ReactOS  0.4.15-dev-1171-gab82533
install.c File Reference
#include "precomp.h"
#include <io.h>
#include <wincon.h>
#include <winnls.h>
#include <winsvc.h>
#include <userenv.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <shobjidl.h>
#include <rpcproxy.h>
#include <ndk/cmfuncs.h>
#include <debug.h>
Include dependency graph for install.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define NDEBUG
 

Functions

DWORD WINAPI CMP_WaitNoPendingInstallEvents (DWORD dwTimeout)
 
DWORD WINAPI SetupStartService (LPCWSTR lpServiceName, BOOL bWait)
 
static VOID FatalError (char *pszFmt,...)
 
static HRESULT CreateShellLink (LPCWSTR pszLinkPath, LPCWSTR pszCmd, LPCWSTR pszArg, LPCWSTR pszDir, LPCWSTR pszIconPath, INT iIconNr, LPCWSTR pszComment)
 
static BOOL CreateShortcut (LPCWSTR pszFolder, LPCWSTR pszName, LPCWSTR pszCommand, LPCWSTR pszDescription, INT iIconNr, LPCWSTR pszWorkingDir)
 
static BOOL CreateShortcutsFromSection (HINF hinf, LPWSTR pszSection, LPCWSTR pszFolder)
 
static BOOL CreateShortcuts (HINF hinf, LPCWSTR szSection)
 
static VOID CreateTempDir (IN LPCWSTR VarName)
 
static BOOL InstallSysSetupInfDevices (VOID)
 
static BOOL InstallSysSetupInfComponents (VOID)
 
BOOL RegisterTypeLibraries (HINF hinf, LPCWSTR szSection)
 
static BOOL EnableUserModePnpManager (VOID)
 
static INT_PTR CALLBACK StatusMessageWindowProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
 
static DWORD WINAPI ShowStatusMessageThread (IN LPVOID lpParameter)
 
static LONG ReadRegSzKey (IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
 
static BOOL IsConsoleBoot (VOID)
 
static BOOL CommonInstall (VOID)
 
static DWORD InstallLiveCD (VOID)
 
static BOOL SetSetupType (DWORD dwSetupType)
 
static DWORD CALLBACK HotkeyThread (LPVOID Parameter)
 
static BOOL InitializeProgramFilesDir (VOID)
 
static VOID InitializeDefaultUserLocale (VOID)
 
static DWORD SaveDefaultUserHive (VOID)
 
static DWORD InstallReactOS (VOID)
 
INT WINAPI InstallWindowsNt (INT argc, WCHAR **argv)
 
DWORD WINAPI SetupChangeFontSize (IN HANDLE hWnd, IN LPCWSTR lpszFontSize)
 
DWORD WINAPI SetupChangeLocaleEx (HWND hWnd, LCID Lcid, LPCWSTR lpSrcRootPath, char Unknown, DWORD dwUnused1, DWORD dwUnused2)
 
DWORD WINAPI SetupChangeLocale (HWND hWnd, LCID Lcid)
 

Variables

HINF hSysSetupInf = INVALID_HANDLE_VALUE
 
ADMIN_INFO AdminInfo
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 13 of file install.c.

◆ NDEBUG

#define NDEBUG

Definition at line 26 of file install.c.

Function Documentation

◆ CMP_WaitNoPendingInstallEvents()

DWORD WINAPI CMP_WaitNoPendingInstallEvents ( DWORD  dwTimeout)

Referenced by CommonInstall().

◆ CommonInstall()

static BOOL CommonInstall ( VOID  )
static

Definition at line 669 of file install.c.

670 {
671  HANDLE hThread = NULL;
672  BOOL bResult = FALSE;
673 
674  hSysSetupInf = SetupOpenInfFileW(L"syssetup.inf",
675  NULL,
677  NULL);
679  {
680  FatalError("SetupOpenInfFileW() failed to open 'syssetup.inf' (Error: %lu)\n", GetLastError());
681  return FALSE;
682  }
683 
685  {
686  FatalError("InstallSysSetupInfDevices() failed!\n");
687  goto Exit;
688  }
689 
691  {
692  FatalError("InstallSysSetupInfComponents() failed!\n");
693  goto Exit;
694  }
695 
696  if (!IsConsoleBoot())
697  {
699  0,
701  NULL,
702  0,
703  NULL);
704  }
705 
707  {
708  FatalError("EnableUserModePnpManager() failed!\n");
709  goto Exit;
710  }
711 
713  {
714  FatalError("CMP_WaitNoPendingInstallEvents() failed!\n");
715  goto Exit;
716  }
717 
718  bResult = TRUE;
719 
720 Exit:
721 
722  if (bResult == FALSE)
723  {
725  }
726 
727  if (hThread != NULL)
728  {
732  }
733 
734  return bResult;
735 }
#define CloseHandle
Definition: compat.h:487
#define INF_STYLE_WIN4
Definition: infsupp.h:41
static BOOL InstallSysSetupInfComponents(VOID)
Definition: install.c:344
#define TRUE
Definition: types.h:120
#define WM_QUIT
Definition: winuser.h:1605
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:912
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
#define WAIT_OBJECT_0
Definition: winbase.h:387
static DWORD WINAPI ShowStatusMessageThread(IN LPVOID lpParameter)
Definition: install.c:552
static void Exit(void)
Definition: sock.c:1331
#define PostThreadMessage
Definition: winuser.h:5808
static BOOL InstallSysSetupInfDevices(VOID)
Definition: install.c:308
static const WCHAR L[]
Definition: oid.c:1250
static BOOL IsConsoleBoot(VOID)
Definition: install.c:624
HINF hSysSetupInf
Definition: install.c:37
DWORD WINAPI CMP_WaitNoPendingInstallEvents(DWORD dwTimeout)
HANDLE hThread
Definition: wizard.c:27
#define INFINITE
Definition: serial.h:102
static VOID FatalError(char *pszFmt,...)
Definition: install.c:43
static BOOL EnableUserModePnpManager(VOID)
Definition: install.c:475

Referenced by InstallLiveCD(), and InstallReactOS().

◆ CreateShellLink()

static HRESULT CreateShellLink ( LPCWSTR  pszLinkPath,
LPCWSTR  pszCmd,
LPCWSTR  pszArg,
LPCWSTR  pszDir,
LPCWSTR  pszIconPath,
INT  iIconNr,
LPCWSTR  pszComment 
)
static

Definition at line 62 of file install.c.

70 {
71  IShellLinkW *psl;
72  IPersistFile *ppf;
73 
74  HRESULT hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID*)&psl);
75 
76  if (SUCCEEDED(hr))
77  {
78  hr = IShellLinkW_SetPath(psl, pszCmd);
79 
80  if (pszArg)
81  hr = IShellLinkW_SetArguments(psl, pszArg);
82 
83  if (pszDir)
84  hr = IShellLinkW_SetWorkingDirectory(psl, pszDir);
85 
86  if (pszIconPath)
87  hr = IShellLinkW_SetIconLocation(psl, pszIconPath, iIconNr);
88 
89  if (pszComment)
90  hr = IShellLinkW_SetDescription(psl, pszComment);
91 
92  hr = IShellLinkW_QueryInterface(psl, &IID_IPersistFile, (LPVOID*)&ppf);
93 
94  if (SUCCEEDED(hr))
95  {
96  hr = IPersistFile_Save(ppf, pszLinkPath, TRUE);
97  IPersistFile_Release(ppf);
98  }
99 
100  IShellLinkW_Release(psl);
101  }
102 
103  return hr;
104 }
HRESULT hr
Definition: shlfolder.c:183
#define TRUE
Definition: types.h:120
#define IID_IShellLink
Definition: shlguid.h:128
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:79
_In_ LPCSTR pszDir
Definition: shellapi.h:582
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
const GUID IID_IPersistFile
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by CreateShortcut().

◆ CreateShortcut()

static BOOL CreateShortcut ( LPCWSTR  pszFolder,
LPCWSTR  pszName,
LPCWSTR  pszCommand,
LPCWSTR  pszDescription,
INT  iIconNr,
LPCWSTR  pszWorkingDir 
)
static

Definition at line 108 of file install.c.

115 {
116  DWORD dwLen;
117  LPWSTR Ptr;
120  WCHAR szWorkingDirBuf[MAX_PATH];
121 
122  /* If no working directory is provided, try to compute a default one */
123  if (pszWorkingDir == NULL || pszWorkingDir[0] == L'\0')
124  {
125  if (ExpandEnvironmentStringsW(pszCommand, szPath, ARRAYSIZE(szPath)) == 0)
126  wcscpy(szPath, pszCommand);
127 
128  dwLen = GetFullPathNameW(szPath,
129  ARRAYSIZE(szWorkingDirBuf),
130  szWorkingDirBuf,
131  &lpFilePart);
132  if (dwLen != 0 && dwLen <= ARRAYSIZE(szWorkingDirBuf))
133  {
134  /* Since those should only be called with (.exe) files,
135  lpFilePart has not to be NULL */
136  ASSERT(lpFilePart != NULL);
137 
138  /* We're only interested in the path. Cut the file name off.
139  Also remove the trailing backslash unless the working directory
140  is only going to be a drive, i.e. C:\ */
141  *(lpFilePart--) = L'\0';
142  if (!(lpFilePart - szWorkingDirBuf == 2 &&
143  szWorkingDirBuf[1] == L':' && szWorkingDirBuf[2] == L'\\'))
144  {
145  *lpFilePart = L'\0';
146  }
147  pszWorkingDir = szWorkingDirBuf;
148  }
149  }
150 
151  /* If we failed to compute a working directory, just do not use one */
152  if (pszWorkingDir && pszWorkingDir[0] == L'\0')
153  pszWorkingDir = NULL;
154 
155  /* Build the shortcut file name */
156  wcscpy(szPath, pszFolder);
158  wcscpy(Ptr, pszName);
159 
160  /* Create the shortcut */
162  pszCommand,
163  L"",
164  pszWorkingDir,
165  /* Special value to indicate no icon */
166  (iIconNr != -1 ? pszCommand : NULL),
167  iIconNr,
168  pszDescription));
169 }
_In_ LPCSTR _In_opt_ LPCSTR _In_ DWORD _Out_opt_ LPSTR * lpFilePart
Definition: winbase.h:3038
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
#define PathAddBackslash
Definition: shlwapi.h:783
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
LPCWSTR szPath
Definition: env.c:35
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
static HRESULT CreateShellLink(LPCWSTR pszLinkPath, LPCWSTR pszCmd, LPCWSTR pszArg, LPCWSTR pszDir, LPCWSTR pszIconPath, INT iIconNr, LPCWSTR pszComment)
Definition: install.c:62
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by CreateShortcutsFromSection().

◆ CreateShortcuts()

static BOOL CreateShortcuts ( HINF  hinf,
LPCWSTR  szSection 
)
static

Definition at line 215 of file install.c.

216 {
219  WCHAR szFolder[MAX_PATH];
220  WCHAR szFolderSection[MAX_PATH];
221  INT csidl;
222 
224 
225  if (!SetupFindFirstLine(hinf, szSection, NULL, &Context))
226  return FALSE;
227 
228  do
229  {
230  if (SetupGetFieldCount(&Context) < 2)
231  continue;
232 
233  if (!SetupGetStringFieldW(&Context, 0, szFolderSection, ARRAYSIZE(szFolderSection), NULL))
234  continue;
235 
236  if (!SetupGetIntField(&Context, 1, &csidl))
237  continue;
238 
239  if (!SetupGetStringFieldW(&Context, 2, szFolder, ARRAYSIZE(szFolder), NULL))
240  continue;
241 
243  continue;
244 
245  CreateShortcutsFromSection(hinf, szFolderSection, szPath);
246 
247  } while (SetupFindNextLine(&Context, &Context));
248 
249  CoUninitialize();
250 
251  return TRUE;
252 }
#define SetupFindFirstLine
Definition: setupapi.h:2619
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
static BOOL CreateShortcutsFromSection(HINF hinf, LPWSTR pszSection, LPCWSTR pszFolder)
Definition: install.c:172
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
ULONG WINAPI SetupGetFieldCount(IN PINFCONTEXT Context)
Definition: infsupp.c:91
LPCWSTR szPath
Definition: env.c:35
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define CSIDL_FLAG_CREATE
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:146
struct tagContext Context
Definition: acpixf.h:1034
HRESULT WINAPI SHGetFolderPathAndSubDirW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubPath, LPWSTR pszPath)
Definition: shellpath.c:2273
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by InstallReactOS().

◆ CreateShortcutsFromSection()

static BOOL CreateShortcutsFromSection ( HINF  hinf,
LPWSTR  pszSection,
LPCWSTR  pszFolder 
)
static

Definition at line 172 of file install.c.

173 {
175  DWORD dwFieldCount;
176  INT iIconNr;
177  WCHAR szCommand[MAX_PATH];
180  WCHAR szDirectory[MAX_PATH];
181 
182  if (!SetupFindFirstLine(hinf, pszSection, NULL, &Context))
183  return FALSE;
184 
185  do
186  {
187  dwFieldCount = SetupGetFieldCount(&Context);
188  if (dwFieldCount < 3)
189  continue;
190 
191  if (!SetupGetStringFieldW(&Context, 1, szCommand, ARRAYSIZE(szCommand), NULL))
192  continue;
193 
195  continue;
196 
198  continue;
199 
200  if (dwFieldCount < 4 || !SetupGetIntField(&Context, 4, &iIconNr))
201  iIconNr = -1; /* Special value to indicate no icon */
202 
203  if (dwFieldCount < 5 || !SetupGetStringFieldW(&Context, 5, szDirectory, ARRAYSIZE(szDirectory), NULL))
204  szDirectory[0] = L'\0';
205 
206  wcscat(szName, L".lnk");
207 
208  CreateShortcut(pszFolder, szName, szCommand, szDescription, iIconNr, szDirectory);
209 
210  } while (SetupFindNextLine(&Context, &Context));
211 
212  return TRUE;
213 }
#define SetupFindFirstLine
Definition: setupapi.h:2619
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
static BOOL CreateShortcut(LPCWSTR pszFolder, LPCWSTR pszName, LPCWSTR pszCommand, LPCWSTR pszDescription, INT iIconNr, LPCWSTR pszWorkingDir)
Definition: install.c:108
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG WINAPI SetupGetFieldCount(IN PINFCONTEXT Context)
Definition: infsupp.c:91
static const WCHAR L[]
Definition: oid.c:1250
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
static const WCHAR szName[]
Definition: msipriv.h:1194
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:146
struct tagContext Context
Definition: acpixf.h:1034
static const WCHAR szDescription[]
Definition: provider.c:55
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by CreateShortcuts().

◆ CreateTempDir()

static VOID CreateTempDir ( IN LPCWSTR  VarName)
static

Definition at line 255 of file install.c.

257 {
258  WCHAR szTempDir[MAX_PATH];
259  WCHAR szBuffer[MAX_PATH];
260  DWORD dwLength;
261  HKEY hKey;
262 
264  L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
265  0,
267  &hKey) != ERROR_SUCCESS)
268  {
269  FatalError("Error: %lu\n", GetLastError());
270  return;
271  }
272 
273  /* Get temp dir */
274  dwLength = sizeof(szBuffer);
275  if (RegQueryValueExW(hKey,
276  VarName,
277  NULL,
278  NULL,
279  (LPBYTE)szBuffer,
280  &dwLength) != ERROR_SUCCESS)
281  {
282  FatalError("Error: %lu\n", GetLastError());
283  goto cleanup;
284  }
285 
286  /* Expand it */
287  if (!ExpandEnvironmentStringsW(szBuffer, szTempDir, ARRAYSIZE(szTempDir)))
288  {
289  FatalError("Error: %lu\n", GetLastError());
290  goto cleanup;
291  }
292 
293  /* Create profiles directory */
294  if (!CreateDirectoryW(szTempDir, NULL))
295  {
297  {
298  FatalError("Error: %lu\n", GetLastError());
299  goto cleanup;
300  }
301  }
302 
303 cleanup:
304  RegCloseKey(hKey);
305 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
char * cleanup(char *str)
Definition: wpickclick.c:99
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static VOID FatalError(char *pszFmt,...)
Definition: install.c:43
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by InstallReactOS().

◆ EnableUserModePnpManager()

static BOOL EnableUserModePnpManager ( VOID  )
static

Definition at line 475 of file install.c.

476 {
477  SC_HANDLE hSCManager = NULL;
478  SC_HANDLE hService = NULL;
479  BOOL bRet = FALSE;
480 
482  if (hSCManager == NULL)
483  {
484  DPRINT1("Unable to open the service control manager.\n");
485  DPRINT1("Last Error %d\n", GetLastError());
486  goto cleanup;
487  }
488 
489  hService = OpenServiceW(hSCManager,
490  L"PlugPlay",
492  if (hService == NULL)
493  {
494  DPRINT1("Unable to open PlugPlay service\n");
495  goto cleanup;
496  }
497 
498  bRet = ChangeServiceConfigW(hService,
502  NULL, NULL, NULL,
503  NULL, NULL, NULL, NULL);
504  if (!bRet)
505  {
506  DPRINT1("Unable to change the service configuration\n");
507  goto cleanup;
508  }
509 
510  bRet = StartServiceW(hService, 0, NULL);
511  if (!bRet && (GetLastError() != ERROR_SERVICE_ALREADY_RUNNING))
512  {
513  DPRINT1("Unable to start service\n");
514  goto cleanup;
515  }
516 
517  bRet = TRUE;
518 
519 cleanup:
520  if (hService != NULL)
521  CloseServiceHandle(hService);
522  if (hSCManager != NULL)
524  return bRet;
525 }
#define SC_MANAGER_ENUMERATE_SERVICE
Definition: winsvc.h:16
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define SERVICE_NO_CHANGE
Definition: winsvc.h:20
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword, LPCWSTR lpDisplayName)
Definition: scm.c:480
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2103
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI StartServiceW(SC_HANDLE hService, DWORD dwNumServiceArgs, LPCWSTR *lpServiceArgVectors)
Definition: scm.c:2923
#define SERVICE_CHANGE_CONFIG
Definition: winsvc.h:54
static const WCHAR L[]
Definition: oid.c:1250
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
SC_HANDLE hSCManager
Definition: sc.c:12
#define SERVICE_START
Definition: winsvc.h:57
#define DPRINT1
Definition: precomp.h:8
#define SERVICE_AUTO_START
Definition: cmtypes.h:977
char * cleanup(char *str)
Definition: wpickclick.c:99
#define ERROR_SERVICE_ALREADY_RUNNING
Definition: winerror.h:607

Referenced by CommonInstall().

◆ FatalError()

static VOID FatalError ( char pszFmt,
  ... 
)
static

Definition at line 43 of file install.c.

44 {
45  char szBuffer[512];
46  va_list ap;
47 
48  va_start(ap, pszFmt);
49  vsprintf(szBuffer, pszFmt, ap);
50  va_end(ap);
51 
52  LogItem(NULL, L"Failed");
53 
54  strcat(szBuffer, "\nRebooting now!");
56  szBuffer,
57  "ReactOS Setup",
58  MB_OK);
59 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
static const WCHAR L[]
Definition: oid.c:1250
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define MB_OK
Definition: winuser.h:784
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98

Referenced by CommonInstall(), CreateTempDir(), InstallReactOS(), InstallSysSetupInfComponents(), and RegisterTypeLibraries().

◆ HotkeyThread()

static DWORD CALLBACK HotkeyThread ( LPVOID  Parameter)
static

Definition at line 844 of file install.c.

845 {
846  ATOM hotkey;
847  MSG msg;
848 
849  DPRINT("HotkeyThread start\n");
850 
851  hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
852 
853  if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
854  DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
855 
856  while (GetMessage(&msg, NULL, 0, 0))
857  {
858  if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
859  {
860  STARTUPINFOW si = { sizeof(si) };
862 
863  if (CreateProcessW(L"cmd.exe",
864  NULL,
865  NULL,
866  NULL,
867  FALSE,
869  NULL,
870  NULL,
871  &si,
872  &pi))
873  {
874  CloseHandle(pi.hProcess);
875  CloseHandle(pi.hThread);
876  }
877  else
878  {
879  DPRINT1("Failed to launch command prompt: %lu\n", GetLastError());
880  }
881  }
882  }
883 
884  UnregisterHotKey(NULL, hotkey);
885  GlobalDeleteAtom(hotkey);
886 
887  DPRINT("HotkeyThread terminate\n");
888  return 0;
889 }
ATOM WINAPI GlobalDeleteAtom(ATOM nAtom)
Definition: atom.c:454
#define CloseHandle
Definition: compat.h:487
WORD ATOM
Definition: dimm.idl:113
#define WM_HOTKEY
Definition: winuser.h:1861
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
BOOL WINAPI UnregisterHotKey(_In_opt_ HWND, _In_ int)
#define VK_F10
Definition: winuser.h:2239
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4595
#define CREATE_NEW_CONSOLE
Definition: winbase.h:180
static refpint_t pi[]
Definition: server.c:96
static const WCHAR L[]
Definition: oid.c:1250
#define MOD_SHIFT
Definition: imm.h:316
#define GetMessage
Definition: winuser.h:5765
ATOM WINAPI GlobalAddAtomW(LPCWSTR lpString)
Definition: atom.c:444
#define DPRINT1
Definition: precomp.h:8
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)

Referenced by InstallReactOS().

◆ InitializeDefaultUserLocale()

static VOID InitializeDefaultUserLocale ( VOID  )
static

Definition at line 1009 of file install.c.

1010 {
1011  WCHAR szBuffer[80];
1012  PWSTR ptr;
1013  HKEY hLocaleKey;
1014  DWORD ret;
1015  DWORD dwSize;
1016  LCID lcid;
1017  INT i;
1018 
1019  struct {LCTYPE LCType; PWSTR pValue;} LocaleData[] = {
1020  /* Number */
1021  {LOCALE_SDECIMAL, L"sDecimal"},
1022  {LOCALE_STHOUSAND, L"sThousand"},
1023  {LOCALE_SNEGATIVESIGN, L"sNegativeSign"},
1024  {LOCALE_SPOSITIVESIGN, L"sPositiveSign"},
1025  {LOCALE_SGROUPING, L"sGrouping"},
1026  {LOCALE_SLIST, L"sList"},
1027  {LOCALE_SNATIVEDIGITS, L"sNativeDigits"},
1028  {LOCALE_INEGNUMBER, L"iNegNumber"},
1029  {LOCALE_IDIGITS, L"iDigits"},
1030  {LOCALE_ILZERO, L"iLZero"},
1031  {LOCALE_IMEASURE, L"iMeasure"},
1032  {LOCALE_IDIGITSUBSTITUTION, L"NumShape"},
1033 
1034  /* Currency */
1035  {LOCALE_SCURRENCY, L"sCurrency"},
1036  {LOCALE_SMONDECIMALSEP, L"sMonDecimalSep"},
1037  {LOCALE_SMONTHOUSANDSEP, L"sMonThousandSep"},
1038  {LOCALE_SMONGROUPING, L"sMonGrouping"},
1039  {LOCALE_ICURRENCY, L"iCurrency"},
1040  {LOCALE_INEGCURR, L"iNegCurr"},
1041  {LOCALE_ICURRDIGITS, L"iCurrDigits"},
1042 
1043  /* Time */
1044  {LOCALE_STIMEFORMAT, L"sTimeFormat"},
1045  {LOCALE_STIME, L"sTime"},
1046  {LOCALE_S1159, L"s1159"},
1047  {LOCALE_S2359, L"s2359"},
1048  {LOCALE_ITIME, L"iTime"},
1049  {LOCALE_ITIMEMARKPOSN, L"iTimePrefix"},
1050  {LOCALE_ITLZERO, L"iTLZero"},
1051 
1052  /* Date */
1053  {LOCALE_SLONGDATE, L"sLongDate"},
1054  {LOCALE_SSHORTDATE, L"sShortDate"},
1055  {LOCALE_SDATE, L"sDate"},
1056  {LOCALE_IFIRSTDAYOFWEEK, L"iFirstDayOfWeek"},
1057  {LOCALE_IFIRSTWEEKOFYEAR, L"iFirstWeekOfYear"},
1058  {LOCALE_IDATE, L"iDate"},
1059  {LOCALE_ICALENDARTYPE, L"iCalendarType"},
1060 
1061  /* Misc */
1062  {LOCALE_SCOUNTRY, L"sCountry"},
1063  {LOCALE_SABBREVLANGNAME, L"sLanguage"},
1064  {LOCALE_ICOUNTRY, L"iCountry"},
1065  {0, NULL}};
1066 
1068  L".DEFAULT\\Control Panel\\International",
1069  0,
1070  KEY_READ | KEY_WRITE,
1071  &hLocaleKey);
1072  if (ret != ERROR_SUCCESS)
1073  {
1074  return;
1075  }
1076 
1077  dwSize = 9 * sizeof(WCHAR);
1078  ret = RegQueryValueExW(hLocaleKey,
1079  L"Locale",
1080  NULL,
1081  NULL,
1082  (PBYTE)szBuffer,
1083  &dwSize);
1084  if (ret != ERROR_SUCCESS)
1085  goto done;
1086 
1087  lcid = (LCID)wcstoul(szBuffer, &ptr, 16);
1088  if (lcid == 0)
1089  goto done;
1090 
1091  i = 0;
1092  while (LocaleData[i].pValue != NULL)
1093  {
1094  if (GetLocaleInfoW(lcid,
1095  LocaleData[i].LCType | LOCALE_NOUSEROVERRIDE,
1096  szBuffer,
1097  ARRAYSIZE(szBuffer)))
1098  {
1099  RegSetValueExW(hLocaleKey,
1100  LocaleData[i].pValue,
1101  0,
1102  REG_SZ,
1103  (PBYTE)szBuffer,
1104  (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1105  }
1106 
1107  i++;
1108  }
1109 
1110 done:
1111  RegCloseKey(hLocaleKey);
1112 }
#define HKEY_USERS
Definition: winreg.h:13
#define LOCALE_SGROUPING
Definition: winnls.h:44
#define LOCALE_SMONGROUPING
Definition: winnls.h:53
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
uint16_t * PWSTR
Definition: typedefs.h:56
#define LOCALE_IDATE
Definition: winnls.h:63
#define LOCALE_ICALENDARTYPE
Definition: winnls.h:73
#define LOCALE_ILZERO
Definition: winnls.h:46
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD LCID
Definition: nls.h:13
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define LOCALE_IMEASURE
Definition: winnls.h:41
int32_t INT
Definition: typedefs.h:58
#define LOCALE_SCURRENCY
Definition: winnls.h:49
#define LOCALE_INEGNUMBER
Definition: winnls.h:47
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
DWORD LCTYPE
Definition: winnls.h:514
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define LOCALE_STHOUSAND
Definition: winnls.h:43
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define LOCALE_SLONGDATE
Definition: winnls.h:61
static PVOID ptr
Definition: dispmode.c:27
#define LOCALE_ITIMEMARKPOSN
Definition: winnls.h:66
#define LOCALE_INEGCURR
Definition: winnls.h:57
smooth NULL
Definition: ftsmooth.c:416
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define LOCALE_STIME
Definition: winnls.h:59
#define KEY_WRITE
Definition: nt_native.h:1031
#define LOCALE_ICURRENCY
Definition: winnls.h:56
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define LOCALE_SMONDECIMALSEP
Definition: winnls.h:51
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
#define LOCALE_SMONTHOUSANDSEP
Definition: winnls.h:52
#define LOCALE_SDATE
Definition: winnls.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:28
#define LOCALE_SPOSITIVESIGN
Definition: winnls.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LOCALE_S1159
Definition: winnls.h:71
#define LOCALE_ITLZERO
Definition: winnls.h:68
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define LOCALE_SNEGATIVESIGN
Definition: winnls.h:118
#define LOCALE_SSHORTDATE
Definition: winnls.h:60
#define LOCALE_ICOUNTRY
Definition: winnls.h:30
#define LOCALE_IDIGITS
Definition: winnls.h:45
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:75
#define LOCALE_IFIRSTWEEKOFYEAR
Definition: winnls.h:76
#define LOCALE_ICURRDIGITS
Definition: winnls.h:54
#define LOCALE_ITIME
Definition: winnls.h:65
#define LOCALE_SLIST
Definition: winnls.h:40
#define LOCALE_SCOUNTRY
Definition: winnls.h:31
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define LOCALE_SNATIVEDIGITS
Definition: winnls.h:48
#define LOCALE_S2359
Definition: winnls.h:72
#define LOCALE_STIMEFORMAT
Definition: winnls.h:62
BYTE * PBYTE
Definition: pedump.c:66
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define REG_SZ
Definition: layer.c:22

Referenced by InstallReactOS().

◆ InitializeProgramFilesDir()

static BOOL InitializeProgramFilesDir ( VOID  )
static

Definition at line 894 of file install.c.

895 {
896  LONG Error;
897  HKEY hKey;
898  DWORD dwLength;
899  WCHAR szProgramFilesDirPath[MAX_PATH];
900  WCHAR szCommonFilesDirPath[MAX_PATH];
901  WCHAR szBuffer[MAX_PATH];
902 
903  /* Load 'Program Files' location */
906  szBuffer,
907  ARRAYSIZE(szBuffer)))
908  {
909  DPRINT1("Error: %lu\n", GetLastError());
910  return FALSE;
911  }
912 
915  szCommonFilesDirPath,
916  ARRAYSIZE(szCommonFilesDirPath)))
917  {
918  DPRINT1("Warning: %lu\n", GetLastError());
919  }
920 
921  /* Expand it */
922  if (!ExpandEnvironmentStringsW(szBuffer,
923  szProgramFilesDirPath,
924  ARRAYSIZE(szProgramFilesDirPath)))
925  {
926  DPRINT1("Error: %lu\n", GetLastError());
927  return FALSE;
928  }
929 
930  wcscpy(szBuffer, szProgramFilesDirPath);
931  wcscat(szBuffer, L"\\");
932  wcscat(szBuffer, szCommonFilesDirPath);
933 
934  if (!ExpandEnvironmentStringsW(szBuffer,
935  szCommonFilesDirPath,
936  ARRAYSIZE(szCommonFilesDirPath)))
937  {
938  DPRINT1("Warning: %lu\n", GetLastError());
939  }
940 
941  /* Store it */
943  L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
944  0,
946  &hKey);
947  if (Error != ERROR_SUCCESS)
948  {
949  DPRINT1("Error: %lu\n", Error);
950  return FALSE;
951  }
952 
953  dwLength = (wcslen(szProgramFilesDirPath) + 1) * sizeof(WCHAR);
954  Error = RegSetValueExW(hKey,
955  L"ProgramFilesDir",
956  0,
957  REG_SZ,
958  (LPBYTE)szProgramFilesDirPath,
959  dwLength);
960  if (Error != ERROR_SUCCESS)
961  {
962  DPRINT1("Error: %lu\n", Error);
963  RegCloseKey(hKey);
964  return FALSE;
965  }
966 
967  dwLength = (wcslen(szCommonFilesDirPath) + 1) * sizeof(WCHAR);
968  Error = RegSetValueExW(hKey,
969  L"CommonFilesDir",
970  0,
971  REG_SZ,
972  (LPBYTE)szCommonFilesDirPath,
973  dwLength);
974  if (Error != ERROR_SUCCESS)
975  {
976  DPRINT1("Warning: %lu\n", Error);
977  }
978 
979  RegCloseKey(hKey);
980 
981  /* Create directory */
982  // FIXME: Security!
983  if (!CreateDirectoryW(szProgramFilesDirPath, NULL))
984  {
986  {
987  DPRINT1("Error: %lu\n", GetLastError());
988  return FALSE;
989  }
990  }
991 
992  /* Create directory */
993  // FIXME: Security!
994  if (!CreateDirectoryW(szCommonFilesDirPath, NULL))
995  {
997  {
998  DPRINT1("Warning: %lu\n", GetLastError());
999  // return FALSE;
1000  }
1001  }
1002 
1003  return TRUE;
1004 }
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define TRUE
Definition: types.h:120
#define IDS_PROGRAMFILES
Definition: resource.h:143
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
static HINSTANCE hDllInstance
Definition: clb.c:30
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
static DWORD DWORD * dwLength
Definition: fusion.c:85
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Error
Definition: chkdsk.c:66
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_COMMONFILES
Definition: resource.h:144
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by InstallReactOS().

◆ InstallLiveCD()

static DWORD InstallLiveCD ( VOID  )
static

Definition at line 739 of file install.c.

740 {
741  STARTUPINFOW StartupInfo;
742  PROCESS_INFORMATION ProcessInformation;
743  BOOL bRes;
744 
745  if (!CommonInstall())
746  goto error;
747 
748  /* Install the TCP/IP protocol driver */
749  bRes = InstallNetworkComponent(L"MS_TCPIP");
750  if (!bRes && GetLastError() != ERROR_FILE_NOT_FOUND)
751  {
752  DPRINT("InstallNetworkComponent() failed with error 0x%lx\n", GetLastError());
753  }
754  else
755  {
756  /* Start the TCP/IP protocol driver */
757  SetupStartService(L"Tcpip", FALSE);
758  SetupStartService(L"Dhcp", FALSE);
759  SetupStartService(L"Dnscache", FALSE);
760  }
761 
762  /* Register components */
763  _SEH2_TRY
764  {
766  hSysSetupInf, L"RegistrationPhase2",
767  SPINST_ALL,
768  0, NULL, 0, NULL, NULL, NULL, NULL))
769  {
770  DPRINT1("SetupInstallFromInfSectionW failed!\n");
771  }
772 
773  RegisterTypeLibraries(hSysSetupInf, L"TypeLibraries");
774  }
776  {
777  DPRINT1("Catching exception\n");
778  }
779  _SEH2_END;
780 
782 
783  /* Run the shell */
784  ZeroMemory(&StartupInfo, sizeof(StartupInfo));
785  StartupInfo.cb = sizeof(StartupInfo);
786  bRes = CreateProcessW(L"userinit.exe",
787  NULL,
788  NULL,
789  NULL,
790  FALSE,
791  0,
792  NULL,
793  NULL,
794  &StartupInfo,
795  &ProcessInformation);
796  if (!bRes)
797  goto error;
798 
799  CloseHandle(ProcessInformation.hThread);
800  CloseHandle(ProcessInformation.hProcess);
801 
802  return 0;
803 
804 error:
805  MessageBoxW(
806  NULL,
807  L"Failed to load LiveCD! You can shutdown your computer, or press ENTER to reboot.",
808  L"ReactOS LiveCD",
809  MB_OK);
810  return 0;
811 }
#define CloseHandle
Definition: compat.h:487
#define error(str)
Definition: mkdosfs.c:1605
BOOL RegisterTypeLibraries(HINF hinf, LPCWSTR szSection)
Definition: install.c:423
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define ZeroMemory
Definition: winbase.h:1648
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
_SEH2_TRY
Definition: create.c:4226
static BOOL CommonInstall(VOID)
Definition: install.c:669
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4595
DWORD WINAPI SetupStartService(LPCWSTR lpServiceName, BOOL bWait)
Definition: install.c:1443
DWORD cb
Definition: winbase.h:830
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1327
static const WCHAR L[]
Definition: oid.c:1250
#define SPINST_ALL
Definition: setupapi.h:596
HINF hSysSetupInf
Definition: install.c:37
_SEH2_END
Definition: create.c:4400
#define MB_OK
Definition: winuser.h:784
#define DPRINT1
Definition: precomp.h:8
BOOL InstallNetworkComponent(_In_ PWSTR pszComponentId)
Definition: netinstall.c:467
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

Referenced by InstallWindowsNt().

◆ InstallReactOS()

static DWORD InstallReactOS ( VOID  )
static

Definition at line 1190 of file install.c.

1191 {
1192  WCHAR szBuffer[MAX_PATH];
1193  HANDLE token;
1194  TOKEN_PRIVILEGES privs;
1195  HKEY hKey;
1196  HINF hShortcutsInf;
1197  HANDLE hHotkeyThread;
1198  BOOL ret;
1199 
1201  LogItem(NULL, L"Installing ReactOS");
1202 
1203  CreateTempDir(L"TEMP");
1204  CreateTempDir(L"TMP");
1205 
1207  {
1208  FatalError("InitializeProgramFilesDir() failed");
1209  return 0;
1210  }
1211 
1212  if (!InitializeProfiles())
1213  {
1214  FatalError("InitializeProfiles() failed");
1215  return 0;
1216  }
1217 
1219 
1220  if (GetWindowsDirectoryW(szBuffer, ARRAYSIZE(szBuffer)))
1221  {
1223  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
1224  0,
1225  KEY_WRITE,
1226  &hKey) == ERROR_SUCCESS)
1227  {
1228  RegSetValueExW(hKey,
1229  L"PathName",
1230  0,
1231  REG_SZ,
1232  (LPBYTE)szBuffer,
1233  (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1234 
1235  RegSetValueExW(hKey,
1236  L"SystemRoot",
1237  0,
1238  REG_SZ,
1239  (LPBYTE)szBuffer,
1240  (wcslen(szBuffer) + 1) * sizeof(WCHAR));
1241 
1242  RegCloseKey(hKey);
1243  }
1244 
1245  PathAddBackslash(szBuffer);
1246  wcscat(szBuffer, L"system");
1247  CreateDirectory(szBuffer, NULL);
1248  }
1249 
1251  {
1252  FatalError("SaveDefaultUserHive() failed");
1253  return 0;
1254  }
1255 
1256  if (!CopySystemProfile(0))
1257  {
1258  FatalError("CopySystemProfile() failed");
1259  return 0;
1260  }
1261 
1262  hHotkeyThread = CreateThread(NULL, 0, HotkeyThread, NULL, 0, NULL);
1263 
1264  if (!CommonInstall())
1265  return 0;
1266 
1267  /* Install the TCP/IP protocol driver */
1268  ret = InstallNetworkComponent(L"MS_TCPIP");
1269  if (!ret && GetLastError() != ERROR_FILE_NOT_FOUND)
1270  {
1271  DPRINT("InstallNetworkComponent() failed with error 0x%lx\n", GetLastError());
1272  }
1273  else
1274  {
1275  /* Start the TCP/IP protocol driver */
1276  SetupStartService(L"Tcpip", FALSE);
1277  SetupStartService(L"Dhcp", FALSE);
1278  SetupStartService(L"Dnscache", FALSE);
1279  }
1280 
1281  InstallWizard();
1282 
1283  InstallSecurity();
1284 
1286 
1287  hShortcutsInf = SetupOpenInfFileW(L"shortcuts.inf",
1288  NULL,
1290  NULL);
1291  if (hShortcutsInf == INVALID_HANDLE_VALUE)
1292  {
1293  FatalError("Failed to open shortcuts.inf");
1294  return 0;
1295  }
1296 
1297  if (!CreateShortcuts(hShortcutsInf, L"ShortcutFolders"))
1298  {
1299  FatalError("CreateShortcuts() failed");
1300  return 0;
1301  }
1302 
1303  SetupCloseInfFile(hShortcutsInf);
1304 
1305  hShortcutsInf = SetupOpenInfFileW(L"rosapps_shortcuts.inf",
1306  NULL,
1308  NULL);
1309  if (hShortcutsInf != INVALID_HANDLE_VALUE)
1310  {
1311  if (!CreateShortcuts(hShortcutsInf, L"ShortcutFolders"))
1312  {
1313  FatalError("CreateShortcuts(rosapps) failed");
1314  return 0;
1315  }
1316  SetupCloseInfFile(hShortcutsInf);
1317  }
1318 
1320  SetSetupType(0);
1321 
1322  if (hHotkeyThread)
1323  {
1324  PostThreadMessage(GetThreadId(hHotkeyThread), WM_QUIT, 0, 0);
1325  CloseHandle(hHotkeyThread);
1326  }
1327 
1328  LogItem(NULL, L"Installing ReactOS done");
1330 
1331  if (AdminInfo.Name != NULL)
1332  RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Name);
1333 
1334  if (AdminInfo.Domain != NULL)
1335  RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Domain);
1336 
1337  if (AdminInfo.Password != NULL)
1338  RtlFreeHeap(RtlGetProcessHeap(), 0, AdminInfo.Password);
1339 
1340  /* Get shutdown privilege */
1342  {
1343  FatalError("OpenProcessToken() failed!");
1344  return 0;
1345  }
1348  &privs.Privileges[0].Luid))
1349  {
1350  FatalError("LookupPrivilegeValue() failed!");
1351  return 0;
1352  }
1353  privs.PrivilegeCount = 1;
1356  FALSE,
1357  &privs,
1358  0,
1360  NULL) == 0)
1361  {
1362  FatalError("AdjustTokenPrivileges() failed!");
1363  return 0;
1364  }
1365 
1367  return 0;
1368 }
static BOOL SetSetupType(DWORD dwSetupType)
Definition: install.c:815
#define CloseHandle
Definition: compat.h:487
#define INF_STYLE_WIN4
Definition: infsupp.h:41
static VOID CreateTempDir(IN LPCWSTR VarName)
Definition: install.c:255
#define ERROR_SUCCESS
Definition: deptool.c:10
static BOOL InitializeProgramFilesDir(VOID)
Definition: install.c:894
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define WM_QUIT
Definition: winuser.h:1605
$ULONG PrivilegeCount
Definition: setypes.h:969
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static DWORD SaveDefaultUserHive(VOID)
Definition: install.c:1117
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
DWORD WINAPI GetThreadId(IN HANDLE Thread)
Definition: thread.c:912
static VOID InitializeDefaultUserLocale(VOID)
Definition: install.c:1009
#define EWX_REBOOT
Definition: winuser.h:633
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
#define LookupPrivilegeValue
Definition: winbase.h:3710
static DWORD CALLBACK HotkeyThread(LPVOID Parameter)
Definition: install.c:844
LPWSTR Name
Definition: globals.h:23
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
static BOOL CommonInstall(VOID)
Definition: install.c:669
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
VOID InstallWizard(VOID)
Definition: wizard.c:2713
#define PathAddBackslash
Definition: shlwapi.h:783
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL WINAPI InitializeProfiles(VOID)
Definition: setup.c:335
VOID SetAutoAdminLogon(VOID)
Definition: security.c:759
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
DWORD WINAPI SetupStartService(LPCWSTR lpServiceName, BOOL bWait)
Definition: install.c:1443
BOOL WINAPI CopySystemProfile(_In_ ULONG Unused)
Definition: profile.c:565
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define PostThreadMessage
Definition: winuser.h:5808
#define MAX_PATH
Definition: compat.h:34
VOID WINAPI TerminateSetupActionLog(VOID)
Definition: logfile.c:82
static BOOL CreateShortcuts(HINF hinf, LPCWSTR szSection)
Definition: install.c:215
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define GetCurrentProcess()
Definition: compat.h:507
BOOL WINAPI ExitWindowsEx(_In_ UINT, _In_ DWORD)
LPWSTR Password
Definition: globals.h:25
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
HINF hSysSetupInf
Definition: install.c:37
ADMIN_INFO AdminInfo
Definition: install.c:38
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:970
LPWSTR Domain
Definition: globals.h:24
VOID InstallSecurity(VOID)
Definition: security.c:590
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:383
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
BOOL InstallNetworkComponent(_In_ PWSTR pszComponentId)
Definition: netinstall.c:467
BOOL WINAPI InitializeSetupActionLog(BOOL bDeleteOldLogFile)
Definition: logfile.c:42
static VOID FatalError(char *pszFmt,...)
Definition: install.c:43
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define LogItem(lpTag, lpMessageText...)
Definition: syssetup.h:98
#define REG_SZ
Definition: layer.c:22

Referenced by InstallWindowsNt(), and RunInstallReactOS().

◆ InstallSysSetupInfComponents()

static BOOL InstallSysSetupInfComponents ( VOID  )
static

Definition at line 344 of file install.c.

345 {
346  INFCONTEXT InfContext;
347  WCHAR szNameBuffer[256];
348  WCHAR szSectionBuffer[256];
349  HINF hComponentInf = INVALID_HANDLE_VALUE;
350 
352  L"Infs.Always",
353  NULL,
354  &InfContext))
355  {
356  DPRINT("No Inf.Always section found\n");
357  }
358  else
359  {
360  do
361  {
362  if (!SetupGetStringFieldW(&InfContext,
363  1, // Get the component name
364  szNameBuffer,
365  ARRAYSIZE(szNameBuffer),
366  NULL))
367  {
368  FatalError("Error while trying to get component name \n");
369  return FALSE;
370  }
371 
372  if (!SetupGetStringFieldW(&InfContext,
373  2, // Get the component install section
374  szSectionBuffer,
375  ARRAYSIZE(szSectionBuffer),
376  NULL))
377  {
378  FatalError("Error while trying to get component install section \n");
379  return FALSE;
380  }
381 
382  DPRINT("Trying to execute install section '%S' from '%S' \n", szSectionBuffer, szNameBuffer);
383 
384  hComponentInf = SetupOpenInfFileW(szNameBuffer,
385  NULL,
387  NULL);
388 
389  if (hComponentInf == INVALID_HANDLE_VALUE)
390  {
391  FatalError("SetupOpenInfFileW() failed to open '%S' (Error: %lu)\n", szNameBuffer, GetLastError());
392  return FALSE;
393  }
394 
396  hComponentInf,
397  szSectionBuffer,
398  SPINST_ALL,
399  NULL,
400  NULL,
403  NULL,
404  NULL,
405  NULL))
406  {
407  FatalError("Error while trying to install : %S (Error: %lu)\n", szNameBuffer, GetLastError());
408  SetupCloseInfFile(hComponentInf);
409  return FALSE;
410  }
411 
412  SetupCloseInfFile(hComponentInf);
413  }
414  while (SetupFindNextLine(&InfContext, &InfContext));
415  }
416 
417  return TRUE;
418 }
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define INF_STYLE_WIN4
Definition: infsupp.h:41
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
HINF WINAPI SetupOpenInfFileW(PCWSTR name, PCWSTR class, DWORD style, UINT *error)
Definition: parser.c:1229
VOID WINAPI SetupCloseInfFile(IN HINF InfHandle)
Definition: infsupp.c:43
#define FALSE
Definition: types.h:117
#define SP_COPY_NEWER
Definition: setupapi.h:473
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI SetupInstallFromInfSectionW(HWND owner, HINF hinf, PCWSTR section, UINT flags, HKEY key_root, PCWSTR src_root, UINT copy_flags, PSP_FILE_CALLBACK_W callback, PVOID context, HDEVINFO devinfo, PSP_DEVINFO_DATA devinfo_data)
Definition: install.c:1327
static const WCHAR L[]
Definition: oid.c:1250
UINT WINAPI SetupDefaultQueueCallbackW(PVOID context, UINT notification, UINT_PTR param1, UINT_PTR param2)
Definition: queue.c:1777
#define SPINST_ALL
Definition: setupapi.h:596
HINF hSysSetupInf
Definition: install.c:37
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
static VOID FatalError(char *pszFmt,...)
Definition: install.c:43
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by CommonInstall().

◆ InstallSysSetupInfDevices()

static BOOL InstallSysSetupInfDevices ( VOID  )
static

Definition at line 308 of file install.c.

309 {
310  INFCONTEXT InfContext;
311  WCHAR szLineBuffer[256];
312  DWORD dwLineLength;
313 
315  L"DeviceInfsToInstall",
316  NULL,
317  &InfContext))
318  {
319  return FALSE;
320  }
321 
322  do
323  {
324  if (!SetupGetStringFieldW(&InfContext,
325  0,
326  szLineBuffer,
327  ARRAYSIZE(szLineBuffer),
328  &dwLineLength))
329  {
330  return FALSE;
331  }
332 
333  if (!SetupDiInstallClassW(NULL, szLineBuffer, DI_QUIETINSTALL, NULL))
334  {
335  return FALSE;
336  }
337  }
338  while (SetupFindNextLine(&InfContext, &InfContext));
339 
340  return TRUE;
341 }
BOOL WINAPI SetupFindFirstLineW(IN HINF InfHandle, IN PCWSTR Section, IN PCWSTR Key, IN OUT PINFCONTEXT Context)
Definition: infsupp.c:54
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI SetupDiInstallClassW(HWND hwndParent, PCWSTR InfFileName, DWORD Flags, HSPFILEQ FileQueue)
Definition: devinst.c:3610
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DI_QUIETINSTALL
Definition: setupapi.h:68
static const WCHAR L[]
Definition: oid.c:1250
HINF hSysSetupInf
Definition: install.c:37
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by CommonInstall().

◆ InstallWindowsNt()

INT WINAPI InstallWindowsNt ( INT  argc,
WCHAR **  argv 
)

Definition at line 1377 of file install.c.

1378 {
1379  INT i;
1380  PWSTR p;
1381 
1382  for (i = 0; i < argc; ++i)
1383  {
1384  p = argv[i];
1385  if (*p == L'-')
1386  {
1387  p++;
1388 
1389  // NOTE: On Windows, "mini" means "minimal UI", and can be used
1390  // in addition to "newsetup"; these options are not exclusive.
1391  if (_wcsicmp(p, L"newsetup") == 0)
1392  return (INT)InstallReactOS();
1393  else if (_wcsicmp(p, L"mini") == 0)
1394  return (INT)InstallLiveCD();
1395 
1396  /* Add support for other switches */
1397  }
1398  }
1399 
1400  return 0;
1401 }
static int argc
Definition: ServiceArgs.c:12
static DWORD InstallReactOS(VOID)
Definition: install.c:1190
uint16_t * PWSTR
Definition: typedefs.h:56
#define argv
Definition: mplay32.c:18
int32_t INT
Definition: typedefs.h:58
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const WCHAR L[]
Definition: oid.c:1250
GLfloat GLfloat p
Definition: glext.h:8902
static DWORD InstallLiveCD(VOID)
Definition: install.c:739
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ IsConsoleBoot()

static BOOL IsConsoleBoot ( VOID  )
static

Definition at line 624 of file install.c.

625 {
626  HKEY hControlKey = NULL;
627  LPWSTR pwszSystemStartOptions = NULL;
628  LPWSTR pwszCurrentOption, pwszNextOption; /* Pointers into SystemStartOptions */
629  BOOL bConsoleBoot = FALSE;
630  LONG rc;
631 
633  L"SYSTEM\\CurrentControlSet\\Control",
634  0,
636  &hControlKey);
637  if (rc != ERROR_SUCCESS)
638  goto cleanup;
639 
640  rc = ReadRegSzKey(hControlKey, L"SystemStartOptions", &pwszSystemStartOptions);
641  if (rc != ERROR_SUCCESS)
642  goto cleanup;
643 
644  /* Check for CONSOLE switch in SystemStartOptions */
645  pwszCurrentOption = pwszSystemStartOptions;
646  while (pwszCurrentOption)
647  {
648  pwszNextOption = wcschr(pwszCurrentOption, L' ');
649  if (pwszNextOption)
650  *pwszNextOption = L'\0';
651  if (wcsicmp(pwszCurrentOption, L"CONSOLE") == 0)
652  {
653  DPRINT("Found %S. Switching to console boot\n", pwszCurrentOption);
654  bConsoleBoot = TRUE;
655  goto cleanup;
656  }
657  pwszCurrentOption = pwszNextOption ? pwszNextOption + 1 : NULL;
658  }
659 
660 cleanup:
661  if (hControlKey != NULL)
662  RegCloseKey(hControlKey);
663  if (pwszSystemStartOptions)
664  HeapFree(GetProcessHeap(), 0, pwszSystemStartOptions);
665  return bConsoleBoot;
666 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define GetProcessHeap()
Definition: compat.h:484
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
#define wcsicmp
Definition: compat.h:15
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
char * cleanup(char *str)
Definition: wpickclick.c:99
static LONG ReadRegSzKey(IN HKEY hKey, IN LPCWSTR pszKey, OUT LPWSTR *pValue)
Definition: install.c:588
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:483
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by CommonInstall().

◆ ReadRegSzKey()

static LONG ReadRegSzKey ( IN HKEY  hKey,
IN LPCWSTR  pszKey,
OUT LPWSTR pValue 
)
static

Definition at line 588 of file install.c.

592 {
593  LONG rc;
594  DWORD dwType;
595  DWORD cbData = 0;
596  LPWSTR pwszValue;
597 
598  if (!pValue)
600 
601  *pValue = NULL;
602  rc = RegQueryValueExW(hKey, pszKey, NULL, &dwType, NULL, &cbData);
603  if (rc != ERROR_SUCCESS)
604  return rc;
605  if (dwType != REG_SZ)
606  return ERROR_FILE_NOT_FOUND;
607  pwszValue = HeapAlloc(GetProcessHeap(), 0, cbData + sizeof(WCHAR));
608  if (!pwszValue)
610  rc = RegQueryValueExW(hKey, pszKey, NULL, NULL, (LPBYTE)pwszValue, &cbData);
611  if (rc != ERROR_SUCCESS)
612  {
613  HeapFree(GetProcessHeap(), 0, pwszValue);
614  return rc;
615  }
616  /* NULL-terminate the string */
617  pwszValue[cbData / sizeof(WCHAR)] = '\0';
618 
619  *pValue = pwszValue;
620  return ERROR_SUCCESS;
621 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
unsigned char * LPBYTE
Definition: typedefs.h:53
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:483
#define REG_SZ
Definition: layer.c:22

Referenced by IsConsoleBoot().

◆ RegisterTypeLibraries()

BOOL RegisterTypeLibraries ( HINF  hinf,
LPCWSTR  szSection 
)

Definition at line 423 of file install.c.

424 {
425  INFCONTEXT InfContext;
426  BOOL res;
429  INT csidl;
430  LPWSTR p;
431  HMODULE hmod;
432  HRESULT hret;
433 
434  /* Begin iterating the entries in the inf section */
435  res = SetupFindFirstLine(hinf, szSection, NULL, &InfContext);
436  if (!res) return FALSE;
437 
438  do
439  {
440  /* Get the name of the current type library */
441  if (!SetupGetStringFieldW(&InfContext, 1, szName, ARRAYSIZE(szName), NULL))
442  {
443  FatalError("SetupGetStringFieldW failed\n");
444  continue;
445  }
446 
447  if (!SetupGetIntField(&InfContext, 2, &csidl))
448  csidl = CSIDL_SYSTEM;
449 
450  hret = SHGetFolderPathW(NULL, csidl, NULL, 0, szPath);
451  if (FAILED(hret))
452  {
453  FatalError("SHGetFolderPathW failed hret=0x%lx\n", hret);
454  continue;
455  }
456 
458  wcscpy(p, szName);
459 
461  if (hmod == NULL)
462  {
463  FatalError("LoadLibraryW failed\n");
464  continue;
465  }
466 
468 
469  } while (SetupFindNextLine(&InfContext, &InfContext));
470 
471  return TRUE;
472 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define SetupFindFirstLine
Definition: setupapi.h:2619
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PathAddBackslash
Definition: shlwapi.h:783
#define LoadLibraryW(x)
Definition: compat.h:495
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:141
LPCWSTR szPath
Definition: env.c:35
BOOL WINAPI SetupFindNextLine(IN PINFCONTEXT ContextIn, OUT PINFCONTEXT ContextOut)
Definition: infsupp.c:80
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208
static const WCHAR szName[]
Definition: msipriv.h:1194
BOOL WINAPI SetupGetIntField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT INT *IntegerValue)
Definition: infsupp.c:146
GLuint res
Definition: glext.h:9613
#define CSIDL_SYSTEM
Definition: shlobj.h:2048
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static VOID FatalError(char *pszFmt,...)
Definition: install.c:43
BOOL WINAPI SetupGetStringFieldW(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PWSTR ReturnBuffer, IN ULONG ReturnBufferSize, OUT PULONG RequiredSize)
Definition: infsupp.c:184

Referenced by InstallLiveCD(), and RegistrationProc().

◆ SaveDefaultUserHive()

static DWORD SaveDefaultUserHive ( VOID  )
static

Definition at line 1117 of file install.c.

1118 {
1119  WCHAR szDefaultUserHive[MAX_PATH];
1120  HKEY hUserKey = NULL;
1121  DWORD cchSize;
1122  DWORD dwError;
1123 
1124  DPRINT("SaveDefaultUserHive()\n");
1125 
1126  cchSize = ARRAYSIZE(szDefaultUserHive);
1127  GetDefaultUserProfileDirectoryW(szDefaultUserHive, &cchSize);
1128 
1129  wcscat(szDefaultUserHive, L"\\ntuser.dat");
1130 
1131  dwError = RegOpenKeyExW(HKEY_USERS,
1132  L".DEFAULT",
1133  0,
1134  KEY_READ,
1135  &hUserKey);
1136  if (dwError != ERROR_SUCCESS)
1137  {
1138  DPRINT1("RegOpenKeyExW() failed (Error %lu)\n", dwError);
1139  return dwError;
1140  }
1141 
1142  pSetupEnablePrivilege(L"SeBackupPrivilege", TRUE);
1143 
1144  /* Save the Default hive */
1145  dwError = RegSaveKeyExW(hUserKey,
1146  szDefaultUserHive,
1147  NULL,
1149  if (dwError == ERROR_ALREADY_EXISTS)
1150  {
1151  WCHAR szBackupHive[MAX_PATH];
1152 
1153  /* Build the backup hive file name by replacing the extension */
1154  wcscpy(szBackupHive, szDefaultUserHive);
1155  wcscpy(&szBackupHive[wcslen(szBackupHive) - 4], L".bak");
1156 
1157  /* Back up the existing default user hive by renaming it, replacing any possible existing old backup */
1158  if (!MoveFileExW(szDefaultUserHive,
1159  szBackupHive,
1161  {
1162  dwError = GetLastError();
1163  DPRINT1("Failed to create a default-user hive backup '%S', MoveFileExW failed (Error %lu)\n",
1164  szBackupHive, dwError);
1165  }
1166  else
1167  {
1168  /* The backup has been done, retry saving the Default hive */
1169  dwError = RegSaveKeyExW(hUserKey,
1170  szDefaultUserHive,
1171  NULL,
1173  }
1174  }
1175  if (dwError != ERROR_SUCCESS)
1176  {
1177  DPRINT1("RegSaveKeyExW() failed (Error %lu)\n", dwError);
1178  }
1179 
1180  pSetupEnablePrivilege(L"SeBackupPrivilege", FALSE);
1181 
1182  RegCloseKey(hUserKey);
1183 
1184  return dwError;
1185 }
#define HKEY_USERS
Definition: winreg.h:13
LONG WINAPI RegSaveKeyExW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD Flags)
Definition: reg.c:4743
BOOL WINAPI GetDefaultUserProfileDirectoryW(_Out_opt_ LPWSTR lpProfileDir, _Inout_ LPDWORD lpcchSize)
Definition: profile.c:1443
#define REG_STANDARD_FORMAT
Definition: cmtypes.h:97
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MOVEFILE_REPLACE_EXISTING
Definition: filesup.h:28
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define FALSE
Definition: types.h:117
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL WINAPI pSetupEnablePrivilege(LPCWSTR lpPrivilegeName, BOOL bEnable)
Definition: misc.c:440
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DPRINT1
Definition: precomp.h:8
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
BOOL WINAPI MoveFileExW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName OPTIONAL, IN DWORD dwFlags)
Definition: move.c:1060
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by InstallReactOS().

◆ SetSetupType()

static BOOL SetSetupType ( DWORD  dwSetupType)
static

Definition at line 815 of file install.c.

816 {
817  DWORD dwError;
818  HKEY hKey;
819 
820  dwError = RegOpenKeyExW(
822  L"SYSTEM\\Setup",
823  0,
825  &hKey);
826  if (dwError != ERROR_SUCCESS)
827  return FALSE;
828 
829  dwError = RegSetValueExW(
830  hKey,
831  L"SetupType",
832  0,
833  REG_DWORD,
834  (LPBYTE)&dwSetupType,
835  sizeof(DWORD));
836  RegCloseKey(hKey);
837  if (dwError != ERROR_SUCCESS)
838  return FALSE;
839 
840  return TRUE;
841 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define TRUE
Definition: types.h:120
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by InstallReactOS().

◆ SetupChangeFontSize()

DWORD WINAPI SetupChangeFontSize ( IN HANDLE  hWnd,
IN LPCWSTR  lpszFontSize 
)

Definition at line 1408 of file install.c.

1411 {
1413  return FALSE;
1414 }
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:500
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

◆ SetupChangeLocale()

DWORD WINAPI SetupChangeLocale ( HWND  hWnd,
LCID  Lcid 
)

Definition at line 1435 of file install.c.

1436 {
1437  return SetupChangeLocaleEx(hWnd, Lcid, NULL, 0, 0, 0);
1438 }
_In_ CONST DEVPROPKEY _In_ LCID Lcid
Definition: iofuncs.h:2410
HWND hWnd
Definition: settings.c:17
DWORD WINAPI SetupChangeLocaleEx(HWND hWnd, LCID Lcid, LPCWSTR lpSrcRootPath, char Unknown, DWORD dwUnused1, DWORD dwUnused2)
Definition: install.c:1420
smooth NULL
Definition: ftsmooth.c:416

◆ SetupChangeLocaleEx()

DWORD WINAPI SetupChangeLocaleEx ( HWND  hWnd,
LCID  Lcid,
LPCWSTR  lpSrcRootPath,
char  Unknown,
DWORD  dwUnused1,
DWORD  dwUnused2 
)

Definition at line 1420 of file install.c.

1426 {
1428  return FALSE;
1429 }
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:500
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102

Referenced by SetupChangeLocale().

◆ SetupStartService()

DWORD WINAPI SetupStartService ( LPCWSTR  lpServiceName,
BOOL  bWait 
)

Definition at line 1443 of file install.c.

1446 {
1447  SC_HANDLE hManager = NULL;
1448  SC_HANDLE hService = NULL;
1449  DWORD dwError = ERROR_SUCCESS;
1450 
1451  hManager = OpenSCManagerW(NULL,
1452  NULL,
1454  if (hManager == NULL)
1455  {
1456  dwError = GetLastError();
1457  goto done;
1458  }
1459 
1460  hService = OpenServiceW(hManager,
1461  lpServiceName,
1462  SERVICE_START);
1463  if (hService == NULL)
1464  {
1465  dwError = GetLastError();
1466  goto done;
1467  }
1468 
1469  if (!StartService(hService, 0, NULL))
1470  {
1471  dwError = GetLastError();
1472  goto done;
1473  }
1474 
1475 done:
1476  if (hService != NULL)
1477  CloseServiceHandle(hService);
1478 
1479  if (hManager != NULL)
1480  CloseServiceHandle(hManager);
1481 
1482  return dwError;
1483 }
#define StartService
Definition: winsvc.h:585
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2103
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:577
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2011
#define SERVICE_START
Definition: winsvc.h:57
#define SC_MANAGER_ALL_ACCESS
Definition: winsvc.h:13

Referenced by InstallLiveCD(), and InstallReactOS().

◆ ShowStatusMessageThread()

static DWORD WINAPI ShowStatusMessageThread ( IN LPVOID  lpParameter)
static

Definition at line 552 of file install.c.

554 {
555  HWND hWnd, hItem;
556  MSG Msg;
558 
563  (LPARAM)NULL);
564  if (!hWnd)
565  return 0;
566 
568 
570  if (hItem)
571  {
573  }
574 
575  /* Message loop for the Status window */
576  while (GetMessage(&Msg, NULL, 0, 0))
577  {
580  }
581 
582  EndDialog(hWnd, 0);
583 
584  return 0;
585 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define DispatchMessage
Definition: winuser.h:5740
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static INT_PTR CALLBACK StatusMessageWindowProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: install.c:528
#define PBM_SETMARQUEE
Definition: commctrl.h:2195
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define IDC_STATUSPROGRESS
Definition: resource.h:81
HWND hWnd
Definition: settings.c:17
struct @1610 Msg[]
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
HTREEITEM hItem
Definition: treelist.h:37
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
LONG_PTR LPARAM
Definition: windef.h:208
#define SW_SHOW
Definition: winuser.h:769
#define PostMessage
Definition: winuser.h:5807
static HINSTANCE hDllInstance
Definition: clb.c:30
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LPVOID lpParameter
Definition: kernel32.h:241
#define IDD_STATUSWINDOW_DLG
Definition: resource.h:79
#define GetMessage
Definition: winuser.h:5765
#define CreateDialogParam
Definition: winuser.h:5727

Referenced by CommonInstall().

◆ StatusMessageWindowProc()

static INT_PTR CALLBACK StatusMessageWindowProc ( IN HWND  hwndDlg,
IN UINT  uMsg,
IN WPARAM  wParam,
IN LPARAM  lParam 
)
static

Definition at line 528 of file install.c.

533 {
535 
536  switch (uMsg)
537  {
538  case WM_INITDIALOG:
539  {
540  WCHAR szMsg[256];
541 
543  return FALSE;
544  SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, szMsg);
545  return TRUE;
546  }
547  }
548  return FALSE;
549 }
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define FALSE
Definition: types.h:117
#define IDS_STATUS_INSTALL_DEV
Definition: resource.h:140
static HINSTANCE hDllInstance
Definition: clb.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_STATUSLABEL
Definition: resource.h:80
#define WM_INITDIALOG
Definition: winuser.h:1721

Referenced by ShowStatusMessageThread().

Variable Documentation

◆ AdminInfo

ADMIN_INFO AdminInfo

Definition at line 38 of file install.c.

Referenced by InstallReactOS(), SetAdministratorPassword(), and SetAutoAdminLogon().

◆ hSysSetupInf