ReactOS 0.4.17-dev-1371-g303d27d
classlib.cpp File Reference
#include "ucx01000.h"
#include <debug.h>
Include dependency graph for classlib.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static ULONG NTAPI UcxTableEntriesForMinor (_In_ ULONG Minor)
 
 _IRQL_requires_ (PASSIVE_LEVEL) NTSTATUS NTAPI UcxOnClassLoad(VOID)
 Sends a synchronous IOCTL to the specified device object.
 
 PAGED_CODE ()
 
 if (ClientGlobals==NULL)
 
 if (ClassBindInfo->Version.Major !=UCX_CLASS_MAJOR_VERSION||Minor > UCX_CLASS_MINOR_VERSION)
 
 if (ClassBindInfo->FunctionTableCount !=UcxTableEntriesForMinor(Minor))
 
 RtlCopyMemory (ClassBindInfo->FunctionTable, UcxExportTable, ClassBindInfo->FunctionTableCount *sizeof(UcxExportTable[0]))
 
 if (Globals==NULL)
 
 DPRINT ("Bound UCX 1.%lu client, globals %p\n", Minor, Globals)
 
 UNREFERENCED_PARAMETER (ComponentGlobals)
 
 DPRINT ("Unbinding client globals %p\n", *ClientGlobals)
 

Variables

WDF_CLASS_LIBRARY_INFO UcxClassLibraryInfo
 
_Outptr_ PWDF_COMPONENT_GLOBALS * ComponentGlobals
 
PUCX_DRIVER_GLOBALS Globals = (PUCX_DRIVER_GLOBALS)ExAllocatePoolZero(NonPagedPool, sizeof(*Globals), UCX_POOL_TAG)
 
ULONG Minor = ClassBindInfo->Version.Minor
 
 ClientGlobals = (PUCX_DRIVER_GLOBALS *)ClassBindInfo->ClassBindInfo
 
Globals Size = sizeof(*Globals)
 
Globals WdfDriverGlobals = (PWDF_DRIVER_GLOBALS)ComponentGlobals
 
return STATUS_SUCCESS
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file classlib.cpp.

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.

Definition at line 42 of file classlib.cpp.

46{
47 PAGED_CODE();
48
49 DPRINT("Class library initialize\n");
51 return STATUS_SUCCESS;
52}
PAGED_CODE()
return STATUS_SUCCESS
Definition: classlib.cpp:118
VOID NTAPI UcxBuildExportTable(VOID)
Definition: exports.cpp:353
#define DPRINT
Definition: sndvol32.h:73

◆ DPRINT() [1/2]

DPRINT ( "Bound UCX 1.%lu  client,
globals %p\n"  ,
Minor  ,
Globals   
)

◆ DPRINT() [2/2]

DPRINT ( "Unbinding client globals %p\n"  ,
*  ClientGlobals 
)

◆ if() [1/4]

if ( ClassBindInfo->FunctionTableCount !  = UcxTableEntriesForMinor(Minor))

Definition at line 95 of file classlib.cpp.

96 {
97 DPRINT1("UCX 1.%lu client has %lu table slots\n", Minor, ClassBindInfo->FunctionTableCount);
99 }
#define DPRINT1
Definition: precomp.h:8
ULONG Minor
Definition: classlib.cpp:73
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135

◆ if() [2/4]

if ( ClassBindInfo->Version.Major !  = UCX_CLASS_MAJOR_VERSION || Minor,
UCX_CLASS_MINOR_VERSION   
)

Definition at line 88 of file classlib.cpp.

89 {
90 DPRINT1("Client wants UCX %lu.%lu, have %u.%u\n",
91 ClassBindInfo->Version.Major, Minor, UCX_CLASS_MAJOR_VERSION, UCX_CLASS_MINOR_VERSION);
93 }
#define UCX_CLASS_MAJOR_VERSION
Definition: ucx01000.h:43
#define UCX_CLASS_MINOR_VERSION
Definition: ucx01000.h:44

◆ if() [3/4]

if ( ClientGlobals  = =NULL)

Definition at line 78 of file classlib.cpp.

79 {
80 DPRINT1("Client bind info %p has no globals slot\n", ClassBindInfo);
82 }

◆ if() [4/4]

if ( Globals  = = NULL)

Definition at line 107 of file classlib.cpp.

108 {
109 DPRINT1("Client globals allocation failed\n");
111 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ PAGED_CODE()

PAGED_CODE ( )

Referenced by _IRQL_requires_().

◆ RtlCopyMemory()

RtlCopyMemory ( ClassBindInfo->  FunctionTable,
UcxExportTable  ,
ClassBindInfo->FunctionTableCount *  sizeofUcxExportTable[0] 
)

◆ UcxTableEntriesForMinor()

static ULONG NTAPI UcxTableEntriesForMinor ( _In_ ULONG  Minor)
static

Definition at line 29 of file classlib.cpp.

31{
32 if (Minor >= 4)
34
35 /* SetIdStrings arrived in 1.3 */
36 if (Minor == 3)
38
40}
@ UcxControllerSetIdStringsTableIndex
Definition: ucxfuncenum.h:35
@ UcxFunctionTableNumEntries
Definition: ucxfuncenum.h:37
@ UcxInitializeDeviceInitTableIndex
Definition: ucxfuncenum.h:34

◆ UNREFERENCED_PARAMETER()

UNREFERENCED_PARAMETER ( ComponentGlobals  )

Variable Documentation

◆ ClientGlobals

* ClientGlobals = (PUCX_DRIVER_GLOBALS *)ClassBindInfo->ClassBindInfo

Definition at line 77 of file classlib.cpp.

Referenced by WdfVersionBindClass().

◆ ComponentGlobals

_In_ PWDF_COMPONENT_GLOBALS * ComponentGlobals
Initial value:
{
ClientGlobals
Definition: classlib.cpp:77
WDF_EXTERN_C_START struct _UCX_DRIVER_GLOBALS * PUCX_DRIVER_GLOBALS

Definition at line 69 of file classlib.cpp.

Referenced by WdfVersionBind(), and WdfVersionUnbind().

◆ Globals

Definition at line 72 of file classlib.cpp.

◆ Minor

◆ Size

Definition at line 113 of file classlib.cpp.

◆ STATUS_SUCCESS

return STATUS_SUCCESS

Definition at line 118 of file classlib.cpp.

Referenced by _IRQL_requires_().

◆ UcxClassLibraryInfo

WDF_CLASS_LIBRARY_INFO UcxClassLibraryInfo
Initial value:
=
{
UcxOnClassLoad,
UcxOnClassUnload,
UcxOnClientBind,
UcxOnClientUnbind
}
WDF_CLASS_LIBRARY_INFO UcxClassLibraryInfo
Definition: classlib.cpp:15

Definition at line 15 of file classlib.cpp.

◆ WdfDriverGlobals