ReactOS 0.4.15-dev-8119-g4fb2fdb
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 357 of file shlinstobj.c.

359{
360 WCHAR wszInstanceKey[] = { 'C','L','S','I','D','\\','{','0','0','0','0','0','0','0','0','-',
361 '0','0','0','0','-','0','0','0','0','-','0','0','0','0','-','0','0','0','0','0','0','0','0',
362 '0','0','0','0','}','\\','I','n','s','t','a','n','c','e', 0 };
363 static const WCHAR wszCLSID[] = { 'C','L','S','I','D',0 };
364 static const WCHAR wszInitPropertyBag[] =
365 { 'I','n','i','t','P','r','o','p','e','r','t','y','B','a','g',0 };
366 WCHAR wszCLSIDInstance[CHARS_IN_GUID];
367 CLSID clsidInstance;
368 HKEY hInstanceKey, hInitPropertyBagKey;
369 DWORD dwType, cbBytes = sizeof(wszCLSIDInstance);
370 IPropertyBag *pInitPropertyBag;
371 HRESULT hr;
372 LONG res;
373
374 TRACE("(rclsid=%s, riid=%s, ppvClassObject=%p)\n", debugstr_guid(rclsid), debugstr_guid(riid),
375 ppvClassObj);
376
377 /* Figure if there is an 'Instance' subkey for the given CLSID and acquire a handle. */
378 if (!StringFromGUID2(rclsid, wszInstanceKey + 6, CHARS_IN_GUID))
380 wszInstanceKey[5+CHARS_IN_GUID] = '\\'; /* Repair the null-termination. */
381 if (ERROR_SUCCESS != RegOpenKeyExW(HKEY_CLASSES_ROOT, wszInstanceKey, 0, KEY_READ, &hInstanceKey))
382 /* If there is no 'Instance' subkey, then it's not a Shell Instance Object. */
384
385 if (ERROR_SUCCESS != RegQueryValueExW(hInstanceKey, wszCLSID, NULL, &dwType, (LPBYTE)wszCLSIDInstance, &cbBytes) ||
386 FAILED(CLSIDFromString(wszCLSIDInstance, &clsidInstance)))
387 {
388 /* 'Instance' should have a 'CLSID' value with a well-formed clsid-string. */
389 FIXME("Failed to infer instance CLSID! %s\n", debugstr_w(wszCLSIDInstance));
390 RegCloseKey(hInstanceKey);
392 }
393
394 /* Try to open the 'InitPropertyBag' subkey. */
395 res = RegOpenKeyExW(hInstanceKey, wszInitPropertyBag, 0, KEY_READ, &hInitPropertyBagKey);
396 RegCloseKey(hInstanceKey);
397 if (res != ERROR_SUCCESS) {
398 /* Besides 'InitPropertyBag's, shell instance objects might be initialized by streams.
399 * So this case might not be an error. */
400 TRACE("No InitPropertyBag key found!\n");
402 }
403
404 /* If the construction succeeds, the new RegistryPropertyBag is responsible for closing
405 * hInitPropertyBagKey. */
407 (LPVOID*)&pInitPropertyBag);
408 if (FAILED(hr)) {
409 RegCloseKey(hInitPropertyBagKey);
410 return hr;
411 }
412
413 /* Construct an Instance Object Factory, which creates objects of class 'clsidInstance'
414 * and asks them to initialize themselves with the help of the 'pInitiPropertyBag' */
415 hr = InstanceObjectFactory_Constructor(&clsidInstance, pInitPropertyBag, riid, ppvClassObj);
416 IPropertyBag_Release(pInitPropertyBag); /* The factory will hold a reference the bag. */
417
418 return hr;
419}
#define FIXME(fmt,...)
Definition: debug.h:114
#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:316
static HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID riid, LPVOID *ppvObject)
Definition: shlinstobj.c:171
#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()

static void SHDOCVW_LockModule ( void  )
inlinestatic

Definition at line 59 of file shdocvw.h.

#define InterlockedIncrement
Definition: armddk.h:53
LONG SHDOCVW_refCount
Definition: shdocvw_main.c:44

Referenced by InstanceObjectFactory_IClassFactory_LockServer(), and RegistryPropertyBag_IPropertyBag_AddRef().

◆ SHDOCVW_UnlockModule()

static void SHDOCVW_UnlockModule ( void  )
inlinestatic

Variable Documentation

◆ DECLSPEC_HIDDEN

LONG SHDOCVW_refCount DECLSPEC_HIDDEN
extern

Definition at line 289 of file d3dcompiler_private.h.