ReactOS 0.4.17-dev-1037-g720d112
ucxstub.c File Reference
#include <ntddk.h>
#include <windef.h>
#include <fxldr.h>
#include <wdf.h>
#include <ucxclass.h>
#include "ucxstub.h"
#include <debug.h>
Include dependency graph for ucxstub.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define UCX_STUB_MAJOR_VERSION   1
 
#define UCX_STUB_MINOR_VERSION   6
 

Functions

 _IRQL_requires_ (PASSIVE_LEVEL)
 Sends a synchronous IOCTL to the specified device object.
 

Variables

WDF_BIND_INFO BindInfo
 
PWDF_DRIVER_GLOBALS WdfDriverGlobals
 
PFN_UCXFUNC UcxFunctions [UcxFunctionTableNumEntries]
 
PUCX_DRIVER_GLOBALS UcxDriverGlobals
 
static WDF_CLASS_BIND_INFO UcxStubClassBindInfo
 
static BOOLEAN UcxStubBound
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 20 of file ucxstub.c.

◆ UCX_STUB_MAJOR_VERSION

#define UCX_STUB_MAJOR_VERSION   1

Definition at line 24 of file ucxstub.c.

◆ UCX_STUB_MINOR_VERSION

#define UCX_STUB_MINOR_VERSION   6

Definition at line 25 of file ucxstub.c.

Function Documentation

◆ _IRQL_requires_()

_IRQL_requires_ ( PASSIVE_LEVEL  )

Sends a synchronous IOCTL to the specified device object.

Parameters
[in]IoControlCodeThe IOCTL to send to the device.
[in]DeviceObjectPointer to the device object that will handle the IOCTL.
[in]InputBufferOptional pointer to a buffer containing input data for the IOCTL. When specified, the buffer should be at least of InputBufferLength size.
[in]InputBufferLengthSize in bytes, of the buffer pointed by InputBuffer.
[out]OutputBufferOptional pointer to a buffer that will receive output data from the IOCTL. When specified, the buffer should be at least of OutputBufferLength size.
[in]OutputBufferLengthSize in bytes, of the buffer pointed by OutputBuffer.
[in]FileObjectOptional pointer to a file object that may be necessary for the IOCTL.
Returns
An NTSTATUS code indicating success or failure of this function.
Note
Must be called at PASSIVE_LEVEL with all APCs enabled.

Lets UCX hook the controller device init. Call before WdfDeviceCreate.

Definition at line 37 of file ucxstub.c.

41{
44
45 PAGED_CODE();
46
47 if (UcxStubBound)
48 return STATUS_SUCCESS;
49
50 RtlZeroMemory(Info, sizeof(*Info));
51 Info->Size = sizeof(*Info);
52 Info->ClassName = (PWCHAR)L"Ucx";
53 Info->Version.Major = UCX_STUB_MAJOR_VERSION;
54 Info->Version.Minor = UCX_STUB_MINOR_VERSION;
55 Info->FunctionTable = UcxFunctions;
56 Info->FunctionTableCount = UcxFunctionTableNumEntries;
57 Info->ClassBindInfo = &UcxDriverGlobals;
58
59 /* Typed as PWDF_COMPONENT_GLOBALS*, but clients pass the globals pointer itself */
61 if (!NT_SUCCESS(Status))
62 {
63 DPRINT1("UCX class bind failed 0x%lx\n", Status);
64 return Status;
65 }
66
68 return STATUS_SUCCESS;
69}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define L(x)
Definition: resources.c:13
Status
Definition: gdiplustypes.h:24
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
@ UcxFunctionTableNumEntries
Definition: ucxfuncenum.h:37
PFN_UCXFUNC UcxFunctions[UcxFunctionTableNumEntries]
Definition: ucxstub.c:31
PWDF_DRIVER_GLOBALS WdfDriverGlobals
Definition: classlib.cpp:132
static BOOLEAN UcxStubBound
Definition: ucxstub.c:35
#define UCX_STUB_MAJOR_VERSION
Definition: ucxstub.c:24
static WDF_CLASS_BIND_INFO UcxStubClassBindInfo
Definition: ucxstub.c:34
#define UCX_STUB_MINOR_VERSION
Definition: ucxstub.c:25
PUCX_DRIVER_GLOBALS UcxDriverGlobals
Definition: ucxstub.c:32
WDF_BIND_INFO BindInfo
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
NTSTATUS NTAPI WdfVersionBindClass(_In_ PWDF_BIND_INFO BindInfo, _Inout_ PWDF_COMPONENT_GLOBALS *Globals, _In_ PWDF_CLASS_BIND_INFO ClassBindInfo)
Definition: wdfldr.c:794

Variable Documentation

◆ BindInfo

◆ UcxDriverGlobals

◆ UcxFunctions

Definition at line 31 of file ucxstub.c.

Referenced by _IRQL_requires_().

◆ UcxStubBound

BOOLEAN UcxStubBound
static

Definition at line 35 of file ucxstub.c.

Referenced by _IRQL_requires_().

◆ UcxStubClassBindInfo

WDF_CLASS_BIND_INFO UcxStubClassBindInfo
static

Definition at line 34 of file ucxstub.c.

Referenced by _IRQL_requires_().

◆ WdfDriverGlobals