Added patch to return failure in NtProtectVirtualMemory when last argument is omitted.

This commit is contained in:
Sebastian Lackner
2015-05-02 18:55:34 +02:00
parent e25c35e363
commit f23ff69f86
14 changed files with 354 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
From 26fabea3f9d17e404f802c130f6cb8c74b1d265d Mon Sep 17 00:00:00 2001
From 8ae00b9ad7636141e206f76ca685286311e44aca Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 16 Oct 2014 23:26:35 +0200
Subject: kernel32/tests: Add tests for NtQuerySection. (try 2)
@@ -8,14 +8,15 @@ Subject: kernel32/tests: Add tests for NtQuerySection. (try 2)
1 file changed, 258 insertions(+)
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
index 75e91d5..8abe554 100644
index 1c70eca..fcfb254 100644
--- a/dlls/kernel32/tests/virtual.c
+++ b/dlls/kernel32/tests/virtual.c
@@ -47,9 +47,27 @@ static struct _TEB * (WINAPI *pNtCurrentTeb)(void);
@@ -47,10 +47,28 @@ static struct _TEB * (WINAPI *pNtCurrentTeb)(void);
static PVOID (WINAPI *pRtlAddVectoredExceptionHandler)(ULONG, PVECTORED_EXCEPTION_HANDLER);
static ULONG (WINAPI *pRtlRemoveVectoredExceptionHandler)(PVOID);
static BOOL (WINAPI *pGetProcessDEPPolicy)(HANDLE, LPDWORD, PBOOL);
+static NTSTATUS (WINAPI *pNtQuerySection)(HANDLE, int, PVOID, ULONG, PULONG);
static NTSTATUS (WINAPI *pNtProtectVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG, ULONG *);
/* ############################### */
@@ -39,7 +40,7 @@ index 75e91d5..8abe554 100644
static HANDLE create_target_process(const char *arg)
{
char **argv;
@@ -3425,6 +3443,244 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
@@ -3447,6 +3465,244 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
CloseHandle(mapping);
}
@@ -284,14 +285,15 @@ index 75e91d5..8abe554 100644
START_TEST(virtual)
{
int argc;
@@ -3477,12 +3733,14 @@ START_TEST(virtual)
@@ -3499,6 +3755,7 @@ START_TEST(virtual)
pNtCurrentTeb = (void *)GetProcAddress( hntdll, "NtCurrentTeb" );
pRtlAddVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlAddVectoredExceptionHandler" );
pRtlRemoveVectoredExceptionHandler = (void *)GetProcAddress( hntdll, "RtlRemoveVectoredExceptionHandler" );
+ pNtQuerySection = (void *)GetProcAddress( hntdll, "NtQuerySection" );
pNtProtectVirtualMemory = (void *)GetProcAddress( hntdll, "NtProtectVirtualMemory" );
test_shared_memory(FALSE);
test_shared_memory_ro(FALSE, FILE_MAP_READ|FILE_MAP_WRITE);
@@ -3506,6 +3763,7 @@ START_TEST(virtual)
test_shared_memory_ro(FALSE, FILE_MAP_COPY);
test_shared_memory_ro(FALSE, FILE_MAP_COPY|FILE_MAP_WRITE);
test_mapping();
@@ -300,5 +302,5 @@ index 75e91d5..8abe554 100644
test_VirtualAlloc_protection();
test_VirtualProtect();
--
2.3.0
2.3.5

View File

@@ -1 +1,2 @@
Fixes: [37338] Support for NtQuerySection
Depends: ntdll-NtProtectVirtualMemory