ReactOS 0.4.16-dev-1457-g02ea0aa
shellole.c
Go to the documentation of this file.
1/*
2 * handling of SHELL32.DLL OLE-Objects
3 *
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#include <wine/config.h>
23
24#include <stdarg.h>
25#include <stdlib.h>
26#include <string.h>
27
28#define WIN32_NO_STATUS
29#define _INC_WINDOWS
30#define COBJMACROS
31#define NONAMELESSUNION
32
33#include <windef.h>
34#include <winbase.h>
35#include <shellapi.h>
36#include <shlobj.h>
37#include <shlwapi.h>
38#include <debughlp.h>
39
40#include <wine/debug.h>
41#include <wine/unicode.h>
42
43#include "shell32_main.h"
44
46
48
49/**************************************************************************
50 * Default ClassFactory types
51 */
53
54#ifndef __REACTOS__
55
57
58/* this table contains all CLSIDs of shell32 objects */
59static const struct {
62} InterfaceTable[] = {
63
64 {&CLSID_ApplicationAssociationRegistration, ApplicationAssociationRegistration_Constructor},
65 {&CLSID_AutoComplete, IAutoComplete_Constructor},
66 {&CLSID_ControlPanel, IControlPanel_Constructor},
67 {&CLSID_DragDropHelper, IDropTargetHelper_Constructor},
68 {&CLSID_FolderShortcut, FolderShortcut_Constructor},
69 {&CLSID_MyComputer, ISF_MyComputer_Constructor},
70 {&CLSID_MyDocuments, MyDocuments_Constructor},
71 {&CLSID_NetworkPlaces, ISF_NetworkPlaces_Constructor},
72 {&CLSID_Printers, Printers_Constructor},
73 {&CLSID_QueryAssociations, QueryAssociations_Constructor},
74 {&CLSID_RecycleBin, RecycleBin_Constructor},
75 {&CLSID_ShellDesktop, ISF_Desktop_Constructor},
76 {&CLSID_ShellFSFolder, IFSFolder_Constructor},
77 {&CLSID_ShellItem, IShellItem_Constructor},
78 {&CLSID_ShellLink, IShellLink_Constructor},
79 {&CLSID_UnixDosFolder, UnixDosFolder_Constructor},
80 {&CLSID_UnixFolder, UnixFolder_Constructor},
81 {&CLSID_ExplorerBrowser,ExplorerBrowser_Constructor},
82 {&CLSID_KnownFolderManager, KnownFolderManager_Constructor},
83 {&CLSID_Shell, IShellDispatch_Constructor},
84 {NULL, NULL}
85};
86
87#endif /* !__REACTOS__ */
88
89/*************************************************************************
90 * SHCoCreateInstance [SHELL32.102]
91 *
92 * Equivalent to CoCreateInstance. Under Windows 9x this function could sometimes
93 * use the shell32 built-in "mini-COM" without the need to load ole32.dll - see
94 * SHLoadOLE for details.
95 *
96 * Under wine if a "LoadWithoutCOM" value is present or the object resides in
97 * shell32.dll the function will load the object manually without the help of ole32
98 *
99 * NOTES
100 * exported by ordinal
101 *
102 * SEE ALSO
103 * CoCreateInstance, SHLoadOLE
104 */
106 LPCWSTR aclsid,
107 const CLSID *clsid,
108 LPUNKNOWN pUnkOuter,
109 REFIID refiid,
110 LPVOID *ppv)
111{
112 DWORD hres;
113 CLSID iid;
114 const CLSID * myclsid = clsid;
115 WCHAR sKeyName[MAX_PATH];
116 WCHAR sClassID[60];
117 WCHAR sDllPath[MAX_PATH];
118 HKEY hKey = 0;
120 IClassFactory * pcf = NULL;
121
122 if(!ppv) return E_POINTER;
123 *ppv=NULL;
124
125 /* if the clsid is a string, convert it */
126 if (!clsid)
127 {
128 if (!aclsid) return REGDB_E_CLASSNOTREG;
129 SHCLSIDFromStringW(aclsid, &iid);
130 myclsid = &iid;
131 }
132
133 TRACE("(%p,%s,unk:%p,%s,%p)\n",
134 aclsid,shdebugstr_guid(myclsid),pUnkOuter,shdebugstr_guid(refiid),ppv);
135
137 {
138 hres = IClassFactory_CreateInstance(pcf, pUnkOuter, refiid, ppv);
139 IClassFactory_Release(pcf);
140 goto end;
141 }
142
143 /* we look up the dll path in the registry */
144 SHStringFromGUIDW(myclsid, sClassID, ARRAY_SIZE(sClassID));
145 swprintf(sKeyName, L"CLSID\\%s\\InprocServer32", sClassID);
146
147 if (RegOpenKeyExW(HKEY_CLASSES_ROOT, sKeyName, 0, KEY_READ, &hKey))
148 return E_ACCESSDENIED;
149
150 /* if a special registry key is set, we load a shell extension without help of OLE32 */
151 if (!SHQueryValueExW(hKey, L"LoadWithoutCOM", 0, 0, 0, 0))
152 {
153 /* load an external dll without ole32 */
157
158 dwSize = sizeof(sDllPath);
159 SHQueryValueExW(hKey, NULL, 0,0, sDllPath, &dwSize );
160
161 if ((hLibrary = LoadLibraryExW(sDllPath, 0, LOAD_WITH_ALTERED_SEARCH_PATH)) == 0) {
162 ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath));
164 goto end;
165 } else if (!(DllGetClassObject = (DllGetClassObjectFunc)GetProcAddress(hLibrary, "DllGetClassObject"))) {
166 ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath));
169 goto end;
170 } else if (FAILED(hres = DllGetClassObject(myclsid, &IID_IClassFactory, (LPVOID*)&pcf))) {
171 TRACE("GetClassObject failed 0x%08x\n", hres);
172 goto end;
173 }
174
175 hres = IClassFactory_CreateInstance(pcf, pUnkOuter, refiid, ppv);
176 IClassFactory_Release(pcf);
177 } else {
178
179 /* load an external dll in the usual way */
180 hres = CoCreateInstance(myclsid, pUnkOuter, CLSCTX_INPROC_SERVER, refiid, ppv);
181 }
182
183end:
184 if (hKey) RegCloseKey(hKey);
185 if(hres!=S_OK)
186 {
187 ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
188 hres, shdebugstr_guid(myclsid), shdebugstr_guid(refiid));
189 ERR("class not found in registry\n");
190 }
191
192 TRACE("-- instance: %p\n",*ppv);
193 return hres;
194}
195
197 _In_opt_ LPCWSTR aclsid,
198 _In_opt_ const CLSID *clsid,
199 _In_opt_ LPUNKNOWN pUnkOuter,
200 _In_ REFIID refiid,
202{
203 // TODO: Verify that this CLSID is allowed if REST_ENFORCESHELLEXTSECURITY is active
204 return SHCoCreateInstance(aclsid, clsid, pUnkOuter, refiid, ppv);
205}
206
207#ifndef __REACTOS__
208/*************************************************************************
209 * DllGetClassObject [SHELL32.@]
210 * SHDllGetClassObject [SHELL32.128]
211 */
213{
214 IClassFactory * pcf = NULL;
216 int i;
217
218 TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid),shdebugstr_guid(iid));
219
220 if (!ppv) return E_INVALIDARG;
221 *ppv = NULL;
222
223 /* search our internal interface table */
224 for(i=0;InterfaceTable[i].clsid;i++) {
225 if(IsEqualIID(InterfaceTable[i].clsid, rclsid)) {
226 TRACE("index[%u]\n", i);
228 break;
229 }
230 }
231
232 if (!pcf) {
233 FIXME("failed for CLSID=%s\n", shdebugstr_guid(rclsid));
235 }
236
237 hres = IClassFactory_QueryInterface(pcf, iid, ppv);
238 IClassFactory_Release(pcf);
239
240 TRACE("-- pointer to class factory: %p\n",*ppv);
241 return hres;
242}
243#endif
244
245/*************************************************************************
246 * SHCLSIDFromString [SHELL32.147]
247 *
248 * Under Windows 9x this was an ANSI version of CLSIDFromString. It also allowed
249 * to avoid dependency on ole32.dll (see SHLoadOLE for details).
250 *
251 * Under Windows NT/2000/XP this is equivalent to CLSIDFromString
252 *
253 * NOTES
254 * exported by ordinal
255 *
256 * SEE ALSO
257 * CLSIDFromString, SHLoadOLE
258 */
260{
261 WCHAR buffer[40];
262 TRACE("(%p(%s) %p)\n", clsid, clsid, id);
263 if (!MultiByteToWideChar( CP_ACP, 0, clsid, -1, buffer, sizeof(buffer)/sizeof(WCHAR) ))
264 return CO_E_CLASSSTRING;
265 return CLSIDFromString( buffer, id );
266}
268{
269 TRACE("(%p(%s) %p)\n", clsid, debugstr_w(clsid), id);
270 return CLSIDFromString(clsid, id);
271}
273{
274 if (SHELL_OsIsUnicode())
275 return SHCLSIDFromStringW (clsid, id);
276 return SHCLSIDFromStringA (clsid, id);
277}
278
279/*************************************************************************
280 * SHGetMalloc [SHELL32.@]
281 *
282 * Equivalent to CoGetMalloc(MEMCTX_TASK, ...). Under Windows 9x this function
283 * could use the shell32 built-in "mini-COM" without the need to load ole32.dll -
284 * see SHLoadOLE for details.
285 *
286 * PARAMS
287 * lpmal [O] Destination for IMalloc interface.
288 *
289 * RETURNS
290 * Success: S_OK. lpmal contains the shells IMalloc interface.
291 * Failure. An HRESULT error code.
292 *
293 * SEE ALSO
294 * CoGetMalloc, SHLoadOLE
295 */
297{
298 TRACE("(%p)\n", lpmal);
299 return CoGetMalloc(MEMCTX_TASK, lpmal);
300}
301
302/*************************************************************************
303 * SHAlloc [SHELL32.196]
304 *
305 * Equivalent to CoTaskMemAlloc. Under Windows 9x this function could use
306 * the shell32 built-in "mini-COM" without the need to load ole32.dll -
307 * see SHLoadOLE for details.
308 *
309 * NOTES
310 * exported by ordinal
311 *
312 * SEE ALSO
313 * CoTaskMemAlloc, SHLoadOLE
314 */
316{
317 LPVOID ret;
318
320 TRACE("%u bytes at %p\n",len, ret);
321 return ret;
322}
323
324/*************************************************************************
325 * SHFree [SHELL32.195]
326 *
327 * Equivalent to CoTaskMemFree. Under Windows 9x this function could use
328 * the shell32 built-in "mini-COM" without the need to load ole32.dll -
329 * see SHLoadOLE for details.
330 *
331 * NOTES
332 * exported by ordinal
333 *
334 * SEE ALSO
335 * CoTaskMemFree, SHLoadOLE
336 */
338{
339 TRACE("%p\n",pv);
340 CoTaskMemFree(pv);
341}
342
343#ifndef __REACTOS__
344/*************************************************************************
345 * SHGetDesktopFolder [SHELL32.@]
346 */
348{
350
351 TRACE("(%p)\n", psf);
352
353 if(!psf) return E_INVALIDARG;
354
355 *psf = NULL;
356 hres = ISF_Desktop_Constructor(NULL, &IID_IShellFolder, (LPVOID*)psf);
357
358 TRACE("-- %p->(%p) 0x%08x\n", psf, *psf, hres);
359 return hres;
360}
361#endif
362
363/**************************************************************************
364 * Default ClassFactory Implementation
365 *
366 * SHCreateDefClassObject
367 *
368 * NOTES
369 * Helper function for dlls without their own classfactory.
370 * A generic classfactory is returned.
371 * When the CreateInstance of the cf is called the callback is executed.
372 */
373
374#ifndef __REACTOS__
375
376typedef struct
377{
380 CLSID *rclsid;
382 const IID * riidInst;
383 LONG * pcRefDll; /* pointer to refcounter in external dll (ugrrr...) */
385
387{
388 return CONTAINING_RECORD(iface, IDefClFImpl, IClassFactory_iface);
389}
390
391static const IClassFactoryVtbl dclfvt;
392
393/**************************************************************************
394 * IDefClF_fnConstructor
395 */
396
398{
399 IDefClFImpl* lpclf;
400
401 lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
402 lpclf->ref = 1;
403 lpclf->IClassFactory_iface.lpVtbl = &dclfvt;
404 lpclf->lpfnCI = lpfnCI;
405 lpclf->pcRefDll = pcRefDll;
406
407 if (pcRefDll) InterlockedIncrement(pcRefDll);
408 lpclf->riidInst = riidInst;
409
410 TRACE("(%p)%s\n",lpclf, shdebugstr_guid(riidInst));
411 return (LPCLASSFACTORY)lpclf;
412}
413/**************************************************************************
414 * IDefClF_fnQueryInterface
415 */
417 LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
418{
420
421 TRACE("(%p)->(%s)\n",This,shdebugstr_guid(riid));
422
423 *ppvObj = NULL;
424
426 *ppvObj = This;
428 return S_OK;
429 }
430
431 TRACE("-- E_NOINTERFACE\n");
432 return E_NOINTERFACE;
433}
434/******************************************************************************
435 * IDefClF_fnAddRef
436 */
437static ULONG WINAPI IDefClF_fnAddRef(LPCLASSFACTORY iface)
438{
440 ULONG refCount = InterlockedIncrement(&This->ref);
441
442 TRACE("(%p)->(count=%u)\n", This, refCount - 1);
443
444 return refCount;
445}
446/******************************************************************************
447 * IDefClF_fnRelease
448 */
449static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface)
450{
452 ULONG refCount = InterlockedDecrement(&This->ref);
453
454 TRACE("(%p)->(count=%u)\n", This, refCount + 1);
455
456 if (!refCount)
457 {
458 if (This->pcRefDll) InterlockedDecrement(This->pcRefDll);
459
460 TRACE("-- destroying IClassFactory(%p)\n",This);
462 return 0;
463 }
464 return refCount;
465}
466/******************************************************************************
467 * IDefClF_fnCreateInstance
468 */
470 LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
471{
473
474 TRACE("%p->(%p,%s,%p)\n",This,pUnkOuter,shdebugstr_guid(riid),ppvObject);
475
476 *ppvObject = NULL;
477
478 if ( This->riidInst==NULL ||
479 IsEqualCLSID(riid, This->riidInst) ||
481 {
482 return This->lpfnCI(pUnkOuter, riid, ppvObject);
483 }
484
485 ERR("unknown IID requested %s\n",shdebugstr_guid(riid));
486 return E_NOINTERFACE;
487}
488/******************************************************************************
489 * IDefClF_fnLockServer
490 */
491static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
492{
494 TRACE("%p->(0x%x), not implemented\n",This, fLock);
495 return E_NOTIMPL;
496}
497
498static const IClassFactoryVtbl dclfvt =
499{
505};
506
507/******************************************************************************
508 * SHCreateDefClassObject [SHELL32.70]
509 */
511 REFIID riid,
512 LPVOID* ppv,
513 LPFNCREATEINSTANCE lpfnCI, /* [in] create instance callback entry */
514 LPDWORD pcRefDll, /* [in/out] ref count of the dll */
515 REFIID riidInst) /* [in] optional interface to the instance */
516{
517 IClassFactory * pcf;
518
519 TRACE("%s %p %p %p %s\n",
520 shdebugstr_guid(riid), ppv, lpfnCI, pcRefDll, shdebugstr_guid(riidInst));
521
523 if (! (pcf = IDefClF_fnConstructor(lpfnCI, (PLONG)pcRefDll, riidInst))) return E_OUTOFMEMORY;
524 *ppv = pcf;
525 return S_OK;
526}
527
528#endif /* !__REACTOS__ */
529
530/*************************************************************************
531 * DragAcceptFiles [SHELL32.@]
532 */
534{
535 LONG exstyle;
536
537 if( !IsWindow(hWnd) ) return;
539 if (b)
540 exstyle |= WS_EX_ACCEPTFILES;
541 else
542 exstyle &= ~WS_EX_ACCEPTFILES;
544}
545
546/*************************************************************************
547 * DragFinish [SHELL32.@]
548 */
549void WINAPI DragFinish(HDROP h)
550{
551 TRACE("\n");
552 GlobalFree(h);
553}
554
555/*************************************************************************
556 * DragQueryPoint [SHELL32.@]
557 */
559{
560 DROPFILES *lpDropFileStruct;
561 BOOL bRet;
562
563 TRACE("\n");
564
565 lpDropFileStruct = GlobalLock(hDrop);
566
567 *p = lpDropFileStruct->pt;
568 bRet = lpDropFileStruct->fNC;
569
570 GlobalUnlock(hDrop);
571 return bRet;
572}
573
574/*************************************************************************
575 * DragQueryFileA [SHELL32.@]
576 * DragQueryFile [SHELL32.@]
577 */
579 HDROP hDrop,
580 UINT lFile,
581 LPSTR lpszFile,
582 UINT lLength)
583{
584 LPSTR lpDrop;
585 UINT i = 0;
586 DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
587
588 TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
589
590 if(!lpDropFileStruct) goto end;
591
592 lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles;
593
594 if(lpDropFileStruct->fWide) {
595 LPWSTR lpszFileW = NULL;
596
597 if(lpszFile && lFile != 0xFFFFFFFF) {
598 lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
599 if(lpszFileW == NULL) {
600 goto end;
601 }
602 }
603 i = DragQueryFileW(hDrop, lFile, lpszFileW, lLength);
604
605 if(lpszFileW) {
606 WideCharToMultiByte(CP_ACP, 0, lpszFileW, -1, lpszFile, lLength, 0, NULL);
607 HeapFree(GetProcessHeap(), 0, lpszFileW);
608 }
609 goto end;
610 }
611
612 while (i++ < lFile)
613 {
614 while (*lpDrop++); /* skip filename */
615 if (!*lpDrop)
616 {
617 i = (lFile == 0xFFFFFFFF) ? i : 0;
618 goto end;
619 }
620 }
621
622 i = strlen(lpDrop);
623 if (!lpszFile ) goto end; /* needed buffer size */
624 lstrcpynA (lpszFile, lpDrop, lLength);
625end:
626 GlobalUnlock(hDrop);
627 return i;
628}
629
630/*************************************************************************
631 * DragQueryFileW [SHELL32.@]
632 */
634 HDROP hDrop,
635 UINT lFile,
636 LPWSTR lpszwFile,
637 UINT lLength)
638{
639 LPWSTR lpwDrop;
640 UINT i = 0;
641 DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
642
643 TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);
644
645 if(!lpDropFileStruct) goto end;
646
647 lpwDrop = (LPWSTR) ((LPSTR)lpDropFileStruct + lpDropFileStruct->pFiles);
648
649 if(lpDropFileStruct->fWide == FALSE) {
650 LPSTR lpszFileA = NULL;
651
652 if(lpszwFile && lFile != 0xFFFFFFFF) {
653 lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
654 if(lpszFileA == NULL) {
655 goto end;
656 }
657 }
658 i = DragQueryFileA(hDrop, lFile, lpszFileA, lLength);
659
660 if(lpszFileA) {
661 MultiByteToWideChar(CP_ACP, 0, lpszFileA, -1, lpszwFile, lLength);
662 HeapFree(GetProcessHeap(), 0, lpszFileA);
663 }
664 goto end;
665 }
666
667 i = 0;
668 while (i++ < lFile)
669 {
670 while (*lpwDrop++); /* skip filename */
671 if (!*lpwDrop)
672 {
673 i = (lFile == 0xFFFFFFFF) ? i : 0;
674 goto end;
675 }
676 }
677
678 i = strlenW(lpwDrop);
679 if ( !lpszwFile) goto end; /* needed buffer size */
680 lstrcpynW (lpszwFile, lpwDrop, lLength);
681end:
682 GlobalUnlock(hDrop);
683 return i;
684}
685
686/*************************************************************************
687 * SHPropStgCreate [SHELL32.685]
688 */
690 const CLSID *pclsid, DWORD grfFlags, DWORD grfMode,
691 DWORD dwDisposition, IPropertyStorage **ppstg, UINT *puCodePage)
692{
693 PROPSPEC prop;
694 PROPVARIANT ret;
696
697 TRACE("%p %s %s %x %x %x %p %p\n", psstg, debugstr_guid(fmtid), debugstr_guid(pclsid),
698 grfFlags, grfMode, dwDisposition, ppstg, puCodePage);
699
700 hres = IPropertySetStorage_Open(psstg, fmtid, grfMode, ppstg);
701
702 switch(dwDisposition) {
703 case CREATE_ALWAYS:
704 if(SUCCEEDED(hres)) {
705 IPropertyStorage_Release(*ppstg);
706 hres = IPropertySetStorage_Delete(psstg, fmtid);
707 if(FAILED(hres))
708 return hres;
709 hres = E_FAIL;
710 }
711
712 case OPEN_ALWAYS:
713 case CREATE_NEW:
714 if(FAILED(hres))
715 hres = IPropertySetStorage_Create(psstg, fmtid, pclsid,
716 grfFlags, grfMode, ppstg);
717
718 case OPEN_EXISTING:
719 if(FAILED(hres))
720 return hres;
721
722 if(puCodePage) {
723 prop.ulKind = PRSPEC_PROPID;
724 prop.u.propid = PID_CODEPAGE;
725 hres = IPropertyStorage_ReadMultiple(*ppstg, 1, &prop, &ret);
726 if(FAILED(hres) || ret.vt!=VT_I2)
727 *puCodePage = 0;
728 else
729 *puCodePage = ret.u.iVal;
730 }
731 }
732
733 return S_OK;
734}
735
736/*************************************************************************
737 * SHPropStgReadMultiple [SHELL32.688]
738 */
740 ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar)
741{
742 STATPROPSETSTG stat;
744
745 FIXME("%p %u %u %p %p\n", pps, uCodePage, cpspec, rgpspec, rgvar);
746
747 memset(rgvar, 0, cpspec*sizeof(PROPVARIANT));
748 hres = IPropertyStorage_ReadMultiple(pps, cpspec, rgpspec, rgvar);
749 if(FAILED(hres))
750 return hres;
751
752 if(!uCodePage) {
753 PROPSPEC prop;
754 PROPVARIANT ret;
755
756 prop.ulKind = PRSPEC_PROPID;
757 prop.u.propid = PID_CODEPAGE;
758 hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
759 if(FAILED(hres) || ret.vt!=VT_I2)
760 return S_OK;
761
762 uCodePage = ret.u.iVal;
763 }
764
765 hres = IPropertyStorage_Stat(pps, &stat);
766 if(FAILED(hres))
767 return S_OK;
768
769 /* TODO: do something with codepage and stat */
770 return S_OK;
771}
772
773/*************************************************************************
774 * SHPropStgWriteMultiple [SHELL32.689]
775 */
777 ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar, PROPID propidNameFirst)
778{
779 STATPROPSETSTG stat;
782
783 FIXME("%p %p %u %p %p %d\n", pps, uCodePage, cpspec, rgpspec, rgvar, propidNameFirst);
784
785 hres = IPropertyStorage_Stat(pps, &stat);
786 if(FAILED(hres))
787 return hres;
788
789 if(uCodePage && *uCodePage)
790 codepage = *uCodePage;
791 else {
792 PROPSPEC prop;
793 PROPVARIANT ret;
794
795 prop.ulKind = PRSPEC_PROPID;
796 prop.u.propid = PID_CODEPAGE;
797 hres = IPropertyStorage_ReadMultiple(pps, 1, &prop, &ret);
798 if(FAILED(hres))
799 return hres;
800 if(ret.vt!=VT_I2 || !ret.u.iVal)
801 return E_FAIL;
802
803 codepage = ret.u.iVal;
804 if(uCodePage)
805 *uCodePage = codepage;
806 }
807
808 /* TODO: do something with codepage and stat */
809
810 hres = IPropertyStorage_WriteMultiple(pps, cpspec, rgpspec, rgvar, propidNameFirst);
811 return hres;
812}
813
814/*************************************************************************
815 * SHCreateQueryCancelAutoPlayMoniker [SHELL32.@]
816 */
818{
819 TRACE("%p\n", moniker);
820
821 if (!moniker) return E_INVALIDARG;
822 return CreateClassMoniker(&CLSID_QueryCancelAutoPlay, moniker);
823}
UINT cchMax
WCHAR lpszDest[260]
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define stat
Definition: acwin.h:99
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
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:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define RegCloseKey(hKey)
Definition: registry.h:49
IClassFactory IClassFactory_iface
Definition: shellole.c:378
LONG ref
Definition: shellole.c:379
const IID * riidInst
Definition: shell32.cpp:133
LONG * pcRefDll
Definition: shell32.cpp:134
LPFNCREATEINSTANCE lpfnCI
Definition: shell32.cpp:132
HRESULT WINAPI CreateClassMoniker(REFCLSID rclsid, IMoniker **ppmk)
Definition: classmoniker.c:701
HMODULE hLibrary
Definition: odbccp32.c:12
#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
const char * shdebugstr_guid(const struct _GUID *id)
Definition: debughlp.cpp:438
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define GetProcessHeap()
Definition: compat.h:736
#define CP_ACP
Definition: compat.h:109
#define OPEN_EXISTING
Definition: compat.h:775
#define lstrcpynA
Definition: compat.h:751
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
@ VT_I2
Definition: compat.h:2297
#define lstrcpynW
Definition: compat.h:738
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
GUID guid
Definition: version.c:147
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT(CALLBACK * DllGetClassObjectFunc)(REFCLSID clsid, REFIID iid, LPVOID *ppv)
Definition: compobj.c:449
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
const GUID CLSID_UnixDosFolder
const GUID CLSID_UnixFolder
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
Definition: shellole.c:347
static HRESULT WINAPI IDefClF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
Definition: shellole.c:491
HRESULT WINAPI SHCreateDefClassObject(REFIID riid, LPVOID *ppv, LPFNCREATEINSTANCE lpfnCI, LPDWORD pcRefDll, REFIID riidInst)
Definition: shellole.c:510
static IClassFactory * IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
Definition: shellole.c:397
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:337
static ULONG WINAPI IDefClF_fnRelease(LPCLASSFACTORY iface)
Definition: shellole.c:449
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:549
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:633
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
Definition: shellole.c:533
HRESULT WINAPI SHPropStgReadMultiple(IPropertyStorage *pps, UINT uCodePage, ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar)
Definition: shellole.c:739
static const IClassFactoryVtbl dclfvt
Definition: shellole.c:391
HRESULT WINAPI SHPropStgCreate(IPropertySetStorage *psstg, REFFMTID fmtid, const CLSID *pclsid, DWORD grfFlags, DWORD grfMode, DWORD dwDisposition, IPropertyStorage **ppstg, UINT *puCodePage)
Definition: shellole.c:689
HRESULT WINAPI SHPropStgWriteMultiple(IPropertyStorage *pps, UINT *uCodePage, ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar, PROPID propidNameFirst)
Definition: shellole.c:776
HRESULT(CALLBACK * LPFNCREATEINSTANCE)(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: shellole.c:52
HRESULT WINAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker **moniker)
Definition: shellole.c:817
static const struct @628 InterfaceTable[]
UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength)
Definition: shellole.c:578
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax)
Definition: ordinal.c:661
DWORD WINAPI SHCLSIDFromStringAW(LPCVOID clsid, CLSID *id)
Definition: shellole.c:272
HRESULT WINAPI SHGetMalloc(LPMALLOC *lpmal)
Definition: shellole.c:296
BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
Definition: shellole.c:558
REFIID clsid
Definition: shellole.c:60
static ULONG WINAPI IDefClF_fnAddRef(LPCLASSFACTORY iface)
Definition: shellole.c:437
HRESULT WINAPI SHExtCoCreateInstance(_In_opt_ LPCWSTR aclsid, _In_opt_ const CLSID *clsid, _In_opt_ LPUNKNOWN pUnkOuter, _In_ REFIID refiid, _Out_ LPVOID *ppv)
Definition: shellole.c:196
static HRESULT WINAPI IDefClF_fnQueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: shellole.c:416
DWORD WINAPI SHCLSIDFromStringA(LPCSTR clsid, CLSID *id)
Definition: shellole.c:259
static IDefClFImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: shellole.c:386
static HRESULT WINAPI IDefClF_fnCreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: shellole.c:469
DWORD WINAPI SHCLSIDFromStringW(LPCWSTR clsid, CLSID *id)
Definition: shellole.c:267
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
Definition: shellole.c:212
LPVOID WINAPI SHAlloc(SIZE_T len)
Definition: shellole.c:315
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
Definition: shellole.c:105
DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue, LPDWORD lpReserved, LPDWORD pwType, LPVOID pvData, LPDWORD pcbData)
Definition: reg.c:1461
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint end
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT WINAPI CoGetMalloc(DWORD context, IMalloc **imalloc)
Definition: ifs.c:403
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
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
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define CREATE_ALWAYS
Definition: disk.h:72
#define CREATE_NEW
Definition: disk.h:69
#define OPEN_ALWAYS
Definition: disk.h:70
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
HRESULT hres
Definition: protocol.c:465
#define PID_CODEPAGE
Definition: suminfo.c:43
static const CLSID IPropertyStorage UINT *static const PROPSPEC PROPVARIANT *static UINT const PROPSPEC PROPVARIANT PROPID
Definition: shellole.c:78
unsigned int UINT
Definition: ndis.h:50
static LPUNKNOWN
Definition: ndr_ole.c:49
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define KEY_READ
Definition: nt_native.h:1023
interface IMalloc * LPMALLOC
Definition: objfwd.h:12
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
#define REFFMTID
Definition: guiddef.h:119
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
#define strlenW(s)
Definition: unicode.h:34
#define memset(x, y, z)
Definition: compat.h:39
static __inline BOOL SHELL_OsIsUnicode(void)
Definition: shell32_main.h:164
#define TRACE(s)
Definition: solgame.cpp:4
BOOL fNC
Definition: shlobj.h:2315
DWORD pFiles
Definition: shlobj.h:2313
BOOL fWide
Definition: shlobj.h:2316
POINT pt
Definition: shlobj.h:2314
Definition: scsiwmi.h:51
Definition: main.c:40
Definition: stat.h:55
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
int32_t * PLONG
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int codepage
Definition: win_iconv.c:156
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:377
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
CONST void * LPCVOID
Definition: windef.h:191
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define E_POINTER
Definition: winerror.h:2365
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define SetWindowLongPtrA
Definition: winuser.h:5430
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define GetWindowLongPtrA
Definition: winuser.h:4904
#define GWL_EXSTYLE
Definition: winuser.h:862
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185