ReactOS  0.4.15-dev-439-g292f67a
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,2020 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 {
29 };
30 
31 
32 
33 // Should fix our headers..
35 
36 
37 // Helper functions to translate a guid to a readable name
38 bool GetInterfaceName(const WCHAR* InterfaceString, WCHAR* buf, size_t size)
39 {
40  WCHAR LocalBuf[100];
41  DWORD dwType = 0, dwDataSize = size * sizeof(WCHAR);
42 
43  if (!SUCCEEDED(StringCchPrintfW(LocalBuf, _countof(LocalBuf), L"Interface\\%s", InterfaceString)))
44  return false;
45 
46  return RegGetValueW(HKEY_CLASSES_ROOT, LocalBuf, NULL, RRF_RT_REG_SZ, &dwType, buf, &dwDataSize) == ERROR_SUCCESS;
47 }
48 
50 {
51  static WCHAR buf[2][300];
52  static int idx = 0;
53 
54  idx ^= 1;
55 
56  LPOLESTR tmp;
57  HRESULT hr = ProgIDFromCLSID(iid, &tmp);
58  if (SUCCEEDED(hr))
59  {
60  wcscpy(buf[idx], tmp);
61  CoTaskMemFree(tmp);
62  return buf[idx];
63  }
66  {
67  return buf[idx];
68  }
70 
71  return buf[idx];
72 }
73 
74 
76 {
78 }
79 
81 {
83 }
84 
85 // *** IShellFolder2 methods ***
87 {
88  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
89  return E_NOTIMPL;
90 }
91 
93 {
94  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
95  return E_NOTIMPL;
96 }
97 
99 {
100  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
101  return E_NOTIMPL;
102 }
103 
105 {
106  if (!pcsFlags || iColumn >= _countof(g_ColumnDefs))
107  return E_INVALIDARG;
108 
109  *pcsFlags = g_ColumnDefs[iColumn].dwDefaultState;
110  return S_OK;
111 }
112 
114 {
115  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
116  return E_NOTIMPL;
117 }
118 
120 {
121  if (iColumn >= _countof(g_ColumnDefs))
122  return E_FAIL;
123 
124  psd->cxChar = g_ColumnDefs[iColumn].cxChar;
125  psd->fmt = g_ColumnDefs[iColumn].fmt;
126 
127  // No item requested, so return the column name
128  if (pidl == NULL)
129  {
130  return SHSetStrRet(&psd->str, _AtlBaseModule.GetResourceInstance(), g_ColumnDefs[iColumn].iResource);
131  }
132 
133  // Validate that this pidl is the last one
134  PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
135  if (curpidl->mkid.cb != 0)
136  {
137  ERR("ERROR, unhandled PIDL!\n");
138  return E_FAIL;
139  }
140 
141  // Name, ReactOS specific?
142  if (iColumn == 0)
143  return GetDisplayNameOf(pidl, 0, &psd->str);
144 
145  const FontPidlEntry* fontEntry = _FontFromIL(pidl);
146  if (!fontEntry)
147  {
148  ERR("ERROR, not a font PIDL!\n");
149  return E_FAIL;
150  }
151 
152  // If we got here, we are in details view!
153  // Let's see if we got info about this file that we can re-use
154  if (m_LastDetailsFontName != fontEntry->Name)
155  {
156  CStringW File = g_FontCache->Filename(fontEntry, true);
159  {
161  ERR("Unable to query info about %S\n", File.GetString());
163  }
164  FindClose(hFile);
165  m_LastDetailsFontName = fontEntry->Name;
166  }
167 
168  // Most code borrowed from CFSFolder::GetDetailsOf
169  FILETIME lft;
171  int ret;
173  CStringA AttrLetters;
174  switch (iColumn)
175  {
176  case 1: // Filename
177  return SHSetStrRet(&psd->str, m_LastDetailsFileData.cFileName);
178  case 2: // Size
179  psd->str.uType = STRRET_CSTR;
180  FileSize.HighPart = m_LastDetailsFileData.nFileSizeHigh;
181  FileSize.LowPart = m_LastDetailsFileData.nFileSizeLow;
183  return S_OK;
184  case 3: // Modified
185  FileTimeToLocalFileTime(&m_LastDetailsFileData.ftLastWriteTime, &lft);
186  FileTimeToSystemTime (&lft, &time);
187  psd->str.uType = STRRET_CSTR;
189  if (ret < 1)
190  {
191  ERR("GetDateFormatA failed\n");
192  return E_FAIL;
193  }
194  psd->str.cStr[ret-1] = ' ';
196  return S_OK;
197  case 4: // Attributes
198  AttrLetters.LoadString(IDS_COL_ATTR_LETTERS);
199  if (AttrLetters.GetLength() != 5)
200  {
201  ERR("IDS_COL_ATTR_LETTERS does not contain 5 letters!\n");
202  return E_FAIL;
203  }
204  psd->str.uType = STRRET_CSTR;
205  ret = 0;
206  if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_READONLY)
207  psd->str.cStr[ret++] = AttrLetters[0];
208  if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
209  psd->str.cStr[ret++] = AttrLetters[1];
210  if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)
211  psd->str.cStr[ret++] = AttrLetters[2];
212  if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
213  psd->str.cStr[ret++] = AttrLetters[3];
214  if (m_LastDetailsFileData.dwFileAttributes & FILE_ATTRIBUTE_COMPRESSED)
215  psd->str.cStr[ret++] = AttrLetters[4];
216  psd->str.cStr[ret] = '\0';
217  return S_OK;
218  default:
219  break;
220  }
221 
223  return E_NOTIMPL;
224 }
225 
227 {
228  //ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
229  return E_NOTIMPL;
230 }
231 
232 // *** IShellFolder2 methods ***
233 STDMETHODIMP CFontExt::ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
234 {
235  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
236  return E_NOTIMPL;
237 }
238 
239 STDMETHODIMP CFontExt::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
240 {
241  return _CEnumFonts_CreateInstance(this, dwFlags, IID_PPV_ARG(IEnumIDList, ppEnumIDList));
242 }
243 
245 {
246  ERR("%s(riid=%S) UNIMPLEMENTED\n", __FUNCTION__, g2s(riid));
247  return E_NOTIMPL;
248 }
249 
251 {
252  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
253  return E_NOTIMPL;
254 }
255 
257 {
258  const FontPidlEntry* fontEntry1 = _FontFromIL(pidl1);
259  const FontPidlEntry* fontEntry2 = _FontFromIL(pidl2);
260 
261  if (!fontEntry1 || !fontEntry2)
262  return E_INVALIDARG;
263 
264  int result = (int)fontEntry1->Index - (int)fontEntry2->Index;
265 
267 }
268 
270 {
272 
273  *ppvOut = NULL;
274 
275  if (IsEqualIID(riid, IID_IDropTarget))
276  {
277  ERR("IDropTarget not implemented\n");
278  *ppvOut = static_cast<IDropTarget *>(this);
279  AddRef();
280  hr = S_OK;
281  }
282  else if (IsEqualIID(riid, IID_IContextMenu))
283  {
284  ERR("IContextMenu not implemented\n");
285  hr = E_NOTIMPL;
286  }
287  else if (IsEqualIID(riid, IID_IShellView))
288  {
289  // Just create a default shell folder view, and register ourself as folder
290  SFV_CREATE sfv = { sizeof(SFV_CREATE) };
291  sfv.pshf = this;
292  hr = SHCreateShellFolderView(&sfv, (IShellView**)ppvOut);
293  }
294 
295  return hr;
296 }
297 
299 {
300  if (!rgfInOut || !cidl || !apidl)
301  return E_INVALIDARG;
302 
303  DWORD rgf = 0;
304  while (cidl > 0 && *apidl)
305  {
306  const FontPidlEntry* fontEntry = _FontFromIL(*apidl);
307  if (fontEntry)
308  {
309  // We don't support delete yet
310  rgf |= (/*SFGAO_CANDELETE |*/ SFGAO_HASPROPSHEET | SFGAO_CANCOPY | SFGAO_FILESYSTEM);
311  }
312  else
313  {
314  rgf = 0;
315  break;
316  }
317 
318  apidl++;
319  cidl--;
320  }
321 
322  *rgfInOut = rgf;
323  return S_OK;
324 }
325 
326 
328 {
329  if (riid == IID_IContextMenu ||
330  riid == IID_IContextMenu2 ||
331  riid == IID_IContextMenu3)
332  {
333  return _CFontMenu_CreateInstance(hwndOwner, cidl, apidl, this, riid, ppvOut);
334  }
335  else if (riid == IID_IExtractIconA || riid == IID_IExtractIconW)
336  {
337  if (cidl == 1)
338  {
339  const FontPidlEntry* fontEntry = _FontFromIL(*apidl);
340  if (fontEntry)
341  {
343  CStringW File = g_FontCache->Filename(fontEntry);
344  // Just create a default icon extractor based on the filename
345  // We might want to create a preview with the font to get really fancy one day.
347  }
348  }
349  else
350  {
351  ERR("IID_IExtractIcon with cidl != 1 UNIMPLEMENTED\n");
352  }
353  }
354  else if (riid == IID_IDataObject)
355  {
356  if (cidl >= 1)
357  {
358  return _CDataObject_CreateInstance(m_Folder, cidl, apidl, riid, ppvOut);
359  }
360  else
361  {
362  ERR("IID_IDataObject with cidl == 0 UNIMPLEMENTED\n");
363  }
364  }
365 
366  //ERR("%s(riid=%S) UNIMPLEMENTED\n", __FUNCTION__, g2s(riid));
367  return E_NOTIMPL;
368 }
369 
371 {
372  if (!pidl)
373  return E_NOTIMPL;
374 
375  // Validate that this pidl is the last one
376  PCUIDLIST_RELATIVE curpidl = ILGetNext(pidl);
377  if (curpidl->mkid.cb != 0)
378  {
379  ERR("ERROR, unhandled PIDL!\n");
380  return E_FAIL;
381  }
382 
383  const FontPidlEntry* fontEntry = _FontFromIL(pidl);
384  if (!fontEntry)
385  return E_FAIL;
386 
387  return SHSetStrRet(strRet, fontEntry->Name);
388 }
389 
391 {
392  ERR("%s() UNIMPLEMENTED\n", __FUNCTION__);
393  return E_NOTIMPL;
394 }
395 
396 // *** IPersistFolder2 methods ***
398 {
399  if (ppidl && m_Folder)
400  {
401  *ppidl = ILClone(m_Folder);
402  return S_OK;
403  }
404 
405  return E_POINTER;
406 }
407 
408 
409 // *** IPersistFolder methods ***
411 {
412  WCHAR PidlPath[MAX_PATH + 1] = {0}, FontsDir[MAX_PATH + 1];
413  if (!SHGetPathFromIDListW(pidl, PidlPath))
414  {
415  ERR("Unable to extract path from pidl\n");
416  return E_FAIL;
417  }
418 
419  HRESULT hr = SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, FontsDir);
420  if (FAILED_UNEXPECTEDLY(hr))
421  {
422  ERR("Unable to get fonts path (0x%x)\n", hr);
423  return hr;
424  }
425 
426  if (_wcsicmp(PidlPath, FontsDir))
427  {
428  ERR("CFontExt View initializing on unexpected folder: '%S'\n", PidlPath);
429  return E_FAIL;
430  }
431 
432  m_Folder.Attach(ILClone(pidl));
433  StringCchCatW(FontsDir, _countof(FontsDir), L"\\");
434  g_FontCache->SetFontDir(FontsDir);
435 
436  return S_OK;
437 }
438 
439 
440 // *** IPersist methods ***
442 {
443  *lpClassId = CLSID_CFontExt;
444  return S_OK;
445 }
446 
447 // *** IDropTarget methods ***
448 STDMETHODIMP CFontExt::DragEnter(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
449 {
450  *pdwEffect = DROPEFFECT_NONE;
451 
452  CComHeapPtr<CIDA> cida;
453  HRESULT hr = _GetCidlFromDataObject(pDataObj, &cida);
454  if (FAILED_UNEXPECTEDLY(hr))
455  return hr;
456 
457 #if 1 // Please implement DoGetFontTitle
458  return DRAGDROP_S_CANCEL;
459 #else
460  *pdwEffect = DROPEFFECT_COPY;
461  return S_OK;
462 #endif
463 }
464 
466 {
467  return S_OK;
468 }
469 
471 {
472  return S_OK;
473 }
474 
475 STDMETHODIMP CFontExt::Drop(IDataObject* pDataObj, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect)
476 {
477  *pdwEffect = DROPEFFECT_NONE;
478 
479  CComHeapPtr<CIDA> cida;
480  HRESULT hr = _GetCidlFromDataObject(pDataObj, &cida);
481  if (FAILED_UNEXPECTEDLY(hr))
482  return hr;
483 
484  PCUIDLIST_ABSOLUTE pidlParent = HIDA_GetPIDLFolder(cida);
485  if (!pidlParent)
486  {
487  ERR("pidlParent is NULL\n");
488  return E_FAIL;
489  }
490 
491  BOOL bOK = TRUE;
492  CAtlArray<CStringW> FontPaths;
493  for (UINT n = 0; n < cida->cidl; ++n)
494  {
495  PCUIDLIST_RELATIVE pidlRelative = HIDA_GetPIDLItem(cida, n);
496  if (!pidlRelative)
497  continue;
498 
499  PIDLIST_ABSOLUTE pidl = ILCombine(pidlParent, pidlRelative);
500  if (!pidl)
501  {
502  ERR("ILCombine failed\n");
503  bOK = FALSE;
504  break;
505  }
506 
509  ILFree(pidl);
510 
511  if (!ret)
512  {
513  ERR("SHGetPathFromIDListW failed\n");
514  bOK = FALSE;
515  break;
516  }
517 
519  {
520  ERR("PathIsDirectory\n");
521  bOK = FALSE;
522  break;
523  }
524 
525  LPCWSTR pchDotExt = PathFindExtensionW(szPath);
526  if (!IsFontDotExt(pchDotExt))
527  {
528  ERR("'%S' is not supported\n", pchDotExt);
529  bOK = FALSE;
530  break;
531  }
532 
533  FontPaths.Add(szPath);
534  }
535 
536  if (!bOK)
537  return E_FAIL;
538 
539  CRegKey keyFonts;
540  if (keyFonts.Open(FONT_HIVE, FONT_KEY, KEY_WRITE) != ERROR_SUCCESS)
541  {
542  ERR("keyFonts.Open failed\n");
543  return E_FAIL;
544  }
545 
546  for (size_t iItem = 0; iItem < FontPaths.GetCount(); ++iItem)
547  {
548  HRESULT hr = DoInstallFontFile(FontPaths[iItem], g_FontCache->FontPath(), keyFonts.m_hKey);
549  if (FAILED_UNEXPECTEDLY(hr))
550  {
551  bOK = FALSE;
552  break;
553  }
554  }
555 
556  // TODO: update g_FontCache
557 
559 
560  // TODO: Show message
561 
562  return bOK ? S_OK : E_FAIL;
563 }
564 
565 HRESULT CFontExt::DoInstallFontFile(LPCWSTR pszFontPath, LPCWSTR pszFontsDir, HKEY hkeyFonts)
566 {
567  WCHAR szDestFile[MAX_PATH];
568  LPCWSTR pszFileTitle = PathFindFileName(pszFontPath);
569 
570  WCHAR szFontName[512];
571  if (!DoGetFontTitle(pszFontPath, szFontName))
572  return E_FAIL;
573 
574  RemoveFontResourceW(pszFileTitle);
575 
576  StringCchCopyW(szDestFile, sizeof(szDestFile), pszFontsDir);
577  PathAppendW(szDestFile, pszFileTitle);
578  if (!CopyFileW(pszFontPath, szDestFile, FALSE))
579  {
580  ERR("CopyFileW('%S', '%S') failed\n", pszFontPath, szDestFile);
581  return E_FAIL;
582  }
583 
584  if (!AddFontResourceW(pszFileTitle))
585  {
586  ERR("AddFontResourceW('%S') failed\n", pszFileTitle);
587  DeleteFileW(szDestFile);
588  return E_FAIL;
589  }
590 
591  DWORD cbData = (wcslen(pszFileTitle) + 1) * sizeof(WCHAR);
592  LONG nError = RegSetValueExW(hkeyFonts, szFontName, 0, REG_SZ, (const BYTE *)szFontName, cbData);
593  if (nError)
594  {
595  ERR("RegSetValueExW failed with %ld\n", nError);
596  RemoveFontResourceW(pszFileTitle);
597  DeleteFileW(szDestFile);
598  return E_FAIL;
599  }
600 
601  return S_OK;
602 }
603 
605 {
606  // TODO:
607  return E_FAIL;
608 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
int GetLength() const
Definition: atlsimpstr.h:356
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
DWORD dwDefaultState
Definition: CFontExt.cpp:17
virtual STDMETHODIMP DragLeave()
Definition: CFontExt.cpp:470
virtual STDMETHODIMP GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELLDETAILS *psd)
Definition: CFontExt.cpp:119
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#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
INT WINAPI GetDateFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpDateStr, INT cchOut)
Definition: lcformat.c:922
#define pt(x, y)
Definition: drawing.c:79
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
REFIID riid
Definition: precomp.h:44
virtual STDMETHODIMP GetClassID(CLSID *lpClassId)
Definition: CFontExt.cpp:441
LONG g_ModuleRefCnt
Definition: ACPPage.cpp:13
#define REFCLSID
Definition: guiddef.h:117
#define LOCALE_USER_DEFAULT
#define DATE_SHORTDATE
Definition: winnls.h:193
virtual STDMETHODIMP Initialize(LPCITEMIDLIST pidl)
Definition: CFontExt.cpp:410
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
#define LVCFMT_RIGHT
Definition: commctrl.h:2595
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:1288
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:543
_In_ LPCSTR lpName
Definition: winbase.h:2752
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
CStringW m_LastDetailsFontName
Definition: CFontExt.hpp:19
WINE_DEFAULT_DEBUG_CHANNEL(fontext)
#define LVCFMT_LEFT
Definition: commctrl.h:2594
#define INVALID_HANDLE_VALUE
Definition: compat.h:400
const FontPidlEntry * _FontFromIL(LPCITEMIDLIST pidl)
Definition: fontpidl.cpp:32
virtual STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect)
Definition: CFontExt.cpp:448
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:80
LPSTR WINAPI StrFormatKBSizeA(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax)
Definition: string.c:1727
const GUID IID_IDataObject
#define MAKE_COMPARE_HRESULT(x)
Definition: shellutils.h:535
__u16 time
Definition: mkdosfs.c:366
bool GetInterfaceName(const WCHAR *InterfaceString, WCHAR *buf, size_t size)
Definition: CFontExt.cpp:38
static LPOLESTR
Definition: stg_prop.c:27
#define CSIDL_FONTS
Definition: shlobj.h:2031
BOOL WINAPI FileTimeToLocalFileTime(IN CONST FILETIME *lpFileTime, OUT LPFILETIME lpLocalFileTime)
Definition: time.c:221
HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv, IShellView **ppsv)
Definition: CDefView.cpp:3594
#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:256
HKEY m_hKey
Definition: atlbase.h:1013
HRESULT DoInstallFontFile(LPCWSTR pszFontPath, LPCWSTR pszFontsDir, HKEY hkeyFonts)
Definition: CFontExt.cpp:565
#define DRAGDROP_S_CANCEL
Definition: winerror.h:2647
DWORD dwAttributes
Definition: vdmdbg.h:34
virtual STDMETHODIMP EnumSearches(IEnumExtraSearch **ppenum)
Definition: CFontExt.cpp:92
const DWORD DROPEFFECT_COPY
Definition: oleidl.idl:930
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
int WINAPI AddFontResourceW(_In_ LPCWSTR pszFilename)
INT WINAPI GetTimeFormatA(LCID lcid, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCSTR lpFormat, LPSTR lpTimeStr, INT cchOut)
Definition: lcformat.c:1030
const DWORD DROPEFFECT_NONE
Definition: oleidl.idl:929
char cStr[MAX_PATH]
Definition: shtypes.idl:98
size_t GetCount() const
Definition: atlcoll.h:373
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:244
_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:41
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:370
#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 IDS_COL_MODIFIED
Definition: resource.h:9
WIN32_FIND_DATAW m_LastDetailsFileData
Definition: CFontExt.hpp:20
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static FolderViewColumns g_ColumnDefs[]
Definition: CFontExt.cpp:22
virtual STDMETHODIMP GetDefaultColumnState(UINT iColumn, SHCOLSTATEF *pcsFlags)
Definition: CFontExt.cpp:104
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:137
#define IDS_COL_SIZE
Definition: resource.h:8
virtual STDMETHODIMP ParseDisplayName(HWND hwndOwner, LPBC pbc, LPOLESTR lpszDisplayName, DWORD *pchEaten, PIDLIST_RELATIVE *ppidl, DWORD *pdwAttributes)
Definition: CFontExt.cpp:233
struct _SFV_CREATE SFV_CREATE
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
void SetFontDir(const LPCWSTR Path)
Definition: CFontCache.cpp:71
WCHAR * g2s(REFCLSID iid)
Definition: CFontExt.cpp:49
virtual STDMETHODIMP BindToStorage(PCUIDLIST_RELATIVE pidl, LPBC pbcReserved, REFIID riid, LPVOID *ppvOut)
Definition: CFontExt.cpp:250
#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:75
size_t Add(INARGTYPE element)
Definition: atlcoll.h:295
virtual STDMETHODIMP GetUIObjectOf(HWND hwndOwner, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, UINT *prgfInOut, LPVOID *ppvOut)
Definition: CFontExt.cpp:327
#define FONT_HIVE
Definition: precomp.h:30
BOOL WINAPI FileTimeToSystemTime(IN CONST FILETIME *lpFileTime, OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:188
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
#define _countof(array)
Definition: sndvol32.h:68
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:26
#define IDS_COL_ATTR
Definition: resource.h:10
#define WINAPI
Definition: msvc.h:6
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE)
Definition: atlbase.h:1070
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
UINT cidl
Definition: shlobj.h:499
#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:475
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
ULONG AddRef()
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706
#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:465
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:86
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:397
ULONG LowPart
Definition: typedefs.h:105
_Must_inspect_result_ _Out_ PLARGE_INTEGER FileSize
Definition: fsrtlfuncs.h:108
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
WCHAR Name[1]
Definition: fontpidl.hpp:17
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:538
#define IDS_COL_FILENAME
Definition: resource.h:7
const CStringW & FontPath() const
Definition: CFontCache.hpp:40
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned char BYTE
Definition: xxhash.c:193
CComHeapPtr< ITEMIDLIST > m_Folder
Definition: CFontExt.hpp:18
#define ERR(fmt,...)
Definition: debug.h:110
IShellFolder * pshf
Definition: shlobj.h:1283
virtual STDMETHODIMP EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList)
Definition: CFontExt.cpp:239
#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
CStringW Filename(const FontPidlEntry *fontEntry, bool alwaysFullPath=false)
Definition: CFontCache.cpp:96
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:228
#define IDS_COL_ATTR_LETTERS
Definition: resource.h:11
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
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
unsigned int UINT
Definition: ndis.h:50
virtual STDMETHODIMP CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)
Definition: CFontExt.cpp:269
virtual STDMETHODIMP GetDetailsEx(PCUITEMID_CHILD pidl, const SHCOLUMNID *pscid, VARIANT *pv)
Definition: CFontExt.cpp:113
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
virtual STDMETHODIMP GetAttributesOf(UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD *rgfInOut)
Definition: CFontExt.cpp:298
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208
DWORD dwFileAttributes
unsigned int ULONG
Definition: retypes.h:1
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:526
const GUID CLSID_CFontExt
Definition: fontext.cpp:12
#define UNIMPLEMENTED
Definition: debug.h:115
virtual STDMETHODIMP MapColumnToSCID(UINT iColumn, SHCOLUMNID *pscid)
Definition: CFontExt.cpp:226
HRESULT _CDataObject_CreateInstance(PCIDLIST_ABSOLUTE folder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, REFIID riid, LPVOID *ppvOut)
Definition: CDataObject.cpp:38
#define TIME_NOSECONDS
Definition: winnls.h:275
#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:390
virtual STDMETHODIMP GetDefaultColumn(DWORD dwReserved, ULONG *pSort, ULONG *pDisplay)
Definition: CFontExt.cpp:98
UINT uType
Definition: shtypes.idl:93
#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:604
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
LONGLONG QuadPart
Definition: typedefs.h:113
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define REG_SZ
Definition: layer.c:22
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502