DuplicateHandle(), use in first or second process?

前端 未结 4 662
挽巷
挽巷 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:19

    Use a named pipe or mailslots for IPC, this should work reliably for your purpose. If you need to wait, use named wait handles.

    Otherwise, I'd choose to do DuplicateHandle in the second process in order to set the handle ownership correctly.

提交回复
热议问题