PICyourBrain
PICyourBrain

Reputation: 10284

Does a SafeFileHandle change between Open Close and Reopen?

I am using a SafeFileHandle to talk to USB devices. If I close a Handle and then reopen a handle to the same device (assuming is has not been removed and reattached/enumerated) will the first and second handles necessarily be exactly the same? Or is a handle like an instance thing that can be different every time it's opened?

Upvotes: 1

Views: 800

Answers (1)

Rob
Rob

Reputation: 45771

I've just run a quick experiment, using a SafeHandle to a file (based on the sample code in the MSDN SafeFileHandle class documentation) and it would appear that the handle does indeed change when closed and then opened again.

Upvotes: 2

Related Questions