Commit 1975ba27 authored by Nicolas Le Cam's avatar Nicolas Le Cam Committed by Alexandre Julliard

kernel32/tests: Test GetVolumeInformation when current directory is a root directory.

parent c562d444
......@@ -299,6 +299,7 @@ static void test_GetVolumeInformationA(void)
DWORD vol_name_size=MAX_PATH+1, vol_serial_num=-1, max_comp_len=0, fs_flags=0, fs_name_len=MAX_PATH+1;
char vol_name_buf[MAX_PATH+1], fs_name_buf[MAX_PATH+1];
char windowsdir[MAX_PATH+10];
char currentdir[MAX_PATH+1];
if (!pGetVolumeInformationA) {
win_skip("GetVolumeInformationA not found\n");
......@@ -328,6 +329,29 @@ static void test_GetVolumeInformationA(void)
ok(!ret && GetLastError() == ERROR_INVALID_NAME,
"GetVolumeInformationA w/o '\\' did not fail, last error %u\n", GetLastError());
result = GetCurrentDirectory(MAX_PATH, currentdir);
ok(result, "GetCurrentDirectory: error %d\n", GetLastError());
/* check for error on no trailing \ when current dir is root dir */
ret = SetCurrentDirectory(Root_Dir1);
ok(ret, "SetCurrentDirectory: error %d\n", GetLastError());
ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL,
NULL, NULL, fs_name_buf, fs_name_len);
todo_wine
ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError());
/* check for error on no trailing \ when current dir is windows dir */
ret = SetCurrentDirectory(windowsdir);
ok(ret, "SetCurrentDirectory: error %d\n", GetLastError());
ret = pGetVolumeInformationA(Root_Dir0, vol_name_buf, vol_name_size, NULL,
NULL, NULL, fs_name_buf, fs_name_len);
ok(!ret && GetLastError() == ERROR_INVALID_NAME,
"GetVolumeInformationA did not fail, last error %u\n", GetLastError());
/* reset current directory */
ret = SetCurrentDirectory(currentdir);
ok(ret, "SetCurrentDirectory: error %d\n", GetLastError());
/* try null root directory to return "root of the current directory" */
ret = pGetVolumeInformationA(NULL, vol_name_buf, vol_name_size, NULL,
NULL, NULL, fs_name_buf, fs_name_len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment