contentbotB to [email protected]English • 8 months agoAnyone remember the /cupholder scripts in the 90’s for your PC?i.redd.itimagemessage-square3fedilinkarrow-up172arrow-down10file-text
arrow-up172arrow-down1imageAnyone remember the /cupholder scripts in the 90’s for your PC?i.redd.itcontentbotB to [email protected]English • 8 months agomessage-square3fedilinkfile-text
minus-square@SzethFriendOfNimilinkEnglish8•edit-28 months agohttps://stackoverflow.com/questions/58670/windows-cdrom-eject C function bool ejectDisk(TCHAR driveLetter) { TCHAR tmp[10]; _stprintf(tmp, _T("\\\\.\\%c:"), driveLetter); HANDLE handle = CreateFile(tmp, GENERIC_READ, FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); DWORD bytes = 0; DeviceIoControl(handle, FSCTL_LOCK_VOLUME, 0, 0, 0, 0, &bytes, 0); DeviceIoControl(handle, FSCTL_DISMOUNT_VOLUME, 0, 0, 0, 0, &bytes, 0); DeviceIoControl(handle, IOCTL_STORAGE_EJECT_MEDIA, 0, 0, 0, 0, &bytes, 0); CloseHandle(handle); return true; }
https://stackoverflow.com/questions/58670/windows-cdrom-eject
C function