| 63 | } |
| 64 | |
| 65 | void 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, |
no test coverage detected