I have an ISAPI DLL originaly written in VC 6. The project compiles, links
and runs without errors when built with VC6. However, when compiled with .Net
2003 the ISAPI extension fails to load - when I navigate to my DLL web page I
get a 500 - Internal Server Error.
Attaching to inetinfo with WinDbg hits the following break point:
ModLoad: 04ca0000 04fec000 \\?\C:\Program Files\HRM Software\HRCharter
Enterprise 9.6\ChartIIS.dll
ModLoad: 10480000 1053c000 C:\WINDOWS\system32\MSVCP71D.dll
(dd0.89c): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=04efe150 ecx=00fceba8 edx=7c90eb94 esi=001a68d0 edi=00000000
eip=7c901230 esp=00fcebd4 ebp=00fcecc8 iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
ntdll!DbgBreakPoint:
7c901230 cc int
kd reveals:
0:021> kd
0110ebd0 00000004
0110ebd4 7c93ad0f ntdll!LdrpRunInitializeRoutines+0x247
0110ebd8 0110f268
0110ebdc 0110f248
0110ebe0 00000000
0110ebe4 00000000
0110ebe8 04f4a000*** WARNING: Unable to verify checksum for
\\?\C:\ChartIIS.dll
ChartIIS!_imp__DeregisterEventSource
0110ebec 00000000
0110ebf0 7c91c94d ntdll!LdrFindResourceDirectory_U+0x18
0110ebf4 7ffa4000
0110ebf8 001a92b8
0110ebfc 7c91d6d8 ntdll!`string'+0x7c
0110ec00 ffffffff
0110ec04 7c91d6d2 ntdll!LdrpSnapIAT+0x2b1
0110ec08 7c91d9cb ntdll!LdrpHandleOneOldFormatImportDescriptor+0xcc
0110ec0c 001a2a58
0110ec10 001a92b8
0110ec14 04f91918 ChartIIS!_IMPORT_DESCRIPTOR_NETAPI32
0110ec18 00000000
0110ec1c 00000001
The only clue is the DeregisterEventSource imported symbol: There is only
one place where this gets called. I've stuck a break point on and around that
line of code, and either the debugger is confused or that bit of code is not
getting called.
What is interesting is that ChartIIS.DLL *is* successfully loaded before
that point, and if I place a break point in my CHttpServer derived class
constructor, the class gets constructed correctly and everything looks OK.
After constructing the class, however, none of the class members get called
by IIS.
LdrpRunInitializeRoutines is the last bit of kernel code ran before DLL code
is executed, correct? I've stuck a break point on there and as far as I can
tell (it's by no means easy to work out what's going on!), its ChartIIS.DLL
that's being loaded. This makes me think that its a problem with the DLL
rather than a ISS/ISAPI specific problem.
Any suggestions on how to track down the probem(s) would be greatly
appreciated!
TIA,
--
Martin