[USERENV]
authorEric Kohl <eric.kohl@reactos.org>
Thu, 24 Oct 2013 20:16:20 +0000 (20:16 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 24 Oct 2013 20:16:20 +0000 (20:16 +0000)
Fix coding style and indentation. No code changes!

svn path=/trunk/; revision=60744

reactos/dll/win32/userenv/desktop.c
reactos/dll/win32/userenv/directory.c
reactos/dll/win32/userenv/environment.c
reactos/dll/win32/userenv/gpolicy.c
reactos/dll/win32/userenv/internal.h
reactos/dll/win32/userenv/misc.c
reactos/dll/win32/userenv/profile.c
reactos/dll/win32/userenv/registry.c
reactos/dll/win32/userenv/resources.h
reactos/dll/win32/userenv/setup.c
reactos/dll/win32/userenv/userenv.c

index 5d1223c..a8ca97a 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/desktop.c
+ * FILE:            dll/win32/userenv/desktop.c
  * PURPOSE:         Desktop and start menu support functions.
  * PROGRAMMER:      Eric Kohl
  */
 
 /* FUNCTIONS ***************************************************************/
 
-static BOOL
-GetDesktopPath (BOOL bCommonPath,
-               LPWSTR lpDesktopPath)
+static
+BOOL
+GetDesktopPath(BOOL bCommonPath,
+               LPWSTR lpDesktopPath)
 {
-  WCHAR szPath[MAX_PATH];
-  DWORD dwLength;
-  DWORD dwType;
-  HKEY hKey;
-  LONG Error;
-
-  DPRINT ("GetDesktopPath() called\n");
-
-  Error = RegOpenKeyExW (HKEY_CURRENT_USER,
-                        L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
-                        0,
-                        KEY_QUERY_VALUE,
-                        &hKey);
-  if (Error != ERROR_SUCCESS)
-    {
-      DPRINT1 ("RegOpenKeyExW() failed\n");
-      SetLastError((DWORD)Error);
-      return FALSE;
+    WCHAR szPath[MAX_PATH];
+    DWORD dwLength;
+    DWORD dwType;
+    HKEY hKey;
+    LONG Error;
+
+    DPRINT("GetDesktopPath() called\n");
+
+    Error = RegOpenKeyExW(HKEY_CURRENT_USER,
+                          L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
+                          0,
+                          KEY_QUERY_VALUE,
+                          &hKey);
+    if (Error != ERROR_SUCCESS)
+    {
+        DPRINT1("RegOpenKeyExW() failed\n");
+        SetLastError((DWORD)Error);
+        return FALSE;
     }
 
-  dwLength = MAX_PATH * sizeof(WCHAR);
-  Error = RegQueryValueExW (hKey,
-                           bCommonPath ? L"Common Desktop" : L"Desktop",
-                           0,
-                           &dwType,
-                           (LPBYTE)szPath,
-                          &dwLength);
-  if (Error != ERROR_SUCCESS)
+    dwLength = MAX_PATH * sizeof(WCHAR);
+    Error = RegQueryValueExW(hKey,
+                             bCommonPath ? L"Common Desktop" : L"Desktop",
+                             0,
+                             &dwType,
+                             (LPBYTE)szPath,
+                             &dwLength);
+    if (Error != ERROR_SUCCESS)
     {
-      DPRINT1 ("RegQueryValueExW() failed\n");
-      RegCloseKey (hKey);
-      SetLastError((DWORD)Error);
-      return FALSE;
+        DPRINT1("RegQueryValueExW() failed\n");
+        RegCloseKey(hKey);
+        SetLastError((DWORD)Error);
+        return FALSE;
     }
 
-  RegCloseKey (hKey);
+    RegCloseKey(hKey);
 
-  if (dwType == REG_EXPAND_SZ)
+    if (dwType == REG_EXPAND_SZ)
     {
-      ExpandEnvironmentStringsW (szPath,
-                                lpDesktopPath,
-                                MAX_PATH);
+        ExpandEnvironmentStringsW(szPath,
+                                  lpDesktopPath,
+                                  MAX_PATH);
     }
-  else
+    else
     {
-      wcscpy (lpDesktopPath, szPath);
+        wcscpy(lpDesktopPath, szPath);
     }
 
-  DPRINT ("GetDesktopPath() done\n");
+    DPRINT("GetDesktopPath() done\n");
 
-  return TRUE;
+    return TRUE;
 }
 
 
-static BOOL
-GetProgramsPath (BOOL bCommonPath,
-                LPWSTR lpProgramsPath)
+static
+BOOL
+GetProgramsPath(BOOL bCommonPath,
+                LPWSTR lpProgramsPath)
 {
-  WCHAR szPath[MAX_PATH];
-  DWORD dwLength;
-  DWORD dwType;
-  HKEY hKey;
-  LONG Error;
-
-  DPRINT ("GetProgramsPath() called\n");
-
-  Error = RegOpenKeyExW (HKEY_CURRENT_USER,
-                        L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
-                        0,
-                        KEY_QUERY_VALUE,
-                        &hKey);
-  if (Error != ERROR_SUCCESS)
-    {
-      DPRINT1 ("RegOpenKeyExW() failed\n");
-      SetLastError((DWORD)Error);
-      return FALSE;
+    WCHAR szPath[MAX_PATH];
+    DWORD dwLength;
+    DWORD dwType;
+    HKEY hKey;
+    LONG Error;
+
+    DPRINT("GetProgramsPath() called\n");
+
+    Error = RegOpenKeyExW(HKEY_CURRENT_USER,
+                          L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders",
+                          0,
+                          KEY_QUERY_VALUE,
+                          &hKey);
+    if (Error != ERROR_SUCCESS)
+    {
+        DPRINT1("RegOpenKeyExW() failed\n");
+        SetLastError((DWORD)Error);
+        return FALSE;
     }
 
-  dwLength = MAX_PATH * sizeof(WCHAR);
-  Error = RegQueryValueExW (hKey,
-                           bCommonPath ? L"Common Programs" : L"Programs",
-                           0,
-                           &dwType,
-                           (LPBYTE)szPath,
-                           &dwLength);
-  if (Error != ERROR_SUCCESS)
+    dwLength = MAX_PATH * sizeof(WCHAR);
+    Error = RegQueryValueExW(hKey,
+                             bCommonPath ? L"Common Programs" : L"Programs",
+                             0,
+                             &dwType,
+                             (LPBYTE)szPath,
+                             &dwLength);
+    if (Error != ERROR_SUCCESS)
     {
-      DPRINT1 ("RegQueryValueExW() failed\n");
-      RegCloseKey (hKey);
-      SetLastError((DWORD)Error);
-      return FALSE;
+        DPRINT1("RegQueryValueExW() failed\n");
+        RegCloseKey(hKey);
+        SetLastError((DWORD)Error);
+        return FALSE;
     }
 
-  RegCloseKey (hKey);
+    RegCloseKey(hKey);
 
-  if (dwType == REG_EXPAND_SZ)
+    if (dwType == REG_EXPAND_SZ)
     {
-      ExpandEnvironmentStringsW (szPath,
-                                lpProgramsPath,
-                                MAX_PATH);
+        ExpandEnvironmentStringsW(szPath,
+                                  lpProgramsPath,
+                                  MAX_PATH);
     }
-  else
+    else
     {
-      wcscpy (lpProgramsPath,
-             szPath);
+        wcscpy(lpProgramsPath,
+               szPath);
     }
 
-  DPRINT ("GetProgramsPath() done\n");
+    DPRINT("GetProgramsPath() done\n");
 
-  return TRUE;
+    return TRUE;
 }
 
 
-BOOL WINAPI
-AddDesktopItemA (BOOL bCommonItem,
-                LPCSTR lpItemName,
-                LPCSTR lpArguments,
-                LPCSTR lpIconLocation,
-                INT iIcon,
-                LPCSTR lpWorkingDirectory, /* Optional */
-                WORD wHotKey,
-                INT iShowCmd)
+BOOL
+WINAPI
+AddDesktopItemA(BOOL bCommonItem,
+                LPCSTR lpItemName,
+                LPCSTR lpArguments,
+                LPCSTR lpIconLocation,
+                INT iIcon,
+                LPCSTR lpWorkingDirectory, /* Optional */
+                WORD wHotKey,
+                INT iShowCmd)
 {
-  UNICODE_STRING ItemName;
-  UNICODE_STRING Arguments;
-  UNICODE_STRING IconLocation;
-  UNICODE_STRING WorkingDirectory;
-  BOOL bResult;
+    UNICODE_STRING ItemName;
+    UNICODE_STRING Arguments;
+    UNICODE_STRING IconLocation;
+    UNICODE_STRING WorkingDirectory;
+    BOOL bResult;
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
-                                        (LPSTR)lpItemName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
+                                          (LPSTR)lpItemName))
     {
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&Arguments,
-                                        (LPSTR)lpArguments))
+    if (!RtlCreateUnicodeStringFromAsciiz(&Arguments,
+                                          (LPSTR)lpArguments))
     {
-      RtlFreeUnicodeString(&ItemName);
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        RtlFreeUnicodeString(&ItemName);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&IconLocation,
-                                        (LPSTR)lpIconLocation))
+    if (!RtlCreateUnicodeStringFromAsciiz(&IconLocation,
+                                          (LPSTR)lpIconLocation))
     {
-      RtlFreeUnicodeString(&Arguments);
-      RtlFreeUnicodeString(&ItemName);
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        RtlFreeUnicodeString(&Arguments);
+        RtlFreeUnicodeString(&ItemName);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (lpWorkingDirectory != NULL)
+    if (lpWorkingDirectory != NULL)
     {
-      if (!RtlCreateUnicodeStringFromAsciiz(&WorkingDirectory,
-                                            (LPSTR)lpWorkingDirectory))
-       {
-         RtlFreeUnicodeString(&IconLocation);
-         RtlFreeUnicodeString(&Arguments);
-         RtlFreeUnicodeString(&ItemName);
-         SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
+        if (!RtlCreateUnicodeStringFromAsciiz(&WorkingDirectory,
+                                              (LPSTR)lpWorkingDirectory))
+        {
+            RtlFreeUnicodeString(&IconLocation);
+            RtlFreeUnicodeString(&Arguments);
+            RtlFreeUnicodeString(&ItemName);
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
     }
 
-  bResult = AddDesktopItemW(bCommonItem,
-                           ItemName.Buffer,
-                           Arguments.Buffer,
-                           IconLocation.Buffer,
-                           iIcon,
-                           (lpWorkingDirectory != NULL) ? WorkingDirectory.Buffer : NULL,
-                           wHotKey,
-                           iShowCmd);
+    bResult = AddDesktopItemW(bCommonItem,
+                              ItemName.Buffer,
+                              Arguments.Buffer,
+                              IconLocation.Buffer,
+                              iIcon,
+                              (lpWorkingDirectory != NULL) ? WorkingDirectory.Buffer : NULL,
+                              wHotKey,
+                              iShowCmd);
 
-  if (lpWorkingDirectory != NULL)
+    if (lpWorkingDirectory != NULL)
     {
-      RtlFreeUnicodeString(&WorkingDirectory);
+        RtlFreeUnicodeString(&WorkingDirectory);
     }
 
-  RtlFreeUnicodeString(&IconLocation);
-  RtlFreeUnicodeString(&Arguments);
-  RtlFreeUnicodeString(&ItemName);
+    RtlFreeUnicodeString(&IconLocation);
+    RtlFreeUnicodeString(&Arguments);
+    RtlFreeUnicodeString(&ItemName);
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-AddDesktopItemW (BOOL bCommonDesktop,
-                LPCWSTR lpItemName,
-                LPCWSTR lpArguments,
-                LPCWSTR lpIconLocation,
-                INT iIcon,
-                LPCWSTR lpWorkingDirectory,  /* Optional */
-                WORD wHotKey,
-                INT iShowCmd)
+BOOL
+WINAPI
+AddDesktopItemW(BOOL bCommonDesktop,
+                LPCWSTR lpItemName,
+                LPCWSTR lpArguments,
+                LPCWSTR lpIconLocation,
+                INT iIcon,
+                LPCWSTR lpWorkingDirectory,  /* Optional */
+                WORD wHotKey,
+                INT iShowCmd)
 {
-  DYN_FUNCS Ole32;
-  WCHAR szLinkPath[MAX_PATH];
-  WCHAR szArguments[MAX_PATH];
-  WCHAR szCommand[MAX_PATH];
-  WIN32_FIND_DATAW FindData;
-  HANDLE hFind;
-  LPWSTR Ptr;
-  DWORD dwLength;
-  IShellLinkW* psl;
-  IPersistFile* ppf;
-  HRESULT hr;
-  BOOL bResult;
-
-  DPRINT ("AddDesktopItemW() called\n");
-
-  bResult = FALSE;
-
-  if (!GetDesktopPath (bCommonDesktop, szLinkPath))
-    {
-      DPRINT1 ("GetDesktopPath() failed\n");
-      return FALSE;
+    DYN_FUNCS Ole32;
+    WCHAR szLinkPath[MAX_PATH];
+    WCHAR szArguments[MAX_PATH];
+    WCHAR szCommand[MAX_PATH];
+    WIN32_FIND_DATAW FindData;
+    HANDLE hFind;
+    LPWSTR Ptr;
+    DWORD dwLength;
+    IShellLinkW* psl;
+    IPersistFile* ppf;
+    HRESULT hr;
+    BOOL bResult;
+
+    DPRINT("AddDesktopItemW() called\n");
+
+    bResult = FALSE;
+
+    if (!GetDesktopPath(bCommonDesktop, szLinkPath))
+    {
+        DPRINT1("GetDesktopPath() failed\n");
+        return FALSE;
     }
-  DPRINT ("Desktop path: '%S'\n", szLinkPath);
+    DPRINT("Desktop path: '%S'\n", szLinkPath);
 
-  /* Make sure the path exists */
-  hFind = FindFirstFileW (szLinkPath,
-                         &FindData);
-  if (hFind == INVALID_HANDLE_VALUE)
+    /* Make sure the path exists */
+    hFind = FindFirstFileW(szLinkPath,
+                           &FindData);
+    if (hFind == INVALID_HANDLE_VALUE)
     {
-      DPRINT ("'%S' does not exist\n", szLinkPath);
+        DPRINT("'%S' does not exist\n", szLinkPath);
 
-      /* Create directory path */
-      if (!CreateDirectoryPath (szLinkPath, NULL))
-        return FALSE;
+        /* Create directory path */
+        if (!CreateDirectoryPath(szLinkPath, NULL))
+            return FALSE;
     }
-  else
+    else
     {
-      DPRINT ("'%S' exists\n", szLinkPath);
-      FindClose (hFind);
+        DPRINT("'%S' exists\n", szLinkPath);
+        FindClose(hFind);
     }
 
-  /* Append backslash, item name and ".lnk" extension */
-  wcscat (szLinkPath, L"\\");
-  wcscat (szLinkPath, lpItemName);
-  wcscat (szLinkPath, L".lnk");
-  DPRINT ("Link path: '%S'\n", szLinkPath);
+    /* Append backslash, item name and ".lnk" extension */
+    wcscat(szLinkPath, L"\\");
+    wcscat(szLinkPath, lpItemName);
+    wcscat(szLinkPath, L".lnk");
+    DPRINT("Link path: '%S'\n", szLinkPath);
 
-  /* Split 'lpArguments' string into command and arguments */
-  Ptr = wcschr (lpArguments, L' ');
-  DPRINT ("Ptr %p  lpArguments %p\n", Ptr, lpArguments);
-  if (Ptr != NULL)
+    /* Split 'lpArguments' string into command and arguments */
+    Ptr = wcschr(lpArguments, L' ');
+    DPRINT("Ptr %p  lpArguments %p\n", Ptr, lpArguments);
+    if (Ptr != NULL)
     {
-      dwLength = (DWORD)(Ptr - lpArguments);
-      DPRINT ("dwLength %lu\n", dwLength);
-      memcpy (szCommand, lpArguments, dwLength * sizeof(WCHAR));
-      szCommand[dwLength] = 0;
-      Ptr++;
-      wcscpy (szArguments, Ptr);
+        dwLength = (DWORD)(Ptr - lpArguments);
+        DPRINT("dwLength %lu\n", dwLength);
+        memcpy(szCommand, lpArguments, dwLength * sizeof(WCHAR));
+        szCommand[dwLength] = 0;
+        Ptr++;
+        wcscpy(szArguments, Ptr);
     }
-  else
+    else
     {
-      wcscpy (szCommand, lpArguments);
-      szArguments[0] = 0;
+        wcscpy(szCommand, lpArguments);
+        szArguments[0] = 0;
     }
-  DPRINT ("szCommand: '%S'\n", szCommand);
-  DPRINT ("szArguments: '%S'\n", szArguments);
+    DPRINT("szCommand: '%S'\n", szCommand);
+    DPRINT("szArguments: '%S'\n", szArguments);
 
-  /* Dynamically load ole32.dll */
-  if (!LoadDynamicImports(&DynOle32, &Ole32))
+    /* Dynamically load ole32.dll */
+    if (!LoadDynamicImports(&DynOle32, &Ole32))
     {
-      DPRINT1("USERENV: Unable to load OLE32.DLL\n");
-      return FALSE;
+        DPRINT1("USERENV: Unable to load OLE32.DLL\n");
+        return FALSE;
     }
 
-  Ole32.fn.CoInitialize(NULL);
+    Ole32.fn.CoInitialize(NULL);
 
-  hr = Ole32.fn.CoCreateInstance(&CLSID_ShellLink,
-                                 NULL,
-                                 CLSCTX_INPROC_SERVER,
-                                 &IID_IShellLinkW,
-                                 (LPVOID*)&psl);
-  if (!SUCCEEDED(hr))
+    hr = Ole32.fn.CoCreateInstance(&CLSID_ShellLink,
+                                   NULL,
+                                   CLSCTX_INPROC_SERVER,
+                                   &IID_IShellLinkW,
+                                   (LPVOID*)&psl);
+    if (!SUCCEEDED(hr))
     {
-      Ole32.fn.CoUninitialize();
-      UnloadDynamicImports(&Ole32);
-      return FALSE;
+        Ole32.fn.CoUninitialize();
+        UnloadDynamicImports(&Ole32);
+        return FALSE;
     }
 
-  hr = psl->lpVtbl->QueryInterface(psl,
-                                   &IID_IPersistFile,
-                                   (LPVOID*)&ppf);
-  if (SUCCEEDED(hr))
+    hr = psl->lpVtbl->QueryInterface(psl,
+                                     &IID_IPersistFile,
+                                     (LPVOID*)&ppf);
+    if (SUCCEEDED(hr))
     {
-      psl->lpVtbl->SetDescription(psl,
-                                  lpItemName);
+        psl->lpVtbl->SetDescription(psl,
+                                    lpItemName);
 
-      psl->lpVtbl->SetPath(psl,
-                           szCommand);
+        psl->lpVtbl->SetPath(psl,
+                             szCommand);
 
-      psl->lpVtbl->SetArguments(psl,
-                                szArguments);
+        psl->lpVtbl->SetArguments(psl,
+                                  szArguments);
 
-      psl->lpVtbl->SetIconLocation(psl,
-                                   lpIconLocation,
-                                   iIcon);
+        psl->lpVtbl->SetIconLocation(psl,
+                                     lpIconLocation,
+                                     iIcon);
 
-      if (lpWorkingDirectory != NULL)
+        if (lpWorkingDirectory != NULL)
         {
-          psl->lpVtbl->SetWorkingDirectory(psl,
-                                           lpWorkingDirectory);
+            psl->lpVtbl->SetWorkingDirectory(psl,
+                                             lpWorkingDirectory);
         }
-      else
+        else
         {
-          psl->lpVtbl->SetWorkingDirectory(psl,
-                                           L"%HOMEDRIVE%%HOMEPATH%");
+            psl->lpVtbl->SetWorkingDirectory(psl,
+                                             L"%HOMEDRIVE%%HOMEPATH%");
         }
 
-      psl->lpVtbl->SetHotkey(psl,
-                             wHotKey);
+        psl->lpVtbl->SetHotkey(psl,
+                               wHotKey);
 
-      psl->lpVtbl->SetShowCmd(psl,
-                              iShowCmd);
+        psl->lpVtbl->SetShowCmd(psl,
+                                iShowCmd);
 
-      hr = ppf->lpVtbl->Save(ppf,
-                             szLinkPath,
-                             TRUE);
-      if (SUCCEEDED(hr))
-        bResult = TRUE;
+        hr = ppf->lpVtbl->Save(ppf,
+                               szLinkPath,
+                               TRUE);
+        if (SUCCEEDED(hr))
+            bResult = TRUE;
 
-      ppf->lpVtbl->Release(ppf);
+        ppf->lpVtbl->Release(ppf);
     }
 
-  psl->lpVtbl->Release(psl);
+    psl->lpVtbl->Release(psl);
 
-  Ole32.fn.CoUninitialize();
+    Ole32.fn.CoUninitialize();
 
-  UnloadDynamicImports(&Ole32);
+    UnloadDynamicImports(&Ole32);
 
-  DPRINT ("AddDesktopItemW() done\n");
+    DPRINT("AddDesktopItemW() done\n");
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-DeleteDesktopItemA (BOOL bCommonItem,
-                   LPCSTR lpItemName)
+BOOL
+WINAPI
+DeleteDesktopItemA(BOOL bCommonItem,
+                   LPCSTR lpItemName)
 {
-  UNICODE_STRING ItemName;
-  BOOL bResult;
+    UNICODE_STRING ItemName;
+    BOOL bResult;
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
-                                        (LPSTR)lpItemName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
+                                          (LPSTR)lpItemName))
     {
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  bResult = DeleteDesktopItemW(bCommonItem,
-                              ItemName.Buffer);
+    bResult = DeleteDesktopItemW(bCommonItem,
+                                 ItemName.Buffer);
 
-  RtlFreeUnicodeString(&ItemName);
+    RtlFreeUnicodeString(&ItemName);
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-DeleteDesktopItemW (BOOL bCommonItem,
-                   LPCWSTR lpItemName)
+BOOL
+WINAPI
+DeleteDesktopItemW(BOOL bCommonItem,
+                   LPCWSTR lpItemName)
 {
-  WCHAR szLinkPath[MAX_PATH];
+    WCHAR szLinkPath[MAX_PATH];
 
-  DPRINT ("DeleteDesktopItemW() called\n");
+    DPRINT("DeleteDesktopItemW() called\n");
 
-  if (!GetDesktopPath (bCommonItem, szLinkPath))
+    if (!GetDesktopPath(bCommonItem, szLinkPath))
     {
-      DPRINT1 ("GetDesktopPath() failed\n");
-      return FALSE;
+        DPRINT1("GetDesktopPath() failed\n");
+        return FALSE;
     }
 
-  wcscat (szLinkPath, L"\\");
-  wcscat (szLinkPath, lpItemName);
-  wcscat (szLinkPath, L".lnk");
-  DPRINT ("Link path: '%S'\n", szLinkPath);
+    wcscat(szLinkPath, L"\\");
+    wcscat(szLinkPath, lpItemName);
+    wcscat(szLinkPath, L".lnk");
+    DPRINT("Link path: '%S'\n", szLinkPath);
 
-  return DeleteFileW (szLinkPath);
+    return DeleteFileW (szLinkPath);
 }
 
 
-BOOL WINAPI
-CreateGroupA (LPCSTR lpGroupName,
-             BOOL bCommonGroup)
+BOOL
+WINAPI
+CreateGroupA(LPCSTR lpGroupName,
+             BOOL bCommonGroup)
 {
-  UNICODE_STRING GroupName;
-  BOOL bResult;
+    UNICODE_STRING GroupName;
+    BOOL bResult;
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
-                                        (LPSTR)lpGroupName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
+                                          (LPSTR)lpGroupName))
     {
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  bResult = CreateGroupW(GroupName.Buffer, bCommonGroup);
+    bResult = CreateGroupW(GroupName.Buffer, bCommonGroup);
 
-  RtlFreeUnicodeString(&GroupName);
+    RtlFreeUnicodeString(&GroupName);
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-CreateGroupW (LPCWSTR lpGroupName,
-             BOOL bCommonGroup)
+BOOL
+WINAPI
+CreateGroupW(LPCWSTR lpGroupName,
+             BOOL bCommonGroup)
 {
-  WCHAR szGroupPath[MAX_PATH];
+    WCHAR szGroupPath[MAX_PATH];
 
-  DPRINT1 ("CreateGroupW() called\n");
+    DPRINT1("CreateGroupW() called\n");
 
-  if (lpGroupName == NULL || *lpGroupName == 0)
-    return TRUE;
+    if (lpGroupName == NULL || *lpGroupName == 0)
+        return TRUE;
 
-  if (!GetProgramsPath (bCommonGroup, szGroupPath))
+    if (!GetProgramsPath(bCommonGroup, szGroupPath))
     {
-      DPRINT1 ("GetProgramsPath() failed\n");
-      return FALSE;
+        DPRINT1("GetProgramsPath() failed\n");
+        return FALSE;
     }
-  DPRINT1 ("Programs path: '%S'\n", szGroupPath);
+    DPRINT1("Programs path: '%S'\n", szGroupPath);
 
-  wcscat (szGroupPath, L"\\");
-  wcscat (szGroupPath, lpGroupName);
-  DPRINT1 ("Group path: '%S'\n", szGroupPath);
+    wcscat(szGroupPath, L"\\");
+    wcscat(szGroupPath, lpGroupName);
+    DPRINT1("Group path: '%S'\n", szGroupPath);
 
-  /* Create directory path */
-  if (!CreateDirectoryPath (szGroupPath, NULL))
-    return FALSE;
+    /* Create directory path */
+    if (!CreateDirectoryPath (szGroupPath, NULL))
+        return FALSE;
 
-  /* FIXME: Notify the shell */
+    /* FIXME: Notify the shell */
 
-  DPRINT1 ("CreateGroupW() done\n");
+    DPRINT1("CreateGroupW() done\n");
 
-  return TRUE;
+    return TRUE;
 }
 
 
-BOOL WINAPI
-DeleteGroupA (LPCSTR lpGroupName,
-             BOOL bCommonGroup)
+BOOL
+WINAPI
+DeleteGroupA(LPCSTR lpGroupName,
+             BOOL bCommonGroup)
 {
-  UNICODE_STRING GroupName;
-  BOOL bResult;
+    UNICODE_STRING GroupName;
+    BOOL bResult;
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
-                                        (LPSTR)lpGroupName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
+                                          (LPSTR)lpGroupName))
     {
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  bResult = DeleteGroupW(GroupName.Buffer, bCommonGroup);
+    bResult = DeleteGroupW(GroupName.Buffer, bCommonGroup);
 
-  RtlFreeUnicodeString(&GroupName);
+    RtlFreeUnicodeString(&GroupName);
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-DeleteGroupW (LPCWSTR lpGroupName,
-             BOOL bCommonGroup)
+BOOL
+WINAPI
+DeleteGroupW(LPCWSTR lpGroupName,
+             BOOL bCommonGroup)
 {
-  WCHAR szGroupPath[MAX_PATH];
+    WCHAR szGroupPath[MAX_PATH];
 
-  DPRINT ("DeleteGroupW() called\n");
+    DPRINT("DeleteGroupW() called\n");
 
-  if (lpGroupName == NULL || *lpGroupName == 0)
-    return TRUE;
+    if (lpGroupName == NULL || *lpGroupName == 0)
+        return TRUE;
 
-  if (!GetProgramsPath (bCommonGroup, szGroupPath))
+    if (!GetProgramsPath(bCommonGroup, szGroupPath))
     {
-      DPRINT1 ("GetProgramsPath() failed\n");
-      return FALSE;
+        DPRINT1("GetProgramsPath() failed\n");
+        return FALSE;
     }
-  DPRINT ("Programs path: '%S'\n", szGroupPath);
+    DPRINT("Programs path: '%S'\n", szGroupPath);
 
-  wcscat (szGroupPath, L"\\");
-  wcscat (szGroupPath, lpGroupName);
-  DPRINT ("Group path: '%S'\n", szGroupPath);
+    wcscat(szGroupPath, L"\\");
+    wcscat(szGroupPath, lpGroupName);
+    DPRINT("Group path: '%S'\n", szGroupPath);
 
-  /* Remove directory path */
-  if (!RemoveDirectoryPath (szGroupPath))
-    return FALSE;
+    /* Remove directory path */
+    if (!RemoveDirectoryPath (szGroupPath))
+        return FALSE;
 
-  /* FIXME: Notify the shell */
+    /* FIXME: Notify the shell */
 
-  DPRINT ("DeleteGroupW() done\n");
+    DPRINT("DeleteGroupW() done\n");
 
-  return TRUE;
+    return TRUE;
 }
 
 
-BOOL WINAPI
-AddItemA (LPCSTR lpGroupName,  /* Optional */
-         BOOL bCommonGroup,
-         LPCSTR lpItemName,
-         LPCSTR lpArguments,
-         LPCSTR lpIconLocation,
-         INT iIcon,
-         LPCSTR lpWorkingDirectory,  /* Optional */
-         WORD wHotKey,
-         INT iShowCmd)
+BOOL
+WINAPI
+AddItemA(LPCSTR lpGroupName,  /* Optional */
+         BOOL bCommonGroup,
+         LPCSTR lpItemName,
+         LPCSTR lpArguments,
+         LPCSTR lpIconLocation,
+         INT iIcon,
+         LPCSTR lpWorkingDirectory,  /* Optional */
+         WORD wHotKey,
+         INT iShowCmd)
 {
-  UNICODE_STRING GroupName;
-  UNICODE_STRING ItemName;
-  UNICODE_STRING Arguments;
-  UNICODE_STRING IconLocation;
-  UNICODE_STRING WorkingDirectory;
-  BOOL bResult;
+    UNICODE_STRING GroupName;
+    UNICODE_STRING ItemName;
+    UNICODE_STRING Arguments;
+    UNICODE_STRING IconLocation;
+    UNICODE_STRING WorkingDirectory;
+    BOOL bResult;
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
-                                        (LPSTR)lpItemName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
+                                          (LPSTR)lpItemName))
     {
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&Arguments,
-                                        (LPSTR)lpArguments))
+    if (!RtlCreateUnicodeStringFromAsciiz(&Arguments,
+                                          (LPSTR)lpArguments))
     {
-      RtlFreeUnicodeString(&ItemName);
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        RtlFreeUnicodeString(&ItemName);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&IconLocation,
-                                        (LPSTR)lpIconLocation))
+    if (!RtlCreateUnicodeStringFromAsciiz(&IconLocation,
+                                          (LPSTR)lpIconLocation))
     {
-      RtlFreeUnicodeString(&Arguments);
-      RtlFreeUnicodeString(&ItemName);
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        RtlFreeUnicodeString(&Arguments);
+        RtlFreeUnicodeString(&ItemName);
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  if (lpGroupName != NULL)
+    if (lpGroupName != NULL)
     {
-      if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
-                                            (LPSTR)lpGroupName))
-       {
-         RtlFreeUnicodeString(&IconLocation);
-         RtlFreeUnicodeString(&Arguments);
-         RtlFreeUnicodeString(&ItemName);
-         SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
+        if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
+                                              (LPSTR)lpGroupName))
+        {
+            RtlFreeUnicodeString(&IconLocation);
+            RtlFreeUnicodeString(&Arguments);
+            RtlFreeUnicodeString(&ItemName);
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
     }
 
-  if (lpWorkingDirectory != NULL)
+    if (lpWorkingDirectory != NULL)
     {
-      if (!RtlCreateUnicodeStringFromAsciiz(&WorkingDirectory,
-                                            (LPSTR)lpWorkingDirectory))
-       {
-         if (lpGroupName != NULL)
-           {
-             RtlFreeUnicodeString(&GroupName);
-           }
-         RtlFreeUnicodeString(&IconLocation);
-         RtlFreeUnicodeString(&Arguments);
-         RtlFreeUnicodeString(&ItemName);
-         SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
+        if (!RtlCreateUnicodeStringFromAsciiz(&WorkingDirectory,
+                                              (LPSTR)lpWorkingDirectory))
+        {
+            if (lpGroupName != NULL)
+            {
+                RtlFreeUnicodeString(&GroupName);
+            }
+            RtlFreeUnicodeString(&IconLocation);
+            RtlFreeUnicodeString(&Arguments);
+            RtlFreeUnicodeString(&ItemName);
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
     }
 
-  bResult = AddItemW((lpGroupName != NULL) ? GroupName.Buffer : NULL,
-                    bCommonGroup,
-                    ItemName.Buffer,
-                    Arguments.Buffer,
-                    IconLocation.Buffer,
-                    iIcon,
-                    (lpWorkingDirectory != NULL) ? WorkingDirectory.Buffer : NULL,
-                    wHotKey,
-                    iShowCmd);
+    bResult = AddItemW((lpGroupName != NULL) ? GroupName.Buffer : NULL,
+                       bCommonGroup,
+                       ItemName.Buffer,
+                       Arguments.Buffer,
+                       IconLocation.Buffer,
+                       iIcon,
+                       (lpWorkingDirectory != NULL) ? WorkingDirectory.Buffer : NULL,
+                       wHotKey,
+                       iShowCmd);
 
-  if (lpGroupName != NULL)
+    if (lpGroupName != NULL)
     {
-      RtlFreeUnicodeString(&GroupName);
+        RtlFreeUnicodeString(&GroupName);
     }
 
-  if (lpWorkingDirectory != NULL)
+    if (lpWorkingDirectory != NULL)
     {
-      RtlFreeUnicodeString(&WorkingDirectory);
+        RtlFreeUnicodeString(&WorkingDirectory);
     }
 
-  RtlFreeUnicodeString(&IconLocation);
-  RtlFreeUnicodeString(&Arguments);
-  RtlFreeUnicodeString(&ItemName);
+    RtlFreeUnicodeString(&IconLocation);
+    RtlFreeUnicodeString(&Arguments);
+    RtlFreeUnicodeString(&ItemName);
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-AddItemW (LPCWSTR lpGroupName,  /* Optional */
-         BOOL bCommonGroup,
-         LPCWSTR lpItemName,
-         LPCWSTR lpArguments,
-         LPCWSTR lpIconLocation,
-         INT iIcon,
-         LPCWSTR lpWorkingDirectory,  /* Optional */
-         WORD wHotKey,
-         INT iShowCmd)
+BOOL
+WINAPI
+AddItemW(LPCWSTR lpGroupName,  /* Optional */
+         BOOL bCommonGroup,
+         LPCWSTR lpItemName,
+         LPCWSTR lpArguments,
+         LPCWSTR lpIconLocation,
+         INT iIcon,
+         LPCWSTR lpWorkingDirectory,  /* Optional */
+         WORD wHotKey,
+         INT iShowCmd)
 {
-  DYN_FUNCS Ole32;
-  WCHAR szLinkPath[MAX_PATH];
-  WCHAR szArguments[MAX_PATH];
-  WCHAR szCommand[MAX_PATH];
-  WIN32_FIND_DATAW FindData;
-  HANDLE hFind;
-  LPWSTR Ptr;
-  DWORD dwLength;
-  IShellLinkW* psl;
-  IPersistFile* ppf;
-  HRESULT hr;
-  BOOL bResult;
-
-  DPRINT ("AddItemW() called\n");
-
-  bResult = FALSE;
-
-  if (!GetProgramsPath (bCommonGroup, szLinkPath))
-    {
-      DPRINT1 ("GetProgramsPath() failed\n");
-      return FALSE;
+    DYN_FUNCS Ole32;
+    WCHAR szLinkPath[MAX_PATH];
+    WCHAR szArguments[MAX_PATH];
+    WCHAR szCommand[MAX_PATH];
+    WIN32_FIND_DATAW FindData;
+    HANDLE hFind;
+    LPWSTR Ptr;
+    DWORD dwLength;
+    IShellLinkW* psl;
+    IPersistFile* ppf;
+    HRESULT hr;
+    BOOL bResult;
+
+    DPRINT("AddItemW() called\n");
+
+    bResult = FALSE;
+
+    if (!GetProgramsPath(bCommonGroup, szLinkPath))
+    {
+        DPRINT1("GetProgramsPath() failed\n");
+        return FALSE;
     }
 
-  DPRINT ("Programs path: '%S'\n", szLinkPath);
+    DPRINT("Programs path: '%S'\n", szLinkPath);
 
-  if (lpGroupName != NULL && *lpGroupName != 0)
+    if (lpGroupName != NULL && *lpGroupName != 0)
     {
-      wcscat (szLinkPath, L"\\");
-      wcscat (szLinkPath, lpGroupName);
+        wcscat(szLinkPath, L"\\");
+        wcscat(szLinkPath, lpGroupName);
 
-      /* Make sure the path exists */
-      hFind = FindFirstFileW (szLinkPath,
-                             &FindData);
-      if (hFind == INVALID_HANDLE_VALUE)
-       {
-         DPRINT ("'%S' does not exist\n", szLinkPath);
-         if (!CreateGroupW (lpGroupName,
-                            bCommonGroup))
-           return FALSE;
-       }
-      else
-       {
-         DPRINT ("'%S' exists\n", szLinkPath);
-         FindClose (hFind);
-       }
+        /* Make sure the path exists */
+        hFind = FindFirstFileW(szLinkPath,
+                               &FindData);
+        if (hFind == INVALID_HANDLE_VALUE)
+        {
+            DPRINT("'%S' does not exist\n", szLinkPath);
+            if (!CreateGroupW(lpGroupName,
+                              bCommonGroup))
+                return FALSE;
+        }
+        else
+        {
+            DPRINT("'%S' exists\n", szLinkPath);
+            FindClose(hFind);
+        }
     }
 
-  wcscat (szLinkPath, L"\\");
-  wcscat (szLinkPath, lpItemName);
-  wcscat (szLinkPath, L".lnk");
-  DPRINT ("Link path: '%S'\n", szLinkPath);
+    wcscat(szLinkPath, L"\\");
+    wcscat(szLinkPath, lpItemName);
+    wcscat(szLinkPath, L".lnk");
+    DPRINT("Link path: '%S'\n", szLinkPath);
 
-  /* Split 'lpArguments' string into command and arguments */
-  Ptr = wcschr (lpArguments, L' ');
-  DPRINT ("Ptr %p  lpArguments %p\n", Ptr, lpArguments);
-  if (Ptr != NULL)
+    /* Split 'lpArguments' string into command and arguments */
+    Ptr = wcschr(lpArguments, L' ');
+    DPRINT("Ptr %p  lpArguments %p\n", Ptr, lpArguments);
+    if (Ptr != NULL)
     {
-      dwLength = (DWORD)(Ptr - lpArguments);
-      DPRINT ("dwLength %lu\n", dwLength);
-      memcpy (szCommand, lpArguments, dwLength * sizeof(WCHAR));
-      szCommand[dwLength] = 0;
-      Ptr++;
-      wcscpy (szArguments, Ptr);
+        dwLength = (DWORD)(Ptr - lpArguments);
+        DPRINT("dwLength %lu\n", dwLength);
+        memcpy(szCommand, lpArguments, dwLength * sizeof(WCHAR));
+        szCommand[dwLength] = 0;
+        Ptr++;
+        wcscpy(szArguments, Ptr);
     }
-  else
+    else
     {
-      wcscpy (szCommand, lpArguments);
-      szArguments[0] = 0;
+        wcscpy(szCommand, lpArguments);
+        szArguments[0] = 0;
     }
-  DPRINT ("szCommand: '%S'\n", szCommand);
-  DPRINT ("szArguments: '%S'\n", szArguments);
+    DPRINT("szCommand: '%S'\n", szCommand);
+    DPRINT("szArguments: '%S'\n", szArguments);
 
-  /* Dynamically load ole32.dll */
-  if (!LoadDynamicImports(&DynOle32, &Ole32))
+    /* Dynamically load ole32.dll */
+    if (!LoadDynamicImports(&DynOle32, &Ole32))
     {
-      DPRINT1("USERENV: Unable to load OLE32.DLL\n");
-      return FALSE;
+        DPRINT1("USERENV: Unable to load OLE32.DLL\n");
+        return FALSE;
     }
 
-  Ole32.fn.CoInitialize(NULL);
+    Ole32.fn.CoInitialize(NULL);
 
-  hr = Ole32.fn.CoCreateInstance(&CLSID_ShellLink,
-                                 NULL,
-                                 CLSCTX_INPROC_SERVER,
-                                 &IID_IShellLinkW,
-                                 (LPVOID*)&psl);
-  if (!SUCCEEDED(hr))
+    hr = Ole32.fn.CoCreateInstance(&CLSID_ShellLink,
+                                   NULL,
+                                   CLSCTX_INPROC_SERVER,
+                                   &IID_IShellLinkW,
+                                   (LPVOID*)&psl);
+    if (!SUCCEEDED(hr))
     {
-      Ole32.fn.CoUninitialize();
-      UnloadDynamicImports(&Ole32);
-      return FALSE;
+        Ole32.fn.CoUninitialize();
+        UnloadDynamicImports(&Ole32);
+        return FALSE;
     }
 
-  hr = psl->lpVtbl->QueryInterface(psl,
-                                   &IID_IPersistFile,
-                                   (LPVOID*)&ppf);
-  if (SUCCEEDED(hr))
+    hr = psl->lpVtbl->QueryInterface(psl,
+                                     &IID_IPersistFile,
+                                     (LPVOID*)&ppf);
+    if (SUCCEEDED(hr))
     {
-      psl->lpVtbl->SetDescription(psl,
-                                  lpItemName);
+        psl->lpVtbl->SetDescription(psl,
+                                    lpItemName);
 
-      psl->lpVtbl->SetPath(psl,
-                           szCommand);
+        psl->lpVtbl->SetPath(psl,
+                             szCommand);
 
-      psl->lpVtbl->SetArguments(psl,
-                                szArguments);
+        psl->lpVtbl->SetArguments(psl,
+                                  szArguments);
 
-      psl->lpVtbl->SetIconLocation(psl,
-                                   lpIconLocation,
-                                   iIcon);
+        psl->lpVtbl->SetIconLocation(psl,
+                                     lpIconLocation,
+                                     iIcon);
 
-      if (lpWorkingDirectory != NULL)
+        if (lpWorkingDirectory != NULL)
         {
-          psl->lpVtbl->SetWorkingDirectory(psl,
-                                           lpWorkingDirectory);
+            psl->lpVtbl->SetWorkingDirectory(psl,
+                                             lpWorkingDirectory);
         }
-      else
+        else
         {
-          psl->lpVtbl->SetWorkingDirectory(psl,
-                                           L"%HOMEDRIVE%%HOMEPATH%");
+            psl->lpVtbl->SetWorkingDirectory(psl,
+                                             L"%HOMEDRIVE%%HOMEPATH%");
         }
 
-      psl->lpVtbl->SetHotkey(psl,
-                             wHotKey);
+        psl->lpVtbl->SetHotkey(psl,
+                               wHotKey);
 
-      psl->lpVtbl->SetShowCmd(psl,
-                              iShowCmd);
+        psl->lpVtbl->SetShowCmd(psl,
+                                iShowCmd);
 
-      hr = ppf->lpVtbl->Save(ppf,
-                             szLinkPath,
-                             TRUE);
-      if (SUCCEEDED(hr))
-        bResult = TRUE;
+        hr = ppf->lpVtbl->Save(ppf,
+                               szLinkPath,
+                               TRUE);
+        if (SUCCEEDED(hr))
+            bResult = TRUE;
 
-      ppf->lpVtbl->Release(ppf);
+        ppf->lpVtbl->Release(ppf);
     }
 
-  psl->lpVtbl->Release(psl);
+    psl->lpVtbl->Release(psl);
 
-  Ole32.fn.CoUninitialize();
-  UnloadDynamicImports(&Ole32);
+    Ole32.fn.CoUninitialize();
+    UnloadDynamicImports(&Ole32);
 
-  DPRINT ("AddItemW() done\n");
+    DPRINT("AddItemW() done\n");
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-DeleteItemA (LPCSTR lpGroupName, /* Optional */
-            BOOL bCommonGroup,
-            LPCSTR lpItemName,
-            BOOL bDeleteGroup)
+BOOL
+WINAPI
+DeleteItemA(LPCSTR lpGroupName, /* Optional */
+            BOOL bCommonGroup,
+            LPCSTR lpItemName,
+            BOOL bDeleteGroup)
 {
-  UNICODE_STRING GroupName;
-  UNICODE_STRING ItemName;
-  BOOL bResult;
+    UNICODE_STRING GroupName;
+    UNICODE_STRING ItemName;
+    BOOL bResult;
 
-  if (lpGroupName != NULL)
+    if (lpGroupName != NULL)
     {
-      if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
-                                            (LPSTR)lpGroupName))
-       {
-         SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
+        if (!RtlCreateUnicodeStringFromAsciiz(&GroupName,
+                                              (LPSTR)lpGroupName))
+        {
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
     }
 
-  if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
-                                        (LPSTR)lpItemName))
+    if (!RtlCreateUnicodeStringFromAsciiz(&ItemName,
+                                          (LPSTR)lpItemName))
     {
-      if (lpGroupName != NULL)
-       {
-         RtlFreeUnicodeString(&GroupName);
-       }
+        if (lpGroupName != NULL)
+        {
+            RtlFreeUnicodeString(&GroupName);
+        }
 
-      SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-      return FALSE;
+        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+        return FALSE;
     }
 
-  bResult = DeleteItemW((lpGroupName != NULL) ? GroupName.Buffer : NULL,
-                       bCommonGroup,
-                       ItemName.Buffer,
-                       bDeleteGroup);
+    bResult = DeleteItemW((lpGroupName != NULL) ? GroupName.Buffer : NULL,
+                          bCommonGroup,
+                          ItemName.Buffer,
+                          bDeleteGroup);
 
-  RtlFreeUnicodeString(&ItemName);
-  if (lpGroupName != NULL)
+    RtlFreeUnicodeString(&ItemName);
+    if (lpGroupName != NULL)
     {
-      RtlFreeUnicodeString(&GroupName);
+        RtlFreeUnicodeString(&GroupName);
     }
 
-  return bResult;
+    return bResult;
 }
 
 
-BOOL WINAPI
-DeleteItemW (LPCWSTR lpGroupName, /* Optional */
-            BOOL bCommonGroup,
-            LPCWSTR lpItemName,
-            BOOL bDeleteGroup)
+BOOL
+WINAPI
+DeleteItemW(LPCWSTR lpGroupName, /* Optional */
+            BOOL bCommonGroup,
+            LPCWSTR lpItemName,
+            BOOL bDeleteGroup)
 {
-  WCHAR szItemPath[MAX_PATH];
-  LPWSTR Ptr;
+    WCHAR szItemPath[MAX_PATH];
+    LPWSTR Ptr;
 
-  DPRINT ("DeleteItemW() called\n");
+    DPRINT("DeleteItemW() called\n");
 
-  if (!GetProgramsPath (bCommonGroup, szItemPath))
+    if (!GetProgramsPath(bCommonGroup, szItemPath))
     {
-      DPRINT1 ("GetProgramsPath() failed\n");
-      return FALSE;
+        DPRINT1("GetProgramsPath() failed\n");
+        return FALSE;
     }
-  DPRINT ("Programs path: '%S'\n", szItemPath);
+    DPRINT("Programs path: '%S'\n", szItemPath);
 
-  if (lpGroupName != NULL && *lpGroupName != 0)
+    if (lpGroupName != NULL && *lpGroupName != 0)
     {
-      wcscat (szItemPath, L"\\");
-      wcscat (szItemPath, lpGroupName);
+        wcscat(szItemPath, L"\\");
+        wcscat(szItemPath, lpGroupName);
     }
 
-  wcscat (szItemPath, L"\\");
-  wcscat (szItemPath, lpItemName);
-  wcscat (szItemPath, L".lnk");
-  DPRINT ("Item path: '%S'\n", szItemPath);
+    wcscat(szItemPath, L"\\");
+    wcscat(szItemPath, lpItemName);
+    wcscat(szItemPath, L".lnk");
+    DPRINT("Item path: '%S'\n", szItemPath);
 
-  if (!DeleteFileW (szItemPath))
-    return FALSE;
+    if (!DeleteFileW(szItemPath))
+        return FALSE;
 
-  /* FIXME: Notify the shell */
+    /* FIXME: Notify the shell */
 
-  if (bDeleteGroup)
+    if (bDeleteGroup)
     {
-      Ptr = wcsrchr (szItemPath, L'\\');
-      if (Ptr == NULL)
-       return TRUE;
+        Ptr = wcsrchr(szItemPath, L'\\');
+        if (Ptr == NULL)
+            return TRUE;
 
-      *Ptr = 0;
-      DPRINT ("Item path: '%S'\n", szItemPath);
-      if (RemoveDirectoryW (szItemPath))
-       {
-         /* FIXME: Notify the shell */
-       }
+        *Ptr = 0;
+        DPRINT("Item path: '%S'\n", szItemPath);
+        if (RemoveDirectoryW(szItemPath))
+        {
+            /* FIXME: Notify the shell */
+        }
     }
 
-  DPRINT ("DeleteItemW() done\n");
+    DPRINT("DeleteItemW() done\n");
 
-  return TRUE;
+    return TRUE;
 }
 
 /* EOF */
index 5cbabcc..d3232fb 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/directory.c
+ * FILE:            dll/win32/userenv/directory.c
  * PURPOSE:         User profile code
  * PROGRAMMER:      Eric Kohl
  */
@@ -32,7 +32,8 @@
 
 /* FUNCTIONS ***************************************************************/
 
-BOOL WINAPI
+BOOL
+WINAPI
 CopyProfileDirectoryA(LPCSTR lpSourcePath,
                       LPCSTR lpDestinationPath,
                       DWORD dwFlags)
@@ -67,7 +68,8 @@ CopyProfileDirectoryA(LPCSTR lpSourcePath,
 }
 
 
-BOOL WINAPI
+BOOL
+WINAPI
 CopyProfileDirectoryW(LPCWSTR lpSourcePath,
                       LPCWSTR lpDestinationPath,
                       DWORD dwFlags)
@@ -78,8 +80,8 @@ CopyProfileDirectoryW(LPCWSTR lpSourcePath,
 
 
 BOOL
-CopyDirectory (LPCWSTR lpDestinationPath,
-               LPCWSTR lpSourcePath)
+CopyDirectory(LPCWSTR lpDestinationPath,
+              LPCWSTR lpSourcePath)
 {
     WCHAR szFileName[MAX_PATH];
     WCHAR szFullSrcName[MAX_PATH];
@@ -89,110 +91,110 @@ CopyDirectory (LPCWSTR lpDestinationPath,
     LPWSTR lpDstPtr;
     HANDLE hFind;
 
-    DPRINT ("CopyDirectory (%S, %S) called\n",
+    DPRINT("CopyDirectory (%S, %S) called\n",
             lpDestinationPath, lpSourcePath);
 
-    wcscpy (szFileName, lpSourcePath);
-    wcscat (szFileName, L"\\*.*");
+    wcscpy(szFileName, lpSourcePath);
+    wcscat(szFileName, L"\\*.*");
 
-    hFind = FindFirstFileW (szFileName,
-                            &FindFileData);
+    hFind = FindFirstFileW(szFileName,
+                           &FindFileData);
     if (hFind == INVALID_HANDLE_VALUE)
     {
-        DPRINT1 ("Error: %lu\n", GetLastError());
+        DPRINT1("Error: %lu\n", GetLastError());
         return FALSE;
     }
 
-    wcscpy (szFullSrcName, lpSourcePath);
-    lpSrcPtr = AppendBackslash (szFullSrcName);
+    wcscpy(szFullSrcName, lpSourcePath);
+    lpSrcPtr = AppendBackslash(szFullSrcName);
 
-    wcscpy (szFullDstName, lpDestinationPath);
-    lpDstPtr = AppendBackslash (szFullDstName);
+    wcscpy(szFullDstName, lpDestinationPath);
+    lpDstPtr = AppendBackslash(szFullDstName);
 
     for (;;)
     {
-        if (wcscmp (FindFileData.cFileName, L".") &&
-                wcscmp (FindFileData.cFileName, L".."))
+        if (wcscmp(FindFileData.cFileName, L".") &&
+            wcscmp(FindFileData.cFileName, L".."))
         {
-            wcscpy (lpSrcPtr, FindFileData.cFileName);
-            wcscpy (lpDstPtr, FindFileData.cFileName);
+            wcscpy(lpSrcPtr, FindFileData.cFileName);
+            wcscpy(lpDstPtr, FindFileData.cFileName);
 
             if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
             {
-                DPRINT ("Create directory: %S\n", szFullDstName);
-                if (!CreateDirectoryExW (szFullSrcName, szFullDstName, NULL))
+                DPRINT("Create directory: %S\n", szFullDstName);
+                if (!CreateDirectoryExW(szFullSrcName, szFullDstName, NULL))
                 {
-                    if (GetLastError () != ERROR_ALREADY_EXISTS)
+                    if (GetLastError() != ERROR_ALREADY_EXISTS)
                     {
-                        DPRINT1 ("Error: %lu\n", GetLastError());
+                        DPRINT1("Error: %lu\n", GetLastError());
 
-                        FindClose (hFind);
+                        FindClose(hFind);
                         return FALSE;
                     }
                 }
 
-                if (!CopyDirectory (szFullDstName, szFullSrcName))
+                if (!CopyDirectory(szFullDstName, szFullSrcName))
                 {
-                    DPRINT1 ("Error: %lu\n", GetLastError());
+                    DPRINT1("Error: %lu\n", GetLastError());
 
-                    FindClose (hFind);
+                    FindClose(hFind);
                     return FALSE;
                 }
             }
             else
             {
-                DPRINT ("Copy file: %S -> %S\n", szFullSrcName, szFullDstName);
-                if (!CopyFileW (szFullSrcName, szFullDstName, FALSE))
+                DPRINT("Copy file: %S -> %S\n", szFullSrcName, szFullDstName);
+                if (!CopyFileW(szFullSrcName, szFullDstName, FALSE))
                 {
-                    DPRINT1 ("Error: %lu\n", GetLastError());
+                    DPRINT1("Error: %lu\n", GetLastError());
 
-                    FindClose (hFind);
+                    FindClose(hFind);
                     return FALSE;
                 }
             }
         }
 
-        if (!FindNextFileW (hFind, &FindFileData))
+        if (!FindNextFileW(hFind, &FindFileData))
         {
-            if (GetLastError () != ERROR_NO_MORE_FILES)
+            if (GetLastError() != ERROR_NO_MORE_FILES)
             {
-                DPRINT1 ("Error: %lu\n", GetLastError());
+                DPRINT1("Error: %lu\n", GetLastError());
             }
 
             break;
         }
     }
 
-    FindClose (hFind);
+    FindClose(hFind);
 
-    DPRINT ("CopyDirectory() done\n");
+    DPRINT("CopyDirectory() done\n");
 
     return TRUE;
 }
 
 
 BOOL
-CreateDirectoryPath (LPCWSTR lpPathName,
-                     LPSECURITY_ATTRIBUTES lpSecurityAttributes)
+CreateDirectoryPath(LPCWSTR lpPathName,
+                    LPSECURITY_ATTRIBUTES lpSecurityAttributes)
 {
     WCHAR szPath[MAX_PATH];
     LPWSTR Ptr;
     DWORD dwError;
 
-    DPRINT ("CreateDirectoryPath() called\n");
+    DPRINT("CreateDirectoryPath() called\n");
 
     if (lpPathName == NULL || *lpPathName == 0)
         return TRUE;
 
-    if (CreateDirectoryW (lpPathName,
-                          lpSecurityAttributes))
+    if (CreateDirectoryW(lpPathName,
+                         lpSecurityAttributes))
         return TRUE;
 
-    dwError = GetLastError ();
+    dwError = GetLastError();
     if (dwError == ERROR_ALREADY_EXISTS)
         return TRUE;
 
-    wcscpy (szPath, lpPathName);
+    wcscpy(szPath, lpPathName);
 
     if (wcslen(szPath) > 3 && szPath[1] == ':' && szPath[2] == '\\')
     {
@@ -205,15 +207,15 @@ CreateDirectoryPath (LPCWSTR lpPathName,
 
     while (Ptr != NULL)
     {
-        Ptr = wcschr (Ptr, L'\\');
+        Ptr = wcschr(Ptr, L'\\');
         if (Ptr != NULL)
             *Ptr = 0;
 
-        DPRINT ("CreateDirectory(%S)\n", szPath);
-        if (!CreateDirectoryW (szPath,
-                               lpSecurityAttributes))
+        DPRINT("CreateDirectory(%S)\n", szPath);
+        if (!CreateDirectoryW(szPath,
+                              lpSecurityAttributes))
         {
-            dwError = GetLastError ();
+            dwError = GetLastError();
             if (dwError != ERROR_ALREADY_EXISTS)
                 return FALSE;
         }
@@ -225,45 +227,46 @@ CreateDirectoryPath (LPCWSTR lpPathName,
         }
     }
 
-    DPRINT ("CreateDirectoryPath() done\n");
+    DPRINT("CreateDirectoryPath() done\n");
 
     return TRUE;
 }
 
 
-static BOOL
-RecursiveRemoveDir (LPCWSTR lpPath)
+static
+BOOL
+RecursiveRemoveDir(LPCWSTR lpPath)
 {
     WCHAR szPath[MAX_PATH];
     WIN32_FIND_DATAW FindData;
     HANDLE hFind;
     BOOL bResult;
 
-    wcscpy (szPath, lpPath);
-    wcscat (szPath, L"\\*.*");
-    DPRINT ("Search path: '%S'\n", szPath);
+    wcscpy(szPath, lpPath);
+    wcscat(szPath, L"\\*.*");
+    DPRINT("Search path: '%S'\n", szPath);
 
-    hFind = FindFirstFileW (szPath,
-                            &FindData);
+    hFind = FindFirstFileW(szPath,
+                           &FindData);
     if (hFind == INVALID_HANDLE_VALUE)
         return FALSE;
 
     bResult = TRUE;
     while (TRUE)
     {
-        if (wcscmp (FindData.cFileName, L".") &&
-                wcscmp (FindData.cFileName, L".."))
+        if (wcscmp(FindData.cFileName, L".") &&
+            wcscmp(FindData.cFileName, L".."))
         {
-            wcscpy (szPath, lpPath);
-            wcscat (szPath, L"\\");
-            wcscat (szPath, FindData.cFileName);
-            DPRINT ("File name: '%S'\n", szPath);
+            wcscpy(szPath, lpPath);
+            wcscat(szPath, L"\\");
+            wcscat(szPath, FindData.cFileName);
+            DPRINT("File name: '%S'\n", szPath);
 
             if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
             {
-                DPRINT ("Delete directory: '%S'\n", szPath);
+                DPRINT("Delete directory: '%S'\n", szPath);
 
-                if (!RecursiveRemoveDir (szPath))
+                if (!RecursiveRemoveDir(szPath))
                 {
                     bResult = FALSE;
                     break;
@@ -271,11 +274,11 @@ RecursiveRemoveDir (LPCWSTR lpPath)
 
                 if (FindData.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
                 {
-                    SetFileAttributesW (szPath,
-                                        FindData.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY);
+                    SetFileAttributesW(szPath,
+                                       FindData.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY);
                 }
 
-                if (!RemoveDirectoryW (szPath))
+                if (!RemoveDirectoryW(szPath))
                 {
                     bResult = FALSE;
                     break;
@@ -283,15 +286,15 @@ RecursiveRemoveDir (LPCWSTR lpPath)
             }
             else
             {
-                DPRINT ("Delete file: '%S'\n", szPath);
+                DPRINT("Delete file: '%S'\n", szPath);
 
                 if (FindData.dwFileAttributes & (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM))
                 {
-                    SetFileAttributesW (szPath,
-                                        FILE_ATTRIBUTE_NORMAL);
+                    SetFileAttributesW(szPath,
+                                       FILE_ATTRIBUTE_NORMAL);
                 }
 
-                if (!DeleteFileW (szPath))
+                if (!DeleteFileW(szPath))
                 {
                     bResult = FALSE;
                     break;
@@ -299,11 +302,11 @@ RecursiveRemoveDir (LPCWSTR lpPath)
             }
         }
 
-        if (!FindNextFileW (hFind, &FindData))
+        if (!FindNextFileW(hFind, &FindData))
         {
-            if (GetLastError () != ERROR_NO_MORE_FILES)
+            if (GetLastError() != ERROR_NO_MORE_FILES)
             {
-                DPRINT1 ("Error: %lu\n", GetLastError());
+                DPRINT1("Error: %lu\n", GetLastError());
                 bResult = FALSE;
                 break;
             }
@@ -312,20 +315,20 @@ RecursiveRemoveDir (LPCWSTR lpPath)
         }
     }
 
-    FindClose (hFind);
+    FindClose(hFind);
 
     return bResult;
 }
 
 
 BOOL
-RemoveDirectoryPath (LPCWSTR lpPathName)
+RemoveDirectoryPath(LPCWSTR lpPathName)
 {
-    if (!RecursiveRemoveDir (lpPathName))
+    if (!RecursiveRemoveDir(lpPathName))
         return FALSE;
 
-    DPRINT ("Delete directory: '%S'\n", lpPathName);
-    return RemoveDirectoryW (lpPathName);
+    DPRINT("Delete directory: '%S'\n", lpPathName);
+    return RemoveDirectoryW(lpPathName);
 }
 
 /* EOF */
index c07db23..918bce4 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/environment.c
+ * FILE:            dll/win32/userenv/environment.c
  * PURPOSE:         User environment functions
  * PROGRAMMER:      Eric Kohl
  */
@@ -30,7 +30,8 @@
 #include <debug.h>
 
 
-static BOOL
+static
+BOOL
 SetUserEnvironmentVariable(LPVOID *Environment,
                            LPWSTR lpName,
                            LPWSTR lpValue,
@@ -117,7 +118,8 @@ SetUserEnvironmentVariable(LPVOID *Environment,
 }
 
 
-static BOOL
+static
+BOOL
 AppendUserEnvironmentVariable(LPVOID *Environment,
                               LPWSTR lpName,
                               LPWSTR lpValue)
@@ -165,7 +167,8 @@ AppendUserEnvironmentVariable(LPVOID *Environment,
 }
 
 
-static HKEY
+static
+HKEY
 GetCurrentUserKey(HANDLE hToken)
 {
     UNICODE_STRING SidString;
@@ -198,7 +201,8 @@ GetCurrentUserKey(HANDLE hToken)
 }
 
 
-static BOOL
+static
+BOOL
 SetUserEnvironment(LPVOID *lpEnvironment,
                    HKEY hKey,
                    LPWSTR lpSubKeyName)
@@ -310,7 +314,8 @@ SetUserEnvironment(LPVOID *lpEnvironment,
 }
 
 
-BOOL WINAPI
+BOOL
+WINAPI
 CreateEnvironmentBlock(LPVOID *lpEnvironment,
                        HANDLE hToken,
                        BOOL bInherit)
@@ -454,7 +459,8 @@ CreateEnvironmentBlock(LPVOID *lpEnvironment,
 }
 
 
-BOOL WINAPI
+BOOL
+WINAPI
 DestroyEnvironmentBlock(LPVOID lpEnvironment)
 {
     DPRINT("DestroyEnvironmentBlock() called\n");
@@ -471,7 +477,8 @@ DestroyEnvironmentBlock(LPVOID lpEnvironment)
 }
 
 
-BOOL WINAPI
+BOOL
+WINAPI
 ExpandEnvironmentStringsForUserW(IN HANDLE hToken,
                                  IN LPCWSTR lpSrc,
                                  OUT LPWSTR lpDest,
@@ -522,7 +529,8 @@ ExpandEnvironmentStringsForUserW(IN HANDLE hToken,
 }
 
 
-BOOL WINAPI
+BOOL
+WINAPI
 ExpandEnvironmentStringsForUserA(IN HANDLE hToken,
                                  IN LPCSTR lpSrc,
                                  OUT LPSTR lpDest,
index e253813..8302ce8 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/gpolicy.c
+ * FILE:            dll/win32/userenv/gpolicy.c
  * PURPOSE:         Group policy functions
  * PROGRAMMER:      Thomas Weidenmueller <w3seek@reactos.com>
  */
@@ -110,7 +110,8 @@ UninitializeGPNotifications(VOID)
     DeleteCriticalSection(&GPNotifyLock);
 }
 
-static VOID
+static
+VOID
 NotifyGPEvents(IN BOOL bMachine)
 {
     PGP_NOTIFY Notify = NotificationList;
@@ -126,7 +127,9 @@ NotifyGPEvents(IN BOOL bMachine)
     }
 }
 
-static DWORD WINAPI
+static
+DWORD
+WINAPI
 GPNotificationThreadProc(IN LPVOID lpParameter)
 {
     HMODULE hModule;
@@ -255,7 +258,8 @@ GPNotificationThreadProc(IN LPVOID lpParameter)
     return 1;
 }
 
-static HANDLE
+static
+HANDLE
 CreateGPEvent(IN BOOL bMachine,
               IN PSECURITY_DESCRIPTOR lpSecurityDescriptor)
 {
@@ -274,7 +278,8 @@ CreateGPEvent(IN BOOL bMachine,
     return hEvent;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 RegisterGPNotification(IN HANDLE hEvent,
                        IN BOOL bMachine)
 {
@@ -378,7 +383,8 @@ Cleanup:
     return Ret;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 UnregisterGPNotification(IN HANDLE hEvent)
 {
     PGP_NOTIFY Notify = NULL, *NotifyLink;
@@ -418,7 +424,8 @@ UnregisterGPNotification(IN HANDLE hEvent)
     return Ret;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 RefreshPolicy(IN BOOL bMachine)
 {
     HANDLE hEvent;
@@ -437,7 +444,8 @@ RefreshPolicy(IN BOOL bMachine)
     return Ret;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 RefreshPolicyEx(IN BOOL bMachine,
                 IN DWORD dwOptions)
 {
@@ -470,7 +478,8 @@ RefreshPolicyEx(IN BOOL bMachine,
     }
 }
 
-HANDLE WINAPI
+HANDLE
+WINAPI
 EnterCriticalPolicySection(IN BOOL bMachine)
 {
     SECURITY_ATTRIBUTES SecurityAttributes;
@@ -507,7 +516,8 @@ EnterCriticalPolicySection(IN BOOL bMachine)
     return NULL;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 LeaveCriticalPolicySection(IN HANDLE hSection)
 {
     BOOL Ret;
@@ -524,7 +534,8 @@ LeaveCriticalPolicySection(IN HANDLE hSection)
     return Ret;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 WaitForUserPolicyForegroundProcessing(VOID)
 {
     HANDLE hEvent;
@@ -543,7 +554,8 @@ WaitForUserPolicyForegroundProcessing(VOID)
     return Ret;
 }
 
-BOOL WINAPI
+BOOL
+WINAPI
 WaitForMachinePolicyForegroundProcessing(VOID)
 {
     HANDLE hEvent;
index 07c1498..098de53 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/internal.h
+ * FILE:            dll/win32/userenv/internal.h
  * PURPOSE:         internal stuff
  * PROGRAMMER:      Eric Kohl
  */
 
 /* directory.c */
 BOOL
-CopyDirectory (LPCWSTR lpDestinationPath,
-              LPCWSTR lpSourcePath);
+CopyDirectory(LPCWSTR lpDestinationPath,
+              LPCWSTR lpSourcePath);
 
 BOOL
-CreateDirectoryPath (LPCWSTR lpPathName,
-                    LPSECURITY_ATTRIBUTES lpSecurityAttributes);
+CreateDirectoryPath(LPCWSTR lpPathName,
+                    LPSECURITY_ATTRIBUTES lpSecurityAttributes);
 
 BOOL
-RemoveDirectoryPath (LPCWSTR lpPathName);
+RemoveDirectoryPath(LPCWSTR lpPathName);
 
 /* misc.c */
 typedef struct _DYN_FUNCS
@@ -64,35 +64,36 @@ typedef struct _DYN_MODULE
 extern DYN_MODULE DynOle32;
 
 BOOL
-LoadDynamicImports(PDYN_MODULE Module, PDYN_FUNCS DynFuncs);
+LoadDynamicImports(PDYN_MODULE Module,
+                   PDYN_FUNCS DynFuncs);
 
 VOID
 UnloadDynamicImports(PDYN_FUNCS DynFuncs);
 
 LPWSTR
-AppendBackslash (LPWSTR String);
+AppendBackslash(LPWSTR String);
 
 BOOL
-GetUserSidFromToken (HANDLE hToken,
-                    PUNICODE_STRING SidString);
+GetUserSidFromToken(HANDLE hToken,
+                    PUNICODE_STRING SidString);
 
 PSECURITY_DESCRIPTOR
 CreateDefaultSecurityDescriptor(VOID);
 
 /* profile.c */
 BOOL
-AppendSystemPostfix (LPWSTR lpName,
-                    DWORD dwMaxLength);
+AppendSystemPostfix(LPWSTR lpName,
+                    DWORD dwMaxLength);
 
 /* registry.c */
 BOOL
-CreateUserHive (LPCWSTR lpKeyName,
-               LPCWSTR lpProfilePath);
+CreateUserHive(LPCWSTR lpKeyName,
+               LPCWSTR lpProfilePath);
 
 /* setup.c */
 BOOL
 UpdateUsersShellFolderSettings(LPCWSTR lpUserProfilePath,
-                              HKEY hUserKey);
+                               HKEY hUserKey);
 
 /* userenv.c */
 extern HINSTANCE hInstance;
index 92e66c1..e7bf1dd 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/misc.c
+ * FILE:            dll/win32/userenv/misc.c
  * PURPOSE:         User profile code
  * PROGRAMMER:      Eric Kohl
  */
@@ -35,86 +35,86 @@ static SID_IDENTIFIER_AUTHORITY WorldAuthority = {SECURITY_WORLD_SID_AUTHORITY};
 /* FUNCTIONS ***************************************************************/
 
 LPWSTR
-AppendBackslash (LPWSTR String)
+AppendBackslash(LPWSTR String)
 {
-  ULONG Length;
+    ULONG Length;
 
-  Length = lstrlenW (String);
-  if (String[Length - 1] != L'\\')
+    Length = lstrlenW(String);
+    if (String[Length - 1] != L'\\')
     {
-      String[Length] = L'\\';
-      Length++;
-      String[Length] = (WCHAR)0;
+        String[Length] = L'\\';
+        Length++;
+        String[Length] = (WCHAR)0;
     }
 
-  return &String[Length];
+    return &String[Length];
 }
 
 
 BOOL
-GetUserSidFromToken (HANDLE hToken,
-                    PUNICODE_STRING SidString)
+GetUserSidFromToken(HANDLE hToken,
+                    PUNICODE_STRING SidString)
 {
-  PSID_AND_ATTRIBUTES SidBuffer, nsb;
-  ULONG Length;
-  NTSTATUS Status;
-
-  Length = 256;
-  SidBuffer = LocalAlloc (LMEM_FIXED,
-                         Length);
-  if (SidBuffer == NULL)
-    return FALSE;
-
-  Status = NtQueryInformationToken (hToken,
-                                   TokenUser,
-                                   (PVOID)SidBuffer,
-                                   Length,
-                                   &Length);
-  if (Status == STATUS_BUFFER_TOO_SMALL)
+    PSID_AND_ATTRIBUTES SidBuffer, nsb;
+    ULONG Length;
+    NTSTATUS Status;
+
+    Length = 256;
+    SidBuffer = LocalAlloc(LMEM_FIXED,
+                           Length);
+    if (SidBuffer == NULL)
+        return FALSE;
+
+    Status = NtQueryInformationToken(hToken,
+                                     TokenUser,
+                                     (PVOID)SidBuffer,
+                                     Length,
+                                     &Length);
+    if (Status == STATUS_BUFFER_TOO_SMALL)
     {
-      nsb = LocalReAlloc (SidBuffer,
-                          Length,
-                          LMEM_MOVEABLE);
-      if (nsb == NULL)
+        nsb = LocalReAlloc(SidBuffer,
+                           Length,
+                           LMEM_MOVEABLE);
+        if (nsb == NULL)
         {
-          LocalFree((HLOCAL)SidBuffer);
-          return FALSE;
+            LocalFree((HLOCAL)SidBuffer);
+            return FALSE;
         }
 
-      SidBuffer = nsb;
-      Status = NtQueryInformationToken (hToken,
-                                       TokenUser,
-                                       (PVOID)SidBuffer,
-                                       Length,
-                                       &Length);
+        SidBuffer = nsb;
+        Status = NtQueryInformationToken(hToken,
+                                         TokenUser,
+                                         (PVOID)SidBuffer,
+                                         Length,
+                                         &Length);
     }
 
-  if (!NT_SUCCESS (Status))
+    if (!NT_SUCCESS (Status))
     {
-      LocalFree ((HLOCAL)SidBuffer);
-      SetLastError (RtlNtStatusToDosError (Status));
-      return FALSE;
+        LocalFree((HLOCAL)SidBuffer);
+        SetLastError(RtlNtStatusToDosError(Status));
+        return FALSE;
     }
 
-  DPRINT ("SidLength: %lu\n", RtlLengthSid (SidBuffer[0].Sid));
+    DPRINT("SidLength: %lu\n", RtlLengthSid (SidBuffer[0].Sid));
 
-  Status = RtlConvertSidToUnicodeString (SidString,
-                                        SidBuffer[0].Sid,
-                                        TRUE);
+    Status = RtlConvertSidToUnicodeString(SidString,
+                                          SidBuffer[0].Sid,
+                                          TRUE);
 
-  LocalFree ((HLOCAL)SidBuffer);
+    LocalFree((HLOCAL)SidBuffer);
 
-  if (!NT_SUCCESS (Status))
+    if (!NT_SUCCESS(Status))
     {
-      SetLastError (RtlNtStatusToDosError (Status));
-      return FALSE;
+        SetLastError(RtlNtStatusToDosError(Status));
+        return FALSE;
     }
 
-  DPRINT ("SidString.Length: %lu\n", SidString->Length);
-  DPRINT ("SidString.MaximumLength: %lu\n", SidString->MaximumLength);
-  DPRINT ("SidString: '%wZ'\n", SidString);
+    DPRINT("SidString.Length: %lu\n", SidString->Length);
+    DPRINT("SidString.MaximumLength: %lu\n", SidString->MaximumLength);
+    DPRINT("SidString: '%wZ'\n", SidString);
 
-  return TRUE;
+    return TRUE;
 }
 
 PSECURITY_DESCRIPTOR
@@ -284,47 +284,48 @@ DYN_MODULE DynOle32 =
  * has been created!
  */
 BOOL
-LoadDynamicImports(PDYN_MODULE Module, PDYN_FUNCS DynFuncs)
+LoadDynamicImports(PDYN_MODULE Module,
+                   PDYN_FUNCS DynFuncs)
 {
-  LPSTR *fname;
-  PVOID *fn;
+    LPSTR *fname;
+    PVOID *fn;
 
-  ZeroMemory(DynFuncs, sizeof(DYN_FUNCS));
+    ZeroMemory(DynFuncs, sizeof(DYN_FUNCS));
 
-  DynFuncs->hModule = LoadLibraryW(Module->Library);
-  if (!DynFuncs->hModule)
+    DynFuncs->hModule = LoadLibraryW(Module->Library);
+    if (!DynFuncs->hModule)
     {
-      return FALSE;
+        return FALSE;
     }
 
-  fn = &DynFuncs->fn.foo;
+    fn = &DynFuncs->fn.foo;
 
-  /* load the imports */
-  for (fname = Module->Functions; *fname != NULL; fname++)
+    /* load the imports */
+    for (fname = Module->Functions; *fname != NULL; fname++)
     {
-      *fn = GetProcAddress(DynFuncs->hModule, *fname);
-      if (*fn == NULL)
+        *fn = GetProcAddress(DynFuncs->hModule, *fname);
+        if (*fn == NULL)
         {
-          FreeLibrary(DynFuncs->hModule);
-          DynFuncs->hModule = (HMODULE)0;
+            FreeLibrary(DynFuncs->hModule);
+            DynFuncs->hModule = (HMODULE)0;
 
-          return FALSE;
+            return FALSE;
         }
 
-      fn++;
+        fn++;
     }
 
-  return TRUE;
+    return TRUE;
 }
 
 
 VOID
 UnloadDynamicImports(PDYN_FUNCS DynFuncs)
 {
-  if (DynFuncs->hModule)
+    if (DynFuncs->hModule)
     {
-      FreeLibrary(DynFuncs->hModule);
-      DynFuncs->hModule = (HMODULE)0;
+        FreeLibrary(DynFuncs->hModule);
+        DynFuncs->hModule = (HMODULE)0;
     }
 }
 
index ac41f12..9be4d08 100644 (file)
@@ -18,7 +18,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/profile.c
+ * FILE:            dll/win32/userenv/profile.c
  * PURPOSE:         User profile code
  * PROGRAMMERS:     Eric Kohl
  *                  HervĂ© Poussineau
index cd822f8..512cef8 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/registry.c
+ * FILE:            dll/win32/userenv/registry.c
  * PURPOSE:         User profile code
  * PROGRAMMER:      Eric Kohl
  */
 
 /* FUNCTIONS ***************************************************************/
 
-static BOOL
-CopyKey (HKEY hDstKey,
-        HKEY hSrcKey)
+static
+BOOL
+CopyKey(HKEY hDstKey,
+        HKEY hSrcKey)
 {
-  LONG Error;
+    LONG Error;
 
 #if (_WIN32_WINNT >= 0x0600)
-  Error = RegCopyTreeW(hSrcKey,
-                       NULL,
-                       hDstKey);
-  if (Error != ERROR_SUCCESS)
-  {
-      SetLastError((DWORD)Error);
-      return FALSE;
-  }
+    Error = RegCopyTreeW(hSrcKey,
+                         NULL,
+                         hDstKey);
+    if (Error != ERROR_SUCCESS)
+    {
+        SetLastError((DWORD)Error);
+        return FALSE;
+    }
 
-  return TRUE;
+    return TRUE;
 
 #else
-  FILETIME LastWrite;
-  DWORD dwSubKeys;
-  DWORD dwValues;
-  DWORD dwType;
-  DWORD dwMaxSubKeyNameLength;
-  DWORD dwSubKeyNameLength;
-  DWORD dwMaxValueNameLength;
-  DWORD dwValueNameLength;
-  DWORD dwMaxValueLength;
-  DWORD dwValueLength;
-  DWORD dwDisposition;
-  DWORD i;
-  LPWSTR lpNameBuffer;
-  LPBYTE lpDataBuffer;
-  HKEY hDstSubKey;
-  HKEY hSrcSubKey;
-
-  DPRINT ("CopyKey() called \n");
-
-  Error = RegQueryInfoKey (hSrcKey,
-                          NULL,
-                          NULL,
-                          NULL,
-                          &dwSubKeys,
-                          &dwMaxSubKeyNameLength,
-                          NULL,
-                          &dwValues,
-                          &dwMaxValueNameLength,
-                          &dwMaxValueLength,
-                          NULL,
-                          NULL);
-  if (Error != ERROR_SUCCESS)
+    FILETIME LastWrite;
+    DWORD dwSubKeys;
+    DWORD dwValues;
+    DWORD dwType;
+    DWORD dwMaxSubKeyNameLength;
+    DWORD dwSubKeyNameLength;
+    DWORD dwMaxValueNameLength;
+    DWORD dwValueNameLength;
+    DWORD dwMaxValueLength;
+    DWORD dwValueLength;
+    DWORD dwDisposition;
+    DWORD i;
+    LPWSTR lpNameBuffer;
+    LPBYTE lpDataBuffer;
+    HKEY hDstSubKey;
+    HKEY hSrcSubKey;
+
+    DPRINT ("CopyKey() called \n");
+
+    Error = RegQueryInfoKey(hSrcKey,
+                            NULL,
+                            NULL,
+                            NULL,
+                            &dwSubKeys,
+                            &dwMaxSubKeyNameLength,
+                            NULL,
+                            &dwValues,
+                            &dwMaxValueNameLength,
+                            &dwMaxValueLength,
+                            NULL,
+                            NULL);
+    if (Error != ERROR_SUCCESS)
     {
-      DPRINT1 ("RegQueryInfoKey() failed (Error %lu)\n", Error);
-      SetLastError((DWORD)Error);
-      return FALSE;
+        DPRINT1("RegQueryInfoKey() failed (Error %lu)\n", Error);
+        SetLastError((DWORD)Error);
+        return FALSE;
     }
 
-  DPRINT ("dwSubKeys %lu\n", dwSubKeys);
-  DPRINT ("dwMaxSubKeyNameLength %lu\n", dwMaxSubKeyNameLength);
-  DPRINT ("dwValues %lu\n", dwValues);
-  DPRINT ("dwMaxValueNameLength %lu\n", dwMaxValueNameLength);
-  DPRINT ("dwMaxValueLength %lu\n", dwMaxValueLength);
+    DPRINT("dwSubKeys %lu\n", dwSubKeys);
+    DPRINT("dwMaxSubKeyNameLength %lu\n", dwMaxSubKeyNameLength);
+    DPRINT("dwValues %lu\n", dwValues);
+    DPRINT("dwMaxValueNameLength %lu\n", dwMaxValueNameLength);
+    DPRINT("dwMaxValueLength %lu\n", dwMaxValueLength);
 
-  /* Copy subkeys */
-  if (dwSubKeys != 0)
+    /* Copy subkeys */
+    if (dwSubKeys != 0)
     {
-      lpNameBuffer = HeapAlloc (GetProcessHeap (),
-                               0,
-                               dwMaxSubKeyNameLength * sizeof(WCHAR));
-      if (lpNameBuffer == NULL)
-       {
-         DPRINT1("Buffer allocation failed\n");
-          SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
-
-      for (i = 0; i < dwSubKeys; i++)
-       {
-         dwSubKeyNameLength = dwMaxSubKeyNameLength;
-         Error = RegEnumKeyExW (hSrcKey,
-                                i,
-                                lpNameBuffer,
-                                &dwSubKeyNameLength,
-                                NULL,
-                                NULL,
-                                NULL,
-                                &LastWrite);
-          if (Error != ERROR_SUCCESS)
-           {
-             DPRINT1 ("Subkey enumeration failed (Error %lu)\n", Error);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-              SetLastError((DWORD)Error);
-             return FALSE;
-           }
-
-         Error = RegCreateKeyExW (hDstKey,
-                                  lpNameBuffer,
-                                  0,
-                                  NULL,
-                                  REG_OPTION_NON_VOLATILE,
-                                  KEY_WRITE,
-                                  NULL,
-                                  &hDstSubKey,
-                                  &dwDisposition);
-          if (Error != ERROR_SUCCESS)
-           {
-             DPRINT1 ("Subkey creation failed (Error %lu)\n", Error);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-              SetLastError((DWORD)Error);
-             return FALSE;
-           }
-
-         Error = RegOpenKeyExW (hSrcKey,
-                                lpNameBuffer,
-                                0,
-                                KEY_READ,
-                                &hSrcSubKey);
-          if (Error != ERROR_SUCCESS)
-           {
-             DPRINT1 ("Error: %lu\n", Error);
-             RegCloseKey (hDstSubKey);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-              SetLastError((DWORD)Error);
-             return FALSE;
-           }
-
-         if (!CopyKey (hDstSubKey,
-                       hSrcSubKey))
-           {
-             DPRINT1 ("Error: %lu\n", GetLastError());
-             RegCloseKey (hSrcSubKey);
-             RegCloseKey (hDstSubKey);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-             return FALSE;
-           }
-
-         RegCloseKey (hSrcSubKey);
-         RegCloseKey (hDstSubKey);
-       }
-
-       HeapFree (GetProcessHeap (),
-                0,
-                lpNameBuffer);
+        lpNameBuffer = HeapAlloc(GetProcessHeap(),
+                                 0,
+                                 dwMaxSubKeyNameLength * sizeof(WCHAR));
+        if (lpNameBuffer == NULL)
+        {
+            DPRINT1("Buffer allocation failed\n");
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
+
+        for (i = 0; i < dwSubKeys; i++)
+        {
+            dwSubKeyNameLength = dwMaxSubKeyNameLength;
+            Error = RegEnumKeyExW(hSrcKey,
+                                  i,
+                                  lpNameBuffer,
+                                  &dwSubKeyNameLength,
+                                  NULL,
+                                  NULL,
+                                  NULL,
+                                  &LastWrite);
+            if (Error != ERROR_SUCCESS)
+            {
+                DPRINT1("Subkey enumeration failed (Error %lu)\n", Error);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                SetLastError((DWORD)Error);
+                return FALSE;
+            }
+
+            Error = RegCreateKeyExW(hDstKey,
+                                    lpNameBuffer,
+                                    0,
+                                    NULL,
+                                    REG_OPTION_NON_VOLATILE,
+                                    KEY_WRITE,
+                                    NULL,
+                                    &hDstSubKey,
+                                    &dwDisposition);
+            if (Error != ERROR_SUCCESS)
+            {
+                DPRINT1("Subkey creation failed (Error %lu)\n", Error);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                SetLastError((DWORD)Error);
+                return FALSE;
+            }
+
+            Error = RegOpenKeyExW(hSrcKey,
+                                  lpNameBuffer,
+                                  0,
+                                  KEY_READ,
+                                  &hSrcSubKey);
+            if (Error != ERROR_SUCCESS)
+            {
+                DPRINT1("Error: %lu\n", Error);
+                RegCloseKey(hDstSubKey);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                SetLastError((DWORD)Error);
+                return FALSE;
+            }
+
+            if (!CopyKey(hDstSubKey,
+                         hSrcSubKey))
+            {
+                DPRINT1("Error: %lu\n", GetLastError());
+                RegCloseKey (hSrcSubKey);
+                RegCloseKey (hDstSubKey);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                return FALSE;
+            }
+
+            RegCloseKey(hSrcSubKey);
+            RegCloseKey(hDstSubKey);
+        }
+
+        HeapFree(GetProcessHeap(),
+                 0,
+                 lpNameBuffer);
     }
 
-  /* Copy values */
-  if (dwValues != 0)
+    /* Copy values */
+    if (dwValues != 0)
     {
-      lpNameBuffer = HeapAlloc (GetProcessHeap (),
-                               0,
-                               dwMaxValueNameLength * sizeof(WCHAR));
-      if (lpNameBuffer == NULL)
-       {
-         DPRINT1 ("Buffer allocation failed\n");
-          SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
-
-      lpDataBuffer = HeapAlloc (GetProcessHeap (),
-                               0,
-                               dwMaxValueLength);
-      if (lpDataBuffer == NULL)
-       {
-         DPRINT1 ("Buffer allocation failed\n");
-         HeapFree (GetProcessHeap (),
-                   0,
-                   lpNameBuffer);
-          SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-         return FALSE;
-       }
-
-      for (i = 0; i < dwValues; i++)
-       {
-         dwValueNameLength = dwMaxValueNameLength;
-         dwValueLength = dwMaxValueLength;
-         Error = RegEnumValueW (hSrcKey,
-                                i,
-                                lpNameBuffer,
-                                &dwValueNameLength,
-                                NULL,
-                                &dwType,
-                                lpDataBuffer,
-                                 &dwValueLength);
-          if (Error != ERROR_SUCCESS)
-           {
-             DPRINT1("Error: %lu\n", Error);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpDataBuffer);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-              SetLastError((DWORD)Error);
-             return FALSE;
-           }
-
-         Error = RegSetValueExW (hDstKey,
-                                 lpNameBuffer,
-                                 0,
-                                 dwType,
-                                 lpDataBuffer,
-                                 dwValueLength);
-          if (Error != ERROR_SUCCESS)
-           {
-             DPRINT1("Error: %lu\n", Error);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpDataBuffer);
-             HeapFree (GetProcessHeap (),
-                       0,
-                       lpNameBuffer);
-              SetLastError((DWORD)Error);
-             return FALSE;
-           }
-       }
-
-      HeapFree (GetProcessHeap (),
-               0,
-               lpDataBuffer);
-
-      HeapFree (GetProcessHeap (),
-               0,
-               lpNameBuffer);
+        lpNameBuffer = HeapAlloc(GetProcessHeap(),
+                                 0,
+                                 dwMaxValueNameLength * sizeof(WCHAR));
+        if (lpNameBuffer == NULL)
+        {
+            DPRINT1("Buffer allocation failed\n");
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
+
+        lpDataBuffer = HeapAlloc(GetProcessHeap(),
+                                 0,
+                                 dwMaxValueLength);
+        if (lpDataBuffer == NULL)
+        {
+            DPRINT1("Buffer allocation failed\n");
+            HeapFree(GetProcessHeap(),
+                     0,
+                     lpNameBuffer);
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
+
+        for (i = 0; i < dwValues; i++)
+        {
+            dwValueNameLength = dwMaxValueNameLength;
+            dwValueLength = dwMaxValueLength;
+            Error = RegEnumValueW(hSrcKey,
+                                  i,
+                                  lpNameBuffer,
+                                  &dwValueNameLength,
+                                  NULL,
+                                  &dwType,
+                                  lpDataBuffer,
+                                  &dwValueLength);
+            if (Error != ERROR_SUCCESS)
+            {
+                DPRINT1("Error: %lu\n", Error);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpDataBuffer);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                SetLastError((DWORD)Error);
+                return FALSE;
+            }
+
+            Error = RegSetValueExW(hDstKey,
+                                   lpNameBuffer,
+                                   0,
+                                   dwType,
+                                   lpDataBuffer,
+                                   dwValueLength);
+            if (Error != ERROR_SUCCESS)
+            {
+                DPRINT1("Error: %lu\n", Error);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpDataBuffer);
+                HeapFree(GetProcessHeap(),
+                         0,
+                         lpNameBuffer);
+                SetLastError((DWORD)Error);
+                return FALSE;
+            }
+        }
+
+        HeapFree(GetProcessHeap(),
+                 0,
+                 lpDataBuffer);
+
+        HeapFree(GetProcessHeap(),
+                 0,
+                 lpNameBuffer);
     }
 
-  DPRINT ("CopyKey() done \n");
+    DPRINT("CopyKey() done \n");
 
-  return TRUE;
+    return TRUE;
 #endif
 }
 
 
 BOOL
-CreateUserHive (LPCWSTR lpKeyName,
-               LPCWSTR lpProfilePath)
+CreateUserHive(LPCWSTR lpKeyName,
+               LPCWSTR lpProfilePath)
 {
-  HKEY hDefaultKey = NULL;
-  HKEY hUserKey = NULL;
-  LONG Error;
-  BOOL Ret = FALSE;
-
-  DPRINT ("CreateUserHive(%S) called\n", lpKeyName);
-
-  Error = RegOpenKeyExW (HKEY_USERS,
-                        L".Default",
-                        0,
-                        KEY_READ,
-                        &hDefaultKey);
-  if (Error != ERROR_SUCCESS)
+    HKEY hDefaultKey = NULL;
+    HKEY hUserKey = NULL;
+    LONG Error;
+    BOOL Ret = FALSE;
+
+    DPRINT("CreateUserHive(%S) called\n", lpKeyName);
+
+    Error = RegOpenKeyExW(HKEY_USERS,
+                          L".Default",
+                          0,
+                          KEY_READ,
+                          &hDefaultKey);
+    if (Error != ERROR_SUCCESS)
     {
-      SetLastError((DWORD)Error);
-      goto Cleanup;
+        SetLastError((DWORD)Error);
+        goto Cleanup;
     }
 
-  Error = RegOpenKeyExW (HKEY_USERS,
-                        lpKeyName,
-                        0,
-                        KEY_ALL_ACCESS,
-                        &hUserKey);
-  if (Error != ERROR_SUCCESS)
+    Error = RegOpenKeyExW(HKEY_USERS,
+                          lpKeyName,
+                          0,
+                          KEY_ALL_ACCESS,
+                          &hUserKey);
+    if (Error != ERROR_SUCCESS)
     {
-      SetLastError((DWORD)Error);
-      goto Cleanup;
+        SetLastError((DWORD)Error);
+        goto Cleanup;
     }
 
-  if (!CopyKey(hUserKey, hDefaultKey))
+    if (!CopyKey(hUserKey, hDefaultKey))
     {
-      goto Cleanup;
+        goto Cleanup;
     }
 
-  if (!UpdateUsersShellFolderSettings(lpProfilePath,
-                                     hUserKey))
+    if (!UpdateUsersShellFolderSettings(lpProfilePath,
+                                        hUserKey))
     {
-      goto Cleanup;
+        goto Cleanup;
     }
 
-  RegFlushKey (hUserKey);
-  Ret = TRUE;
+    RegFlushKey(hUserKey);
+    Ret = TRUE;
 
 Cleanup:
-  if (hUserKey != NULL)
-    RegCloseKey (hUserKey);
+    if (hUserKey != NULL)
+        RegCloseKey (hUserKey);
 
-  if (hDefaultKey != NULL)
-    RegCloseKey (hDefaultKey);
+    if (hDefaultKey != NULL)
+        RegCloseKey (hDefaultKey);
 
-  return Ret;
+    return Ret;
 }
 
 /* EOF */
index a78cd0a..b43ea9d 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/resource.h
+ * FILE:            dll/win32/userenv/resource.h
  * PURPOSE:         Resource IDs
  * PROGRAMMER:      Eric Kohl
  */
index f662110..ed4eb5d 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/setup.c
+ * FILE:            dll/win32/userenv/setup.c
  * PURPOSE:         Profile setup functions
  * PROGRAMMER:      Eric Kohl
  */
index 6295fd7..f7a83b8 100644 (file)
@@ -19,7 +19,7 @@
 /*
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
- * FILE:            lib/userenv/userenv.c
+ * FILE:            dll/win32/userenv/userenv.c
  * PURPOSE:         DLL initialization code
  * PROGRAMMER:      Eric Kohl
  */
 
 HINSTANCE hInstance = NULL;
 
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
-         DWORD fdwReason,
-         LPVOID lpvReserved)
+BOOL
+WINAPI
+DllMain(HINSTANCE hinstDLL,
+        DWORD fdwReason,
+        LPVOID lpvReserved)
 {
-  if (fdwReason == DLL_PROCESS_ATTACH)
+    if (fdwReason == DLL_PROCESS_ATTACH)
     {
-       hInstance = hinstDLL;
-       InitializeGPNotifications();
+        hInstance = hinstDLL;
+        InitializeGPNotifications();
     }
-  else if (fdwReason == DLL_PROCESS_DETACH)
+    else if (fdwReason == DLL_PROCESS_DETACH)
     {
         UninitializeGPNotifications();
     }
 
-  return TRUE;
+    return TRUE;
 }