[SHELL32]
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 6 Nov 2014 12:45:07 +0000 (12:45 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 6 Nov 2014 12:45:07 +0000 (12:45 +0000)
* Move shlmenu.cpp to the wine folder.
* Convert shlmenu.cpp into shlmenu.c.

svn path=/branches/shell-experiments/; revision=65283

dll/win32/shell32/CMakeLists.txt
dll/win32/shell32/wine/shlmenu.c [moved from dll/win32/shell32/shlmenu.cpp with 97% similarity]

index 86daf16..7561f46 100644 (file)
@@ -55,7 +55,6 @@ list(APPEND SOURCE
     shlfileop.cpp
     shlfolder.cpp
     CFileSysBindData.cpp
-    shlmenu.cpp
     CDefView.cpp
     stubs.cpp
     systray.cpp
@@ -76,6 +75,7 @@ add_library(shell32 SHARED
     wine/shellpath.c
     wine/shellreg.c
     wine/shellstring.c
+    wine/shlmenu.c
     wine/shpolicy.c
     vista.c
     shell32.rc
similarity index 97%
rename from dll/win32/shell32/shlmenu.cpp
rename to dll/win32/shell32/wine/shlmenu.c
index 3b47ef2..6e45268 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "precomp.h"
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COBJMACROS
+
+#include <windef.h>
+#include <winbase.h>
+#include <shlobj.h>
+#include <undocshell.h>
+#include <shlwapi.h>
+#include <wine/debug.h>
+#include <wine/unicode.h>
+
+#include "pidl.h"
+#include "shell32_main.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shellmenu);
 
@@ -115,8 +128,8 @@ static LPFMINFO FM_SetMenuParameter(
  */
 static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
 {
-    CComPtr<IShellFolder> lpsf;
-    CComPtr<IShellFolder> lpsf2;
+    IShellFolder *lpsf;
+    IShellFolder *lpsf2;
     ULONG        ulItemAttr = SFGAO_FOLDER;
     UINT        uID, uEnumFlags;
     LPFNFMCALLBACK    lpfnCallback;
@@ -158,19 +171,19 @@ static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
 
     if (SUCCEEDED(SHGetDesktopFolder(&lpsf)))
     {
-        if (SUCCEEDED(lpsf->BindToObject(pidl, 0, IID_PPV_ARG(IShellFolder, &lpsf2))))
+        if (SUCCEEDED(IShellFolder_BindToObject(lpsf, pidl,0,&IID_IShellFolder,(LPVOID *)&lpsf2)))
         {
-            CComPtr<IEnumIDList> lpe;
+            IEnumIDList *lpe;
 
-            if (SUCCEEDED(lpsf2->EnumObjects(0, uEnumFlags, &lpe)))
+            if (SUCCEEDED (IShellFolder_EnumObjects(lpsf2, 0, uEnumFlags, &lpe )))
             {
 
                 LPITEMIDLIST pidlTemp = NULL;
                 ULONG ulFetched;
 
-                while ((!bAbortInit) && (S_OK == lpe->Next(1, &pidlTemp, &ulFetched)))
+                while ((!bAbortInit) && (S_OK == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched)))
                 {
-                    if (SUCCEEDED(lpsf->GetAttributesOf(1, (LPCITEMIDLIST*) &pidlTemp, &ulItemAttr)))
+                    if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulItemAttr)))
                     {
                         ILGetDisplayNameExW(NULL, pidlTemp, sTemp, ILGDN_FORPARSING);
                         if (!(PidlToSicIndex(lpsf, pidlTemp, FALSE, 0, &iIcon)))