ReactOS 0.4.15-dev-8002-gbbb3b00
Debug.cpp File Reference
#include "precomp.h"
Include dependency graph for Debug.cpp:

Go to the source code of this file.

Functions

static bool GetInterfaceName (const WCHAR *InterfaceString, WCHAR *buf, size_t size)
 
WCHARguid2string (REFCLSID iid)
 

Function Documentation

◆ GetInterfaceName()

static bool GetInterfaceName ( const WCHAR InterfaceString,
WCHAR buf,
size_t  size 
)
static

Definition at line 10 of file Debug.cpp.

11{
12 WCHAR LocalBuf[100];
13 DWORD dwType = 0, dwDataSize = size * sizeof(WCHAR);
14
15 if (!SUCCEEDED(StringCchPrintfW(LocalBuf, _countof(LocalBuf), L"Interface\\%s", InterfaceString)))
16 return false;
17
18 return SHRegGetValueW(HKEY_CLASSES_ROOT, LocalBuf, NULL, RRF_RT_REG_SZ, &dwType, buf, &dwDataSize) == ERROR_SUCCESS;
19}
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define RRF_RT_REG_SZ
Definition: driver.c:575
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define L(x)
Definition: ntvdm.h:50
LSTATUS WINAPI SHRegGetValueW(_In_ HKEY hkey, _In_opt_ LPCWSTR pszSubKey, _In_opt_ LPCWSTR pszValue, _In_ SRRF srrfFlags, _Out_opt_ LPDWORD pdwType, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID pvData, _Inout_opt_ LPDWORD pcbData)
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by guid2string().

◆ guid2string()

WCHAR * guid2string ( REFCLSID  iid)

Definition at line 21 of file Debug.cpp.

22{
23 static WCHAR buf[2][300];
24 static int idx = 0;
25
26 idx ^= 1;
27
28 LPOLESTR tmp;
29 HRESULT hr = ProgIDFromCLSID(iid, &tmp);
30 if (SUCCEEDED(hr))
31 {
32 wcscpy(buf[idx], tmp);
33 CoTaskMemFree(tmp);
34 return buf[idx];
35 }
38 {
39 return buf[idx];
40 }
42
43 return buf[idx];
44}
static bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: Debug.cpp:10
unsigned int idx
Definition: utils.c:41
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2530
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
static LPOLESTR
Definition: stg_prop.c:27
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HRESULT hr
Definition: shlfolder.c:183

Referenced by CZipFolder::BindToObject(), CZipFolder::CreateViewObject(), and CZipFolder::GetUIObjectOf().