| 593 | } |
| 594 | |
| 595 | BOOL WINAPI KbMapMemory( |
| 596 | OUT PMAPPING_INFO MappingInfo, |
| 597 | OPTIONAL UINT64 SrcProcessId, |
| 598 | OPTIONAL UINT64 DestProcessId, |
| 599 | WdkTypes::PVOID VirtualAddress, |
| 600 | ULONG Size, |
| 601 | WdkTypes::KPROCESSOR_MODE MapToAddressSpace, |
| 602 | ULONG Protect, |
| 603 | WdkTypes::MEMORY_CACHING_TYPE CacheType, |
| 604 | OPTIONAL WdkTypes::PVOID UserRequestedAddress |
| 605 | ) { |
| 606 | if (!MappingInfo || !Size) return FALSE; |
| 607 | KB_MAP_MEMORY_IN Input = {}; |
| 608 | KB_MAP_MEMORY_OUT Output = {}; |
| 609 | Input.SrcProcessId = SrcProcessId; |
| 610 | Input.DestProcessId = DestProcessId; |
| 611 | Input.VirtualAddress = VirtualAddress; |
| 612 | Input.Size = Size; |
| 613 | Input.MapToAddressSpace = MapToAddressSpace; |
| 614 | Input.Protect = Protect; |
| 615 | Input.CacheType = CacheType; |
| 616 | Input.UserRequestedAddress = UserRequestedAddress; |
| 617 | BOOL Status = KbSendRequest(Ctls::KbMapMemory, &Input, sizeof(Input), &Output, sizeof(Output)); |
| 618 | MappingInfo->MappedAddress = Output.BaseAddress; |
| 619 | MappingInfo->Mdl = Output.Mdl; |
| 620 | return Status; |
| 621 | } |
| 622 | |
| 623 | BOOL WINAPI KbUnmapMemory(IN PMAPPING_INFO MappingInfo) |
| 624 | { |
nothing calls this directly
no test coverage detected