Floppy = CreateFile("\\\\.\\A:", GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL );
if( hFloppy != INVALID_HANDLE_VALUE )
{
bRes = DeviceIoControl( hFloppy, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &dummy, NULL );
if( !bRes )
{
CloseHandle( hFloppy );
hFloppy = INVALID_HANDLE_VALUE;
}
}