Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
2602df14
Commit
2602df14
authored
Jul 26, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement the SectionBasicInformation class of NtQuerySection.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ddc6360
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
23 deletions
+60
-23
loader.c
dlls/kernel32/tests/loader.c
+17
-2
virtual.c
dlls/kernel32/tests/virtual.c
+0
-0
nt.c
dlls/ntdll/nt.c
+0
-19
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-2
virtual.c
dlls/ntdll/virtual.c
+35
-0
mapping.c
server/mapping.c
+6
-0
No files found.
dlls/kernel32/tests/loader.c
View file @
2602df14
...
...
@@ -52,6 +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
*
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
);
...
...
@@ -241,8 +242,21 @@ static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header )
file
=
CreateFileA
(
dll_name
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile error %d
\n
"
,
GetLastError
());
status
=
pNtCreateSection
(
&
map
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_MAP_READ
,
NULL
,
&
size
,
PAGE_READONLY
,
SEC_IMAGE
,
file
);
status
=
pNtCreateSection
(
&
map
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_MAP_READ
|
SECTION_QUERY
,
NULL
,
&
size
,
PAGE_READONLY
,
SEC_IMAGE
,
file
);
if
(
!
status
)
{
SECTION_BASIC_INFORMATION
info
;
ULONG
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
.
Attributes
==
(
SEC_IMAGE
|
SEC_FILE
),
"NtQuerySection wrong attr %x
\n
"
,
info
.
Attributes
);
ok
(
info
.
BaseAddress
==
NULL
,
"NtQuerySection wrong base %p
\n
"
,
info
.
BaseAddress
);
todo_wine
ok
(
info
.
Size
.
QuadPart
==
size
.
QuadPart
,
"NtQuerySection wrong size %x%08x / %x%08x
\n
"
,
info
.
Size
.
u
.
HighPart
,
info
.
Size
.
u
.
LowPart
,
size
.
u
.
HighPart
,
size
.
u
.
LowPart
);
}
if
(
map
)
CloseHandle
(
map
);
CloseHandle
(
file
);
DeleteFileA
(
dll_name
);
...
...
@@ -2777,6 +2791,7 @@ START_TEST(loader)
ntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
pNtCreateSection
=
(
void
*
)
GetProcAddress
(
ntdll
,
"NtCreateSection"
);
pNtQuerySection
=
(
void
*
)
GetProcAddress
(
ntdll
,
"NtQuerySection"
);
pNtMapViewOfSection
=
(
void
*
)
GetProcAddress
(
ntdll
,
"NtMapViewOfSection"
);
pNtUnmapViewOfSection
=
(
void
*
)
GetProcAddress
(
ntdll
,
"NtUnmapViewOfSection"
);
pNtTerminateProcess
=
(
void
*
)
GetProcAddress
(
ntdll
,
"NtTerminateProcess"
);
...
...
dlls/kernel32/tests/virtual.c
View file @
2602df14
This diff is collapsed.
Click to expand it.
dlls/ntdll/nt.c
View file @
2602df14
...
...
@@ -646,25 +646,6 @@ NTSTATUS WINAPI NtPrivilegeCheck(
}
/*
* Section
*/
/******************************************************************************
* NtQuerySection [NTDLL.@]
*/
NTSTATUS
WINAPI
NtQuerySection
(
IN
HANDLE
SectionHandle
,
IN
SECTION_INFORMATION_CLASS
SectionInformationClass
,
OUT
PVOID
SectionInformation
,
IN
ULONG
Length
,
OUT
PULONG
ResultLength
)
{
FIXME
(
"(%p,%d,%p,0x%08x,%p) stub!
\n
"
,
SectionHandle
,
SectionInformationClass
,
SectionInformation
,
Length
,
ResultLength
);
return
0
;
}
/*
* ports
*/
...
...
dlls/ntdll/ntdll.spec
View file @
2602df14
...
...
@@ -269,7 +269,7 @@
@ stdcall NtQueryPerformanceCounter(ptr ptr)
# @ stub NtQueryPortInformationProcess
# @ stub NtQueryQuotaInformationFile
@ stdcall NtQuerySection
(long long long long long
)
@ stdcall NtQuerySection
(long long ptr long ptr
)
@ stdcall NtQuerySecurityObject (long long long long long)
@ stdcall NtQuerySemaphore (long long ptr long ptr)
@ stdcall NtQuerySymbolicLinkObject(long ptr ptr)
...
...
@@ -1194,7 +1194,7 @@
@ stdcall ZwQueryPerformanceCounter(ptr ptr) NtQueryPerformanceCounter
# @ stub ZwQueryPortInformationProcess
# @ stub ZwQueryQuotaInformationFile
@ stdcall ZwQuerySection
(long long long long long
) NtQuerySection
@ stdcall ZwQuerySection
(long long ptr long ptr
) NtQuerySection
@ stdcall ZwQuerySecurityObject (long long long long long) NtQuerySecurityObject
@ stdcall ZwQuerySemaphore(long long ptr long ptr) NtQuerySemaphore
@ stdcall ZwQuerySymbolicLinkObject(long ptr ptr) NtQuerySymbolicLinkObject
...
...
dlls/ntdll/virtual.c
View file @
2602df14
...
...
@@ -2761,6 +2761,41 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
}
/******************************************************************************
* NtQuerySection (NTDLL.@)
* ZwQuerySection (NTDLL.@)
*/
NTSTATUS
WINAPI
NtQuerySection
(
HANDLE
handle
,
SECTION_INFORMATION_CLASS
class
,
void
*
ptr
,
ULONG
size
,
ULONG
*
ret_size
)
{
NTSTATUS
status
;
SECTION_BASIC_INFORMATION
*
basic_info
=
ptr
;
if
(
class
!=
SectionBasicInformation
)
{
FIXME
(
"class %u not implemented
\n
"
,
class
);
return
STATUS_NOT_IMPLEMENTED
;
}
if
(
size
<
sizeof
(
*
basic_info
))
return
STATUS_INFO_LENGTH_MISMATCH
;
SERVER_START_REQ
(
get_mapping_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
access
=
SECTION_QUERY
;
if
(
!
(
status
=
wine_server_call
(
req
)))
{
basic_info
->
Attributes
=
reply
->
flags
;
basic_info
->
BaseAddress
=
NULL
;
basic_info
->
Size
.
QuadPart
=
reply
->
size
;
if
(
ret_size
)
*
ret_size
=
sizeof
(
*
basic_info
);
}
}
SERVER_END_REQ
;
return
status
;
}
/***********************************************************************
* NtFlushVirtualMemory (NTDLL.@)
* ZwFlushVirtualMemory (NTDLL.@)
...
...
server/mapping.c
View file @
2602df14
...
...
@@ -704,6 +704,12 @@ DECL_HANDLER(get_mapping_info)
reply
->
header_size
=
mapping
->
header_size
;
reply
->
base
=
mapping
->
base
;
if
(
!
(
req
->
access
&
(
SECTION_MAP_READ
|
SECTION_MAP_WRITE
)))
/* query only */
{
release_object
(
mapping
);
return
;
}
if
((
mapping
->
flags
&
SEC_IMAGE
)
&&
mapping
->
cpu
!=
current
->
process
->
cpu
)
{
set_error
(
STATUS_INVALID_IMAGE_FORMAT
);
...
...
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