Skip to content

Commit 7e52f64

Browse files
authored
[SDK] Define IAssociationElement, IAssociationArray etc. (reactos#7678)
Defining missing interfaces for file association... JIRA issue: CORE-19278 - Define IID_IAssociationElementOld, and IID_IAssociationElement interface IDs in <shlguid_undoc.h>. - Define ASSOCQUERY, and IAssociationElementOld in <shlwapi_undoc.h>. - Define IAssociationElement, IEnumAssociationElements, IAssociationArrayOld, and IAssociationArray interfaces in <shlobj_undoc.h>. - Simplify <shlwapi_undoc.h> and <shlobj_undoc.h>.
1 parent de3a670 commit 7e52f64

File tree

3 files changed

+212
-47
lines changed

3 files changed

+212
-47
lines changed

sdk/include/reactos/shlguid_undoc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ DEFINE_GUID(IID_IDelegateHostItemContainer,0x02468693, 0xE7E5, 0x4C6B, 0x99, 0x9
161161
DEFINE_GUID(IID_IDrawPropertyControl, 0xE6DFF6FD, 0xBCD5, 0x4162, 0x9C, 0x65, 0xA3, 0xB1, 0x8C, 0x61, 0x6F, 0xDB);
162162
DEFINE_GUID(IID_IEnumAssociationElements, 0xA6B0FB57, 0x7523, 0x4439, 0x94, 0x25, 0xEB, 0xE9, 0x98, 0x23, 0xB8, 0x28);
163163
DEFINE_GUID(IID_IEnumerateAssociationElements,0x7513A16E,0xCF00,0x4817,0xA8, 0x90, 0xA2, 0x3C, 0x60, 0x8F, 0xE7, 0xB7);
164+
DEFINE_GUID(IID_IAssociationElementOld, 0xE58B1ABF, 0x9596, 0x4DBA, 0x89, 0x97, 0x89, 0xDC, 0xDE, 0xF4, 0x69, 0x92);
165+
DEFINE_GUID(IID_IAssociationElement, 0xD8F6AD5B, 0xB44F, 0x4BCC, 0x88, 0xFD, 0xEB, 0x34, 0x73, 0xDB, 0x75, 0x02);
164166
DEFINE_GUID(IID_IFilterCondition, 0xFCA2857D, 0x1760, 0x4AD3, 0x8C, 0x63, 0xC9, 0xB6, 0x02, 0xFC, 0xBA, 0xEA);
165167
DEFINE_GUID(IID_IFolderNotify, 0x0FF22D71, 0x5172, 0x11D1, 0xA9, 0xC6, 0x08, 0x00, 0x36, 0xAF, 0x3F, 0x03);
166168
DEFINE_GUID(IID_IFolderProperties, 0x7361EE29, 0x5BAD, 0x459D, 0xA9, 0xF5, 0xF6, 0x55, 0x06, 0x89, 0x82, 0xF0);

sdk/include/reactos/shlobj_undoc.h

Lines changed: 147 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
11
/*
2-
* ReactOS undocumented shell interface
3-
*
4-
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
5-
* Copyright 2013 Dominik Hornung
6-
*
7-
* This library is free software; you can redistribute it and/or
8-
* modify it under the terms of the GNU Lesser General Public
9-
* License as published by the Free Software Foundation; either
10-
* version 2.1 of the License, or (at your option) any later version.
11-
*
12-
* This library is distributed in the hope that it will be useful,
13-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15-
* Lesser General Public License for more details.
16-
*
17-
* You should have received a copy of the GNU Lesser General Public
18-
* License along with this library; if not, write to the Free Software
19-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2+
* PROJECT: ReactOS header
3+
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4+
* PURPOSE: Undocumented shell interface
5+
* COPYRIGHT: Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
6+
* Copyright 2013 Dominik Hornung
7+
* Copyright 2025 Katayama Hirofumi MZ <[email protected]>
208
*/
219

22-
#ifndef __SHLOBJ_UNDOC__H
23-
#define __SHLOBJ_UNDOC__H
10+
#pragma once
11+
12+
#define SHLWAPI_ISHELLFOLDER_HELPERS
13+
#include <shlwapi_undoc.h> // For ASSOCQUERY
2414

2515
#ifdef __cplusplus
2616
extern "C" {
27-
#endif /* defined(__cplusplus) */
17+
#endif
2818

2919
typedef struct tagSLOTITEMDATA
3020
{
@@ -817,12 +807,145 @@ DECLARE_INTERFACE_(ITrayPriv, IUnknown)
817807
#define ITrayPriv_AppendMenu(T,a) (T)->lpVtbl->AppendMenu(T,a)
818808
#endif
819809

810+
/*****************************************************************************
811+
* IAssociationElement interface
812+
*
813+
* @see IAssociationElementOld
814+
* @see https://www.geoffchappell.com/studies/windows/shell/shlwapi/interfaces/iassociationelement.htm
815+
*/
816+
#define INTERFACE IAssociationElement
817+
DECLARE_INTERFACE_(IAssociationElement, IUnknown) // {D8F6AD5B-B44F-4BCC-88FD-EB3473DB7502}
818+
{
819+
/*** IUnknown ***/
820+
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
821+
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
822+
STDMETHOD_(ULONG,Release)(THIS) PURE;
823+
/*** IAssociationElement ***/
824+
STDMETHOD(QueryString)(THIS_ ASSOCQUERY query, PCWSTR key, PWSTR *ppszValue) PURE;
825+
STDMETHOD(QueryDword)(THIS_ ASSOCQUERY query, PCWSTR key, DWORD *pdwValue) PURE;
826+
STDMETHOD(QueryGuid)(THIS_ ASSOCQUERY query, PCWSTR key, GUID *pguid) PURE;
827+
STDMETHOD(QueryExists)(THIS_ ASSOCQUERY query, PCWSTR key) PURE;
828+
STDMETHOD(QueryDirect)(THIS_ ASSOCQUERY query, PCWSTR key, FLAGGED_BYTE_BLOB **ppBlob) PURE;
829+
STDMETHOD(QueryObject)(THIS_ ASSOCQUERY query, PCWSTR key, REFIID riid, PVOID *ppvObj) PURE;
830+
};
831+
#undef INTERFACE
832+
833+
#ifdef COBJMACROS
834+
#define IAssociationElement_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b)
835+
#define IAssociationElement_AddRef(T) (T)->lpVtbl->AddRef(T)
836+
#define IAssociationElement_Release(T) (T)->lpVtbl->Release(T)
837+
#define IAssociationElement_QueryString(T,a,b,c) (T)->lpVtbl->QueryString(T,a,b,c)
838+
#define IAssociationElement_QueryDword(T,a,b,c) (T)->lpVtbl->QueryDword(T,a,b,c)
839+
#define IAssociationElement_QueryGuid(T,a,b,c) (T)->lpVtbl->QueryGuid(T,a,b,c)
840+
#define IAssociationElement_QueryExists(T,a,b) (T)->lpVtbl->QueryExists(T,a,b)
841+
#define IAssociationElement_QueryDirect(T,a,b,c) (T)->lpVtbl->QueryDirect(T,a,b,c)
842+
#define IAssociationElement_QueryObject(T,a,b,c,d) (T)->lpVtbl->QueryObject(T,a,b,c,d)
843+
#endif
844+
845+
/*****************************************************************************
846+
* IEnumAssociationElements interface
847+
*
848+
* @see https://www.geoffchappell.com/studies/windows/shell/shell32/interfaces/ienumassociationelements.htm
849+
*/
850+
#define INTERFACE IEnumAssociationElements
851+
DECLARE_INTERFACE_(IEnumAssociationElements, IUnknown) // {A6B0FB57-7523-4439-9425-EBE99823B828}
852+
{
853+
/*** IUnknown ***/
854+
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
855+
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
856+
STDMETHOD_(ULONG,Release)(THIS) PURE;
857+
/*** IEnumAssociationElements ***/
858+
STDMETHOD(Next)(THIS_ ULONG celt, IAssociationElement *pElement, ULONG *pceltFetched) PURE;
859+
STDMETHOD(Skip)(THIS_ ULONG celt) PURE;
860+
STDMETHOD(Reset)(THIS) PURE;
861+
STDMETHOD(Clone)(THIS_ IEnumAssociationElements **ppNew) PURE;
862+
};
863+
#undef INTERFACE
864+
865+
#ifdef COBJMACROS
866+
#define IEnumAssociationElements_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b)
867+
#define IEnumAssociationElements_AddRef(T) (T)->lpVtbl->AddRef(T)
868+
#define IEnumAssociationElements_Release(T) (T)->lpVtbl->Release(T)
869+
#define IEnumAssociationElements_Next(T,a,b,c) (T)->lpVtbl->Next(T,a,b,c)
870+
#define IEnumAssociationElements_Skip(T,a) (T)->lpVtbl->Skip(T,a)
871+
#define IEnumAssociationElements_Reset(T) (T)->lpVtbl->Reset(T)
872+
#define IEnumAssociationElements_Clone(T,a) (T)->lpVtbl->Clone(T,a)
873+
#endif
874+
875+
/*****************************************************************************
876+
* IAssociationArrayOld interface
877+
*
878+
* @see IAssociationArray
879+
* @see https://www.geoffchappell.com/studies/windows/shell/shell32/interfaces/iassociationarray.htm
880+
*/
881+
#define INTERFACE IAssociationArrayOld
882+
DECLARE_INTERFACE_(IAssociationArrayOld, IUnknown) // {3B877E3C-67DE-4F9A-B29B-17D0A1521C6A}
883+
{
884+
/*** IUnknown ***/
885+
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
886+
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
887+
STDMETHOD_(ULONG,Release)(THIS) PURE;
888+
/*** IAssociationArrayOld ***/
889+
STDMETHOD(EnumElements)(THIS_ ULONG flags, IEnumAssociationElements **ppElement) PURE;
890+
STDMETHOD(QueryString)(THIS_ ULONG flags, ASSOCQUERY query, PCWSTR key, PWSTR *ppszValue) PURE;
891+
STDMETHOD(QueryDword)(THIS_ ULONG flags, ASSOCQUERY query, PCWSTR key, DWORD *pdwValue) PURE;
892+
STDMETHOD(QueryExists)(THIS_ ULONG flags, ASSOCQUERY query, PCWSTR key) PURE;
893+
STDMETHOD(QueryDirect)(THIS_ ULONG flags, ASSOCQUERY query, PCWSTR key, FLAGGED_BYTE_BLOB **ppBlob) PURE;
894+
STDMETHOD(QueryObject)(THIS_ ULONG flags, ASSOCQUERY query, PCWSTR key, REFIID riid, PVOID *ppvObj) PURE;
895+
};
896+
#undef INTERFACE
897+
898+
#ifdef COBJMACROS
899+
#define IAssociationArrayOld_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b)
900+
#define IAssociationArrayOld_AddRef(T) (T)->lpVtbl->AddRef(T)
901+
#define IAssociationArrayOld_Release(T) (T)->lpVtbl->Release(T)
902+
#define IAssociationArrayOld_EnumElements(T,a,b) (T)->lpVtbl->EnumElements(T,a,b)
903+
#define IAssociationArrayOld_QueryString(T,a,b,c,d) (T)->lpVtbl->QueryString(T,a,b,c,d)
904+
#define IAssociationArrayOld_QueryDword(T,a,b,c,d) (T)->lpVtbl->QueryDword(T,a,b,c,d)
905+
#define IAssociationArrayOld_QueryExists(T,a,b,c) (T)->lpVtbl->QueryExists(T,a,b,c)
906+
#define IAssociationArrayOld_QueryDirect(T,a,b,c,d) (T)->lpVtbl->QueryDirect(T,a,b,c,d)
907+
#define IAssociationArrayOld_QueryObject(T,a,b,c,d,e) (T)->lpVtbl->QueryObject(T,a,b,c,d,e)
908+
#endif
909+
910+
/*****************************************************************************
911+
* IAssociationArray interface
912+
*
913+
* @see IAssociationArrayOld
914+
* @see https://www.geoffchappell.com/studies/windows/shell/shell32/interfaces/iassociationarray.htm
915+
*/
916+
#define INTERFACE IAssociationArray
917+
DECLARE_INTERFACE_(IAssociationArray, IUnknown) // {19ADBAFD-1C5F-4FC7-94EE-846702DFB58B}
918+
{
919+
/*** IUnknown ***/
920+
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
921+
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
922+
STDMETHOD_(ULONG,Release)(THIS) PURE;
923+
/*** IAssociationArray ***/
924+
STDMETHOD(QueryString)(THIS_ ASSOCQUERY query, PCWSTR key, PWSTR *ppszValue) PURE;
925+
STDMETHOD(QueryDword)(THIS_ ASSOCQUERY query, PCWSTR key, DWORD *pdwValue) PURE;
926+
STDMETHOD(QueryGuid)(THIS_ ASSOCQUERY query, PCWSTR key, GUID *pguid) PURE;
927+
STDMETHOD(QueryExists)(THIS_ ASSOCQUERY query, PCWSTR key) PURE;
928+
STDMETHOD(QueryDirect)(THIS_ ASSOCQUERY query, PCWSTR key, FLAGGED_BYTE_BLOB **ppBlob) PURE;
929+
STDMETHOD(QueryObject)(THIS_ ASSOCQUERY query, PCWSTR key, REFIID riid, PVOID *ppvObj) PURE;
930+
};
931+
#undef INTERFACE
932+
933+
#ifdef COBJMACROS
934+
#define IAssociationArray_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b)
935+
#define IAssociationArray_AddRef(T) (T)->lpVtbl->AddRef(T)
936+
#define IAssociationArray_Release(T) (T)->lpVtbl->Release(T)
937+
#define IAssociationArray_QueryString(T,a,b,c) (T)->lpVtbl->QueryString(T,a,b,c)
938+
#define IAssociationArray_QueryDword(T,a,b,c) (T)->lpVtbl->QueryDword(T,a,b,c)
939+
#define IAssociationArray_QueryGuid(T,a,b,c) (T)->lpVtbl->QueryGuid(T,a,b,c)
940+
#define IAssociationArray_QueryExists(T,a,b) (T)->lpVtbl->QueryExists(T,a,b)
941+
#define IAssociationArray_QueryDirect(T,a,b,c) (T)->lpVtbl->QueryDirect(T,a,b,c)
942+
#define IAssociationArray_QueryObject(T,a,b,c,d) (T)->lpVtbl->QueryObject(T,a,b,c,d)
943+
#endif
944+
820945
HANDLE WINAPI SHCreateDesktop(IShellDesktopTray*);
821946
BOOL WINAPI SHDesktopMessageLoop(HANDLE);
822947
HRESULT WINAPI SHCreateFileDataObject(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IDataObject* pDataInner, IDataObject** ppDataObj);
823948

824949
#ifdef __cplusplus
825950
} /* extern "C" */
826-
#endif /* defined(__cplusplus) */
827-
828-
#endif // __SHLOBJ_UNDOC__H
951+
#endif

sdk/include/reactos/shlwapi_undoc.h

Lines changed: 63 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,38 @@
11
/*
2-
* ReactOS shlwapi
3-
*
4-
* Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
5-
*
6-
* This library is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU Lesser General Public
8-
* License as published by the Free Software Foundation; either
9-
* version 2.1 of the License, or (at your option) any later version.
10-
*
11-
* This library is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* Lesser General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU Lesser General Public
17-
* License along with this library; if not, write to the Free Software
18-
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2+
* PROJECT: ReactOS header
3+
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4+
* PURPOSE: Undocumented SHLWAPI definitions
5+
* COPYRIGHT: Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
6+
* Copyright 2025 Katayama Hirofumi MZ <[email protected]>
197
*/
208

21-
#ifndef __SHLWAPI_UNDOC_H
22-
#define __SHLWAPI_UNDOC_H
9+
#pragma once
10+
11+
#include <winreg.h> // For REGSAM
2312

2413
#ifdef __cplusplus
2514
extern "C" {
26-
#endif /* defined(__cplusplus) */
15+
#endif
16+
17+
/*****************************************************************************
18+
* ASSOCQUERY --- The type flags of association query
19+
*
20+
* @see IAssociationElementOld, IAssociationElement, IAssociationArrayOld, IAssociationArray
21+
* @see https://www.geoffchappell.com/studies/windows/shell/shell32/api/assocelem/query.htm
22+
*/
23+
typedef DWORD ASSOCQUERY;
24+
#define ASSOCQUERY_LOWORD_MASK 0x0000FFFF // The low-order word of flags
25+
#define ASSOCQUERY_STRING 0x00010000 // Responds to QueryString method
26+
#define ASSOCQUERY_EXISTS 0x00020000 // Responds to QueryExists method
27+
#define ASSOCQUERY_DIRECT 0x00040000 // Responds to QueryDirect method
28+
#define ASSOCQUERY_DWORD 0x00080000 // Responds to QueryDword method
29+
#define ASSOCQUERY_INDIRECT 0x00100000 // Obtains resource string from QueryString
30+
#define ASSOCQUERY_OBJECT 0x00200000 // Responds to QueryObject method
31+
#define ASSOCQUERY_GUID 0x00400000 // Responds to QueryGuid method
32+
#define ASSOCQUERY_EXTRA_NON_VERB 0x01000000 // Expects pszExtra for path or value
33+
#define ASSOCQUERY_EXTRA_VERB 0x02000000 // Expects pszExtra for verb
34+
#define ASSOCQUERY_SIGNIFICANCE 0x04000000 // Significance unknown
35+
#define ASSOCQUERY_FALLBACK 0x80000000 // Fallback to secondary query source
2736

2837
#define SHELL_NO_POLICY ((DWORD)-1)
2938

@@ -402,8 +411,39 @@ IShellFolder_CompareIDs(
402411
_In_ PCUIDLIST_RELATIVE pidl2);
403412
#endif /* SHLWAPI_ISHELLFOLDER_HELPERS */
404413

414+
/*****************************************************************************
415+
* IAssociationElementOld interface
416+
*
417+
* @see IAssociationElement
418+
* @see https://www.geoffchappell.com/studies/windows/shell/shlwapi/interfaces/iassociationelement.htm
419+
*/
420+
#define INTERFACE IAssociationElementOld
421+
DECLARE_INTERFACE_(IAssociationElementOld, IUnknown) // {E58B1ABF-9596-4DBA-8997-89DCDEF46992}
422+
{
423+
/*** IUnknown ***/
424+
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
425+
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
426+
STDMETHOD_(ULONG,Release)(THIS) PURE;
427+
/*** IAssociationElementOld ***/
428+
STDMETHOD(QueryString)(THIS_ ASSOCQUERY query, PCWSTR key, PWSTR *ppszValue) PURE;
429+
STDMETHOD(QueryDword)(THIS_ ASSOCQUERY query, PCWSTR key, DWORD *pdwValue) PURE;
430+
STDMETHOD(QueryExists)(THIS_ ASSOCQUERY query, PCWSTR key) PURE;
431+
STDMETHOD(QueryDirect)(THIS_ ASSOCQUERY query, PCWSTR key, FLAGGED_BYTE_BLOB **ppBlob) PURE;
432+
STDMETHOD(QueryObject)(THIS_ ASSOCQUERY query, PCWSTR key, REFIID riid, PVOID *ppvObj) PURE;
433+
};
434+
#undef INTERFACE
435+
436+
#ifdef COBJMACROS
437+
#define IAssociationElementOld_QueryInterface(T,a,b) (T)->lpVtbl->QueryInterface(T,a,b)
438+
#define IAssociationElementOld_AddRef(T) (T)->lpVtbl->AddRef(T)
439+
#define IAssociationElementOld_Release(T) (T)->lpVtbl->Release(T)
440+
#define IAssociationElementOld_QueryString(T,a,b,c) (T)->lpVtbl->QueryString(T,a,b,c)
441+
#define IAssociationElementOld_QueryDword(T,a,b,c) (T)->lpVtbl->QueryDword(T,a,b,c)
442+
#define IAssociationElementOld_QueryExists(T,a,b) (T)->lpVtbl->QueryExists(T,a,b)
443+
#define IAssociationElementOld_QueryDirect(T,a,b,c) (T)->lpVtbl->QueryDirect(T,a,b,c)
444+
#define IAssociationElementOld_QueryObject(T,a,b,c,d) (T)->lpVtbl->QueryObject(T,a,b,c,d)
445+
#endif
446+
405447
#ifdef __cplusplus
406448
} /* extern "C" */
407-
#endif /* defined(__cplusplus) */
408-
409-
#endif /* __SHLWAPI_UNDOC_H */
449+
#endif

0 commit comments

Comments
 (0)