Exception code: 0xc00000fd
-
Friday, July 09, 2010 9:07 PMScenarioWe have site in ASP.NET (C#) which gives call to Win32 dll (with MFC used - Native code). It works in debug mode. But when i used the same dll with published site, i get following exception.
Used P/Invoke to call functions from Win32 dll
Everything works fine if buffer length is kept low like -TCHAR users[BUFSIZE] = {'0'}; where BUFSIZE = 9999
If we increase BUFSIZE = 99999, w3wp.exe crashes hard.
Any clues how can this be fixed?
Thanks,Sachin
Following exception is thrown.Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd2bFaulting module name: PTLicenseMgmnt.dll, version: 1.0.0.0, time stamp: 0x4c378b13Exception code: 0xc00000fdFault offset: 0x00019bf7Faulting process id: 0x%9Faulting application start time: 0x%10Faulting application path: %11Faulting module path: %12Report Id: %13
All Replies
-
Monday, July 12, 2010 6:39 PM
I'm guessing you are defining BUFSIZE as an Int32? If the win32.dll expects an integer, than it's actually expecting a 16-bit integer, and not a 32-bit integer.
When BUFSIZE = 9999, this value is less than the maximum size of a 16-bit value of 32,767.
When BUFSIZE = 99999, this value is greater than the maximum size of a 16-bit value of 32,767.
EDIT: After re-reading where you using BUFSIZE, I see that it's for defining an array. I'm thinking that the maximum size the P/Invoke method will accept for that array is an array size that does NOT exceed the 16-bit value, so Int16.
Hope this helps :)
-
Monday, July 12, 2010 7:07 PM
The code works for both 9999 and 99999 in debug mode.
Works with C# .Net dll
Works with ASP.NET.
Problem occurs with release mode and published site.
Any clues?
Thanks,
Sachin
-
Tuesday, July 13, 2010 3:08 PM
With some code changes I am able to pass on stringbuilder with buffer of 99999 to win 32 dll.
Actual issue occurs if i have that much buffer inside function using registry functions
I am sure I am missing something .... do not what is that.
Thanks,
Sachin

