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
50ca65d1
Commit
50ca65d1
authored
Feb 19, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Handle notifications on the parent dir more gracefully.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
80677440
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
17 deletions
+32
-17
change.c
dlls/kernel32/tests/change.c
+32
-17
No files found.
dlls/kernel32/tests/change.c
View file @
50ca65d1
...
...
@@ -383,6 +383,7 @@ static void test_readdirectorychanges(void)
static
const
WCHAR
szHoo
[]
=
{
'\\'
,
'h'
,
'o'
,
'o'
,
0
};
static
const
WCHAR
szGa
[]
=
{
'\\'
,
'h'
,
'o'
,
'o'
,
'\\'
,
'g'
,
'a'
,
0
};
PFILE_NOTIFY_INFORMATION
pfni
;
BOOL
got_subdir_change
=
FALSE
;
if
(
!
pReadDirectoryChangesW
)
{
...
...
@@ -550,26 +551,40 @@ static void test_readdirectorychanges(void)
r
=
CreateDirectoryW
(
subsubdir
,
NULL
);
ok
(
r
==
TRUE
,
"failed to create directory
\n
"
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
1000
);
ok
(
r
==
WAIT_OBJECT_0
,
"should be ready
\n
"
);
while
(
1
)
{
r
=
WaitForSingleObject
(
ov
.
hEvent
,
1000
);
ok
(
r
==
WAIT_OBJECT_0
,
"should be ready
\n
"
);
if
(
r
==
WAIT_TIMEOUT
)
break
;
ok
(
(
NTSTATUS
)
ov
.
Internal
==
STATUS_SUCCESS
,
"ov.Internal wrong
\n
"
);
ok
(
ov
.
InternalHigh
==
0x18
||
ov
.
InternalHigh
==
0x12
+
0x18
,
"ov.InternalHigh wrong %lx
\n
"
,
ov
.
InternalHigh
);
ok
((
NTSTATUS
)
ov
.
Internal
==
STATUS_SUCCESS
,
"ov.Internal wrong
\n
"
);
pfni
=
(
PFILE_NOTIFY_INFORMATION
)
buffer
;
if
(
pfni
->
NextEntryOffset
)
/* we may get a modified event on the parent dir */
{
ok
(
pfni
->
NextEntryOffset
==
0x12
,
"offset wrong %x
\n
"
,
pfni
->
NextEntryOffset
);
ok
(
pfni
->
Action
==
FILE_ACTION_MODIFIED
,
"action wrong %d
\n
"
,
pfni
->
Action
);
ok
(
pfni
->
FileNameLength
==
3
*
sizeof
(
WCHAR
),
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
3
*
sizeof
(
WCHAR
)),
"name wrong
\n
"
);
pfni
=
(
PFILE_NOTIFY_INFORMATION
)((
char
*
)
pfni
+
pfni
->
NextEntryOffset
);
pfni
=
(
PFILE_NOTIFY_INFORMATION
)
buffer
;
while
(
1
)
{
/* We might get one or more modified events on the parent dir */
if
(
pfni
->
Action
==
FILE_ACTION_MODIFIED
)
{
ok
(
pfni
->
FileNameLength
==
3
*
sizeof
(
WCHAR
),
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
3
*
sizeof
(
WCHAR
)),
"name wrong
\n
"
);
}
else
{
ok
(
pfni
->
Action
==
FILE_ACTION_ADDED
,
"action wrong
\n
"
);
ok
(
pfni
->
FileNameLength
==
6
*
sizeof
(
WCHAR
),
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
6
*
sizeof
(
WCHAR
)),
"name wrong
\n
"
);
got_subdir_change
=
TRUE
;
}
if
(
!
pfni
->
NextEntryOffset
)
break
;
pfni
=
(
PFILE_NOTIFY_INFORMATION
)((
char
*
)
pfni
+
pfni
->
NextEntryOffset
);
}
if
(
got_subdir_change
)
break
;
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
sizeof
buffer
,
FALSE
,
filter
,
NULL
,
&
ov
,
NULL
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
}
ok
(
pfni
->
NextEntryOffset
==
0
,
"offset wrong
\n
"
);
ok
(
pfni
->
Action
==
FILE_ACTION_ADDED
,
"action wrong
\n
"
);
ok
(
pfni
->
FileNameLength
==
6
*
sizeof
(
WCHAR
),
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
6
*
sizeof
(
WCHAR
)),
"name wrong
\n
"
);
ok
(
got_subdir_change
,
"didn't get subdir change
\n
"
);
r
=
RemoveDirectoryW
(
subsubdir
);
ok
(
r
==
TRUE
,
"failed to remove directory
\n
"
);
...
...
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