Commit edb5762b authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32/tests: Add a test to show that services.exe is supposed to run in the session 0.

IsWindowsService() from Microsoft.Extensions.Hosting.WindowsServices (.Net 4.6, 4.8, 5.0) depends on this. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent af3fcc3f
......@@ -4959,6 +4959,40 @@ static void test_job_list_attribute(HANDLE parent_job)
ok(ret, "SetInformationJobObject error %lu\n", GetLastError());
}
static void test_services_exe(void)
{
NTSTATUS status;
ULONG size, offset;
char *buf;
SYSTEM_PROCESS_INFORMATION *spi;
ULONG services_pid = 0, services_session_id = ~0;
status = NtQuerySystemInformation(SystemProcessInformation, NULL, 0, &size);
ok(status == STATUS_INFO_LENGTH_MISMATCH, "got %#lx\n", status);
buf = malloc(size);
status = NtQuerySystemInformation(SystemProcessInformation, buf, size, &size);
ok(status == STATUS_SUCCESS, "got %#lx\n", status);
spi = (SYSTEM_PROCESS_INFORMATION *)buf;
offset = 0;
do
{
spi = (SYSTEM_PROCESS_INFORMATION *)(buf + offset);
if (!wcsnicmp(spi->ProcessName.Buffer, L"services.exe", spi->ProcessName.Length/sizeof(WCHAR)))
{
services_pid = HandleToUlong(spi->UniqueProcessId);
services_session_id = spi->SessionId;
}
offset += spi->NextEntryOffset;
} while (spi->NextEntryOffset != 0);
ok(services_pid != 0, "services.exe not found\n");
todo_wine
ok(services_session_id == 0, "got services.exe SessionId %lu\n", services_session_id);
}
START_TEST(process)
{
HANDLE job, hproc, h, h2;
......@@ -5088,6 +5122,7 @@ START_TEST(process)
test_parent_process_attribute(0, NULL);
test_handle_list_attribute(FALSE, NULL, NULL);
test_dead_process();
test_services_exe();
/* things that can be tested:
* lookup: check the way program to be executed is searched
......
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