mirror of
https://github.com/reactos/reactos.git
synced 2025-05-18 16:51:18 +00:00
[FORMATTING] Fix indentation
svn path=/trunk/; revision=31366
This commit is contained in:
parent
e1c174281d
commit
0099292d68
1 changed files with 109 additions and 107 deletions
|
@ -25,35 +25,40 @@ GetSetupType(VOID)
|
|||
DWORD dwSize;
|
||||
DWORD dwSetupType;
|
||||
|
||||
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\Setup", //TEXT("SYSTEM\\Setup"),
|
||||
TRACE("GetSetupType()\n");
|
||||
|
||||
/* Open key */
|
||||
dwError = RegOpenKeyExW(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\Setup",
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Read key */
|
||||
dwSize = sizeof(DWORD);
|
||||
dwError = RegQueryValueExW (hKey,
|
||||
L"SetupType", //TEXT("SetupType"),
|
||||
dwError = RegQueryValueExW(
|
||||
hKey,
|
||||
L"SetupType",
|
||||
NULL,
|
||||
&dwType,
|
||||
(LPBYTE)&dwSetupType,
|
||||
&dwSize);
|
||||
RegCloseKey (hKey);
|
||||
if (dwError != ERROR_SUCCESS || dwType != REG_DWORD)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close key, and check if returned values are correct */
|
||||
RegCloseKey(hKey);
|
||||
if (dwError != ERROR_SUCCESS || dwType != REG_DWORD || dwSize != sizeof(DWORD))
|
||||
return 0;
|
||||
|
||||
TRACE("GetSetupType() returns %lu\n", dwSetupType);
|
||||
return dwSetupType;
|
||||
}
|
||||
|
||||
|
||||
static DWORD WINAPI
|
||||
RunSetupThreadProc (IN LPVOID lpParameter)
|
||||
RunSetupThreadProc(
|
||||
IN LPVOID lpParameter)
|
||||
{
|
||||
PROCESS_INFORMATION ProcessInformation;
|
||||
STARTUPINFOW StartupInfo;
|
||||
|
@ -68,18 +73,20 @@ RunSetupThreadProc (IN LPVOID lpParameter)
|
|||
|
||||
TRACE("RunSetup() called\n");
|
||||
|
||||
dwError = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
|
||||
/* Open key */
|
||||
dwError = RegOpenKeyExW(
|
||||
HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\Setup",
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwSize = MAX_PATH;
|
||||
dwError = RegQueryValueExW (hKey,
|
||||
/* Read key */
|
||||
dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1;
|
||||
dwError = RegQueryValueExW(
|
||||
hKey,
|
||||
L"CmdLine",
|
||||
NULL,
|
||||
&dwType,
|
||||
|
@ -87,25 +94,22 @@ RunSetupThreadProc (IN LPVOID lpParameter)
|
|||
&dwSize);
|
||||
RegCloseKey(hKey);
|
||||
if (dwError != ERROR_SUCCESS)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Finish string */
|
||||
Shell[dwSize / sizeof(WCHAR)] = UNICODE_NULL;
|
||||
|
||||
/* Expand string (if applicable) */
|
||||
if (dwType == REG_EXPAND_SZ)
|
||||
{
|
||||
ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH);
|
||||
}
|
||||
else if (dwType == REG_SZ)
|
||||
{
|
||||
wcscpy(CommandLine, Shell);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
TRACE ("Should run '%S' now.\n", CommandLine);
|
||||
TRACE("Should run '%s' now\n", debugstr_w(CommandLine));
|
||||
|
||||
/* Start process */
|
||||
StartupInfo.cb = sizeof(StartupInfo);
|
||||
StartupInfo.lpReserved = NULL;
|
||||
StartupInfo.lpDesktop = NULL;
|
||||
|
@ -113,10 +117,8 @@ RunSetupThreadProc (IN LPVOID lpParameter)
|
|||
StartupInfo.dwFlags = 0;
|
||||
StartupInfo.cbReserved2 = 0;
|
||||
StartupInfo.lpReserved2 = 0;
|
||||
|
||||
TRACE ("Creating new setup process\n");
|
||||
|
||||
Result = CreateProcessW (NULL,
|
||||
Result = CreateProcessW(
|
||||
NULL,
|
||||
CommandLine,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -137,15 +139,15 @@ RunSetupThreadProc (IN LPVOID lpParameter)
|
|||
|
||||
GetExitCodeProcess(ProcessInformation.hProcess, &dwExitCode);
|
||||
|
||||
/* Close handles */
|
||||
CloseHandle(ProcessInformation.hThread);
|
||||
CloseHandle(ProcessInformation.hProcess);
|
||||
|
||||
TRACE ("RunSetup() done.\n");
|
||||
TRACE ("RunSetup() done\n");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOL
|
||||
RunSetup(VOID)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue