Results 1 to 6 of 6

Thread: Detect when a USB Token with digital signature is insert or remove

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Location
    Craiova, Romania
    Posts
    140

    Detect when a USB Token with digital signature is insert or remove

    Can i detect when a USB Token with digital signature is insert or remove in a USB plug?

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,667

    Re: Detect when a USB Token with digital signature is insert or remove

    What does it show up as?

    If it's just a storage drive you can check the file list on, that's easiest.

    But if it's some special hardware device that doesn't show up as a drive letter you'd need to use RegisterDeviceNotification/WM_DEVICECHANGE to detect DBT_DEVICEARRIVAL notifications for the devinterface class GUID giving you the specific device type like smart cards, security devices, sensors, etc.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Location
    Craiova, Romania
    Posts
    140

    Re: Detect when a USB Token with digital signature is insert or remove

    Quote Originally Posted by fafalone View Post
    But if it's some special hardware device that doesn't show up as a drive letter you'd need to use RegisterDeviceNotification/WM_DEVICECHANGE to detect DBT_DEVICEARRIVAL notifications for the devinterface class GUID giving you the specific device type like smart cards, security devices, sensors, etc.
    Thank you
    it's a SmartCard and i want to detect only if it's insert or when insert/remove

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,667

    Re: Detect when a USB Token with digital signature is insert or remove

    If, when connected, it's in the Device Manager under the "Smart cards" category, then you'd use RegisterDeviceNotification with DBT_DEVTYP_DEVICEINTERFACE and DEVICE_NOTIFY_ALL_INTERFACE_CLASSES, then WM_DEVICECHANGE to detect DBT_DEVICEARRIVAL/DBT_DEVICEREMOVECOMPLETE and be looking for a device with the class guid {990A2BD7-E738-46C7-B26F-1CF8FB9F1391}

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Location
    Craiova, Romania
    Posts
    140

    Re: Detect when a USB Token with digital signature is insert or remove

    Quote Originally Posted by fafalone View Post
    If, when connected, it's in the Device Manager under the "Smart cards" category, then you'd use RegisterDeviceNotification with DBT_DEVTYP_DEVICEINTERFACE and DEVICE_NOTIFY_ALL_INTERFACE_CLASSES, then WM_DEVICECHANGE to detect DBT_DEVICEARRIVAL/DBT_DEVICEREMOVECOMPLETE and be looking for a device with the class guid {990A2BD7-E738-46C7-B26F-1CF8FB9F1391}
    Thank you

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Location
    Craiova, Romania
    Posts
    140

    Re: Detect when a USB Token with digital signature is insert or remove

    Quote Originally Posted by fafalone View Post
    ...device with the class guid {990A2BD7-E738-46C7-B26F-1CF8FB9F1391}
    my guid seems to be {50dd5230-ba8a-11d1-bf5d-0000f805f530}
    Name:  2025-01-26_132820.jpg
Views: 244
Size:  30.2 KB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width