| 182 | |
| 183 | _IRQL_requires_max_(DISPATCH_LEVEL) |
| 184 | BOOLEAN IsMemoryRangePresent(PVOID Address, SIZE_T Size) { |
| 185 | PVOID PageCounter = ALIGN_DOWN_POINTER_BY(Address, PAGE_SIZE); |
| 186 | do { |
| 187 | if (!IsPagePresent(PageCounter)) return FALSE; |
| 188 | PageCounter = reinterpret_cast<PVOID>(reinterpret_cast<SIZE_T>(PageCounter) + PAGE_SIZE); |
| 189 | } while (reinterpret_cast<SIZE_T>(PageCounter) < reinterpret_cast<SIZE_T>(Address) + Size); |
| 190 | return TRUE; |
| 191 | } |
| 192 | |
| 193 | _IRQL_requires_max_(APC_LEVEL) |
| 194 | BOOLEAN CheckUserMemoryReadable(__in_data_source(USER_MODE) PVOID UserAddress, SIZE_T Size) { |
no test coverage detected