ReactOS  0.4.15-dev-3017-g1d9542d
aux_klib.h File Reference
#include <ntimage.h>
Include dependency graph for aux_klib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _AUX_MODULE_BASIC_INFO
 
struct  _AUX_MODULE_EXTENDED_INFO
 
struct  _KBUGCHECK_DATA
 

Macros

#define AUX_KLIB_MODULE_PATH_LEN   0x100
 

Typedefs

typedef struct _AUX_MODULE_BASIC_INFO AUX_MODULE_BASIC_INFO
 
typedef struct _AUX_MODULE_BASIC_INFOPAUX_MODULE_BASIC_INFO
 
typedef struct _AUX_MODULE_EXTENDED_INFO AUX_MODULE_EXTENDED_INFO
 
typedef struct _AUX_MODULE_EXTENDED_INFOPAUX_MODULE_EXTENDED_INFO
 
typedef struct _KBUGCHECK_DATA KBUGCHECK_DATA
 
typedef struct _KBUGCHECK_DATAPKBUGCHECK_DATA
 

Functions

NTSTATUS NTAPI AuxKlibInitialize (VOID)
 
 _IRQL_requires_max_ (PASSIVE_LEVEL) NTSTATUS NTAPI AuxKlibQueryModuleInformation(_Inout_ PULONG InformationLength
 
NTSTATUS AuxKlibGetBugCheckData (_Inout_ PKBUGCHECK_DATA BugCheckData)
 
PIMAGE_EXPORT_DIRECTORY AuxKlibGetImageExportDirectory (_In_ PVOID ImageBase)
 
 _Out_writes_bytes_to_opt_ (BufferLength, *ReturnLength) PVOID FirmwareTableBuffer
 

Variables

_In_ ULONG SizePerModule
 
_In_ ULONG _Out_writes_bytes_opt_ InformationLength PAUX_MODULE_EXTENDED_INFO ModuleInfo
 
_In_ ULONG BufferLength
 
_In_ ULONG _Out_opt_ PULONG ReturnLength
 
_In_ ULONG FirmwareTableID
 

Macro Definition Documentation

◆ AUX_KLIB_MODULE_PATH_LEN

#define AUX_KLIB_MODULE_PATH_LEN   0x100

Definition at line 31 of file aux_klib.h.

Typedef Documentation

◆ AUX_MODULE_BASIC_INFO

◆ AUX_MODULE_EXTENDED_INFO

◆ KBUGCHECK_DATA

◆ PAUX_MODULE_BASIC_INFO

◆ PAUX_MODULE_EXTENDED_INFO

◆ PKBUGCHECK_DATA

Function Documentation

◆ _IRQL_requires_max_()

_IRQL_requires_max_ ( PASSIVE_LEVEL  )

Definition at line 64 of file Messaging.c.

75 {
76  PFLT_SERVER_PORT_OBJECT PortObject;
78 
79  /* The caller must allow at least one connection */
80  if (MaxConnections == 0)
81  {
83  }
84 
85  /* The request must be for a kernel handle */
86  if (!(ObjectAttributes->Attributes & OBJ_KERNEL_HANDLE))
87  {
89  }
90 
91  /*
92  * Get rundown protection on the target to stop the owner
93  * from unloading whilst this port object is open. It gets
94  * removed in the FltpServerPortClose callback
95  */
97  if (!NT_SUCCESS(Status))
98  {
99  return Status;
100  }
101 
102  /* Create the server port object for this filter */
106  KernelMode,
107  NULL,
108  sizeof(FLT_SERVER_PORT_OBJECT),
109  0,
110  0,
111  (PVOID *)&PortObject);
112  if (NT_SUCCESS(Status))
113  {
114  /* Zero out the struct */
115  RtlZeroMemory(PortObject, sizeof(FLT_SERVER_PORT_OBJECT));
116 
117  /* Increment the ref count on the target filter */
119 
120  /* Setup the filter port object */
121  PortObject->Filter = Filter;
122  PortObject->ConnectNotify = ConnectNotifyCallback;
124  PortObject->MessageNotify = MessageNotifyCallback;
125  PortObject->Cookie = ServerPortCookie;
126  PortObject->MaxConnections = MaxConnections;
127 
128  /* Insert the object */
129  Status = ObInsertObject(PortObject,
130  NULL,
132  0,
133  NULL,
135  if (NT_SUCCESS(Status))
136  {
137  /* Lock the connection list */
139 
140  /* Add the new port object to the connection list and increment the count */
143 
144  /* Unlock the connection list*/
146  }
147  }
148 
149  if (!NT_SUCCESS(Status))
150  {
151  /* Allow the filter to be cleaned up */
153  }
154 
155  return Status;
156 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _Outptr_ PFLT_PORT * ServerPort
Definition: fltkernel.h:1872
PFLT_CONNECT_NOTIFY ConnectNotify
Definition: fltmgrint.h:191
VOID FLTAPI FltObjectDereference(_Inout_ PVOID Object)
Definition: Object.c:53
LONG NTSTATUS
Definition: precomp.h:26
#define InsertTailList(ListHead, Entry)
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31
ULONG FltpObjectPointerReference(_In_ PFLT_OBJECT Object)
Definition: Object.c:322
LIST_ENTRY mList
Definition: fltmgrint.h:56
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
#define FILE_READ_DATA
Definition: nt_native.h:628
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)
Definition: oblife.c:952
Status
Definition: gdiplustypes.h:24
POBJECT_TYPE ServerPortObjectType
Definition: Messaging.c:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY _In_ PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback
Definition: fltkernel.h:1872
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID _In_ PFLT_CONNECT_NOTIFY ConnectNotifyCallback
Definition: fltkernel.h:1872
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)
Definition: obhandle.c:2931
#define STANDARD_RIGHTS_ALL
Definition: nt_native.h:69
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23
NTSTATUS FLTAPI FltObjectReference(_Inout_ PVOID Object)
Definition: Object.c:41
_Must_inspect_result_ _Outptr_ PFLT_PORT _In_ POBJECT_ATTRIBUTES _In_opt_ PVOID ServerPortCookie
Definition: fltkernel.h:1872
#define NULL
Definition: types.h:112
FAST_MUTEX mLock
Definition: fltmgrint.h:55
PFLT_MESSAGE_NOTIFY MessageNotify
Definition: fltmgrint.h:193
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_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 _In_ LONG MaxConnections
Definition: fltkernel.h:1872
PFLT_DISCONNECT_NOTIFY DisconnectNotify
Definition: fltmgrint.h:192
_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
Definition: fltkernel.h:1872
FLT_MUTEX_LIST_HEAD ConnectionList
Definition: fltmgrint.h:121

◆ _Out_writes_bytes_to_opt_()

_Out_writes_bytes_to_opt_ ( BufferLength  ,
ReturnLength 
)

◆ AuxKlibGetBugCheckData()

NTSTATUS AuxKlibGetBugCheckData ( _Inout_ PKBUGCHECK_DATA  BugCheckData)

Definition at line 178 of file aux_klib.c.

180 {
181  if (BugCheckData->BugCheckDataSize != sizeof(*BugCheckData))
182  {
184  }
185 
186  BugCheckData->BugCheckCode = KiBugCheckData[0];
187  BugCheckData->Parameter1 = KiBugCheckData[1];
188  BugCheckData->Parameter2 = KiBugCheckData[2];
189  BugCheckData->Parameter3 = KiBugCheckData[3];
190  BugCheckData->Parameter4 = KiBugCheckData[4];
191 
192  return STATUS_SUCCESS;
193 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
ULONG_PTR KiBugCheckData[5]
Definition: bug.c:27
static tBugCheckData BugCheckData
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by FxpBugCheckCallbackFilter().

◆ AuxKlibGetImageExportDirectory()

PIMAGE_EXPORT_DIRECTORY AuxKlibGetImageExportDirectory ( _In_ PVOID  ImageBase)

Definition at line 196 of file aux_klib.c.

198 {
199  ULONG size;
201 }
#define TRUE
Definition: types.h:120
GLsizeiptr size
Definition: glext.h:5919
#define RtlImageDirectoryEntryToData
Definition: compat.h:668
#define IMAGE_DIRECTORY_ENTRY_EXPORT
Definition: compat.h:151
unsigned int ULONG
Definition: retypes.h:1

◆ AuxKlibInitialize()

NTSTATUS NTAPI AuxKlibInitialize ( VOID  )

Definition at line 26 of file aux_klib.c.

27 {
28  RTL_OSVERSIONINFOW osVersion;
29  UNICODE_STRING strRtlQueryModuleInformation = RTL_CONSTANT_STRING(L"RtlQueryModuleInformation");
30 
31  PAGED_CODE();
32 
33  if (!gKlibInitialized)
34  {
35  RtlGetVersion(&osVersion);
36  if (osVersion.dwMajorVersion >= 5)
37  {
38  pfnRtlQueryModuleInformation = MmGetSystemRoutineAddress(&strRtlQueryModuleInformation);
40  }
41  else
42  {
43  return STATUS_NOT_SUPPORTED;
44  }
45  }
46 
47  return STATUS_SUCCESS;
48 }
LONG gKlibInitialized
Definition: aux_klib.c:20
return STATUS_NOT_SUPPORTED
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
PFN_RTLQUERYMODULEINFORMATION pfnRtlQueryModuleInformation
Definition: aux_klib.c:19
PVOID NTAPI MmGetSystemRoutineAddress(IN PUNICODE_STRING SystemRoutineName)
Definition: sysldr.c:3514
ULONG dwMajorVersion
Definition: rtltypes.h:247
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedExchange
Definition: armddk.h:54
#define STATUS_SUCCESS
Definition: shellext.h:65
#define PAGED_CODE()
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Referenced by FxpGetImageBase().

Variable Documentation

◆ BufferLength

Definition at line 82 of file aux_klib.h.

◆ FirmwareTableID

_In_ ULONG FirmwareTableID

◆ ModuleInfo

◆ ReturnLength

Definition at line 82 of file aux_klib.h.

◆ SizePerModule

_In_ ULONG SizePerModule

Definition at line 64 of file aux_klib.h.

Referenced by AuxKlibQueryModuleInformation().