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
b80bbd59
Commit
b80bbd59
authored
Jun 17, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add GetVolumePathNameW tests.
parent
d01c135a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
volume.c
dlls/kernel32/tests/volume.c
+49
-0
No files found.
dlls/kernel32/tests/volume.c
View file @
b80bbd59
...
...
@@ -54,6 +54,7 @@ static UINT (WINAPI *pGetLogicalDriveStringsA)(UINT,LPSTR);
static
UINT
(
WINAPI
*
pGetLogicalDriveStringsW
)(
UINT
,
LPWSTR
);
static
BOOL
(
WINAPI
*
pGetVolumeInformationA
)(
LPCSTR
,
LPSTR
,
DWORD
,
LPDWORD
,
LPDWORD
,
LPDWORD
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumePathNameA
)(
LPCSTR
,
LPSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumePathNameW
)(
LPWSTR
,
LPWSTR
,
DWORD
);
static
BOOL
(
WINAPI
*
pGetVolumePathNamesForVolumeNameA
)(
LPCSTR
,
LPSTR
,
DWORD
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pGetVolumePathNamesForVolumeNameW
)(
LPCWSTR
,
LPWSTR
,
DWORD
,
LPDWORD
);
...
...
@@ -832,6 +833,52 @@ static void test_GetVolumePathNameA(void)
}
}
static
void
test_GetVolumePathNameW
(
void
)
{
static
WCHAR
drive_c1
[]
=
{
'C'
,
':'
,
0
};
static
WCHAR
drive_c2
[]
=
{
'C'
,
':'
,
'\\'
,
0
};
WCHAR
volume_path
[
MAX_PATH
];
BOOL
ret
;
if
(
!
pGetVolumePathNameW
)
{
win_skip
(
"required functions not found
\n
"
);
return
;
}
volume_path
[
0
]
=
0
;
volume_path
[
1
]
=
0x11
;
ret
=
pGetVolumePathNameW
(
drive_c1
,
volume_path
,
1
);
ok
(
!
ret
,
"GetVolumePathNameW test succeeded unexpectedly.
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILENAME_EXCED_RANGE
,
"GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).
\n
"
,
GetLastError
(),
ERROR_FILENAME_EXCED_RANGE
);
ok
(
volume_path
[
1
]
==
0x11
,
"GetVolumePathW corrupted byte after end of buffer.
\n
"
);
volume_path
[
0
]
=
0
;
volume_path
[
2
]
=
0x11
;
ret
=
pGetVolumePathNameW
(
drive_c1
,
volume_path
,
2
);
ok
(
!
ret
,
"GetVolumePathNameW test succeeded unexpectedly.
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILENAME_EXCED_RANGE
,
"GetVolumePathNameW unexpectedly returned error 0x%x (expected 0x%x).
\n
"
,
GetLastError
(),
ERROR_FILENAME_EXCED_RANGE
);
ok
(
volume_path
[
2
]
==
0x11
,
"GetVolumePathW corrupted byte after end of buffer.
\n
"
);
volume_path
[
0
]
=
0
;
volume_path
[
3
]
=
0x11
;
ret
=
pGetVolumePathNameW
(
drive_c1
,
volume_path
,
3
);
ok
(
ret
||
broken
(
!
ret
)
/* win2k */
,
"GetVolumePathNameW test failed unexpectedly.
\n
"
);
ok
(
memcmp
(
volume_path
,
drive_c1
,
sizeof
(
drive_c1
))
==
0
||
broken
(
volume_path
[
0
]
==
0
)
/* win2k */
,
"GetVolumePathNameW unexpectedly returned wrong path.
\n
"
);
ok
(
volume_path
[
3
]
==
0x11
,
"GetVolumePathW corrupted byte after end of buffer.
\n
"
);
volume_path
[
0
]
=
0
;
volume_path
[
4
]
=
0x11
;
ret
=
pGetVolumePathNameW
(
drive_c1
,
volume_path
,
4
);
ok
(
ret
,
"GetVolumePathNameW test failed unexpectedly.
\n
"
);
ok
(
memcmp
(
volume_path
,
drive_c2
,
sizeof
(
drive_c2
))
==
0
,
"GetVolumePathNameW unexpectedly returned wrong path.
\n
"
);
ok
(
volume_path
[
4
]
==
0x11
,
"GetVolumePathW corrupted byte after end of buffer.
\n
"
);
}
static
void
test_GetVolumePathNamesForVolumeNameA
(
void
)
{
BOOL
ret
;
...
...
@@ -1171,6 +1218,7 @@ START_TEST(volume)
pGetLogicalDriveStringsW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetLogicalDriveStringsW"
);
pGetVolumeInformationA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumeInformationA"
);
pGetVolumePathNameA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumePathNameA"
);
pGetVolumePathNameW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumePathNameW"
);
pGetVolumePathNamesForVolumeNameA
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumePathNamesForVolumeNameA"
);
pGetVolumePathNamesForVolumeNameW
=
(
void
*
)
GetProcAddress
(
hdll
,
"GetVolumePathNamesForVolumeNameW"
);
...
...
@@ -1178,6 +1226,7 @@ START_TEST(volume)
test_define_dos_deviceA
();
test_FindFirstVolume
();
test_GetVolumePathNameA
();
test_GetVolumePathNameW
();
test_GetVolumeNameForVolumeMountPointA
();
test_GetVolumeNameForVolumeMountPointW
();
test_GetLogicalDriveStringsA
();
...
...
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