ReactOS 0.4.15-dev-8191-gbc6c731
fltmgrint.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _FLT_OBJECT
 
struct  _ALLOCATE_CONTEXT_HEADER
 
struct  _FLT_RESOURCE_LIST_HEAD
 
struct  _FLT_MUTEX_LIST_HEAD
 
struct  _FLT_TYPE
 
struct  _FLTP_FRAME
 
struct  _FLT_FILTER
 
struct  _FLT_INSTANCE
 
struct  _TREE_ROOT
 
struct  _CONTEXT_LIST_CTRL
 
struct  _STREAM_LIST_CTRL
 
struct  _FLT_SERVER_PORT_OBJECT
 
struct  _FLT_MESSAGE_WAITER_QUEUE
 
struct  _FLT_PORT_OBJECT
 
struct  _CALLBACK_CTRL
 
struct  _NAME_CACHE_LIST_CTRL_STATS
 
struct  _NAME_CACHE_VOLUME_CTRL_STATS
 
struct  _NAME_CACHE_VOLUME_CTRL
 
struct  _FLT_VOLUME
 
struct  _MANAGER_CCB
 
struct  _FILTER_CCB
 
struct  _INSTANCE_CCB
 
struct  _VOLUME_CCB
 
struct  _PORT_CCB
 
union  _CCB_TYPE
 
struct  _FLT_CCB
 

Macros

#define MAX_CONTEXT_TYPES   6
 

Typedefs

typedef enum _FLT_OBJECT_FLAGS FLT_OBJECT_FLAGS
 
typedef enum _FLT_OBJECT_FLAGSPFLT_OBJECT_FLAGS
 
typedef enum _FLT_FILTER_FLAGS FLT_FILTER_FLAGS
 
typedef enum _FLT_FILTER_FLAGSPFLT_FILTER_FLAGS
 
typedef struct _FLT_OBJECT FLT_OBJECT
 
typedef struct _FLT_OBJECTPFLT_OBJECT
 
typedef struct _ALLOCATE_CONTEXT_HEADER ALLOCATE_CONTEXT_HEADER
 
typedef struct _ALLOCATE_CONTEXT_HEADERPALLOCATE_CONTEXT_HEADER
 
typedef struct _FLT_RESOURCE_LIST_HEAD FLT_RESOURCE_LIST_HEAD
 
typedef struct _FLT_RESOURCE_LIST_HEADPFLT_RESOURCE_LIST_HEAD
 
typedef struct _FLT_MUTEX_LIST_HEAD FLT_MUTEX_LIST_HEAD
 
typedef struct _FLT_MUTEX_LIST_HEADPFLT_MUTEX_LIST_HEAD
 
typedef struct _FLT_TYPE FLT_TYPE
 
typedef struct _FLT_TYPEPFLT_TYPE
 
typedef struct _FLTP_FRAME FLTP_FRAME
 
typedef struct _FLTP_FRAMEPFLTP_FRAME
 
typedef struct _FLT_FILTER FLT_FILTER
 
typedef struct _FLT_FILTERPFLT_FILTER
 
typedef enum _FLT_INSTANCE_FLAGS FLT_INSTANCE_FLAGS
 
typedef enum _FLT_INSTANCE_FLAGSPFLT_INSTANCE_FLAGS
 
typedef struct _FLT_INSTANCE FLT_INSTANCE
 
typedef struct _FLT_INSTANCEPFLT_INSTANCE
 
typedef struct _TREE_ROOT TREE_ROOT
 
typedef struct _TREE_ROOTPTREE_ROOT
 
typedef struct _CONTEXT_LIST_CTRL CONTEXT_LIST_CTRL
 
typedef struct _CONTEXT_LIST_CTRLPCONTEXT_LIST_CTRL
 
typedef struct _STREAM_LIST_CTRL STREAM_LIST_CTRL
 
typedef struct _STREAM_LIST_CTRLPSTREAM_LIST_CTRL
 
typedef struct _FLT_SERVER_PORT_OBJECT FLT_SERVER_PORT_OBJECT
 
typedef struct _FLT_SERVER_PORT_OBJECTPFLT_SERVER_PORT_OBJECT
 
typedef struct _FLT_MESSAGE_WAITER_QUEUE FLT_MESSAGE_WAITER_QUEUE
 
typedef struct _FLT_MESSAGE_WAITER_QUEUEPFLT_MESSAGE_WAITER_QUEUE
 
typedef struct _FLT_PORT_OBJECT FLT_PORT_OBJECT
 
typedef struct _FLT_PORT_OBJECTPFLT_PORT_OBJECT
 
typedef enum _FLT_VOLUME_FLAGS FLT_VOLUME_FLAGS
 
typedef enum _FLT_VOLUME_FLAGSPFLT_VOLUME_FLAGS
 
typedef enum _CALLBACK_NODE_FLAGS CALLBACK_NODE_FLAGS
 
typedef enum _CALLBACK_NODE_FLAGSPCALLBACK_NODE_FLAGS
 
typedef struct _CALLBACK_CTRL CALLBACK_CTRL
 
typedef struct _CALLBACK_CTRLPCALLBACK_CTRL
 
typedef struct _NAME_CACHE_LIST_CTRL_STATS NAME_CACHE_LIST_CTRL_STATS
 
typedef struct _NAME_CACHE_LIST_CTRL_STATSPNAME_CACHE_LIST_CTRL_STATS
 
typedef struct _NAME_CACHE_VOLUME_CTRL_STATS NAME_CACHE_VOLUME_CTRL_STATS
 
typedef struct _NAME_CACHE_VOLUME_CTRL_STATSPNAME_CACHE_VOLUME_CTRL_STATS
 
typedef struct _NAME_CACHE_VOLUME_CTRL NAME_CACHE_VOLUME_CTRL
 
typedef struct _NAME_CACHE_VOLUME_CTRLPNAME_CACHE_VOLUME_CTRL
 
typedef struct _FLT_VOLUME FLT_VOLUME
 
typedef struct _FLT_VOLUMEPFLT_VOLUME
 
typedef struct _MANAGER_CCB MANAGER_CCB
 
typedef struct _MANAGER_CCBPMANAGER_CCB
 
typedef struct _FILTER_CCB FILTER_CCB
 
typedef struct _FILTER_CCBPFILTER_CCB
 
typedef struct _INSTANCE_CCB INSTANCE_CCB
 
typedef struct _INSTANCE_CCBPINSTANCE_CCB
 
typedef struct _VOLUME_CCB VOLUME_CCB
 
typedef struct _VOLUME_CCBPVOLUME_CCB
 
typedef struct _PORT_CCB PORT_CCB
 
typedef struct _PORT_CCBPPORT_CCB
 
typedef union _CCB_TYPE CCB_TYPE
 
typedef union _CCB_TYPEPCCB_TYPE
 
typedef struct _FLT_CCB FLT_CCB
 
typedef struct _FLT_CCBPFLT_CCB
 

Enumerations

enum  _FLT_OBJECT_FLAGS {
  FLT_OBFL_DRAINING = 1 , FLT_OBFL_ZOMBIED = 2 , FLT_OBFL_TYPE_INSTANCE = 0x1000000 , FLT_OBFL_TYPE_FILTER = 0x2000000 ,
  FLT_OBFL_TYPE_VOLUME = 0x4000000
}
 
enum  _FLT_FILTER_FLAGS { FLTFL_MANDATORY_UNLOAD_IN_PROGRESS = 1 , FLTFL_FILTERING_INITIATED = 2 }
 
enum  _FLT_INSTANCE_FLAGS { INSFL_CAN_BE_DETACHED = 0x01 , INSFL_DELETING = 0x02 , INSFL_INITING = 0x04 }
 
enum  _FLT_VOLUME_FLAGS {
  VOLFL_NETWORK_FILESYSTEM = 0x1 , VOLFL_PENDING_MOUNT_SETUP_NOTIFIES = 0x2 , VOLFL_MOUNT_SETUP_NOTIFIES_CALLED = 0x4 , VOLFL_MOUNTING = 0x8 ,
  VOLFL_SENT_SHUTDOWN_IRP = 0x10 , VOLFL_ENABLE_NAME_CACHING = 0x20 , VOLFL_FILTER_EVER_ATTACHED = 0x40 , VOLFL_STANDARD_LINK_NOT_SUPPORTED = 0x80
}
 
enum  _CALLBACK_NODE_FLAGS { CBNFL_SKIP_PAGING_IO = 0x1 , CBNFL_SKIP_CACHED_IO = 0x2 , CBNFL_USE_NAME_CALLBACK_EX = 0x4 , CBNFL_SKIP_NON_DASD_IO = 0x8 }
 

Functions

VOID FltpExInitializeRundownProtection (_Out_ PEX_RUNDOWN_REF RundownRef)
 
BOOLEAN FltpExAcquireRundownProtection (_Inout_ PEX_RUNDOWN_REF RundownRef)
 
BOOLEAN FltpExReleaseRundownProtection (_Inout_ PEX_RUNDOWN_REF RundownRef)
 
NTSTATUS NTAPI FltpObjectRundownWait (_Inout_ PEX_RUNDOWN_REF RundownRef)
 
BOOLEAN FltpExRundownCompleted (_Inout_ PEX_RUNDOWN_REF RundownRef)
 
NTSTATUS FltpGetBaseDeviceObjectName (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PUNICODE_STRING ObjectName)
 
NTSTATUS FltpGetObjectName (_In_ PVOID Object, _Inout_ PUNICODE_STRING ObjectName)
 
ULONG FltpObjectPointerReference (_In_ PFLT_OBJECT Object)
 
VOID FltpObjectPointerDereference (_In_ PFLT_OBJECT Object)
 
NTSTATUS FltpReallocateUnicodeString (_In_ PUNICODE_STRING String, _In_ SIZE_T NewLength, _In_ BOOLEAN CopyExisting)
 
VOID FltpFreeUnicodeString (_In_ PUNICODE_STRING String)
 
NTSTATUS FltpDeviceControlHandler (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpDispatchHandler (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpMsgCreate (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpMsgDispatch (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 
NTSTATUS FltpSetupCommunicationObjects (_In_ PDRIVER_OBJECT DriverObject)
 

Macro Definition Documentation

◆ MAX_CONTEXT_TYPES

#define MAX_CONTEXT_TYPES   6

Definition at line 5 of file fltmgrint.h.

Typedef Documentation

◆ ALLOCATE_CONTEXT_HEADER

◆ CALLBACK_CTRL

◆ CALLBACK_NODE_FLAGS

◆ CCB_TYPE

typedef union _CCB_TYPE CCB_TYPE

◆ CONTEXT_LIST_CTRL

◆ FILTER_CCB

◆ FLT_CCB

◆ FLT_FILTER

◆ FLT_FILTER_FLAGS

◆ FLT_INSTANCE

◆ FLT_INSTANCE_FLAGS

◆ FLT_MESSAGE_WAITER_QUEUE

◆ FLT_MUTEX_LIST_HEAD

◆ FLT_OBJECT

◆ FLT_OBJECT_FLAGS

◆ FLT_PORT_OBJECT

◆ FLT_RESOURCE_LIST_HEAD

◆ FLT_SERVER_PORT_OBJECT

◆ FLT_TYPE

◆ FLT_VOLUME

◆ FLT_VOLUME_FLAGS

◆ FLTP_FRAME

◆ INSTANCE_CCB

◆ MANAGER_CCB

◆ NAME_CACHE_LIST_CTRL_STATS

◆ NAME_CACHE_VOLUME_CTRL

◆ NAME_CACHE_VOLUME_CTRL_STATS

◆ PALLOCATE_CONTEXT_HEADER

◆ PCALLBACK_CTRL

◆ PCALLBACK_NODE_FLAGS

◆ PCCB_TYPE

typedef union _CCB_TYPE * PCCB_TYPE

◆ PCONTEXT_LIST_CTRL

◆ PFILTER_CCB

◆ PFLT_CCB

◆ PFLT_FILTER

◆ PFLT_FILTER_FLAGS

◆ PFLT_INSTANCE

◆ PFLT_INSTANCE_FLAGS

◆ PFLT_MESSAGE_WAITER_QUEUE

◆ PFLT_MUTEX_LIST_HEAD

◆ PFLT_OBJECT

◆ PFLT_OBJECT_FLAGS

◆ PFLT_PORT_OBJECT

◆ PFLT_RESOURCE_LIST_HEAD

◆ PFLT_SERVER_PORT_OBJECT

◆ PFLT_TYPE

◆ PFLT_VOLUME

◆ PFLT_VOLUME_FLAGS

◆ PFLTP_FRAME

◆ PINSTANCE_CCB

◆ PMANAGER_CCB

◆ PNAME_CACHE_LIST_CTRL_STATS

◆ PNAME_CACHE_VOLUME_CTRL

◆ PNAME_CACHE_VOLUME_CTRL_STATS

◆ PORT_CCB

◆ PPORT_CCB

◆ PSTREAM_LIST_CTRL

◆ PTREE_ROOT

◆ PVOLUME_CCB

◆ STREAM_LIST_CTRL

◆ TREE_ROOT

◆ VOLUME_CCB

Enumeration Type Documentation

◆ _CALLBACK_NODE_FLAGS

Enumerator
CBNFL_SKIP_PAGING_IO 
CBNFL_SKIP_CACHED_IO 
CBNFL_USE_NAME_CALLBACK_EX 
CBNFL_SKIP_NON_DASD_IO 

Definition at line 243 of file fltmgrint.h.

244{
249
enum _CALLBACK_NODE_FLAGS CALLBACK_NODE_FLAGS
enum _CALLBACK_NODE_FLAGS * PCALLBACK_NODE_FLAGS
@ CBNFL_SKIP_CACHED_IO
Definition: fltmgrint.h:246
@ CBNFL_SKIP_NON_DASD_IO
Definition: fltmgrint.h:248
@ CBNFL_SKIP_PAGING_IO
Definition: fltmgrint.h:245
@ CBNFL_USE_NAME_CALLBACK_EX
Definition: fltmgrint.h:247

◆ _FLT_FILTER_FLAGS

Enumerator
FLTFL_MANDATORY_UNLOAD_IN_PROGRESS 
FLTFL_FILTERING_INITIATED 

Definition at line 18 of file fltmgrint.h.

19{
22
@ FLTFL_FILTERING_INITIATED
Definition: fltmgrint.h:21
@ FLTFL_MANDATORY_UNLOAD_IN_PROGRESS
Definition: fltmgrint.h:20
enum _FLT_FILTER_FLAGS FLT_FILTER_FLAGS
enum _FLT_FILTER_FLAGS * PFLT_FILTER_FLAGS

◆ _FLT_INSTANCE_FLAGS

Enumerator
INSFL_CAN_BE_DETACHED 
INSFL_DELETING 
INSFL_INITING 

Definition at line 127 of file fltmgrint.h.

128{
130 INSFL_DELETING = 0x02,
131 INSFL_INITING = 0x04
132
enum _FLT_INSTANCE_FLAGS FLT_INSTANCE_FLAGS
@ INSFL_CAN_BE_DETACHED
Definition: fltmgrint.h:129
@ INSFL_INITING
Definition: fltmgrint.h:131
@ INSFL_DELETING
Definition: fltmgrint.h:130
enum _FLT_INSTANCE_FLAGS * PFLT_INSTANCE_FLAGS

◆ _FLT_OBJECT_FLAGS

Enumerator
FLT_OBFL_DRAINING 
FLT_OBFL_ZOMBIED 
FLT_OBFL_TYPE_INSTANCE 
FLT_OBFL_TYPE_FILTER 
FLT_OBFL_TYPE_VOLUME 

Definition at line 8 of file fltmgrint.h.

9{
12 FLT_OBFL_TYPE_INSTANCE = 0x1000000,
13 FLT_OBFL_TYPE_FILTER = 0x2000000,
14 FLT_OBFL_TYPE_VOLUME = 0x4000000
15
@ FLT_OBFL_TYPE_VOLUME
Definition: fltmgrint.h:14
@ FLT_OBFL_TYPE_FILTER
Definition: fltmgrint.h:13
@ FLT_OBFL_DRAINING
Definition: fltmgrint.h:10
@ FLT_OBFL_TYPE_INSTANCE
Definition: fltmgrint.h:12
@ FLT_OBFL_ZOMBIED
Definition: fltmgrint.h:11
enum _FLT_OBJECT_FLAGS * PFLT_OBJECT_FLAGS
enum _FLT_OBJECT_FLAGS FLT_OBJECT_FLAGS

◆ _FLT_VOLUME_FLAGS

Enumerator
VOLFL_NETWORK_FILESYSTEM 
VOLFL_PENDING_MOUNT_SETUP_NOTIFIES 
VOLFL_MOUNT_SETUP_NOTIFIES_CALLED 
VOLFL_MOUNTING 
VOLFL_SENT_SHUTDOWN_IRP 
VOLFL_ENABLE_NAME_CACHING 
VOLFL_FILTER_EVER_ATTACHED 
VOLFL_STANDARD_LINK_NOT_SUPPORTED 

Definition at line 229 of file fltmgrint.h.

230{
234 VOLFL_MOUNTING = 0x8,
239
enum _FLT_VOLUME_FLAGS FLT_VOLUME_FLAGS
enum _FLT_VOLUME_FLAGS * PFLT_VOLUME_FLAGS
@ VOLFL_ENABLE_NAME_CACHING
Definition: fltmgrint.h:236
@ VOLFL_NETWORK_FILESYSTEM
Definition: fltmgrint.h:231
@ VOLFL_STANDARD_LINK_NOT_SUPPORTED
Definition: fltmgrint.h:238
@ VOLFL_PENDING_MOUNT_SETUP_NOTIFIES
Definition: fltmgrint.h:232
@ VOLFL_SENT_SHUTDOWN_IRP
Definition: fltmgrint.h:235
@ VOLFL_MOUNT_SETUP_NOTIFIES_CALLED
Definition: fltmgrint.h:233
@ VOLFL_MOUNTING
Definition: fltmgrint.h:234
@ VOLFL_FILTER_EVER_ATTACHED
Definition: fltmgrint.h:237

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 {
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}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
NTSTATUS HandleLoadUnloadIoctl(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: Dispatch.c:119
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49
#define IOCTL_FILTER_CREATE
Definition: fltmgr_shared.h:5
#define IOCTL_FILTER_DETATCH
Definition: fltmgr_shared.h:7
#define IOCTL_FILTER_UNLOAD
Definition: fltmgr_shared.h:4
#define IOCTL_FILTER_FIND_FIRST
Definition: fltmgr_shared.h:11
#define IOCTL_FILTER_GET_INFO
Definition: fltmgr_shared.h:13
#define IOCTL_FILTER_FIND_NEXT
Definition: fltmgr_shared.h:12
#define IOCTL_FILTER_GET_MESSAGE
Definition: fltmgr_shared.h:9
#define IOCTL_FILTER_REPLY_MESSAGE
Definition: fltmgr_shared.h:10
#define IOCTL_FILTER_ATTATCH
Definition: fltmgr_shared.h:6
#define IOCTL_FILTER_LOAD
Definition: fltmgr_shared.h:3
#define IOCTL_FILTER_SEND_MESSAGE
Definition: fltmgr_shared.h:8
Status
Definition: gdiplustypes.h:25
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
union _IO_STACK_LOCATION::@1571 Parameters
struct _IO_STACK_LOCATION::@1571::@1572 DeviceIoControl
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55

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;
108 UNREFERENCED_PARAMETER(StackPtr);
109
110 // implement me
111
112 return STATUS_SUCCESS;
113}
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by FltpDispatch().

◆ FltpExAcquireRundownProtection()

BOOLEAN FltpExAcquireRundownProtection ( _Inout_ PEX_RUNDOWN_REF  RundownRef)

Definition at line 218 of file Object.c.

219{
220 return ExAcquireRundownProtection(RundownRef);
221}
#define ExAcquireRundownProtection
Definition: ex.h:135

Referenced by FltObjectReference().

◆ FltpExInitializeRundownProtection()

VOID FltpExInitializeRundownProtection ( _Out_ PEX_RUNDOWN_REF  RundownRef)

Definition at line 212 of file Object.c.

213{
215}
#define ExInitializeRundownProtection
Definition: ex.h:137

◆ FltpExReleaseRundownProtection()

BOOLEAN FltpExReleaseRundownProtection ( _Inout_ PEX_RUNDOWN_REF  RundownRef)

Definition at line 224 of file Object.c.

225{
226 ExReleaseRundownProtection(RundownRef);
227 return TRUE;
228}
#define TRUE
Definition: types.h:120
#define ExReleaseRundownProtection
Definition: ex.h:136

Referenced by FltObjectDereference().

◆ FltpExRundownCompleted()

BOOLEAN FltpExRundownCompleted ( _Inout_ PEX_RUNDOWN_REF  RundownRef)

Definition at line 231 of file Object.c.

232{
233 return _InterlockedExchange((PLONG)RundownRef, 1);
234}
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
int32_t * PLONG
Definition: typedefs.h:58

◆ FltpFreeUnicodeString()

VOID FltpFreeUnicodeString ( _In_ PUNICODE_STRING  String)

Definition at line 24 of file Lib.c.

25{
26 /* Free up any existing buffer */
27 if (String->Buffer)
28 {
30 }
31
32 /* Empty the string */
33 String->Buffer = NULL;
34 String->Length = 0;
35 String->MaximumLength = 0;
36}
#define NULL
Definition: types.h:112
#define FM_TAG_UNICODE_STRING
Definition: fltmgr.h:20
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

◆ FltpGetBaseDeviceObjectName()

NTSTATUS FltpGetBaseDeviceObjectName ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PUNICODE_STRING  ObjectName 
)

Definition at line 245 of file Object.c.

247{
248 PDEVICE_OBJECT BaseDeviceObject;
250
251 /*
252 * Get the lowest device object on the stack, which may be the
253 * object we were passed, and lookup the name for that object
254 */
255 BaseDeviceObject = IoGetDeviceAttachmentBaseRef(DeviceObject);
256 Status = FltpGetObjectName(BaseDeviceObject, ObjectName);
257 ObDereferenceObject(BaseDeviceObject);
258
259 return Status;
260}
NTSTATUS FltpGetObjectName(_In_ PVOID Object, _Inout_ PUNICODE_STRING ObjectName)
Definition: Object.c:263
PDEVICE_OBJECT NTAPI IoGetDeviceAttachmentBaseRef(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1419
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
Definition: cmfuncs.h:64
#define ObDereferenceObject
Definition: obfuncs.h:203

◆ FltpGetObjectName()

NTSTATUS FltpGetObjectName ( _In_ PVOID  Object,
_Inout_ PUNICODE_STRING  ObjectName 
)

Definition at line 263 of file Object.c.

265{
266 OBJECT_NAME_INFORMATION LocalNameInfo;
267 POBJECT_NAME_INFORMATION ObjectNameInfo = &LocalNameInfo;
270
271 if (ObjectName == NULL)
273
274 /* Get the size of the buffer required to hold the nameinfo */
276 &LocalNameInfo,
277 sizeof(LocalNameInfo),
278 &ReturnLength);
280 {
281 ObjectNameInfo = ExAllocatePoolWithTag(PagedPool,
284 if (ObjectNameInfo == NULL) return STATUS_INSUFFICIENT_RESOURCES;
285
286 /* Get the actual name info now we have the buffer to hold it */
288 ObjectNameInfo,
290 &ReturnLength);
291 }
292
293
294 if (NT_SUCCESS(Status))
295 {
296 /* Make sure the buffer we were passed is large enough to hold the string */
297 if (ObjectName->MaximumLength < ObjectNameInfo->Name.Length)
298 {
299 /* It wasn't, let's enlarge the buffer */
301 ObjectNameInfo->Name.Length,
302 FALSE);
303
304 }
305
306 if (NT_SUCCESS(Status))
307 {
308 /* Copy the object name into the callers buffer */
309 RtlCopyUnicodeString(ObjectName, &ObjectNameInfo->Name);
310 }
311 }
312
313 if (ObjectNameInfo != &LocalNameInfo)
314 {
316 }
317
318 return Status;
319}
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:43
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
NTSTATUS FltpReallocateUnicodeString(_In_ PUNICODE_STRING String, _In_ SIZE_T NewLength, _In_ BOOLEAN CopyExisting)
Definition: Lib.c:39
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSTATUS NTAPI ObQueryNameString(IN PVOID Object, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength)
Definition: obname.c:1207
UNICODE_STRING Name
Definition: nt_native.h:1270
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by FltpGetBaseDeviceObjectName().

◆ FltpMsgCreate()

NTSTATUS FltpMsgCreate ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 223 of file Messaging.c.

225{
226 PIO_STACK_LOCATION StackPtr;
228
229 /* Get the stack location */
231
233
234 /* Check if this is a caller wanting to connect */
235 if (StackPtr->MajorFunction == IRP_MJ_CREATE)
236 {
237 /* Create the client port for this connection and exit */
239 }
240 else
241 {
243 }
244
245 if (Status != STATUS_PENDING)
246 {
247 Irp->IoStatus.Status = Status;
248 Irp->IoStatus.Information = 0;
250 }
251
252 return Status;
253}
static NTSTATUS CreateClientPort(_In_ PFILE_OBJECT FileObject, _Inout_ PIRP Irp)
Definition: Messaging.c:617
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
PFILE_OBJECT FileObject
Definition: iotypes.h:3169

Referenced by FltpCreate().

◆ FltpMsgDispatch()

NTSTATUS FltpMsgDispatch ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 256 of file Messaging.c.

258{
259 PIO_STACK_LOCATION StackPtr;
261
262 /* Get the stack location */
264
265 /* Check if this is a caller wanting to connect */
266 if (StackPtr->MajorFunction == IRP_MJ_CLOSE)
267 {
268 /* Create the client port for this connection and exit */
269 Status = CloseClientPort(StackPtr->FileObject, Irp);
270 }
271 else
272 {
273 // We don't support anything else yet
275 }
276
277 if (Status != STATUS_PENDING)
278 {
279 Irp->IoStatus.Status = Status;
280 Irp->IoStatus.Information = 0;
282 }
283
284 return Status;
285}
static NTSTATUS CloseClientPort(_In_ PFILE_OBJECT FileObject, _Inout_ PIRP Irp)
Definition: Messaging.c:766
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45

Referenced by FltpDispatch().

◆ FltpObjectPointerDereference()

VOID FltpObjectPointerDereference ( _In_ PFLT_OBJECT  Object)

Definition at line 335 of file Object.c.

336{
337 if (InterlockedDecrementSizeT(&Object->PointerCount) == 0)
338 {
339 // Cleanup
341 }
342}
#define InterlockedDecrementSizeT(a)
Definition: interlocked.h:153

Referenced by FltpServerPortDelete().

◆ FltpObjectPointerReference()

ULONG FltpObjectPointerReference ( _In_ PFLT_OBJECT  Object)

Definition at line 322 of file Object.c.

323{
325
326 /* Store the old count and increment */
327 Result = &Object->PointerCount;
328 InterlockedIncrementSizeT(&Object->PointerCount);
329
330 /* Return the initial value */
331 return *Result;
332}
#define InterlockedIncrementSizeT(a)
Definition: interlocked.h:220
uint32_t * PULONG
Definition: typedefs.h:59
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by _IRQL_requires_max_().

◆ FltpObjectRundownWait()

NTSTATUS NTAPI FltpObjectRundownWait ( _Inout_ PEX_RUNDOWN_REF  RundownRef)

Definition at line 238 of file Object.c.

239{
240 //return FltpExWaitForRundownProtectionRelease(RundownRef);
241 return 0;
242}

◆ FltpReallocateUnicodeString()

NTSTATUS FltpReallocateUnicodeString ( _In_ PUNICODE_STRING  String,
_In_ SIZE_T  NewLength,
_In_ BOOLEAN  CopyExisting 
)

Definition at line 39 of file Lib.c.

42{
43 PWCH NewBuffer;
44
45 /* Don't bother reallocating if the buffer is smaller */
46 if (NewLength <= String->MaximumLength)
47 {
48 String->Length = 0;
49 return STATUS_SUCCESS;
50 }
51
52 /* Allocate a new buffer at the size requested */
54 if (NewBuffer == NULL) return STATUS_INSUFFICIENT_RESOURCES;
55
56 if (CopyExisting)
57 {
58 /* Copy the old data across */
59 RtlCopyMemory(NewBuffer, String->Buffer, String->Length);
60 }
61 else
62 {
63 /* Reset the length */
64 String->Length = 0;
65 }
66
67 /* Free any old buffer */
68 if (String->Buffer)
70
71 /* Update the lengths */
72 String->Buffer = NewBuffer;
73 String->MaximumLength = NewLength;
74
75 return STATUS_SUCCESS;
76}
static USHORT USHORT * NewLength
WCHAR * PWCH
Definition: ntbasedef.h:410
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength

◆ FltpSetupCommunicationObjects()

NTSTATUS FltpSetupCommunicationObjects ( _In_ PDRIVER_OBJECT  DriverObject)

Definition at line 377 of file Messaging.c.

378{
379 OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
380 UNICODE_STRING SymLinkName;
383
385 {
390 };
391
392 /* Create the server comms object type */
393 RtlZeroMemory(&ObjectTypeInitializer, sizeof(OBJECT_TYPE_INITIALIZER));
394 RtlInitUnicodeString(&Name, L"FilterConnectionPort");
395 ObjectTypeInitializer.Length = sizeof(OBJECT_TYPE_INITIALIZER);
396 ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK;
397 ObjectTypeInitializer.GenericMapping = Mapping;
398 ObjectTypeInitializer.PoolType = NonPagedPool;
399 ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(FLT_SERVER_PORT_OBJECT);
400 ObjectTypeInitializer.ValidAccessMask = GENERIC_ALL;
401 ObjectTypeInitializer.CloseProcedure = FltpServerPortClose;
402 ObjectTypeInitializer.DeleteProcedure = FltpServerPortDelete;
403 Status = ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ServerPortObjectType);
404 if (!NT_SUCCESS(Status)) return Status;
405
406 /* Create the client comms object type */
407 RtlZeroMemory(&ObjectTypeInitializer, sizeof(OBJECT_TYPE_INITIALIZER));
408 RtlInitUnicodeString(&Name, L"FilterCommunicationPort");
409 ObjectTypeInitializer.Length = sizeof(OBJECT_TYPE_INITIALIZER);
410 ObjectTypeInitializer.InvalidAttributes = OBJ_OPENLINK;
411 ObjectTypeInitializer.GenericMapping = Mapping;
412 ObjectTypeInitializer.PoolType = NonPagedPool;
413 ObjectTypeInitializer.DefaultNonPagedPoolCharge = sizeof(FLT_PORT_OBJECT);
414 ObjectTypeInitializer.ValidAccessMask = GENERIC_ALL;
415 ObjectTypeInitializer.CloseProcedure = FltpClientPortClose;
416 ObjectTypeInitializer.DeleteProcedure = FltpClientPortDelete;
417 Status = ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &ClientPortObjectType);
418 if (!NT_SUCCESS(Status))
419 {
420 goto Quit;
421 }
422
423 /* Create the device object */
425 0,
428 0,
429 0,
431 if (NT_SUCCESS(Status))
432 {
433 /* Setup a symbolic link for the device */
434 RtlInitUnicodeString(&SymLinkName, L"\\DosDevices\\FltMgrMsg");
436 }
437
438Quit:
439 if (!NT_SUCCESS(Status))
440 {
441 /* Something went wrong, undo */
443 {
446 }
448 {
452 }
453
455 {
459 }
460 }
461
462 return Status;
463}
VOID NTAPI FltpServerPortDelete(PVOID Object)
Definition: Messaging.c:317
UNICODE_STRING CommsDeviceName
Definition: Messaging.c:21
PDEVICE_OBJECT CommsDeviceObject
Definition: Messaging.c:22
VOID NTAPI FltpClientPortDelete(PVOID Object)
Definition: Messaging.c:369
POBJECT_TYPE ClientPortObjectType
Definition: Messaging.c:25
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
VOID NTAPI FltpServerPortClose(_In_opt_ PEPROCESS Process, _In_ PVOID Object, _In_ ACCESS_MASK GrantedAccess, _In_ ULONG ProcessHandleCount, _In_ ULONG SystemHandleCount)
Definition: Messaging.c:289
VOID NTAPI FltpClientPortClose(_In_opt_ PEPROCESS Process, _In_ PVOID Object, _In_ ACCESS_MASK GrantedAccess, _In_ ULONG ProcessHandleCount, _In_ ULONG SystemHandleCount)
Definition: Messaging.c:327
struct NameRec_ * Name
Definition: cdprocs.h:460
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
#define NonPagedPool
Definition: env_spec_w32.h:307
#define FLT_PORT_ALL_ACCESS
Definition: fltkernel.h:836
struct _FLT_SERVER_PORT_OBJECT FLT_SERVER_PORT_OBJECT
struct _FLT_PORT_OBJECT FLT_PORT_OBJECT
#define OBJ_OPENLINK
Definition: winternl.h:230
struct _OBJECT_TYPE_INITIALIZER OBJECT_TYPE_INITIALIZER
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STANDARD_RIGHTS_READ
Definition: nt_native.h:65
#define STANDARD_RIGHTS_WRITE
Definition: nt_native.h:66
#define GENERIC_ALL
Definition: nt_native.h:92
#define STANDARD_RIGHTS_EXECUTE
Definition: nt_native.h:67
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define L(x)
Definition: ntvdm.h:50
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
Definition: oblife.c:1136
VOID NTAPI ObMakeTemporaryObject(IN PVOID ObjectBody)
Definition: oblife.c:1449
#define FILE_DEVICE_WPD
Definition: winioctl.h:168
OB_CLOSE_METHOD CloseProcedure
Definition: obtypes.h:368
GENERIC_MAPPING GenericMapping
Definition: obtypes.h:358
OB_DELETE_METHOD DeleteProcedure
Definition: obtypes.h:369
ULONG DefaultNonPagedPoolCharge
Definition: obtypes.h:365
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213

Referenced by CODE_SEG().