MCPcopy Create free account
hub / github.com/WinDurango/WinDurango / AllocateDriverMemory

Method AllocateDriverMemory

projects/WinDurango.KernelX/src/Logan.cpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void LoganHeap::AllocateDriverMemory()
66{
67 for (SIZE_T i = 0; i < ARRAYSIZE(_driverMemory); i++)
68 {
69 _driverMemory[i].sizeInBytes = 0x100000;
70 UINT Size = (_driverMemory[i].sizeInBytes + ((1ULL << 16) - 1)) & ~((1ULL << 16) - 1);
71 UINT NumPages = Size / (1ULL << 16);
72 _driverMemory[i].address = XMemAlloc(_driverMemory[i].sizeInBytes, c_XMemAttributes);
73 if (_driverMemory[i].address == 0)
74 {
75 throw GetLastError();
76 }
77 _driverMemory[i].apuAddress = BumpAlloc(_driverMemory[i].sizeInBytes);
78 Map(_driverMemory[i].address, _driverMemory[i].apuAddress, _driverMemory[i].sizeInBytes);
79 }
80}
81
82_Use_decl_annotations_ DWORD DispatchGetDriverMemory(DWORD IoControlCode, PVOID InBuffer, DWORD InBufferSize,
83 PVOID OutBuffer, DWORD OutBufferSize, PDWORD BytesReturned,

Callers 1

LoganInitFunction · 0.80

Calls 3

XMemAllocFunction · 0.85
GetLastErrorFunction · 0.85
BumpAllocFunction · 0.85

Tested by

no test coverage detected