├── .gitattributes ├── make.cmd ├── README.md ├── LICENSE ├── EtwPlus.cpp ├── pixEvt.cpp ├── toolhelpx.cpp ├── era.h ├── .gitignore ├── combase.cpp └── kernelx.cpp /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /make.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | set MAKE=cl /O2 /std:c++20 /I.. 3 | set MAKEDLL=%MAKE% /LD 4 | if not exist bin mkdir bin 5 | pushd bin 6 | %MAKEDLL% ..\combase.cpp 7 | %MAKEDLL% ..\kernelx.cpp 8 | %MAKEDLL% ..\toolhelpx.cpp 9 | %MAKEDLL% ..\EtwPlus.cpp 10 | %MAKEDLL% ..\pixEvt.cpp 11 | popd 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SlimEra 2 | This project provides "slim" Win32 reference implementations of select DLLs from the Xbox ERA (Exclusive Resource Application) operating system. 3 | 4 | These implementations primarily target tool-focused use cases (such as writing programs to utilize ERA's `D3DCompiler_46.dll`, `xg_x.dll`, etc. binaries for research and analysis purposes). They do not (on their own) enable more complex ERA applications such as games to run on desktop. However, these implementations can still be used as a base to build full translation layers capable of running games (XWine1 itself derives from SlimEra). 5 | 6 | Each library is implemented in its own `.cpp` file and requires no external dependencies aside from the Windows SDK and the included `era.h`. 7 | 8 | # Supported Libraries 9 | * `combase.dll` 10 | * `EtwPlus.dll` 11 | * `kernelx.dll` 12 | * `pixEvt.dll` 13 | * `toolhelpx.dll` 14 | 15 | # Building 16 | Run `make.cmd` from a Visual Studio developer command prompt. 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 XWine1 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /EtwPlus.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | typedef struct _ETX_FIELD_DESCRIPTOR 5 | { 6 | UINT8 Type : 5; 7 | UINT8 IsLengthField : 1; 8 | } ETX_FIELD_DESCRIPTOR, *PETX_FIELD_DESCRIPTOR, *LPETX_FIELD_DESCRIPTOR; 9 | 10 | typedef struct _ETX_EVENT_DESCRIPTOR 11 | { 12 | EVENT_DESCRIPTOR EtwDescriptor; 13 | LPCSTR Name; 14 | LPCSTR SchemaVersion; 15 | ETX_FIELD_DESCRIPTOR const *FieldDescriptors; 16 | UINT8 NumFields; 17 | UINT8 UploadEnabled; 18 | UINT8 CurrentUploadEnabledState; 19 | UINT8 DefaultUploadEnabledState; 20 | INT8 CurrentPopulationSample; 21 | INT8 DefaultPopulationSample; 22 | UINT8 CurrentLatency; 23 | UINT8 DefaultLatency; 24 | UINT8 CurrentPriority; 25 | UINT8 DefaultPriority; 26 | } ETX_EVENT_DESCRIPTOR, *PETX_EVENT_DESCRIPTOR, *LPETX_EVENT_DESCRIPTOR; 27 | 28 | typedef struct _ETX_PROVIDER_DESCRIPTOR 29 | { 30 | LPCSTR Name; 31 | GUID Guid; 32 | ULONG NumEvents; 33 | PETX_EVENT_DESCRIPTOR EventDescriptors; 34 | UINT8 UploadEnabled; 35 | UINT8 CurrentUploadEnabledState; 36 | UINT8 DefaultUploadEnabledState; 37 | INT8 CurrentPopulationSample; 38 | INT8 DefaultPopulationSample; 39 | UINT8 CurrentLatency; 40 | UINT8 DefaultLatency; 41 | UINT8 CurrentPriority; 42 | UINT8 DefaultPriority; 43 | } ETX_PROVIDER_DESCRIPTOR, *PETX_PROVIDER_DESCRIPTOR, *LPETX_PROVIDER_DESCRIPTOR; 44 | 45 | EXTERN_C ULONG WINAPI EtxEventWrite( 46 | _In_ PETX_EVENT_DESCRIPTOR EventDescriptor, 47 | _In_ PETX_PROVIDER_DESCRIPTOR ProviderDescriptor, 48 | _In_ REGHANDLE RegHandle, 49 | _In_ ULONG UserDataCount, 50 | _In_opt_ PEVENT_DATA_DESCRIPTOR UserData) 51 | { 52 | UNREFERENCED_PARAMETER(EventDescriptor); 53 | UNREFERENCED_PARAMETER(ProviderDescriptor); 54 | UNREFERENCED_PARAMETER(RegHandle); 55 | UNREFERENCED_PARAMETER(UserDataCount); 56 | UNREFERENCED_PARAMETER(UserData); 57 | return ERROR_SUCCESS; 58 | } 59 | 60 | EXTERN_C void WINAPI EtxFillCommonFields_v7( 61 | _Out_ PEVENT_DATA_DESCRIPTOR EventData, 62 | _Out_ PUINT8 Scratch, 63 | _In_ SIZE_T ScratchSize) 64 | { 65 | UNREFERENCED_PARAMETER(EventData); 66 | UNREFERENCED_PARAMETER(Scratch); 67 | UNREFERENCED_PARAMETER(ScratchSize); 68 | ZeroMemory(EventData, sizeof(*EventData)); 69 | } 70 | 71 | EXTERN_C ULONG WINAPI EtxRegister( 72 | _In_ PETX_PROVIDER_DESCRIPTOR ProviderDescriptor, 73 | _Out_ PREGHANDLE RegHandle) 74 | { 75 | UNREFERENCED_PARAMETER(ProviderDescriptor); 76 | *RegHandle = 0; 77 | return ERROR_SUCCESS; 78 | } 79 | 80 | EXTERN_C void WINAPI EtxResumeUploading() 81 | { 82 | } 83 | 84 | EXTERN_C void WINAPI EtxSuspendUploading() 85 | { 86 | } 87 | 88 | EXTERN_C ULONG WINAPI EtxUnregister( 89 | _In_ PETX_PROVIDER_DESCRIPTOR ProviderDescriptor, 90 | _In_ PREGHANDLE RegHandle) 91 | { 92 | UNREFERENCED_PARAMETER(ProviderDescriptor); 93 | UNREFERENCED_PARAMETER(RegHandle); 94 | return ERROR_SUCCESS; 95 | } 96 | 97 | // 98 | // Exports 99 | // 100 | #pragma comment(linker, "/export:EtxEventWrite") 101 | #pragma comment(linker, "/export:EtxFillCommonFields_v7") 102 | #pragma comment(linker, "/export:EtxRegister") 103 | #pragma comment(linker, "/export:EtxResumeUploading") 104 | #pragma comment(linker, "/export:EtxSuspendUploading") 105 | #pragma comment(linker, "/export:EtxUnregister") 106 | -------------------------------------------------------------------------------- /pixEvt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | union PIXCaptureParameters 4 | { 5 | enum PIXCaptureStorage 6 | { 7 | Memory = 0, 8 | MemoryCircular = 1, // Xbox only 9 | FileCircular = 2, // PC only 10 | }; 11 | 12 | struct GpuCaptureParameters 13 | { 14 | PCWSTR FileName; 15 | } GpuCaptureParameters; 16 | 17 | struct TimingCaptureParameters 18 | { 19 | PCWSTR FileName; 20 | UINT32 MaximumToolingMemorySizeMb; 21 | PIXCaptureStorage CaptureStorage; 22 | 23 | BOOL CaptureGpuTiming; 24 | 25 | BOOL CaptureCallstacks; 26 | BOOL CaptureCpuSamples; 27 | UINT32 CpuSamplesPerSecond; 28 | 29 | BOOL CaptureFileIO; 30 | 31 | BOOL CaptureVirtualAllocEvents; 32 | BOOL CaptureHeapAllocEvents; 33 | BOOL CaptureXMemEvents; // Xbox only 34 | BOOL CapturePixMemEvents; 35 | BOOL CapturePageFaultEvents; 36 | BOOL CaptureVideoFrames; // Xbox only 37 | } TimingCaptureParameters; 38 | }; 39 | 40 | typedef PIXCaptureParameters* PPIXCaptureParameters; 41 | 42 | EXTERN_C HRESULT WINAPI ConfigureL2IPMCs( 43 | _In_ UINT eventIndex10, 44 | _In_ UINT eventIndex11, 45 | _In_ UINT eventIndex12, 46 | _In_ UINT eventIndex13) 47 | { 48 | UNREFERENCED_PARAMETER(eventIndex10); 49 | UNREFERENCED_PARAMETER(eventIndex11); 50 | UNREFERENCED_PARAMETER(eventIndex12); 51 | UNREFERENCED_PARAMETER(eventIndex13); 52 | return S_OK; 53 | } 54 | 55 | EXTERN_C HRESULT WINAPI ConfigureNBPMCs( 56 | _In_ UINT eventIndex6, 57 | _In_ UINT eventIndex7, 58 | _In_ UINT eventIndex8, 59 | _In_ UINT eventIndex9) 60 | { 61 | UNREFERENCED_PARAMETER(eventIndex6); 62 | UNREFERENCED_PARAMETER(eventIndex7); 63 | UNREFERENCED_PARAMETER(eventIndex8); 64 | UNREFERENCED_PARAMETER(eventIndex9); 65 | return S_OK; 66 | } 67 | 68 | EXTERN_C HRESULT WINAPI ConfigurePMCs( 69 | _In_ UINT eventIndex0, 70 | _In_ UINT eventIndex1, 71 | _In_ UINT eventIndex2, 72 | _In_ UINT eventIndex3) 73 | { 74 | UNREFERENCED_PARAMETER(eventIndex0); 75 | UNREFERENCED_PARAMETER(eventIndex1); 76 | UNREFERENCED_PARAMETER(eventIndex2); 77 | UNREFERENCED_PARAMETER(eventIndex3); 78 | return S_OK; 79 | } 80 | 81 | EXTERN_C HRESULT WINAPI PIXBeginCapture( 82 | _In_ DWORD captureFlags, 83 | _In_opt_ const PPIXCaptureParameters captureParameters) 84 | { 85 | UNREFERENCED_PARAMETER(captureFlags); 86 | UNREFERENCED_PARAMETER(captureParameters); 87 | return S_OK; 88 | } 89 | 90 | EXTERN_C HRESULT WINAPI PIXEndCapture( 91 | _In_ BOOL discard) 92 | { 93 | UNREFERENCED_PARAMETER(discard); 94 | return S_OK; 95 | } 96 | 97 | EXTERN_C UINT64 WINAPI PIXEventsReplaceBlock( 98 | _In_ bool getEarliestTime) 99 | { 100 | UNREFERENCED_PARAMETER(getEarliestTime); 101 | return 0; 102 | } 103 | 104 | EXTERN_C DWORD WINAPI PIXGetCaptureState() 105 | { 106 | return 0; 107 | } 108 | 109 | EXTERN_C void WINAPI PIXReportCounter( 110 | _In_ PCWSTR Name, 111 | _In_ float value) 112 | { 113 | UNREFERENCED_PARAMETER(Name); 114 | UNREFERENCED_PARAMETER(value); 115 | } 116 | 117 | EXTERN_C UINT64 WINAPI GetCaptureControlState() 118 | { 119 | return 0; 120 | } 121 | 122 | EXTERN_C UINT64 WINAPI RegisterForCaptureControl() 123 | { 124 | return 0; 125 | } 126 | 127 | EXTERN_C UINT64 WINAPI SetCaptureCallgraphState() 128 | { 129 | return 0; 130 | } 131 | 132 | EXTERN_C UINT64 WINAPI SetCaptureFunctionDetailsState() 133 | { 134 | return 0; 135 | } 136 | 137 | EXTERN_C UINT64 WINAPI SetCaptureFunctionSummaryState() 138 | { 139 | return 0; 140 | } 141 | 142 | EXTERN_C UINT64 WINAPI SetCaptureInstructionTraceState() 143 | { 144 | return 0; 145 | } 146 | 147 | EXTERN_C UINT64 WINAPI UnregisterForCaptureControl() 148 | { 149 | return 0; 150 | } 151 | 152 | // 153 | // Exports 154 | // 155 | #pragma comment(linker, "/export:ConfigureL2IPMCs") 156 | #pragma comment(linker, "/export:ConfigureNBPMCs") 157 | #pragma comment(linker, "/export:ConfigurePMCs") 158 | #pragma comment(linker, "/export:GetCaptureControlState") 159 | #pragma comment(linker, "/export:PIXBeginCapture") 160 | #pragma comment(linker, "/export:PIXEndCapture") 161 | #pragma comment(linker, "/export:PIXEventsReplaceBlock") 162 | #pragma comment(linker, "/export:PIXGetCaptureState") 163 | #pragma comment(linker, "/export:PIXReportCounter") 164 | #pragma comment(linker, "/export:RegisterForCaptureControl") 165 | #pragma comment(linker, "/export:SetCaptureCallgraphState") 166 | #pragma comment(linker, "/export:SetCaptureFunctionDetailsState") 167 | #pragma comment(linker, "/export:SetCaptureFunctionSummaryState") 168 | #pragma comment(linker, "/export:SetCaptureInstructionTraceState") 169 | #pragma comment(linker, "/export:UnregisterForCaptureControl") 170 | -------------------------------------------------------------------------------- /toolhelpx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | enum ResolveDisposition 4 | { 5 | // TODO: Is this value correct? 6 | // Need to find a reference other than ATG samples. 7 | DefaultPriority, 8 | }; 9 | 10 | EXTERN_C HRESULT WINAPI GetSourceLineFromAddress( 11 | _In_ ResolveDisposition Disposition, 12 | _In_ DWORD FrameCount, 13 | _In_ PULONG_PTR Addresses, 14 | _In_ BOOL(*Callback)( 15 | _In_ LPVOID Context, 16 | _In_ ULONG_PTR Address, 17 | _In_ HRESULT Result, 18 | _In_ PCWSTR FilePath, 19 | _In_ ULONG LineNumber), 20 | _In_ LPVOID Context) 21 | { 22 | UNREFERENCED_PARAMETER(Disposition); 23 | UNREFERENCED_PARAMETER(FrameCount); 24 | UNREFERENCED_PARAMETER(Addresses); 25 | UNREFERENCED_PARAMETER(Callback); 26 | UNREFERENCED_PARAMETER(Context); 27 | return E_NOTIMPL; 28 | } 29 | 30 | EXTERN_C HRESULT WINAPI GetSymbolFromAddress( 31 | _In_ ResolveDisposition Disposition, 32 | _In_ DWORD FrameCount, 33 | _In_ PULONG_PTR Addresses, 34 | _In_ BOOL(*Callback)( 35 | _In_ LPVOID Context, 36 | _In_ ULONG_PTR Address, 37 | _In_ HRESULT Result, 38 | _In_ PCWSTR Name, 39 | _In_ ULONG Offset), 40 | _In_ LPVOID Context) 41 | { 42 | UNREFERENCED_PARAMETER(Disposition); 43 | UNREFERENCED_PARAMETER(FrameCount); 44 | UNREFERENCED_PARAMETER(Addresses); 45 | UNREFERENCED_PARAMETER(Callback); 46 | UNREFERENCED_PARAMETER(Context); 47 | return E_NOTIMPL; 48 | } 49 | 50 | EXTERN_C BOOL WINAPI QuerySystemHardwareInfo() 51 | { 52 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 53 | return FALSE; 54 | } 55 | 56 | // 57 | // Exports 58 | // 59 | #pragma comment(linker, "/export:CloseTrace=advapi32.CloseTrace") 60 | #pragma comment(linker, "/export:ContinueDebugEvent=kernel32.ContinueDebugEvent") 61 | #pragma comment(linker, "/export:ControlTraceW=advapi32.ControlTraceW") 62 | #pragma comment(linker, "/export:DebugActiveProcess=kernel32.DebugActiveProcess") 63 | #pragma comment(linker, "/export:DebugActiveProcessStop=kernel32.DebugActiveProcessStop") 64 | #pragma comment(linker, "/export:EnableTrace=advapi32.EnableTrace") 65 | #pragma comment(linker, "/export:EnableTraceEx=advapi32.EnableTraceEx") 66 | #pragma comment(linker, "/export:EnableTraceEx2=advapi32.EnableTraceEx2") 67 | #pragma comment(linker, "/export:EnumerateTraceGuidsEx=advapi32.EnumerateTraceGuidsEx") 68 | #pragma comment(linker, "/export:GetSourceLineFromAddress") 69 | #pragma comment(linker, "/export:GetSymbolFromAddress") 70 | #pragma comment(linker, "/export:GetThreadName=kernelx.GetThreadName") 71 | #pragma comment(linker, "/export:K32EnumDeviceDrivers=kernel32.K32EnumDeviceDrivers") 72 | #pragma comment(linker, "/export:K32EnumProcessModules=kernel32.K32EnumProcessModules") 73 | #pragma comment(linker, "/export:K32EnumProcessModulesEx=kernel32.K32EnumProcessModulesEx") 74 | #pragma comment(linker, "/export:K32EnumProcesses=kernel32.K32EnumProcesses") 75 | #pragma comment(linker, "/export:K32GetDeviceDriverBaseNameA=kernel32.K32GetDeviceDriverBaseNameA") 76 | #pragma comment(linker, "/export:K32GetDeviceDriverBaseNameW=kernel32.K32GetDeviceDriverBaseNameW") 77 | #pragma comment(linker, "/export:K32GetDeviceDriverFileNameA=kernel32.K32GetDeviceDriverFileNameA") 78 | #pragma comment(linker, "/export:K32GetDeviceDriverFileNameW=kernel32.K32GetDeviceDriverFileNameW") 79 | #pragma comment(linker, "/export:K32GetMappedFileNameA=kernel32.K32GetMappedFileNameA") 80 | #pragma comment(linker, "/export:K32GetMappedFileNameW=kernel32.K32GetMappedFileNameW") 81 | #pragma comment(linker, "/export:K32GetModuleBaseNameA=kernel32.K32GetModuleBaseNameA") 82 | #pragma comment(linker, "/export:K32GetModuleBaseNameW=kernel32.K32GetModuleBaseNameW") 83 | #pragma comment(linker, "/export:K32GetModuleFileNameExA=kernel32.K32GetModuleFileNameExA") 84 | #pragma comment(linker, "/export:K32GetModuleFileNameExW=kernel32.K32GetModuleFileNameExW") 85 | #pragma comment(linker, "/export:K32GetModuleInformation=kernel32.K32GetModuleInformation") 86 | #pragma comment(linker, "/export:K32GetPerformanceInfo=kernel32.K32GetPerformanceInfo") 87 | #pragma comment(linker, "/export:K32GetProcessImageFileNameA=kernel32.K32GetProcessImageFileNameA") 88 | #pragma comment(linker, "/export:K32GetProcessImageFileNameW=kernel32.K32GetProcessImageFileNameW") 89 | #pragma comment(linker, "/export:K32GetProcessMemoryInfo=kernel32.K32GetProcessMemoryInfo") 90 | #pragma comment(linker, "/export:K32GetWsChanges=kernel32.K32GetWsChanges") 91 | #pragma comment(linker, "/export:K32GetWsChangesEx=kernel32.K32GetWsChangesEx") 92 | #pragma comment(linker, "/export:K32InitializeProcessForWsWatch=kernel32.K32InitializeProcessForWsWatch") 93 | #pragma comment(linker, "/export:K32QueryWorkingSet=kernel32.K32QueryWorkingSet") 94 | #pragma comment(linker, "/export:K32QueryWorkingSetEx=kernel32.K32QueryWorkingSetEx") 95 | #pragma comment(linker, "/export:MiniDumpWriteDump=dbghelp.MiniDumpWriteDump") 96 | #pragma comment(linker, "/export:OpenTraceW=advapi32.OpenTraceW") 97 | #pragma comment(linker, "/export:ProcessTrace=advapi32.ProcessTrace") 98 | #pragma comment(linker, "/export:QueryAllTracesW=advapi32.QueryAllTracesW") 99 | #pragma comment(linker, "/export:QueryFullProcessImageNameW=kernel32.QueryFullProcessImageNameW") 100 | #pragma comment(linker, "/export:QuerySystemHardwareInfo") 101 | #pragma comment(linker, "/export:SetThreadName=kernelx.SetThreadName") 102 | #pragma comment(linker, "/export:StartTraceW=advapi32.StartTraceW") 103 | #pragma comment(linker, "/export:StopTraceW=advapi32.StopTraceW") 104 | #pragma comment(linker, "/export:TraceQueryInformation=advapi32.TraceQueryInformation") 105 | #pragma comment(linker, "/export:TraceSetInformation=advapi32.TraceSetInformation") 106 | #pragma comment(linker, "/export:WaitForDebugEvent=kernel32.WaitForDebugEvent") 107 | -------------------------------------------------------------------------------- /era.h: -------------------------------------------------------------------------------- 1 | #ifndef _XBOX_ERA_ 2 | #define _XBOX_ERA_ 3 | 4 | #include 5 | 6 | #define MEM_GRAPHICS 0x10000000 7 | #define MEM_TITLE 0x40000000 8 | 9 | typedef enum _CONSOLE_TYPE 10 | { 11 | CONSOLE_TYPE_UNKNOWN, 12 | CONSOLE_TYPE_XBOX_ONE, 13 | CONSOLE_TYPE_XBOX_ONE_S, 14 | CONSOLE_TYPE_XBOX_ONE_X, 15 | CONSOLE_TYPE_XBOX_ONE_X_DEVKIT, 16 | } CONSOLE_TYPE, *PCONSOLE_TYPE, *LPCONSOLE_TYPE; 17 | 18 | EXTERN_C CONSOLE_TYPE WINAPI GetConsoleType(); 19 | 20 | typedef struct _SYSTEMOSVERSIONINFO 21 | { 22 | BYTE MajorVersion; 23 | BYTE MinorVersion; 24 | WORD BuildNumber; 25 | WORD Revision; 26 | } SYSTEMOSVERSIONINFO, *PSYSTEMOSVERSIONINFO, *LPSYSTEMOSVERSIONINFO; 27 | 28 | EXTERN_C VOID WINAPI GetSystemOSVersion( 29 | _Out_ LPSYSTEMOSVERSIONINFO lpVersionInformation); 30 | 31 | typedef struct _PROCESSOR_SCHEDULING_STATISTICS 32 | { 33 | ULONGLONG RunningTime; 34 | ULONGLONG IdleTime; 35 | ULONGLONG GlobalTime; 36 | } PROCESSOR_SCHEDULING_STATISTICS, *PPROCESSOR_SCHEDULING_STATISTICS, *LPPROCESSOR_SCHEDULING_STATISTICS; 37 | 38 | EXTERN_C VOID WINAPI QueryProcessorSchedulingStatistics( 39 | _Out_ PPROCESSOR_SCHEDULING_STATISTICS lpStatistics); 40 | 41 | EXTERN_C BOOL WINAPI SetThreadpoolAffinityMask( 42 | _Inout_ PTP_POOL Pool, 43 | _In_ DWORD_PTR dwThreadAffinityMask); 44 | 45 | EXTERN_C BOOL WINAPI SetThreadName( 46 | _In_ HANDLE hThread, 47 | _In_ PCWSTR lpThreadName); 48 | 49 | EXTERN_C BOOL WINAPI GetThreadName( 50 | _In_ HANDLE hThread, 51 | _Out_ PWSTR lpThreadName, 52 | _In_ SIZE_T dwBufferLength, 53 | _Out_ PSIZE_T pdwReturnLength); 54 | 55 | typedef struct _TITLEMEMORYSTATUS 56 | { 57 | DWORD dwLength; 58 | DWORD dwReserved; 59 | ULONGLONG ullTotalMem; 60 | ULONGLONG ullAvailMem; 61 | ULONGLONG ullLegacyUsed; 62 | ULONGLONG ullLegacyPeak; 63 | ULONGLONG ullLegacyAvail; 64 | ULONGLONG ullTitleUsed; 65 | ULONGLONG ullTitleAvail; 66 | ULONGLONG ullLegacyPageTableUsed; 67 | ULONGLONG ullTitlePageTableUsed; 68 | } TITLEMEMORYSTATUS, *PTITLEMEMORYSTATUS, *LPTITLEMEMORYSTATUS; 69 | 70 | EXTERN_C BOOL WINAPI TitleMemoryStatus( 71 | _Inout_ LPTITLEMEMORYSTATUS lpBuffer); 72 | 73 | EXTERN_C BOOL WINAPI JobTitleMemoryStatus( 74 | _Inout_ LPTITLEMEMORYSTATUS lpBuffer); 75 | 76 | typedef struct _TOOLINGMEMORYSTATUS 77 | { 78 | DWORD dwLength; 79 | DWORD dwReserved; 80 | ULONGLONG ullTotalMem; 81 | ULONGLONG ullAvailMem; 82 | ULONGLONG ulPeakUsage; 83 | ULONGLONG ullPageTableUsage; 84 | } TOOLINGMEMORYSTATUS, *PTOOLINGMEMORYSTATUS, *LPTOOLINGMEMORYSTATUS; 85 | 86 | EXTERN_C BOOL WINAPI ToolingMemoryStatus( 87 | _Inout_ LPTOOLINGMEMORYSTATUS lpBuffer); 88 | 89 | EXTERN_C BOOL WINAPI AllocateTitlePhysicalPages( 90 | _In_ HANDLE hProcess, 91 | _In_ DWORD flAllocationType, 92 | _Inout_ PULONG_PTR NumberOfPages, 93 | _Out_ PULONG_PTR PageArray); 94 | 95 | EXTERN_C BOOL WINAPI FreeTitlePhysicalPages( 96 | _In_ HANDLE hProcess, 97 | _In_ ULONG_PTR NumberOfPages, 98 | _In_ PULONG_PTR PageArray); 99 | 100 | EXTERN_C PVOID WINAPI MapTitlePhysicalPages( 101 | _In_opt_ PVOID VirtualAddress, 102 | _In_ ULONG_PTR NumberOfPages, 103 | _In_ DWORD flAllocationType, 104 | _In_ DWORD flProtect, 105 | _In_ PULONG_PTR PageArray); 106 | 107 | // This is not a standard ERA function, it is provided for convenience 108 | // to aid in the implementation of the Direct3D D3DMapEsramMemory API. 109 | EXTERN_C HRESULT WINAPI MapTitleEsramPages( 110 | _In_ PVOID VirtualAddress, 111 | _In_ UINT NumberOfPages, 112 | _In_ DWORD flAllocationType, 113 | _In_opt_ UINT const *PageArray); 114 | 115 | typedef union _XALLOC_ATTRIBUTES 116 | { 117 | ULONGLONG dwAttributes; 118 | 119 | struct 120 | { 121 | ULONGLONG dwObjectType : 14; 122 | ULONGLONG dwPageSize : 2; 123 | ULONGLONG dwAllocatorId : 8; 124 | ULONGLONG dwAlignment : 5; 125 | ULONGLONG dwMemoryType : 4; 126 | ULONGLONG reserved : 31; 127 | } s; 128 | } XALLOC_ATTRIBUTES, *PXALLOC_ATTRIBUTES, *LPXALLOC_ATTRIBUTES; 129 | 130 | typedef enum _XALLOC_PAGESIZE 131 | { 132 | XALLOC_PAGESIZE_4KB, 133 | XALLOC_PAGESIZE_64KB, 134 | XALLOC_PAGESIZE_4MB, 135 | } XALLOC_PAGESIZE, *PXALLOC_PAGESIZE; 136 | 137 | typedef enum _XALLOC_MEMTYPE 138 | { 139 | XALLOC_MEMTYPE_HEAP, 140 | XALLOC_MEMTYPE_GRAPHICS_1, 141 | XALLOC_MEMTYPE_GRAPHICS_2, 142 | XALLOC_MEMTYPE_GRAPHICS_3, 143 | XALLOC_MEMTYPE_GRAPHICS_4, 144 | XALLOC_MEMTYPE_GRAPHICS_5, 145 | XALLOC_MEMTYPE_GRAPHICS_6, 146 | XALLOC_MEMTYPE_PHYSICAL_1, 147 | XALLOC_MEMTYPE_PHYSICAL_2, 148 | XALLOC_MEMTYPE_PHYSICAL_3, 149 | } XALLOC_MEMTYPE, *PXALLOC_MEMTYPE; 150 | 151 | EXTERN_C PVOID WINAPI XMemAllocDefault( 152 | _In_ SIZE_T dwSize, 153 | _In_ ULONGLONG dwAttributes); 154 | 155 | EXTERN_C void WINAPI XMemFreeDefault( 156 | _In_ PVOID lpAddress, 157 | _In_ ULONGLONG dwAttributes); 158 | 159 | EXTERN_C PVOID WINAPI XMemAlloc( 160 | _In_ SIZE_T dwSize, 161 | _In_ ULONGLONG dwAttributes); 162 | 163 | EXTERN_C void WINAPI XMemFree( 164 | _In_ PVOID lpAddress, 165 | _In_ ULONGLONG dwAttributes); 166 | 167 | typedef PVOID WINAPI XMEMALLOC_ROUTINE( 168 | _In_ SIZE_T dwSize, 169 | _In_ ULONGLONG dwAttributes); 170 | 171 | typedef XMEMALLOC_ROUTINE *PXMEMALLOC_ROUTINE, *LPXMEMALLOC_ROUTINE; 172 | 173 | typedef void WINAPI XMEMFREE_ROUTINE( 174 | _In_ PVOID lpAddress, 175 | _In_ ULONGLONG dwAttributes); 176 | 177 | typedef XMEMFREE_ROUTINE *PXMEMFREE_ROUTINE, *LPXMEMFREE_ROUTINE; 178 | 179 | EXTERN_C void WINAPI XMemSetAllocationHooks( 180 | _In_opt_ PXMEMALLOC_ROUTINE pAllocRoutine, 181 | _In_opt_ PXMEMFREE_ROUTINE pFreeRoutine); 182 | 183 | EXTERN_C void WINAPI XMemCheckDefaultHeaps(); 184 | 185 | // XMemSetAllocationHysteresis 186 | 187 | // XMemGetAllocationHysteresis 188 | 189 | // XMemPreallocateFreeSpace 190 | 191 | // XMemGetAllocationStatistics 192 | 193 | // XMemGetAuxiliaryTitleMemory 194 | 195 | // XMemReleaseAuxiliaryTitleMemory 196 | 197 | #endif /* _XBOX_ERA_ */ 198 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | [Aa][Rr][Mm]64[Ee][Cc]/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | [Oo]ut/ 34 | [Ll]og/ 35 | [Ll]ogs/ 36 | 37 | # Visual Studio 2015/2017 cache/options directory 38 | .vs/ 39 | # Uncomment if you have tasks that create the project's static files in wwwroot 40 | #wwwroot/ 41 | 42 | # Visual Studio 2017 auto generated files 43 | Generated\ Files/ 44 | 45 | # MSTest test Results 46 | [Tt]est[Rr]esult*/ 47 | [Bb]uild[Ll]og.* 48 | 49 | # NUnit 50 | *.VisualState.xml 51 | TestResult.xml 52 | nunit-*.xml 53 | 54 | # Approval Tests result files 55 | *.received.* 56 | 57 | # Build Results of an ATL Project 58 | [Dd]ebugPS/ 59 | [Rr]eleasePS/ 60 | dlldata.c 61 | 62 | # Benchmark Results 63 | BenchmarkDotNet.Artifacts/ 64 | 65 | # .NET Core 66 | project.lock.json 67 | project.fragment.lock.json 68 | artifacts/ 69 | 70 | # ASP.NET Scaffolding 71 | ScaffoldingReadMe.txt 72 | 73 | # StyleCop 74 | StyleCopReport.xml 75 | 76 | # Files built by Visual Studio 77 | *_i.c 78 | *_p.c 79 | *_h.h 80 | *.ilk 81 | *.meta 82 | *.obj 83 | *.idb 84 | *.iobj 85 | *.pch 86 | *.pdb 87 | *.ipdb 88 | *.pgc 89 | *.pgd 90 | *.rsp 91 | # but not Directory.Build.rsp, as it configures directory-level build defaults 92 | !Directory.Build.rsp 93 | *.sbr 94 | *.tlb 95 | *.tli 96 | *.tlh 97 | *.tmp 98 | *.tmp_proj 99 | *_wpftmp.csproj 100 | *.log 101 | *.tlog 102 | *.vspscc 103 | *.vssscc 104 | .builds 105 | *.pidb 106 | *.svclog 107 | *.scc 108 | 109 | # Chutzpah Test files 110 | _Chutzpah* 111 | 112 | # Visual C++ cache files 113 | ipch/ 114 | *.aps 115 | *.ncb 116 | *.opendb 117 | *.opensdf 118 | *.sdf 119 | *.cachefile 120 | *.VC.db 121 | *.VC.VC.opendb 122 | 123 | # Visual Studio profiler 124 | *.psess 125 | *.vsp 126 | *.vspx 127 | *.sap 128 | 129 | # Visual Studio Trace Files 130 | *.e2e 131 | 132 | # TFS 2012 Local Workspace 133 | $tf/ 134 | 135 | # Guidance Automation Toolkit 136 | *.gpState 137 | 138 | # ReSharper is a .NET coding add-in 139 | _ReSharper*/ 140 | *.[Rr]e[Ss]harper 141 | *.DotSettings.user 142 | 143 | # TeamCity is a build add-in 144 | _TeamCity* 145 | 146 | # DotCover is a Code Coverage Tool 147 | *.dotCover 148 | 149 | # AxoCover is a Code Coverage Tool 150 | .axoCover/* 151 | !.axoCover/settings.json 152 | 153 | # Coverlet is a free, cross platform Code Coverage Tool 154 | coverage*.json 155 | coverage*.xml 156 | coverage*.info 157 | 158 | # Visual Studio code coverage results 159 | *.coverage 160 | *.coveragexml 161 | 162 | # NCrunch 163 | _NCrunch_* 164 | .NCrunch_* 165 | .*crunch*.local.xml 166 | nCrunchTemp_* 167 | 168 | # MightyMoose 169 | *.mm.* 170 | AutoTest.Net/ 171 | 172 | # Web workbench (sass) 173 | .sass-cache/ 174 | 175 | # Installshield output folder 176 | [Ee]xpress/ 177 | 178 | # DocProject is a documentation generator add-in 179 | DocProject/buildhelp/ 180 | DocProject/Help/*.HxT 181 | DocProject/Help/*.HxC 182 | DocProject/Help/*.hhc 183 | DocProject/Help/*.hhk 184 | DocProject/Help/*.hhp 185 | DocProject/Help/Html2 186 | DocProject/Help/html 187 | 188 | # Click-Once directory 189 | publish/ 190 | 191 | # Publish Web Output 192 | *.[Pp]ublish.xml 193 | *.azurePubxml 194 | # Note: Comment the next line if you want to checkin your web deploy settings, 195 | # but database connection strings (with potential passwords) will be unencrypted 196 | *.pubxml 197 | *.publishproj 198 | 199 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 200 | # checkin your Azure Web App publish settings, but sensitive information contained 201 | # in these scripts will be unencrypted 202 | PublishScripts/ 203 | 204 | # NuGet Packages 205 | *.nupkg 206 | # NuGet Symbol Packages 207 | *.snupkg 208 | # The packages folder can be ignored because of Package Restore 209 | **/[Pp]ackages/* 210 | # except build/, which is used as an MSBuild target. 211 | !**/[Pp]ackages/build/ 212 | # Uncomment if necessary however generally it will be regenerated when needed 213 | #!**/[Pp]ackages/repositories.config 214 | # NuGet v3's project.json files produces more ignorable files 215 | *.nuget.props 216 | *.nuget.targets 217 | 218 | # Microsoft Azure Build Output 219 | csx/ 220 | *.build.csdef 221 | 222 | # Microsoft Azure Emulator 223 | ecf/ 224 | rcf/ 225 | 226 | # Windows Store app package directories and files 227 | AppPackages/ 228 | BundleArtifacts/ 229 | Package.StoreAssociation.xml 230 | _pkginfo.txt 231 | *.appx 232 | *.appxbundle 233 | *.appxupload 234 | 235 | # Visual Studio cache files 236 | # files ending in .cache can be ignored 237 | *.[Cc]ache 238 | # but keep track of directories ending in .cache 239 | !?*.[Cc]ache/ 240 | 241 | # Others 242 | ClientBin/ 243 | ~$* 244 | *~ 245 | *.dbmdl 246 | *.dbproj.schemaview 247 | *.jfm 248 | *.pfx 249 | *.publishsettings 250 | orleans.codegen.cs 251 | 252 | # Including strong name files can present a security risk 253 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 254 | #*.snk 255 | 256 | # Since there are multiple workflows, uncomment next line to ignore bower_components 257 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 258 | #bower_components/ 259 | 260 | # RIA/Silverlight projects 261 | Generated_Code/ 262 | 263 | # Backup & report files from converting an old project file 264 | # to a newer Visual Studio version. Backup files are not needed, 265 | # because we have git ;-) 266 | _UpgradeReport_Files/ 267 | Backup*/ 268 | UpgradeLog*.XML 269 | UpgradeLog*.htm 270 | ServiceFabricBackup/ 271 | *.rptproj.bak 272 | 273 | # SQL Server files 274 | *.mdf 275 | *.ldf 276 | *.ndf 277 | 278 | # Business Intelligence projects 279 | *.rdl.data 280 | *.bim.layout 281 | *.bim_*.settings 282 | *.rptproj.rsuser 283 | *- [Bb]ackup.rdl 284 | *- [Bb]ackup ([0-9]).rdl 285 | *- [Bb]ackup ([0-9][0-9]).rdl 286 | 287 | # Microsoft Fakes 288 | FakesAssemblies/ 289 | 290 | # GhostDoc plugin setting file 291 | *.GhostDoc.xml 292 | 293 | # Node.js Tools for Visual Studio 294 | .ntvs_analysis.dat 295 | node_modules/ 296 | 297 | # Visual Studio 6 build log 298 | *.plg 299 | 300 | # Visual Studio 6 workspace options file 301 | *.opt 302 | 303 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 304 | *.vbw 305 | 306 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 307 | *.vbp 308 | 309 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 310 | *.dsw 311 | *.dsp 312 | 313 | # Visual Studio 6 technical files 314 | *.ncb 315 | *.aps 316 | 317 | # Visual Studio LightSwitch build output 318 | **/*.HTMLClient/GeneratedArtifacts 319 | **/*.DesktopClient/GeneratedArtifacts 320 | **/*.DesktopClient/ModelManifest.xml 321 | **/*.Server/GeneratedArtifacts 322 | **/*.Server/ModelManifest.xml 323 | _Pvt_Extensions 324 | 325 | # Paket dependency manager 326 | .paket/paket.exe 327 | paket-files/ 328 | 329 | # FAKE - F# Make 330 | .fake/ 331 | 332 | # CodeRush personal settings 333 | .cr/personal 334 | 335 | # Python Tools for Visual Studio (PTVS) 336 | __pycache__/ 337 | *.pyc 338 | 339 | # Cake - Uncomment if you are using it 340 | # tools/** 341 | # !tools/packages.config 342 | 343 | # Tabs Studio 344 | *.tss 345 | 346 | # Telerik's JustMock configuration file 347 | *.jmconfig 348 | 349 | # BizTalk build output 350 | *.btp.cs 351 | *.btm.cs 352 | *.odx.cs 353 | *.xsd.cs 354 | 355 | # OpenCover UI analysis results 356 | OpenCover/ 357 | 358 | # Azure Stream Analytics local run output 359 | ASALocalRun/ 360 | 361 | # MSBuild Binary and Structured Log 362 | *.binlog 363 | 364 | # AWS SAM Build and Temporary Artifacts folder 365 | .aws-sam 366 | 367 | # NVidia Nsight GPU debugger configuration file 368 | *.nvuser 369 | 370 | # MFractors (Xamarin productivity tool) working folder 371 | .mfractor/ 372 | 373 | # Local History for Visual Studio 374 | .localhistory/ 375 | 376 | # Visual Studio History (VSHistory) files 377 | .vshistory/ 378 | 379 | # BeatPulse healthcheck temp database 380 | healthchecksdb 381 | 382 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 383 | MigrationBackup/ 384 | 385 | # Ionide (cross platform F# VS Code tools) working folder 386 | .ionide/ 387 | 388 | # Fody - auto-generated XML schema 389 | FodyWeavers.xsd 390 | 391 | # VS Code files for those working on multiple tools 392 | .vscode/* 393 | !.vscode/settings.json 394 | !.vscode/tasks.json 395 | !.vscode/launch.json 396 | !.vscode/extensions.json 397 | *.code-workspace 398 | 399 | # Local History for Visual Studio Code 400 | .history/ 401 | 402 | # Windows Installer files from build outputs 403 | *.cab 404 | *.msi 405 | *.msix 406 | *.msm 407 | *.msp 408 | -------------------------------------------------------------------------------- /combase.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Exports 3 | // 4 | #pragma comment(linker, "/export:WinRTNotifyChangedStore=C:\\Windows\\System32\\combase.#1,@1,NONAME") 5 | #pragma comment(linker, "/export:ObjectStublessClient3=C:\\Windows\\System32\\combase.ObjectStublessClient3") 6 | #pragma comment(linker, "/export:ObjectStublessClient4=C:\\Windows\\System32\\combase.ObjectStublessClient4") 7 | #pragma comment(linker, "/export:ObjectStublessClient5=C:\\Windows\\System32\\combase.ObjectStublessClient5") 8 | #pragma comment(linker, "/export:ObjectStublessClient6=C:\\Windows\\System32\\combase.ObjectStublessClient6") 9 | #pragma comment(linker, "/export:ObjectStublessClient7=C:\\Windows\\System32\\combase.ObjectStublessClient7") 10 | #pragma comment(linker, "/export:ObjectStublessClient8=C:\\Windows\\System32\\combase.ObjectStublessClient8") 11 | #pragma comment(linker, "/export:ObjectStublessClient9=C:\\Windows\\System32\\combase.ObjectStublessClient9") 12 | #pragma comment(linker, "/export:ObjectStublessClient10=C:\\Windows\\System32\\combase.ObjectStublessClient10") 13 | #pragma comment(linker, "/export:ObjectStublessClient11=C:\\Windows\\System32\\combase.ObjectStublessClient11") 14 | #pragma comment(linker, "/export:ObjectStublessClient12=C:\\Windows\\System32\\combase.ObjectStublessClient12") 15 | #pragma comment(linker, "/export:ObjectStublessClient13=C:\\Windows\\System32\\combase.ObjectStublessClient13") 16 | #pragma comment(linker, "/export:ObjectStublessClient14=C:\\Windows\\System32\\combase.ObjectStublessClient14") 17 | #pragma comment(linker, "/export:ObjectStublessClient15=C:\\Windows\\System32\\combase.ObjectStublessClient15") 18 | #pragma comment(linker, "/export:ObjectStublessClient16=C:\\Windows\\System32\\combase.ObjectStublessClient16") 19 | #pragma comment(linker, "/export:ObjectStublessClient17=C:\\Windows\\System32\\combase.ObjectStublessClient17") 20 | #pragma comment(linker, "/export:ObjectStublessClient18=C:\\Windows\\System32\\combase.ObjectStublessClient18") 21 | #pragma comment(linker, "/export:ObjectStublessClient19=C:\\Windows\\System32\\combase.ObjectStublessClient19") 22 | #pragma comment(linker, "/export:ObjectStublessClient20=C:\\Windows\\System32\\combase.ObjectStublessClient20") 23 | #pragma comment(linker, "/export:ObjectStublessClient21=C:\\Windows\\System32\\combase.ObjectStublessClient21") 24 | #pragma comment(linker, "/export:ObjectStublessClient22=C:\\Windows\\System32\\combase.ObjectStublessClient22") 25 | #pragma comment(linker, "/export:ObjectStublessClient23=C:\\Windows\\System32\\combase.ObjectStublessClient23") 26 | #pragma comment(linker, "/export:ObjectStublessClient24=C:\\Windows\\System32\\combase.ObjectStublessClient24") 27 | #pragma comment(linker, "/export:ObjectStublessClient25=C:\\Windows\\System32\\combase.ObjectStublessClient25") 28 | #pragma comment(linker, "/export:ObjectStublessClient26=C:\\Windows\\System32\\combase.ObjectStublessClient26") 29 | #pragma comment(linker, "/export:ObjectStublessClient27=C:\\Windows\\System32\\combase.ObjectStublessClient27") 30 | #pragma comment(linker, "/export:ObjectStublessClient28=C:\\Windows\\System32\\combase.ObjectStublessClient28") 31 | #pragma comment(linker, "/export:ObjectStublessClient29=C:\\Windows\\System32\\combase.ObjectStublessClient29") 32 | #pragma comment(linker, "/export:ObjectStublessClient30=C:\\Windows\\System32\\combase.ObjectStublessClient30") 33 | #pragma comment(linker, "/export:ObjectStublessClient31=C:\\Windows\\System32\\combase.ObjectStublessClient31") 34 | #pragma comment(linker, "/export:ObjectStublessClient32=C:\\Windows\\System32\\combase.ObjectStublessClient32") 35 | #pragma comment(linker, "/export:NdrProxyForwardingFunction3=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction3") 36 | #pragma comment(linker, "/export:NdrProxyForwardingFunction4=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction4") 37 | #pragma comment(linker, "/export:NdrProxyForwardingFunction5=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction5") 38 | #pragma comment(linker, "/export:NdrProxyForwardingFunction6=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction6") 39 | #pragma comment(linker, "/export:NdrProxyForwardingFunction7=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction7") 40 | #pragma comment(linker, "/export:NdrProxyForwardingFunction8=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction8") 41 | #pragma comment(linker, "/export:NdrProxyForwardingFunction9=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction9") 42 | #pragma comment(linker, "/export:NdrProxyForwardingFunction10=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction10") 43 | #pragma comment(linker, "/export:NdrProxyForwardingFunction11=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction11") 44 | #pragma comment(linker, "/export:NdrProxyForwardingFunction12=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction12") 45 | #pragma comment(linker, "/export:NdrProxyForwardingFunction13=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction13") 46 | #pragma comment(linker, "/export:NdrProxyForwardingFunction14=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction14") 47 | #pragma comment(linker, "/export:NdrProxyForwardingFunction15=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction15") 48 | #pragma comment(linker, "/export:NdrProxyForwardingFunction16=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction16") 49 | #pragma comment(linker, "/export:NdrProxyForwardingFunction17=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction17") 50 | #pragma comment(linker, "/export:NdrProxyForwardingFunction18=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction18") 51 | #pragma comment(linker, "/export:NdrProxyForwardingFunction19=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction19") 52 | #pragma comment(linker, "/export:NdrProxyForwardingFunction20=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction20") 53 | #pragma comment(linker, "/export:NdrProxyForwardingFunction21=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction21") 54 | #pragma comment(linker, "/export:NdrProxyForwardingFunction22=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction22") 55 | #pragma comment(linker, "/export:NdrProxyForwardingFunction23=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction23") 56 | #pragma comment(linker, "/export:NdrProxyForwardingFunction24=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction24") 57 | #pragma comment(linker, "/export:NdrProxyForwardingFunction25=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction25") 58 | #pragma comment(linker, "/export:NdrProxyForwardingFunction26=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction26") 59 | #pragma comment(linker, "/export:NdrProxyForwardingFunction27=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction27") 60 | #pragma comment(linker, "/export:NdrProxyForwardingFunction28=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction28") 61 | #pragma comment(linker, "/export:NdrProxyForwardingFunction29=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction29") 62 | #pragma comment(linker, "/export:NdrProxyForwardingFunction30=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction30") 63 | #pragma comment(linker, "/export:NdrProxyForwardingFunction31=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction31") 64 | #pragma comment(linker, "/export:NdrProxyForwardingFunction32=C:\\Windows\\System32\\combase.NdrProxyForwardingFunction32") 65 | #pragma comment(linker, "/export:NdrOleInitializeExtension=C:\\Windows\\System32\\combase.NdrOleInitializeExtension") 66 | #pragma comment(linker, "/export:GetStringRefCount=C:\\Windows\\System32\\combase.#63,@63,NONAME") 67 | #pragma comment(linker, "/export:GetStringCount=C:\\Windows\\System32\\combase.#64,@64,NONAME") 68 | #pragma comment(linker, "/export:RoGetExtensionRegistration=C:\\Windows\\System32\\combase.#65,@65,NONAME") 69 | #pragma comment(linker, "/export:CoGetSharedServiceId=C:\\Windows\\System32\\combase.#66,@66,NONAME") 70 | #pragma comment(linker, "/export:CoAddRefSharedService=C:\\Windows\\System32\\combase.#67,@67,NONAME") 71 | #pragma comment(linker, "/export:CoReleaseSharedService=C:\\Windows\\System32\\combase.#68,@68,NONAME") 72 | #pragma comment(linker, "/export:CoRegisterServerShutdownDelay=C:\\Windows\\System32\\combase.#69,@69,NONAME") 73 | #pragma comment(linker, "/export:CoGetMTAUsageInfo=C:\\Windows\\System32\\combase.#70,@70,NONAME") 74 | #pragma comment(linker, "/export:CoWaitMTACompletion=C:\\Windows\\System32\\combase.#71,@71,NONAME") 75 | #pragma comment(linker, "/export:CLSIDFromProgID=C:\\Windows\\System32\\combase.CLSIDFromProgID") 76 | #pragma comment(linker, "/export:CLSIDFromString=C:\\Windows\\System32\\combase.CLSIDFromString") 77 | #pragma comment(linker, "/export:CoAddRefServerProcess=C:\\Windows\\System32\\combase.CoAddRefServerProcess") 78 | #pragma comment(linker, "/export:CoAllowUnmarshalerCLSID=C:\\Windows\\System32\\combase.CoAllowUnmarshalerCLSID") 79 | #pragma comment(linker, "/export:CoCancelCall=C:\\Windows\\System32\\combase.CoCancelCall") 80 | #pragma comment(linker, "/export:CoCreateFreeThreadedMarshaler=C:\\Windows\\System32\\combase.CoCreateFreeThreadedMarshaler") 81 | #pragma comment(linker, "/export:CoCreateGuid=C:\\Windows\\System32\\combase.CoCreateGuid") 82 | #pragma comment(linker, "/export:RoGetExtensionRegistrationByExtensionId=C:\\Windows\\System32\\combase.#79,@79,NONAME") 83 | #pragma comment(linker, "/export:CoCreateInstance=C:\\Windows\\System32\\combase.CoCreateInstance") 84 | #pragma comment(linker, "/export:CoCreateInstanceEx=C:\\Windows\\System32\\combase.CoCreateInstanceEx") 85 | #pragma comment(linker, "/export:CoCreateInstanceFromApp=C:\\Windows\\System32\\combase.CoCreateInstanceFromApp") 86 | #pragma comment(linker, "/export:CoDecodeProxy=C:\\Windows\\System32\\combase.CoDecodeProxy") 87 | #pragma comment(linker, "/export:CoDecrementMTAUsage=C:\\Windows\\System32\\combase.CoDecrementMTAUsage") 88 | #pragma comment(linker, "/export:CoDisableCallCancellation=C:\\Windows\\System32\\combase.CoDisableCallCancellation") 89 | #pragma comment(linker, "/export:CoBeginProcessEvents=C:\\Windows\\System32\\combase.#86,@86,NONAME") 90 | #pragma comment(linker, "/export:CoMsgWaitInProcessEvents=C:\\Windows\\System32\\combase.#87,@87,NONAME") 91 | #pragma comment(linker, "/export:CoEndProcessEvents=C:\\Windows\\System32\\combase.#88,@88,NONAME") 92 | #pragma comment(linker, "/export:CoDisconnectContext=C:\\Windows\\System32\\combase.CoDisconnectContext") 93 | #pragma comment(linker, "/export:CoDisconnectObject=C:\\Windows\\System32\\combase.CoDisconnectObject") 94 | #pragma comment(linker, "/export:CoEnableCallCancellation=C:\\Windows\\System32\\combase.CoEnableCallCancellation") 95 | #pragma comment(linker, "/export:CoSetASTAQueuedCallTimeout=C:\\Windows\\System32\\combase.#92,@92,NONAME") 96 | #pragma comment(linker, "/export:NdrOleGetComMarshalingContextAttribute=C:\\Windows\\System32\\combase.#93,@93,NONAME") 97 | #pragma comment(linker, "/export:CoFreeUnusedLibraries=C:\\Windows\\System32\\combase.CoFreeUnusedLibraries") 98 | #pragma comment(linker, "/export:CoSignalPendingGitRegistrationWaits=C:\\Windows\\System32\\combase.#95,@95,NONAME") 99 | #pragma comment(linker, "/export:CoFreeUnusedLibrariesEx=C:\\Windows\\System32\\combase.CoFreeUnusedLibrariesEx") 100 | #pragma comment(linker, "/export:CoIsHandlingIncomingTouchedASTACall=C:\\Windows\\System32\\combase.#97,@97,NONAME") 101 | #pragma comment(linker, "/export:CoSetRetryForReentrancyGuardTimeout=C:\\Windows\\System32\\combase.#98,@98,NONAME") 102 | #pragma comment(linker, "/export:CoGetApartmentType=C:\\Windows\\System32\\combase.CoGetApartmentType") 103 | #pragma comment(linker, "/export:CoSetASTATestMode=C:\\Windows\\System32\\combase.#100,@100,NONAME") 104 | #pragma comment(linker, "/export:CoGetCallerTID=C:\\Windows\\System32\\combase.CoGetCallerTID") 105 | #pragma comment(linker, "/export:CoGetCancelObject=C:\\Windows\\System32\\combase.CoGetCancelObject") 106 | #pragma comment(linker, "/export:CoGetClassObject=C:\\Windows\\System32\\combase.CoGetClassObject") 107 | #pragma comment(linker, "/export:CoGetContextToken=C:\\Windows\\System32\\combase.CoGetContextToken") 108 | #pragma comment(linker, "/export:CoGetCurrentLogicalThreadId=C:\\Windows\\System32\\combase.CoGetCurrentLogicalThreadId") 109 | #pragma comment(linker, "/export:CoGetCurrentProcess=C:\\Windows\\System32\\combase.CoGetCurrentProcess") 110 | #pragma comment(linker, "/export:CoGetDefaultContext=C:\\Windows\\System32\\combase.CoGetDefaultContext") 111 | #pragma comment(linker, "/export:CoGetInterfaceAndReleaseStream=C:\\Windows\\System32\\combase.CoGetInterfaceAndReleaseStream") 112 | #pragma comment(linker, "/export:CoGetMalloc=C:\\Windows\\System32\\combase.CoGetMalloc") 113 | #pragma comment(linker, "/export:CoSetMessageDispatcher=C:\\Windows\\System32\\combase.#110,@110,NONAME") 114 | #pragma comment(linker, "/export:CoHandlePriorityEventsFromMessagePump=C:\\Windows\\System32\\combase.#111,@111,NONAME") 115 | #pragma comment(linker, "/export:CoRegisterChannelHook=C:\\Windows\\System32\\combase.#112,@112,NONAME") 116 | #pragma comment(linker, "/export:CoGetMarshalSizeMax=C:\\Windows\\System32\\combase.CoGetMarshalSizeMax") 117 | #pragma comment(linker, "/export:CoGetObjectContext=C:\\Windows\\System32\\combase.CoGetObjectContext") 118 | #pragma comment(linker, "/export:CoGetPSClsid=C:\\Windows\\System32\\combase.CoGetPSClsid") 119 | #pragma comment(linker, "/export:CoGetStandardMarshal=C:\\Windows\\System32\\combase.CoGetStandardMarshal") 120 | #pragma comment(linker, "/export:CoGetStdMarshalEx=C:\\Windows\\System32\\combase.CoGetStdMarshalEx") 121 | #pragma comment(linker, "/export:CoGetTreatAsClass=C:\\Windows\\System32\\combase.CoGetTreatAsClass") 122 | #pragma comment(linker, "/export:CoIncrementMTAUsage=C:\\Windows\\System32\\combase.CoIncrementMTAUsage") 123 | #pragma comment(linker, "/export:CoRegisterForApartmentShutdown=C:\\Windows\\System32\\combase.#120,@120,NONAME") 124 | #pragma comment(linker, "/export:CoUnregisterForApartmentShutdown=C:\\Windows\\System32\\combase.#121,@121,NONAME") 125 | #pragma comment(linker, "/export:CoGetApartmentIdentifier=C:\\Windows\\System32\\combase.#122,@122,NONAME") 126 | #pragma comment(linker, "/export:CoInitializeEx=C:\\Windows\\System32\\combase.CoInitializeEx") 127 | #pragma comment(linker, "/export:CoInvalidateRemoteMachineBindings=C:\\Windows\\System32\\combase.CoInvalidateRemoteMachineBindings") 128 | #pragma comment(linker, "/export:CoIsHandlerConnected=C:\\Windows\\System32\\combase.CoIsHandlerConnected") 129 | #pragma comment(linker, "/export:CoLockObjectExternal=C:\\Windows\\System32\\combase.CoLockObjectExternal") 130 | #pragma comment(linker, "/export:CoMarshalHresult=C:\\Windows\\System32\\combase.CoMarshalHresult") 131 | #pragma comment(linker, "/export:CoMarshalInterThreadInterfaceInStream=C:\\Windows\\System32\\combase.CoMarshalInterThreadInterfaceInStream") 132 | #pragma comment(linker, "/export:CoMarshalInterface=C:\\Windows\\System32\\combase.CoMarshalInterface") 133 | #pragma comment(linker, "/export:CoRegisterClassObject=C:\\Windows\\System32\\combase.CoRegisterClassObject") 134 | #pragma comment(linker, "/export:CoRegisterPSClsid=C:\\Windows\\System32\\combase.CoRegisterPSClsid") 135 | #pragma comment(linker, "/export:CoReleaseMarshalData=C:\\Windows\\System32\\combase.CoReleaseMarshalData") 136 | #pragma comment(linker, "/export:CoReleaseServerProcess=C:\\Windows\\System32\\combase.CoReleaseServerProcess") 137 | #pragma comment(linker, "/export:CoResumeClassObjects=C:\\Windows\\System32\\combase.CoResumeClassObjects") 138 | #pragma comment(linker, "/export:CoRevokeClassObject=C:\\Windows\\System32\\combase.CoRevokeClassObject") 139 | #pragma comment(linker, "/export:CoSetCancelObject=C:\\Windows\\System32\\combase.CoSetCancelObject") 140 | #pragma comment(linker, "/export:CoSuspendClassObjects=C:\\Windows\\System32\\combase.CoSuspendClassObjects") 141 | #pragma comment(linker, "/export:CoTaskMemAlloc=C:\\Windows\\System32\\combase.CoTaskMemAlloc") 142 | #pragma comment(linker, "/export:CoTaskMemFree=C:\\Windows\\System32\\combase.CoTaskMemFree") 143 | #pragma comment(linker, "/export:CoTaskMemRealloc=C:\\Windows\\System32\\combase.CoTaskMemRealloc") 144 | #pragma comment(linker, "/export:CoUninitialize=C:\\Windows\\System32\\combase.CoUninitialize") 145 | #pragma comment(linker, "/export:CoUnmarshalHresult=C:\\Windows\\System32\\combase.CoUnmarshalHresult") 146 | #pragma comment(linker, "/export:CoUnmarshalInterface=C:\\Windows\\System32\\combase.CoUnmarshalInterface") 147 | #pragma comment(linker, "/export:CoWaitForMultipleHandles=C:\\Windows\\System32\\combase.CoWaitForMultipleHandles") 148 | #pragma comment(linker, "/export:CoWaitForMultipleObjects=C:\\Windows\\System32\\combase.CoWaitForMultipleObjects") 149 | #pragma comment(linker, "/export:CreateErrorInfo=C:\\Windows\\System32\\combase.CreateErrorInfo") 150 | #pragma comment(linker, "/export:CreateStreamOnHGlobal=C:\\Windows\\System32\\combase.CreateStreamOnHGlobal") 151 | #pragma comment(linker, "/export:DcomChannelSetHResult=C:\\Windows\\System32\\combase.DcomChannelSetHResult") 152 | #pragma comment(linker, "/export:DllGetActivationFactory=C:\\Windows\\System32\\combase.DllGetActivationFactory") 153 | #pragma comment(linker, "/export:DllGetClassObject=C:\\Windows\\System32\\combase.DllGetClassObject,PRIVATE") 154 | #pragma comment(linker, "/export:FreePropVariantArray=C:\\Windows\\System32\\combase.FreePropVariantArray") 155 | #pragma comment(linker, "/export:GetErrorInfo=C:\\Windows\\System32\\combase.GetErrorInfo") 156 | #pragma comment(linker, "/export:GetHGlobalFromStream=C:\\Windows\\System32\\combase.GetHGlobalFromStream") 157 | #pragma comment(linker, "/export:GetRestrictedErrorInfo=C:\\Windows\\System32\\combase.GetRestrictedErrorInfo") 158 | #pragma comment(linker, "/export:HSTRING_UserFree=C:\\Windows\\System32\\combase.HSTRING_UserFree") 159 | #pragma comment(linker, "/export:HSTRING_UserFree64=C:\\Windows\\System32\\combase.HSTRING_UserFree64") 160 | #pragma comment(linker, "/export:HSTRING_UserMarshal=C:\\Windows\\System32\\combase.HSTRING_UserMarshal") 161 | #pragma comment(linker, "/export:HSTRING_UserMarshal64=C:\\Windows\\System32\\combase.HSTRING_UserMarshal64") 162 | #pragma comment(linker, "/export:HSTRING_UserSize=C:\\Windows\\System32\\combase.HSTRING_UserSize") 163 | #pragma comment(linker, "/export:HSTRING_UserSize64=C:\\Windows\\System32\\combase.HSTRING_UserSize64") 164 | #pragma comment(linker, "/export:HSTRING_UserUnmarshal=C:\\Windows\\System32\\combase.HSTRING_UserUnmarshal") 165 | #pragma comment(linker, "/export:HSTRING_UserUnmarshal64=C:\\Windows\\System32\\combase.HSTRING_UserUnmarshal64") 166 | #pragma comment(linker, "/export:IIDFromString=C:\\Windows\\System32\\combase.IIDFromString") 167 | #pragma comment(linker, "/export:ProgIDFromCLSID=C:\\Windows\\System32\\combase.ProgIDFromCLSID") 168 | #pragma comment(linker, "/export:PropVariantClear=C:\\Windows\\System32\\combase.PropVariantClear") 169 | #pragma comment(linker, "/export:PropVariantCopy=C:\\Windows\\System32\\combase.PropVariantCopy") 170 | #pragma comment(linker, "/export:RoActivateInstance=C:\\Windows\\System32\\combase.RoActivateInstance") 171 | #pragma comment(linker, "/export:RoCaptureErrorContext=C:\\Windows\\System32\\combase.RoCaptureErrorContext") 172 | #pragma comment(linker, "/export:RoFailFastWithErrorContext=C:\\Windows\\System32\\combase.RoFailFastWithErrorContext") 173 | #pragma comment(linker, "/export:RoGetActivatableClassRegistration=C:\\Windows\\System32\\combase.RoGetActivatableClassRegistration") 174 | #pragma comment(linker, "/export:RoGetActivationFactory=C:\\Windows\\System32\\combase.RoGetActivationFactory") 175 | #pragma comment(linker, "/export:RoGetApartmentIdentifier=C:\\Windows\\System32\\combase.RoGetApartmentIdentifier") 176 | #pragma comment(linker, "/export:RoGetErrorReportingFlags=C:\\Windows\\System32\\combase.RoGetErrorReportingFlags") 177 | #pragma comment(linker, "/export:RoGetServerActivatableClasses=C:\\Windows\\System32\\combase.RoGetServerActivatableClasses") 178 | #pragma comment(linker, "/export:RoInitialize=C:\\Windows\\System32\\combase.RoInitialize") 179 | #pragma comment(linker, "/export:RoOriginateError=C:\\Windows\\System32\\combase.RoOriginateError") 180 | #pragma comment(linker, "/export:RoOriginateErrorW=C:\\Windows\\System32\\combase.RoOriginateErrorW") 181 | #pragma comment(linker, "/export:RoRegisterActivationFactories=C:\\Windows\\System32\\combase.RoRegisterActivationFactories") 182 | #pragma comment(linker, "/export:RoRegisterForApartmentShutdown=C:\\Windows\\System32\\combase.RoRegisterForApartmentShutdown") 183 | #pragma comment(linker, "/export:RoReportUnhandledError=C:\\Windows\\System32\\combase.RoReportUnhandledError") 184 | #pragma comment(linker, "/export:RoResolveRestrictedErrorInfoReference=C:\\Windows\\System32\\combase.RoResolveRestrictedErrorInfoReference") 185 | #pragma comment(linker, "/export:RoRevokeActivationFactories=C:\\Windows\\System32\\combase.RoRevokeActivationFactories") 186 | #pragma comment(linker, "/export:RoSetErrorReportingFlags=C:\\Windows\\System32\\combase.RoSetErrorReportingFlags") 187 | #pragma comment(linker, "/export:RoTransformError=C:\\Windows\\System32\\combase.RoTransformError") 188 | #pragma comment(linker, "/export:RoTransformErrorW=C:\\Windows\\System32\\combase.RoTransformErrorW") 189 | #pragma comment(linker, "/export:RoUninitialize=C:\\Windows\\System32\\combase.RoUninitialize") 190 | #pragma comment(linker, "/export:RoUnregisterForApartmentShutdown=C:\\Windows\\System32\\combase.RoUnregisterForApartmentShutdown") 191 | #pragma comment(linker, "/export:SetErrorInfo=C:\\Windows\\System32\\combase.SetErrorInfo") 192 | #pragma comment(linker, "/export:SetRestrictedErrorInfo=C:\\Windows\\System32\\combase.SetRestrictedErrorInfo") 193 | #pragma comment(linker, "/export:StringFromCLSID=C:\\Windows\\System32\\combase.StringFromCLSID") 194 | #pragma comment(linker, "/export:StringFromGUID2=C:\\Windows\\System32\\combase.StringFromGUID2") 195 | #pragma comment(linker, "/export:StringFromIID=C:\\Windows\\System32\\combase.StringFromIID") 196 | #pragma comment(linker, "/export:SysAllocString=oleaut32.SysAllocString") 197 | #pragma comment(linker, "/export:SysAllocStringLen=oleaut32.SysAllocStringLen") 198 | #pragma comment(linker, "/export:SysFreeString=oleaut32.SysFreeString") 199 | #pragma comment(linker, "/export:SysStringByteLen=oleaut32.SysStringByteLen") 200 | #pragma comment(linker, "/export:SysStringLen=oleaut32.SysStringLen") 201 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserMarshal=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserMarshal") 202 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserMarshal64=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserMarshal64") 203 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserSize=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserSize") 204 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserSize64=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserSize64") 205 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserUnmarshal=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserUnmarshal") 206 | #pragma comment(linker, "/export:WdtpInterfacePointer_UserUnmarshal64=C:\\Windows\\System32\\combase.WdtpInterfacePointer_UserUnmarshal64") 207 | #pragma comment(linker, "/export:WindowsCompareStringOrdinal=C:\\Windows\\System32\\combase.WindowsCompareStringOrdinal") 208 | #pragma comment(linker, "/export:WindowsConcatString=C:\\Windows\\System32\\combase.WindowsConcatString") 209 | #pragma comment(linker, "/export:WindowsCreateString=C:\\Windows\\System32\\combase.WindowsCreateString") 210 | #pragma comment(linker, "/export:WindowsCreateStringReference=C:\\Windows\\System32\\combase.WindowsCreateStringReference") 211 | #pragma comment(linker, "/export:WindowsDeleteString=C:\\Windows\\System32\\combase.WindowsDeleteString") 212 | #pragma comment(linker, "/export:WindowsDeleteStringBuffer=C:\\Windows\\System32\\combase.WindowsDeleteStringBuffer") 213 | #pragma comment(linker, "/export:WindowsDuplicateString=C:\\Windows\\System32\\combase.WindowsDuplicateString") 214 | #pragma comment(linker, "/export:WindowsGetStringLen=C:\\Windows\\System32\\combase.WindowsGetStringLen") 215 | #pragma comment(linker, "/export:WindowsGetStringRawBuffer=C:\\Windows\\System32\\combase.WindowsGetStringRawBuffer") 216 | #pragma comment(linker, "/export:WindowsInspectString=C:\\Windows\\System32\\combase.WindowsInspectString") 217 | #pragma comment(linker, "/export:WindowsIsStringEmpty=C:\\Windows\\System32\\combase.WindowsIsStringEmpty") 218 | #pragma comment(linker, "/export:WindowsPreallocateStringBuffer=C:\\Windows\\System32\\combase.WindowsPreallocateStringBuffer") 219 | #pragma comment(linker, "/export:WindowsPromoteStringBuffer=C:\\Windows\\System32\\combase.WindowsPromoteStringBuffer") 220 | #pragma comment(linker, "/export:WindowsReplaceString=C:\\Windows\\System32\\combase.WindowsReplaceString") 221 | #pragma comment(linker, "/export:WindowsStringHasEmbeddedNull=C:\\Windows\\System32\\combase.WindowsStringHasEmbeddedNull") 222 | #pragma comment(linker, "/export:WindowsSubstring=C:\\Windows\\System32\\combase.WindowsSubstring") 223 | #pragma comment(linker, "/export:WindowsSubstringWithSpecifiedLength=C:\\Windows\\System32\\combase.WindowsSubstringWithSpecifiedLength") 224 | #pragma comment(linker, "/export:WindowsTrimStringEnd=C:\\Windows\\System32\\combase.WindowsTrimStringEnd") 225 | #pragma comment(linker, "/export:WindowsTrimStringStart=C:\\Windows\\System32\\combase.WindowsTrimStringStart") 226 | -------------------------------------------------------------------------------- /kernelx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | // 6 | // Helpers 7 | // 8 | static DWORD WIN32_FROM_HRESULT(_In_ HRESULT hr) 9 | { 10 | if (SUCCEEDED(hr)) 11 | return ERROR_SUCCESS; 12 | 13 | return HRESULT_FACILITY(hr) == FACILITY_WIN32 ? HRESULT_CODE(hr) : hr; 14 | } 15 | 16 | // 17 | // General APIs 18 | // 19 | EXTERN_C CONSOLE_TYPE WINAPI GetConsoleType() 20 | { 21 | return CONSOLE_TYPE_XBOX_ONE; 22 | } 23 | 24 | EXTERN_C VOID WINAPI GetSystemOSVersion(_Out_ LPSYSTEMOSVERSIONINFO lpVersionInformation) 25 | { 26 | OSVERSIONINFOW VersionInformation = { sizeof(VersionInformation) }; 27 | GetVersionExW(&VersionInformation); 28 | lpVersionInformation->MajorVersion = (BYTE)VersionInformation.dwMajorVersion; 29 | lpVersionInformation->MinorVersion = (BYTE)VersionInformation.dwMinorVersion; 30 | lpVersionInformation->BuildNumber = (WORD)VersionInformation.dwBuildNumber; 31 | 32 | DWORD dwRevisionNumber; 33 | DWORD dwDataSize = sizeof(dwRevisionNumber); 34 | 35 | if (RegGetValueW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", L"UBR", RRF_RT_REG_DWORD, nullptr, &dwRevisionNumber, &dwDataSize) != ERROR_SUCCESS) 36 | dwRevisionNumber = 0; 37 | 38 | lpVersionInformation->Revision = (WORD)dwRevisionNumber; 39 | } 40 | 41 | EXTERN_C VOID WINAPI QueryProcessorSchedulingStatistics(_Out_ PPROCESSOR_SCHEDULING_STATISTICS lpStatistics) 42 | { 43 | LARGE_INTEGER Frequency, Counter; 44 | FILETIME IdleTime, KernelTime, UserTime; 45 | 46 | QueryPerformanceFrequency(&Frequency); 47 | QueryPerformanceCounter(&Counter); 48 | lpStatistics->GlobalTime = Counter.QuadPart / (Frequency.QuadPart / 10000000ULL); 49 | 50 | if (GetSystemTimes(&IdleTime, &KernelTime, &UserTime)) 51 | { 52 | ULARGE_INTEGER IdleTime64 = { IdleTime.dwLowDateTime, IdleTime.dwHighDateTime }; 53 | ULARGE_INTEGER KernelTime64 = { KernelTime.dwLowDateTime, KernelTime.dwHighDateTime }; 54 | ULARGE_INTEGER UserTime64 = { UserTime.dwLowDateTime, UserTime.dwHighDateTime }; 55 | lpStatistics->RunningTime = (KernelTime64.QuadPart - IdleTime64.QuadPart) + UserTime64.QuadPart; 56 | lpStatistics->IdleTime = IdleTime64.QuadPart; 57 | } 58 | else 59 | { 60 | lpStatistics->RunningTime = 0; 61 | lpStatistics->IdleTime = 0; 62 | } 63 | } 64 | 65 | EXTERN_C BOOL WINAPI SetThreadpoolAffinityMask(_Inout_ PTP_POOL Pool, _In_ DWORD_PTR dwThreadAffinityMask) 66 | { 67 | UNREFERENCED_PARAMETER(Pool); 68 | UNREFERENCED_PARAMETER(dwThreadAffinityMask); 69 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 70 | return FALSE; 71 | } 72 | 73 | EXTERN_C BOOL WINAPI SetThreadName(_In_ HANDLE hThread, _In_ PCWSTR lpThreadName) 74 | { 75 | HRESULT hr = SetThreadDescription(hThread, lpThreadName); 76 | SetLastError(WIN32_FROM_HRESULT(hr)); 77 | return SUCCEEDED(hr); 78 | } 79 | 80 | EXTERN_C BOOL WINAPI GetThreadName(_In_ HANDLE hThread, _Out_ PWSTR lpThreadName, _In_ SIZE_T dwBufferLength, _Out_ PSIZE_T pdwReturnLength) 81 | { 82 | PWSTR pszThreadDescription; 83 | int nThreadDescriptionLength; 84 | 85 | if (!pdwReturnLength) 86 | { 87 | SetLastError(ERROR_INVALID_PARAMETER); 88 | return FALSE; 89 | } 90 | 91 | if (HRESULT hr; FAILED(hr = GetThreadDescription(hThread, &pszThreadDescription))) 92 | { 93 | *pdwReturnLength = 0; 94 | SetLastError(WIN32_FROM_HRESULT(hr)); 95 | return FALSE; 96 | } 97 | 98 | nThreadDescriptionLength = lstrlenW(pszThreadDescription); 99 | *pdwReturnLength = nThreadDescriptionLength; 100 | 101 | if (!lpThreadName || nThreadDescriptionLength >= dwBufferLength) 102 | { 103 | LocalFree((HLOCAL)pszThreadDescription); 104 | SetLastError(ERROR_INSUFFICIENT_BUFFER); 105 | return FALSE; 106 | } 107 | 108 | CopyMemory(lpThreadName, pszThreadDescription, sizeof(WCHAR) * nThreadDescriptionLength); 109 | lpThreadName[nThreadDescriptionLength] = L'\0'; 110 | LocalFree((HLOCAL)pszThreadDescription); 111 | SetLastError(ERROR_SUCCESS); 112 | return TRUE; 113 | } 114 | 115 | // 116 | // Virtual Memory 117 | // 118 | #define PAGE_SIZE_4KB (1ULL << 12) 119 | #define PAGE_SIZE_64K (1ULL << 16) 120 | #define PAGE_SIZE_2MB (1ULL << 21) 121 | #define PAGE_SIZE_4MB (1ULL << 22) 122 | 123 | #define MEM_MASK (MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_RESET_UNDO) 124 | #define PAGE_MASK (PAGE_NOACCESS | PAGE_READONLY | PAGE_READWRITE | PAGE_GUARD) 125 | 126 | // Represents a mappable memory allocation (usable with MapTitlePhysicalPages and D3DMapEsramMemory) 127 | typedef struct _MAPPABLE_MEM 128 | { 129 | ULONG_PTR RegionSize : 63; 130 | ULONG_PTR Is4MBPages : 1; 131 | } MAPPABLE_MEM, *PMAPPABLE_MEM; 132 | 133 | static SRWLOCK XwpMappableLock = SRWLOCK_INIT; 134 | 135 | static std::map XwpMappables; 136 | 137 | static LPVOID MappableQuery(_In_opt_ LPCVOID lpAddress, _Out_ PMAPPABLE_MEM pMappable) 138 | { 139 | auto it = XwpMappables.upper_bound((ULONG_PTR)lpAddress); 140 | 141 | if (it == XwpMappables.begin()) 142 | { 143 | *pMappable = {}; 144 | return nullptr; 145 | } 146 | 147 | --it; 148 | 149 | if (it->first + it->second.RegionSize <= (ULONG_PTR)lpAddress) 150 | { 151 | *pMappable = {}; 152 | return nullptr; 153 | } 154 | 155 | *pMappable = it->second; 156 | return (LPVOID)it->first; 157 | } 158 | 159 | EXTERN_C LPVOID WINAPI EraVirtualAllocEx( 160 | _In_ HANDLE hProcess, 161 | _In_opt_ LPVOID lpAddress, 162 | _In_ SIZE_T dwSize, 163 | _In_ DWORD flAllocationType, 164 | _In_ DWORD flProtect) 165 | { 166 | MEM_ADDRESS_REQUIREMENTS AddrRq; 167 | AddrRq.LowestStartingAddress = nullptr; 168 | AddrRq.HighestEndingAddress = nullptr; 169 | AddrRq.Alignment = 0; 170 | 171 | MEM_EXTENDED_PARAMETER ExtParam; 172 | ExtParam.Type = MemExtendedParameterAddressRequirements; 173 | ExtParam.Reserved = 0; 174 | ExtParam.Pointer = &AddrRq; 175 | 176 | // If true, the memory can be used with MapTitlePhysicalPages and D3DMapEsramMemory. 177 | // These allocations go through a file mapping and therefore get handled differently. 178 | BOOL bMappable = FALSE; 179 | MAPPABLE_MEM Mappable = {}; 180 | SIZE_T dwPageSize = PAGE_SIZE_4KB; 181 | 182 | if (flAllocationType & (MEM_RESERVE | MEM_TOP_DOWN)) 183 | { 184 | // If MEM_LARGE_PAGES or MEM_4MB_PAGES is specified, the memory is mappable. 185 | bMappable = !!(flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)); 186 | 187 | if (!lpAddress) 188 | { 189 | if (flAllocationType & MEM_4MB_PAGES) 190 | AddrRq.Alignment = PAGE_SIZE_4MB; 191 | 192 | // If we're reserving memory, ERA will use specific memory ranges. 193 | // TODO: Does any set of flags use 1 TiB -> 2 TiB? Need to test on hardware. 194 | if (flAllocationType & MEM_GRAPHICS) // 4 GiB -> 1 TiB 195 | { 196 | AddrRq.LowestStartingAddress = (PVOID)0x100000000ULL; 197 | AddrRq.HighestEndingAddress = (PVOID)0xFFFFFFFFFFULL; 198 | } 199 | else if (flAllocationType & MEM_TITLE) // 2 TiB -> 4 TiB 200 | { 201 | AddrRq.LowestStartingAddress = (PVOID)0x40000000000ULL; 202 | AddrRq.HighestEndingAddress = (PVOID)0x7FFFFFFFFFFULL; 203 | } 204 | else // 4 TiB -> 8 TiB 205 | { 206 | AddrRq.LowestStartingAddress = (PVOID)0x20000000000ULL; 207 | AddrRq.HighestEndingAddress = (PVOID)0x3FFFFFFFFFFULL; 208 | } 209 | } 210 | } 211 | else if (lpAddress && (flAllocationType & MEM_COMMIT)) 212 | { 213 | AcquireSRWLockShared(&XwpMappableLock); 214 | bMappable = !!MappableQuery(lpAddress, &Mappable); 215 | ReleaseSRWLockShared(&XwpMappableLock); 216 | } 217 | 218 | if (!bMappable) 219 | return VirtualAlloc2(hProcess, lpAddress, dwSize, flAllocationType & MEM_MASK, flProtect & PAGE_MASK, &ExtParam, 1); 220 | 221 | if ((flAllocationType & MEM_4MB_PAGES) || Mappable.Is4MBPages) 222 | dwPageSize = PAGE_SIZE_4MB; 223 | else 224 | dwPageSize = PAGE_SIZE_64K; 225 | 226 | dwSize = (dwSize + (dwPageSize - 1)) & ~(dwPageSize - 1); 227 | lpAddress = (LPVOID)((ULONG_PTR)lpAddress & ~(dwPageSize - 1)); 228 | 229 | if (flAllocationType & (MEM_RESERVE | MEM_TOP_DOWN)) 230 | { 231 | Mappable = { dwSize, !!(flAllocationType & MEM_4MB_PAGES) }; 232 | lpAddress = VirtualAlloc2(hProcess, lpAddress, dwSize, MEM_RESERVE | MEM_RESERVE_PLACEHOLDER | (flAllocationType & MEM_TOP_DOWN), PAGE_NOACCESS, &ExtParam, 1); 233 | 234 | if (lpAddress) 235 | { 236 | // Split the placeholder by the physical page size to enable individual mappings. 237 | // This comes with its own caveats. MEM_COMMIT and other Virtual* functions must 238 | // be aware of mappable memory allocations and handle them appropriately. 239 | for (SIZE_T dwOffset = dwPageSize; dwOffset < dwSize; dwOffset += dwPageSize) 240 | VirtualFreeEx(hProcess, (LPBYTE)lpAddress + dwOffset, dwPageSize, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER); 241 | 242 | AcquireSRWLockExclusive(&XwpMappableLock); 243 | XwpMappables[(ULONG_PTR)lpAddress] = Mappable; 244 | ReleaseSRWLockExclusive(&XwpMappableLock); 245 | } 246 | } 247 | 248 | if (lpAddress && (flAllocationType & MEM_COMMIT)) 249 | { 250 | HANDLE hMap = CreateFileMapping2(INVALID_HANDLE_VALUE, nullptr, FILE_MAP_READ | FILE_MAP_WRITE, PAGE_READWRITE, SEC_RESERVE, dwSize, nullptr, nullptr, 0); 251 | 252 | if (!hMap) 253 | { 254 | SetLastError(ERROR_OUTOFMEMORY); 255 | return nullptr; 256 | } 257 | 258 | for (SIZE_T dwOffset = 0; dwOffset < dwSize; dwOffset += dwPageSize) 259 | { 260 | LPVOID PageAddress = (LPBYTE)lpAddress + dwOffset; 261 | MapViewOfFile3(hMap, hProcess, PageAddress, dwOffset, dwPageSize, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, nullptr, 0); 262 | VirtualAlloc2(hProcess, PageAddress, dwPageSize, MEM_COMMIT, flProtect & PAGE_MASK, nullptr, 0); 263 | } 264 | 265 | CloseHandle(hMap); 266 | } 267 | 268 | return lpAddress; 269 | } 270 | 271 | EXTERN_C LPVOID WINAPI EraVirtualAlloc( 272 | _In_opt_ LPVOID lpAddress, 273 | _In_ SIZE_T dwSize, 274 | _In_ DWORD flAllocationType, 275 | _In_ DWORD flProtect) 276 | { 277 | return EraVirtualAllocEx(GetCurrentProcess(), lpAddress, dwSize, flAllocationType, flProtect); 278 | } 279 | 280 | EXTERN_C BOOL WINAPI EraVirtualFreeEx( 281 | _In_ HANDLE hProcess, 282 | _In_ LPVOID lpAddress, 283 | _In_ SIZE_T dwSize, 284 | _In_ DWORD dwFreeType) 285 | { 286 | LPVOID AllocationBase; 287 | MAPPABLE_MEM Mappable; 288 | AcquireSRWLockShared(&XwpMappableLock); 289 | AllocationBase = MappableQuery(lpAddress, &Mappable); 290 | ReleaseSRWLockShared(&XwpMappableLock); 291 | 292 | // If we have a mappable allocation, we need to ensure it is unmapped first. 293 | if (AllocationBase) 294 | { 295 | ULONG_PTR PageSize = Mappable.Is4MBPages ? PAGE_SIZE_4MB : PAGE_SIZE_64K; 296 | ULONG_PTR BasePage = (ULONG_PTR)lpAddress & ~(PageSize - 1); 297 | 298 | if (dwFreeType == MEM_RELEASE && (AllocationBase != lpAddress || dwSize)) 299 | return FALSE; 300 | 301 | if (dwFreeType == MEM_RELEASE || (dwFreeType == MEM_DECOMMIT && !dwSize)) 302 | dwSize = Mappable.RegionSize - ((ULONG_PTR)BasePage - (ULONG_PTR)AllocationBase); 303 | 304 | ULONG_PTR LastPage = ((ULONG_PTR)lpAddress + dwSize) & ~(PageSize - 1); 305 | 306 | for (ULONG_PTR BaseAddress = BasePage; BaseAddress <= LastPage; BaseAddress += PageSize) 307 | UnmapViewOfFile2(hProcess, (PVOID)BaseAddress, MEM_PRESERVE_PLACEHOLDER); 308 | 309 | if (dwFreeType == MEM_DECOMMIT) 310 | return TRUE; 311 | 312 | BOOL Status; 313 | VirtualFreeEx(hProcess, lpAddress, dwSize, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS); 314 | AcquireSRWLockExclusive(&XwpMappableLock); 315 | Status = VirtualFreeEx(hProcess, lpAddress, 0, MEM_RELEASE); 316 | if (Status) XwpMappables.erase((ULONG_PTR)AllocationBase); 317 | ReleaseSRWLockExclusive(&XwpMappableLock); 318 | return Status; 319 | } 320 | 321 | return VirtualFreeEx(hProcess, lpAddress, dwSize, dwFreeType); 322 | } 323 | 324 | EXTERN_C BOOL WINAPI EraVirtualFree( 325 | _In_ LPVOID lpAddress, 326 | _In_ SIZE_T dwSize, 327 | _In_ DWORD dwFreeType) 328 | { 329 | return EraVirtualFreeEx(GetCurrentProcess(), lpAddress, dwSize, dwFreeType); 330 | } 331 | 332 | EXTERN_C SIZE_T WINAPI EraVirtualQueryEx( 333 | _In_ HANDLE hProcess, 334 | _In_opt_ LPCVOID lpAddress, 335 | _Out_writes_bytes_to_(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer, 336 | _In_ SIZE_T dwLength) 337 | { 338 | LPVOID AllocationBase; 339 | MAPPABLE_MEM Mappable; 340 | 341 | if (!lpBuffer || dwLength < sizeof(*lpBuffer)) 342 | return 0; 343 | 344 | AcquireSRWLockShared(&XwpMappableLock); 345 | AllocationBase = MappableQuery(lpAddress, &Mappable); 346 | ReleaseSRWLockShared(&XwpMappableLock); 347 | 348 | // Mappable memory requires special handling because of placeholder splits. 349 | // VirtualQuery will normally only report on pages that belong to the same allocation. 350 | if (AllocationBase) 351 | { 352 | MEMORY_BASIC_INFORMATION Region; 353 | ULONG_PTR PageSize = Mappable.Is4MBPages ? PAGE_SIZE_2MB : PAGE_SIZE_4KB; 354 | ULONG_PTR BasePage = (ULONG_PTR)lpAddress & ~(PageSize - 1); 355 | ULONG_PTR ByteSize = Mappable.RegionSize - ((ULONG_PTR)BasePage - (ULONG_PTR)AllocationBase); 356 | ULONG_PTR LastPage = ((ULONG_PTR)lpAddress + ByteSize) & ~(PageSize - 1); 357 | 358 | if (!VirtualQueryEx(hProcess, (LPCVOID)BasePage, &Region, sizeof(Region))) 359 | return 0; 360 | 361 | lpBuffer->BaseAddress = (PVOID)BasePage; 362 | lpBuffer->AllocationBase = AllocationBase; 363 | lpBuffer->AllocationProtect = Region.AllocationProtect; 364 | lpBuffer->PartitionId = Region.PartitionId; 365 | lpBuffer->RegionSize = PageSize; 366 | lpBuffer->State = Region.State; 367 | lpBuffer->Protect = Region.Protect; 368 | lpBuffer->Type = Region.Type; 369 | 370 | for (ULONG_PTR Page = BasePage + PageSize; Page <= LastPage; Page += PageSize) 371 | { 372 | if (!VirtualQueryEx(hProcess, (LPCVOID)Page, &Region, sizeof(Region))) 373 | break; 374 | 375 | if (Region.State != lpBuffer->State || Region.Protect != lpBuffer->Protect) 376 | break; 377 | 378 | if (Region.RegionSize < PageSize) 379 | { 380 | lpBuffer->RegionSize += Region.RegionSize; 381 | break; 382 | } 383 | 384 | lpBuffer->RegionSize += PageSize; 385 | } 386 | 387 | return sizeof(*lpBuffer); 388 | } 389 | 390 | return VirtualQueryEx(hProcess, lpAddress, lpBuffer, dwLength); 391 | } 392 | 393 | EXTERN_C SIZE_T WINAPI EraVirtualQuery( 394 | _In_opt_ LPCVOID lpAddress, 395 | _Out_writes_bytes_to_(dwLength, return) PMEMORY_BASIC_INFORMATION lpBuffer, 396 | _In_ SIZE_T dwLength) 397 | { 398 | return EraVirtualQueryEx(GetCurrentProcess(), lpAddress, lpBuffer, dwLength); 399 | } 400 | 401 | EXTERN_C BOOL WINAPI EraVirtualProtectEx( 402 | _In_ HANDLE hProcess, 403 | _In_ LPVOID lpAddress, 404 | _In_ SIZE_T dwSize, 405 | _In_ DWORD flNewProtect, 406 | _Out_opt_ PDWORD lpflOldProtect) 407 | { 408 | DWORD flOldProtect; 409 | LPVOID AllocationBase; 410 | MAPPABLE_MEM Mappable; 411 | AcquireSRWLockShared(&XwpMappableLock); 412 | AllocationBase = MappableQuery(lpAddress, &Mappable); 413 | ReleaseSRWLockShared(&XwpMappableLock); 414 | 415 | // Mappable memory requires special handling because of placeholder splits. 416 | // VirtualProtect will normally only work on pages that belong to the same allocation. 417 | if (AllocationBase) 418 | { 419 | // TODO: Validate all pages are committed before changing protections 420 | ULONG_PTR PageSize = Mappable.Is4MBPages ? PAGE_SIZE_2MB : PAGE_SIZE_4KB; 421 | ULONG_PTR BasePage = (ULONG_PTR)lpAddress & ~(PageSize - 1); 422 | ULONG_PTR LastPage = ((ULONG_PTR)lpAddress + dwSize) & ~(PageSize - 1); 423 | BOOL Status = VirtualProtectEx(hProcess, (LPVOID)BasePage, PageSize, flNewProtect, lpflOldProtect ? lpflOldProtect : &flOldProtect); 424 | 425 | for (ULONG_PTR Page = BasePage + PageSize; Page <= LastPage; Page += PageSize) 426 | Status |= VirtualProtectEx(hProcess, (LPVOID)Page, PageSize, flNewProtect, &flOldProtect); 427 | 428 | return Status; 429 | } 430 | 431 | return VirtualProtectEx(hProcess, lpAddress, dwSize, flNewProtect, lpflOldProtect ? lpflOldProtect : &flOldProtect); 432 | } 433 | 434 | EXTERN_C BOOL WINAPI EraVirtualProtect( 435 | _In_ LPVOID lpAddress, 436 | _In_ SIZE_T dwSize, 437 | _In_ DWORD flNewProtect, 438 | _Out_opt_ PDWORD lpflOldProtect) 439 | { 440 | return EraVirtualProtectEx(GetCurrentProcess(), lpAddress, dwSize, flNewProtect, lpflOldProtect); 441 | } 442 | 443 | // 444 | // Title Memory 445 | // 446 | EXTERN_C BOOL WINAPI TitleMemoryStatus(_Inout_ LPTITLEMEMORYSTATUS lpBuffer) // Similar: GlobalMemoryStatusEx 447 | { 448 | UNREFERENCED_PARAMETER(lpBuffer); 449 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 450 | return FALSE; 451 | } 452 | 453 | EXTERN_C BOOL WINAPI JobTitleMemoryStatus(_Inout_ LPTITLEMEMORYSTATUS lpBuffer) // Similar: GlobalMemoryStatusEx 454 | { 455 | UNREFERENCED_PARAMETER(lpBuffer); 456 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 457 | return FALSE; 458 | } 459 | 460 | EXTERN_C BOOL WINAPI ToolingMemoryStatus(_Inout_ LPTOOLINGMEMORYSTATUS lpBuffer) // Similar: GlobalMemoryStatusEx 461 | { 462 | UNREFERENCED_PARAMETER(lpBuffer); 463 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 464 | return FALSE; 465 | } 466 | 467 | // 468 | // Physical Memory 469 | // 470 | #define MEM_PHYSICAL_SIZE 0x400000000ULL // 16 GiB 471 | 472 | static std::bitset<(MEM_PHYSICAL_SIZE >> 16)> XwpPhysicalPages; 473 | 474 | static SRWLOCK XwpPhysicalMemoryLock = SRWLOCK_INIT; 475 | 476 | static HANDLE XwpPhysicalMemory = CreateFileMapping2(INVALID_HANDLE_VALUE, nullptr, FILE_MAP_READ | FILE_MAP_WRITE, PAGE_READWRITE, SEC_RESERVE, MEM_PHYSICAL_SIZE, nullptr, nullptr, 0); 477 | 478 | EXTERN_C BOOL WINAPI AllocateTitlePhysicalPages(_In_ HANDLE hProcess, _In_ DWORD flAllocationType, _Inout_ PULONG_PTR NumberOfPages, _Out_ PULONG_PTR PageArray) 479 | { 480 | UNREFERENCED_PARAMETER(hProcess); 481 | 482 | if (!NumberOfPages || !PageArray || 483 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == 0 || 484 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == (MEM_LARGE_PAGES | MEM_4MB_PAGES) || 485 | ((flAllocationType & MEM_4MB_PAGES) && (*NumberOfPages & 63))) 486 | { 487 | if (NumberOfPages) 488 | *NumberOfPages = 0; 489 | 490 | SetLastError(ERROR_INVALID_PARAMETER); 491 | return FALSE; 492 | } 493 | 494 | ULONG_PTR PagesAllocated = 0; 495 | ULONG_PTR PagesRequested = *NumberOfPages; 496 | ULONG_PTR PagesPerRegion = (flAllocationType & MEM_4MB_PAGES) ? 64 : 1; 497 | AcquireSRWLockExclusive(&XwpPhysicalMemoryLock); 498 | 499 | for (ULONG_PTR i = 0; (i + PagesPerRegion - 1) < XwpPhysicalPages.size() && PagesAllocated < PagesRequested;) 500 | { 501 | BOOL FoundContiguousPages = TRUE; 502 | 503 | for (ULONG_PTR j = 0; j < PagesPerRegion; j++) 504 | { 505 | if (XwpPhysicalPages[i + j]) 506 | { 507 | FoundContiguousPages = FALSE; 508 | break; 509 | } 510 | } 511 | 512 | if (!FoundContiguousPages) 513 | { 514 | i++; 515 | continue; 516 | } 517 | 518 | for (ULONG_PTR j = 0; j < PagesPerRegion; j++) 519 | { 520 | XwpPhysicalPages[i + j] = true; 521 | PageArray[PagesAllocated++] = i + j; 522 | } 523 | 524 | i += PagesPerRegion; 525 | } 526 | 527 | ReleaseSRWLockExclusive(&XwpPhysicalMemoryLock); 528 | *NumberOfPages = PagesAllocated; 529 | SetLastError(PagesAllocated > 0 ? ERROR_SUCCESS : ERROR_OUTOFMEMORY); 530 | return PagesAllocated > 0; 531 | } 532 | 533 | EXTERN_C BOOL WINAPI FreeTitlePhysicalPages(_In_ HANDLE hProcess, _In_ ULONG_PTR NumberOfPages, _In_ PULONG_PTR PageArray) 534 | { 535 | UNREFERENCED_PARAMETER(hProcess); 536 | 537 | if (NumberOfPages && !PageArray) 538 | { 539 | SetLastError(ERROR_INVALID_PARAMETER); 540 | return FALSE; 541 | } 542 | 543 | AcquireSRWLockExclusive(&XwpPhysicalMemoryLock); 544 | 545 | for (ULONG_PTR i = 0; i < NumberOfPages; i++) 546 | XwpPhysicalPages[PageArray[i]] = false; 547 | 548 | ReleaseSRWLockExclusive(&XwpPhysicalMemoryLock); 549 | SetLastError(ERROR_SUCCESS); 550 | return TRUE; 551 | } 552 | 553 | EXTERN_C PVOID WINAPI MapTitlePhysicalPages(_In_opt_ PVOID VirtualAddress, _In_ ULONG_PTR NumberOfPages, _In_ DWORD flAllocationType, _In_ DWORD flProtect, _In_ PULONG_PTR PageArray) 554 | { 555 | // TODO: Validate that PageArray contains contiguous 4MB blocks of 64K pages for MEM_4MB_PAGES 556 | 557 | if (!PageArray || 558 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == 0 || 559 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == (MEM_LARGE_PAGES | MEM_4MB_PAGES) || 560 | ((flAllocationType & MEM_4MB_PAGES) && (NumberOfPages & 63))) 561 | { 562 | SetLastError(ERROR_INVALID_PARAMETER); 563 | return nullptr; 564 | } 565 | 566 | ULONG_PTR dwPageSize = (flAllocationType & MEM_LARGE_PAGES) ? PAGE_SIZE_64K : PAGE_SIZE_4MB; 567 | ULONG_PTR RegionSize = (flAllocationType & MEM_4MB_PAGES) ? 64 : 1; 568 | 569 | if (VirtualAddress && ((ULONG_PTR)VirtualAddress & (dwPageSize - 1))) 570 | { 571 | SetLastError(ERROR_INVALID_PARAMETER); 572 | return nullptr; 573 | } 574 | 575 | if (MEMORY_BASIC_INFORMATION mbi; !VirtualAddress || !VirtualQuery(VirtualAddress, &mbi, sizeof(mbi)) || mbi.State == MEM_FREE) 576 | { 577 | VirtualAddress = EraVirtualAlloc( 578 | VirtualAddress, 579 | NumberOfPages * PAGE_SIZE_64K, 580 | MEM_RESERVE | flAllocationType, 581 | PAGE_NOACCESS); 582 | 583 | if (!VirtualAddress) 584 | { 585 | return nullptr; 586 | } 587 | } 588 | 589 | for (ULONG_PTR i = 0; i < NumberOfPages; i += RegionSize) 590 | { 591 | ULONG_PTR PhysicalOffset = PAGE_SIZE_64K * PageArray[i]; 592 | PVOID PageVirtualAddress = (PVOID)((ULONG_PTR)VirtualAddress + i * PAGE_SIZE_64K); 593 | UnmapViewOfFile2(GetCurrentProcess(), PageVirtualAddress, MEM_PRESERVE_PLACEHOLDER); 594 | MapViewOfFile3(XwpPhysicalMemory, nullptr, PageVirtualAddress, PhysicalOffset, dwPageSize, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, nullptr, 0); 595 | VirtualAlloc2(nullptr, PageVirtualAddress, dwPageSize, MEM_COMMIT, flProtect & PAGE_MASK, nullptr, 0); 596 | } 597 | 598 | SetLastError(ERROR_SUCCESS); 599 | return VirtualAddress; 600 | } 601 | 602 | // 603 | // ESRAM 604 | // 605 | #define MEM_ESRAM_SIZE 0x2000000ULL // 32 MiB 606 | 607 | static HANDLE XwpEsramMemory = CreateFileMapping2(INVALID_HANDLE_VALUE, nullptr, FILE_MAP_READ | FILE_MAP_WRITE, PAGE_READWRITE, SEC_RESERVE, MEM_ESRAM_SIZE, nullptr, nullptr, 0); 608 | 609 | EXTERN_C HRESULT WINAPI MapTitleEsramPages( 610 | _In_ PVOID VirtualAddress, 611 | _In_ UINT NumberOfPages, 612 | _In_ DWORD flAllocationType, 613 | _In_opt_ UINT const *PageArray) 614 | { 615 | if (!VirtualAddress || 616 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == 0 || 617 | (flAllocationType & (MEM_LARGE_PAGES | MEM_4MB_PAGES)) == (MEM_LARGE_PAGES | MEM_4MB_PAGES)) 618 | { 619 | return E_INVALIDARG; 620 | } 621 | 622 | SIZE_T dwPageSize = (flAllocationType & MEM_LARGE_PAGES) ? PAGE_SIZE_64K : PAGE_SIZE_4MB; 623 | 624 | if (NumberOfPages * dwPageSize > MEM_ESRAM_SIZE) 625 | return E_INVALIDARG; 626 | 627 | if ((ULONG_PTR)VirtualAddress & (dwPageSize - 1)) 628 | return E_INVALIDARG; 629 | 630 | if (!PageArray) 631 | { 632 | for (ULONG_PTR dwOffset = 0; dwOffset < NumberOfPages * dwPageSize; dwOffset += dwPageSize) 633 | { 634 | PVOID PageAddress = (PVOID)((ULONG_PTR)VirtualAddress + dwOffset); 635 | UnmapViewOfFile2(GetCurrentProcess(), PageAddress, MEM_PRESERVE_PLACEHOLDER); 636 | } 637 | 638 | return S_OK; 639 | } 640 | 641 | for (ULONG_PTR i = 0; i < NumberOfPages; i++) 642 | { 643 | ULONG_PTR PhysicalOffset = PageArray[i] * dwPageSize; 644 | PVOID PageVirtualAddress = (PVOID)((ULONG_PTR)VirtualAddress + i * dwPageSize); 645 | 646 | if (PhysicalOffset + dwPageSize > MEM_ESRAM_SIZE) 647 | return E_INVALIDARG; 648 | 649 | MapViewOfFile3(XwpEsramMemory, nullptr, PageVirtualAddress, PhysicalOffset, dwPageSize, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, nullptr, 0); 650 | VirtualAlloc2(nullptr, PageVirtualAddress, dwPageSize, MEM_COMMIT, PAGE_READWRITE, nullptr, 0); 651 | } 652 | 653 | return S_OK; 654 | } 655 | 656 | // 657 | // XMem 658 | // 659 | EXTERN_C PVOID WINAPI XMemAllocDefault(_In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes) 660 | { 661 | auto attr = XALLOC_ATTRIBUTES { dwAttributes }; 662 | 663 | if (attr.s.dwMemoryType != XALLOC_MEMTYPE_HEAP) 664 | { 665 | DWORD flAllocationType = MEM_COMMIT | MEM_RESERVE; 666 | 667 | if (attr.s.dwPageSize == XALLOC_PAGESIZE_4MB) 668 | flAllocationType |= MEM_4MB_PAGES; 669 | else 670 | flAllocationType |= MEM_LARGE_PAGES; 671 | 672 | if (attr.s.dwMemoryType >= XALLOC_MEMTYPE_GRAPHICS_1 && 673 | attr.s.dwMemoryType <= XALLOC_MEMTYPE_GRAPHICS_6) 674 | { 675 | flAllocationType |= MEM_GRAPHICS; 676 | } 677 | 678 | return EraVirtualAlloc(nullptr, dwSize, flAllocationType, PAGE_READWRITE); 679 | } 680 | 681 | void *ptr = _aligned_malloc(dwSize, 1ULL << max(4, attr.s.dwAlignment)); 682 | 683 | if (ptr) 684 | memset(ptr, 0, dwSize); 685 | 686 | return ptr; 687 | } 688 | 689 | EXTERN_C void WINAPI XMemFreeDefault(_In_ PVOID lpAddress, _In_ ULONGLONG dwAttributes) 690 | { 691 | auto attr = XALLOC_ATTRIBUTES { dwAttributes }; 692 | 693 | if (attr.s.dwMemoryType != XALLOC_MEMTYPE_HEAP) 694 | { 695 | EraVirtualFree(lpAddress, 0, MEM_RELEASE); 696 | return; 697 | } 698 | 699 | _aligned_free(lpAddress); 700 | } 701 | 702 | static CRITICAL_SECTION XmpAllocationHookLock; 703 | 704 | static PXMEMALLOC_ROUTINE XmpAllocRoutine = XMemAllocDefault; 705 | 706 | static PXMEMFREE_ROUTINE XmpFreeRoutine = XMemFreeDefault; 707 | 708 | EXTERN_C PVOID WINAPI XMemAlloc(_In_ SIZE_T dwSize, _In_ ULONGLONG dwAttributes) 709 | { 710 | return XmpAllocRoutine(dwSize, dwAttributes); 711 | } 712 | 713 | EXTERN_C void WINAPI XMemFree(_In_ PVOID lpAddress, _In_ ULONGLONG dwAttributes) 714 | { 715 | return XmpFreeRoutine(lpAddress, dwAttributes); 716 | } 717 | 718 | EXTERN_C void WINAPI XMemSetAllocationHooks(_In_opt_ PXMEMALLOC_ROUTINE pAllocRoutine, _In_opt_ PXMEMFREE_ROUTINE pFreeRoutine) 719 | { 720 | EnterCriticalSection(&XmpAllocationHookLock); 721 | 722 | if (pAllocRoutine) 723 | { 724 | XmpAllocRoutine = pAllocRoutine; 725 | XmpFreeRoutine = pFreeRoutine; 726 | } 727 | else 728 | { 729 | XmpAllocRoutine = XMemAllocDefault; 730 | XmpFreeRoutine = XMemFreeDefault; 731 | } 732 | 733 | LeaveCriticalSection(&XmpAllocationHookLock); 734 | } 735 | 736 | EXTERN_C void WINAPI XMemCheckDefaultHeaps() 737 | { 738 | // This function is empty in kernelx.dll 739 | } 740 | 741 | EXTERN_C BOOL WINAPI XMemSetAllocationHysteresis() 742 | { 743 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 744 | return FALSE; 745 | } 746 | 747 | EXTERN_C SIZE_T WINAPI XMemGetAllocationHysteresis() 748 | { 749 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 750 | return MAXSIZE_T; 751 | } 752 | 753 | EXTERN_C BOOL WINAPI XMemPreallocateFreeSpace() 754 | { 755 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 756 | return FALSE; 757 | } 758 | 759 | EXTERN_C BOOL WINAPI XMemGetAllocationStatistics() 760 | { 761 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 762 | return FALSE; 763 | } 764 | 765 | EXTERN_C HANDLE WINAPI XMemGetAuxiliaryTitleMemory() 766 | { 767 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 768 | return nullptr; 769 | } 770 | 771 | EXTERN_C void WINAPI XMemReleaseAuxiliaryTitleMemory(_In_opt_ HANDLE hHandle) 772 | { 773 | UNREFERENCED_PARAMETER(hHandle); 774 | SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 775 | } 776 | 777 | // 778 | // Entry Point 779 | // 780 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 781 | { 782 | UNREFERENCED_PARAMETER(hinstDLL); 783 | UNREFERENCED_PARAMETER(lpvReserved); 784 | 785 | switch (fdwReason) 786 | { 787 | case DLL_PROCESS_ATTACH: 788 | InitializeCriticalSection(&XmpAllocationHookLock); 789 | break; 790 | } 791 | 792 | return TRUE; 793 | } 794 | 795 | // 796 | // Imports 797 | // 798 | #pragma comment(lib, "onecore.lib") 799 | 800 | // 801 | // Exports 802 | // 803 | #pragma comment(linker, "/export:AcquireSRWLockExclusive=kernel32.AcquireSRWLockExclusive") 804 | #pragma comment(linker, "/export:AcquireSRWLockShared=kernel32.AcquireSRWLockShared") 805 | #pragma comment(linker, "/export:AddVectoredContinueHandler=kernel32.AddVectoredContinueHandler") 806 | #pragma comment(linker, "/export:AddVectoredExceptionHandler=kernel32.AddVectoredExceptionHandler") 807 | #pragma comment(linker, "/export:AllocateTitlePhysicalPages") 808 | #pragma comment(linker, "/export:AppPolicyGetProcessTerminationMethod=kernel32.AppPolicyGetProcessTerminationMethod") 809 | #pragma comment(linker, "/export:AppPolicyGetShowDeveloperDiagnostic=kernel32.AppPolicyGetShowDeveloperDiagnostic") 810 | #pragma comment(linker, "/export:AppPolicyGetThreadInitializationType=kernel32.AppPolicyGetThreadInitializationType") 811 | #pragma comment(linker, "/export:AppPolicyGetWindowingModel=kernel32.AppPolicyGetWindowingModel") 812 | #pragma comment(linker, "/export:AreFileApisANSI=kernel32.AreFileApisANSI") 813 | #pragma comment(linker, "/export:Beep=kernel32.Beep") 814 | #pragma comment(linker, "/export:BindIoCompletionCallback=kernel32.BindIoCompletionCallback") 815 | #pragma comment(linker, "/export:CallbackMayRunLong=kernel32.CallbackMayRunLong") 816 | #pragma comment(linker, "/export:CancelIo=kernel32.CancelIo") 817 | #pragma comment(linker, "/export:CancelIoEx=kernel32.CancelIoEx") 818 | #pragma comment(linker, "/export:CancelSynchronousIo=kernel32.CancelSynchronousIo") 819 | #pragma comment(linker, "/export:CancelThreadpoolIo=kernel32.CancelThreadpoolIo") 820 | #pragma comment(linker, "/export:CancelWaitableTimer=kernel32.CancelWaitableTimer") 821 | #pragma comment(linker, "/export:CloseHandle=kernel32.CloseHandle") 822 | #pragma comment(linker, "/export:CloseThreadpool=kernel32.CloseThreadpool") 823 | #pragma comment(linker, "/export:CloseThreadpoolCleanupGroup=kernel32.CloseThreadpoolCleanupGroup") 824 | #pragma comment(linker, "/export:CloseThreadpoolCleanupGroupMembers=kernel32.CloseThreadpoolCleanupGroupMembers") 825 | #pragma comment(linker, "/export:CloseThreadpoolIo=kernel32.CloseThreadpoolIo") 826 | #pragma comment(linker, "/export:CloseThreadpoolTimer=kernel32.CloseThreadpoolTimer") 827 | #pragma comment(linker, "/export:CloseThreadpoolWait=kernel32.CloseThreadpoolWait") 828 | #pragma comment(linker, "/export:CloseThreadpoolWork=kernel32.CloseThreadpoolWork") 829 | #pragma comment(linker, "/export:CompareFileTime=kernel32.CompareFileTime") 830 | #pragma comment(linker, "/export:CompareStringEx=kernel32.CompareStringEx") 831 | #pragma comment(linker, "/export:CompareStringOrdinal=kernel32.CompareStringOrdinal") 832 | #pragma comment(linker, "/export:CompareStringW=kernel32.CompareStringW") 833 | #pragma comment(linker, "/export:ConnectNamedPipe=kernel32.ConnectNamedPipe") 834 | #pragma comment(linker, "/export:ConvertFiberToThread=kernel32.ConvertFiberToThread") 835 | #pragma comment(linker, "/export:ConvertThreadToFiber=kernel32.ConvertThreadToFiber") 836 | #pragma comment(linker, "/export:ConvertThreadToFiberEx=kernel32.ConvertThreadToFiberEx") 837 | #pragma comment(linker, "/export:CopyContext=kernel32.CopyContext") 838 | #pragma comment(linker, "/export:CopyFile2=kernel32.CopyFile2") 839 | #pragma comment(linker, "/export:CopyMemoryNonTemporal=kernelbase.CopyMemoryNonTemporal") 840 | #pragma comment(linker, "/export:CreateDirectoryA=kernel32.CreateDirectoryA") 841 | #pragma comment(linker, "/export:CreateDirectoryW=kernel32.CreateDirectoryW") 842 | #pragma comment(linker, "/export:CreateEventA=kernel32.CreateEventA") 843 | #pragma comment(linker, "/export:CreateEventExA=kernel32.CreateEventExA") 844 | #pragma comment(linker, "/export:CreateEventExW=kernel32.CreateEventExW") 845 | #pragma comment(linker, "/export:CreateEventW=kernel32.CreateEventW") 846 | #pragma comment(linker, "/export:CreateFiber=kernel32.CreateFiber") 847 | #pragma comment(linker, "/export:CreateFiberEx=kernel32.CreateFiberEx") 848 | #pragma comment(linker, "/export:CreateFile2=kernel32.CreateFile2") 849 | #pragma comment(linker, "/export:CreateFileA=kernel32.CreateFileA") 850 | #pragma comment(linker, "/export:CreateFileMappingW=kernel32.CreateFileMappingW") 851 | #pragma comment(linker, "/export:CreateFileW=kernel32.CreateFileW") 852 | #pragma comment(linker, "/export:CreateHardLinkW=kernel32.CreateHardLinkW") 853 | #pragma comment(linker, "/export:CreateIoCompletionPort=kernel32.CreateIoCompletionPort") 854 | #pragma comment(linker, "/export:CreateMutexA=kernel32.CreateMutexA") 855 | #pragma comment(linker, "/export:CreateMutexExA=kernel32.CreateMutexExA") 856 | #pragma comment(linker, "/export:CreateMutexExW=kernel32.CreateMutexExW") 857 | #pragma comment(linker, "/export:CreateMutexW=kernel32.CreateMutexW") 858 | #pragma comment(linker, "/export:CreateNamedPipeW=kernel32.CreateNamedPipeW") 859 | #pragma comment(linker, "/export:CreatePipe=kernel32.CreatePipe") 860 | #pragma comment(linker, "/export:CreateProcessA=kernel32.CreateProcessA") 861 | #pragma comment(linker, "/export:CreateProcessW=kernel32.CreateProcessW") 862 | #pragma comment(linker, "/export:CreateRemoteThread=kernel32.CreateRemoteThread") 863 | #pragma comment(linker, "/export:CreateRemoteThreadEx=kernel32.CreateRemoteThreadEx") 864 | #pragma comment(linker, "/export:CreateSemaphoreA=kernel32.CreateSemaphoreA") 865 | #pragma comment(linker, "/export:CreateSemaphoreExA=kernel32.CreateSemaphoreExA") 866 | #pragma comment(linker, "/export:CreateSemaphoreExW=kernel32.CreateSemaphoreExW") 867 | #pragma comment(linker, "/export:CreateSemaphoreW=kernel32.CreateSemaphoreW") 868 | #pragma comment(linker, "/export:CreateSymbolicLinkW=kernel32.CreateSymbolicLinkW") 869 | #pragma comment(linker, "/export:CreateThread=kernel32.CreateThread") 870 | #pragma comment(linker, "/export:CreateThreadpool=kernel32.CreateThreadpool") 871 | #pragma comment(linker, "/export:CreateThreadpoolCleanupGroup=kernel32.CreateThreadpoolCleanupGroup") 872 | #pragma comment(linker, "/export:CreateThreadpoolIo=kernel32.CreateThreadpoolIo") 873 | #pragma comment(linker, "/export:CreateThreadpoolTimer=kernel32.CreateThreadpoolTimer") 874 | #pragma comment(linker, "/export:CreateThreadpoolWait=kernel32.CreateThreadpoolWait") 875 | #pragma comment(linker, "/export:CreateThreadpoolWork=kernel32.CreateThreadpoolWork") 876 | #pragma comment(linker, "/export:CreateWaitableTimerA=kernel32.CreateWaitableTimerA") 877 | #pragma comment(linker, "/export:CreateWaitableTimerExA=kernel32.CreateWaitableTimerExA") 878 | #pragma comment(linker, "/export:CreateWaitableTimerExW=kernel32.CreateWaitableTimerExW") 879 | #pragma comment(linker, "/export:CreateWaitableTimerW=kernel32.CreateWaitableTimerW") 880 | #pragma comment(linker, "/export:DebugBreak=kernel32.DebugBreak") 881 | #pragma comment(linker, "/export:DecodePointer=kernel32.DecodePointer") 882 | #pragma comment(linker, "/export:DecodeSystemPointer=kernel32.DecodeSystemPointer") 883 | #pragma comment(linker, "/export:DeleteCriticalSection=kernel32.DeleteCriticalSection") 884 | #pragma comment(linker, "/export:DeleteFiber=kernel32.DeleteFiber") 885 | #pragma comment(linker, "/export:DeleteFileA=kernel32.DeleteFileA") 886 | #pragma comment(linker, "/export:DeleteFileW=kernel32.DeleteFileW") 887 | #pragma comment(linker, "/export:DeleteProcThreadAttributeList=kernel32.DeleteProcThreadAttributeList") 888 | #pragma comment(linker, "/export:DeleteSynchronizationBarrier=kernel32.DeleteSynchronizationBarrier") 889 | #pragma comment(linker, "/export:DeviceIoControl=kernel32.DeviceIoControl") 890 | #pragma comment(linker, "/export:DisableThreadLibraryCalls=kernel32.DisableThreadLibraryCalls") 891 | #pragma comment(linker, "/export:DisassociateCurrentThreadFromCallback=kernel32.DisassociateCurrentThreadFromCallback") 892 | #pragma comment(linker, "/export:DisconnectNamedPipe=kernel32.DisconnectNamedPipe") 893 | #pragma comment(linker, "/export:DuplicateHandle=kernel32.DuplicateHandle") 894 | #pragma comment(linker, "/export:EncodePointer=kernel32.EncodePointer") 895 | #pragma comment(linker, "/export:EncodeSystemPointer=kernel32.EncodeSystemPointer") 896 | #pragma comment(linker, "/export:EnterCriticalSection=kernel32.EnterCriticalSection") 897 | #pragma comment(linker, "/export:EnterSynchronizationBarrier=kernel32.EnterSynchronizationBarrier") 898 | #pragma comment(linker, "/export:EnumSystemLocalesA=kernel32.EnumSystemLocalesA") 899 | #pragma comment(linker, "/export:EnumSystemLocalesEx=kernel32.EnumSystemLocalesEx") 900 | #pragma comment(linker, "/export:EnumSystemLocalesW=kernel32.EnumSystemLocalesW") 901 | #pragma comment(linker, "/export:EventActivityIdControl=kernelbase.EventActivityIdControl") 902 | #pragma comment(linker, "/export:EventEnabled=kernelbase.EventEnabled") 903 | #pragma comment(linker, "/export:EventProviderEnabled=kernelbase.EventProviderEnabled") 904 | #pragma comment(linker, "/export:EventRegister=kernelbase.EventRegister") 905 | #pragma comment(linker, "/export:EventSetInformation=kernelbase.EventSetInformation") 906 | #pragma comment(linker, "/export:EventUnregister=kernelbase.EventUnregister") 907 | #pragma comment(linker, "/export:EventWrite=kernelbase.EventWrite") 908 | #pragma comment(linker, "/export:EventWriteEx=kernelbase.EventWriteEx") 909 | #pragma comment(linker, "/export:EventWriteString=kernelbase.EventWriteString") 910 | #pragma comment(linker, "/export:EventWriteTransfer=kernelbase.EventWriteTransfer") 911 | #pragma comment(linker, "/export:ExitProcess=kernel32.ExitProcess") 912 | #pragma comment(linker, "/export:ExitThread=kernel32.ExitThread") 913 | #pragma comment(linker, "/export:ExpandEnvironmentStringsW=kernel32.ExpandEnvironmentStringsW") 914 | #pragma comment(linker, "/export:FatalAppExitA=kernel32.FatalAppExitA") 915 | #pragma comment(linker, "/export:FileTimeToLocalFileTime=kernel32.FileTimeToLocalFileTime") 916 | #pragma comment(linker, "/export:FileTimeToSystemTime=kernel32.FileTimeToSystemTime") 917 | #pragma comment(linker, "/export:FillMemoryNonTemporal=ntdll.RtlFillMemoryNonTemporal") 918 | #pragma comment(linker, "/export:FindClose=kernel32.FindClose") 919 | #pragma comment(linker, "/export:FindFirstFileA=kernel32.FindFirstFileA") 920 | #pragma comment(linker, "/export:FindFirstFileExA=kernel32.FindFirstFileExA") 921 | #pragma comment(linker, "/export:FindFirstFileExW=kernel32.FindFirstFileExW") 922 | #pragma comment(linker, "/export:FindFirstFileW=kernel32.FindFirstFileW") 923 | #pragma comment(linker, "/export:FindNLSString=kernel32.FindNLSString") 924 | #pragma comment(linker, "/export:FindNLSStringEx=kernel32.FindNLSStringEx") 925 | #pragma comment(linker, "/export:FindNextFileA=kernel32.FindNextFileA") 926 | #pragma comment(linker, "/export:FindNextFileW=kernel32.FindNextFileW") 927 | #pragma comment(linker, "/export:FindResourceExW=kernel32.FindResourceExW") 928 | #pragma comment(linker, "/export:FindResourceW=kernel32.FindResourceW") 929 | #pragma comment(linker, "/export:FindStringOrdinal=kernel32.FindStringOrdinal") 930 | #pragma comment(linker, "/export:FlsAlloc=kernel32.FlsAlloc") 931 | #pragma comment(linker, "/export:FlsFree=kernel32.FlsFree") 932 | #pragma comment(linker, "/export:FlsGetValue=kernel32.FlsGetValue") 933 | #pragma comment(linker, "/export:FlsSetValue=kernel32.FlsSetValue") 934 | #pragma comment(linker, "/export:FlushFileBuffers=kernel32.FlushFileBuffers") 935 | #pragma comment(linker, "/export:FlushProcessWriteBuffers=kernel32.FlushProcessWriteBuffers") 936 | #pragma comment(linker, "/export:FoldStringW=kernel32.FoldStringW") 937 | #pragma comment(linker, "/export:FormatMessageW=kernel32.FormatMessageW") 938 | #pragma comment(linker, "/export:FreeEnvironmentStringsW=kernel32.FreeEnvironmentStringsW") 939 | #pragma comment(linker, "/export:FreeLibrary=kernel32.FreeLibrary") 940 | #pragma comment(linker, "/export:FreeLibraryAndExitThread=kernel32.FreeLibraryAndExitThread") 941 | #pragma comment(linker, "/export:FreeLibraryWhenCallbackReturns=kernel32.FreeLibraryWhenCallbackReturns") 942 | #pragma comment(linker, "/export:FreeTitlePhysicalPages") 943 | #pragma comment(linker, "/export:GetACP=kernel32.GetACP") 944 | #pragma comment(linker, "/export:GetCPInfo=kernel32.GetCPInfo") 945 | #pragma comment(linker, "/export:GetCommandLineA=kernel32.GetCommandLineA") 946 | #pragma comment(linker, "/export:GetCommandLineW=kernel32.GetCommandLineW") 947 | #pragma comment(linker, "/export:GetComputerNameExW=kernel32.GetComputerNameExW") 948 | #pragma comment(linker, "/export:GetConsoleCP=kernel32.GetConsoleCP") 949 | #pragma comment(linker, "/export:GetConsoleMode=kernel32.GetConsoleMode") 950 | #pragma comment(linker, "/export:GetConsoleType") 951 | #pragma comment(linker, "/export:GetCurrencyFormatEx=kernel32.GetCurrencyFormatEx") 952 | #pragma comment(linker, "/export:GetCurrentDirectoryA=kernel32.GetCurrentDirectoryA") 953 | #pragma comment(linker, "/export:GetCurrentDirectoryW=kernel32.GetCurrentDirectoryW") 954 | #pragma comment(linker, "/export:GetCurrentProcess=kernel32.GetCurrentProcess") 955 | #pragma comment(linker, "/export:GetCurrentProcessId=kernel32.GetCurrentProcessId") 956 | #pragma comment(linker, "/export:GetCurrentProcessorNumber=kernel32.GetCurrentProcessorNumber") 957 | #pragma comment(linker, "/export:GetCurrentProcessorNumberEx=kernel32.GetCurrentProcessorNumberEx") 958 | #pragma comment(linker, "/export:GetCurrentThread=kernel32.GetCurrentThread") 959 | #pragma comment(linker, "/export:GetCurrentThreadId=kernel32.GetCurrentThreadId") 960 | #pragma comment(linker, "/export:GetCurrentThreadStackLimits=kernel32.GetCurrentThreadStackLimits") 961 | #pragma comment(linker, "/export:GetDateFormatA=kernel32.GetDateFormatA") 962 | #pragma comment(linker, "/export:GetDateFormatEx=kernel32.GetDateFormatEx") 963 | #pragma comment(linker, "/export:GetDateFormatW=kernel32.GetDateFormatW") 964 | #pragma comment(linker, "/export:GetDiskFreeSpaceExW=kernel32.GetDiskFreeSpaceExW") 965 | #pragma comment(linker, "/export:GetDiskFreeSpaceW=kernel32.GetDiskFreeSpaceW") 966 | #pragma comment(linker, "/export:GetDriveTypeA=kernel32.GetDriveTypeA") 967 | #pragma comment(linker, "/export:GetDriveTypeW=kernel32.GetDriveTypeW") 968 | #pragma comment(linker, "/export:GetDynamicTimeZoneInformation=kernel32.GetDynamicTimeZoneInformation") 969 | #pragma comment(linker, "/export:GetEnabledXStateFeatures=kernel32.GetEnabledXStateFeatures") 970 | #pragma comment(linker, "/export:GetEnvironmentStringsW=kernel32.GetEnvironmentStringsW") 971 | #pragma comment(linker, "/export:GetEnvironmentVariableW=kernel32.GetEnvironmentVariableW") 972 | #pragma comment(linker, "/export:GetExitCodeProcess=kernel32.GetExitCodeProcess") 973 | #pragma comment(linker, "/export:GetExitCodeThread=kernel32.GetExitCodeThread") 974 | #pragma comment(linker, "/export:GetFileAttributesA=kernel32.GetFileAttributesA") 975 | #pragma comment(linker, "/export:GetFileAttributesExA=kernel32.GetFileAttributesExA") 976 | #pragma comment(linker, "/export:GetFileAttributesExW=kernel32.GetFileAttributesExW") 977 | #pragma comment(linker, "/export:GetFileAttributesW=kernel32.GetFileAttributesW") 978 | #pragma comment(linker, "/export:GetFileInformationByHandle=kernel32.GetFileInformationByHandle") 979 | #pragma comment(linker, "/export:GetFileInformationByHandleEx=kernel32.GetFileInformationByHandleEx") 980 | #pragma comment(linker, "/export:GetFileSize=kernel32.GetFileSize") 981 | #pragma comment(linker, "/export:GetFileSizeEx=kernel32.GetFileSizeEx") 982 | #pragma comment(linker, "/export:GetFileTime=kernel32.GetFileTime") 983 | #pragma comment(linker, "/export:GetFileType=kernel32.GetFileType") 984 | #pragma comment(linker, "/export:GetFullPathNameA=kernel32.GetFullPathNameA") 985 | #pragma comment(linker, "/export:GetFullPathNameW=kernel32.GetFullPathNameW") 986 | #pragma comment(linker, "/export:GetGeoInfoW=kernel32.GetGeoInfoW") 987 | #pragma comment(linker, "/export:GetHandleInformation=kernel32.GetHandleInformation") 988 | #pragma comment(linker, "/export:GetLastError=kernel32.GetLastError") 989 | #pragma comment(linker, "/export:GetLocalTime=kernel32.GetLocalTime") 990 | #pragma comment(linker, "/export:GetLocaleInfoA=kernel32.GetLocaleInfoA") 991 | #pragma comment(linker, "/export:GetLocaleInfoEx=kernel32.GetLocaleInfoEx") 992 | #pragma comment(linker, "/export:GetLocaleInfoW=kernel32.GetLocaleInfoW") 993 | #pragma comment(linker, "/export:GetLogicalDrives=kernel32.GetLogicalDrives") 994 | #pragma comment(linker, "/export:GetModuleFileNameA=kernel32.GetModuleFileNameA") 995 | #pragma comment(linker, "/export:GetModuleFileNameW=kernel32.GetModuleFileNameW") 996 | #pragma comment(linker, "/export:GetModuleHandleA=kernel32.GetModuleHandleA") 997 | #pragma comment(linker, "/export:GetModuleHandleExA=kernel32.GetModuleHandleExA") 998 | #pragma comment(linker, "/export:GetModuleHandleExW=kernel32.GetModuleHandleExW") 999 | #pragma comment(linker, "/export:GetModuleHandleW=kernel32.GetModuleHandleW") 1000 | #pragma comment(linker, "/export:GetNativeSystemInfo=kernel32.GetNativeSystemInfo") 1001 | #pragma comment(linker, "/export:GetNumberFormatEx=kernel32.GetNumberFormatEx") 1002 | #pragma comment(linker, "/export:GetNumberOfConsoleInputEvents=kernel32.GetNumberOfConsoleInputEvents") 1003 | #pragma comment(linker, "/export:GetOEMCP=kernel32.GetOEMCP") 1004 | #pragma comment(linker, "/export:GetOverlappedResult=kernel32.GetOverlappedResult") 1005 | #pragma comment(linker, "/export:GetOverlappedResultEx=kernel32.GetOverlappedResultEx") 1006 | #pragma comment(linker, "/export:GetProcAddress=kernel32.GetProcAddress") 1007 | #pragma comment(linker, "/export:GetProcessAffinityMask=kernel32.GetProcessAffinityMask") 1008 | #pragma comment(linker, "/export:GetProcessHandleCount=kernel32.GetProcessHandleCount") 1009 | #pragma comment(linker, "/export:GetProcessHeap=kernel32.GetProcessHeap") 1010 | #pragma comment(linker, "/export:GetProcessHeaps=kernel32.GetProcessHeaps") 1011 | #pragma comment(linker, "/export:GetProcessId=kernel32.GetProcessId") 1012 | #pragma comment(linker, "/export:GetProcessIdOfThread=kernel32.GetProcessIdOfThread") 1013 | #pragma comment(linker, "/export:GetProcessPriorityBoost=kernel32.GetProcessPriorityBoost") 1014 | #pragma comment(linker, "/export:GetProcessTimes=kernel32.GetProcessTimes") 1015 | #pragma comment(linker, "/export:GetProcessWorkingSetSize=kernel32.GetProcessWorkingSetSize") 1016 | #pragma comment(linker, "/export:GetQueuedCompletionStatus=kernel32.GetQueuedCompletionStatus") 1017 | #pragma comment(linker, "/export:GetQueuedCompletionStatusEx=kernel32.GetQueuedCompletionStatusEx") 1018 | #pragma comment(linker, "/export:GetStartupInfoW=kernel32.GetStartupInfoW") 1019 | #pragma comment(linker, "/export:GetStdHandle=kernel32.GetStdHandle") 1020 | #pragma comment(linker, "/export:GetStringTypeExW=kernel32.GetStringTypeExW") 1021 | #pragma comment(linker, "/export:GetStringTypeW=kernel32.GetStringTypeW") 1022 | #pragma comment(linker, "/export:GetSystemDirectoryW=kernel32.GetSystemDirectoryW") 1023 | #pragma comment(linker, "/export:GetSystemFileCacheSize=kernel32.GetSystemFileCacheSize") 1024 | #pragma comment(linker, "/export:GetSystemInfo=kernel32.GetSystemInfo") 1025 | #pragma comment(linker, "/export:GetSystemOSVersion") 1026 | #pragma comment(linker, "/export:GetSystemTime=kernel32.GetSystemTime") 1027 | #pragma comment(linker, "/export:GetSystemTimeAdjustment=kernel32.GetSystemTimeAdjustment") 1028 | #pragma comment(linker, "/export:GetSystemTimeAsFileTime=kernel32.GetSystemTimeAsFileTime") 1029 | #pragma comment(linker, "/export:GetSystemTimePreciseAsFileTime=kernel32.GetSystemTimePreciseAsFileTime") 1030 | #pragma comment(linker, "/export:GetSystemWindowsDirectoryW=kernel32.GetSystemWindowsDirectoryW") 1031 | #pragma comment(linker, "/export:GetTempPathW=kernel32.GetTempPathW") 1032 | #pragma comment(linker, "/export:GetThreadContext=kernel32.GetThreadContext") 1033 | #pragma comment(linker, "/export:GetThreadGroupAffinity=kernel32.GetThreadGroupAffinity") 1034 | #pragma comment(linker, "/export:GetThreadId=kernel32.GetThreadId") 1035 | #pragma comment(linker, "/export:GetThreadIdealProcessorEx=kernel32.GetThreadIdealProcessorEx") 1036 | #pragma comment(linker, "/export:GetThreadLocale=kernel32.GetThreadLocale") 1037 | #pragma comment(linker, "/export:GetThreadName") 1038 | #pragma comment(linker, "/export:GetThreadPriority=kernel32.GetThreadPriority") 1039 | #pragma comment(linker, "/export:GetThreadPriorityBoost=kernel32.GetThreadPriorityBoost") 1040 | #pragma comment(linker, "/export:GetThreadTimes=kernel32.GetThreadTimes") 1041 | #pragma comment(linker, "/export:GetTickCount=kernel32.GetTickCount") 1042 | #pragma comment(linker, "/export:GetTickCount64=kernel32.GetTickCount64") 1043 | #pragma comment(linker, "/export:GetTimeFormatA=kernel32.GetTimeFormatA") 1044 | #pragma comment(linker, "/export:GetTimeFormatEx=kernel32.GetTimeFormatEx") 1045 | #pragma comment(linker, "/export:GetTimeFormatW=kernel32.GetTimeFormatW") 1046 | #pragma comment(linker, "/export:GetTimeZoneInformation=kernel32.GetTimeZoneInformation") 1047 | #pragma comment(linker, "/export:GetTimeZoneInformationForYear=kernel32.GetTimeZoneInformationForYear") 1048 | #pragma comment(linker, "/export:GetTraceEnableFlags=kernelbase.GetTraceEnableFlags") 1049 | #pragma comment(linker, "/export:GetTraceEnableLevel=kernelbase.GetTraceEnableLevel") 1050 | #pragma comment(linker, "/export:GetTraceLoggerHandle=kernelbase.GetTraceLoggerHandle") 1051 | #pragma comment(linker, "/export:GetUserDefaultLCID=kernel32.GetUserDefaultLCID") 1052 | #pragma comment(linker, "/export:GetUserDefaultLocaleName=kernel32.GetUserDefaultLocaleName") 1053 | #pragma comment(linker, "/export:GetUserGeoID=kernel32.GetUserGeoID") 1054 | #pragma comment(linker, "/export:GetVersion=kernel32.GetVersion") 1055 | #pragma comment(linker, "/export:GetVersionExW=kernel32.GetVersionExW") 1056 | #pragma comment(linker, "/export:GetVolumeInformationByHandleW=kernel32.GetVolumeInformationByHandleW") 1057 | #pragma comment(linker, "/export:GetVolumeInformationW=kernel32.GetVolumeInformationW") 1058 | #pragma comment(linker, "/export:GetVolumePathNameW=kernel32.GetVolumePathNameW") 1059 | #pragma comment(linker, "/export:GetWindowsDirectoryW=kernel32.GetWindowsDirectoryW") 1060 | #pragma comment(linker, "/export:GetXStateFeaturesMask=kernel32.GetXStateFeaturesMask") 1061 | #pragma comment(linker, "/export:GlobalMemoryStatusEx=kernel32.GlobalMemoryStatusEx") 1062 | #pragma comment(linker, "/export:HeapAlloc=kernel32.HeapAlloc") 1063 | #pragma comment(linker, "/export:HeapCompact=kernel32.HeapCompact") 1064 | #pragma comment(linker, "/export:HeapCreate=kernel32.HeapCreate") 1065 | #pragma comment(linker, "/export:HeapDestroy=kernel32.HeapDestroy") 1066 | #pragma comment(linker, "/export:HeapFree=kernel32.HeapFree") 1067 | #pragma comment(linker, "/export:HeapLock=kernel32.HeapLock") 1068 | #pragma comment(linker, "/export:HeapQueryInformation=kernel32.HeapQueryInformation") 1069 | #pragma comment(linker, "/export:HeapReAlloc=kernel32.HeapReAlloc") 1070 | #pragma comment(linker, "/export:HeapSetInformation=kernel32.HeapSetInformation") 1071 | #pragma comment(linker, "/export:HeapSize=kernel32.HeapSize") 1072 | #pragma comment(linker, "/export:HeapUnlock=kernel32.HeapUnlock") 1073 | #pragma comment(linker, "/export:HeapValidate=kernel32.HeapValidate") 1074 | #pragma comment(linker, "/export:HeapWalk=kernel32.HeapWalk") 1075 | #pragma comment(linker, "/export:InitOnceBeginInitialize=kernel32.InitOnceBeginInitialize") 1076 | #pragma comment(linker, "/export:InitOnceComplete=kernel32.InitOnceComplete") 1077 | #pragma comment(linker, "/export:InitOnceExecuteOnce=kernel32.InitOnceExecuteOnce") 1078 | #pragma comment(linker, "/export:InitOnceInitialize=kernel32.InitOnceInitialize") 1079 | #pragma comment(linker, "/export:InitializeConditionVariable=kernel32.InitializeConditionVariable") 1080 | #pragma comment(linker, "/export:InitializeContext=kernel32.InitializeContext") 1081 | #pragma comment(linker, "/export:InitializeCriticalSection=kernel32.InitializeCriticalSection") 1082 | #pragma comment(linker, "/export:InitializeCriticalSectionAndSpinCount=kernel32.InitializeCriticalSectionAndSpinCount") 1083 | #pragma comment(linker, "/export:InitializeCriticalSectionEx=kernel32.InitializeCriticalSectionEx") 1084 | #pragma comment(linker, "/export:InitializeProcThreadAttributeList=kernel32.InitializeProcThreadAttributeList") 1085 | #pragma comment(linker, "/export:InitializeSListHead=kernel32.InitializeSListHead") 1086 | #pragma comment(linker, "/export:InitializeSRWLock=kernel32.InitializeSRWLock") 1087 | #pragma comment(linker, "/export:InitializeSynchronizationBarrier=kernel32.InitializeSynchronizationBarrier") 1088 | #pragma comment(linker, "/export:InterlockedFlushSList=kernel32.InterlockedFlushSList") 1089 | #pragma comment(linker, "/export:InterlockedPopEntrySList=kernel32.InterlockedPopEntrySList") 1090 | #pragma comment(linker, "/export:InterlockedPushEntrySList=kernel32.InterlockedPushEntrySList") 1091 | #pragma comment(linker, "/export:InterlockedPushListSList=kernel32.InterlockedPushListSList") 1092 | #pragma comment(linker, "/export:InterlockedPushListSListEx=kernel32.InterlockedPushListSListEx") 1093 | #pragma comment(linker, "/export:IsDebuggerPresent=kernel32.IsDebuggerPresent") 1094 | #pragma comment(linker, "/export:IsProcessorFeaturePresent=kernel32.IsProcessorFeaturePresent") 1095 | #pragma comment(linker, "/export:IsThreadAFiber=kernel32.IsThreadAFiber") 1096 | #pragma comment(linker, "/export:IsThreadpoolTimerSet=kernel32.IsThreadpoolTimerSet") 1097 | #pragma comment(linker, "/export:IsValidCodePage=kernel32.IsValidCodePage") 1098 | #pragma comment(linker, "/export:IsValidLocale=kernel32.IsValidLocale") 1099 | #pragma comment(linker, "/export:IsValidLocaleName=kernel32.IsValidLocaleName") 1100 | #pragma comment(linker, "/export:JobTitleMemoryStatus") 1101 | #pragma comment(linker, "/export:LCIDToLocaleName=kernel32.LCIDToLocaleName") 1102 | #pragma comment(linker, "/export:LCMapStringEx=kernel32.LCMapStringEx") 1103 | #pragma comment(linker, "/export:LCMapStringW=kernel32.LCMapStringW") 1104 | #pragma comment(linker, "/export:LeaveCriticalSection=kernel32.LeaveCriticalSection") 1105 | #pragma comment(linker, "/export:LeaveCriticalSectionWhenCallbackReturns=kernel32.LeaveCriticalSectionWhenCallbackReturns") 1106 | #pragma comment(linker, "/export:LoadLibraryExA=kernel32.LoadLibraryExA") 1107 | #pragma comment(linker, "/export:LoadLibraryExW=kernel32.LoadLibraryExW") 1108 | #pragma comment(linker, "/export:LoadLibraryW=kernel32.LoadLibraryW") 1109 | #pragma comment(linker, "/export:LoadPackagedLibrary=kernel32.LoadPackagedLibrary") 1110 | #pragma comment(linker, "/export:LoadResource=kernel32.LoadResource") 1111 | #pragma comment(linker, "/export:LoadStringW=kernelbase.LoadStringW") 1112 | #pragma comment(linker, "/export:LocalAlloc=kernel32.LocalAlloc") 1113 | #pragma comment(linker, "/export:LocalFileTimeToFileTime=kernel32.LocalFileTimeToFileTime") 1114 | #pragma comment(linker, "/export:LocalFree=kernel32.LocalFree") 1115 | #pragma comment(linker, "/export:LocaleNameToLCID=kernel32.LocaleNameToLCID") 1116 | #pragma comment(linker, "/export:LocateXStateFeature=kernel32.LocateXStateFeature") 1117 | #pragma comment(linker, "/export:LockFile=kernel32.LockFile") 1118 | #pragma comment(linker, "/export:LockFileEx=kernel32.LockFileEx") 1119 | #pragma comment(linker, "/export:LockResource=kernel32.LockResource") 1120 | #pragma comment(linker, "/export:MapTitlePhysicalPages") 1121 | #pragma comment(linker, "/export:MapViewOfFileEx=kernel32.MapViewOfFileEx") 1122 | #pragma comment(linker, "/export:MoveFileExW=kernel32.MoveFileExW") 1123 | #pragma comment(linker, "/export:MulDiv=kernel32.MulDiv") 1124 | #pragma comment(linker, "/export:MultiByteToWideChar=kernel32.MultiByteToWideChar") 1125 | #pragma comment(linker, "/export:NlsUpdateLocale=kernel32.NlsUpdateLocale") 1126 | #pragma comment(linker, "/export:OpenEventA=kernel32.OpenEventA") 1127 | #pragma comment(linker, "/export:OpenEventW=kernel32.OpenEventW") 1128 | #pragma comment(linker, "/export:OpenFileMappingW=kernel32.OpenFileMappingW") 1129 | #pragma comment(linker, "/export:OpenJobObjectW=kernel32.OpenJobObjectW") 1130 | #pragma comment(linker, "/export:OpenMutexA=kernel32.OpenMutexA") 1131 | #pragma comment(linker, "/export:OpenMutexW=kernel32.OpenMutexW") 1132 | #pragma comment(linker, "/export:OpenProcess=kernel32.OpenProcess") 1133 | #pragma comment(linker, "/export:OpenSemaphoreA=kernel32.OpenSemaphoreA") 1134 | #pragma comment(linker, "/export:OpenSemaphoreW=kernel32.OpenSemaphoreW") 1135 | #pragma comment(linker, "/export:OpenThread=kernel32.OpenThread") 1136 | #pragma comment(linker, "/export:OpenWaitableTimerA=kernel32.OpenWaitableTimerA") 1137 | #pragma comment(linker, "/export:OpenWaitableTimerW=kernel32.OpenWaitableTimerW") 1138 | #pragma comment(linker, "/export:OutputDebugStringA=kernel32.OutputDebugStringA") 1139 | #pragma comment(linker, "/export:OutputDebugStringW=kernel32.OutputDebugStringW") 1140 | #pragma comment(linker, "/export:PeekConsoleInputA=kernel32.PeekConsoleInputA") 1141 | #pragma comment(linker, "/export:PeekNamedPipe=kernel32.PeekNamedPipe") 1142 | #pragma comment(linker, "/export:PostQueuedCompletionStatus=kernel32.PostQueuedCompletionStatus") 1143 | #pragma comment(linker, "/export:QueryDepthSList=kernel32.QueryDepthSList") 1144 | #pragma comment(linker, "/export:QueryPerformanceCounter=kernel32.QueryPerformanceCounter") 1145 | #pragma comment(linker, "/export:QueryPerformanceFrequency=kernel32.QueryPerformanceFrequency") 1146 | #pragma comment(linker, "/export:QueryProcessorSchedulingStatistics") 1147 | #pragma comment(linker, "/export:QueryThreadpoolStackInformation=kernel32.QueryThreadpoolStackInformation") 1148 | #pragma comment(linker, "/export:QueueUserAPC=kernel32.QueueUserAPC") 1149 | #pragma comment(linker, "/export:QueueUserWorkItem=kernel32.QueueUserWorkItem") 1150 | #pragma comment(linker, "/export:RaiseException=kernel32.RaiseException") 1151 | #pragma comment(linker, "/export:RaiseFailFastException=kernel32.RaiseFailFastException") 1152 | #pragma comment(linker, "/export:ReadConsoleInputA=kernel32.ReadConsoleInputA") 1153 | #pragma comment(linker, "/export:ReadConsoleInputW=kernel32.ReadConsoleInputW") 1154 | #pragma comment(linker, "/export:ReadConsoleW=kernel32.ReadConsoleW") 1155 | #pragma comment(linker, "/export:ReadFile=kernel32.ReadFile") 1156 | #pragma comment(linker, "/export:ReadFileEx=kernel32.ReadFileEx") 1157 | #pragma comment(linker, "/export:ReadFileScatter=kernel32.ReadFileScatter") 1158 | #pragma comment(linker, "/export:ReadProcessMemory=kernel32.ReadProcessMemory") 1159 | #pragma comment(linker, "/export:RegCloseKey=kernel32.RegCloseKey") 1160 | #pragma comment(linker, "/export:RegCreateKeyExW=kernel32.RegCreateKeyExW") 1161 | #pragma comment(linker, "/export:RegCreateKeyW=advapi32.RegCreateKeyW") 1162 | #pragma comment(linker, "/export:RegDeleteKeyExW=kernel32.RegDeleteKeyExW") 1163 | #pragma comment(linker, "/export:RegDeleteKeyW=advapi32.RegDeleteKeyW") 1164 | #pragma comment(linker, "/export:RegDeleteValueW=kernel32.RegDeleteValueW") 1165 | #pragma comment(linker, "/export:RegEnumKeyExW=kernel32.RegEnumKeyExW") 1166 | #pragma comment(linker, "/export:RegEnumKeyW=advapi32.RegEnumKeyW") 1167 | #pragma comment(linker, "/export:RegEnumValueW=kernel32.RegEnumValueW") 1168 | #pragma comment(linker, "/export:RegOpenKeyExW=kernel32.RegOpenKeyExW") 1169 | #pragma comment(linker, "/export:RegOpenKeyW=advapi32.RegOpenKeyW") 1170 | #pragma comment(linker, "/export:RegQueryInfoKeyW=kernel32.RegQueryInfoKeyW") 1171 | #pragma comment(linker, "/export:RegQueryValueExW=kernel32.RegQueryValueExW") 1172 | #pragma comment(linker, "/export:RegSetValueExW=kernel32.RegSetValueExW") 1173 | #pragma comment(linker, "/export:RegisterTraceGuidsW=kernelbase.RegisterTraceGuidsW") 1174 | #pragma comment(linker, "/export:RegisterWaitForSingleObject=kernel32.RegisterWaitForSingleObject") 1175 | #pragma comment(linker, "/export:ReleaseMutex=kernel32.ReleaseMutex") 1176 | #pragma comment(linker, "/export:ReleaseMutexWhenCallbackReturns=kernel32.ReleaseMutexWhenCallbackReturns") 1177 | #pragma comment(linker, "/export:ReleaseSRWLockExclusive=kernel32.ReleaseSRWLockExclusive") 1178 | #pragma comment(linker, "/export:ReleaseSRWLockShared=kernel32.ReleaseSRWLockShared") 1179 | #pragma comment(linker, "/export:ReleaseSemaphore=kernel32.ReleaseSemaphore") 1180 | #pragma comment(linker, "/export:ReleaseSemaphoreWhenCallbackReturns=kernel32.ReleaseSemaphoreWhenCallbackReturns") 1181 | #pragma comment(linker, "/export:RemoveDirectoryA=kernel32.RemoveDirectoryA") 1182 | #pragma comment(linker, "/export:RemoveDirectoryW=kernel32.RemoveDirectoryW") 1183 | #pragma comment(linker, "/export:RemoveVectoredContinueHandler=kernel32.RemoveVectoredContinueHandler") 1184 | #pragma comment(linker, "/export:RemoveVectoredExceptionHandler=kernel32.RemoveVectoredExceptionHandler") 1185 | #pragma comment(linker, "/export:ResetEvent=kernel32.ResetEvent") 1186 | #pragma comment(linker, "/export:ResolveLocaleName=kernel32.ResolveLocaleName") 1187 | #pragma comment(linker, "/export:RestoreLastError=kernel32.RestoreLastError") 1188 | #pragma comment(linker, "/export:ResumeThread=kernel32.ResumeThread") 1189 | #pragma comment(linker, "/export:RtlCaptureContext=kernel32.RtlCaptureContext") 1190 | #pragma comment(linker, "/export:RtlCaptureStackBackTrace=kernel32.RtlCaptureStackBackTrace") 1191 | #pragma comment(linker, "/export:RtlLookupFunctionEntry=kernel32.RtlLookupFunctionEntry") 1192 | #pragma comment(linker, "/export:RtlPcToFileHeader=kernel32.RtlPcToFileHeader") 1193 | #pragma comment(linker, "/export:RtlRaiseException=kernel32.RtlRaiseException") 1194 | #pragma comment(linker, "/export:RtlRestoreContext=kernel32.RtlRestoreContext") 1195 | #pragma comment(linker, "/export:RtlUnwind=kernel32.RtlUnwind") 1196 | #pragma comment(linker, "/export:RtlUnwindEx=kernel32.RtlUnwindEx") 1197 | #pragma comment(linker, "/export:RtlVirtualUnwind=kernel32.RtlVirtualUnwind") 1198 | #pragma comment(linker, "/export:SearchPathW=kernel32.SearchPathW") 1199 | #pragma comment(linker, "/export:SetConsoleCtrlHandler=kernel32.SetConsoleCtrlHandler") 1200 | #pragma comment(linker, "/export:SetConsoleMode=kernel32.SetConsoleMode") 1201 | #pragma comment(linker, "/export:SetCriticalSectionSpinCount=kernel32.SetCriticalSectionSpinCount") 1202 | #pragma comment(linker, "/export:SetCurrentDirectoryA=kernel32.SetCurrentDirectoryA") 1203 | #pragma comment(linker, "/export:SetCurrentDirectoryW=kernel32.SetCurrentDirectoryW") 1204 | #pragma comment(linker, "/export:SetDynamicTimeZoneInformation=kernel32.SetDynamicTimeZoneInformation") 1205 | #pragma comment(linker, "/export:SetEndOfFile=kernel32.SetEndOfFile") 1206 | #pragma comment(linker, "/export:SetEnvironmentStringsW=kernel32.SetEnvironmentStringsW") 1207 | #pragma comment(linker, "/export:SetEnvironmentVariableA=kernel32.SetEnvironmentVariableA") 1208 | #pragma comment(linker, "/export:SetEnvironmentVariableW=kernel32.SetEnvironmentVariableW") 1209 | #pragma comment(linker, "/export:SetErrorMode=kernel32.SetErrorMode") 1210 | #pragma comment(linker, "/export:SetEvent=kernel32.SetEvent") 1211 | #pragma comment(linker, "/export:SetEventWhenCallbackReturns=kernel32.SetEventWhenCallbackReturns") 1212 | #pragma comment(linker, "/export:SetFileAttributesA=kernel32.SetFileAttributesA") 1213 | #pragma comment(linker, "/export:SetFileAttributesW=kernel32.SetFileAttributesW") 1214 | #pragma comment(linker, "/export:SetFileInformationByHandle=kernel32.SetFileInformationByHandle") 1215 | #pragma comment(linker, "/export:SetFilePointer=kernel32.SetFilePointer") 1216 | #pragma comment(linker, "/export:SetFilePointerEx=kernel32.SetFilePointerEx") 1217 | #pragma comment(linker, "/export:SetFileTime=kernel32.SetFileTime") 1218 | #pragma comment(linker, "/export:SetFileValidData=kernel32.SetFileValidData") 1219 | #pragma comment(linker, "/export:SetHandleInformation=kernel32.SetHandleInformation") 1220 | #pragma comment(linker, "/export:SetLastError=kernel32.SetLastError") 1221 | #pragma comment(linker, "/export:SetLocalTime=kernel32.SetLocalTime") 1222 | #pragma comment(linker, "/export:SetNamedPipeHandleState=kernel32.SetNamedPipeHandleState") 1223 | #pragma comment(linker, "/export:SetProcessAffinityMask=kernel32.SetProcessAffinityMask") 1224 | #pragma comment(linker, "/export:SetProcessPriorityBoost=kernel32.SetProcessPriorityBoost") 1225 | #pragma comment(linker, "/export:SetProcessWorkingSetSize=kernel32.SetProcessWorkingSetSize") 1226 | #pragma comment(linker, "/export:SetStdHandle=kernel32.SetStdHandle") 1227 | #pragma comment(linker, "/export:SetStdHandleEx=kernel32.SetStdHandleEx") 1228 | #pragma comment(linker, "/export:SetSystemFileCacheSize=kernel32.SetSystemFileCacheSize") 1229 | #pragma comment(linker, "/export:SetThreadAffinityMask=kernel32.SetThreadAffinityMask") 1230 | #pragma comment(linker, "/export:SetThreadContext=kernel32.SetThreadContext") 1231 | #pragma comment(linker, "/export:SetThreadGroupAffinity=kernel32.SetThreadGroupAffinity") 1232 | #pragma comment(linker, "/export:SetThreadIdealProcessorEx=kernel32.SetThreadIdealProcessorEx") 1233 | #pragma comment(linker, "/export:SetThreadLocale=kernel32.SetThreadLocale") 1234 | #pragma comment(linker, "/export:SetThreadName") 1235 | #pragma comment(linker, "/export:SetThreadPriority=kernel32.SetThreadPriority") 1236 | #pragma comment(linker, "/export:SetThreadPriorityBoost=kernel32.SetThreadPriorityBoost") 1237 | #pragma comment(linker, "/export:SetThreadStackGuarantee=kernel32.SetThreadStackGuarantee") 1238 | #pragma comment(linker, "/export:SetThreadpoolAffinityMask") 1239 | #pragma comment(linker, "/export:SetThreadpoolStackInformation=kernel32.SetThreadpoolStackInformation") 1240 | #pragma comment(linker, "/export:SetThreadpoolThreadMaximum=kernel32.SetThreadpoolThreadMaximum") 1241 | #pragma comment(linker, "/export:SetThreadpoolThreadMinimum=kernel32.SetThreadpoolThreadMinimum") 1242 | #pragma comment(linker, "/export:SetThreadpoolTimer=kernel32.SetThreadpoolTimer") 1243 | #pragma comment(linker, "/export:SetThreadpoolWait=kernel32.SetThreadpoolWait") 1244 | #pragma comment(linker, "/export:SetUnhandledExceptionFilter=kernel32.SetUnhandledExceptionFilter") 1245 | #pragma comment(linker, "/export:SetUserGeoID=kernel32.SetUserGeoID") 1246 | #pragma comment(linker, "/export:SetWaitableTimer=kernel32.SetWaitableTimer") 1247 | #pragma comment(linker, "/export:SetWaitableTimerEx=kernel32.SetWaitableTimerEx") 1248 | #pragma comment(linker, "/export:SetXStateFeaturesMask=kernel32.SetXStateFeaturesMask") 1249 | #pragma comment(linker, "/export:SignalObjectAndWait=kernel32.SignalObjectAndWait") 1250 | #pragma comment(linker, "/export:SizeofResource=kernel32.SizeofResource") 1251 | #pragma comment(linker, "/export:Sleep=kernel32.Sleep") 1252 | #pragma comment(linker, "/export:SleepConditionVariableCS=kernel32.SleepConditionVariableCS") 1253 | #pragma comment(linker, "/export:SleepConditionVariableSRW=kernel32.SleepConditionVariableSRW") 1254 | #pragma comment(linker, "/export:SleepEx=kernel32.SleepEx") 1255 | #pragma comment(linker, "/export:StartThreadpoolIo=kernel32.StartThreadpoolIo") 1256 | #pragma comment(linker, "/export:SubmitThreadpoolWork=kernel32.SubmitThreadpoolWork") 1257 | #pragma comment(linker, "/export:SuspendThread=kernel32.SuspendThread") 1258 | #pragma comment(linker, "/export:SwitchToFiber=kernel32.SwitchToFiber") 1259 | #pragma comment(linker, "/export:SwitchToThread=kernel32.SwitchToThread") 1260 | #pragma comment(linker, "/export:SystemTimeToFileTime=kernel32.SystemTimeToFileTime") 1261 | #pragma comment(linker, "/export:SystemTimeToTzSpecificLocalTime=kernel32.SystemTimeToTzSpecificLocalTime") 1262 | #pragma comment(linker, "/export:TerminateProcess=kernel32.TerminateProcess") 1263 | #pragma comment(linker, "/export:TerminateThread=kernel32.TerminateThread") 1264 | #pragma comment(linker, "/export:TitleMemoryStatus") 1265 | #pragma comment(linker, "/export:TlsAlloc=kernel32.TlsAlloc") 1266 | #pragma comment(linker, "/export:TlsFree=kernel32.TlsFree") 1267 | #pragma comment(linker, "/export:TlsGetValue=kernel32.TlsGetValue") 1268 | #pragma comment(linker, "/export:TlsSetValue=kernel32.TlsSetValue") 1269 | #pragma comment(linker, "/export:ToolingMemoryStatus") 1270 | #pragma comment(linker, "/export:TraceEvent=kernelbase.TraceEvent") 1271 | #pragma comment(linker, "/export:TraceMessage=kernelbase.TraceMessage") 1272 | #pragma comment(linker, "/export:TraceMessageVa=kernelbase.TraceMessageVa") 1273 | #pragma comment(linker, "/export:TryAcquireSRWLockExclusive=kernel32.TryAcquireSRWLockExclusive") 1274 | #pragma comment(linker, "/export:TryAcquireSRWLockShared=kernel32.TryAcquireSRWLockShared") 1275 | #pragma comment(linker, "/export:TryEnterCriticalSection=kernel32.TryEnterCriticalSection") 1276 | #pragma comment(linker, "/export:TrySubmitThreadpoolCallback=kernel32.TrySubmitThreadpoolCallback") 1277 | #pragma comment(linker, "/export:TzSpecificLocalTimeToSystemTime=kernel32.TzSpecificLocalTimeToSystemTime") 1278 | #pragma comment(linker, "/export:UnhandledExceptionFilter=kernel32.UnhandledExceptionFilter") 1279 | #pragma comment(linker, "/export:UnlockFile=kernel32.UnlockFile") 1280 | #pragma comment(linker, "/export:UnlockFileEx=kernel32.UnlockFileEx") 1281 | #pragma comment(linker, "/export:UnmapViewOfFile=kernel32.UnmapViewOfFile") 1282 | #pragma comment(linker, "/export:UnregisterTraceGuids=kernelbase.UnregisterTraceGuids") 1283 | #pragma comment(linker, "/export:UnregisterWaitEx=kernel32.UnregisterWaitEx") 1284 | #pragma comment(linker, "/export:UpdateProcThreadAttribute=kernel32.UpdateProcThreadAttribute") 1285 | #pragma comment(linker, "/export:VirtualAlloc=EraVirtualAlloc") 1286 | #pragma comment(linker, "/export:VirtualAllocEx=EraVirtualAllocEx") 1287 | #pragma comment(linker, "/export:VirtualFree=EraVirtualFree") 1288 | #pragma comment(linker, "/export:VirtualFreeEx=EraVirtualFreeEx") 1289 | #pragma comment(linker, "/export:VirtualProtect=EraVirtualProtect") 1290 | #pragma comment(linker, "/export:VirtualProtectEx=EraVirtualProtectEx") 1291 | #pragma comment(linker, "/export:VirtualQuery=EraVirtualQuery") 1292 | #pragma comment(linker, "/export:VirtualQueryEx=EraVirtualQueryEx") 1293 | #pragma comment(linker, "/export:WaitForMultipleObjects=kernel32.WaitForMultipleObjects") 1294 | #pragma comment(linker, "/export:WaitForMultipleObjectsEx=kernel32.WaitForMultipleObjectsEx") 1295 | #pragma comment(linker, "/export:WaitForSingleObject=kernel32.WaitForSingleObject") 1296 | #pragma comment(linker, "/export:WaitForSingleObjectEx=kernel32.WaitForSingleObjectEx") 1297 | #pragma comment(linker, "/export:WaitForThreadpoolIoCallbacks=kernel32.WaitForThreadpoolIoCallbacks") 1298 | #pragma comment(linker, "/export:WaitForThreadpoolTimerCallbacks=kernel32.WaitForThreadpoolTimerCallbacks") 1299 | #pragma comment(linker, "/export:WaitForThreadpoolWaitCallbacks=kernel32.WaitForThreadpoolWaitCallbacks") 1300 | #pragma comment(linker, "/export:WaitForThreadpoolWorkCallbacks=kernel32.WaitForThreadpoolWorkCallbacks") 1301 | #pragma comment(linker, "/export:WaitNamedPipeW=kernel32.WaitNamedPipeW") 1302 | #pragma comment(linker, "/export:WaitOnAddress=kernelbase.WaitOnAddress") 1303 | #pragma comment(linker, "/export:WakeAllConditionVariable=kernel32.WakeAllConditionVariable") 1304 | #pragma comment(linker, "/export:WakeByAddressAll=kernelbase.WakeByAddressAll") 1305 | #pragma comment(linker, "/export:WakeByAddressSingle=kernelbase.WakeByAddressSingle") 1306 | #pragma comment(linker, "/export:WakeConditionVariable=kernel32.WakeConditionVariable") 1307 | #pragma comment(linker, "/export:WerRegisterFile=kernel32.WerRegisterFile") 1308 | #pragma comment(linker, "/export:WerUnregisterFile=kernel32.WerUnregisterFile") 1309 | #pragma comment(linker, "/export:WideCharToMultiByte=kernel32.WideCharToMultiByte") 1310 | #pragma comment(linker, "/export:WriteConsoleW=kernel32.WriteConsoleW") 1311 | #pragma comment(linker, "/export:WriteFile=kernel32.WriteFile") 1312 | #pragma comment(linker, "/export:WriteFileEx=kernel32.WriteFileEx") 1313 | #pragma comment(linker, "/export:WriteFileGather=kernel32.WriteFileGather") 1314 | #pragma comment(linker, "/export:WriteProcessMemory=kernel32.WriteProcessMemory") 1315 | #pragma comment(linker, "/export:XMemAlloc") 1316 | #pragma comment(linker, "/export:XMemAllocDefault") 1317 | #pragma comment(linker, "/export:XMemCheckDefaultHeaps") 1318 | #pragma comment(linker, "/export:XMemFree") 1319 | #pragma comment(linker, "/export:XMemFreeDefault") 1320 | #pragma comment(linker, "/export:XMemGetAllocationHysteresis") 1321 | #pragma comment(linker, "/export:XMemGetAllocationStatistics") 1322 | #pragma comment(linker, "/export:XMemGetAuxiliaryTitleMemory") 1323 | #pragma comment(linker, "/export:XMemPreallocateFreeSpace") 1324 | #pragma comment(linker, "/export:XMemReleaseAuxiliaryTitleMemory") 1325 | #pragma comment(linker, "/export:XMemSetAllocationHooks") 1326 | #pragma comment(linker, "/export:XMemSetAllocationHysteresis") 1327 | #pragma comment(linker, "/export:lstrcmpA=kernel32.lstrcmpA") 1328 | #pragma comment(linker, "/export:lstrcmpW=kernel32.lstrcmpW") 1329 | #pragma comment(linker, "/export:lstrcmpiA=kernel32.lstrcmpiA") 1330 | #pragma comment(linker, "/export:lstrcmpiW=kernel32.lstrcmpiW") 1331 | 1332 | // Extensions 1333 | #pragma comment(linker, "/export:MapTitleEsramPages") 1334 | --------------------------------------------------------------------------------