Doron's right, mostly you simply assume what you have is a device object. If
you want to be paranoid about it you can check the sanity values of Type and
Size in the first two fields of the device object. However ... those are
opaque and are changeable with no thought of impact to your code.
Besides, an invalid device object becomes rather apparent rather fast. They
do not simply go stale with disuse. If you are concerned about it
"disappearing " before you use it, as Doron states, when you acquire it you
should be incrementing/decremeting it's reference count if your method of
acquisition and detaching does not do so.
--
The personal opinion of
Gary G. Litte
"yang" <> wrote in message
news:9AF11DB2-16CB-43CA-806C-...
>I get the device object, the later, I want to check if it is valid. How can
>I
> do?
>
> Thanks!
>
> yang
> --
> Help
|