Changeset 96387 in vbox
- Timestamp:
- Aug 20, 2022 11:06:28 PM (2 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Installer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk
r96038 r96387 54 54 55 55 PROGRAMS += RegCleanup 56 RegCleanup_TEMPLATE = VBoxGuestR3Exe 57 RegCleanup_DEFS = _WIN32_WINNT=0x0400 UNICODE 58 RegCleanup_SOURCES = \ 56 RegCleanup_TEMPLATE := VBoxGuestR3Exe 57 RegCleanup_BLD_TRG_ARCH := x86 58 RegCleanup_DEFS := _WIN32_WINNT=0x0400 59 RegCleanup_SOURCES := \ 59 60 RegCleanup.cpp \ 60 61 RegCleanup.rc … … 377 378 378 379 include $(FILE_KBUILD_SUB_FOOTER) 380 -
trunk/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp
r96375 r96387 33 33 34 34 35 static BOOL isNT4(void)35 static bool IsNt4(void) 36 36 { 37 OSVERSIONINFO OSversion; 38 39 OSversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); 40 ::GetVersionEx(&OSversion); 41 42 switch (OSversion.dwPlatformId) 43 { 44 case VER_PLATFORM_WIN32s: 45 case VER_PLATFORM_WIN32_WINDOWS: 46 return FALSE; 47 case VER_PLATFORM_WIN32_NT: 48 if (OSversion.dwMajorVersion == 4) 49 return TRUE; 50 return FALSE; 51 default: 52 break; 53 } 54 return FALSE; 37 OSVERSIONINFOW VerInfo = { sizeof(VerInfo), 0 }; 38 GetVersionExW(&VerInfo); 39 return VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT 40 && VerInfo.dwMajorVersion == 4; 55 41 } 56 42 … … 58 44 int main() 59 45 { 60 /* This program is only for installing drivers on NT4 */ 61 if (!isNT4()) 46 if (!IsNt4()) 62 47 { 63 48 DWORD cbIgn; 64 49 WriteFile(GetStdHandle(STD_ERROR_HANDLE), RT_STR_TUPLE("This program only runs on NT4\r\n"), &cbIgn, NULL); 65 return 1;50 return RTEXITCODE_FAILURE; 66 51 } 67 52 … … 72 57 RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\InvalidDisplay"); 73 58 RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\NewDisplay"); 74 75 return 0; 59 return RTEXITCODE_SUCCESS; 76 60 } 77 61
Note:
See TracChangeset
for help on using the changeset viewer.