402{
418 struct
419 {
423 } *UserStruct;
426
428 if (
skip(MyPage !=
NULL,
"Out of memory\n"))
429 return;
435
437 if (
skip(ZeroPageContents !=
NULL,
"Out of memory\n"))
438 {
440 return;
441 }
443
446 {
449 return;
450 }
451
454
456 &SectionName,
457 0,
463 {
464
467 Status = ZwMapViewOfSection(SectionHandle,
470 0,
471 0,
472 &ZeroPagePhysical,
475 0,
479 {
482 ZeroPageContents,
487 }
488
489
492 Status = ZwMapViewOfSection(SectionHandle,
495 0,
496 0,
497 &ZeroPagePhysical,
500 0,
504 {
507 ZeroPageContents,
512 }
513
514
517 Status = ZwMapViewOfSection(SectionHandle,
520 0,
521 0,
522 &MyPagePhysical,
525 0,
529 {
532 MyPage,
535
537 ok(MappingBytes[5] == 0x23,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
538 ok(MyPage[5] == 0x23,
"MyPage[5] = 0x%x\n", MyPage[5]);
539
540 MyPage[5] = 0x44;
541 ok(MappingBytes[5] == 0x44,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
542 ok(MyPage[5] == 0x44,
"MyPage[5] = 0x%x\n", MyPage[5]);
543
544 MappingBytes[5] = 0x88;
545 ok(MappingBytes[5] == 0x88,
"Mapping[5] = 0x%x\n", MappingBytes[5]);
546 ok(MyPage[5] == 0x88,
"MyPage[5] = 0x%x\n", MyPage[5]);
547
550 }
551
552
556 Status = ZwMapViewOfSection(SectionHandle,
559 0,
560 0,
564 0,
568 {
572
574 MyPage,
577
580 }
581
582
587 &UserMem,
588 0,
589 &UserSize,
594 UserStruct = UserMem;
595
596
598 &BasicInfo,
599 sizeof(BasicInfo),
603
604
608 Status = ZwMapViewOfSection(SectionHandle,
611 0,
612 0,
616 0,
621
622
623 if (!
skip(UserStruct !=
NULL,
"No user memory\n"))
624 {
630
634 0,
635 0,
639 0,
643 {
647 }
648 }
649
650
654 Status = ZwMapViewOfSection(SectionHandle,
657 0,
658 0,
662 0,
667
668
670 {
676
680 0,
681 0,
685 0,
689 {
693 }
694 }
695
696
700 Status = ZwMapViewOfSection(SectionHandle,
703 0,
704 0,
708 0,
713
714
716 {
722
726 0,
727 0,
731 0,
735 {
739 }
740 }
741
742
744 {
745 UserSize = 0;
747 &UserMem,
748 &UserSize,
751 }
752
755 }
756
757
763 Status = ZwCreateSection(&SectionHandle,
768 0x80000000,
773
774
776 {
787 0x80000000,
793 }
794
811
814}
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()