MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / ProbeForReadSmallStructure

Function ProbeForReadSmallStructure

KernelLibrary/kDbgCore.h:658–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656#if defined(_AMD64_)
657
658FORCEINLINE
659VOID
660ProbeForReadSmallStructure(
661 IN PVOID Address,
662 IN SIZE_T Size,
663 IN ULONG Alignment
664)
665
666/*++
667Routine Description:
668 Probes a structure for read access whose size is known at compile time.
669 N.B. A NULL structure address is not allowed.
670Arguments:
671 Address - Supples a pointer to the structure.
672 Size - Supplies the size of the structure.
673 Alignment - Supplies the alignment of structure.
674Return Value:
675 None
676--*/
677
678{
679
680 ASSERT((Alignment == 1) || (Alignment == 2) ||
681 (Alignment == 4) || (Alignment == 8) ||
682 (Alignment == 16));
683
684 if ((Size == 0) || (Size >= 0x10000)) {
685
686 ASSERT(0);
687
688 ProbeForRead(Address, Size, Alignment);
689
690 }
691 else {
692 if (((ULONG_PTR)Address & (Alignment - 1)) != 0) {
693 ExRaiseDatatypeMisalignment();
694 }
695
696 if ((PUCHAR)Address >= (UCHAR* const)MM_USER_PROBE_ADDRESS) {
697 Address = (UCHAR* const)MM_USER_PROBE_ADDRESS;
698 }
699
700 _ReadWriteBarrier();
701 *(volatile UCHAR*)Address;
702 }
703}
704
705#else
706

Callers 1

DbgkpPostModuleMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected