[FORMATTING] Fix indentation

svn path=/trunk/; revision=31366
This commit is contained in:
Hervé Poussineau 2007-12-21 10:06:46 +00:00
parent e1c174281d
commit 0099292d68

View file

@ -25,35 +25,40 @@ GetSetupType(VOID)
DWORD dwSize; DWORD dwSize;
DWORD dwSetupType; DWORD dwSetupType;
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, TRACE("GetSetupType()\n");
L"SYSTEM\\Setup", //TEXT("SYSTEM\\Setup"),
/* Open key */
dwError = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
L"SYSTEM\\Setup",
0, 0,
KEY_QUERY_VALUE, KEY_QUERY_VALUE,
&hKey); &hKey);
if (dwError != ERROR_SUCCESS) if (dwError != ERROR_SUCCESS)
{
return 0; return 0;
}
/* Read key */
dwSize = sizeof(DWORD); dwSize = sizeof(DWORD);
dwError = RegQueryValueExW (hKey, dwError = RegQueryValueExW(
L"SetupType", //TEXT("SetupType"), hKey,
L"SetupType",
NULL, NULL,
&dwType, &dwType,
(LPBYTE)&dwSetupType, (LPBYTE)&dwSetupType,
&dwSize); &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; return dwSetupType;
} }
static DWORD WINAPI static DWORD WINAPI
RunSetupThreadProc (IN LPVOID lpParameter) RunSetupThreadProc(
IN LPVOID lpParameter)
{ {
PROCESS_INFORMATION ProcessInformation; PROCESS_INFORMATION ProcessInformation;
STARTUPINFOW StartupInfo; STARTUPINFOW StartupInfo;
@ -68,18 +73,20 @@ RunSetupThreadProc (IN LPVOID lpParameter)
TRACE("RunSetup() called\n"); TRACE("RunSetup() called\n");
dwError = RegOpenKeyExW (HKEY_LOCAL_MACHINE, /* Open key */
dwError = RegOpenKeyExW(
HKEY_LOCAL_MACHINE,
L"SYSTEM\\Setup", L"SYSTEM\\Setup",
0, 0,
KEY_QUERY_VALUE, KEY_QUERY_VALUE,
&hKey); &hKey);
if (dwError != ERROR_SUCCESS) if (dwError != ERROR_SUCCESS)
{
return FALSE; return FALSE;
}
dwSize = MAX_PATH; /* Read key */
dwError = RegQueryValueExW (hKey, dwSize = (sizeof(Shell) / sizeof(Shell[0])) - 1;
dwError = RegQueryValueExW(
hKey,
L"CmdLine", L"CmdLine",
NULL, NULL,
&dwType, &dwType,
@ -87,25 +94,22 @@ RunSetupThreadProc (IN LPVOID lpParameter)
&dwSize); &dwSize);
RegCloseKey(hKey); RegCloseKey(hKey);
if (dwError != ERROR_SUCCESS) if (dwError != ERROR_SUCCESS)
{
return FALSE; return FALSE;
}
/* Finish string */
Shell[dwSize / sizeof(WCHAR)] = UNICODE_NULL;
/* Expand string (if applicable) */
if (dwType == REG_EXPAND_SZ) if (dwType == REG_EXPAND_SZ)
{
ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH); ExpandEnvironmentStringsW(Shell, CommandLine, MAX_PATH);
}
else if (dwType == REG_SZ) else if (dwType == REG_SZ)
{
wcscpy(CommandLine, Shell); wcscpy(CommandLine, Shell);
}
else else
{
return FALSE; 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.cb = sizeof(StartupInfo);
StartupInfo.lpReserved = NULL; StartupInfo.lpReserved = NULL;
StartupInfo.lpDesktop = NULL; StartupInfo.lpDesktop = NULL;
@ -113,10 +117,8 @@ RunSetupThreadProc (IN LPVOID lpParameter)
StartupInfo.dwFlags = 0; StartupInfo.dwFlags = 0;
StartupInfo.cbReserved2 = 0; StartupInfo.cbReserved2 = 0;
StartupInfo.lpReserved2 = 0; StartupInfo.lpReserved2 = 0;
Result = CreateProcessW(
TRACE ("Creating new setup process\n"); NULL,
Result = CreateProcessW (NULL,
CommandLine, CommandLine,
NULL, NULL,
NULL, NULL,
@ -137,15 +139,15 @@ RunSetupThreadProc (IN LPVOID lpParameter)
GetExitCodeProcess(ProcessInformation.hProcess, &dwExitCode); GetExitCodeProcess(ProcessInformation.hProcess, &dwExitCode);
/* Close handles */
CloseHandle(ProcessInformation.hThread); CloseHandle(ProcessInformation.hThread);
CloseHandle(ProcessInformation.hProcess); CloseHandle(ProcessInformation.hProcess);
TRACE ("RunSetup() done.\n"); TRACE ("RunSetup() done\n");
return TRUE; return TRUE;
} }
BOOL BOOL
RunSetup(VOID) RunSetup(VOID)
{ {