VerifyVersionInfo() fails with error 1150

  • Thread starter Thread starter ananda vardhana
  • Start date Start date
A

ananda vardhana

Guest
Hello,

The following program is directly from MSFT sample program and it fails ironically with error code 1150 - The specified program requires a newer version of Windows. :) . All I need is a way to get or verify the build number. I dont want to use WMI calls want to do it via API's only. I get the info from the WMI calls and plug it in here and it fails. Any help advice please

thanks

ananda





void main()
{
OSVERSIONINFOEX osvi;
DWORDLONG dwlConditionMask = 0;
BOOL ret;
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));

osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

VER_SET_CONDITION(dwlConditionMask, VER_MAJORVERSION, VER_EQUAL);
VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, VER_EQUAL);
VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_EQUAL);


osvi.dwBuildNumber = 17763;
osvi.dwMajorVersion = 10;
osvi.dwMinorVersion = 0;

ret = VerifyVersionInfo(&osvi, VER_MAJORVERSION | VER_MINORVERSION, dwlConditionMask);
if (ret == FALSE) {
printf("Err: %d\n", GetLastError());
}
}

Continue reading...
 
Back
Top