ReactOS  0.4.15-dev-1384-g878186b
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. */
406  hr = RegistryPropertyBag_Constructor(hInitPropertyBagKey, &IID_IPropertyBag,
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 ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
REFIID riid
Definition: precomp.h:44
static HRESULT InstanceObjectFactory_Constructor(REFCLSID rclsid, IPropertyBag *pPropertyBag, REFIID riid, LPVOID *ppvObject)
Definition: shlinstobj.c:316
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
const GUID IID_IPropertyBag
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
static HRESULT RegistryPropertyBag_Constructor(HKEY hInitPropertyBagKey, REFIID riid, LPVOID *ppvObject)
Definition: shlinstobj.c:171
LONG HRESULT
Definition: typedefs.h:79
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CHARS_IN_GUID
Definition: shlinstobj.c:42
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by DllGetClassObject().

◆ SHDOCVW_LockModule()

static void SHDOCVW_LockModule ( void  )
inlinestatic

Definition at line 50 of file shdocvw.h.

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

Referenced by InstanceObjectFactory_IClassFactory_LockServer(), and RegistryPropertyBag_IPropertyBag_AddRef().

◆ SHDOCVW_UnlockModule()

static void SHDOCVW_UnlockModule ( void  )
inlinestatic

Definition at line 51 of file shdocvw.h.

LONG SHDOCVW_refCount
Definition: shdocvw_main.c:42
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by InstanceObjectFactory_IClassFactory_LockServer(), and RegistryPropertyBag_IPropertyBag_Release().

Variable Documentation

◆ DECLSPEC_HIDDEN

LONG SHDOCVW_refCount DECLSPEC_HIDDEN

Definition at line 155 of file crypt32_private.h.