6.52 64-bits Win7上执行32-bits应用程序碰上0xC000007B错误
https://scz.617.cn/windows/201204051418.txt
Q:
在64-bits Win7上用Visual C++ 2010 Express编译了一个32-bits的curl.exe,其用 到了msvcr100.dll。为了使用上的方便,我将c:\windows\system32\msvcr100.dll复 制到curl.exe所在目录。
将这份绿色版的curl.exe复制到另一台64-bits Win7上执行,得到错误信息:
应用程序无法正常启动(0xc000007b)。请单击"确定"关闭应用程序。
cdb.exe -snul -hd -o curl.exe ModLoad: 00000000
01230000 00000000
0126a000 image0000000001230000 ModLoad: 00000000
77940000 0000000077ae9000 ntdll.dll ModLoad: 00000000
77b20000 0000000077ca0000 ntdll32.dll ModLoad: 00000000
75600000 000000007563f000 C:\Windows\SYSTEM32\wow64.dll ModLoad: 00000000
755a0000 00000000755fc000 C:\Windows\SYSTEM32\wow64win.dll ModLoad: 00000000
75590000 0000000075598000 C:\Windows\SYSTEM32\wow64cpu.dll (534.b8c): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00000000
779ecb60 cc int 3 0:000> sxe 0xC000007B 0:000> g ModLoad: 0000000077720000 00000000
7783f000 WOW64_IMAGE_SECTION ModLoad: 0000000076270000 00000000
76380000 WOW64_IMAGE_SECTION ModLoad: 0000000077720000 00000000
7783f000 NOT_AN_IMAGE ModLoad: 0000000077840000 00000000
7793a000 NOT_AN_IMAGE ModLoad: 0000000076270000 00000000
76380000 C:\Windows\syswow64\kernel32.dll ModLoad: 00000000772e0000 00000000
77326000 C:\Windows\syswow64\KERNELBASE.dll ModLoad: 00000000754c0000 00000000
75504000 C:\Program Files\Green\libcurl.dll ModLoad: 0000000075c90000 00000000
75cc5000 C:\Windows\syswow64\WS2_32.dll ModLoad: 0000000075e80000 00000000
75f2c000 C:\Windows\syswow64\msvcrt.dll ModLoad: 00000000758c0000 00000000
759b0000 C:\Windows\syswow64\RPCRT4.dll ModLoad: 0000000075680000 00000000
756e0000 C:\Windows\syswow64\SspiCli.dll ModLoad: 0000000075670000 00000000
7567c000 C:\Windows\syswow64\CRYPTBASE.dll ModLoad: 00000000773c0000 00000000
773d9000 C:\Windows\SysWOW64\sechost.dll ModLoad: 0000000075800000 00000000
75806000 C:\Windows\syswow64\NSI.dll ModLoad: 0000000075d70000 00000000
75db5000 C:\Windows\syswow64\WLDAP32.dll ModLoad: 0000000075390000 00000000
754b1000 C:\Program Files\Green\LIBEAY32.dll ModLoad: 0000000077540000 00000000
775d0000 C:\Windows\syswow64\GDI32.dll ModLoad: 00000000775d0000 00000000
776d0000 C:\Windows\syswow64\USER32.dll ModLoad: 0000000075cd0000 00000000
75d70000 C:\Windows\syswow64\ADVAPI32.dll ModLoad: 0000000077af0000 00000000
77afa000 C:\Windows\syswow64\LPK.dll ModLoad: 00000000761c0000 00000000
7625d000 C:\Windows\syswow64\USP10.dll ModLoad: 00000000752b0000 00000000
75382000 C:\Program Files\Green\MSVCR100.dll ModLoad: 00000000751d0000 00000000
752a2000 C:\Program Files\Green\MSVCR100.dll ModLoad: 00000000752b0000 00000000
75382000 C:\Program Files\Green\MSVCR100.dll ntdll!NtTerminateProcess+0xa: 00000000`779915da c3 ret 0:000>
用cdb.exe进行调试,未能捕捉0xC000007B异常,仍然直接得到前述错误信息。
A:
0xC000007B错误通常是因为32-bits应用程序试图加载64-bits动态链接库,或者反过 来。用depends.exe查看curl.exe,发现其试图加载64-bits的msvcr100.dll。
应该从C:\Windows\SysWOW64\复制32-bits的msvcr100.dll。