Skip to content

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: 0000000001230000 000000000126a000 image0000000001230000 ModLoad: 0000000077940000 0000000077ae9000 ntdll.dll ModLoad: 0000000077b20000 0000000077ca0000 ntdll32.dll ModLoad: 0000000075600000 000000007563f000 C:\Windows\SYSTEM32\wow64.dll ModLoad: 00000000755a0000 00000000755fc000 C:\Windows\SYSTEM32\wow64win.dll ModLoad: 0000000075590000 0000000075598000 C:\Windows\SYSTEM32\wow64cpu.dll (534.b8c): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00000000779ecb60 cc int 3 0:000> sxe 0xC000007B 0:000> g ModLoad: 0000000077720000 000000007783f000 WOW64_IMAGE_SECTION ModLoad: 0000000076270000 0000000076380000 WOW64_IMAGE_SECTION ModLoad: 0000000077720000 000000007783f000 NOT_AN_IMAGE ModLoad: 0000000077840000 000000007793a000 NOT_AN_IMAGE ModLoad: 0000000076270000 0000000076380000 C:\Windows\syswow64\kernel32.dll ModLoad: 00000000772e0000 0000000077326000 C:\Windows\syswow64\KERNELBASE.dll ModLoad: 00000000754c0000 0000000075504000 C:\Program Files\Green\libcurl.dll ModLoad: 0000000075c90000 0000000075cc5000 C:\Windows\syswow64\WS2_32.dll ModLoad: 0000000075e80000 0000000075f2c000 C:\Windows\syswow64\msvcrt.dll ModLoad: 00000000758c0000 00000000759b0000 C:\Windows\syswow64\RPCRT4.dll ModLoad: 0000000075680000 00000000756e0000 C:\Windows\syswow64\SspiCli.dll ModLoad: 0000000075670000 000000007567c000 C:\Windows\syswow64\CRYPTBASE.dll ModLoad: 00000000773c0000 00000000773d9000 C:\Windows\SysWOW64\sechost.dll ModLoad: 0000000075800000 0000000075806000 C:\Windows\syswow64\NSI.dll ModLoad: 0000000075d70000 0000000075db5000 C:\Windows\syswow64\WLDAP32.dll ModLoad: 0000000075390000 00000000754b1000 C:\Program Files\Green\LIBEAY32.dll ModLoad: 0000000077540000 00000000775d0000 C:\Windows\syswow64\GDI32.dll ModLoad: 00000000775d0000 00000000776d0000 C:\Windows\syswow64\USER32.dll ModLoad: 0000000075cd0000 0000000075d70000 C:\Windows\syswow64\ADVAPI32.dll ModLoad: 0000000077af0000 0000000077afa000 C:\Windows\syswow64\LPK.dll ModLoad: 00000000761c0000 000000007625d000 C:\Windows\syswow64\USP10.dll ModLoad: 00000000752b0000 0000000075382000 C:\Program Files\Green\MSVCR100.dll ModLoad: 00000000751d0000 00000000752a2000 C:\Program Files\Green\MSVCR100.dll ModLoad: 00000000752b0000 0000000075382000 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。