This day was a cool course for me in terms of pens, safety pens, PInvoke and many other things. I think it is slowly sinking, however I am still struggling with a few concepts:
How do I know which SafeHandle implementation I should use with different types of descriptors?
In particular, which implementation of SafeHandle should be used with process handlers (for example, in the PROCESS_INFORMATION structure returned from the CreateProcess call?
The only two public implementations I see are SafeFileHandle and SafeWaitHandle - none of them work in this case.
What should i use?
source share