QueryInformationJobObject function kernel32

Win32Result<bool> QueryInformationJobObject(
  1. HANDLE? hJob,
  2. JOBOBJECTINFOCLASS jobObjectInformationClass,
  3. Pointer<NativeType> lpJobObjectInformation,
  4. int cbJobObjectInformationLength,
  5. Pointer<Uint32>? lpReturnLength,
)

Retrieves limit and job state information from the job object.

To learn more, see learn.microsoft.com/windows/win32/api/jobapi2/nf-jobapi2-queryinformationjobobject.

Implementation

Win32Result<bool> QueryInformationJobObject(
  HANDLE? hJob,
  JOBOBJECTINFOCLASS jobObjectInformationClass,
  Pointer lpJobObjectInformation,
  int cbJobObjectInformationLength,
  Pointer<Uint32>? lpReturnLength,
) {
  resolveGetLastError();
  final result_ = _QueryInformationJobObject(
    hJob ?? nullptr,
    jobObjectInformationClass,
    lpJobObjectInformation,
    cbJobObjectInformationLength,
    lpReturnLength ?? nullptr,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}