ReactOS  0.4.14-dev-384-g5b37caa
CFontExt.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Font Shell Extension
3  * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE: CFontExt implementation
5  * COPYRIGHT: Copyright 2019 Mark Jansen (mark.jansen@reactos.org)
6  * Copyright 2019 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7  */
8 
9 #include "precomp.h"
10 
12 
13 
15 {
16  int iResource;
18  int cxChar;
19  int fmt;
20 };
21 
23 {
25 };
26 
27 
28 
29 // Should fix our headers..
31 
32 
33 // Helper functions to translate a guid to a readable name
34 bool GetInterfaceName(const WCHAR* InterfaceString, WCHAR* buf, size_t size)
35 {
36  WCHAR LocalBuf[100];
37  DWORD dwType = 0, dwDataSize = size * sizeof(WCHAR);
38 
39  if (!SUCCEEDED(StringCchPrintfW(LocalBuf, _countof(LocalBuf), L"Interface\\%s", InterfaceString)))
40  return false;
41 
42  return RegGetValueW(HKEY_CLASSES_ROOT, LocalBuf, NULL, RRF_RT_REG_SZ, &dwType, buf, &dwDataSize) == ERROR_SUCCESS;
43 }
44 
46 {
47  static WCHAR buf[2][300];
48  static int idx = 0;
49 
50  idx ^= 1;
51 
52  LPOLESTR tmp;
53  HRESULT hr = ProgIDFromCLSID(iid, &tmp);
54  if (SUCCEEDED(hr))
55  {
56  wcscpy(buf[idx], tmp);
57  CoTaskMemFree(tmp);
58  return buf[idx];
59  }
62  {
63  return buf[idx];
64  }
66 
67  return buf[idx];
68 }
69 
70 
72 {
74 }
75 
77 {
79 }
80 
81 // *** IShellFolder2 methods ***
83 {
84  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
85  return E_NOTIMPL;
86 }
87 
89 {
90  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
91  return E_NOTIMPL;
92 }
93 
95 {
96  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
97  return E_NOTIMPL;
98 }
99 
101 {
102  if (!pcsFlags || iColumn >= _countof(g_ColumnDefs))
103  return E_INVALIDARG;
104 
105  *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
106  return S_OK;
107 }
108 
110 {
111  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
112  return E_NOTIMPL;
113 }
114 
116 {
117  if (iColumn >= _countof(g_ColumnDefs))
118  return E_FAIL;
119 
120  psd->cxChar = g_ColumnDefs[iColumn].cxChar;
121  psd->fmt = g_ColumnDefs[iColumn].fmt;
122 
123  // No item requested, so return the column name
124  if (pidl == NULL)
125  {
126  return SHSetStrRet(&psd->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
127  }
128 
129  // Validate that this pidl is the last one
130  PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
131  if (curpidl->mkid.cb != 0)
132  {
133  ERR("ERROR, unhandled PIDL!\n");
134  return E_FAIL;
135  }
136 
137  switch (iColumn)
138  {
139  case 0: /* Name, ReactOS specific? */
140  return GetDisplayNameOf(pidl, 0, &psd->str);
141  default:
142  break;
143  }
144 
146  return E_NOTIMPL;
147 }
148 
150 {
151  //ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
152  return E_NOTIMPL;
153 }
154 
155 // *** IShellFolder2 methods ***
156 STDMETHODIMP CFontExt::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
157 {
158  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
159  return E_NOTIMPL;
160 }
161 
162 STDMETHODIMP CFontExt::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
163 {
164  return _CEnumFonts_CreateInstance(this, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
165 }
166 
168 {
169  ERR("%s(riid=%S) UNIMPLEMENTED\n", __FUNCTION__, g2s(riid));
170  return E_NOTIMPL;
171 }
172 
174 {
175  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
176  return E_NOTIMPL;
177 }
178 
180 {
181  const FontPidlEntry* fontEntry1 = _FontFromIL(pidl1);
182  const FontPidlEntry* fontEntry2 = _FontFromIL(pidl2);
183 
184  if (!fontEntry1 || !fontEntry2)
185  return E_INVALIDARG;
186 
187  int result = (int)fontEntry1->Index - (int)fontEntry2->Index;
188 
190 }
191 
193 {
195 
196  *ppvOut = NULL;
197 
198  if (IsEqualIID(riid, IID_IDropTarget))
199  {
200  ERR("IDropTarget not implemented\n");
201  *ppvOut = static_cast<IDropTarget *>(this);
202  AddRef();
203  hr = S_OK;
204  }
205  else if (IsEqualIID(riid, IID_IContextMenu))
206  {
207  ERR("IContextMenu not implemented\n");
208  hr = E_NOTIMPL;
209  }
210  else if (IsEqualIID(riid, IID_IShellView))
211  {
212  // Just create a default shell folder view, and register ourself as folder
213  SFV_CREATE sfv = { sizeof(SFV_CREATE) };
214  sfv.pshf = this;
215  hr = SHCreateShellFolderView(&sfv, (IShellView**)ppvOut);
216  }
217 
218  return hr;
219 }
220 
222 {
223  if (!rgfInOut || !cidl || !apidl)
224  return E_INVALIDARG;
225 
226  DWORD rgf = 0;
227  while (cidl > 0 && *apidl)
228  {
229  const FontPidlEntry* fontEntry = _FontFromIL(*apidl);
230  if (fontEntry)
231  {
232  // We don't support delete yet
233  rgf |= (/*SFGAO_CANDELETE |*/ SFGAO_HASPROPSHEET | SFGAO_CANCOPY | SFGAO_FILESYSTEM);
234  }
235  else
236  {
237  rgf = 0;
238  break;
239  }
240 
241  apidl++;
242  cidl--;
243  }
244 
245  *rgfInOut = rgf;
246  return S_OK;
247 }
248 
249 
251 {
252  if (riid == IID_IContextMenu ||
253  riid == IID_IContextMenu2 ||
254  riid == IID_IContextMenu3)
255  {
256  return _CFontMenu_CreateInstance(hwndOwner, cidl, apidl, this, riid, ppvOut);
257  }
258  else if (riid == IID_IExtractIconA || riid == IID_IExtractIconW)
259  {
260  if (cidl == 1)
261  {
262  const FontPidlEntry* fontEntry = _FontFromIL(*apidl);
263  if (fontEntry)
264  {
266  CStringW File = g_FontCache->Filename(fontEntry);
267  // Just create a default icon extractor based on the filename
268  // We might want to create a preview with the font to get really fancy one day.
270  }
271  }
272  else
273  {
274  ERR("IID_IExtractIcon with cidl != 1 UNIMPLEMENTED\n");
275  }
276  }
277  else if (riid == IID_IDataObject)
278  {
279  if (cidl >= 1)
280  {
281  return _CDataObject_CreateInstance(m_Folder, cidl, apidl, riid, ppvOut);
282  }
283  else
284  {
285  ERR("IID_IDataObject with cidl == 0 UNIMPLEMENTED\n");
286  }
287  }
288 
289  //ERR("%s(riid=%S) UNIMPLEMENTED\n", __FUNCTION__, g2s(riid));
290  return E_NOTIMPL;
291 }
292 
294 {
295  if (!pidl)
296  return E_NOTIMPL;
297 
298  // Validate that this pidl is the last one
299  PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
300  if (curpidl->mkid.cb != 0)
301  {
302  ERR("ERROR, unhandled PIDL!\n");
303  return E_FAIL;
304  }
305 
306  const FontPidlEntry* fontEntry = _FontFromIL(pidl);
307  if (!fontEntry)
308  return E_FAIL;
309 
310  return SHSetStrRet(strRet, fontEntry->Name);
311 }
312 
314 {
315  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
316  return E_NOTIMPL;
317 }
318 
319 // *** IPersistFolder2 methods ***
321 {
322  if (ppidl && m_Folder)
323  {
324  *ppidl = ILClone(m_Folder);
325  return S_OK;
326  }
327 
328  return E_POINTER;
329 }
330 
331 
332 // *** IPersistFolder methods ***
334 {
335  WCHAR PidlPath[MAX_PATH + 1] = {0}, Expected[MAX_PATH + 1];
336  if (!SHGetPathFromIDListW(pidl, PidlPath))
337  {
338  ERR("Unable to extract path from pidl\n");
339  return E_FAIL;
340  }
341 
343  if (!SUCCEEDED(hr))
344  {
345  ERR("Unable to get fonts path (0x%x)\n", hr);
346  return hr;
347  }
348 
349  if (_wcsicmp(PidlPath, Expected))
350  {
351  ERR("CFontExt View initializing on unexpected folder: '%S'\n", PidlPath);
352  return E_FAIL;
353  }
354 
355  m_Folder.Attach(ILClone(pidl));
356 
357  return S_OK;
358 }
359 
360 
361 // *** IPersist methods ***
363 {
364  *lpClassId = CLSID_CFontExt;
365  return S_OK;
366 }
367 
368 // *** IDropTarget methods ***
369 STDMETHODIMP CFontExt::DragEnter(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
370 {
371  *pdwEffect = DROPEFFECT_NONE;
372 
373  CComHeapPtr<CIDA> cida;
374  HRESULT hr = _GetCidlFromDataObject(pDataObj, &cida);
375  if (FAILED_UNEXPECTEDLY(hr))
376  return hr;
377 
378 #if 1 // Please implement DoGetFontTitle
379  return DRAGDROP_S_CANCEL;
380 #else
381  *pdwEffect = DROPEFFECT_COPY;
382  return S_OK;
383 #endif
384 }
385 
387 {
388  return S_OK;
389 }
390 
392 {
393  return S_OK;
394 }
395 
396 STDMETHODIMP CFontExt::Drop(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
397 {
398  *pdwEffect = DROPEFFECT_NONE;
399 
400  WCHAR szFontsDir[MAX_PATH];
401  HRESULT hr = SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, szFontsDir);
402  if (FAILED_UNEXPECTEDLY(hr))
403  return E_FAIL;
404 
405  CComHeapPtr<CIDA> cida;
406  hr = _GetCidlFromDataObject(pDataObj, &cida);
407  if (FAILED_UNEXPECTEDLY(hr))
408  return hr;
409 
410  PCUIDLIST_ABSOLUTE pidlParent = HIDA_GetPIDLFolder(cida);
411  if (!pidlParent)
412  {
413  ERR("pidlParent is NULL\n");
414  return E_FAIL;
415  }
416 
417  BOOL bOK = TRUE;
418  CAtlArray<CStringW> FontPaths;
419  for (UINT n = 0; n < cida->cidl; ++n)
420  {
421  PCUIDLIST_RELATIVE pidlRelative = HIDA_GetPIDLItem(cida, n);
422  if (!pidlRelative)
423  continue;
424 
425  PIDLIST_ABSOLUTE pidl = ILCombine(pidlParent, pidlRelative);
426  if (!pidl)
427  {
428  ERR("ILCombine failed\n");
429  bOK = FALSE;
430  break;
431  }
432 
435  ILFree(pidl);
436 
437  if (!ret)
438  {
439  ERR("SHGetPathFromIDListW failed\n");
440  bOK = FALSE;
441  break;
442  }
443 
445  {
446  ERR("PathIsDirectory\n");
447  bOK = FALSE;
448  break;
449  }
450 
451  LPCWSTR pchDotExt = PathFindExtensionW(szPath);
452  if (!IsFontDotExt(pchDotExt))
453  {
454  ERR("'%S' is not supported\n", pchDotExt);
455  bOK = FALSE;
456  break;
457  }
458 
459  FontPaths.Add(szPath);
460  }
461 
462  if (!bOK)
463  return E_FAIL;
464 
465  CRegKey keyFonts;
466  if (keyFonts.Open(FONT_HIVE, FONT_KEY, KEY_WRITE) != ERROR_SUCCESS)
467  {
468  ERR("keyFonts.Open failed\n");
469  return E_FAIL;
470  }
471 
472  for (size_t iItem = 0; iItem < FontPaths.GetCount(); ++iItem)
473  {
474  HRESULT hr = DoInstallFontFile(FontPaths[iItem], szFontsDir, keyFonts.m_hKey);
475  if (FAILED_UNEXPECTEDLY(hr))
476  {
477  bOK = FALSE;
478  break;
479  }
480  }
481 
482  // TODO: update g_FontCache
483 
485 
486  // TODO: Show message
487 
488  return bOK ? S_OK : E_FAIL;
489 }
490 
491 HRESULT CFontExt::DoInstallFontFile(LPCWSTR pszFontPath, LPCWSTR pszFontsDir, HKEY hkeyFonts)
492 {
493  WCHAR szDestFile[MAX_PATH];
494  LPCWSTR pszFileTitle = PathFindFileName(pszFontPath);
495 
496  WCHAR szFontName[512];
497  if (!DoGetFontTitle(pszFontPath, szFontName))
498  return E_FAIL;
499 
500  RemoveFontResourceW(pszFileTitle);
501 
502  StringCchCopyW(szDestFile, sizeof(szDestFile), pszFontsDir);
503  PathAppendW(szDestFile, pszFileTitle);
504  if (!CopyFileW(pszFontPath, szDestFile, FALSE))
505  {
506  ERR("CopyFileW('%S', '%S') failed\n", pszFontPath, szDestFile);
507  return E_FAIL;
508  }
509 
510  if (!AddFontResourceW(pszFileTitle))
511  {
512  ERR("AddFontResourceW('%S') failed\n", pszFileTitle);
513  DeleteFileW(szDestFile);
514  return E_FAIL;
515  }
516 
517  DWORD cbData = (wcslen(pszFileTitle) + 1) * sizeof(WCHAR);
518  LONG nError = RegSetValueExW(hkeyFonts, szFontName, 0, REG_SZ, (const BYTE *)szFontName, cbData);
519  if (nError)
520  {
521  ERR("RegSetValueExW failed with %ld\n", nError);
522  RemoveFontResourceW(pszFileTitle);
523  DeleteFileW(szDestFile);
524  return E_FAIL;
525  }
526 
527  return S_OK;
528 }
529 
531 {
532  // TODO:
533  return E_FAIL;
534 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
DWORD dwDefaultState
Definition: CFontExt.cpp:17
virtual STDMETHODIMP DragLeave()
Definition: CFontExt.cpp:391
virtual STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
Definition: CFontExt.cpp:115
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: precomp.h:46
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
interface IBindCtx * LPBC
Definition: objfwd.h:18
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define pt(x, y)
Definition: drawing.c:79
REFIID riid
Definition: precomp.h:44
virtual STDMETHODIMP GetClassID(CLSID *lpClassId)
Definition: CFontExt.cpp:362
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define REFCLSID
Definition: guiddef.h:117
#define _countof(array)
Definition: fontsub.cpp:30
virtual STDMETHODIMP Initialize(LPCITEMIDLIST pidl)
Definition: CFontExt.cpp:333
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
HRESULT _CEnumFonts_CreateInstance(CFontExt *zip, DWORD flags, REFIID riid, LPVOID *ppvOut)
Definition: CEnumFonts.cpp:87
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
_In_ LPCSTR lpName
Definition: winbase.h:2736
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
Definition: pidl.c:851
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLdouble n
Definition: glext.h:7729
#define IDS_COL_NAME
Definition: resource.h:6
WINE_DEFAULT_DEBUG_CHANNEL(fontext)
#define LVCFMT_LEFT
Definition: commctrl.h:2594
const FontPidlEntry * _FontFromIL(LPCITEMIDLIST pidl)
Definition: fontpidl.cpp:32
virtual STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CFontExt.cpp:369
const ITEMID_CHILD UNALIGNED * PCUITEMID_CHILD
Definition: shtypes.idl:70
#define RRF_RT_REG_SZ
Definition: driver.c:575
HRESULT _GetCidlFromDataObject(IDataObject *pDataObject, CIDA **ppcida)
Definition: CFontMenu.cpp:14
~CFontExt()
Definition: CFontExt.cpp:76
const GUID IID_IDataObject
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: CFontExt.cpp:34
static LPOLESTR
Definition: stg_prop.c:27
#define CSIDL_FONTS
Definition: shlobj.h:2022
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3469
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
STRRET str
Definition: shtypes.idl:108
virtual STDMETHODIMP CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PCUIDLIST_RELATIVE pidl2)
Definition: CFontExt.cpp:179
HKEY m_hKey
Definition: atlbase.h:1013
HRESULT DoInstallFontFile(LPCWSTR pszFontPath, LPCWSTR pszFontsDir, HKEY hkeyFonts)
Definition: CFontExt.cpp:491
#define DRAGDROP_S_CANCEL
Definition: winerror.h:2647
DWORD dwAttributes
Definition: vdmdbg.h:34
virtual STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
Definition: CFontExt.cpp:88
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
int WINAPI AddFontResourceW(_In_ LPCWSTR pszFilename)
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
size_t GetCount() const
Definition: atlcoll.h:358
HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *ppszProgID)
Definition: compobj.c:2530
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
virtual STDMETHODIMP BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFontExt.cpp:167
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
BOOL IsFontDotExt(LPCWSTR pchDotExt)
Definition: precomp.h:51
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
virtual STDMETHODIMP GetDisplayNameOf(PCUITEMID_CHILD pidl, DWORD dwFlags, LPSTRRET strRet)
Definition: CFontExt.cpp:293
#define STDMETHODIMP
Definition: basetyps.h:43
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
#define FONT_KEY
Definition: precomp.h:31
unsigned int idx
Definition: utils.c:41
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: precomp.h:41
static FolderViewColumns g_ColumnDefs[]
Definition: CFontExt.cpp:22
virtual STDMETHODIMP GetDefaultColumnState(UINT iColumn, SHCOLSTATEF *pcsFlags)
Definition: CFontExt.cpp:100
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT _CFontMenu_CreateInstance(HWND hwnd, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, IShellFolder *psf, REFIID riid, LPVOID *ppvOut)
Definition: CFontMenu.cpp:148
virtual STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
Definition: CFontExt.cpp:156
struct _SFV_CREATE SFV_CREATE
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
WCHAR * g2s(REFCLSID iid)
Definition: CFontExt.cpp:45
virtual STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFontExt.cpp:173
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
CFontExt()
Definition: CFontExt.cpp:71
size_t Add(INARGTYPE element)
Definition: atlcoll.h:280
virtual STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
Definition: CFontExt.cpp:250
#define FONT_HIVE
Definition: precomp.h:30
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
CStringW Filename(const FontPidlEntry *fontEntry)
Definition: CFontCache.cpp:90
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1070
UINT cidl
Definition: shlobj.h:491
#define PathFindFileName
Definition: shlwapi.h:911
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI RemoveFontResourceW(_In_ LPCWSTR)
virtual STDMETHODIMP Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CFontExt.cpp:396
ULONG AddRef()
#define WM_FONTCHANGE
Definition: winuser.h:1615
EXTERN_C HRESULT WINAPI SHCreateFileExtractIconW(LPCWSTR pszPath, DWORD dwFileAttributes, REFIID riid, void **ppv)
int ret
virtual STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CFontExt.cpp:386
DWORD SHCOLSTATEF
Definition: shtypes.idl:142
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
virtual STDMETHODIMP GetDefaultSearchGUID(GUID *lpguid)
Definition: CFontExt.cpp:82
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
virtual STDMETHODIMP GetCurFolder(LPITEMIDLIST *ppidl)
Definition: CFontExt.cpp:320
unsigned char BYTE
Definition: mem.h:68
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
WCHAR Name[1]
Definition: fontpidl.hpp:17
CComHeapPtr< ITEMIDLIST > m_Folder
Definition: CFontExt.hpp:18
#define ERR(fmt,...)
Definition: debug.h:109
IShellFolder * pshf
Definition: shlobj.h:1274
virtual STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CFontExt.cpp:162
#define S_OK
Definition: intsafe.h:59
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
#define InterlockedIncrement
Definition: armddk.h:53
LPCWSTR szPath
Definition: env.c:35
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
virtual STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
Definition: CFontExt.cpp:192
virtual STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
Definition: CFontExt.cpp:109
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
virtual STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
Definition: CFontExt.cpp:221
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2086
DWORD dwFileAttributes
unsigned int ULONG
Definition: retypes.h:1
const GUID CLSID_CFontExt
Definition: fontext.cpp:12
#define UNIMPLEMENTED
Definition: debug.h:114
virtual STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
Definition: CFontExt.cpp:149
HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, LPVOID *ppvOut)
Definition: CDataObject.cpp:38
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
Definition: File.h:15
virtual STDMETHODIMP SetNameOf(HWND hwndOwner, PCUITEMID_CHILD pidl, LPCOLESTR lpName, DWORD dwFlags, PITEMID_CHILD *pPidlOut)
Definition: CFontExt.cpp:313
virtual STDMETHODIMP GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG *pDisplay)
Definition: CFontExt.cpp:94
BOOLEAN Expected
#define E_POINTER
Definition: winerror.h:2365
#define EXTERN_C
Definition: basetyps.h:12
#define __FUNCTION__
Definition: types.h:112
GLuint64EXT * result
Definition: glext.h:11304
#define HWND_BROADCAST
Definition: winuser.h:1190
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
HRESULT DoGetFontTitle(LPCWSTR pszFontPath, LPCWSTR pszFontName)
Definition: CFontExt.cpp:530
LPARAM lParam
Definition: combotst.c:139
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define SUCCEEDED(hr)
Definition: intsafe.h:57
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define REG_SZ
Definition: layer.c:22