source: Daodan/MinGW/include/ddk/mcd.h@ 1163

Last change on this file since 1163 was 1046, checked in by alloc, 8 years ago

Daodan: Added Windows MinGW and build batch file

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