DxgkCbGetDeviceInformation routine

The DxgkCbGetDeviceInformation function gets information, including the registry path and a list of translated resources, about a specified display adapter.

Syntax


DXGKCB_GET_DEVICE_INFORMATION DxgkCbGetDeviceInformation;

NTSTATUS DxgkCbGetDeviceInformation(
  _In_   HANDLE DeviceHandle,
  _Out_  PDXGK_DEVICE_INFO DeviceInfo
)
{ ... }

Parameters

DeviceHandle [in]

A handle that represents a display adapter. The display miniport driver previously obtained this handle in the DeviceHandle member of the DXGKRNL_INTERFACE structure that was passed to the DxgkDdiStartDevice function.

DeviceInfo [out]

A pointer to a DXGK_DEVICE_INFO structure that receives information about the display adapter.

Return value

DxgkCbGetDeviceInformation returns STATUS_SUCCESS if it succeeds; otherwise, it returns STATUS_INVALID_PARAMETER.

Examples

The following code example shows a partial implementation of DxgkDdiStartDevice in which DxgkCbGetDeviceInformation is called.


NTSTATUS
DxgkDdiStartDevice(
    IN PVOID MiniportDeviceContext,
    IN PDXGK_START_INFO DxgkStartInfo,
    IN PDXGKRNL_INTERFACE DxgkInterface,
    OUT PULONG NumberOfViews,
    OUT PULONG NumberOfChildren
    )
{
    DXGK_DEVICE_INFO DeviceInfo;
    PHW_DEVICE_EXTENSION DeviceContext;
    PHW_DEVICE_EXTENSION *ExtensionArray = MiniportDeviceContext;
    NTSTATUS Status = STATUS_SUCCESS;
    ULONG ExtensionSize = GetExtensionSize();

    PAGED_CODE();

    if (! ARGUMENT_PRESENT(MiniportDeviceContext) ||
        ! ARGUMENT_PRESENT(DxgkInterface) ||
        ! ARGUMENT_PRESENT(NumberOfViews)) {
        return STATUS_INVALID_PARAMETER;
    }

    // Retrieve information about the graphics adapter
    DxgkCbGetDeviceInformation(DxgkInterface->DeviceHandle, &DeviceInfo);

    // Allocate memory for the first view
    DeviceContext = (PHW_DEVICE_EXTENSION)ExAllocatePoolWithTag(NonPagedPool,
                                        ExtensionSize,
                                        ATI_TAG);

    if (DeviceContext == NULL) {
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    RtlZeroMemory(DeviceContext, ExtensionSize);

    DeviceContext->DeviceHandle = DxgkInterface->DeviceHandle;

    // Use the information that DxgkCbGetDeviceInformation returns 
    // to store the AGP aperture size in the HwDeviceExtension.
    DeviceContext->SystemAgpApertureSize = DeviceInfo.AgpApertureSize;
    DeviceContext->SystemAgpApertureBase = DeviceInfo.AgpApertureBase;

    // Save the DXG interface specific data
    DeviceContext->ddiCallback = *DxgkInterface;
    DeviceContext->pVidSchINTCB = DxgkInterface->DxgkCbNotifyInterrupt;
    DeviceContext->pVidSchDPCCB = DxgkInterface->DxgkCbNotifyDpc;

    // Save number of entry requred in dma queue.
    DeviceContext->ulRequiredDmaQueueEntry = DxgkStartInfo->RequiredDmaQueueEntry;

....
}

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Dispmprt.h (include Dispmprt.h)

IRQL

PASSIVE_LEVEL

See also

DXGK_DEVICE_INFO
DxgkDdiStartDevice

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft