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
54dfdb9b
Commit
54dfdb9b
authored
Feb 21, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Feb 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add a simple test for recursive notification.
parent
f4b447ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
2 deletions
+62
-2
change.c
dlls/kernel/tests/change.c
+62
-2
No files found.
dlls/kernel/tests/change.c
View file @
54dfdb9b
...
@@ -327,9 +327,10 @@ static void test_readdirectorychanges(void)
...
@@ -327,9 +327,10 @@ static void test_readdirectorychanges(void)
char
buffer
[
0x1000
];
char
buffer
[
0x1000
];
DWORD
fflags
,
filter
=
0
,
r
,
dwCount
;
DWORD
fflags
,
filter
=
0
,
r
,
dwCount
;
OVERLAPPED
ov
;
OVERLAPPED
ov
;
WCHAR
path
[
MAX_PATH
],
subdir
[
MAX_PATH
];
WCHAR
path
[
MAX_PATH
],
subdir
[
MAX_PATH
]
,
subsubdir
[
MAX_PATH
]
;
static
const
WCHAR
szBoo
[]
=
{
'\\'
,
'b'
,
'o'
,
'o'
,
0
};
static
const
WCHAR
szBoo
[]
=
{
'\\'
,
'b'
,
'o'
,
'o'
,
0
};
static
const
WCHAR
szHoo
[]
=
{
'\\'
,
'h'
,
'o'
,
'o'
,
0
};
static
const
WCHAR
szHoo
[]
=
{
'\\'
,
'h'
,
'o'
,
'o'
,
0
};
static
const
WCHAR
szGa
[]
=
{
'\\'
,
'h'
,
'o'
,
'o'
,
'\\'
,
'g'
,
'a'
,
0
};
PFILE_NOTIFY_INFORMATION
pfni
;
PFILE_NOTIFY_INFORMATION
pfni
;
if
(
!
pReadDirectoryChangesW
)
if
(
!
pReadDirectoryChangesW
)
...
@@ -344,6 +345,10 @@ static void test_readdirectorychanges(void)
...
@@ -344,6 +345,10 @@ static void test_readdirectorychanges(void)
lstrcpyW
(
subdir
,
path
);
lstrcpyW
(
subdir
,
path
);
lstrcatW
(
subdir
,
szHoo
);
lstrcatW
(
subdir
,
szHoo
);
lstrcpyW
(
subsubdir
,
path
);
lstrcatW
(
subsubdir
,
szGa
);
RemoveDirectoryW
(
subsubdir
);
RemoveDirectoryW
(
subdir
);
RemoveDirectoryW
(
subdir
);
RemoveDirectoryW
(
path
);
RemoveDirectoryW
(
path
);
...
@@ -395,7 +400,7 @@ static void test_readdirectorychanges(void)
...
@@ -395,7 +400,7 @@ static void test_readdirectorychanges(void)
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"last error wrong
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"last error wrong
\n
"
);
ok
(
r
==
FALSE
,
"should return false
\n
"
);
ok
(
r
==
FALSE
,
"should return false
\n
"
);
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
sizeof
buffer
,
FALS
E
,
filter
,
NULL
,
&
ov
,
NULL
);
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
sizeof
buffer
,
TRU
E
,
filter
,
NULL
,
&
ov
,
NULL
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
10
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
10
);
...
@@ -462,6 +467,61 @@ static void test_readdirectorychanges(void)
...
@@ -462,6 +467,61 @@ static void test_readdirectorychanges(void)
ok
(
pfni
->
FileNameLength
==
6
,
"len wrong
\n
"
);
ok
(
pfni
->
FileNameLength
==
6
,
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szHoo
[
1
],
6
),
"name wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szHoo
[
1
],
6
),
"name wrong
\n
"
);
/* what happens if the buffer is too small? */
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
0x10
,
FALSE
,
filter
,
NULL
,
&
ov
,
NULL
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
r
=
CreateDirectoryW
(
subdir
,
NULL
);
ok
(
r
==
TRUE
,
"failed to create directory
\n
"
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"should be ready
\n
"
);
ok
(
ov
.
Internal
==
STATUS_NOTIFY_ENUM_DIR
,
"ov.Internal wrong
\n
"
);
ok
(
ov
.
InternalHigh
==
0
,
"ov.InternalHigh wrong
\n
"
);
/* test the recursive watch */
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
sizeof
buffer
,
FALSE
,
filter
,
NULL
,
&
ov
,
NULL
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
r
=
CreateDirectoryW
(
subsubdir
,
NULL
);
ok
(
r
==
TRUE
,
"failed to create directory
\n
"
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"should be ready
\n
"
);
ok
(
ov
.
Internal
==
STATUS_SUCCESS
,
"ov.Internal wrong
\n
"
);
ok
(
ov
.
InternalHigh
==
0x18
,
"ov.InternalHigh wrong
\n
"
);
pfni
=
(
PFILE_NOTIFY_INFORMATION
)
buffer
;
ok
(
pfni
->
NextEntryOffset
==
0
,
"offset wrong
\n
"
);
ok
(
pfni
->
Action
==
FILE_ACTION_ADDED
,
"action wrong
\n
"
);
ok
(
pfni
->
FileNameLength
==
0x0c
,
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
6
),
"name wrong
\n
"
);
r
=
RemoveDirectoryW
(
subsubdir
);
ok
(
r
==
TRUE
,
"failed to remove directory
\n
"
);
ov
.
Internal
=
1
;
ov
.
InternalHigh
=
1
;
r
=
pReadDirectoryChangesW
(
hdir
,
buffer
,
sizeof
buffer
,
FALSE
,
filter
,
NULL
,
&
ov
,
NULL
);
ok
(
r
==
TRUE
,
"should return true
\n
"
);
r
=
RemoveDirectoryW
(
subdir
);
ok
(
r
==
TRUE
,
"failed to remove directory
\n
"
);
r
=
WaitForSingleObject
(
ov
.
hEvent
,
INFINITE
);
ok
(
r
==
WAIT_OBJECT_0
,
"should be ready
\n
"
);
pfni
=
(
PFILE_NOTIFY_INFORMATION
)
buffer
;
ok
(
pfni
->
NextEntryOffset
==
0
,
"offset wrong
\n
"
);
ok
(
pfni
->
Action
==
FILE_ACTION_REMOVED
,
"action wrong
\n
"
);
ok
(
pfni
->
FileNameLength
==
0x0c
,
"len wrong
\n
"
);
ok
(
!
memcmp
(
pfni
->
FileName
,
&
szGa
[
1
],
6
),
"name wrong
\n
"
);
ok
(
ov
.
Internal
==
STATUS_SUCCESS
,
"ov.Internal wrong
\n
"
);
ok
(
ov
.
InternalHigh
==
0x18
,
"ov.InternalHigh wrong
\n
"
);
CloseHandle
(
hdir
);
CloseHandle
(
hdir
);
r
=
RemoveDirectoryW
(
path
);
r
=
RemoveDirectoryW
(
path
);
...
...
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