2023-04-09 02:16:33 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
#include <wdf.h>
|
|
|
|
#include <IddCx.h>
|
2023-04-09 19:36:00 +00:00
|
|
|
#include "CIVSHMEM.h"
|
2023-04-09 02:16:33 +00:00
|
|
|
|
|
|
|
class CIndirectDeviceContext
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
WDFDEVICE m_wdfDevice;
|
|
|
|
IDDCX_ADAPTER m_adapter = nullptr;
|
2023-04-09 19:36:00 +00:00
|
|
|
CIVSHMEM m_ivshmem;
|
2023-04-09 02:16:33 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
CIndirectDeviceContext(_In_ WDFDEVICE wdfDevice) :
|
|
|
|
m_wdfDevice(wdfDevice) {};
|
|
|
|
|
|
|
|
virtual ~CIndirectDeviceContext() {};
|
|
|
|
|
|
|
|
void InitAdapter();
|
|
|
|
|
|
|
|
void FinishInit(UINT connectorIndex);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CIndirectDeviceContextWrapper
|
|
|
|
{
|
|
|
|
CIndirectDeviceContext* context;
|
|
|
|
|
|
|
|
void Cleanup()
|
|
|
|
{
|
|
|
|
delete context;
|
|
|
|
context = nullptr;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
WDF_DECLARE_CONTEXT_TYPE(CIndirectDeviceContextWrapper);
|