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
ca092dcf
Commit
ca092dcf
authored
Apr 06, 2020
by
Andrew Eikum
Committed by
Alexandre Julliard
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winmm/tests: Test mmioOpen with long file name.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5ee2ef52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
mmio.c
dlls/winmm/tests/mmio.c
+53
-0
No files found.
dlls/winmm/tests/mmio.c
View file @
ca092dcf
...
...
@@ -471,6 +471,58 @@ static void test_mmioOpen(char *fname)
mmioClose
(
hmmio
,
0
);
}
static
void
test_mmioOpen_create
(
void
)
{
HMMIO
hmmio
;
HANDLE
handle
;
WCHAR
cwd
[
MAX_PATH
],
temp_dir
[
MAX_PATH
];
/* According to docs, filename must be no more than 128 bytes, but it will
* actually allow longer than that. */
WCHAR
filename
[]
=
L"very_long_filename_"
L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
L"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
;
GetCurrentDirectoryW
(
ARRAY_SIZE
(
cwd
),
cwd
);
GetTempPathW
(
ARRAY_SIZE
(
temp_dir
),
temp_dir
);
SetCurrentDirectoryW
(
temp_dir
);
DeleteFileW
(
filename
);
/* open with MMIO_DENYNONE */
hmmio
=
mmioOpenW
(
filename
,
NULL
,
MMIO_CREATE
|
MMIO_WRITE
|
MMIO_DENYNONE
);
ok
(
hmmio
!=
NULL
,
"mmioOpen failed
\n
"
);
/* MMIO_DENYNONE lets us open it here, too */
handle
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_WRITE
|
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"Couldn't open non-exclusive file
\n
"
);
CloseHandle
(
handle
);
mmioClose
(
hmmio
,
0
);
DeleteFileW
(
filename
);
/* open with MMIO_EXCLUSIVE */
hmmio
=
mmioOpenW
(
filename
,
NULL
,
MMIO_CREATE
|
MMIO_WRITE
|
MMIO_EXCLUSIVE
);
ok
(
hmmio
!=
NULL
,
"mmioOpen failed
\n
"
);
/* should fail due to MMIO_EXCLUSIVE */
handle
=
CreateFileW
(
filename
,
GENERIC_READ
,
FILE_SHARE_WRITE
|
FILE_SHARE_READ
|
FILE_SHARE_DELETE
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"Opening exclusive file should have failed
\n
"
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
CloseHandle
(
handle
);
mmioClose
(
hmmio
,
0
);
DeleteFileW
(
filename
);
SetCurrentDirectoryW
(
cwd
);
}
static
void
test_mmioSetBuffer
(
char
*
fname
)
{
char
buf
[
256
];
...
...
@@ -1016,6 +1068,7 @@ START_TEST(mmio)
test_mmioDescend
(
fname
);
test_mmioOpen
(
NULL
);
test_mmioOpen
(
fname
);
test_mmioOpen_create
();
test_mmioSetBuffer
(
NULL
);
test_mmioSetBuffer
(
fname
);
test_mmioOpen_fourcc
();
...
...
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