contentbotB to NostalgiaEnglish · 2 months agoAnyone remember the /cupholder scripts in the 90’s for your PC?i.redd.itimagemessage-square3fedilinkarrow-up173arrow-down10file-text
arrow-up173arrow-down1imageAnyone remember the /cupholder scripts in the 90’s for your PC?i.redd.itcontentbotB to NostalgiaEnglish · 2 months agomessage-square3fedilinkfile-text
minus-squareSzethFriendOfNimi@lemmy.worldlinkfedilinkEnglisharrow-up8·edit-22 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