@@ -101,57 +101,25 @@ InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
101101 if (hDC != NULL ) ReleaseDC (hwndDlg , hDC );
102102}
103103
104-
104+ /**
105+ * @brief Check whether we are running in MiniNT mode (e.g. live medium).
106+ **/
105107BOOL
106- IsLiveCD (VOID )
108+ IsMiniNT (VOID )
107109{
108- HKEY ControlKey = NULL ;
109- LPWSTR SystemStartOptions = NULL ;
110- LPWSTR CurrentOption , NextOption ; /* Pointers into SystemStartOptions */
110+ HKEY hKey ;
111111 LONG rc ;
112- BOOL ret = FALSE;
113112
113+ /* Check for the presence of the "MiniNT" registry key */
114114 rc = RegOpenKeyExW (HKEY_LOCAL_MACHINE ,
115- REGSTR_PATH_CURRENT_CONTROL_SET ,
115+ L"SYSTEM\\CurrentControlSet\\Control\\MiniNT" ,
116116 0 ,
117117 KEY_QUERY_VALUE ,
118- & ControlKey );
119- if (rc != ERROR_SUCCESS )
120- {
121- WARN ("RegOpenKeyEx() failed with error %lu\n" , rc );
122- goto cleanup ;
123- }
124-
125- rc = ReadRegSzKey (ControlKey , L"SystemStartOptions" , & SystemStartOptions );
126- if (rc != ERROR_SUCCESS )
127- {
128- WARN ("ReadRegSzKey() failed with error %lu\n" , rc );
129- goto cleanup ;
130- }
131-
132- /* Check for CONSOLE switch in SystemStartOptions */
133- CurrentOption = SystemStartOptions ;
134- while (CurrentOption )
135- {
136- NextOption = wcschr (CurrentOption , L' ' );
137- if (NextOption )
138- * NextOption = L'\0' ;
139- if (_wcsicmp (CurrentOption , L"MININT" ) == 0 )
140- {
141- TRACE ("Found 'MININT' boot option\n" );
142- ret = TRUE;
143- goto cleanup ;
144- }
145- CurrentOption = NextOption ? NextOption + 1 : NULL ;
146- }
147-
148- cleanup :
149- if (ControlKey != NULL )
150- RegCloseKey (ControlKey );
151- HeapFree (GetProcessHeap (), 0 , SystemStartOptions );
118+ & hKey );
119+ if (rc == ERROR_SUCCESS )
120+ RegCloseKey (hKey );
152121
153- TRACE ("IsLiveCD() returning %u\n" , ret );
154- return ret ;
122+ return (rc == ERROR_SUCCESS );
155123}
156124
157125
0 commit comments