How do you call GetVersionEx (Windows)?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Aug 22 12:36:50 PDT 2010


There's an example of a module constructor in TDPL. I don't think it's supossed to compile as it is, but I wanted to try it out anyway.

I need a way to call the windows c function GetVersionEx. A grep through the source files doesn't find it (except in the DMD cpp backend which it internally uses), but there's one GetVersion function in core\sys\windows\windows.d. That seems to work and returns a uint representation, but then I have to do bitmasking to get all the info out of it. Yikes!

The TDPL example does actually use GetVersionEx() and calls it with a "OSVERSIONINFOEX" structure argument, and it's all nicely documented on MSDN. But I've no idea if I can call it from D. Anyone doing Windows programming in D? :)




More information about the Digitalmars-d-learn mailing list