SHELL32: remove tabs and reformat

Mike McCormack mike at codeweavers.com
Wed Feb 23 01:18:35 CST 2005


ChangeLog:
* remove tabs and reformat
-------------- next part --------------
Index: dlls/shell32/shfldr_mycomp.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/shfldr_mycomp.c,v
retrieving revision 1.29
diff -u -p -w -r1.29 shfldr_mycomp.c
--- dlls/shell32/shfldr_mycomp.c	14 Jan 2005 16:02:20 -0000	1.29
+++ dlls/shell32/shfldr_mycomp.c	23 Feb 2005 07:18:50 -0000
@@ -1,4 +1,3 @@
-
 /*
  *	Virtual Workplace folder
  *
@@ -109,7 +108,7 @@ HRESULT WINAPI ISF_MyComputer_Constructo
     if (pUnkOuter)
 	return CLASS_E_NOAGGREGATION;
 
-    sf = (IGenericSFImpl *) LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
+    sf = LocalAlloc (GMEM_ZEROINIT, sizeof (IGenericSFImpl));
     if (!sf)
 	return E_OUTOFMEMORY;
 
@@ -118,7 +117,8 @@ HRESULT WINAPI ISF_MyComputer_Constructo
     sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
     sf->pidlRoot = _ILCreateMyComputer ();	/* my qualified pidl */
 
-    if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv))) {
+    if (!SUCCEEDED (IUnknown_QueryInterface (_IUnknown_ (sf), riid, ppv)))
+    {
 	IUnknown_Release (_IUnknown_ (sf));
 	return E_NOINTERFACE;
     }
@@ -132,7 +132,8 @@ HRESULT WINAPI ISF_MyComputer_Constructo
  *
  * NOTES supports not IPersist/IPersistFolder
  */
-static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
+static HRESULT WINAPI ISF_MyComputer_fnQueryInterface (IShellFolder2 *iface,
+               REFIID riid, LPVOID *ppvObj)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
@@ -141,14 +142,20 @@ static HRESULT WINAPI ISF_MyComputer_fnQ
     *ppvObj = NULL;
 
     if (IsEqualIID (riid, &IID_IUnknown) ||
-	IsEqualIID (riid, &IID_IShellFolder) || IsEqualIID (riid, &IID_IShellFolder2)) {
+        IsEqualIID (riid, &IID_IShellFolder) ||
+        IsEqualIID (riid, &IID_IShellFolder2))
+    {
 	*ppvObj = This;
-    } else if (IsEqualIID (riid, &IID_IPersist) ||
-	       IsEqualIID (riid, &IID_IPersistFolder) || IsEqualIID (riid, &IID_IPersistFolder2)) {
+    }
+    else if (IsEqualIID (riid, &IID_IPersist) ||
+             IsEqualIID (riid, &IID_IPersistFolder) ||
+             IsEqualIID (riid, &IID_IPersistFolder2))
+    {
 	*ppvObj = _IPersistFolder2_ (This);
     }
 
-    if (*ppvObj) {
+    if (*ppvObj)
+    {
 	IUnknown_AddRef ((IUnknown *) (*ppvObj));
 	TRACE ("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj);
 	return S_OK;
@@ -174,7 +181,8 @@ static ULONG WINAPI ISF_MyComputer_fnRel
 
     TRACE ("(%p)->(count=%lu)\n", This, refCount + 1);
 
-    if (!refCount) {
+    if (!refCount)
+    {
         TRACE ("-- destroying IShellFolder(%p)\n", This);
         if (This->pidlRoot)
             SHFree (This->pidlRoot);
@@ -186,48 +194,53 @@ static ULONG WINAPI ISF_MyComputer_fnRel
 /**************************************************************************
 *	ISF_MyComputer_fnParseDisplayName
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnParseDisplayName (IShellFolder2 * iface,
-				   HWND hwndOwner,
-				   LPBC pbc,
-				   LPOLESTR lpszDisplayName,
+static HRESULT WINAPI ISF_MyComputer_fnParseDisplayName (IShellFolder2 *iface,
+               HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName,
 				   DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
-
     HRESULT hr = E_INVALIDARG;
     LPCWSTR szNext = NULL;
     WCHAR szElement[MAX_PATH];
     LPITEMIDLIST pidlTemp = NULL;
     CLSID clsid;
 
-    TRACE ("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
-	   This, hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName), pchEaten, ppidl, pdwAttributes);
+    TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", This,
+          hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
+          pchEaten, ppidl, pdwAttributes);
 
     *ppidl = 0;
     if (pchEaten)
 	*pchEaten = 0;		/* strange but like the original */
 
     /* handle CLSID paths */
-    if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
+    if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
+    {
 	szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
 	TRACE ("-- element: %s\n", debugstr_w (szElement));
 	SHCLSIDFromStringW (szElement + 2, &clsid);
 	pidlTemp = _ILCreateGuid (PT_GUID, &clsid);
     }
     /* do we have an absolute path name ? */
-    else if (PathGetDriveNumberW (lpszDisplayName) >= 0 && lpszDisplayName[2] == (WCHAR) '\\') {
+    else if (PathGetDriveNumberW (lpszDisplayName) >= 0 &&
+              lpszDisplayName[2] == (WCHAR) '\\')
+    {
 	szNext = GetNextElementW (lpszDisplayName, szElement, MAX_PATH);
-	szElement[0] = toupper(szElement[0]); /* make drive letter uppercase to enable PIDL comparison */
+        /* make drive letter uppercase to enable PIDL comparison */
+        szElement[0] = toupper(szElement[0]);
 	pidlTemp = _ILCreateDrive (szElement);
     }
 
-    if (szNext && *szNext) {
-	hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp, (LPOLESTR) szNext, pchEaten, pdwAttributes);
-    } else {
-	if (pdwAttributes && *pdwAttributes) {
-	    SHELL32_GetItemAttributes (_IShellFolder_ (This), pidlTemp, pdwAttributes);
+    if (szNext && *szNext)
+    {
+        hr = SHELL32_ParseNextElement (iface, hwndOwner, pbc, &pidlTemp,
+                              (LPOLESTR) szNext, pchEaten, pdwAttributes);
 	}
+    else
+    {
+        if (pdwAttributes && *pdwAttributes)
+            SHELL32_GetItemAttributes (_IShellFolder_ (This),
+                                       pidlTemp, pdwAttributes);
 	hr = S_OK;
     }
 
@@ -253,6 +266,8 @@ static BOOL CreateMyCompEnumList(IEnumID
         WCHAR wszDriveName[] = {'A', ':', '\\', '\0'};
         DWORD dwDrivemap = GetLogicalDrives();
         HKEY hkey;
+        char *szkey = "SOFTWARE\\Microsoft\\Windows\\"
+                      "CurrentVersion\\explorer\\mycomputer\\NameSpace";
 
         while (ret && wszDriveName[0]<='Z')
         {
@@ -263,27 +278,26 @@ static BOOL CreateMyCompEnumList(IEnumID
         }
 
         TRACE("-- (%p)-> enumerate (mycomputer shell extensions)\n",list);
-        if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE,
-         "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\explorer\\mycomputer\\NameSpace",
-         0, KEY_READ, &hkey))
+        if (ret && !RegOpenKeyExA(HKEY_LOCAL_MACHINE, szkey, 0, KEY_READ, &hkey))
         {
             char iid[50];
             int i=0;
 
             while (ret)
             {
-                DWORD size = sizeof (iid);
-                LONG apiRet = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL,
-                 NULL);
+                DWORD size;
+                LONG r;
 
-                if (ERROR_SUCCESS == apiRet)
+                size = sizeof (iid);
+                r = RegEnumKeyExA(hkey, i, iid, &size, 0, NULL, NULL, NULL);
+                if (ERROR_SUCCESS == r)
                 {
                     /* FIXME: shell extensions, shouldn't the type be
                      * PT_SHELLEXT? */
                     ret = AddToEnumList(list, _ILCreateGuidFromStrA(iid));
                     i++;
                 }
-                else if (ERROR_NO_MORE_ITEMS == apiRet)
+                else if (ERROR_NO_MORE_ITEMS == r)
                     break;
                 else
                     ret = FALSE;
@@ -297,12 +311,13 @@ static BOOL CreateMyCompEnumList(IEnumID
 /**************************************************************************
 *		ISF_MyComputer_fnEnumObjects
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnEnumObjects (IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
+static HRESULT WINAPI ISF_MyComputer_fnEnumObjects (IShellFolder2 *iface,
+               HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
-    TRACE ("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
+    TRACE("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This,
+          hwndOwner, dwFlags, ppEnumIDList);
 
     *ppEnumIDList = IEnumIDList_Constructor();
     if (*ppEnumIDList)
@@ -316,13 +331,13 @@ ISF_MyComputer_fnEnumObjects (IShellFold
 /**************************************************************************
 *		ISF_MyComputer_fnBindToObject
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnBindToObject (IShellFolder2 * iface, LPCITEMIDLIST pidl,
-			       LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
+static HRESULT WINAPI ISF_MyComputer_fnBindToObject (IShellFolder2 *iface,
+               LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
-    TRACE ("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
+    TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This,
+          pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
 
     return SHELL32_BindToChild (This->pidlRoot, NULL, pidl, riid, ppvOut);
 }
@@ -330,13 +345,13 @@ ISF_MyComputer_fnBindToObject (IShellFol
 /**************************************************************************
 *	ISF_MyComputer_fnBindToStorage
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
+static HRESULT WINAPI ISF_MyComputer_fnBindToStorage (IShellFolder2 * iface,
 				LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
-    FIXME ("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
+    FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This,
+          pidl, pbcReserved, shdebugstr_guid (riid), ppvOut);
 
     *ppvOut = NULL;
     return E_NOTIMPL;
@@ -346,11 +361,10 @@ ISF_MyComputer_fnBindToStorage (IShellFo
 * 	ISF_MyComputer_fnCompareIDs
 */
 
-static HRESULT WINAPI
-ISF_MyComputer_fnCompareIDs (IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
+static HRESULT WINAPI ISF_MyComputer_fnCompareIDs (IShellFolder2 *iface,
+               LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
-
     int nReturn;
 
     TRACE ("(%p)->(0x%08lx,pidl1=%p,pidl2=%p)\n", This, lParam, pidl1, pidl2);
@@ -362,33 +376,40 @@ ISF_MyComputer_fnCompareIDs (IShellFolde
 /**************************************************************************
 *	ISF_MyComputer_fnCreateViewObject
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnCreateViewObject (IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
+static HRESULT WINAPI ISF_MyComputer_fnCreateViewObject (IShellFolder2 *iface,
+               HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
-
     LPSHELLVIEW pShellView;
     HRESULT hr = E_INVALIDARG;
 
-    TRACE ("(%p)->(hwnd=%p,%s,%p)\n", This, hwndOwner, shdebugstr_guid (riid), ppvOut);
+    TRACE("(%p)->(hwnd=%p,%s,%p)\n", This,
+          hwndOwner, shdebugstr_guid (riid), ppvOut);
+
+    if (!ppvOut)
+        return hr;
 
-    if (ppvOut) {
 	*ppvOut = NULL;
 
-	if (IsEqualIID (riid, &IID_IDropTarget)) {
+    if (IsEqualIID (riid, &IID_IDropTarget))
+    {
 	    WARN ("IDropTarget not implemented\n");
 	    hr = E_NOTIMPL;
-	} else if (IsEqualIID (riid, &IID_IContextMenu)) {
+    }
+    else if (IsEqualIID (riid, &IID_IContextMenu))
+    {
 	    WARN ("IContextMenu not implemented\n");
 	    hr = E_NOTIMPL;
-	} else if (IsEqualIID (riid, &IID_IShellView)) {
+    }
+    else if (IsEqualIID (riid, &IID_IShellView))
+    {
 	    pShellView = IShellView_Constructor ((IShellFolder *) iface);
-	    if (pShellView) {
+        if (pShellView)
+        {
 		hr = IShellView_QueryInterface (pShellView, riid, ppvOut);
 		IShellView_Release (pShellView);
 	    }
 	}
-    }
     TRACE ("-- (%p)->(interface=%p)\n", This, ppvOut);
     return hr;
 }
@@ -396,22 +417,22 @@ ISF_MyComputer_fnCreateViewObject (IShel
 /**************************************************************************
 *  ISF_MyComputer_fnGetAttributesOf
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
+static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface,
+                UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
-
     HRESULT hr = S_OK;
 
     TRACE ("(%p)->(cidl=%d apidl=%p mask=0x%08lx)\n", This, cidl, apidl, *rgfInOut);
 
-    if ((!cidl) || (!apidl) || (!rgfInOut))
+    if (!cidl || !apidl || !rgfInOut)
 	return E_INVALIDARG;
 
     if (*rgfInOut == 0)
 	*rgfInOut = ~0;
 
-    while (cidl > 0 && *apidl) {
+    while (cidl > 0 && *apidl)
+    {
 	pdump (*apidl);
 	SHELL32_GetItemAttributes (_IShellFolder_ (This), *apidl, rgfInOut);
 	apidl++;
@@ -426,18 +447,17 @@ ISF_MyComputer_fnGetAttributesOf (IShell
 *	ISF_MyComputer_fnGetUIObjectOf
 *
 * PARAMETERS
-*  HWND           hwndOwner, //[in ] Parent window for any output
-*  UINT           cidl,      //[in ] array size
-*  LPCITEMIDLIST* apidl,     //[in ] simple pidl array
-*  REFIID         riid,      //[in ] Requested Interface
-*  UINT*          prgfInOut, //[   ] reserved
-*  LPVOID*        ppvObject) //[out] Resulting Interface
+*  hwndOwner [in]  Parent window for any output
+*  cidl      [in]  array size
+*  apidl     [in]  simple pidl array
+*  riid      [in]  Requested Interface
+*  prgfInOut [   ] reserved
+*  ppvObject [out] Resulting Interface
 *
 */
-static HRESULT WINAPI
-ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
-				HWND hwndOwner,
-				UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
+static HRESULT WINAPI ISF_MyComputer_fnGetUIObjectOf (IShellFolder2 * iface,
+                HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl, REFIID riid,
+                UINT * prgfInOut, LPVOID * ppvOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
@@ -445,44 +465,59 @@ ISF_MyComputer_fnGetUIObjectOf (IShellFo
     IUnknown *pObj = NULL;
     HRESULT hr = E_INVALIDARG;
 
-    TRACE ("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n",
-	   This, hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
+    TRACE("(%p)->(%p,%u,apidl=%p,%s,%p,%p)\n", This,
+          hwndOwner, cidl, apidl, shdebugstr_guid (riid), prgfInOut, ppvOut);
+
+    if (!ppvOut)
+        return hr;
 
-    if (ppvOut) {
 	*ppvOut = NULL;
 
-	if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1)) {
-	    pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface, This->pidlRoot, apidl, cidl);
+    if (IsEqualIID (riid, &IID_IContextMenu) && (cidl >= 1))
+    {
+        pObj = (LPUNKNOWN) ISvItemCm_Constructor ((IShellFolder *) iface,
+                                              This->pidlRoot, apidl, cidl);
 	    hr = S_OK;
-	} else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1)) {
-	    pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner, This->pidlRoot, apidl, cidl);
+    }
+    else if (IsEqualIID (riid, &IID_IDataObject) && (cidl >= 1))
+    {
+        pObj = (LPUNKNOWN) IDataObject_Constructor (hwndOwner,
+                                              This->pidlRoot, apidl, cidl);
 	    hr = S_OK;
-	} else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1)) {
+    }
+    else if (IsEqualIID (riid, &IID_IExtractIconA) && (cidl == 1))
+    {
 	    pidl = ILCombine (This->pidlRoot, apidl[0]);
 	    pObj = (LPUNKNOWN) IExtractIconA_Constructor (pidl);
 	    SHFree (pidl);
 	    hr = S_OK;
-	} else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1)) {
+    }
+    else if (IsEqualIID (riid, &IID_IExtractIconW) && (cidl == 1))
+    {
 	    pidl = ILCombine (This->pidlRoot, apidl[0]);
 	    pObj = (LPUNKNOWN) IExtractIconW_Constructor (pidl);
 	    SHFree (pidl);
 	    hr = S_OK;
-	} else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1)) {
-	    hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget, (LPVOID *) & pObj);
-	} else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
-				&& (cidl == 1)) {
+    }
+    else if (IsEqualIID (riid, &IID_IDropTarget) && (cidl >= 1))
+    {
+        hr = IShellFolder_QueryInterface (iface, &IID_IDropTarget,
+                                          (LPVOID *) &pObj);
+    }
+    else if ((IsEqualIID(riid,&IID_IShellLinkW) ||
+              IsEqualIID(riid,&IID_IShellLinkA)) && (cidl == 1))
+    {
 	    pidl = ILCombine (This->pidlRoot, apidl[0]);
 	    hr = IShellLink_ConstructFromFile(NULL, riid, pidl, (LPVOID*)&pObj);
 	    SHFree (pidl);
-	} else {
-	    hr = E_NOINTERFACE;
 	}
+    else 
+        hr = E_NOINTERFACE;
 
 	if (SUCCEEDED(hr) && !pObj)
 	    hr = E_OUTOFMEMORY;
 
 	*ppvOut = pObj;
-    }
     TRACE ("(%p)->hr=0x%08lx\n", This, hr);
     return hr;
 }
@@ -490,12 +525,12 @@ ISF_MyComputer_fnGetUIObjectOf (IShellFo
 /**************************************************************************
 *	ISF_MyComputer_fnGetDisplayNameOf
 */
-static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
+static HRESULT WINAPI ISF_MyComputer_fnGetDisplayNameOf (IShellFolder2 *iface,
+               LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
-    char szPath[MAX_PATH],
-      szDrive[18];
+    char szPath[MAX_PATH], szDrive[18];
     int len = 0;
     BOOL bSimplePidl;
     HRESULT hr = S_OK;
@@ -511,39 +546,59 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 
     bSimplePidl = _ILIsPidlSimple (pidl);
 
-    if (!pidl->mkid.cb) {
+    if (!pidl->mkid.cb)
+    {
 	/* parsing name like ::{...} */
 	lstrcpyA (szPath, "::");
 	SHELL32_GUIDToStringA(&CLSID_MyComputer, &szPath[2]);
-    } else if (_ILIsSpecialFolder (pidl)) {
+    }
+    else if (_ILIsSpecialFolder (pidl))
+    {
 	/* take names of special folders only if its only this folder */
-	if (bSimplePidl) {
+        if (bSimplePidl)
+        {
 	    GUID const *clsid;
 
-	    if ((clsid = _ILGetGUIDPointer (pidl))) {
-		if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING) {
-		    int bWantsForParsing;
+            clsid = _ILGetGUIDPointer (pidl);
+            if (clsid)
+            {
+                if (GET_SHGDN_FOR (dwFlags) == SHGDN_FORPARSING)
+                {
+                    int bWantsForParsing = FALSE;
+                    char szRegPath[100];
+                    LONG r;
 
 		    /*
-		     * we can only get a filesystem path from a shellfolder if the value WantsFORPARSING in
-		     * CLSID\\{...}\\shellfolder exists
-		     * exception: the MyComputer folder has this keys not but like any filesystem backed
+                     * We can only get a filesystem path from a shellfolder
+                     * if the value WantsFORPARSING exists in
+                     *      CLSID\\{...}\\shellfolder 
+                     * exception: the MyComputer folder has this keys not
+                     *            but like any filesystem backed
 		     *            folder it needs these behaviour
+                     *
+                     * Get the "WantsFORPARSING" flag from the registry
 		     */
-		    /* get the "WantsFORPARSING" flag from the registry */
-		    char szRegPath[100];
 
 		    lstrcpyA (szRegPath, "CLSID\\");
 		    SHELL32_GUIDToStringA (clsid, &szRegPath[6]);
 		    lstrcatA (szRegPath, "\\shellfolder");
-		    bWantsForParsing =
-			(ERROR_SUCCESS ==
-			 SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, "WantsFORPARSING", NULL, NULL, NULL));
-
-		    if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) && bWantsForParsing) {
-			/* we need the filesystem path to the destination folder. Only the folder itself can know it */
-			hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags, szPath, MAX_PATH);
-		    } else {
+                    r = SHGetValueA (HKEY_CLASSES_ROOT, szRegPath, 
+                                     "WantsFORPARSING", NULL, NULL, NULL);
+                    if (r == ERROR_SUCCESS)
+                        bWantsForParsing = TRUE;
+
+                    if ((GET_SHGDN_RELATION (dwFlags) == SHGDN_NORMAL) &&
+                        bWantsForParsing)
+                    {
+                        /*
+                         * We need the filesystem path to the destination folder
+                         * Only the folder itself can know it
+                         */
+                        hr = SHELL32_GetDisplayNameOfChild (iface, pidl,
+                                                dwFlags, szPath, MAX_PATH);
+                    }
+                    else
+                    {
 			LPSTR p;
 
 			/* parsing name like ::{...} */
@@ -554,17 +609,26 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 			p += 3;
 			SHELL32_GUIDToStringA(clsid, p);
 		    }
-		} else {
+                }
+                else
+                {
 		    /* user friendly name */
 		    HCR_GetClassNameA (clsid, szPath, MAX_PATH);
 		}
-	    } else
-		_ILSimpleGetText (pidl, szPath, MAX_PATH);	/* append my own path */
-	} else {
+            }
+            else
+            {
+                /* append my own path */
+                _ILSimpleGetText (pidl, szPath, MAX_PATH);
+            }
+        }
+        else
 	    FIXME ("special folder\n");
 	}
-    } else {
-	if (!_ILIsDrive (pidl)) {
+    else
+    {
+        if (!_ILIsDrive (pidl))
+        {
 	    ERR ("Wrong pidl type\n");
 	    return E_INVALIDARG;
 	}
@@ -572,12 +636,12 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 	_ILSimpleGetText (pidl, szPath, MAX_PATH);	/* append my own path */
 
 	/* long view "lw_name (C:)" */
-	if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING)) {
-	    DWORD dwVolumeSerialNumber,
-	      dwMaximumComponetLength,
-	      dwFileSystemFlags;
+        if (bSimplePidl && !(dwFlags & SHGDN_FORPARSING))
+        {
+            DWORD dwVolumeSerialNumber, dwMaximumComponetLength, dwFileSystemFlags;
 
-	    GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6, &dwVolumeSerialNumber,
+            GetVolumeInformationA (szPath, szDrive, sizeof (szDrive) - 6,
+                       &dwVolumeSerialNumber,
 				   &dwMaximumComponetLength, &dwFileSystemFlags, NULL, 0);
 	    strcat (szDrive, " (");
 	    strncat (szDrive, szPath, 2);
@@ -586,14 +650,18 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 	}
     }
 
-    if (!bSimplePidl) {		/* go deeper if needed */
+    if (!bSimplePidl)
+    {
+        /* go deeper if needed */
 	PathAddBackslashA (szPath);
 	len = strlen (szPath);
 
-	hr = SHELL32_GetDisplayNameOfChild (iface, pidl, dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
+        hr = SHELL32_GetDisplayNameOfChild (iface, pidl,
+                  dwFlags | SHGDN_INFOLDER, szPath + len, MAX_PATH - len);
     }
 
-    if (SUCCEEDED (hr)) {
+    if (SUCCEEDED (hr))
+    {
 	strRet->uType = STRRET_CSTR;
 	lstrcpynA (strRet->u.cStr, szPath, MAX_PATH);
     }
@@ -608,53 +676,64 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 *  identifier in the process.
 *
 * PARAMETERS
-*  HWND          hwndOwner,  //[in ] Owner window for output
-*  LPCITEMIDLIST pidl,       //[in ] simple pidl of item to change
-*  LPCOLESTR     lpszName,   //[in ] the items new display name
-*  DWORD         dwFlags,    //[in ] SHGNO formatting flags
-*  LPITEMIDLIST* ppidlOut)   //[out] simple pidl returned
+*  hwndOwner  [in]   Owner window for output
+*  pidl       [in]   simple pidl of item to change
+*  lpszName   [in]   the items new display name
+*  dwFlags    [in]   SHGNO formatting flags
+*  ppidlOut   [out]  simple pidl returned
 */
-static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl,	/*simple pidl */
+static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
+               IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl,
 						  LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
-    FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
+    FIXME ("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This,
+           hwndOwner, pidl, debugstr_w (lpName), dwFlags, pPidlOut);
     return E_FAIL;
 }
 
-static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (IShellFolder2 * iface, GUID * pguid)
+static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (
+               IShellFolder2 * iface, GUID * pguid)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
     FIXME ("(%p)\n", This);
     return E_NOTIMPL;
 }
-static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
+static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (
+               IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
     FIXME ("(%p)\n", This);
     return E_NOTIMPL;
 }
-static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
+static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumn (
+               IShellFolder2 *iface, DWORD dwRes, ULONG *pSort, ULONG *pDisplay)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
     TRACE ("(%p)\n", This);
 
-    if (pSort) *pSort = 0;
-    if (pDisplay) *pDisplay = 0;
+    if (pSort)
+         *pSort = 0;
+    if (pDisplay)
+        *pDisplay = 0;
     return S_OK;
 }
-static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
+static HRESULT WINAPI ISF_MyComputer_fnGetDefaultColumnState (
+               IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
 
     TRACE ("(%p)\n", This);
 
-    if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS) return E_INVALIDARG;
+    if (!pcsFlags || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
+        return E_INVALIDARG;
     *pcsFlags = MyComputerSFHeader[iColumn].pcsFlags;
     return S_OK;
 }
-static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
+
+static HRESULT WINAPI ISF_MyComputer_fnGetDetailsEx (IShellFolder2 * iface,
+               LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
     FIXME ("(%p)\n", This);
@@ -662,7 +741,8 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 }
 
 /* FIXME: drive size >4GB is rolling over */
-static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
+static HRESULT WINAPI ISF_MyComputer_fnGetDetailsOf (IShellFolder2 * iface,
+               LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
     HRESULT hr;
@@ -672,34 +752,42 @@ static HRESULT WINAPI ISF_MyComputer_fnG
     if (!psd || iColumn >= MYCOMPUTERSHELLVIEWCOLUMNS)
 	return E_INVALIDARG;
 
-    if (!pidl) {
+    if (!pidl)
+    {
 	psd->fmt = MyComputerSFHeader[iColumn].fmt;
 	psd->cxChar = MyComputerSFHeader[iColumn].cxChar;
 	psd->str.uType = STRRET_CSTR;
-	LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid, psd->str.u.cStr, MAX_PATH);
+        LoadStringA (shell32_hInstance, MyComputerSFHeader[iColumn].colnameid,
+                     psd->str.u.cStr, MAX_PATH);
 	return S_OK;
-    } else {
+    }
+    else
+    {
 	char szPath[MAX_PATH];
 	ULARGE_INTEGER ulBytes;
 
 	psd->str.u.cStr[0] = 0x00;
 	psd->str.uType = STRRET_CSTR;
-	switch (iColumn) {
+        switch (iColumn)
+        {
 	case 0:		/* name */
-	    hr = IShellFolder_GetDisplayNameOf (iface, pidl, SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
+            hr = IShellFolder_GetDisplayNameOf (iface, pidl,
+                       SHGDN_NORMAL | SHGDN_INFOLDER, &psd->str);
 	    break;
 	case 1:		/* type */
 	    _ILGetFileType (pidl, psd->str.u.cStr, MAX_PATH);
 	    break;
 	case 2:		/* total size */
-	    if (_ILIsDrive (pidl)) {
+            if (_ILIsDrive (pidl))
+            {
 		_ILSimpleGetText (pidl, szPath, MAX_PATH);
 		GetDiskFreeSpaceExA (szPath, NULL, &ulBytes, NULL);
 		StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
 	    }
 	    break;
 	case 3:		/* free size */
-	    if (_ILIsDrive (pidl)) {
+            if (_ILIsDrive (pidl))
+            {
 		_ILSimpleGetText (pidl, szPath, MAX_PATH);
 		GetDiskFreeSpaceExA (szPath, &ulBytes, NULL, NULL);
 		StrFormatByteSizeA (ulBytes.u.LowPart, psd->str.u.cStr, MAX_PATH);
@@ -711,7 +799,9 @@ static HRESULT WINAPI ISF_MyComputer_fnG
 
     return hr;
 }
-static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
+
+static HRESULT WINAPI ISF_MyComputer_fnMapColumnToSCID (
+               IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
 {
     IGenericSFImpl *This = (IGenericSFImpl *)iface;
     FIXME ("(%p)\n", This);
@@ -746,7 +836,8 @@ static IShellFolder2Vtbl vt_ShellFolder2
 /************************************************************************
  *	IMCFldr_PersistFolder2_QueryInterface
  */
-static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
+static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface (
+               IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
 {
     _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
 
@@ -782,7 +873,8 @@ static ULONG WINAPI IMCFldr_PersistFolde
 /************************************************************************
  *	IMCFldr_PersistFolder2_GetClassID
  */
-static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (IPersistFolder2 * iface, CLSID * lpClassId)
+static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID (
+               IPersistFolder2 * iface, CLSID * lpClassId)
 {
     _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
 
@@ -800,7 +892,8 @@ static HRESULT WINAPI IMCFldr_PersistFol
  *
  * NOTES: it makes no sense to change the pidl
  */
-static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (IPersistFolder2 * iface, LPCITEMIDLIST pidl)
+static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize (
+               IPersistFolder2 * iface, LPCITEMIDLIST pidl)
 {
     _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
     TRACE ("(%p)->(%p)\n", This, pidl);
@@ -810,7 +903,8 @@ static HRESULT WINAPI IMCFldr_PersistFol
 /**************************************************************************
  *	IPersistFolder2_fnGetCurFolder
  */
-static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (IPersistFolder2 * iface, LPITEMIDLIST * pidl)
+static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder (
+               IPersistFolder2 * iface, LPITEMIDLIST * pidl)
 {
     _ICOM_THIS_From_IPersistFolder2 (IGenericSFImpl, iface);
 


More information about the wine-patches mailing list