I get the shameful exception 0xC00000FD (stack overflow) from my application when called in my native DLL. This is run from a C # managed application in Windows CE 5 (SH4 processor). Compiling the same DLL for Windows XP using the same managed application, and everything works fine (no overflow). The procedure in the DLL makes a very complex recursion that ultimately causes an overflow, but again, it works fine on a PC.
It seems I just need to adjust the stack size when creating the DLL? I believe that the default stack size for CE and XP is 1 MB when using the Visual C compiler (I use Visual Studio 2005, if that matters). If they both default to the same size, I'm not sure why one of them is overflowing and the other is not. I tried setting the stack size with the compiler flag / F and the linker flag / STACK, but that didn't seem to do anything. It is also not entirely clear to me that I can specify the stack size in the DLL, but the executable should install it. But if that is the case, then how would I configure the stack size for my managed process to use when calling the native DLL?
Jason source share