ReactOS  0.4.15-dev-2991-g632fa1c
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
 

Macros

#define SHCIDS_ALLFIELDS   0x80000000L
 

Enumerations

enum  font_columns {
  FONTEXT_COL_NAME, FONTEXT_COL_FILENAME, FONTEXT_COL_SIZE, FONTEXT_COL_MODIFIED,
  FONTEXT_COL_ATTR
}
 

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 []
 

Macro Definition Documentation

◆ SHCIDS_ALLFIELDS

#define SHCIDS_ALLFIELDS   0x80000000L

Definition at line 15 of file CFontExt.cpp.

Enumeration Type Documentation

◆ font_columns

Enumerator
FONTEXT_COL_NAME 
FONTEXT_COL_FILENAME 
FONTEXT_COL_SIZE 
FONTEXT_COL_MODIFIED 
FONTEXT_COL_ATTR 

Definition at line 26 of file CFontExt.cpp.

Function Documentation

◆ g2s()

WCHAR* g2s ( REFCLSID  iid)

Definition at line 62 of file CFontExt.cpp.

63 {
64  static WCHAR buf[2][300];
65  static int idx = 0;
66 
67  idx ^= 1;
68 
69  LPOLESTR tmp;
70  HRESULT hr = ProgIDFromCLSID(iid, &tmp);
71  if (SUCCEEDED(hr))
72  {
73  wcscpy(buf[idx], tmp);
74  CoTaskMemFree(tmp);
75  return buf[idx];
76  }
79  {
80  return buf[idx];
81  }
83 
84  return buf[idx];
85 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT hr
Definition: shlfolder.c:183
bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: CFontExt.cpp:51
static LPOLESTR
Definition: stg_prop.c:27
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2530
if SUCCEEDED(hr)
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)

Referenced by CFontExt::BindToObject().

◆ GetInterfaceName()

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

Definition at line 51 of file CFontExt.cpp.

52 {
53  WCHAR LocalBuf[100];
54  DWORD dwType = 0, dwDataSize = size * sizeof(WCHAR);
55 
56  if (!SUCCEEDED(StringCchPrintfW(LocalBuf, _countof(LocalBuf), L"Interface\\%s", InterfaceString)))
57  return false;
58 
59  return RegGetValueW(HKEY_CLASSES_ROOT, LocalBuf, NULL, RRF_RT_REG_SZ, &dwType, buf, &dwDataSize) == ERROR_SUCCESS;
60 }
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
#define RRF_RT_REG_SZ
Definition: driver.c:575
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
if SUCCEEDED(hr)
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 NULL
Definition: types.h:112
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

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:414
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#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