ntdll: Move the job functions to the Unix library.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-06-13 13:21:26 +02:00
parent 06fa3d32a7
commit 07248fc500
4 changed files with 256 additions and 223 deletions

View File

@ -24,28 +24,7 @@
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <signal.h>
#ifdef HAVE_SYS_SYSCALL_H
#include <sys/syscall.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SCHED_H
# include <sched.h>
#endif
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
@ -321,23 +300,7 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class,
*/
NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
{
NTSTATUS ret;
data_size_t len;
struct object_attributes *objattr;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
SERVER_START_REQ( create_job )
{
req->access = access;
wine_server_add_data( req, objattr, len );
ret = wine_server_call( req );
*handle = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr );
return ret;
return unix_funcs->NtCreateJobObject( handle, access, attr );
}
/******************************************************************************
@ -346,22 +309,7 @@ NTSTATUS WINAPI NtCreateJobObject( PHANDLE handle, ACCESS_MASK access, const OBJ
*/
NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
{
NTSTATUS ret;
if ((ret = validate_open_object_attributes( attr ))) return ret;
SERVER_START_REQ( open_job )
{
req->access = access;
req->attributes = attr->Attributes;
req->rootdir = wine_server_obj_handle( attr->RootDirectory );
if (attr->ObjectName)
wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length );
ret = wine_server_call( req );
*handle = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
return ret;
return unix_funcs->NtOpenJobObject( handle, access, attr );
}
/******************************************************************************
@ -370,19 +318,7 @@ NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJEC
*/
NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status )
{
NTSTATUS ret;
TRACE( "(%p, %d)\n", handle, status );
SERVER_START_REQ( terminate_job )
{
req->handle = wine_server_obj_handle( handle );
req->status = status;
ret = wine_server_call( req );
}
SERVER_END_REQ;
return ret;
return unix_funcs->NtTerminateJobObject( handle, status );
}
/******************************************************************************
@ -392,78 +328,7 @@ NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status )
NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info,
ULONG len, PULONG ret_len )
{
NTSTATUS ret;
TRACE( "semi-stub: %p %u %p %u %p\n", handle, class, info, len, ret_len );
if (class >= MaxJobObjectInfoClass)
return STATUS_INVALID_PARAMETER;
switch (class)
{
case JobObjectBasicAccountingInformation:
{
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION *accounting;
if (len < sizeof(*accounting))
return STATUS_INFO_LENGTH_MISMATCH;
accounting = (JOBOBJECT_BASIC_ACCOUNTING_INFORMATION *)info;
SERVER_START_REQ(get_job_info)
{
req->handle = wine_server_obj_handle( handle );
if ((ret = wine_server_call( req )) == STATUS_SUCCESS)
{
memset(accounting, 0, sizeof(*accounting));
accounting->TotalProcesses = reply->total_processes;
accounting->ActiveProcesses = reply->active_processes;
}
}
SERVER_END_REQ;
if (ret_len) *ret_len = sizeof(*accounting);
return ret;
}
case JobObjectBasicProcessIdList:
{
JOBOBJECT_BASIC_PROCESS_ID_LIST *process;
if (len < sizeof(*process))
return STATUS_INFO_LENGTH_MISMATCH;
process = (JOBOBJECT_BASIC_PROCESS_ID_LIST *)info;
memset(process, 0, sizeof(*process));
if (ret_len) *ret_len = sizeof(*process);
return STATUS_SUCCESS;
}
case JobObjectExtendedLimitInformation:
{
JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit;
if (len < sizeof(*extended_limit))
return STATUS_INFO_LENGTH_MISMATCH;
extended_limit = (JOBOBJECT_EXTENDED_LIMIT_INFORMATION *)info;
memset(extended_limit, 0, sizeof(*extended_limit));
if (ret_len) *ret_len = sizeof(*extended_limit);
return STATUS_SUCCESS;
}
case JobObjectBasicLimitInformation:
{
JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit;
if (len < sizeof(*basic_limit))
return STATUS_INFO_LENGTH_MISMATCH;
basic_limit = (JOBOBJECT_BASIC_LIMIT_INFORMATION *)info;
memset(basic_limit, 0, sizeof(*basic_limit));
if (ret_len) *ret_len = sizeof(*basic_limit);
return STATUS_SUCCESS;
}
default:
return STATUS_NOT_IMPLEMENTED;
}
return unix_funcs->NtQueryInformationJobObject( handle, class, info, len, ret_len );
}
/******************************************************************************
@ -472,63 +337,7 @@ NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS c
*/
NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, PVOID info, ULONG len )
{
NTSTATUS status = STATUS_NOT_IMPLEMENTED;
JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit;
ULONG info_size = sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION);
DWORD limit_flags = JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS;
TRACE( "(%p, %u, %p, %u)\n", handle, class, info, len );
if (class >= MaxJobObjectInfoClass)
return STATUS_INVALID_PARAMETER;
switch (class)
{
case JobObjectExtendedLimitInformation:
info_size = sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
limit_flags = JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS;
/* fallthrough */
case JobObjectBasicLimitInformation:
if (len != info_size)
return STATUS_INVALID_PARAMETER;
basic_limit = info;
if (basic_limit->LimitFlags & ~limit_flags)
return STATUS_INVALID_PARAMETER;
SERVER_START_REQ( set_job_limits )
{
req->handle = wine_server_obj_handle( handle );
req->limit_flags = basic_limit->LimitFlags;
status = wine_server_call( req );
}
SERVER_END_REQ;
break;
case JobObjectAssociateCompletionPortInformation:
if (len != sizeof(JOBOBJECT_ASSOCIATE_COMPLETION_PORT))
return STATUS_INVALID_PARAMETER;
SERVER_START_REQ( set_job_completion_port )
{
JOBOBJECT_ASSOCIATE_COMPLETION_PORT *port_info = info;
req->job = wine_server_obj_handle( handle );
req->port = wine_server_obj_handle( port_info->CompletionPort );
req->key = wine_server_client_ptr( port_info->CompletionKey );
status = wine_server_call(req);
}
SERVER_END_REQ;
break;
case JobObjectBasicUIRestrictions:
status = STATUS_SUCCESS;
/* fallthrough */
default:
FIXME( "stub: %p %u %p %u\n", handle, class, info, len );
}
return status;
return unix_funcs->NtSetInformationJobObject( handle, class, info, len );
}
/******************************************************************************
@ -537,19 +346,7 @@ NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS cla
*/
NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job )
{
NTSTATUS status;
TRACE( "(%p %p)\n", job, process );
SERVER_START_REQ( process_in_job )
{
req->job = wine_server_obj_handle( job );
req->process = wine_server_obj_handle( process );
status = wine_server_call( req );
}
SERVER_END_REQ;
return status;
return unix_funcs->NtIsProcessInJob( process, job );
}
/******************************************************************************
@ -558,19 +355,7 @@ NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job )
*/
NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process )
{
NTSTATUS status;
TRACE( "(%p %p)\n", job, process );
SERVER_START_REQ( assign_job )
{
req->job = wine_server_obj_handle( job );
req->process = wine_server_obj_handle( process );
status = wine_server_call( req );
}
SERVER_END_REQ;
return status;
return unix_funcs->NtAssignProcessToJobObject( job, process );
}
/*

View File

@ -820,6 +820,7 @@ static struct unix_funcs unix_funcs =
NtAlertThread,
NtAllocateVirtualMemory,
NtAreMappedFilesTheSame,
NtAssignProcessToJobObject,
NtCancelTimer,
NtClearEvent,
NtClose,
@ -827,6 +828,7 @@ static struct unix_funcs unix_funcs =
NtCreateEvent,
NtCreateFile,
NtCreateIoCompletion,
NtCreateJobObject,
NtCreateKeyedEvent,
NtCreateMailslotFile,
NtCreateMutant,
@ -843,11 +845,13 @@ static struct unix_funcs unix_funcs =
NtFreeVirtualMemory,
NtGetContextThread,
NtGetWriteWatch,
NtIsProcessInJob,
NtLockVirtualMemory,
NtMapViewOfSection,
NtOpenEvent,
NtOpenFile,
NtOpenIoCompletion,
NtOpenJobObject,
NtOpenKeyedEvent,
NtOpenMutant,
NtOpenSection,
@ -860,6 +864,7 @@ static struct unix_funcs unix_funcs =
NtQueryDirectoryFile,
NtQueryEvent,
NtQueryFullAttributesFile,
NtQueryInformationJobObject,
NtQueryIoCompletion,
NtQueryMutant,
NtQueryPerformanceCounter,
@ -881,12 +886,14 @@ static struct unix_funcs unix_funcs =
NtResumeThread,
NtSetContextThread,
NtSetEvent,
NtSetInformationJobObject,
NtSetIoCompletion,
NtSetLdtEntries,
NtSetSystemTime,
NtSetTimer,
NtSignalAndWaitForSingleObject,
NtSuspendThread,
NtTerminateJobObject,
NtTerminateThread,
NtUnlockVirtualMemory,
NtUnmapViewOfSection,

View File

@ -683,6 +683,236 @@ NTSTATUS WINAPI NtQueryMutant( HANDLE handle, MUTANT_INFORMATION_CLASS class,
}
/**************************************************************************
* NtCreateJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtCreateJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
{
NTSTATUS ret;
data_size_t len;
struct object_attributes *objattr;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
SERVER_START_REQ( create_job )
{
req->access = access;
wine_server_add_data( req, objattr, len );
ret = wine_server_call( req );
*handle = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
RtlFreeHeap( GetProcessHeap(), 0, objattr );
return ret;
}
/**************************************************************************
* NtOpenJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtOpenJobObject( HANDLE *handle, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
{
NTSTATUS ret;
if ((ret = validate_open_object_attributes( attr ))) return ret;
SERVER_START_REQ( open_job )
{
req->access = access;
req->attributes = attr->Attributes;
req->rootdir = wine_server_obj_handle( attr->RootDirectory );
if (attr->ObjectName)
wine_server_add_data( req, attr->ObjectName->Buffer, attr->ObjectName->Length );
ret = wine_server_call( req );
*handle = wine_server_ptr_handle( reply->handle );
}
SERVER_END_REQ;
return ret;
}
/**************************************************************************
* NtTerminateJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtTerminateJobObject( HANDLE handle, NTSTATUS status )
{
NTSTATUS ret;
TRACE( "(%p, %d)\n", handle, status );
SERVER_START_REQ( terminate_job )
{
req->handle = wine_server_obj_handle( handle );
req->status = status;
ret = wine_server_call( req );
}
SERVER_END_REQ;
return ret;
}
/**************************************************************************
* NtQueryInformationJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtQueryInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, void *info,
ULONG len, ULONG *ret_len )
{
NTSTATUS ret;
TRACE( "semi-stub: %p %u %p %u %p\n", handle, class, info, len, ret_len );
if (class >= MaxJobObjectInfoClass) return STATUS_INVALID_PARAMETER;
switch (class)
{
case JobObjectBasicAccountingInformation:
{
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION *accounting = info;
if (len < sizeof(*accounting)) return STATUS_INFO_LENGTH_MISMATCH;
SERVER_START_REQ(get_job_info)
{
req->handle = wine_server_obj_handle( handle );
if (!(ret = wine_server_call( req )))
{
memset( accounting, 0, sizeof(*accounting) );
accounting->TotalProcesses = reply->total_processes;
accounting->ActiveProcesses = reply->active_processes;
}
}
SERVER_END_REQ;
if (ret_len) *ret_len = sizeof(*accounting);
return ret;
}
case JobObjectBasicProcessIdList:
{
JOBOBJECT_BASIC_PROCESS_ID_LIST *process = info;
if (len < sizeof(*process)) return STATUS_INFO_LENGTH_MISMATCH;
memset( process, 0, sizeof(*process) );
if (ret_len) *ret_len = sizeof(*process);
return STATUS_SUCCESS;
}
case JobObjectExtendedLimitInformation:
{
JOBOBJECT_EXTENDED_LIMIT_INFORMATION *extended_limit = info;
if (len < sizeof(*extended_limit)) return STATUS_INFO_LENGTH_MISMATCH;
memset( extended_limit, 0, sizeof(*extended_limit) );
if (ret_len) *ret_len = sizeof(*extended_limit);
return STATUS_SUCCESS;
}
case JobObjectBasicLimitInformation:
{
JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit = info;
if (len < sizeof(*basic_limit)) return STATUS_INFO_LENGTH_MISMATCH;
memset( basic_limit, 0, sizeof(*basic_limit) );
if (ret_len) *ret_len = sizeof(*basic_limit);
return STATUS_SUCCESS;
}
default:
return STATUS_NOT_IMPLEMENTED;
}
}
/**************************************************************************
* NtSetInformationJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtSetInformationJobObject( HANDLE handle, JOBOBJECTINFOCLASS class, void *info, ULONG len )
{
NTSTATUS status = STATUS_NOT_IMPLEMENTED;
JOBOBJECT_BASIC_LIMIT_INFORMATION *basic_limit;
ULONG info_size = sizeof(JOBOBJECT_BASIC_LIMIT_INFORMATION);
DWORD limit_flags = JOB_OBJECT_BASIC_LIMIT_VALID_FLAGS;
TRACE( "(%p, %u, %p, %u)\n", handle, class, info, len );
if (class >= MaxJobObjectInfoClass) return STATUS_INVALID_PARAMETER;
switch (class)
{
case JobObjectExtendedLimitInformation:
info_size = sizeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION);
limit_flags = JOB_OBJECT_EXTENDED_LIMIT_VALID_FLAGS;
/* fall through */
case JobObjectBasicLimitInformation:
if (len != info_size) return STATUS_INVALID_PARAMETER;
basic_limit = info;
if (basic_limit->LimitFlags & ~limit_flags) return STATUS_INVALID_PARAMETER;
SERVER_START_REQ( set_job_limits )
{
req->handle = wine_server_obj_handle( handle );
req->limit_flags = basic_limit->LimitFlags;
status = wine_server_call( req );
}
SERVER_END_REQ;
break;
case JobObjectAssociateCompletionPortInformation:
if (len != sizeof(JOBOBJECT_ASSOCIATE_COMPLETION_PORT)) return STATUS_INVALID_PARAMETER;
SERVER_START_REQ( set_job_completion_port )
{
JOBOBJECT_ASSOCIATE_COMPLETION_PORT *port_info = info;
req->job = wine_server_obj_handle( handle );
req->port = wine_server_obj_handle( port_info->CompletionPort );
req->key = wine_server_client_ptr( port_info->CompletionKey );
status = wine_server_call( req );
}
SERVER_END_REQ;
break;
case JobObjectBasicUIRestrictions:
status = STATUS_SUCCESS;
/* fall through */
default:
FIXME( "stub: %p %u %p %u\n", handle, class, info, len );
}
return status;
}
/**************************************************************************
* NtIsProcessInJob (NTDLL.@)
*/
NTSTATUS WINAPI NtIsProcessInJob( HANDLE process, HANDLE job )
{
NTSTATUS status;
TRACE( "(%p %p)\n", job, process );
SERVER_START_REQ( process_in_job )
{
req->job = wine_server_obj_handle( job );
req->process = wine_server_obj_handle( process );
status = wine_server_call( req );
}
SERVER_END_REQ;
return status;
}
/**************************************************************************
* NtAssignProcessToJobObject (NTDLL.@)
*/
NTSTATUS WINAPI NtAssignProcessToJobObject( HANDLE job, HANDLE process )
{
NTSTATUS status;
TRACE( "(%p %p)\n", job, process );
SERVER_START_REQ( assign_job )
{
req->job = wine_server_obj_handle( job );
req->process = wine_server_obj_handle( process );
status = wine_server_call( req );
}
SERVER_END_REQ;
return status;
}
/**************************************************************************
* NtCreateTimer (NTDLL.@)
*/

View File

@ -28,7 +28,7 @@ struct ldt_copy;
struct msghdr;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 44
#define NTDLL_UNIXLIB_VERSION 45
struct unix_funcs
{
@ -38,6 +38,7 @@ struct unix_funcs
NTSTATUS (WINAPI *NtAllocateVirtualMemory)( HANDLE process, PVOID *ret, ULONG_PTR zero_bits,
SIZE_T *size_ptr, ULONG type, ULONG protect );
NTSTATUS (WINAPI *NtAreMappedFilesTheSame)(PVOID addr1, PVOID addr2);
NTSTATUS (WINAPI *NtAssignProcessToJobObject)( HANDLE job, HANDLE process );
NTSTATUS (WINAPI *NtCancelTimer)( HANDLE handle, BOOLEAN *state );
NTSTATUS (WINAPI *NtClearEvent)( HANDLE handle );
NTSTATUS (WINAPI *NtClose)( HANDLE handle );
@ -50,6 +51,8 @@ struct unix_funcs
ULONG options, void *ea_buffer, ULONG ea_length );
NTSTATUS (WINAPI *NtCreateIoCompletion)( HANDLE *handle, ACCESS_MASK access,
OBJECT_ATTRIBUTES *attr, ULONG threads );
NTSTATUS (WINAPI *NtCreateJobObject)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtCreateKeyedEvent)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr, ULONG flags );
NTSTATUS (WINAPI *NtCreateMailslotFile)( HANDLE *handle, ULONG access, OBJECT_ATTRIBUTES *attr,
@ -87,6 +90,7 @@ struct unix_funcs
NTSTATUS (WINAPI *NtGetContextThread)( HANDLE handle, CONTEXT *context );
NTSTATUS (WINAPI *NtGetWriteWatch)( HANDLE process, ULONG flags, PVOID base, SIZE_T size,
PVOID *addresses, ULONG_PTR *count, ULONG *granularity );
NTSTATUS (WINAPI *NtIsProcessInJob)( HANDLE process, HANDLE job );
NTSTATUS (WINAPI *NtLockVirtualMemory)( HANDLE process, PVOID *addr, SIZE_T *size, ULONG unknown );
NTSTATUS (WINAPI *NtMapViewOfSection)( HANDLE handle, HANDLE process, PVOID *addr_ptr,
ULONG_PTR zero_bits, SIZE_T commit_size,
@ -98,6 +102,8 @@ struct unix_funcs
IO_STATUS_BLOCK *io, ULONG sharing, ULONG options );
NTSTATUS (WINAPI *NtOpenIoCompletion)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtOpenJobObject)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtOpenKeyedEvent)( HANDLE *handle, ACCESS_MASK access,
const OBJECT_ATTRIBUTES *attr );
NTSTATUS (WINAPI *NtOpenMutant)( HANDLE *handle, ACCESS_MASK access,
@ -123,6 +129,8 @@ struct unix_funcs
void *info, ULONG len, ULONG *ret_len );
NTSTATUS (WINAPI *NtQueryFullAttributesFile)( const OBJECT_ATTRIBUTES *attr,
FILE_NETWORK_OPEN_INFORMATION *info );
NTSTATUS (WINAPI *NtQueryInformationJobObject)( HANDLE handle, JOBOBJECTINFOCLASS class,
void *info, ULONG len, ULONG *ret_len );
NTSTATUS (WINAPI *NtQueryIoCompletion)( HANDLE handle, IO_COMPLETION_INFORMATION_CLASS class,
void *buffer, ULONG len, ULONG *ret_len );
NTSTATUS (WINAPI *NtQueryMutant)( HANDLE handle, MUTANT_INFORMATION_CLASS class,
@ -157,6 +165,8 @@ struct unix_funcs
NTSTATUS (WINAPI *NtResumeThread)( HANDLE handle, ULONG *count );
NTSTATUS (WINAPI *NtSetContextThread)( HANDLE handle, const CONTEXT *context );
NTSTATUS (WINAPI *NtSetEvent)( HANDLE handle, LONG *prev_state );
NTSTATUS (WINAPI *NtSetInformationJobObject)( HANDLE handle, JOBOBJECTINFOCLASS class,
void *info, ULONG len );
NTSTATUS (WINAPI *NtSetIoCompletion)( HANDLE handle, ULONG_PTR key, ULONG_PTR value,
NTSTATUS status, SIZE_T count );
NTSTATUS (WINAPI *NtSetLdtEntries)( ULONG sel1, LDT_ENTRY entry1, ULONG sel2, LDT_ENTRY entry2 );
@ -167,6 +177,7 @@ struct unix_funcs
NTSTATUS (WINAPI *NtSignalAndWaitForSingleObject)( HANDLE signal, HANDLE wait,
BOOLEAN alertable, const LARGE_INTEGER *timeout );
NTSTATUS (WINAPI *NtSuspendThread)( HANDLE handle, ULONG *count );
NTSTATUS (WINAPI *NtTerminateJobObject)( HANDLE handle, NTSTATUS status );
NTSTATUS (WINAPI *NtTerminateThread)( HANDLE handle, LONG exit_code );
NTSTATUS (WINAPI *NtUnlockVirtualMemory)( HANDLE process, PVOID *addr,
SIZE_T *size, ULONG unknown );