1*c2c66affSColin Finck /* 2*c2c66affSColin Finck * mcd.h 3*c2c66affSColin Finck * 4*c2c66affSColin Finck * Media changer driver interface 5*c2c66affSColin Finck * 6*c2c66affSColin Finck * This file is part of the w32api package. 7*c2c66affSColin Finck * 8*c2c66affSColin Finck * Contributors: 9*c2c66affSColin Finck * Created by Casper S. Hornstrup <chorns@users.sourceforge.net> 10*c2c66affSColin Finck * 11*c2c66affSColin Finck * THIS SOFTWARE IS NOT COPYRIGHTED 12*c2c66affSColin Finck * 13*c2c66affSColin Finck * This source code is offered for use in the public domain. You may 14*c2c66affSColin Finck * use, modify or distribute it freely. 15*c2c66affSColin Finck * 16*c2c66affSColin Finck * This code is distributed in the hope that it will be useful but 17*c2c66affSColin Finck * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 18*c2c66affSColin Finck * DISCLAIMED. This includes but is not limited to warranties of 19*c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20*c2c66affSColin Finck * 21*c2c66affSColin Finck */ 22*c2c66affSColin Finck 23*c2c66affSColin Finck #ifndef __MCD_H 24*c2c66affSColin Finck #define __MCD_H 25*c2c66affSColin Finck 26*c2c66affSColin Finck #include "srb.h" 27*c2c66affSColin Finck #include "scsi.h" 28*c2c66affSColin Finck #include "ntddchgr.h" 29*c2c66affSColin Finck 30*c2c66affSColin Finck #ifdef __cplusplus 31*c2c66affSColin Finck extern "C" { 32*c2c66affSColin Finck #endif 33*c2c66affSColin Finck 34*c2c66affSColin Finck #if defined(_MCD_) 35*c2c66affSColin Finck #define CHANGERAPI 36*c2c66affSColin Finck #else 37*c2c66affSColin Finck #define CHANGERAPI DECLSPEC_IMPORT 38*c2c66affSColin Finck #endif 39*c2c66affSColin Finck 40*c2c66affSColin Finck #ifdef DebugPrint 41*c2c66affSColin Finck #undef DebugPrint 42*c2c66affSColin Finck #endif 43*c2c66affSColin Finck 44*c2c66affSColin Finck #if DBG 45*c2c66affSColin Finck #define DebugPrint(x) ChangerClassDebugPrint x 46*c2c66affSColin Finck #else 47*c2c66affSColin Finck #define DebugPrint(x) 48*c2c66affSColin Finck #endif 49*c2c66affSColin Finck 50*c2c66affSColin Finck #define MAXIMUM_CHANGER_INQUIRY_DATA 252 51*c2c66affSColin Finck 52*c2c66affSColin Finck CHANGERAPI 53*c2c66affSColin Finck PVOID 54*c2c66affSColin Finck NTAPI 55*c2c66affSColin Finck ChangerClassAllocatePool( 56*c2c66affSColin Finck IN POOL_TYPE PoolType, 57*c2c66affSColin Finck IN ULONG NumberOfBytes); 58*c2c66affSColin Finck 59*c2c66affSColin Finck VOID 60*c2c66affSColin Finck ChangerClassDebugPrint( 61*c2c66affSColin Finck ULONG DebugPrintLevel, 62*c2c66affSColin Finck PCCHAR DebugMessage, 63*c2c66affSColin Finck ...); 64*c2c66affSColin Finck 65*c2c66affSColin Finck CHANGERAPI 66*c2c66affSColin Finck PVOID 67*c2c66affSColin Finck NTAPI 68*c2c66affSColin Finck ChangerClassFreePool( 69*c2c66affSColin Finck IN PVOID PoolToFree); 70*c2c66affSColin Finck 71*c2c66affSColin Finck CHANGERAPI 72*c2c66affSColin Finck NTSTATUS 73*c2c66affSColin Finck NTAPI 74*c2c66affSColin Finck ChangerClassSendSrbSynchronous( 75*c2c66affSColin Finck IN PDEVICE_OBJECT DeviceObject, 76*c2c66affSColin Finck IN PSCSI_REQUEST_BLOCK Srb, 77*c2c66affSColin Finck IN PVOID Buffer, 78*c2c66affSColin Finck IN ULONG BufferSize, 79*c2c66affSColin Finck IN BOOLEAN WriteToDevice); 80*c2c66affSColin Finck 81*c2c66affSColin Finck 82*c2c66affSColin Finck typedef NTSTATUS NTAPI 83*c2c66affSColin Finck (*CHANGER_INITIALIZE)( 84*c2c66affSColin Finck IN PDEVICE_OBJECT DeviceObject); 85*c2c66affSColin Finck 86*c2c66affSColin Finck typedef ULONG NTAPI 87*c2c66affSColin Finck (*CHANGER_EXTENSION_SIZE)( 88*c2c66affSColin Finck VOID); 89*c2c66affSColin Finck 90*c2c66affSColin Finck typedef VOID NTAPI 91*c2c66affSColin Finck (*CHANGER_ERROR_ROUTINE)( 92*c2c66affSColin Finck PDEVICE_OBJECT DeviceObject, 93*c2c66affSColin Finck PSCSI_REQUEST_BLOCK Srb, 94*c2c66affSColin Finck NTSTATUS *Status, 95*c2c66affSColin Finck BOOLEAN *Retry); 96*c2c66affSColin Finck 97*c2c66affSColin Finck typedef NTSTATUS NTAPI 98*c2c66affSColin Finck (*CHANGER_COMMAND_ROUTINE)( 99*c2c66affSColin Finck IN PDEVICE_OBJECT DeviceObject, 100*c2c66affSColin Finck IN PIRP Irp); 101*c2c66affSColin Finck 102*c2c66affSColin Finck typedef NTSTATUS NTAPI 103*c2c66affSColin Finck (*CHANGER_PERFORM_DIAGNOSTICS)( 104*c2c66affSColin Finck IN PDEVICE_OBJECT DeviceObject, 105*c2c66affSColin Finck OUT PWMI_CHANGER_PROBLEM_DEVICE_ERROR ChangerDeviceError); 106*c2c66affSColin Finck 107*c2c66affSColin Finck typedef struct _MCD_INIT_DATA { 108*c2c66affSColin Finck ULONG InitDataSize; 109*c2c66affSColin Finck CHANGER_EXTENSION_SIZE ChangerAdditionalExtensionSize; 110*c2c66affSColin Finck CHANGER_INITIALIZE ChangerInitialize; 111*c2c66affSColin Finck CHANGER_ERROR_ROUTINE ChangerError; 112*c2c66affSColin Finck CHANGER_PERFORM_DIAGNOSTICS ChangerPerformDiagnostics; 113*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerGetParameters; 114*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerGetStatus; 115*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerGetProductData; 116*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerSetAccess; 117*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerGetElementStatus; 118*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerInitializeElementStatus; 119*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerSetPosition; 120*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerExchangeMedium; 121*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerMoveMedium; 122*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerReinitializeUnit; 123*c2c66affSColin Finck CHANGER_COMMAND_ROUTINE ChangerQueryVolumeTags; 124*c2c66affSColin Finck } MCD_INIT_DATA, *PMCD_INIT_DATA; 125*c2c66affSColin Finck 126*c2c66affSColin Finck CHANGERAPI 127*c2c66affSColin Finck NTSTATUS 128*c2c66affSColin Finck NTAPI 129*c2c66affSColin Finck ChangerClassInitialize( 130*c2c66affSColin Finck IN PDRIVER_OBJECT DriverObject, 131*c2c66affSColin Finck IN PUNICODE_STRING RegistryPath, 132*c2c66affSColin Finck IN PMCD_INIT_DATA MCDInitData); 133*c2c66affSColin Finck 134*c2c66affSColin Finck #ifdef __cplusplus 135*c2c66affSColin Finck } 136*c2c66affSColin Finck #endif 137*c2c66affSColin Finck 138*c2c66affSColin Finck #endif /* __MCD_H */ 139