Initial commit
This commit is contained in:
20
src/Dmf.props
Normal file
20
src/Dmf.props
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_PropertySheetDisplayName>Driver Module Framework</_PropertySheetDisplayName>
|
||||
<!-- By default, look for DMF in parent root directory, otherwise use environment variable value -->
|
||||
<DmfRootPath Condition="'$(DmfRootPath)' == ''">$(SolutionDir)..\</DmfRootPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(DmfRootPath)\DMF\Modules.Library;$(DmfRootPath)\DMF\Modules.Template;$(DmfRootPath)\DMF\Modules.Library.Tests;$(DmfRootPath)\DMF\Framework;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies Condition="'$(DriverType)'=='KMDF'">$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfK\DmfK.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfKModules.Template\DmfKModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
|
||||
<AdditionalDependencies Condition="'$(DriverType)'=='UMDF'">$(DmfRootPath)\$(Configuration)\$(PlatformName)\lib\DmfU\DmfU.lib;$(DmfRootPath)\$(Configuration)\$(PlatformName)\individual_libs\DmfUModules.Template\DmfUModules.Template.lib;%(AdditionalDependencies);</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup />
|
||||
</Project>
|
155
src/DmfBusFilterExtension.vcxproj
Normal file
155
src/DmfBusFilterExtension.vcxproj
Normal file
@ -0,0 +1,155 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D384918D-A356-4325-B8DD-A2A10E4592A0}</ProjectGuid>
|
||||
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
|
||||
<RootNamespace>DmfBusFilterExtension</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<DriverType>KMDF</DriverType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="DMF.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WppEnabled>true</WppEnabled>
|
||||
<WppScanConfigurationData>Trace.h</WppScanConfigurationData>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<FilesToPackage Include="$(TargetPath)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Dmf_BusFilter.h" />
|
||||
<ClInclude Include="Trace.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dmf_BusFilter.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
34
src/DmfBusFilterExtension.vcxproj.filters
Normal file
34
src/DmfBusFilterExtension.vcxproj.filters
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Driver Files">
|
||||
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
|
||||
<Extensions>inf;inv;inx;mof;mc;</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Dmf_BusFilter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Trace.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Dmf_BusFilter.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
1211
src/Dmf_BusFilter.c
Normal file
1211
src/Dmf_BusFilter.c
Normal file
File diff suppressed because it is too large
Load Diff
198
src/Dmf_BusFilter.h
Normal file
198
src/Dmf_BusFilter.h
Normal file
@ -0,0 +1,198 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) Nefarius Software Solutions e.U. All rights reserved.
|
||||
Licensed under the MIT license.
|
||||
|
||||
Module Name:
|
||||
|
||||
Dmf_BusFilter.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Companion file to Dmf_BusFilter.c.
|
||||
|
||||
Environment:
|
||||
|
||||
Kernel-mode Driver Framework
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Bus Filter support
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
#if defined(DMF_KERNEL_MODE)
|
||||
|
||||
// Declare an opaque handle representing a filtered PDO.
|
||||
//
|
||||
DECLARE_HANDLE(DMFBUSCHILDDEVICE);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_PreBusDeviceAdd)
|
||||
_IRQL_requires_same_
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
NTSTATUS
|
||||
EVT_DMF_BusFilter_PreBusDeviceAdd(
|
||||
_In_ WDFDRIVER Driver,
|
||||
_Inout_ PWDFDEVICE_INIT DeviceInit,
|
||||
_Out_ WDF_OBJECT_ATTRIBUTES* Attributes,
|
||||
_Outptr_result_maybenull_ PDMFDEVICE_INIT* DmfDeviceInit
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_PostBusDeviceAdd)
|
||||
_IRQL_requires_same_
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
NTSTATUS
|
||||
EVT_DMF_BusFilter_PostBusDeviceAdd(
|
||||
_In_ WDFDEVICE Device,
|
||||
_In_opt_ PDMFDEVICE_INIT DmfDeviceInit
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceAdd)
|
||||
_IRQL_requires_max_(APC_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
NTSTATUS
|
||||
EVT_DMF_BusFilter_DeviceAdd(
|
||||
_In_ WDFDEVICE Device,
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceRemove)
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
VOID
|
||||
EVT_DMF_BusFilter_DeviceRemove(
|
||||
_In_ WDFDEVICE Device,
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceStarted)
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
VOID
|
||||
EVT_DMF_BusFilter_DeviceStarted(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice,
|
||||
_In_ IRP* Irp
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceEnumerated)
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
VOID
|
||||
EVT_DMF_BusFilter_DeviceEnumerated(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice,
|
||||
_In_ IRP* Irp
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceQueryId)
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
BOOLEAN
|
||||
EVT_DMF_BusFilter_DeviceQueryId(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice,
|
||||
_In_ IRP* Irp
|
||||
);
|
||||
|
||||
typedef
|
||||
_Function_class_(EVT_DMF_BusFilter_DeviceQueryInterface)
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_IRQL_requires_same_
|
||||
BOOLEAN
|
||||
EVT_DMF_BusFilter_DeviceQueryInterface(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice,
|
||||
_In_ IRP* Irp
|
||||
);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// The driver object.
|
||||
//
|
||||
_In_ DRIVER_OBJECT* DriverObject;
|
||||
|
||||
// The device type.
|
||||
//
|
||||
_In_ DEVICE_TYPE DeviceType;
|
||||
|
||||
// The device characteristics.
|
||||
//
|
||||
_In_ ULONG DeviceCharacteristics;
|
||||
|
||||
// Called before bus device object is created.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_PreBusDeviceAdd* EvtPreBusDeviceAdd;
|
||||
|
||||
// Called after bus device object was created.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_PostBusDeviceAdd* EvtPostBusDeviceAdd;
|
||||
|
||||
// Called when child proxy device was created.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceAdd* EvtDeviceAdd;
|
||||
|
||||
// Called when child proxy device gets removed.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceRemove* EvtDeviceRemove;
|
||||
|
||||
// Called when IRP_MN_START_DEVICE is set to child device.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceStarted* EvtDeviceStarted;
|
||||
|
||||
// Called when IRP_MN_DEVICE_ENUMERATED is sent to child device.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceEnumerated* EvtDeviceEnumerated;
|
||||
|
||||
// Called when IRP_MN_QUERY_ID is sent to child device.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceQueryId* EvtDeviceQueryId;
|
||||
|
||||
// Called when IRP_MN_QUERY_INTERFACE is sent to child device.
|
||||
//
|
||||
_In_opt_ EVT_DMF_BusFilter_DeviceQueryInterface* EvtDeviceQueryInterface;
|
||||
} DMF_BusFilter_CONFIG;
|
||||
|
||||
__forceinline
|
||||
VOID
|
||||
DMF_BusFilter_CONFIG_INIT(
|
||||
_Out_ DMF_BusFilter_CONFIG* BusFilterConfig,
|
||||
_In_ PDRIVER_OBJECT DriverObject
|
||||
)
|
||||
{
|
||||
RtlZeroMemory(BusFilterConfig,
|
||||
sizeof(DMF_BusFilter_CONFIG));
|
||||
BusFilterConfig->DriverObject = DriverObject;
|
||||
}
|
||||
|
||||
_IRQL_requires_max_(PASSIVE_LEVEL)
|
||||
_Must_inspect_result_
|
||||
NTSTATUS
|
||||
DMF_BusFilter_Initialize(
|
||||
_In_ DMF_BusFilter_CONFIG* BusFilterConfig
|
||||
);
|
||||
|
||||
EVT_WDF_DRIVER_DEVICE_ADD DMF_BusFilter_DeviceAdd;
|
||||
|
||||
PDEVICE_OBJECT
|
||||
DMF_BusFilter_WdmDeviceObjectGet(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice
|
||||
);
|
||||
|
||||
PDEVICE_OBJECT
|
||||
DMF_BusFilter_WdmAttachedDeviceGet(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice
|
||||
);
|
||||
|
||||
PDEVICE_OBJECT
|
||||
DMF_BusFilter_WdmPhysicalDeviceGet(
|
||||
_In_ DMFBUSCHILDDEVICE ChildDevice
|
||||
);
|
||||
|
||||
#endif // defined(DMF_KERNEL_MODE)
|
54
src/Trace.h
Normal file
54
src/Trace.h
Normal file
@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
// From DmfTrace.h.
|
||||
// ----------------
|
||||
//
|
||||
|
||||
#define WPP_FLAG_LEVEL_LOGGER(flag, level) \
|
||||
WPP_LEVEL_LOGGER(flag)
|
||||
|
||||
#define WPP_FLAG_LEVEL_ENABLED(flag, level) \
|
||||
(WPP_LEVEL_ENABLED(flag) && \
|
||||
WPP_CONTROL(WPP_BIT_ ## flag).Level >= level)
|
||||
|
||||
#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) \
|
||||
WPP_LEVEL_LOGGER(flags)
|
||||
|
||||
#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \
|
||||
(WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl)
|
||||
|
||||
//
|
||||
// This comment block is scanned by the trace preprocessor to define our
|
||||
// Trace function.
|
||||
//
|
||||
// USEPREFIX and USESUFFIX strip all trailing whitespace, so we need to surround
|
||||
// FuncExit messages with brackets
|
||||
//
|
||||
// begin_wpp config
|
||||
// FUNC Trace{FLAG=MYDRIVER_ALL_INFO}(LEVEL, MSG, ...);
|
||||
// FUNC TraceEvents(LEVEL, FLAGS, MSG, ...);
|
||||
// FUNC FuncEntry{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS);
|
||||
// FUNC FuncEntryArguments{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS, MSG, ...);
|
||||
// FUNC FuncExit{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS, MSG, ...);
|
||||
// FUNC FuncExitVoid{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS);
|
||||
// FUNC TraceError{LEVEL=TRACE_LEVEL_ERROR}(FLAGS, MSG, ...);
|
||||
// FUNC TraceWarning{LEVEL=TRACE_LEVEL_WARNING}(FLAGS, MSG, ...);
|
||||
// FUNC TraceInformation{LEVEL=TRACE_LEVEL_INFORMATION}(FLAGS, MSG, ...);
|
||||
// FUNC TraceVerbose{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS, MSG, ...);
|
||||
// FUNC FuncExitNoReturn{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS);
|
||||
// USEPREFIX(FuncEntry, "%!STDPREFIX! [%!FUNC!] --> Entry");
|
||||
// USEPREFIX(FuncEntryArguments, "%!STDPREFIX! [%!FUNC!] --> Entry <");
|
||||
// USEPREFIX(FuncExit, "%!STDPREFIX! [%!FUNC!] <-- Exit <");
|
||||
// USESUFFIX(FuncExit, ">");
|
||||
// USEPREFIX(FuncExitVoid, "%!STDPREFIX! [%!FUNC!] <-- Exit");
|
||||
// USEPREFIX(TraceError, "%!STDPREFIX! [%!FUNC!] ERROR:");
|
||||
// USEPREFIX(TraceWarning, "%!STDPREFIX! [%!FUNC!] WARNING:");
|
||||
// USEPREFIX(TraceEvents, "%!STDPREFIX! [%!FUNC!] ");
|
||||
// USEPREFIX(TraceInformation, "%!STDPREFIX! [%!FUNC!] ");
|
||||
// USEPREFIX(TraceVerbose, "%!STDPREFIX! [%!FUNC!] ");
|
||||
// USEPREFIX(FuncExitNoReturn, "%!STDPREFIX! [%!FUNC!] <--");
|
||||
// CUSTOM_TYPE(SMFX_MACHINE_EXCEPTION, ItemEnum(StateMachine_MachineException));
|
||||
// CUSTOM_TYPE(SMFX_TRANSITION_TYPE, ItemEnum(StateMachine_TransitionType));
|
||||
// CUSTOM_TYPE(COMPONENT_FIRMWARE_UPDATE_V2_EVENT, ItemEnum(ComponentFirmwareUpdateV2EventId));
|
||||
// CUSTOM_TYPE(COMPONENT_FIRMWARE_UPDATE_V2_STATE, ItemEnum(ComponentFirmwareUpdateV2StateId));
|
||||
// end_wpp
|
Reference in New Issue
Block a user