Compiling the Packet_dll sources in debug-mode and with the switch -RTCs and using them in a simple program, I get a crash as show here:
Seems the definition of bool is to blame. Looking at the CPP output, I see
typedef _Bool __crt_bool;
...
_Bool IsWow64()
{
_Bool b = 0;
if (Is64BitCode())
{
return 0;
}
if (IsWow64Process(GetCurrentProcess(), &b) == 0)
{
return 0;
}
I had to build using WIN32COM_CPP with the latest WindowsKit. Bottom line seems to be, sizeof(bool) != sizeof(BOOL). I suggest you rewrite that since IsWow64Process() clearly should take a PBOOL.
-RTCs is Stack Frame runtime checking, a real handy switch in MSVC.
BTW, here is the stack backtrace:
enum_adapters!failwithmessage(void * retaddr = 0x012de50e, int crttype = 0n1, int errnum = 0n2, char * msg = 0x00b9f910 "Stack around the variable 'b' was corrupted.")+0x1ec
enum_adapters!_RTC_StackFailure(void * retaddr = 0x012de50e, char * varname = 0x00000002 "--- memory read error at address 0x00000002 ---")+0xee
enum_adapters!_RTC_CheckStackVars(void * frame = 0x00b9fd58, struct _RTC_framedesc * v = 0x012de520)+0x46
enum_adapters!IsWow64(void)+0x6e
...
Compiling the
Packet_dll
sources in debug-mode and with the switch-RTCs
and using them in a simple program, I get a crash as show here:Seems the definition of
bool
is to blame. Looking at the CPP output, I seeI had to build using
WIN32COM_CPP
with the latest WindowsKit. Bottom line seems to be,sizeof(bool) != sizeof(BOOL)
. I suggest you rewrite that sinceIsWow64Process()
clearly should take aPBOOL
.-RTCs
is Stack Frame runtime checking, a real handy switch in MSVC.BTW, here is the stack backtrace: