网站首页  词典首页

请输入您要查询的函数:

 

术语 setprocessaffinitymask
释义 SetProcessAffinityMask
语法:
C++
BOOL WINAPI SetProcessAffinityMask(
__in HANDLE hProcess,
__in DWORD_PTR dwProcessAffinityMask
);
SetProcessAffinityMask功能
设置一个指定进程的线程处理器关联掩码。
参数
hProcess [in]
句柄的过程,其关联掩码被设置。这种处理必须有PROCESS_SET_INFORMATION访问权限。有关更多信息,请参见过程的安全性和访问权限。
dwProcessAffinityMask [in]
对于这一进程的线程关联掩码。
在一个拥有6400多处理器,相似性掩码必须指定一组单处理器处理器的系统。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
如果进程关联掩码请求处理器,未在系统中配置,最后一个错误代码是ERROR_INVALID_PARAMETER。
在一个拥有6400多处理器系统中,如果调用进程包含多个处理器组,最后一个错误代码是ERROR_INVALID_PARAMETER线程。
备注
一个进程关联掩码是位向量中的每一位代表一个逻辑处理器上的进程的线程被允许运行。该进程的关联掩码值必须是一个系统的关联掩码的子集值函数的GetProcessAffinityMask获得。一个进程只允许配置的处理器到系统中运行。因此,该进程关联掩码不能指定处理器在系统相似性掩码指定该位处理器0 1 1位。
进程关联继承任何子进程或新实例化的本地进程。
不要打电话在一个过程可能不是您自己调用的DLL SetProcessAffinityMask。
在一个拥有6400多处理器,SetProcessAffinityMask功能系统可以用来设置只在一组单处理器线程进程的进程关联掩码。使用SetThreadAffinityMask函数来设置多个团体在单个线程关联掩码。这有效地改变了进程组的任务。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateProcess的
GetProcessAffinityMask
多处理器
进程和线程函数
过程
处理器组
SetThreadAffinityMask
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SetProcessAffinityMask Function
Sets a processor affinity mask for the threads of the specified process.
Syntax
C++
BOOL WINAPI SetProcessAffinityMask(
__in HANDLE hProcess,
__in DWORD_PTR dwProcessAffinityMask
);
Parameters
hProcess [in]
A handle to the process whose affinity mask is to be set. This handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Security and Access Rights .
dwProcessAffinityMask [in]
The affinity mask for the threads of the process.
On a system with more than 64 processors, the affinity mask must specify processors in a single processor group .
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
If the process affinity mask requests a processor that is not configured in the system, the last error code is ERROR_INVALID_PARAMETER.
On a system with more than 64 processors, if the calling process contains threads in more than one processor group, the last error code is ERROR_INVALID_PARAMETER.
Remarks
A process affinity mask is a bit vector in which each bit represents a logical processor on which the threads of the process are allowed to run. The value of the process affinity mask must be a subset of the system affinity mask values obtained by the GetProcessAffinityMask function. A process is only allowed to run on the processors configured into a system. Therefore, the process affinity mask cannot specify a 1 bit for a processor when the system affinity mask specifies a 0 bit for that processor.
Process affinity is inherited by any child process or newly instantiated local process.
Do not call SetProcessAffinityMask in a DLL that may be called by processes other than your own.
On a system with more than 64 processors, the SetProcessAffinityMask function can be used to set the process affinity mask only for processes with threads in a single processor group. Use the SetThreadAffinityMask function to set the affinity mask for individual threads in multiple groups. This effectively changes the group assignment of the process.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateProcess
GetProcessAffinityMask
Multiple Processors
Process and Thread Functions
Processes
Processor Groups
SetThreadAffinityMask
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686223(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:15:49