| 656 | #if defined(_AMD64_) |
| 657 | |
| 658 | FORCEINLINE |
| 659 | VOID |
| 660 | ProbeForReadSmallStructure( |
| 661 | IN PVOID Address, |
| 662 | IN SIZE_T Size, |
| 663 | IN ULONG Alignment |
| 664 | ) |
| 665 | |
| 666 | /*++ |
| 667 | Routine 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. |
| 670 | Arguments: |
| 671 | Address - Supples a pointer to the structure. |
| 672 | Size - Supplies the size of the structure. |
| 673 | Alignment - Supplies the alignment of structure. |
| 674 | Return 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 |
no outgoing calls
no test coverage detected