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
c7032e92
Commit
c7032e92
authored
Jul 15, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Implement OBJ_PERMANENT.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
26c8fb8c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+6
-6
object.c
server/object.c
+9
-2
object.h
server/object.h
+1
-0
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
c7032e92
...
...
@@ -2048,28 +2048,28 @@ static void test_permanence(void)
attr
.
Attributes
=
0
;
status
=
ZwOpenDirectoryObject
(
&
handle
,
0
,
&
attr
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwMakeTemporaryObject
(
handle
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwMakeTemporaryObject
(
handle
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwClose
(
handle
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
status
=
ZwOpenDirectoryObject
(
&
handle
,
0
,
&
attr
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
status
=
ZwCreateDirectoryObject
(
&
handle
,
GENERIC_ALL
,
&
attr
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
todo_wine
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
);
ok
(
!
status
,
"got %#x
\n
"
,
status
);
todo_wine
ok
(
!
status
,
"got %#x
\n
"
,
status
);
attr
.
Attributes
=
0
;
status
=
ZwOpenDirectoryObject
(
&
handle
,
0
,
&
attr
);
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
todo_wine
ok
(
status
==
STATUS_OBJECT_NAME_NOT_FOUND
,
"got %#x
\n
"
,
status
);
}
static
NTSTATUS
main_test
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
IO_STACK_LOCATION
*
stack
)
...
...
server/object.c
View file @
c7032e92
...
...
@@ -278,7 +278,8 @@ data_size_t get_path_element( const WCHAR *name, data_size_t len )
}
static
struct
object
*
create_object
(
struct
object
*
parent
,
const
struct
object_ops
*
ops
,
const
struct
unicode_str
*
name
,
const
struct
security_descriptor
*
sd
)
const
struct
unicode_str
*
name
,
unsigned
int
attributes
,
const
struct
security_descriptor
*
sd
)
{
struct
object
*
obj
;
struct
object_name
*
name_ptr
;
...
...
@@ -292,6 +293,11 @@ static struct object *create_object( struct object *parent, const struct object_
name_ptr
->
obj
=
obj
;
obj
->
name
=
name_ptr
;
if
(
attributes
&
OBJ_PERMANENT
)
{
make_object_static
(
obj
);
grab_object
(
obj
);
}
return
obj
;
failed:
...
...
@@ -340,7 +346,7 @@ void *create_named_object( struct object *parent, const struct object_ops *ops,
return
obj
;
}
new_obj
=
create_object
(
obj
,
ops
,
&
new_name
,
sd
);
new_obj
=
create_object
(
obj
,
ops
,
&
new_name
,
attributes
,
sd
);
release_object
(
obj
);
return
new_obj
;
}
...
...
@@ -401,6 +407,7 @@ void unlink_named_object( struct object *obj )
/* mark an object as being stored statically, i.e. only released at shutdown */
void
make_object_static
(
struct
object
*
obj
)
{
obj
->
is_permanent
=
1
;
#ifdef DEBUG_OBJECTS
list_remove
(
&
obj
->
obj_list
);
list_add_head
(
&
static_object_list
,
&
obj
->
obj_list
);
...
...
server/object.h
View file @
c7032e92
...
...
@@ -105,6 +105,7 @@ struct object
struct
list
wait_queue
;
struct
object_name
*
name
;
struct
security_descriptor
*
sd
;
unsigned
int
is_permanent
:
1
;
#ifdef DEBUG_OBJECTS
struct
list
obj_list
;
#endif
...
...
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