2 * IQueryAssociations object and helper functions
4 * Copyright 2002 Jon Griffiths
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wine/unicode.h"
31 #include "wine/debug.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
35 /**************************************************************************
36 * IQueryAssociations {SHLWAPI}
39 * This object provides a layer of abstraction over the system registry in
40 * order to simplify the process of parsing associations between files.
41 * Associations in this context means the registry entries that link (for
42 * example) the extension of a file with its description, list of
43 * applications to open the file with, and actions that can be performed on it
44 * (the shell displays such information in the context menu of explorer
45 * when you right-click on a file).
48 * You can use this object transparently by calling the helper functions
49 * AssocQueryKeyA(), AssocQueryStringA() and AssocQueryStringByKeyA(). These
50 * create an IQueryAssociations object, perform the requested actions
51 * and then dispose of the object. Alternatively, you can create an instance
52 * of the object using AssocCreate() and call the following methods on it:
57 /* Default IQueryAssociations::Init() flags */
58 #define SHLWAPI_DEF_ASSOCF (ASSOCF_INIT_BYEXENAME|ASSOCF_INIT_DEFAULTTOSTAR| \
59 ASSOCF_INIT_DEFAULTTOFOLDER)
63 const IQueryAssociationsVtbl
*lpVtbl
;
67 } IQueryAssociationsImpl
;
69 static const IQueryAssociationsVtbl IQueryAssociations_vtbl
;
71 /**************************************************************************
72 * IQueryAssociations_Constructor [internal]
74 * Construct a new IQueryAssociations object.
76 static IQueryAssociations
* IQueryAssociations_Constructor(void)
78 IQueryAssociationsImpl
* iface
;
80 iface
= HeapAlloc(GetProcessHeap(),0,sizeof(IQueryAssociationsImpl
));
81 iface
->lpVtbl
= &IQueryAssociations_vtbl
;
83 iface
->hkeySource
= NULL
;
84 iface
->hkeyProgID
= NULL
;
86 TRACE("Returning IQueryAssociations* %p\n", iface
);
87 return (IQueryAssociations
*)iface
;
90 /*************************************************************************
93 * Internal helper function: Convert ASCII parameter to Unicode.
95 static BOOL
SHLWAPI_ParamAToW(LPCSTR lpszParam
, LPWSTR lpszBuff
, DWORD dwLen
,
100 DWORD dwStrLen
= MultiByteToWideChar(CP_ACP
, 0, lpszParam
, -1, NULL
, 0);
102 if (dwStrLen
< dwLen
)
104 *lpszOut
= lpszBuff
; /* Use Buffer, it is big enough */
108 /* Create a new buffer big enough for the string */
109 *lpszOut
= HeapAlloc(GetProcessHeap(), 0,
110 dwStrLen
* sizeof(WCHAR
));
114 MultiByteToWideChar(CP_ACP
, 0, lpszParam
, -1, *lpszOut
, dwStrLen
);
121 /*************************************************************************
122 * AssocCreate [SHLWAPI.@]
124 * Create a new IQueryAssociations object.
127 * clsid [I] CLSID of object
128 * refiid [I] REFIID of interface
129 * lpInterface [O] Destination for the created IQueryAssociations object
132 * Success: S_OK. lpInterface contains the new object.
133 * Failure: An HRESULT error code indicating the error.
136 * refiid must be equal to IID_IQueryAssociations, or this function will fail.
138 HRESULT WINAPI
AssocCreate(CLSID clsid
, REFIID refiid
, void **lpInterface
)
141 IQueryAssociations
* lpAssoc
;
143 TRACE("(%s,%s,%p)\n", debugstr_guid(&clsid
), debugstr_guid(refiid
),
149 *(DWORD
*)lpInterface
= 0;
151 if (!IsEqualGUID(&clsid
, &IID_IQueryAssociations
))
154 lpAssoc
= IQueryAssociations_Constructor();
157 return E_OUTOFMEMORY
;
159 hRet
= IQueryAssociations_QueryInterface(lpAssoc
, refiid
, lpInterface
);
160 IQueryAssociations_Release(lpAssoc
);
164 /*************************************************************************
165 * AssocQueryKeyW [SHLWAPI.@]
167 * See AssocQueryKeyA.
169 HRESULT WINAPI
AssocQueryKeyW(ASSOCF cfFlags
, ASSOCKEY assockey
, LPCWSTR pszAssoc
,
170 LPCWSTR pszExtra
, HKEY
*phkeyOut
)
173 IQueryAssociations
* lpAssoc
;
175 TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags
, assockey
, debugstr_w(pszAssoc
),
176 debugstr_w(pszExtra
), phkeyOut
);
178 lpAssoc
= IQueryAssociations_Constructor();
181 return E_OUTOFMEMORY
;
183 cfFlags
&= SHLWAPI_DEF_ASSOCF
;
184 hRet
= IQueryAssociations_Init(lpAssoc
, cfFlags
, pszAssoc
, NULL
, NULL
);
187 hRet
= IQueryAssociations_GetKey(lpAssoc
, cfFlags
, assockey
, pszExtra
, phkeyOut
);
189 IQueryAssociations_Release(lpAssoc
);
193 /*************************************************************************
194 * AssocQueryKeyA [SHLWAPI.@]
196 * Get a file association key from the registry.
199 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
200 * assockey [I] Type of key to get
201 * pszAssoc [I] Key name to search below
202 * pszExtra [I] Extra information about the key location
203 * phkeyOut [O] Destination for the association key
206 * Success: S_OK. phkeyOut contains the key.
207 * Failure: An HRESULT error code indicating the error.
209 HRESULT WINAPI
AssocQueryKeyA(ASSOCF cfFlags
, ASSOCKEY assockey
, LPCSTR pszAssoc
,
210 LPCSTR pszExtra
, HKEY
*phkeyOut
)
212 WCHAR szAssocW
[MAX_PATH
], *lpszAssocW
= NULL
;
213 WCHAR szExtraW
[MAX_PATH
], *lpszExtraW
= NULL
;
214 HRESULT hRet
= E_OUTOFMEMORY
;
216 TRACE("(0x%8x,0x%8x,%s,%s,%p)\n", cfFlags
, assockey
, debugstr_a(pszAssoc
),
217 debugstr_a(pszExtra
), phkeyOut
);
219 if (SHLWAPI_ParamAToW(pszAssoc
, szAssocW
, MAX_PATH
, &lpszAssocW
) &&
220 SHLWAPI_ParamAToW(pszExtra
, szExtraW
, MAX_PATH
, &lpszExtraW
))
222 hRet
= AssocQueryKeyW(cfFlags
, assockey
, lpszAssocW
, lpszExtraW
, phkeyOut
);
225 if (lpszAssocW
!= szAssocW
)
226 HeapFree(GetProcessHeap(), 0, lpszAssocW
);
228 if (lpszExtraW
!= szExtraW
)
229 HeapFree(GetProcessHeap(), 0, lpszExtraW
);
234 /*************************************************************************
235 * AssocQueryStringW [SHLWAPI.@]
237 * See AssocQueryStringA.
239 HRESULT WINAPI
AssocQueryStringW(ASSOCF cfFlags
, ASSOCSTR str
, LPCWSTR pszAssoc
,
240 LPCWSTR pszExtra
, LPWSTR pszOut
, DWORD
*pcchOut
)
243 IQueryAssociations
* lpAssoc
;
245 TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags
, str
, debugstr_w(pszAssoc
),
246 debugstr_w(pszExtra
), pszOut
, pcchOut
);
251 lpAssoc
= IQueryAssociations_Constructor();
254 return E_OUTOFMEMORY
;
256 hRet
= IQueryAssociations_Init(lpAssoc
, cfFlags
& SHLWAPI_DEF_ASSOCF
,
257 pszAssoc
, NULL
, NULL
);
260 hRet
= IQueryAssociations_GetString(lpAssoc
, cfFlags
, str
, pszExtra
,
263 IQueryAssociations_Release(lpAssoc
);
267 /*************************************************************************
268 * AssocQueryStringA [SHLWAPI.@]
270 * Get a file association string from the registry.
273 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
274 * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h")
275 * pszAssoc [I] Key name to search below
276 * pszExtra [I] Extra information about the string location
277 * pszOut [O] Destination for the association string
278 * pcchOut [O] Length of pszOut
281 * Success: S_OK. pszOut contains the string, pcchOut contains its length.
282 * Failure: An HRESULT error code indicating the error.
284 HRESULT WINAPI
AssocQueryStringA(ASSOCF cfFlags
, ASSOCSTR str
, LPCSTR pszAssoc
,
285 LPCSTR pszExtra
, LPSTR pszOut
, DWORD
*pcchOut
)
287 WCHAR szAssocW
[MAX_PATH
], *lpszAssocW
= NULL
;
288 WCHAR szExtraW
[MAX_PATH
], *lpszExtraW
= NULL
;
289 HRESULT hRet
= E_OUTOFMEMORY
;
291 TRACE("(0x%8x,0x%8x,%s,%s,%p,%p)\n", cfFlags
, str
, debugstr_a(pszAssoc
),
292 debugstr_a(pszExtra
), pszOut
, pcchOut
);
296 else if (SHLWAPI_ParamAToW(pszAssoc
, szAssocW
, MAX_PATH
, &lpszAssocW
) &&
297 SHLWAPI_ParamAToW(pszExtra
, szExtraW
, MAX_PATH
, &lpszExtraW
))
299 WCHAR szReturnW
[MAX_PATH
], *lpszReturnW
= szReturnW
;
300 DWORD dwLenOut
= *pcchOut
;
302 if (dwLenOut
>= MAX_PATH
)
303 lpszReturnW
= HeapAlloc(GetProcessHeap(), 0,
304 (dwLenOut
+ 1) * sizeof(WCHAR
));
307 hRet
= E_OUTOFMEMORY
;
310 hRet
= AssocQueryStringW(cfFlags
, str
, lpszAssocW
, lpszExtraW
,
311 lpszReturnW
, &dwLenOut
);
314 WideCharToMultiByte(CP_ACP
,0,szReturnW
,-1,pszOut
,dwLenOut
,0,0);
317 if (lpszReturnW
!= szReturnW
)
318 HeapFree(GetProcessHeap(), 0, lpszReturnW
);
322 if (lpszAssocW
!= szAssocW
)
323 HeapFree(GetProcessHeap(), 0, lpszAssocW
);
324 if (lpszExtraW
!= szExtraW
)
325 HeapFree(GetProcessHeap(), 0, lpszExtraW
);
329 /*************************************************************************
330 * AssocQueryStringByKeyW [SHLWAPI.@]
332 * See AssocQueryStringByKeyA.
334 HRESULT WINAPI
AssocQueryStringByKeyW(ASSOCF cfFlags
, ASSOCSTR str
, HKEY hkAssoc
,
335 LPCWSTR pszExtra
, LPWSTR pszOut
,
339 IQueryAssociations
* lpAssoc
;
341 TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags
, str
, hkAssoc
,
342 debugstr_w(pszExtra
), pszOut
, pcchOut
);
344 lpAssoc
= IQueryAssociations_Constructor();
347 return E_OUTOFMEMORY
;
349 cfFlags
&= SHLWAPI_DEF_ASSOCF
;
350 hRet
= IQueryAssociations_Init(lpAssoc
, cfFlags
, 0, hkAssoc
, NULL
);
353 hRet
= IQueryAssociations_GetString(lpAssoc
, cfFlags
, str
, pszExtra
,
356 IQueryAssociations_Release(lpAssoc
);
360 /*************************************************************************
361 * AssocQueryStringByKeyA [SHLWAPI.@]
363 * Get a file association string from the registry, given a starting key.
366 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
367 * str [I] Type of string to get
368 * hkAssoc [I] Key to search below
369 * pszExtra [I] Extra information about the string location
370 * pszOut [O] Destination for the association string
371 * pcchOut [O] Length of pszOut
374 * Success: S_OK. pszOut contains the string, pcchOut contains its length.
375 * Failure: An HRESULT error code indicating the error.
377 HRESULT WINAPI
AssocQueryStringByKeyA(ASSOCF cfFlags
, ASSOCSTR str
, HKEY hkAssoc
,
378 LPCSTR pszExtra
, LPSTR pszOut
,
381 WCHAR szExtraW
[MAX_PATH
], *lpszExtraW
= szExtraW
;
382 WCHAR szReturnW
[MAX_PATH
], *lpszReturnW
= szReturnW
;
383 HRESULT hRet
= E_OUTOFMEMORY
;
385 TRACE("(0x%8x,0x%8x,%p,%s,%p,%p)\n", cfFlags
, str
, hkAssoc
,
386 debugstr_a(pszExtra
), pszOut
, pcchOut
);
390 else if (SHLWAPI_ParamAToW(pszExtra
, szExtraW
, MAX_PATH
, &lpszExtraW
))
392 DWORD dwLenOut
= *pcchOut
;
393 if (dwLenOut
>= MAX_PATH
)
394 lpszReturnW
= HeapAlloc(GetProcessHeap(), 0,
395 (dwLenOut
+ 1) * sizeof(WCHAR
));
399 hRet
= AssocQueryStringByKeyW(cfFlags
, str
, hkAssoc
, lpszExtraW
,
400 lpszReturnW
, &dwLenOut
);
403 WideCharToMultiByte(CP_ACP
,0,szReturnW
,-1,pszOut
,dwLenOut
,0,0);
406 if (lpszReturnW
!= szReturnW
)
407 HeapFree(GetProcessHeap(), 0, lpszReturnW
);
411 if (lpszExtraW
!= szExtraW
)
412 HeapFree(GetProcessHeap(), 0, lpszExtraW
);
417 /**************************************************************************
418 * AssocIsDangerous (SHLWAPI.@)
420 * Determine if a file association is dangerous (potentially malware).
423 * lpszAssoc [I] Name of file or file extension to check.
426 * TRUE, if lpszAssoc may potentially be malware (executable),
429 BOOL WINAPI
AssocIsDangerous(LPCWSTR lpszAssoc
)
431 FIXME("%s\n", debugstr_w(lpszAssoc
));
435 /**************************************************************************
436 * IQueryAssociations_QueryInterface {SHLWAPI}
438 * See IUnknown_QueryInterface.
440 static HRESULT WINAPI
IQueryAssociations_fnQueryInterface(
441 IQueryAssociations
* iface
,
445 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
447 TRACE("(%p,%s,%p)\n",This
, debugstr_guid(riid
), ppvObj
);
451 if (IsEqualIID(riid
, &IID_IUnknown
) ||
452 IsEqualIID(riid
, &IID_IQueryAssociations
))
454 *ppvObj
= (IQueryAssociations
*)This
;
456 IQueryAssociations_AddRef((IQueryAssociations
*)*ppvObj
);
457 TRACE("Returning IQueryAssociations (%p)\n", *ppvObj
);
460 TRACE("Returning E_NOINTERFACE\n");
461 return E_NOINTERFACE
;
464 /**************************************************************************
465 * IQueryAssociations_AddRef {SHLWAPI}
467 * See IUnknown_AddRef.
469 static ULONG WINAPI
IQueryAssociations_fnAddRef(IQueryAssociations
*iface
)
471 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
472 ULONG refCount
= InterlockedIncrement(&This
->ref
);
474 TRACE("(%p)->(ref before=%u)\n",This
, refCount
- 1);
479 /**************************************************************************
480 * IQueryAssociations_Release {SHLWAPI}
482 * See IUnknown_Release.
484 static ULONG WINAPI
IQueryAssociations_fnRelease(IQueryAssociations
*iface
)
486 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
487 ULONG refCount
= InterlockedDecrement(&This
->ref
);
489 TRACE("(%p)->(ref before=%u)\n",This
, refCount
+ 1);
493 TRACE("Destroying IQueryAssociations (%p)\n", This
);
494 RegCloseKey(This
->hkeySource
);
495 RegCloseKey(This
->hkeyProgID
);
496 HeapFree(GetProcessHeap(), 0, This
);
502 /**************************************************************************
503 * IQueryAssociations_Init {SHLWAPI}
505 * Initialise an IQueryAssociations object.
508 * iface [I] IQueryAssociations interface to initialise
509 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
510 * pszAssoc [I] String for the root key name, or NULL if hkeyProgid is given
511 * hkeyProgid [I] Handle for the root key, or NULL if pszAssoc is given
512 * hWnd [I] Reserved, must be NULL.
515 * Success: S_OK. iface is initialised with the parameters given.
516 * Failure: An HRESULT error code indicating the error.
518 static HRESULT WINAPI
IQueryAssociations_fnInit(
519 IQueryAssociations
*iface
,
525 static const WCHAR szProgID
[] = {'P','r','o','g','I','D',0};
526 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
529 TRACE("(%p)->(%d,%s,%p,%p)\n", iface
,
531 debugstr_w(pszAssoc
),
535 FIXME("hwnd != NULL not supported\n");
537 FIXME("unsupported flags: %x\n", cfFlags
);
538 if (pszAssoc
!= NULL
)
540 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
,
545 if (ret
!= ERROR_SUCCESS
)
547 /* if this is not a prog id */
548 if ((*pszAssoc
== '.') || (*pszAssoc
== '{'))
550 RegOpenKeyExW(This
->hkeySource
,
557 This
->hkeyProgID
= This
->hkeySource
;
560 else if (hkeyProgid
!= NULL
)
562 This
->hkeyProgID
= hkeyProgid
;
569 static HRESULT
ASSOC_GetValue(HKEY hkey
, WCHAR
** pszText
)
575 ret
= RegQueryValueExW(hkey
, NULL
, 0, NULL
, NULL
, &len
);
576 if (ret
!= ERROR_SUCCESS
)
577 return HRESULT_FROM_WIN32(ret
);
580 *pszText
= HeapAlloc(GetProcessHeap(), 0, len
);
582 return E_OUTOFMEMORY
;
583 ret
= RegQueryValueExW(hkey
, NULL
, 0, NULL
, (LPBYTE
)*pszText
,
585 if (ret
!= ERROR_SUCCESS
)
587 HeapFree(GetProcessHeap(), 0, *pszText
);
588 return HRESULT_FROM_WIN32(ret
);
593 /**************************************************************************
594 * IQueryAssociations_GetString {SHLWAPI}
596 * Get a file association string from the registry.
599 * iface [I] IQueryAssociations interface to query
600 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
601 * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h")
602 * pszExtra [I] Extra information about the string location
603 * pszOut [O] Destination for the association string
604 * pcchOut [I/O] Length of pszOut
607 * Success: S_OK. pszOut contains the string, pcchOut contains its length.
608 * Failure: An HRESULT error code indicating the error.
610 static HRESULT WINAPI
IQueryAssociations_fnGetString(
611 IQueryAssociations
*iface
,
618 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
619 const ASSOCF cfUnimplemented
= ~(0);
627 WCHAR path
[MAX_PATH
];
630 WCHAR
* pszExtraFromReg
;
633 static const WCHAR commandW
[] = { 'c','o','m','m','a','n','d',0 };
634 static const WCHAR shellW
[] = { 's','h','e','l','l',0 };
636 TRACE("(%p,0x%8x,0x%8x,%s,%p,%p)\n", This
, cfFlags
, str
,
637 debugstr_w(pszExtra
), pszOut
, pcchOut
);
639 if (cfFlags
& cfUnimplemented
)
640 FIXME("%08x: unimplemented flags!\n", cfFlags
& cfUnimplemented
);
647 case ASSOCSTR_EXECUTABLE
:
649 hr
= ASSOC_GetValue(This
->hkeySource
, &pszFileType
);
652 ret
= RegOpenKeyExW(HKEY_CLASSES_ROOT
, pszFileType
, 0, KEY_READ
,
654 HeapFree(GetProcessHeap(), 0, pszFileType
);
655 if (ret
!= ERROR_SUCCESS
)
656 return HRESULT_FROM_WIN32(ret
);
658 ret
= RegOpenKeyExW(hkeyFile
, shellW
, 0, KEY_READ
, &hkeyShell
);
659 RegCloseKey(hkeyFile
);
660 if (ret
!= ERROR_SUCCESS
)
661 return HRESULT_FROM_WIN32(ret
);
665 hr
= ASSOC_GetValue(hkeyShell
, &pszExtraFromReg
);
668 RegCloseKey(hkeyShell
);
673 ret
= RegOpenKeyExW(hkeyShell
, pszExtra
? pszExtra
: pszExtraFromReg
,
674 0, KEY_READ
, &hkeyVerb
);
675 HeapFree(GetProcessHeap(), 0, pszExtraFromReg
);
676 RegCloseKey(hkeyShell
);
677 if (ret
!= ERROR_SUCCESS
)
678 return HRESULT_FROM_WIN32(ret
);
680 ret
= RegOpenKeyExW(hkeyVerb
, commandW
, 0, KEY_READ
, &hkeyCommand
);
681 RegCloseKey(hkeyVerb
);
682 if (ret
!= ERROR_SUCCESS
)
683 return HRESULT_FROM_WIN32(ret
);
684 hr
= ASSOC_GetValue(hkeyCommand
, &pszCommand
);
685 RegCloseKey(hkeyCommand
);
689 /* cleanup pszCommand */
690 if (pszCommand
[0] == '"')
692 pszStart
= pszCommand
+ 1;
693 pszEnd
= strchrW(pszStart
, '"');
697 pszStart
= pszCommand
;
698 pszEnd
= strchrW(pszStart
, ' ');
703 len
= SearchPathW(NULL
, pszStart
, NULL
, MAX_PATH
, path
, NULL
);
704 HeapFree(GetProcessHeap(), 0, pszCommand
);
706 return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND
);
717 lstrcpynW(pszOut
, path
, len
);
729 FIXME("assocstr %d unimplemented!\n", str
);
734 /**************************************************************************
735 * IQueryAssociations_GetKey {SHLWAPI}
737 * Get a file association key from the registry.
740 * iface [I] IQueryAssociations interface to query
741 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
742 * assockey [I] Type of key to get (ASSOCKEY enum from "shlwapi.h")
743 * pszExtra [I] Extra information about the key location
744 * phkeyOut [O] Destination for the association key
747 * Success: S_OK. phkeyOut contains a handle to the key.
748 * Failure: An HRESULT error code indicating the error.
750 static HRESULT WINAPI
IQueryAssociations_fnGetKey(
751 IQueryAssociations
*iface
,
757 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
759 FIXME("(%p,0x%8x,0x%8x,%s,%p)-stub!\n", This
, cfFlags
, assockey
,
760 debugstr_w(pszExtra
), phkeyOut
);
764 /**************************************************************************
765 * IQueryAssociations_GetData {SHLWAPI}
767 * Get the data for a file association key from the registry.
770 * iface [I] IQueryAssociations interface to query
771 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
772 * assocdata [I] Type of data to get (ASSOCDATA enum from "shlwapi.h")
773 * pszExtra [I] Extra information about the data location
774 * pvOut [O] Destination for the association key
775 * pcbOut [I/O] Size of pvOut
778 * Success: S_OK. pszOut contains the data, pcbOut contains its length.
779 * Failure: An HRESULT error code indicating the error.
781 static HRESULT WINAPI
IQueryAssociations_fnGetData(
782 IQueryAssociations
*iface
,
789 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
791 FIXME("(%p,0x%8x,0x%8x,%s,%p,%p)-stub!\n", This
, cfFlags
, assocdata
,
792 debugstr_w(pszExtra
), pvOut
, pcbOut
);
796 /**************************************************************************
797 * IQueryAssociations_GetEnum {SHLWAPI}
799 * Not yet implemented in native Win32.
802 * iface [I] IQueryAssociations interface to query
803 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
804 * assocenum [I] Type of enum to get (ASSOCENUM enum from "shlwapi.h")
805 * pszExtra [I] Extra information about the enum location
806 * riid [I] REFIID to look for
807 * ppvOut [O] Destination for the interface.
811 * Failure: An HRESULT error code indicating the error.
814 * Presumably this function returns an enumerator object.
816 static HRESULT WINAPI
IQueryAssociations_fnGetEnum(
817 IQueryAssociations
*iface
,
824 IQueryAssociationsImpl
*This
= (IQueryAssociationsImpl
*)iface
;
826 FIXME("(%p,0x%8x,0x%8x,%s,%s,%p)-stub!\n", This
, cfFlags
, assocenum
,
827 debugstr_w(pszExtra
), debugstr_guid(riid
), ppvOut
);
831 static const IQueryAssociationsVtbl IQueryAssociations_vtbl
=
833 IQueryAssociations_fnQueryInterface
,
834 IQueryAssociations_fnAddRef
,
835 IQueryAssociations_fnRelease
,
836 IQueryAssociations_fnInit
,
837 IQueryAssociations_fnGetString
,
838 IQueryAssociations_fnGetKey
,
839 IQueryAssociations_fnGetData
,
840 IQueryAssociations_fnGetEnum