417{
433 struct
434 {
438 } *UserStruct;
441
443 if (
skip(MyPage !=
NULL,
"Out of memory\n"))
444 return;
450
452 if (
skip(ZeroPageContents !=
NULL,
"Out of memory\n"))
453 {
455 return;
456 }
458
461 {
464 return;
465 }
466
469
471 &SectionName,
472 0,
478 {
479
482 Status = ZwMapViewOfSection(SectionHandle,
485 0,
486 0,
487 &ZeroPagePhysical,
490 0,
494 {
497 ZeroPageContents,
502 }
503
504
507 Status = ZwMapViewOfSection(SectionHandle,
510 0,
511 0,
512 &ZeroPagePhysical,
515 0,
519 {
522 ZeroPageContents,
527 }
528
529
532 Status = ZwMapViewOfSection(SectionHandle,
535 0,
536 0,
537 &MyPagePhysical,
540 0,
544 {
547 MyPage,
550
552 ok(MappingBytes[5] == 0x23,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
553 ok(MyPage[5] == 0x23,
"MyPage[5] = 0x%x\n", MyPage[5]);
554
555 MyPage[5] = 0x44;
556 ok(MappingBytes[5] == 0x44,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
557 ok(MyPage[5] == 0x44,
"MyPage[5] = 0x%x\n", MyPage[5]);
558
559 MappingBytes[5] = 0x88;
560 ok(MappingBytes[5] == 0x88,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
561 ok(MyPage[5] == 0x88,
"MyPage[5] = 0x%x\n", MyPage[5]);
562
565 }
566
567
571 Status = ZwMapViewOfSection(SectionHandle,
574 0,
575 0,
579 0,
583 {
588
590 MyPage,
593
596 }
597
598
603 &UserMem,
604 0,
605 &UserSize,
610 UserStruct = UserMem;
611
612
614 &BasicInfo,
615 sizeof(BasicInfo),
619
620
624 Status = ZwMapViewOfSection(SectionHandle,
627 0,
628 0,
632 0,
637
638
639 if (!
skip(UserStruct !=
NULL,
"No user memory\n"))
640 {
646
650 0,
651 0,
655 0,
659 {
663 }
664 }
665
666
670 Status = ZwMapViewOfSection(SectionHandle,
673 0,
674 0,
678 0,
683
684
686 {
692
696 0,
697 0,
701 0,
705 {
709 }
710 }
711
712
716 Status = ZwMapViewOfSection(SectionHandle,
719 0,
720 0,
724 0,
729
730
732 {
738
742 0,
743 0,
747 0,
751 {
755 }
756 }
757
758
760 {
761 UserSize = 0;
763 &UserMem,
764 &UserSize,
767 }
768
771 }
772
773
779 Status = ZwCreateSection(&SectionHandle,
784 0x80000000,
789
790
792 {
803 0x80000000,
809 }
810
827
830}
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
#define ok_eq_ulong(value, expected)
#define ok_eq_size(value, expected)
void user(int argc, const char *argv[])
static PVOID Mapping[EMS_PHYSICAL_PAGES]
#define ExAllocatePoolWithTag(hernya, size, tag)
#define RtlCompareMemory(s1, s2, l)
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
#define RtlFillMemory(Dest, Length, Fill)
VOID NTAPI MmUnmapIoSpace(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes)
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
#define ExFreePoolWithTag(_P, _T)
static char memory[1024 *256]
NTSYSAPI NTSTATUS NTAPI ZwOpenSection(_Out_ PHANDLE SectionHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
#define SECTION_ALL_ACCESS
#define NtCurrentProcess()
PHYSICAL_ADDRESS NTAPI MmGetPhysicalAddress(IN PVOID Address)
#define STATUS_INVALID_PARAMETER_6
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
#define RtlCopyMemory(Destination, Source, Length)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
#define ZwCurrentProcess()