|
-
Jan 17th, 2025, 02:22 AM
#1
Thread Starter
Addicted Member
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?
-
Jan 17th, 2025, 05:26 AM
#2
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.
-
Jan 17th, 2025, 06:00 AM
#3
Thread Starter
Addicted Member
Re: Detect when a USB Token with digital signature is insert or remove
 Originally Posted by fafalone
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
-
Jan 17th, 2025, 11:04 AM
#4
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}
-
Jan 17th, 2025, 12:04 PM
#5
Thread Starter
Addicted Member
Re: Detect when a USB Token with digital signature is insert or remove
 Originally Posted by fafalone
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
-
Jan 26th, 2025, 06:32 AM
#6
Thread Starter
Addicted Member
Re: Detect when a USB Token with digital signature is insert or remove
 Originally Posted by fafalone
...device with the class guid {990A2BD7-E738-46C7-B26F-1CF8FB9F1391}
my guid seems to be {50dd5230-ba8a-11d1-bf5d-0000f805f530}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|