123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- #ifndef NULLSOFT_MLDISC_DRIVEMANAGER_HEADER
- #define NULLSOFT_MLDISC_DRIVEMANAGER_HEADER
- #if defined(_MSC_VER) && (_MSC_VER >= 1020)
- #pragma once
- #endif
- #include <windows.h>
- #define DRIVE_TYPE_UNKNOWN 0x00000000
- #define DRIVE_TYPE_CD 0x00000010
- #define DRIVE_TYPE_DVD 0x00000020
- #define DRIVE_CAP_UNKNOWN 0x80000000
- #define DRIVE_CAP_R 0x00010000
- #define DRIVE_CAP_RW 0x00020000
- #define DRIVE_CDR (DRIVE_TYPE_CD | DRIVE_CAP_R )
- #define DRIVE_CDRW (DRIVE_TYPE_CD | DRIVE_CAP_RW)
- #define DRIVE_DVDR (DRIVE_TYPE_DVD | DRIVE_CAP_R)
- #define DRIVE_DVDRW (DRIVE_TYPE_DVD | DRIVE_CAP_RW)
- #define DMW_DRIVEADDED 0x0001
- #define DMW_DRIVEREMOVED 0x0002
- #define DMW_DRIVECHANGED 0x0003
- #define DMW_MEDIUMARRIVED 0x0004
- #define DMW_MEDIUMREMOVED 0x0005
- #define DMW_OPCOMPLETED 0x0006
- #define DMW_MODECHANGED 0x0010
- typedef void* HDRVMNGR;
- typedef struct _DM_NOTIFY_PARAM DM_NOTIFY_PARAM;
- typedef void (CALLBACK *DMNPROC)(WORD, INT_PTR);
- typedef void (CALLBACK *DMFREEPROC)(DM_NOTIFY_PARAM *phdr);
- #define DM_EJECT_REMOVE 0
- #define DM_EJECT_LOAD 1
- #define DM_EJECT_CHANGE 2
- #define DMF_DESCRIPTION 0x00000001
- #define DMF_FIRMWARE 0x00000002
- #define DMF_READY 0x00000004
- #define DMF_TYPES 0x00000001
- #define DMF_DRIVEMODE_DAO 0x00000000
- #define DMF_DRIVEMODE_TAO 0x00010000
- #define DMF_MEDIUMTYPE 0x00000001
- #define DMF_MEDIUMFORMAT 0x00000002
- #define DMF_TRACKS 0x00000004
- #define DMF_USED 0x00000008
- #define DMF_FREE 0x00000010
- #define DMF_MEDIUM 0x00000001
- #define DMF_PROTECTEDDVD 0x00000002
- #define DMF_PACKETWRITTEN 0x00000004
- #define DMF_MEDIUMEX 0x00000008
- #define DMF_VOLUMELABEL 0x00000001
- #define DMF_CDTEXT 0x00000002
- #define DMF_CDDB 0x00000004
- #define DMF_DRIVEDESCRIPTION 0x00000010
- #define DMF_READY 0x00000004
- #define DMF_MEDIUMPRESENT 0x00000002
- #define DMF_MODE 0x00000001
- #define DMF_TRACKCOUNT 0x00000008
- #define DMF_TRACKSINFO 0x00000010
- #define DMF_MEDIUMUID 0x00000020
- #define DMF_MEDIUMUPC 0x00000040
- #define DMF_BASEPNPID 0x00000001
- #define DMF_DISPLAYNAMES 0x00000002
- #define DMF_PATH 0x00000004
- #define DMF_DRIVESTATE 0x00000008
- #define DMF_DRIVETYPE 0x00000010
- #define DMF_QUERYMEDIATYPE 0x00000020
- #define DMF_QUERYMEDIAINFO 0x00000040
- #define DMOP_GENERAL 0x0000
- #define DMOP_UNITINFO 0x0001
- #define DMOP_UNITINFO2 0x0002
- #define DMOP_DISCINFO 0x0003
- #define DMOP_DISCINFO2 0x0004
- #define DMOP_TITLE 0x0005
- #define DMOP_MCIINFO 0x0006
- #define DMOP_IMAPIINFO 0x0007
- #define DM_MODE_ERROR ((CHAR)(0 - 1))
- #define DM_MODE_READY 0x00
- #define DM_MODE_BURNING 0x01
- #define DM_MODE_RIPPING 0x02
- #define DM_MODE_COPYING 0x03
- typedef struct _DM_NOTIFY_PARAM
- {
- INT_PTR callback;
- UINT uMsg;
- CHAR cLetter;
- UINT fFlags;
- DWORD result;
- WORD opCode;
- DMFREEPROC fnFree;
- HANDLE hReserved;
- } DM_NOTIFY_PARAM;
- typedef struct _DM_UNITINFO_PARAM
- {
- DM_NOTIFY_PARAM header;
- DWORD dwType;
- BOOL bReady;
- LPSTR pszDesc;
- INT cchDesc;
- LPSTR pszFirmware;
- INT cchFirmware;
- } DM_UNITINFO_PARAM;
- typedef struct _DM_UNITINFO2_PARAM
- {
- DM_NOTIFY_PARAM header;
- DWORD *pdwTypes;
- INT nTypes;
- DWORD dwClassId;
- DWORD dwBusType;
- } DM_UNITINFO2_PARAM;
- typedef struct _DM_DISCINFOEX_PARAM
- {
- DM_NOTIFY_PARAM header;
- DWORD dwMediumType;
- DWORD dwMediumFormat;
- BOOL bErasable;
- DWORD dwTracks;
- DWORD dwUsed;
- DWORD dwFree;
- } DM_DISCINFOEX_PARAM;
- typedef struct _DM_DISCINFO2_PARAM
- {
- DM_NOTIFY_PARAM header;
- DWORD dwMedium;
- BOOL bProtectedDVD;
- BOOL bPacketWritten;
- DWORD dwMediumEx;
- } DM_DISCINFO2_PARAM;
- typedef struct _DM_TITLE_PARAM
- {
- DM_NOTIFY_PARAM header;
- LPWSTR pszTitle;
- INT cchTitle;
- } DM_TITLE_PARAM;
- typedef struct _DM_MCI_PARAM
- {
- DM_NOTIFY_PARAM header;
- BOOL bReady;
- BOOL bMediumPresent;
- UINT uMode;
- DWORD* pTracks;
- INT nTracks;
- LPWSTR pszMediumUID;
- INT cchMediumUID;
- LPWSTR pszMediumUPC;
- INT cchMediumUPC;
- } DM_MCI_PARAM;
- typedef struct _DM_IMAPI_PARAM
- {
- DM_NOTIFY_PARAM header;
- BOOL bRecorder;
- BSTR bstrBasePnPID;
- BSTR bstrVendorID;
- BSTR bstrProductID;
- BSTR bstrRevision;
- BSTR bstrPath;
- ULONG ulDriveState;
- LONG fDriveType;
- LONG fMediaType;
- LONG fMediaFlags;
- BYTE bSessions;
- BYTE bLastTrack;
- ULONG ulStartAddress;
- ULONG ulNextWritable;
- ULONG ulFreeBlocks;
- } DM_IMAPI_PARAM;
- BOOL DriveManager_Initialize(DMNPROC DMNProc, BOOL bSuspended);
- BOOL DriveManager_Uninitialize(INT msExitWaitTime);
- BOOL DriveManager_Suspend(void);
- BOOL DriveManager_Resume(BOOL bUpdate);
- INT DriveManager_GetDriveList(CHAR *pLetters, INT cchSize);
- BOOL DriveManager_Update(BOOL bAsync);
- BOOL DriveManager_SetDriveMode(CHAR cLetter, CHAR cMode);
- CHAR DriveManager_GetDriveMode(CHAR cLetter);
- DWORD DriveManager_GetDriveType(CHAR cLetter);
- BOOL DriveManager_Eject(CHAR cLetter, INT nCmd);
- BOOL DriveManager_IsUnitReady(BOOL *pbReady);
- BOOL DriveManager_IsMediumInserted(CHAR cLetter);
- BOOL DriveManager_GetUnitInfo(DM_UNITINFO_PARAM *puip);
- BOOL DriveManager_GetUnitInfo2(DM_UNITINFO2_PARAM *puip);
- BOOL DriveManager_GetDiscInfoEx(DM_DISCINFOEX_PARAM *pdip);
- BOOL DriveManager_GetDiscInfo2(DM_DISCINFO2_PARAM *pdip);
- BOOL DriveManager_QueryTitle(DM_TITLE_PARAM *pdtp);
- BOOL DriveManager_GetMCIInfo(DM_MCI_PARAM *pmcip);
- BOOL DriveManager_GetIMAPIInfo(DM_IMAPI_PARAM *pIMAPI);
- #endif
|