@@ -1150,17 +1150,18 @@ MiMapViewInSystemSpace(
11501150
11511151static
11521152NTSTATUS
1153- MiMapViewOfDataSection (IN PCONTROL_AREA ControlArea ,
1154- IN PEPROCESS Process ,
1155- IN PVOID * BaseAddress ,
1156- IN PLARGE_INTEGER SectionOffset ,
1157- IN PSIZE_T ViewSize ,
1158- IN PSECTION Section ,
1159- IN SECTION_INHERIT InheritDisposition ,
1160- IN ULONG ProtectionMask ,
1161- IN SIZE_T CommitSize ,
1162- IN ULONG_PTR ZeroBits ,
1163- IN ULONG AllocationType )
1153+ MiMapViewOfDataSection (
1154+ _In_ PCONTROL_AREA ControlArea ,
1155+ _In_ PEPROCESS Process ,
1156+ _Outptr_result_bytebuffer_ (* ViewSize ) _Pre_opt_valid_ PVOID * BaseAddress ,
1157+ _Inout_ PLARGE_INTEGER SectionOffset ,
1158+ _Inout_ PSIZE_T ViewSize ,
1159+ _In_ PSECTION Section ,
1160+ _In_range_ (ViewShare , ViewUnmap ) SECTION_INHERIT InheritDisposition ,
1161+ _In_ ULONG ProtectionMask ,
1162+ _In_ SIZE_T CommitSize ,
1163+ _In_ ULONG_PTR ZeroBits ,
1164+ _In_ ULONG AllocationType )
11641165{
11651166 PMMVAD_LONG Vad ;
11661167 ULONG_PTR StartAddress ;
@@ -2530,16 +2531,20 @@ MmCreateArm3Section(OUT PVOID *SectionObject,
25302531 */
25312532NTSTATUS
25322533NTAPI
2533- MmMapViewOfArm3Section (IN PVOID SectionObject ,
2534- IN PEPROCESS Process ,
2535- IN OUT PVOID * BaseAddress ,
2536- IN ULONG_PTR ZeroBits ,
2537- IN SIZE_T CommitSize ,
2538- IN OUT PLARGE_INTEGER SectionOffset OPTIONAL ,
2539- IN OUT PSIZE_T ViewSize ,
2540- IN SECTION_INHERIT InheritDisposition ,
2541- IN ULONG AllocationType ,
2542- IN ULONG Protect )
2534+ MmMapViewOfArm3Section (
2535+ _In_ PVOID SectionObject ,
2536+ _In_ PEPROCESS Process ,
2537+ _Outptr_result_bytebuffer_ (* ViewSize )
2538+ _When_ (* ViewSize != 0 , _Pre_opt_valid_ )
2539+ _When_ (* ViewSize == 0 , _Pre_valid_ )
2540+ PVOID * BaseAddress ,
2541+ _In_ ULONG_PTR ZeroBits ,
2542+ _In_ SIZE_T CommitSize ,
2543+ _Inout_ PLARGE_INTEGER SectionOffset ,
2544+ _Inout_ PSIZE_T ViewSize ,
2545+ _In_range_ (ViewShare , ViewUnmap ) SECTION_INHERIT InheritDisposition ,
2546+ _In_ ULONG AllocationType ,
2547+ _In_ ULONG Protect )
25432548{
25442549 KAPC_STATE ApcState ;
25452550 BOOLEAN Attached = FALSE;
@@ -3256,16 +3261,17 @@ NtOpenSection(OUT PHANDLE SectionHandle,
32563261
32573262NTSTATUS
32583263NTAPI
3259- NtMapViewOfSection (IN HANDLE SectionHandle ,
3260- IN HANDLE ProcessHandle ,
3261- IN OUT PVOID * BaseAddress ,
3262- IN ULONG_PTR ZeroBits ,
3263- IN SIZE_T CommitSize ,
3264- IN OUT PLARGE_INTEGER SectionOffset OPTIONAL ,
3265- IN OUT PSIZE_T ViewSize ,
3266- IN SECTION_INHERIT InheritDisposition ,
3267- IN ULONG AllocationType ,
3268- IN ULONG Protect )
3264+ NtMapViewOfSection (
3265+ _In_ HANDLE SectionHandle ,
3266+ _In_ HANDLE ProcessHandle ,
3267+ _Outptr_result_bytebuffer_ (* ViewSize ) _Pre_valid_ PVOID * BaseAddress ,
3268+ _In_ ULONG_PTR ZeroBits ,
3269+ _In_ SIZE_T CommitSize ,
3270+ _Inout_opt_ PLARGE_INTEGER SectionOffset ,
3271+ _Inout_ PSIZE_T ViewSize ,
3272+ _In_range_ (ViewShare , ViewUnmap ) SECTION_INHERIT InheritDisposition ,
3273+ _In_ ULONG AllocationType ,
3274+ _In_ ULONG Win32Protect )
32693275{
32703276 PVOID SafeBaseAddress ;
32713277 LARGE_INTEGER SafeSectionOffset ;
@@ -3299,7 +3305,7 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
32993305 }
33003306
33013307 /* Convert the protection mask, and validate it */
3302- ProtectionMask = MiMakeProtectionMask (Protect );
3308+ ProtectionMask = MiMakeProtectionMask (Win32Protect );
33033309 if (ProtectionMask == MM_INVALID_PROTECTION )
33043310 {
33053311 DPRINT1 ("Invalid page protection\n" );
@@ -3442,7 +3448,7 @@ NtMapViewOfSection(IN HANDLE SectionHandle,
34423448 & SafeViewSize ,
34433449 InheritDisposition ,
34443450 AllocationType ,
3445- Protect );
3451+ Win32Protect );
34463452
34473453 /* Return data only on success */
34483454 if (NT_SUCCESS (Status ))
0 commit comments