Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than kernel32, prefix the name with the module name and a period.
<DllImport("kernel32.dll", SetLastError:=True)> _
Private Shared Function SetInformationJobObject(hJob As IntPtr, JobObjectInfoClass As JOBOBJECTINFOCLASS, lpJobObjectInfo As IntPtr, cbJobObjectInfoLength As UInteger) As Boolean
End Function
Dim j_handle As IntPtr
'Create new Job
j_handle = CreateJobObject(Nothing, Nothing)
'Create job info structure
Dim info As New JOBOBJECT_BASIC_LIMIT_INFORMATION()
'Set process limit count to one
info.ActiveProcessLimit = &H1
'Set job info flags to activate process limiting
info.LimitFlags = &H8
'Get length of job limit structure
Dim length As Integer = Marshal.SizeOf(GetType(JOBOBJECT_BASIC_LIMIT_INFORMATION))
'Create a pointer to our structure
Dim basicInfoPtr As IntPtr = Marshal.AllocHGlobal(length)
Marshal.StructureToPtr(info, basicInfoPtr, False)
'Store the job information settings to the job object
Dim intreturn As Integer = SetInformationJobObject(j_handle, JOBOBJECTINFOCLASS.BasicLimitInformation, basicInfoPtr, CUInt(length))
If Not SetInformationJobObject(j_handle, JOBOBJECTINFOCLASS.BasicLimitInformation, basicInfoPtr, CUInt(length)) Then
Throw New Exception(String.Format("Unable to set information. Error: {0}", Marshal.GetLastWin32Error()))
End If
Alternative Managed API:
Do you know one? Please contribute it!
The SetInformationJobObject API
12/30/2011 2:28:32 PM - DMS-167.136.242.30
The information class for the limits to be set on a process job object.
12/30/2011 2:15:20 PM - anonymous
Contains basic limit information for a job object.
11/29/2013 6:02:30 AM - prikryl-109.80.225.166
Structure that contains basic and extended limit information for a job object.
9/6/2013 1:31:33 PM - -203.62.208.2
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).