kernel32: Fix GetVolumeInformation[AW] to require trailing \.

This commit is contained in:
Guy Albertelli 2009-04-28 21:08:22 -04:00 committed by Alexandre Julliard
parent 6f1390646c
commit f7e6777e6e
2 changed files with 1 additions and 2 deletions

View File

@ -287,7 +287,6 @@ static void test_GetVolumeInformationA(void)
/* check for error on no trailing \ */
ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL,
NULL, NULL, fs_name_buf, fs_name_len);
todo_wine
ok(!ret && GetLastError() == ERROR_INVALID_NAME,
"GetVolumeInformationA w/o '\\' did not fail, last error %u\n", GetLastError());

View File

@ -526,7 +526,7 @@ BOOL WINAPI GetVolumeInformationW( LPCWSTR root, LPWSTR label, DWORD label_len,
}
else
{
if (!root[0] || root[1] != ':')
if (!root[0] || root[1] != ':' || root[lstrlenW(root)-1] != '\\' )
{
SetLastError( ERROR_INVALID_NAME );
return FALSE;