ReactOS 0.4.16-dev-2206-gc56950d
fontext.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: Shell extension entry point
5 * COPYRIGHT: Copyright 2019,2020 Mark Jansen <mark.jansen@reactos.org>
6 */
7
8#include "precomp.h"
9#include "undocgdi.h" // for GetFontResourceInfoW
10
12
13const GUID CLSID_CFontExt = { 0xbd84b380, 0x8ca2, 0x1069, { 0xab, 0x1d, 0x08, 0x00, 0x09, 0x48, 0xf5, 0x34 } };
14
16{
17public:
18 void Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE h, const GUID *plibid)
19 {
20 g_FontCache = new CFontCache();
21 CComModule::Init(p, h, plibid);
22 }
23
24 void Term()
25 {
26 delete g_FontCache;
29 }
30};
31
32BEGIN_OBJECT_MAP(ObjectMap)
35
38
40{
42 return S_FALSE;
43 return gModule.DllCanUnloadNow();
44}
45
47{
48 return gModule.DllGetClassObject(rclsid, riid, ppv);
49}
50
52{
53 WCHAR Path[MAX_PATH] = { 0 };
54 static const char DesktopIniContents[] = "[.ShellClassInfo]\r\n"
55 "CLSID={BD84B380-8CA2-1069-AB1D-08000948F534}\r\n"
56 "IconResource=%SystemRoot%\\system32\\shell32.dll,-39\r\n"; // IDI_SHELL_FONTS_FOLDER
58 HRESULT hr;
59
62 return hr;
63
66 return hr;
67
68 // Make this a system folder:
69 // Ideally this should not be done here, but when installing
70 // Otherwise, livecd won't have this set properly
73 {
76 }
77 else
78 {
79 ERR("Unable to get attributes for fonts folder (%d)\n", GetLastError());
80 }
81
82 if (!PathAppendW(Path, L"desktop.ini"))
83 return E_FAIL;
84
88
89 DWORD BytesWritten, BytesToWrite = strlen(DesktopIniContents);
90 if (WriteFile(hFile, DesktopIniContents, (DWORD)BytesToWrite, &BytesWritten, NULL))
91 hr = (BytesToWrite == BytesWritten) ? S_OK : E_FAIL;
92 else
95 return hr;
96}
97
99{
101}
102
104{
105 for (UINT i = 0; i < cKeys; ++i)
107}
108
110{
111 if (*cKeys >= 16)
112 return ERROR_MORE_DATA;
113
114 HKEY hkey;
116 if (result == ERROR_SUCCESS)
117 {
118 array[*cKeys] = hkey;
119 *cKeys += 1;
120 }
121 return result;
122}
123
127{
128 PCUIDLIST_ABSOLUTE pidlParent = pData->pidlParent;
129 UINT cidl = pData->cSteps;
130 PCUITEMID_CHILD_ARRAY apidl = pData->apidl;
131
132 CAtlArray<CStringW> FontPaths;
133 for (UINT n = 0; n < cidl; ++n)
134 {
136 pidl.Attach(ILCombine(pidlParent, apidl[n]));
137 if (!pidl)
138 {
139 ERR("Out of memory\n");
140 return E_OUTOFMEMORY;
141 }
142
146 {
147 ERR("Not font file: %s\n", wine_dbgstr_w(szPath));
148 return E_FAIL;
149 }
150
151 FontPaths.Add(szPath);
152 }
153
154 CRegKey keyFonts;
155 if (keyFonts.Open(FONT_HIVE, FONT_KEY, KEY_WRITE) != ERROR_SUCCESS)
156 {
157 ERR("CRegKey::Open failed\n");
158 return E_FAIL;
159 }
160
161 for (SIZE_T iItem = 0; iItem < FontPaths.GetCount(); ++iItem)
162 {
163 if (pData->bCanceled)
164 {
165 WARN("Canceled\n");
166 return E_ABORT;
167 }
168
169 HRESULT hr = DoInstallFontFile(FontPaths[iItem], g_FontCache->FontPath(), keyFonts);
171 return hr;
172
173 if (pData->hwnd)
175 }
176
177 return S_OK;
178}
179
182 _In_ PCWSTR pszFontPath,
183 _In_ PCWSTR pszFontsDir,
184 _In_ HKEY hkeyFonts)
185{
186 ATLASSERT(pszFontPath);
187 ATLASSERT(pszFontsDir);
188 ATLASSERT(hkeyFonts);
189
190 // Add this font to the font list, so we can query the name
191 if (!AddFontResourceW(pszFontPath))
192 {
193 ERR("AddFontResourceW('%S') failed\n", pszFontPath);
194 return E_FAIL;
195 }
196
197 // Get the font name
198 CStringW strFontName;
199 HRESULT hr = DoGetFontTitle(pszFontPath, strFontName);
201 return hr;
202
203 // Remove it now
204 // WINDOWS BUG: Removing once is not enough
205 for (INT iTry = 0; iTry < 3; ++iTry)
206 {
207 if (!RemoveFontResourceW(pszFontPath) &&
208 !RemoveFontResourceExW(pszFontPath, FR_PRIVATE, NULL))
209 {
210 break;
211 }
212 }
213
214 // Delete font entry in registry
215 RegDeleteValueW(hkeyFonts, strFontName);
216
217 LPCWSTR pszFileTitle = PathFindFileName(pszFontPath);
218 ATLASSERT(pszFileTitle);
219
220 // Build destination path
221 CStringW szDestFile(pszFontsDir); // pszFontsDir has backslash at back
222 szDestFile += pszFileTitle;
223 TRACE("szDestFile: '%S'\n", (PCWSTR)szDestFile);
224
225 if (!StrCmpIW(szDestFile, pszFontPath)) // Same file?
226 {
227 ERR("Wrongly same: %S\n", pszFontPath);
228 return E_FAIL;
229 }
230
231 // Copy file
232 if (!CopyFileW(pszFontPath, szDestFile, FALSE))
233 {
234 ERR("CopyFileW('%S', '%S') failed\n", pszFontPath, (PCWSTR)szDestFile);
235 return E_FAIL;
236 }
237
238 // Write registry for font entry
239 DWORD cbData = (wcslen(pszFileTitle) + 1) * sizeof(WCHAR);
240 LONG nError = RegSetValueExW(hkeyFonts, strFontName, 0, REG_SZ,
241 (const BYTE *)pszFileTitle, cbData);
242 if (nError)
243 {
244 ERR("RegSetValueExW failed with %ld\n", nError);
245 DeleteFileW(szDestFile);
246 return E_FAIL;
247 }
248
249 // Notify file creation
251
252 return AddFontResourceW(szDestFile) ? S_OK : E_FAIL;
253}
254
257 _In_ LPCWSTR pszFontPath,
258 _Out_ CStringW& strFontName)
259{
260 DWORD cbInfo = 0;
261 BOOL ret = GetFontResourceInfoW(pszFontPath, &cbInfo, NULL, 1);
262 if (!ret || !cbInfo)
263 {
264 ERR("GetFontResourceInfoW failed (err: %u)\n", GetLastError());
265 return E_FAIL;
266 }
267
268 LPWSTR pszBuffer = strFontName.GetBuffer(cbInfo / sizeof(WCHAR));
269 ret = GetFontResourceInfoW(pszFontPath, &cbInfo, pszBuffer, 1);
271 strFontName.ReleaseBuffer();
272 if (!ret)
273 {
274 ERR("GetFontResourceInfoW failed (err: %u)\n", dwErr);
275 return E_FAIL;
276 }
277
278 LPCWSTR pchDotExt = PathFindExtensionW(pszFontPath);
279 if (!StrCmpIW(pchDotExt, L".ttf") || !StrCmpIW(pchDotExt, L".ttc") ||
280 !StrCmpIW(pchDotExt, L".otf") || !StrCmpIW(pchDotExt, L".otc"))
281 {
282 strFontName += L" (TrueType)";
283 }
284
285 TRACE("pszFontName: %S\n", (LPCWSTR)strFontName);
286 return S_OK;
287}
288
290{
291 UINT cFiles = DragQueryFileW(hDrop, 0xFFFFFFFF, NULL, 0);
292 if (cFiles == 0)
293 return FALSE;
294
295 for (UINT iFile = 0; iFile < cFiles; ++iFile)
296 {
297 WCHAR szFile[MAX_PATH];
298 if (!DragQueryFileW(hDrop, iFile, szFile, _countof(szFile)))
299 return FALSE;
300 LPCWSTR pchDotExt = PathFindExtensionW(szFile);
301 if (!IsFontDotExt(pchDotExt))
302 return FALSE;
303 }
304
305 return TRUE;
306}
307
309{
310 STGMEDIUM stg;
311 FORMATETC etc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
312 HRESULT hr = pDataObj->GetData(&etc, &stg);
314 return FALSE;
315 HDROP hDrop = reinterpret_cast<HDROP>(stg.hGlobal);
316 BOOL bOK = CheckDropFontFiles(hDrop);
317 ReleaseStgMedium(&stg);
318 return bOK;
319}
320
322{
325 pData->hrResult = InstallFontFiles(pData);
326 if (pData->bCanceled)
327 pData->hrResult = S_FALSE;
328 TRACE("hrResult: 0x%08X\n", pData->hrResult);
330 pData->pDataObj->Release();
331 return 0;
332}
333
334static INT_PTR CALLBACK
336{
337 switch (uMsg)
338 {
339 case WM_INITDIALOG:
340 {
341 pData->hwnd = hwnd;
342 ATLASSERT(pData->cSteps >= 0);
345 {
346 WARN("!SHCreateThread\n");
347 pData->pDataObj->Release();
348 pData->hrResult = E_ABORT;
350 }
351 return TRUE;
352 }
353 case WM_COMMAND:
354 {
355 switch (LOWORD(wParam))
356 {
357 case IDOK:
359 break;
360 case IDCANCEL:
361 pData->bCanceled = TRUE;
363 break;
364 case IDCONTINUE:
365 pData->iStep += 1;
366 ATLASSERT(pData->iStep <= pData->cSteps);
368 break;
369 }
370 break;
371 }
372 }
373 return 0;
374}
375
376static INT_PTR CALLBACK
378{
380 if (uMsg == WM_INITDIALOG)
381 {
384 }
385
387 return InstallDlgProc(hwnd, uMsg, wParam, lParam, pData);
388}
389
391{
392 if (!CheckDataObject(pDataObj))
393 {
394 ERR("!CheckDataObject\n");
395 return E_FAIL;
396 }
397
398 CDataObjectHIDA cida(pDataObj);
399 if (!cida || cida->cidl <= 0)
400 {
401 ERR("E_UNEXPECTED\n");
402 return E_FAIL;
403 }
404
405 PCUIDLIST_ABSOLUTE pidlParent = HIDA_GetPIDLFolder(cida);
406 if (!pidlParent)
407 {
408 ERR("pidlParent is NULL\n");
409 return E_FAIL;
410 }
411
413 for (UINT n = 0; n < cida->cidl; ++n)
414 {
415 PCUIDLIST_RELATIVE pidlRelative = HIDA_GetPIDLItem(cida, n);
416 if (!pidlRelative)
417 {
418 ERR("!pidlRelative\n");
419 return E_FAIL;
420 }
421 apidl.Add(pidlRelative);
422 }
423
424 // Show progress dialog
426 data.pDataObj = pDataObj;
427 data.pidlParent = pidlParent;
428 data.apidl = &apidl[0];
429 data.cSteps = cida->cidl;
430 pDataObj->AddRef();
431 DialogBoxParamW(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCEW(IDD_INSTALL),
432 hwndView, InstallDialogProc, (LPARAM)&data);
433 if (data.bCanceled)
434 return S_FALSE;
435
436 return FAILED_UNEXPECTEDLY(data.hrResult) ? E_FAIL : S_OK;
437}
438
441{
442 switch (dwReason)
443 {
446 gModule.Init(ObjectMap, hInstance, NULL);
447 break;
449 gModule.Term();
450 break;
451 }
452
453 return TRUE;
454}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CFontCache * g_FontCache
Definition: CFontCache.cpp:12
PRTL_UNICODE_STRING_BUFFER Path
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define CF_HDROP
Definition: constants.h:410
DWORD dwErr
Definition: service.c:36
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD dwReason
Definition: misc.cpp:135
#define STDAPI
Definition: basetyps.h:41
#define EXTERN_C
Definition: basetyps.h:12
#define RegCloseKey(hKey)
Definition: registry.h:49
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
HINSTANCE hInstance
Definition: charmap.c:19
size_t Add(INARGTYPE element)
Definition: atlcoll.h:295
size_t GetCount() const
Definition: atlcoll.h:373
void Term()
Definition: atlbase.h:916
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:1037
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:1047
HRESULT Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE, const GUID *plibid)
Definition: atlbase.h:886
HRESULT DllCanUnloadNow()
Definition: atlbase.h:1030
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:1042
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE) noexcept
Definition: atlbase.h:1173
const CStringW & FontPath() const
Definition: CFontCache.hpp:51
void Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE h, const GUID *plibid)
Definition: fontext.cpp:18
void Term()
Definition: fontext.cpp:24
void Attach(T *lp)
Definition: atlalloc.h:162
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_MORE_DATA
Definition: dderror.h:13
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
struct tagINSTALL_FONT_DATA * PINSTALL_FONT_DATA
BOOL IsFontDotExt(LPCWSTR pchDotExt)
Definition: precomp.h:56
#define FONT_HIVE
Definition: precomp.h:49
#define FONT_KEY
Definition: precomp.h:50
#define IDD_INSTALL
Definition: resource.h:3
#define IDC_INSTALL_PROGRESS
Definition: resource.h:5
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
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:4882
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
#define CloseHandle
Definition: compat.h:739
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:439
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
Definition: path.c:1274
int WINAPI StrCmpIW(const WCHAR *str, const WCHAR *comp)
Definition: string.c:456
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2033
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:666
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2716
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1729
BOOL WINAPI SHCreateThread(LPTHREAD_START_ROUTINE pfnThreadProc, VOID *pData, DWORD dwFlags, LPTHREAD_START_ROUTINE pfnCallback)
Definition: thread.c:356
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
EXTERN_C BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
Definition: fontext.cpp:440
STDAPI DllRegisterServer()
Definition: fontext.cpp:51
const GUID CLSID_CFontExt
Definition: fontext.cpp:13
LONG g_ModuleRefCnt
Definition: fontext.cpp:36
STDAPI DllCanUnloadNow()
Definition: fontext.cpp:39
STDAPI DllUnregisterServer()
Definition: fontext.cpp:98
HRESULT InstallFontsFromDataObject(HWND hwndView, IDataObject *pDataObj)
Definition: fontext.cpp:390
static INT_PTR CALLBACK InstallDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, PINSTALL_FONT_DATA pData)
Definition: fontext.cpp:335
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: fontext.cpp:46
HRESULT InstallFontFiles(_Inout_ PINSTALL_FONT_DATA pData)
Definition: fontext.cpp:125
LSTATUS AddClassKeyToArray(const WCHAR *szClass, HKEY *array, UINT *cKeys)
Definition: fontext.cpp:109
void CloseRegKeyArray(HKEY *array, UINT cKeys)
Definition: fontext.cpp:103
BOOL CheckDropFontFiles(HDROP hDrop)
Definition: fontext.cpp:289
static DWORD WINAPI InstallThreadProc(LPVOID lpParameter)
Definition: fontext.cpp:321
BOOL CheckDataObject(IDataObject *pDataObj)
Definition: fontext.cpp:308
CFontExtModule gModule
Definition: fontext.cpp:37
HRESULT DoGetFontTitle(_In_ LPCWSTR pszFontPath, _Out_ CStringW &strFontName)
Definition: fontext.cpp:256
HRESULT DoInstallFontFile(_In_ PCWSTR pszFontPath, _In_ PCWSTR pszFontsDir, _In_ HKEY hkeyFonts)
Definition: fontext.cpp:181
static INT_PTR CALLBACK InstallDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontext.cpp:377
BOOL WINAPI GetFontResourceInfoW(LPCWSTR lpFileName, DWORD *pdwBufSize, void *lpBuffer, DWORD dwType)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble n
Definition: glext.h:7729
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52
#define wine_dbgstr_w
Definition: kernel32.h:34
#define REG_SZ
Definition: layer.c:22
#define END_OBJECT_MAP()
Definition: atlcom.h:691
#define OBJECT_ENTRY(clsid, class)
Definition: atlcom.h:693
#define BEGIN_OBJECT_MAP(x)
Definition: atlcom.h:689
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#define CREATE_ALWAYS
Definition: disk.h:72
LPCWSTR szPath
Definition: env.c:37
_In_ HANDLE hFile
Definition: mswsock.h:90
unsigned int UINT
Definition: ndis.h:50
#define _Inout_
Definition: no_sal2.h:162
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define KEY_READ
Definition: nt_native.h:1026
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define KEY_QUERY_VALUE
Definition: nt_native.h:1019
#define KEY_WRITE
Definition: nt_native.h:1034
#define GENERIC_WRITE
Definition: nt_native.h:90
#define PathAppendW
Definition: pathcch.h:310
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:817
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1496
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
@ CTF_COINIT
Definition: shlwapi.h:75
#define PathFindFileName
Definition: shlwapi.h:469
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
Definition: shellutils.h:713
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
Definition: shellutils.h:708
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_FONTS
Definition: shlobj.h:2198
#define SHCNE_CREATE
Definition: shlobj.h:1896
#define SHCNF_PATHW
Definition: shlobj.h:1931
const ITEMIDLIST_ABSOLUTE UNALIGNED * PCUIDLIST_ABSOLUTE
Definition: shtypes.idl:63
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
Definition: shtypes.idl:57
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
Definition: undname.c:54
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
int32_t INT_PTR
Definition: typedefs.h:64
const uint16_t * PCWSTR
Definition: typedefs.h:57
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int32_t INT
Definition: typedefs.h:58
DWORD dwAttributes
Definition: vdmdbg.h:34
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define IDCONTINUE
Definition: vfdguiut.c:42
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
BOOL WINAPI RemoveFontResourceExW(_In_ LPCWSTR lpFileName, _In_ DWORD fl, _In_opt_ PVOID pdv)
Definition: font.c:2232
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_ABORT
Definition: winerror.h:3481
int WINAPI AddFontResourceW(_In_ LPCWSTR pszFilename)
Definition: font.c:2167
BOOL WINAPI RemoveFontResourceW(_In_ LPCWSTR)
Definition: font.c:2175
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO _In_opt_ LPVOID lpReserved
Definition: winnls.h:1268
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define DWLP_USER
Definition: winuser.h:883
#define GetWindowLongPtrW
Definition: winuser.h:4931
#define MAKELPARAM(l, h)
Definition: winuser.h:4110
#define IDCANCEL
Definition: winuser.h:842
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_INITDIALOG
Definition: winuser.h:1767
#define IDOK
Definition: winuser.h:841
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDABORT
Definition: winuser.h:843
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SetWindowLongPtrW
Definition: winuser.h:5457
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char BYTE
Definition: xxhash.c:193