<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - Extensibility</title><link>http://forums.iis.net/1042.aspx</link><description>Problems developing a IIS 7 module using Native or Managed code - come here for help from the experts.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1887113.aspx</link><pubDate>Tue, 09 Dec 2008 22:28:31 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1887113</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1887113.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1887113</wfw:commentRss><description>&lt;p&gt;Use .symfix to point the debugger to microsoft&amp;#39;s public symbol server.&lt;/p&gt;
&lt;p&gt;You probably need to change CharSet to CharSet.Unicode and add a [MarshalAs(UnmanagedType.LPWStr)] to the returned string - CLR is treating it like BSTR and using CoTaksMemFree to free it, I don&amp;#39;t think your dll allocated it with CoTaskMemAlloc.&lt;/p&gt;</description></item><item><title>Re: IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1887111.aspx</link><pubDate>Tue, 09 Dec 2008 22:12:03 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1887111</guid><dc:creator>DadKind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1887111.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1887111</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;OK. I&amp;#39;ve turned on PageHeap using GlobalFlags. But still it doesn&amp;#39;t seem to show much. Here is a more detailed dump of data. I&amp;#39;m a little concerned that WinDbg does not seem to find the Symbol file for some of the DLLs.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here&amp;#39;s my stub definition:&lt;br /&gt;[DllImport(&amp;quot;rsynclib.dll&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;public static extern string DecryptBuffer([In] byte[] pEncrypted, [In] int dwBufLen, [In, Out] byte[]&amp;nbsp; pClear);&lt;br /&gt;&lt;/p&gt;&lt;p&gt;And here&amp;#39;s the signature in the DLL source: &lt;br /&gt;PWCHAR CCryptString::DecryptBuffer( IN CONST PBYTE pEncrypted, IN CONST DWORD dwBufLen, OUT PBYTE pClear )&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Again, this all works as expected in the IDE, but not when run outside the IDE in the &amp;quot;production&amp;quot; mode.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks for your help thus far!&lt;/p&gt;&lt;p&gt;-tomas&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&amp;nbsp;---- WINDBG OUTPUT ----&lt;br /&gt;&lt;/p&gt;

&lt;div style="font-family:courier;"&gt;
&lt;pre&gt;ModLoad: 66f00000 66f40000   C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Web.RegularE#\854f0d4c93caa7b6b958ba325aa59f07\System.Web.RegularExpressions.ni.dll
ModLoad: 7ade0000 7af7c000   C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Drawing\b07363ad6e831292e585523a54df6879\System.Drawing.ni.dll
ModLoad: 752b0000 752f5000   C:\Windows\system32\bcrypt.dll
(1458.15a4): Break instruction exception - code 80000003 (first chance)
eax=7ffda000 ebx=00000000 ecx=00000000 edx=7734d094 esi=00000000 edi=00000000
eip=77307dfe esp=0f6ffee0 ebp=0f6fff0c iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\ntdll.dll - 
ntdll!DbgBreakPoint:
77307dfe cc              int     3
0:023&amp;gt; g
ModLoad: 0f560000 0f5b3000   C:\development\RsyncWebTest\bin\rsynclib.dll
ModLoad: 00560000 00587000   C:\development\RsyncWebTest\bin\librsync.dll
ModLoad: 74230000 74269000   C:\Windows\system32\OLEACC.dll
ModLoad: 72470000 724b2000   C:\Windows\system32\WINSPOOL.DRV
ModLoad: 76ff0000 77063000   C:\Windows\system32\COMDLG32.dll
ModLoad: 73940000 739c5000   C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6001.18000_none_886786f450a74a05\COMCTL32.dll
Critical error detected c0000374
(1458.1134): Break instruction exception - code 80000003 (first chance)
eax=00000000 ebx=00000000 ecx=772e385a edx=0f4de855 esi=00310000 edi=0f594140
eip=77307dfe esp=0f4deaa4 ebp=0f4deb20 iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
ntdll!DbgBreakPoint:
77307dfe cc              int     3
0:021&amp;gt; K
ChildEBP RetAddr  
WARNING: Stack unwind information not available. Following frames may be wrong.
0f4deb20 77370d68 ntdll!DbgBreakPoint
0f4deb30 77370e56 ntdll!RtlpNtMakeTemporaryKey+0x2fc3
0f4deb64 77330531 ntdll!RtlpNtMakeTemporaryKey+0x30b1
0f4deb90 7710c56f ntdll!RtlTimeToElapsedTimeFields+0x19b6
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\ole32.dll - 
0f4deba4 768fdc2c kernel32!HeapFree+0x14
0f4debb8 768fdc53 ole32!CoTaskMemAlloc+0x17c
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll - 
0f4debc8 7a138820 ole32!CoTaskMemFree+0x13
0f4debd8 79ead0ce mscorwks!CorLaunchApplication+0x19c06
0f4dee14 79eb068c mscorwks!GetMetaDataInternalInterface+0x1701e
0f4dee94 79eb03ed mscorwks!GetMetaDataInternalInterface+0x1a5dc
*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Web\8c1af99f3ddcfeb589e13bed6b9acf36\System.Web.ni.dll
*** ERROR: Module load completed but symbols could not be loaded for C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Web\8c1af99f3ddcfeb589e13bed6b9acf36\System.Web.ni.dll
0f4def7c 6619006e mscorwks!GetMetaDataInternalInterface+0x1a33d
0f4def94 6619025c System_Web_ni+0x27006e
00000000 00000000 System_Web_ni+0x27025c
&lt;/pre&gt;
&lt;/div&gt;</description></item><item><title>Re: IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1887102.aspx</link><pubDate>Tue, 09 Dec 2008 21:11:17 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1887102</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1887102.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1887102</wfw:commentRss><description>&lt;p&gt;I would suggest turning on pageheap (using either app-verifier or gflags) on the process and re-reproing - you should then catch the problem at the point of corruption.&lt;/p&gt;
&lt;p&gt;You have not pasted the stack trace below, but it does seem to indicate bad definition of the interop stub method.&lt;/p&gt;</description></item><item><title>Re: IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1887066.aspx</link><pubDate>Tue, 09 Dec 2008 18:10:24 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1887066</guid><dc:creator>DadKind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1887066.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1887066</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Anil,&lt;/p&gt;
&lt;p&gt;I got this from a Windb session, but I need some help interpreting the results. Is &amp;quot;COMCTL32.DLL&amp;quot; the offending DLL? What should be the next step?&lt;/p&gt;&lt;p&gt;Why does this run inside the debugger but not in &amp;quot;normal&amp;quot; fashion? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Your help is much appreciated.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-tomas&lt;/p&gt;&lt;p&gt;-----WINDBG Session --------------------- &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;div style="font-family:Serif;"&gt;
&lt;p&gt;0:023&amp;gt; g&lt;br /&gt;ModLoad: 0f680000 0f6d3000&amp;nbsp;&amp;nbsp; C:\development\RsyncWebTest\bin\rsynclib.dll&lt;br /&gt;ModLoad: 01720000 01747000&amp;nbsp;&amp;nbsp; C:\development\RsyncWebTest\bin\librsync.dll&lt;br /&gt;ModLoad: 74230000 74269000&amp;nbsp;&amp;nbsp; C:\Windows\system32\OLEACC.dll&lt;br /&gt;ModLoad: 72470000 724b2000&amp;nbsp;&amp;nbsp; C:\Windows\system32\WINSPOOL.DRV&lt;br /&gt;ModLoad: 76ff0000 77063000&amp;nbsp;&amp;nbsp; C:\Windows\system32\COMDLG32.dll&lt;br /&gt;ModLoad: 73940000 739c5000&amp;nbsp;&amp;nbsp; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.6001.18000_none_886786f450a74a05\COMCTL32.dll&lt;br /&gt;Critical error detected c0000374&lt;br /&gt;(ba8.1c10): Break instruction exception - code 80000003 (first chance)&lt;br /&gt;eax=00000000 ebx=00000000 ecx=772e385a edx=0f52e8c5 esi=001d0000 edi=0f6b4140&lt;br /&gt;eip=77307dfe esp=0f52eb14 ebp=0f52eb90 iopl=0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nv up ei pl nz na pe nc&lt;br /&gt;cs=001b&amp;nbsp; ss=0023&amp;nbsp; ds=0023&amp;nbsp; es=0023&amp;nbsp; fs=003b&amp;nbsp; gs=0000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; efl=00000206&lt;br /&gt;ntdll!DbgBreakPoint:&lt;br /&gt;77307dfe cc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description></item><item><title>Re: IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1886676.aspx</link><pubDate>Wed, 03 Dec 2008 21:44:13 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1886676</guid><dc:creator>anilr</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1886676.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1886676</wfw:commentRss><description>&lt;p&gt;The exception code 0xc0000374 indicates a heap corruption - to determine the solution, you would need to debug the crash in a debugger to figure out who is corrupting the heap.&lt;/p&gt;</description></item><item><title>IIS7 NTDLL.DLL Errors</title><link>http://forums.iis.net/thread/1886558.aspx</link><pubDate>Tue, 02 Dec 2008 22:21:53 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1886558</guid><dc:creator>DadKind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1886558.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1042&amp;PostID=1886558</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello All,&lt;/p&gt;

&lt;p&gt;I&amp;#39;m porting an old web app to Server2008/IIS7 (it was originally written in VS2005 and runs on XP Pro and Windows Server 2003).&lt;/p&gt;

&lt;p&gt;&amp;nbsp;This app imports from functions from an unmanaged DLL. &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;When I was first running my app I was getting a bunch of &amp;quot;Unable to load DLL&amp;quot; errors. I then figured out that I needed to copy the unmanaged DLL to the Temporary ASP.NET folder and the DLL is now found (but this is another thread!) but the application runs.&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Outside the IDE, whenever my app calls the unmanaged code (using DllImport) my app crashes painfully and I see the following in the Application Log:&lt;/p&gt;

&lt;p&gt;
Faulting application w3wp.exe, version 7.0.6001.18000, time stamp 0x47919413, faulting module ntdll.dll, version 6.0.6001.18000, time stamp 0x4791a7a6, exception code 0xc0000374, fault offset 0x000b015d, process id 0x142c, application start time 0x01c954c955ce8d65. &lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ve seen other posts here and elsewhere regarding this, but I&amp;#39;ve not seen any real solutuions or explanations as to the actual cause of the problem.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Can anyone shed some light on this?&amp;nbsp;&lt;/p&gt;&lt;p&gt;What is the actual problem?&lt;/p&gt;&lt;p&gt;What is the solution?&lt;/p&gt;&lt;p&gt;&amp;nbsp;TIA&lt;br /&gt;-tomas&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>