且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在另一个过程中关闭互斥锁的句柄

更新时间:2023-11-13 22:14:52

DuplicateHandle的第二个参数期望在源进程的上下文中有效的开放对象句柄" 我相信您要传递的句柄仅在当前进程中有效(OpenMutex为现有的互斥对象创建一个新的句柄).您可能需要确定互斥对象的句柄在远程进程中是什么,并在调用DuplicateHandle时使用该值.

The second argument to DuplicateHandle expects "an open object handle that is valid in the context of the source process", however I believe the handle you're passing in would only be valid within the current process (OpenMutex creates a new handle to an existing mutex object). You'll likely need to determine what the mutex's handle is in the remote process, and use that value when calling DuplicateHandle.