Skip to content

Commit 228156e

Browse files
committed
[SDK][SHELL] Sort out SEE_MASK_* and CMIC_MASK_* defines (reactos#8019)
- Add missing versioning defines for the different SEE_MASK_* and CMIC_MASK_* defines. - Move the five undocumented SEE_MASK_* defines into reactos/undocshell.h
1 parent 07ab1cc commit 228156e

File tree

5 files changed

+104
-76
lines changed

5 files changed

+104
-76
lines changed

dll/win32/shell32/precomp.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,6 @@ UINT
187187
GetDfmCmd(_In_ IContextMenu *pCM, _In_ LPCSTR verba);
188188
#define SHELL_ExecuteControlPanelCPL(hwnd, cpl) SHRunControlPanel((cpl), (hwnd))
189189

190-
#define CmicFlagsToSeeFlags(flags) ((flags) & SEE_CMIC_COMMON_FLAGS)
191-
static inline UINT SeeFlagsToCmicFlags(UINT flags)
192-
{
193-
if (flags & SEE_MASK_CLASSNAME)
194-
flags &= ~(SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE);
195-
return flags & SEE_CMIC_COMMON_FLAGS;
196-
}
197-
198190

199191
// CStubWindow32 --- The owner window of file property sheets.
200192
// This window hides taskbar button of property sheet.

sdk/include/psdk/shellapi.h

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,42 @@ extern "C" {
2121
#define ABS_AUTOHIDE 1
2222
#define ABS_ALWAYSONTOP 2
2323

24-
#define SEE_MASK_DEFAULT 0x00000000
25-
#define SEE_MASK_CLASSNAME 0x00000001
26-
#define SEE_MASK_CLASSKEY 0x00000003
27-
#define SEE_MASK_IDLIST 0x00000004
28-
#define SEE_MASK_INVOKEIDLIST 0x0000000C
29-
#define SEE_MASK_ICON 0x00000010
30-
#define SEE_MASK_HOTKEY 0x00000020
31-
#define SEE_MASK_NOCLOSEPROCESS 0x00000040
32-
#define SEE_MASK_CONNECTNETDRV 0x00000080
33-
#define SEE_MASK_NOASYNC 0x00000100
34-
#define SEE_MASK_FLAG_DDEWAIT SEE_MASK_NOASYNC
35-
#define SEE_MASK_DOENVSUBST 0x00000200
36-
#define SEE_MASK_FLAG_NO_UI 0x00000400
37-
#define SEE_MASK_UNICODE 0x00004000
38-
#define SEE_MASK_NO_CONSOLE 0x00008000
39-
/*
40-
* NOTE: The following 5 flags are undocumented and are not present in the
41-
* official Windows SDK. However they are used in shobjidl.idl to define some
42-
* CMIC_MASK_* flags, these ones being mentioned in the MSDN documentation of
43-
* the CMINVOKECOMMANDINFOEX structure.
44-
* I affect them this range of values which seems to be strangely empty. Of
45-
* course their values may differ from the real ones, however I have no way
46-
* of discovering them. If somebody else can verify them, it would be great.
47-
*/
48-
#define SEE_MASK_UNKNOWN_0x1000 0x00001000 /* FIXME: Name */
49-
#define SEE_MASK_HASLINKNAME 0x00010000
50-
#define SEE_MASK_FLAG_SEPVDM 0x00020000
51-
#define SEE_MASK_USE_RESERVED 0x00040000
52-
#define SEE_MASK_HASTITLE 0x00080000
53-
/* END NOTE */
54-
#define SEE_MASK_ASYNCOK 0x00100000
55-
#define SEE_MASK_HMONITOR 0x00200000
56-
#define SEE_MASK_NOZONECHECKS 0x00800000
57-
#define SEE_MASK_NOQUERYCLASSSTORE 0x01000000
58-
#define SEE_MASK_WAITFORINPUTIDLE 0x02000000
59-
#define SEE_MASK_FLAG_LOG_USAGE 0x04000000
24+
#define SEE_MASK_DEFAULT 0x00000000
25+
#define SEE_MASK_CLASSNAME 0x00000001
26+
#define SEE_MASK_CLASSKEY 0x00000003
27+
#define SEE_MASK_IDLIST 0x00000004
28+
#define SEE_MASK_INVOKEIDLIST 0x0000000C
29+
#if (NTDDI_VERSION < NTDDI_VISTA) || defined(__REACTOS__)
30+
#define SEE_MASK_ICON 0x00000010
31+
#endif
32+
#define SEE_MASK_HOTKEY 0x00000020
33+
#define SEE_MASK_NOCLOSEPROCESS 0x00000040
34+
#define SEE_MASK_CONNECTNETDRV 0x00000080
35+
#define SEE_MASK_NOASYNC 0x00000100
36+
#define SEE_MASK_FLAG_DDEWAIT SEE_MASK_NOASYNC
37+
#define SEE_MASK_DOENVSUBST 0x00000200
38+
#define SEE_MASK_FLAG_NO_UI 0x00000400
39+
// 0x00001000 is undocumented.
40+
#define SEE_MASK_UNICODE 0x00004000
41+
#define SEE_MASK_NO_CONSOLE 0x00008000
42+
// 0x00010000 .. 0x00080000 are undocumented.
43+
#define SEE_MASK_ASYNCOK 0x00100000
44+
#if (NTDDI_VERSION >= NTDDI_WIN2K)
45+
#define SEE_MASK_HMONITOR 0x00200000
46+
#endif
47+
#if (NTDDI_VERSION >= NTDDI_WINXPSP1)
48+
#define SEE_MASK_NOZONECHECKS 0x00800000
49+
#endif
50+
#if (NTDDI_VERSION >= NTDDI_WIN2K)
51+
#define SEE_MASK_NOQUERYCLASSSTORE 0x01000000
52+
#define SEE_MASK_WAITFORINPUTIDLE 0x02000000
53+
#endif
54+
#if (NTDDI_VERSION >= NTDDI_WINXP)
55+
#define SEE_MASK_FLAG_LOG_USAGE 0x04000000
56+
#endif
57+
#if (NTDDI_VERSION >= NTDDI_VISTA)
6058
#define SEE_MASK_FLAG_HINST_IS_SITE 0x08000000
59+
#endif
6160

6261
#define ABM_NEW 0
6362
#define ABM_REMOVE 1

sdk/include/psdk/shobjidl.idl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,15 +1693,19 @@ cpp_quote("#define CMDSTR_VIEWLIST WINELIB_NAME_AW(CMDSTR_VIEWLIST)")
16931693
cpp_quote("#define CMDSTR_VIEWDETAILS WINELIB_NAME_AW(CMDSTR_VIEWDETAILS)")
16941694

16951695
cpp_quote("#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY")
1696-
cpp_quote("#define CMIC_MASK_ICON SEE_MASK_ICON")
1696+
cpp_quote("#define CMIC_MASK_ICON SEE_MASK_ICON") // (NTDDI_VERSION < NTDDI_VISTA) || defined(__REACTOS__)
16971697
cpp_quote("#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI")
16981698
cpp_quote("#define CMIC_MASK_UNICODE SEE_MASK_UNICODE")
16991699
cpp_quote("#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE")
1700-
cpp_quote("#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME")
1701-
cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM")
1702-
cpp_quote("#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE")
1700+
cpp_quote("#if (NTDDI_VERSION < NTDDI_VISTA) || defined(__REACTOS__)")
1701+
cpp_quote("#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME") // NOTE: Depends on undocumented define
1702+
cpp_quote("#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE") // NOTE: Depends on undocumented define
1703+
cpp_quote("#endif")
1704+
cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM") // NOTE: Depends on undocumented define
17031705
cpp_quote("#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK")
1706+
cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
17041707
cpp_quote("#define CMIC_MASK_NOASYNC SEE_MASK_NOASYNC")
1708+
cpp_quote("#endif")
17051709
cpp_quote("#define CMIC_MASK_SHIFT_DOWN 0x10000000")
17061710
cpp_quote("#define CMIC_MASK_PTINVOKE 0x20000000")
17071711
cpp_quote("#define CMIC_MASK_CONTROL_DOWN 0x40000000")

sdk/include/reactos/shellutils.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,23 @@ class CObjectWithSiteBase :
662662
#define S_GREATERTHAN S_FALSE
663663
#define MAKE_COMPARE_HRESULT(x) ((x)>0 ? S_GREATERTHAN : ((x)<0 ? S_LESSTHAN : S_EQUAL))
664664

665+
#ifdef _UNDOCSHELL_H
666+
/* The SEE_MASK_* defines that are undocumented, are defined in reactos/undocshell.h */
665667
#define SEE_CMIC_COMMON_BASICFLAGS (SEE_MASK_NOASYNC | SEE_MASK_ASYNCOK | SEE_MASK_UNICODE | \
666668
SEE_MASK_NO_CONSOLE | SEE_MASK_FLAG_NO_UI | SEE_MASK_FLAG_SEPVDM | \
667669
SEE_MASK_FLAG_LOG_USAGE | SEE_MASK_NOZONECHECKS)
668670
#define SEE_CMIC_COMMON_FLAGS (SEE_CMIC_COMMON_BASICFLAGS | SEE_MASK_HOTKEY | SEE_MASK_ICON | \
669671
SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE)
670672

673+
#define CmicFlagsToSeeFlags(flags) ((flags) & SEE_CMIC_COMMON_FLAGS)
674+
static inline UINT SeeFlagsToCmicFlags(UINT flags)
675+
{
676+
if (flags & SEE_MASK_CLASSNAME)
677+
flags &= ~(SEE_MASK_HASLINKNAME | SEE_MASK_HASTITLE);
678+
return flags & SEE_CMIC_COMMON_FLAGS;
679+
}
680+
#endif // _UNDOCSHELL_H
681+
671682
static inline BOOL SHELL_IsContextMenuMsg(UINT uMsg)
672683
{
673684
return uMsg == WM_MEASUREITEM || uMsg == WM_DRAWITEM ||

sdk/include/reactos/undocshell.h

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
* Copyright 2025 Katayama Hirofumi MZ ([email protected])
77
*/
88

9+
#ifndef _UNDOCSHELL_H
10+
#define _UNDOCSHELL_H
11+
912
#pragma once
1013

1114
#include <shellapi.h>
@@ -589,44 +592,44 @@ C_ASSERT(sizeof(REGSHELLSTATE) == REGSHELLSTATE_SIZE);
589592
/* Generic structure used by several messages */
590593
typedef struct
591594
{
592-
DWORD dwReserved;
593-
DWORD dwReserved2;
594-
LPCITEMIDLIST pidl;
595-
LPDWORD lpdwUser;
596-
} SFVCBINFO, * LPSFVCBINFO;
597-
typedef const SFVCBINFO * LPCSFVCBINFO;
595+
DWORD dwReserved;
596+
DWORD dwReserved2;
597+
LPCITEMIDLIST pidl;
598+
LPDWORD lpdwUser;
599+
} SFVCBINFO, *LPSFVCBINFO;
600+
typedef const SFVCBINFO *LPCSFVCBINFO;
598601

599602
/* SFVCB_SELECTIONCHANGED structure */
600603
typedef struct
601604
{
602-
UINT uOldState;
603-
UINT uNewState;
604-
LPCITEMIDLIST pidl;
605-
LPDWORD lpdwUser;
606-
} SFVSELECTSTATE, * LPSFVSELECTSTATE;
607-
typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
605+
UINT uOldState;
606+
UINT uNewState;
607+
LPCITEMIDLIST pidl;
608+
LPDWORD lpdwUser;
609+
} SFVSELECTSTATE, *LPSFVSELECTSTATE;
610+
typedef const SFVSELECTSTATE *LPCSFVSELECTSTATE;
608611

609612
/* SFVCB_COPYHOOKCALLBACK structure */
610613
typedef struct
611614
{
612-
HWND hwnd;
613-
UINT wFunc;
614-
UINT wFlags;
615-
LPCSTR pszSrcFile;
616-
DWORD dwSrcAttribs;
617-
LPCSTR pszDestFile;
618-
DWORD dwDestAttribs;
619-
} SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
620-
typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
615+
HWND hwnd;
616+
UINT wFunc;
617+
UINT wFlags;
618+
LPCSTR pszSrcFile;
619+
DWORD dwSrcAttribs;
620+
LPCSTR pszDestFile;
621+
DWORD dwDestAttribs;
622+
} SFVCOPYHOOKINFO, *LPSFVCOPYHOOKINFO;
623+
typedef const SFVCOPYHOOKINFO *LPCSFVCOPYHOOKINFO;
621624

622625
/* SFVCB_GETDETAILSOF structure */
623626
typedef struct
624627
{
625-
LPCITEMIDLIST pidl;
626-
int fmt;
627-
int cx;
628-
STRRET lpText;
629-
} SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
628+
LPCITEMIDLIST pidl;
629+
int fmt;
630+
int cx;
631+
STRRET lpText;
632+
} SFVCOLUMNINFO, *LPSFVCOLUMNINFO;
630633

631634
/****************************************************************************
632635
* Misc Stuff
@@ -667,6 +670,19 @@ HRESULT WINAPI ShellExecCmdLine(
667670
LPVOID pUnused,
668671
DWORD dwSeclFlags);
669672

673+
/*
674+
* Undocumented SEE_MASK_* flags for the SHELLEXECUTEINFO::fMask member
675+
* used by ShellExecuteEx(). These are absent from the official Windows SDK.
676+
* However they are used in shobjidl.idl to define some CMIC_MASK_* flags,
677+
* these ones being mentioned in the MSDN documentation of the
678+
* CMINVOKECOMMANDINFOEX structure.
679+
*/
680+
#define SEE_MASK_UNKNOWN_0x1000 0x00001000 // FIXME: Name
681+
#define SEE_MASK_HASLINKNAME 0x00010000
682+
#define SEE_MASK_FLAG_SEPVDM 0x00020000
683+
#define SEE_MASK_USE_RESERVED 0x00040000
684+
#define SEE_MASK_HASTITLE 0x00080000
685+
670686
HINSTANCE WINAPI
671687
RealShellExecuteA(
672688
_In_opt_ HWND hwnd,
@@ -799,6 +815,7 @@ HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv);
799815
BOOL WINAPI GUIDFromStringA(
800816
_In_ PCSTR psz,
801817
_Out_ LPGUID pguid);
818+
802819
BOOL WINAPI GUIDFromStringW(
803820
_In_ PCWSTR psz,
804821
_Out_ LPGUID pguid);
@@ -862,6 +879,7 @@ SHInvokePrivilegedFunctionW(
862879

863880
BOOL WINAPI
864881
SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName);
882+
865883
BOOL WINAPI IsSuspendAllowed(VOID);
866884

867885
BOOL WINAPI
@@ -949,17 +967,19 @@ LONG WINAPI SHRegQueryValueExA(
949967
LPDWORD lpType,
950968
LPBYTE lpData,
951969
LPDWORD lpcbData);
970+
952971
LONG WINAPI SHRegQueryValueExW(
953972
HKEY hkey,
954973
LPCWSTR pszValue,
955974
LPDWORD pdwReserved,
956975
LPDWORD pdwType,
957976
LPVOID pvData,
958977
LPDWORD pcbData);
978+
959979
#ifdef UNICODE
960-
#define SHRegQueryValueEx SHRegQueryValueExW
980+
#define SHRegQueryValueEx SHRegQueryValueExW
961981
#else
962-
#define SHRegQueryValueEx SHRegQueryValueExA
982+
#define SHRegQueryValueEx SHRegQueryValueExA
963983
#endif
964984

965985
BOOL WINAPI
@@ -1264,3 +1284,5 @@ C_ASSERT(sizeof(APPBAR_COMMAND) == 0x38);
12641284
#ifdef __cplusplus
12651285
} /* extern "C" */
12661286
#endif /* defined(__cplusplus) */
1287+
1288+
#endif /* _UNDOCSHELL_H */

0 commit comments

Comments
 (0)