ReactOS  0.4.15-dev-1150-g593bcce
CFontExt.cpp File Reference
#include "precomp.h"
#include "undocgdi.h"
Include dependency graph for CFontExt.cpp:

Go to the source code of this file.

Classes

struct  FolderViewColumns
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fontext)
 
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW (LPCWSTR pszPath, DWORD dwFileAttributes, REFIID riid, void **ppv)
 
bool GetInterfaceName (const WCHAR *InterfaceString, WCHAR *buf, size_t size)
 
WCHARg2s (REFCLSID iid)
 

Variables

static FolderViewColumns g_ColumnDefs []
 

Function Documentation

◆ g2s()

WCHAR* g2s ( REFCLSID  iid)

Definition at line 50 of file CFontExt.cpp.

51 {
52  static WCHAR buf[2][300];
53  static int idx = 0;
54 
55  idx ^= 1;
56 
57  LPOLESTR tmp;
58  HRESULT hr = ProgIDFromCLSID(iid, &tmp);
59  if (SUCCEEDED(hr))
60  {
61  wcscpy(buf[idx], tmp);
62  CoTaskMemFree(tmp);
63  return buf[idx];
64  }
67  {
68  return buf[idx];
69  }
71 
72  return buf[idx];
73 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT hr
Definition: shlfolder.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: CFontExt.cpp:39
static LPOLESTR
Definition: stg_prop.c:27
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2530
unsigned int idx
Definition: utils.c:41
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
_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:49

Referenced by CFontExt::BindToObject().

◆ GetInterfaceName()

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

Definition at line 39 of file CFontExt.cpp.

40 {
41  WCHAR LocalBuf[100];
42  DWORD dwType = 0, dwDataSize = size * sizeof(WCHAR);
43 
44  if (!SUCCEEDED(StringCchPrintfW(LocalBuf, _countof(LocalBuf), L"Interface\\%s", InterfaceString)))
45  return false;
46 
47  return RegGetValueW(HKEY_CLASSES_ROOT, LocalBuf, NULL, RRF_RT_REG_SZ, &dwType, buf, &dwDataSize) == ERROR_SUCCESS;
48 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#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
#define _countof(array)
Definition: sndvol32.h:68
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
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define SUCCEEDED(hr)
Definition: intsafe.h:49

Referenced by g2s(), and InfoTdiQueryGetInterfaceMIB().

◆ SHCreateFileExtractIconW()

EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW ( LPCWSTR  pszPath,
DWORD  dwFileAttributes,
REFIID  riid,
void **  ppv 
)

Definition at line 350 of file CExtractIcon.cpp.

354 {
355  SHFILEINFOW shfi;
356  ULONG_PTR firet = SHGetFileInfoW(pszPath, dwFileAttributes, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICONLOCATION);
357  HRESULT hr = E_FAIL;
358  if (firet)
359  {
362  if (FAILED_UNEXPECTEDLY(hr))
363  return hr;
364 
365  hr = iconInit->SetNormalIcon(shfi.szDisplayName, shfi.iIcon);
366  if (FAILED_UNEXPECTEDLY(hr))
367  return hr;
368 
369  return iconInit->QueryInterface(riid, ppv);
370  }
371  if (FAILED_UNEXPECTEDLY(hr))
372  return hr;
373 
374  return hr;
375 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
uint32_t ULONG_PTR
Definition: typedefs.h:65
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:413
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define SHGFI_USEFILEATTRIBUTES
Definition: shellapi.h:179
WCHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:373
HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv)
#define SHGFI_ICONLOCATION
Definition: shellapi.h:167
DWORD dwFileAttributes

Referenced by CFontExt::GetUIObjectOf().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fontext  )

Variable Documentation

◆ g_ColumnDefs