WinStructs now has a new friend!
AHK-SizeOf-Checker
(Requires compiler from Visual Studio)
This library can create and compile C code in order to perform a check that the size of a structure created with _Struct matches the size of the struct in actual C code
ie it checks whether sizeof(SOME_STRUCT) in AHK (ie using the sizeof command that comes with _Struct) equals sizeof(SOME_STRUCT) in a compiled C++ executable (ie using the sizeof() macro in C++)
This way, at least we have some way of vaguely validating that the Struct definitions in WinStructs are correct (And potentially also exposing bugs in _Struct)
So, for example, performing a check on RAWINPUTDEVICE would generate the following C code, compile and execute it:
Code: Select all
#include <iostream>
#include <windows.h>
int main()
{
std::cout << sizeof(RAWINPUTDEVICE) << std::endl;
return 0;
}
Whereas to check HIDP_BUTTON_CAPS, you need to also tell it that HidUsage.h and Hidpi.h are required, which would generate the following code:
Code: Select all
#include <iostream>
#include <windows.h>
#include <HidUsage.h>
#include <Hidpi.h>
int main()
{
std::cout << sizeof(HIDP_BUTTON_CAPS) << std::endl;
return 0;
}