[PATCH 1/2] include/shell32: Shell_MergeMenus should be declared in shlobj.h and exported by name.
David Hedberg
david.hedberg at gmail.com
Sat Jul 17 10:09:53 CDT 2010
---
dlls/shell32/shell32.spec | 2 +-
dlls/shell32/shell32_main.h | 5 -----
dlls/shell32/shlmenu.c | 2 +-
dlls/shell32/tests/shlfileop.c | 14 +++++++-------
dlls/shell32/undocshell.h | 4 ----
include/shlobj.h | 6 ++++++
6 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index f913872..904b53b 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -62,7 +62,7 @@
64 stdcall -noname DriveType(long)
65 stdcall -noname InvalidateDriveType(long)
66 stdcall -noname IsNetDrive(long)
- 67 stdcall -noname Shell_MergeMenus(long long long long long long)
+ 67 stdcall Shell_MergeMenus(long long long long long long)
68 stdcall -noname SHGetSetSettings(ptr long long)
69 stub -noname SHGetNetResource
70 stdcall -noname SHCreateDefClassObject(long long long long long)
diff --git a/dlls/shell32/shell32_main.h b/dlls/shell32/shell32_main.h
index 8f51850..3eecdad 100644
--- a/dlls/shell32/shell32_main.h
+++ b/dlls/shell32/shell32_main.h
@@ -108,11 +108,6 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO
LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST);
LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST);
-/* menu merging */
-#define MM_ADDSEPARATOR 0x00000001L
-#define MM_SUBMENUSHAVEIDS 0x00000002L
-HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
-
/* initialisation for FORMATETC */
#define InitFormatEtc(fe, cf, med) \
{\
diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c
index aea319c..ae13ff8 100644
--- a/dlls/shell32/shlmenu.c
+++ b/dlls/shell32/shlmenu.c
@@ -857,7 +857,7 @@ static BOOL _SHIsMenuSeparator(HMENU hm, int i)
/*************************************************************************
* Shell_MergeMenus [SHELL32.67]
*/
-HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
+UINT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
{ int nItem;
HMENU hmSubMenu;
BOOL bAlreadySeparated;
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
index 08867c8..feaefec 100644
--- a/dlls/shell32/tests/shlfileop.c
+++ b/dlls/shell32/tests/shlfileop.c
@@ -61,6 +61,7 @@ static int (WINAPI *pSHFileOperationW)(LPSHFILEOPSTRUCTW);
static DWORD_PTR (WINAPI *pSHGetFileInfoW)(LPCWSTR, DWORD , SHFILEINFOW*, UINT, UINT);
static int (WINAPI *pSHPathPrepareForWriteA)(HWND, IUnknown*, LPCSTR, DWORD);
static int (WINAPI *pSHPathPrepareForWriteW)(HWND, IUnknown*, LPCWSTR, DWORD);
+static UINT (WINAPI *pShell_MergeMenus)(HMENU, HMENU, UINT, UINT, UINT, ULONG);
static void InitFunctionPointers(void)
{
@@ -71,6 +72,7 @@ static void InitFunctionPointers(void)
pSHGetFileInfoW = (void*)GetProcAddress(hshell32, "SHGetFileInfoW");
pSHPathPrepareForWriteA = (void*)GetProcAddress(hshell32, "SHPathPrepareForWriteA");
pSHPathPrepareForWriteW = (void*)GetProcAddress(hshell32, "SHPathPrepareForWriteW");
+ pShell_MergeMenus = (void*)GetProcAddress(hshell32, (LPSTR)67);
}
/* creates a file with the specified name for tests */
@@ -2309,15 +2311,13 @@ static void test_unicode(void)
ok(!file_existsW(UNICODE_PATH), "The directory should have been removed\n");
}
-extern HRESULT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
-
static void
test_shlmenu(void) {
- HRESULT hres;
- hres = Shell_MergeMenus (0, 0, 0x42, 0x4242, 0x424242, 0);
- ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
- hres = Shell_MergeMenus ((HMENU)42, 0, 0x42, 0x4242, 0x424242, 0);
- ok (hres == 0x4242, "expected 0x4242 but got %x\n", hres);
+ UINT res;
+ res = pShell_MergeMenus (0, 0, 0x42, 0x4242, 0x424242, 0);
+ ok (res == 0x4242, "expected 0x4242 but got %x\n", res);
+ res = pShell_MergeMenus ((HMENU)42, 0, 0x42, 0x4242, 0x424242, 0);
+ ok (res == 0x4242, "expected 0x4242 but got %x\n", res);
}
/* Check for old shell32 (4.0.x) */
diff --git a/dlls/shell32/undocshell.h b/dlls/shell32/undocshell.h
index 513006d..fa0ac05 100644
--- a/dlls/shell32/undocshell.h
+++ b/dlls/shell32/undocshell.h
@@ -191,10 +191,6 @@ int WINAPI Shell_GetCachedImageIndex(
UINT nIconIndex,
BOOL bSimulateDoc);
-BOOL WINAPI Shell_GetImageLists(
- HIMAGELIST *lphimlLarge,
- HIMAGELIST *lphimlSmall);
-
HICON WINAPI SHGetFileIcon(
DWORD dwReserved,
LPCSTR lpszPath,
diff --git a/include/shlobj.h b/include/shlobj.h
index 5f125c1..bd00d21 100644
--- a/include/shlobj.h
+++ b/include/shlobj.h
@@ -82,6 +82,7 @@ VOID WINAPI SHUpdateImageW(LPCWSTR,INT,UINT,INT);
int WINAPI RestartDialog(HWND,LPCWSTR,DWORD);
int WINAPI RestartDialogEx(HWND,LPCWSTR,DWORD,DWORD);
BOOL WINAPI IsUserAnAdmin(void);
+UINT WINAPI Shell_MergeMenus(HMENU,HMENU,UINT,UINT,UINT,ULONG);
#define SHFMT_ERROR 0xFFFFFFFFL /* Error on last format, drive may be formattable */
#define SHFMT_CANCEL 0xFFFFFFFEL /* Last format was cancelled */
@@ -116,6 +117,11 @@ BOOL WINAPI SHObjectProperties(HWND,DWORD,LPCWSTR,LPCWSTR);
int WINAPI PathCleanupSpec(LPCWSTR,LPWSTR);
+/* Shell_MergeMenus flags */
+#define MM_ADDSEPARATOR 0x00000001
+#define MM_SUBMENUSHAVEIDS 0x00000002
+#define MM_DONTREMOVESEPS 0x00000004
+
/*****************************************************************************
* IContextMenu interface
*/
--
1.7.1.1
More information about the wine-patches
mailing list