Changeset 96372 in vbox for trunk/src/VBox/Additions/WINNT/Installer
- Timestamp:
- Aug 20, 2022 2:49:33 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 153189
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/RegCleanup.cpp
r93115 r96372 1 1 /* $Id$ */ 2 2 /** @file 3 * delinvalid - remove "InvalidDisplay" key on NT4 3 * RegCleanup - Remove "InvalidDisplay" and "NewDisplay" keys on NT4, 4 * run via HKLM/.../Windows/CurrentVersion/RunOnce. 5 * 6 * Delete the "InvalidDisplay" key which causes the display applet to be 7 * started on every boot. For some reason this key isn't removed after 8 * setting the proper resolution and even not when * doing a driver reinstall. 9 * Removing it doesn't seem to do any harm. The key is inserted by windows on 10 * first reboot after installing the VBox video driver using the VirtualBox 11 * utility. It's not inserted when using the Display applet for installation. 12 * There seems to be a subtle problem with the VirtualBox util. 4 13 */ 5 14 … … 16 25 */ 17 26 18 /*19 Purpose:20 21 Delete the "InvalidDisplay" key which causes the display22 applet to be started on every boot. For some reason this key23 isn't removed after setting the proper resolution and even not when24 doing a driver reinstall. Removing it doesn't seem to do any harm.25 The key is inserted by windows on first reboot after installing26 the VBox video driver using the VirtualBox utility.27 It's not inserted when using the Display applet for installation.28 There seems to be a subtle problem with the VirtualBox util.29 */30 31 27 32 28 /********************************************************************************************************************************* 33 29 * Header Files * 34 30 *********************************************************************************************************************************/ 35 //#define _UNICODE36 37 31 #include <iprt/win/windows.h> 38 #include <iprt/win/setupapi.h>39 #include <regstr.h>40 #include <DEVGUID.h>41 #include <stdio.h>42 43 #include "tchar.h"44 #include "string.h"45 32 46 33 47 BOOL isNT4(void)34 static BOOL isNT4(void) 48 35 { 49 36 OSVERSIONINFO OSversion; … … 54 41 switch (OSversion.dwPlatformId) 55 42 { 56 case VER_PLATFORM_WIN32s:57 case VER_PLATFORM_WIN32_WINDOWS:58 return FALSE;59 case VER_PLATFORM_WIN32_NT:60 if (OSversion.dwMajorVersion == 4)61 return TRUE;62 elsereturn FALSE;63 default:64 break;43 case VER_PLATFORM_WIN32s: 44 case VER_PLATFORM_WIN32_WINDOWS: 45 return FALSE; 46 case VER_PLATFORM_WIN32_NT: 47 if (OSversion.dwMajorVersion == 4) 48 return TRUE; 49 return FALSE; 50 default: 51 break; 65 52 } 66 53 return FALSE; 67 54 } 68 55 56 69 57 int main() 70 58 { 71 int rc = 0;72 73 59 /* This program is only for installing drivers on NT4 */ 74 60 if (!isNT4()) 75 61 { 76 printf("This program only runs on NT4\n"); 77 return -1; 62 DWORD cbIgn; 63 WriteFile(GetStdHandle(STD_ERROR_HANDLE), RT_STR_TUPLE("This program only runs on NT4\r\n"), &cbIgn, NULL); 64 return 1; 78 65 } 79 66 80 67 /* Delete the "InvalidDisplay" key which causes the display 81 applet to be started on every boot. For some reason this key82 isn't removed after setting the proper resolution and even not when83 doing a driverreinstall. */84 RegDeleteKey (HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\InvalidDisplay"));85 RegDeleteKey (HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\NewDisplay"));68 applet to be started on every boot. For some reason this key 69 isn't removed after setting the proper resolution and even not when 70 doing a driverreinstall. */ 71 RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\InvalidDisplay"); 72 RegDeleteKeyW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\GraphicsDrivers\\NewDisplay"); 86 73 87 return rc;74 return 0; 88 75 } 89 76
Note:
See TracChangeset
for help on using the changeset viewer.