HW_INITIALIZE_TRACING - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// storport.h

HW_INITIALIZE_TRACING HwInitializeTracing;

VOID HwInitializeTracing(
  PVOID Arg1,
  PVOID Arg2
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-storport-hw_initialize_tracing)

HW_INITIALIZE_TRACING callback function

Description

The HwStorInitializeTracing callback routine allows the Storport virtual miniport driver to set up tracing and any related resources.

Parameters

Arg1

The first parameter that is passed to StorPortInitialize.

Arg2

The second parameter that is passed to StorPortInitialize.

Remarks

The name HwStorInitializeTracing is placeholder text for the actual routine name. The actual prototype of this routine is defined in Storport.h as follows:

typedef
VOID
HW_INITIALIZE_TRACING (
  _In_ PVOID  Arg1,
  _In_ PVOID  Arg2
  );

The port driver calls the Storport virtual miniport's HwStorInitializeTracing at PASSIVE_LEVEL.

Examples

To define an HwStorInitializeTracing callback function, you must first provide a function declaration that identifies the type of callback function you’re defining. Windows provides a set of callback function types for drivers. Declaring a function using the callback function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it’s a requirement for writing drivers for the Windows operating system.

For example, to define a HwStorInitializeTracing callback routine that is named MyHwInitializeTracing, use the HW_INITIALIZE_TRACING type as shown in this code example:

HW_INITIALIZE_TRACING MyHwInitializeTracing;

Then, implement your callback routine as follows:

_Use_decl_annotations_
VOID
MyHwInitializeTracing (
  _In_ PVOID  Arg1,
  _In_ PVOID  Arg2
  );
  {
      ...
  }

The HW_INITIALIZE_TRACING function type is defined in the Storport.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the HW_INITIALIZE_TRACING function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions Using Function Role Types for Storport Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.