I'm getting the infamous 0xC00000FD
(stack overflow) exception from my application when I call into a native DLL. This is being done from a managed C# application on Windows CE 5 (SH4 processor). Compiling the same DLL for Windows XP using the same managed application and everything works fine (no overflow). The routine in the DLL is doing some very complex recursion which is ultimately what is causing the overflow, but again, it works fine on a PC.
It seems like I may just need to adjust the stack size when building the DLL? I believe the default stack size for both CE and XP are both 1MB when using the Visual C compiler (I'm using Visual Studio 2005, if that matters). If they both default to the same size, I'm not sure why one would overflow and the other would not, however. I tried adjusting the stack size with the /F compiler flag and the /STACK linker flag but that didn't seem to do anything. It is also not entirely clear to me that I can specify the stack size in a DLL, but rather the executable must set it. But if that is the case how would I adjust the stack size for my managed process to use when calling into the native DLL?