Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d108ff79
Commit
d108ff79
authored
Dec 28, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: NtQuerySection takes SIZE_T parameters.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
decf34e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
14 deletions
+22
-14
loader.c
dlls/kernel32/tests/loader.c
+5
-5
virtual.c
dlls/kernel32/tests/virtual.c
+15
-7
virtual.c
dlls/ntdll/virtual.c
+1
-1
winternl.h
include/winternl.h
+1
-1
No files found.
dlls/kernel32/tests/loader.c
View file @
d108ff79
...
...
@@ -52,7 +52,7 @@ static DWORD page_size;
static
NTSTATUS
(
WINAPI
*
pNtCreateSection
)(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
LARGE_INTEGER
*
,
ULONG
,
ULONG
,
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySection
)(
HANDLE
,
SECTION_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySection
)(
HANDLE
,
SECTION_INFORMATION_CLASS
,
void
*
,
SIZE_T
,
SIZE_T
*
);
static
NTSTATUS
(
WINAPI
*
pNtMapViewOfSection
)(
HANDLE
,
HANDLE
,
PVOID
*
,
ULONG
,
SIZE_T
,
const
LARGE_INTEGER
*
,
SIZE_T
*
,
ULONG
,
ULONG
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pNtUnmapViewOfSection
)(
HANDLE
,
PVOID
);
static
NTSTATUS
(
WINAPI
*
pNtQueryInformationProcess
)(
HANDLE
,
PROCESSINFOCLASS
,
PVOID
,
ULONG
,
PULONG
);
...
...
@@ -239,7 +239,7 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
{
SECTION_BASIC_INFORMATION
info
;
SECTION_IMAGE_INFORMATION
image
;
ULONG
info_size
=
0xdeadbeef
;
SIZE_T
info_size
=
(
SIZE_T
)
0xdeadbeef
<<
16
;
NTSTATUS
status
;
HANDLE
file
,
mapping
;
ULONG
file_size
;
...
...
@@ -265,7 +265,7 @@ static BOOL query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
}
status
=
pNtQuerySection
(
mapping
,
SectionImageInformation
,
&
image
,
sizeof
(
image
),
&
info_size
);
ok
(
!
status
,
"%u: NtQuerySection failed err %x
\n
"
,
id
,
status
);
ok
(
info_size
==
sizeof
(
image
),
"%u: NtQuerySection wrong size %u
\n
"
,
id
,
info_size
);
ok
(
info_size
==
sizeof
(
image
),
"%u: NtQuerySection wrong size %
l
u
\n
"
,
id
,
info_size
);
if
(
nt_header
->
OptionalHeader
.
Magic
==
(
sizeof
(
void
*
)
>
sizeof
(
int
)
?
IMAGE_NT_OPTIONAL_HDR64_MAGIC
:
IMAGE_NT_OPTIONAL_HDR32_MAGIC
))
{
...
...
@@ -405,10 +405,10 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header, int line )
if
(
!
status
)
{
SECTION_BASIC_INFORMATION
info
;
ULONG
info_size
=
0xdeadbeef
;
SIZE_T
info_size
=
0xdeadbeef
;
NTSTATUS
ret
=
pNtQuerySection
(
map
,
SectionBasicInformation
,
&
info
,
sizeof
(
info
),
&
info_size
);
ok
(
!
ret
,
"NtQuerySection failed err %x
\n
"
,
ret
);
ok
(
info_size
==
sizeof
(
info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
info
.
Attributes
==
(
SEC_IMAGE
|
SEC_FILE
),
"NtQuerySection wrong attr %x
\n
"
,
info
.
Attributes
);
ok
(
info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
info
.
BaseAddress
);
ok
(
info
.
Size
.
QuadPart
==
file_size
,
"NtQuerySection wrong size %x%08x / %08x
\n
"
,
...
...
dlls/kernel32/tests/virtual.c
View file @
d108ff79
...
...
@@ -46,7 +46,7 @@ static NTSTATUS (WINAPI *pNtCreateSection)(HANDLE *, ACCESS_MASK, const OBJECT_A
const
LARGE_INTEGER
*
,
ULONG
,
ULONG
,
HANDLE
);
static
NTSTATUS
(
WINAPI
*
pNtMapViewOfSection
)(
HANDLE
,
HANDLE
,
PVOID
*
,
ULONG
,
SIZE_T
,
const
LARGE_INTEGER
*
,
SIZE_T
*
,
ULONG
,
ULONG
,
ULONG
);
static
DWORD
(
WINAPI
*
pNtUnmapViewOfSection
)(
HANDLE
,
PVOID
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySection
)(
HANDLE
,
SECTION_INFORMATION_CLASS
,
void
*
,
ULONG
,
ULONG
*
);
static
NTSTATUS
(
WINAPI
*
pNtQuerySection
)(
HANDLE
,
SECTION_INFORMATION_CLASS
,
void
*
,
SIZE_T
,
SIZE_T
*
);
static
PVOID
(
WINAPI
*
pRtlAddVectoredExceptionHandler
)(
ULONG
,
PVECTORED_EXCEPTION_HANDLER
);
static
ULONG
(
WINAPI
*
pRtlRemoveVectoredExceptionHandler
)(
PVOID
);
static
BOOL
(
WINAPI
*
pGetProcessDEPPolicy
)(
HANDLE
,
LPDWORD
,
PBOOL
);
...
...
@@ -502,7 +502,7 @@ static void test_MapViewOfFile(void)
BOOL
ret
;
SIZE_T
size
;
NTSTATUS
status
;
ULONG
info_size
;
SIZE_T
info_size
;
LARGE_INTEGER
map_size
;
SetLastError
(
0xdeadbeef
);
...
...
@@ -722,10 +722,11 @@ static void test_MapViewOfFile(void)
CloseHandle
(
mapping
);
mapping
=
OpenFileMappingA
(
FILE_MAP_READ
|
SECTION_QUERY
,
FALSE
,
name
);
ok
(
mapping
!=
0
,
"OpenFileMapping FILE_MAP_READ error %u
\n
"
,
GetLastError
()
);
info_size
=
(
SIZE_T
)
0xdeadbeef
<<
16
;
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
section_info
,
sizeof
(
section_info
),
&
info_size
);
ok
(
!
status
,
"NtQuerySection failed err %x
\n
"
,
status
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
section_info
.
Attributes
==
SEC_COMMIT
,
"NtQuerySection wrong attr %08x
\n
"
,
section_info
.
Attributes
);
ok
(
section_info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
section_info
.
BaseAddress
);
...
...
@@ -764,7 +765,7 @@ static void test_MapViewOfFile(void)
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
section_info
,
sizeof
(
section_info
),
&
info_size
);
ok
(
!
status
,
"NtQuerySection failed err %x
\n
"
,
status
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
section_info
.
Attributes
==
SEC_COMMIT
,
"NtQuerySection wrong attr %08x
\n
"
,
section_info
.
Attributes
);
ok
(
section_info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
section_info
.
BaseAddress
);
...
...
@@ -1070,7 +1071,7 @@ static void test_MapViewOfFile(void)
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
section_info
,
sizeof
(
section_info
),
&
info_size
);
ok
(
!
status
,
"NtQuerySection failed err %x
\n
"
,
status
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
section_info
.
Attributes
==
SEC_FILE
,
"NtQuerySection wrong attr %08x
\n
"
,
section_info
.
Attributes
);
ok
(
section_info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
section_info
.
BaseAddress
);
...
...
@@ -1163,7 +1164,7 @@ static void test_MapViewOfFile(void)
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
section_info
,
sizeof
(
section_info
),
&
info_size
);
ok
(
!
status
,
"NtQuerySection failed err %x
\n
"
,
status
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
section_info
.
Attributes
==
SEC_FILE
,
"NtQuerySection wrong attr %08x
\n
"
,
section_info
.
Attributes
);
ok
(
section_info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
section_info
.
BaseAddress
);
...
...
@@ -1178,7 +1179,7 @@ static void test_MapViewOfFile(void)
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
section_info
,
sizeof
(
section_info
),
&
info_size
);
ok
(
!
status
,
"NtQuerySection failed err %x
\n
"
,
status
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %u
\n
"
,
info_size
);
ok
(
info_size
==
sizeof
(
section_info
),
"NtQuerySection wrong size %
l
u
\n
"
,
info_size
);
ok
(
section_info
.
Attributes
==
SEC_FILE
,
"NtQuerySection wrong attr %08x
\n
"
,
section_info
.
Attributes
);
ok
(
section_info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
section_info
.
BaseAddress
);
...
...
@@ -1236,6 +1237,13 @@ static void test_MapViewOfFile(void)
ok
(
status
==
STATUS_SECTION_NOT_IMAGE
,
"NtQuerySection failed err %x
\n
"
,
status
);
status
=
pNtQuerySection
(
mapping
,
SectionImageInformation
,
&
image_info
,
sizeof
(
image_info
)
+
1
,
NULL
);
ok
(
status
==
STATUS_SECTION_NOT_IMAGE
,
"NtQuerySection failed err %x
\n
"
,
status
);
if
(
sizeof
(
SIZE_T
)
>
sizeof
(
int
))
{
status
=
pNtQuerySection
(
mapping
,
SectionImageInformation
,
&
image_info
,
sizeof
(
image_info
)
+
((
SIZE_T
)
0x10000000
<<
8
),
NULL
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"NtQuerySection wrong err %x
\n
"
,
status
);
}
CloseHandle
(
mapping
);
SetFilePointer
(
file
,
0
,
NULL
,
FILE_BEGIN
);
...
...
dlls/ntdll/virtual.c
View file @
d108ff79
...
...
@@ -3161,7 +3161,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
* ZwQuerySection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQuerySection
(
HANDLE
handle
,
SECTION_INFORMATION_CLASS
class
,
void
*
ptr
,
ULONG
size
,
ULONG
*
ret_size
)
SIZE_T
size
,
SIZE_T
*
ret_size
)
{
NTSTATUS
status
;
pe_image_info_t
image_info
;
...
...
include/winternl.h
View file @
d108ff79
...
...
@@ -2321,7 +2321,7 @@ NTSYSAPI NTSTATUS WINAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID,
NTSYSAPI
NTSTATUS
WINAPI
NtQueryOpenSubKeys
(
POBJECT_ATTRIBUTES
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQueryPerformanceCounter
(
PLARGE_INTEGER
,
PLARGE_INTEGER
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySecurityObject
(
HANDLE
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
,
ULONG
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySection
(
HANDLE
,
SECTION_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySection
(
HANDLE
,
SECTION_INFORMATION_CLASS
,
PVOID
,
SIZE_T
,
SIZE_T
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySemaphore
(
HANDLE
,
SEMAPHORE_INFORMATION_CLASS
,
PVOID
,
ULONG
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySymbolicLinkObject
(
HANDLE
,
PUNICODE_STRING
,
PULONG
);
NTSYSAPI
NTSTATUS
WINAPI
NtQuerySystemEnvironmentValue
(
PUNICODE_STRING
,
PWCHAR
,
ULONG
,
PULONG
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment