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
af25949a
Commit
af25949a
authored
Aug 09, 2009
by
Mike Kaplinskiy
Committed by
Alexandre Julliard
Aug 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement NtCancelIoFileEx and fix NtCancelIoFile.
parent
b05774ee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
7 deletions
+47
-7
file.c
dlls/ntdll/file.c
+41
-3
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
change.c
dlls/ntdll/tests/change.c
+2
-3
file.c
dlls/ntdll/tests/file.c
+1
-1
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/ntdll/file.c
View file @
af25949a
...
...
@@ -2604,6 +2604,38 @@ NTSTATUS WINAPI NtDeleteFile( POBJECT_ATTRIBUTES ObjectAttributes )
}
/******************************************************************
* NtCancelIoFileEx (NTDLL.@)
*
*
*/
NTSTATUS
WINAPI
NtCancelIoFileEx
(
HANDLE
hFile
,
PIO_STATUS_BLOCK
iosb
,
PIO_STATUS_BLOCK
io_status
)
{
LARGE_INTEGER
timeout
;
TRACE
(
"%p %p %p
\n
"
,
hFile
,
iosb
,
io_status
);
SERVER_START_REQ
(
cancel_async
)
{
req
->
handle
=
wine_server_obj_handle
(
hFile
);
req
->
iosb
=
wine_server_client_ptr
(
iosb
);
req
->
only_thread
=
FALSE
;
io_status
->
u
.
Status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
if
(
io_status
->
u
.
Status
)
return
io_status
->
u
.
Status
;
/* Let some APC be run, so that we can run the remaining APCs on hFile
* either the cancelation of the pending one, but also the execution
* of the queued APC, but not yet run. This is needed to ensure proper
* clean-up of allocated data.
*/
timeout
.
u
.
LowPart
=
timeout
.
u
.
HighPart
=
0
;
NtDelayExecution
(
TRUE
,
&
timeout
);
return
io_status
->
u
.
Status
;
}
/******************************************************************
* NtCancelIoFile (NTDLL.@)
*
*
...
...
@@ -2616,17 +2648,23 @@ NTSTATUS WINAPI NtCancelIoFile( HANDLE hFile, PIO_STATUS_BLOCK io_status )
SERVER_START_REQ
(
cancel_async
)
{
req
->
handle
=
wine_server_obj_handle
(
hFile
);
wine_server_call
(
req
);
req
->
handle
=
wine_server_obj_handle
(
hFile
);
req
->
iosb
=
0
;
req
->
only_thread
=
TRUE
;
io_status
->
u
.
Status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
if
(
io_status
->
u
.
Status
)
return
io_status
->
u
.
Status
;
/* Let some APC be run, so that we can run the remaining APCs on hFile
* either the cancelation of the pending one, but also the execution
* of the queued APC, but not yet run. This is needed to ensure proper
* clean-up of allocated data.
*/
timeout
.
u
.
LowPart
=
timeout
.
u
.
HighPart
=
0
;
return
io_status
->
u
.
Status
=
NtDelayExecution
(
TRUE
,
&
timeout
);
NtDelayExecution
(
TRUE
,
&
timeout
);
return
io_status
->
u
.
Status
;
}
/******************************************************************************
...
...
dlls/ntdll/ntdll.spec
View file @
af25949a
...
...
@@ -109,6 +109,7 @@
@ stub NtCallbackReturn
# @ stub NtCancelDeviceWakeupRequest
@ stdcall NtCancelIoFile(long ptr)
@ stdcall NtCancelIoFileEx(long ptr ptr)
@ stdcall NtCancelTimer(long ptr)
@ stdcall NtClearEvent(long)
@ stdcall NtClose(long)
...
...
@@ -959,6 +960,7 @@
@ stub ZwCallbackReturn
# @ stub ZwCancelDeviceWakeupRequest
@ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile
@ stdcall ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx
@ stdcall ZwCancelTimer(long ptr) NtCancelTimer
@ stdcall ZwClearEvent(long) NtClearEvent
@ stdcall ZwClose(long) NtClose
...
...
dlls/ntdll/tests/change.c
View file @
af25949a
...
...
@@ -295,15 +295,14 @@ static void test_ntncdf_async(void)
ok
(
U
(
iosb
).
Status
==
0x01234567
,
"status set too soon
\n
"
);
ok
(
iosb
.
Information
==
0x12345678
,
"info set too soon
\n
"
);
todo_wine
{
r
=
pNtCancelIoFile
(
hdir
,
&
iosb
);
ok
(
r
==
STATUS_SUCCESS
,
"cancel failed
\n
"
);
CloseHandle
(
hdir
);
ok
(
U
(
iosb
).
Status
==
STATUS_SUCCESS
,
"status wrong
\n
"
);
ok
(
U
(
iosb2
).
Status
==
STATUS_CANCELLED
,
"status wrong
\n
"
);
}
todo_wine
ok
(
U
(
iosb2
).
Status
==
STATUS_CANCELLED
,
"status wrong
\n
"
);
ok
(
iosb
.
Information
==
0
,
"info wrong
\n
"
);
ok
(
iosb2
.
Information
==
0
,
"info wrong
\n
"
);
...
...
dlls/ntdll/tests/file.c
View file @
af25949a
...
...
@@ -376,7 +376,7 @@ static void read_file_test(void)
ok
(
U
(
iosb
).
Status
==
STATUS_CANCELLED
,
"wrong status %x
\n
"
,
U
(
iosb
).
Status
);
ok
(
iosb
.
Information
==
0
,
"wrong info %lu
\n
"
,
iosb
.
Information
);
ok
(
is_signaled
(
event
),
"event is signaled
\n
"
);
ok
(
!
apc_count
,
"apc was called
\n
"
);
todo_wine
ok
(
!
apc_count
,
"apc was called
\n
"
);
SleepEx
(
1
,
TRUE
);
/* alertable sleep */
ok
(
apc_count
==
1
,
"apc was not called
\n
"
);
CloseHandle
(
read
);
...
...
include/winternl.h
View file @
af25949a
...
...
@@ -2013,6 +2013,7 @@ NTSYSAPI NTSTATUS WINAPI NtAreMappedFilesTheSame(PVOID,PVOID);
NTSYSAPI
NTSTATUS
WINAPI
NtAssignProcessToJobObject
(
HANDLE
,
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
NtCallbackReturn
(
PVOID
,
ULONG
,
NTSTATUS
);
NTSYSAPI
NTSTATUS
WINAPI
NtCancelIoFile
(
HANDLE
,
PIO_STATUS_BLOCK
);
NTSYSAPI
NTSTATUS
WINAPI
NtCancelIoFileEx
(
HANDLE
,
PIO_STATUS_BLOCK
,
PIO_STATUS_BLOCK
);
NTSYSAPI
NTSTATUS
WINAPI
NtCancelTimer
(
HANDLE
,
BOOLEAN
*
);
NTSYSAPI
NTSTATUS
WINAPI
NtClearEvent
(
HANDLE
);
NTSYSAPI
NTSTATUS
WINAPI
NtClose
(
HANDLE
);
...
...
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