111 (
PVOID *)&PortObject);
248 Irp->IoStatus.Information = 0;
280 Irp->IoStatus.Information = 0;
350 if (PortObject->Disconnected ==
FALSE)
353 KeSetEvent(&PortObject->DisconnectEvent, 0, 0);
358 PortObject->Disconnected =
TRUE;
483 &
Irp->Tail.Overlay.ListEntry);
523 NextEntry =
Irp->Tail.Overlay.ListEntry.
Flink;
552 NextEntry = NextEntry->
Flink;
608 Irp->IoStatus.Information = 0;
631 FilterPortData =
Irp->AssociatedIrp.SystemBuffer;
641 (
PVOID *)&ServerPortObject);
671 (
PVOID *)&ClientPortObject);
685 ClientPortObject->
ServerPort = ServerPortObject;
707 ClientPortObject =
NULL;
720 &ClientPortObject->
Cookie);
740 if (ClientPortObject)
749 else if (ServerPortObject)
792 FltpAcquireMessageWaiterLock,
793 FltpReleaseMessageWaiterLock,
803 MsgWaiterQueue->WaiterQ.mCount = 0;
806 MsgWaiterQueue->MinimumWaiterLength = (
ULONG)-1;
826 PortCCB->
Port = PortObject;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
static const INTERNET_PORT ServerPort
VOID NTAPI FltpServerPortDelete(PVOID Object)
static NTSTATUS CreateClientPort(_In_ PFILE_OBJECT FileObject, _Inout_ PIRP Irp)
NTSTATUS FltpSetupCommunicationObjects(_In_ PDRIVER_OBJECT DriverObject)
UNICODE_STRING CommsDeviceName
NTSTATUS NTAPI FltpAddMessageWaiter(_In_ PIO_CSQ Csq, _In_ PIRP Irp, _In_ PVOID InsertContext)
PDEVICE_OBJECT CommsDeviceObject
VOID NTAPI FltpClientPortDelete(PVOID Object)
POBJECT_TYPE ClientPortObjectType
NTSTATUS FltpMsgCreate(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
POBJECT_TYPE ServerPortObjectType
static NTSTATUS CloseClientPort(_In_ PFILE_OBJECT FileObject, _Inout_ PIRP Irp)
static BOOLEAN FltpDisconnectPort(_In_ PFLT_PORT_OBJECT PortObject)
NTSTATUS FltpMsgDispatch(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
PIRP NTAPI FltpGetNextMessageWaiter(_In_ PIO_CSQ Csq, _In_ PIRP Irp, _In_ PVOID PeekContext)
VOID NTAPI FltpServerPortClose(_In_opt_ PEPROCESS Process, _In_ PVOID Object, _In_ ACCESS_MASK GrantedAccess, _In_ ULONG ProcessHandleCount, _In_ ULONG SystemHandleCount)
VOID NTAPI FltpClientPortClose(_In_opt_ PEPROCESS Process, _In_ PVOID Object, _In_ ACCESS_MASK GrantedAccess, _In_ ULONG ProcessHandleCount, _In_ ULONG SystemHandleCount)
VOID NTAPI FltpRemoveMessageWaiter(_In_ PIO_CSQ Csq, _In_ PIRP Irp)
static PPORT_CCB CreatePortCCB(_In_ PFLT_PORT_OBJECT PortObject)
VOID NTAPI FltpCancelMessageWaiter(_In_ PIO_CSQ Csq, _In_ PIRP Irp)
static NTSTATUS InitializeMessageWaiterQueue(_Inout_ PFLT_MESSAGE_WAITER_QUEUE MsgWaiterQueue)
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
#define InterlockedIncrement
#define InterlockedDecrement
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define _Acquires_lock_(lock)
#define _Releases_lock_(lock)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
_In_ PIRP _In_ PVOID InsertContext
_In_opt_ PIRP _In_opt_ PVOID PeekContext
NTKERNELAPI NTSTATUS NTAPI IoCsqInitializeEx(_Out_ PIO_CSQ Csq, _In_ PIO_CSQ_INSERT_IRP_EX CsqInsertIrpEx, _In_ PIO_CSQ_REMOVE_IRP CsqRemoveIrp, _In_ PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, _In_ PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, _In_ PIO_CSQ_RELEASE_LOCK CsqReleaseLock, _In_ PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp)
Set up a CSQ struct to initialize the queue (extended version)
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
#define _IRQL_requires_max_(irql)
#define _IRQL_requires_(irql)
#define _IRQL_raises_(irql)
#define _IRQL_saves_global_(kind, param)
#define _IRQL_restores_global_(kind, param)
static PVOID Mapping[EMS_PHYSICAL_PAGES]
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
#define InitializeListHead(ListHead)
#define ExGetPreviousMode
#define ExInitializeRundownProtection
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG SenderBufferLength
_Outptr_ PFLT_PORT * ClientPort
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG _Out_writes_bytes_opt_ ReplyLength PVOID ReplyBuffer
VOID(FLTAPI * PFLT_DISCONNECT_NOTIFY)(_In_opt_ PVOID ConnectionCookie)
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
NTSTATUS(FLTAPI * PFLT_MESSAGE_NOTIFY)(_In_opt_ PVOID PortCookie, _In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer, _In_ ULONG InputBufferLength, _Out_writes_bytes_to_opt_(OutputBufferLength, *ReturnOutputBufferLength) PVOID OutputBuffer, _In_ ULONG OutputBufferLength, _Out_ PULONG ReturnOutputBufferLength)
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY _In_opt_ PFLT_MESSAGE_NOTIFY MessageNotifyCallback
#define FLT_PORT_ALL_ACCESS
struct _FLT_PORT * PFLT_PORT
NTSTATUS(FLTAPI * PFLT_CONNECT_NOTIFY)(_In_ PFLT_PORT ClientPort, _In_opt_ PVOID ServerPortCookie, _In_reads_bytes_opt_(SizeOfContext) PVOID ConnectionContext, _In_ ULONG SizeOfContext, _Outptr_result_maybenull_ PVOID *ConnectionPortCookie)
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
_Must_inspect_result_ _In_ PFLT_PORT _In_ ULONG _Out_writes_bytes_opt_ ReplyLength PVOID _Inout_opt_ PULONG ReplyLength
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
VOID FltpObjectPointerDereference(_In_ PFLT_OBJECT Object)
struct _FLT_SERVER_PORT_OBJECT * PFLT_SERVER_PORT_OBJECT
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
struct _FLT_SERVER_PORT_OBJECT FLT_SERVER_PORT_OBJECT
struct _FLT_PORT_OBJECT * PFLT_PORT_OBJECT
struct _FLT_PORT_OBJECT FLT_PORT_OBJECT
struct _FLT_CCB * PFLT_CCB
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
#define OBJ_KERNEL_HANDLE
static LONG MaxConnections
#define ExFreePoolWithTag(_P, _T)
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
struct _OBJECT_TYPE_INITIALIZER OBJECT_TYPE_INITIALIZER
#define _In_reads_bytes_(s)
#define _Out_writes_bytes_opt_(s)
#define _Must_inspect_result_
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STANDARD_RIGHTS_READ
#define STANDARD_RIGHTS_ALL
#define STANDARD_RIGHTS_WRITE
#define STANDARD_RIGHTS_EXECUTE
#define UNREFERENCED_PARAMETER(P)
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)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
#define STATUS_CONNECTION_COUNT_LIMIT
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
VOID NTAPI ObMakeTemporaryObject(IN PVOID ObjectBody)
NTSTATUS NTAPI ObReferenceObjectByName(IN PUNICODE_STRING ObjectPath, IN ULONG Attributes, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext, OUT PVOID *ObjectPtr)
VOID NTAPI KeInitializeSemaphore(IN PKSEMAPHORE Semaphore, IN LONG Count, IN LONG Limit)
FLT_MUTEX_LIST_HEAD PortList
FLT_MUTEX_LIST_HEAD ConnectionList
FLT_MUTEX_LIST_HEAD WaiterQ
EX_RUNDOWN_REF MsgNotifRundownRef
PFLT_SERVER_PORT_OBJECT ServerPort
FLT_MESSAGE_WAITER_QUEUE MsgQ
PFLT_DISCONNECT_NOTIFY DisconnectNotify
PFLT_MESSAGE_NOTIFY MessageNotify
PFLT_CONNECT_NOTIFY ConnectNotify
struct _LIST_ENTRY * Flink
OB_CLOSE_METHOD CloseProcedure
GENERIC_MAPPING GenericMapping
OB_DELETE_METHOD DeleteProcedure
ULONG DefaultNonPagedPoolCharge
FLT_MUTEX_LIST_HEAD ReplyWaiterList
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
#define ObDereferenceObject
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess