ntdll: Add stub for JobObjectBasicAccountingInformation and JobObjectBasicProcessIdList.

Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Müller 2017-04-23 23:22:25 +02:00 committed by Alexandre Julliard
parent a345265614
commit 62ae2ae1a1
2 changed files with 32 additions and 2 deletions

View File

@ -2515,7 +2515,6 @@ static void test_QueryInformationJobObject(void)
ret = QueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list,
FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList), &ret_len);
ok(!ret, "QueryInformationJobObject expected failure\n");
todo_wine
expect_eq_d(ERROR_BAD_LENGTH, GetLastError());
SetLastError(0xdeadbeef);
@ -2524,18 +2523,20 @@ static void test_QueryInformationJobObject(void)
pid_list->NumberOfProcessIdsInList = 42;
ret = QueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list,
FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[1]), &ret_len);
todo_wine
ok(!ret, "QueryInformationJobObject expected failure\n");
todo_wine
expect_eq_d(ERROR_MORE_DATA, GetLastError());
if (ret)
{
todo_wine
expect_eq_d(42, pid_list->NumberOfAssignedProcesses);
todo_wine
expect_eq_d(42, pid_list->NumberOfProcessIdsInList);
}
memset(buf, 0, sizeof(buf));
ret = pQueryInformationJobObject(job, JobObjectBasicProcessIdList, pid_list, sizeof(buf), &ret_len);
todo_wine
ok(ret, "QueryInformationJobObject error %u\n", GetLastError());
if(ret)
{
@ -2545,12 +2546,17 @@ static void test_QueryInformationJobObject(void)
{
ULONG_PTR *list = pid_list->ProcessIdList;
todo_wine
ok(ret_len == FIELD_OFFSET(JOBOBJECT_BASIC_PROCESS_ID_LIST, ProcessIdList[2]),
"QueryInformationJobObject returned ret_len=%u\n", ret_len);
todo_wine
expect_eq_d(2, pid_list->NumberOfAssignedProcesses);
todo_wine
expect_eq_d(2, pid_list->NumberOfProcessIdsInList);
todo_wine
expect_eq_d(pi[0].dwProcessId, list[0]);
todo_wine
expect_eq_d(pi[1].dwProcessId, list[1]);
}
}

View File

@ -645,6 +645,30 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c
switch (class)
{
case JobObjectBasicAccountingInformation:
{
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION *accounting;
if (len < sizeof(*accounting))
return STATUS_INFO_LENGTH_MISMATCH;
accounting = (JOBOBJECT_BASIC_ACCOUNTING_INFORMATION *)info;
memset(accounting, 0, sizeof(*accounting));
if (ret_len) *ret_len = sizeof(*accounting);
return STATUS_SUCCESS;
}
case JobObjectBasicProcessIdList:
{
JOBOBJECT_BASIC_PROCESS_ID_LIST *process;
if (len < sizeof(*process))
return STATUS_INFO_LENGTH_MISMATCH;
process = (JOBOBJECT_BASIC_PROCESS_ID_LIST *)info;
memset(process, 0, sizeof(*process));
if (ret_len) *ret_len = sizeof(*process);
return STATUS_SUCCESS;
}
case JobObjectExtendedLimitInformation:
{
JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit;