[shell32.dll]
authorClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Thu, 8 Sep 2011 22:43:43 +0000 (22:43 +0000)
committerClaudiu Mihail <claudiu.bogdan.mihail@gmail.com>
Thu, 8 Sep 2011 22:43:43 +0000 (22:43 +0000)
[FORMATTING]
- Second wave of formatting. At least now we won't have any tabs and spaces mixed in.

svn path=/branches/shell32_new-bringup/; revision=53651

35 files changed:
dll/win32/shell32/brsfolder.cpp
dll/win32/shell32/changenotify.cpp
dll/win32/shell32/clipboard.cpp
dll/win32/shell32/control.cpp
dll/win32/shell32/dataobject.cpp
dll/win32/shell32/desktop.cpp
dll/win32/shell32/dragdrophelper.cpp
dll/win32/shell32/drive.cpp
dll/win32/shell32/extracticon.cpp
dll/win32/shell32/folder_options.cpp
dll/win32/shell32/folders.cpp
dll/win32/shell32/fprop.cpp
dll/win32/shell32/iconcache.cpp
dll/win32/shell32/pidl.cpp
dll/win32/shell32/ros-systray.cpp
dll/win32/shell32/she_ocmenu.cpp
dll/win32/shell32/shellitem.cpp
dll/win32/shell32/shellole.cpp
dll/win32/shell32/shellord.cpp
dll/win32/shell32/shellpath.cpp
dll/win32/shell32/shellreg.cpp
dll/win32/shell32/shellstring.cpp
dll/win32/shell32/shfldr_admintools.cpp
dll/win32/shell32/shfldr_fs.cpp
dll/win32/shell32/shfldr_mycomp.cpp
dll/win32/shell32/shfldr_netplaces.cpp
dll/win32/shell32/shfldr_recyclebin.cpp
dll/win32/shell32/shlfolder.cpp
dll/win32/shell32/shlfsbind.cpp
dll/win32/shell32/shlmenu.cpp
dll/win32/shell32/shlview.cpp
dll/win32/shell32/shpolicy.cpp
dll/win32/shell32/shv_def_cmenu.cpp
dll/win32/shell32/shv_item_new.cpp
dll/win32/shell32/startmenu.cpp

index f4bf88c..2d66bdd 100644 (file)
@@ -71,9 +71,9 @@ static DWORD __inline BrowseFlagsToSHCONTF(UINT ulFlags)
 static void browsefolder_callback( LPBROWSEINFOW lpBrowseInfo, HWND hWnd,
                                    UINT msg, LPARAM param )
 {
-       if (!lpBrowseInfo->lpfn)
-               return;
-       lpBrowseInfo->lpfn( hWnd, msg, param, lpBrowseInfo->lParam );
+    if (!lpBrowseInfo->lpfn)
+        return;
+    lpBrowseInfo->lpfn( hWnd, msg, param, lpBrowseInfo->lParam );
 }
 
 /******************************************************************************
@@ -215,17 +215,17 @@ static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq, LPTVITEMW lpTV_ITEM)
  */
 static BOOL GetName(LPSHELLFOLDER lpsf, LPCITEMIDLIST lpi, DWORD dwFlags, LPWSTR lpFriendlyName)
 {
-       BOOL   bSuccess=TRUE;
-       STRRET str;
+    BOOL   bSuccess=TRUE;
+    STRRET str;
 
-       TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
-       if (SUCCEEDED(lpsf->GetDisplayNameOf(lpi, dwFlags, &str)))
+    TRACE("%p %p %x %p\n", lpsf, lpi, dwFlags, lpFriendlyName);
+    if (SUCCEEDED(lpsf->GetDisplayNameOf(lpi, dwFlags, &str)))
           bSuccess = StrRetToStrNW(lpFriendlyName, MAX_PATH, &str, lpi);
-       else
-         bSuccess = FALSE;
+    else
+      bSuccess = FALSE;
 
-       TRACE("-- %s\n", debugstr_w(lpFriendlyName));
-       return bSuccess;
+    TRACE("-- %s\n", debugstr_w(lpFriendlyName));
+    return bSuccess;
 }
 
 /******************************************************************************
@@ -247,39 +247,39 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
     LPCITEMIDLIST pidl, LPCITEMIDLIST pidlParent, IEnumIDList* pEnumIL,
     HTREEITEM hParent)
 {
-       TVITEMW         tvi;
-       TVINSERTSTRUCTW tvins;
-       WCHAR           szBuff[MAX_PATH];
-       LPTV_ITEMDATA   lptvid=0;
+    TVITEMW     tvi;
+    TVINSERTSTRUCTW    tvins;
+    WCHAR        szBuff[MAX_PATH];
+    LPTV_ITEMDATA    lptvid=0;
 
-       tvi.mask  = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
+    tvi.mask  = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
 
-       tvi.cChildren= pEnumIL ? 1 : 0;
-       tvi.mask |= TVIF_CHILDREN;
+    tvi.cChildren= pEnumIL ? 1 : 0;
+    tvi.mask |= TVIF_CHILDREN;
 
-       lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
-       if (!lptvid)
-           return NULL;
+    lptvid = (TV_ITEMDATA *)SHAlloc( sizeof(TV_ITEMDATA) );
+    if (!lptvid)
+        return NULL;
 
-       if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
-           return NULL;
+    if (!GetName(lpsf, pidl, SHGDN_NORMAL, szBuff))
+        return NULL;
 
-       tvi.pszText    = szBuff;
-       tvi.cchTextMax = MAX_PATH;
-       tvi.lParam = (LPARAM)lptvid;
+    tvi.pszText    = szBuff;
+    tvi.cchTextMax = MAX_PATH;
+    tvi.lParam = (LPARAM)lptvid;
 
-       lpsf->AddRef();
-       lptvid->lpsfParent = lpsf;
-       lptvid->lpi     = ILClone(pidl);
-       lptvid->lpifq   = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
-       lptvid->pEnumIL = pEnumIL;
-       GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
+    lpsf->AddRef();
+    lptvid->lpsfParent = lpsf;
+    lptvid->lpi    = ILClone(pidl);
+    lptvid->lpifq    = pidlParent ? ILCombine(pidlParent, pidl) : ILClone(pidl);
+    lptvid->pEnumIL = pEnumIL;
+    GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
 
-       tvins.item         = tvi;
-       tvins.hInsertAfter = NULL;
-       tvins.hParent      = hParent;
+    tvins.item         = tvi;
+    tvins.hInsertAfter = NULL;
+    tvins.hParent      = hParent;
 
-       return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins );
+    return (HTREEITEM)SendMessageW(info->hwndTreeView, TVM_INSERTITEM, 0, (LPARAM)&tvins );
 }
 
 /******************************************************************************
@@ -298,33 +298,33 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf,
 static void FillTreeView( browse_info *info, IShellFolder * lpsf,
                  LPITEMIDLIST  pidl, HTREEITEM hParent, IEnumIDList* lpe)
 {
-       HTREEITEM       hPrev = 0;
-       LPITEMIDLIST    pidlTemp = 0;
-       ULONG           ulFetched;
-       HRESULT         hr;
-       HWND            hwnd = GetParent( info->hwndTreeView );
-
-       TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);
-
-       /* No IEnumIDList -> No children */
-       if (!lpe) return;
-
-       SetCapture( hwnd );
-       SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );
-
-       while (NOERROR == lpe->Next(1,&pidlTemp,&ulFetched))
-       {
-           ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
-           IEnumIDList* pEnumIL = NULL;
-           IShellFolder* pSFChild = NULL;
-           lpsf->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
-           if (ulAttrs & SFGAO_FOLDER)
-           {
-               hr = lpsf->BindToObject(pidlTemp, NULL, IID_IShellFolder, (LPVOID *)&pSFChild);
-               if (SUCCEEDED(hr))
+    HTREEITEM    hPrev = 0;
+    LPITEMIDLIST    pidlTemp = 0;
+    ULONG        ulFetched;
+    HRESULT        hr;
+    HWND        hwnd = GetParent( info->hwndTreeView );
+
+    TRACE("%p %p %p %p\n",lpsf, pidl, hParent, lpe);
+
+    /* No IEnumIDList -> No children */
+    if (!lpe) return;
+
+    SetCapture( hwnd );
+    SetCursor( LoadCursorA( 0, (LPSTR)IDC_WAIT ) );
+
+    while (NOERROR == lpe->Next(1,&pidlTemp,&ulFetched))
+    {
+        ULONG ulAttrs = SFGAO_HASSUBFOLDER | SFGAO_FOLDER;
+        IEnumIDList* pEnumIL = NULL;
+        IShellFolder* pSFChild = NULL;
+        lpsf->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlTemp, &ulAttrs);
+        if (ulAttrs & SFGAO_FOLDER)
+        {
+            hr = lpsf->BindToObject(pidlTemp, NULL, IID_IShellFolder, (LPVOID *)&pSFChild);
+            if (SUCCEEDED(hr))
                 {
-                   DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
-                   hr = pSFChild->EnumObjects(hwnd, flags, &pEnumIL);
+                DWORD flags = BrowseFlagsToSHCONTF(info->lpBrowseInfo->ulFlags);
+                hr = pSFChild->EnumObjects(hwnd, flags, &pEnumIL);
                     if (hr == S_OK)
                     {
                         if ((pEnumIL->Skip(1) != S_OK) ||
@@ -336,17 +336,17 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf,
                     }
                     pSFChild->Release();
                 }
-           }
+        }
 
-           if (!(hPrev = InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent)))
-               goto done;
-           SHFree(pidlTemp);  /* Finally, free the pidl that the shell gave us... */
-           pidlTemp=NULL;
-       }
+        if (!(hPrev = InsertTreeViewItem(info, lpsf, pidlTemp, pidl, pEnumIL, hParent)))
+            goto done;
+        SHFree(pidlTemp);  /* Finally, free the pidl that the shell gave us... */
+        pidlTemp=NULL;
+    }
 
 done:
-       ReleaseCapture();
-       SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
+    ReleaseCapture();
+    SetCursor(LoadCursorW(0, (LPWSTR)IDC_ARROW));
     SHFree(pidlTemp);
 }
 
@@ -491,16 +491,16 @@ static BOOL BrsFolder_OnCreate( HWND hWnd, browse_info *info )
     if (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE)
         FIXME("flags BIF_NEWDIALOGSTYLE partially implemented\n");
     if (lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS)
-       FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
+    FIXME("flags %x not implemented\n", lpBrowseInfo->ulFlags & ~SUPPORTEDFLAGS);
 
     if (lpBrowseInfo->lpszTitle)
-       SetWindowTextW( GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle );
+    SetWindowTextW( GetDlgItem(hWnd, IDD_TITLE), lpBrowseInfo->lpszTitle );
     else
-       ShowWindow( GetDlgItem(hWnd, IDD_TITLE), SW_HIDE );
+    ShowWindow( GetDlgItem(hWnd, IDD_TITLE), SW_HIDE );
 
     if (!(lpBrowseInfo->ulFlags & BIF_STATUSTEXT)
         || (lpBrowseInfo->ulFlags & BIF_NEWDIALOGSTYLE))
-       ShowWindow( GetDlgItem(hWnd, IDD_STATUS), SW_HIDE );
+    ShowWindow( GetDlgItem(hWnd, IDD_STATUS), SW_HIDE );
 
     /* Hide "Make New Folder" Button? */
     if ((lpBrowseInfo->ulFlags & BIF_NONEWFOLDERBUTTON)
@@ -675,7 +675,7 @@ static BOOL BrsFolder_OnSetSelectionA(browse_info *info, LPVOID selection, BOOL
  *             BrsFolderDlgProc32  (not an exported API function)
  */
 static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
-                                         LPARAM lParam )
+                          LPARAM lParam )
 {
     browse_info *info;
 
@@ -806,7 +806,7 @@ LPITEMIDLIST WINAPI SHBrowseForFolderW (LPBROWSEINFOW lpbi)
     else
         templateName = swBrowseTemplateName;
     r = DialogBoxParamW( shell32_hInstance, templateName, lpbi->hwndOwner,
-                        BrsFolderDlgProc, (LPARAM)&info );
+                     BrsFolderDlgProc, (LPARAM)&info );
     if (SUCCEEDED(hr))
         OleUninitialize();
     if (!r)
index 5328dae..c9c8596 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     shell change notification
+ *    shell change notification
  *
  * Copyright 2000 Juergen Schmied
  *
@@ -25,14 +25,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 namespace
 {
-       extern CRITICAL_SECTION SHELL32_ChangenotifyCS;
-       CRITICAL_SECTION_DEBUG critsect_debug =
-       {
-               0, 0, &SHELL32_ChangenotifyCS,
-               { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
-                 0, 0, { (DWORD_PTR)(__FILE__ ": SHELL32_ChangenotifyCS") }
-       };
-       CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
+    extern CRITICAL_SECTION SHELL32_ChangenotifyCS;
+    CRITICAL_SECTION_DEBUG critsect_debug =
+    {
+        0, 0, &SHELL32_ChangenotifyCS,
+        { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
+          0, 0, { (DWORD_PTR)(__FILE__ ": SHELL32_ChangenotifyCS") }
+    };
+    CRITICAL_SECTION SHELL32_ChangenotifyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
 }
 
 typedef SHChangeNotifyEntry *LPNOTIFYREGISTER;
@@ -40,16 +40,16 @@ typedef SHChangeNotifyEntry *LPNOTIFYREGISTER;
 /* internal list of notification clients (internal) */
 typedef struct _NOTIFICATIONLIST
 {
-       struct _NOTIFICATIONLIST *next;
-       struct _NOTIFICATIONLIST *prev;
-       HWND hwnd;              /* window to notify */
-       DWORD uMsg;             /* message to send */
-       LPNOTIFYREGISTER apidl; /* array of entries to watch*/
-       UINT cidl;              /* number of pidls in array */
-       LONG wEventMask;        /* subscribed events */
-       LONG wSignalledEvent;   /* event that occurred */
-       DWORD dwFlags;          /* client flags */
-       LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/
+    struct _NOTIFICATIONLIST *next;
+    struct _NOTIFICATIONLIST *prev;
+    HWND hwnd;        /* window to notify */
+    DWORD uMsg;        /* message to send */
+    LPNOTIFYREGISTER apidl; /* array of entries to watch*/
+    UINT cidl;        /* number of pidls in array */
+    LONG wEventMask;    /* subscribed events */
+    LONG wSignalledEvent;   /* event that occurred */
+    DWORD dwFlags;        /* client flags */
+    LPCITEMIDLIST pidlSignaled; /*pidl of the path that caused the signal*/
 
 } NOTIFICATIONLIST, *LPNOTIFICATIONLIST;
 
@@ -178,7 +178,7 @@ void FreeChangeNotifications(void)
 }
 
 /*************************************************************************
- * SHChangeNotifyRegister                      [SHELL32.2]
+ * SHChangeNotifyRegister            [SHELL32.2]
  *
  */
 ULONG WINAPI
@@ -196,7 +196,7 @@ SHChangeNotifyRegister(
     item = (NOTIFICATIONLIST *)SHAlloc(sizeof(NOTIFICATIONLIST));
 
     TRACE("(%p,0x%08x,0x%08x,0x%08x,%d,%p) item=%p\n",
-       hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item);
+    hwnd, fSources, wEventMask, uMsg, cItems, lpItems, item);
 
     item->next = NULL;
     item->prev = NULL;
@@ -225,7 +225,7 @@ SHChangeNotifyRegister(
 }
 
 /*************************************************************************
- * SHChangeNotifyDeregister                    [SHELL32.4]
+ * SHChangeNotifyDeregister            [SHELL32.4]
  */
 BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
 {
@@ -245,10 +245,10 @@ BOOL WINAPI SHChangeNotifyDeregister(ULONG hNotify)
 }
 
 /*************************************************************************
- * SHChangeNotifyUpdateEntryList                       [SHELL32.5]
+ * SHChangeNotifyUpdateEntryList               [SHELL32.5]
  */
 EXTERN_C BOOL WINAPI SHChangeNotifyUpdateEntryList(DWORD unknown1, DWORD unknown2,
-                             DWORD unknown3, DWORD unknown4)
+                  DWORD unknown3, DWORD unknown4)
 {
     FIXME("(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n",
           unknown1, unknown2, unknown3, unknown4);
@@ -269,7 +269,7 @@ static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL su
 }
 
 /*************************************************************************
- * SHChangeNotify                              [SHELL32.@]
+ * SHChangeNotify                [SHELL32.@]
  */
 void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
 {
@@ -403,7 +403,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
 }
 
 /*************************************************************************
- * NTSHChangeNotifyRegister                    [SHELL32.640]
+ * NTSHChangeNotifyRegister            [SHELL32.640]
  * NOTES
  *   Idlist is an array of structures and Count specifies how many items in the array.
  *   count should always be one when calling SHChangeNotifyRegister, or
@@ -422,13 +422,13 @@ EXTERN_C ULONG WINAPI NTSHChangeNotifyRegister(
 }
 
 /*************************************************************************
- * SHChangeNotification_Lock                   [SHELL32.644]
+ * SHChangeNotification_Lock            [SHELL32.644]
  */
 HANDLE WINAPI SHChangeNotification_Lock(
-       HANDLE hChange,
-       DWORD dwProcessId,
-       LPITEMIDLIST **lppidls,
-       LPLONG lpwEventId)
+    HANDLE hChange,
+    DWORD dwProcessId,
+    LPITEMIDLIST **lppidls,
+    LPLONG lpwEventId)
 {
     DWORD i;
     LPNOTIFICATIONLIST node;
@@ -457,7 +457,7 @@ HANDLE WINAPI SHChangeNotification_Lock(
 }
 
 /*************************************************************************
- * SHChangeNotification_Unlock                 [SHELL32.645]
+ * SHChangeNotification_Unlock            [SHELL32.645]
  */
 BOOL WINAPI SHChangeNotification_Unlock ( HANDLE hLock)
 {
@@ -466,7 +466,7 @@ BOOL WINAPI SHChangeNotification_Unlock ( HANDLE hLock)
 }
 
 /*************************************************************************
- * NTSHChangeNotifyDeregister                  [SHELL32.641]
+ * NTSHChangeNotifyDeregister            [SHELL32.641]
  */
 EXTERN_C DWORD WINAPI NTSHChangeNotifyDeregister(ULONG x1)
 {
index a2b7510..b4a6943 100644 (file)
@@ -1,7 +1,7 @@
 /*
- *     clipboard helper functions
+ *    clipboard helper functions
  *
- *     Copyright 2000  Juergen Schmied <juergen.schmied@debitel.de>
+ *    Copyright 2000    Juergen Schmied <juergen.schmied@debitel.de>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  *
  * - a right mousebutton-copy sets the following formats:
  *  classic:
- *     Shell IDList Array
- *     Preferred Drop Effect
- *     Shell Object Offsets
- *     HDROP
- *     FileName
+ *    Shell IDList Array
+ *    Preferred Drop Effect
+ *    Shell Object Offsets
+ *    HDROP
+ *    FileName
  *  ole:
- *     OlePrivateData (ClipboardDataObjectInterface)
+ *    OlePrivateData (ClipboardDataObjectInterface)
  *
  */
 
@@ -46,195 +46,195 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
  */
 HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       UINT i;
-       int size = 0;
-       WCHAR wszFileName[MAX_PATH];
-       HGLOBAL hGlobal = NULL;
-       DROPFILES *pDropFiles;
-       int offset;
-       LPITEMIDLIST *pidls;
+    UINT i;
+    int size = 0;
+    WCHAR wszFileName[MAX_PATH];
+    HGLOBAL hGlobal = NULL;
+    DROPFILES *pDropFiles;
+    int offset;
+    LPITEMIDLIST *pidls;
 
-       TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
+    TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
 
-       pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
-       if (!pidls)
-               goto cleanup;
+    pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
+    if (!pidls)
+        goto cleanup;
 
-       /* get the size needed */
-       size = sizeof(DROPFILES);
+    /* get the size needed */
+    size = sizeof(DROPFILES);
 
-       for (i=0; i<cidl;i++)
-       {
-         pidls[i] = ILCombine(pidlRoot, apidl[i]);
-         SHGetPathFromIDListW(pidls[i], wszFileName);
-         size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
-       }
+    for (i=0; i<cidl;i++)
+    {
+      pidls[i] = ILCombine(pidlRoot, apidl[i]);
+      SHGetPathFromIDListW(pidls[i], wszFileName);
+      size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
+    }
 
-       size += sizeof(WCHAR);
+    size += sizeof(WCHAR);
 
-       /* Fill the structure */
-       hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
-       if(!hGlobal)
-               goto cleanup;
+    /* Fill the structure */
+    hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
+    if(!hGlobal)
+        goto cleanup;
 
         pDropFiles = (DROPFILES *)GlobalLock(hGlobal);
-       offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
+    offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
         pDropFiles->pFiles = offset * sizeof(WCHAR);
         pDropFiles->fWide = TRUE;
 
-       for (i=0; i<cidl;i++)
-       {
-         SHGetPathFromIDListW(pidls[i], wszFileName);
-         wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
-         offset += wcslen(wszFileName) + 1;
-         ILFree(pidls[i]);
-       }
+    for (i=0; i<cidl;i++)
+    {
+      SHGetPathFromIDListW(pidls[i], wszFileName);
+      wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
+      offset += wcslen(wszFileName) + 1;
+      ILFree(pidls[i]);
+    }
 
-       ((WCHAR*)pDropFiles)[offset] = 0;
-       GlobalUnlock(hGlobal);
+    ((WCHAR*)pDropFiles)[offset] = 0;
+    GlobalUnlock(hGlobal);
 
 cleanup:
-       if(pidls)
-               HeapFree(GetProcessHeap(), 0, pidls);
+    if(pidls)
+        HeapFree(GetProcessHeap(), 0, pidls);
 
-       return hGlobal;
+    return hGlobal;
 }
 
 HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       UINT i;
-       int offset = 0, sizePidl, size;
-       HGLOBAL hGlobal;
-       LPIDA   pcida;
-
-       TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
-
-       /* get the size needed */
-       size = sizeof(CIDA) + sizeof (UINT)*(cidl);     /* header */
-       size += ILGetSize (pidlRoot);                   /* root pidl */
-       for(i=0; i<cidl; i++)
-       {
-         size += ILGetSize(apidl[i]);                  /* child pidls */
-       }
-
-       /* fill the structure */
-       hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
-       if(!hGlobal) return hGlobal;
-       pcida = (LPIDA)GlobalLock (hGlobal);
-       pcida->cidl = cidl;
-
-       /* root pidl */
-       offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
-       pcida->aoffset[0] = offset;                     /* first element */
-       sizePidl = ILGetSize (pidlRoot);
-       memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
-       offset += sizePidl;
-
-       for(i=0; i<cidl; i++)                           /* child pidls */
-       {
-         pcida->aoffset[i+1] = offset;
-         sizePidl = ILGetSize(apidl[i]);
-         memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
-         offset += sizePidl;
-       }
-
-       GlobalUnlock(hGlobal);
-       return hGlobal;
+    UINT i;
+    int offset = 0, sizePidl, size;
+    HGLOBAL hGlobal;
+    LPIDA    pcida;
+
+    TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
+
+    /* get the size needed */
+    size = sizeof(CIDA) + sizeof (UINT)*(cidl);    /* header */
+    size += ILGetSize (pidlRoot);            /* root pidl */
+    for(i=0; i<cidl; i++)
+    {
+      size += ILGetSize(apidl[i]);            /* child pidls */
+    }
+
+    /* fill the structure */
+    hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
+    if(!hGlobal) return hGlobal;
+    pcida = (LPIDA)GlobalLock (hGlobal);
+    pcida->cidl = cidl;
+
+    /* root pidl */
+    offset = sizeof(CIDA) + sizeof (UINT)*(cidl);
+    pcida->aoffset[0] = offset;            /* first element */
+    sizePidl = ILGetSize (pidlRoot);
+    memcpy(((LPBYTE)pcida)+offset, pidlRoot, sizePidl);
+    offset += sizePidl;
+
+    for(i=0; i<cidl; i++)                /* child pidls */
+    {
+      pcida->aoffset[i+1] = offset;
+      sizePidl = ILGetSize(apidl[i]);
+      memcpy(((LPBYTE)pcida)+offset, apidl[i], sizePidl);
+      offset += sizePidl;
+    }
+
+    GlobalUnlock(hGlobal);
+    return hGlobal;
 }
 
 HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       FIXME("\n");
-       return 0;
+    FIXME("\n");
+    return 0;
 }
 
 HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       FIXME("\n");
-       return 0;
+    FIXME("\n");
+    return 0;
 }
 
 HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       FIXME("\n");
-       return 0;
+    FIXME("\n");
+    return 0;
 }
 
 HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       int size = 0;
-       char szTemp[MAX_PATH], *szFileName;
-       LPITEMIDLIST pidl;
-       HGLOBAL hGlobal;
-       BOOL bSuccess;
-
-       TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
-
-       /* get path of combined pidl */
-       pidl = ILCombine(pidlRoot, apidl[0]);
-       if (!pidl)
-               return 0;
-
-       bSuccess = SHGetPathFromIDListA(pidl, szTemp);
-       SHFree(pidl);
-       if (!bSuccess)
-               return 0;
-
-       size = strlen(szTemp) + 1;
-
-       /* fill the structure */
-       hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
-       if(!hGlobal) return hGlobal;
-       szFileName = (char *)GlobalLock(hGlobal);
-       memcpy(szFileName, szTemp, size);
-       GlobalUnlock(hGlobal);
-
-       return hGlobal;
+    int size = 0;
+    char szTemp[MAX_PATH], *szFileName;
+    LPITEMIDLIST pidl;
+    HGLOBAL hGlobal;
+    BOOL bSuccess;
+
+    TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
+
+    /* get path of combined pidl */
+    pidl = ILCombine(pidlRoot, apidl[0]);
+    if (!pidl)
+        return 0;
+
+    bSuccess = SHGetPathFromIDListA(pidl, szTemp);
+    SHFree(pidl);
+    if (!bSuccess)
+        return 0;
+
+    size = strlen(szTemp) + 1;
+
+    /* fill the structure */
+    hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
+    if(!hGlobal) return hGlobal;
+    szFileName = (char *)GlobalLock(hGlobal);
+    memcpy(szFileName, szTemp, size);
+    GlobalUnlock(hGlobal);
+
+    return hGlobal;
 }
 
 HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
 {
-       int size = 0;
-       WCHAR szTemp[MAX_PATH], *szFileName;
-       LPITEMIDLIST pidl;
-       HGLOBAL hGlobal;
-       BOOL bSuccess;
-
-       TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
-
-       /* get path of combined pidl */
-       pidl = ILCombine(pidlRoot, apidl[0]);
-       if (!pidl)
-               return 0;
-
-       bSuccess = SHGetPathFromIDListW(pidl, szTemp);
-       SHFree(pidl);
-       if (!bSuccess)
-               return 0;
-
-       size = (wcslen(szTemp)+1) * sizeof(WCHAR);
-
-       /* fill the structure */
-       hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
-       if(!hGlobal) return hGlobal;
-       szFileName = (WCHAR *)GlobalLock(hGlobal);
-       memcpy(szFileName, szTemp, size);
-       GlobalUnlock(hGlobal);
-
-       return hGlobal;
+    int size = 0;
+    WCHAR szTemp[MAX_PATH], *szFileName;
+    LPITEMIDLIST pidl;
+    HGLOBAL hGlobal;
+    BOOL bSuccess;
+
+    TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
+
+    /* get path of combined pidl */
+    pidl = ILCombine(pidlRoot, apidl[0]);
+    if (!pidl)
+        return 0;
+
+    bSuccess = SHGetPathFromIDListW(pidl, szTemp);
+    SHFree(pidl);
+    if (!bSuccess)
+        return 0;
+
+    size = (wcslen(szTemp)+1) * sizeof(WCHAR);
+
+    /* fill the structure */
+    hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
+    if(!hGlobal) return hGlobal;
+    szFileName = (WCHAR *)GlobalLock(hGlobal);
+    memcpy(szFileName, szTemp, size);
+    GlobalUnlock(hGlobal);
+
+    return hGlobal;
 }
 
 HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
 {
-       DWORD * pdwFlag;
-       HGLOBAL hGlobal;
+    DWORD * pdwFlag;
+    HGLOBAL hGlobal;
 
-       TRACE("(0x%08x)\n", dwFlags);
+    TRACE("(0x%08x)\n", dwFlags);
 
-       hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
-       if(!hGlobal) return hGlobal;
+    hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
+    if(!hGlobal) return hGlobal;
         pdwFlag = (DWORD*)GlobalLock(hGlobal);
-       *pdwFlag = dwFlags;
-       GlobalUnlock(hGlobal);
-       return hGlobal;
+    *pdwFlag = dwFlags;
+    GlobalUnlock(hGlobal);
+    return hGlobal;
 }
index 9b4b74a..811258e 100644 (file)
 
 WINE_DEFAULT_DEBUG_CHANNEL(shlctrl);
 
-CPlApplet*     Control_UnloadApplet(CPlApplet* applet)
+CPlApplet*    Control_UnloadApplet(CPlApplet* applet)
 {
-    unsigned   i;
-    CPlApplet* next;
+    unsigned    i;
+    CPlApplet*    next;
 
     for (i = 0; i < applet->count; i++) {
         if (!applet->info[i].dwSize) continue;
@@ -38,11 +38,11 @@ CPlApplet*  Control_UnloadApplet(CPlApplet* applet)
     return next;
 }
 
-CPlApplet*     Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
+CPlApplet*    Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
 {
-    CPlApplet* applet;
-    unsigned   i;
-    CPLINFO    info;
+    CPlApplet*    applet;
+    unsigned     i;
+    CPLINFO    info;
     NEWCPLINFOW newinfo;
 
     if (!(applet = (CPlApplet *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet))))
@@ -52,62 +52,62 @@ CPlApplet*  Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
 
     if (!(applet->hModule = LoadLibraryW(cmd))) {
         WARN("Cannot load control panel applet %s\n", debugstr_w(cmd));
-       goto theError;
+    goto theError;
     }
     if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) {
         WARN("Not a valid control panel applet %s\n", debugstr_w(cmd));
-       goto theError;
+    goto theError;
     }
     if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) {
         WARN("Init of applet has failed\n");
-       goto theError;
+    goto theError;
     }
     if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) {
         WARN("No subprogram in applet\n");
-       goto theError;
+    goto theError;
     }
 
     applet = (CPlApplet *)HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet,
-                        sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW));
+             sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW));
 
     for (i = 0; i < applet->count; i++) {
        ZeroMemory(&newinfo, sizeof(newinfo));
        newinfo.dwSize = sizeof(NEWCPLINFOW);
        applet->info[i].dwSize = sizeof(NEWCPLINFOW);
        /* proc is supposed to return a null value upon success for
-       * CPL_INQUIRE and CPL_NEWINQUIRE
-       * However, real drivers don't seem to behave like this
-       * So, use introspection rather than return value
-       */
+    * CPL_INQUIRE and CPL_NEWINQUIRE
+    * However, real drivers don't seem to behave like this
+    * So, use introspection rather than return value
+    */
        applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo);
        if (newinfo.hIcon == 0) {
-          applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
-          if (info.idIcon == 0 || info.idName == 0) {
-              WARN("Couldn't get info from sp %u\n", i);
-              applet->info[i].dwSize = 0;
-          } else {
-              /* convert the old data into the new structure */
-              applet->info[i].dwFlags = 0;
-              applet->info[i].dwHelpContext = 0;
-              applet->info[i].lData = info.lData;
-              applet->info[i].hIcon = LoadIconW(applet->hModule,
-                                                MAKEINTRESOURCEW(info.idIcon));
-              LoadStringW(applet->hModule, info.idName,
-                          applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR));
-              LoadStringW(applet->hModule, info.idInfo,
-                          applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
-              applet->info[i].szHelpFile[0] = '\0';
-          }
+       applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info);
+       if (info.idIcon == 0 || info.idName == 0) {
+           WARN("Couldn't get info from sp %u\n", i);
+           applet->info[i].dwSize = 0;
+       } else {
+           /* convert the old data into the new structure */
+           applet->info[i].dwFlags = 0;
+           applet->info[i].dwHelpContext = 0;
+           applet->info[i].lData = info.lData;
+           applet->info[i].hIcon = LoadIconW(applet->hModule,
+                         MAKEINTRESOURCEW(info.idIcon));
+           LoadStringW(applet->hModule, info.idName,
+               applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR));
+           LoadStringW(applet->hModule, info.idInfo,
+               applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR));
+           applet->info[i].szHelpFile[0] = '\0';
+       }
        }
        else
        {
            CopyMemory(&applet->info[i], &newinfo, newinfo.dwSize);
-              if (newinfo.dwSize != sizeof(NEWCPLINFOW))
+           if (newinfo.dwSize != sizeof(NEWCPLINFOW))
            {
-                   applet->info[i].dwSize = sizeof(NEWCPLINFOW);
-                       lstrcpyW(applet->info[i].szName, newinfo.szName);
-                               lstrcpyW(applet->info[i].szInfo, newinfo.szInfo);
-                               lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile);
+                applet->info[i].dwSize = sizeof(NEWCPLINFOW);
+                lstrcpyW(applet->info[i].szName, newinfo.szName);
+                lstrcpyW(applet->info[i].szInfo, newinfo.szInfo);
+                lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile);
            }
        }
     }
@@ -124,74 +124,74 @@ CPlApplet*        Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel)
 
 static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs)
 {
-   CPanel*     panel = (CPanel*)cs->lpCreateParams;
+   CPanel*    panel = (CPanel*)cs->lpCreateParams;
 
    SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel);
    panel->status = 0;
    panel->hWnd = hWnd;
 }
 
-#define        XICON   32
-#define XSTEP  128
-#define        YICON   32
-#define YSTEP  64
+#define    XICON    32
+#define XSTEP    128
+#define    YICON    32
+#define YSTEP    64
 
-static BOOL    Control_Localize(const CPanel* panel, int cx, int cy,
-                                CPlApplet** papplet, unsigned* psp)
+static BOOL    Control_Localize(const CPanel* panel, int cx, int cy,
+                 CPlApplet** papplet, unsigned* psp)
 {
-    unsigned int       i;
-       int                             x = (XSTEP-XICON)/2, y = 0;
-    CPlApplet* applet;
-    RECT       rc;
+    unsigned int    i;
+    int                x = (XSTEP-XICON)/2, y = 0;
+    CPlApplet*    applet;
+    RECT    rc;
 
     GetClientRect(panel->hWnd, &rc);
     for (applet = panel->first; applet; applet = applet->next) {
         for (i = 0; i < applet->count; i++) {
-           if (!applet->info[i].dwSize) continue;
-           if (x + XSTEP >= rc.right - rc.left) {
-               x = (XSTEP-XICON)/2;
-               y += YSTEP;
-           }
-           if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) {
-               *papplet = applet;
-               *psp = i;
-               return TRUE;
-           }
-           x += XSTEP;
-       }
+        if (!applet->info[i].dwSize) continue;
+        if (x + XSTEP >= rc.right - rc.left) {
+            x = (XSTEP-XICON)/2;
+        y += YSTEP;
+        }
+        if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) {
+            *papplet = applet;
+            *psp = i;
+        return TRUE;
+        }
+        x += XSTEP;
+    }
     }
     return FALSE;
 }
 
 static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam)
 {
-    HDC                hdc;
-    PAINTSTRUCT        ps;
-    RECT       rc, txtRect;
-    unsigned int       i;
-       int                             x = 0, y = 0;
-    CPlApplet* applet;
-    HGDIOBJ    hOldFont;
+    HDC        hdc;
+    PAINTSTRUCT    ps;
+    RECT    rc, txtRect;
+    unsigned int    i;
+    int                x = 0, y = 0;
+    CPlApplet*    applet;
+    HGDIOBJ    hOldFont;
 
     hdc = (wParam) ? (HDC)wParam : BeginPaint(panel->hWnd, &ps);
     hOldFont = SelectObject(hdc, GetStockObject(ANSI_VAR_FONT));
     GetClientRect(panel->hWnd, &rc);
     for (applet = panel->first; applet; applet = applet->next) {
         for (i = 0; i < applet->count; i++) {
-           if (x + XSTEP >= rc.right - rc.left) {
-               x = 0;
-               y += YSTEP;
-           }
-           if (!applet->info[i].dwSize) continue;
-           DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon);
-           txtRect.left = x;
-           txtRect.right = x + XSTEP;
-           txtRect.top = y + YICON;
-           txtRect.bottom = y + YSTEP;
-           DrawTextW(hdc, applet->info[i].szName, -1, &txtRect,
-                     DT_CENTER | DT_VCENTER);
-           x += XSTEP;
-       }
+        if (x + XSTEP >= rc.right - rc.left) {
+            x = 0;
+        y += YSTEP;
+        }
+        if (!applet->info[i].dwSize) continue;
+        DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon);
+        txtRect.left = x;
+        txtRect.right = x + XSTEP;
+        txtRect.top = y + YICON;
+        txtRect.bottom = y + YSTEP;
+        DrawTextW(hdc, applet->info[i].szName, -1, &txtRect,
+              DT_CENTER | DT_VCENTER);
+        x += XSTEP;
+    }
     }
     SelectObject(hdc, hOldFont);
     if (!wParam) EndPaint(panel->hWnd, &ps);
@@ -200,48 +200,48 @@ static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam)
 
 static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up)
 {
-    unsigned   i;
-    CPlApplet* applet;
+    unsigned    i;
+    CPlApplet*    applet;
 
     if (Control_Localize(panel, (short)LOWORD(lParam), (short)HIWORD(lParam), &applet, &i)) {
        if (up) {
-          if (panel->clkApplet == applet && panel->clkSP == i) {
-              applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData);
-          }
+       if (panel->clkApplet == applet && panel->clkSP == i) {
+           applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData);
+       }
        } else {
-          panel->clkApplet = applet;
-          panel->clkSP = i;
+       panel->clkApplet = applet;
+       panel->clkSP = i;
        }
     }
     return 0;
 }
 
-static LRESULT WINAPI  Control_WndProc(HWND hWnd, UINT wMsg,
-                                       WPARAM lParam1, LPARAM lParam2)
+static LRESULT WINAPI    Control_WndProc(HWND hWnd, UINT wMsg,
+                    WPARAM lParam1, LPARAM lParam2)
 {
-   CPanel*     panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
+   CPanel*    panel = (CPanel*)GetWindowLongPtrW(hWnd, 0);
 
    if (panel || wMsg == WM_CREATE) {
       switch (wMsg) {
       case WM_CREATE:
-        Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2);
-        return 0;
+     Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2);
+     return 0;
       case WM_DESTROY:
          {
-           CPlApplet*  applet = panel->first;
-           while (applet)
-              applet = Control_UnloadApplet(applet);
+        CPlApplet*    applet = panel->first;
+        while (applet)
+           applet = Control_UnloadApplet(applet);
          }
          PostQuitMessage(0);
-        break;
+     break;
       case WM_PAINT:
-        return Control_WndProc_Paint(panel, lParam1);
+     return Control_WndProc_Paint(panel, lParam1);
       case WM_LBUTTONUP:
-        return Control_WndProc_LButton(panel, lParam2, TRUE);
+     return Control_WndProc_LButton(panel, lParam2, TRUE);
       case WM_LBUTTONDOWN:
-        return Control_WndProc_LButton(panel, lParam2, FALSE);
+     return Control_WndProc_LButton(panel, lParam2, FALSE);
 /* EPP       case WM_COMMAND: */
-/* EPP          return Control_WndProc_Command(mwi, lParam1, lParam2); */
+/* EPP      return Control_WndProc_Command(mwi, lParam1, lParam2); */
       }
    }
 
@@ -250,8 +250,8 @@ static LRESULT WINAPI       Control_WndProc(HWND hWnd, UINT wMsg,
 
 static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 {
-    WNDCLASSW  wc;
-    MSG        msg;
+    WNDCLASSW    wc;
+    MSG    msg;
     const WCHAR* appName = L"ReactOS Control Panel";
     wc.style = CS_HREDRAW|CS_VREDRAW;
     wc.lpfnWndProc = Control_WndProc;
@@ -267,16 +267,16 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
     if (!RegisterClassW(&wc)) return;
 
     CreateWindowExW(0, wc.lpszClassName, appName,
-                   WS_OVERLAPPEDWINDOW | WS_VISIBLE,
-                   CW_USEDEFAULT, CW_USEDEFAULT,
-                   CW_USEDEFAULT, CW_USEDEFAULT,
-                   hWnd, NULL, hInst, panel);
+            WS_OVERLAPPEDWINDOW | WS_VISIBLE,
+            CW_USEDEFAULT, CW_USEDEFAULT,
+            CW_USEDEFAULT, CW_USEDEFAULT,
+            hWnd, NULL, hInst, panel);
     if (!panel->hWnd) return;
 
     if (!panel->first) {
-       /* FIXME appName & message should be localized  */
-       MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK);
-       return;
+    /* FIXME appName & message should be localized  */
+    MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK);
+    return;
     }
 
     while (GetMessageW(&msg, panel->hWnd, 0, 0)) {
@@ -287,9 +287,9 @@ static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 
 static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 {
-    HANDLE             h;
-    WIN32_FIND_DATAW   fd;
-    WCHAR              buffer[MAX_PATH];
+    HANDLE        h;
+    WIN32_FIND_DATAW    fd;
+    WCHAR        buffer[MAX_PATH];
     static const WCHAR wszAllCpl[] = {'*','.','c','p','l',0};
     WCHAR *p;
 
@@ -300,35 +300,35 @@ static void Control_DoWindow(CPanel* panel, HWND hWnd, HINSTANCE hInst)
 
     if ((h = FindFirstFileW(buffer, &fd)) != INVALID_HANDLE_VALUE) {
         do {
-          wcscpy(p, fd.cFileName);
-          Control_LoadApplet(hWnd, buffer, panel);
-       } while (FindNextFileW(h, &fd));
-       FindClose(h);
+       wcscpy(p, fd.cFileName);
+       Control_LoadApplet(hWnd, buffer, panel);
+    } while (FindNextFileW(h, &fd));
+    FindClose(h);
     }
 
     Control_DoInterface(panel, hWnd, hInst);
 }
 
-static void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
+static    void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
    /* forms to parse:
-    *  foo.cpl,@sp,str
-    *  foo.cpl,@sp
-    *  foo.cpl,,str
-    *  foo.cpl @sp
-    *  foo.cpl str
+    *    foo.cpl,@sp,str
+    *    foo.cpl,@sp
+    *    foo.cpl,,str
+    *    foo.cpl @sp
+    *    foo.cpl str
     *   "a path\foo.cpl"
     */
 {
-    LPWSTR     buffer;
-    LPWSTR     beg = NULL;
-    LPWSTR     end;
-    WCHAR      ch;
+    LPWSTR    buffer;
+    LPWSTR    beg = NULL;
+    LPWSTR    end;
+    WCHAR    ch;
     LPCWSTR       ptr, ptr2;
     WCHAR szName[MAX_PATH];
-    unsigned   sp = 0;
-    LPWSTR     extraPmts = NULL;
+    unsigned     sp = 0;
+    LPWSTR    extraPmts = NULL;
     int        quoted = 0;
-    BOOL       spSet = FALSE;
+    BOOL    spSet = FALSE;
     HANDLE hMutex;
     UINT Length;
 
@@ -352,7 +352,7 @@ static      void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
     szName[Length] = L'\0';
     hMutex = CreateMutexW(NULL, TRUE, szName);
 
-       if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
+     if ((!hMutex) || (GetLastError() == ERROR_ALREADY_EXISTS))
         return;
     buffer = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(wszCmd) + 1) * sizeof(*wszCmd));
     if (!buffer)
@@ -362,32 +362,32 @@ static    void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
     }
     end = wcscpy(buffer, wszCmd);
     for (;;) {
-       ch = *end;
+    ch = *end;
         if (ch == '"') quoted = !quoted;
-       if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
-           *end = '\0';
-           if (beg) {
-               if (*beg == '@') {
-                   sp = atoiW(beg + 1);
-                   spSet = TRUE;
-               } else if (*beg == '\0') {
-                   sp = 0;
-                   spSet = TRUE;
-               } else {
-                   extraPmts = beg;
-               }
-           }
-           if (ch == '\0') break;
-           beg = end + 1;
-           if (ch == ' ') while (end[1] == ' ') end++;
-       }
-       end++;
+    if (!quoted && (ch == ' ' || ch == ',' || ch == '\0')) {
+        *end = '\0';
+        if (beg) {
+            if (*beg == '@') {
+            sp = atoiW(beg + 1);
+            spSet = TRUE;
+        } else if (*beg == '\0') {
+            sp = 0;
+            spSet = TRUE;
+        } else {
+            extraPmts = beg;
+        }
+        }
+        if (ch == '\0') break;
+        beg = end + 1;
+        if (ch == ' ') while (end[1] == ' ') end++;
+    }
+    end++;
     }
     while ((ptr = StrChrW(buffer, '"')))
-       memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
+    memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
 
     while ((ptr = StrChrW(extraPmts, '"')))
-       memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
+    memmove((LPVOID)ptr, ptr+1, wcslen(ptr)*sizeof(WCHAR));
 
     TRACE("cmd %s, extra %s, sp %d\n", debugstr_w(buffer), debugstr_w(extraPmts), sp);
 
@@ -398,8 +398,8 @@ static      void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
 
        assert(applet && applet->next == NULL);
        if (sp >= applet->count) {
-         WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
-         sp = 0;
+      WARN("Out of bounds (%u >= %u), setting to 0\n", sp, applet->count);
+      sp = 0;
        }
 
        if ((extraPmts) && extraPmts[0] &&(!spSet))
@@ -422,21 +422,21 @@ static    void    Control_DoLaunch(CPanel* panel, HWND hWnd, LPCWSTR wszCmd)
        }
        Control_UnloadApplet(applet);
     }
-       ReleaseMutex(hMutex);
-       CloseHandle(hMutex);
+    ReleaseMutex(hMutex);
+    CloseHandle(hMutex);
     HeapFree(GetProcessHeap(), 0, buffer);
 }
 
 /*************************************************************************
- * Control_RunDLLW                     [SHELL32.@]
+ * Control_RunDLLW            [SHELL32.@]
  *
  */
 EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow)
 {
-    CPanel     panel;
+    CPanel    panel;
 
     TRACE("(%p, %p, %s, 0x%08x)\n",
-         hWnd, hInst, debugstr_w(cmd), nCmdShow);
+      hWnd, hInst, debugstr_w(cmd), nCmdShow);
 
     memset(&panel, 0, sizeof(panel));
 
@@ -448,7 +448,7 @@ EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DW
 }
 
 /*************************************************************************
- * Control_RunDLLA                     [SHELL32.@]
+ * Control_RunDLLA            [SHELL32.@]
  *
  */
 EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow)
@@ -463,7 +463,7 @@ EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWO
 }
 
 /*************************************************************************
- * Control_FillCache_RunDLLW                   [SHELL32.@]
+ * Control_FillCache_RunDLLW            [SHELL32.@]
  *
  */
 EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
@@ -473,7 +473,7 @@ EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWO
 }
 
 /*************************************************************************
- * Control_FillCache_RunDLLA                   [SHELL32.@]
+ * Control_FillCache_RunDLLA            [SHELL32.@]
  *
  */
 EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x)
@@ -483,7 +483,7 @@ EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWO
 
 
 /*************************************************************************
- * RunDLL_CallEntry16                          [SHELL32.122]
+ * RunDLL_CallEntry16                [SHELL32.122]
  * the name is probably wrong
  */
 EXTERN_C void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
@@ -511,7 +511,7 @@ EXTERN_C void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
 }
 
 /*************************************************************************
- * CallCPLEntry16                              [SHELL32.166]
+ * CallCPLEntry16                [SHELL32.166]
  *
  * called by desk.cpl on "Advanced" with:
  * hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0
index ec48398..1936870 100644 (file)
@@ -1,9 +1,9 @@
 /*
- *     IEnumFORMATETC, IDataObject
+ *    IEnumFORMATETC, IDataObject
  *
  * selecting and droping objects within the shell and/or common dialogs
  *
- *     Copyright 1998, 1999    <juergen.schmied@metronet.de>
+ *    Copyright 1998, 1999    <juergen.schmied@metronet.de>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -29,34 +29,34 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
 */
 
 class IEnumFORMATETCImpl :
-       public CComObjectRootEx<CComMultiThreadModelNoCS>,
-       public IEnumFORMATETC
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IEnumFORMATETC
 {
 private:
-    UINT                                               posFmt;
-    UINT                                               countFmt;
-    LPFORMATETC                                        pFmt;
+    UINT                        posFmt;
+    UINT                        countFmt;
+    LPFORMATETC                    pFmt;
 public:
-       IEnumFORMATETCImpl();
-       ~IEnumFORMATETCImpl();
-       HRESULT WINAPI Initialize(UINT cfmt, const FORMATETC afmt[]);
+    IEnumFORMATETCImpl();
+    ~IEnumFORMATETCImpl();
+    HRESULT WINAPI Initialize(UINT cfmt, const FORMATETC afmt[]);
 
-       // *****************
-       virtual HRESULT WINAPI Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed);
-       virtual HRESULT WINAPI Skip(ULONG celt);
-       virtual HRESULT WINAPI Reset();
-       virtual HRESULT WINAPI Clone(LPENUMFORMATETC* ppenum);
+    // *****************
+    virtual HRESULT WINAPI Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed);
+    virtual HRESULT WINAPI Skip(ULONG celt);
+    virtual HRESULT WINAPI Reset();
+    virtual HRESULT WINAPI Clone(LPENUMFORMATETC* ppenum);
 
 BEGIN_COM_MAP(IEnumFORMATETCImpl)
-       COM_INTERFACE_ENTRY_IID(IID_IEnumFORMATETC, IEnumFORMATETC)
+    COM_INTERFACE_ENTRY_IID(IID_IEnumFORMATETC, IEnumFORMATETC)
 END_COM_MAP()
 };
 
 IEnumFORMATETCImpl::IEnumFORMATETCImpl()
 {
-       posFmt = 0;
-       countFmt = 0;
-       pFmt = NULL;
+    posFmt = 0;
+    countFmt = 0;
+    pFmt = NULL;
 }
 
 IEnumFORMATETCImpl::~IEnumFORMATETCImpl()
@@ -65,50 +65,50 @@ IEnumFORMATETCImpl::~IEnumFORMATETCImpl()
 
 HRESULT WINAPI IEnumFORMATETCImpl::Initialize(UINT cfmt, const FORMATETC afmt[])
 {
-    DWORD                                              size;
+    DWORD                        size;
 
-       size = cfmt * sizeof(FORMATETC);
-       countFmt = cfmt;
-       pFmt = (LPFORMATETC)SHAlloc(size);
-       if (pFmt == NULL)
-               return E_OUTOFMEMORY;
+    size = cfmt * sizeof(FORMATETC);
+    countFmt = cfmt;
+    pFmt = (LPFORMATETC)SHAlloc(size);
+    if (pFmt == NULL)
+        return E_OUTOFMEMORY;
 
-       memcpy(pFmt, afmt, size);
-       return S_OK;
+    memcpy(pFmt, afmt, size);
+    return S_OK;
 }
 
 HRESULT WINAPI IEnumFORMATETCImpl::Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFethed)
 {
-       UINT i;
+    UINT i;
 
-       TRACE("(%p)->(%u,%p)\n", this, celt, rgelt);
+    TRACE("(%p)->(%u,%p)\n", this, celt, rgelt);
 
-       if(!pFmt)return S_FALSE;
-       if(!rgelt) return E_INVALIDARG;
-       if (pceltFethed)  *pceltFethed = 0;
+    if(!pFmt)return S_FALSE;
+    if(!rgelt) return E_INVALIDARG;
+    if (pceltFethed)  *pceltFethed = 0;
 
-       for(i = 0; posFmt < countFmt && celt > i; i++)
+    for(i = 0; posFmt < countFmt && celt > i; i++)
     {
-         *rgelt++ = pFmt[posFmt++];
-       }
+      *rgelt++ = pFmt[posFmt++];
+    }
 
-       if (pceltFethed) *pceltFethed = i;
+    if (pceltFethed) *pceltFethed = i;
 
-       return ((i == celt) ? S_OK : S_FALSE);
+    return ((i == celt) ? S_OK : S_FALSE);
 }
 
 HRESULT WINAPI IEnumFORMATETCImpl::Skip(ULONG celt)
 {
-       TRACE("(%p)->(num=%u)\n", this, celt);
+    TRACE("(%p)->(num=%u)\n", this, celt);
 
-       if (posFmt + celt >= countFmt) return S_FALSE;
-       posFmt += celt;
-       return S_OK;
+    if (posFmt + celt >= countFmt) return S_FALSE;
+    posFmt += celt;
+    return S_OK;
 }
 
 HRESULT WINAPI IEnumFORMATETCImpl::Reset()
 {
-       TRACE("(%p)->()\n", this);
+    TRACE("(%p)->()\n", this);
 
         posFmt = 0;
         return S_OK;
@@ -116,41 +116,41 @@ HRESULT WINAPI IEnumFORMATETCImpl::Reset()
 
 HRESULT WINAPI IEnumFORMATETCImpl::Clone(LPENUMFORMATETC* ppenum)
 {
-       HRESULT                                                                 hResult;
+    HRESULT                                    hResult;
 
-       TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
+    TRACE("(%p)->(ppenum=%p)\n", this, ppenum);
 
-       if (!ppenum) return E_INVALIDARG;
-       hResult = IEnumFORMATETC_Constructor(countFmt, pFmt, ppenum);
-       if (FAILED (hResult))
-               return hResult;
-       return (*ppenum)->Skip(posFmt);
+    if (!ppenum) return E_INVALIDARG;
+    hResult = IEnumFORMATETC_Constructor(countFmt, pFmt, ppenum);
+    if (FAILED (hResult))
+        return hResult;
+    return (*ppenum)->Skip(posFmt);
 }
 
 HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator)
 {
-       CComObject<IEnumFORMATETCImpl>                  *theEnumerator;
-       CComPtr<IEnumFORMATETC>                                 result;
-       HRESULT                                                                 hResult;
-
-       if (enumerator == NULL)
-               return E_POINTER;
-       *enumerator = NULL;
-       ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>);
-       if (theEnumerator == NULL)
-               return E_OUTOFMEMORY;
-       hResult = theEnumerator->QueryInterface (IID_IEnumFORMATETC, (void **)&result);
-       if (FAILED (hResult))
-       {
-               delete theEnumerator;
-               return hResult;
-       }
-       hResult = theEnumerator->Initialize (cfmt, afmt);
-       if (FAILED (hResult))
-               return hResult;
-       *enumerator = result.Detach ();
+    CComObject<IEnumFORMATETCImpl>            *theEnumerator;
+    CComPtr<IEnumFORMATETC>                    result;
+    HRESULT                                    hResult;
+
+    if (enumerator == NULL)
+        return E_POINTER;
+    *enumerator = NULL;
+    ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>);
+    if (theEnumerator == NULL)
+        return E_OUTOFMEMORY;
+    hResult = theEnumerator->QueryInterface (IID_IEnumFORMATETC, (void **)&result);
+    if (FAILED (hResult))
+    {
+        delete theEnumerator;
+        return hResult;
+    }
+    hResult = theEnumerator->Initialize (cfmt, afmt);
+    if (FAILED (hResult))
+        return hResult;
+    *enumerator = result.Detach ();
     TRACE("(%p)->(%u,%p)\n", *enumerator, cfmt, afmt);
-       return S_OK;
+    return S_OK;
 }
 
 
@@ -162,72 +162,72 @@ HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMA
 #define MAX_FORMATS 4
 
 class IDataObjectImpl :
-       public CComObjectRootEx<CComMultiThreadModelNoCS>,
-       public IDataObject
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IDataObject
 {
 private:
-       LPITEMIDLIST    pidl;
-       LPITEMIDLIST *  apidl;
-       UINT            cidl;
-
-       FORMATETC       pFormatEtc[MAX_FORMATS];
-       UINT            cfShellIDList;
-       UINT            cfFileNameA;
-       UINT            cfFileNameW;
+    LPITEMIDLIST    pidl;
+    LPITEMIDLIST *    apidl;
+    UINT        cidl;
+
+    FORMATETC    pFormatEtc[MAX_FORMATS];
+    UINT        cfShellIDList;
+    UINT        cfFileNameA;
+    UINT        cfFileNameW;
 public:
-       IDataObjectImpl();
-       ~IDataObjectImpl();
-       HRESULT WINAPI Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx);
-
-       ///////////
-       virtual HRESULT WINAPI GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium);
-       virtual HRESULT WINAPI GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium);
-       virtual HRESULT WINAPI QueryGetData(LPFORMATETC pformatetc);
-       virtual HRESULT WINAPI GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut);
-       virtual HRESULT WINAPI SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease);
-       virtual HRESULT WINAPI EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc);
-       virtual HRESULT WINAPI DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
-       virtual HRESULT WINAPI DUnadvise(DWORD dwConnection);
-       virtual HRESULT WINAPI EnumDAdvise(IEnumSTATDATA **ppenumAdvise);
+    IDataObjectImpl();
+    ~IDataObjectImpl();
+    HRESULT WINAPI Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx);
+
+    ///////////
+    virtual HRESULT WINAPI GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium);
+    virtual HRESULT WINAPI GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium);
+    virtual HRESULT WINAPI QueryGetData(LPFORMATETC pformatetc);
+    virtual HRESULT WINAPI GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut);
+    virtual HRESULT WINAPI SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease);
+    virtual HRESULT WINAPI EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc);
+    virtual HRESULT WINAPI DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection);
+    virtual HRESULT WINAPI DUnadvise(DWORD dwConnection);
+    virtual HRESULT WINAPI EnumDAdvise(IEnumSTATDATA **ppenumAdvise);
 
 BEGIN_COM_MAP(IDataObjectImpl)
-       COM_INTERFACE_ENTRY_IID(IID_IDataObject, IDataObject)
+    COM_INTERFACE_ENTRY_IID(IID_IDataObject, IDataObject)
 END_COM_MAP()
 };
 
 IDataObjectImpl::IDataObjectImpl()
 {
-       pidl = NULL;
-       apidl = NULL;
-       cidl = 0;
-       cfShellIDList = 0;
-       cfFileNameA = 0;
-       cfFileNameW = 0;
+    pidl = NULL;
+    apidl = NULL;
+    cidl = 0;
+    cfShellIDList = 0;
+    cfFileNameA = 0;
+    cfFileNameW = 0;
 }
 
 IDataObjectImpl::~IDataObjectImpl()
 {
-       TRACE(" destroying IDataObject(%p)\n",this);
-       _ILFreeaPidl(apidl, cidl);
-       ILFree(pidl);
+    TRACE(" destroying IDataObject(%p)\n",this);
+    _ILFreeaPidl(apidl, cidl);
+    ILFree(pidl);
 }
 
 HRESULT WINAPI IDataObjectImpl::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidlx, UINT cidlx)
 {
-       pidl = ILClone(pMyPidl);
-       apidl = _ILCopyaPidl(apidlx, cidlx);
-       if (pidl == NULL || apidl == NULL)
-               return E_OUTOFMEMORY;
-       cidl = cidlx;
-
-       cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
-       cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
-       cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW);
-       InitFormatEtc(pFormatEtc[0], cfShellIDList, TYMED_HGLOBAL);
-       InitFormatEtc(pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
-       InitFormatEtc(pFormatEtc[2], cfFileNameA, TYMED_HGLOBAL);
-       InitFormatEtc(pFormatEtc[3], cfFileNameW, TYMED_HGLOBAL);
-       return S_OK;
+    pidl = ILClone(pMyPidl);
+    apidl = _ILCopyaPidl(apidlx, cidlx);
+    if (pidl == NULL || apidl == NULL)
+        return E_OUTOFMEMORY;
+    cidl = cidlx;
+
+    cfShellIDList = RegisterClipboardFormatW(CFSTR_SHELLIDLIST);
+    cfFileNameA = RegisterClipboardFormatA(CFSTR_FILENAMEA);
+    cfFileNameW = RegisterClipboardFormatW(CFSTR_FILENAMEW);
+    InitFormatEtc(pFormatEtc[0], cfShellIDList, TYMED_HGLOBAL);
+    InitFormatEtc(pFormatEtc[1], CF_HDROP, TYMED_HGLOBAL);
+    InitFormatEtc(pFormatEtc[2], cfFileNameA, TYMED_HGLOBAL);
+    InitFormatEtc(pFormatEtc[3], cfFileNameW, TYMED_HGLOBAL);
+    return S_OK;
 }
 
 /**************************************************************************
@@ -235,116 +235,116 @@ HRESULT WINAPI IDataObjectImpl::Initialize(HWND hwndOwner, LPCITEMIDLIST pMyPidl
 */
 HRESULT WINAPI IDataObjectImpl::GetData(LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
 {
-       char    szTemp[256];
-
-       szTemp[0] = 0;
-       GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
-       TRACE("(%p)->(%p %p format=%s)\n", this, pformatetcIn, pmedium, szTemp);
-
-       if (pformatetcIn->cfFormat == cfShellIDList)
-       {
-         if (cidl < 1) return(E_UNEXPECTED);
-         pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
-       }
-       else if (pformatetcIn->cfFormat == CF_HDROP)
-       {
-         if (cidl < 1) return(E_UNEXPECTED);
-         pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
-       }
-       else if (pformatetcIn->cfFormat == cfFileNameA)
-       {
-         if (cidl < 1) return(E_UNEXPECTED);
-         pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
-       }
-       else if (pformatetcIn->cfFormat == cfFileNameW)
-       {
-         if (cidl < 1) return(E_UNEXPECTED);
-         pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
-       }
-       else
-       {
-         FIXME("-- expected clipformat not implemented\n");
-         return (E_INVALIDARG);
-       }
-       if (pmedium->hGlobal)
-       {
-         pmedium->tymed = TYMED_HGLOBAL;
-         pmedium->pUnkForRelease = NULL;
-         return S_OK;
-       }
-       return E_OUTOFMEMORY;
+    char    szTemp[256];
+
+    szTemp[0] = 0;
+    GetClipboardFormatNameA (pformatetcIn->cfFormat, szTemp, 256);
+    TRACE("(%p)->(%p %p format=%s)\n", this, pformatetcIn, pmedium, szTemp);
+
+    if (pformatetcIn->cfFormat == cfShellIDList)
+    {
+      if (cidl < 1) return(E_UNEXPECTED);
+      pmedium->hGlobal = RenderSHELLIDLIST(pidl, apidl, cidl);
+    }
+    else if    (pformatetcIn->cfFormat == CF_HDROP)
+    {
+      if (cidl < 1) return(E_UNEXPECTED);
+      pmedium->hGlobal = RenderHDROP(pidl, apidl, cidl);
+    }
+    else if    (pformatetcIn->cfFormat == cfFileNameA)
+    {
+      if (cidl < 1) return(E_UNEXPECTED);
+      pmedium->hGlobal = RenderFILENAMEA(pidl, apidl, cidl);
+    }
+    else if    (pformatetcIn->cfFormat == cfFileNameW)
+    {
+      if (cidl < 1) return(E_UNEXPECTED);
+      pmedium->hGlobal = RenderFILENAMEW(pidl, apidl, cidl);
+    }
+    else
+    {
+      FIXME("-- expected clipformat not implemented\n");
+      return (E_INVALIDARG);
+    }
+    if (pmedium->hGlobal)
+    {
+      pmedium->tymed = TYMED_HGLOBAL;
+      pmedium->pUnkForRelease = NULL;
+      return S_OK;
+    }
+    return E_OUTOFMEMORY;
 }
 
 HRESULT WINAPI IDataObjectImpl::GetDataHere(LPFORMATETC pformatetc, STGMEDIUM *pmedium)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::QueryGetData(LPFORMATETC pformatetc)
 {
-       UINT i;
+    UINT i;
 
-       TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", this, pformatetc->cfFormat, pformatetc->tymed);
+    TRACE("(%p)->(fmt=0x%08x tym=0x%08x)\n", this, pformatetc->cfFormat, pformatetc->tymed);
 
-       if(!(DVASPECT_CONTENT & pformatetc->dwAspect))
-         return DV_E_DVASPECT;
+    if(!(DVASPECT_CONTENT & pformatetc->dwAspect))
+      return DV_E_DVASPECT;
 
-       /* check our formats table what we have */
-       for (i=0; i<MAX_FORMATS; i++)
-       {
-         if ((pFormatEtc[i].cfFormat == pformatetc->cfFormat)
-          && (pFormatEtc[i].tymed == pformatetc->tymed))
-         {
-           return S_OK;
-         }
-       }
+    /* check our formats table what we have */
+    for (i=0; i<MAX_FORMATS; i++)
+    {
+      if ((pFormatEtc[i].cfFormat == pformatetc->cfFormat)
+       && (pFormatEtc[i].tymed == pformatetc->tymed))
+      {
+        return S_OK;
+      }
+    }
 
-       return DV_E_TYMED;
+    return DV_E_TYMED;
 }
 
 HRESULT WINAPI IDataObjectImpl::GetCanonicalFormatEtc(LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::SetData(LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
 {
-       TRACE("(%p)->()\n", this);
-       *ppenumFormatEtc = NULL;
+    TRACE("(%p)->()\n", this);
+    *ppenumFormatEtc = NULL;
 
-       /* only get data */
-       if (DATADIR_GET == dwDirection)
-       {
-               return IEnumFORMATETC_Constructor(MAX_FORMATS, pFormatEtc, ppenumFormatEtc);
-       }
+    /* only get data */
+    if (DATADIR_GET == dwDirection)
+    {
+        return IEnumFORMATETC_Constructor(MAX_FORMATS, pFormatEtc, ppenumFormatEtc);
+    }
 
-       return E_NOTIMPL;
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::DAdvise(FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::DUnadvise(DWORD dwConnection)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 HRESULT WINAPI IDataObjectImpl::EnumDAdvise(IEnumSTATDATA **ppenumAdvise)
 {
-       FIXME("(%p)->()\n", this);
-       return E_NOTIMPL;
+    FIXME("(%p)->()\n", this);
+    return E_NOTIMPL;
 }
 
 /**************************************************************************
@@ -352,32 +352,32 @@ HRESULT WINAPI IDataObjectImpl::EnumDAdvise(IEnumSTATDATA **ppenumAdvise)
 */
 HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl, IDataObject **dataObject)
 {
-       CComObject<IDataObjectImpl>                             *theDataObject;
-       CComPtr<IDataObject>                                    result;
-       HRESULT                                                                 hResult;
-
-       if (dataObject == NULL)
-               return E_POINTER;
-       *dataObject = NULL;
-       ATLTRY (theDataObject = new CComObject<IDataObjectImpl>);
-       if (theDataObject == NULL)
-               return E_OUTOFMEMORY;
-       hResult = theDataObject->QueryInterface (IID_IDataObject, (void **)&result);
-       if (FAILED (hResult))
-       {
-               delete theDataObject;
-               return hResult;
-       }
-       hResult = theDataObject->Initialize (hwndOwner, pMyPidl, apidl, cidl);
-       if (FAILED (hResult))
-               return hResult;
-       *dataObject = result.Detach ();
-       TRACE("(%p)->(apidl=%p cidl=%u)\n", *dataObject,  apidl, cidl);
-       return S_OK;
+    CComObject<IDataObjectImpl>                *theDataObject;
+    CComPtr<IDataObject>                    result;
+    HRESULT                                    hResult;
+
+    if (dataObject == NULL)
+        return E_POINTER;
+    *dataObject = NULL;
+    ATLTRY (theDataObject = new CComObject<IDataObjectImpl>);
+    if (theDataObject == NULL)
+        return E_OUTOFMEMORY;
+    hResult = theDataObject->QueryInterface (IID_IDataObject, (void **)&result);
+    if (FAILED (hResult))
+    {
+        delete theDataObject;
+        return hResult;
+    }
+    hResult = theDataObject->Initialize (hwndOwner, pMyPidl, apidl, cidl);
+    if (FAILED (hResult))
+        return hResult;
+    *dataObject = result.Detach ();
+    TRACE("(%p)->(apidl=%p cidl=%u)\n", *dataObject,  apidl, cidl);
+    return S_OK;
 }
 
 /*************************************************************************
- * SHCreateDataObject                  [SHELL32.@]
+ * SHCreateDataObject            [SHELL32.@]
  *
  */
 
index 9bdfcea..c5a6ec6 100644 (file)
@@ -32,10 +32,10 @@ static const WCHAR szProgmanWindowName[] = {
 };
 
 class CDesktopBrowser :
-       public CComObjectRootEx<CComMultiThreadModelNoCS>,
-       public IShellBrowser,
-       public ICommDlgBrowser,
-       public IServiceProvider
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IShellBrowser,
+    public ICommDlgBrowser,
+    public IServiceProvider
 {
 public:
     DWORD Tag;
@@ -43,26 +43,26 @@ private:
     HWND hWnd;
     HWND hWndShellView;
     HWND hWndDesktopListView;
-    CComPtr<IShellDesktopTray>         ShellDesk;
-    CComPtr<IShellView>                                DesktopView;
+    CComPtr<IShellDesktopTray>        ShellDesk;
+    CComPtr<IShellView>                DesktopView;
     IShellBrowser *DefaultShellBrowser;
     LPITEMIDLIST pidlDesktopDirectory;
     LPITEMIDLIST pidlDesktop;
 public:
-       CDesktopBrowser();
-       ~CDesktopBrowser();
-       HRESULT Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx);
-       HWND FindDesktopListView ();
-       BOOL CreateDeskWnd();
-       HWND DesktopGetWindowControl(IN UINT id);
-       static LRESULT CALLBACK ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam);
-       static BOOL MessageLoop();
-
-       // *** IOleWindow methods ***
-       virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
-       virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
-
-       // *** IShellBrowser methods ***
+    CDesktopBrowser();
+    ~CDesktopBrowser();
+    HRESULT Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx);
+    HWND FindDesktopListView ();
+    BOOL CreateDeskWnd();
+    HWND DesktopGetWindowControl(IN UINT id);
+    static LRESULT CALLBACK ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam);
+    static BOOL MessageLoop();
+
+    // *** IOleWindow methods ***
+    virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *lphwnd);
+    virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
+
+    // *** IShellBrowser methods ***
     virtual HRESULT STDMETHODCALLTYPE InsertMenusSB(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
     virtual HRESULT STDMETHODCALLTYPE SetMenuSB(HMENU hmenuShared, HOLEMENU holemenuRes, HWND hwndActiveObject);
     virtual HRESULT STDMETHODCALLTYPE RemoveMenusSB(HMENU hmenuShared);
@@ -77,31 +77,31 @@ public:
     virtual HRESULT STDMETHODCALLTYPE OnViewWindowActive(struct IShellView *ppshv);
     virtual HRESULT STDMETHODCALLTYPE SetToolbarItems(LPTBBUTTON lpButtons, UINT nButtons, UINT uFlags);
 
-       // *** ICommDlgBrowser methods ***
-       virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand (struct IShellView *ppshv);
-       virtual HRESULT STDMETHODCALLTYPE OnStateChange (struct IShellView *ppshv, ULONG uChange);
-       virtual HRESULT STDMETHODCALLTYPE IncludeObject (struct IShellView *ppshv, LPCITEMIDLIST pidl);
+    // *** ICommDlgBrowser methods ***
+    virtual HRESULT STDMETHODCALLTYPE OnDefaultCommand (struct IShellView *ppshv);
+    virtual HRESULT STDMETHODCALLTYPE OnStateChange (struct IShellView *ppshv, ULONG uChange);
+    virtual HRESULT STDMETHODCALLTYPE IncludeObject (struct IShellView *ppshv, LPCITEMIDLIST pidl);
 
-       // *** IServiceProvider methods ***
-       virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
+    // *** IServiceProvider methods ***
+    virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void **ppvObject);
 
 BEGIN_COM_MAP(CDesktopBrowser)
-       COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
-       COM_INTERFACE_ENTRY_IID(IID_IShellBrowser, IShellBrowser)
-       COM_INTERFACE_ENTRY_IID(IID_ICommDlgBrowser, ICommDlgBrowser)
-       COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
+    COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow)
+    COM_INTERFACE_ENTRY_IID(IID_IShellBrowser, IShellBrowser)
+    COM_INTERFACE_ENTRY_IID(IID_ICommDlgBrowser, ICommDlgBrowser)
+    COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
 END_COM_MAP()
 };
 
 CDesktopBrowser::CDesktopBrowser()
 {
-       Tag = SHDESK_TAG;
-       hWnd = NULL;
-       hWndShellView = NULL;
-       hWndDesktopListView = NULL;
-       DefaultShellBrowser = NULL;
-       pidlDesktopDirectory = NULL;
-       pidlDesktop = NULL;
+    Tag = SHDESK_TAG;
+    hWnd = NULL;
+    hWndShellView = NULL;
+    hWndDesktopListView = NULL;
+    DefaultShellBrowser = NULL;
+    pidlDesktopDirectory = NULL;
+    pidlDesktop = NULL;
 }
 
 CDesktopBrowser::~CDesktopBrowser()
@@ -130,9 +130,9 @@ CDesktopBrowser::~CDesktopBrowser()
 
 HRESULT CDesktopBrowser::Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx)
 {
-    CComPtr<IShellFolder>      psfDesktopFolder;
-    CSFV                                       csfv;
-    HRESULT                                    hRet;
+    CComPtr<IShellFolder>    psfDesktopFolder;
+    CSFV                    csfv;
+    HRESULT                    hRet;
 
     hWnd = hWndx;
     ShellDesk = ShellDeskx;
@@ -154,14 +154,14 @@ HRESULT CDesktopBrowser::Initialize(HWND hWndx, IShellDesktopTray *ShellDeskx)
 
     hRet = SHCreateShellFolderViewEx(&csfv, &DesktopView);
 
-       return hRet;
+    return hRet;
 }
 
 static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
 {
-       IShellDesktopTray               *ShellDesk;
-       CComObject<CDesktopBrowser>             *pThis;
-       HRESULT                                 hRet;
+    IShellDesktopTray        *ShellDesk;
+    CComObject<CDesktopBrowser>        *pThis;
+    HRESULT                    hRet;
 
     ShellDesk = (IShellDesktopTray *)lpCreateStruct->lpCreateParams;
     if (ShellDesk == NULL)
@@ -170,19 +170,19 @@ static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
         return NULL;
     }
 
-       pThis = new CComObject<CDesktopBrowser>;
-       if (pThis == NULL)
-               return NULL;
-       pThis->AddRef();
+    pThis = new CComObject<CDesktopBrowser>;
+    if (pThis == NULL)
+        return NULL;
+    pThis->AddRef();
 
-       hRet = pThis->Initialize(hWnd, ShellDesk);
-       if (FAILED(hRet))
-       {
-               pThis->Release();
-               return NULL;
-       }
+    hRet = pThis->Initialize(hWnd, ShellDesk);
+    if (FAILED(hRet))
+    {
+        pThis->Release();
+        return NULL;
+    }
 
-       return pThis;
+    return pThis;
 }
 
 HWND CDesktopBrowser::FindDesktopListView ()
@@ -302,7 +302,7 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetControlWindow(UINT id, HWND *lphwn
 
 HRESULT STDMETHODCALLTYPE CDesktopBrowser::SendControlMsg(UINT id, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pret)
 {
-    HWND                                               hWnd;
+    HWND                        hWnd;
 
     if (pret == NULL)
         return E_POINTER;
@@ -323,8 +323,8 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::SendControlMsg(UINT id, UINT uMsg, WP
 HRESULT STDMETHODCALLTYPE CDesktopBrowser::QueryActiveShellView(IShellView **ppshv)
 {
     *ppshv = DesktopView;
-       if (DesktopView != NULL)
-               DesktopView->AddRef();
+    if (DesktopView != NULL)
+        DesktopView->AddRef();
 
     return S_OK;
 }
@@ -486,7 +486,7 @@ RegisterProgmanWindowClass(VOID)
     WNDCLASSW wcProgman;
 
     wcProgman.style = CS_DBLCLKS;
-       wcProgman.lpfnWndProc = CDesktopBrowser::ProgmanWindowProc;
+    wcProgman.lpfnWndProc = CDesktopBrowser::ProgmanWindowProc;
     wcProgman.cbClsExtra = 0;
     wcProgman.cbWndExtra = sizeof(CDesktopBrowser *);
     wcProgman.hInstance = shell32_hInstance;
@@ -501,7 +501,7 @@ RegisterProgmanWindowClass(VOID)
 
 
 /*************************************************************************
- * SHCreateDesktop                     [SHELL32.200]
+ * SHCreateDesktop            [SHELL32.200]
  *
  */
 HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
@@ -544,7 +544,7 @@ HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
 }
 
 /*************************************************************************
- * SHCreateDesktop                     [SHELL32.201]
+ * SHCreateDesktop            [SHELL32.201]
  *
  */
 BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop)
index faf307d..bb55441 100644 (file)
@@ -1,9 +1,9 @@
 /*
- *     file system folder
+ *    file system folder
  *
- *     Copyright 1997                      Marcus Meissner
- *     Copyright 1998, 1999, 2002      Juergen Schmied
- *     Copyright 2009              Andrew Hill
+ *    Copyright 1997                Marcus Meissner
+ *    Copyright 1998, 1999, 2002    Juergen Schmied
+ *    Copyright 2009              Andrew Hill
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
index 7c82a90..3863c4b 100644 (file)
@@ -34,50 +34,50 @@ typedef enum
 typedef
 BOOLEAN 
 (NTAPI *INITIALIZE_FMIFS)(
-       IN PVOID hinstDll,
-       IN DWORD dwReason,
-       IN PVOID reserved
+    IN PVOID hinstDll,
+    IN DWORD dwReason,
+    IN PVOID reserved
 );
 typedef
 BOOLEAN
 (NTAPI *QUERY_AVAILABLEFSFORMAT)(
-       IN DWORD Index,
-       IN OUT PWCHAR FileSystem,
-       OUT UCHAR* Major,
-       OUT UCHAR* Minor,
-       OUT BOOLEAN* LastestVersion
+    IN DWORD Index,
+    IN OUT PWCHAR FileSystem,
+    OUT UCHAR* Major,
+    OUT UCHAR* Minor,
+    OUT BOOLEAN* LastestVersion
 );
 typedef
 BOOLEAN
 (NTAPI *ENABLEVOLUMECOMPRESSION)(
-       IN PWCHAR DriveRoot,
-       IN USHORT Compression
+    IN PWCHAR DriveRoot,
+    IN USHORT Compression
 );
 
 typedef
 VOID 
 (NTAPI *FORMAT_EX)(
-       IN PWCHAR DriveRoot,
-       IN FMIFS_MEDIA_FLAG MediaFlag,
-       IN PWCHAR Format,
-       IN PWCHAR Label,
-       IN BOOLEAN QuickFormat,
-       IN ULONG ClusterSize,
-       IN PFMIFSCALLBACK Callback
+    IN PWCHAR DriveRoot,
+    IN FMIFS_MEDIA_FLAG MediaFlag,
+    IN PWCHAR Format,
+    IN PWCHAR Label,
+    IN BOOLEAN QuickFormat,
+    IN ULONG ClusterSize,
+    IN PFMIFSCALLBACK Callback
 );
 
 typedef
 VOID 
 (NTAPI *CHKDSK)(
-       IN PWCHAR DriveRoot,
-       IN PWCHAR Format,
-       IN BOOLEAN CorrectErrors,
-       IN BOOLEAN Verbose,
-       IN BOOLEAN CheckOnlyIfDirty,
-       IN BOOLEAN ScanDrive,
-       IN PVOID Unused2,
-       IN PVOID Unused3,
-       IN PFMIFSCALLBACK Callback
+    IN PWCHAR DriveRoot,
+    IN PWCHAR Format,
+    IN BOOLEAN CorrectErrors,
+    IN BOOLEAN Verbose,
+    IN BOOLEAN CheckOnlyIfDirty,
+    IN BOOLEAN ScanDrive,
+    IN PVOID Unused2,
+    IN PVOID Unused3,
+    IN PFMIFSCALLBACK Callback
 );
 
 
@@ -163,9 +163,9 @@ BOOLEAN bChkdskSuccess = FALSE;
 BOOLEAN
 NTAPI
 ChkdskCallback(
-       IN CALLBACKCOMMAND Command,
-       IN ULONG SubAction,
-       IN PVOID ActionInfo)
+    IN CALLBACKCOMMAND Command,
+    IN ULONG SubAction,
+    IN PVOID ActionInfo)
 {
     PDWORD Progress;
     PBOOLEAN pSuccess;
@@ -674,7 +674,7 @@ SH_ShowDriveProperties(WCHAR * drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *
    UINT i;
    WCHAR szName[MAX_PATH+6];
    DWORD dwMaxComponent, dwFileSysFlags;
-   CComPtr<IDataObject>                pDataObj;
+   CComPtr<IDataObject>        pDataObj;
    UINT DriveType;
 
    ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
@@ -1018,9 +1018,9 @@ BOOLEAN bSuccess = FALSE;
 BOOLEAN
 NTAPI
 FormatExCB(
-       IN CALLBACKCOMMAND Command,
-       IN ULONG SubAction,
-       IN PVOID ActionInfo)
+    IN CALLBACKCOMMAND Command,
+    IN ULONG SubAction,
+    IN PVOID ActionInfo)
 {
     PDWORD Progress;
     PBOOLEAN pSuccess;
@@ -1057,7 +1057,7 @@ FormatExCB(
 VOID
 FormatDrive(HWND hwndDlg, PFORMAT_DRIVE_CONTEXT pContext)
 {
-       WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
+    WCHAR szDrive[4] = { L'C', ':', '\\', 0 };
     WCHAR szFileSys[40] = {0};
     WCHAR szLabel[40] = {0};
     INT iSelIndex;
index a304487..4a4e5cc 100644 (file)
@@ -18,11 +18,11 @@ struct IconLocation
 };
 
 class IconExtraction :
-       public CComObjectRootEx<CComMultiThreadModelNoCS>,
-       public IDefaultExtractIconInit,
-       public IExtractIconW,
-       public IExtractIconA,
-       public IPersistFile
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IDefaultExtractIconInit,
+    public IExtractIconW,
+    public IExtractIconA,
+    public IPersistFile
 {
 private:
     UINT flags;
@@ -31,41 +31,41 @@ private:
     struct IconLocation openIcon;
     struct IconLocation shortcutIcon;
 public:
-       IconExtraction();
-       ~IconExtraction();
-
-       // IDefaultExtractIconInit
-       virtual HRESULT STDMETHODCALLTYPE SetDefaultIcon(LPCWSTR pszFile, int iIcon);
-       virtual HRESULT STDMETHODCALLTYPE SetFlags(UINT uFlags);
-       virtual HRESULT STDMETHODCALLTYPE SetKey(HKEY hkey);
-       virtual HRESULT STDMETHODCALLTYPE SetNormalIcon(LPCWSTR pszFile, int iIcon);
-       virtual HRESULT STDMETHODCALLTYPE SetOpenIcon(LPCWSTR pszFile, int iIcon);
-       virtual HRESULT STDMETHODCALLTYPE SetShortcutIcon(LPCWSTR pszFile, int iIcon);
-
-       // IExtractIconW
-       virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
-       virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
-
-       // IExtractIconA
-       virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
-       virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
-
-       // IPersist
-       virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
-       virtual HRESULT STDMETHODCALLTYPE IsDirty();
-
-       // IPersistFile
-       virtual HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pszFileName, DWORD dwMode);
-       virtual HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pszFileName, BOOL fRemember);
-       virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName);
-       virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName);
+    IconExtraction();
+    ~IconExtraction();
+
+    // IDefaultExtractIconInit
+    virtual HRESULT STDMETHODCALLTYPE SetDefaultIcon(LPCWSTR pszFile, int iIcon);
+    virtual HRESULT STDMETHODCALLTYPE SetFlags(UINT uFlags);
+    virtual HRESULT STDMETHODCALLTYPE SetKey(HKEY hkey);
+    virtual HRESULT STDMETHODCALLTYPE SetNormalIcon(LPCWSTR pszFile, int iIcon);
+    virtual HRESULT STDMETHODCALLTYPE SetOpenIcon(LPCWSTR pszFile, int iIcon);
+    virtual HRESULT STDMETHODCALLTYPE SetShortcutIcon(LPCWSTR pszFile, int iIcon);
+
+    // IExtractIconW
+    virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
+    virtual HRESULT STDMETHODCALLTYPE Extract(LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
+
+    // IExtractIconA
+    virtual HRESULT STDMETHODCALLTYPE GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int *piIndex, UINT *pwFlags);
+    virtual HRESULT STDMETHODCALLTYPE Extract(LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
+
+    // IPersist
+    virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
+    virtual HRESULT STDMETHODCALLTYPE IsDirty();
+
+    // IPersistFile
+    virtual HRESULT STDMETHODCALLTYPE Load(LPCOLESTR pszFileName, DWORD dwMode);
+    virtual HRESULT STDMETHODCALLTYPE Save(LPCOLESTR pszFileName, BOOL fRemember);
+    virtual HRESULT STDMETHODCALLTYPE SaveCompleted(LPCOLESTR pszFileName);
+    virtual HRESULT STDMETHODCALLTYPE GetCurFile(LPOLESTR *ppszFileName);
 
 BEGIN_COM_MAP(IconExtraction)
-       COM_INTERFACE_ENTRY_IID(IID_IDefaultExtractIconInit, IDefaultExtractIconInit)
-       COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
-       COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
-       COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
-       COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
+    COM_INTERFACE_ENTRY_IID(IID_IDefaultExtractIconInit, IDefaultExtractIconInit)
+    COM_INTERFACE_ENTRY_IID(IID_IExtractIconW, IExtractIconW)
+    COM_INTERFACE_ENTRY_IID(IID_IExtractIconA, IExtractIconA)
+    COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
+    COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile)
 END_COM_MAP()
 };
 
@@ -87,11 +87,11 @@ VOID DuplicateString(
 
 IconExtraction::IconExtraction()
 {
-       flags = 0;
-       memset(&defaultIcon, 0, sizeof(defaultIcon));
-       memset(&normalIcon, 0, sizeof(normalIcon));
-       memset(&openIcon, 0, sizeof(openIcon));
-       memset(&shortcutIcon, 0, sizeof(shortcutIcon));
+    flags = 0;
+    memset(&defaultIcon, 0, sizeof(defaultIcon));
+    memset(&normalIcon, 0, sizeof(normalIcon));
+    memset(&openIcon, 0, sizeof(openIcon));
+    memset(&shortcutIcon, 0, sizeof(shortcutIcon));
 }
 
 IconExtraction::~IconExtraction()
@@ -337,22 +337,22 @@ HRESULT STDMETHODCALLTYPE IconExtraction::GetCurFile(
 
 HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
 {
-       CComObject<IconExtraction>                              *theExtractor;
-       CComPtr<IUnknown>                                               result;
-       HRESULT                                                                 hResult;
-
-       if (ppv == NULL)
-               return E_POINTER;
-       *ppv = NULL;
-       ATLTRY (theExtractor = new CComObject<IconExtraction>);
-       if (theExtractor == NULL)
-               return E_OUTOFMEMORY;
-       hResult = theExtractor->QueryInterface (riid, (void **)&result);
-       if (FAILED (hResult))
-       {
-               delete theExtractor;
-               return hResult;
-       }
-       *ppv = result.Detach ();
-       return S_OK;
+    CComObject<IconExtraction>                *theExtractor;
+    CComPtr<IUnknown>                        result;
+    HRESULT                                    hResult;
+
+    if (ppv == NULL)
+        return E_POINTER;
+    *ppv = NULL;
+    ATLTRY (theExtractor = new CComObject<IconExtraction>);
+    if (theExtractor == NULL)
+        return E_OUTOFMEMORY;
+    hResult = theExtractor->QueryInterface (riid, (void **)&result);
+    if (FAILED (hResult))
+    {
+        delete theExtractor;
+        return hResult;
+    }
+    *ppv = result.Detach ();
+    return S_OK;
 }
index 1e91c30..f091877 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Open With  Context Menu extension
+ *    Open With  Context Menu extension
  *
  * Copyright 2007 Johannes Anderwald <janderwald@reactos.org>
  *
@@ -50,8 +50,8 @@ typedef struct
 
 typedef struct
 {
-       LPCWSTR szKeyName;
-       UINT ResourceID;
+    LPCWSTR szKeyName;
+    UINT ResourceID;
 }FOLDER_VIEW_ENTRY, PFOLDER_VIEW_ENTRY;
 /*
 static FOLDER_VIEW_ENTRY s_Options[] =
@@ -116,7 +116,7 @@ InitializeFolderOptionsListCtrl(HWND hwndDlg)
     WCHAR szName[50];
     HWND hDlgCtrl;
 
-       hDlgCtrl = GetDlgItem(hwndDlg, 14003);
+    hDlgCtrl = GetDlgItem(hwndDlg, 14003);
 
     if (!LoadStringW(shell32_hInstance, IDS_COLUMN_EXTENSION, szName, sizeof(szName) / sizeof(WCHAR)))
         szName[0] = 0;
@@ -589,7 +589,7 @@ CountFolderAndFiles(LPVOID lParam)
                 pContext->cFiles++;
                 pContext->bSize.u.LowPart += FindData.nFileSizeLow;
                 pContext->bSize.u.HighPart += FindData.nFileSizeHigh;
-            }  
+            }    
         }
         else if (GetLastError() == ERROR_NO_MORE_FILES)
         {
@@ -777,7 +777,7 @@ SH_ShowFolderProperties(LPWSTR pwszFolder,  LPCITEMIDLIST pidlFolder, LPCITEMIDL
     WCHAR szName[MAX_PATH] = {0};
     HPSXA hpsx = NULL;
     LPWSTR pFolderName;
-    CComPtr<IDataObject>               pDataObj;
+    CComPtr<IDataObject>        pDataObj;
 
     if (!PathIsDirectoryW(pwszFolder))
         return FALSE;
index 3783fe7..dc08d49 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *     Copyright 1997  Marcus Meissner
- *     Copyright 1998  Juergen Schmied
+ *    Copyright 1997    Marcus Meissner
+ *    Copyright 1998    Juergen Schmied
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -187,7 +187,7 @@ GetIconOverlay(LPCITEMIDLIST pidl, WCHAR * wTemp, int* pIndex)
 */
 IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
 {
-    CComPtr<IDefaultExtractIconInit>   initIcon;
+    CComPtr<IDefaultExtractIconInit>    initIcon;
     IExtractIconW *extractIcon;
     GUID const * riid;
     int icon_idx;
@@ -330,8 +330,8 @@ IExtractIconW* IExtractIconW_Constructor(LPCITEMIDLIST pidl)
             else if (!lstrcmpiA(sTemp, "lnkfile"))
             {
                 /* extract icon from shell shortcut */
-                CComPtr<IShellFolder>          dsf;
-                CComPtr<IShellLinkW>           psl;
+                CComPtr<IShellFolder>        dsf;
+                CComPtr<IShellLinkW>        psl;
 
                 if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
                 {
index 2bcd6f4..7eee167 100644 (file)
@@ -388,7 +388,7 @@ SH_FileGeneralSetFileSizeTime(HWND hwndDlg, WCHAR *lpfilename, PULARGE_INTEGER l
     }
 
     if (SHFileGeneralGetFileTimeString(&accessed_time, resultstr))
-       {
+    {
         hDlgCtrl = GetDlgItem(hwndDlg, 14019);
         SendMessageW(hDlgCtrl, WM_SETTEXT, (WPARAM)NULL, (LPARAM)resultstr);
     }
@@ -844,7 +844,7 @@ SH_ShowPropertiesDialog(WCHAR *lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *api
     WCHAR *pFileName;
     HPSXA hpsxa[3];
     INT_PTR res;
-    CComPtr<IDataObject>               pDataObj;
+    CComPtr<IDataObject>        pDataObj;
     HRESULT hResult;
 
     TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(lpf));
index 6f2b22f..b4f0076 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     shell icon cache (SIC)
+ *    shell icon cache (SIC)
  *
  * Copyright 1998, 1999 Juergen Schmied
  *
@@ -28,14 +28,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 typedef struct
 {
-       LPWSTR sSourceFile;     /* file (not path!) containing the icon */
-       DWORD dwSourceIndex;    /* index within the file, if it is a resoure ID it will be negated */
-       DWORD dwListIndex;      /* index within the iconlist */
-       DWORD dwFlags;          /* GIL_* flags */
-       DWORD dwAccessTime;
+    LPWSTR sSourceFile;    /* file (not path!) containing the icon */
+    DWORD dwSourceIndex;    /* index within the file, if it is a resoure ID it will be negated */
+    DWORD dwListIndex;    /* index within the iconlist */
+    DWORD dwFlags;        /* GIL_* flags */
+    DWORD dwAccessTime;
 } SIC_ENTRY, * LPSIC_ENTRY;
 
-static HDPA            sic_hdpa = 0;
+static HDPA        sic_hdpa = 0;
 
 namespace
 {
@@ -56,127 +56,127 @@ CRITICAL_SECTION SHELL32_SicCS = { &critsect_debug, -1, 0, 0, 0, 0 };
  *  Callback for DPA_Search
  */
 static INT CALLBACK SIC_CompareEntries( LPVOID p1, LPVOID p2, LPARAM lparam)
-{      LPSIC_ENTRY e1 = (LPSIC_ENTRY)p1, e2 = (LPSIC_ENTRY)p2;
+{    LPSIC_ENTRY e1 = (LPSIC_ENTRY)p1, e2 = (LPSIC_ENTRY)p2;
 
-       TRACE("%p %p %8lx\n", p1, p2, lparam);
+    TRACE("%p %p %8lx\n", p1, p2, lparam);
 
-       /* Icons in the cache are keyed by the name of the file they are
-        * loaded from, their resource index and the fact if they have a shortcut
-        * icon overlay or not.
-        */
-       if (e1->dwSourceIndex != e2->dwSourceIndex || /* first the faster one */
-           (e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
-         return 1;
+    /* Icons in the cache are keyed by the name of the file they are
+     * loaded from, their resource index and the fact if they have a shortcut
+     * icon overlay or not.
+     */
+    if (e1->dwSourceIndex != e2->dwSourceIndex || /* first the faster one */
+        (e1->dwFlags & GIL_FORSHORTCUT) != (e2->dwFlags & GIL_FORSHORTCUT))
+      return 1;
 
-       if (wcsicmp(e1->sSourceFile,e2->sSourceFile))
-         return 1;
+    if (wcsicmp(e1->sSourceFile,e2->sSourceFile))
+      return 1;
 
-       return 0;
+    return 0;
 }
 
 /* declare SIC_LoadOverlayIcon() */
 static int SIC_LoadOverlayIcon(int icon_idx);
 
 /*****************************************************************************
- * SIC_OverlayShortcutImage                    [internal]
+ * SIC_OverlayShortcutImage            [internal]
  *
  * NOTES
  *  Creates a new icon as a copy of the passed-in icon, overlayed with a
  *  shortcut image.
  */
 static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
-{      ICONINFO SourceIconInfo, ShortcutIconInfo, TargetIconInfo;
-       HICON ShortcutIcon, TargetIcon;
-       BITMAP SourceBitmapInfo, ShortcutBitmapInfo;
-       HDC SourceDC = NULL,
-         ShortcutDC = NULL,
-         TargetDC = NULL,
-         ScreenDC = NULL;
-       HBITMAP OldSourceBitmap = NULL,
-         OldShortcutBitmap = NULL,
-         OldTargetBitmap = NULL;
-
-       static int s_imgListIdx = -1;
-
-       /* Get information about the source icon and shortcut overlay */
-       if (! GetIconInfo(SourceIcon, &SourceIconInfo)
-           || 0 == GetObjectW(SourceIconInfo.hbmColor, sizeof(BITMAP), &SourceBitmapInfo))
-       {
-         return NULL;
-       }
-
-       /* search for the shortcut icon only once */
-       if (s_imgListIdx == -1)
-           s_imgListIdx = SIC_LoadOverlayIcon(- IDI_SHELL_SHORTCUT);
+{    ICONINFO SourceIconInfo, ShortcutIconInfo, TargetIconInfo;
+    HICON ShortcutIcon, TargetIcon;
+    BITMAP SourceBitmapInfo, ShortcutBitmapInfo;
+    HDC SourceDC = NULL,
+      ShortcutDC = NULL,
+      TargetDC = NULL,
+      ScreenDC = NULL;
+    HBITMAP OldSourceBitmap = NULL,
+      OldShortcutBitmap = NULL,
+      OldTargetBitmap = NULL;
+
+    static int s_imgListIdx = -1;
+
+    /* Get information about the source icon and shortcut overlay */
+    if (! GetIconInfo(SourceIcon, &SourceIconInfo)
+        || 0 == GetObjectW(SourceIconInfo.hbmColor, sizeof(BITMAP), &SourceBitmapInfo))
+    {
+      return NULL;
+    }
+
+    /* search for the shortcut icon only once */
+    if (s_imgListIdx == -1)
+        s_imgListIdx = SIC_LoadOverlayIcon(- IDI_SHELL_SHORTCUT);
                            /* FIXME should use icon index 29 instead of the
                               resource id, but not all icons are present yet
                               so we can't use icon indices */
 
-       if (s_imgListIdx != -1)
-       {
-           if (large)
-               ShortcutIcon = ImageList_GetIcon(ShellBigIconList, s_imgListIdx, ILD_TRANSPARENT);
-           else
-               ShortcutIcon = ImageList_GetIcon(ShellSmallIconList, s_imgListIdx, ILD_TRANSPARENT);
-       } else
-           ShortcutIcon = NULL;
-
-       if (NULL == ShortcutIcon
-           || ! GetIconInfo(ShortcutIcon, &ShortcutIconInfo)
-           || 0 == GetObjectW(ShortcutIconInfo.hbmColor, sizeof(BITMAP), &ShortcutBitmapInfo))
-       {
-         return NULL;
-       }
-
-       TargetIconInfo = SourceIconInfo;
-       TargetIconInfo.hbmMask = NULL;
-       TargetIconInfo.hbmColor = NULL;
-
-       /* Setup the source, shortcut and target masks */
-       SourceDC = CreateCompatibleDC(NULL);
-       if (NULL == SourceDC) goto fail;
-       OldSourceBitmap = (HBITMAP)SelectObject(SourceDC, SourceIconInfo.hbmMask);
-       if (NULL == OldSourceBitmap) goto fail;
-
-       ShortcutDC = CreateCompatibleDC(NULL);
-       if (NULL == ShortcutDC) goto fail;
-       OldShortcutBitmap = (HBITMAP)SelectObject(ShortcutDC, ShortcutIconInfo.hbmMask);
-       if (NULL == OldShortcutBitmap) goto fail;
-
-       TargetDC = CreateCompatibleDC(NULL);
-       if (NULL == TargetDC) goto fail;
-       TargetIconInfo.hbmMask = CreateCompatibleBitmap(TargetDC, SourceBitmapInfo.bmWidth,
-                                                       SourceBitmapInfo.bmHeight);
-       if (NULL == TargetIconInfo.hbmMask) goto fail;
-       ScreenDC = GetDC(NULL);
-       if (NULL == ScreenDC) goto fail;
-       TargetIconInfo.hbmColor = CreateCompatibleBitmap(ScreenDC, SourceBitmapInfo.bmWidth,
-                                                        SourceBitmapInfo.bmHeight);
-       ReleaseDC(NULL, ScreenDC);
-       if (NULL == TargetIconInfo.hbmColor) goto fail;
-       OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmMask);
-       if (NULL == OldTargetBitmap) goto fail;
-
-       /* Create the target mask by ANDing the source and shortcut masks */
-       if (! BitBlt(TargetDC, 0, 0, SourceBitmapInfo.bmWidth, SourceBitmapInfo.bmHeight,
-                    SourceDC, 0, 0, SRCCOPY) ||
-           ! BitBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight,
-                    ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
-                    ShortcutDC, 0, 0, SRCAND))
-       {
-         goto fail;
-       }
-
-       /* Setup the source and target xor bitmap */
-       if (NULL == SelectObject(SourceDC, SourceIconInfo.hbmColor) ||
-           NULL == SelectObject(TargetDC, TargetIconInfo.hbmColor))
-       {
-         goto fail;
-       }
-
-       /* Copy the source color bitmap to the target */
-       if (! BitBlt(TargetDC, 0, 0, SourceBitmapInfo.bmWidth, SourceBitmapInfo.bmHeight,
-                    SourceDC, 0, 0, SRCCOPY)) goto fail;
+    if (s_imgListIdx != -1)
+    {
+        if (large)
+            ShortcutIcon = ImageList_GetIcon(ShellBigIconList, s_imgListIdx, ILD_TRANSPARENT);
+        else
+            ShortcutIcon = ImageList_GetIcon(ShellSmallIconList, s_imgListIdx, ILD_TRANSPARENT);
+    } else
+        ShortcutIcon = NULL;
+
+    if (NULL == ShortcutIcon
+        || ! GetIconInfo(ShortcutIcon, &ShortcutIconInfo)
+        || 0 == GetObjectW(ShortcutIconInfo.hbmColor, sizeof(BITMAP), &ShortcutBitmapInfo))
+    {
+      return NULL;
+    }
+
+    TargetIconInfo = SourceIconInfo;
+    TargetIconInfo.hbmMask = NULL;
+    TargetIconInfo.hbmColor = NULL;
+
+    /* Setup the source, shortcut and target masks */
+    SourceDC = CreateCompatibleDC(NULL);
+    if (NULL == SourceDC) goto fail;
+    OldSourceBitmap = (HBITMAP)SelectObject(SourceDC, SourceIconInfo.hbmMask);
+    if (NULL == OldSourceBitmap) goto fail;
+
+    ShortcutDC = CreateCompatibleDC(NULL);
+    if (NULL == ShortcutDC) goto fail;
+    OldShortcutBitmap = (HBITMAP)SelectObject(ShortcutDC, ShortcutIconInfo.hbmMask);
+    if (NULL == OldShortcutBitmap) goto fail;
+
+    TargetDC = CreateCompatibleDC(NULL);
+    if (NULL == TargetDC) goto fail;
+    TargetIconInfo.hbmMask = CreateCompatibleBitmap(TargetDC, SourceBitmapInfo.bmWidth,
+                                                    SourceBitmapInfo.bmHeight);
+    if (NULL == TargetIconInfo.hbmMask) goto fail;
+    ScreenDC = GetDC(NULL);
+    if (NULL == ScreenDC) goto fail;
+    TargetIconInfo.hbmColor = CreateCompatibleBitmap(ScreenDC, SourceBitmapInfo.bmWidth,
+                                                     SourceBitmapInfo.bmHeight);
+    ReleaseDC(NULL, ScreenDC);
+    if (NULL == TargetIconInfo.hbmColor) goto fail;
+    OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmMask);
+    if (NULL == OldTargetBitmap) goto fail;
+
+    /* Create the target mask by ANDing the source and shortcut masks */
+    if (! BitBlt(TargetDC, 0, 0, SourceBitmapInfo.bmWidth, SourceBitmapInfo.bmHeight,
+                 SourceDC, 0, 0, SRCCOPY) ||
+        ! BitBlt(TargetDC, 0, SourceBitmapInfo.bmHeight - ShortcutBitmapInfo.bmHeight,
+                 ShortcutBitmapInfo.bmWidth, ShortcutBitmapInfo.bmHeight,
+                 ShortcutDC, 0, 0, SRCAND))
+    {
+      goto fail;
+    }
+
+    /* Setup the source and target xor bitmap */
+    if (NULL == SelectObject(SourceDC, SourceIconInfo.hbmColor) ||
+        NULL == SelectObject(TargetDC, TargetIconInfo.hbmColor))
+    {
+      goto fail;
+    }
+
+    /* Copy the source color bitmap to the target */
+    if (! BitBlt(TargetDC, 0, 0, SourceBitmapInfo.bmWidth, SourceBitmapInfo.bmHeight,
+                 SourceDC, 0, 0, SRCCOPY)) goto fail;
 
     /* Copy the source xor bitmap to the target and clear out part of it by using
        the shortcut mask */
@@ -189,145 +189,145 @@ static HICON SIC_OverlayShortcutImage(HICON SourceIcon, BOOL large)
         goto fail;
     }
 
-       /* Clean up, we're not goto'ing to 'fail' after this so we can be lazy and not set
-          handles to NULL */
-       SelectObject(TargetDC, OldTargetBitmap);
-       DeleteObject(TargetDC);
-       SelectObject(ShortcutDC, OldShortcutBitmap);
-       DeleteObject(ShortcutDC);
-       SelectObject(SourceDC, OldSourceBitmap);
-       DeleteObject(SourceDC);
+    /* Clean up, we're not goto'ing to 'fail' after this so we can be lazy and not set
+       handles to NULL */
+    SelectObject(TargetDC, OldTargetBitmap);
+    DeleteObject(TargetDC);
+    SelectObject(ShortcutDC, OldShortcutBitmap);
+    DeleteObject(ShortcutDC);
+    SelectObject(SourceDC, OldSourceBitmap);
+    DeleteObject(SourceDC);
 
-       /* Create the icon using the bitmaps prepared earlier */
-       TargetIcon = CreateIconIndirect(&TargetIconInfo);
+    /* Create the icon using the bitmaps prepared earlier */
+    TargetIcon = CreateIconIndirect(&TargetIconInfo);
 
-       /* CreateIconIndirect copies the bitmaps, so we can release our bitmaps now */
-       DeleteObject(TargetIconInfo.hbmColor);
-       DeleteObject(TargetIconInfo.hbmMask);
+    /* CreateIconIndirect copies the bitmaps, so we can release our bitmaps now */
+    DeleteObject(TargetIconInfo.hbmColor);
+    DeleteObject(TargetIconInfo.hbmMask);
 
-       return TargetIcon;
+    return TargetIcon;
 
 fail:
-       /* Clean up scratch resources we created */
-       if (NULL != OldTargetBitmap) SelectObject(TargetDC, OldTargetBitmap);
-       if (NULL != TargetIconInfo.hbmColor) DeleteObject(TargetIconInfo.hbmColor);
-       if (NULL != TargetIconInfo.hbmMask) DeleteObject(TargetIconInfo.hbmMask);
-       if (NULL != TargetDC) DeleteObject(TargetDC);
-       if (NULL != OldShortcutBitmap) SelectObject(ShortcutDC, OldShortcutBitmap);
-       if (NULL != ShortcutDC) DeleteObject(ShortcutDC);
-       if (NULL != OldSourceBitmap) SelectObject(SourceDC, OldSourceBitmap);
-       if (NULL != SourceDC) DeleteObject(SourceDC);
-
-       return NULL;
+    /* Clean up scratch resources we created */
+    if (NULL != OldTargetBitmap) SelectObject(TargetDC, OldTargetBitmap);
+    if (NULL != TargetIconInfo.hbmColor) DeleteObject(TargetIconInfo.hbmColor);
+    if (NULL != TargetIconInfo.hbmMask) DeleteObject(TargetIconInfo.hbmMask);
+    if (NULL != TargetDC) DeleteObject(TargetDC);
+    if (NULL != OldShortcutBitmap) SelectObject(ShortcutDC, OldShortcutBitmap);
+    if (NULL != ShortcutDC) DeleteObject(ShortcutDC);
+    if (NULL != OldSourceBitmap) SelectObject(SourceDC, OldSourceBitmap);
+    if (NULL != SourceDC) DeleteObject(SourceDC);
+
+    return NULL;
 }
 
 /*****************************************************************************
- * SIC_IconAppend                      [internal]
+ * SIC_IconAppend            [internal]
  *
  * NOTES
  *  appends an icon pair to the end of the cache
  */
 static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallIcon, HICON hBigIcon, DWORD dwFlags)
-{      LPSIC_ENTRY lpsice;
-       INT ret, index, index1;
-       WCHAR path[MAX_PATH];
-       TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
-
-       lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
-
-       GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
-       lpsice->sSourceFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) );
-       wcscpy( lpsice->sSourceFile, path );
-
-       lpsice->dwSourceIndex = dwSourceIndex;
-       lpsice->dwFlags = dwFlags;
-
-       EnterCriticalSection(&SHELL32_SicCS);
-
-       index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
-       if ( INVALID_INDEX == index )
-       {
-         HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
-         SHFree(lpsice);
-         ret = INVALID_INDEX;
-       }
-       else
-       {
-         index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
-         index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
-
-         if (index!=index1)
-         {
-           FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
-         }
-         lpsice->dwListIndex = index;
-         ret = lpsice->dwListIndex;
-       }
-
-       LeaveCriticalSection(&SHELL32_SicCS);
-       return ret;
+{    LPSIC_ENTRY lpsice;
+    INT ret, index, index1;
+    WCHAR path[MAX_PATH];
+    TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
+
+    lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
+
+    GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
+    lpsice->sSourceFile = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, (wcslen(path)+1)*sizeof(WCHAR) );
+    wcscpy( lpsice->sSourceFile, path );
+
+    lpsice->dwSourceIndex = dwSourceIndex;
+    lpsice->dwFlags = dwFlags;
+
+    EnterCriticalSection(&SHELL32_SicCS);
+
+    index = DPA_InsertPtr(sic_hdpa, 0x7fff, lpsice);
+    if ( INVALID_INDEX == index )
+    {
+      HeapFree(GetProcessHeap(), 0, lpsice->sSourceFile);
+      SHFree(lpsice);
+      ret = INVALID_INDEX;
+    }
+    else
+    {
+      index = ImageList_AddIcon (ShellSmallIconList, hSmallIcon);
+      index1= ImageList_AddIcon (ShellBigIconList, hBigIcon);
+
+      if (index!=index1)
+      {
+        FIXME("iconlists out of sync 0x%x 0x%x\n", index, index1);
+      }
+      lpsice->dwListIndex = index;
+      ret = lpsice->dwListIndex;
+    }
+
+    LeaveCriticalSection(&SHELL32_SicCS);
+    return ret;
 }
 /****************************************************************************
- * SIC_LoadIcon                                [internal]
+ * SIC_LoadIcon                [internal]
  *
  * NOTES
  *  gets small/big icon by number from a file
  */
 static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
-{      HICON   hiconLarge=0;
-       HICON   hiconSmall=0;
-       HICON   hiconLargeShortcut;
-       HICON   hiconSmallShortcut;
+{    HICON    hiconLarge=0;
+    HICON    hiconSmall=0;
+    HICON     hiconLargeShortcut;
+    HICON    hiconSmallShortcut;
 
 #if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
-       static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
+    static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
 
-       if (!PrivateExtractIconExW) {
-           HMODULE hUser32 = GetModuleHandleA("user32");
-           PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
-       }
+    if (!PrivateExtractIconExW) {
+        HMODULE hUser32 = GetModuleHandleA("user32");
+        PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
+    }
 
         if (PrivateExtractIconExW)
-           PrivateExtractIconExW(sSourceFile, dwSourceIndex, &hiconLarge, &hiconSmall, 1);
-       else
+        PrivateExtractIconExW(sSourceFile, dwSourceIndex, &hiconLarge, &hiconSmall, 1);
+    else
 #endif
-       {
-           PrivateExtractIconsW(sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, NULL, 1, 0);
-           PrivateExtractIconsW(sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, NULL, 1, 0);
-       }
-
-       if ( !hiconLarge ||  !hiconSmall)
-       {
-         WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall);
-         return -1;
-       }
-
-       if (0 != (dwFlags & GIL_FORSHORTCUT))
-       {
-         hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE);
-         hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE);
-         if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut)
-         {
-           hiconLarge = hiconLargeShortcut;
-           hiconSmall = hiconSmallShortcut;
-         }
-         else
-         {
-           WARN("Failed to create shortcut overlayed icons\n");
-           if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut);
-           if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut);
-           dwFlags &= ~ GIL_FORSHORTCUT;
-         }
-       }
-
-       return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags);
+    {
+        PrivateExtractIconsW(sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, NULL, 1, 0);
+        PrivateExtractIconsW(sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, NULL, 1, 0);
+    }
+
+    if ( !hiconLarge ||  !hiconSmall)
+    {
+      WARN("failure loading icon %i from %s (%p %p)\n", dwSourceIndex, debugstr_w(sSourceFile), hiconLarge, hiconSmall);
+      return -1;
+    }
+
+    if (0 != (dwFlags & GIL_FORSHORTCUT))
+    {
+      hiconLargeShortcut = SIC_OverlayShortcutImage(hiconLarge, TRUE);
+      hiconSmallShortcut = SIC_OverlayShortcutImage(hiconSmall, FALSE);
+      if (NULL != hiconLargeShortcut && NULL != hiconSmallShortcut)
+      {
+        hiconLarge = hiconLargeShortcut;
+        hiconSmall = hiconSmallShortcut;
+      }
+      else
+      {
+        WARN("Failed to create shortcut overlayed icons\n");
+        if (NULL != hiconLargeShortcut) DestroyIcon(hiconLargeShortcut);
+        if (NULL != hiconSmallShortcut) DestroyIcon(hiconSmallShortcut);
+        dwFlags &= ~ GIL_FORSHORTCUT;
+      }
+    }
+
+    return SIC_IconAppend (sSourceFile, dwSourceIndex, hiconSmall, hiconLarge, dwFlags);
 }
 /*****************************************************************************
- * SIC_GetIconIndex                    [internal]
+ * SIC_GetIconIndex            [internal]
  *
  * Parameters
- *     sSourceFile     [IN]    filename of file containing the icon
- *     index           [IN]    index/resID (negated) in this file
+ *    sSourceFile    [IN]    filename of file containing the icon
+ *    index        [IN]    index/resID (negated) in this file
  *
  * NOTES
  *  look in the cache for a proper icon. if not available the icon is taken
@@ -335,40 +335,40 @@ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
  */
 INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags )
 {
-       SIC_ENTRY sice;
-       INT ret, index = INVALID_INDEX;
-       WCHAR path[MAX_PATH];
+    SIC_ENTRY sice;
+    INT ret, index = INVALID_INDEX;
+    WCHAR path[MAX_PATH];
 
-       TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
+    TRACE("%s %i\n", debugstr_w(sSourceFile), dwSourceIndex);
 
-       GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
-       sice.sSourceFile = path;
-       sice.dwSourceIndex = dwSourceIndex;
-       sice.dwFlags = dwFlags;
+    GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
+    sice.sSourceFile = path;
+    sice.dwSourceIndex = dwSourceIndex;
+    sice.dwFlags = dwFlags;
 
-       EnterCriticalSection(&SHELL32_SicCS);
+    EnterCriticalSection(&SHELL32_SicCS);
 
-       if (NULL != DPA_GetPtr (sic_hdpa, 0))
-       {
-         /* search linear from position 0*/
-         index = DPA_Search (sic_hdpa, &sice, 0, SIC_CompareEntries, 0, 0);
-       }
+    if (NULL != DPA_GetPtr (sic_hdpa, 0))
+    {
+      /* search linear from position 0*/
+      index = DPA_Search (sic_hdpa, &sice, 0, SIC_CompareEntries, 0, 0);
+    }
 
-       if ( INVALID_INDEX == index )
-       {
+    if ( INVALID_INDEX == index )
+    {
           ret = SIC_LoadIcon (sSourceFile, dwSourceIndex, dwFlags);
-       }
-       else
-       {
-         TRACE("-- found\n");
-         ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
-       }
-
-       LeaveCriticalSection(&SHELL32_SicCS);
-       return ret;
+    }
+    else
+    {
+      TRACE("-- found\n");
+      ret = ((LPSIC_ENTRY)DPA_GetPtr(sic_hdpa, index))->dwListIndex;
+    }
+
+    LeaveCriticalSection(&SHELL32_SicCS);
+    return ret;
 }
 /*****************************************************************************
- * SIC_Initialize                      [internal]
+ * SIC_Initialize            [internal]
  */
 BOOL SIC_Initialize(void)
 {
@@ -490,180 +490,180 @@ BOOL SIC_Initialize(void)
  */
 static INT CALLBACK sic_free( LPVOID ptr, LPVOID lparam )
 {
-       HeapFree(GetProcessHeap(), 0, ((LPSIC_ENTRY)ptr)->sSourceFile);
-       SHFree(ptr);
-       return TRUE;
+    HeapFree(GetProcessHeap(), 0, ((LPSIC_ENTRY)ptr)->sSourceFile);
+    SHFree(ptr);
+    return TRUE;
 }
 
 void SIC_Destroy(void)
 {
-       TRACE("\n");
+    TRACE("\n");
 
-       EnterCriticalSection(&SHELL32_SicCS);
+    EnterCriticalSection(&SHELL32_SicCS);
 
-       if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
+    if (sic_hdpa) DPA_DestroyCallback(sic_hdpa, sic_free, NULL );
 
-       sic_hdpa = NULL;
-       ImageList_Destroy(ShellSmallIconList);
-       ShellSmallIconList = 0;
-       ImageList_Destroy(ShellBigIconList);
-       ShellBigIconList = 0;
+    sic_hdpa = NULL;
+    ImageList_Destroy(ShellSmallIconList);
+    ShellSmallIconList = 0;
+    ImageList_Destroy(ShellBigIconList);
+    ShellBigIconList = 0;
 
-       LeaveCriticalSection(&SHELL32_SicCS);
-       //DeleteCriticalSection(&SHELL32_SicCS); //static
+    LeaveCriticalSection(&SHELL32_SicCS);
+    //DeleteCriticalSection(&SHELL32_SicCS); //static
 }
 
 /*****************************************************************************
- * SIC_LoadOverlayIcon                 [internal]
+ * SIC_LoadOverlayIcon            [internal]
  *
  * Load a shell overlay icon and return its icon cache index.
  */
 static int SIC_LoadOverlayIcon(int icon_idx)
 {
-       WCHAR buffer[1024], wszIdx[8];
-       HKEY hKeyShellIcons;
-       LPCWSTR iconPath;
-       int iconIdx;
-
-       static const WCHAR wszShellIcons[] = {
-           'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
-           'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
-           'E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','I','c','o','n','s',0
-       };
-       static const WCHAR wszNumFmt[] = {'%','d',0};
-
-       iconPath = swShell32Name;       /* default: load icon from shell32.dll */
-       iconIdx = icon_idx;
-
-       if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszShellIcons, 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS)
-       {
-           DWORD count = sizeof(buffer);
+    WCHAR buffer[1024], wszIdx[8];
+    HKEY hKeyShellIcons;
+    LPCWSTR iconPath;
+    int iconIdx;
+
+    static const WCHAR wszShellIcons[] = {
+        'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
+        'W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
+        'E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','I','c','o','n','s',0
+    };
+    static const WCHAR wszNumFmt[] = {'%','d',0};
+
+    iconPath = swShell32Name;    /* default: load icon from shell32.dll */
+    iconIdx = icon_idx;
+
+    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszShellIcons, 0, KEY_READ, &hKeyShellIcons) == ERROR_SUCCESS)
+    {
+        DWORD count = sizeof(buffer);
 
-           swprintf(wszIdx, wszNumFmt, icon_idx);
+        swprintf(wszIdx, wszNumFmt, icon_idx);
 
-           /* read icon path and index */
-           if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
-           {
-               LPWSTR p = wcschr(buffer, ',');
+        /* read icon path and index */
+        if (RegQueryValueExW(hKeyShellIcons, wszIdx, NULL, NULL, (LPBYTE)buffer, &count) == ERROR_SUCCESS)
+        {
+        LPWSTR p = wcschr(buffer, ',');
 
-               if (p)
-                   *p++ = 0;
+        if (p)
+            *p++ = 0;
 
-               iconPath = buffer;
-               iconIdx = _wtoi(p);
-           }
+        iconPath = buffer;
+        iconIdx = _wtoi(p);
+        }
 
-           RegCloseKey(hKeyShellIcons);
-       }
+        RegCloseKey(hKeyShellIcons);
+    }
 
-       return SIC_LoadIcon(iconPath, iconIdx, 0);
+    return SIC_LoadIcon(iconPath, iconIdx, 0);
 }
 
 /*************************************************************************
- * Shell_GetImageLists                 [SHELL32.71]
+ * Shell_GetImageLists            [SHELL32.71]
  *
  * PARAMETERS
  *  imglist[1|2] [OUT] pointer which receives imagelist handles
  *
  */
 BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
-{      TRACE("(%p,%p)\n",lpBigList,lpSmallList);
-       if (lpBigList)
-       { *lpBigList = ShellBigIconList;
-       }
-       if (lpSmallList)
-       { *lpSmallList = ShellSmallIconList;
-       }
-
-       return TRUE;
+{    TRACE("(%p,%p)\n",lpBigList,lpSmallList);
+    if (lpBigList)
+    { *lpBigList = ShellBigIconList;
+    }
+    if (lpSmallList)
+    { *lpSmallList = ShellSmallIconList;
+    }
+
+    return TRUE;
 }
 /*************************************************************************
- * PidlToSicIndex                      [INTERNAL]
+ * PidlToSicIndex            [INTERNAL]
  *
  * PARAMETERS
- *     sh      [IN]    IShellFolder
- *     pidl    [IN]
- *     bBigIcon [IN]
- *     uFlags  [IN]    GIL_*
- *     pIndex  [OUT]   index within the SIC
+ *    sh    [IN]    IShellFolder
+ *    pidl    [IN]
+ *    bBigIcon [IN]
+ *    uFlags    [IN]    GIL_*
+ *    pIndex    [OUT]    index within the SIC
  *
  */
 BOOL PidlToSicIndex (
-       IShellFolder * sh,
-       LPCITEMIDLIST pidl,
-       BOOL bBigIcon,
-       UINT uFlags,
-       int * pIndex)
+    IShellFolder * sh,
+    LPCITEMIDLIST pidl,
+    BOOL bBigIcon,
+    UINT uFlags,
+    int * pIndex)
 {
-       CComPtr<IExtractIconW>          ei;
-       WCHAR           szIconFile[MAX_PATH];   /* file containing the icon */
-       INT             iSourceIndex;           /* index or resID(negated) in this file */
-       BOOL            ret = FALSE;
-       UINT            dwFlags = 0;
-       int             iShortcutDefaultIndex = INVALID_INDEX;
-
-       TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
-
-       if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_IExtractIconW, 0, (void **)&ei)))
-       {
-         if (SUCCEEDED(ei->GetIconLocation(uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
-         {
-           *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
-           ret = TRUE;
-         }
-       }
-
-       if (INVALID_INDEX == *pIndex)   /* default icon when failed */
-       {
-         if (0 == (uFlags & GIL_FORSHORTCUT))
-         {
-           *pIndex = 0;
-         }
-         else
-         {
-           if (INVALID_INDEX == iShortcutDefaultIndex)
-           {
-             iShortcutDefaultIndex = SIC_LoadIcon(swShell32Name, 0, GIL_FORSHORTCUT);
-           }
-           *pIndex = (INVALID_INDEX != iShortcutDefaultIndex ? iShortcutDefaultIndex : 0);
-         }
-       }
-
-       return ret;
+    CComPtr<IExtractIconW>        ei;
+    WCHAR        szIconFile[MAX_PATH];    /* file containing the icon */
+    INT        iSourceIndex;        /* index or resID(negated) in this file */
+    BOOL        ret = FALSE;
+    UINT        dwFlags = 0;
+    int        iShortcutDefaultIndex = INVALID_INDEX;
+
+    TRACE("sf=%p pidl=%p %s\n", sh, pidl, bBigIcon?"Big":"Small");
+
+    if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_IExtractIconW, 0, (void **)&ei)))
+    {
+      if (SUCCEEDED(ei->GetIconLocation(uFlags, szIconFile, MAX_PATH, &iSourceIndex, &dwFlags)))
+      {
+        *pIndex = SIC_GetIconIndex(szIconFile, iSourceIndex, uFlags);
+        ret = TRUE;
+      }
+    }
+
+    if (INVALID_INDEX == *pIndex)    /* default icon when failed */
+    {
+      if (0 == (uFlags & GIL_FORSHORTCUT))
+      {
+        *pIndex = 0;
+      }
+      else
+      {
+        if (INVALID_INDEX == iShortcutDefaultIndex)
+        {
+          iShortcutDefaultIndex = SIC_LoadIcon(swShell32Name, 0, GIL_FORSHORTCUT);
+        }
+        *pIndex = (INVALID_INDEX != iShortcutDefaultIndex ? iShortcutDefaultIndex : 0);
+      }
+    }
+
+    return ret;
 
 }
 
 /*************************************************************************
- * SHMapPIDLToSystemImageListIndex     [SHELL32.77]
+ * SHMapPIDLToSystemImageListIndex    [SHELL32.77]
  *
  * PARAMETERS
- *     sh      [IN]            pointer to an instance of IShellFolder
- *     pidl    [IN]
- *     pIndex  [OUT][OPTIONAL] SIC index for big icon
+ *    sh    [IN]        pointer to an instance of IShellFolder
+ *    pidl    [IN]
+ *    pIndex    [OUT][OPTIONAL]    SIC index for big icon
  *
  */
 int WINAPI SHMapPIDLToSystemImageListIndex(
-       IShellFolder *sh,
-       LPCITEMIDLIST pidl,
-       int *pIndex)
+    IShellFolder *sh,
+    LPCITEMIDLIST pidl,
+    int *pIndex)
 {
-       int Index;
-       UINT uGilFlags = 0;
+    int Index;
+    UINT uGilFlags = 0;
 
-       TRACE("(SF=%p,pidl=%p,%p)\n",sh,pidl,pIndex);
-       pdump(pidl);
+    TRACE("(SF=%p,pidl=%p,%p)\n",sh,pidl,pIndex);
+    pdump(pidl);
 
-       if (SHELL_IsShortcut(pidl))
-           uGilFlags |= GIL_FORSHORTCUT;
+    if (SHELL_IsShortcut(pidl))
+        uGilFlags |= GIL_FORSHORTCUT;
 
-       if (pIndex)
-           if (!PidlToSicIndex ( sh, pidl, 1, uGilFlags, pIndex))
-               *pIndex = -1;
+    if (pIndex)
+        if (!PidlToSicIndex ( sh, pidl, 1, uGilFlags, pIndex))
+            *pIndex = -1;
 
-       if (!PidlToSicIndex ( sh, pidl, 0, uGilFlags, &Index))
-           return -1;
+    if (!PidlToSicIndex ( sh, pidl, 0, uGilFlags, &Index))
+        return -1;
 
-       return Index;
+    return Index;
 }
 
 /*************************************************************************
@@ -680,42 +680,42 @@ EXTERN_C HRESULT WINAPI SHMapIDListToImageListIndexAsync(IShellTaskScheduler *pt
 }
 
 /*************************************************************************
- * Shell_GetCachedImageIndex           [SHELL32.72]
+ * Shell_GetCachedImageIndex        [SHELL32.72]
  *
  */
 INT WINAPI Shell_GetCachedImageIndexA(LPCSTR szPath, INT nIndex, UINT bSimulateDoc)
 {
-       INT ret, len;
-       LPWSTR szTemp;
+    INT ret, len;
+    LPWSTR szTemp;
 
-       WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc);
+    WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_a(szPath), nIndex, bSimulateDoc);
 
-       len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 );
-       szTemp = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
-       MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len );
+    len = MultiByteToWideChar( CP_ACP, 0, szPath, -1, NULL, 0 );
+    szTemp = (LPWSTR)HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
+    MultiByteToWideChar( CP_ACP, 0, szPath, -1, szTemp, len );
 
-       ret = SIC_GetIconIndex( szTemp, nIndex, 0 );
+    ret = SIC_GetIconIndex( szTemp, nIndex, 0 );
 
-       HeapFree( GetProcessHeap(), 0, szTemp );
+    HeapFree( GetProcessHeap(), 0, szTemp );
 
-       return ret;
+    return ret;
 }
 
 INT WINAPI Shell_GetCachedImageIndexW(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc)
 {
-       WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc);
+    WARN("(%s,%08x,%08x) semi-stub.\n",debugstr_w(szPath), nIndex, bSimulateDoc);
 
-       return SIC_GetIconIndex(szPath, nIndex, 0);
+    return SIC_GetIconIndex(szPath, nIndex, 0);
 }
 
 EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL bSimulateDoc)
-{      if( SHELL_OsIsUnicode())
-         return Shell_GetCachedImageIndexW((LPCWSTR)szPath, nIndex, bSimulateDoc);
-       return Shell_GetCachedImageIndexA((LPCSTR)szPath, nIndex, bSimulateDoc);
+{    if( SHELL_OsIsUnicode())
+      return Shell_GetCachedImageIndexW((LPCWSTR)szPath, nIndex, bSimulateDoc);
+    return Shell_GetCachedImageIndexA((LPCSTR)szPath, nIndex, bSimulateDoc);
 }
 
 /*************************************************************************
- * ExtractIconExW                      [SHELL32.@]
+ * ExtractIconExW            [SHELL32.@]
  * RETURNS
  *  0 no icon found
  *  -1 file is not valid
@@ -723,26 +723,26 @@ EXTERN_C INT WINAPI Shell_GetCachedImageIndexAW(LPCVOID szPath, INT nIndex, BOOL
  */
 UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
 {
-       /* get entry point of undocumented function PrivateExtractIconExW() in user32 */
+    /* get entry point of undocumented function PrivateExtractIconExW() in user32 */
 #if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
-       static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
+    static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
 
-       if (!PrivateExtractIconExW) {
-           HMODULE hUser32 = GetModuleHandleA("user32");
-           PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
+    if (!PrivateExtractIconExW) {
+        HMODULE hUser32 = GetModuleHandleA("user32");
+        PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
 
-           if (!PrivateExtractIconExW)
-               return 0;
-       }
+        if (!PrivateExtractIconExW)
+        return 0;
+    }
 #endif
 
-       TRACE("%s %i %p %p %i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
+    TRACE("%s %i %p %p %i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
 
-       return PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
+    return PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
 }
 
 /*************************************************************************
- * ExtractIconExA                      [SHELL32.@]
+ * ExtractIconExA            [SHELL32.@]
  */
 UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
 {
@@ -762,7 +762,7 @@ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge,
 }
 
 /*************************************************************************
- *                             ExtractAssociatedIconA (SHELL32.@)
+ *                ExtractAssociatedIconA (SHELL32.@)
  *
  * Return icon for given file (either from file itself or from associated
  * executable) and patch parameters if needed.
@@ -791,7 +791,7 @@ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lp
 }
 
 /*************************************************************************
- *                             ExtractAssociatedIconW (SHELL32.@)
+ *                ExtractAssociatedIconW (SHELL32.@)
  *
  * Return icon for given file (either from file itself or from associated
  * executable) and patch parameters if needed.
@@ -833,7 +833,7 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l
 }
 
 /*************************************************************************
- *                             ExtractAssociatedIconExW (SHELL32.@)
+ *                ExtractAssociatedIconExW (SHELL32.@)
  *
  * Return icon for given file (either from file itself or from associated
  * executable) and patch parameters if needed.
@@ -845,7 +845,7 @@ EXTERN_C HICON WINAPI ExtractAssociatedIconExW(HINSTANCE hInst, LPWSTR lpIconPat
 }
 
 /*************************************************************************
- *                             ExtractAssociatedIconExA (SHELL32.@)
+ *                ExtractAssociatedIconExA (SHELL32.@)
  *
  * Return icon for given file (either from file itself or from associated
  * executable) and patch parameters if needed.
@@ -866,35 +866,35 @@ EXTERN_C HICON WINAPI ExtractAssociatedIconExA(HINSTANCE hInst, LPSTR lpIconPath
 
 
 /****************************************************************************
- * SHDefExtractIconW           [SHELL32.@]
+ * SHDefExtractIconW        [SHELL32.@]
  */
 HRESULT WINAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
                                  HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
 {
-       UINT ret;
-       HICON hIcons[2];
-       WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile), iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
-
-       ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize, nIconSize, hIcons, NULL, 2, LR_DEFAULTCOLOR);
-       /* FIXME: deal with uFlags parameter which contains GIL_ flags */
-       if (ret == 0xFFFFFFFF)
-         return E_FAIL;
-       if (ret > 0) {
-         if (phiconLarge)
-           *phiconLarge = hIcons[0];
-         else
-           DestroyIcon(hIcons[0]);
-         if (phiconSmall)
-           *phiconSmall = hIcons[1];
-         else
-           DestroyIcon(hIcons[1]);
-         return S_OK;
-       }
-       return S_FALSE;
+    UINT ret;
+    HICON hIcons[2];
+    WARN("%s %d 0x%08x %p %p %d, semi-stub\n", debugstr_w(pszIconFile), iIndex, uFlags, phiconLarge, phiconSmall, nIconSize);
+
+    ret = PrivateExtractIconsW(pszIconFile, iIndex, nIconSize, nIconSize, hIcons, NULL, 2, LR_DEFAULTCOLOR);
+    /* FIXME: deal with uFlags parameter which contains GIL_ flags */
+    if (ret == 0xFFFFFFFF)
+      return E_FAIL;
+    if (ret > 0) {
+      if (phiconLarge)
+        *phiconLarge = hIcons[0];
+      else
+        DestroyIcon(hIcons[0]);
+      if (phiconSmall)
+        *phiconSmall = hIcons[1];
+      else
+        DestroyIcon(hIcons[1]);
+      return S_OK;
+    }
+    return S_FALSE;
 }
 
 /****************************************************************************
- * SHDefExtractIconA           [SHELL32.@]
+ * SHDefExtractIconA        [SHELL32.@]
  */
 HRESULT WINAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
                                  HICON* phiconLarge, HICON* phiconSmall, UINT nIconSize)
index c034f13..d28dbce 100644 (file)
@@ -70,8 +70,8 @@ static BOOL ILGetDisplayNameExA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPSTR pat
 
 BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR path, DWORD type)
 {
-    CComPtr<IShellFolder>              psfParent;
-       LPSHELLFOLDER lsf = psf;
+    CComPtr<IShellFolder>        psfParent;
+    LPSHELLFOLDER lsf = psf;
     HRESULT ret = NO_ERROR;
     LPCITEMIDLIST pidllast;
     STRRET strret;
@@ -373,7 +373,7 @@ HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST * ppidl, DWORD * at
 
 HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST * ppidl, DWORD * attributes)
 {
-    CComPtr<IShellFolder>              sf;
+    CComPtr<IShellFolder>        sf;
     DWORD pchEaten;
     HRESULT ret = E_FAIL;
 
@@ -683,7 +683,7 @@ LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
  */
 HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST *pidlReal)
 {
-    CComPtr<IDataObject>               pDataObj;
+    CComPtr<IDataObject>        pDataObj;
     HRESULT hr;
 
     hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple,
@@ -967,8 +967,8 @@ EXTERN_C LPITEMIDLIST WINAPI ILCreateFromPathAW (LPCVOID path)
 static HRESULT _ILParsePathW(LPCWSTR path, LPWIN32_FIND_DATAW lpFindFile,
                              BOOL bBindCtx, LPITEMIDLIST *ppidl, LPDWORD prgfInOut)
 {
-    CComPtr<IShellFolder>      pSF;
-    CComPtr<IBindCtx>          pBC;
+    CComPtr<IShellFolder>    pSF;
+    CComPtr<IBindCtx>        pBC;
     HRESULT ret;
 
     TRACE("%s %p %d (%p)->%p (%p)->0x%x\n", debugstr_w(path), lpFindFile, bBindCtx,
@@ -1210,7 +1210,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
 {
     HRESULT hr;
     LPCITEMIDLIST pidlLast;
-    CComPtr<IShellFolder>              psfFolder;
+    CComPtr<IShellFolder>        psfFolder;
     DWORD dwAttributes;
     STRRET strret;
 
@@ -1244,7 +1244,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
  */
 HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast)
 {
-    CComPtr<IShellFolder>              psfDesktop;
+    CComPtr<IShellFolder>        psfDesktop;
     HRESULT         hr=E_FAIL;
 
     TRACE_(shell)("pidl=%p\n", pidl);
index f560b49..1400c2e 100644 (file)
 
  /* copy data structure for tray notifications */
 typedef struct TrayNotifyCDS_Dummy {
-       DWORD   cookie;
-       DWORD   notify_code;
-       DWORD   nicon_data[1];  // placeholder for NOTIFYICONDATA structure
+    DWORD    cookie;
+    DWORD    notify_code;
+    DWORD    nicon_data[1];    // placeholder for NOTIFYICONDATA structure
 } TrayNotifyCDS_Dummy;
 
  /* The only difference between Shell_NotifyIconA and Shell_NotifyIconW is the call to SendMessageA/W. */
 static BOOL SHELL_NotifyIcon(DWORD dwMessage, void* pnid, HWND nid_hwnd, int nid_size, BOOL unicode)
 {
-       HWND hwnd;
-       COPYDATASTRUCT data;
+    HWND hwnd;
+    COPYDATASTRUCT data;
 
-       BOOL ret = FALSE;
-       int len = sizeof(TrayNotifyCDS_Dummy)-sizeof(DWORD)+nid_size;
+    BOOL ret = FALSE;
+    int len = sizeof(TrayNotifyCDS_Dummy)-sizeof(DWORD)+nid_size;
 
-       TrayNotifyCDS_Dummy* pnotify_data = (TrayNotifyCDS_Dummy*) alloca(len);
+    TrayNotifyCDS_Dummy* pnotify_data = (TrayNotifyCDS_Dummy*) alloca(len);
 
-       pnotify_data->cookie = 1;
-       pnotify_data->notify_code = dwMessage;
-       memcpy(&pnotify_data->nicon_data, pnid, nid_size);
+    pnotify_data->cookie = 1;
+    pnotify_data->notify_code = dwMessage;
+    memcpy(&pnotify_data->nicon_data, pnid, nid_size);
 
-       data.dwData = 1;
-       data.cbData = len;
-       data.lpData = pnotify_data;
+    data.dwData = 1;
+    data.cbData = len;
+    data.lpData = pnotify_data;
 
-       for(hwnd=0; (hwnd=FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL)); )
-               if ((unicode?SendMessageW:SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data))
-                       ret = TRUE;
+    for(hwnd=0; (hwnd=FindWindowExW(0, hwnd, L"Shell_TrayWnd", NULL)); )
+        if ((unicode?SendMessageW:SendMessageA)(hwnd, WM_COPYDATA, (WPARAM)nid_hwnd, (LPARAM)&data))
+            ret = TRUE;
 
-       return ret;
+    return ret;
 }
 
 
 /*************************************************************************
- * Shell_NotifyIcon                    [SHELL32.296]
- * Shell_NotifyIconA                   [SHELL32.297]
+ * Shell_NotifyIcon            [SHELL32.296]
+ * Shell_NotifyIconA            [SHELL32.297]
  */
 BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA pnid)
 {
-       return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, FALSE);
+    return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, FALSE);
 }
 
 /*************************************************************************
- * Shell_NotifyIconW                   [SHELL32.298]
+ * Shell_NotifyIconW            [SHELL32.298]
  */
 BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW pnid)
 {
-       return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, TRUE);
+    return SHELL_NotifyIcon(dwMessage, pnid, pnid->hWnd, pnid->cbSize, TRUE);
 }
index d3ed8a4..d15bb22 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Open With  Context Menu extension
+ *    Open With  Context Menu extension
  *
  * Copyright 2007 Johannes Anderwald <janderwald@reactos.org>
  * Copyright 2009 Andrew Hill
@@ -73,7 +73,7 @@ COpenWithMenu::COpenWithMenu()
 
 COpenWithMenu::~COpenWithMenu()
 {
-       TRACE(" destroying IContextMenu(%p)\n", this);
+    TRACE(" destroying IContextMenu(%p)\n", this);
 }
 
 VOID
@@ -141,11 +141,11 @@ LoadOWItems(POPEN_WITH_CONTEXT pContext, LPCWSTR szName)
 
 
 HRESULT WINAPI COpenWithMenu::QueryContextMenu(
-       HMENU hmenu,
-       UINT indexMenu,
-       UINT idCmdFirst,
-       UINT idCmdLast,
-       UINT uFlags)
+    HMENU hmenu,
+    UINT indexMenu,
+    UINT idCmdFirst,
+    UINT idCmdLast,
+    UINT uFlags)
 {
     MENUITEMINFOW mii;
     WCHAR szBuffer[100] = {0};
@@ -717,9 +717,9 @@ COpenWithMenu::GetCommandString(UINT_PTR idCmd, UINT uType,
 }
 
 HRESULT WINAPI COpenWithMenu::HandleMenuMsg(
-       UINT uMsg,
-       WPARAM wParam,
-       LPARAM lParam)
+    UINT uMsg,
+    WPARAM wParam,
+    LPARAM lParam)
 {
     TRACE("This %p uMsg %x\n",this, uMsg);
 
@@ -737,7 +737,7 @@ GetManufacturer(WCHAR * szAppName, POPEN_ITEM_CONTEXT pContext)
     LPLANGANDCODEPAGE lplangcode;
     WCHAR szBuffer[100];
     WCHAR * pResult;
-       BOOL bResult;
+    BOOL bResult;
 
     static const WCHAR wFormat[] = L"\\StringFileInfo\\%04x%04x\\CompanyName";
     static const WCHAR wTranslation[] = L"VarFileInfo\\Translation";
@@ -1098,8 +1098,8 @@ COpenWithMenu::Initialize(LPCITEMIDLIST pidlFolder,
 {
     TRACE("This %p\n", this);
 
-       if (pdtobj == NULL)
-               return E_INVALIDARG;
+    if (pdtobj == NULL)
+        return E_INVALIDARG;
     return SHEOW_LoadOpenWithItems(pdtobj);
 }
 
index e0620b1..995d3b2 100644 (file)
@@ -28,12 +28,12 @@ EXTERN_C HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
 
 ShellItem::ShellItem()
 {
-       pidl = NULL;
+    pidl = NULL;
 }
 
 ShellItem::~ShellItem()
 {
-       ILFree(pidl);
+    ILFree(pidl);
 }
 
 HRESULT ShellItem::get_parent_pidl(LPITEMIDLIST *parent_pidl)
@@ -60,7 +60,7 @@ HRESULT ShellItem::get_parent_pidl(LPITEMIDLIST *parent_pidl)
 HRESULT ShellItem::get_parent_shellfolder(IShellFolder **ppsf)
 {
     LPITEMIDLIST parent_pidl;
-    CComPtr<IShellFolder>              desktop;
+    CComPtr<IShellFolder>        desktop;
     HRESULT ret;
 
     ret = get_parent_pidl(&parent_pidl);
@@ -112,7 +112,7 @@ HRESULT WINAPI ShellItem::GetDisplayName(SIGDN sigdnName, LPWSTR *ppszName)
 
 HRESULT WINAPI ShellItem::GetAttributes(SFGAOF sfgaoMask, SFGAOF *psfgaoAttribs)
 {
-    CComPtr<IShellFolder>              parent_folder;
+    CComPtr<IShellFolder>        parent_folder;
     LPITEMIDLIST child_pidl;
     HRESULT ret;
 
@@ -179,7 +179,7 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
 {
     IShellItem *newShellItem;
     LPITEMIDLIST new_pidl;
-       CComPtr<IPersistIDList>                 newPersistIDList;
+    CComPtr<IPersistIDList>            newPersistIDList;
     HRESULT ret;
 
     TRACE("(%p,%p,%p,%p)\n", pidlParent, psfParent, pidl, ppsi);
@@ -193,7 +193,7 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
         LPITEMIDLIST temp_parent=NULL;
         if (!pidlParent)
         {
-            CComPtr<IPersistFolder2>   ppf2Parent;
+            CComPtr<IPersistFolder2>    ppf2Parent;
 
             if (FAILED(psfParent->QueryInterface(IID_IPersistFolder2, (void**)&ppf2Parent)))
             {
@@ -223,26 +223,26 @@ HRESULT WINAPI SHCreateShellItem(LPCITEMIDLIST pidlParent,
             return E_OUTOFMEMORY;
     }
 
-       ret = ShellItem::_CreatorClass::CreateInstance(NULL, IID_IShellItem, (void**)&newShellItem);
+    ret = ShellItem::_CreatorClass::CreateInstance(NULL, IID_IShellItem, (void**)&newShellItem);
     if (FAILED(ret))
     {
         *ppsi = NULL;
         ILFree(new_pidl);
-               return ret;
+        return ret;
     }
-       ret = newShellItem->QueryInterface(IID_IPersistIDList, (void **)&newPersistIDList);
+    ret = newShellItem->QueryInterface(IID_IPersistIDList, (void **)&newPersistIDList);
     if (FAILED(ret))
-       {
+    {
         ILFree(new_pidl);
-               return ret;
-       }
-       ret = newPersistIDList->SetIDList(new_pidl);
+        return ret;
+    }
+    ret = newPersistIDList->SetIDList(new_pidl);
     if (FAILED(ret))
-       {
+    {
         ILFree(new_pidl);
-               return ret;
-       }
+        return ret;
+    }
     ILFree(new_pidl);
-       *ppsi = newShellItem;
+    *ppsi = newShellItem;
     return ret;
 }
index 88d7bc2..6d1023f 100644 (file)
@@ -1,8 +1,8 @@
 /*
- *     handling of SHELL32.DLL OLE-Objects
+ *    handling of SHELL32.DLL OLE-Objects
  *
- *     Copyright 1997  Marcus Meissner
- *     Copyright 1998  Juergen Schmied  <juergen.schmied@metronet.de>
+ *    Copyright 1997    Marcus Meissner
+ *    Copyright 1998    Juergen Schmied  <juergen.schmied@metronet.de>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -38,11 +38,11 @@ HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const I
 DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
 {
     WCHAR sFormat[52] = {'{','%','0','8','l','x','-','%','0','4',
-                        'x','-','%','0','4','x','-','%','0','2',
+                 'x','-','%','0','4','x','-','%','0','2',
                          'x','%','0','2','x','-','%','0','2','x',
-                        '%','0','2','x','%','0','2','x','%','0',
-                        '2','x','%','0','2','x','%','0','2','x',
-                        '}','\0'};
+             '%','0','2','x','%','0','2','x','%','0',
+             '2','x','%','0','2','x','%','0','2','x',
+             '}','\0'};
 
     return swprintf ( str, sFormat,
              guid.Data1, guid.Data2, guid.Data3,
@@ -68,116 +68,116 @@ DWORD WINAPI __SHGUIDToStringW (REFGUID guid, LPWSTR str)
  *     CoCreateInstace, SHLoadOLE
  */
 HRESULT WINAPI SHCoCreateInstance(
-       LPCWSTR aclsid,
-       const CLSID *clsid,
-       LPUNKNOWN pUnkOuter,
-       REFIID refiid,
-       LPVOID *ppv)
+    LPCWSTR aclsid,
+    const CLSID *clsid,
+    LPUNKNOWN pUnkOuter,
+    REFIID refiid,
+    LPVOID *ppv)
 {
-       DWORD   hres;
-       CLSID   iid;
-       const   CLSID * myclsid = clsid;
-       WCHAR   sKeyName[MAX_PATH];
-       const   WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
-       WCHAR   sClassID[60];
-       const WCHAR sInProcServer32[16] ={'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
-       const WCHAR sLoadWithoutCOM[15] ={'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
-       WCHAR   sDllPath[MAX_PATH];
-       HKEY    hKey;
-       DWORD   dwSize;
-       BOOLEAN bLoadFromShell32 = FALSE;
-       BOOLEAN bLoadWithoutCOM = FALSE;
-       CComPtr<IClassFactory>          pcf;
-
-       if(!ppv) return E_POINTER;
-       *ppv=NULL;
-
-       /* if the clsid is a string, convert it */
-       if (!clsid)
-       {
-         if (!aclsid) return REGDB_E_CLASSNOTREG;
-         CLSIDFromString((LPOLESTR)aclsid, &iid);
-         myclsid = &iid;
-       }
-
-       TRACE("(%p,%s,unk:%p,%s,%p)\n",
-               aclsid, shdebugstr_guid(myclsid), pUnkOuter, shdebugstr_guid(&refiid), ppv);
-
-       /* we look up the dll path in the registry */
+    DWORD    hres;
+    CLSID    iid;
+    const    CLSID * myclsid = clsid;
+    WCHAR    sKeyName[MAX_PATH];
+    const    WCHAR sCLSID[7] = {'C','L','S','I','D','\\','\0'};
+    WCHAR    sClassID[60];
+    const WCHAR sInProcServer32[16] ={'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
+    const WCHAR sLoadWithoutCOM[15] ={'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
+    WCHAR    sDllPath[MAX_PATH];
+    HKEY    hKey;
+    DWORD    dwSize;
+    BOOLEAN bLoadFromShell32 = FALSE;
+    BOOLEAN bLoadWithoutCOM = FALSE;
+    CComPtr<IClassFactory>        pcf;
+
+    if(!ppv) return E_POINTER;
+    *ppv=NULL;
+
+    /* if the clsid is a string, convert it */
+    if (!clsid)
+    {
+      if (!aclsid) return REGDB_E_CLASSNOTREG;
+      CLSIDFromString((LPOLESTR)aclsid, &iid);
+      myclsid = &iid;
+    }
+
+    TRACE("(%p,%s,unk:%p,%s,%p)\n",
+        aclsid, shdebugstr_guid(myclsid), pUnkOuter, shdebugstr_guid(&refiid), ppv);
+
+    /* we look up the dll path in the registry */
         __SHGUIDToStringW(*myclsid, sClassID);
-       wcscpy(sKeyName, sCLSID);
-       wcscat(sKeyName, sClassID);
-       wcscat(sKeyName, sInProcServer32);
-
-       if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) {
-           dwSize = sizeof(sDllPath);
-           SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
-
-           /* if a special registry key is set, we load a shell extension without help of OLE32 */
-           bLoadWithoutCOM = (ERROR_SUCCESS == SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0));
-
-           /* if the com object is inside shell32, omit use of ole32 */
-           bLoadFromShell32 = (0==lstrcmpiW( PathFindFileNameW(sDllPath), sShell32));
-
-           RegCloseKey (hKey);
-       } else {
-           /* since we can't find it in the registry we try internally */
-           bLoadFromShell32 = TRUE;
-       }
-
-       TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
-
-       /* now we create an instance */
-       if (bLoadFromShell32) {
-           if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
-               ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
-           }
-       } else if (bLoadWithoutCOM) {
-
-           /* load an external dll without ole32 */
-           HINSTANCE hLibrary;
-           typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
-           DllGetClassObjectFunc DllGetClassObject;
-
-           if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
-               ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
-               hres = E_ACCESSDENIED;
-               goto end;
-           } else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
-               ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
-               FreeLibrary( hLibrary );
-               hres = E_ACCESSDENIED;
-               goto end;
-           } else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
-                   TRACE("GetClassObject failed 0x%08x\n", hres);
-                   goto end;
-           }
-
-       } else {
-
-           /* load an external dll in the usual way */
-           hres = CoCreateInstance(*myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
-           goto end;
-       }
-
-       /* here we should have a ClassFactory */
-       if (!pcf) return E_ACCESSDENIED;
-
-       hres = pcf->CreateInstance(pUnkOuter, refiid, ppv);
+    wcscpy(sKeyName, sCLSID);
+    wcscat(sKeyName, sClassID);
+    wcscat(sKeyName, sInProcServer32);
+
+    if (ERROR_SUCCESS == RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey)) {
+        dwSize = sizeof(sDllPath);
+        SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
+
+        /* if a special registry key is set, we load a shell extension without help of OLE32 */
+        bLoadWithoutCOM = (ERROR_SUCCESS == SHQueryValueExW(hKey, sLoadWithoutCOM, 0, 0, 0, 0));
+
+        /* if the com object is inside shell32, omit use of ole32 */
+        bLoadFromShell32 = (0==lstrcmpiW( PathFindFileNameW(sDllPath), sShell32));
+
+        RegCloseKey (hKey);
+    } else {
+        /* since we can't find it in the registry we try internally */
+        bLoadFromShell32 = TRUE;
+    }
+
+    TRACE("WithoutCom=%u FromShell=%u\n", bLoadWithoutCOM, bLoadFromShell32);
+
+    /* now we create an instance */
+    if (bLoadFromShell32) {
+        if (! SUCCEEDED(DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
+            ERR("LoadFromShell failed for CLSID=%s\n", shdebugstr_guid(myclsid));
+        }
+    } else if (bLoadWithoutCOM) {
+
+        /* load an external dll without ole32 */
+        HINSTANCE hLibrary;
+        typedef HRESULT (CALLBACK *DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv);
+        DllGetClassObjectFunc DllGetClassObject;
+
+        if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
+            ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
+        hres = E_ACCESSDENIED;
+            goto end;
+        } else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
+            ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
+            FreeLibrary( hLibrary );
+        hres = E_ACCESSDENIED;
+            goto end;
+        } else if (! SUCCEEDED(hres = DllGetClassObject(*myclsid, IID_IClassFactory, (LPVOID*)&pcf))) {
+            TRACE("GetClassObject failed 0x%08x\n", hres);
+            goto end;
+        }
+
+    } else {
+
+        /* load an external dll in the usual way */
+        hres = CoCreateInstance(*myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
+        goto end;
+    }
+
+    /* here we should have a ClassFactory */
+    if (!pcf) return E_ACCESSDENIED;
+
+    hres = pcf->CreateInstance(pUnkOuter, refiid, ppv);
 end:
-       if(hres!=S_OK)
-       {
-         ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
+    if(hres!=S_OK)
+    {
+      ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
               hres, shdebugstr_guid(myclsid), shdebugstr_guid(&refiid));
-         ERR("class not found in registry\n");
-       }
+      ERR("class not found in registry\n");
+    }
 
-       TRACE("-- instance: %p\n",*ppv);
-       return hres;
+    TRACE("-- instance: %p\n",*ppv);
+    return hres;
 }
 
 /*************************************************************************
- * SHCLSIDFromString                           [SHELL32.147]
+ * SHCLSIDFromString                [SHELL32.147]
  *
  * Under Windows 9x this was an ANSI version of CLSIDFromString. It also allowed
  * to avoid dependency on ole32.dll (see SHLoadOLE for details).
@@ -201,19 +201,19 @@ DWORD WINAPI SHCLSIDFromStringA (LPCSTR clsid, CLSID *id)
 
 DWORD WINAPI SHCLSIDFromStringW (LPCWSTR clsid, CLSID *id)
 {
-       TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
-       return CLSIDFromString((LPWSTR)clsid, id);
+    TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
+    return CLSIDFromString((LPWSTR)clsid, id);
 }
 
 EXTERN_C DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id)
 {
-       if (SHELL_OsIsUnicode())
-         return SHCLSIDFromStringW ((LPCWSTR)clsid, id);
-       return SHCLSIDFromStringA ((LPCSTR)clsid, id);
+    if (SHELL_OsIsUnicode())
+      return SHCLSIDFromStringW ((LPCWSTR)clsid, id);
+    return SHCLSIDFromStringA ((LPCSTR)clsid, id);
 }
 
 /*************************************************************************
- *                      SHGetMalloc                    [SHELL32.@]
+ *             SHGetMalloc            [SHELL32.@]
  *
  * Equivalent to CoGetMalloc(MEMCTX_TASK, ...). Under Windows 9x this function
  * could use the shell32 built-in "mini-COM" without the need to load ole32.dll -
@@ -231,12 +231,12 @@ EXTERN_C DWORD WINAPI SHCLSIDFromStringAW (LPCVOID clsid, CLSID *id)
  */
 HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
 {
-       TRACE("(%p)\n", lpmal);
-       return CoGetMalloc(MEMCTX_TASK, lpmal);
+    TRACE("(%p)\n", lpmal);
+    return CoGetMalloc(MEMCTX_TASK, lpmal);
 }
 
 /*************************************************************************
- * SHAlloc                                     [SHELL32.196]
+ * SHAlloc                    [SHELL32.196]
  *
  * Equivalent to CoTaskMemAlloc. Under Windows 9x this function could use
  * the shell32 built-in "mini-COM" without the need to load ole32.dll -
@@ -250,15 +250,15 @@ HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
  */
 LPVOID WINAPI SHAlloc(DWORD len)
 {
-       LPVOID ret;
+    LPVOID ret;
 
-       ret = CoTaskMemAlloc(len);
-       TRACE("%u bytes at %p\n",len, ret);
-       return ret;
+    ret = CoTaskMemAlloc(len);
+    TRACE("%u bytes at %p\n",len, ret);
+    return ret;
 }
 
 /*************************************************************************
- * SHFree                                      [SHELL32.195]
+ * SHFree                    [SHELL32.195]
  *
  * Equivalent to CoTaskMemFree. Under Windows 9x this function could use
  * the shell32 built-in "mini-COM" without the need to load ole32.dll -
@@ -272,24 +272,24 @@ LPVOID WINAPI SHAlloc(DWORD len)
  */
 void WINAPI SHFree(LPVOID pv)
 {
-       TRACE("%p\n",pv);
-       CoTaskMemFree(pv);
+    TRACE("%p\n",pv);
+    CoTaskMemFree(pv);
 }
 
 /*************************************************************************
- * SHGetDesktopFolder                  [SHELL32.@]
+ * SHGetDesktopFolder            [SHELL32.@]
  */
 HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
 {
-       HRESULT hres = S_OK;
-       TRACE("\n");
+    HRESULT    hres = S_OK;
+    TRACE("\n");
 
-       if(!psf) return E_INVALIDARG;
-       *psf = NULL;
-       hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_IShellFolder, (void**)psf);
+    if(!psf) return E_INVALIDARG;
+    *psf = NULL;
+    hres = CDesktopFolder::_CreatorClass::CreateInstance(NULL, IID_IShellFolder, (void**)psf);
 
-       TRACE("-- %p->(%p)\n",psf, *psf);
-       return hres;
+    TRACE("-- %p->(%p)\n",psf, *psf);
+    return hres;
 }
 /**************************************************************************
  * Default ClassFactory Implementation
@@ -303,46 +303,46 @@ HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
  */
 
 class IDefClFImpl :
-       public CComObjectRootEx<CComMultiThreadModelNoCS>,
-       public IClassFactory
+    public CComObjectRootEx<CComMultiThreadModelNoCS>,
+    public IClassFactory
 {
 private:
-       CLSID                                   *rclsid;
-       LPFNCREATEINSTANCE              lpfnCI;
-       const IID                               *riidInst;
-       LONG                                    *pcRefDll;              /* pointer to refcounter in external dll (ugrrr...) */
+    CLSID                    *rclsid;
+    LPFNCREATEINSTANCE        lpfnCI;
+    const IID                *riidInst;
+    LONG                    *pcRefDll;        /* pointer to refcounter in external dll (ugrrr...) */
 public:
-       IDefClFImpl();
-       HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
+    IDefClFImpl();
+    HRESULT Initialize(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInstx);
 
-       // IClassFactory
-       virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
-       virtual HRESULT WINAPI LockServer(BOOL fLock);
+    // IClassFactory
+    virtual HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
+    virtual HRESULT WINAPI LockServer(BOOL fLock);
 
 BEGIN_COM_MAP(IDefClFImpl)
-       COM_INTERFACE_ENTRY_IID(IID_IClassFactory, IClassFactory)
+    COM_INTERFACE_ENTRY_IID(IID_IClassFactory, IClassFactory)
 END_COM_MAP()
 };
 
 IDefClFImpl::IDefClFImpl()
 {
-       lpfnCI = NULL;
-       riidInst = NULL;
-       pcRefDll = NULL;
+    lpfnCI = NULL;
+    riidInst = NULL;
+    pcRefDll = NULL;
     rclsid = NULL;
 }
 
 HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, const IID *riidInstx)
 {
-       lpfnCI = lpfnCIx;
-       riidInst = riidInstx;
-       pcRefDll = pcRefDllx;
+    lpfnCI = lpfnCIx;
+    riidInst = riidInstx;
+    pcRefDll = pcRefDllx;
 
-       if (pcRefDll)
-               InterlockedIncrement(pcRefDll);
+    if (pcRefDll)
+        InterlockedIncrement(pcRefDll);
 
-       TRACE("(%p)%s\n", this, shdebugstr_guid(riidInst));
-       return S_OK;
+    TRACE("(%p)%s\n", this, shdebugstr_guid(riidInst));
+    return S_OK;
 }
 
 /******************************************************************************
@@ -350,17 +350,17 @@ HRESULT IDefClFImpl::Initialize(LPFNCREATEINSTANCE lpfnCIx, PLONG pcRefDllx, con
  */
 HRESULT WINAPI IDefClFImpl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
 {
-       TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
+    TRACE("%p->(%p,%s,%p)\n", this, pUnkOuter, shdebugstr_guid(&riid), ppvObject);
 
-       *ppvObject = NULL;
+    *ppvObject = NULL;
 
-       if (riidInst == NULL || IsEqualCLSID(riid, *riidInst) || IsEqualCLSID(riid, IID_IUnknown))
-       {
-               return lpfnCI(pUnkOuter, riid, ppvObject);
-       }
+    if (riidInst == NULL || IsEqualCLSID(riid, *riidInst) || IsEqualCLSID(riid, IID_IUnknown))
+    {
+        return lpfnCI(pUnkOuter, riid, ppvObject);
+    }
 
-       ERR("unknown IID requested %s\n", shdebugstr_guid(&riid));
-       return E_NOINTERFACE;
+    ERR("unknown IID requested %s\n", shdebugstr_guid(&riid));
+    return E_NOINTERFACE;
 }
 
 /******************************************************************************
@@ -368,8 +368,8 @@ HRESULT WINAPI IDefClFImpl::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPV
  */
 HRESULT WINAPI IDefClFImpl::LockServer(BOOL fLock)
 {
-       TRACE("%p->(0x%x), not implemented\n", this, fLock);
-       return E_NOTIMPL;
+    TRACE("%p->(0x%x), not implemented\n", this, fLock);
+    return E_NOTIMPL;
 }
 
 /**************************************************************************
@@ -378,116 +378,116 @@ HRESULT WINAPI IDefClFImpl::LockServer(BOOL fLock)
 
 HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInst, IClassFactory **theFactory)
 {
-       CComObject<IDefClFImpl>                                 *theClassObject;
-       CComPtr<IClassFactory>                                  result;
-       HRESULT                                                                 hResult;
-
-       if (theFactory == NULL)
-               return E_POINTER;
-       *theFactory = NULL;
-       ATLTRY (theClassObject = new CComObject<IDefClFImpl>);
-       if (theClassObject == NULL)
-               return E_OUTOFMEMORY;
-       hResult = theClassObject->QueryInterface (IID_IClassFactory, (void **)&result);
-       if (FAILED (hResult))
-       {
-               delete theClassObject;
-               return hResult;
-       }
-       hResult = theClassObject->Initialize (lpfnCI, pcRefDll, riidInst);
-       if (FAILED (hResult))
-               return hResult;
-       *theFactory = result.Detach ();
-       return S_OK;
+    CComObject<IDefClFImpl>                    *theClassObject;
+    CComPtr<IClassFactory>                    result;
+    HRESULT                                    hResult;
+
+    if (theFactory == NULL)
+        return E_POINTER;
+    *theFactory = NULL;
+    ATLTRY (theClassObject = new CComObject<IDefClFImpl>);
+    if (theClassObject == NULL)
+        return E_OUTOFMEMORY;
+    hResult = theClassObject->QueryInterface (IID_IClassFactory, (void **)&result);
+    if (FAILED (hResult))
+    {
+        delete theClassObject;
+        return hResult;
+    }
+    hResult = theClassObject->Initialize (lpfnCI, pcRefDll, riidInst);
+    if (FAILED (hResult))
+        return hResult;
+    *theFactory = result.Detach ();
+    return S_OK;
 }
 
 /******************************************************************************
- * SHCreateDefClassObject                      [SHELL32.70]
+ * SHCreateDefClassObject            [SHELL32.70]
  */
 HRESULT WINAPI SHCreateDefClassObject(
-       REFIID  riid,
-       LPVOID* ppv,
-       LPFNCREATEINSTANCE lpfnCI,      /* [in] create instance callback entry */
-       LPDWORD pcRefDll,               /* [in/out] ref count of the dll */
-       REFIID  riidInst)               /* [in] optional interface to the instance */
+    REFIID    riid,
+    LPVOID*    ppv,
+    LPFNCREATEINSTANCE lpfnCI,    /* [in] create instance callback entry */
+    LPDWORD    pcRefDll,        /* [in/out] ref count of the dll */
+    REFIID    riidInst)        /* [in] optional interface to the instance */
 {
-       IClassFactory                           *pcf;
-       HRESULT                                         hResult;
-
-       TRACE("%s %p %p %p %s\n", shdebugstr_guid(&riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(&riidInst));
-
-       if (!IsEqualCLSID(riid, IID_IClassFactory))
-               return E_NOINTERFACE;
-       hResult = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, &riidInst, &pcf);
-       if (FAILED(hResult))
-               return hResult;
-       *ppv = pcf;
-       return NOERROR;
+    IClassFactory                *pcf;
+    HRESULT                        hResult;
+
+    TRACE("%s %p %p %p %s\n", shdebugstr_guid(&riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(&riidInst));
+
+    if (!IsEqualCLSID(riid, IID_IClassFactory))
+        return E_NOINTERFACE;
+    hResult = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, &riidInst, &pcf);
+    if (FAILED(hResult))
+        return hResult;
+    *ppv = pcf;
+    return NOERROR;
 }
 
 /*************************************************************************
- *  DragAcceptFiles            [SHELL32.@]
+ *  DragAcceptFiles        [SHELL32.@]
  */
 void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
 {
-       LONG exstyle;
-
-       if( !IsWindow(hWnd) ) return;
-       exstyle = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
-       if (b)
-         exstyle |= WS_EX_ACCEPTFILES;
-       else
-         exstyle &= ~WS_EX_ACCEPTFILES;
-       SetWindowLongPtrA(hWnd,GWL_EXSTYLE,exstyle);
+    LONG exstyle;
+
+    if( !IsWindow(hWnd) ) return;
+    exstyle = GetWindowLongPtrA(hWnd,GWL_EXSTYLE);
+    if (b)
+      exstyle |= WS_EX_ACCEPTFILES;
+    else
+      exstyle &= ~WS_EX_ACCEPTFILES;
+    SetWindowLongPtrA(hWnd,GWL_EXSTYLE,exstyle);
 }
 
 /*************************************************************************
- * DragFinish          [SHELL32.@]
+ * DragFinish        [SHELL32.@]
  */
 void WINAPI DragFinish(HDROP h)
 {
-       TRACE("\n");
-       GlobalFree((HGLOBAL)h);
+    TRACE("\n");
+    GlobalFree((HGLOBAL)h);
 }
 
 /*************************************************************************
- * DragQueryPoint              [SHELL32.@]
+ * DragQueryPoint        [SHELL32.@]
  */
 BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
 {
         DROPFILES *lpDropFileStruct;
-       BOOL bRet;
+    BOOL bRet;
 
-       TRACE("\n");
+    TRACE("\n");
 
-       lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
+    lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
 
         *p = lpDropFileStruct->pt;
-       bRet = lpDropFileStruct->fNC;
+    bRet = lpDropFileStruct->fNC;
 
-       GlobalUnlock(hDrop);
-       return bRet;
+    GlobalUnlock(hDrop);
+    return bRet;
 }
 
 /*************************************************************************
- *  DragQueryFileA             [SHELL32.@]
- *  DragQueryFile              [SHELL32.@]
+ *  DragQueryFileA        [SHELL32.@]
+ *  DragQueryFile         [SHELL32.@]
  */
 UINT WINAPI DragQueryFileA(
-       HDROP hDrop,
-       UINT lFile,
-       LPSTR lpszFile,
-       UINT lLength)
+    HDROP hDrop,
+    UINT lFile,
+    LPSTR lpszFile,
+    UINT lLength)
 {
-       LPSTR lpDrop;
-       UINT i = 0;
-       DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
+    LPSTR lpDrop;
+    UINT i = 0;
+    DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
 
-       TRACE("(%p, %x, %p, %u)\n",     hDrop,lFile,lpszFile,lLength);
+    TRACE("(%p, %x, %p, %u)\n",    hDrop,lFile,lpszFile,lLength);
 
-       if(!lpDropFileStruct) goto end;
+    if(!lpDropFileStruct) goto end;
 
-       lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
+    lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
 
         if(lpDropFileStruct->fWide) {
             LPWSTR lpszFileW = NULL;
@@ -507,42 +507,42 @@ UINT WINAPI DragQueryFileA(
             goto end;
         }
 
-       while (i++ < lFile)
-       {
-         while (*lpDrop++); /* skip filename */
-         if (!*lpDrop)
-         {
-           i = (lFile == 0xFFFFFFFF) ? i : 0;
-           goto end;
-         }
-       }
-
-       i = strlen(lpDrop);
-       if (!lpszFile ) goto end;   /* needed buffer size */
-       lstrcpynA (lpszFile, lpDrop, lLength);
+    while (i++ < lFile)
+    {
+      while (*lpDrop++); /* skip filename */
+      if (!*lpDrop)
+      {
+        i = (lFile == 0xFFFFFFFF) ? i : 0;
+        goto end;
+      }
+    }
+
+    i = strlen(lpDrop);
+    if (!lpszFile ) goto end;   /* needed buffer size */
+    lstrcpynA (lpszFile, lpDrop, lLength);
 end:
-       GlobalUnlock(hDrop);
-       return i;
+    GlobalUnlock(hDrop);
+    return i;
 }
 
 /*************************************************************************
- *  DragQueryFileW             [SHELL32.@]
+ *  DragQueryFileW        [SHELL32.@]
  */
 UINT WINAPI DragQueryFileW(
-       HDROP hDrop,
-       UINT lFile,
-       LPWSTR lpszwFile,
-       UINT lLength)
+    HDROP hDrop,
+    UINT lFile,
+    LPWSTR lpszwFile,
+    UINT lLength)
 {
-       LPWSTR lpwDrop;
-       UINT i = 0;
-       DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
+    LPWSTR lpwDrop;
+    UINT i = 0;
+    DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
 
-       TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
+    TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
 
-       if(!lpDropFileStruct) goto end;
+    if(!lpDropFileStruct) goto end;
 
-       lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
+    lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
 
         if(lpDropFileStruct->fWide == FALSE) {
             LPSTR lpszFileA = NULL;
@@ -562,21 +562,21 @@ UINT WINAPI DragQueryFileW(
             goto end;
         }
 
-       i = 0;
-       while (i++ < lFile)
-       {
-         while (*lpwDrop++); /* skip filename */
-         if (!*lpwDrop)
-         {
-           i = (lFile == 0xFFFFFFFF) ? i : 0;
-           goto end;
-         }
-       }
-
-       i = wcslen(lpwDrop);
-       if ( !lpszwFile) goto end;   /* needed buffer size */
-       lstrcpynW (lpszwFile, lpwDrop, lLength);
+    i = 0;
+    while (i++ < lFile)
+    {
+      while (*lpwDrop++); /* skip filename */
+      if (!*lpwDrop)
+      {
+        i = (lFile == 0xFFFFFFFF) ? i : 0;
+        goto end;
+      }
+    }
+
+    i = wcslen(lpwDrop);
+    if ( !lpszwFile) goto end;   /* needed buffer size */
+    lstrcpynW (lpszwFile, lpwDrop, lLength);
 end:
-       GlobalUnlock(hDrop);
-       return i;
+    GlobalUnlock(hDrop);
+    return i;
 }
index f38f279..44fa887 100644 (file)
@@ -52,41 +52,41 @@ static HMODULE SHELL32_hshlwapi=NULL;
 
 
 /*************************************************************************
- * ParseFieldA                                 [internal]
+ * ParseFieldA                    [internal]
  *
  * copies a field from a ',' delimited string
  *
  * first field is nField = 1
  */
 DWORD WINAPI ParseFieldA(
-       LPCSTR src,
-       DWORD nField,
-       LPSTR dst,
-       DWORD len)
+    LPCSTR src,
+    DWORD nField,
+    LPSTR dst,
+    DWORD len)
 {
-       WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
+    WARN("(%s,0x%08x,%p,%d) semi-stub.\n",debugstr_a(src),nField,dst,len);
 
-       if (!src || !src[0] || !dst || !len)
-         return 0;
+    if (!src || !src[0] || !dst || !len)
+      return 0;
 
-       /* skip n fields delimited by ',' */
-       while (nField > 1)
-       {
-         if (*src=='\0') return FALSE;
-         if (*(src++)==',') nField--;
-       }
+    /* skip n fields delimited by ',' */
+    while (nField > 1)
+    {
+      if (*src=='\0') return FALSE;
+      if (*(src++)==',') nField--;
+    }
 
-       /* copy part till the next ',' to dst */
-       while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
+    /* copy part till the next ',' to dst */
+    while ( *src!='\0' && *src!=',' && (len--)>0 ) *(dst++)=*(src++);
 
-       /* finalize the string */
-       *dst=0x0;
+    /* finalize the string */
+    *dst=0x0;
 
-       return TRUE;
+    return TRUE;
 }
 
 /*************************************************************************
- * ParseFieldW                 [internal]
+ * ParseFieldW            [internal]
  *
  * copies a field from a ',' delimited string
  *
@@ -94,49 +94,49 @@ DWORD WINAPI ParseFieldA(
  */
 DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len)
 {
-       WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
+    WARN("(%s,0x%08x,%p,%d) semi-stub.\n", debugstr_w(src), nField, dst, len);
 
-       if (!src || !src[0] || !dst || !len)
-         return 0;
+    if (!src || !src[0] || !dst || !len)
+      return 0;
 
-       /* skip n fields delimited by ',' */
-       while (nField > 1)
-       {
-         if (*src == 0x0) return FALSE;
-         if (*src++ == ',') nField--;
-       }
+    /* skip n fields delimited by ',' */
+    while (nField > 1)
+    {
+      if (*src == 0x0) return FALSE;
+      if (*src++ == ',') nField--;
+    }
 
-       /* copy part till the next ',' to dst */
-       while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
+    /* copy part till the next ',' to dst */
+    while ( *src != 0x0 && *src != ',' && (len--)>0 ) *(dst++) = *(src++);
 
-       /* finalize the string */
-       *dst = 0x0;
+    /* finalize the string */
+    *dst = 0x0;
 
-       return TRUE;
+    return TRUE;
 }
 
 /*************************************************************************
- * ParseField                  [SHELL32.58]
+ * ParseField            [SHELL32.58]
  */
 EXTERN_C DWORD WINAPI ParseFieldAW(LPCVOID src, DWORD nField, LPVOID dst, DWORD len)
 {
-       if (SHELL_OsIsUnicode())
-         return ParseFieldW((LPCWSTR)src, nField, (LPWSTR)dst, len);
-       return ParseFieldA((LPCSTR)src, nField, (LPSTR)dst, len);
+    if (SHELL_OsIsUnicode())
+      return ParseFieldW((LPCWSTR)src, nField, (LPWSTR)dst, len);
+    return ParseFieldA((LPCSTR)src, nField, (LPSTR)dst, len);
 }
 
 /*************************************************************************
- * GetFileNameFromBrowse                       [SHELL32.63]
+ * GetFileNameFromBrowse            [SHELL32.63]
  *
  */
 BOOL WINAPI GetFileNameFromBrowse(
-       HWND hwndOwner,
-       LPWSTR lpstrFile,
-       UINT nMaxFile,
-       LPCWSTR lpstrInitialDir,
-       LPCWSTR lpstrDefExt,
-       LPCWSTR lpstrFilter,
-       LPCWSTR lpstrTitle)
+    HWND hwndOwner,
+    LPWSTR lpstrFile,
+    UINT nMaxFile,
+    LPCWSTR lpstrInitialDir,
+    LPCWSTR lpstrDefExt,
+    LPCWSTR lpstrFilter,
+    LPCWSTR lpstrTitle)
 {
 typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
     HMODULE hmodule;
@@ -145,16 +145,16 @@ typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
     BOOL ret;
 
     TRACE("%p, %s, %d, %s, %s, %s, %s)\n",
-         hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
-         lpstrFilter, lpstrTitle);
+      hwndOwner, debugstr_w(lpstrFile), nMaxFile, lpstrInitialDir, lpstrDefExt,
+      lpstrFilter, lpstrTitle);
 
     hmodule = LoadLibraryW(L"comdlg32.dll");
     if(!hmodule) return FALSE;
     pGetOpenFileNameW = (GetOpenFileNameProc)GetProcAddress(hmodule, "GetOpenFileNameW");
     if(!pGetOpenFileNameW)
     {
-       FreeLibrary(hmodule);
-       return FALSE;
+    FreeLibrary(hmodule);
+    return FALSE;
     }
 
     memset(&ofn, 0, sizeof(ofn));
@@ -175,7 +175,7 @@ typedef BOOL (WINAPI *GetOpenFileNameProc)(OPENFILENAMEW *ofn);
 }
 
 /*************************************************************************
- * SHGetSetSettings                            [SHELL32.68]
+ * SHGetSetSettings                [SHELL32.68]
  */
 EXTERN_C VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
 {
@@ -190,7 +190,7 @@ EXTERN_C VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet
 }
 
 /*************************************************************************
- * SHGetSettings                               [SHELL32.@]
+ * SHGetSettings                [SHELL32.@]
  *
  * NOTES
  *  the registry path are for win98 (tested)
@@ -199,55 +199,55 @@ EXTERN_C VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet
  */
 EXTERN_C VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
 {
-       HKEY    hKey;
-       DWORD   dwData;
-       DWORD   dwDataSize = sizeof (DWORD);
+    HKEY    hKey;
+    DWORD    dwData;
+    DWORD    dwDataSize = sizeof (DWORD);
 
-       TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
+    TRACE("(%p 0x%08x)\n",lpsfs,dwMask);
 
-       if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
-                                0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
-         return;
+    if (RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+                 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0))
+      return;
 
-       if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fShowExtensions  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_SHOWEXTENSIONS & dwMask) && !RegQueryValueExA(hKey, "HideFileExt", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fShowExtensions  = ((dwData == 0) ?  0 : 1);
 
-       if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fShowInfoTip  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_SHOWINFOTIP & dwMask) && !RegQueryValueExA(hKey, "ShowInfoTip", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fShowInfoTip  = ((dwData == 0) ?  0 : 1);
 
-       if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fDontPrettyPath  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_DONTPRETTYPATH & dwMask) && !RegQueryValueExA(hKey, "DontPrettyPath", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fDontPrettyPath  = ((dwData == 0) ?  0 : 1);
 
-       if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fHideIcons  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_HIDEICONS & dwMask) && !RegQueryValueExA(hKey, "HideIcons", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fHideIcons  = ((dwData == 0) ?  0 : 1);
 
-       if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fMapNetDrvBtn  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_MAPNETDRVBUTTON & dwMask) && !RegQueryValueExA(hKey, "MapNetDrvBtn", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fMapNetDrvBtn  = ((dwData == 0) ?  0 : 1);
 
-       if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-         lpsfs->fShowAttribCol  = ((dwData == 0) ?  0 : 1);
+    if ( (SSF_SHOWATTRIBCOL & dwMask) && !RegQueryValueExA(hKey, "ShowAttribCol", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+      lpsfs->fShowAttribCol  = ((dwData == 0) ?  0 : 1);
 
-       if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
-       { if (dwData == 0)
-         { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
-           if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 0;
-         }
-         else if (dwData == 1)
-         { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 1;
-           if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 0;
-         }
-         else if (dwData == 2)
-         { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
-           if (SSF_SHOWSYSFILES & dwMask)      lpsfs->fShowSysFiles  = 1;
-         }
-       }
-       RegCloseKey (hKey);
+    if (((SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES) & dwMask) && !RegQueryValueExA(hKey, "Hidden", 0, 0, (LPBYTE)&dwData, &dwDataSize))
+    { if (dwData == 0)
+      { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
+        if (SSF_SHOWSYSFILES & dwMask)    lpsfs->fShowSysFiles  = 0;
+      }
+      else if (dwData == 1)
+      { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 1;
+        if (SSF_SHOWSYSFILES & dwMask)    lpsfs->fShowSysFiles  = 0;
+      }
+      else if (dwData == 2)
+      { if (SSF_SHOWALLOBJECTS & dwMask)    lpsfs->fShowAllObjects  = 0;
+        if (SSF_SHOWSYSFILES & dwMask)    lpsfs->fShowSysFiles  = 1;
+      }
+    }
+    RegCloseKey (hKey);
 
-       TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
+    TRACE("-- 0x%04x\n", *(WORD*)lpsfs);
 }
 
 /*************************************************************************
- * SHShellFolderView_Message                   [SHELL32.73]
+ * SHShellFolderView_Message            [SHELL32.73]
  *
  * Send a message to an explorer cabinet window.
  *
@@ -267,16 +267,16 @@ EXTERN_C VOID WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask)
  *    that was clicked.
  */
 LRESULT WINAPI SHShellFolderView_Message(
-       HWND hwndCabinet,
-       UINT uMessage,
-       LPARAM lParam)
+    HWND hwndCabinet,
+    UINT uMessage,
+    LPARAM lParam)
 {
-       FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
-       return 0;
+    FIXME("%p %08x %08lx stub\n",hwndCabinet, uMessage, lParam);
+    return 0;
 }
 
 /*************************************************************************
- * RegisterShellHook                           [SHELL32.181]
+ * RegisterShellHook                [SHELL32.181]
  *
  * Register a shell hook.
  *
@@ -288,15 +288,15 @@ LRESULT WINAPI SHShellFolderView_Message(
  *     Exported by ordinal
  */
 BOOL WINAPI RegisterShellHook(
-       HWND hWnd,
-       DWORD dwType)
+    HWND hWnd,
+    DWORD dwType)
 {
-       FIXME("(%p,0x%08x):stub.\n",hWnd, dwType);
-       return TRUE;
+    FIXME("(%p,0x%08x):stub.\n",hWnd, dwType);
+    return TRUE;
 }
 
 /*************************************************************************
- * ShellMessageBoxW                            [SHELL32.182]
+ * ShellMessageBoxW                [SHELL32.182]
  *
  * See ShellMessageBoxA.
  *
@@ -307,47 +307,47 @@ BOOL WINAPI RegisterShellHook(
  * shlwapi as well.
  */
 EXTERN_C int WINAPI ShellMessageBoxW(
-       HINSTANCE hInstance,
-       HWND hWnd,
-       LPCWSTR lpText,
-       LPCWSTR lpCaption,
-       UINT uType,
-       ...)
-{
-       WCHAR   szText[100],szTitle[100];
-       LPCWSTR pszText = szText, pszTitle = szTitle;
-       LPWSTR  pszTemp;
-       va_list args;
-       int     ret;
-
-       va_start(args, uType);
-       /* wvsprintfA(buf,fmt, args); */
-
-       TRACE("(%p,%p,%p,%p,%08x)\n",
-           hInstance,hWnd,lpText,lpCaption,uType);
-
-       if (IS_INTRESOURCE(lpCaption))
-         LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
-       else
-         pszTitle = lpCaption;
+    HINSTANCE hInstance,
+    HWND hWnd,
+    LPCWSTR lpText,
+    LPCWSTR lpCaption,
+    UINT uType,
+    ...)
+{
+    WCHAR    szText[100],szTitle[100];
+    LPCWSTR pszText = szText, pszTitle = szTitle;
+    LPWSTR  pszTemp;
+    va_list args;
+    int    ret;
+
+    va_start(args, uType);
+    /* wvsprintfA(buf,fmt, args); */
+
+    TRACE("(%p,%p,%p,%p,%08x)\n",
+        hInstance,hWnd,lpText,lpCaption,uType);
+
+    if (IS_INTRESOURCE(lpCaption))
+      LoadStringW(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle)/sizeof(szTitle[0]));
+    else
+      pszTitle = lpCaption;
 
-       if (IS_INTRESOURCE(lpText))
-         LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
-       else
-         pszText = lpText;
+    if (IS_INTRESOURCE(lpText))
+      LoadStringW(hInstance, LOWORD(lpText), szText, sizeof(szText)/sizeof(szText[0]));
+    else
+      pszText = lpText;
 
-       FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
-                      pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
+    FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+               pszText, 0, 0, (LPWSTR)&pszTemp, 0, &args);
 
-       va_end(args);
+    va_end(args);
 
-       ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
-       LocalFree(pszTemp);
-       return ret;
+    ret = MessageBoxW(hWnd,pszTemp,pszTitle,uType);
+    LocalFree(pszTemp);
+    return ret;
 }
 
 /*************************************************************************
- * ShellMessageBoxA                            [SHELL32.183]
+ * ShellMessageBoxA                [SHELL32.183]
  *
  * Format and output an error message.
  *
@@ -365,47 +365,47 @@ EXTERN_C int WINAPI ShellMessageBoxW(
  *     Exported by ordinal
  */
 EXTERN_C int WINAPI ShellMessageBoxA(
-       HINSTANCE hInstance,
-       HWND hWnd,
-       LPCSTR lpText,
-       LPCSTR lpCaption,
-       UINT uType,
-       ...)
-{
-       char    szText[100],szTitle[100];
-       LPCSTR  pszText = szText, pszTitle = szTitle;
-       LPSTR   pszTemp;
-       va_list args;
-       int     ret;
-
-       va_start(args, uType);
-       /* wvsprintfA(buf,fmt, args); */
-
-       TRACE("(%p,%p,%p,%p,%08x)\n",
-           hInstance,hWnd,lpText,lpCaption,uType);
-
-       if (IS_INTRESOURCE(lpCaption))
-         LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
-       else
-         pszTitle = lpCaption;
+    HINSTANCE hInstance,
+    HWND hWnd,
+    LPCSTR lpText,
+    LPCSTR lpCaption,
+    UINT uType,
+    ...)
+{
+    char    szText[100],szTitle[100];
+    LPCSTR  pszText = szText, pszTitle = szTitle;
+    LPSTR   pszTemp;
+    va_list args;
+    int    ret;
+
+    va_start(args, uType);
+    /* wvsprintfA(buf,fmt, args); */
+
+    TRACE("(%p,%p,%p,%p,%08x)\n",
+        hInstance,hWnd,lpText,lpCaption,uType);
+
+    if (IS_INTRESOURCE(lpCaption))
+      LoadStringA(hInstance, LOWORD(lpCaption), szTitle, sizeof(szTitle));
+    else
+      pszTitle = lpCaption;
 
-       if (IS_INTRESOURCE(lpText))
-         LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
-       else
-         pszText = lpText;
+    if (IS_INTRESOURCE(lpText))
+      LoadStringA(hInstance, LOWORD(lpText), szText, sizeof(szText));
+    else
+      pszText = lpText;
 
-       FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
-                      pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
+    FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_STRING,
+               pszText, 0, 0, (LPSTR)&pszTemp, 0, &args);
 
-       va_end(args);
+    va_end(args);
 
-       ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
-       LocalFree(pszTemp);
-       return ret;
+    ret = MessageBoxA(hWnd,pszTemp,pszTitle,uType);
+    LocalFree(pszTemp);
+    return ret;
 }
 
 /*************************************************************************
- * SHRegisterDragDrop                          [SHELL32.86]
+ * SHRegisterDragDrop                [SHELL32.86]
  *
  * Probably equivalent to RegisterDragDrop but under Windows 95 it could use the
  * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
@@ -420,15 +420,15 @@ EXTERN_C int WINAPI ShellMessageBoxA(
  *     RegisterDragDrop, SHLoadOLE
  */
 HRESULT WINAPI SHRegisterDragDrop(
-       HWND hWnd,
-       LPDROPTARGET pDropTarget)
+    HWND hWnd,
+    LPDROPTARGET pDropTarget)
 {
-       FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
-       return RegisterDragDrop(hWnd, pDropTarget);
+    FIXME("(%p,%p):stub.\n", hWnd, pDropTarget);
+    return RegisterDragDrop(hWnd, pDropTarget);
 }
 
 /*************************************************************************
- * SHRevokeDragDrop                            [SHELL32.87]
+ * SHRevokeDragDrop                [SHELL32.87]
  *
  * Probably equivalent to RevokeDragDrop but under Windows 9x it could use the
  * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
@@ -447,7 +447,7 @@ HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
 }
 
 /*************************************************************************
- * SHDoDragDrop                                        [SHELL32.88]
+ * SHDoDragDrop                    [SHELL32.88]
  *
  * Probably equivalent to DoDragDrop but under Windows 9x it could use the
  * shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
@@ -460,36 +460,36 @@ HRESULT WINAPI SHRevokeDragDrop(HWND hWnd)
  *     DoDragDrop, SHLoadOLE
  */
 HRESULT WINAPI SHDoDragDrop(
-       HWND hWnd,
-       LPDATAOBJECT lpDataObject,
-       LPDROPSOURCE lpDropSource,
-       DWORD dwOKEffect,
-       LPDWORD pdwEffect)
+    HWND hWnd,
+    LPDATAOBJECT lpDataObject,
+    LPDROPSOURCE lpDropSource,
+    DWORD dwOKEffect,
+    LPDWORD pdwEffect)
 {
     FIXME("(%p %p %p 0x%08x %p):stub.\n",
     hWnd, lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
-       return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
+    return DoDragDrop(lpDataObject, lpDropSource, dwOKEffect, pdwEffect);
 }
 
 /*************************************************************************
- * ArrangeWindows                              [SHELL32.184]
+ * ArrangeWindows                [SHELL32.184]
  *
  */
 WORD WINAPI ArrangeWindows(
-       HWND hwndParent,
-       DWORD dwReserved,
-       LPCRECT lpRect,
-       WORD cKids,
-       CONST HWND * lpKids)
+    HWND hwndParent,
+    DWORD dwReserved,
+    LPCRECT lpRect,
+    WORD cKids,
+    CONST HWND * lpKids)
 {
     /* Unimplemented in WinXP SP3 */
     TRACE("(%p 0x%08x %p 0x%04x %p):stub.\n",
-          hwndParent, dwReserved, lpRect, cKids, lpKids);
+       hwndParent, dwReserved, lpRect, cKids, lpKids);
     return 0;
 }
 
 /*************************************************************************
- * SignalFileOpen                              [SHELL32.103]
+ * SignalFileOpen                [SHELL32.103]
  *
  * NOTES
  *     exported by ordinal
@@ -523,17 +523,17 @@ static INT SHADD_get_policy(LPCSTR policy, LPDWORD type, LPVOID buffer, LPDWORD
     /* Get the key for the policies location in the registry
      */
     if (RegOpenKeyExA(HKEY_LOCAL_MACHINE,
-                     "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
-                     0, KEY_READ, &Policy_basekey)) {
-
-       if (RegOpenKeyExA(HKEY_CURRENT_USER,
-                         "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
-                         0, KEY_READ, &Policy_basekey)) {
-           TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
-                 policy);
-           *len = 0;
-           return ERROR_FILE_NOT_FOUND;
-       }
+              "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
+              0, KEY_READ, &Policy_basekey)) {
+
+    if (RegOpenKeyExA(HKEY_CURRENT_USER,
+              "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer",
+              0, KEY_READ, &Policy_basekey)) {
+        TRACE("No Explorer Policies location exists. Policy wanted=%s\n",
+          policy);
+        *len = 0;
+        return ERROR_FILE_NOT_FOUND;
+    }
     }
 
     /* Retrieve the data if it exists
@@ -590,7 +590,7 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR n
      */
 
     /* Create the MRU data structure for "RecentDocs"
-        */
+     */
     ptr = buffer;
     lstrcpyA(ptr, doc_name);
     ptr += (lstrlenA(buffer) + 1);
@@ -613,7 +613,7 @@ static INT SHADD_create_add_mru_data(HANDLE mruhandle, LPCSTR doc_name, LPCSTR n
 }
 
 /*************************************************************************
- * SHAddToRecentDocs                           [SHELL32.@]
+ * SHAddToRecentDocs                [SHELL32.@]
  *
  * Modify (add/clear) Shell's list of recently used documents.
  *
@@ -645,7 +645,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
     CHAR new_lnk_filepath[MAX_PATH];
     CHAR new_lnk_name[MAX_PATH];
     CHAR * ext;
-    CComPtr<IMalloc>           ppM;
+    CComPtr<IMalloc>        ppM;
     LPITEMIDLIST pidl;
     HWND hwnd = 0;       /* FIXME:  get real window handle */
     INT ret;
@@ -668,21 +668,21 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
     datalen = 64;
     ret=SHADD_get_policy( "NoRecentDocsHistory", &type, data, &datalen);
     if ((ret > 0) && (ret != ERROR_FILE_NOT_FOUND)) {
-       ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
-       return;
+    ERR("Error %d getting policy \"NoRecentDocsHistory\"\n", ret);
+    return;
     }
     if (ret == ERROR_SUCCESS) {
-       if (!( (type == REG_DWORD) ||
-              ((type == REG_BINARY) && (datalen == 4)) )) {
-           ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
-               type, datalen);
-           return;
-       }
-
-       TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
-       /* now test the actual policy value */
-       if ( data[0] != 0)
-           return;
+    if (!( (type == REG_DWORD) ||
+           ((type == REG_BINARY) && (datalen == 4)) )) {
+        ERR("Error policy data for \"NoRecentDocsHistory\" not formatted correctly, type=%d, len=%d\n",
+        type, datalen);
+        return;
+    }
+
+    TRACE("policy value for NoRecentDocsHistory = %08x\n", data[0]);
+    /* now test the actual policy value */
+    if ( data[0] != 0)
+        return;
     }
 
     /* Open key to where the necessary info is
@@ -692,59 +692,59 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
      *        key is stored in the DLL global data.
      */
     if (RegCreateKeyExA(HKEY_CURRENT_USER,
-                       "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
-                       0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
-       ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
-       return;
+            "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer",
+            0, 0, 0, KEY_READ, 0, &HCUbasekey, 0)) {
+    ERR("Failed to create 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer'\n");
+    return;
     }
 
     /* Get path to user's "Recent" directory
      */
     if(SUCCEEDED(SHGetMalloc(&ppM))) {
-       if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
-                                                &pidl))) {
-           SHGetPathFromIDListA(pidl, link_dir);
-           ppM->Free(pidl);
-       }
-       else {
-           /* serious issues */
-           link_dir[0] = 0;
-           ERR("serious issues 1\n");
-       }
+    if (SUCCEEDED(SHGetSpecialFolderLocation(hwnd, CSIDL_RECENT,
+                         &pidl))) {
+        SHGetPathFromIDListA(pidl, link_dir);
+        ppM->Free(pidl);
+    }
+    else {
+        /* serious issues */
+        link_dir[0] = 0;
+        ERR("serious issues 1\n");
+    }
     }
     else {
-       /* serious issues */
-       link_dir[0] = 0;
-       ERR("serious issues 2\n");
+    /* serious issues */
+    link_dir[0] = 0;
+    ERR("serious issues 2\n");
     }
     TRACE("Users Recent dir %s\n", link_dir);
 
     /* If no input, then go clear the lists */
     if (!pv) {
-       /* clear user's Recent dir
-        */
-
-       /* FIXME: delete all files in "link_dir"
-        *
-        * while( more files ) {
-        *    lstrcpyA(old_lnk_name, link_dir);
-        *    PathAppendA(old_lnk_name, filenam);
-        *    DeleteFileA(old_lnk_name);
-        * }
-        */
-       FIXME("should delete all files in %s\\\n", link_dir);
-
-       /* clear MRU list
-        */
-       /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
-        *  HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
-        *  and naturally it fails w/ rc=2. It should do it against
-        *  HKEY_CURRENT_USER which is where it is stored, and where
-        *  the MRU routines expect it!!!!
-        */
-       RegDeleteKeyA(HCUbasekey, "RecentDocs");
-       RegCloseKey(HCUbasekey);
-       return;
+    /* clear user's Recent dir
+     */
+
+    /* FIXME: delete all files in "link_dir"
+     *
+     * while( more files ) {
+     *    lstrcpyA(old_lnk_name, link_dir);
+     *    PathAppendA(old_lnk_name, filenam);
+     *    DeleteFileA(old_lnk_name);
+     * }
+     */
+    FIXME("should delete all files in %s\\\n", link_dir);
+
+    /* clear MRU list
+     */
+    /* MS Bug ?? v4.72.3612.1700 of shell32 does the delete against
+     *  HKEY_LOCAL_MACHINE version of ...CurrentVersion\Explorer
+     *  and naturally it fails w/ rc=2. It should do it against
+     *  HKEY_CURRENT_USER which is where it is stored, and where
+     *  the MRU routines expect it!!!!
+     */
+    RegDeleteKeyA(HCUbasekey, "RecentDocs");
+    RegCloseKey(HCUbasekey);
+    return;
     }
 
     /* Have data to add, the jobs to be done:
@@ -760,7 +760,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
     switch (uFlags)
     {
     case SHARD_PIDL:
-       SHGetPathFromIDListA((LPCITEMIDLIST)pv, doc_name);
+    SHGetPathFromIDListA((LPCITEMIDLIST)pv, doc_name);
         break;
 
     case SHARD_PATHA:
@@ -801,173 +801,173 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
     /* ***  JOB 1: Update registry for ...\Explorer\RecentDocs list  *** */
 
     {  /* on input needs:
-       *      doc_name    -  pure file-spec, no path
-       *      link_dir    -  path to the user's Recent directory
-       *      HCUbasekey  -  key of ...Windows\CurrentVersion\Explorer" node
-       * creates:
-       *      new_lnk_name-  pure file-spec, no path for new .lnk file
-       *      new_lnk_filepath
-       *                  -  path and file name of new .lnk file
-       */
-       CREATEMRULISTA mymru;
-       HANDLE mruhandle;
-       INT len, pos, bufused, err;
-       INT i;
-       DWORD attr;
-       CHAR buffer[2048];
-       CHAR *ptr;
-       CHAR old_lnk_name[MAX_PATH];
-       short int slen;
-
-       mymru.cbSize = sizeof(CREATEMRULISTA);
-       mymru.nMaxItems = 15;
-       mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
-       mymru.hKey = HCUbasekey;
-       mymru.lpszSubKey = "RecentDocs";
-       mymru.lpfnCompare = (PROC)SHADD_compare_mru;
-       mruhandle = CreateMRUListA(&mymru);
-       if (!mruhandle) {
-           /* MRU failed */
-           ERR("MRU processing failed, handle zero\n");
-           RegCloseKey(HCUbasekey);
-           return;
-       }
-       len = lstrlenA(doc_name);
-       pos = FindMRUData(mruhandle, doc_name, len, 0);
-
-       /* Now get the MRU entry that will be replaced
-        * and delete the .lnk file for it
-        */
-       if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
+    *      doc_name    -  pure file-spec, no path
+    *      link_dir    -  path to the user's Recent directory
+    *      HCUbasekey  -  key of ...Windows\CurrentVersion\Explorer" node
+    * creates:
+    *      new_lnk_name-  pure file-spec, no path for new .lnk file
+    *      new_lnk_filepath
+    *                  -  path and file name of new .lnk file
+    */
+    CREATEMRULISTA mymru;
+    HANDLE mruhandle;
+    INT len, pos, bufused, err;
+    INT i;
+    DWORD attr;
+    CHAR buffer[2048];
+    CHAR *ptr;
+    CHAR old_lnk_name[MAX_PATH];
+    short int slen;
+
+    mymru.cbSize = sizeof(CREATEMRULISTA);
+    mymru.nMaxItems = 15;
+    mymru.dwFlags = MRUF_BINARY_LIST | MRUF_DELAYED_SAVE;
+    mymru.hKey = HCUbasekey;
+    mymru.lpszSubKey = "RecentDocs";
+    mymru.lpfnCompare = (PROC)SHADD_compare_mru;
+    mruhandle = CreateMRUListA(&mymru);
+    if (!mruhandle) {
+        /* MRU failed */
+        ERR("MRU processing failed, handle zero\n");
+        RegCloseKey(HCUbasekey);
+        return;
+    }
+    len = lstrlenA(doc_name);
+    pos = FindMRUData(mruhandle, doc_name, len, 0);
+
+    /* Now get the MRU entry that will be replaced
+     * and delete the .lnk file for it
+     */
+    if ((bufused = EnumMRUListA(mruhandle, (pos == -1) ? 14 : pos,
                                     buffer, 2048)) != -1) {
-           ptr = buffer;
-           ptr += (lstrlenA(buffer) + 1);
-           slen = *((short int*)ptr);
-           ptr += 2;  /* skip the length area */
-           if (bufused >= slen + (ptr-buffer)) {
-               /* buffer size looks good */
-               ptr += 12; /* get to string */
-               len = bufused - (ptr-buffer);  /* get length of buf remaining */
-               if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
-                   /* appears to be good string */
-                   lstrcpyA(old_lnk_name, link_dir);
-                   PathAppendA(old_lnk_name, ptr);
-                   if (!DeleteFileA(old_lnk_name)) {
-                       if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
-                           if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
-                               ERR("Delete for %s failed, err=%d, attr=%08x\n",
-                                   old_lnk_name, err, attr);
-                           }
-                           else {
-                               TRACE("old .lnk file %s did not exist\n",
-                                     old_lnk_name);
-                           }
-                       }
-                       else {
-                           ERR("Delete for %s failed, attr=%08x\n",
-                               old_lnk_name, attr);
-                       }
-                   }
-                   else {
-                       TRACE("deleted old .lnk file %s\n", old_lnk_name);
-                   }
-               }
-           }
-       }
-
-       /* Create usable .lnk file name for the "Recent" directory
-        */
-       wsprintfA(new_lnk_name, "%s.lnk", doc_name);
-       lstrcpyA(new_lnk_filepath, link_dir);
-       PathAppendA(new_lnk_filepath, new_lnk_name);
-       i = 1;
-       olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
-       while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
-           i++;
-           wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
-           lstrcpyA(new_lnk_filepath, link_dir);
-           PathAppendA(new_lnk_filepath, new_lnk_name);
-       }
-       SetErrorMode(olderrormode);
-       TRACE("new shortcut will be %s\n", new_lnk_filepath);
-
-       /* Now add the new MRU entry and data
-        */
-       pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
-                                       buffer, &len);
-       FreeMRUList(mruhandle);
-       TRACE("Updated MRU list, new doc is position %d\n", pos);
+        ptr = buffer;
+        ptr += (lstrlenA(buffer) + 1);
+        slen = *((short int*)ptr);
+        ptr += 2;  /* skip the length area */
+        if (bufused >= slen + (ptr-buffer)) {
+        /* buffer size looks good */
+        ptr += 12; /* get to string */
+        len = bufused - (ptr-buffer);  /* get length of buf remaining */
+        if ((lstrlenA(ptr) > 0) && (lstrlenA(ptr) <= len-1)) {
+            /* appears to be good string */
+            lstrcpyA(old_lnk_name, link_dir);
+            PathAppendA(old_lnk_name, ptr);
+            if (!DeleteFileA(old_lnk_name)) {
+            if ((attr = GetFileAttributesA(old_lnk_name)) == INVALID_FILE_ATTRIBUTES) {
+                if ((err = GetLastError()) != ERROR_FILE_NOT_FOUND) {
+                ERR("Delete for %s failed, err=%d, attr=%08x\n",
+                    old_lnk_name, err, attr);
+                }
+                else {
+                TRACE("old .lnk file %s did not exist\n",
+                      old_lnk_name);
+                }
+            }
+            else {
+                ERR("Delete for %s failed, attr=%08x\n",
+                old_lnk_name, attr);
+            }
+            }
+            else {
+            TRACE("deleted old .lnk file %s\n", old_lnk_name);
+            }
+        }
+        }
+    }
+
+    /* Create usable .lnk file name for the "Recent" directory
+     */
+    wsprintfA(new_lnk_name, "%s.lnk", doc_name);
+    lstrcpyA(new_lnk_filepath, link_dir);
+    PathAppendA(new_lnk_filepath, new_lnk_name);
+    i = 1;
+    olderrormode = SetErrorMode(SEM_FAILCRITICALERRORS);
+    while (GetFileAttributesA(new_lnk_filepath) != INVALID_FILE_ATTRIBUTES) {
+        i++;
+        wsprintfA(new_lnk_name, "%s (%u).lnk", doc_name, i);
+        lstrcpyA(new_lnk_filepath, link_dir);
+        PathAppendA(new_lnk_filepath, new_lnk_name);
+    }
+    SetErrorMode(olderrormode);
+    TRACE("new shortcut will be %s\n", new_lnk_filepath);
+
+    /* Now add the new MRU entry and data
+     */
+    pos = SHADD_create_add_mru_data(mruhandle, doc_name, new_lnk_name,
+                    buffer, &len);
+    FreeMRUList(mruhandle);
+    TRACE("Updated MRU list, new doc is position %d\n", pos);
     }
 
     /* ***  JOB 2: Create shortcut in user's "Recent" directory  *** */
 
     {  /* on input needs:
-       *      doc_name    -  pure file-spec, no path
-       *      new_lnk_filepath
-       *                  -  path and file name of new .lnk file
-       *      uFlags[in]  -  flags on call to SHAddToRecentDocs
-       *      pv[in]      -  document path/pidl on call to SHAddToRecentDocs
-       */
-       CComPtr<IShellLinkA>            psl;
-       CComPtr<IPersistFile>           pPf;
-       HRESULT hres;
-       CHAR desc[MAX_PATH];
-       WCHAR widelink[MAX_PATH];
-
-       CoInitialize(0);
-
-       hres = CoCreateInstance(CLSID_ShellLink,
-                                NULL,
-                                CLSCTX_INPROC_SERVER,
-                                IID_IShellLinkA,
-                                (void **)&psl);
-       if(SUCCEEDED(hres)) {
-
-           hres = psl->QueryInterface(IID_IPersistFile,
-                                            (LPVOID *)&pPf);
-           if(FAILED(hres)) {
-               /* bombed */
-               ERR("failed QueryInterface for IPersistFile %08x\n", hres);
-               goto fail;
-           }
-
-           /* Set the document path or pidl */
-           if (uFlags == SHARD_PIDL) {
-               hres = psl->SetIDList((LPCITEMIDLIST) pv);
-           } else {
-               hres = psl->SetPath((LPCSTR) pv);
-           }
-           if(FAILED(hres)) {
-               /* bombed */
-               ERR("failed Set{IDList|Path} %08x\n", hres);
-               goto fail;
-           }
-
-           lstrcpyA(desc, "Shortcut to ");
-           lstrcatA(desc, doc_name);
-           hres = psl->SetDescription(desc);
-           if(FAILED(hres)) {
-               /* bombed */
-               ERR("failed SetDescription %08x\n", hres);
-               goto fail;
-           }
-
-           MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
-                               widelink, MAX_PATH);
-           /* create the short cut */
-           hres = pPf->Save(widelink, TRUE);
-           if(FAILED(hres)) {
-               /* bombed */
-               ERR("failed IPersistFile::Save %08x\n", hres);
-               goto fail;
-           }
-           hres = pPf->SaveCompleted(widelink);
-           TRACE("shortcut %s has been created, result=%08x\n",
-                 new_lnk_filepath, hres);
-       }
-       else {
-           ERR("CoCreateInstance failed, hres=%08x\n", hres);
-       }
+    *      doc_name    -  pure file-spec, no path
+    *      new_lnk_filepath
+    *                  -  path and file name of new .lnk file
+     *      uFlags[in]  -  flags on call to SHAddToRecentDocs
+    *      pv[in]      -  document path/pidl on call to SHAddToRecentDocs
+    */
+    CComPtr<IShellLinkA>        psl;
+    CComPtr<IPersistFile>        pPf;
+    HRESULT hres;
+    CHAR desc[MAX_PATH];
+    WCHAR widelink[MAX_PATH];
+
+    CoInitialize(0);
+
+    hres = CoCreateInstance(CLSID_ShellLink,
+                 NULL,
+                 CLSCTX_INPROC_SERVER,
+                 IID_IShellLinkA,
+                 (void **)&psl);
+    if(SUCCEEDED(hres)) {
+
+        hres = psl->QueryInterface(IID_IPersistFile,
+                         (LPVOID *)&pPf);
+        if(FAILED(hres)) {
+        /* bombed */
+        ERR("failed QueryInterface for IPersistFile %08x\n", hres);
+        goto fail;
+        }
+
+        /* Set the document path or pidl */
+        if (uFlags == SHARD_PIDL) {
+        hres = psl->SetIDList((LPCITEMIDLIST) pv);
+        } else {
+        hres = psl->SetPath((LPCSTR) pv);
+        }
+        if(FAILED(hres)) {
+        /* bombed */
+        ERR("failed Set{IDList|Path} %08x\n", hres);
+        goto fail;
+        }
+
+        lstrcpyA(desc, "Shortcut to ");
+        lstrcatA(desc, doc_name);
+        hres = psl->SetDescription(desc);
+        if(FAILED(hres)) {
+        /* bombed */
+        ERR("failed SetDescription %08x\n", hres);
+        goto fail;
+        }
+
+        MultiByteToWideChar(CP_ACP, 0, new_lnk_filepath, -1,
+                widelink, MAX_PATH);
+        /* create the short cut */
+        hres = pPf->Save(widelink, TRUE);
+        if(FAILED(hres)) {
+        /* bombed */
+        ERR("failed IPersistFile::Save %08x\n", hres);
+        goto fail;
+        }
+        hres = pPf->SaveCompleted(widelink);
+        TRACE("shortcut %s has been created, result=%08x\n",
+          new_lnk_filepath, hres);
+    }
+    else {
+        ERR("CoCreateInstance failed, hres=%08x\n", hres);
+    }
     }
 
  fail:
@@ -979,7 +979,7 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
 }
 
 /*************************************************************************
- * SHCreateShellFolderViewEx                   [SHELL32.174]
+ * SHCreateShellFolderViewEx            [SHELL32.174]
  *
  * Create a new instance of the default Shell folder view object.
  *
@@ -991,36 +991,36 @@ void WINAPI SHAddToRecentDocs (UINT uFlags,LPCVOID pv)
  *  see IShellFolder::CreateViewObject
  */
 HRESULT WINAPI SHCreateShellFolderViewEx(
-       LPCSFV psvcbi,    /* [in] shelltemplate struct */
-       IShellView **ppv) /* [out] IShellView pointer */
+    LPCSFV psvcbi,    /* [in] shelltemplate struct */
+    IShellView **ppv) /* [out] IShellView pointer */
 {
-       IShellView * psf;
-       HRESULT hRes;
+    IShellView * psf;
+    HRESULT hRes;
 
-       TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
-         psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
-         psvcbi->fvm, psvcbi->psvOuter);
+    TRACE("sf=%p pidl=%p cb=%p mode=0x%08x parm=%p\n",
+      psvcbi->pshf, psvcbi->pidl, psvcbi->pfnCallback,
+      psvcbi->fvm, psvcbi->psvOuter);
 
-       hRes = IShellView_Constructor(psvcbi->pshf, &psf);
-       if (FAILED(hRes))
-               return hRes;
+    hRes = IShellView_Constructor(psvcbi->pshf, &psf);
+    if (FAILED(hRes))
+        return hRes;
 
-       if (!psf)
-         return E_OUTOFMEMORY;
+    if (!psf)
+      return E_OUTOFMEMORY;
 
-       psf->AddRef();
-       hRes = psf->QueryInterface(IID_IShellView, (LPVOID *)ppv);
-       psf->Release();
+    psf->AddRef();
+    hRes = psf->QueryInterface(IID_IShellView, (LPVOID *)ppv);
+    psf->Release();
 
-       return hRes;
+    return hRes;
 }
 /*************************************************************************
- *  SHWinHelp                                  [SHELL32.127]
+ *  SHWinHelp                    [SHELL32.127]
  *
  */
 EXTERN_C HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
-{      FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v,w,x,z);
-       return 0;
+{    FIXME("0x%08x 0x%08x 0x%08x 0x%08x stub\n",v,w,x,z);
+    return 0;
 }
 /*************************************************************************
  *  SHRunControlPanel [SHELL32.161]
@@ -1028,40 +1028,40 @@ EXTERN_C HRESULT WINAPI SHWinHelp (DWORD v, DWORD w, DWORD x, DWORD z)
  */
 EXTERN_C BOOL WINAPI SHRunControlPanel (LPCWSTR lpcszCmdLine, HWND hwndMsgParent)
 {
-       FIXME("0x%08x 0x%08x stub\n",lpcszCmdLine,hwndMsgParent);
-       return 0;
+    FIXME("0x%08x 0x%08x stub\n",lpcszCmdLine,hwndMsgParent);
+    return 0;
 }
 
 static LPUNKNOWN SHELL32_IExplorerInterface=0;
 /*************************************************************************
- * SHSetInstanceExplorer                       [SHELL32.176]
+ * SHSetInstanceExplorer            [SHELL32.176]
  *
  * NOTES
  *  Sets the interface
  */
 VOID WINAPI SHSetInstanceExplorer (LPUNKNOWN lpUnknown)
-{      TRACE("%p\n", lpUnknown);
-       SHELL32_IExplorerInterface = lpUnknown;
+{    TRACE("%p\n", lpUnknown);
+    SHELL32_IExplorerInterface = lpUnknown;
 }
 /*************************************************************************
- * SHGetInstanceExplorer                       [SHELL32.@]
+ * SHGetInstanceExplorer            [SHELL32.@]
  *
  * NOTES
  *  gets the interface pointer of the explorer and a reference
  */
 HRESULT WINAPI SHGetInstanceExplorer (IUnknown **lpUnknown)
-{      TRACE("%p\n", lpUnknown);
+{    TRACE("%p\n", lpUnknown);
 
-       *lpUnknown = SHELL32_IExplorerInterface;
+    *lpUnknown = SHELL32_IExplorerInterface;
 
-       if (!SHELL32_IExplorerInterface)
-         return E_FAIL;
+    if (!SHELL32_IExplorerInterface)
+      return E_FAIL;
 
-       SHELL32_IExplorerInterface->AddRef();
-       return NOERROR;
+    SHELL32_IExplorerInterface->AddRef();
+    return NOERROR;
 }
 /*************************************************************************
- * SHFreeUnusedLibraries                       [SHELL32.123]
+ * SHFreeUnusedLibraries            [SHELL32.123]
  *
  * Probably equivalent to CoFreeUnusedLibraries but under Windows 9x it could use
  * the shell32 built-in "mini-COM" without the need to load ole32.dll - see SHLoadOLE
@@ -1075,11 +1075,11 @@ HRESULT WINAPI SHGetInstanceExplorer (IUnknown **lpUnknown)
  */
 void WINAPI SHFreeUnusedLibraries (void)
 {
-       FIXME("stub\n");
-       CoFreeUnusedLibraries();
+    FIXME("stub\n");
+    CoFreeUnusedLibraries();
 }
 /*************************************************************************
- * DAD_AutoScroll                              [SHELL32.129]
+ * DAD_AutoScroll                [SHELL32.129]
  *
  */
 BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT * pt)
@@ -1088,7 +1088,7 @@ BOOL WINAPI DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *samples, const POINT * p
     return 0;
 }
 /*************************************************************************
- * DAD_DragEnter                               [SHELL32.130]
+ * DAD_DragEnter                [SHELL32.130]
  *
  */
 BOOL WINAPI DAD_DragEnter(HWND hwnd)
@@ -1097,7 +1097,7 @@ BOOL WINAPI DAD_DragEnter(HWND hwnd)
     return FALSE;
 }
 /*************************************************************************
- * DAD_DragEnterEx                             [SHELL32.131]
+ * DAD_DragEnterEx                [SHELL32.131]
  *
  */
 BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
@@ -1106,7 +1106,7 @@ BOOL WINAPI DAD_DragEnterEx(HWND hwnd, POINT p)
     return FALSE;
 }
 /*************************************************************************
- * DAD_DragMove                                [SHELL32.134]
+ * DAD_DragMove                [SHELL32.134]
  *
  */
 BOOL WINAPI DAD_DragMove(POINT p)
@@ -1115,7 +1115,7 @@ BOOL WINAPI DAD_DragMove(POINT p)
     return FALSE;
 }
 /*************************************************************************
- * DAD_DragLeave                               [SHELL32.132]
+ * DAD_DragLeave                [SHELL32.132]
  *
  */
 BOOL WINAPI DAD_DragLeave(VOID)
@@ -1124,28 +1124,28 @@ BOOL WINAPI DAD_DragLeave(VOID)
     return FALSE;
 }
 /*************************************************************************
- * DAD_SetDragImage                            [SHELL32.136]
+ * DAD_SetDragImage                [SHELL32.136]
  *
  * NOTES
  *  exported by name
  */
 BOOL WINAPI DAD_SetDragImage(
-       HIMAGELIST himlTrack,
-       LPPOINT lppt)
+    HIMAGELIST himlTrack,
+    LPPOINT lppt)
 {
-       FIXME("%p %p stub\n",himlTrack, lppt);
+    FIXME("%p %p stub\n",himlTrack, lppt);
   return 0;
 }
 /*************************************************************************
- * DAD_ShowDragImage                           [SHELL32.137]
+ * DAD_ShowDragImage                [SHELL32.137]
  *
  * NOTES
  *  exported by name
  */
 BOOL WINAPI DAD_ShowDragImage(BOOL bShow)
 {
-       FIXME("0x%08x stub\n",bShow);
-       return 0;
+    FIXME("0x%08x stub\n",bShow);
+    return 0;
 }
 
 static const WCHAR szwCabLocation[] = {
@@ -1160,86 +1160,86 @@ static const WCHAR szwCabLocation[] = {
 static const WCHAR szwSettings[] = { 'S','e','t','t','i','n','g','s',0 };
 
 /*************************************************************************
- * ReadCabinetState                            [SHELL32.651] NT 4.0
+ * ReadCabinetState                [SHELL32.651] NT 4.0
  *
  */
 BOOL WINAPI ReadCabinetState(CABINETSTATE *cs, int length)
 {
-       HKEY hkey = 0;
-       DWORD type, r;
+    HKEY hkey = 0;
+    DWORD type, r;
 
-       TRACE("%p %d\n", cs, length);
+    TRACE("%p %d\n", cs, length);
 
-       if( (cs == NULL) || (length < (int)sizeof(*cs))  )
-               return FALSE;
+    if( (cs == NULL) || (length < (int)sizeof(*cs))  )
+        return FALSE;
 
-       r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
-       if( r == ERROR_SUCCESS )
-       {
-               type = REG_BINARY;
-               r = RegQueryValueExW( hkey, szwSettings,
-                       NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
-               RegCloseKey( hkey );
+    r = RegOpenKeyW( HKEY_CURRENT_USER, szwCabLocation, &hkey );
+    if( r == ERROR_SUCCESS )
+    {
+        type = REG_BINARY;
+        r = RegQueryValueExW( hkey, szwSettings,
+            NULL, &type, (LPBYTE)cs, (LPDWORD)&length );
+        RegCloseKey( hkey );
 
-       }
+    }
 
-       /* if we can't read from the registry, create default values */
-       if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
-               (cs->cLength != length) )
-       {
-               ERR("Initializing shell cabinet settings\n");
-               memset(cs, 0, sizeof(*cs));
-               cs->cLength          = sizeof(*cs);
-               cs->nVersion         = 2;
-               cs->fFullPathTitle   = FALSE;
-               cs->fSaveLocalView   = TRUE;
-               cs->fNotShell        = FALSE;
-               cs->fSimpleDefault   = TRUE;
-               cs->fDontShowDescBar = FALSE;
-               cs->fNewWindowMode   = FALSE;
-               cs->fShowCompColor   = FALSE;
-               cs->fDontPrettyNames = FALSE;
-               cs->fAdminsCreateCommonGroups = TRUE;
-               cs->fMenuEnumFilter  = 96;
-       }
+    /* if we can't read from the registry, create default values */
+    if ( (r != ERROR_SUCCESS) || (cs->cLength < sizeof(*cs)) ||
+        (cs->cLength != length) )
+    {
+        ERR("Initializing shell cabinet settings\n");
+        memset(cs, 0, sizeof(*cs));
+        cs->cLength          = sizeof(*cs);
+        cs->nVersion         = 2;
+        cs->fFullPathTitle   = FALSE;
+        cs->fSaveLocalView   = TRUE;
+        cs->fNotShell        = FALSE;
+        cs->fSimpleDefault   = TRUE;
+        cs->fDontShowDescBar = FALSE;
+        cs->fNewWindowMode   = FALSE;
+        cs->fShowCompColor   = FALSE;
+        cs->fDontPrettyNames = FALSE;
+        cs->fAdminsCreateCommonGroups = TRUE;
+        cs->fMenuEnumFilter  = 96;
+    }
 
-       return TRUE;
+    return TRUE;
 }
 
 /*************************************************************************
- * WriteCabinetState                           [SHELL32.652] NT 4.0
+ * WriteCabinetState                [SHELL32.652] NT 4.0
  *
  */
 BOOL WINAPI WriteCabinetState(CABINETSTATE *cs)
 {
-       DWORD r;
-       HKEY hkey = 0;
+    DWORD r;
+    HKEY hkey = 0;
 
-       TRACE("%p\n",cs);
+    TRACE("%p\n",cs);
 
-       if( cs == NULL )
-               return FALSE;
+    if( cs == NULL )
+        return FALSE;
 
-       r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
-                NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
-       if( r == ERROR_SUCCESS )
-       {
-               r = RegSetValueExW( hkey, szwSettings, 0,
-                       REG_BINARY, (LPBYTE) cs, cs->cLength);
+    r = RegCreateKeyExW( HKEY_CURRENT_USER, szwCabLocation, 0,
+         NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL);
+    if( r == ERROR_SUCCESS )
+    {
+        r = RegSetValueExW( hkey, szwSettings, 0,
+            REG_BINARY, (LPBYTE) cs, cs->cLength);
 
-               RegCloseKey( hkey );
-       }
+        RegCloseKey( hkey );
+    }
 
-       return (r==ERROR_SUCCESS);
+    return (r==ERROR_SUCCESS);
 }
 
 /*************************************************************************
- * FileIconInit                                [SHELL32.660]
+ * FileIconInit                 [SHELL32.660]
  *
  */
 BOOL WINAPI FileIconInit(BOOL bFullInit)
-{      FIXME("(%s)\n", bFullInit ? "true" : "false");
-       return 0;
+{    FIXME("(%s)\n", bFullInit ? "true" : "false");
+    return 0;
 }
 
 /*************************************************************************
@@ -1319,71 +1319,71 @@ BOOL WINAPI IsUserAnAdmin(VOID)
 }
 
 /*************************************************************************
- * SHAllocShared                               [SHELL32.520]
+ * SHAllocShared                [SHELL32.520]
  *
  * See shlwapi.SHAllocShared
  */
 HANDLE WINAPI SHAllocShared(LPVOID lpvData, DWORD dwSize, DWORD dwProcId)
 {
-       typedef HANDLE (WINAPI *SHAllocSharedProc)(LPCVOID, DWORD, DWORD);
-       static SHAllocSharedProc                pSHAllocShared;
+    typedef HANDLE (WINAPI *SHAllocSharedProc)(LPCVOID, DWORD, DWORD);
+    static SHAllocSharedProc        pSHAllocShared;
 
     GET_FUNC(pSHAllocShared, SHAllocSharedProc, shlwapi, (char*)7, NULL);
     return pSHAllocShared(lpvData, dwSize, dwProcId);
 }
 
 /*************************************************************************
- * SHLockShared                                        [SHELL32.521]
+ * SHLockShared                    [SHELL32.521]
  *
  * See shlwapi.SHLockShared
  */
 LPVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
 {
-       typedef HANDLE (WINAPI *SHLockSharedProc)(HANDLE, DWORD);
-       static SHLockSharedProc                 pSHLockShared;
+    typedef HANDLE (WINAPI *SHLockSharedProc)(HANDLE, DWORD);
+    static SHLockSharedProc            pSHLockShared;
 
     GET_FUNC(pSHLockShared, SHLockSharedProc, shlwapi, (char*)8, NULL);
     return pSHLockShared(hShared, dwProcId);
 }
 
 /*************************************************************************
- * SHUnlockShared                              [SHELL32.522]
+ * SHUnlockShared                [SHELL32.522]
  *
  * See shlwapi.SHUnlockShared
  */
 BOOL WINAPI SHUnlockShared(LPVOID lpView)
 {
-       typedef HANDLE (WINAPI *SHUnlockSharedProc)(LPCVOID);
-       static SHUnlockSharedProc               pSHUnlockShared;
+    typedef HANDLE (WINAPI *SHUnlockSharedProc)(LPCVOID);
+    static SHUnlockSharedProc        pSHUnlockShared;
 
     GET_FUNC(pSHUnlockShared, SHUnlockSharedProc, shlwapi, (char*)9, FALSE);
     return pSHUnlockShared(lpView) != NULL;
 }
 
 /*************************************************************************
- * SHFreeShared                                        [SHELL32.523]
+ * SHFreeShared                    [SHELL32.523]
  *
  * See shlwapi.SHFreeShared
  */
 BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
 {
-       typedef HANDLE (WINAPI *SHFreeSharedProc)(HANDLE, DWORD);
-       static SHFreeSharedProc                 pSHFreeShared;
+    typedef HANDLE (WINAPI *SHFreeSharedProc)(HANDLE, DWORD);
+    static SHFreeSharedProc            pSHFreeShared;
 
     GET_FUNC(pSHFreeShared, SHFreeSharedProc, shlwapi, (char*)10, FALSE);
     return pSHFreeShared(hShared, dwProcId) != NULL;
 }
 
 /*************************************************************************
- * SetAppStartingCursor                                [SHELL32.99]
+ * SetAppStartingCursor                [SHELL32.99]
  */
 EXTERN_C HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
-{      FIXME("hwnd=%p 0x%04x stub\n",u,v );
-       return 0;
+{    FIXME("hwnd=%p 0x%04x stub\n",u,v );
+    return 0;
 }
 
 /*************************************************************************
- * SHLoadOLE                                   [SHELL32.151]
+ * SHLoadOLE                    [SHELL32.151]
  *
  * To reduce the memory usage of Windows 95, its shell32 contained an
  * internal implementation of a part of COM (see e.g. SHGetMalloc, SHCoCreateInstance,
@@ -1402,97 +1402,97 @@ EXTERN_C HRESULT WINAPI SetAppStartingCursor(HWND u, DWORD v)
  * hack in SHCoCreateInstance)
  */
 HRESULT WINAPI SHLoadOLE(LPARAM lParam)
-{      FIXME("0x%08lx stub\n",lParam);
-       return S_OK;
+{    FIXME("0x%08lx stub\n",lParam);
+    return S_OK;
 }
 /*************************************************************************
- * DriveType                                   [SHELL32.64]
+ * DriveType                    [SHELL32.64]
  *
  */
 EXTERN_C int WINAPI DriveType(int DriveType)
 {
     WCHAR root[] = L"A:\\";
-       root[0] = L'A' + DriveType;
-       return GetDriveTypeW(root);
+    root[0] = L'A' + DriveType;
+    return GetDriveTypeW(root);
 }
 
 /*************************************************************************
- * InvalidateDriveType                 [SHELL32.65]
+ * InvalidateDriveType            [SHELL32.65]
  * Unimplemented in XP SP3
  */
 EXTERN_C int WINAPI InvalidateDriveType(int u)
 {
-       TRACE("0x%08x stub\n",u);
-       return 0;
+    TRACE("0x%08x stub\n",u);
+    return 0;
 }
 
 /*************************************************************************
- * SHAbortInvokeCommand                                [SHELL32.198]
+ * SHAbortInvokeCommand                [SHELL32.198]
  *
  */
 EXTERN_C HRESULT WINAPI SHAbortInvokeCommand(void)
-{      FIXME("stub\n");
-       return 1;
+{    FIXME("stub\n");
+    return 1;
 }
 
 /*************************************************************************
- * SHOutOfMemoryMessageBox                     [SHELL32.126]
+ * SHOutOfMemoryMessageBox            [SHELL32.126]
  *
  */
 int WINAPI SHOutOfMemoryMessageBox(
-       HWND hwndOwner,
-       LPCSTR lpCaption,
-       UINT uType)
+    HWND hwndOwner,
+    LPCSTR lpCaption,
+    UINT uType)
 {
-       FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
-       return 0;
+    FIXME("%p %s 0x%08x stub\n",hwndOwner, lpCaption, uType);
+    return 0;
 }
 
 /*************************************************************************
- * SHFlushClipboard                            [SHELL32.121]
+ * SHFlushClipboard                [SHELL32.121]
  *
  */
 EXTERN_C HRESULT WINAPI SHFlushClipboard(void)
 {
-       return OleFlushClipboard();
+    return OleFlushClipboard();
 }
 
 /*************************************************************************
- * SHWaitForFileToOpen                         [SHELL32.97]
+ * SHWaitForFileToOpen                [SHELL32.97]
  *
  */
 BOOL WINAPI SHWaitForFileToOpen(
-       LPCITEMIDLIST pidl,
-       DWORD dwFlags,
-       DWORD dwTimeout)
+    LPCITEMIDLIST pidl,
+    DWORD dwFlags,
+    DWORD dwTimeout)
 {
-       FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
-       return 0;
+    FIXME("%p 0x%08x 0x%08x stub\n", pidl, dwFlags, dwTimeout);
+    return 0;
 }
 
 /************************************************************************
- *     RLBuildListOfPaths                      [SHELL32.146]
+ *    RLBuildListOfPaths            [SHELL32.146]
  *
  * NOTES
  *   builds a DPA
  */
 EXTERN_C DWORD WINAPI RLBuildListOfPaths (void)
-{      FIXME("stub\n");
-       return 0;
+{    FIXME("stub\n");
+    return 0;
 }
 
 /************************************************************************
- *     SHValidateUNC                           [SHELL32.173]
+ *    SHValidateUNC                [SHELL32.173]
  *
  */
 EXTERN_C BOOL WINAPI SHValidateUNC (HWND hwndOwner, LPWSTR pszFile, UINT fConnect)
 {
-       FIXME("0x%08x 0x%08x 0x%08x stub\n",hwndOwner,pszFile,fConnect);
-       return 0;
+    FIXME("0x%08x 0x%08x 0x%08x stub\n",hwndOwner,pszFile,fConnect);
+    return 0;
 }
 
 /************************************************************************
- *     DoEnvironmentSubstA                     [SHELL32.@]
+ *    DoEnvironmentSubstA            [SHELL32.@]
  *
  * Replace %KEYWORD% in the str with the value of variable KEYWORD
  * from environment. If it is not found the %KEYWORD% is left
@@ -1528,7 +1528,7 @@ EXTERN_C DWORD WINAPI DoEnvironmentSubstA(LPSTR pszString, UINT cchString)
 }
 
 /************************************************************************
- *     DoEnvironmentSubstW                     [SHELL32.@]
+ *    DoEnvironmentSubstW            [SHELL32.@]
  *
  * See DoEnvironmentSubstA.
  */
@@ -1552,7 +1552,7 @@ EXTERN_C DWORD WINAPI DoEnvironmentSubstW(LPWSTR pszString, UINT cchString)
 }
 
 /************************************************************************
- *     DoEnvironmentSubst                      [SHELL32.53]
+ *    DoEnvironmentSubst            [SHELL32.53]
  *
  * See DoEnvironmentSubstA.
  */
@@ -1584,21 +1584,21 @@ BOOL WINAPI GUIDFromStringW(LPCWSTR str, LPGUID guid)
 }
 
 /*************************************************************************
- *      PathIsTemporaryW       [SHELL32.714]
+ *      PathIsTemporaryW    [SHELL32.714]
  */
 EXTERN_C BOOL WINAPI PathIsTemporaryW(LPWSTR Str)
 {
-       FIXME("(%s)stub\n", debugstr_w(Str));
-       return FALSE;
+     FIXME("(%s)stub\n", debugstr_w(Str));
+    return FALSE;
 }
 
 /*************************************************************************
- *      PathIsTemporaryA       [SHELL32.713]
+ *      PathIsTemporaryA    [SHELL32.713]
  */
 EXTERN_C BOOL WINAPI PathIsTemporaryA(LPSTR Str)
 {
-       FIXME("(%s)stub\n", debugstr_a(Str));
-       return FALSE;
+     FIXME("(%s)stub\n", debugstr_a(Str));
+    return FALSE;
 }
 
 typedef struct _PSXA
@@ -1636,7 +1636,7 @@ static BOOL CALLBACK PsxaCall(HPROPSHEETPAGE hpage, LPARAM lParam)
 }
 
 /*************************************************************************
- *      SHAddFromPropSheetExtArray     [SHELL32.167]
+ *      SHAddFromPropSheetExtArray    [SHELL32.167]
  */
 UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
 {
@@ -1666,7 +1666,7 @@ UINT WINAPI SHAddFromPropSheetExtArray(HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAdd
 }
 
 /*************************************************************************
- *      SHCreatePropSheetExtArray      [SHELL32.168]
+ *      SHCreatePropSheetExtArray    [SHELL32.168]
  */
 HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface)
 {
@@ -1675,7 +1675,7 @@ HPSXA WINAPI SHCreatePropSheetExtArray(HKEY hKey, LPCWSTR pszSubKey, UINT max_if
 
 
 /*************************************************************************
- *      SHCreatePropSheetExtArrayEx    [SHELL32.194]
+ *      SHCreatePropSheetExtArrayEx    [SHELL32.194]
  */
 EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_iface, IDataObject *pDataObj)
 {
@@ -1739,8 +1739,8 @@ EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey,
                 }
                 if (SUCCEEDED(hr))
                 {
-                                       CComPtr<IShellExtInit>                  psxi;
-                                       CComPtr<IShellPropSheetExt>             pspsx;
+                    CComPtr<IShellExtInit>            psxi;
+                    CComPtr<IShellPropSheetExt>        pspsx;
 
                    /* Attempt to get an IShellPropSheetExt and an IShellExtInit instance.
                        Only if both interfaces are supported it's a real shell extension.
@@ -1775,7 +1775,7 @@ EXTERN_C HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey,
 }
 
 /*************************************************************************
- *      SHReplaceFromPropSheetExtArray [SHELL32.170]
+ *      SHReplaceFromPropSheetExtArray    [SHELL32.170]
  */
 UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam)
 {
@@ -1806,7 +1806,7 @@ UINT WINAPI SHReplaceFromPropSheetExtArray(HPSXA hpsxa, UINT uPageID, LPFNADDPRO
 }
 
 /*************************************************************************
- *      SHDestroyPropSheetExtArray     [SHELL32.169]
+ *      SHDestroyPropSheetExtArray    [SHELL32.169]
  */
 void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
 {
@@ -1827,60 +1827,60 @@ void WINAPI SHDestroyPropSheetExtArray(HPSXA hpsxa)
 }
 
 /*************************************************************************
- *      CIDLData_CreateFromIDArray     [SHELL32.83]
+ *      CIDLData_CreateFromIDArray    [SHELL32.83]
  *
  *  Create IDataObject from PIDLs??
  */
 HRESULT WINAPI CIDLData_CreateFromIDArray(
-       LPCITEMIDLIST pidlFolder,
-       UINT cpidlFiles,
-       LPCITEMIDLIST *lppidlFiles,
-       IDataObject **ppdataObject)
+    LPCITEMIDLIST pidlFolder,
+    UINT cpidlFiles,
+    LPCITEMIDLIST *lppidlFiles,
+    IDataObject **ppdataObject)
 {
-       UINT i;
-       HWND hwnd = 0;   /*FIXME: who should be hwnd of owner? set to desktop */
-       HRESULT hResult;
+    UINT i;
+    HWND hwnd = 0;   /*FIXME: who should be hwnd of owner? set to desktop */
+    HRESULT hResult;
 
-       TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
-       if (TRACE_ON(pidl))
-       {
-               pdump (pidlFolder);
-               for (i = 0; i < cpidlFiles; i++)
-                       pdump(lppidlFiles[i]);
-       }
-       hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, ppdataObject);
-       return hResult;
+    TRACE("(%p, %d, %p, %p)\n", pidlFolder, cpidlFiles, lppidlFiles, ppdataObject);
+    if (TRACE_ON(pidl))
+    {
+        pdump (pidlFolder);
+        for (i = 0; i < cpidlFiles; i++)
+            pdump(lppidlFiles[i]);
+    }
+    hResult = IDataObject_Constructor(hwnd, pidlFolder, lppidlFiles, cpidlFiles, ppdataObject);
+    return hResult;
 }
 
 /*************************************************************************
- * SHCreateStdEnumFmtEtc                       [SHELL32.74]
+ * SHCreateStdEnumFmtEtc            [SHELL32.74]
  *
  * NOTES
  *
  */
 HRESULT WINAPI SHCreateStdEnumFmtEtc(
-       UINT cFormats,
-       const FORMATETC *lpFormats,
-       LPENUMFORMATETC *ppenumFormatetc)
+    UINT cFormats,
+    const FORMATETC *lpFormats,
+    LPENUMFORMATETC *ppenumFormatetc)
 {
-       IEnumFORMATETC *pef;
-       HRESULT hRes;
-       TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
+    IEnumFORMATETC *pef;
+    HRESULT hRes;
+    TRACE("cf=%d fe=%p pef=%p\n", cFormats, lpFormats, ppenumFormatetc);
 
-       hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
-       if (FAILED(hRes))
-               return hRes;
+    hRes = IEnumFORMATETC_Constructor(cFormats, lpFormats, &pef);
+    if (FAILED(hRes))
+        return hRes;
 
-       pef->AddRef();
-       hRes = pef->QueryInterface(IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
-       pef->Release();
+    pef->AddRef();
+    hRes = pef->QueryInterface(IID_IEnumFORMATETC, (LPVOID*)ppenumFormatetc);
+    pef->Release();
 
-       return hRes;
+    return hRes;
 }
 
 
 /*************************************************************************
- *             SHCreateShellFolderView (SHELL32.256)
+ *        SHCreateShellFolderView (SHELL32.256)
  */
 HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
 {
@@ -1894,19 +1894,19 @@ HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **pps
     {
         LPVOID lpdata = 0;/*LocalAlloc(LMEM_ZEROINIT, 0x4E4);*/
 
-       if (!lpdata)
+    if (!lpdata)
             ret = E_OUTOFMEMORY;
-       else
-       {
+    else
+    {
             /* Initialize and return unknown lpdata structure */
-       }
+    }
     }
 
     return ret;
 }
 
 /*************************************************************************
- *             SHFindFiles (SHELL32.90)
+ *        SHFindFiles (SHELL32.90)
  */
 BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
 {
@@ -1915,7 +1915,7 @@ BOOL WINAPI SHFindFiles( LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile )
 }
 
 /*************************************************************************
- *             SHUpdateImageW (SHELL32.192)
+ *        SHUpdateImageW (SHELL32.192)
  *
  * Notifies the shell that an icon in the system image list has been changed.
  *
@@ -1939,7 +1939,7 @@ void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iIm
 }
 
 /*************************************************************************
- *             SHUpdateImageA (SHELL32.191)
+ *        SHUpdateImageA (SHELL32.191)
  *
  * See SHUpdateImageW.
  */
@@ -2074,7 +2074,7 @@ HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags)
 
 HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags)
 {
-       WCHAR szPath[MAX_PATH] = {0};
+    WCHAR szPath[MAX_PATH] = {0};
     DWORD dwSize, dwType;
     LONG ret;
 
@@ -2255,7 +2255,7 @@ EXTERN_C HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
 EXTERN_C HRESULT WINAPI SHParseDisplayName(LPCWSTR pszName, IBindCtx *pbc,
     LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
 {
-    CComPtr<IShellFolder>              psfDesktop;
+    CComPtr<IShellFolder>        psfDesktop;
     HRESULT         hr=E_FAIL;
     ULONG           dwAttr=sfgaoIn;
 
index f141861..34e2a18 100644 (file)
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /*
-       ########## Combining and Constructing paths ##########
+    ########## Combining and Constructing paths ##########
 */
 
 /*************************************************************************
- * PathAppend          [SHELL32.36]
+ * PathAppend        [SHELL32.36]
  */
 BOOL WINAPI PathAppendAW(
-       LPVOID lpszPath1,
-       LPCVOID lpszPath2)
+    LPVOID lpszPath1,
+    LPCVOID lpszPath2)
 {
-       if (SHELL_OsIsUnicode())
-         return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2);
-       return PathAppendA((LPSTR)lpszPath1, (LPCSTR)lpszPath2);
+    if (SHELL_OsIsUnicode())
+      return PathAppendW((LPWSTR)lpszPath1, (LPCWSTR)lpszPath2);
+    return PathAppendA((LPSTR)lpszPath1, (LPCSTR)lpszPath2);
 }
 
 /*************************************************************************
- * PathBuildRoot               [SHELL32.30]
+ * PathBuildRoot        [SHELL32.30]
  */
 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
 {
-       if(SHELL_OsIsUnicode())
-         return PathBuildRootW((LPWSTR)lpszPath, drive);
-       return PathBuildRootA((LPSTR)lpszPath, drive);
+    if(SHELL_OsIsUnicode())
+      return PathBuildRootW((LPWSTR)lpszPath, drive);
+    return PathBuildRootA((LPSTR)lpszPath, drive);
 }
 
 /*************************************************************************
- * PathGetExtensionA           [internal]
+ * PathGetExtensionA        [internal]
  *
  * NOTES
  *  exported by ordinal
@@ -63,29 +63,29 @@ LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive)
  */
 static LPSTR PathGetExtensionA(LPCSTR lpszPath)
 {
-       TRACE("(%s)\n",lpszPath);
+    TRACE("(%s)\n",lpszPath);
 
-       lpszPath = PathFindExtensionA(lpszPath);
-       return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
+    lpszPath = PathFindExtensionA(lpszPath);
+    return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
 }
 
 /*************************************************************************
- * PathGetExtensionW           [internal]
+ * PathGetExtensionW        [internal]
  */
 LPWSTR PathGetExtensionW(LPCWSTR lpszPath)
 {
-       TRACE("(%s)\n",debugstr_w(lpszPath));
+    TRACE("(%s)\n",debugstr_w(lpszPath));
 
-       lpszPath = PathFindExtensionW(lpszPath);
-       return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
+    lpszPath = PathFindExtensionW(lpszPath);
+    return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
 }
 
 /*************************************************************************
- * SHPathGetExtension          [SHELL32.158]
+ * SHPathGetExtension        [SHELL32.158]
  */
 EXTERN_C LPVOID WINAPI SHPathGetExtensionW(LPCWSTR lpszPath, DWORD void1, DWORD void2)
 {
-       return PathGetExtensionW(lpszPath);
+    return PathGetExtensionW(lpszPath);
 }
 
 /*************************************************************************
@@ -93,13 +93,13 @@ EXTERN_C LPVOID WINAPI SHPathGetExtensionW(LPCWSTR lpszPath, DWORD void1, DWORD
  */
 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
 {
-       if (SHELL_OsIsUnicode())
-         return PathRemoveFileSpecW((LPWSTR)lpszPath);
-       return PathRemoveFileSpecA((LPSTR)lpszPath);
+    if (SHELL_OsIsUnicode())
+      return PathRemoveFileSpecW((LPWSTR)lpszPath);
+    return PathRemoveFileSpecA((LPSTR)lpszPath);
 }
 
 /*
-       Path Manipulations
+    Path Manipulations
 */
 
 /*************************************************************************
@@ -107,14 +107,14 @@ BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath)
  */
 static void PathGetShortPathA(LPSTR pszPath)
 {
-       CHAR path[MAX_PATH];
+    CHAR path[MAX_PATH];
 
-       TRACE("%s\n", pszPath);
+    TRACE("%s\n", pszPath);
 
-       if (GetShortPathNameA(pszPath, path, MAX_PATH))
-       {
-         lstrcpyA(pszPath, path);
-       }
+    if (GetShortPathNameA(pszPath, path, MAX_PATH))
+    {
+      lstrcpyA(pszPath, path);
+    }
 }
 
 /*************************************************************************
@@ -122,14 +122,14 @@ static void PathGetShortPathA(LPSTR pszPath)
  */
 static void PathGetShortPathW(LPWSTR pszPath)
 {
-       WCHAR path[MAX_PATH];
+    WCHAR path[MAX_PATH];
 
-       TRACE("%s\n", debugstr_w(pszPath));
+    TRACE("%s\n", debugstr_w(pszPath));
 
-       if (GetShortPathNameW(pszPath, path, MAX_PATH))
-       {
-         wcscpy(pszPath, path);
-       }
+    if (GetShortPathNameW(pszPath, path, MAX_PATH))
+    {
+      wcscpy(pszPath, path);
+    }
 }
 
 /*************************************************************************
@@ -137,175 +137,175 @@ static void PathGetShortPathW(LPWSTR pszPath)
  */
 EXTERN_C VOID WINAPI PathGetShortPathAW(LPVOID pszPath)
 {
-       if(SHELL_OsIsUnicode())
-         PathGetShortPathW((LPWSTR)pszPath);
-       PathGetShortPathA((LPSTR)pszPath);
+    if(SHELL_OsIsUnicode())
+      PathGetShortPathW((LPWSTR)pszPath);
+    PathGetShortPathA((LPSTR)pszPath);
 }
 
 /*
-       ########## Path Testing ##########
+    ########## Path Testing ##########
 */
 
 /*************************************************************************
- * PathIsRoot          [SHELL32.29]
+ * PathIsRoot        [SHELL32.29]
  */
 BOOL WINAPI PathIsRootAW(LPCVOID lpszPath)
 {
-       if (SHELL_OsIsUnicode())
-         return PathIsRootW((LPWSTR)lpszPath);
-       return PathIsRootA((LPSTR)lpszPath);
+    if (SHELL_OsIsUnicode())
+      return PathIsRootW((LPWSTR)lpszPath);
+    return PathIsRootA((LPSTR)lpszPath);
 }
 
 /*************************************************************************
- *  PathIsExeA         [internal]
+ *  PathIsExeA        [internal]
  */
 static BOOL PathIsExeA (LPCSTR lpszPath)
 {
-       LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
+    LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
         int i;
         static const char * const lpszExtensions[] =
             {"exe", "com", "pif", "cmd", "bat", "scf", "scr", NULL };
 
-       TRACE("path=%s\n",lpszPath);
+    TRACE("path=%s\n",lpszPath);
 
-       for(i=0; lpszExtensions[i]; i++)
-         if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
+    for(i=0; lpszExtensions[i]; i++)
+      if (!lstrcmpiA(lpszExtension,lpszExtensions[i])) return TRUE;
 
-       return FALSE;
+    return FALSE;
 }
 
 /*************************************************************************
- *  PathIsExeW         [internal]
+ *  PathIsExeW        [internal]
  */
 static BOOL PathIsExeW (LPCWSTR lpszPath)
 {
-       LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
+    LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
         int i;
         static const WCHAR lpszExtensions[][4] =
             {{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','f','\0'},
              {'c','m','d','\0'}, {'b','a','t','\0'}, {'s','c','f','\0'},
              {'s','c','r','\0'}, {'\0'} };
 
-       TRACE("path=%s\n",debugstr_w(lpszPath));
+    TRACE("path=%s\n",debugstr_w(lpszPath));
 
-       for(i=0; lpszExtensions[i][0]; i++)
-         if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
+    for(i=0; lpszExtensions[i][0]; i++)
+      if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
 
-       return FALSE;
+    return FALSE;
 }
 
 /*************************************************************************
- *  PathIsExe          [SHELL32.43]
+ *  PathIsExe        [SHELL32.43]
  */
 BOOL WINAPI PathIsExeAW (LPCVOID path)
 {
-       if (SHELL_OsIsUnicode())
-         return PathIsExeW ((LPWSTR)path);
-       return PathIsExeA((LPSTR)path);
+    if (SHELL_OsIsUnicode())
+      return PathIsExeW ((LPWSTR)path);
+    return PathIsExeA((LPSTR)path);
 }
 
 /*************************************************************************
- * PathFileExists      [SHELL32.45]
+ * PathFileExists    [SHELL32.45]
  */
 BOOL WINAPI PathFileExistsAW (LPCVOID lpszPath)
 {
-       if (SHELL_OsIsUnicode())
-         return PathFileExistsW ((LPWSTR)lpszPath);
-       return PathFileExistsA ((LPSTR)lpszPath);
+    if (SHELL_OsIsUnicode())
+      return PathFileExistsW ((LPWSTR)lpszPath);
+    return PathFileExistsA ((LPSTR)lpszPath);
 }
 
 /*************************************************************************
- * PathIsSameRoot      [SHELL32.650]
+ * PathIsSameRoot    [SHELL32.650]
  */
 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2)
 {
-       if (SHELL_OsIsUnicode())
-         return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2);
-       return PathIsSameRootA((LPCSTR)lpszPath1, (LPCSTR)lpszPath2);
+    if (SHELL_OsIsUnicode())
+      return PathIsSameRootW((LPCWSTR)lpszPath1, (LPCWSTR)lpszPath2);
+    return PathIsSameRootA((LPCSTR)lpszPath1, (LPCSTR)lpszPath2);
 }
 
 /*************************************************************************
- * IsLFNDriveA         [SHELL32.41]
+ * IsLFNDriveA        [SHELL32.41]
  */
 EXTERN_C BOOL WINAPI IsLFNDriveA(LPCSTR lpszPath)
 {
-    DWORD      fnlen;
+    DWORD    fnlen;
 
     if (!GetVolumeInformationA(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
-       return FALSE;
+    return FALSE;
     return fnlen > 12;
 }
 
 /*************************************************************************
- * IsLFNDriveW         [SHELL32.42]
+ * IsLFNDriveW        [SHELL32.42]
  */
 EXTERN_C BOOL WINAPI IsLFNDriveW(LPCWSTR lpszPath)
 {
-    DWORD      fnlen;
+    DWORD    fnlen;
 
     if (!GetVolumeInformationW(lpszPath, NULL, 0, NULL, &fnlen, NULL, NULL, 0))
-       return FALSE;
+    return FALSE;
     return fnlen > 12;
 }
 
 /*************************************************************************
- * IsLFNDrive          [SHELL32.119]
+ * IsLFNDrive        [SHELL32.119]
  */
 EXTERN_C BOOL WINAPI IsLFNDriveAW(LPCVOID lpszPath)
 {
-       if (SHELL_OsIsUnicode())
-         return IsLFNDriveW((LPCWSTR)lpszPath);
-       return IsLFNDriveA((LPCSTR)lpszPath);
+    if (SHELL_OsIsUnicode())
+      return IsLFNDriveW((LPCWSTR)lpszPath);
+    return IsLFNDriveA((LPCSTR)lpszPath);
 }
 
 /*
-       ########## Creating Something Unique ##########
+    ########## Creating Something Unique ##########
 */
 /*************************************************************************
- * PathMakeUniqueNameA [internal]
+ * PathMakeUniqueNameA    [internal]
  */
 BOOL WINAPI PathMakeUniqueNameA(
-       LPSTR lpszBuffer,
-       DWORD dwBuffSize,
-       LPCSTR lpszShortName,
-       LPCSTR lpszLongName,
-       LPCSTR lpszPathName)
+    LPSTR lpszBuffer,
+    DWORD dwBuffSize,
+    LPCSTR lpszShortName,
+    LPCSTR lpszLongName,
+    LPCSTR lpszPathName)
 {
-       FIXME("%p %u %s %s %s stub\n",
-        lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
-        debugstr_a(lpszLongName), debugstr_a(lpszPathName));
-       return TRUE;
+    FIXME("%p %u %s %s %s stub\n",
+     lpszBuffer, dwBuffSize, debugstr_a(lpszShortName),
+     debugstr_a(lpszLongName), debugstr_a(lpszPathName));
+    return TRUE;
 }
 
 /*************************************************************************
- * PathMakeUniqueNameW [internal]
+ * PathMakeUniqueNameW    [internal]
  */
 BOOL WINAPI PathMakeUniqueNameW(
-       LPWSTR lpszBuffer,
-       DWORD dwBuffSize,
-       LPCWSTR lpszShortName,
-       LPCWSTR lpszLongName,
-       LPCWSTR lpszPathName)
+    LPWSTR lpszBuffer,
+    DWORD dwBuffSize,
+    LPCWSTR lpszShortName,
+    LPCWSTR lpszLongName,
+    LPCWSTR lpszPathName)
 {
-       FIXME("%p %u %s %s %s stub\n",
-        lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
-        debugstr_w(lpszLongName), debugstr_w(lpszPathName));
-       return TRUE;
+    FIXME("%p %u %s %s %s stub\n",
+     lpszBuffer, dwBuffSize, debugstr_w(lpszShortName),
+     debugstr_w(lpszLongName), debugstr_w(lpszPathName));
+    return TRUE;
 }
 
 /*************************************************************************
- * PathMakeUniqueName  [SHELL32.47]
+ * PathMakeUniqueName    [SHELL32.47]
  */
 BOOL WINAPI PathMakeUniqueNameAW(
-       LPVOID lpszBuffer,
-       DWORD dwBuffSize,
-       LPCVOID lpszShortName,
-       LPCVOID lpszLongName,
-       LPCVOID lpszPathName)
+    LPVOID lpszBuffer,
+    DWORD dwBuffSize,
+    LPCVOID lpszShortName,
+    LPCVOID lpszLongName,
+    LPCVOID lpszPathName)
 {
-       if (SHELL_OsIsUnicode())
-         return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName);
-       return PathMakeUniqueNameA((LPSTR)lpszBuffer, dwBuffSize, (LPCSTR)lpszShortName, (LPCSTR)lpszLongName, (LPCSTR)lpszPathName);
+    if (SHELL_OsIsUnicode())
+      return PathMakeUniqueNameW((LPWSTR)lpszBuffer, dwBuffSize, (LPCWSTR)lpszShortName, (LPCWSTR)lpszLongName, (LPCWSTR)lpszPathName);
+    return PathMakeUniqueNameA((LPSTR)lpszBuffer, dwBuffSize, (LPCSTR)lpszShortName, (LPCSTR)lpszLongName, (LPCSTR)lpszPathName);
 }
 
 /*************************************************************************
@@ -315,10 +315,10 @@ BOOL WINAPI PathMakeUniqueNameAW(
  *     exported by ordinal
  */
 BOOL WINAPI PathYetAnotherMakeUniqueName(
-       LPWSTR lpszBuffer,
-       LPCWSTR lpszPathName,
-       LPCWSTR lpszShortName,
-       LPCWSTR lpszLongName)
+    LPWSTR lpszBuffer,
+    LPCWSTR lpszPathName,
+    LPCWSTR lpszShortName,
+    LPCWSTR lpszLongName)
 {
     FIXME("(%p, %s, %s ,%s):stub.\n",
           lpszBuffer, debugstr_w(lpszPathName), debugstr_w(lpszShortName), debugstr_w(lpszLongName));
@@ -327,11 +327,11 @@ BOOL WINAPI PathYetAnotherMakeUniqueName(
 
 
 /*
-       ########## cleaning and resolving paths ##########
+    ########## cleaning and resolving paths ##########
  */
 
 /*************************************************************************
- * PathCleanupSpec     [SHELL32.171]
+ * PathCleanupSpec    [SHELL32.171]
  *
  * lpszFile is changed in place.
  */
@@ -405,120 +405,120 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW )
 }
 
 /*************************************************************************
- * PathQualifyA                [SHELL32]
+ * PathQualifyA        [SHELL32]
  */
 BOOL WINAPI PathQualifyA(LPCSTR pszPath)
 {
-       FIXME("%s\n",pszPath);
-       return 0;
+    FIXME("%s\n",pszPath);
+    return 0;
 }
 
 /*************************************************************************
- * PathQualifyW                [SHELL32]
+ * PathQualifyW        [SHELL32]
  */
 BOOL WINAPI PathQualifyW(LPCWSTR pszPath)
 {
-       FIXME("%s\n",debugstr_w(pszPath));
-       return 0;
+    FIXME("%s\n",debugstr_w(pszPath));
+    return 0;
 }
 
 /*************************************************************************
- * PathQualify [SHELL32.49]
+ * PathQualify    [SHELL32.49]
  */
 BOOL WINAPI PathQualifyAW(LPCVOID pszPath)
 {
-       if (SHELL_OsIsUnicode())
-         return PathQualifyW((LPCWSTR)pszPath);
-       return PathQualifyA((LPCSTR)pszPath);
+    if (SHELL_OsIsUnicode())
+      return PathQualifyW((LPCWSTR)pszPath);
+    return PathQualifyA((LPCSTR)pszPath);
 }
 
 /*************************************************************************
  * PathResolveA [SHELL32.51]
  */
 BOOL WINAPI PathResolveA(
-       LPSTR lpszPath,
-       LPCSTR *alpszPaths,
-       DWORD dwFlags)
+    LPSTR lpszPath,
+    LPCSTR *alpszPaths,
+    DWORD dwFlags)
 {
-       FIXME("(%s,%p,0x%08x),stub!\n",
-         lpszPath, *alpszPaths, dwFlags);
-       return 0;
+    FIXME("(%s,%p,0x%08x),stub!\n",
+      lpszPath, *alpszPaths, dwFlags);
+    return 0;
 }
 
 /*************************************************************************
  * PathResolveW [SHELL32]
  */
 BOOL WINAPI PathResolveW(
-       LPWSTR lpszPath,
-       LPCWSTR *alpszPaths,
-       DWORD dwFlags)
+    LPWSTR lpszPath,
+    LPCWSTR *alpszPaths,
+    DWORD dwFlags)
 {
-       FIXME("(%s,%p,0x%08x),stub!\n",
-         debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
-       return 0;
+    FIXME("(%s,%p,0x%08x),stub!\n",
+      debugstr_w(lpszPath), debugstr_w(*alpszPaths), dwFlags);
+    return 0;
 }
 
 /*************************************************************************
  * PathResolve [SHELL32.51]
  */
 BOOL WINAPI PathResolveAW(
-       LPVOID lpszPath,
-       LPCVOID *alpszPaths,
-       DWORD dwFlags)
+    LPVOID lpszPath,
+    LPCVOID *alpszPaths,
+    DWORD dwFlags)
 {
-       if (SHELL_OsIsUnicode())
-         return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags);
-       return PathResolveA((LPSTR)lpszPath, (LPCSTR *)alpszPaths, dwFlags);
+    if (SHELL_OsIsUnicode())
+      return PathResolveW((LPWSTR)lpszPath, (LPCWSTR *)alpszPaths, dwFlags);
+    return PathResolveA((LPSTR)lpszPath, (LPCSTR *)alpszPaths, dwFlags);
 }
 
 /*************************************************************************
-*      PathProcessCommandA     [SHELL32.653]
+*    PathProcessCommandA    [SHELL32.653]
 */
 LONG WINAPI PathProcessCommandA (
-       LPCSTR lpszPath,
-       LPSTR lpszBuff,
-       DWORD dwBuffSize,
-       DWORD dwFlags)
+    LPCSTR lpszPath,
+    LPSTR lpszBuff,
+    DWORD dwBuffSize,
+    DWORD dwFlags)
 {
-       FIXME("%s %p 0x%04x 0x%04x stub\n",
-       lpszPath, lpszBuff, dwBuffSize, dwFlags);
-       if(!lpszPath) return -1;
-       if(lpszBuff) strcpy(lpszBuff, lpszPath);
-       return strlen(lpszPath);
+    FIXME("%s %p 0x%04x 0x%04x stub\n",
+    lpszPath, lpszBuff, dwBuffSize, dwFlags);
+    if(!lpszPath) return -1;
+    if(lpszBuff) strcpy(lpszBuff, lpszPath);
+    return strlen(lpszPath);
 }
 
 /*************************************************************************
-*      PathProcessCommandW
+*    PathProcessCommandW
 */
 LONG WINAPI PathProcessCommandW (
-       LPCWSTR lpszPath,
-       LPWSTR lpszBuff,
-       DWORD dwBuffSize,
-       DWORD dwFlags)
+    LPCWSTR lpszPath,
+    LPWSTR lpszBuff,
+    DWORD dwBuffSize,
+    DWORD dwFlags)
 {
-       FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
-       debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
-       if(!lpszPath) return -1;
-       if(lpszBuff) wcscpy(lpszBuff, lpszPath);
-       return wcslen(lpszPath);
+    FIXME("(%s, %p, 0x%04x, 0x%04x) stub\n",
+    debugstr_w(lpszPath), lpszBuff, dwBuffSize, dwFlags);
+    if(!lpszPath) return -1;
+    if(lpszBuff) wcscpy(lpszBuff, lpszPath);
+    return wcslen(lpszPath);
 }
 
 /*************************************************************************
-*      PathProcessCommand (SHELL32.653)
+*    PathProcessCommand (SHELL32.653)
 */
 LONG WINAPI PathProcessCommandAW (
-       LPCVOID lpszPath,
-       LPVOID lpszBuff,
-       DWORD dwBuffSize,
-       DWORD dwFlags)
+    LPCVOID lpszPath,
+    LPVOID lpszBuff,
+    DWORD dwBuffSize,
+    DWORD dwFlags)
 {
-       if (SHELL_OsIsUnicode())
-         return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags);
-       return PathProcessCommandA((LPCSTR)lpszPath, (LPSTR)lpszBuff, dwBuffSize, dwFlags);
+    if (SHELL_OsIsUnicode())
+      return PathProcessCommandW((LPCWSTR)lpszPath, (LPWSTR)lpszBuff, dwBuffSize, dwFlags);
+    return PathProcessCommandA((LPCSTR)lpszPath, (LPSTR)lpszBuff, dwBuffSize, dwFlags);
 }
 
 /*
-       ########## special ##########
+    ########## special ##########
 */
 
 static const WCHAR szCurrentVersion[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\0'};
@@ -1011,9 +1011,9 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
  */
 static HRESULT _SHGetDefaultValue(BYTE folder, LPWSTR pszPath)
 {
-       DWORD dwSize;
+    DWORD dwSize;
     HRESULT hr;
-       HKEY hKey;
+    HKEY hKey;
     WCHAR resourcePath[MAX_PATH];
     LPCWSTR pDefaultPath = NULL;
 
@@ -1262,7 +1262,7 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
 }
 
 /*************************************************************************
- * SHGetFolderPathW                    [SHELL32.@]
+ * SHGetFolderPathW            [SHELL32.@]
  *
  * Convert nFolder to path.
  *
@@ -1282,11 +1282,11 @@ static HRESULT _SHGetAllUsersProfilePath(DWORD dwFlags, BYTE folder,
  * Furthermore, the HKCU paths take precedence over the HKLM paths.
  */
 HRESULT WINAPI SHGetFolderPathW(
-       HWND hwndOwner,    /* [I] owner window */
-       int nFolder,       /* [I] CSIDL identifying the folder */
-       HANDLE hToken,     /* [I] access token */
-       DWORD dwFlags,     /* [I] which path to return */
-       LPWSTR pszPath)    /* [O] converted path */
+    HWND hwndOwner,    /* [I] owner window */
+    int nFolder,       /* [I] CSIDL identifying the folder */
+    HANDLE hToken,     /* [I] access token */
+    DWORD dwFlags,     /* [I] which path to return */
+    LPWSTR pszPath)    /* [O] converted path */
 {
     HRESULT hr =  SHGetFolderPathAndSubDirW(hwndOwner, nFolder, hToken, dwFlags, NULL, pszPath);
     if(HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND) == hr)
@@ -1295,12 +1295,12 @@ HRESULT WINAPI SHGetFolderPathW(
 }
 
 HRESULT WINAPI SHGetFolderPathAndSubDirA(
-       HWND hwndOwner,    /* [I] owner window */
-       int nFolder,       /* [I] CSIDL identifying the folder */
-       HANDLE hToken,     /* [I] access token */
-       DWORD dwFlags,     /* [I] which path to return */
-       LPCSTR pszSubPath, /* [I] sub directory of the specified folder */
-       LPSTR pszPath)     /* [O] converted path */
+    HWND hwndOwner,    /* [I] owner window */
+    int nFolder,       /* [I] CSIDL identifying the folder */
+    HANDLE hToken,     /* [I] access token */
+    DWORD dwFlags,     /* [I] which path to return */
+    LPCSTR pszSubPath, /* [I] sub directory of the specified folder */
+    LPSTR pszPath)     /* [O] converted path */
 {
     int length;
     HRESULT hr = S_OK;
@@ -1343,12 +1343,12 @@ cleanup:
 }
 
 HRESULT WINAPI SHGetFolderPathAndSubDirW(
-       HWND hwndOwner,    /* [I] owner window */
-       int nFolder,       /* [I] CSIDL identifying the folder */
-       HANDLE hToken,     /* [I] access token */
-       DWORD dwFlags,     /* [I] which path to return */
-       LPCWSTR pszSubPath,/* [I] sub directory of the specified folder */
-       LPWSTR pszPath)    /* [O] converted path */
+    HWND hwndOwner,    /* [I] owner window */
+    int nFolder,       /* [I] CSIDL identifying the folder */
+    HANDLE hToken,     /* [I] access token */
+    DWORD dwFlags,     /* [I] which path to return */
+    LPCWSTR pszSubPath,/* [I] sub directory of the specified folder */
+    LPWSTR pszPath)    /* [O] converted path */
 {
     HRESULT    hr;
     WCHAR      szBuildPath[MAX_PATH], szTemp[MAX_PATH];
@@ -1478,16 +1478,16 @@ end:
 }
 
 /*************************************************************************
- * SHGetFolderPathA                    [SHELL32.@]
+ * SHGetFolderPathA            [SHELL32.@]
  *
  * See SHGetFolderPathW.
  */
 HRESULT WINAPI SHGetFolderPathA(
-       HWND hwndOwner,
-       int nFolder,
-       HANDLE hToken,
-       DWORD dwFlags,
-       LPSTR pszPath)
+    HWND hwndOwner,
+    int nFolder,
+    HANDLE hToken,
+    DWORD dwFlags,
+    LPSTR pszPath)
 {
     WCHAR szTemp[MAX_PATH];
     HRESULT hr;
@@ -1872,34 +1872,34 @@ HRESULT SHELL_RegisterShellFolders(void)
  * SHGetSpecialFolderPathA [SHELL32.@]
  */
 BOOL WINAPI SHGetSpecialFolderPathA (
-       HWND hwndOwner,
-       LPSTR szPath,
-       int nFolder,
-       BOOL bCreate)
+    HWND hwndOwner,
+    LPSTR szPath,
+    int nFolder,
+    BOOL bCreate)
 {
-       return (SHGetFolderPathA(
-               hwndOwner,
-               nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
-               NULL,
-               0,
-               szPath)) == S_OK ? TRUE : FALSE;
+    return (SHGetFolderPathA(
+        hwndOwner,
+        nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
+        NULL,
+        0,
+        szPath)) == S_OK ? TRUE : FALSE;
 }
 
 /*************************************************************************
  * SHGetSpecialFolderPathW
  */
 BOOL WINAPI SHGetSpecialFolderPathW (
-       HWND hwndOwner,
-       LPWSTR szPath,
-       int nFolder,
-       BOOL bCreate)
+    HWND hwndOwner,
+    LPWSTR szPath,
+    int nFolder,
+    BOOL bCreate)
 {
-       return (SHGetFolderPathW(
-               hwndOwner,
-               nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
-               NULL,
-               0,
-               szPath)) == S_OK ? TRUE : FALSE;
+    return (SHGetFolderPathW(
+        hwndOwner,
+        nFolder + (bCreate ? CSIDL_FLAG_CREATE : 0),
+        NULL,
+        0,
+        szPath)) == S_OK ? TRUE : FALSE;
 }
 
 /*************************************************************************
@@ -1925,11 +1925,11 @@ BOOL WINAPI SHGetSpecialFolderPathW (
  *  virtual folders that are handled here.
  */
 HRESULT WINAPI SHGetFolderLocation(
-       HWND hwndOwner,
-       int nFolder,
-       HANDLE hToken,
-       DWORD dwReserved,
-       LPITEMIDLIST *ppidl)
+    HWND hwndOwner,
+    int nFolder,
+    HANDLE hToken,
+    DWORD dwReserved,
+    LPITEMIDLIST *ppidl)
 {
     HRESULT hr = E_INVALIDARG;
 
@@ -2007,16 +2007,16 @@ HRESULT WINAPI SHGetFolderLocation(
 }
 
 /*************************************************************************
- * SHGetSpecialFolderLocation          [SHELL32.@]
+ * SHGetSpecialFolderLocation        [SHELL32.@]
  *
  * NOTES
  *   In NT5, SHGetSpecialFolderLocation needs the <winntdir>/Recent
  *   directory.
  */
 HRESULT WINAPI SHGetSpecialFolderLocation(
-       HWND hwndOwner,
-       INT nFolder,
-       LPITEMIDLIST * ppidl)
+    HWND hwndOwner,
+    INT nFolder,
+    LPITEMIDLIST * ppidl)
 {
     HRESULT hr = E_INVALIDARG;
 
index 5cd665f..b63eabc 100644 (file)
 WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /*************************************************************************
- * SHRegOpenKeyA                               [SHELL32.506]
+ * SHRegOpenKeyA                [SHELL32.506]
  *
  */
 EXTERN_C HRESULT WINAPI SHRegOpenKeyA(
-       HKEY hKey,
-       LPSTR lpSubKey,
-       PHKEY phkResult)
+    HKEY hKey,
+    LPSTR lpSubKey,
+    PHKEY phkResult)
 {
-       TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
-       return RegOpenKeyA(hKey, lpSubKey, phkResult);
+    TRACE("(%p, %s, %p)\n", hKey, debugstr_a(lpSubKey), phkResult);
+    return RegOpenKeyA(hKey, lpSubKey, phkResult);
 }
 
 /*************************************************************************
- * SHRegOpenKeyW                               [SHELL32.507] NT 4.0
+ * SHRegOpenKeyW                [SHELL32.507] NT 4.0
  *
  */
 EXTERN_C HRESULT WINAPI SHRegOpenKeyW (
-       HKEY hkey,
-       LPCWSTR lpszSubKey,
-       PHKEY retkey)
+    HKEY hkey,
+    LPCWSTR lpszSubKey,
+    PHKEY retkey)
 {
-       WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
-       return RegOpenKeyW( hkey, lpszSubKey, retkey );
+    WARN("%p %s %p\n",hkey,debugstr_w(lpszSubKey),retkey);
+    return RegOpenKeyW( hkey, lpszSubKey, retkey );
 }
 
 /*************************************************************************
@@ -54,8 +54,8 @@ EXTERN_C HRESULT WINAPI SHRegOpenKeyW (
  */
 EXTERN_C HRESULT WINAPI SHRegQueryValueA(HKEY hkey, LPSTR lpSubKey, LPSTR lpValue, LPDWORD lpcbValue)
 {
-       TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
-       return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
+    TRACE("(%p %s %p %p)\n", hkey, debugstr_a(lpSubKey), lpValue, lpcbValue);
+    return RegQueryValueA(hkey, lpSubKey, lpValue, (LONG*)lpcbValue);
 }
 
 /*************************************************************************
@@ -63,82 +63,82 @@ EXTERN_C HRESULT WINAPI SHRegQueryValueA(HKEY hkey, LPSTR lpSubKey, LPSTR lpValu
  *
  */
 EXTERN_C HRESULT WINAPI SHRegQueryValueExA(
-       HKEY hkey,
-       LPSTR lpValueName,
-       LPDWORD lpReserved,
-       LPDWORD lpType,
-       LPBYTE lpData,
-       LPDWORD lpcbData)
+    HKEY hkey,
+    LPSTR lpValueName,
+    LPDWORD lpReserved,
+    LPDWORD lpType,
+    LPBYTE lpData,
+    LPDWORD lpcbData)
 {
-       TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
-       return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
+    TRACE("%p %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
+    return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
 }
 
 /*************************************************************************
- * SHRegQueryValueW                            [SHELL32.510] NT4.0
+ * SHRegQueryValueW                [SHELL32.510] NT4.0
  *
  */
 EXTERN_C HRESULT WINAPI SHRegQueryValueW(
-       HKEY hkey,
-       LPWSTR lpszSubKey,
-       LPWSTR lpszData,
-       LPDWORD lpcbData )
+    HKEY hkey,
+    LPWSTR lpszSubKey,
+    LPWSTR lpszData,
+    LPDWORD lpcbData )
 {
-       WARN("%p %s %p %p semi-stub\n",
-               hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
-       return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
+    WARN("%p %s %p %p semi-stub\n",
+        hkey, debugstr_w(lpszSubKey), lpszData, lpcbData);
+    return RegQueryValueW( hkey, lpszSubKey, lpszData, (LONG*)lpcbData );
 }
 
 /*************************************************************************
- * SHRegQueryValueExW  [SHELL32.511] NT4.0
+ * SHRegQueryValueExW    [SHELL32.511] NT4.0
  *
  * FIXME
  *  if the datatype REG_EXPAND_SZ then expand the string and change
  *  *pdwType to REG_SZ.
  */
 EXTERN_C HRESULT WINAPI SHRegQueryValueExW (
-       HKEY hkey,
-       LPWSTR pszValue,
-       LPDWORD pdwReserved,
-       LPDWORD pdwType,
-       LPVOID pvData,
-       LPDWORD pcbData)
+    HKEY hkey,
+    LPWSTR pszValue,
+    LPDWORD pdwReserved,
+    LPDWORD pdwType,
+    LPVOID pvData,
+    LPDWORD pcbData)
 {
-       DWORD ret;
-       WARN("%p %s %p %p %p %p semi-stub\n",
-               hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
-       ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, (LPBYTE)pvData, pcbData);
-       return ret;
+    DWORD ret;
+    WARN("%p %s %p %p %p %p semi-stub\n",
+        hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
+    ret = RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, (LPBYTE)pvData, pcbData);
+    return ret;
 }
 
 /*************************************************************************
  * SHRegDeleteKeyA   [SHELL32.?]
  */
 HRESULT WINAPI SHRegDeleteKeyA(
-       HKEY hkey,
-       LPCSTR pszSubKey)
+    HKEY hkey,
+    LPCSTR pszSubKey)
 {
-       FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
-       return 0;
+    FIXME("hkey=%p, %s\n", hkey, debugstr_a(pszSubKey));
+    return 0;
 }
 
 /*************************************************************************
  * SHRegDeleteKeyW   [SHELL32.512]
  */
 EXTERN_C HRESULT WINAPI SHRegDeleteKeyW(
-       HKEY hkey,
-       LPCWSTR pszSubKey)
+    HKEY hkey,
+    LPCWSTR pszSubKey)
 {
-       FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
-       return 0;
+    FIXME("hkey=%p, %s\n", hkey, debugstr_w(pszSubKey));
+    return 0;
 }
 
 /*************************************************************************
- * SHRegCloseKey                       [SHELL32.505] NT 4.0
+ * SHRegCloseKey            [SHELL32.505] NT 4.0
  *
  */
 EXTERN_C HRESULT WINAPI SHRegCloseKey (HKEY hkey)
 {
-       TRACE("%p\n",hkey);
-       return RegCloseKey( hkey );
+    TRACE("%p\n",hkey);
+    return RegCloseKey( hkey );
 }
index 073270a..b283a00 100644 (file)
@@ -24,82 +24,82 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
 {
-       TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
-           dest,len,src,
-           (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
-           (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
-           (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
-           pidl);
+    TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
+        dest,len,src,
+        (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
+        (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
+        (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
+        pidl);
 
     if (!dest)
         return FALSE;
 
-       switch (src->uType)
-       {
-         case STRRET_WSTR:
-           WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL);
-           CoTaskMemFree(src->pOleStr);
-           break;
-
-         case STRRET_CSTR:
-           lstrcpynA(dest, src->cStr, len);
-           break;
-
-         case STRRET_OFFSET:
-           lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len);
-           break;
-
-         default:
-           FIXME("unknown type!\n");
-           if (len) *dest = '\0';
-           return FALSE;
-       }
-       TRACE("-- %s\n", debugstr_a(dest) );
-       return TRUE;
+    switch (src->uType)
+    {
+      case STRRET_WSTR:
+        WideCharToMultiByte(CP_ACP, 0, src->pOleStr, -1, dest, len, NULL, NULL);
+        CoTaskMemFree(src->pOleStr);
+        break;
+
+      case STRRET_CSTR:
+        lstrcpynA(dest, src->cStr, len);
+        break;
+
+      case STRRET_OFFSET:
+        lstrcpynA(dest, ((LPCSTR)&pidl->mkid)+src->uOffset, len);
+        break;
+
+      default:
+        FIXME("unknown type!\n");
+        if (len) *dest = '\0';
+        return FALSE;
+    }
+    TRACE("-- %s\n", debugstr_a(dest) );
+    return TRUE;
 }
 
 /************************************************************************/
 
 BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
 {
-       TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
-           dest,len,src,
-           (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
-           (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
-           (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
-           pidl);
+    TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
+        dest,len,src,
+        (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
+        (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
+        (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
+        pidl);
 
     if (!dest)
         return FALSE;
 
-       switch (src->uType)
-       {
-         case STRRET_WSTR:
-           lstrcpynW(dest, src->pOleStr, len);
-           CoTaskMemFree(src->pOleStr);
-           break;
+    switch (src->uType)
+    {
+      case STRRET_WSTR:
+        lstrcpynW(dest, src->pOleStr, len);
+        CoTaskMemFree(src->pOleStr);
+        break;
 
-         case STRRET_CSTR:
+      case STRRET_CSTR:
             if (!MultiByteToWideChar( CP_ACP, 0, src->cStr, -1, dest, len ) && len)
                   dest[len-1] = 0;
-           break;
+        break;
 
-         case STRRET_OFFSET:
+      case STRRET_OFFSET:
             if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->uOffset, -1, dest, len ) && len)
                   dest[len-1] = 0;
-           break;
-
-         default:
-           FIXME("unknown type!\n");
-           if (len) *dest = '\0';
-           return FALSE;
-       }
-       return TRUE;
+        break;
+
+      default:
+        FIXME("unknown type!\n");
+        if (len) *dest = '\0';
+        return FALSE;
+    }
+    return TRUE;
 }
 
 
 /*************************************************************************
- * StrRetToStrN                                [SHELL32.96]
+ * StrRetToStrN                [SHELL32.96]
  *
  * converts a STRRET to a normal string
  *
@@ -108,7 +108,7 @@ BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
  */
 EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
 {
-       if(SHELL_OsIsUnicode())
+    if(SHELL_OsIsUnicode())
         return StrRetToStrNW((LPWSTR)dest, len, src, pidl);
     else
         return StrRetToStrNA((LPSTR)dest, len, src, pidl);
@@ -117,84 +117,84 @@ EXTERN_C BOOL WINAPI StrRetToStrNAW(LPVOID dest, DWORD len, LPSTRRET src, const
 /************************* OLESTR functions ****************************/
 
 /************************************************************************
- *     StrToOleStr                     [SHELL32.163]
+ *    StrToOleStr            [SHELL32.163]
  *
  */
 int WINAPI StrToOleStrA (LPWSTR lpWideCharStr, LPCSTR lpMultiByteString)
 {
-       TRACE("(%p, %p %s)\n",
-       lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
+    TRACE("(%p, %p %s)\n",
+    lpWideCharStr, lpMultiByteString, debugstr_a(lpMultiByteString));
 
-       return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
+    return MultiByteToWideChar(0, 0, lpMultiByteString, -1, lpWideCharStr, MAX_PATH);
 
 }
 int WINAPI StrToOleStrW (LPWSTR lpWideCharStr, LPCWSTR lpWString)
 {
-       TRACE("(%p, %p %s)\n",
-       lpWideCharStr, lpWString, debugstr_w(lpWString));
+    TRACE("(%p, %p %s)\n",
+    lpWideCharStr, lpWString, debugstr_w(lpWString));
 
-       wcscpy (lpWideCharStr, lpWString );
-       return wcslen(lpWideCharStr);
+    wcscpy (lpWideCharStr, lpWString );
+    return wcslen(lpWideCharStr);
 }
 
 EXTERN_C BOOL WINAPI StrToOleStrAW (LPWSTR lpWideCharStr, LPCVOID lpString)
 {
-       if (SHELL_OsIsUnicode())
-         return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
-       return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
+    if (SHELL_OsIsUnicode())
+      return StrToOleStrW (lpWideCharStr, (LPCWSTR)lpString);
+    return StrToOleStrA (lpWideCharStr, (LPCSTR)lpString);
 }
 
 /*************************************************************************
- * StrToOleStrN                                        [SHELL32.79]
+ * StrToOleStrN                    [SHELL32.79]
  *  lpMulti, nMulti, nWide [IN]
  *  lpWide [OUT]
  */
 BOOL WINAPI StrToOleStrNA (LPWSTR lpWide, INT nWide, LPCSTR lpStrA, INT nStr)
 {
-       TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
-       return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
+    TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_an(lpStrA,nStr), nStr);
+    return MultiByteToWideChar (0, 0, lpStrA, nStr, lpWide, nWide);
 }
 BOOL WINAPI StrToOleStrNW (LPWSTR lpWide, INT nWide, LPCWSTR lpStrW, INT nStr)
 {
-       TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
+    TRACE("(%p, %x, %s, %x)\n", lpWide, nWide, debugstr_wn(lpStrW, nStr), nStr);
 
-       if (lstrcpynW (lpWide, lpStrW, nWide))
-       { return wcslen (lpWide);
-       }
-       return 0;
+    if (lstrcpynW (lpWide, lpStrW, nWide))
+    { return wcslen (lpWide);
+    }
+    return 0;
 }
 
 EXTERN_C BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr)
 {
-       if (SHELL_OsIsUnicode())
-         return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr);
-       return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr);
+    if (SHELL_OsIsUnicode())
+      return StrToOleStrNW (lpWide, nWide, (LPCWSTR)lpStr, nStr);
+    return StrToOleStrNA (lpWide, nWide, (LPCSTR)lpStr, nStr);
 }
 
 /*************************************************************************
- * OleStrToStrN                                        [SHELL32.78]
+ * OleStrToStrN                    [SHELL32.78]
  */
 BOOL WINAPI OleStrToStrNA (LPSTR lpStr, INT nStr, LPCWSTR lpOle, INT nOle)
 {
-       TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
-       return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
+    TRACE("(%p, %x, %s, %x)\n", lpStr, nStr, debugstr_wn(lpOle,nOle), nOle);
+    return WideCharToMultiByte (0, 0, lpOle, nOle, lpStr, nStr, NULL, NULL);
 }
 
 BOOL WINAPI OleStrToStrNW (LPWSTR lpwStr, INT nwStr, LPCWSTR lpOle, INT nOle)
 {
-       TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
+    TRACE("(%p, %x, %s, %x)\n", lpwStr, nwStr, debugstr_wn(lpOle,nOle), nOle);
 
-       if (lstrcpynW ( lpwStr, lpOle, nwStr))
-       { return wcslen (lpwStr);
-       }
-       return 0;
+    if (lstrcpynW ( lpwStr, lpOle, nwStr))
+    { return wcslen (lpwStr);
+    }
+    return 0;
 }
 
 EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
 {
-       if (SHELL_OsIsUnicode())
-         return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
-       return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
+    if (SHELL_OsIsUnicode())
+      return OleStrToStrNW ((LPWSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
+    return OleStrToStrNA ((LPSTR)lpOut, nOut, (LPCWSTR)lpIn, nIn);
 }
 
 
@@ -215,22 +215,22 @@ EXTERN_C BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT n
  *  Not really sure if this function returns actually a value at all.
  */
 DWORD WINAPI CheckEscapesA(
-       LPSTR   string,         /* [I/O]   string to check ??*/
-       DWORD   len)            /* [I]      is 0 */
+    LPSTR    string,         /* [I/O]   string to check ??*/
+    DWORD    len)            /* [I]      is 0 */
 {
-       LPWSTR wString;
-       DWORD ret = 0;
-
-       TRACE("(%s %d)\n", debugstr_a(string), len);
-       wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
-       if (wString)
-       {
-         MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
-         ret = CheckEscapesW(wString, len);
-         WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL);
-         LocalFree(wString);
-       }
-       return ret;
+    LPWSTR wString;
+    DWORD ret = 0;
+
+    TRACE("(%s %d)\n", debugstr_a(string), len);
+    wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
+    if (wString)
+    {
+      MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);
+      ret = CheckEscapesW(wString, len);
+      WideCharToMultiByte(CP_ACP, 0, wString, len, string, len, NULL, NULL);
+      LocalFree(wString);
+    }
+    return ret;
 }
 
 static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
@@ -241,24 +241,24 @@ static const WCHAR strEscapedChars[] = {' ','"',',',';','^',0};
  * See CheckEscapesA.
  */
 DWORD WINAPI CheckEscapesW(
-       LPWSTR  string,
-       DWORD   len)
+    LPWSTR    string,
+    DWORD    len)
 {
-       DWORD size = wcslen(string);
-       LPWSTR s, d;
-
-       TRACE("(%s %d) stub\n", debugstr_w(string), len);
-
-       if (StrPBrkW(string, strEscapedChars) && size + 2 <= len)
-       {
-         s = &string[size - 1];
-         d = &string[size + 2];
-         *d-- = 0;
-         *d-- = '"';
-         for (;d > string;)
-           *d-- = *s--;
-         *d = '"';
-         return size + 2;
-       }
-       return size;
+    DWORD size = wcslen(string);
+    LPWSTR s, d;
+
+    TRACE("(%s %d) stub\n", debugstr_w(string), len);
+
+    if (StrPBrkW(string, strEscapedChars) && size + 2 <= len)
+    {
+      s = &string[size - 1];
+      d = &string[size + 2];
+      *d-- = 0;
+      *d-- = '"';
+      for (;d > string;)
+        *d-- = *s--;
+      *d = '"';
+      return size + 2;
+    }
+    return size;
 }
index e9762f3..8c056c6 100644 (file)
@@ -38,16 +38,16 @@ This folder should not exist. It is just a file system folder...
  */
 
 class CDesktopFolderEnumY :
-       public IEnumIDListImpl
+    public IEnumIDListImpl
 {
 private:
 public:
-       CDesktopFolderEnumY();
-       ~CDesktopFolderEnumY();
-       HRESULT WINAPI Initialize(LPWSTR szTarget, DWORD dwFlags);
+    CDesktopFolderEnumY();
+    ~CDesktopFolderEnumY();
+    HRESULT WINAPI Initialize(LPWSTR szTarget, DWORD dwFlags);
 
 BEGIN_COM_MAP(CDesktopFolderEnumY)
-       COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
+    COM_INTERFACE_ENTRY_IID(IID_IEnumIDList, IEnumIDList)
 END_COM_MAP()
 };
 
@@ -82,34 +82,34 @@ HRESULT WINAPI CDesktopFolderEnumY::Initialize(LPWSTR szTarget, DWORD dwFlags)
 
 CAdminToolsFolder::CAdminToolsFolder()
 {
-       pclsid = NULL;
+    pclsid = NULL;
 
-       pidlRoot = NULL;  /* absolute pidl */
-       szTarget = NULL;
+    pidlRoot = NULL;  /* absolute pidl */
+    szTarget = NULL;
 
-       dwAttributes = 0;        /* attributes returned by GetAttributesOf FIXME: use it */
+    dwAttributes = 0;        /* attributes returned by GetAttributesOf FIXME: use it */
 }
 
 CAdminToolsFolder::~CAdminToolsFolder()
 {
-       TRACE ("-- destroying IShellFolder(%p)\n", this);
-       if (pidlRoot)
-               SHFree(pidlRoot);
-       HeapFree(GetProcessHeap(), 0, szTarget);
+    TRACE ("-- destroying IShellFolder(%p)\n", this);
+    if (pidlRoot)
+        SHFree(pidlRoot);
+    HeapFree(GetProcessHeap(), 0, szTarget);
 }
 
 HRESULT WINAPI CAdminToolsFolder::FinalConstruct()
 {
-       szTarget = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
-       if (szTarget == NULL)
-               return E_OUTOFMEMORY;
-       if (!SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_COMMON_ADMINTOOLS, FALSE))
-               return E_FAIL;
-
-       pidlRoot = _ILCreateAdminTools();    /* my qualified pidl */
-       if (pidlRoot == NULL)
-               return E_OUTOFMEMORY;
-       return S_OK;
+    szTarget = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR));
+    if (szTarget == NULL)
+        return E_OUTOFMEMORY;
+    if (!SHGetSpecialFolderPathW(NULL, szTarget, CSIDL_COMMON_ADMINTOOLS, FALSE))
+        return E_FAIL;
+
+    pidlRoot = _ILCreateAdminTools();    /* my qualified pidl */
+    if (pidlRoot == NULL)
+        return E_OUTOFMEMORY;
+    return S_OK;
 }
 
 /**************************************************************************
@@ -127,7 +127,7 @@ HRESULT WINAPI CAdminToolsFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LP
     if (pchEaten)
         *pchEaten = 0;
 
-       MessageBoxW(NULL, lpszDisplayName, L"ParseDisplayName", MB_OK);
+    MessageBoxW(NULL, lpszDisplayName, L"ParseDisplayName", MB_OK);
 
     return E_NOTIMPL;
 }
@@ -137,32 +137,32 @@ HRESULT WINAPI CAdminToolsFolder::ParseDisplayName (HWND hwndOwner, LPBC pbc, LP
  */
 HRESULT WINAPI CAdminToolsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 {
-       CComObject<CDesktopFolderEnumY>                 *theEnumerator;
-       CComPtr<IEnumIDList>                                    result;
-       HRESULT                                                                 hResult;
-
-       TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
-
-       if (ppEnumIDList == NULL)
-               return E_POINTER;
-       *ppEnumIDList = NULL;
-       ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>);
-       if (theEnumerator == NULL)
-               return E_OUTOFMEMORY;
-       hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
-       if (FAILED (hResult))
-       {
-               delete theEnumerator;
-               return hResult;
-       }
-       hResult = theEnumerator->Initialize (szTarget, dwFlags);
-       if (FAILED (hResult))
-               return hResult;
-       *ppEnumIDList = result.Detach ();
+    CComObject<CDesktopFolderEnumY>            *theEnumerator;
+    CComPtr<IEnumIDList>                    result;
+    HRESULT                                    hResult;
+
+    TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList);
+
+    if (ppEnumIDList == NULL)
+        return E_POINTER;
+    *ppEnumIDList = NULL;
+    ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>);
+    if (theEnumerator == NULL)
+        return E_OUTOFMEMORY;
+    hResult = theEnumerator->QueryInterface (IID_IEnumIDList, (void **)&result);
+    if (FAILED (hResult))
+    {
+        delete theEnumerator;
+        return hResult;
+    }
+    hResult = theEnumerator->Initialize (szTarget, dwFlags);
+    if (FAILED (hResult))
+        return hResult;
+    *ppEnumIDList = result.Detach ();
 
     TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList);
 
-       return S_OK;
+    return S_OK;
 }
 
 /**************************************************************************
@@ -206,8 +206,8 @@ HRESULT WINAPI CAdminToolsFolder::CompareIDs(LPARAM lParam, LPCITEMIDLIST pidl1,
  */
 HRESULT WINAPI CAdminToolsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
 {
-    CComPtr<IShellView>                                        pShellView;
-    HRESULT                                                            hr = E_INVALIDARG;
+    CComPtr<IShellView>                    pShellView;
+    HRESULT                                hr = E_INVALIDARG;
 
     TRACE ("(%p)->(hwnd=%p,%s,%p)\n", this,
             hwndOwner, shdebugstr_guid (&riid), ppvO