mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 00:43:21 +00:00
- Formatting fix. No code changes
svn path=/trunk/; revision=39657
This commit is contained in:
parent
10d8c3ec04
commit
bd6c020071
|
@ -103,8 +103,9 @@ DebugPrint(char* fmt,...)
|
|||
}
|
||||
|
||||
|
||||
BOOL WINAPI
|
||||
InitializeProfiles (VOID)
|
||||
BOOL
|
||||
WINAPI
|
||||
InitializeProfiles(VOID)
|
||||
{
|
||||
WCHAR szProfilesPath[MAX_PATH];
|
||||
WCHAR szProfilePath[MAX_PATH];
|
||||
|
@ -126,7 +127,7 @@ InitializeProfiles (VOID)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
Error = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
|
||||
Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList",
|
||||
0,
|
||||
KEY_SET_VALUE,
|
||||
|
@ -140,7 +141,7 @@ InitializeProfiles (VOID)
|
|||
|
||||
/* Store profiles directory path */
|
||||
dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR);
|
||||
Error = RegSetValueExW (hKey,
|
||||
Error = RegSetValueExW(hKey,
|
||||
L"ProfilesDirectory",
|
||||
0,
|
||||
REG_EXPAND_SZ,
|
||||
|
@ -149,43 +150,43 @@ InitializeProfiles (VOID)
|
|||
if (Error != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("Error: %lu\n", Error);
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
SetLastError((DWORD)Error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Expand it */
|
||||
if (!ExpandEnvironmentStringsW (szBuffer,
|
||||
if (!ExpandEnvironmentStringsW(szBuffer,
|
||||
szProfilesPath,
|
||||
MAX_PATH))
|
||||
{
|
||||
DPRINT1("Error: %lu\n", GetLastError());
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* 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());
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set 'DefaultUserProfile' value */
|
||||
wcscpy (szBuffer, L"Default User");
|
||||
if (!AppendSystemPostfix (szBuffer, MAX_PATH))
|
||||
wcscpy(szBuffer, L"Default User");
|
||||
if (!AppendSystemPostfix(szBuffer, MAX_PATH))
|
||||
{
|
||||
DPRINT1("AppendSystemPostfix() failed\n", GetLastError());
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dwLength = (wcslen (szBuffer) + 1) * sizeof(WCHAR);
|
||||
Error = RegSetValueExW (hKey,
|
||||
Error = RegSetValueExW(hKey,
|
||||
L"DefaultUserProfile",
|
||||
0,
|
||||
REG_SZ,
|
||||
|
@ -194,20 +195,20 @@ InitializeProfiles (VOID)
|
|||
if (Error != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("Error: %lu\n", Error);
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
SetLastError((DWORD)Error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
/* Create 'Default User' profile directory */
|
||||
wcscpy (szProfilePath, szProfilesPath);
|
||||
wcscat (szProfilePath, L"\\");
|
||||
wcscat (szProfilePath, szBuffer);
|
||||
wcscpy(szProfilePath, szProfilesPath);
|
||||
wcscat(szProfilePath, L"\\");
|
||||
wcscat(szProfilePath, szBuffer);
|
||||
if (!CreateDirectoryW (szProfilePath, NULL))
|
||||
{
|
||||
if (GetLastError () != ERROR_ALREADY_EXISTS)
|
||||
if (GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
DPRINT1("Error: %lu\n", GetLastError());
|
||||
return FALSE;
|
||||
|
@ -378,7 +379,6 @@ InitializeProfiles (VOID)
|
|||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
|
||||
/* Set 'AllUsersProfile' value */
|
||||
wcscpy(szBuffer, L"All Users");
|
||||
if (!AppendSystemPostfix(szBuffer, MAX_PATH))
|
||||
|
@ -409,14 +409,13 @@ InitializeProfiles (VOID)
|
|||
if (Error != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("Error: %lu\n", Error);
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
SetLastError((DWORD)Error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
|
||||
/* Create 'All Users' profile directory */
|
||||
wcscpy(szProfilePath, szProfilesPath);
|
||||
wcscat(szProfilePath, L"\\");
|
||||
|
@ -586,7 +585,7 @@ InitializeProfiles (VOID)
|
|||
}
|
||||
|
||||
/* Expand it */
|
||||
if (!ExpandEnvironmentStringsW (szBuffer,
|
||||
if (!ExpandEnvironmentStringsW(szBuffer,
|
||||
szProfilesPath,
|
||||
MAX_PATH))
|
||||
{
|
||||
|
@ -595,7 +594,7 @@ InitializeProfiles (VOID)
|
|||
}
|
||||
|
||||
/* Store it */
|
||||
Error = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
|
||||
Error = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
|
||||
0,
|
||||
KEY_SET_VALUE,
|
||||
|
@ -608,7 +607,7 @@ InitializeProfiles (VOID)
|
|||
}
|
||||
|
||||
dwLength = (wcslen (szProfilesPath) + 1) * sizeof(WCHAR);
|
||||
Error = RegSetValueExW (hKey,
|
||||
Error = RegSetValueExW(hKey,
|
||||
L"ProgramFilesDir",
|
||||
0,
|
||||
REG_SZ,
|
||||
|
@ -617,7 +616,7 @@ InitializeProfiles (VOID)
|
|||
if (Error != ERROR_SUCCESS)
|
||||
{
|
||||
DPRINT1("Error: %lu\n", Error);
|
||||
RegCloseKey (hKey);
|
||||
RegCloseKey(hKey);
|
||||
SetLastError((DWORD)Error);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -625,7 +624,7 @@ InitializeProfiles (VOID)
|
|||
RegCloseKey (hKey);
|
||||
|
||||
/* Create directory */
|
||||
if (!CreateDirectoryW (szProfilesPath, NULL))
|
||||
if (!CreateDirectoryW(szProfilesPath, NULL))
|
||||
{
|
||||
if (GetLastError () != ERROR_ALREADY_EXISTS)
|
||||
{
|
||||
|
@ -634,7 +633,6 @@ InitializeProfiles (VOID)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
DPRINT("Success\n");
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue