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
193667ec
Commit
193667ec
authored
May 07, 2015
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix handling of async cancellation for directory changes.
parent
38b7c883
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
file.c
dlls/ntdll/file.c
+15
-10
change.c
dlls/ntdll/tests/change.c
+5
-5
change.c
server/change.c
+1
-1
No files found.
dlls/ntdll/file.c
View file @
193667ec
...
...
@@ -1805,19 +1805,20 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb,
NTSTATUS
status
,
void
**
apc
,
void
**
arg
)
{
struct
read_changes_fileio
*
fileio
=
user
;
NTSTATUS
ret
;
int
size
;
int
size
=
0
;
if
(
status
==
STATUS_ALERTED
)
{
SERVER_START_REQ
(
read_change
)
{
req
->
handle
=
wine_server_obj_handle
(
fileio
->
io
.
handle
);
wine_server_set_reply
(
req
,
fileio
->
data
,
fileio
->
data_size
);
ret
=
wine_server_call
(
req
);
status
=
wine_server_call
(
req
);
size
=
wine_server_reply_size
(
reply
);
}
SERVER_END_REQ
;
if
(
ret
==
STATUS_SUCCESS
&&
fileio
->
buffer
)
if
(
status
==
STATUS_SUCCESS
&&
fileio
->
buffer
)
{
FILE_NOTIFY_INFORMATION
*
pfni
=
fileio
->
buffer
;
int
i
,
left
=
fileio
->
buffer_size
;
...
...
@@ -1827,7 +1828,7 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb,
while
(
size
&&
left
>=
sizeof
(
*
pfni
))
{
/* convert to an NT style path */
for
(
i
=
0
;
i
<
event
->
len
;
i
++
)
for
(
i
=
0
;
i
<
event
->
len
;
i
++
)
if
(
event
->
name
[
i
]
==
'/'
)
event
->
name
[
i
]
=
'\\'
;
pfni
->
Action
=
event
->
action
;
...
...
@@ -1851,27 +1852,31 @@ static NTSTATUS read_changes_apc( void *user, IO_STATUS_BLOCK *iosb,
if
(
size
)
{
ret
=
STATUS_NOTIFY_ENUM_DIR
;
status
=
STATUS_NOTIFY_ENUM_DIR
;
size
=
0
;
}
else
{
*
last_entry_offset
=
0
;
if
(
last_entry_offset
)
*
last_entry_offset
=
0
;
size
=
fileio
->
buffer_size
-
left
;
}
}
else
{
ret
=
STATUS_NOTIFY_ENUM_DIR
;
status
=
STATUS_NOTIFY_ENUM_DIR
;
size
=
0
;
}
}
iosb
->
u
.
Status
=
ret
;
if
(
status
!=
STATUS_PENDING
)
{
iosb
->
u
.
Status
=
status
;
iosb
->
Information
=
size
;
*
apc
=
fileio
->
io
.
apc
;
*
arg
=
fileio
->
io
.
apc_arg
;
release_fileio
(
&
fileio
->
io
);
return
ret
;
}
return
status
;
}
#define FILE_NOTIFY_ALL ( \
...
...
dlls/ntdll/tests/change.c
View file @
193667ec
...
...
@@ -99,19 +99,19 @@ static void test_ntncdf(void)
r
=
pNtNotifyChangeDirectoryFile
(
hdir
,
hEvent
,
NULL
,
NULL
,
&
iosb
,
buffer
,
sizeof
buffer
,
filter
,
0
);
ok
(
r
==
STATUS_PENDING
,
"should return status pending
\n
"
);
r
=
WaitForSingleObject
(
hEvent
,
0
);
r
=
WaitForSingleObject
(
hEvent
,
10
0
);
ok
(
r
==
STATUS_TIMEOUT
,
"should timeout
\n
"
);
r
=
WaitForSingleObject
(
hdir
,
0
);
r
=
WaitForSingleObject
(
hdir
,
10
0
);
ok
(
r
==
STATUS_TIMEOUT
,
"should timeout
\n
"
);
r
=
CreateDirectoryW
(
subdir
,
NULL
);
ok
(
r
==
TRUE
,
"failed to create directory
\n
"
);
r
=
WaitForSingleObject
(
hdir
,
0
);
r
=
WaitForSingleObject
(
hdir
,
10
0
);
ok
(
r
==
STATUS_TIMEOUT
,
"should timeout
\n
"
);
r
=
WaitForSingleObject
(
hEvent
,
0
);
r
=
WaitForSingleObject
(
hEvent
,
10
0
);
ok
(
r
==
WAIT_OBJECT_0
,
"event should be ready
\n
"
);
ok
(
U
(
iosb
).
Status
==
STATUS_SUCCESS
,
"information wrong
\n
"
);
...
...
@@ -299,7 +299,7 @@ static void test_ntncdf_async(void)
CloseHandle
(
hdir
);
ok
(
U
(
iosb
).
Status
==
STATUS_SUCCESS
,
"status wrong
\n
"
);
todo_wine
ok
(
U
(
iosb2
).
Status
==
STATUS_CANCELLED
,
"status wrong
\n
"
);
ok
(
U
(
iosb2
).
Status
==
STATUS_CANCELLED
,
"status wrong %x
\n
"
,
U
(
iosb2
).
Status
);
ok
(
iosb
.
Information
==
0
,
"info wrong
\n
"
);
ok
(
iosb2
.
Information
==
0
,
"info wrong
\n
"
);
...
...
server/change.c
View file @
193667ec
...
...
@@ -272,7 +272,7 @@ void sigio_callback(void)
LIST_FOR_EACH_ENTRY
(
dir
,
&
change_list
,
struct
dir
,
entry
)
{
if
(
interlocked_xchg
(
&
dir
->
notified
,
0
))
fd_async_wake_up
(
dir
->
fd
,
ASYNC_TYPE_WAIT
,
STATUS_
NOTIFY_ENUM_DIR
);
fd_async_wake_up
(
dir
->
fd
,
ASYNC_TYPE_WAIT
,
STATUS_
ALERTED
);
}
}
...
...
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