[RSHELL]
[reactos.git] / dll / win32 / shell32 / pidl.cpp
index d4e3374..7f877b9 100644 (file)
@@ -22,7 +22,7 @@
  *
  */
 
  *
  */
 
-#include <precomp.h>
+#include "precomp.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(pidl);
 WINE_DECLARE_DEBUG_CHANNEL(shell);
 
 WINE_DEFAULT_DEBUG_CHANNEL(pidl);
 WINE_DECLARE_DEBUG_CHANNEL(shell);
@@ -118,7 +118,7 @@ BOOL WINAPI ILGetDisplayNameExW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, LPWSTR pa
         }
         else
         {
         }
         else
         {
-            ret = SHBindToParent(pidl, IID_IShellFolder, (LPVOID*)&psfParent, &pidllast);
+            ret = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psfParent), &pidllast);
             if (SUCCEEDED(ret))
             {
                 ret = psfParent->GetDisplayNameOf(pidllast, flag, &strret);
             if (SUCCEEDED(ret))
             {
                 ret = psfParent->GetDisplayNameOf(pidllast, flag, &strret);
@@ -686,8 +686,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM
     CComPtr<IDataObject>        pDataObj;
     HRESULT hr;
 
     CComPtr<IDataObject>        pDataObj;
     HRESULT hr;
 
-    hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple,
-                             IID_IDataObject, 0, (LPVOID*)&pDataObj);
+    hr = lpsf->GetUIObjectOf(0, 1, &pidlSimple, IID_NULL_PPV_ARG(IDataObject, &pDataObj));
     if (SUCCEEDED(hr))
     {
         STGMEDIUM medium;
     if (SUCCEEDED(hr))
     {
         STGMEDIUM medium;
@@ -754,11 +753,13 @@ EXTERN_C LPITEMIDLIST WINAPI SHLogILFromFSIL(LPITEMIDLIST pidl)
  */
 UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
 {
  */
 UINT WINAPI ILGetSize(LPCITEMIDLIST pidl)
 {
-    LPCSHITEMID si = &(pidl->mkid);
+    LPCSHITEMID si;
     UINT len = 0;
 
     if (pidl)
     {
     UINT len = 0;
 
     if (pidl)
     {
+        si = &(pidl->mkid);
+
         while (si->cb)
         {
             len += si->cb;
         while (si->cb)
         {
             len += si->cb;
@@ -1102,7 +1103,7 @@ HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
                 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
             else
                 pfd->cAlternateFileName[0] = '\0';
                 lstrcpynA(pfd->cAlternateFileName, shortname, sizeof(pfd->cAlternateFileName));
             else
                 pfd->cAlternateFileName[0] = '\0';
-            return NOERROR;
+            return S_OK;
 
         case SHGDFIL_NETRESOURCE:
         case SHGDFIL_DESCRIPTIONID:
 
         case SHGDFIL_NETRESOURCE:
         case SHGDFIL_DESCRIPTIONID:
@@ -1144,7 +1145,7 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
             if (len < (int)sizeof(WIN32_FIND_DATAW))
                 return E_INVALIDARG;
 
             if (len < (int)sizeof(WIN32_FIND_DATAW))
                 return E_INVALIDARG;
 
-            ZeroMemory(pfd, sizeof (WIN32_FIND_DATAA));
+            ZeroMemory(pfd, sizeof (WIN32_FIND_DATAW));
             _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
             pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
             pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
             _ILGetFileDateTime( pidl, &(pfd->ftLastWriteTime));
             pfd->dwFileAttributes = _ILGetFileAttributes(pidl, NULL, 0);
             pfd->nFileSizeLow = _ILGetFileSize ( pidl, NULL, 0);
@@ -1161,7 +1162,7 @@ HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
                 pfd->cAlternateFileName[0] = '\0';
             else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1, pfd->cAlternateFileName, 14))
                 pfd->cAlternateFileName[13] = 0;
                 pfd->cAlternateFileName[0] = '\0';
             else if (!MultiByteToWideChar(CP_ACP, 0, shortname, -1, pfd->cAlternateFileName, 14))
                 pfd->cAlternateFileName[13] = 0;
-            return NOERROR;
+            return S_OK;
 
         case SHGDFIL_NETRESOURCE:
         case SHGDFIL_DESCRIPTIONID:
 
         case SHGDFIL_NETRESOURCE:
         case SHGDFIL_DESCRIPTIONID:
@@ -1221,7 +1222,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
     if (!pidl)
         return FALSE;
 
     if (!pidl)
         return FALSE;
 
-    hr = SHBindToParent(pidl, IID_IShellFolder, (VOID**)&psfFolder, &pidlLast);
+    hr = SHBindToParent(pidl, IID_PPV_ARG(IShellFolder, &psfFolder), &pidlLast);
     if (FAILED(hr))
     {
         ERR("SHBindToParent failed: %x\n", hr);
     if (FAILED(hr))
     {
         ERR("SHBindToParent failed: %x\n", hr);