Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1550426
  • 博文数量: 596
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 173
  • 用 户 组: 普通用户
  • 注册时间: 2016-07-06 15:50
个人简介

在线笔记

文章分类

全部博文(596)

文章存档

2016年(1)

2015年(104)

2014年(228)

2013年(226)

2012年(26)

2011年(11)

分类: Windows平台

2014-08-12 17:36:29

DxgkDdiAddDevice routine

The DxgkDdiAddDevice function creates a context block for a display adapter and returns a handle that represents the display adapter.

Syntax

PDXGKDDI_ADD_DEVICE DxgkDdiAddDevice;

NTSTATUS DxgkDdiAddDevice(
  _In_   const PDEVICE_OBJECT PhysicalDeviceObject,
  _Out_  PVOID *MiniportDeviceContext
)
{ ... }

Parameters

PhysicalDeviceObject [in]

A pointer to a physical device object (PDO) that identifies a display adapter.

MiniportDeviceContext [out]

A pointer to a variable that receives a handle, created by the display miniport driver, that will represent the display adapter identified by PhysicalDeviceObject. The display miniport driver can return NULL in this parameter to indicate that it will not support the display adapter identified by PhysicalDeviceObject.

Return value

DxgkDdiAddDevice returns STATUS_SUCCESS if it succeeds; otherwise, it returns one of the error codes defined in Ntstatus.h.

Remarks

The DxgkDdiAddDevice function allocates a private context block that is associated with the display adapter identified by PhysicalDeviceObject. You can think of the handle returned in MiniportDeviceContext as a handle to the display adapter or as a handle to the context block associated with the display adapter. The DirectX graphics kernel subsystem (Dxgkrnl.sys) will supply the handle in subsequent calls to the display miniport driver. The following list gives examples of various components of Dxgkrnl.sys passing the handle to functions implemented by the display miniport driver.

  • The display port driver supplies the handle in the MiniportDeviceContext parameter of the function.

  • The VidPN manager supplies the handle in the hAdapter parameter of the function.

  • The DirectX graphics core supplies the handle in the hAdapter parameter of the function.

Do not be confused by the fact that sometimes the handle is named MiniportDeviceContext and sometimes it is named hAdapter. Also, do not confuse this handle with the hDevice parameter that is passed to certain display miniport driver functions.

Some display adapter cards have two or more PCI functions that play the role of display adapter. For example, certain older cards implement multiple views by having a separate PCI function for each view. The display port driver calls DxgkDdiAddDevice once for each of those PCI functions, at which time the display miniport driver can indicate that it supports the PCI function (by setting MiniportDeviceContext to a nonzero value) or that it does not support the PCI function (by setting MiniportDeviceContext to NULL). To get information about a particular PCI function, the display miniport driver can pass PhysicalDeviceObject to .

In , free your context block and any other resources you allocate duringDxgkDdiAddDevice.

The DxgkDdiAddDevice function should be made pageable.

Requirements

Version

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

Header

Dispmprt.h (include Dispmprt.h)

IRQL

PASSIVE_LEVEL
阅读(1650) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~