2 * handling of SHELL32.DLL OLE-Objects
4 * Copyright 1997 Marcus Meissner
5 * Copyright 1998 Juergen Schmied <juergen.schmied@metronet.de>
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.
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.
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
22 #include <wine/config.h>
28 #define WIN32_NO_STATUS
31 #define NONAMELESSUNION
40 #include <wine/debug.h>
41 #include <wine/unicode.h>
43 #include "shell32_main.h"
45 WINE_DEFAULT_DEBUG_CHANNEL(shell
);
47 extern INT WINAPI
SHStringFromGUIDW(REFGUID guid
, LPWSTR lpszDest
, INT cchMax
); /* shlwapi.24 */
49 /**************************************************************************
50 * Default ClassFactory types
52 typedef HRESULT (CALLBACK
*LPFNCREATEINSTANCE
)(IUnknown
* pUnkOuter
, REFIID riid
, LPVOID
* ppvObject
);
56 static IClassFactory
* IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI
, PLONG pcRefDll
, REFIID riidInst
);
58 /* this table contains all CLSIDs of shell32 objects */
61 LPFNCREATEINSTANCE lpfnCI
;
62 } InterfaceTable
[] = {
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
},
87 #endif /* !__REACTOS__ */
89 /*************************************************************************
90 * SHCoCreateInstance [SHELL32.102]
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.
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
100 * exported by ordinal
103 * CoCreateInstance, SHLoadOLE
105 HRESULT WINAPI
SHCoCreateInstance(
114 const CLSID
* myclsid
= clsid
;
115 WCHAR sKeyName
[MAX_PATH
];
116 static const WCHAR sCLSID
[] = {'C','L','S','I','D','\\','\0'};
118 static const WCHAR sInProcServer32
[] = {'\\','I','n','p','r','o','c','S','e','r','v','e','r','3','2','\0'};
119 static const WCHAR sLoadWithoutCOM
[] = {'L','o','a','d','W','i','t','h','o','u','t','C','O','M','\0'};
120 WCHAR sDllPath
[MAX_PATH
];
123 IClassFactory
* pcf
= NULL
;
125 if(!ppv
) return E_POINTER
;
128 /* if the clsid is a string, convert it */
131 if (!aclsid
) return REGDB_E_CLASSNOTREG
;
132 SHCLSIDFromStringW(aclsid
, &iid
);
136 TRACE("(%p,%s,unk:%p,%s,%p)\n",
137 aclsid
,shdebugstr_guid(myclsid
),pUnkOuter
,shdebugstr_guid(refiid
),ppv
);
139 if (SUCCEEDED(DllGetClassObject(myclsid
, &IID_IClassFactory
,(LPVOID
*)&pcf
)))
141 hres
= IClassFactory_CreateInstance(pcf
, pUnkOuter
, refiid
, ppv
);
142 IClassFactory_Release(pcf
);
146 /* we look up the dll path in the registry */
147 SHStringFromGUIDW(myclsid
, sClassID
, sizeof(sClassID
)/sizeof(WCHAR
));
148 lstrcpyW(sKeyName
, sCLSID
);
149 lstrcatW(sKeyName
, sClassID
);
150 lstrcatW(sKeyName
, sInProcServer32
);
152 if (RegOpenKeyExW(HKEY_CLASSES_ROOT
, sKeyName
, 0, KEY_READ
, &hKey
))
153 return E_ACCESSDENIED
;
155 /* if a special registry key is set, we load a shell extension without help of OLE32 */
156 if (!SHQueryValueExW(hKey
, sLoadWithoutCOM
, 0, 0, 0, 0))
158 /* load an external dll without ole32 */
160 typedef HRESULT (CALLBACK
*DllGetClassObjectFunc
)(REFCLSID clsid
, REFIID iid
, LPVOID
*ppv
);
161 DllGetClassObjectFunc DllGetClassObject
;
163 dwSize
= sizeof(sDllPath
);
164 SHQueryValueExW(hKey
, NULL
, 0,0, sDllPath
, &dwSize
);
166 if ((hLibrary
= LoadLibraryExW(sDllPath
, 0, LOAD_WITH_ALTERED_SEARCH_PATH
)) == 0) {
167 ERR("couldn't load InprocServer32 dll %s\n", debugstr_w(sDllPath
));
168 hres
= E_ACCESSDENIED
;
170 } else if (!(DllGetClassObject
= (DllGetClassObjectFunc
)GetProcAddress(hLibrary
, "DllGetClassObject"))) {
171 ERR("couldn't find function DllGetClassObject in %s\n", debugstr_w(sDllPath
));
172 FreeLibrary( hLibrary
);
173 hres
= E_ACCESSDENIED
;
175 } else if (FAILED(hres
= DllGetClassObject(myclsid
, &IID_IClassFactory
, (LPVOID
*)&pcf
))) {
176 TRACE("GetClassObject failed 0x%08x\n", hres
);
180 hres
= IClassFactory_CreateInstance(pcf
, pUnkOuter
, refiid
, ppv
);
181 IClassFactory_Release(pcf
);
184 /* load an external dll in the usual way */
185 hres
= CoCreateInstance(myclsid
, pUnkOuter
, CLSCTX_INPROC_SERVER
, refiid
, ppv
);
189 if (hKey
) RegCloseKey(hKey
);
192 ERR("failed (0x%08x) to create CLSID:%s IID:%s\n",
193 hres
, shdebugstr_guid(myclsid
), shdebugstr_guid(refiid
));
194 ERR("class not found in registry\n");
197 TRACE("-- instance: %p\n",*ppv
);
202 /*************************************************************************
203 * DllGetClassObject [SHELL32.@]
204 * SHDllGetClassObject [SHELL32.128]
206 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID iid
, LPVOID
*ppv
)
208 HRESULT hres
= E_OUTOFMEMORY
;
209 IClassFactory
* pcf
= NULL
;
212 TRACE("CLSID:%s,IID:%s\n",shdebugstr_guid(rclsid
),shdebugstr_guid(iid
));
214 if (!ppv
) return E_INVALIDARG
;
217 /* search our internal interface table */
218 for(i
=0;InterfaceTable
[i
].riid
;i
++) {
219 if(IsEqualIID(InterfaceTable
[i
].riid
, rclsid
)) {
220 TRACE("index[%u]\n", i
);
221 pcf
= IDefClF_fnConstructor(InterfaceTable
[i
].lpfnCI
, NULL
, NULL
);
226 FIXME("failed for CLSID=%s\n", shdebugstr_guid(rclsid
));
227 return CLASS_E_CLASSNOTAVAILABLE
;
230 hres
= IClassFactory_QueryInterface(pcf
, iid
, ppv
);
231 IClassFactory_Release(pcf
);
233 TRACE("-- pointer to class factory: %p\n",*ppv
);
238 /*************************************************************************
239 * SHCLSIDFromString [SHELL32.147]
241 * Under Windows 9x this was an ANSI version of CLSIDFromString. It also allowed
242 * to avoid dependency on ole32.dll (see SHLoadOLE for details).
244 * Under Windows NT/2000/XP this is equivalent to CLSIDFromString
247 * exported by ordinal
250 * CLSIDFromString, SHLoadOLE
252 DWORD WINAPI
SHCLSIDFromStringA (LPCSTR clsid
, CLSID
*id
)
255 TRACE("(%p(%s) %p)\n", clsid
, clsid
, id
);
256 if (!MultiByteToWideChar( CP_ACP
, 0, clsid
, -1, buffer
, sizeof(buffer
)/sizeof(WCHAR
) ))
257 return CO_E_CLASSSTRING
;
258 return CLSIDFromString( buffer
, id
);
260 DWORD WINAPI
SHCLSIDFromStringW (LPCWSTR clsid
, CLSID
*id
)
262 TRACE("(%p(%s) %p)\n", clsid
, debugstr_w(clsid
), id
);
263 return CLSIDFromString(clsid
, id
);
265 DWORD WINAPI
SHCLSIDFromStringAW (LPCVOID clsid
, CLSID
*id
)
267 if (SHELL_OsIsUnicode())
268 return SHCLSIDFromStringW (clsid
, id
);
269 return SHCLSIDFromStringA (clsid
, id
);
272 /*************************************************************************
273 * SHGetMalloc [SHELL32.@]
275 * Equivalent to CoGetMalloc(MEMCTX_TASK, ...). Under Windows 9x this function
276 * could use the shell32 built-in "mini-COM" without the need to load ole32.dll -
277 * see SHLoadOLE for details.
280 * lpmal [O] Destination for IMalloc interface.
283 * Success: S_OK. lpmal contains the shells IMalloc interface.
284 * Failure. An HRESULT error code.
287 * CoGetMalloc, SHLoadOLE
289 HRESULT WINAPI
SHGetMalloc(LPMALLOC
*lpmal
)
291 TRACE("(%p)\n", lpmal
);
292 return CoGetMalloc(MEMCTX_TASK
, lpmal
);
295 /*************************************************************************
296 * SHAlloc [SHELL32.196]
298 * Equivalent to CoTaskMemAlloc. Under Windows 9x this function could use
299 * the shell32 built-in "mini-COM" without the need to load ole32.dll -
300 * see SHLoadOLE for details.
303 * exported by ordinal
306 * CoTaskMemAlloc, SHLoadOLE
308 LPVOID WINAPI
SHAlloc(SIZE_T len
)
312 ret
= CoTaskMemAlloc(len
);
313 TRACE("%u bytes at %p\n",len
, ret
);
317 /*************************************************************************
318 * SHFree [SHELL32.195]
320 * Equivalent to CoTaskMemFree. Under Windows 9x this function could use
321 * the shell32 built-in "mini-COM" without the need to load ole32.dll -
322 * see SHLoadOLE for details.
325 * exported by ordinal
328 * CoTaskMemFree, SHLoadOLE
330 void WINAPI
SHFree(LPVOID pv
)
337 /*************************************************************************
338 * SHGetDesktopFolder [SHELL32.@]
340 HRESULT WINAPI
SHGetDesktopFolder(IShellFolder
**psf
)
344 TRACE("(%p)\n", psf
);
346 if(!psf
) return E_INVALIDARG
;
349 hres
= ISF_Desktop_Constructor(NULL
, &IID_IShellFolder
, (LPVOID
*)psf
);
351 TRACE("-- %p->(%p) 0x%08x\n", psf
, *psf
, hres
);
356 /**************************************************************************
357 * Default ClassFactory Implementation
359 * SHCreateDefClassObject
362 * Helper function for dlls without their own classfactory.
363 * A generic classfactory is returned.
364 * When the CreateInstance of the cf is called the callback is executed.
369 IClassFactory IClassFactory_iface
;
372 LPFNCREATEINSTANCE lpfnCI
;
373 const IID
* riidInst
;
374 LONG
* pcRefDll
; /* pointer to refcounter in external dll (ugrrr...) */
377 static inline IDefClFImpl
*impl_from_IClassFactory(IClassFactory
*iface
)
379 return CONTAINING_RECORD(iface
, IDefClFImpl
, IClassFactory_iface
);
384 static const IClassFactoryVtbl dclfvt
;
386 /**************************************************************************
387 * IDefClF_fnConstructor
390 static IClassFactory
* IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI
, PLONG pcRefDll
, REFIID riidInst
)
394 lpclf
= HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl
));
396 lpclf
->IClassFactory_iface
.lpVtbl
= &dclfvt
;
397 lpclf
->lpfnCI
= lpfnCI
;
398 lpclf
->pcRefDll
= pcRefDll
;
400 if (pcRefDll
) InterlockedIncrement(pcRefDll
);
401 lpclf
->riidInst
= riidInst
;
403 TRACE("(%p)%s\n",lpclf
, shdebugstr_guid(riidInst
));
404 return (LPCLASSFACTORY
)lpclf
;
406 /**************************************************************************
407 * IDefClF_fnQueryInterface
409 static HRESULT WINAPI
IDefClF_fnQueryInterface(
410 LPCLASSFACTORY iface
, REFIID riid
, LPVOID
*ppvObj
)
412 IDefClFImpl
*This
= impl_from_IClassFactory(iface
);
414 TRACE("(%p)->(%s)\n",This
,shdebugstr_guid(riid
));
418 if(IsEqualIID(riid
, &IID_IUnknown
) || IsEqualIID(riid
, &IID_IClassFactory
)) {
420 InterlockedIncrement(&This
->ref
);
424 TRACE("-- E_NOINTERFACE\n");
425 return E_NOINTERFACE
;
427 /******************************************************************************
430 static ULONG WINAPI
IDefClF_fnAddRef(LPCLASSFACTORY iface
)
432 IDefClFImpl
*This
= impl_from_IClassFactory(iface
);
433 ULONG refCount
= InterlockedIncrement(&This
->ref
);
435 TRACE("(%p)->(count=%u)\n", This
, refCount
- 1);
439 /******************************************************************************
442 static ULONG WINAPI
IDefClF_fnRelease(LPCLASSFACTORY iface
)
444 IDefClFImpl
*This
= impl_from_IClassFactory(iface
);
445 ULONG refCount
= InterlockedDecrement(&This
->ref
);
447 TRACE("(%p)->(count=%u)\n", This
, refCount
+ 1);
451 if (This
->pcRefDll
) InterlockedDecrement(This
->pcRefDll
);
453 TRACE("-- destroying IClassFactory(%p)\n",This
);
454 HeapFree(GetProcessHeap(),0,This
);
459 /******************************************************************************
460 * IDefClF_fnCreateInstance
462 static HRESULT WINAPI
IDefClF_fnCreateInstance(
463 LPCLASSFACTORY iface
, LPUNKNOWN pUnkOuter
, REFIID riid
, LPVOID
*ppvObject
)
465 IDefClFImpl
*This
= impl_from_IClassFactory(iface
);
467 TRACE("%p->(%p,%s,%p)\n",This
,pUnkOuter
,shdebugstr_guid(riid
),ppvObject
);
471 if ( This
->riidInst
==NULL
||
472 IsEqualCLSID(riid
, This
->riidInst
) ||
473 IsEqualCLSID(riid
, &IID_IUnknown
) )
475 return This
->lpfnCI(pUnkOuter
, riid
, ppvObject
);
478 ERR("unknown IID requested %s\n",shdebugstr_guid(riid
));
479 return E_NOINTERFACE
;
481 /******************************************************************************
482 * IDefClF_fnLockServer
484 static HRESULT WINAPI
IDefClF_fnLockServer(LPCLASSFACTORY iface
, BOOL fLock
)
486 IDefClFImpl
*This
= impl_from_IClassFactory(iface
);
487 TRACE("%p->(0x%x), not implemented\n",This
, fLock
);
491 static const IClassFactoryVtbl dclfvt
=
493 IDefClF_fnQueryInterface
,
496 IDefClF_fnCreateInstance
,
500 /******************************************************************************
501 * SHCreateDefClassObject [SHELL32.70]
503 HRESULT WINAPI
SHCreateDefClassObject(
506 LPFNCREATEINSTANCE lpfnCI
, /* [in] create instance callback entry */
507 LPDWORD pcRefDll
, /* [in/out] ref count of the dll */
508 REFIID riidInst
) /* [in] optional interface to the instance */
512 TRACE("%s %p %p %p %s\n",
513 shdebugstr_guid(riid
), ppv
, lpfnCI
, pcRefDll
, shdebugstr_guid(riidInst
));
515 if (! IsEqualCLSID(riid
, &IID_IClassFactory
) ) return E_NOINTERFACE
;
516 if (! (pcf
= IDefClF_fnConstructor(lpfnCI
, (PLONG
)pcRefDll
, riidInst
))) return E_OUTOFMEMORY
;
521 #endif /* !__REACTOS__ */
523 /*************************************************************************
524 * DragAcceptFiles [SHELL32.@]
526 void WINAPI
DragAcceptFiles(HWND hWnd
, BOOL b
)
530 if( !IsWindow(hWnd
) ) return;
531 exstyle
= GetWindowLongPtrA(hWnd
,GWL_EXSTYLE
);
533 exstyle
|= WS_EX_ACCEPTFILES
;
535 exstyle
&= ~WS_EX_ACCEPTFILES
;
536 SetWindowLongPtrA(hWnd
,GWL_EXSTYLE
,exstyle
);
539 /*************************************************************************
540 * DragFinish [SHELL32.@]
542 void WINAPI
DragFinish(HDROP h
)
548 /*************************************************************************
549 * DragQueryPoint [SHELL32.@]
551 BOOL WINAPI
DragQueryPoint(HDROP hDrop
, POINT
*p
)
553 DROPFILES
*lpDropFileStruct
;
558 lpDropFileStruct
= GlobalLock(hDrop
);
560 *p
= lpDropFileStruct
->pt
;
561 bRet
= lpDropFileStruct
->fNC
;
567 /*************************************************************************
568 * DragQueryFileA [SHELL32.@]
569 * DragQueryFile [SHELL32.@]
571 UINT WINAPI
DragQueryFileA(
579 DROPFILES
*lpDropFileStruct
= GlobalLock(hDrop
);
581 TRACE("(%p, %x, %p, %u)\n", hDrop
,lFile
,lpszFile
,lLength
);
583 if(!lpDropFileStruct
) goto end
;
585 lpDrop
= (LPSTR
) lpDropFileStruct
+ lpDropFileStruct
->pFiles
;
587 if(lpDropFileStruct
->fWide
) {
588 LPWSTR lpszFileW
= NULL
;
591 lpszFileW
= HeapAlloc(GetProcessHeap(), 0, lLength
*sizeof(WCHAR
));
592 if(lpszFileW
== NULL
) {
596 i
= DragQueryFileW(hDrop
, lFile
, lpszFileW
, lLength
);
599 WideCharToMultiByte(CP_ACP
, 0, lpszFileW
, -1, lpszFile
, lLength
, 0, NULL
);
600 HeapFree(GetProcessHeap(), 0, lpszFileW
);
607 while (*lpDrop
++); /* skip filename */
610 i
= (lFile
== 0xFFFFFFFF) ? i
: 0;
616 if (!lpszFile
) goto end
; /* needed buffer size */
617 lstrcpynA (lpszFile
, lpDrop
, lLength
);
623 /*************************************************************************
624 * DragQueryFileW [SHELL32.@]
626 UINT WINAPI
DragQueryFileW(
634 DROPFILES
*lpDropFileStruct
= GlobalLock(hDrop
);
636 TRACE("(%p, %x, %p, %u)\n", hDrop
,lFile
,lpszwFile
,lLength
);
638 if(!lpDropFileStruct
) goto end
;
640 lpwDrop
= (LPWSTR
) ((LPSTR
)lpDropFileStruct
+ lpDropFileStruct
->pFiles
);
642 if(lpDropFileStruct
->fWide
== FALSE
) {
643 LPSTR lpszFileA
= NULL
;
646 lpszFileA
= HeapAlloc(GetProcessHeap(), 0, lLength
);
647 if(lpszFileA
== NULL
) {
651 i
= DragQueryFileA(hDrop
, lFile
, lpszFileA
, lLength
);
654 MultiByteToWideChar(CP_ACP
, 0, lpszFileA
, -1, lpszwFile
, lLength
);
655 HeapFree(GetProcessHeap(), 0, lpszFileA
);
663 while (*lpwDrop
++); /* skip filename */
666 i
= (lFile
== 0xFFFFFFFF) ? i
: 0;
671 i
= strlenW(lpwDrop
);
672 if ( !lpszwFile
) goto end
; /* needed buffer size */
673 lstrcpynW (lpszwFile
, lpwDrop
, lLength
);
679 /*************************************************************************
680 * SHPropStgCreate [SHELL32.685]
682 HRESULT WINAPI
SHPropStgCreate(IPropertySetStorage
*psstg
, REFFMTID fmtid
,
683 const CLSID
*pclsid
, DWORD grfFlags
, DWORD grfMode
,
684 DWORD dwDisposition
, IPropertyStorage
**ppstg
, UINT
*puCodePage
)
690 TRACE("%p %s %s %x %x %x %p %p\n", psstg
, debugstr_guid(fmtid
), debugstr_guid(pclsid
),
691 grfFlags
, grfMode
, dwDisposition
, ppstg
, puCodePage
);
693 hres
= IPropertySetStorage_Open(psstg
, fmtid
, grfMode
, ppstg
);
695 switch(dwDisposition
) {
697 if(SUCCEEDED(hres
)) {
698 IPropertyStorage_Release(*ppstg
);
699 hres
= IPropertySetStorage_Delete(psstg
, fmtid
);
708 hres
= IPropertySetStorage_Create(psstg
, fmtid
, pclsid
,
709 grfFlags
, grfMode
, ppstg
);
716 prop
.ulKind
= PRSPEC_PROPID
;
717 prop
.u
.propid
= PID_CODEPAGE
;
718 hres
= IPropertyStorage_ReadMultiple(*ppstg
, 1, &prop
, &ret
);
719 if(FAILED(hres
) || ret
.vt
!=VT_I2
)
722 *puCodePage
= ret
.u
.iVal
;
729 /*************************************************************************
730 * SHPropStgReadMultiple [SHELL32.688]
732 HRESULT WINAPI
SHPropStgReadMultiple(IPropertyStorage
*pps
, UINT uCodePage
,
733 ULONG cpspec
, const PROPSPEC
*rgpspec
, PROPVARIANT
*rgvar
)
738 FIXME("%p %u %u %p %p\n", pps
, uCodePage
, cpspec
, rgpspec
, rgvar
);
740 memset(rgvar
, 0, cpspec
*sizeof(PROPVARIANT
));
741 hres
= IPropertyStorage_ReadMultiple(pps
, cpspec
, rgpspec
, rgvar
);
749 prop
.ulKind
= PRSPEC_PROPID
;
750 prop
.u
.propid
= PID_CODEPAGE
;
751 hres
= IPropertyStorage_ReadMultiple(pps
, 1, &prop
, &ret
);
752 if(FAILED(hres
) || ret
.vt
!=VT_I2
)
755 uCodePage
= ret
.u
.iVal
;
758 hres
= IPropertyStorage_Stat(pps
, &stat
);
762 /* TODO: do something with codepage and stat */
766 /*************************************************************************
767 * SHPropStgWriteMultiple [SHELL32.689]
769 HRESULT WINAPI
SHPropStgWriteMultiple(IPropertyStorage
*pps
, UINT
*uCodePage
,
770 ULONG cpspec
, const PROPSPEC
*rgpspec
, PROPVARIANT
*rgvar
, PROPID propidNameFirst
)
776 FIXME("%p %p %u %p %p %d\n", pps
, uCodePage
, cpspec
, rgpspec
, rgvar
, propidNameFirst
);
778 hres
= IPropertyStorage_Stat(pps
, &stat
);
782 if(uCodePage
&& *uCodePage
)
783 codepage
= *uCodePage
;
788 prop
.ulKind
= PRSPEC_PROPID
;
789 prop
.u
.propid
= PID_CODEPAGE
;
790 hres
= IPropertyStorage_ReadMultiple(pps
, 1, &prop
, &ret
);
793 if(ret
.vt
!=VT_I2
|| !ret
.u
.iVal
)
796 codepage
= ret
.u
.iVal
;
798 *uCodePage
= codepage
;
801 /* TODO: do something with codepage and stat */
803 hres
= IPropertyStorage_WriteMultiple(pps
, cpspec
, rgpspec
, rgvar
, propidNameFirst
);
807 /*************************************************************************
808 * SHCreateQueryCancelAutoPlayMoniker [SHELL32.@]
810 HRESULT WINAPI
SHCreateQueryCancelAutoPlayMoniker(IMoniker
**moniker
)
812 TRACE("%p\n", moniker
);
814 if (!moniker
) return E_INVALIDARG
;
815 return CreateClassMoniker(&CLSID_QueryCancelAutoPlay
, moniker
);