ReactOS 0.4.15-dev-7934-g1dc8d80
fontext.cpp File Reference
#include "precomp.h"
Include dependency graph for fontext.cpp:

Go to the source code of this file.

Classes

class  CFontExtModule
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fontext)
 
STDAPI DllCanUnloadNow ()
 
STDAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
STDAPI DllRegisterServer ()
 
STDAPI DllUnregisterServer ()
 
EXTERN_C BOOL WINAPI DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
 

Variables

const GUID CLSID_CFontExt = { 0xbd84b380, 0x8ca2, 0x1069, { 0xab, 0x1d, 0x08, 0x00, 0x09, 0x48, 0xf5, 0x34 } }
 
LONG g_ModuleRefCnt
 
CFontExtModule gModule
 

Function Documentation

◆ DllCanUnloadNow()

STDAPI DllCanUnloadNow ( void  )

Definition at line 41 of file fontext.cpp.

42{
44 return S_FALSE;
45 return gModule.DllCanUnloadNow();
46}
HRESULT DllCanUnloadNow()
Definition: atlbase.h:1030
LONG g_ModuleRefCnt
Definition: fontext.cpp:37
CFontExtModule gModule
Definition: fontext.cpp:38
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

STDAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 48 of file fontext.cpp.

49{
50 return gModule.DllGetClassObject(rclsid, riid, ppv);
51}
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:1037
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ DllMain()

EXTERN_C BOOL WINAPI DllMain ( HINSTANCE  hInstance,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 108 of file fontext.cpp.

109{
110 switch (dwReason)
111 {
114 gModule.Init(ObjectMap, hInstance, NULL);
115 break;
117 gModule.Term();
118 break;
119 }
120
121 return TRUE;
122}
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hInstance
Definition: charmap.c:19
void Init(_ATL_OBJMAP_ENTRY *p, HINSTANCE h, const GUID *plibid)
Definition: fontext.cpp:18
void Term()
Definition: fontext.cpp:24
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85

◆ DllRegisterServer()

STDAPI DllRegisterServer ( void  )

Definition at line 54 of file fontext.cpp.

55{
56 WCHAR Path[MAX_PATH] = { 0 };
57 static const char DesktopIniContents[] = "[.ShellClassInfo]\r\n"
58 "CLSID={BD84B380-8CA2-1069-AB1D-08000948F534}\r\n"
59 "IconResource=%SystemRoot%\\system32\\shell32.dll,-39\r\n"; // IDI_SHELL_FONTS_FOLDER
61 HRESULT hr;
62
65 return hr;
66
69 return hr;
70
71 // Make this a system folder:
72 // Ideally this should not be done here, but when installing
73 // Otherwise, livecd won't have this set properly
76 {
79 }
80 else
81 {
82 ERR("Unable to get attributes for fonts folder (%d)\n", GetLastError());
83 }
84
85 if (!PathAppendW(Path, L"desktop.ini"))
86 return E_FAIL;
87
91
92 DWORD BytesWritten, BytesToWrite = strlen(DesktopIniContents);
93 if (WriteFile(hFile, DesktopIniContents, (DWORD)BytesToWrite, &BytesWritten, NULL))
94 hr = (BytesToWrite == BytesWritten) ? S_OK : E_FAIL;
95 else
98 return hr;
99}
PRTL_UNICODE_STRING_BUFFER Path
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:1042
#define E_FAIL
Definition: ddrawi.h:102
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
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
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2589
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:52
#define CREATE_ALWAYS
Definition: disk.h:72
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50
#define PathAppendW
Definition: pathcch.h:309
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_FONTS
Definition: shlobj.h:2177
DWORD dwAttributes
Definition: vdmdbg.h:34
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_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
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 101 of file fontext.cpp.

102{
104}
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:1047

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fontext  )

Variable Documentation

◆ CLSID_CFontExt

const GUID CLSID_CFontExt = { 0xbd84b380, 0x8ca2, 0x1069, { 0xab, 0x1d, 0x08, 0x00, 0x09, 0x48, 0xf5, 0x34 } }

Definition at line 12 of file fontext.cpp.

Referenced by CFontExt::GetClassID().

◆ g_ModuleRefCnt

LONG g_ModuleRefCnt

Definition at line 37 of file fontext.cpp.

Referenced by DllCanUnloadNow().

◆ gModule