3 * Copyright (C) 2008 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 * COPYRIGHT: See COPYING in the top level directory
20 * PROJECT: ReactOS kernel
21 * FILE: drivers/filesystem/ntfs/dispatch.c
22 * PURPOSE: NTFS filesystem driver
23 * PROGRAMMER: Pierre Schweitzer
27 /* INCLUDES *****************************************************************/
34 /* GLOBALS *****************************************************************/
37 /* FUNCTIONS ****************************************************************/
40 * FUNCTION: This function manages IRP for various major functions
42 * DriverObject = object describing this driver
43 * Irp = IRP to be passed to internal functions
44 * RETURNS: Status of I/O Request
48 NtfsFsdDispatch(PDEVICE_OBJECT DeviceObject
,
51 PNTFS_IRP_CONTEXT IrpContext
= NULL
;
52 NTSTATUS Status
= STATUS_UNSUCCESSFUL
;
54 TRACE_(NTFS
, "NtfsFsdDispatch()\n");
56 FsRtlEnterFileSystem();
60 NtfsIsIrpTopLevel(Irp
);
62 IrpContext
= NtfsAllocateIrpContext(DeviceObject
, Irp
);
65 switch (IrpContext
->MajorFunction
)
67 case IRP_MJ_QUERY_VOLUME_INFORMATION
:
68 Status
= NtfsQueryVolumeInformation(IrpContext
);
71 case IRP_MJ_SET_VOLUME_INFORMATION
:
72 Status
= NtfsSetVolumeInformation(IrpContext
);
77 Status
= STATUS_INSUFFICIENT_RESOURCES
;
79 Irp
->IoStatus
.Status
= Status
;
80 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
83 ExFreePoolWithTag(IrpContext
, 'PRIN');
85 IoSetTopLevelIrp(NULL
);
86 FsRtlExitFileSystem();