- Formatting fix. No code changes

svn path=/trunk/; revision=39657
This commit is contained in:
Dmitry Chapyshev 2009-02-18 14:30:44 +00:00
parent 10d8c3ec04
commit bd6c020071

View file

@ -103,8 +103,9 @@ DebugPrint(char* fmt,...)
} }
BOOL WINAPI BOOL
InitializeProfiles (VOID) WINAPI
InitializeProfiles(VOID)
{ {
WCHAR szProfilesPath[MAX_PATH]; WCHAR szProfilesPath[MAX_PATH];
WCHAR szProfilePath[MAX_PATH]; WCHAR szProfilePath[MAX_PATH];
@ -126,7 +127,7 @@ InitializeProfiles (VOID)
return FALSE; return FALSE;
} }
Error = RegOpenKeyExW (HKEY_LOCAL_MACHINE, Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList", L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
0, 0,
KEY_SET_VALUE, KEY_SET_VALUE,
@ -140,7 +141,7 @@ InitializeProfiles (VOID)
/* Store profiles directory path */ /* Store profiles directory path */
dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR); dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR);
Error = RegSetValueExW (hKey, Error = RegSetValueExW(hKey,
L"ProfilesDirectory", L"ProfilesDirectory",
0, 0,
REG_EXPAND_SZ, REG_EXPAND_SZ,
@ -149,43 +150,43 @@ InitializeProfiles (VOID)
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
DPRINT1("Error: %lu\n", Error); DPRINT1("Error: %lu\n", Error);
RegCloseKey (hKey); RegCloseKey(hKey);
SetLastError((DWORD)Error); SetLastError((DWORD)Error);
return FALSE; return FALSE;
} }
/* Expand it */ /* Expand it */
if (!ExpandEnvironmentStringsW (szBuffer, if (!ExpandEnvironmentStringsW(szBuffer,
szProfilesPath, szProfilesPath,
MAX_PATH)) MAX_PATH))
{ {
DPRINT1("Error: %lu\n", GetLastError()); DPRINT1("Error: %lu\n", GetLastError());
RegCloseKey (hKey); RegCloseKey(hKey);
return FALSE; return FALSE;
} }
/* Create profiles directory */ /* Create profiles directory */
if (!CreateDirectoryW (szProfilesPath, NULL)) if (!CreateDirectoryW(szProfilesPath, NULL))
{ {
if (GetLastError () != ERROR_ALREADY_EXISTS) if (GetLastError() != ERROR_ALREADY_EXISTS)
{ {
DPRINT1("Error: %lu\n", GetLastError()); DPRINT1("Error: %lu\n", GetLastError());
RegCloseKey (hKey); RegCloseKey(hKey);
return FALSE; return FALSE;
} }
} }
/* Set 'DefaultUserProfile' value */ /* Set 'DefaultUserProfile' value */
wcscpy (szBuffer, L"Default User"); wcscpy(szBuffer, L"Default User");
if (!AppendSystemPostfix (szBuffer, MAX_PATH)) if (!AppendSystemPostfix(szBuffer, MAX_PATH))
{ {
DPRINT1("AppendSystemPostfix() failed\n", GetLastError()); DPRINT1("AppendSystemPostfix() failed\n", GetLastError());
RegCloseKey (hKey); RegCloseKey(hKey);
return FALSE; return FALSE;
} }
dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR); dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR);
Error = RegSetValueExW (hKey, Error = RegSetValueExW(hKey,
L"DefaultUserProfile", L"DefaultUserProfile",
0, 0,
REG_SZ, REG_SZ,
@ -194,20 +195,20 @@ InitializeProfiles (VOID)
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
DPRINT1("Error: %lu\n", Error); DPRINT1("Error: %lu\n", Error);
RegCloseKey (hKey); RegCloseKey(hKey);
SetLastError((DWORD)Error); SetLastError((DWORD)Error);
return FALSE; return FALSE;
} }
RegCloseKey (hKey); RegCloseKey(hKey);
/* Create 'Default User' profile directory */ /* Create 'Default User' profile directory */
wcscpy (szProfilePath, szProfilesPath); wcscpy(szProfilePath, szProfilesPath);
wcscat (szProfilePath, L"\\"); wcscat(szProfilePath, L"\\");
wcscat (szProfilePath, szBuffer); wcscat(szProfilePath, szBuffer);
if (!CreateDirectoryW (szProfilePath, NULL)) if (!CreateDirectoryW (szProfilePath, NULL))
{ {
if (GetLastError () != ERROR_ALREADY_EXISTS) if (GetLastError() != ERROR_ALREADY_EXISTS)
{ {
DPRINT1("Error: %lu\n", GetLastError()); DPRINT1("Error: %lu\n", GetLastError());
return FALSE; return FALSE;
@ -378,7 +379,6 @@ InitializeProfiles (VOID)
RegCloseKey(hKey); RegCloseKey(hKey);
/* Set 'AllUsersProfile' value */ /* Set 'AllUsersProfile' value */
wcscpy(szBuffer, L"All Users"); wcscpy(szBuffer, L"All Users");
if (!AppendSystemPostfix(szBuffer, MAX_PATH)) if (!AppendSystemPostfix(szBuffer, MAX_PATH))
@ -409,14 +409,13 @@ InitializeProfiles (VOID)
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
DPRINT1("Error: %lu\n", Error); DPRINT1("Error: %lu\n", Error);
RegCloseKey (hKey); RegCloseKey(hKey);
SetLastError((DWORD)Error); SetLastError((DWORD)Error);
return FALSE; return FALSE;
} }
RegCloseKey(hKey); RegCloseKey(hKey);
/* Create 'All Users' profile directory */ /* Create 'All Users' profile directory */
wcscpy(szProfilePath, szProfilesPath); wcscpy(szProfilePath, szProfilesPath);
wcscat(szProfilePath, L"\\"); wcscat(szProfilePath, L"\\");
@ -586,7 +585,7 @@ InitializeProfiles (VOID)
} }
/* Expand it */ /* Expand it */
if (!ExpandEnvironmentStringsW (szBuffer, if (!ExpandEnvironmentStringsW(szBuffer,
szProfilesPath, szProfilesPath,
MAX_PATH)) MAX_PATH))
{ {
@ -595,7 +594,7 @@ InitializeProfiles (VOID)
} }
/* Store it */ /* Store it */
Error = RegOpenKeyExW (HKEY_LOCAL_MACHINE, Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion", L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
0, 0,
KEY_SET_VALUE, KEY_SET_VALUE,
@ -608,7 +607,7 @@ InitializeProfiles (VOID)
} }
dwLength = (wcslen (szProfilesPath) + 1) * sizeof(WCHAR); dwLength = (wcslen (szProfilesPath) + 1) * sizeof(WCHAR);
Error = RegSetValueExW (hKey, Error = RegSetValueExW(hKey,
L"ProgramFilesDir", L"ProgramFilesDir",
0, 0,
REG_SZ, REG_SZ,
@ -617,7 +616,7 @@ InitializeProfiles (VOID)
if (Error != ERROR_SUCCESS) if (Error != ERROR_SUCCESS)
{ {
DPRINT1("Error: %lu\n", Error); DPRINT1("Error: %lu\n", Error);
RegCloseKey (hKey); RegCloseKey(hKey);
SetLastError((DWORD)Error); SetLastError((DWORD)Error);
return FALSE; return FALSE;
} }
@ -625,7 +624,7 @@ InitializeProfiles (VOID)
RegCloseKey (hKey); RegCloseKey (hKey);
/* Create directory */ /* Create directory */
if (!CreateDirectoryW (szProfilesPath, NULL)) if (!CreateDirectoryW(szProfilesPath, NULL))
{ {
if (GetLastError () != ERROR_ALREADY_EXISTS) if (GetLastError () != ERROR_ALREADY_EXISTS)
{ {
@ -634,7 +633,6 @@ InitializeProfiles (VOID)
} }
} }
DPRINT("Success\n"); DPRINT("Success\n");
return TRUE; return TRUE;