网站首页  词典首页

请输入您要查询的函数:

 

术语 openprocess
释义 OpenProcess
语法:
C++
HANDLE WINAPI OpenProcess(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);
OpenProcess函数
打开一个现有的本地处理对象。
参数
dwDesiredAccess [in]
对这一进程对象访问。这探视权,对检查的过程中的安全描述符。此参数可以是一个或更多的进程访问的权利。
如果调用方已使SeDebugPrivilege特权,请求授予访问权限,不论安全描述符的内容。
bInheritHandle [in]
如果该值为TRUE,进程创建的这一进程将继承处理。否则,该进程不会继承此处理。
dwProcessId [in]
当地的进程标识符被打开。
如果指定的进程是系统进程(00000000),该功能失败,最后错误代码是ERROR_INVALID_PARAMETER。如果指定的进程是空闲进程或CSRSS中的一个过程,这个函数失败,最后错误代码是ERROR_ACCESS_DENIED,因为他们的访问限制阻止他们打开用户级代码。
返回值
如果函数成功,返回值是一个开放的句柄指定的进程。
如果函数失败,返回值为NULL。为了获得更多错误信息,调用GetLastError。
备注
要打开句柄到另一个地方的过程,并获得完全访问权,您必须启用SeDebugPrivilege特权。有关更多信息,请参阅更改权限的令牌。
在处理返回的OpenProcess函数可以在任何函数,需要处理的进程,如等待函数,使用,提供相应的访问权限的要求。
当您完成与处理,一定要关闭它使用CloseHandle函数。
实例
有关示例,请参阅以快照和浏览过程。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
AssignProcessToJobObject
CloseHandle
CreateProcess的
CreateRemoteThread的
DuplicateHandle
GetCurrentProcess
GetCurrentProcessId
GetExitCodeProcess
GetModuleFileNameEx
GetPriorityClass
进程和线程函数
过程
ReadProcessMemory的
SetPriorityClass
SetProcessWorkingSetSize
TerminateProcess
VirtualProtectEx
WriteProcessMemory的
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==OpenProcess Function
Opens an existing local process object.
Syntax
C++
HANDLE WINAPI OpenProcess(
__in DWORD dwDesiredAccess,
__in BOOL bInheritHandle,
__in DWORD dwProcessId
);
Parameters
dwDesiredAccess [in]
The access to the process object. This access right is checked against the security descriptor for the process. This parameter can be one or more of the process access rights .
If the caller has enabled the SeDebugPrivilege privilege, the requested access is granted regardless of the contents of the security descriptor.
bInheritHandle [in]
If this value is TRUE, processes created by this process will inherit the handle. Otherwise, the processes do not inherit this handle.
dwProcessId [in]
The identifier of the local process to be opened.
If the specified process is the System Process (0x00000000), the function fails and the last error code is ERROR_INVALID_PARAMETER. If the specified process is the Idle process or one of the CSRSS processes, this function fails and the last error code is ERROR_ACCESS_DENIED because their access restrictions prevent user-level code from opening them.
Return Value
If the function succeeds, the return value is an open handle to the specified process.
If the function fails, the return value is NULL. To get extended error information, call GetLastError .
Remarks
To open a handle to another local process and obtain full access rights, you must enable the SeDebugPrivilege privilege. For more information, see Changing Privileges in a Token .
The handle returned by the OpenProcess function can be used in any function that requires a handle to a process, such as the wait functions , provided the appropriate access rights were requested.
When you are finished with the handle, be sure to close it using the CloseHandle function.
Examples
For an example, see Taking a Snapshot and Viewing Processes .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
AssignProcessToJobObject
CloseHandle
CreateProcess
CreateRemoteThread
DuplicateHandle
GetCurrentProcess
GetCurrentProcessId
GetExitCodeProcess
GetModuleFileNameEx
GetPriorityClass
Process and Thread Functions
Processes
ReadProcessMemory
SetPriorityClass
SetProcessWorkingSetSize
TerminateProcess
VirtualProtectEx
WriteProcessMemory
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684320(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:23:56