QueryInformationJobObject

[This is preliminary documentation and subject to change.]

The QueryInformationJobObject function obtains limit and job state information from the job object.

BOOL QueryInformationJobObject(
  HANDLE hJob,
  JOBOBJECTINFOCLASS JobObjectInformationClass,
  LPVOID lpJobObjectInformation,
  DWORD cbJobObjectInformationLength,
  LPDWORD lpReturnLength
);
 

Parameters

hJob
Handle to the job object whose information is being queried. The CreateJobObject or OpenJobObject function returns this handle. The handle must have the JOB_OBJECT_QUERY access right associated with it.

If this value is NULL and the calling process is associated with a job object, the job object associated with the calling process is used.

JobObjectInformationClass
Specifies the information class for limits to be queried. This parameter can be one of the following values.
Value Meaning
JobObjectAssociateCompletionPortInformation The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_ASSOCIATE_COMPLETION_PORT structure.
JobObjectBasicAccountingInformation The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_BASIC_ACCOUNTING_INFORMATION structure.
JobObjectBasicLimitInformation The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_BASIC_LIMIT_INFORMATION structure.
JobObjectBasicProcessIdList The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_BASIC_PROCESS_ID_LIST structure.
JobObjectBasicUIRestrictions The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_BASIC_UI_RESTRICTIONS structure.
JobObjectEndOfJobTimeInformation The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_END_OF_JOB_TIME_INFORMATION structure.
JobObjectSecurityLimitInformation The lpJobObjectInformation parameter is a pointer to a JOBOBJECT_SECURITY_LIMIT_INFORMATION structure.

lpJobObjectInformation
Specifies the limits to be queried for the job object. The format of this data depends on the value of the JobObjectInformationClass parameter.
cbJobObjectInformationLength
Specifies the count, in bytes, of the job object information being queried.
lpReturnLength
Pointer to a DWORD variable that receives the length of data written to the structure pointed to by the lpJobObjectInformation parameter. If you do not want to receive this information, specify NULL.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

You can use QueryInformationJobObject to obtain the current limits, modify them, then use the SetInformationJobObject function to set new limits.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winbase.h.
  Import Library: Use kernel32.lib.

See Also

Processes and Threads Overview, Process and Thread Functions, JOBOBJECT_ASSOCIATE_COMPLETION_PORT, JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, JOBOBJECT_BASIC_LIMIT_INFORMATION, JOBOBJECT_BASIC_PROCESS_ID_LIST, JOBOBJECT_BASIC_UI_RESTRICTIONS, JOBOBJECT_END_OF_JOB_TIME_INFORMATION, SetInformationJobObject