ReactOS 0.4.16-dev-122-g325d74c
shdocvw.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "shlobj.h"
#include "exdisp.h"
#include "wine/heap.h"
#include "wine/list.h"
Include dependency graph for shdocvw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

HRESULT SHDOCVW_GetShellInstanceObjectClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppvClassObj) DECLSPEC_HIDDEN
 
static void SHDOCVW_LockModule (void)
 
static void SHDOCVW_UnlockModule (void)
 

Variables

LONG SHDOCVW_refCount DECLSPEC_HIDDEN
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file shdocvw.h.

Function Documentation

◆ SHDOCVW_GetShellInstanceObjectClassObject()

HRESULT SHDOCVW_GetShellInstanceObjectClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppvClassObj 
)

Definition at line 365 of file shlinstobj.c.

367{
368 WCHAR wszInstanceKey[] = { 'C','L','S','I','D','\\','{','0','0','0','0','0','0','0','0','-',
369 '0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0',
370 '0','0','0','0','}','\\','I','n','s','t','a','n','c','e', 0 };
371 static const WCHAR wszCLSID[] = { 'C','L','S','I','D',0 };
372 static const WCHAR wszInitPropertyBag[] =
373 { 'I','n','i','t','P','r','o','p','e','r','t','y','B','a','g',0 };
374 WCHAR wszCLSIDInstance[CHARS_IN_GUID];
375 CLSID clsidInstance;
376 HKEY hInstanceKey, hInitPropertyBagKey;
377 DWORD dwType, cbBytes = sizeof(wszCLSIDInstance);
378 IPropertyBag *pInitPropertyBag;
379 HRESULT hr;
380 LONG res;
381
382 TRACE("(rclsid=%s, riid=%s, ppvClassObject=%p)\n", debugstr_guid(rclsid), debugstr_guid(riid),
383 ppvClassObj);
384
385 /* Figure if there is an 'Instance' subkey for the given CLSID and acquire a handle. */
386 if (!StringFromGUID2(rclsid, wszInstanceKey + 6, CHARS_IN_GUID))
388 wszInstanceKey[5+CHARS_IN_GUID] = '\\'; /* Repair the null-termination. */
389 if (ERROR_SUCCESS != RegOpenKeyExW(HKEY_CLASSES_ROOT, wszInstanceKey, 0, KEY_READ, &hInstanceKey))
390 /* If there is no 'Instance' subkey, then it's not a Shell Instance Object. */
392
393 if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, wszCLSID, NULL, &dwType, (LPBYTE)wszCLSIDInstance, &cbBytes) ||
394 FAILED(CLSIDFromString(wszCLSIDInstance, &clsidInstance)))
395 {
396 /* 'Instance' should have a 'CLSID' value with a well-formed clsid-string. */
397 FIXME("Failed to infer instance CLSID! %s\n", debugstr_w(wszCLSIDInstance));
398 RegCloseKey(hInstanceKey);
400 }
401
402 /* Try to open the 'InitPropertyBag' subkey. */
403 res = RegOpenKeyExW(hInstanceKey, wszInitPropertyBag, 0, KEY_READ, &hInitPropertyBagKey);
404 RegCloseKey(hInstanceKey);
405 if (res != ERROR_SUCCESS) {
406 /* Besides 'InitPropertyBag's, shell instance objects might be initialized by streams.
407 * So this case might not be an error. */
408 TRACE("No InitPropertyBag key found!\n");
410 }
411
412 /* If the construction succeeds, the new RegistryPropertyBag is responsible for closing
413 * hInitPropertyBagKey. */
415 (LPVOID*)&pInitPropertyBag);
416 if (FAILED(hr)) {
417 RegCloseKey(hInitPropertyBagKey);
418 return hr;
419 }
420
421 /* Construct an Instance Object Factory, which creates objects of class 'clsidInstance'
422 * and asks them to initialize themselves with the help of the 'pInitiPropertyBag' */
423 hr = InstanceObjectFactory_Constructor(&clsidInstance, pInitPropertyBag, riid, ppvClassObj);
424 IPropertyBag_Release(pInitPropertyBag); /* The factory will hold a reference the bag. */
425
426 return hr;
427}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define RegCloseKey(hKey)
Definition: registry.h:49
#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:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define KEY_READ
Definition: nt_native.h:1023
const GUID IID_IPropertyBag
long LONG
Definition: pedump.c:60
HRESULT hr
Definition: shlfolder.c:183
static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *pPropertyBag, REFIID riid, LPVOID *ppvObject)
Definition: shlinstobj.c:324
static HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID riid, LPVOID *ppvObject)
Definition: shlinstobj.c:175
#define CHARS_IN_GUID
Definition: shlinstobj.c:42
#define TRACE(s)
Definition: solgame.cpp:4
unsigned char * LPBYTE
Definition: typedefs.h:53
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DllGetClassObject().

◆ SHDOCVW_LockModule()

◆ SHDOCVW_UnlockModule()

Variable Documentation

◆ DECLSPEC_HIDDEN

LONG SHDOCVW_refCount DECLSPEC_HIDDEN
extern

Definition at line 289 of file d3dcompiler_private.h.