ReactOS 0.4.15-dev-7659-ga55345b
CQueryAssociations.cpp
Go to the documentation of this file.
1/*
2 * IQueryAssociations object and helper functions
3 *
4 * Copyright 2002 Jon Griffiths
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#include "precomp.h"
22
24
25/**************************************************************************
26 * IQueryAssociations
27 *
28 * DESCRIPTION
29 * This object provides a layer of abstraction over the system registry in
30 * order to simplify the process of parsing associations between files.
31 * Associations in this context means the registry entries that link (for
32 * example) the extension of a file with its description, list of
33 * applications to open the file with, and actions that can be performed on it
34 * (the shell displays such information in the context menu of explorer
35 * when you right-click on a file).
36 *
37 * HELPERS
38 * You can use this object transparently by calling the helper functions
39 * AssocQueryKeyA(), AssocQueryStringA() and AssocQueryStringByKeyA(). These
40 * create an IQueryAssociations object, perform the requested actions
41 * and then dispose of the object. Alternatively, you can create an instance
42 * of the object using AssocCreate() and call the following methods on it:
43 *
44 * METHODS
45 */
46
47CQueryAssociations::CQueryAssociations() : hkeySource(0), hkeyProgID(0)
48{
49}
50
52{
53}
54
55/**************************************************************************
56 * IQueryAssociations_Init
57 *
58 * Initialise an IQueryAssociations object.
59 *
60 * PARAMS
61 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
62 * pszAssoc [I] String for the root key name, or NULL if hkeyProgid is given
63 * hkeyProgid [I] Handle for the root key, or NULL if pszAssoc is given
64 * hWnd [I] Reserved, must be NULL.
65 *
66 * RETURNS
67 * Success: S_OK. iface is initialised with the parameters given.
68 * Failure: An HRESULT error code indicating the error.
69 */
71 ASSOCF cfFlags,
72 LPCWSTR pszAssoc,
73 HKEY hkeyProgid,
74 HWND hWnd)
75{
76 TRACE("(%p)->(%d,%s,%p,%p)\n", this,
77 cfFlags,
78 debugstr_w(pszAssoc),
79 hkeyProgid,
80 hWnd);
81
82 if (hWnd != NULL)
83 {
84 FIXME("hwnd != NULL not supported\n");
85 }
86
87 if (cfFlags != 0)
88 {
89 FIXME("unsupported flags: %x\n", cfFlags);
90 }
91
94 this->hkeySource = this->hkeyProgID = NULL;
95 if (pszAssoc != NULL)
96 {
97 WCHAR *progId;
98 HRESULT hr;
99
101 pszAssoc,
102 0,
103 KEY_READ,
104 &this->hkeySource);
105 if (ret)
106 {
107 return S_OK;
108 }
109
110 /* if this is a progid */
111 if (*pszAssoc != '.' && *pszAssoc != '{')
112 {
113 this->hkeyProgID = this->hkeySource;
114 return S_OK;
115 }
116
117 /* if it's not a progid, it's a file extension or clsid */
118 if (*pszAssoc == '.')
119 {
120 /* for a file extension, the progid is the default value */
121 hr = this->GetValue(this->hkeySource, NULL, (void**)&progId, NULL);
122 if (FAILED(hr))
123 return S_OK;
124 }
125 else /* if (*pszAssoc == '{') */
126 {
127 HKEY progIdKey;
128 /* for a clsid, the progid is the default value of the ProgID subkey */
129 ret = RegOpenKeyExW(this->hkeySource, L"ProgID", 0, KEY_READ, &progIdKey);
130 if (ret != ERROR_SUCCESS)
131 return S_OK;
132 hr = this->GetValue(progIdKey, NULL, (void**)&progId, NULL);
133 if (FAILED(hr))
134 return S_OK;
135 RegCloseKey(progIdKey);
136 }
137
138 /* open the actual progid key, the one with the shell subkey */
140 progId,
141 0,
142 KEY_READ,
143 &this->hkeyProgID);
144 HeapFree(GetProcessHeap(), 0, progId);
145
146 return S_OK;
147 }
148 else if (hkeyProgid != NULL)
149 {
150 /* reopen the key so we don't end up closing a key owned by the caller */
151 RegOpenKeyExW(hkeyProgid, NULL, 0, KEY_READ, &this->hkeyProgID);
152 this->hkeySource = this->hkeyProgID;
153 return S_OK;
154 }
155 else
156 return E_INVALIDARG;
157}
158
159/**************************************************************************
160 * IQueryAssociations_GetString
161 *
162 * Get a file association string from the registry.
163 *
164 * PARAMS
165 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
166 * str [I] Type of string to get (ASSOCSTR enum from "shlwapi.h")
167 * pszExtra [I] Extra information about the string location
168 * pszOut [O] Destination for the association string
169 * pcchOut [I/O] Length of pszOut
170 *
171 * RETURNS
172 * Success: S_OK. pszOut contains the string, pcchOut contains its length.
173 * Failure: An HRESULT error code indicating the error.
174 */
178 LPCWSTR pszExtra,
179 LPWSTR pszOut,
180 DWORD *pcchOut)
181{
182 const ASSOCF unimplemented_flags = ~ASSOCF_NOTRUNCATE;
183 DWORD len = 0;
184 HRESULT hr;
186
187 TRACE("(%p)->(0x%08x, %u, %s, %p, %p)\n", this, flags, str, debugstr_w(pszExtra), pszOut, pcchOut);
188 if (flags & unimplemented_flags)
189 {
190 FIXME("%08x: unimplemented flags\n", flags & unimplemented_flags);
191 }
192
193 if (!pcchOut)
194 {
195 return E_UNEXPECTED;
196 }
197
198 if (!this->hkeySource && !this->hkeyProgID)
199 {
201 }
202
203 switch (str)
204 {
205 case ASSOCSTR_COMMAND:
206 {
207 WCHAR *command;
208 hr = this->GetCommand(pszExtra, &command);
209 if (SUCCEEDED(hr))
210 {
211 hr = this->ReturnString(flags, pszOut, pcchOut, command, strlenW(command) + 1);
213 }
214 return hr;
215 }
217 {
218 hr = this->GetExecutable(pszExtra, path, MAX_PATH, &len);
219 if (FAILED(hr))
220 {
221 return hr;
222 }
223 len++;
224 return this->ReturnString(flags, pszOut, pcchOut, path, len);
225 }
227 {
228 WCHAR *pszFileType;
229
230 hr = this->GetValue(this->hkeySource, NULL, (void**)&pszFileType, NULL);
231 if (FAILED(hr))
232 {
233 return hr;
234 }
235 DWORD size = 0;
237 if (ret == ERROR_SUCCESS)
238 {
239 WCHAR *docName = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, size));
240 if (docName)
241 {
242 ret = RegGetValueW(HKEY_CLASSES_ROOT, pszFileType, NULL, RRF_RT_REG_SZ, NULL, docName, &size);
243 if (ret == ERROR_SUCCESS)
244 {
245 hr = this->ReturnString(flags, pszOut, pcchOut, docName, strlenW(docName) + 1);
246 }
247 else
248 {
250 }
251 HeapFree(GetProcessHeap(), 0, docName);
252 }
253 else
254 {
256 }
257 }
258 else
259 {
261 }
262 HeapFree(GetProcessHeap(), 0, pszFileType);
263 return hr;
264 }
266 {
267 PVOID verinfoW = NULL;
268 DWORD size, retval = 0;
269 UINT flen;
270 WCHAR *bufW;
271 WCHAR fileDescW[41];
272
273 hr = this->GetExecutable(pszExtra, path, MAX_PATH, &len);
274 if (FAILED(hr))
275 {
276 return hr;
277 }
279 if (!retval)
280 {
281 goto get_friendly_name_fail;
282 }
283 verinfoW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, retval);
284 if (!verinfoW)
285 {
286 return E_OUTOFMEMORY;
287 }
288 if (!GetFileVersionInfoW(path, 0, retval, verinfoW))
289 {
290 goto get_friendly_name_fail;
291 }
292 if (VerQueryValueW(verinfoW, L"\\VarFileInfo\\Translation", (LPVOID *)&bufW, &flen))
293 {
294 UINT i;
295 DWORD *langCodeDesc = (DWORD *)bufW;
296 for (i = 0; i < flen / sizeof(DWORD); i++)
297 {
298 sprintfW(fileDescW, L"\\StringFileInfo\\%04x%04x\\FileDescription",
299 LOWORD(langCodeDesc[i]), HIWORD(langCodeDesc[i]));
300 if (VerQueryValueW(verinfoW, fileDescW, (LPVOID *)&bufW, &flen))
301 {
302 /* Does strlenW(bufW) == 0 mean we use the filename? */
303 len = strlenW(bufW) + 1;
304 TRACE("found FileDescription: %s\n", debugstr_w(bufW));
305 hr = this->ReturnString(flags, pszOut, pcchOut, bufW, len);
306 HeapFree(GetProcessHeap(), 0, verinfoW);
307 return hr;
308 }
309 }
310 }
311 get_friendly_name_fail:
314 TRACE("using filename: %s\n", debugstr_w(path));
315 hr = this->ReturnString(flags, pszOut, pcchOut, path, strlenW(path) + 1);
316 HeapFree(GetProcessHeap(), 0, verinfoW);
317 return hr;
318 }
320 {
321 DWORD size = 0;
322 DWORD ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, NULL, &size);
323 if (ret != ERROR_SUCCESS)
324 {
325 return HRESULT_FROM_WIN32(ret);
326 }
327 WCHAR *contentType = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, size));
328 if (contentType != NULL)
329 {
330 ret = RegGetValueW(this->hkeySource, NULL, L"Content Type", RRF_RT_REG_SZ, NULL, contentType, &size);
331 if (ret == ERROR_SUCCESS)
332 {
333 hr = this->ReturnString(flags, pszOut, pcchOut, contentType, strlenW(contentType) + 1);
334 }
335 else
336 {
338 }
339 HeapFree(GetProcessHeap(), 0, contentType);
340 }
341 else
342 {
344 }
345 return hr;
346 }
348 {
349 DWORD ret;
350 DWORD size = 0;
351 ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, NULL, &size);
352 if (ret == ERROR_SUCCESS)
353 {
354 WCHAR *icon = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, size));
355 if (icon)
356 {
357 ret = RegGetValueW(this->hkeyProgID, L"DefaultIcon", NULL, RRF_RT_REG_SZ, NULL, icon, &size);
358 if (ret == ERROR_SUCCESS)
359 {
360 hr = this->ReturnString(flags, pszOut, pcchOut, icon, strlenW(icon) + 1);
361 }
362 else
363 {
365 }
366 HeapFree(GetProcessHeap(), 0, icon);
367 }
368 else
369 {
371 }
372 }
373 else
374 {
376 }
377 return hr;
378 }
380 {
381 WCHAR keypath[ARRAY_SIZE(L"ShellEx\\") + 39], guid[39];
382 CLSID clsid;
383 HKEY hkey;
384
385 hr = CLSIDFromString(pszExtra, &clsid);
386 if (FAILED(hr))
387 {
388 return hr;
389 }
390 strcpyW(keypath, L"ShellEx\\");
391 strcatW(keypath, pszExtra);
392 LONG ret = RegOpenKeyExW(this->hkeySource, keypath, 0, KEY_READ, &hkey);
393 if (ret)
394 {
395 return HRESULT_FROM_WIN32(ret);
396 }
397 DWORD size = sizeof(guid);
399 RegCloseKey(hkey);
400 if (ret)
401 {
402 return HRESULT_FROM_WIN32(ret);
403 }
404 return this->ReturnString(flags, pszOut, pcchOut, guid, size / sizeof(WCHAR));
405 }
406
407 default:
408 {
409 FIXME("assocstr %d unimplemented!\n", str);
410 return E_NOTIMPL;
411 }
412 }
413}
414
415/**************************************************************************
416 * IQueryAssociations_GetKey
417 *
418 * Get a file association key from the registry.
419 *
420 * PARAMS
421 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
422 * assockey [I] Type of key to get (ASSOCKEY enum from "shlwapi.h")
423 * pszExtra [I] Extra information about the key location
424 * phkeyOut [O] Destination for the association key
425 *
426 * RETURNS
427 * Success: S_OK. phkeyOut contains a handle to the key.
428 * Failure: An HRESULT error code indicating the error.
429 */
431 ASSOCF cfFlags,
432 ASSOCKEY assockey,
433 LPCWSTR pszExtra,
434 HKEY *phkeyOut)
435{
436 FIXME("(%p,0x%8x,0x%8x,%s,%p)-stub!\n", this, cfFlags, assockey,
437 debugstr_w(pszExtra), phkeyOut);
438 return E_NOTIMPL;
439}
440
441/**************************************************************************
442 * IQueryAssociations_GetData
443 *
444 * Get the data for a file association key from the registry.
445 *
446 * PARAMS
447 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
448 * assocdata [I] Type of data to get (ASSOCDATA enum from "shlwapi.h")
449 * pszExtra [I] Extra information about the data location
450 * pvOut [O] Destination for the association key
451 * pcbOut [I/O] Size of pvOut
452 *
453 * RETURNS
454 * Success: S_OK. pszOut contains the data, pcbOut contains its length.
455 * Failure: An HRESULT error code indicating the error.
456 */
458{
459 TRACE("(%p,0x%8x,0x%8x,%s,%p,%p)\n", this, cfFlags, assocdata,
460 debugstr_w(pszExtra), pvOut, pcbOut);
461
462 if(cfFlags)
463 {
464 FIXME("Unsupported flags: %x\n", cfFlags);
465 }
466
467 switch(assocdata)
468 {
470 {
471 if(!this->hkeyProgID)
472 {
474 }
475
476 void *data;
477 DWORD size;
478 HRESULT hres = this->GetValue(this->hkeyProgID, L"EditFlags", &data, &size);
479 if(FAILED(hres))
480 {
481 return hres;
482 }
483
484 if (!pcbOut)
485 {
487 return hres;
488 }
489
490 hres = this->ReturnData(pvOut, pcbOut, data, size);
492 return hres;
493 }
494 default:
495 {
496 FIXME("Unsupported ASSOCDATA value: %d\n", assocdata);
497 return E_NOTIMPL;
498 }
499 }
500}
501
502/**************************************************************************
503 * IQueryAssociations_GetEnum
504 *
505 * Not yet implemented in native Win32.
506 *
507 * PARAMS
508 * cfFlags [I] ASSOCF_ flags from "shlwapi.h"
509 * assocenum [I] Type of enum to get (ASSOCENUM enum from "shlwapi.h")
510 * pszExtra [I] Extra information about the enum location
511 * riid [I] REFIID to look for
512 * ppvOut [O] Destination for the interface.
513 *
514 * RETURNS
515 * Success: S_OK.
516 * Failure: An HRESULT error code indicating the error.
517 *
518 * NOTES
519 * Presumably this function returns an enumerator object.
520 */
522 ASSOCF cfFlags,
523 ASSOCENUM assocenum,
524 LPCWSTR pszExtra,
525 REFIID riid,
526 LPVOID *ppvOut)
527{
528 return E_NOTIMPL;
529}
530
532{
533 DWORD size;
534 LONG ret;
535
536 ret = RegQueryValueExW(hkey, name, 0, NULL, NULL, &size);
537 if (ret != ERROR_SUCCESS)
538 {
539 return HRESULT_FROM_WIN32(ret);
540 }
541 if (!size)
542 {
543 return E_FAIL;
544 }
546 if (!*data)
547 {
548 return E_OUTOFMEMORY;
549 }
550 ret = RegQueryValueExW(hkey, name, 0, NULL, (LPBYTE)*data, &size);
551 if (ret != ERROR_SUCCESS)
552 {
554 return HRESULT_FROM_WIN32(ret);
555 }
556 if(data_size)
557 {
558 *data_size = size;
559 }
560 return S_OK;
561}
562
564{
565 HKEY hkeyCommand;
566 HKEY hkeyShell;
567 HKEY hkeyVerb;
568 HRESULT hr;
569 LONG ret;
570 WCHAR *extra_from_reg = NULL;
572
573 /* When looking for file extension it's possible to have a default value
574 that points to another key that contains 'shell/<verb>/command' subtree. */
575 hr = this->GetValue(this->hkeySource, NULL, (void**)&filetype, NULL);
576 if (hr == S_OK)
577 {
578 HKEY hkeyFile;
579
582
583 if (ret == ERROR_SUCCESS)
584 {
585 ret = RegOpenKeyExW(hkeyFile, L"shell", 0, KEY_READ, &hkeyShell);
586 RegCloseKey(hkeyFile);
587 }
588 else
589 {
590 ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell);
591 }
592 }
593 else
594 {
595 ret = RegOpenKeyExW(this->hkeySource, L"shell", 0, KEY_READ, &hkeyShell);
596 }
597
598 if (ret)
599 {
600 return HRESULT_FROM_WIN32(ret);
601 }
602
603 if (!extra)
604 {
605 /* check for default verb */
606 hr = this->GetValue(hkeyShell, NULL, (void**)&extra_from_reg, NULL);
607 if (FAILED(hr))
608 {
609 /* no default verb, try first subkey */
610 DWORD max_subkey_len;
611
612 ret = RegQueryInfoKeyW(hkeyShell, NULL, NULL, NULL, NULL, &max_subkey_len, NULL, NULL, NULL, NULL, NULL, NULL);
613 if (ret)
614 {
615 RegCloseKey(hkeyShell);
616 return HRESULT_FROM_WIN32(ret);
617 }
618
619 max_subkey_len++;
620 extra_from_reg = static_cast<WCHAR*>(HeapAlloc(GetProcessHeap(), 0, max_subkey_len * sizeof(WCHAR)));
621 if (!extra_from_reg)
622 {
623 RegCloseKey(hkeyShell);
624 return E_OUTOFMEMORY;
625 }
626
627 ret = RegEnumKeyExW(hkeyShell, 0, extra_from_reg, &max_subkey_len, NULL, NULL, NULL, NULL);
628 if (ret)
629 {
630 HeapFree(GetProcessHeap(), 0, extra_from_reg);
631 RegCloseKey(hkeyShell);
632 return HRESULT_FROM_WIN32(ret);
633 }
634 }
635 extra = extra_from_reg;
636 }
637
638 /* open verb subkey */
639 ret = RegOpenKeyExW(hkeyShell, extra, 0, KEY_READ, &hkeyVerb);
640 HeapFree(GetProcessHeap(), 0, extra_from_reg);
641 RegCloseKey(hkeyShell);
642 if (ret)
643 {
644 return HRESULT_FROM_WIN32(ret);
645 }
646 /* open command subkey */
647 ret = RegOpenKeyExW(hkeyVerb, L"command", 0, KEY_READ, &hkeyCommand);
648 RegCloseKey(hkeyVerb);
649 if (ret)
650 {
651 return HRESULT_FROM_WIN32(ret);
652 }
653 hr = this->GetValue(hkeyCommand, NULL, (void**)command, NULL);
654 RegCloseKey(hkeyCommand);
655 return hr;
656}
657
659{
660 WCHAR *pszCommand;
661 WCHAR *pszStart;
662 WCHAR *pszEnd;
663
664 HRESULT hr = this->GetCommand(pszExtra, &pszCommand);
665 if (FAILED(hr))
666 {
667 return hr;
668 }
669
670 DWORD expLen = ExpandEnvironmentStringsW(pszCommand, NULL, 0);
671 if (expLen > 0)
672 {
673 expLen++;
674 WCHAR *buf = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, expLen * sizeof(WCHAR)));
675 ExpandEnvironmentStringsW(pszCommand, buf, expLen);
676 HeapFree(GetProcessHeap(), 0, pszCommand);
677 pszCommand = buf;
678 }
679
680 /* cleanup pszCommand */
681 if (pszCommand[0] == '"')
682 {
683 pszStart = pszCommand + 1;
684 pszEnd = strchrW(pszStart, '"');
685 if (pszEnd)
686 {
687 *pszEnd = 0;
688 }
689 *len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
690 }
691 else
692 {
693 pszStart = pszCommand;
694 for (pszEnd = pszStart; (pszEnd = strchrW(pszEnd, ' ')); pszEnd++)
695 {
696 WCHAR c = *pszEnd;
697 *pszEnd = 0;
698 if ((*len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL)))
699 {
700 break;
701 }
702 *pszEnd = c;
703 }
704 if (!pszEnd)
705 {
706 *len = SearchPathW(NULL, pszStart, NULL, pathlen, path, NULL);
707 }
708 }
709
710 HeapFree(GetProcessHeap(), 0, pszCommand);
711 if (!*len)
712 {
714 }
715 return S_OK;
716}
717
719{
720 if (out)
721 {
722 if (*outlen < datalen)
723 {
724 *outlen = datalen;
725 return E_POINTER;
726 }
727 *outlen = datalen;
729 return S_OK;
730 }
731 else
732 {
733 *outlen = datalen;
734 return S_FALSE;
735 }
736}
737
739{
740 HRESULT hr = S_OK;
741 DWORD len;
742
743 TRACE("flags=0x%08x, data=%s\n", flags, debugstr_w(data));
744
745 if (!out)
746 {
747 *outlen = datalen;
748 return S_FALSE;
749 }
750
751 if (*outlen < datalen)
752 {
754 {
755 len = 0;
756 if (*outlen > 0) out[0] = 0;
757 hr = E_POINTER;
758 }
759 else
760 {
761 len = min(*outlen, datalen);
763 }
764 *outlen = datalen;
765 }
766 else
767 {
768 len = datalen;
769 }
770
771 if (len)
772 {
773 memcpy(out, data, len*sizeof(WCHAR));
774 }
775
776 return hr;
777}
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
void shell(int argc, const char *argv[])
Definition: cmds.c:1231
#define ARRAY_SIZE(A)
Definition: main.h:33
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define FIXME(fmt,...)
Definition: debug.h:111
#define RegCloseKey(hKey)
Definition: registry.h:49
virtual HRESULT STDMETHODCALLTYPE Init(ASSOCF flags, LPCWSTR pwszAssoc, HKEY hkProgid, HWND hwnd)
HRESULT GetValue(HKEY hkey, const WCHAR *name, void **data, DWORD *data_size)
HRESULT ReturnString(ASSOCF flags, LPWSTR out, DWORD *outlen, LPCWSTR data, DWORD datalen)
HRESULT GetCommand(const WCHAR *extra, WCHAR **command)
HRESULT ReturnData(void *out, DWORD *outlen, const void *data, DWORD datalen)
HRESULT GetExecutable(LPCWSTR pszExtra, LPWSTR path, DWORD pathlen, DWORD *len)
virtual HRESULT STDMETHODCALLTYPE GetEnum(ASSOCF cfFlags, ASSOCENUM assocenum, LPCWSTR pszExtra, REFIID riid, LPVOID *ppvOut)
virtual HRESULT STDMETHODCALLTYPE GetKey(ASSOCF flags, ASSOCKEY key, LPCWSTR pwszExtra, HKEY *phkeyOut)
virtual HRESULT STDMETHODCALLTYPE GetString(ASSOCF flags, ASSOCSTR str, LPCWSTR pwszExtra, LPWSTR pwszOut, DWORD *pcchOut)
virtual HRESULT STDMETHODCALLTYPE GetData(ASSOCF flags, ASSOCDATA data, LPCWSTR pwszExtra, void *pvOut, DWORD *pcbOut)
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1969
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2533
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3691
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4132
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1298
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
#define RRF_RT_REG_SZ
Definition: driver.c:575
void WINAPI PathStripPathW(LPWSTR lpszPath)
Definition: path.c:694
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
BOOL WINAPI GetFileVersionInfoW(LPCWSTR filename, DWORD handle, DWORD datasize, LPVOID data)
Definition: version.c:845
BOOL WINAPI VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen)
Definition: version.c:1049
DWORD WINAPI GetFileVersionInfoSizeW(LPCWSTR filename, LPDWORD handle)
Definition: version.c:611
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ extra
Definition: id3.c:95
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1031
#define c
Definition: ke_i.h:80
#define debugstr_w
Definition: kernel32.h:32
const GUID * guid
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
HRESULT hres
Definition: protocol.c:465
#define min(a, b)
Definition: monoChain.cc:55
REFCLSID clsid
Definition: msctf.c:82
unsigned int UINT
Definition: ndis.h:50
#define KEY_READ
Definition: nt_native.h:1023
#define DWORD
Definition: nt_native.h:44
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
#define REFIID
Definition: guiddef.h:118
#define strchrW(s, c)
Definition: unicode.h:34
#define strlenW(s)
Definition: unicode.h:28
#define strcatW(d, s)
Definition: unicode.h:30
#define sprintfW
Definition: unicode.h:58
#define strcpyW(d, s)
Definition: unicode.h:29
static FILE * out
Definition: regtests2xml.c:44
const WCHAR * str
LOCAL char * filetype(int t)
Definition: tree.c:114
HRESULT hr
Definition: shlfolder.c:183
ASSOCDATA
Definition: shlwapi.h:632
@ ASSOCDATA_EDITFLAGS
Definition: shlwapi.h:637
ASSOCSTR
Definition: shlwapi.h:602
@ ASSOCSTR_CONTENTTYPE
Definition: shlwapi.h:616
@ ASSOCSTR_SHELLEXTENSION
Definition: shlwapi.h:618
@ ASSOCSTR_COMMAND
Definition: shlwapi.h:603
@ ASSOCSTR_FRIENDLYDOCNAME
Definition: shlwapi.h:605
@ ASSOCSTR_FRIENDLYAPPNAME
Definition: shlwapi.h:606
@ ASSOCSTR_EXECUTABLE
Definition: shlwapi.h:604
@ ASSOCSTR_DEFAULTICON
Definition: shlwapi.h:617
@ ASSOCF_NOTRUNCATE
Definition: shlwapi.h:588
ASSOCKEY
Definition: shlwapi.h:623
DWORD ASSOCF
Definition: shlwapi.h:599
ASSOCENUM
Definition: shlwapi.h:643
#define TRACE(s)
Definition: solgame.cpp:4
Definition: name.c:39
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HIWORD(l)
Definition: typedefs.h:247
int ret
#define S_FALSE
Definition: winerror.h:2357
#define ERROR_NO_ASSOCIATION
Definition: winerror.h:677
#define E_UNEXPECTED
Definition: winerror.h:2456
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define E_POINTER
Definition: winerror.h:2365
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185