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
1f1d4da5
Commit
1f1d4da5
authored
Feb 17, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fill the handle attributes in System(Extended)HandleInformation.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
835f5fff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
16 deletions
+37
-16
info.c
dlls/ntdll/tests/info.c
+19
-5
system.c
dlls/ntdll/unix/system.c
+7
-5
server_protocol.h
include/wine/server_protocol.h
+2
-1
handle.c
server/handle.c
+6
-3
protocol.def
server/protocol.def
+1
-0
trace.c
server/trace.c
+2
-2
No files found.
dlls/ntdll/tests/info.c
View file @
1f1d4da5
...
...
@@ -542,11 +542,14 @@ static void test_query_handle(void)
ULONG
SystemInformationLength
=
sizeof
(
SYSTEM_HANDLE_INFORMATION
);
SYSTEM_HANDLE_INFORMATION
*
shi
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SystemInformationLength
);
HANDLE
EventHandle
;
BOOL
found
;
BOOL
found
,
ret
;
INT
i
;
EventHandle
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
EventHandle
!=
NULL
,
"CreateEventA failed %u
\n
"
,
GetLastError
()
);
ret
=
SetHandleInformation
(
EventHandle
,
HANDLE_FLAG_INHERIT
|
HANDLE_FLAG_PROTECT_FROM_CLOSE
,
HANDLE_FLAG_INHERIT
|
HANDLE_FLAG_PROTECT_FROM_CLOSE
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
/* Request the needed length : a SystemInformationLength greater than one struct sets ReturnLength */
ReturnLength
=
0xdeadbeef
;
...
...
@@ -581,11 +584,22 @@ static void test_query_handle(void)
goto
done
;
}
for
(
i
=
0
,
found
=
FALSE
;
i
<
shi
->
Count
&&
!
found
;
i
++
)
found
=
(
shi
->
Handle
[
i
].
OwnerPid
==
GetCurrentProcessId
())
&&
((
HANDLE
)(
ULONG_PTR
)
shi
->
Handle
[
i
].
HandleValue
==
EventHandle
);
found
=
FALSE
;
for
(
i
=
0
;
i
<
shi
->
Count
;
i
++
)
{
if
(
shi
->
Handle
[
i
].
OwnerPid
==
GetCurrentProcessId
()
&&
(
HANDLE
)(
ULONG_PTR
)
shi
->
Handle
[
i
].
HandleValue
==
EventHandle
)
{
ok
(
shi
->
Handle
[
i
].
HandleFlags
==
(
OBJ_INHERIT
|
OBJ_PROTECT_CLOSE
),
"got attributes %#x
\n
"
,
shi
->
Handle
[
i
].
HandleFlags
);
found
=
TRUE
;
break
;
}
}
ok
(
found
,
"Expected to find event handle %p (pid %x) in handle list
\n
"
,
EventHandle
,
GetCurrentProcessId
()
);
ret
=
SetHandleInformation
(
EventHandle
,
HANDLE_FLAG_PROTECT_FROM_CLOSE
,
0
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
CloseHandle
(
EventHandle
);
ReturnLength
=
0xdeadbeef
;
...
...
@@ -645,7 +659,7 @@ static void test_query_handle_ex(void)
if
(
info
->
Handles
[
i
].
UniqueProcessId
==
GetCurrentProcessId
()
&&
(
HANDLE
)
info
->
Handles
[
i
].
HandleValue
==
event
)
{
todo_wine
ok
(
info
->
Handles
[
i
].
HandleAttributes
==
(
OBJ_INHERIT
|
OBJ_PROTECT_CLOSE
),
ok
(
info
->
Handles
[
i
].
HandleAttributes
==
(
OBJ_INHERIT
|
OBJ_PROTECT_CLOSE
),
"got flags %#x
\n
"
,
info
->
Handles
[
i
].
HandleAttributes
);
ok
(
info
->
Handles
[
i
].
GrantedAccess
==
EVENT_ALL_ACCESS
,
"got access %#x
\n
"
,
info
->
Handles
[
i
].
GrantedAccess
);
found
=
TRUE
;
...
...
dlls/ntdll/unix/system.c
View file @
1f1d4da5
...
...
@@ -2446,7 +2446,8 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
shi
->
Handle
[
i
].
OwnerPid
=
handle_info
[
i
].
owner
;
shi
->
Handle
[
i
].
HandleValue
=
handle_info
[
i
].
handle
;
shi
->
Handle
[
i
].
AccessMask
=
handle_info
[
i
].
access
;
/* FIXME: Fill out ObjectType, HandleFlags, ObjectPointer */
shi
->
Handle
[
i
].
HandleFlags
=
handle_info
[
i
].
attributes
;
/* FIXME: Fill out ObjectType, ObjectPointer */
}
}
else
if
(
ret
==
STATUS_BUFFER_TOO_SMALL
)
...
...
@@ -2493,10 +2494,11 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class,
for
(
i
=
0
;
i
<
shi
->
NumberOfHandles
;
i
++
)
{
memset
(
&
shi
->
Handles
[
i
],
0
,
sizeof
(
shi
->
Handles
[
i
])
);
shi
->
Handles
[
i
].
UniqueProcessId
=
handle_info
[
i
].
owner
;
shi
->
Handles
[
i
].
HandleValue
=
handle_info
[
i
].
handle
;
shi
->
Handles
[
i
].
GrantedAccess
=
handle_info
[
i
].
access
;
/* FIXME: Fill out Object, HandleAttributes, ObjectTypeIndex */
shi
->
Handles
[
i
].
UniqueProcessId
=
handle_info
[
i
].
owner
;
shi
->
Handles
[
i
].
HandleValue
=
handle_info
[
i
].
handle
;
shi
->
Handles
[
i
].
GrantedAccess
=
handle_info
[
i
].
access
;
shi
->
Handles
[
i
].
HandleAttributes
=
handle_info
[
i
].
attributes
;
/* FIXME: Fill out Object, ObjectTypeIndex */
}
}
else
if
(
ret
==
STATUS_BUFFER_TOO_SMALL
)
...
...
include/wine/server_protocol.h
View file @
1f1d4da5
...
...
@@ -4543,6 +4543,7 @@ struct handle_info
process_id_t
owner
;
obj_handle_t
handle
;
unsigned
int
access
;
unsigned
int
attributes
;
};
...
...
@@ -6226,7 +6227,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 68
2
#define SERVER_PROTOCOL_VERSION 68
3
/* ### protocol_version end ### */
...
...
server/handle.c
View file @
1f1d4da5
...
...
@@ -830,9 +830,12 @@ static int enum_handles( struct process *process, void *user )
}
assert
(
info
->
count
);
handle
=
info
->
handle
++
;
handle
->
owner
=
process
->
id
;
handle
->
handle
=
index_to_handle
(
i
);
handle
->
access
=
entry
->
access
&
~
RESERVED_ALL
;
handle
->
owner
=
process
->
id
;
handle
->
handle
=
index_to_handle
(
i
);
handle
->
access
=
entry
->
access
&
~
RESERVED_ALL
;
handle
->
attributes
=
0
;
if
(
entry
->
access
&
RESERVED_INHERIT
)
handle
->
attributes
|=
OBJ_INHERIT
;
if
(
entry
->
access
&
RESERVED_CLOSE_PROTECT
)
handle
->
attributes
|=
OBJ_PROTECT_CLOSE
;
info
->
count
--
;
}
...
...
server/protocol.def
View file @
1f1d4da5
...
...
@@ -3197,6 +3197,7 @@ struct handle_info
process_id_t owner;
obj_handle_t handle;
unsigned int access;
unsigned int attributes;
};
/* Return a list of all opened handles */
...
...
server/trace.c
View file @
1f1d4da5
...
...
@@ -1342,8 +1342,8 @@ static void dump_varargs_handle_infos( const char *prefix, data_size_t size )
while
(
size
>=
sizeof
(
*
handle
))
{
handle
=
cur_data
;
fprintf
(
stderr
,
"{owner=%04x,handle=%04x,access=%08x}"
,
handle
->
owner
,
handle
->
handle
,
handle
->
access
);
fprintf
(
stderr
,
"{owner=%04x,handle=%04x,access=%08x
,attributes=%08x
}"
,
handle
->
owner
,
handle
->
handle
,
handle
->
access
,
handle
->
attributes
);
size
-=
sizeof
(
*
handle
);
remove_data
(
sizeof
(
*
handle
)
);
if
(
size
)
fputc
(
','
,
stderr
);
...
...
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