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
dcaeddd4
Commit
dcaeddd4
authored
Apr 23, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Allow creating file kernel objects.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9784c3fd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+0
-1
file.c
server/file.c
+12
-1
No files found.
dlls/ntoskrnl.exe/tests/driver.c
View file @
dcaeddd4
...
...
@@ -847,7 +847,6 @@ static void test_ob_reference(const WCHAR *test_path)
status
=
ObReferenceObjectByHandle
(
file_handle2
,
SYNCHRONIZE
,
*
pIoFileObjectType
,
KernelMode
,
&
obj2
,
NULL
);
ok
(
!
status
,
"ObReferenceObjectByHandle failed: %#x
\n
"
,
status
);
todo_wine
ok
(
obj1
==
obj2
,
"obj1 != obj2
\n
"
);
file
=
obj1
;
...
...
server/file.c
View file @
dcaeddd4
...
...
@@ -59,6 +59,7 @@ struct file
unsigned
int
access
;
/* file access (FILE_READ_DATA etc.) */
mode_t
mode
;
/* file stat.st_mode */
uid_t
uid
;
/* file stat.st_uid */
struct
list
kernel_object
;
/* list of kernel object pointers */
};
static
unsigned
int
generic_file_map_access
(
unsigned
int
access
);
...
...
@@ -70,6 +71,7 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
static
struct
object
*
file_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attr
);
static
struct
object
*
file_open_file
(
struct
object
*
obj
,
unsigned
int
access
,
unsigned
int
sharing
,
unsigned
int
options
);
static
struct
list
*
file_get_kernel_obj_list
(
struct
object
*
obj
);
static
void
file_destroy
(
struct
object
*
obj
);
static
int
file_get_poll_events
(
struct
fd
*
fd
);
...
...
@@ -94,7 +96,7 @@ static const struct object_ops file_ops =
no_link_name
,
/* link_name */
NULL
,
/* unlink_name */
file_open_file
,
/* open_file */
no_kernel_obj_list
,
/* get_kernel_obj_list */
file_get_kernel_obj_list
,
/* get_kernel_obj_list */
fd_close_handle
,
/* close_handle */
file_destroy
/* destroy */
};
...
...
@@ -136,6 +138,7 @@ struct file *create_file_for_fd( int fd, unsigned int access, unsigned int shari
file
->
mode
=
st
.
st_mode
;
file
->
access
=
default_fd_map_access
(
&
file
->
obj
,
access
);
list_init
(
&
file
->
kernel_object
);
if
(
!
(
file
->
fd
=
create_anonymous_fd
(
&
file_fd_ops
,
fd
,
&
file
->
obj
,
FILE_SYNCHRONOUS_IO_NONALERT
)))
{
...
...
@@ -162,6 +165,7 @@ struct file *create_file_for_fd_obj( struct fd *fd, unsigned int access, unsigne
{
file
->
mode
=
st
.
st_mode
;
file
->
access
=
default_fd_map_access
(
&
file
->
obj
,
access
);
list_init
(
&
file
->
kernel_object
);
if
(
!
(
file
->
fd
=
dup_fd_object
(
fd
,
access
,
sharing
,
FILE_SYNCHRONOUS_IO_NONALERT
)))
{
release_object
(
file
);
...
...
@@ -181,6 +185,7 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_
file
->
mode
=
mode
;
file
->
uid
=
~
(
uid_t
)
0
;
file
->
fd
=
fd
;
list_init
(
&
file
->
kernel_object
);
grab_object
(
fd
);
set_fd_user
(
fd
,
&
file_fd_ops
,
&
file
->
obj
);
return
&
file
->
obj
;
...
...
@@ -631,6 +636,12 @@ static struct object *file_open_file( struct object *obj, unsigned int access,
return
new_file
;
}
static
struct
list
*
file_get_kernel_obj_list
(
struct
object
*
obj
)
{
struct
file
*
file
=
(
struct
file
*
)
obj
;
return
&
file
->
kernel_object
;
}
static
void
file_destroy
(
struct
object
*
obj
)
{
struct
file
*
file
=
(
struct
file
*
)
obj
;
...
...
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