mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[host] added IVSHMEM::CreateVectorEvent
This commit is contained in:
parent
215d2c7a4b
commit
941f0f1c16
@ -189,4 +189,31 @@ void * IVSHMEM::GetMemory()
|
||||
m_vectors = static_cast<UINT16>(map.vectors);
|
||||
|
||||
return m_memory;
|
||||
}
|
||||
|
||||
HANDLE IVSHMEM::CreateVectorEvent(UINT16 vector)
|
||||
{
|
||||
if (!m_initialized)
|
||||
return INVALID_HANDLE_VALUE;
|
||||
|
||||
HANDLE event = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
if (event == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DEBUG_ERROR("CreateEvent Failed: %d", GetLastError());
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
IVSHMEM_EVENT msg;
|
||||
msg.event = event;
|
||||
msg.singleShot = false;
|
||||
msg.vector = vector;
|
||||
|
||||
if (!DeviceIoControl(m_handle, IOCTL_IVSHMEM_REGISTER_EVENT, &msg, sizeof(IVSHMEM_EVENT), NULL, 0, NULL, NULL))
|
||||
{
|
||||
DEBUG_ERROR("DeviceIoControl Failed: %d", GetLastError());
|
||||
CloseHandle(event);
|
||||
return INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
return event;
|
||||
}
|
@ -22,6 +22,7 @@ public:
|
||||
UINT16 GetPeerID();
|
||||
UINT16 GetVectors();
|
||||
void * GetMemory();
|
||||
HANDLE CreateVectorEvent(UINT16 vector);
|
||||
|
||||
protected:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user