DuplicateHandle(), use in first or second process?

前端 未结 4 661
挽巷
挽巷 2021-01-13 04:01

The Windows API DuplicateHandle() http://msdn.microsoft.com/en-us/library/ms724251(VS.85).aspx Requires the Object handle to be duplicated and a handle to both the original

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-13 04:24

    Process Handle is different from process id. OpenProcess takes process id. Use something like...

    HANDLE hProcess = OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId());

提交回复
热议问题