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
77e74fb1
Commit
77e74fb1
authored
Jul 15, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtMakeTemporaryObject().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c7032e92
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
8 deletions
+76
-8
om.c
dlls/ntdll/om.c
+13
-3
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+4
-4
server_protocol.h
include/wine/server_protocol.h
+16
-1
handle.c
server/handle.c
+14
-0
object.c
server/object.c
+10
-0
object.h
server/object.h
+1
-0
protocol.def
server/protocol.def
+6
-0
request.h
server/request.h
+4
-0
trace.c
server/trace.c
+8
-0
No files found.
dlls/ntdll/om.c
View file @
77e74fb1
...
...
@@ -476,8 +476,18 @@ NTSTATUS WINAPI NtAllocateUuids( ULARGE_INTEGER *time, ULONG *delta, ULONG *sequ
* Success: STATUS_SUCCESS.
* Failure: An NTSTATUS error code.
*/
NTSTATUS
WINAPI
NtMakeTemporaryObject
(
HANDLE
H
andle
)
NTSTATUS
WINAPI
NtMakeTemporaryObject
(
HANDLE
h
andle
)
{
FIXME
(
"(%p), stub.
\n
"
,
Handle
);
return
STATUS_SUCCESS
;
NTSTATUS
ret
;
TRACE
(
"%p
\n
"
,
handle
);
SERVER_START_REQ
(
make_temporary
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
ret
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
return
ret
;
}
dlls/ntoskrnl.exe/tests/driver.c
View file @
77e74fb1
...
...
@@ -2056,20 +2056,20 @@ static void test_permanence(void)
status
=
ZwClose
(
handle
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwOpenDirectoryObject
(
&
handle
,
0
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
status
=
ZwCreateDirectoryObject
(
&
handle
,
GENERIC_ALL
,
&
attr
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
attr
.
Attributes
=
OBJ_PERMANENT
;
status
=
ZwOpenDirectoryObject
(
&
handle2
,
0
,
&
attr
);
ok
(
status
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
status
);
status
=
ZwClose
(
handle2
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwClose
(
handle
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
attr
.
Attributes
=
0
;
status
=
ZwOpenDirectoryObject
(
&
handle
,
0
,
&
attr
);
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
...
...
include/wine/server_protocol.h
View file @
77e74fb1
...
...
@@ -1218,6 +1218,18 @@ struct dup_handle_reply
struct
make_temporary_request
{
struct
request_header
__header
;
obj_handle_t
handle
;
};
struct
make_temporary_reply
{
struct
reply_header
__header
;
};
struct
open_process_request
{
struct
request_header
__header
;
...
...
@@ -5600,6 +5612,7 @@ enum request
REQ_close_handle
,
REQ_set_handle_info
,
REQ_dup_handle
,
REQ_make_temporary
,
REQ_open_process
,
REQ_open_thread
,
REQ_select
,
...
...
@@ -5894,6 +5907,7 @@ union generic_request
struct
close_handle_request
close_handle_request
;
struct
set_handle_info_request
set_handle_info_request
;
struct
dup_handle_request
dup_handle_request
;
struct
make_temporary_request
make_temporary_request
;
struct
open_process_request
open_process_request
;
struct
open_thread_request
open_thread_request
;
struct
select_request
select_request
;
...
...
@@ -6186,6 +6200,7 @@ union generic_reply
struct
close_handle_reply
close_handle_reply
;
struct
set_handle_info_reply
set_handle_info_reply
;
struct
dup_handle_reply
dup_handle_reply
;
struct
make_temporary_reply
make_temporary_reply
;
struct
open_process_reply
open_process_reply
;
struct
open_thread_reply
open_thread_reply
;
struct
select_reply
select_reply
;
...
...
@@ -6452,7 +6467,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 62
6
#define SERVER_PROTOCOL_VERSION 62
7
/* ### protocol_version end ### */
...
...
server/handle.c
View file @
77e74fb1
...
...
@@ -833,3 +833,17 @@ DECL_HANDLER(get_system_handles)
enum_processes
(
enum_handles
,
&
info
);
}
}
DECL_HANDLER
(
make_temporary
)
{
struct
object
*
obj
;
if
(
!
(
obj
=
get_handle_obj
(
current
->
process
,
req
->
handle
,
0
,
NULL
)))
return
;
if
(
obj
->
is_permanent
)
{
make_object_temporary
(
obj
);
release_object
(
obj
);
}
release_object
(
obj
);
}
server/object.c
View file @
77e74fb1
...
...
@@ -414,6 +414,16 @@ void make_object_static( struct object *obj )
#endif
}
/* mark an object as no longer static */
void
make_object_temporary
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
0
;
#ifdef DEBUG_OBJECTS
list_remove
(
&
obj
->
obj_list
);
list_add_head
(
&
object_list
,
&
obj
->
obj_list
);
#endif
}
/* grab an object (i.e. increment its refcount) and return the object */
struct
object
*
grab_object
(
void
*
ptr
)
{
...
...
server/object.h
View file @
77e74fb1
...
...
@@ -144,6 +144,7 @@ extern void *open_named_object( struct object *parent, const struct object_ops *
const
struct
unicode_str
*
name
,
unsigned
int
attributes
);
extern
void
unlink_named_object
(
struct
object
*
obj
);
extern
void
make_object_static
(
struct
object
*
obj
);
extern
void
make_object_temporary
(
struct
object
*
obj
);
extern
struct
namespace
*
create_namespace
(
unsigned
int
hash_size
);
extern
void
free_kernel_objects
(
struct
object
*
obj
);
/* grab/release_object can take any pointer, but you better make sure */
...
...
server/protocol.def
View file @
77e74fb1
...
...
@@ -1080,6 +1080,12 @@ struct rawinput_device
#define DUP_HANDLE_MAKE_GLOBAL 0x80000000 /* Not a Windows flag */
/* Make an object temporary */
@REQ(make_temporary)
obj_handle_t handle; /* handle to the object */
@END
/* Open a handle to a process */
@REQ(open_process)
process_id_t pid; /* process id to open */
...
...
server/request.h
View file @
77e74fb1
...
...
@@ -144,6 +144,7 @@ DECL_HANDLER(get_apc_result);
DECL_HANDLER
(
close_handle
);
DECL_HANDLER
(
set_handle_info
);
DECL_HANDLER
(
dup_handle
);
DECL_HANDLER
(
make_temporary
);
DECL_HANDLER
(
open_process
);
DECL_HANDLER
(
open_thread
);
DECL_HANDLER
(
select
);
...
...
@@ -437,6 +438,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] =
(
req_handler
)
req_close_handle
,
(
req_handler
)
req_set_handle_info
,
(
req_handler
)
req_dup_handle
,
(
req_handler
)
req_make_temporary
,
(
req_handler
)
req_open_process
,
(
req_handler
)
req_open_thread
,
(
req_handler
)
req_select
,
...
...
@@ -904,6 +906,8 @@ C_ASSERT( FIELD_OFFSET(struct dup_handle_reply, handle) == 8 );
C_ASSERT
(
FIELD_OFFSET
(
struct
dup_handle_reply
,
self
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
dup_handle_reply
,
closed
)
==
16
);
C_ASSERT
(
sizeof
(
struct
dup_handle_reply
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
make_temporary_request
,
handle
)
==
12
);
C_ASSERT
(
sizeof
(
struct
make_temporary_request
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
open_process_request
,
pid
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
open_process_request
,
access
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
open_process_request
,
attributes
)
==
20
);
...
...
server/trace.c
View file @
77e74fb1
...
...
@@ -1590,6 +1590,11 @@ static void dump_dup_handle_reply( const struct dup_handle_reply *req )
fprintf
(
stderr
,
", closed=%d"
,
req
->
closed
);
}
static
void
dump_make_temporary_request
(
const
struct
make_temporary_request
*
req
)
{
fprintf
(
stderr
,
" handle=%04x"
,
req
->
handle
);
}
static
void
dump_open_process_request
(
const
struct
open_process_request
*
req
)
{
fprintf
(
stderr
,
" pid=%04x"
,
req
->
pid
);
...
...
@@ -4522,6 +4527,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = {
(
dump_func
)
dump_close_handle_request
,
(
dump_func
)
dump_set_handle_info_request
,
(
dump_func
)
dump_dup_handle_request
,
(
dump_func
)
dump_make_temporary_request
,
(
dump_func
)
dump_open_process_request
,
(
dump_func
)
dump_open_thread_request
,
(
dump_func
)
dump_select_request
,
...
...
@@ -4812,6 +4818,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = {
NULL
,
(
dump_func
)
dump_set_handle_info_reply
,
(
dump_func
)
dump_dup_handle_reply
,
NULL
,
(
dump_func
)
dump_open_process_reply
,
(
dump_func
)
dump_open_thread_reply
,
(
dump_func
)
dump_select_reply
,
...
...
@@ -5102,6 +5109,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = {
"close_handle"
,
"set_handle_info"
,
"dup_handle"
,
"make_temporary"
,
"open_process"
,
"open_thread"
,
"select"
,
...
...
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