ReactOS  0.4.14-dev-608-gd495a4f
Dispatch.c File Reference
#include "fltmgr.h"
#include "fltmgrint.h"
#include "fltmgr_shared.h"
#include <debug.h>
Include dependency graph for Dispatch.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS HandleLoadUnloadIoctl (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS HandleFindFirstIoctl (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpDeviceControlHandler (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpDispatchHandler (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 15 of file Dispatch.c.

Function Documentation

◆ FltpDeviceControlHandler()

NTSTATUS FltpDeviceControlHandler ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 37 of file Dispatch.c.

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 }
#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 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
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#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 IOCTL_FILTER_REPLY_MESSAGE
Definition: fltmgr_shared.h:10
Status
Definition: gdiplustypes.h:24
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 STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
#define IOCTL_FILTER_FIND_NEXT
Definition: fltmgr_shared.h:12
#define IOCTL_FILTER_LOAD
Definition: fltmgr_shared.h:3
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by FltpDeviceControl().

◆ FltpDispatchHandler()

NTSTATUS FltpDispatchHandler ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 103 of file Dispatch.c.

105 {
106  PIO_STACK_LOCATION StackPtr;
107  StackPtr = IoGetCurrentIrpStackLocation(Irp);
108  UNREFERENCED_PARAMETER(StackPtr);
109 
110  // implement me
111 
112  return STATUS_SUCCESS;
113 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by FltpDispatch().

◆ HandleFindFirstIoctl()

NTSTATUS HandleFindFirstIoctl ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

◆ HandleLoadUnloadIoctl()

NTSTATUS HandleLoadUnloadIoctl ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 119 of file Dispatch.c.

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 }
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#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
WCHAR * PWCH
Definition: ntbasedef.h:417
struct _FILTER_NAME * PFILTER_NAME
Status
Definition: gdiplustypes.h:24
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
unsigned int ULONG
Definition: retypes.h:1
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
#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 FLT_ASSERT(_e)
Definition: fltkernel.h:49

Referenced by FltpDeviceControlHandler().