Reactos

[KERNEL32_WINETEST] Handle Windows -> ReactOS folder differences

+215 -2
+15 -2
modules/rostests/winetests/kernel32/actctx.c
··· 3063 3063 actctx.cbSize = sizeof(actctx); 3064 3064 actctx.lpResourceName = MAKEINTRESOURCEA(1); 3065 3065 actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID | ACTCTX_FLAG_RESOURCE_NAME_VALID; 3066 + #ifdef __REACTOS__ 3067 + char path_explorer[MAX_PATH]; 3068 + GetWindowsDirectoryA(path_explorer, sizeof(path_explorer)); 3069 + strcat(path_explorer, "\\explorer.exe"); 3070 + #endif 3066 3071 for (i = 0; i < ARRAY_SIZE(flags); ++i) 3067 3072 { 3068 3073 winetest_push_context("%lu", flags[i]); 3069 3074 3075 + /* use explorer.exe because using modules already loaded has a different behavior */ 3070 3076 #ifdef __REACTOS__ 3071 3077 if (GetNTVersion() < _WIN32_WINNT_VISTA && i > 0) 3072 3078 break; // Only the first test is valid for WS03. 3079 + actctx.hModule = LoadLibraryExA(path_explorer, NULL, flags[i]); 3080 + #else 3081 + actctx.hModule = LoadLibraryExA("C:\\windows\\explorer.exe", NULL, flags[i]); 3073 3082 #endif 3074 - /* use explorer.exe because using modules already loaded has a different behavior */ 3075 - actctx.hModule = LoadLibraryExA("C:\\windows\\explorer.exe", NULL, flags[i]); 3076 3083 ok(actctx.hModule != NULL, "LoadLibraryExA failed, error %lu\n", GetLastError()); 3077 3084 handle = CreateActCtxA(&actctx); 3078 3085 ok(handle == INVALID_HANDLE_VALUE, "CreateActCtxA succeeded\n"); ··· 3834 3841 ULONG_PTR cookie; 3835 3842 HANDLE handle_context; 3836 3843 BOOL success; 3844 + #ifdef __REACTOS__ 3845 + static char expected_path[MAX_PATH]; 3846 + GetWindowsDirectoryA(expected_path, sizeof(expected_path)); 3847 + strcat(expected_path, "\\WinSxS"); 3848 + #else 3837 3849 static const char *expected_path = "C:\\Windows\\WinSxS"; 3850 + #endif 3838 3851 3839 3852 GetTempPathA(sizeof(path_tmp), path_tmp); 3840 3853
+7
modules/rostests/winetests/kernel32/debugger.c
··· 970 970 } 971 971 else if (is_wow64) 972 972 { 973 + #ifdef __REACTOS__ 974 + static wchar_t expected_path[MAX_PATH]; 975 + GetWindowsDirectoryW(expected_path, MAX_PATH); 976 + wcscat(expected_path, L"\\sysnative\\oleacc.dll"); 977 + wcscpy( path, expected_path ); 978 + #else 973 979 wcscpy( path, L"c:\\windows\\sysnative\\oleacc.dll" ); 980 + #endif 974 981 } 975 982 else goto done; 976 983
+7
modules/rostests/winetests/kernel32/file.c
··· 5917 5917 5918 5918 static void test_find_file_stream(void) 5919 5919 { 5920 + #ifdef __REACTOS__ 5921 + WCHAR path[MAX_PATH]; 5922 + #else 5920 5923 WCHAR path[] = {'C',':','\\','w','i','n','d','o','w','s',0}; 5924 + #endif 5921 5925 HANDLE handle; 5922 5926 int error; 5923 5927 WIN32_FIND_STREAM_DATA data; ··· 5928 5932 return; 5929 5933 } 5930 5934 5935 + #ifdef __REACTOS__ 5936 + GetWindowsDirectoryW(path, ARRAY_SIZE(path)); 5937 + #endif 5931 5938 SetLastError(0xdeadbeef); 5932 5939 handle = pFindFirstStreamW(path, FindStreamInfoStandard, &data, 0); 5933 5940 error = GetLastError();
+46
modules/rostests/winetests/kernel32/profile.c
··· 1219 1219 HKEY mapping_key, mapped_key, mapping_subkey; 1220 1220 char buffer[30]; 1221 1221 LSTATUS ret; 1222 + #ifdef __REACTOS__ 1223 + char path[MAX_PATH]; 1224 + 1225 + /* Get the real system root, use forward slashes, and lowercase everything other than "C:\" */ 1226 + GetWindowsDirectoryA(path, sizeof(path)); 1227 + for (char *p = path; *p; p++) 1228 + if (*p == '\\') *p = '/'; 1229 + else if (p != path) *p = (char)tolower((unsigned char)*p); 1230 + strcat(path, "/winetest_map.ini"); 1231 + #endif 1222 1232 1223 1233 /* impersonate ourselves to prevent registry virtualization */ 1224 1234 ret = ImpersonateSelf(SecurityImpersonation); ··· 1256 1266 1257 1267 check_profile_string("section1", "name2", "winetest_map.ini", "value2"); 1258 1268 1269 + #ifdef __REACTOS__ 1270 + ret = GetFileAttributesA(path); 1271 + #else 1259 1272 ret = GetFileAttributesA("C:/windows/winetest_map.ini"); 1273 + #endif 1260 1274 ok(ret == INVALID_FILE_ATTRIBUTES, "winetest_map.ini should not exist.\n"); 1261 1275 1262 1276 ret = WritePrivateProfileStringA("section1", "name2", NULL, "winetest_map.ini"); ··· 1348 1362 ok(ret == 22, "got %lu\n", ret); 1349 1363 ok(!memcmp(buffer, "section1\0file_section\0", 23), "got %s\n", debugstr_an(buffer, ret)); 1350 1364 1365 + #ifdef __REACTOS__ 1366 + ret = DeleteFileA(path); 1367 + #else 1351 1368 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1369 + #endif 1352 1370 ok(ret, "got error %lu\n", GetLastError()); 1353 1371 1354 1372 /* Test the SYS: prefix. */ ··· 1374 1392 1375 1393 check_profile_string("section2", "name2", "winetest_map.ini", "value2"); 1376 1394 1395 + #ifdef __REACTOS__ 1396 + ret = GetFileAttributesA(path); 1397 + #else 1377 1398 ret = GetFileAttributesA("C:/windows/winetest_map.ini"); 1399 + #endif 1378 1400 ok(ret == INVALID_FILE_ATTRIBUTES, "winetest_map.ini should not exist.\n"); 1379 1401 1380 1402 ret = RegDeleteKeyA(mapped_key, ""); ··· 1416 1438 1417 1439 check_profile_string("section3", "name1", "winetest_map.ini", "value1"); 1418 1440 1441 + #ifdef __REACTOS__ 1442 + ret = DeleteFileA(path); 1443 + #else 1419 1444 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1445 + #endif 1420 1446 ok(ret, "got error %lu\n", GetLastError()); 1421 1447 1422 1448 /* Test default keys. */ ··· 1426 1452 1427 1453 check_profile_string("section4", "name1", "winetest_map.ini", "value1"); 1428 1454 1455 + #ifdef __REACTOS__ 1456 + ret = DeleteFileA(path); 1457 + #else 1429 1458 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1459 + #endif 1430 1460 ok(ret, "got error %lu\n", GetLastError()); 1431 1461 1432 1462 ret = RegSetValueExA(mapping_key, NULL, 0, REG_SZ, (BYTE *)"SYS:winetest_default", sizeof("SYS:winetest_default")); ··· 1451 1481 1452 1482 check_profile_string("section5", "name2", "winetest_map.ini", "value2"); 1453 1483 1484 + #ifdef __REACTOS__ 1485 + ret = GetFileAttributesA(path); 1486 + #else 1454 1487 ret = GetFileAttributesA("C:/windows/winetest_map.ini"); 1488 + #endif 1455 1489 ok(ret == INVALID_FILE_ATTRIBUTES, "winetest_map.ini should not exist.\n"); 1456 1490 1457 1491 ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\\winetest_default\\Section4"); ··· 1506 1540 ret = WritePrivateProfileStringA("section6", "name3", "value3", "winetest_map.ini"); 1507 1541 ok(ret, "got error %lu\n", GetLastError()); 1508 1542 check_profile_string("section6", "name3", "winetest_map.ini", "value3"); 1543 + #ifdef __REACTOS__ 1544 + ret = DeleteFileA(path); 1545 + #else 1509 1546 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1547 + #endif 1510 1548 ok(ret, "got error %lu\n", GetLastError()); 1511 1549 1512 1550 /* Test name-specific mapping with Get/WritePrivateProfileSection(). */ ··· 1549 1587 ok(!ret, "got error %lu\n", ret); 1550 1588 ret = RegDeleteKeyA(HKEY_LOCAL_MACHINE, "Software\\winetest_name2"); 1551 1589 ok(!ret, "got error %lu\n", ret); 1590 + #ifdef __REACTOS__ 1591 + ret = DeleteFileA(path); 1592 + #else 1552 1593 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1594 + #endif 1553 1595 ok(ret, "got error %lu\n", GetLastError()); 1554 1596 1555 1597 /* Test name-specific mapping with a default value. */ ··· 1603 1645 ok(!ret, "got error %lu\n", ret); 1604 1646 RegCloseKey(mapping_key); 1605 1647 1648 + #ifdef __REACTOS__ 1649 + ret = DeleteFileA(path); 1650 + #else 1606 1651 ret = DeleteFileA("C:/windows/winetest_map.ini"); 1652 + #endif 1607 1653 ok(!ret, "expected failure\n"); 1608 1654 ok(GetLastError() == ERROR_FILE_NOT_FOUND, "got error %lu\n", GetLastError()); 1609 1655 ret = RevertToSelf();
+140
modules/rostests/winetests/kernel32/volume.c
··· 115 115 char drivestr[3]; 116 116 HANDLE file; 117 117 BOOL ret; 118 + #ifdef __REACTOS__ 119 + char root_path[MAX_PATH], buf3[MAX_PATH]; 120 + 121 + GetWindowsDirectoryA(root_path, sizeof(root_path)); 122 + #endif 118 123 119 124 /* Find an unused drive letter */ 120 125 drivestr[1] = ':'; ··· 128 133 return; 129 134 } 130 135 136 + #ifdef __REACTOS__ 137 + sprintf(buf3, "%s/", root_path); 138 + for (char *p = buf3; *p; p++) { 139 + if (*p == '\\') *p = '/'; // Replace backslashes with forward slashes 140 + else if (p != buf3) *p = (char)tolower((unsigned char)*p); // Lowercase everything except the first character 141 + } 142 + ret = DefineDosDeviceA( 0, drivestr, buf3 ); 143 + #else 131 144 ret = DefineDosDeviceA( 0, drivestr, "C:/windows/" ); 145 + #endif 132 146 ok(ret, "failed to define drive %s, error %lu\n", drivestr, GetLastError()); 133 147 134 148 ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); 135 149 ok(ret, "failed to query drive %s, error %lu\n", drivestr, GetLastError()); 150 + #ifdef __REACTOS__ 151 + sprintf(buf3, "\\??\\%s\\", root_path); 152 + for (char *p = buf3; *p; p++) { 153 + if (p != (buf3 + 4)) *p = (char)tolower((unsigned char)*p); // Lowercase everything except "C:\" 154 + } 155 + ok(!strcmp(buf, buf3), "got path %s\n", debugstr_a(buf)); 156 + #else 136 157 ok(!strcmp(buf, "\\??\\C:\\windows\\"), "got path %s\n", debugstr_a(buf)); 158 + #endif 137 159 138 160 sprintf(buf, "%s/system32", drivestr); 139 161 file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, ··· 163 185 164 186 /* try with DDD_RAW_TARGET_PATH */ 165 187 188 + #ifdef __REACTOS__ 189 + ret = DefineDosDeviceA( DDD_RAW_TARGET_PATH, drivestr, buf3 ); 190 + #else 166 191 ret = DefineDosDeviceA( DDD_RAW_TARGET_PATH, drivestr, "\\??\\C:\\windows\\" ); 192 + #endif 167 193 ok(ret, "failed to define drive %s, error %lu\n", drivestr, GetLastError()); 168 194 169 195 ret = QueryDosDeviceA( drivestr, buf, sizeof(buf) ); 170 196 ok(ret, "failed to query drive %s, error %lu\n", drivestr, GetLastError()); 197 + #ifdef __REACTOS__ 198 + ok(!strcmp(buf, buf3), "got path %s\n", debugstr_a(buf)); 199 + #else 171 200 ok(!strcmp(buf, "\\??\\C:\\windows\\"), "got path %s\n", debugstr_a(buf)); 201 + #endif 172 202 173 203 sprintf(buf, "%s/system32", drivestr); 174 204 file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, ··· 859 889 DWORD error; 860 890 UINT i; 861 891 892 + #ifdef __REACTOS__ 893 + char sysroot[MAX_PATH]; 894 + char patched[MAX_PATH]; 895 + 896 + /* Get the real system root and lowercase everything other than "C:\""*/ 897 + GetWindowsDirectoryA(sysroot, sizeof(sysroot)); 898 + for (char *p = sysroot; *p; p++) 899 + if (p != sysroot) *p = (char)tolower((unsigned char)*p);; 900 + 901 + /* Patch test 8: "C:\\windows\\system32" */ 902 + sprintf(patched, "%s\\system32", sysroot); 903 + test_paths[8].file_name = _strdup(patched); 904 + 905 + /* Patch test 9: "C:\\windows\\system32\\AnInvalidFolder" */ 906 + sprintf(patched, "%s\\system32\\AnInvalidFolder", sysroot); 907 + test_paths[9].file_name = _strdup(patched); 908 + 909 + /* Patch test 30: "C:/windows/system32" (forward slashes) */ 910 + sprintf(patched, "%s/system32", sysroot); 911 + for (char *p = patched; *p; p++) 912 + if (*p == '\\') *p = '/'; 913 + test_paths[30].file_name = _strdup(patched); 914 + #endif 915 + 862 916 for (i=0; i<ARRAY_SIZE(test_paths); i++) 863 917 { 864 918 BOOL broken_ret = test_paths[i].broken_error == NO_ERROR; ··· 937 991 ok(ret, "Failed to obtain the volume path, error %lu.\n", GetLastError()); 938 992 ok(!strcmp(volume_path, expect_path), "Expected %s, got %s.\n", 939 993 debugstr_a( expect_path ), debugstr_a( volume_path )); 994 + #ifdef __REACTOS__ 995 + /* Free patched strings */ 996 + free((void*)test_paths[8].file_name); 997 + free((void*)test_paths[9].file_name); 998 + free((void*)test_paths[30].file_name); 999 + #endif 940 1000 } 941 1001 942 1002 static void test_GetVolumePathNameW(void) ··· 1313 1373 NTSTATUS status; 1314 1374 HANDLE file; 1315 1375 DWORD size; 1376 + #ifdef __REACTOS__ 1377 + int i = 0; 1378 + char sysroot[MAX_PATH] = {0}, buf[MAX_PATH] = {0}; 1379 + WCHAR buf2[MAX_PATH] = {0}; 1380 + 1381 + GetWindowsDirectoryA(sysroot, sizeof(sysroot)); 1382 + for (char *p = sysroot; *p; p++) { 1383 + // Lowercase everything except "C:\" 1384 + if (p != sysroot) *p = (char)tolower((unsigned char)*p); 1385 + } 1386 + #endif 1316 1387 1317 1388 file = CreateFileA( "C:\\", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 1318 1389 OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, NULL ); ··· 1401 1472 ok(ret != INVALID_FILE_ATTRIBUTES, "got error %lu\n", GetLastError()); 1402 1473 ok((ret & FILE_ATTRIBUTE_REPARSE_POINT) && (ret & FILE_ATTRIBUTE_DIRECTORY), "got attributes %#x\n", ret); 1403 1474 1475 + #ifdef __REACTOS__ 1476 + sprintf(buf, "C:\\winetest_mnt\\%s", sysroot + 3); 1477 + file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 1478 + NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1479 + #else 1404 1480 file = CreateFileA( "C:\\winetest_mnt\\windows", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 1405 1481 NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1482 + #endif 1406 1483 ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); 1407 1484 1408 1485 status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); 1409 1486 ok(!status, "got status %#lx\n", status); 1487 + #ifdef __REACTOS__ 1488 + /* Copy \windows (or \reactos) to buf2. */ 1489 + while ((buf2[i] = (WCHAR)(unsigned char)sysroot[i+2]) != 0) i++; 1490 + ok(name->FileNameLength == wcslen(buf2) * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); 1491 + ok(!wcsnicmp(name->FileName, buf2, wcslen(buf2)), "got name %s\n", 1492 + debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR))); 1493 + #else 1410 1494 ok(name->FileNameLength == wcslen(L"\\windows") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); 1411 1495 ok(!wcsnicmp(name->FileName, L"\\windows", wcslen(L"\\windows")), "got name %s\n", 1412 1496 debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR))); 1497 + #endif 1413 1498 1414 1499 CloseHandle( file ); 1415 1500 ··· 1431 1516 ret = GetVolumeInformationA( "C:\\winetest_mnt\\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1432 1517 ok(ret, "got error %lu\n", GetLastError()); 1433 1518 1519 + #ifdef __REACTOS__ 1520 + ret = GetVolumePathNameA( buf, path, sizeof(path) ); 1521 + #else 1434 1522 ret = GetVolumePathNameA( "C:\\winetest_mnt\\windows", path, sizeof(path) ); 1523 + #endif 1435 1524 ok(ret, "got error %lu\n", GetLastError()); 1436 1525 ok(!strcmp(path, "C:\\winetest_mnt\\"), "got %s\n", debugstr_a(path)); 1437 1526 SetLastError(0xdeadbeef); 1527 + #ifdef __REACTOS__ 1528 + strcat(buf, "\\"); 1529 + ret = GetVolumeNameForVolumeMountPointA( buf, path, sizeof(path) ); 1530 + #else 1438 1531 ret = GetVolumeNameForVolumeMountPointA( "C:\\winetest_mnt\\windows\\", path, sizeof(path) ); 1532 + #endif 1439 1533 ok(!ret, "expected failure\n"); 1440 1534 ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %lu\n", GetLastError()); 1441 1535 SetLastError(0xdeadbeef); 1536 + #ifdef __REACTOS__ 1537 + ret = GetVolumeInformationA( buf, NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1538 + #else 1442 1539 ret = GetVolumeInformationA( "C:\\winetest_mnt\\windows\\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1540 + #endif 1443 1541 ok(!ret, "expected failure\n"); 1444 1542 ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %lu\n", GetLastError()); 1445 1543 ··· 1502 1600 ret = GetVolumeInformationA( "C:\\winetest_link\\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1503 1601 ok(ret, "got error %lu\n", GetLastError()); 1504 1602 1603 + #ifdef __REACTOS__ 1604 + sprintf(buf, "C:\\winetest_link\\%s", sysroot + 3); 1605 + ret = GetVolumePathNameA( buf, path, sizeof(path) ); 1606 + #else 1505 1607 ret = GetVolumePathNameA( "C:\\winetest_link\\windows\\", path, sizeof(path) ); 1608 + #endif 1506 1609 ok(ret, "got error %lu\n", GetLastError()); 1507 1610 ok(!strcmp(path, "C:\\"), "got %s\n", path); 1508 1611 SetLastError(0xdeadbeef); 1612 + #ifdef __REACTOS__ 1613 + ret = GetVolumeNameForVolumeMountPointA( buf, path, sizeof(path) ); 1614 + #else 1509 1615 ret = GetVolumeNameForVolumeMountPointA( "C:\\winetest_link\\windows\\", path, sizeof(path) ); 1616 + #endif 1510 1617 ok(!ret, "expected failure\n"); 1511 1618 ok(GetLastError() == ERROR_NOT_A_REPARSE_POINT, "wrong error %lu\n", GetLastError()); 1512 1619 SetLastError(0xdeadbeef); 1620 + #ifdef __REACTOS__ 1621 + ret = GetVolumeInformationA( buf, NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1622 + #else 1513 1623 ret = GetVolumeInformationA( "C:\\winetest_link\\windows\\", NULL, 0, NULL, NULL, NULL, NULL, 0 ); 1624 + #endif 1514 1625 ok(!ret, "expected failure\n"); 1515 1626 ok(GetLastError() == ERROR_DIR_NOT_ROOT, "wrong error %lu\n", GetLastError()); 1516 1627 ··· 1526 1637 /* The following test makes it clear that when we encounter a symlink 1527 1638 * while resolving, we resolve *every* junction in the path, i.e. both 1528 1639 * mount points and symlinks. */ 1640 + #ifdef __REACTOS__ 1641 + sprintf(buf, "C:\\winetest_link\\winetest_mnt\\winetest_link\\%s\\", sysroot + 3); 1642 + ret = GetVolumePathNameA( buf, path, sizeof(path) ); 1643 + #else 1529 1644 ret = GetVolumePathNameA( "C:\\winetest_link\\winetest_mnt\\winetest_link\\windows\\", path, sizeof(path) ); 1645 + #endif 1530 1646 ok(ret, "got error %lu\n", GetLastError()); 1531 1647 ok(!strcmp(path, "C:\\") || !strcmp(path, "C:\\winetest_link\\winetest_mnt\\") /* 2008 */, 1532 1648 "got %s\n", debugstr_a(path)); 1533 1649 1650 + #ifdef __REACTOS__ 1651 + file = CreateFileA( buf, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1652 + #else 1534 1653 file = CreateFileA( "C:\\winetest_link\\winetest_mnt\\winetest_link\\windows\\", 0, 1535 1654 FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1655 + #endif 1536 1656 ok(file != INVALID_HANDLE_VALUE, "got error %lu\n", GetLastError()); 1537 1657 1538 1658 status = NtQueryInformationFile( file, &io, name, sizeof(name_buffer), FileNameInformation ); 1539 1659 ok(!status, "got status %#lx\n", status); 1660 + #ifdef __REACTOS__ 1661 + ok(name->FileNameLength == wcslen(buf2) * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); 1662 + ok(!wcsnicmp(name->FileName, buf2, wcslen(buf2)), "got name %s\n", 1663 + debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR))); 1664 + #else 1540 1665 ok(name->FileNameLength == wcslen(L"\\windows") * sizeof(WCHAR), "got length %lu\n", name->FileNameLength); 1541 1666 ok(!wcsnicmp(name->FileName, L"\\windows", wcslen(L"\\windows")), "got name %s\n", 1542 1667 debugstr_wn(name->FileName, name->FileNameLength / sizeof(WCHAR))); 1668 + #endif 1543 1669 1544 1670 CloseHandle( file ); 1545 1671 ··· 1573 1699 HANDLE file; 1574 1700 NTSTATUS status; 1575 1701 BOOL ret; 1702 + #ifdef __REACTOS__ 1703 + char sysroot[MAX_PATH]; 1704 + 1705 + GetWindowsDirectoryA(sysroot, sizeof(sysroot)); 1706 + for (char *p = sysroot; *p; p++) { 1707 + if (*p == '\\') *p = '/'; // Use forward slashes 1708 + else if (p != sysroot) *p = (char)tolower((unsigned char)*p); // Lowercase everything except "C:\" 1709 + } 1710 + #endif 1576 1711 1577 1712 #if defined(__REACTOS__) && DLL_EXPORT_VERSION >= 0x600 1578 1713 /* FIXME: GetVolumeInformationByHandleW is a STUB on ReactOS! */ ··· 1585 1720 return; 1586 1721 } 1587 1722 1723 + #ifdef __REACTOS__ 1724 + file = CreateFileA( sysroot, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 1725 + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1726 + #else 1588 1727 file = CreateFileA( "C:/windows", 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, 1589 1728 OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL ); 1729 + #endif 1590 1730 ok(file != INVALID_HANDLE_VALUE, "failed to open file, error %lu\n", GetLastError()); 1591 1731 1592 1732 SetLastError(0xdeadbeef);