Close cdrom image file on eject (#145)
The WIN32 configuration for the cdrom was not closing the image file on eject. This left the handle open while Bochs was running, not allowing the image file to be modified.
This commit is contained in:
parent
5f6e855350
commit
eae6bf9396
@ -19,6 +19,7 @@ Brief summary :
|
|||||||
- USB: Added OHCI as an EHCI Companion option. Now allows UHCI or OHCI specified as a configuration parameter.
|
- USB: Added OHCI as an EHCI Companion option. Now allows UHCI or OHCI specified as a configuration parameter.
|
||||||
- Disk images: Allows large VHD image files
|
- Disk images: Allows large VHD image files
|
||||||
- Enhanced the Floppy Disk emulation
|
- Enhanced the Floppy Disk emulation
|
||||||
|
- Bug fix which now closes the cdrom image file when using win32 configuration
|
||||||
- Documentation updates and fixes
|
- Documentation updates and fixes
|
||||||
|
|
||||||
Detailed change log :
|
Detailed change log :
|
||||||
|
@ -147,6 +147,7 @@ cdrom_win32_c::~cdrom_win32_c(void)
|
|||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
if (hFile != INVALID_HANDLE_VALUE)
|
if (hFile != INVALID_HANDLE_VALUE)
|
||||||
CloseHandle(hFile);
|
CloseHandle(hFile);
|
||||||
|
fd = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +211,11 @@ void cdrom_win32_c::eject_cdrom()
|
|||||||
DWORD lpBytesReturned;
|
DWORD lpBytesReturned;
|
||||||
DeviceIoControl(hFile, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &lpBytesReturned, NULL);
|
DeviceIoControl(hFile, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0, &lpBytesReturned, NULL);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (hFile != INVALID_HANDLE_VALUE) {
|
||||||
|
CloseHandle(hFile);
|
||||||
|
hFile = INVALID_HANDLE_VALUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user