ReactOS  0.4.14-dev-315-gbb6fece
Dispatch.c
Go to the documentation of this file.
1 /*
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)
7 */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include "fltmgr.h"
12 #include "fltmgrint.h"
13 #include "fltmgr_shared.h"
14 
15 #define NDEBUG
16 #include <debug.h>
17 
18 
19 /* DATA *********************************************************************/
20 
25 );
26 
31 );
32 
33 
34 /* sdsfds *******************************************************************/
35 
39 {
40  PIO_STACK_LOCATION StackPtr;
43 
46 
47  ControlCode = StackPtr->Parameters.DeviceIoControl.IoControlCode;
48  switch (ControlCode)
49  {
50  case IOCTL_FILTER_LOAD:
52  break;
53 
56  break;
57 
60  break;
61 
64  break;
65 
68  break;
69 
72  break;
73 
76  break;
77 
80  break;
81 
84  break;
85 
88  break;
89 
92  break;
93 
94  default:
96  break;
97  }
98 
99  return Status;
100 }
101 
102 NTSTATUS
104  _Inout_ PIRP Irp)
105 {
106  PIO_STACK_LOCATION StackPtr;
107  StackPtr = IoGetCurrentIrpStackLocation(Irp);
108  UNREFERENCED_PARAMETER(StackPtr);
109 
110  // implement me
111 
112  return STATUS_SUCCESS;
113 }
114 
115 
116 /* INTERNAL FUNCTIONS ******************************************************/
117 
118 NTSTATUS
120  _Inout_ PIRP Irp)
121 {
122  PIO_STACK_LOCATION StackPtr;
124  PFILTER_NAME FilterName;
128 
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;
133 
135 
136  /* Make sure the buffer is valid */
137  if (BufferLength < sizeof(FILTER_NAME))
139 
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]));
145 
146  /* Forward the request to our Flt routines */
148  {
150  }
151  else
152  {
154  }
155 
156  return Status;
157 }
#define IOCTL_FILTER_GET_INFO
Definition: fltmgr_shared.h:13
#define IOCTL_FILTER_SEND_MESSAGE
Definition: fltmgr_shared.h:8
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define IOCTL_FILTER_ATTATCH
Definition: fltmgr_shared.h:6
#define IOCTL_FILTER_CREATE
Definition: fltmgr_shared.h:5
#define IOCTL_FILTER_UNLOAD
Definition: fltmgr_shared.h:4
_In_ ULONG BufferLength
Definition: usbdlib.h:225
struct NameRec_ * Name
Definition: cdprocs.h:464
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define PCHAR
Definition: match.c:90
NTSTATUS HandleFindFirstIoctl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
#define IOCTL_FILTER_GET_MESSAGE
Definition: fltmgr_shared.h:9
NTSTATUS HandleLoadUnloadIoctl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:119
#define IOCTL_FILTER_DETATCH
Definition: fltmgr_shared.h:7
#define _Inout_
Definition: no_sal2.h:244
WCHAR * PWCH
Definition: ntbasedef.h:417
NTSTATUS FltpDeviceControlHandler(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:37
#define IOCTL_FILTER_REPLY_MESSAGE
Definition: fltmgr_shared.h:10
struct _FILTER_NAME * PFILTER_NAME
Status
Definition: gdiplustypes.h:24
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define IOCTL_FILTER_FIND_FIRST
Definition: fltmgr_shared.h:11
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
NTSTATUS FltpDispatchHandler(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:103
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define IOCTL_FILTER_FIND_NEXT
Definition: fltmgr_shared.h:12
#define IOCTL_FILTER_LOAD
Definition: fltmgr_shared.h:3
NTSTATUS NTAPI FltUnloadFilter(_In_ PCUNICODE_STRING FilterName)
Definition: Filter.c:86
NTSTATUS NTAPI FltLoadFilter(_In_ PCUNICODE_STRING FilterName)
Definition: Filter.c:62
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49