winapivb6lockingdrives

Locking removable drive?


Friends, How to lock/unlock(software based) removable disk/drives in VB6? I need to know any specific win32 routines are there for this purpose?


Solution

  • Not having used this, I would say that you want to look at the win32 IOCTL_STORAGE_MEDIA_REMOVAL Control Code parameter to DeviceIoControl() which "..Enables or disables the mechanism that ejects media, for those devices possessing that locking capability..."