From cf993010ffef53a157e46276f7cb5ab7a44f1a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=B6glinger-Stelzer?= Date: Mon, 11 May 2020 14:25:53 +0200 Subject: [PATCH] Fixed PDO WDF context initialization --- sys/EmulationTargetPDO.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/EmulationTargetPDO.cpp b/sys/EmulationTargetPDO.cpp index 2987e8a..707c670 100644 --- a/sys/EmulationTargetPDO.cpp +++ b/sys/EmulationTargetPDO.cpp @@ -23,6 +23,7 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::PdoCreateDevice(WDFDEVICE Device, WDF_OBJECT_ATTRIBUTES attributes; WDF_IO_QUEUE_CONFIG usbInQueueConfig; WDF_IO_QUEUE_CONFIG notificationsQueueConfig; + PEMULATION_TARGET_PDO_CONTEXT pPdoContext; DECLARE_CONST_UNICODE_STRING(deviceLocation, L"Virtual Gamepad Emulation Bus"); DECLARE_UNICODE_STRING_SIZE(buffer, MAX_INSTANCE_ID_LEN); @@ -179,6 +180,12 @@ NTSTATUS ViGEm::Bus::Core::EmulationTargetPDO::PdoCreateDevice(WDFDEVICE Device, #pragma region Set PDO contexts + // + // Bind this object and device context together + // + pPdoContext = EmulationTargetPdoGetContext(this->PdoDevice); + pPdoContext->Target = this; + status = this->PdoInitContext(); if (!NT_SUCCESS(status))