Export (0) Print
Expand All
Expand Minimize

OpenJobObject function

Opens an existing job object.

Syntax


HANDLE WINAPI OpenJobObject(
  _In_  DWORD dwDesiredAccess,
  _In_  BOOL bInheritHandles,
  _In_  LPCTSTR lpName
);

Parameters

dwDesiredAccess [in]

The access to the job object. This parameter can be one or more of the job object access rights. This access right is checked against any security descriptor for the object.

bInheritHandles [in]

If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle.

lpName [in]

The name of the job to be opened. Name comparisons are case sensitive.

This function can open objects in a private namespace. For more information, see Object Namespaces.

Terminal Services:  The name can have a "Global\" or "Local\" prefix to explicitly open the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\). For more information, see Kernel Object Namespaces.

Return value

If the function succeeds, the return value is a handle to the job. The handle provides the requested access to the job.

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

Remarks

To associate a process with a job, use the AssignProcessToJobObject function.

To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

WinBase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

OpenJobObjectW (Unicode) and OpenJobObjectA (ANSI)

See also

AssignProcessToJobObject
Job Objects
Process and Thread Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft