悠长假期
驱动牛犊
驱动牛犊
  • 注册日期2006-11-29
  • 最后登录2008-04-23
  • 粉丝0
  • 关注0
  • 积分240分
  • 威望25点
  • 贡献值0点
  • 好评度24点
  • 原创分0分
  • 专家分0分
阅读:3863回复:1

关于 PsCreateSystemThread

楼主#
更多 发布于:2007-07-12 13:20
PsCreateSystemThread  的功能是不是启动一个线程?
参数是什么呢?
zhangleierli
驱动小牛
驱动小牛
  • 注册日期2007-01-31
  • 最后登录2017-05-24
  • 粉丝1
  • 关注0
  • 积分3分
  • 威望158点
  • 贡献值0点
  • 好评度146点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2007-07-13 13:05
启动一个系统线程.

NTSTATUS
  PsCreateSystemThread(
    OUT PHANDLE  ThreadHandle,
    IN ULONG  DesiredAccess,
    IN POBJECT_ATTRIBUTES  ObjectAttributes  OPTIONAL,
    IN HANDLE  ProcessHandle  OPTIONAL,
    OUT PCLIENT_ID  ClientId  OPTIONAL,
    IN PKSTART_ROUTINE  StartRoutine,
    IN PVOID  StartContext
    );

Parameters
ThreadHandle
Points to a variable that will receive the handle. The driver must close the handle with ZwClose once the handle is no longer in use.
DesiredAccess
Specifies the ACCESS_MASK value that represents the requested types of access to the created thread. This value can be THREAD_ALL_ACCESS or (ACCESS_MASK) 0L for a driver-created thread.
ObjectAttributes
Points to a structure that specifies the object’s attributes. OBJ_PERMANENT, OBJ_EXCLUSIVE, and OBJ_OPENIF are not valid attributes for a thread object. On Windows XP and later operating systems, if the caller is not running in the system process context, it must set the OBJ_KERNEL_HANDLE attribute for ObjectAttributes. Drivers for Windows 2000 and Windows 98/Me must only call PsCreateSystemThread from the system process context.
ProcessHandle
Specifies an open handle for the process in whose address space the thread is to be run. The caller’s thread must have PROCESS_CREATE_THREAD access to this process. If this parameter is not supplied, the thread will be created in the initial system process. This value should be NULL for a driver-created thread. Use the NtCurrentProcess macro to specify the current process.
ClientId
Points to a structure that receives the client identifier of the new thread. This value should be NULL for a driver-created thread.
StartRoutine
Is the entry point for a driver thread.
StartContext
Supplies a single argument passed to the thread when it begins execution.
Return Value
PsCreateSystemThread returns STATUS_SUCCESS if the thread was created.
游客

返回顶部