- /* Create the handle to VWIN32 */
- h_drive = CreateFile ("\\\\.\\vwin32", 0, 0, NULL, 0,
- FILE_FLAG_DELETE_ON_CLOSE, NULL ) ;
-
- /* Convert logical disk name to DOS-like disk name */
- by_drive = (toupper (*psz_device) - 'A') + 1;
-
- /* Let's eject now : Int 21H function 440DH minor code 49h*/
- regs.reg_EAX = 0x440D ;
- regs.reg_EBX = by_drive ;
- regs.reg_ECX = MAKEWORD(0x49 , 0x08) ; // minor code
-
- i_ret = DeviceIoControl (h_drive, VWIN32_DIOC_DOS_IOCTL,
- ®s, sizeof(regs), ®s, sizeof(regs),
- &dw_result, 0) ;
-
- CloseHandle (h_drive) ;
- return (i_ret) ;
+ st.dwItem = MCI_STATUS_READY;
+ /* Eject disc */
+ i_ret = mciSendCommand( op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0 );
+ /* Release access to the device */
+ mciSendCommand( op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0 );