Home » VB.Net

Exception code: 0xc00000fd

We 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?


Following exception is thrown.
Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bcd2b
Faulting module name: PTLicenseMgmnt.dll, version:, time stamp: 0x4c378b13
Exception code: 0xc00000fd
Fault offset: 0x00019bf7
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13

3 Answers Found


Answer 1

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 :)


Answer 2

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?





Answer 3

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.







<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure