2 * PROJECT: Filesystem Filter Manager
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: drivers/filters/fltmgr/Dispatch.c
5 * PURPOSE: Contains dispatch handler routines
6 * PROGRAMMERS: Ged Murphy (gedmurphy@reactos.org)
9 /* INCLUDES ******************************************************************/
12 #include "fltmgrint.h"
13 #include "fltmgr_shared.h"
19 /* DATA *********************************************************************/
22 HandleLoadUnloadIoctl(
23 _In_ PDEVICE_OBJECT DeviceObject
,
29 _In_ PDEVICE_OBJECT DeviceObject
,
34 /* sdsfds *******************************************************************/
37 FltpDeviceControlHandler(_In_ PDEVICE_OBJECT DeviceObject
,
40 PIO_STACK_LOCATION StackPtr
;
44 StackPtr
= IoGetCurrentIrpStackLocation(Irp
);
45 FLT_ASSERT(StackPtr
->MajorFunction
== IRP_MJ_DEVICE_CONTROL
);
47 ControlCode
= StackPtr
->Parameters
.DeviceIoControl
.IoControlCode
;
50 case IOCTL_FILTER_LOAD
:
51 Status
= HandleLoadUnloadIoctl(DeviceObject
, Irp
);
54 case IOCTL_FILTER_UNLOAD
:
55 Status
= HandleLoadUnloadIoctl(DeviceObject
, Irp
);
58 case IOCTL_FILTER_CREATE
:
59 Status
= STATUS_NOT_SUPPORTED
;
62 case IOCTL_FILTER_ATTATCH
:
63 Status
= STATUS_NOT_SUPPORTED
;
66 case IOCTL_FILTER_DETATCH
:
67 Status
= STATUS_NOT_SUPPORTED
;
70 case IOCTL_FILTER_SEND_MESSAGE
:
71 Status
= STATUS_NOT_SUPPORTED
;
74 case IOCTL_FILTER_GET_MESSAGE
:
75 Status
= STATUS_NOT_SUPPORTED
;
78 case IOCTL_FILTER_REPLY_MESSAGE
:
79 Status
= STATUS_NOT_SUPPORTED
;
82 case IOCTL_FILTER_FIND_FIRST
:
83 Status
= STATUS_NOT_SUPPORTED
;
86 case IOCTL_FILTER_FIND_NEXT
:
87 Status
= STATUS_NOT_SUPPORTED
;
90 case IOCTL_FILTER_GET_INFO
:
91 Status
= STATUS_NOT_SUPPORTED
;
95 Status
= STATUS_INVALID_PARAMETER
;
103 FltpDispatchHandler(_In_ PDEVICE_OBJECT DeviceObject
,
106 PIO_STACK_LOCATION StackPtr
;
107 StackPtr
= IoGetCurrentIrpStackLocation(Irp
);
108 UNREFERENCED_PARAMETER(StackPtr
);
112 return STATUS_SUCCESS
;
116 /* INTERNAL FUNCTIONS ******************************************************/
119 HandleLoadUnloadIoctl(_In_ PDEVICE_OBJECT DeviceObject
,
122 PIO_STACK_LOCATION StackPtr
;
124 PFILTER_NAME FilterName
;
129 /* Get the IOCTL data from the stack pointer */
130 StackPtr
= IoGetCurrentIrpStackLocation(Irp
);
131 BufferLength
= StackPtr
->Parameters
.DeviceIoControl
.InputBufferLength
;
132 ControlCode
= StackPtr
->Parameters
.DeviceIoControl
.IoControlCode
;
134 FLT_ASSERT(ControlCode
== IOCTL_FILTER_LOAD
|| ControlCode
== IOCTL_FILTER_UNLOAD
);
136 /* Make sure the buffer is valid */
137 if (BufferLength
< sizeof(FILTER_NAME
))
138 return STATUS_INVALID_PARAMETER
;
140 /* Convert the file name buffer into a string */
141 FilterName
= (PFILTER_NAME
)Irp
->AssociatedIrp
.SystemBuffer
;
142 Name
.Length
= FilterName
->Length
;
143 Name
.MaximumLength
= FilterName
->Length
;
144 Name
.Buffer
= (PWCH
)((PCHAR
)FilterName
+ FIELD_OFFSET(FILTER_NAME
, FilterName
[0]));
146 /* Forward the request to our Flt routines */
147 if (ControlCode
== IOCTL_FILTER_LOAD
)
149 Status
= FltLoadFilter(&Name
);
153 Status
= FltUnloadFilter(&Name
);