diff --git a/sys/Debugging.hpp b/sys/Debugging.hpp new file mode 100644 index 0000000..c2a1f4e --- /dev/null +++ b/sys/Debugging.hpp @@ -0,0 +1,9 @@ +// +// Don't compile in verbose tracing on release builds +// +#ifndef DBG +#ifdef TraceDbg +#undef TraceDbg +#define TraceDbg(...) { /* nothing to see here :) */ }; +#endif +#endif diff --git a/sys/Driver.cpp b/sys/Driver.cpp index 8039eb0..342cadf 100644 --- a/sys/Driver.cpp +++ b/sys/Driver.cpp @@ -50,6 +50,8 @@ #include "XusbPdo.hpp" #include "Ds4Pdo.hpp" +#include "Debugging.hpp" + using ViGEm::Bus::Core::PDO_IDENTIFICATION_DESCRIPTION; using ViGEm::Bus::Core::EmulationTargetPDO; using ViGEm::Bus::Targets::EmulationTargetXUSB; diff --git a/sys/Ds4Pdo.cpp b/sys/Ds4Pdo.cpp index dc4636e..bbfb35e 100644 --- a/sys/Ds4Pdo.cpp +++ b/sys/Ds4Pdo.cpp @@ -40,6 +40,8 @@ #define NTSTRSAFE_LIB #include +#include "Debugging.hpp" + PCWSTR ViGEm::Bus::Targets::EmulationTargetDS4::_deviceDescription = L"Virtual DualShock 4 Controller"; diff --git a/sys/EmulationTargetPDO.cpp b/sys/EmulationTargetPDO.cpp index 9d658e2..00a5eac 100644 --- a/sys/EmulationTargetPDO.cpp +++ b/sys/EmulationTargetPDO.cpp @@ -42,6 +42,8 @@ #include #include +#include "Debugging.hpp" + PCWSTR ViGEm::Bus::Core::EmulationTargetPDO::_deviceLocation = L"Virtual Gamepad Emulation Bus"; @@ -796,7 +798,7 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::EnqueueWaitDeviceReady(WDFDEVICE WDF_CHILD_LIST_ITERATOR_INIT( &iterator, - WdfRetrievePendingChildren // might not be online yet + WdfRetrieveAddedChildren // might not be online yet ); WdfChildListBeginIteration( list, @@ -818,6 +820,7 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::EnqueueWaitDeviceReady(WDFDEVICE sizeof(description) ); + // ReSharper disable once CppAssignedValueIsNeverUsed description.SerialNo = SerialNo; status = WdfChildListRetrieveNextDevice( diff --git a/sys/Queue.cpp b/sys/Queue.cpp index ca4d424..9f49a76 100644 --- a/sys/Queue.cpp +++ b/sys/Queue.cpp @@ -40,6 +40,7 @@ #include "XusbPdo.hpp" #include "Ds4Pdo.hpp" +#include "Debugging.hpp" using ViGEm::Bus::Core::PDO_IDENTIFICATION_DESCRIPTION; using ViGEm::Bus::Core::EmulationTargetPDO; diff --git a/sys/ViGEmBus.vcxproj b/sys/ViGEmBus.vcxproj index 4e545fb..9b7a61e 100644 --- a/sys/ViGEmBus.vcxproj +++ b/sys/ViGEmBus.vcxproj @@ -190,6 +190,7 @@ + diff --git a/sys/ViGEmBus.vcxproj.filters b/sys/ViGEmBus.vcxproj.filters index 4da282a..9682a31 100644 --- a/sys/ViGEmBus.vcxproj.filters +++ b/sys/ViGEmBus.vcxproj.filters @@ -57,6 +57,9 @@ Header Files + + Header Files + diff --git a/sys/XusbPdo.cpp b/sys/XusbPdo.cpp index c21bb75..4487725 100644 --- a/sys/XusbPdo.cpp +++ b/sys/XusbPdo.cpp @@ -40,6 +40,8 @@ #include #include "Driver.h" +#include "Debugging.hpp" + PCWSTR ViGEm::Bus::Targets::EmulationTargetXUSB::_deviceDescription = L"Virtual Xbox 360 Controller"; diff --git a/sys/busenum.cpp b/sys/busenum.cpp index c0aa2af..ccad29e 100644 --- a/sys/busenum.cpp +++ b/sys/busenum.cpp @@ -40,6 +40,8 @@ #include "XusbPdo.hpp" #include "Ds4Pdo.hpp" +#include "Debugging.hpp" + #ifdef ALLOC_PRAGMA #pragma alloc_text (PAGE, Bus_PlugInDevice) #pragma alloc_text (PAGE, Bus_UnPlugDevice) diff --git a/sys/buspdo.cpp b/sys/buspdo.cpp index 6140b98..eee3297 100644 --- a/sys/buspdo.cpp +++ b/sys/buspdo.cpp @@ -36,6 +36,8 @@ #include "Driver.h" #include "EmulationTargetPDO.hpp" +#include "Debugging.hpp" + #ifdef ALLOC_PRAGMA #pragma alloc_text(PAGE, Bus_EvtDeviceListCreatePdo) #endif diff --git a/sys/trace.h b/sys/trace.h index 3f5e2bb..aa4d5b6 100644 --- a/sys/trace.h +++ b/sys/trace.h @@ -76,6 +76,6 @@ // begin_wpp config // FUNC Trace{FLAG=MYDRIVER_ALL_INFO}(LEVEL, MSG, ...); // FUNC TraceEvents(LEVEL, FLAGS, MSG, ...); -// FUNC TraceDbg{LEVEL=TRACE_LEVEL_VERBOSE}(FLAGS, MSG, ...); +// FUNC TraceDbg{LEVEL=TRACE_LEVEL_INFORMATION}(FLAGS, MSG, ...); // end_wpp //