Virtualbox WDDM之DxgkDdiStartDevice
2015-10-26 10:57
316 查看
1. 参数校验,
2. DxgkCbGetDeviceInformation
https://msdn.microsoft.com/en-us/library/windows/hardware/ff559511(v=vs.85).aspx
The DxgkCbGetDeviceInformation function
gets information, including the registry path and a list of translated resources, about a specified display adapter.
3. DxgkCbGetDeviceInformation失败,返回DxgkCbGetDeviceInformation
error
2. DxgkCbGetDeviceInformation
https://msdn.microsoft.com/en-us/library/windows/hardware/ff559511(v=vs.85).aspx
The DxgkCbGetDeviceInformation function
gets information, including the registry path and a list of translated resources, about a specified display adapter.
3. DxgkCbGetDeviceInformation失败,返回DxgkCbGetDeviceInformation
error
NTSTATUS DxgkDdiStartDevice( IN CONST PVOID MiniportDeviceContext, IN PDXGK_START_INFO DxgkStartInfo, IN PDXGKRNL_INTERFACE DxgkInterface, OUT PULONG NumberOfVideoPresentSources, OUT PULONG NumberOfChildren ) { /* The DxgkDdiStartDevice function should be made pageable. */ PAGED_CODE(); NTSTATUS Status; dfprintf(("==> "__FUNCTION__ ", context(0x%x)\n", MiniportDeviceContext)); if ( ARGUMENT_PRESENT(MiniportDeviceContext) && ARGUMENT_PRESENT(DxgkInterface) && ARGUMENT_PRESENT(DxgkStartInfo) && ARGUMENT_PRESENT(NumberOfVideoPresentSources), ARGUMENT_PRESENT(NumberOfChildren) ) { PDEVICE_EXTENSION pContext = (PDEVICE_EXTENSION)MiniportDeviceContext; /* Save DeviceHandle and function pointers supplied by the DXGKRNL_INTERFACE structure passed to DxgkInterface. */ memcpy(&pContext->u.primary.DxgkInterface, DxgkInterface, sizeof(DXGKRNL_INTERFACE)); /* Allocate a DXGK_DEVICE_INFO structure, and call DxgkCbGetDeviceInformation to fill in the members of that structure, which include the registry path, the PDO, and a list of translated resources for the display adapter represented by MiniportDeviceContext. Save selected members (ones that the display miniport driver will need later) * of the DXGK_DEVICE_INFO structure in the context block represented by MiniportDeviceContext. */ DXGK_DEVICE_INFO DeviceInfo; Status = pContext->u.primary.DxgkInterface.DxgkCbGetDeviceInformation (pContext->u.primary.DxgkInterface.DeviceHandle, &DeviceInfo); if(Status == STATUS_SUCCESS) { ULONG AdapterMemorySize; Status = vboxWddmPickResources(pContext, &DeviceInfo, &AdapterMemorySize); if(Status == STATUS_SUCCESS) { /* Initialize VBoxGuest library, which is used for requests which go through VMMDev. */ VbglInit (); /* Guest supports only HGSMI, the old VBVA via VMMDev is not supported. Old * code will be ifdef'ed and later removed. * The host will however support both old and new interface to keep compatibility * with old guest additions. */ VBoxSetupDisplaysHGSMI(pContext, AdapterMemorySize); if ((pContext)->u.primary.bHGSMI) { drprintf(("VBoxVideoWddm: using HGSMI\n")); *NumberOfVideoPresentSources = pContext->u.primary.cDisplays; *NumberOfChildren = pContext->u.primary.cDisplays; dprintf(("VBoxVideoWddm: sources(%d), children(%d)\n", *NumberOfVideoPresentSources, *NumberOfChildren)); } else { drprintf(("VBoxVideoWddm: HGSMI failed to initialize, returning err\n")); /* @todo: report a better status */ Status = STATUS_UNSUCCESSFUL; } } else { drprintf(("VBoxVideoWddm:: vboxWddmPickResources failed Status(0x%x), returning err\n", Status)); Status = STATUS_UNSUCCESSFUL; } } else { drprintf(("VBoxVideoWddm: DxgkCbGetDeviceInformation failed Status(0x%x), returning err\n", Status)); } } else { drprintf(("VBoxVideoWddm: invalid parameter, returning err\n")); Status = STATUS_INVALID_PARAMETER; } dfprintf(("<== "__FUNCTION__ ", status(0x%x)\n", Status)); return Status; }
相关文章推荐
- 获得到未来6天的天气
- GitLab在Centos下的安装步骤
- Java中正数与负数操作>>、>>>的区别
- "error LNK1169: 找到一个或多个多重定义的符号"另外的解决办法
- 和最大的连续子序列
- linux下环境变量简单配置
- 2014年-2015年我做互联网创业项目的点点滴滴,有成功有失败
- strchr函数
- Core Data
- PHP部分字符串函数汇总
- 设计模式(十五)享元模式(结构型)
- 观后感 - 从MVC到前后端分离
- C_运算符优先级
- React Native 官方文档中文版(含最新Android内容)
- 删除唯一性约束和主键
- Caffe框架,训练model并测试数据
- Caffe框架,训练model并测试数据
- 先进驾驶辅助系统ADAS一些技术应用小结
- 一看就会Android之手机震动的设置
- 九度OJ 1178:复数集合 (插入排序)