mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Updated ntdll-NtQuerySection patchset
Warning fixes.
This commit is contained in:
parent
d29bc4b9e7
commit
74300a69fb
@ -1,17 +1,17 @@
|
||||
From 21d673afd6f937a90c4bf4a578f6b3bcf4aa2940 Mon Sep 17 00:00:00 2001
|
||||
From 75ee9968e8532dcadd39163ff93db9a5c81fb799 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)
|
||||
Subject: [PATCH] kernel32/tests: Add tests for NtQuerySection. (try 2)
|
||||
|
||||
---
|
||||
dlls/kernel32/tests/virtual.c | 245 ++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/kernel32/tests/virtual.c | 245 ++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 245 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c
|
||||
index 46b019c5817..b0c3db0fb76 100644
|
||||
index 365194b9065..167df789abf 100644
|
||||
--- a/dlls/kernel32/tests/virtual.c
|
||||
+++ b/dlls/kernel32/tests/virtual.c
|
||||
@@ -57,6 +57,23 @@ static NTSTATUS (WINAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, SIZE_T *, ULONG)
|
||||
@@ -54,6 +54,23 @@ static PVOID (WINAPI *pVirtualAllocFromApp)(PVOID, SIZE_T, DWORD, DWORD);
|
||||
|
||||
/* ############################### */
|
||||
|
||||
@ -35,7 +35,7 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
static HANDLE create_target_process(const char *arg)
|
||||
{
|
||||
char **argv;
|
||||
@@ -4204,6 +4221,233 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
|
||||
@@ -4240,6 +4257,233 @@ static void test_shared_memory_ro(BOOL is_child, DWORD child_access)
|
||||
CloseHandle(mapping);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ file = CreateFileA(path, GENERIC_READ|GENERIC_EXECUTE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
|
||||
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile error %u\n", GetLastError());
|
||||
+ ok(file != INVALID_HANDLE_VALUE, "CreateFile error %lu\n", GetLastError());
|
||||
+
|
||||
+ fsize = GetFileSize(file, NULL);
|
||||
+
|
||||
@ -79,35 +79,35 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
+ /* NT4 and win2k don't support EXEC on file mappings */
|
||||
+ if (!mapping)
|
||||
+ mapping = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, NULL, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#x\n", status);
|
||||
+ ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, 0, NULL);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, 0, &ret);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#Ix, got %#lx/%08lx\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, sizeof(info.basic), &ret);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SECTION_NOT_IMAGE, "expected STATUS_SECTION_NOT_IMAGE, got %#x\n", status);
|
||||
+ ok(status == STATUS_SECTION_NOT_IMAGE, "expected STATUS_SECTION_NOT_IMAGE, got %#lx\n", status);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ p = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
|
||||
+ ok(p != NULL, "MapViewOfFile error %u\n", GetLastError());
|
||||
+ ok(p != NULL, "MapViewOfFile error %lu\n", GetLastError());
|
||||
+
|
||||
+ nt = image_nt_header(p);
|
||||
+ image_size = ROUND_SIZE(p, nt->OptionalHeader.SizeOfImage);
|
||||
@ -115,11 +115,11 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#Ix, got %#lx/%08lx\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ UnmapViewOfFile(p);
|
||||
+ CloseHandle(mapping);
|
||||
@ -129,46 +129,46 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
+ /* NT4 and win2k don't support EXEC on file mappings */
|
||||
+ if (!mapping)
|
||||
+ mapping = CreateFileMappingA(file, NULL, PAGE_READONLY|SEC_IMAGE, 0, 0, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == (SEC_FILE|SEC_IMAGE), "expected SEC_FILE|SEC_IMAGE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == image_size, "expected %#lx, got %#x/%08x\n", image_size, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == (SEC_FILE|SEC_IMAGE), "expected SEC_FILE|SEC_IMAGE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == image_size, "expected %#Ix, got %#lx/%08lx\n", image_size, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, NULL, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#x\n", status);
|
||||
+ ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, 0, NULL);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, 0, &ret);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, sizeof(info.basic), &ret);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#x\n", status);
|
||||
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %#lx\n", status);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ p = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
|
||||
+ ok(p != NULL, "MapViewOfFile error %u\n", GetLastError());
|
||||
+ ok(p != NULL, "MapViewOfFile error %lu\n", GetLastError());
|
||||
+
|
||||
+ nt = image_nt_header(p);
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionImageInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.image), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.image), "wrong returned size %Iu\n", ret);
|
||||
+ ok((ULONG_PTR)info.image.TransferAddress == nt->OptionalHeader.ImageBase + nt->OptionalHeader.AddressOfEntryPoint,
|
||||
+ "expected %#lx, got %p\n", (SIZE_T)(nt->OptionalHeader.ImageBase + nt->OptionalHeader.AddressOfEntryPoint), info.image.TransferAddress);
|
||||
+ ok(info.image.ZeroBits == 0, "expected 0, got %#x\n", info.image.ZeroBits);
|
||||
+ ok(info.image.MaximumStackSize == nt->OptionalHeader.SizeOfStackReserve, "expected %#lx, got %#lx\n", (SIZE_T)nt->OptionalHeader.SizeOfStackReserve, info.image.MaximumStackSize);
|
||||
+ ok(info.image.CommittedStackSize == nt->OptionalHeader.SizeOfStackCommit, "expected %#lx, got %#lx\n", (SIZE_T)nt->OptionalHeader.SizeOfStackCommit, info.image.CommittedStackSize);
|
||||
+ ok(info.image.SubSystemType == nt->OptionalHeader.Subsystem, "expected %#x, got %#x\n", nt->OptionalHeader.Subsystem, info.image.SubSystemType);
|
||||
+ "expected %#Ix, got %p\n", (SIZE_T)(nt->OptionalHeader.ImageBase + nt->OptionalHeader.AddressOfEntryPoint), info.image.TransferAddress);
|
||||
+ ok(info.image.ZeroBits == 0, "expected 0, got %#lx\n", info.image.ZeroBits);
|
||||
+ ok(info.image.MaximumStackSize == nt->OptionalHeader.SizeOfStackReserve, "expected %#Ix, got %#Ix\n", (SIZE_T)nt->OptionalHeader.SizeOfStackReserve, info.image.MaximumStackSize);
|
||||
+ ok(info.image.CommittedStackSize == nt->OptionalHeader.SizeOfStackCommit, "expected %#Ix, got %#Ix\n", (SIZE_T)nt->OptionalHeader.SizeOfStackCommit, info.image.CommittedStackSize);
|
||||
+ ok(info.image.SubSystemType == nt->OptionalHeader.Subsystem, "expected %#x, got %#lx\n", nt->OptionalHeader.Subsystem, info.image.SubSystemType);
|
||||
+ ok(info.image.MinorSubsystemVersion == nt->OptionalHeader.MinorSubsystemVersion, "expected %#x, got %#x\n", nt->OptionalHeader.MinorSubsystemVersion, info.image.MinorSubsystemVersion);
|
||||
+ ok(info.image.MajorSubsystemVersion == nt->OptionalHeader.MajorSubsystemVersion, "expected %#x, got %#x\n", nt->OptionalHeader.MajorSubsystemVersion, info.image.MajorSubsystemVersion);
|
||||
+ ok(info.image.ImageCharacteristics == nt->FileHeader.Characteristics, "expected %#x, got %#x\n", nt->FileHeader.Characteristics, info.image.ImageCharacteristics);
|
||||
@ -180,88 +180,88 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == (SEC_FILE|SEC_IMAGE), "expected SEC_FILE|SEC_IMAGE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == image_size, "expected %#lx, got %#x/%08x\n", image_size, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == (SEC_FILE|SEC_IMAGE), "expected SEC_FILE|SEC_IMAGE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == image_size, "expected %#Ix, got %#lx/%08lx\n", image_size, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ UnmapViewOfFile(p);
|
||||
+ CloseHandle(mapping);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ mapping = CreateFileMappingA(file, NULL, PAGE_READONLY|SEC_COMMIT|SEC_NOCACHE, 0, 0, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+todo_wine
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#Ix, got %#lx/%08lx\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ CloseHandle(mapping);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ mapping = CreateFileMappingA(file, NULL, PAGE_READONLY|SEC_RESERVE, 0, 0, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#lx, got %#x/%08x\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_FILE, "expected SEC_FILE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == fsize, "expected %#Ix, got %#lx/%08lx\n", fsize, info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ CloseHandle(mapping);
|
||||
+ CloseHandle(file);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE|SEC_COMMIT, 0, 4096, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_COMMIT, "expected SEC_COMMIT, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#x/%08x\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_COMMIT, "expected SEC_COMMIT, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#lx/%08lx\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ p = MapViewOfFile(mapping, FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, 0);
|
||||
+ ok(p != NULL, "MapViewOfFile error %u\n", GetLastError());
|
||||
+ ok(p != NULL, "MapViewOfFile error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_COMMIT, "expected SEC_COMMIT, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#x/%08x\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_COMMIT, "expected SEC_COMMIT, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#lx/%08lx\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ UnmapViewOfFile(p);
|
||||
+ CloseHandle(mapping);
|
||||
+
|
||||
+ SetLastError(0xdeadbef);
|
||||
+ mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READONLY|SEC_RESERVE, 0, 4096, NULL);
|
||||
+ ok(mapping != 0, "CreateFileMapping error %u\n", GetLastError());
|
||||
+ ok(mapping != 0, "CreateFileMapping error %lu\n", GetLastError());
|
||||
+
|
||||
+ memset(&info, 0x55, sizeof(info));
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQuerySection(mapping, SectionBasicInformation, &info, sizeof(info), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#x\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %u\n", ret);
|
||||
+ ok(status == STATUS_SUCCESS, "NtQuerySection error %#lx\n", status);
|
||||
+ ok(ret == sizeof(info.basic), "wrong returned size %Iu\n", ret);
|
||||
+ ok(info.basic.BaseAddress == NULL, "expected NULL, got %p\n", info.basic.BaseAddress);
|
||||
+ ok(info.basic.Attributes == SEC_RESERVE, "expected SEC_RESERVE, got %#x\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#x/%08x\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+ ok(info.basic.Attributes == SEC_RESERVE, "expected SEC_RESERVE, got %#lx\n", info.basic.Attributes);
|
||||
+ ok(info.basic.Size.QuadPart == 4096, "expected 4096, got %#lx/%08lx\n", info.basic.Size.HighPart, info.basic.Size.LowPart);
|
||||
+
|
||||
+ CloseHandle(mapping);
|
||||
+}
|
||||
@ -269,7 +269,7 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
START_TEST(virtual)
|
||||
{
|
||||
int argc;
|
||||
@@ -4270,6 +4514,7 @@ START_TEST(virtual)
|
||||
@@ -4304,6 +4548,7 @@ START_TEST(virtual)
|
||||
test_shared_memory_ro(FALSE, FILE_MAP_COPY);
|
||||
test_shared_memory_ro(FALSE, FILE_MAP_COPY|FILE_MAP_WRITE);
|
||||
test_mappings();
|
||||
@ -278,5 +278,5 @@ index 46b019c5817..b0c3db0fb76 100644
|
||||
test_VirtualAlloc_protection();
|
||||
test_VirtualProtect();
|
||||
--
|
||||
2.14.1
|
||||
2.35.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user