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
637e01e2
Commit
637e01e2
authored
Feb 26, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement file object constructor.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
85531444
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+11
-1
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+4
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
637e01e2
...
...
@@ -369,16 +369,26 @@ NTSTATUS WINAPI ObReferenceObjectByHandle( HANDLE handle, ACCESS_MASK access,
}
static
void
*
create_file_object
(
HANDLE
handle
);
static
const
WCHAR
file_type_name
[]
=
{
'F'
,
'i'
,
'l'
,
'e'
,
0
};
static
struct
_OBJECT_TYPE
file_type
=
{
file_type_name
,
NULL
,
create_file_object
,
free_kernel_object
};
POBJECT_TYPE
IoFileObjectType
=
&
file_type
;
static
void
*
create_file_object
(
HANDLE
handle
)
{
FILE_OBJECT
*
file
;
if
(
!
(
file
=
alloc_kernel_object
(
IoFileObjectType
,
sizeof
(
*
file
),
0
)))
return
NULL
;
file
->
Type
=
5
;
/* MSDN */
file
->
Size
=
sizeof
(
*
file
);
return
file
;
}
/* transfer result of IRP back to wineserver */
static
NTSTATUS
WINAPI
dispatch_irp_completion
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
,
void
*
context
)
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
637e01e2
...
...
@@ -664,6 +664,7 @@ static void test_ob_reference(const WCHAR *test_path)
{
OBJECT_ATTRIBUTES
attr
=
{
sizeof
(
attr
)
};
HANDLE
event_handle
,
file_handle
,
file_handle2
,
thread_handle
;
FILE_OBJECT
*
file
;
void
*
obj1
,
*
obj2
;
UNICODE_STRING
pathU
;
IO_STATUS_BLOCK
io
;
...
...
@@ -732,6 +733,9 @@ static void test_ob_reference(const WCHAR *test_path)
todo_wine
ok
(
obj1
==
obj2
,
"obj1 != obj2
\n
"
);
file
=
obj1
;
ok
(
file
->
Type
==
5
,
"Type = %u
\n
"
,
file
->
Type
);
ObDereferenceObject
(
obj1
);
ObDereferenceObject
(
obj2
);
...
...
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