- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在我的 manager.exe 中,我试图更改由我的 service.exe 启动的 worker.exe 的 CPU 使用率。 Service.exe 在系统帐户下运行,而 manager.exe 在登录用户帐户下运行。
当我使用 worker.exe 的 PID 在 manager.exe 中调用 OpenProcess 时,procHandle 为 NULL:
HANDLE procHandle = OpenProcess(PROCESS_SET_INFORMATION, 0, pid);
使用 GetLastError() 我发现我收到了拒绝访问错误。
有什么解决办法吗?我能否以某种方式修改 worker.exe 以授予其他进程对其自身的完全控制权?
最佳答案
您不必调用 OpenProcess
。
该服务在调用 CreateProcessAsUser
或 CreateProcessWithLogonW
时应该已经拥有对 worker 的完全权限句柄。使用 DuplicateHandle
制作一个适合管理器进程使用的句柄版本,然后让服务将该句柄发送给管理器。服务已经有了管理器的句柄,对吧? DuplicateHandle
需要它。
或者让经理要求服务更改工作进程。
关于c++ - 我的服务启动的进程上的 OpenProcess/SetProcessAffinityMask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2298305/
如何使用 SetProcessAffinityMask 选择多个逻辑处理器? 在 Windows 任务管理器中,您可以执行此操作作为示例: 我更新了我的CreateProcess执行此操作的程序: t
我想将进程设置为使用所有处理器。我试过了 SetProcessAffinityMask(GetCurrentProcess(), 0); 但它并未设置到所有处理器。 最佳答案 如果您阅读 SetPro
在我的 manager.exe 中,我试图更改由我的 service.exe 启动的 worker.exe 的 CPU 使用率。 Service.exe 在系统帐户下运行,而 manager.exe
我需要将各种 c/c++ 进程固定到机器上的特定内核,以便仅在 Windows 7 64 位上进行基准测试。我的机器有 16 个内核 (2x8)。我试图通过从给定进程的代码中调用 SetProcess
SetProcessAffinityMask WinAPI 函数有 dwProcessAffinityMask 参数,其中每一位对应于系统中的单个逻辑处理器。 GetLogicalProcessorI
SetProcessAffinityMask() function接受 DWORD 掩码,因此它不能在超过 32 个处理器的系统上正确使用。 看起来像SetThreadGroupAffinity()旨
我有一个工作站,其操作系统是 64 位 Windows Server 2012 R2。我使用的是 Delphi XE7 Update 1。工作站有 72 个核心,包括超线程。我希望所有应用程序都在每次
我是一名优秀的程序员,十分优秀!