为什么此代码在以受限用户身份运行时会崩溃,但在以机器管理员身份运行时却不会?
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance,
DWORD dwReason,
LPVOID lpReserved)
{
hInstance;
m_hInstance=hInstance;
return _AtlModule.DllMain(dwReason, lpReserved);
}
代码在返回时崩溃......我不知道为什么。
我正进入(状态:
The instruction at "0x7c90100b" referenced memory at "0x00000034".
The memory could not be "read".
此外,_AtlModule.DLLMain 看起来像这样:
inline BOOL WINAPI CAtlDllModuleT<T>::DllMain(DWORD dwReason, LPVOID lpReserved) throw()
{
#if !defined(_ATL_NATIVE_INITIALIZATION)
dwReason; lpReserved;
#pragma warning(push)
#pragma warning(disable:4483)
using namespace __identifier("<AtlImplementationDetails>");
#pragma warning(pop)
if (dwReason == DLL_PROCESS_ATTACH)
{
ATLASSERT(DllModuleInitialized == false);
}
return TRUE;
#else
return _DllMain(dwReason, lpReserved);
#endif
}
我们正在导入 ATL DLL,并尝试静态链接……不走运。
更新
使用 ProcMon,我在这里遇到缓冲区溢出:
RegQueryValue HKU\S-1-5-21-448539723-854245398-1957994488-1005\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Cache BUFFER OVERFLOW 长度:144
这是什么意思?