ReactOS 0.4.16-dev-1946-g52006dd
cicbase.cpp File Reference
#include "precomp.h"
#include "cicbase.h"
#include <shlwapi.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <strsafe.h>
Include dependency graph for cicbase.cpp:

Go to the source code of this file.

Typedefs

typedef enum _PROCESSINFOCLASS PROCESSINFOCLASS
 
typedef LONG NTSTATUS
 
typedef NTSTATUS(WINAPIFN_NtQueryInformationProcess) (HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG)
 

Enumerations

enum  _PROCESSINFOCLASS {
  ProcessBasicInformation = 0 , ProcessDebugPort = 7 , ProcessWow64Information = 26 , ProcessImageFileName = 27 ,
  ProcessBreakOnTermination = 29 , ProcessBasicInformation = 0 , ProcessDebugPort = 7 , ProcessWow64Information = 26 ,
  ProcessImageFileName = 27 , ProcessBreakOnTermination = 29 , ProcessBasicInformation = 0 , ProcessQuotaLimits = 1 ,
  ProcessIoCounters = 2 , ProcessVmCounters = 3 , ProcessTimes = 4 , ProcessBasePriority = 5 ,
  ProcessRaisePriority = 6 , ProcessDebugPort = 7 , ProcessExceptionPort = 8 , ProcessAccessToken = 9 ,
  ProcessLdtInformation = 10 , ProcessLdtSize = 11 , ProcessDefaultHardErrorMode = 12 , ProcessIoPortHandlers = 13 ,
  ProcessPooledUsageAndLimits = 14 , ProcessWorkingSetWatch = 15 , ProcessUserModeIOPL = 16 , ProcessEnableAlignmentFaultFixup = 17 ,
  ProcessPriorityClass = 18 , ProcessWx86Information = 19 , ProcessHandleCount = 20 , ProcessAffinityMask = 21 ,
  ProcessPriorityBoost = 22 , ProcessDeviceMap = 23 , ProcessSessionInformation = 24 , ProcessForegroundInformation = 25 ,
  ProcessWow64Information = 26 , ProcessImageFileName = 27 , ProcessLUIDDeviceMapsEnabled = 28 , ProcessBreakOnTermination = 29 ,
  ProcessDebugObjectHandle = 30 , ProcessDebugFlags = 31 , ProcessHandleTracing = 32 , ProcessIoPriority = 33 ,
  ProcessExecuteFlags = 34 , ProcessTlsInformation = 35 , ProcessCookie = 36 , ProcessImageInformation = 37 ,
  ProcessCycleTime = 38 , ProcessPagePriority = 39 , ProcessInstrumentationCallback = 40 , ProcessThreadStackAllocation = 41 ,
  ProcessWorkingSetWatchEx = 42 , ProcessImageFileNameWin32 = 43 , ProcessImageFileMapping = 44 , ProcessAffinityUpdateMode = 45 ,
  ProcessMemoryAllocationMode = 46 , ProcessGroupInformation = 47 , ProcessTokenVirtualizationEnabled = 48 , ProcessConsoleHostProcess = 49 ,
  ProcessWindowInformation = 50 , ProcessHandleInformation = 51 , ProcessMitigationPolicy = 52 , ProcessDynamicFunctionTableInformation = 53 ,
  ProcessHandleCheckingMode = 54 , ProcessKeepAliveCount = 55 , ProcessRevokeFileHandles = 56 , ProcessWorkingSetControl = 57 ,
  ProcessHandleTable = 58 , ProcessCheckStackExtentsMode = 59 , ProcessCommandLineInformation = 60 , ProcessProtectionInformation = 61 ,
  ProcessMemoryExhaustion = 62 , ProcessFaultInformation = 63 , ProcessTelemetryIdInformation = 64 , ProcessCommitReleaseInformation = 65 ,
  ProcessDefaultCpuSetsInformation = 66 , ProcessAllowedCpuSetsInformation = 67 , ProcessSubsystemProcess = 68 , ProcessJobMemoryInformation = 69 ,
  ProcessInPrivate = 70 , ProcessRaiseUMExceptionOnInvalidHandleClose = 71 , ProcessIumChallengeResponse = 72 , ProcessChildProcessInformation = 73 ,
  ProcessHighGraphicsPriorityInformation = 74 , ProcessSubsystemInformation = 75 , ProcessEnergyValues = 76 , ProcessPowerThrottlingState = 77 ,
  ProcessReserved3Information = 78 , ProcessWin32kSyscallFilterInformation = 79 , ProcessDisableSystemAllowedCpuSets = 80 , ProcessWakeInformation = 81 ,
  ProcessEnergyTrackingState = 82 , ProcessManageWritesToExecutableMemory = 83 , ProcessCaptureTrustletLiveDump = 84 , ProcessTelemetryCoverage = 85 ,
  ProcessEnclaveInformation = 86 , ProcessEnableReadWriteVmLogging = 87 , ProcessUptimeInformation = 88 , ProcessImageSection = 89 ,
  ProcessDebugAuthInformation = 90 , ProcessSystemResourceManagement = 91 , ProcessSequenceNumber = 92 , ProcessLoaderDetour = 93 ,
  ProcessSecurityDomainInformation = 94 , ProcessCombineSecurityDomainsInformation = 95 , ProcessEnableLogging = 96 , ProcessLeapSecondInformation = 97 ,
  ProcessFiberShadowStackAllocation = 98 , ProcessFreeFiberShadowStackAllocation = 99 , ProcessAltSystemCallInformation = 100 , ProcessDynamicEHContinuationTargets = 101 ,
  ProcessDynamicEnforcedCetCompatibleRanges = 102 , ProcessCreateStateChange = 103 , ProcessApplyStateChange = 104 , ProcessEnableOptionalXStateFeatures = 105 ,
  ProcessAltPrefetchParam = 106 , ProcessAssignCpuPartitions = 107 , ProcessPriorityClassEx = 108 , ProcessMembershipInformation = 109 ,
  ProcessEffectiveIoPriority = 110 , ProcessEffectivePagePriority = 111 , MaxProcessInfoClass , ProcessBasicInformation ,
  ProcessQuotaLimits , ProcessIoCounters , ProcessVmCounters , ProcessTimes ,
  ProcessBasePriority , ProcessRaisePriority , ProcessDebugPort , ProcessExceptionPort ,
  ProcessAccessToken , ProcessLdtInformation , ProcessLdtSize , ProcessDefaultHardErrorMode ,
  ProcessIoPortHandlers , ProcessPooledUsageAndLimits , ProcessWorkingSetWatch , ProcessUserModeIOPL ,
  ProcessEnableAlignmentFaultFixup , ProcessPriorityClass , ProcessWx86Information , ProcessHandleCount ,
  ProcessAffinityMask , ProcessPriorityBoost , ProcessDeviceMap , ProcessSessionInformation ,
  ProcessForegroundInformation , ProcessWow64Information , ProcessImageFileName , ProcessLUIDDeviceMapsEnabled ,
  ProcessBreakOnTermination , ProcessDebugObjectHandle , ProcessDebugFlags , ProcessHandleTracing ,
  ProcessIoPriority , ProcessExecuteFlags , ProcessTlsInformation , ProcessCookie ,
  ProcessImageInformation , ProcessCycleTime , ProcessPagePriority , ProcessInstrumentationCallback ,
  ProcessThreadStackAllocation , ProcessWorkingSetWatchEx , ProcessImageFileNameWin32 , ProcessImageFileMapping ,
  ProcessAffinityUpdateMode , ProcessMemoryAllocationMode , ProcessGroupInformation , ProcessTokenVirtualizationEnabled ,
  ProcessConsoleHostProcess , ProcessWindowInformation , MaxProcessInfoClass
}
 

Functions

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
 
LPVOID cicMemReCalloc (LPVOID mem, SIZE_T num, SIZE_T size) noexcept
 
EXTERN_C BOOL cicIsWow64 (VOID)
 
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)
 
static FN_CoCreateInstance _cicGetSetUserCoCreateInstance (FN_CoCreateInstance fnUserCoCreateInstance)
 
EXTERN_C HRESULT cicRealCoCreateInstance (_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
 
HRESULT cicCoCreateInstance (_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
 
EXTERN_C BOOL TFInitLib (FN_CoCreateInstance fnCoCreateInstance)
 

Typedef Documentation

◆ FN_NtQueryInformationProcess

typedef NTSTATUS(WINAPI * FN_NtQueryInformationProcess) (HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG)

Definition at line 74 of file cicbase.cpp.

◆ NTSTATUS

typedef LONG NTSTATUS

Definition at line 71 of file cicbase.cpp.

◆ PROCESSINFOCLASS

Definition at line 63 of file loader.c.

Enumeration Type Documentation

◆ _PROCESSINFOCLASS

Enumerator
ProcessBasicInformation 
ProcessDebugPort 
ProcessWow64Information 
ProcessImageFileName 
ProcessBreakOnTermination 
ProcessBasicInformation 
ProcessDebugPort 
ProcessWow64Information 
ProcessImageFileName 
ProcessBreakOnTermination 
ProcessBasicInformation 
ProcessQuotaLimits 
ProcessIoCounters 
ProcessVmCounters 
ProcessTimes 
ProcessBasePriority 
ProcessRaisePriority 
ProcessDebugPort 
ProcessExceptionPort 
ProcessAccessToken 
ProcessLdtInformation 
ProcessLdtSize 
ProcessDefaultHardErrorMode 
ProcessIoPortHandlers 
ProcessPooledUsageAndLimits 
ProcessWorkingSetWatch 
ProcessUserModeIOPL 
ProcessEnableAlignmentFaultFixup 
ProcessPriorityClass 
ProcessWx86Information 
ProcessHandleCount 
ProcessAffinityMask 
ProcessPriorityBoost 
ProcessDeviceMap 
ProcessSessionInformation 
ProcessForegroundInformation 
ProcessWow64Information 
ProcessImageFileName 
ProcessLUIDDeviceMapsEnabled 
ProcessBreakOnTermination 
ProcessDebugObjectHandle 
ProcessDebugFlags 
ProcessHandleTracing 
ProcessIoPriority 
ProcessExecuteFlags 
ProcessTlsInformation 
ProcessCookie 
ProcessImageInformation 
ProcessCycleTime 
ProcessPagePriority 
ProcessInstrumentationCallback 
ProcessThreadStackAllocation 
ProcessWorkingSetWatchEx 
ProcessImageFileNameWin32 
ProcessImageFileMapping 
ProcessAffinityUpdateMode 
ProcessMemoryAllocationMode 
ProcessGroupInformation 
ProcessTokenVirtualizationEnabled 
ProcessConsoleHostProcess 
ProcessWindowInformation 
ProcessHandleInformation 
ProcessMitigationPolicy 
ProcessDynamicFunctionTableInformation 
ProcessHandleCheckingMode 
ProcessKeepAliveCount 
ProcessRevokeFileHandles 
ProcessWorkingSetControl 
ProcessHandleTable 
ProcessCheckStackExtentsMode 
ProcessCommandLineInformation 
ProcessProtectionInformation 
ProcessMemoryExhaustion 
ProcessFaultInformation 
ProcessTelemetryIdInformation 
ProcessCommitReleaseInformation 
ProcessDefaultCpuSetsInformation 
ProcessAllowedCpuSetsInformation 
ProcessSubsystemProcess 
ProcessJobMemoryInformation 
ProcessInPrivate 
ProcessRaiseUMExceptionOnInvalidHandleClose 
ProcessIumChallengeResponse 
ProcessChildProcessInformation 
ProcessHighGraphicsPriorityInformation 
ProcessSubsystemInformation 
ProcessEnergyValues 
ProcessPowerThrottlingState 
ProcessReserved3Information 
ProcessWin32kSyscallFilterInformation 
ProcessDisableSystemAllowedCpuSets 
ProcessWakeInformation 
ProcessEnergyTrackingState 
ProcessManageWritesToExecutableMemory 
ProcessCaptureTrustletLiveDump 
ProcessTelemetryCoverage 
ProcessEnclaveInformation 
ProcessEnableReadWriteVmLogging 
ProcessUptimeInformation 
ProcessImageSection 
ProcessDebugAuthInformation 
ProcessSystemResourceManagement 
ProcessSequenceNumber 
ProcessLoaderDetour 
ProcessSecurityDomainInformation 
ProcessCombineSecurityDomainsInformation 
ProcessEnableLogging 
ProcessLeapSecondInformation 
ProcessFiberShadowStackAllocation 
ProcessFreeFiberShadowStackAllocation 
ProcessAltSystemCallInformation 
ProcessDynamicEHContinuationTargets 
ProcessDynamicEnforcedCetCompatibleRanges 
ProcessCreateStateChange 
ProcessApplyStateChange 
ProcessEnableOptionalXStateFeatures 
ProcessAltPrefetchParam 
ProcessAssignCpuPartitions 
ProcessPriorityClassEx 
ProcessMembershipInformation 
ProcessEffectiveIoPriority 
ProcessEffectivePagePriority 
MaxProcessInfoClass 
ProcessBasicInformation 
ProcessQuotaLimits 
ProcessIoCounters 
ProcessVmCounters 
ProcessTimes 
ProcessBasePriority 
ProcessRaisePriority 
ProcessDebugPort 
ProcessExceptionPort 
ProcessAccessToken 
ProcessLdtInformation 
ProcessLdtSize 
ProcessDefaultHardErrorMode 
ProcessIoPortHandlers 
ProcessPooledUsageAndLimits 
ProcessWorkingSetWatch 
ProcessUserModeIOPL 
ProcessEnableAlignmentFaultFixup 
ProcessPriorityClass 
ProcessWx86Information 
ProcessHandleCount 
ProcessAffinityMask 
ProcessPriorityBoost 
ProcessDeviceMap 
ProcessSessionInformation 
ProcessForegroundInformation 
ProcessWow64Information 
ProcessImageFileName 
ProcessLUIDDeviceMapsEnabled 
ProcessBreakOnTermination 
ProcessDebugObjectHandle 
ProcessDebugFlags 
ProcessHandleTracing 
ProcessIoPriority 
ProcessExecuteFlags 
ProcessTlsInformation 
ProcessCookie 
ProcessImageInformation 
ProcessCycleTime 
ProcessPagePriority 
ProcessInstrumentationCallback 
ProcessThreadStackAllocation 
ProcessWorkingSetWatchEx 
ProcessImageFileNameWin32 
ProcessImageFileMapping 
ProcessAffinityUpdateMode 
ProcessMemoryAllocationMode 
ProcessGroupInformation 
ProcessTokenVirtualizationEnabled 
ProcessConsoleHostProcess 
ProcessWindowInformation 
MaxProcessInfoClass 

Definition at line 61 of file cicbase.cpp.

62{
@ ProcessDebugPort
Definition: cicbase.cpp:64
@ ProcessBreakOnTermination
Definition: cicbase.cpp:67
@ ProcessBasicInformation
Definition: cicbase.cpp:63
@ ProcessWow64Information
Definition: cicbase.cpp:65
@ ProcessImageFileName
Definition: cicbase.cpp:66
enum _PROCESSINFOCLASS PROCESSINFOCLASS
Definition: loader.c:63

Function Documentation

◆ _cicGetSetUserCoCreateInstance()

static FN_CoCreateInstance _cicGetSetUserCoCreateInstance ( FN_CoCreateInstance  fnUserCoCreateInstance)
static

Definition at line 215 of file cicbase.cpp.

216{
217 static FN_CoCreateInstance s_fn = NULL;
218 if (fnUserCoCreateInstance)
219 s_fn = fnUserCoCreateInstance;
220 return s_fn;
221}
HRESULT(WINAPI * FN_CoCreateInstance)(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: cicbase.h:137
#define NULL
Definition: types.h:112

Referenced by cicCoCreateInstance(), and TFInitLib().

◆ cicCoCreateInstance()

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

@implemented

Definition at line 250 of file cicbase.cpp.

256{
257 // NOTE: It looks like Cicero wants to hook CoCreateInstance
259 if (fnUserCoCreateInstance)
260 return fnUserCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
261
262 return cicRealCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
263}
EXTERN_C HRESULT cicRealCoCreateInstance(_In_ REFCLSID rclsid, _In_ LPUNKNOWN pUnkOuter, _In_ DWORD dwClsContext, _In_ REFIID iid, _Out_ LPVOID *ppv)
Definition: cicbase.cpp:225
static FN_CoCreateInstance _cicGetSetUserCoCreateInstance(FN_CoCreateInstance fnUserCoCreateInstance)
Definition: cicbase.cpp:215
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by GetUIMCat(), and InitDisplayAttrbuteLib().

◆ cicGetOSInfo()

EXTERN_C void cicGetOSInfo ( LPUINT  puACP,
LPDWORD  pdwOSInfo 
)

Definition at line 101 of file cicbase.cpp.

102{
103 *pdwOSInfo = 0;
104
105 /* Check OS version info */
106 OSVERSIONINFO VerInfo;
107 VerInfo.dwOSVersionInfoSize = sizeof(VerInfo);
108 GetVersionEx(&VerInfo);
109 if (VerInfo.dwPlatformId == DLLVER_PLATFORM_NT)
110 {
111 *pdwOSInfo |= CIC_OSINFO_NT;
112 if (VerInfo.dwMajorVersion >= 5)
113 {
114 *pdwOSInfo |= CIC_OSINFO_2KPLUS;
115 if (VerInfo.dwMinorVersion > 0)
116 *pdwOSInfo |= CIC_OSINFO_XPPLUS;
117 }
118 }
119 else
120 {
121 if (VerInfo.dwMinorVersion >= 10)
122 *pdwOSInfo |= CIC_OSINFO_98PLUS;
123 else
124 *pdwOSInfo |= CIC_OSINFO_95;
125 }
126
127 /* Check codepage */
128 *puACP = GetACP();
129 switch (*puACP)
130 {
131 case 932: /* Japanese (Japan) */
132 case 936: /* Chinese (PRC, Singapore) */
133 case 949: /* Korean (Korea) */
134 case 950: /* Chinese (Taiwan, Hong Kong) */
135 *pdwOSInfo |= CIC_OSINFO_CJK;
136 break;
137 }
138
139 if (GetSystemMetrics(SM_IMMENABLED))
140 *pdwOSInfo |= CIC_OSINFO_IMM;
141
143 *pdwOSInfo |= CIC_OSINFO_DBCS;
144}
#define CIC_OSINFO_IMM
Definition: cicbase.h:61
#define CIC_OSINFO_NT
Definition: cicbase.h:56
#define CIC_OSINFO_DBCS
Definition: cicbase.h:62
#define CIC_OSINFO_2KPLUS
Definition: cicbase.h:57
#define CIC_OSINFO_XPPLUS
Definition: cicbase.h:63
#define CIC_OSINFO_95
Definition: cicbase.h:58
#define CIC_OSINFO_CJK
Definition: cicbase.h:60
#define CIC_OSINFO_98PLUS
Definition: cicbase.h:59
UINT WINAPI GetACP(void)
Definition: locale.c:2023
#define DLLVER_PLATFORM_NT
Definition: shlwapi.h:117
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:3601
#define SM_DBCSENABLED
Definition: winuser.h:1016
int WINAPI GetSystemMetrics(_In_ int)

Referenced by InitApp(), and ProcessAttach().

◆ cicGetSystemModuleHandle()

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

Definition at line 149 of file cicbase.cpp.

152{
153 CicSystemModulePath ModPath;
154 if (!ModPath.Init(pszFileName, bSysWinDir))
155 return NULL;
156 return GetModuleHandle(ModPath.m_szPath);
157}
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
#define GetModuleHandle
Definition: winbase.h:3576

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

◆ cicIsWow64()

EXTERN_C BOOL cicIsWow64 ( VOID  )

Definition at line 77 of file cicbase.cpp.

78{
79 static FN_NtQueryInformationProcess s_fnNtQueryInformationProcess = NULL;
81
82 if (!s_fnNtQueryInformationProcess)
83 {
84 HMODULE hNTDLL = cicGetSystemModuleHandle(TEXT("ntdll.dll"), FALSE);
85 if (!hNTDLL)
86 return FALSE;
87
88 s_fnNtQueryInformationProcess =
89 (FN_NtQueryInformationProcess)GetProcAddress(hNTDLL, "NtQueryInformationProcess");
90 if (!s_fnNtQueryInformationProcess)
91 return FALSE;
92 }
93
94 Value = 0;
95 s_fnNtQueryInformationProcess(GetCurrentProcess(), ProcessWow64Information,
96 &Value, sizeof(Value), NULL);
97 return !!Value;
98}
NTSTATUS(WINAPI * FN_NtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG)
Definition: cicbase.cpp:74
EXTERN_C HINSTANCE cicGetSystemModuleHandle(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
Definition: cicbase.cpp:149
#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:28
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 162 of file cicbase.cpp.

165{
166 CicSystemModulePath ModPath;
167 if (!ModPath.Init(pszFileName, bSysWinDir))
168 return NULL;
169 return ::LoadLibrary(ModPath.m_szPath);
170}

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

◆ cicMemReCalloc()

LPVOID cicMemReCalloc ( LPVOID  mem,
SIZE_T  num,
SIZE_T  size 
)
noexcept

Definition at line 41 of file cicbase.cpp.

42{
44 LPVOID ret;
45
46 if (!mem)
48
51 if (!ret)
52 return NULL;
53
54 if (new_size > old_size)
56
57 return ret;
58}
static LPVOID cicMemReAlloc(LPVOID ptr, SIZE_T newSize)
Definition: cicbase.h:26
static LPVOID cicMemAllocClear(SIZE_T size)
Definition: cicbase.h:15
return ret
Definition: mutex.c:146
size_t const old_size
Definition: expand.cpp:65
size_t const new_size
Definition: expand.cpp:66
GLsizeiptr size
Definition: glext.h:5919
GLuint GLuint num
Definition: glext.h:9618
SIZE_T NTAPI LocalSize(HLOCAL hMem)
Definition: heapmem.c:1794
#define ZeroMemory
Definition: minwinbase.h:31
BYTE * PBYTE
Definition: pedump.c:66
Definition: mem.c:349
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by generate_Cookie().

◆ cicRealCoCreateInstance()

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

Definition at line 225 of file cicbase.cpp.

231{
232 static HINSTANCE s_hOle32 = NULL;
233 static FN_CoCreateInstance s_fnCoCreateInstance = NULL;
234 if (!s_fnCoCreateInstance)
235 {
236 if (!s_hOle32)
237 s_hOle32 = cicLoadSystemLibrary(TEXT("ole32.dll"), FALSE);
238 s_fnCoCreateInstance = (FN_CoCreateInstance)GetProcAddress(s_hOle32, "CoCreateInstance");
239 if (!s_fnCoCreateInstance)
240 return E_NOTIMPL;
241 }
242
243 return s_fnCoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, ppv);
244}
EXTERN_C HINSTANCE cicLoadSystemLibrary(_In_ LPCTSTR pszFileName, _In_ BOOL bSysWinDir)
Definition: cicbase.cpp:162
#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 24 of file cicbase.cpp.

25{
27}
static void cicMemFree(LPVOID ptr)
Definition: cicbase.h:20
static PVOID ptr
Definition: dispmode.c:27

◆ operator delete() [2/2]

void operator delete ( void ptr,
size_t  size 
)
noexcept

Definition at line 32 of file cicbase.cpp.

33{
35}

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

void operator delete[] ( void ptr)
noexcept

Definition at line 28 of file cicbase.cpp.

29{
31}

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

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

Definition at line 36 of file cicbase.cpp.

37{
39}

◆ 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}

◆ 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 270 of file cicbase.cpp.

271{
272 if (fnCoCreateInstance)
273 _cicGetSetUserCoCreateInstance(fnCoCreateInstance);
274 return TRUE;
275}
#define TRUE
Definition: types.h:120

Referenced by ProcessAttach().