ReactOS  0.4.15-dev-2354-g9e947e2
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 {
43  if (g_ModuleRefCnt)
44  return S_FALSE;
45  return gModule.DllCanUnloadNow();
46 }
HRESULT DllCanUnloadNow()
Definition: atlbase.h:928
CFontExtModule gModule
Definition: fontext.cpp:38
#define S_FALSE
Definition: winerror.h:2357
LONG g_ModuleRefCnt
Definition: fontext.cpp:37

◆ 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 }
REFIID riid
Definition: precomp.h:44
CFontExtModule gModule
Definition: fontext.cpp:38
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: atlbase.h:935

◆ DllMain()

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

Definition at line 106 of file fontext.cpp.

107 {
108  switch (dwReason)
109  {
110  case DLL_PROCESS_ATTACH:
112  gModule.Init(ObjectMap, hInstance, NULL);
113  break;
114  case DLL_PROCESS_DETACH:
115  gModule.Term();
116  break;
117  }
118 
119  return TRUE;
120 }
#define TRUE
Definition: types.h:120
CFontExtModule gModule
Definition: fontext.cpp:38
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
DWORD dwReason
Definition: misc.cpp:154
HINSTANCE hInstance
Definition: charmap.c:20
#define DLL_PROCESS_DETACH
Definition: compat.h:130
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

◆ 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\nCLSID={BD84B380-8CA2-1069-AB1D-08000948F534}\r\n";
58  HANDLE hFile;
59  HRESULT hr;
60 
63  return hr;
64 
67  return hr;
68 
69  // Make this a system folder:
70  // Ideally this should not be done here, but when installing
71  // Otherwise, livecd won't have this set properly
74  {
77  }
78  else
79  {
80  ERR("Unable to get attributes for fonts folder (%d)\n", GetLastError());
81  }
82 
83  if (!PathAppendW(Path, L"desktop.ini"))
84  return E_FAIL;
85 
89 
90  DWORD BytesWritten, BytesToWrite = strlen(DesktopIniContents);
91  if (WriteFile(hFile, DesktopIniContents, (DWORD)BytesToWrite, &BytesWritten, NULL))
92  hr = (BytesToWrite == BytesWritten) ? S_OK : E_FAIL;
93  else
96  return hr;
97 }
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
Definition: fileinfo.c:794
_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:949
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 DllRegisterServer(BOOL bRegTypeLib=TRUE)
Definition: atlbase.h:940
#define CloseHandle
Definition: compat.h:598
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
CFontExtModule gModule
Definition: fontext.cpp:38
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1044
#define CSIDL_FONTS
Definition: shlobj.h:2031
#define E_FAIL
Definition: ddrawi.h:102
DWORD dwAttributes
Definition: vdmdbg.h:34
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
#define FALSE
Definition: types.h:117
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define GENERIC_WRITE
Definition: nt_native.h:90
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
static const WCHAR L[]
Definition: oid.c:1250
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ERR(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:51
#define CREATE_ALWAYS
Definition: disk.h:72
PRTL_UNICODE_STRING_BUFFER Path
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define NULL
Definition: types.h:112
#define CreateFileW
Definition: compat.h:600
HRESULT WINAPI SHGetFolderPathW(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath)
Definition: shellpath.c:2208

◆ DllUnregisterServer()

STDAPI DllUnregisterServer ( void  )

Definition at line 99 of file fontext.cpp.

100 {
102 }
CFontExtModule gModule
Definition: fontext.cpp:38
#define FALSE
Definition: types.h:117
HRESULT DllUnregisterServer(BOOL bUnRegTypeLib=TRUE)
Definition: atlbase.h:945

◆ 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