Reactos

[NTDLL_APITEST] Various small fixes - Add a missing file - Add convenience targets for MSVC_IDE - Remove whitespace at the end of the lines

+48 -30
+16 -1
modules/rostests/apitests/ntdll/CMakeLists.txt
··· 90 90 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata) 91 91 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata) 92 92 add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata) 93 + add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata) 94 + add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata) 93 95 94 - add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata) 96 + # Convenience target for running from IDE 97 + if(MSVC_IDE) 98 + set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/) 99 + add_custom_command(TARGET ntdll_apitest 100 + POST_BUILD 101 + COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR} 102 + COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR} 103 + COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR} 104 + COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR} 105 + COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR} 106 + COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR} 107 + COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR} 108 + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 109 + endif()
+32 -29
modules/rostests/apitests/ntdll/RtlDosApplyFileIsolationRedirection_Ustr.c
··· 22 22 WCHAR* ExpectedSubString; 23 23 }; 24 24 25 - struct test_data Tests[] = 25 + struct test_data Tests[] = 26 26 { 27 27 /* Not redirected file */ 28 28 {__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"somefilesomefile", NULL}, ··· 33 33 {__LINE__, STATUS_SUCCESS, L"COMCTL32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"}, 34 34 {__LINE__, STATUS_SUCCESS, L"comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"}, 35 35 {__LINE__, STATUS_SUCCESS, L"c:\\windows\\system32\\comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"}, 36 + /* Files not redirected with sxs */ 37 + {__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"MSVCR90.DLL", NULL}, 38 + {__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"c:\\windows\\system32\\MSVCR90.DLL", NULL}, 36 39 /* Files defined in the manifest, one exists, one doesn't */ 37 40 {__LINE__, STATUS_SUCCESS, L"deptest.dll", EXPECT_IN_SAME_DIR}, 38 41 {__LINE__, STATUS_SUCCESS, L"adllfile.dll", EXPECT_IN_SAME_DIR}, ··· 69 72 SetLastError(0xdeaddead); 70 73 h = CreateActCtxW(&ActCtx); 71 74 ok_(__FILE__, line)(h != INVALID_HANDLE_VALUE, "CreateActCtx failed for %S\n", FileName); 72 - // In win10 last error is unchanged and in win2k3 it is ERROR_BAD_EXE_FORMAT 75 + // In win10 last error is unchanged and in win2k3 it is ERROR_BAD_EXE_FORMAT 73 76 ok_(__FILE__, line)(GetLastError() == ERROR_BAD_EXE_FORMAT || GetLastError() == 0xdeaddead, "Wrong last error %lu\n", GetLastError()); 74 77 75 78 return h; ··· 148 151 149 152 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 150 153 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 151 - NULL, 152 154 NULL, 153 155 NULL, 156 + NULL, 154 157 &DynamicString, 155 158 &StringUsed, 156 159 NULL, ··· 161 164 RtlInitEmptyUnicodeString(&Param, NULL, 0); 162 165 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 163 166 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 164 - &Param, 165 - NULL, 167 + &Param, 168 + NULL, 166 169 NULL, 167 170 &DynamicString, 168 171 &StringUsed, ··· 176 179 Param.Buffer = L"comctl32.dllcrapcrap"; 177 180 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 178 181 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 179 - &Param, 180 - NULL, 182 + &Param, 183 + NULL, 181 184 NULL, 182 185 &DynamicString, 183 186 &StringUsed, ··· 190 193 RtlInitUnicodeString(&Param, L"comctl32.dll"); 191 194 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 192 195 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 193 - &Param, 194 - NULL, 196 + &Param, 197 + NULL, 195 198 NULL, 196 199 &DynamicString, 197 200 &StringUsed, ··· 203 206 RtlInitUnicodeString(&Param, L"comctl32"); 204 207 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 205 208 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 206 - &Param, 207 - NULL, 209 + &Param, 210 + NULL, 208 211 NULL, 209 212 &DynamicString, 210 213 &StringUsed, ··· 216 219 RtlInitUnicodeString(&Param, L"comctl32"); 217 220 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 218 221 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 219 - &Param, 220 - &DotDll, 222 + &Param, 223 + &DotDll, 221 224 NULL, 222 225 &DynamicString, 223 226 &StringUsed, ··· 230 233 RtlInitUnicodeString(&Param, L"comctl32.dll"); 231 234 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 232 235 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 233 - &Param, 236 + &Param, 234 237 NULL, 235 238 NULL, 236 239 &DynamicString, ··· 254 257 StaticString.MaximumLength = sizeof(buffer); 255 258 Param = StaticString; 256 259 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 257 - &Param, 258 - NULL, 260 + &Param, 261 + NULL, 259 262 &StaticString, 260 263 NULL, 261 264 &StringUsed, ··· 269 272 StaticString.Length = sizeof(L"comctl32.dll"); 270 273 StaticString.MaximumLength = sizeof(buffer); 271 274 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 272 - &StaticString, 273 - NULL, 275 + &StaticString, 276 + NULL, 274 277 &StaticString, 275 278 NULL, 276 279 &StringUsed, ··· 282 285 RtlInitUnicodeString(&Param, L"comctl32.dll"); 283 286 RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer)); 284 287 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 285 - &Param, 286 - NULL, 288 + &Param, 289 + NULL, 287 290 &StaticString, 288 291 NULL, 289 292 &StringUsed, ··· 301 304 302 305 RtlInitEmptyUnicodeString(&StaticString, buffer, 5 * sizeof(WCHAR)); 303 306 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 304 - &Param, 305 - NULL, 307 + &Param, 308 + NULL, 306 309 &StaticString, 307 310 NULL, 308 311 &StringUsed, ··· 315 318 RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer)); 316 319 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 317 320 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 318 - &Param, 319 - NULL, 321 + &Param, 322 + NULL, 320 323 &StaticString, 321 324 &DynamicString, 322 325 &StringUsed, ··· 341 344 RtlInitEmptyUnicodeString(&DynamicString, NULL, 0); 342 345 StaticString.Buffer[0] = 1; 343 346 Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE, 344 - &Param, 345 - NULL, 347 + &Param, 348 + NULL, 346 349 &StaticString, 347 350 &DynamicString, 348 351 &StringUsed, ··· 374 377 HANDLE h = _CreateActCtxFromFile(L"ntdlltest.manifest", __LINE__); 375 378 BOOL bactivated = FALSE; 376 379 ULONG_PTR cookie; 377 - 380 + 378 381 if (h != INVALID_HANDLE_VALUE) 379 382 bactivated = ActivateActCtx(h, &cookie); 380 383 ··· 396 399 separator = wcsrchr(TestPath, L'\\'); 397 400 separator++; 398 401 wcscpy(separator, L"testdata\\ntdll_apitest.exe RtlDosApplyFileIsolationRedirection_Ustr DoTest"); 399 - 402 + 400 403 created = CreateProcessW(NULL, TestPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); 401 404 ok(created, "Expected CreateProcess to succeed\n"); 402 405 if (created) ··· 406 409 CloseHandle(pi.hProcess); 407 410 } 408 411 } 409 - } 412 + }
modules/rostests/apitests/ntdll/fil1.txt

This is a binary file and will not be displayed.