@@ -79,10 +79,6 @@ EVT_IDD_CX_MONITOR_QUERY_TARGET_MODES2 VirtualDisplayDriverEvtIddCxMonitorQueryT
7979EVT_IDD_CX_ADAPTER_COMMIT_MODES2 VirtualDisplayDriverEvtIddCxAdapterCommitModes2;
8080
8181EVT_IDD_CX_MONITOR_SET_GAMMA_RAMP VirtualDisplayDriverEvtIddCxMonitorSetGammaRamp;
82- EVT_IDD_CX_DEVICE_IO_CONTROL MttVddEvtIoDeviceControl;
83-
84- // Forward declaration for IOCTL queue setup function
85- NTSTATUS SetupIoctlQueue (WDFDEVICE Device);
8682
8783struct
8884{
@@ -156,7 +152,16 @@ const char* XorCursorSupportLevelToString(IDDCX_XOR_CURSOR_SUPPORT level) {
156152
157153vector<unsigned char > Microsoft::IndirectDisp::IndirectDeviceContext::s_KnownMonitorEdid; // Changed to support static vector
158154
155+ struct IndirectDeviceContextWrapper
156+ {
157+ IndirectDeviceContext* pContext;
159158
159+ void Cleanup ()
160+ {
161+ delete pContext;
162+ pContext = nullptr ;
163+ }
164+ };
160165void LogQueries (const char * severity, const std::wstring& xmlName) {
161166 if (xmlName.find (L" logging" ) == std::wstring::npos) {
162167 int size_needed = WideCharToMultiByte (CP_UTF8, 0 , xmlName.c_str (), (int )xmlName.size (), NULL , 0 , NULL , NULL );
@@ -629,6 +634,10 @@ void InitializeD3DDeviceAndLogGPU() {
629634 vddlog (" i" , logtext.c_str ());
630635}
631636
637+
638+ // This macro creates the methods for accessing an IndirectDeviceContextWrapper as a context for a WDF object
639+ WDF_DECLARE_CONTEXT_TYPE (IndirectDeviceContextWrapper);
640+
632641extern " C" BOOL WINAPI DllMain (
633642 _In_ HINSTANCE hInstance,
634643 _In_ UINT dwReason,
@@ -1774,9 +1783,6 @@ NTSTATUS VirtualDisplayDriverDeviceAdd(WDFDRIVER Driver, PWDFDEVICE_INIT pDevice
17741783 IddConfig.EvtIddCxMonitorAssignSwapChain = VirtualDisplayDriverMonitorAssignSwapChain;
17751784 IddConfig.EvtIddCxMonitorUnassignSwapChain = VirtualDisplayDriverMonitorUnassignSwapChain;
17761785
1777- // Enable IOCTL handling
1778- IddConfig.EvtIddCxDeviceIoControl = MttVddEvtIoDeviceControl;
1779-
17801786 if (IDD_IS_FIELD_AVAILABLE (IDD_CX_CLIENT_CONFIG, EvtIddCxAdapterQueryTargetInfo))
17811787 {
17821788 IddConfig.EvtIddCxAdapterQueryTargetInfo = VirtualDisplayDriverEvtIddCxAdapterQueryTargetInfo;
0 commit comments