71{
73 ULONG OutputLength =
Stack->Parameters.DeviceIoControl.OutputBufferLength;
79
80 TRACE_(FLOPPY,
"DeviceIoctl called\n");
82 Irp->IoStatus.Information = 0;
83
84
85
86
88 {
90 INFO_(FLOPPY,
"IOCTL_DISK_GET_MEDIA_TYPES Called\n");
91
93 {
94 INFO_(FLOPPY,
"IOCTL_DISK_GET_MEDIA_TYPES: insufficient buffer; returning STATUS_INVALID_PARAMETER\n");
97 return;
98 }
99
100
101
102
108
111 INFO_(FLOPPY,
"Ioctl: completing with STATUS_SUCCESS\n");
113
114 return;
115 }
116
117
118
119
120
121
122
123
124
125
127 {
128 INFO_(FLOPPY,
"DeviceIoctl(): completing with STATUS_VERIFY_REQUIRED\n");
130 Irp->IoStatus.Information = 0;
132 return;
133 }
134
135
136
137
139
140
141
142
144 {
145 WARN_(FLOPPY,
"DeviceIoctl(): unable to sense disk change; completing with STATUS_UNSUCCESSFUL\n");
147 Irp->IoStatus.Information = 0;
150 return;
151 }
152
153 if(DiskChanged)
154 {
155 INFO_(FLOPPY,
"DeviceIoctl(): detected disk changed; signalling media change and completing\n");
156
157
160
163 return;
164 }
165
167 {
169 {
171
172 INFO_(FLOPPY,
"IOCTL_DISK_IS_WRITABLE Called\n");
173
174
175 Irp->IoStatus.Information = 0;
176
178 {
179 WARN_(FLOPPY,
"IoctlDiskIsWritable(): unable to sense drive status\n");
181 break;
182 }
183
184
186 {
187 WARN_(FLOPPY,
"IoctlDiskIsWritable(): unable to read drive status result\n");
189 break;
190 }
191
192
194 {
195 INFO_(FLOPPY,
"IOCTL_DISK_IS_WRITABLE: disk is write protected\n");
197 }
198 else
200 }
201 break;
202
204 INFO_(FLOPPY,
"IOCTL_DISK_CHECK_VERIFY called\n");
205 if (OutputLength != 0)
206 {
207 if (OutputLength <
sizeof(
ULONG))
208 {
210 Irp->IoStatus.Information = 0;
211 }
212 else
213 {
216 Irp->IoStatus.Information =
sizeof(
ULONG);
217 }
218 }
219 else
220 {
222 Irp->IoStatus.Information = 0;
223 }
224 break;
225
227 {
228 INFO_(FLOPPY,
"IOCTL_DISK_GET_DRIVE_GEOMETRY Called\n");
230 {
232 break;
233 }
234
235
238 break;
239 }
240
243 ERR_(FLOPPY,
"Format called; not supported yet\n");
245 Irp->IoStatus.Information = 0;
246 break;
247
249 INFO_(FLOPPY,
"IOCTL_DISK_GET_PARTITION_INFO Called; not supported by a floppy driver\n");
251 Irp->IoStatus.Information = 0;
252 break;
253
256 {
258 Irp->IoStatus.Information = 0;
259 break;
260 }
261
262 UniqueId =
Irp->AssociatedIrp.SystemBuffer;
264
266 {
269 break;
270 }
271
274
277 break;
278
281 {
283 Irp->IoStatus.Information = 0;
284 break;
285 }
286
287 Name =
Irp->AssociatedIrp.SystemBuffer;
289
291 {
294 break;
295 }
296
299
302 break;
303
304 default:
305 ERR_(FLOPPY,
"UNKNOWN IOCTL CODE: 0x%x\n",
Code);
307 Irp->IoStatus.Information = 0;
308 break;
309 }
310
311 INFO_(FLOPPY,
"ioctl: completing with status 0x%x\n",
Irp->IoStatus.Status);
313
315 return;
316}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define IOCTL_DISK_CHECK_VERIFY
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
#define IOCTL_DISK_FORMAT_TRACKS_EX
#define IOCTL_DISK_GET_MEDIA_TYPES
#define IOCTL_DISK_IS_WRITABLE
#define IOCTL_DISK_FORMAT_TRACKS
NTSTATUS NTAPI HwSenseDriveStatusResult(PCONTROLLER_INFO ControllerInfo, PUCHAR Status)
NTSTATUS NTAPI HwDiskChanged(PDRIVE_INFO DriveInfo, PBOOLEAN DiskChanged)
NTSTATUS NTAPI HwSenseDriveStatus(PDRIVE_INFO DriveInfo)
#define SR3_WRITE_PROTECT_STATUS_SIGNAL
NTSTATUS NTAPI ResetChangeFlag(PDRIVE_INFO DriveInfo)
VOID NTAPI SignalMediaChanged(PDEVICE_OBJECT DeviceObject, PIRP Irp)
VOID NTAPI StartMotor(PDRIVE_INFO DriveInfo)
VOID NTAPI StopMotor(PCONTROLLER_INFO ControllerInfo)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
struct _MOUNTDEV_NAME MOUNTDEV_NAME
struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
struct _DISK_GEOMETRY DISK_GEOMETRY
#define IOCTL_DISK_GET_PARTITION_INFO
#define IoCompleteRequest
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
struct _CONTROLLER_INFO * ControllerInfo
PDEVICE_OBJECT DeviceObject
WCHAR DeviceNameBuffer[MAX_DEVICE_NAME]
DISK_GEOMETRY DiskGeometry
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_IO_DEVICE_ERROR
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_VERIFY_REQUIRED
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
#define SL_OVERRIDE_VERIFY_VOLUME