87{
90
94
98
102 ULONG WriteByteCount;
103 ULONG OriginalByteCount;
104
106
108
110
111
112
113
114
116
119 }
120
121
122
123
124
125
127
128
130
132
135 }
136
137
138
139
140
141
144
145
146
147
148
149
152
154
155
156
157
158
160
161
162
163
164
166
167
168
169
170
171
173
175 }
176
178
179
180
181
182
184
186 }
187
188
189
190
191
192 if (ByteRange >
Fcb->FileSize.QuadPart) {
193
195 ByteRange =
Fcb->FileSize.QuadPart;
196 }
197 }
198
199
200
201
202
203
204
205
207
210 (WriteByteCount > OriginalByteCount)) {
211
213
215 }
216
217
218
219
220
222 }
223
224
225
226
227
228
229
230 if (IrpContext->IoContext ==
NULL ||
232
233
234
235
236
237
239
240 IrpContext->IoContext = &LocalIoContext;
242
243 } else {
244
247 }
248 }
249
251
252
253
254
255
256
257 IrpContext->IoContext->AllocatedContext =
259
261
265
266 } else {
267
269 IrpContext->IoContext->Resource =
Fcb->Resource;
270 IrpContext->IoContext->RequestedByteCount =
ByteCount;
271 }
272
273 Irp->IoStatus.Information = WriteByteCount;
274
275
276
277
278
279
280
281
283
284
285
286
287
288
290
291
292
293
294
296
299
300
301
302
303
304
305 } else {
306
307
308
309
310
312
313
314
315
316
317 Irp->IoStatus.Information = 0;
318
319
320
321
322
324
326 }
327
329
330
331
332
333
334 }
else if (WriteByteCount !=
ByteCount) {
335
337
343
345 }
346
347
348
349
350
352
354 }
355 }
356
359
360
361
362
363
364 if (ReleaseFile) {
365
367 }
369
370
371
372
373
375
376 Status = CdFsdPostRequest( IrpContext,
Irp );
377
378
379
380
381
382 } else {
383
385 }
386
388}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
#define CdMapUserBuffer(IC, UB)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
#define CdReleaseFile(IC, F)
_In_ PFCB _In_ LONGLONG StartingOffset
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define CdAllocateIoContext()
BOOLEAN CdVerifyFcbOperation(_In_opt_ PIRP_CONTEXT IrpContext, _In_ PFCB Fcb)
#define CdAcquireFileShared(IC, F)
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define CdRaiseStatus(IC, S)
#define CCB_FLAG_ALLOW_EXTENDED_DASD_IO
#define CCB_FLAG_DISMOUNT_ON_CLOSE
#define IRP_CONTEXT_FLAG_WAIT
#define IRP_CONTEXT_FLAG_ALLOC_IO
#define _Analysis_suppress_lock_checking_(lock)
#define NT_SUCCESS(StatCode)
#define SafeZeroMemory(IC, AT, BYTE_COUNT)
_In_ PIO_STACK_LOCATION IrpSp
#define KeInitializeEvent(pEvt, foo, foo2)
#define ExGetCurrentResourceThread()
#define ClearFlag(_F, _SF)
#define BooleanFlagOn(F, SF)
#define Add2Ptr(PTR, INC)
NTSTATUS NTAPI FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize, IN NTSTATUS NormalizedNtStatus)
#define STATUS_UNEXPECTED_IO_ERROR
#define STATUS_END_OF_FILE
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@3983 Write
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
_In_ WDFDPC _In_ BOOLEAN Wait
#define IoIsErrorUserInduced(Status)
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
#define FO_SYNCHRONOUS_IO