ReactOS 0.4.15-dev-7994-gb388cb6
cicbase.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CicNoThrow
 

Macros

#define cicNoThrow   CicNoThrow{}
 
#define CIC_OSINFO_NT   0x01
 
#define CIC_OSINFO_2KPLUS   0x02
 
#define CIC_OSINFO_95   0x04
 
#define CIC_OSINFO_98PLUS   0x08
 
#define CIC_OSINFO_CJK   0x10
 
#define CIC_OSINFO_IMM   0x20
 
#define CIC_OSINFO_DBCS   0x40
 
#define CIC_OSINFO_XPPLUS   0x80
 

Typedefs

typedef HRESULT(WINAPIFN_CoCreateInstance) (REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
 

Functions

static LPVOID cicMemAlloc (SIZE_T size)
 
static LPVOID cicMemAllocClear (SIZE_T size)
 
static LPVOID cicMemReAlloc (LPVOID ptr, SIZE_T newSize)
 
static void cicMemFree (LPVOID ptr)
 
voidoperator new (size_t size, const CicNoThrow &) noexcept
 
voidoperator new[] (size_t size, const CicNoThrow &) noexcept
 
void operator delete (void *ptr) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *ptr, size_t size) noexcept
 
void operator delete[] (void *ptr, size_t size) noexcept
 
EXTERN_C void cicGetOSInfo (LPUINT puACP, LPDWORD pdwOSInfo)
 
EXTERN_C HINSTANCE cicGetSystemModuleHandle (_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
 
EXTERN_C HINSTANCE cicLoadSystemLibrary (_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
 
EXTERN_C BOOL cicIsWow64 (VOID)
 
EXTERN_C HRESULT cicRealCoCreateInstance (_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
 
EXTERN_C HRESULT cicCoCreateInstance (_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
 
EXTERN_C BOOL TFInitLib (FN_CoCreateInstance fnCoCreateInstance=NULL)
 
EXTERN_C VOID TFUninitLib (VOID)
 

Macro Definition Documentation

◆ CIC_OSINFO_2KPLUS

#define CIC_OSINFO_2KPLUS   0x02

Definition at line 45 of file cicbase.h.

◆ CIC_OSINFO_95

#define CIC_OSINFO_95   0x04

Definition at line 46 of file cicbase.h.

◆ CIC_OSINFO_98PLUS

#define CIC_OSINFO_98PLUS   0x08

Definition at line 47 of file cicbase.h.

◆ CIC_OSINFO_CJK

#define CIC_OSINFO_CJK   0x10

Definition at line 48 of file cicbase.h.

◆ CIC_OSINFO_DBCS

#define CIC_OSINFO_DBCS   0x40

Definition at line 50 of file cicbase.h.

◆ CIC_OSINFO_IMM

#define CIC_OSINFO_IMM   0x20

Definition at line 49 of file cicbase.h.

◆ CIC_OSINFO_NT

#define CIC_OSINFO_NT   0x01

Definition at line 44 of file cicbase.h.

◆ CIC_OSINFO_XPPLUS

#define CIC_OSINFO_XPPLUS   0x80

Definition at line 51 of file cicbase.h.

◆ cicNoThrow

#define cicNoThrow   CicNoThrow{}

Definition at line 34 of file cicbase.h.

Typedef Documentation

◆ FN_CoCreateInstance

typedef HRESULT(WINAPI * FN_CoCreateInstance) (REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)

Definition at line 125 of file cicbase.h.

Function Documentation

◆ cicCoCreateInstance()

EXTERN_C HRESULT cicCoCreateInstance ( _In_ REFCLSID  rclsid,
_In_ LPUNKNOWN  pUnkOuter,
_In_ DWORD  dwClsContext,
_In_ REFIID  iid,
_Out_ LPVOID ppv 
)

@implemented

Definition at line 231 of file cicbase.cpp.

237{
238 // NOTE: It looks like Cicero wants to hook CoCreateInstance
240 if (fnUserCoCreateInstance)
241 return fnUserCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
242
243 return cicRealCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
244}
EXTERN_C HRESULT cicRealCoCreateInstance(_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
Definition: cicbase.cpp:206
static FN_CoCreateInstance _cicGetSetUserCoCreateInstance(FN_CoCreateInstance fnUserCoCreateInstance)
Definition: cicbase.cpp:196
HRESULT(WINAPI * FN_CoCreateInstance)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: cicbase.h:125
#define NULL
Definition: types.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by GetUIMCat(), and InitDisplayAttrbuteLib().

◆ cicGetOSInfo()

EXTERN_C void cicGetOSInfo ( LPUINT  puACP,
LPDWORD  pdwOSInfo 
)

Definition at line 82 of file cicbase.cpp.

83{
84 *pdwOSInfo = 0;
85
86 /* Check OS version info */
87 OSVERSIONINFO VerInfo;
88 VerInfo.dwOSVersionInfoSize = sizeof(VerInfo);
89 GetVersionEx(&VerInfo);
90 if (VerInfo.dwPlatformId == DLLVER_PLATFORM_NT)
91 {
92 *pdwOSInfo |= CIC_OSINFO_NT;
93 if (VerInfo.dwMajorVersion >= 5)
94 {
95 *pdwOSInfo |= CIC_OSINFO_2KPLUS;
96 if (VerInfo.dwMinorVersion > 0)
97 *pdwOSInfo |= CIC_OSINFO_XPPLUS;
98 }
99 }
100 else
101 {
102 if (VerInfo.dwMinorVersion >= 10)
103 *pdwOSInfo |= CIC_OSINFO_98PLUS;
104 else
105 *pdwOSInfo |= CIC_OSINFO_95;
106 }
107
108 /* Check codepage */
109 *puACP = GetACP();
110 switch (*puACP)
111 {
112 case 932: /* Japanese (Japan) */
113 case 936: /* Chinese (PRC, Singapore) */
114 case 949: /* Korean (Korea) */
115 case 950: /* Chinese (Taiwan, Hong Kong) */
116 *pdwOSInfo |= CIC_OSINFO_CJK;
117 break;
118 }
119
120 if (GetSystemMetrics(SM_IMMENABLED))
121 *pdwOSInfo |= CIC_OSINFO_IMM;
122
124 *pdwOSInfo |= CIC_OSINFO_DBCS;
125}
#define CIC_OSINFO_IMM
Definition: cicbase.h:49
#define CIC_OSINFO_NT
Definition: cicbase.h:44
#define CIC_OSINFO_DBCS
Definition: cicbase.h:50
#define CIC_OSINFO_2KPLUS
Definition: cicbase.h:45
#define CIC_OSINFO_XPPLUS
Definition: cicbase.h:51
#define CIC_OSINFO_95
Definition: cicbase.h:46
#define CIC_OSINFO_CJK
Definition: cicbase.h:48
#define CIC_OSINFO_98PLUS
Definition: cicbase.h:47
#define DLLVER_PLATFORM_NT
Definition: shlwapi.h:1962
ULONG dwPlatformId
Definition: rtltypes.h:241
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:237
ULONG dwMajorVersion
Definition: rtltypes.h:238
ULONG dwMinorVersion
Definition: rtltypes.h:239
#define GetVersionEx
Definition: winbase.h:3852
UINT WINAPI GetACP(void)
Definition: nls.c:2307
#define SM_DBCSENABLED
Definition: winuser.h:1005
int WINAPI GetSystemMetrics(_In_ int)

Referenced by InitApp(), and ProcessAttach().

◆ cicGetSystemModuleHandle()

EXTERN_C HINSTANCE cicGetSystemModuleHandle ( _In_ LPCTSTR  pszFileName,
_In_ BOOL  bSysWinDir 
)

Definition at line 130 of file cicbase.cpp.

133{
134 CicSystemModulePath ModPath;
135 if (!ModPath.Init(pszFileName, bSysWinDir))
136 return NULL;
137 return GetModuleHandle(ModPath.m_szPath);
138}
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
#define GetModuleHandle
Definition: winbase.h:3827

Referenced by CheckX64System(), cicIsWow64(), DelayedRegNotifyChangeKeyValue(), DllShutdownInProgress(), and InitApp().

◆ cicIsWow64()

EXTERN_C BOOL cicIsWow64 ( VOID  )

Definition at line 58 of file cicbase.cpp.

59{
60 static FN_NtQueryInformationProcess s_fnNtQueryInformationProcess = NULL;
62
63 if (!s_fnNtQueryInformationProcess)
64 {
65 HMODULE hNTDLL = cicGetSystemModuleHandle(TEXT("ntdll.dll"), FALSE);
66 if (!hNTDLL)
67 return FALSE;
68
69 s_fnNtQueryInformationProcess =
70 (FN_NtQueryInformationProcess)GetProcAddress(hNTDLL, "NtQueryInformationProcess");
71 if (!s_fnNtQueryInformationProcess)
72 return FALSE;
73 }
74
75 Value = 0;
76 s_fnNtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information,
77 &Value, sizeof(Value), NULL);
78 return !!Value;
79}
NTSTATUS(WINAPI * FN_NtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG)
Definition: cicbase.cpp:55
@ ProcessWow64Information
Definition: cicbase.cpp:46
EXTERN_C HINSTANCE cicGetSystemModuleHandle(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
Definition: cicbase.cpp:130
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
#define GetCurrentProcess()
Definition: compat.h:759
#define TEXT(s)
Definition: k32.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by InitApp(), and ProcessAttach().

◆ cicLoadSystemLibrary()

EXTERN_C HINSTANCE cicLoadSystemLibrary ( _In_ LPCTSTR  pszFileName,
_In_ BOOL  bSysWinDir 
)

Definition at line 143 of file cicbase.cpp.

146{
147 CicSystemModulePath ModPath;
148 if (!ModPath.Init(pszFileName, bSysWinDir))
149 return NULL;
150 return ::LoadLibrary(ModPath.m_szPath);
151}

Referenced by cicRealCoCreateInstance(), and CRegWatcher::UpdateSpTip().

◆ cicMemAlloc()

static LPVOID cicMemAlloc ( SIZE_T  size)
inlinestatic

Definition at line 10 of file cicbase.h.

11{
12 return LocalAlloc(0, size);
13}
GLsizeiptr size
Definition: glext.h:5919
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390

Referenced by CheckMlngInfo().

◆ cicMemAllocClear()

static LPVOID cicMemAllocClear ( SIZE_T  size)
inlinestatic

◆ cicMemFree()

static void cicMemFree ( LPVOID  ptr)
inlinestatic

◆ cicMemReAlloc()

static LPVOID cicMemReAlloc ( LPVOID  ptr,
SIZE_T  newSize 
)
inlinestatic

Definition at line 20 of file cicbase.h.

21{
22 if (!ptr)
23 return LocalAlloc(LMEM_ZEROINIT, newSize);
24 return LocalReAlloc(ptr, newSize, LMEM_ZEROINIT);
25}
HLOCAL NTAPI LocalReAlloc(HLOCAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:1625

Referenced by UIComposition::GetCompStrBuffer(), CicArrayBase::Insert(), and CicArray< LANGBARITEMSTATE >::Remove().

◆ cicRealCoCreateInstance()

EXTERN_C HRESULT cicRealCoCreateInstance ( _In_ REFCLSID  rclsid,
_In_ LPUNKNOWN  pUnkOuter,
_In_ DWORD  dwClsContext,
_In_ REFIID  iid,
_Out_ LPVOID ppv 
)

Definition at line 206 of file cicbase.cpp.

212{
213 static HINSTANCE s_hOle32 = NULL;
214 static FN_CoCreateInstance s_fnCoCreateInstance = NULL;
215 if (!s_fnCoCreateInstance)
216 {
217 if (!s_hOle32)
218 s_hOle32 = cicLoadSystemLibrary(TEXT("ole32.dll"), FALSE);
219 s_fnCoCreateInstance = (FN_CoCreateInstance)GetProcAddress(s_hOle32, "CoCreateInstance");
220 if (!s_fnCoCreateInstance)
221 return E_NOTIMPL;
222 }
223
224 return s_fnCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
225}
EXTERN_C HINSTANCE cicLoadSystemLibrary(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
Definition: cicbase.cpp:143
#define E_NOTIMPL
Definition: ddrawi.h:99

Referenced by cicCoCreateInstance(), and MsUtbCoCreateInstance().

◆ operator delete() [1/2]

void operator delete ( void ptr)
noexcept

Definition at line 8 of file utility.cpp.

9{
10 LocalFree(p);
11}
GLfloat GLfloat p
Definition: glext.h:8902

◆ operator delete() [2/2]

void operator delete ( void ptr,
size_t  size 
)
noexcept

Definition at line 270 of file nc_alloc.cpp.

272{
273 ::operator delete(s);
274}
GLdouble s
Definition: gl.h:2039
operator

◆ operator delete[]() [1/2]

void operator delete[] ( void ptr)
noexcept

Definition at line 238 of file nc_alloc.cpp.

239{ operator delete( ptr ); }

◆ operator delete[]() [2/2]

void operator delete[] ( void ptr,
size_t  size 
)
noexcept

Definition at line 36 of file cicbase.cpp.

37{
39}
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:27

◆ operator new()

void * operator new ( size_t  size,
const CicNoThrow  
)
noexcept

Definition at line 16 of file cicbase.cpp.

17{
18 return cicMemAllocClear(size);
19}
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15

◆ operator new[]()

void * operator new[] ( size_t  size,
const CicNoThrow  
)
noexcept

Definition at line 20 of file cicbase.cpp.

21{
22 return cicMemAllocClear(size);
23}

◆ TFInitLib()

EXTERN_C BOOL TFInitLib ( FN_CoCreateInstance  fnCoCreateInstance)

@implemented

Definition at line 251 of file cicbase.cpp.

252{
253 if (fnCoCreateInstance)
254 _cicGetSetUserCoCreateInstance(fnCoCreateInstance);
255 return TRUE;
256}
#define TRUE
Definition: types.h:120

Referenced by ProcessAttach().

◆ TFUninitLib()

EXTERN_C VOID TFUninitLib ( VOID  )

Definition at line 914 of file msctfime.cpp.

915{
916 if (g_pPropCache)
917 {
918 delete g_pPropCache;
920 }
921}
CDispAttrPropCache * g_pPropCache
Definition: msctfime.cpp:18

Referenced by ProcessDetach().