ReactOS 0.4.17-dev-357-ga8f14ff
querysrc.cpp File Reference
#include "precomp.h"
#include <shlwapi.h>
#include <shlwapi_undoc.h>
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <new>
Include dependency graph for querysrc.cpp:

Go to the source code of this file.

Classes

class  CRegistryEnumBase
 
class  CRegistryEnumValues
 
class  CRegistryEnumKeys
 
class  CRegistrySource
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static HRESULT SHAllocBlob (ULONG cbData, const BYTE *pbData, FLAGGED_BYTE_BLOB **ppBlob)
 
 STDMETHODIMP_ (ULONG) CRegistryEnumBase
 
EXTERN_C HRESULT WINAPI QuerySourceCreateFromKey (_In_ HKEY hKey, _In_opt_ PCWSTR lpSubKey, _In_ BOOL bCreate, _In_ REFIID riid, _Outptr_ PVOID *ppv)
 

Function Documentation

◆ QuerySourceCreateFromKey()

EXTERN_C HRESULT WINAPI QuerySourceCreateFromKey ( _In_ HKEY  hKey,
_In_opt_ PCWSTR  lpSubKey,
_In_ BOOL  bCreate,
_In_ REFIID  riid,
_Outptr_ PVOID ppv 
)

Definition at line 499 of file querysrc.cpp.

505{
506 *ppv = NULL;
507
508 CRegistrySource* pRS = new(std::nothrow) CRegistrySource();
509 if (!pRS)
510 return E_OUTOFMEMORY;
511
512 HRESULT hr = pRS->Init(hKey, lpSubKey, bCreate);
513 if (SUCCEEDED(hr))
514 hr = pRS->QueryInterface(riid, ppv);
515
516 pRS->Release();
517 return hr;
518}
HRESULT Init(HKEY hKey, PCWSTR pszSubKey, BOOL bCreate)
Definition: querysrc.cpp:260
STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject) override
Definition: querysrc.cpp:271
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
FxAutoRegKey hKey
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
_In_ int _In_ BOOL bCreate
Definition: shlobj.h:1527

Referenced by CRegistrySource::OpenSource().

◆ SHAllocBlob()

static HRESULT SHAllocBlob ( ULONG  cbData,
const BYTE pbData,
FLAGGED_BYTE_BLOB **  ppBlob 
)
static

Definition at line 17 of file querysrc.cpp.

18{
19 FLAGGED_BYTE_BLOB* pBlob =
20 (FLAGGED_BYTE_BLOB*)CoTaskMemAlloc(sizeof(FLAGGED_BYTE_BLOB) + cbData);
21 if (!pBlob)
22 return E_OUTOFMEMORY;
23
24 pBlob->clSize = cbData;
25 if (pbData)
26 CopyMemory(pBlob->abData, pbData, cbData);
27
28 *ppBlob = pBlob;
29 return S_OK;
30}
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
#define S_OK
Definition: intsafe.h:52
#define CopyMemory
Definition: minwinbase.h:29
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761

Referenced by CRegistrySource::QueryValueDirect().

◆ STDMETHODIMP_()

STDMETHODIMP_ ( ULONG  )

Definition at line 170 of file querysrc.cpp.

171{
172 return ::InterlockedIncrement(&m_cRefs);
173}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )