https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9fc87dacdb653b6475381…
commit 9fc87dacdb653b647538180a32002117389b36dc
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Feb 13 09:16:59 2020 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Feb 13 09:16:59 2020 +0900
[SDK][INCLUDE] Fix and improve comctl32_undoc.h
---
dll/win32/shell32/COpenWithMenu.cpp | 6 +-
sdk/include/reactos/comctl32_undoc.h | 124 ++++++++++++++++++++++++++---------
2 files changed, 95 insertions(+), 35 deletions(-)
diff --git a/dll/win32/shell32/COpenWithMenu.cpp b/dll/win32/shell32/COpenWithMenu.cpp
index 6ccc664afc9..e9dd8018e35 100644
--- a/dll/win32/shell32/COpenWithMenu.cpp
+++ b/dll/win32/shell32/COpenWithMenu.cpp
@@ -427,12 +427,12 @@ BOOL COpenWithList::LoadProgIdList(HKEY hKey, LPCWSTR pwszExt)
HANDLE COpenWithList::OpenMRUList(HKEY hKey)
{
- CREATEMRULISTW Info;
+ MRUINFOW Info;
/* Initialize mru list info */
Info.cbSize = sizeof(Info);
- Info.nMaxItems = 32;
- Info.dwFlags = MRU_STRING;
+ Info.uMax = 32;
+ Info.fFlags = MRU_STRING;
Info.hKey = hKey;
Info.lpszSubKey = L"OpenWithList";
Info.lpfnCompare = NULL;
diff --git a/sdk/include/reactos/comctl32_undoc.h b/sdk/include/reactos/comctl32_undoc.h
index a9349c6142d..49d68006ab9 100644
--- a/sdk/include/reactos/comctl32_undoc.h
+++ b/sdk/include/reactos/comctl32_undoc.h
@@ -3,6 +3,7 @@
*
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
* Copyright 2013 Dominik Hornung
+ * Copyright 2020 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,61 +23,120 @@
#ifndef __COMCTL32_UNDOC__H
#define __COMCTL32_UNDOC__H
+/*
+ * See also:
+ *
https://docs.microsoft.com/en-us/windows/win32/shell/mruinfo
+ */
+
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
-typedef struct tagCREATEMRULISTA
+typedef INT (CALLBACK *MRUCMPPROCA)(LPCSTR, LPCSTR);
+typedef INT (CALLBACK *MRUCMPPROCW)(LPCWSTR, LPCWSTR);
+typedef INT (CALLBACK *MRUBINARYCMPPROC)(LPCVOID, LPCVOID);
+
+typedef struct _MRUINFOA
{
DWORD cbSize;
- DWORD nMaxItems;
- DWORD dwFlags;
+ DWORD uMax;
+ DWORD fFlags;
HKEY hKey;
LPCSTR lpszSubKey;
- PROC lpfnCompare;
-} CREATEMRULISTA, *LPCREATEMRULISTA;
-typedef struct tagCREATEMRULISTW
+ MRUCMPPROCA lpfnCompare;
+} MRUINFOA, *LPMRUINFOA;
+typedef struct _MRUINFOW
{
DWORD cbSize;
- DWORD nMaxItems;
- DWORD dwFlags;
+ DWORD uMax;
+ DWORD fFlags;
HKEY hKey;
LPCWSTR lpszSubKey;
- PROC lpfnCompare;
-} CREATEMRULISTW, *LPCREATEMRULISTW;
+ MRUCMPPROCW lpfnCompare;
+} MRUINFOW, *LPMRUINFOW;
+
+#ifdef UNICODE
+ #define MRUINFO MRUINFOW
+ #define LPMRUINFO LPMRUINFOW
+#else
+ #define MRUINFO MRUINFOA
+ #define LPMRUINFO LPMRUINFOA
+#endif
-#define MRU_STRING 0x0
-#define MRU_BINARY 0x1
-#define MRU_CACHEWRITE 0x2
+/* MRUINFO.fFlags */
+#define MRU_STRING 0x0
+#define MRU_BINARY 0x1
+#define MRU_CACHEWRITE 0x2
-HANDLE WINAPI CreateMRUListW(LPCREATEMRULISTW);
-HANDLE WINAPI CreateMRUListA(LPCREATEMRULISTA);
-INT WINAPI AddMRUData(HANDLE,LPCVOID,DWORD);
-INT WINAPI FindMRUData(HANDLE,LPCVOID,DWORD,LPINT);
-VOID WINAPI FreeMRUList(HANDLE);
+#ifndef NO_MRU_IMPORTS
-INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString);
+HANDLE WINAPI CreateMRUListA(LPMRUINFOA);
+HANDLE WINAPI CreateMRUListW(LPMRUINFOW);
+HANDLE WINAPI CreateMRUListLazyW(const MRUINFOW *lpcml, DWORD dwParam2,
+ DWORD dwParam3, DWORD dwParam4);
+HANDLE WINAPI CreateMRUListLazyA(const MRUINFOA *lpcml, DWORD dwParam2,
+ DWORD dwParam3, DWORD dwParam4);
+INT WINAPI AddMRUData(HANDLE, LPCVOID, DWORD);
INT WINAPI AddMRUStringA(HANDLE hList, LPCSTR lpszString);
-BOOL WINAPI DelMRUString(HANDLE hList, INT nItemPos);
+INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString);
+INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
+ DWORD nBufferSize);
+INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
+ DWORD nBufferSize);
+INT WINAPI FindMRUData(HANDLE,LPCVOID,DWORD,LPINT);
INT WINAPI FindMRUStringW(HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum);
INT WINAPI FindMRUStringA(HANDLE hList, LPCSTR lpszString, LPINT lpRegNum);
-HANDLE WINAPI CreateMRUListLazyW(const CREATEMRULISTW *lpcml, DWORD dwParam2,
- DWORD dwParam3, DWORD dwParam4);
-HANDLE WINAPI CreateMRUListLazyA(const CREATEMRULISTA *lpcml, DWORD dwParam2,
- DWORD dwParam3, DWORD dwParam4);
-INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
- DWORD nBufferSize);
-INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
- DWORD nBufferSize);
+BOOL WINAPI DelMRUString(HANDLE hList, INT nItemPos);
+VOID WINAPI FreeMRUList(HANDLE);
#ifdef UNICODE
-typedef CREATEMRULISTW CREATEMRULIST, *PCREATEMRULIST;
-#define CreateMRUList CreateMRUListW
+ #define CreateMRUList CreateMRUListW
+ #define CreateMRUListLazy CreateMRUListLazyW
+ #define AddMRUString AddMRUStringW
+ #define EnumMRUList EnumMRUListW
+ #define FindMRUString FindMRUStringW
#else
-typedef CREATEMRULISTA CREATEMRULIST, *PCREATEMRULIST;
-#define CreateMRUList CreateMRUListA
+ #define CreateMRUList CreateMRUListA
+ #define CreateMRUListLazy CreateMRUListLazyA
+ #define AddMRUString AddMRUStringA
+ #define EnumMRUList EnumMRUListA
+ #define FindMRUString FindMRUStringA
#endif
+#endif /* ndef NO_MRU_IMPORTS */
+
+typedef HANDLE (WINAPI *FN_CreateMRUListA)(const MRUINFOA *);
+typedef HANDLE (WINAPI *FN_CreateMRUListW)(const MRUINFOW *);
+typedef HANDLE (WINAPI *FN_CreateMRUListLazyA)(const MRUINFOA *, DWORD, DWORD, DWORD);
+typedef HANDLE (WINAPI *FN_CreateMRUListLazyW)(const MRUINFOW *, DWORD, DWORD, DWORD);
+typedef INT (WINAPI *FN_AddMRUStringA)(HANDLE, LPCSTR);
+typedef INT (WINAPI *FN_AddMRUStringW)(HANDLE, LPCWSTR);
+typedef INT (WINAPI *FN_AddMRUData)(HANDLE, LPCVOID, DWORD);
+typedef INT (WINAPI *FN_EnumMRUListA)(HANDLE, INT, LPVOID, DWORD);
+typedef INT (WINAPI *FN_EnumMRUListW)(HANDLE, INT, LPVOID, DWORD);
+typedef INT (WINAPI *FN_FindMRUData)(HANDLE, LPCVOID, DWORD, LPINT);
+typedef INT (WINAPI *FN_FindMRUStringA)(HANDLE, LPCSTR, LPINT);
+typedef INT (WINAPI *FN_FindMRUStringW)(HANDLE, LPCWSTR, LPINT);
+typedef BOOL (WINAPI *FN_DelMRUString)(HANDLE, INT);
+typedef INT (WINAPI *FN_FreeMRUList)(HANDLE);
+
+#define I_CreateMRUListA 151
+#define I_CreateMRUListW 400
+#define I_CreateMRUListLazyA 157
+#define I_CreateMRUListLazyW 404
+#define I_AddMRUStringA 153
+#define I_AddMRUStringW 401
+#define I_AddMRUData 167
+#define I_EnumMRUListA 154
+#define I_EnumMRUListW 403
+#define I_FindMRUData 169
+#define I_FindMRUStringA 155
+#define I_FindMRUStringW 402
+#define I_DelMRUString 156
+#define I_FreeMRUList 152
+
+// #define GET_PROC(hComCtl32, fn) fn = (FN_##fn)GetProcAddress((hComCtl32), I_##fn)
+
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */