On 2014-08-12 19:34, Bernhard Reiter wrote:
But I've substituted a PULONG here for an unsigned long * -- is that wrong? Trying an unsigned int* instead gives a compiler warning...
The long type on x64 Windows is 32 bit, on x64 Linux (and most other platforms) it is 64 bit. To deal with that difference, Wine defines LONG to be int (and ULONG to be unsigned int etc), which is 32 bit on all the relevant platforms.
So yes, substituting PULONG for unsigned long * is wrong, it needs to be ULONG *, DWORD *, or similar. The compiler warning that you get from the correct prototype would be because you're also using a (lowercase) long when calling the function -- this also needs to be an uppercase LONG.
Including dbghelp.h along with imagehlp.h unfortunately gives a host of definition collisions. From MSDN I know that some of dbghelp's functions are mirrored in imagehlp, but apparently something's wrong here in Wine...
If this works in PSDK, then a fix for Wine's headers is probably preferable -- but I have no idea how intrusive that would be, so a workaround like this could be appropriate for the time being.
Most functions I know simply do ((PCSTR)(DWORD_PTR)ordinal) to represent ordinals (e.g. GetProcAddress). That's just a guess though, I know nothing about this function.
I don't know that much either about this stuff -- documentation is rather scarce. So the only way to find out is more tests, isn't it?
That sounds right ;) (although a step-by-step approach should be okay, so I don't think you have to implement this right away)