parameters: (self)
docstring: Initialization.
docstring_summary: Initialization.
docstring_tokens: Initialization .
function: def __init__(self) -> None:
          """Initialization.
          """
          # get kernel32 instance
          self._kernel32: ctypes.WinDLL = ctypes.WinDLL(
              "kernel32", use_last_error=True)
  
          #
          # fetch functions
          #
  
          self._create_job_object = self._kernel32.CreateJobObjectW
          self._create_job_object.argtypes = (LPSECURITY_ATTRIBUTES, LPCWSTR)
          self._create_job_object.restype = HANDLE
  
          self._query_information_job_object = \
              self._kernel32.QueryInformationJobObject
          self._query_information_job_object.argtypes = (
              HANDLE, ctypes.c_uint32, LPVOID, DWORD, ctypes.POINTER(DWORD))
          self._query_information_job_object.restype = BOOL
  
          self._set_information_job_object = \
              self._kernel32.SetInformationJobObject
          self._set_information_job_object.argtypes = (
              HANDLE, ctypes.c_uint32, LPVOID, DWORD)
          self._set_information_job_object.restype = BOOL
  
          self._assign_process_to_job_object = \
              self._kernel32.AssignProcessToJobObject
          self._assign_process_to_job_object.argtypes = (HANDLE, HANDLE)
          self._assign_process_to_job_object.restype = BOOL
  
          self._create_process = self._kernel32.CreateProcessW
          self._create_process.argtypes = (
              LPCWSTR,
              LPCWSTR,
              LPSECURITY_ATTRIBUTES,
              LPSECURITY_ATTRIBUTES,
              BOOL,
              DWORD,
              LPVOID,
              LPCWSTR,
              LPSTARTUPINFO,
              LPPROCESS_INFORMATION,
          )
          self._create_process.restype = BOOL
  
          self._open_process = self._kernel32.OpenProcess
          self._open_process.argtypes = (DWORD, BOOL, HANDLE)
          self._open_process.restype = HANDLE
  
          self._create_io_completion_port = self._kernel32.CreateIoCompletionPort
          self._create_io_completion_port.argtypes = (
              HANDLE, HANDLE, ULONG_PTR, DWORD)
          self._create_io_completion_port.restype = HANDLE
  
          self._get_queued_completion_status = \
              self._kernel32.GetQueuedCompletionStatus
          self._get_queued_completion_status.argtypes = (
              HANDLE, LPDWORD, PULONG_PTR, ctypes.POINTER(LPOVERLAPPED),
              DWORD)
          self._get_queued_completion_status.restype = BOOL
  
          self._resume_thread = self._kernel32.ResumeThread
          self._resume_thread.argtypes = (HANDLE,)
          self._resume_thread.restype = DWORD
  
          self._terminate_process = self._kernel32.TerminateProcess
          self._terminate_process.argtypes = (HANDLE, ctypes.c_uint32)
          self._terminate_process.restype = BOOL
  
          self._close_handle = self._kernel32.CloseHandle
          self._close_handle.argtypes = (HANDLE,)
          self._close_handle.restype = BOOL
  
          self._function_map = {
              "AssignProcessToJobObject": self._assign_process_to_job_object,
              "CloseHandle": self._close_handle,
              "CreateIoCompletionPort": self._create_io_completion_port,
              "CreateJobObject": self._create_job_object,
              "CreateProcess": self._create_process,
              "GetQueuedCompletionStatus": self._get_queued_completion_status,
              "OpenProcess": self._open_process,
              "QueryInformationJobObject": self._query_information_job_object,
              "ResumeThread": self._resume_thread,
              "TerminateProcess": self._terminate_process,
              "SetInformationJobObject": self._set_information_job_object,
          }
function_tokens: def __init__ ( self ) -> None : # get kernel32 instance self . _kernel32 : ctypes . WinDLL = ctypes . WinDLL ( "kernel32" , use_last_error = True ) # # fetch functions # self . _create_job_object = self . _kernel32 . CreateJobObjectW self . _create_job_object . argtypes = ( LPSECURITY_ATTRIBUTES , LPCWSTR ) self . _create_job_object . restype = HANDLE self . _query_information_job_object = self . _kernel32 . QueryInformationJobObject self . _query_information_job_object . argtypes = ( HANDLE , ctypes . c_uint32 , LPVOID , DWORD , ctypes . POINTER ( DWORD ) ) self . _query_information_job_object . restype = BOOL self . _set_information_job_object = self . _kernel32 . SetInformationJobObject self . _set_information_job_object . argtypes = ( HANDLE , ctypes . c_uint32 , LPVOID , DWORD ) self . _set_information_job_object . restype = BOOL self . _assign_process_to_job_object = self . _kernel32 . AssignProcessToJobObject self . _assign_process_to_job_object . argtypes = ( HANDLE , HANDLE ) self . _assign_process_to_job_object . restype = BOOL self . _create_process = self . _kernel32 . CreateProcessW self . _create_process . argtypes = ( LPCWSTR , LPCWSTR , LPSECURITY_ATTRIBUTES , LPSECURITY_ATTRIBUTES , BOOL , DWORD , LPVOID , LPCWSTR , LPSTARTUPINFO , LPPROCESS_INFORMATION , ) self . _create_process . restype = BOOL self . _open_process = self . _kernel32 . OpenProcess self . _open_process . argtypes = ( DWORD , BOOL , HANDLE ) self . _open_process . restype = HANDLE self . _create_io_completion_port = self . _kernel32 . CreateIoCompletionPort self . _create_io_completion_port . argtypes = ( HANDLE , HANDLE , ULONG_PTR , DWORD ) self . _create_io_completion_port . restype = HANDLE self . _get_queued_completion_status = self . _kernel32 . GetQueuedCompletionStatus self . _get_queued_completion_status . argtypes = ( HANDLE , LPDWORD , PULONG_PTR , ctypes . POINTER ( LPOVERLAPPED ) , DWORD ) self . _get_queued_completion_status . restype = BOOL self . _resume_thread = self . _kernel32 . ResumeThread self . _resume_thread . argtypes = ( HANDLE , ) self . _resume_thread . restype = DWORD self . _terminate_process = self . _kernel32 . TerminateProcess self . _terminate_process . argtypes = ( HANDLE , ctypes . c_uint32 ) self . _terminate_process . restype = BOOL self . _close_handle = self . _kernel32 . CloseHandle self . _close_handle . argtypes = ( HANDLE , ) self . _close_handle . restype = BOOL self . _function_map = { "AssignProcessToJobObject" : self . _assign_process_to_job_object , "CloseHandle" : self . _close_handle , "CreateIoCompletionPort" : self . _create_io_completion_port , "CreateJobObject" : self . _create_job_object , "CreateProcess" : self . _create_process , "GetQueuedCompletionStatus" : self . _get_queued_completion_status , "OpenProcess" : self . _open_process , "QueryInformationJobObject" : self . _query_information_job_object , "ResumeThread" : self . _resume_thread , "TerminateProcess" : self . _terminate_process , "SetInformationJobObject" : self . _set_information_job_object , }