mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:43:12 +00:00
[NTDLL_APITEST] Various small fixes
- Add a missing file - Add convenience targets for MSVC_IDE - Remove whitespace at the end of the lines
This commit is contained in:
parent
ffae49deaf
commit
66e40be8eb
3 changed files with 48 additions and 30 deletions
|
@ -90,5 +90,20 @@ add_rostests_file(TARGET ntdll_apitest SUBDIR testdata)
|
||||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
|
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdll_apitest.exe.local" SUBDIR testdata)
|
||||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
|
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/shell32.dll" SUBDIR testdata)
|
||||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
|
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/test.dll" SUBDIR testdata)
|
||||||
|
|
||||||
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
|
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/ntdlltest.manifest" SUBDIR testdata)
|
||||||
|
add_rostests_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/fil1.txt" SUBDIR testdata)
|
||||||
|
|
||||||
|
# Convenience target for running from IDE
|
||||||
|
if(MSVC_IDE)
|
||||||
|
set(NTDLL_APITEST_DATADIR $<TARGET_FILE_DIR:ntdll_apitest>/testdata/)
|
||||||
|
add_custom_command(TARGET ntdll_apitest
|
||||||
|
POST_BUILD
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E make_directory ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy $<TARGET_FILE:ntdll_apitest> ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy ntdll_apitest.exe.local ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy shell32.dll ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy test.dll ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy ntdlltest.manifest ${NTDLL_APITEST_DATADIR}
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -E copy fil1.txt ${NTDLL_APITEST_DATADIR}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
endif()
|
||||||
|
|
|
@ -22,7 +22,7 @@ struct test_data
|
||||||
WCHAR* ExpectedSubString;
|
WCHAR* ExpectedSubString;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct test_data Tests[] =
|
struct test_data Tests[] =
|
||||||
{
|
{
|
||||||
/* Not redirected file */
|
/* Not redirected file */
|
||||||
{__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"somefilesomefile", NULL},
|
{__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"somefilesomefile", NULL},
|
||||||
|
@ -33,6 +33,9 @@ struct test_data Tests[] =
|
||||||
{__LINE__, STATUS_SUCCESS, L"COMCTL32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
{__LINE__, STATUS_SUCCESS, L"COMCTL32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
||||||
{__LINE__, STATUS_SUCCESS, L"comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
{__LINE__, STATUS_SUCCESS, L"comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
||||||
{__LINE__, STATUS_SUCCESS, L"c:\\windows\\system32\\comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
{__LINE__, STATUS_SUCCESS, L"c:\\windows\\system32\\comctl32.DLL", L"\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82"},
|
||||||
|
/* Files not redirected with sxs */
|
||||||
|
{__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"MSVCR90.DLL", NULL},
|
||||||
|
{__LINE__, STATUS_SXS_KEY_NOT_FOUND, L"c:\\windows\\system32\\MSVCR90.DLL", NULL},
|
||||||
/* Files defined in the manifest, one exists, one doesn't */
|
/* Files defined in the manifest, one exists, one doesn't */
|
||||||
{__LINE__, STATUS_SUCCESS, L"deptest.dll", EXPECT_IN_SAME_DIR},
|
{__LINE__, STATUS_SUCCESS, L"deptest.dll", EXPECT_IN_SAME_DIR},
|
||||||
{__LINE__, STATUS_SUCCESS, L"adllfile.dll", EXPECT_IN_SAME_DIR},
|
{__LINE__, STATUS_SUCCESS, L"adllfile.dll", EXPECT_IN_SAME_DIR},
|
||||||
|
@ -69,7 +72,7 @@ HANDLE _CreateActCtxFromFile(LPCWSTR FileName, int line)
|
||||||
SetLastError(0xdeaddead);
|
SetLastError(0xdeaddead);
|
||||||
h = CreateActCtxW(&ActCtx);
|
h = CreateActCtxW(&ActCtx);
|
||||||
ok_(__FILE__, line)(h != INVALID_HANDLE_VALUE, "CreateActCtx failed for %S\n", FileName);
|
ok_(__FILE__, line)(h != INVALID_HANDLE_VALUE, "CreateActCtx failed for %S\n", FileName);
|
||||||
// In win10 last error is unchanged and in win2k3 it is ERROR_BAD_EXE_FORMAT
|
// In win10 last error is unchanged and in win2k3 it is ERROR_BAD_EXE_FORMAT
|
||||||
ok_(__FILE__, line)(GetLastError() == ERROR_BAD_EXE_FORMAT || GetLastError() == 0xdeaddead, "Wrong last error %lu\n", GetLastError());
|
ok_(__FILE__, line)(GetLastError() == ERROR_BAD_EXE_FORMAT || GetLastError() == 0xdeaddead, "Wrong last error %lu\n", GetLastError());
|
||||||
|
|
||||||
return h;
|
return h;
|
||||||
|
@ -148,7 +151,7 @@ void TestBuffers()
|
||||||
|
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
|
@ -161,8 +164,8 @@ void TestBuffers()
|
||||||
RtlInitEmptyUnicodeString(&Param, NULL, 0);
|
RtlInitEmptyUnicodeString(&Param, NULL, 0);
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -176,8 +179,8 @@ void TestBuffers()
|
||||||
Param.Buffer = L"comctl32.dllcrapcrap";
|
Param.Buffer = L"comctl32.dllcrapcrap";
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -190,8 +193,8 @@ void TestBuffers()
|
||||||
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -203,8 +206,8 @@ void TestBuffers()
|
||||||
RtlInitUnicodeString(&Param, L"comctl32");
|
RtlInitUnicodeString(&Param, L"comctl32");
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -216,8 +219,8 @@ void TestBuffers()
|
||||||
RtlInitUnicodeString(&Param, L"comctl32");
|
RtlInitUnicodeString(&Param, L"comctl32");
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
&DotDll,
|
&DotDll,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -230,7 +233,7 @@ void TestBuffers()
|
||||||
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
|
@ -254,8 +257,8 @@ void TestBuffers()
|
||||||
StaticString.MaximumLength = sizeof(buffer);
|
StaticString.MaximumLength = sizeof(buffer);
|
||||||
Param = StaticString;
|
Param = StaticString;
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
NULL,
|
NULL,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -269,8 +272,8 @@ void TestBuffers()
|
||||||
StaticString.Length = sizeof(L"comctl32.dll");
|
StaticString.Length = sizeof(L"comctl32.dll");
|
||||||
StaticString.MaximumLength = sizeof(buffer);
|
StaticString.MaximumLength = sizeof(buffer);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
NULL,
|
NULL,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -282,8 +285,8 @@ void TestBuffers()
|
||||||
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
RtlInitUnicodeString(&Param, L"comctl32.dll");
|
||||||
RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer));
|
RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer));
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
NULL,
|
NULL,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -301,8 +304,8 @@ void TestBuffers()
|
||||||
|
|
||||||
RtlInitEmptyUnicodeString(&StaticString, buffer, 5 * sizeof(WCHAR));
|
RtlInitEmptyUnicodeString(&StaticString, buffer, 5 * sizeof(WCHAR));
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
NULL,
|
NULL,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -315,8 +318,8 @@ void TestBuffers()
|
||||||
RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer));
|
RtlInitEmptyUnicodeString(&StaticString, buffer, sizeof(buffer));
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -341,8 +344,8 @@ void TestBuffers()
|
||||||
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
RtlInitEmptyUnicodeString(&DynamicString, NULL, 0);
|
||||||
StaticString.Buffer[0] = 1;
|
StaticString.Buffer[0] = 1;
|
||||||
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
Status = RtlDosApplyFileIsolationRedirection_Ustr(TRUE,
|
||||||
&Param,
|
&Param,
|
||||||
NULL,
|
NULL,
|
||||||
&StaticString,
|
&StaticString,
|
||||||
&DynamicString,
|
&DynamicString,
|
||||||
&StringUsed,
|
&StringUsed,
|
||||||
|
@ -374,7 +377,7 @@ START_TEST(RtlDosApplyFileIsolationRedirection_Ustr)
|
||||||
HANDLE h = _CreateActCtxFromFile(L"ntdlltest.manifest", __LINE__);
|
HANDLE h = _CreateActCtxFromFile(L"ntdlltest.manifest", __LINE__);
|
||||||
BOOL bactivated = FALSE;
|
BOOL bactivated = FALSE;
|
||||||
ULONG_PTR cookie;
|
ULONG_PTR cookie;
|
||||||
|
|
||||||
if (h != INVALID_HANDLE_VALUE)
|
if (h != INVALID_HANDLE_VALUE)
|
||||||
bactivated = ActivateActCtx(h, &cookie);
|
bactivated = ActivateActCtx(h, &cookie);
|
||||||
|
|
||||||
|
@ -396,7 +399,7 @@ START_TEST(RtlDosApplyFileIsolationRedirection_Ustr)
|
||||||
separator = wcsrchr(TestPath, L'\\');
|
separator = wcsrchr(TestPath, L'\\');
|
||||||
separator++;
|
separator++;
|
||||||
wcscpy(separator, L"testdata\\ntdll_apitest.exe RtlDosApplyFileIsolationRedirection_Ustr DoTest");
|
wcscpy(separator, L"testdata\\ntdll_apitest.exe RtlDosApplyFileIsolationRedirection_Ustr DoTest");
|
||||||
|
|
||||||
created = CreateProcessW(NULL, TestPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
created = CreateProcessW(NULL, TestPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||||
ok(created, "Expected CreateProcess to succeed\n");
|
ok(created, "Expected CreateProcess to succeed\n");
|
||||||
if (created)
|
if (created)
|
||||||
|
@ -406,4 +409,4 @@ START_TEST(RtlDosApplyFileIsolationRedirection_Ustr)
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
0
modules/rostests/apitests/ntdll/fil1.txt
Normal file
0
modules/rostests/apitests/ntdll/fil1.txt
Normal file
Loading…
Add table
Add a link
Reference in a new issue