Closed mckunda closed 4 years ago
@AArnott if you have any ideas on how to test these, please let me know
Regarding how to test this (which seems like a good idea), you could create a ManualResetEvent
in the unit test and then obtain its Handle
property, and call the 2 new methods on that handle, just to see if no exception is thrown.
Thanks for the feedback! Hope I understood you correctly. Also, I'd like to point out two things:
GetHandleInformation
we may get a result that's not defined in HandleFlags
, e.g. 0x00000003
, which is HANDLE_FLAG_INHERIT | HANDLE_FLAG_PROTECT_FROM_CLOSE
? Honestly, I don't quite understand that.You can check for store-banned status from the Microsoft API docs for the method:
So that's a good point: we need to move these methods to the storebanned folder so they don't cause store app rejection.
Is it okay that from GetHandleInformation we may get a result that's not defined in HandleFlags
Yes: that's the nature of [Flags]
enums. Folks would test for individual flags.
Thanks for the help! Hope now it's all OK.
kernel32!SetHandleInformation
andkernel32!GetHandleInformation