コード例 #1
0
void CVirtQueue::Renew()
{
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)m_IODevice->DeviceContext;

    pContext->pPageAllocator = &m_SharedMemory;
    NTSTATUS status = virtio_find_queue(
        m_IODevice,
        m_Index,
        &m_VirtQueue);
    pContext->pPageAllocator = nullptr;

    if (NT_SUCCESS(status))
    {
        virtio_set_queue_event_suppression(m_VirtQueue, m_UsePublishedIndices);
    }
    else
    {
        DPrintf(0, ("[%s] - queue setup failed for index %u with error %x\n", __FUNCTION__, m_Index, status));
        m_VirtQueue = nullptr;
    }
}
コード例 #2
0
void CVirtQueue::Renew()
{
    PARANDIS_ADAPTER *pContext = (PARANDIS_ADAPTER *)m_IODevice->DeviceContext;

    if (!CanTouchHardware())
    {
        return;
    }

    pContext->pPageAllocator = &m_SharedMemory;
    NTSTATUS status = virtio_find_queue(
        m_IODevice,
        m_Index,
        &m_VirtQueue);
    pContext->pPageAllocator = nullptr;

    if (!NT_SUCCESS(status))
    {
        DPrintf(0, "[%s] - queue setup failed for index %u with error %x\n", __FUNCTION__, m_Index, status);
        m_VirtQueue = nullptr;
    }
}