Fixed issue with ViGEm::Bus::Core::EmulationTargetPDO::EnqueueWaitDeviceReady not reporting online children

This commit is contained in:
Benjamin Höglinger-Stelzer
2020-11-03 17:03:13 +01:00
parent 27555457a7
commit 1a401ff65b
11 changed files with 29 additions and 2 deletions

9
sys/Debugging.hpp Normal file
View File

@@ -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

View File

@@ -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;

View File

@@ -40,6 +40,8 @@
#define NTSTRSAFE_LIB
#include <ntstrsafe.h>
#include "Debugging.hpp"
PCWSTR ViGEm::Bus::Targets::EmulationTargetDS4::_deviceDescription = L"Virtual DualShock 4 Controller";

View File

@@ -42,6 +42,8 @@
#include <usbioctl.h>
#include <usbiodef.h>
#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(

View File

@@ -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;

View File

@@ -190,6 +190,7 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\sdk\include\ViGEm\km\BusShared.h" />
<ClInclude Include="Debugging.hpp" />
<ClInclude Include="Driver.h" />
<ClInclude Include="CRTCPP.hpp" />
<ClInclude Include="Ds4Pdo.hpp" />

View File

@@ -57,6 +57,9 @@
<ClInclude Include="..\sdk\include\ViGEm\km\BusShared.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Debugging.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="XusbPdo.cpp">

View File

@@ -40,6 +40,8 @@
#include <ntstrsafe.h>
#include "Driver.h"
#include "Debugging.hpp"
PCWSTR ViGEm::Bus::Targets::EmulationTargetXUSB::_deviceDescription = L"Virtual Xbox 360 Controller";

View File

@@ -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)

View File

@@ -36,6 +36,8 @@
#include "Driver.h"
#include "EmulationTargetPDO.hpp"
#include "Debugging.hpp"
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, Bus_EvtDeviceListCreatePdo)
#endif

View File

@@ -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
//