vs2008程序再win7上运行出现无法解释的问题

weixin_38050048 2017-02-27 04:05:24
      公司最近将工作的电脑系统从xp换成了win7,新开发了一个程序,出现了很诡异的情况,程序不管是编译运行还是独立运行,偶尔会出现启动就出错。调试发现在调用_DllMainCRTStartup中调用__security_init_cookie出现错误。在代码没修改的情况下重新编译一下又正常了,过段时间又这样。有时还不需要编译,只需要把执行文件拷贝到其他目录也能运行,真是无语。
void __cdecl __security_init_cookie(void)
{
    UINT_PTR cookie;
    FT systime={0};
    LARGE_INTEGER perfctr;

    /*
     * Do nothing if the global cookie has already been initialized.  On x86,
     * reinitialize the cookie if it has been previously initialized to a
     * value with the high word 0x0000.  Some versions of Windows will init
     * the cookie in the loader, but using an older mechanism which forced the
     * high word to zero.
     */

    if (__security_cookie != DEFAULT_SECURITY_COOKIE
#if defined (_X86_)
        && (__security_cookie & 0xFFFF0000) != 0  //调试错误断点就再这里,高手们是啥原因
#endif  /* defined (_X86_) */


       )
    {
        __security_cookie_complement = ~__security_cookie;
        return;
    }
}
...全文
29 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复

476

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧