in src/host/ut_host/ConsoleArgumentsTests.cpp [491:714]
void ConsoleArgumentsTests::LegacyFormatsTests()
{
std::wstring commandline;
commandline = L"conhost.exe 0x4";
ArgTestsRunner(L"#1 Check that legacy launch mechanisms via the system loader with a server handle ID work",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
commandline = L"conhost.exe --server 0x4";
ArgTestsRunner(L"#2 Check that launch mechanism with parameterized server handle ID works",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
commandline = L"conhost.exe 0x4 0x8";
ArgTestsRunner(L"#3 Check that two handle IDs fails (1)",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
false); // successful parse?
commandline = L"conhost.exe --server 0x4 0x8";
ArgTestsRunner(L"#4 Check that two handle IDs fails (2)",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
false); // successful parse?
commandline = L"conhost.exe 0x4 --server 0x8";
ArgTestsRunner(L"#5 Check that two handle IDs fails (3)",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
false); // successful parse?
commandline = L"conhost.exe --server 0x4 --server 0x8";
ArgTestsRunner(L"#6 Check that two handle IDs fails (4)",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
false); // successful parse?
commandline = L"conhost.exe 0x4 -ForceV1";
ArgTestsRunner(L"#7 Check that ConDrv handle + -ForceV1 succeeds",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
true, // forceV1
false, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
commandline = L"conhost.exe -ForceV1";
ArgTestsRunner(L"#8 Check that -ForceV1 parses on its own",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
true, // forceV1
false, // forceNoHandoff
false, // headless
true, // createServerHandle
0, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
commandline = L"conhost.exe 0x4 -ForceNoHandoff";
ArgTestsRunner(L"#9 #7 Check that ConDrv handle + -ForceNoHandoff succeeds",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
true, // forceNoHandoff
false, // headless
false, // createServerHandle
4ul, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
commandline = L"conhost.exe -ForceNoHandoff";
ArgTestsRunner(L"#10 Check that -ForceNoHandoff parses on its own",
commandline,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
ConsoleArguments(commandline,
L"", // clientCommandLine
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
L"", // vtMode
0, // width
0, // height
false, // forceV1
true, // forceNoHandoff
false, // headless
true, // createServerHandle
0, // serverHandle
0, // signalHandle
false, // inheritCursor
false), // runAsComServer
true); // successful parse?
}