Commit ac4dd077 authored by Roman Pišl's avatar Roman Pišl Committed by Alexandre Julliard

kernel32/tests: Add test for GetConsoleProcessList.

parent e7a91b0a
...@@ -1304,8 +1304,8 @@ static void test_GetConsoleProcessList(void) ...@@ -1304,8 +1304,8 @@ static void test_GetConsoleProcessList(void)
GetLastError()); GetLastError());
/* We should only have 1 process but only for these specific unit tests as /* We should only have 1 process but only for these specific unit tests as
* we created our own console. An AttachConsole(ATTACH_PARENT_PROCESS) would * we created our own console. An AttachConsole(ATTACH_PARENT_PROCESS)
* give us two processes for example. * gives us two processes - see test_AttachConsole.
*/ */
list = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)); list = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD));
...@@ -4354,6 +4354,27 @@ static void test_AttachConsole_child(DWORD console_pid) ...@@ -4354,6 +4354,27 @@ static void test_AttachConsole_child(DWORD console_pid)
res = AttachConsole(ATTACH_PARENT_PROCESS); res = AttachConsole(ATTACH_PARENT_PROCESS);
ok(res, "AttachConsole failed: %u\n", GetLastError()); ok(res, "AttachConsole failed: %u\n", GetLastError());
if (pGetConsoleProcessList)
{
DWORD list[2] = { 0xbabebabe };
DWORD pid = GetCurrentProcessId();
SetLastError(0xdeadbeef);
len = pGetConsoleProcessList(list, 1);
todo_wine
ok(len == 2, "Expected 2 processes, got %d\n", len);
ok(list[0] == 0xbabebabe, "Unexpected value in list %u\n", list[0]);
len = pGetConsoleProcessList(list, 2);
todo_wine
ok(len == 2, "Expected 2 processes, got %d\n", len);
todo_wine
ok(list[0] == console_pid || list[1] == console_pid, "Parent PID not in list\n");
todo_wine
ok(list[0] == pid || list[1] == pid, "PID not in list\n");
ok(GetLastError() == 0xdeadbeef, "Unexpected last error: %u\n", GetLastError());
}
ok(pipe_in != GetStdHandle(STD_INPUT_HANDLE), "std handle not set to console\n"); ok(pipe_in != GetStdHandle(STD_INPUT_HANDLE), "std handle not set to console\n");
ok(pipe_out != GetStdHandle(STD_OUTPUT_HANDLE), "std handle not set to console\n"); ok(pipe_out != GetStdHandle(STD_OUTPUT_HANDLE), "std handle not set to console\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment