I have a function:
VOID GetOSVersion(PDWORD major, PDWORD minor, PDWORD build)
{
OSVERSIONINFO osver;
ZeroMemory(&osver, sizeof(OSVERSIONINFO));
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osver);
if(major)
*major = osver.dwMajorVersion;
if(minor)
*minor = osver.dwMinorVersion;
if(build)
*build = osver.dwBuildNumber;
}
And I wanted to invoke it like this:
PDWORD major;
PDWORD minor;
PDWORD build;
GetOSVersion(major, minor, build);
I get an error for all the three arguments:
uninitialized local variable
In my head it went like: I declare major, minor, build, and they get filled in the function. Space is already allocated for them during the first three lines of the invoking code.
I am surely missing something here. Could somebody please explain this for me?