ReactOS  0.4.12-dev-919-gfc3b8d5
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
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _countof(array)
Definition: fontsub.cpp:30
#define RRF_RT_REG_SZ
Definition: driver.c:575
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
LSTATUS WINAPI SHRegGetValueW(_In_ HKEY, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ SRRF, _Out_opt_ LPDWORD, _Out_writes_bytes_to_opt_(*pcbData, *pcbData) LPVOID, _Inout_opt_ LPDWORD pcbData)
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by guid2string(), and InfoTdiQueryGetInterfaceMIB().

◆ 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 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define _countof(array)
Definition: fontsub.cpp:30
static LPOLESTR
Definition: stg_prop.c:27
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2439
unsigned int idx
Definition: utils.c:41
static bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: Debug.cpp:10
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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