WMI instrinsic events. Resources

Posted by Nickolodeon on Stack Overflow See other posts from Stack Overflow or by Nickolodeon
Published on 2010-12-21T12:46:34Z Indexed on 2010/12/21 15:54 UTC
Read the original article Hit count: 143

Filed under:
|

Hi. I subscribe to usb inserted event like this

select * FROM __INSTANCECREATIONEVENT WITHIN 3 WHERE TARGETINSTANCE ISA Win32_DiskDrive

After inserting usb flash it blinks every 3 seconds. This is polling interval and intrinsic events work by polling object that's in query. Now, we know these types of events may be resource expensive. (Putting value greater then 3 sometimes chokes these events and client program doesn't get notified).

Are there other ways to do that, so that usb doesn't get scanned all the time? May be there some extrinsic events available?

Right now the only solution I see is to unsubscribe from event above once it trigerred and resubscribe to it in __INSTANCEDELETIONEVENT handler. Hm, althought deletionevent will also poll diskdrive controllers(

© Stack Overflow or respective owner

Related posts about c#

Related posts about wmi