MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / Ext2InvalidateVolumes

Function Ext2InvalidateVolumes

Ext4Fsd/fsctl.c:295–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293
294
295NTSTATUS
296Ext2InvalidateVolumes ( IN PEXT2_IRP_CONTEXT IrpContext )
297{
298 NTSTATUS Status;
299 PIRP Irp;
300 PIO_STACK_LOCATION IrpSp;
301
302 PVPB NewVpb = NULL;
303 HANDLE Handle;
304 PLIST_ENTRY ListEntry;
305
306 ULONG InputLength = 0;
307 PFILE_OBJECT FileObject;
308 PDEVICE_OBJECT DeviceObject;
309 BOOLEAN GlobalResourceAcquired = FALSE;
310
311 LUID Privilege = {SE_TCB_PRIVILEGE, 0};
312
313 __try {
314
315 Irp = IrpContext->Irp;
316 IrpSp = IoGetCurrentIrpStackLocation(Irp);
317
318 if (!IsExt2FsDevice(IrpSp->DeviceObject)) {
319 Status = STATUS_INVALID_DEVICE_REQUEST;
320 __leave;
321 }
322
323 if (!SeSinglePrivilegeCheck(Privilege, Irp->RequestorMode)) {
324 Status = STATUS_PRIVILEGE_NOT_HELD;
325 __leave;
326 }
327
328
329#ifndef _GNU_NTIFS_
330 InputLength = IrpSp->Parameters.FileSystemControl.InputBufferLength;
331#else
332 InputLength = ((PEXTENDED_IO_STACK_LOCATION)(IrpSp))->
333 Parameters.FileSystemControl.InputBufferLength;
334#endif
335
336#if defined(_WIN64)
337 if (IoIs32bitProcess(Irp)) {
338 if (InputLength != sizeof(UINT32)) {
339 Status = STATUS_INVALID_PARAMETER;
340 __leave;
341 }
342 Handle = (HANDLE) LongToHandle( (*(PUINT32)Irp->AssociatedIrp.SystemBuffer) );
343 } else
344#endif
345 {
346 if (InputLength != sizeof(HANDLE)) {
347 Status = STATUS_INVALID_PARAMETER;
348 __leave;
349 }
350 Handle = *(PHANDLE)Irp->AssociatedIrp.SystemBuffer;
351 }
352

Callers 1

Ext2UserFsRequestFunction · 0.85

Calls 2

Ext2CheckDismountFunction · 0.85
Ext2CompleteIrpContextFunction · 0.85

Tested by

no test coverage detected