Commit ea4ba2f7 authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

ntdll: Add NtQueryInformationProcess(ProcessQuotaLimits) stub.

Based on a patch by Qian Hong. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=44812Signed-off-by: 's avatarGijs Vermeulen <gijsvrm@gmail.com>
parent 917bd3ca
......@@ -1124,7 +1124,6 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
switch (class)
{
UNIMPLEMENTED_INFO_CLASS(ProcessQuotaLimits);
UNIMPLEMENTED_INFO_CLASS(ProcessBasePriority);
UNIMPLEMENTED_INFO_CLASS(ProcessRaisePriority);
UNIMPLEMENTED_INFO_CLASS(ProcessExceptionPort);
......@@ -1580,6 +1579,35 @@ NTSTATUS WINAPI NtQueryInformationProcess( HANDLE handle, PROCESSINFOCLASS class
else ret = STATUS_INVALID_PARAMETER;
break;
case ProcessQuotaLimits:
{
QUOTA_LIMITS qlimits;
FIXME( "ProcessQuotaLimits (%p,%p,0x%08x,%p) stub\n", handle, info, (int)size, ret_len );
len = sizeof(QUOTA_LIMITS);
if (size == len)
{
if (!handle) ret = STATUS_INVALID_HANDLE;
else
{
/* FIXME: SetProcessWorkingSetSize can also set the quota values.
Quota Limits should be stored inside the process. */
qlimits.PagedPoolLimit = (SIZE_T)-1;
qlimits.NonPagedPoolLimit = (SIZE_T)-1;
/* Default minimum working set size is 204800 bytes (50 Pages) */
qlimits.MinimumWorkingSetSize = 204800;
/* Default maximum working set size is 1413120 bytes (345 Pages) */
qlimits.MaximumWorkingSetSize = 1413120;
qlimits.PagefileLimit = (SIZE_T)-1;
qlimits.TimeLimit.QuadPart = -1;
memcpy(info, &qlimits, len);
}
}
else ret = STATUS_INFO_LENGTH_MISMATCH;
break;
}
default:
FIXME("(%p,info_class=%d,%p,0x%08x,%p) Unknown information class\n",
handle, class, info, (int)size, ret_len );
......
......@@ -252,7 +252,6 @@ static void put_ps_attributes( PS_ATTRIBUTE_LIST32 *attr32, const PS_ATTRIBUTE_L
}
}
void put_vm_counters( VM_COUNTERS_EX32 *info32, const VM_COUNTERS_EX *info, ULONG size )
{
info32->PeakVirtualSize = info->PeakVirtualSize;
......@@ -566,6 +565,27 @@ NTSTATUS WINAPI wow64_NtQueryInformationProcess( UINT *args )
/* FIXME: check buffer alignment */
return NtQueryInformationProcess( handle, class, ptr, len, retlen );
case ProcessQuotaLimits: /* QUOTA_LIMITS */
if (len == sizeof(QUOTA_LIMITS32))
{
QUOTA_LIMITS info;
QUOTA_LIMITS32 *info32 = ptr;
if (!(status = NtQueryInformationProcess( handle, class, &info, sizeof(info), NULL )))
{
info32->PagedPoolLimit = info.PagedPoolLimit;
info32->NonPagedPoolLimit = info.NonPagedPoolLimit;
info32->MinimumWorkingSetSize = info.MinimumWorkingSetSize;
info32->MaximumWorkingSetSize = info.MaximumWorkingSetSize;
info32->PagefileLimit = info.PagefileLimit;
info32->TimeLimit = info.TimeLimit;
if (retlen) *retlen = len;
}
return status;
}
if (retlen) *retlen = sizeof(QUOTA_LIMITS32);
return STATUS_INFO_LENGTH_MISMATCH;
case ProcessVmCounters: /* VM_COUNTERS_EX */
if (len == sizeof(VM_COUNTERS32) || len == sizeof(VM_COUNTERS_EX32))
{
......
......@@ -728,4 +728,14 @@ typedef struct
ULONG Thread;
} PROCESS_ACCESS_TOKEN32;
typedef struct
{
ULONG PagedPoolLimit;
ULONG NonPagedPoolLimit;
ULONG MinimumWorkingSetSize;
ULONG MaximumWorkingSetSize;
ULONG PagefileLimit;
LARGE_INTEGER TimeLimit;
} QUOTA_LIMITS32;
#endif /* __WOW64_STRUCT32_H */
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