@@ -1219,6 +1219,16 @@ static void test_registry_mapping(void)
12191219 HKEY mapping_key , mapped_key , mapping_subkey ;
12201220 char buffer [30 ];
12211221 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
12221232
12231233 /* impersonate ourselves to prevent registry virtualization */
12241234 ret = ImpersonateSelf (SecurityImpersonation );
@@ -1256,7 +1266,11 @@ static void test_registry_mapping(void)
12561266
12571267 check_profile_string ("section1" , "name2" , "winetest_map.ini" , "value2" );
12581268
1269+ #ifdef __REACTOS__
1270+ ret = GetFileAttributesA (path );
1271+ #else
12591272 ret = GetFileAttributesA ("C:/windows/winetest_map.ini" );
1273+ #endif
12601274 ok (ret == INVALID_FILE_ATTRIBUTES , "winetest_map.ini should not exist.\n" );
12611275
12621276 ret = WritePrivateProfileStringA ("section1" , "name2" , NULL , "winetest_map.ini" );
@@ -1348,7 +1362,11 @@ static void test_registry_mapping(void)
13481362 ok (ret == 22 , "got %lu\n" , ret );
13491363 ok (!memcmp (buffer , "section1\0file_section\0" , 23 ), "got %s\n" , debugstr_an (buffer , ret ));
13501364
1365+ #ifdef __REACTOS__
1366+ ret = DeleteFileA (path );
1367+ #else
13511368 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1369+ #endif
13521370 ok (ret , "got error %lu\n" , GetLastError ());
13531371
13541372 /* Test the SYS: prefix. */
@@ -1374,7 +1392,11 @@ static void test_registry_mapping(void)
13741392
13751393 check_profile_string ("section2" , "name2" , "winetest_map.ini" , "value2" );
13761394
1395+ #ifdef __REACTOS__
1396+ ret = GetFileAttributesA (path );
1397+ #else
13771398 ret = GetFileAttributesA ("C:/windows/winetest_map.ini" );
1399+ #endif
13781400 ok (ret == INVALID_FILE_ATTRIBUTES , "winetest_map.ini should not exist.\n" );
13791401
13801402 ret = RegDeleteKeyA (mapped_key , "" );
@@ -1416,7 +1438,11 @@ static void test_registry_mapping(void)
14161438
14171439 check_profile_string ("section3" , "name1" , "winetest_map.ini" , "value1" );
14181440
1441+ #ifdef __REACTOS__
1442+ ret = DeleteFileA (path );
1443+ #else
14191444 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1445+ #endif
14201446 ok (ret , "got error %lu\n" , GetLastError ());
14211447
14221448 /* Test default keys. */
@@ -1426,7 +1452,11 @@ static void test_registry_mapping(void)
14261452
14271453 check_profile_string ("section4" , "name1" , "winetest_map.ini" , "value1" );
14281454
1455+ #ifdef __REACTOS__
1456+ ret = DeleteFileA (path );
1457+ #else
14291458 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1459+ #endif
14301460 ok (ret , "got error %lu\n" , GetLastError ());
14311461
14321462 ret = RegSetValueExA (mapping_key , NULL , 0 , REG_SZ , (BYTE * )"SYS:winetest_default" , sizeof ("SYS:winetest_default" ));
@@ -1451,7 +1481,11 @@ static void test_registry_mapping(void)
14511481
14521482 check_profile_string ("section5" , "name2" , "winetest_map.ini" , "value2" );
14531483
1484+ #ifdef __REACTOS__
1485+ ret = GetFileAttributesA (path );
1486+ #else
14541487 ret = GetFileAttributesA ("C:/windows/winetest_map.ini" );
1488+ #endif
14551489 ok (ret == INVALID_FILE_ATTRIBUTES , "winetest_map.ini should not exist.\n" );
14561490
14571491 ret = RegDeleteKeyA (HKEY_LOCAL_MACHINE , "Software\\winetest_default\\Section4" );
@@ -1506,7 +1540,11 @@ static void test_registry_mapping(void)
15061540 ret = WritePrivateProfileStringA ("section6" , "name3" , "value3" , "winetest_map.ini" );
15071541 ok (ret , "got error %lu\n" , GetLastError ());
15081542 check_profile_string ("section6" , "name3" , "winetest_map.ini" , "value3" );
1543+ #ifdef __REACTOS__
1544+ ret = DeleteFileA (path );
1545+ #else
15091546 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1547+ #endif
15101548 ok (ret , "got error %lu\n" , GetLastError ());
15111549
15121550 /* Test name-specific mapping with Get/WritePrivateProfileSection(). */
@@ -1549,7 +1587,11 @@ static void test_registry_mapping(void)
15491587 ok (!ret , "got error %lu\n" , ret );
15501588 ret = RegDeleteKeyA (HKEY_LOCAL_MACHINE , "Software\\winetest_name2" );
15511589 ok (!ret , "got error %lu\n" , ret );
1590+ #ifdef __REACTOS__
1591+ ret = DeleteFileA (path );
1592+ #else
15521593 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1594+ #endif
15531595 ok (ret , "got error %lu\n" , GetLastError ());
15541596
15551597 /* Test name-specific mapping with a default value. */
@@ -1603,7 +1645,11 @@ static void test_registry_mapping(void)
16031645 ok (!ret , "got error %lu\n" , ret );
16041646 RegCloseKey (mapping_key );
16051647
1648+ #ifdef __REACTOS__
1649+ ret = DeleteFileA (path );
1650+ #else
16061651 ret = DeleteFileA ("C:/windows/winetest_map.ini" );
1652+ #endif
16071653 ok (!ret , "expected failure\n" );
16081654 ok (GetLastError () == ERROR_FILE_NOT_FOUND , "got error %lu\n" , GetLastError ());
16091655 ret = RevertToSelf ();
0 commit comments