initial commit
This commit is contained in:
parent
cb3cacc51d
commit
5c52e50bf8
@ -2,3 +2,8 @@ qxl-dod
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
QXL WDDM DOD driver
|
QXL WDDM DOD driver
|
||||||
|
|
||||||
|
Heavily based on Microsoft KMDOD example and XDDM QXL driver
|
||||||
|
|
||||||
|
The most recent binaries can be found at http://people.redhat.com/~vrozenfe/qxlwddm/
|
||||||
|
|
||||||
|
165
qxldod Package/qxldod Package.vcxproj
Executable file
165
qxldod Package/qxldod Package.vcxproj
Executable file
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Win8.1 Debug|Win32">
|
||||||
|
<Configuration>Win8.1 Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Debug|Win32">
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Release|Win32">
|
||||||
|
<Configuration>Win8.1 Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Release|Win32">
|
||||||
|
<Configuration>Win8 Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win7 Debug|Win32">
|
||||||
|
<Configuration>Win7 Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win7 Release|Win32">
|
||||||
|
<Configuration>Win7 Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Debug|x64">
|
||||||
|
<Configuration>Win8.1 Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Debug|x64">
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Release|x64">
|
||||||
|
<Configuration>Win8.1 Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Release|x64">
|
||||||
|
<Configuration>Win8 Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win7 Debug|x64">
|
||||||
|
<Configuration>Win7 Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win7 Release|x64">
|
||||||
|
<Configuration>Win7 Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{B8C04B51-4207-491D-A7DD-C54861E8B528}</ProjectGuid>
|
||||||
|
<TemplateGuid>{4605da2c-74a5-4865-98e1-152ef136825f}</TemplateGuid>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<RootNamespace>qxldod_Package</RootNamespace>
|
||||||
|
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VisualStudioVersion)' == '11.0'">$(VCTargetsPath11)</VCTargetsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="PropertySheets">
|
||||||
|
<ConfigurationType>Utility</ConfigurationType>
|
||||||
|
<DriverType>Package</DriverType>
|
||||||
|
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows7</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows7</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows7</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows7</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||||
|
<EnableDeployment>False</EnableDeployment>
|
||||||
|
<RemoveDriver>True</RemoveDriver>
|
||||||
|
<HardwareIdString />
|
||||||
|
<CommandLine />
|
||||||
|
<DeployFiles />
|
||||||
|
<EnableVerifier>False</EnableVerifier>
|
||||||
|
<AllDrivers>False</AllDrivers>
|
||||||
|
<VerifyProjectOutput>True</VerifyProjectOutput>
|
||||||
|
<VerifyDrivers />
|
||||||
|
<VerifyFlags>133563</VerifyFlags>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\qxldod\qxldod.vcxproj">
|
||||||
|
<Project>{a6f48fc7-97e9-48ec-bcdf-1e4f9b43aadd}</Project>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
9
qxldod Package/qxldod Package.vcxproj.filters
Executable file
9
qxldod Package/qxldod Package.vcxproj.filters
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Driver Files">
|
||||||
|
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
|
||||||
|
<Extensions>inf;inv;inx;mof;mc;</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
75
qxldod.sln
Executable file
75
qxldod.sln
Executable file
@ -0,0 +1,75 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2012
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod", "qxldod\qxldod.vcxproj", "{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qxldod Package", "qxldod Package\qxldod Package.vcxproj", "{B8C04B51-4207-491D-A7DD-C54861E8B528}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD} = {A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Win8.1 Debug|Win32 = Win8.1 Debug|Win32
|
||||||
|
Win8.1 Debug|x64 = Win8.1 Debug|x64
|
||||||
|
Win8.1 Release|Win32 = Win8.1 Release|Win32
|
||||||
|
Win8.1 Release|x64 = Win8.1 Release|x64
|
||||||
|
Win8 Debug|Win32 = Win8 Debug|Win32
|
||||||
|
Win8 Debug|x64 = Win8 Debug|x64
|
||||||
|
Win8 Release|Win32 = Win8 Release|Win32
|
||||||
|
Win8 Release|x64 = Win8 Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|Win32.Deploy.0 = Win8.1 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Debug|x64.Deploy.0 = Win8.1 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|Win32.Deploy.0 = Win8.1 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8.1 Release|x64.Deploy.0 = Win8.1 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|Win32.ActiveCfg = Win8.1 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|Win32.Build.0 = Win8.1 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|Win32.Deploy.0 = Win8.1 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|x64.ActiveCfg = Win8.1 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|x64.Build.0 = Win8.1 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Debug|x64.Deploy.0 = Win8.1 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|Win32.ActiveCfg = Win8.1 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|Win32.Build.0 = Win8.1 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|Win32.Deploy.0 = Win8.1 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|x64.ActiveCfg = Win8.1 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|x64.Build.0 = Win8.1 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8.1 Release|x64.Deploy.0 = Win8.1 Release|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|Win32.Deploy.0 = Win8 Debug|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Debug|x64.Deploy.0 = Win8 Debug|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|Win32.Build.0 = Win8 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|Win32.Deploy.0 = Win8 Release|Win32
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|x64.Build.0 = Win8 Release|x64
|
||||||
|
{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}.Win8 Release|x64.Deploy.0 = Win8 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|Win32.Deploy.0 = Win8 Debug|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Debug|x64.Deploy.0 = Win8 Debug|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|Win32.ActiveCfg = Win8 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|Win32.Build.0 = Win8 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|Win32.Deploy.0 = Win8 Release|Win32
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|x64.Build.0 = Win8 Release|x64
|
||||||
|
{B8C04B51-4207-491D-A7DD-C54861E8B528}.Win8 Release|x64.Deploy.0 = Win8 Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
70
qxldod/BaseObject.cpp
Executable file
70
qxldod/BaseObject.cpp
Executable file
@ -0,0 +1,70 @@
|
|||||||
|
#include "BaseObject.h"
|
||||||
|
|
||||||
|
#pragma code_seg("PAGE")
|
||||||
|
|
||||||
|
#define QXLTAG 'LXQd'
|
||||||
|
|
||||||
|
//
|
||||||
|
// New and delete operators
|
||||||
|
//
|
||||||
|
_When_((PoolType & NonPagedPoolMustSucceed) != 0,
|
||||||
|
__drv_reportError("Must succeed pool allocations are forbidden. "
|
||||||
|
"Allocation failures cause a system crash"))
|
||||||
|
void* __cdecl operator new(size_t Size, POOL_TYPE PoolType)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
Size = (Size != 0) ? Size : 1;
|
||||||
|
|
||||||
|
void* pObject = ExAllocatePoolWithTag(PoolType, Size, QXLTAG);
|
||||||
|
|
||||||
|
#if DBG
|
||||||
|
if (pObject != NULL)
|
||||||
|
{
|
||||||
|
RtlFillMemory(pObject, Size, 0xCD);
|
||||||
|
}
|
||||||
|
#endif // DBG
|
||||||
|
|
||||||
|
return pObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
_When_((PoolType & NonPagedPoolMustSucceed) != 0,
|
||||||
|
__drv_reportError("Must succeed pool allocations are forbidden. "
|
||||||
|
"Allocation failures cause a system crash"))
|
||||||
|
void* __cdecl operator new[](size_t Size, POOL_TYPE PoolType)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
Size = (Size != 0) ? Size : 1;
|
||||||
|
|
||||||
|
void* pObject = ExAllocatePoolWithTag(PoolType, Size, QXLTAG);
|
||||||
|
|
||||||
|
#if DBG
|
||||||
|
if (pObject != NULL)
|
||||||
|
{
|
||||||
|
RtlFillMemory(pObject, Size, 0xCD);
|
||||||
|
}
|
||||||
|
#endif // DBG
|
||||||
|
|
||||||
|
return pObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cdecl operator delete(void* pObject)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (pObject != NULL)
|
||||||
|
{
|
||||||
|
ExFreePool(pObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void __cdecl operator delete[](void* pObject)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (pObject != NULL)
|
||||||
|
{
|
||||||
|
ExFreePool(pObject);
|
||||||
|
}
|
||||||
|
}
|
59
qxldod/BaseObject.h
Executable file
59
qxldod/BaseObject.h
Executable file
@ -0,0 +1,59 @@
|
|||||||
|
#pragma once
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#define __CPLUSPLUS
|
||||||
|
|
||||||
|
// Standard C-runtime headers
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <initguid.h>
|
||||||
|
|
||||||
|
// NTOS headers
|
||||||
|
#include <ntddk.h>
|
||||||
|
|
||||||
|
#ifndef FAR
|
||||||
|
#define FAR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Windows headers
|
||||||
|
#include <windef.h>
|
||||||
|
#include <winerror.h>
|
||||||
|
|
||||||
|
// Windows GDI headers
|
||||||
|
#include <wingdi.h>
|
||||||
|
|
||||||
|
// Windows DDI headers
|
||||||
|
#include <winddi.h>
|
||||||
|
#include <ntddvdeo.h>
|
||||||
|
|
||||||
|
#include <d3dkmddi.h>
|
||||||
|
#include <d3dkmthk.h>
|
||||||
|
|
||||||
|
#include <ntstrsafe.h>
|
||||||
|
#include <ntintsafe.h>
|
||||||
|
|
||||||
|
#include <dispmprt.h>
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Memory handling
|
||||||
|
//
|
||||||
|
|
||||||
|
// Defaulting the value of PoolType means that any call to new Foo()
|
||||||
|
// will raise a compiler error for being ambiguous. This is to help keep
|
||||||
|
// any calls to allocate memory from accidentally NOT going through
|
||||||
|
// these functions.
|
||||||
|
_When_((PoolType & NonPagedPoolMustSucceed) != 0,
|
||||||
|
__drv_reportError("Must succeed pool allocations are forbidden. "
|
||||||
|
"Allocation failures cause a system crash"))
|
||||||
|
void* __cdecl operator new(size_t Size, POOL_TYPE PoolType = PagedPool);
|
||||||
|
_When_((PoolType & NonPagedPoolMustSucceed) != 0,
|
||||||
|
__drv_reportError("Must succeed pool allocations are forbidden. "
|
||||||
|
"Allocation failures cause a system crash"))
|
||||||
|
void* __cdecl operator new[](size_t Size, POOL_TYPE PoolType = PagedPool);
|
||||||
|
void __cdecl operator delete(void* pObject);
|
||||||
|
void __cdecl operator delete[](void* pObject);
|
4487
qxldod/QxlDod.cpp
Executable file
4487
qxldod/QxlDod.cpp
Executable file
File diff suppressed because it is too large
Load Diff
717
qxldod/QxlDod.h
Executable file
717
qxldod/QxlDod.h
Executable file
@ -0,0 +1,717 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "baseobject.h"
|
||||||
|
#include "qxl_dev.h"
|
||||||
|
#include "mspace.h"
|
||||||
|
|
||||||
|
#define MAX_CHILDREN 1
|
||||||
|
#define MAX_VIEWS 1
|
||||||
|
#define BITS_PER_BYTE 8
|
||||||
|
|
||||||
|
#define POINTER_SIZE 64
|
||||||
|
|
||||||
|
typedef struct _QXL_FLAGS
|
||||||
|
{
|
||||||
|
UINT DriverStarted : 1; // ( 1) 1 after StartDevice and 0 after StopDevice
|
||||||
|
UINT Unused : 31;
|
||||||
|
} QXL_FLAGS;
|
||||||
|
|
||||||
|
// For the following macros, c must be a UCHAR.
|
||||||
|
#define UPPER_6_BITS(c) (((c) & rMaskTable[6 - 1]) >> 2)
|
||||||
|
#define UPPER_5_BITS(c) (((c) & rMaskTable[5 - 1]) >> 3)
|
||||||
|
#define LOWER_6_BITS(c) (((BYTE)(c)) & lMaskTable[BITS_PER_BYTE - 6])
|
||||||
|
#define LOWER_5_BITS(c) (((BYTE)(c)) & lMaskTable[BITS_PER_BYTE - 5])
|
||||||
|
|
||||||
|
|
||||||
|
#define SHIFT_FOR_UPPER_5_IN_565 (6 + 5)
|
||||||
|
#define SHIFT_FOR_MIDDLE_6_IN_565 (5)
|
||||||
|
#define SHIFT_UPPER_5_IN_565_BACK ((BITS_PER_BYTE * 2) + (BITS_PER_BYTE - 5))
|
||||||
|
#define SHIFT_MIDDLE_6_IN_565_BACK ((BITS_PER_BYTE * 1) + (BITS_PER_BYTE - 6))
|
||||||
|
#define SHIFT_LOWER_5_IN_565_BACK ((BITS_PER_BYTE * 0) + (BITS_PER_BYTE - 5))
|
||||||
|
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
CHAR Signature[4];
|
||||||
|
USHORT Version;
|
||||||
|
ULONG OemStringPtr;
|
||||||
|
LONG Capabilities;
|
||||||
|
ULONG VideoModePtr;
|
||||||
|
USHORT TotalMemory;
|
||||||
|
USHORT OemSoftwareRevision;
|
||||||
|
ULONG OemVendorNamePtr;
|
||||||
|
ULONG OemProductNamePtr;
|
||||||
|
ULONG OemProductRevPtr;
|
||||||
|
CHAR Reserved[222];
|
||||||
|
// CHAR OemData[256];
|
||||||
|
} VBE_INFO, *PVBE_INFO;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
/* Mandatory information for all VBE revisions */
|
||||||
|
USHORT ModeAttributes;
|
||||||
|
UCHAR WinAAttributes;
|
||||||
|
UCHAR WinBAttributes;
|
||||||
|
USHORT WinGranularity;
|
||||||
|
USHORT WinSize;
|
||||||
|
USHORT WinASegment;
|
||||||
|
USHORT WinBSegment;
|
||||||
|
ULONG WinFuncPtr;
|
||||||
|
USHORT BytesPerScanLine;
|
||||||
|
/* Mandatory information for VBE 1.2 and above */
|
||||||
|
USHORT XResolution;
|
||||||
|
USHORT YResolution;
|
||||||
|
UCHAR XCharSize;
|
||||||
|
UCHAR YCharSize;
|
||||||
|
UCHAR NumberOfPlanes;
|
||||||
|
UCHAR BitsPerPixel;
|
||||||
|
UCHAR NumberOfBanks;
|
||||||
|
UCHAR MemoryModel;
|
||||||
|
UCHAR BankSize;
|
||||||
|
UCHAR NumberOfImagePages;
|
||||||
|
UCHAR Reserved1;
|
||||||
|
/* Direct Color fields (required for Direct/6 and YUV/7 memory models) */
|
||||||
|
UCHAR RedMaskSize;
|
||||||
|
UCHAR RedFieldPosition;
|
||||||
|
UCHAR GreenMaskSize;
|
||||||
|
UCHAR GreenFieldPosition;
|
||||||
|
UCHAR BlueMaskSize;
|
||||||
|
UCHAR BlueFieldPosition;
|
||||||
|
UCHAR ReservedMaskSize;
|
||||||
|
UCHAR ReservedFieldPosition;
|
||||||
|
UCHAR DirectColorModeInfo;
|
||||||
|
/* Mandatory information for VBE 2.0 and above */
|
||||||
|
ULONG PhysBasePtr;
|
||||||
|
ULONG Reserved2;
|
||||||
|
USHORT Reserved3;
|
||||||
|
/* Mandatory information for VBE 3.0 and above */
|
||||||
|
USHORT LinBytesPerScanLine;
|
||||||
|
UCHAR BnkNumberOfImagePages;
|
||||||
|
UCHAR LinNumberOfImagePages;
|
||||||
|
UCHAR LinRedMaskSize;
|
||||||
|
UCHAR LinRedFieldPosition;
|
||||||
|
UCHAR LinGreenMaskSize;
|
||||||
|
UCHAR LinGreenFieldPosition;
|
||||||
|
UCHAR LinBlueMaskSize;
|
||||||
|
UCHAR LinBlueFieldPosition;
|
||||||
|
UCHAR LinReservedMaskSize;
|
||||||
|
UCHAR LinReservedFieldPosition;
|
||||||
|
ULONG MaxPixelClock;
|
||||||
|
CHAR Reserved4[189];
|
||||||
|
} VBE_MODEINFO, *PVBE_MODEINFO;
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
typedef struct _X86BIOS_REGISTERS // invented names
|
||||||
|
{
|
||||||
|
ULONG Eax;
|
||||||
|
ULONG Ecx;
|
||||||
|
ULONG Edx;
|
||||||
|
ULONG Ebx;
|
||||||
|
ULONG Ebp;
|
||||||
|
ULONG Esi;
|
||||||
|
ULONG Edi;
|
||||||
|
USHORT SegDs;
|
||||||
|
USHORT SegEs;
|
||||||
|
} X86BIOS_REGISTERS, *PX86BIOS_REGISTERS;
|
||||||
|
|
||||||
|
/* Undocumented imports from the HAL */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
NTHALAPI BOOLEAN x86BiosCall (ULONG, PX86BIOS_REGISTERS);
|
||||||
|
|
||||||
|
NTHALAPI NTSTATUS x86BiosAllocateBuffer (ULONG *, USHORT *, USHORT *);
|
||||||
|
NTHALAPI NTSTATUS x86BiosFreeBuffer (USHORT, USHORT);
|
||||||
|
|
||||||
|
NTHALAPI NTSTATUS x86BiosReadMemory (USHORT, USHORT, PVOID, ULONG);
|
||||||
|
NTHALAPI NTSTATUS x86BiosWriteMemory (USHORT, USHORT, PVOID, ULONG);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct DoPresentMemory
|
||||||
|
{
|
||||||
|
PVOID DstAddr;
|
||||||
|
UINT DstStride;
|
||||||
|
ULONG DstBitPerPixel;
|
||||||
|
UINT SrcWidth;
|
||||||
|
UINT SrcHeight;
|
||||||
|
BYTE* SrcAddr;
|
||||||
|
LONG SrcPitch;
|
||||||
|
ULONG NumMoves; // in: Number of screen to screen moves
|
||||||
|
D3DKMT_MOVE_RECT* Moves; // in: Point to the list of moves
|
||||||
|
ULONG NumDirtyRects; // in: Number of direct rects
|
||||||
|
RECT* DirtyRect; // in: Point to the list of dirty rects
|
||||||
|
D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation;
|
||||||
|
D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceID;
|
||||||
|
HANDLE hAdapter;
|
||||||
|
PMDL Mdl;
|
||||||
|
PVOID DisplaySource;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _BLT_INFO
|
||||||
|
{
|
||||||
|
PVOID pBits;
|
||||||
|
UINT Pitch;
|
||||||
|
UINT BitsPerPel;
|
||||||
|
POINT Offset; // To unrotated top-left of dirty rects
|
||||||
|
D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation;
|
||||||
|
UINT Width; // For the unrotated image
|
||||||
|
UINT Height; // For the unrotated image
|
||||||
|
} BLT_INFO;
|
||||||
|
|
||||||
|
// Represents the current mode, may not always be set (i.e. frame buffer mapped) if representing the mode passed in on single mode setups.
|
||||||
|
typedef struct _CURRENT_BDD_MODE
|
||||||
|
{
|
||||||
|
// The source mode currently set for HW Framebuffer
|
||||||
|
// For sample driver this info filled in StartDevice by the OS and never changed.
|
||||||
|
DXGK_DISPLAY_INFORMATION DispInfo;
|
||||||
|
|
||||||
|
// The rotation of the current mode. Rotation is performed in software during Present call
|
||||||
|
D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation;
|
||||||
|
|
||||||
|
D3DKMDT_VIDPN_PRESENT_PATH_SCALING Scaling;
|
||||||
|
// This mode might be different from one which are supported for HW frame buffer
|
||||||
|
// Scaling/displasment might be needed (if supported)
|
||||||
|
UINT SrcModeWidth;
|
||||||
|
UINT SrcModeHeight;
|
||||||
|
|
||||||
|
// Various boolean flags the struct uses
|
||||||
|
struct _CURRENT_BDD_MODE_FLAGS
|
||||||
|
{
|
||||||
|
UINT SourceNotVisible : 1; // 0 if source is visible
|
||||||
|
UINT FullscreenPresent : 1; // 0 if should use dirty rects for present
|
||||||
|
UINT FrameBufferIsActive : 1; // 0 if not currently active (i.e. target not connected to source)
|
||||||
|
UINT DoNotMapOrUnmap : 1; // 1 if the FrameBuffer should not be (un)mapped during normal execution
|
||||||
|
UINT IsInternal : 1; // 1 if it was determined (i.e. through ACPI) that an internal panel is being driven
|
||||||
|
UINT Unused : 27;
|
||||||
|
} Flags;
|
||||||
|
|
||||||
|
// The start and end of physical memory known to be all zeroes. Used to optimize the BlackOutScreen function to not write
|
||||||
|
// zeroes to memory already known to be zero. (Physical address is located in DispInfo)
|
||||||
|
PHYSICAL_ADDRESS ZeroedOutStart;
|
||||||
|
PHYSICAL_ADDRESS ZeroedOutEnd;
|
||||||
|
|
||||||
|
// Linear frame buffer pointer
|
||||||
|
// A union with a ULONG64 is used here to ensure this struct looks the same on 32bit and 64bit builds
|
||||||
|
// since the size of a VOID* changes depending on the build.
|
||||||
|
union
|
||||||
|
{
|
||||||
|
VOID* Ptr;
|
||||||
|
ULONG64 Force8Bytes;
|
||||||
|
} FrameBuffer;
|
||||||
|
} CURRENT_BDD_MODE;
|
||||||
|
|
||||||
|
class QxlDod;
|
||||||
|
|
||||||
|
class HwDeviceIntrface {
|
||||||
|
public:
|
||||||
|
virtual NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode) = 0;
|
||||||
|
virtual NTSTATUS SetCurrentMode(ULONG Mode) = 0;
|
||||||
|
virtual NTSTATUS GetCurrentMode(ULONG* Mode) = 0;
|
||||||
|
virtual NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;
|
||||||
|
virtual NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;
|
||||||
|
virtual NTSTATUS HWClose(void) = 0;
|
||||||
|
virtual BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_ ULONG MessageNumber) = 0;
|
||||||
|
virtual VOID DpcRoutine(PVOID) = 0;
|
||||||
|
virtual VOID ResetDevice(void) = 0;
|
||||||
|
|
||||||
|
ULONG GetModeCount(void) {return m_ModeCount;}
|
||||||
|
PVIDEO_MODE_INFORMATION GetModeInfo(UINT idx) {return &m_ModeInfo[idx];}
|
||||||
|
USHORT GetModeNumber(USHORT idx) {return m_ModeNumbers[idx];}
|
||||||
|
USHORT GetCurrentModeIndex(void) {return m_CurrentMode;}
|
||||||
|
VOID SetCurrentModeIndex(USHORT idx) {m_CurrentMode = idx;}
|
||||||
|
virtual BOOLEAN EnablePointer(void) = 0;
|
||||||
|
virtual NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
|
||||||
|
_In_ UINT DstBitPerPixel,
|
||||||
|
_In_ BYTE* SrcAddr,
|
||||||
|
_In_ UINT SrcBytesPerPixel,
|
||||||
|
_In_ LONG SrcPitch,
|
||||||
|
_In_ ULONG NumMoves,
|
||||||
|
_In_ D3DKMT_MOVE_RECT* pMoves,
|
||||||
|
_In_ ULONG NumDirtyRects,
|
||||||
|
_In_ RECT* pDirtyRect,
|
||||||
|
_In_ D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation,
|
||||||
|
_In_ const CURRENT_BDD_MODE* pModeCur) = 0;
|
||||||
|
|
||||||
|
virtual VOID BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod) = 0;
|
||||||
|
virtual NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape) = 0;
|
||||||
|
virtual NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition) = 0;
|
||||||
|
protected:
|
||||||
|
virtual NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo) = 0;
|
||||||
|
protected:
|
||||||
|
QxlDod* m_pQxlDod;
|
||||||
|
PVIDEO_MODE_INFORMATION m_ModeInfo;
|
||||||
|
ULONG m_ModeCount;
|
||||||
|
PUSHORT m_ModeNumbers;
|
||||||
|
USHORT m_CurrentMode;
|
||||||
|
};
|
||||||
|
|
||||||
|
class VgaDevice :
|
||||||
|
public HwDeviceIntrface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
VgaDevice(_In_ QxlDod* pQxlDod);
|
||||||
|
virtual ~VgaDevice(void);
|
||||||
|
NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode);
|
||||||
|
NTSTATUS SetCurrentMode(ULONG Mode);
|
||||||
|
NTSTATUS GetCurrentMode(ULONG* Mode);
|
||||||
|
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
NTSTATUS HWClose(void);
|
||||||
|
BOOLEAN EnablePointer(void) { return FALSE; }
|
||||||
|
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
|
||||||
|
_In_ UINT DstBitPerPixel,
|
||||||
|
_In_ BYTE* SrcAddr,
|
||||||
|
_In_ UINT SrcBytesPerPixel,
|
||||||
|
_In_ LONG SrcPitch,
|
||||||
|
_In_ ULONG NumMoves,
|
||||||
|
_In_ D3DKMT_MOVE_RECT* pMoves,
|
||||||
|
_In_ ULONG NumDirtyRects,
|
||||||
|
_In_ RECT* pDirtyRect,
|
||||||
|
_In_ D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation,
|
||||||
|
_In_ const CURRENT_BDD_MODE* pModeCur);
|
||||||
|
VOID BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod);
|
||||||
|
BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_ ULONG MessageNumber);
|
||||||
|
VOID DpcRoutine(PVOID);
|
||||||
|
VOID ResetDevice(VOID);
|
||||||
|
NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);
|
||||||
|
NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);
|
||||||
|
protected:
|
||||||
|
NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
private:
|
||||||
|
BOOL SetVideoModeInfo(UINT Idx, PVBE_MODEINFO pModeInfo);
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _MemSlot {
|
||||||
|
UINT8 generation;
|
||||||
|
UINT64 start_phys_addr;
|
||||||
|
UINT64 end_phys_addr;
|
||||||
|
UINT64 start_virt_addr;
|
||||||
|
UINT64 end_virt_addr;
|
||||||
|
QXLPHYSICAL high_bits;
|
||||||
|
} MemSlot;
|
||||||
|
|
||||||
|
typedef struct MspaceInfo {
|
||||||
|
mspace _mspace;
|
||||||
|
UINT8 *mspace_start;
|
||||||
|
UINT8 *mspace_end;
|
||||||
|
} MspaceInfo;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
MSPACE_TYPE_DEVRAM,
|
||||||
|
MSPACE_TYPE_VRAM,
|
||||||
|
NUM_MSPACES,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RELEASE_RES(res) if (!--(res)->refs) (res)->free(res);
|
||||||
|
#define GET_RES(res) (++(res)->refs)
|
||||||
|
|
||||||
|
/* Debug helpers - tag each resource with this enum */
|
||||||
|
enum {
|
||||||
|
RESOURCE_TYPE_DRAWABLE = 1,
|
||||||
|
RESOURCE_TYPE_SURFACE,
|
||||||
|
RESOURCE_TYPE_PATH,
|
||||||
|
RESOURCE_TYPE_CLIP_RECTS,
|
||||||
|
RESOURCE_TYPE_QUIC_IMAGE,
|
||||||
|
RESOURCE_TYPE_BITMAP_IMAGE,
|
||||||
|
RESOURCE_TYPE_SURFACE_IMAGE,
|
||||||
|
RESOURCE_TYPE_SRING,
|
||||||
|
RESOURCE_TYPE_CURSOR,
|
||||||
|
RESOURCE_TYPE_BUF,
|
||||||
|
RESOURCE_TYPE_UPDATE,
|
||||||
|
};
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
#define RESOURCE_TYPE(res, val) do { res->type = val; } while (0)
|
||||||
|
#else
|
||||||
|
#define RESOURCE_TYPE(res, val)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct Resource Resource;
|
||||||
|
struct Resource {
|
||||||
|
UINT32 refs;
|
||||||
|
void* ptr;
|
||||||
|
#ifdef DBG
|
||||||
|
UINT32 type;
|
||||||
|
#endif
|
||||||
|
void (*free)(Resource *res);
|
||||||
|
UINT8 res[0];
|
||||||
|
};
|
||||||
|
|
||||||
|
#define TIMEOUT_TO_MS ((LONGLONG) 1 * 10 * 1000)
|
||||||
|
|
||||||
|
#define WAIT_FOR_EVENT(event, timeout) do { \
|
||||||
|
NTSTATUS status; \
|
||||||
|
status = KeWaitForSingleObject ( \
|
||||||
|
&event, \
|
||||||
|
Executive, \
|
||||||
|
KernelMode, \
|
||||||
|
FALSE, \
|
||||||
|
timeout); \
|
||||||
|
ASSERT(NT_SUCCESS(status)); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
#define QXL_SLEEP(msec) do { \
|
||||||
|
LARGE_INTEGER timeout; \
|
||||||
|
timeout.QuadPart = -msec * TIMEOUT_TO_MS; \
|
||||||
|
KeDelayExecutionThread (KernelMode, FALSE, &timeout);\
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
#define IMAGE_HASH_INIT_VAL(width, height, format) \
|
||||||
|
((UINT32)((width) & 0x1FFF) | ((UINT32)((height) & 0x1FFF) << 13) |\
|
||||||
|
((UINT32)(format) << 26))
|
||||||
|
|
||||||
|
#define MAX_OUTPUT_RES 6
|
||||||
|
|
||||||
|
typedef struct QXLOutput {
|
||||||
|
UINT32 num_res;
|
||||||
|
#ifdef DBG
|
||||||
|
UINT32 type;
|
||||||
|
#endif
|
||||||
|
Resource *resources[MAX_OUTPUT_RES];
|
||||||
|
UINT8 data[0];
|
||||||
|
} QXLOutput;
|
||||||
|
|
||||||
|
typedef struct Ring RingItem;
|
||||||
|
typedef struct Ring {
|
||||||
|
RingItem *prev;
|
||||||
|
RingItem *next;
|
||||||
|
} Ring;
|
||||||
|
|
||||||
|
typedef struct InternalImage {
|
||||||
|
QXLImage image;
|
||||||
|
} InternalImage;
|
||||||
|
|
||||||
|
typedef struct InternalCursor {
|
||||||
|
QXLCursor cursor;
|
||||||
|
} InternalCursor;
|
||||||
|
|
||||||
|
#define CURSOR_ALLOC_SIZE (PAGE_SIZE << 1)
|
||||||
|
|
||||||
|
typedef struct DpcCbContext {
|
||||||
|
void* ptr;
|
||||||
|
UINT32 data;
|
||||||
|
} DPC_CB_CONTEXT,* PDPC_CB_CONTEXT;
|
||||||
|
|
||||||
|
#define BITMAP_ALLOC_BASE (sizeof(Resource) + sizeof(InternalImage) + sizeof(QXLDataChunk))
|
||||||
|
#define BITS_BUF_MAX (64 * 1024)
|
||||||
|
#define MIN(x, y) (((x) <= (y)) ? (x) : (y))
|
||||||
|
#define MAX(x, y) (((x) >= (y)) ? (x) : (y))
|
||||||
|
#define ALIGN(a, b) (((a) + ((b) - 1)) & ~((b) - 1))
|
||||||
|
|
||||||
|
class QxlDevice :
|
||||||
|
public HwDeviceIntrface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QxlDevice(_In_ QxlDod* pQxlDod);
|
||||||
|
virtual ~QxlDevice(void);
|
||||||
|
NTSTATUS QueryCurrentMode(PVIDEO_MODE RequestedMode);
|
||||||
|
NTSTATUS SetCurrentMode(ULONG Mode);
|
||||||
|
NTSTATUS GetCurrentMode(ULONG* Mode);
|
||||||
|
NTSTATUS SetPowerState(DEVICE_POWER_STATE DevicePowerState, DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
NTSTATUS HWInit(PCM_RESOURCE_LIST pResList, DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
NTSTATUS HWClose(void);
|
||||||
|
BOOLEAN EnablePointer(void) { return FALSE; }
|
||||||
|
NTSTATUS ExecutePresentDisplayOnly(_In_ BYTE* DstAddr,
|
||||||
|
_In_ UINT DstBitPerPixel,
|
||||||
|
_In_ BYTE* SrcAddr,
|
||||||
|
_In_ UINT SrcBytesPerPixel,
|
||||||
|
_In_ LONG SrcPitch,
|
||||||
|
_In_ ULONG NumMoves,
|
||||||
|
_In_ D3DKMT_MOVE_RECT* pMoves,
|
||||||
|
_In_ ULONG NumDirtyRects,
|
||||||
|
_In_ RECT* pDirtyRect,
|
||||||
|
_In_ D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation,
|
||||||
|
_In_ const CURRENT_BDD_MODE* pModeCur);
|
||||||
|
VOID BlackOutScreen(CURRENT_BDD_MODE* pCurrentBddMod);
|
||||||
|
BOOLEAN InterruptRoutine(_In_ PDXGKRNL_INTERFACE pDxgkInterface, _In_ ULONG MessageNumber);
|
||||||
|
VOID DpcRoutine(PVOID);
|
||||||
|
VOID ResetDevice(VOID);
|
||||||
|
NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);
|
||||||
|
NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);
|
||||||
|
protected:
|
||||||
|
NTSTATUS GetModeList(DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
VOID BltBits (BLT_INFO* pDst,
|
||||||
|
CONST BLT_INFO* pSrc,
|
||||||
|
UINT NumRects,
|
||||||
|
_In_reads_(NumRects) CONST RECT *pRects);
|
||||||
|
QXLDrawable *Drawable(UINT8 type,
|
||||||
|
CONST RECT *area,
|
||||||
|
CONST RECT *clip,
|
||||||
|
UINT32 surface_id);
|
||||||
|
void PushDrawable(QXLDrawable *drawable);
|
||||||
|
void PushCursorCmd(QXLCursorCmd *cursor_cmd);
|
||||||
|
QXLDrawable *GetDrawable();
|
||||||
|
QXLCursorCmd *CursorCmd();
|
||||||
|
void *AllocMem(UINT32 mspace_type, size_t size, BOOL force);
|
||||||
|
VOID UpdateArea(CONST RECT* area, UINT32 surface_id);
|
||||||
|
VOID SetImageId(InternalImage *internal,
|
||||||
|
BOOL cache_me,
|
||||||
|
LONG width,
|
||||||
|
LONG height,
|
||||||
|
UINT8 format, UINT32 key);
|
||||||
|
private:
|
||||||
|
NTSTATUS QxlInit(DXGK_DISPLAY_INFORMATION* pDispInfo);
|
||||||
|
void QxlClose(void);
|
||||||
|
void UnmapMemory(void);
|
||||||
|
BOOL SetVideoModeInfo(UINT Idx, QXLMode* pModeInfo);
|
||||||
|
BOOL InitMemSlots(void);
|
||||||
|
BOOL CreateMemSlots(void);
|
||||||
|
void DestroyMemSlots(void);
|
||||||
|
void CreatePrimarySurface(PVIDEO_MODE_INFORMATION pModeInfo);
|
||||||
|
void DestroyPrimarySurface(void);
|
||||||
|
void SetupHWSlot(UINT8 Idx, MemSlot *pSlot);
|
||||||
|
UINT8 SetupMemSlot(UINT8 Idx, UINT64 pastart, UINT64 paend, UINT64 vastart, UINT64 vaend);
|
||||||
|
BOOL CreateEvents(void);
|
||||||
|
BOOL CreateRings(void);
|
||||||
|
UINT64 VA(QXLPHYSICAL paddr, UINT8 slot_id);
|
||||||
|
QXLPHYSICAL PA(PVOID virt, UINT8 slot_id);
|
||||||
|
void InitDeviceMemoryResources(void);
|
||||||
|
void InitMspace(UINT32 mspace_type, UINT8 *start, size_t capacity);
|
||||||
|
void FlushReleaseRing();
|
||||||
|
void FreeMem(UINT32 mspace_type, void *ptr);
|
||||||
|
UINT64 ReleaseOutput(UINT64 output_id);
|
||||||
|
void WaitForReleaseRing(void);
|
||||||
|
void EmptyReleaseRing(void);
|
||||||
|
BOOL SetClip(const RECT *clip, QXLDrawable *drawable);
|
||||||
|
void AddRes(QXLOutput *output, Resource *res);
|
||||||
|
void DrawableAddRes(QXLDrawable *drawable, Resource *res);
|
||||||
|
void CursorCmdAddRes(QXLCursorCmd *cmd, Resource *res);
|
||||||
|
void FreeClipRects(Resource *res);
|
||||||
|
void static FreeClipRectsEx(Resource *res);
|
||||||
|
void FreeBitmapImage(Resource *res);
|
||||||
|
void static FreeBitmapImageEx(Resource *res);
|
||||||
|
void static FreeCursorEx(Resource *res);
|
||||||
|
void FreeCursor(Resource *res);
|
||||||
|
void WaitForCmdRing(void);
|
||||||
|
void PushCmd(void);
|
||||||
|
void WaitForCursorRing(void);
|
||||||
|
void PushCursor(void);
|
||||||
|
void PutBytesAlign(QXLDataChunk **chunk_ptr, UINT8 **now_ptr,
|
||||||
|
UINT8 **end_ptr, UINT8 *src, int size,
|
||||||
|
size_t alloc_size, uint32_t alignment);
|
||||||
|
BOOLEAN static DpcCallbackEx(PVOID);
|
||||||
|
void DpcCallback(PDPC_CB_CONTEXT);
|
||||||
|
void AsyncIo(UCHAR Port, UCHAR Value);
|
||||||
|
void SyncIo(UCHAR Port, UCHAR Value);
|
||||||
|
private:
|
||||||
|
PUCHAR m_IoBase;
|
||||||
|
BOOLEAN m_IoMapped;
|
||||||
|
ULONG m_IoSize;
|
||||||
|
|
||||||
|
PHYSICAL_ADDRESS m_RamPA;
|
||||||
|
UINT8 *m_RamStart;
|
||||||
|
QXLRam *m_RamHdr;
|
||||||
|
ULONG m_RamSize;
|
||||||
|
|
||||||
|
PHYSICAL_ADDRESS m_VRamPA;
|
||||||
|
UINT8 *m_VRamStart;
|
||||||
|
ULONG m_VRamSize;
|
||||||
|
|
||||||
|
QXLRom *m_RomHdr;
|
||||||
|
ULONG m_RomSize;
|
||||||
|
|
||||||
|
MemSlot *m_MemSlots;
|
||||||
|
UINT8 m_NumMemSlots;
|
||||||
|
UINT8 m_MainMemSlot;
|
||||||
|
UINT8 m_SurfaceMemSlot;
|
||||||
|
UINT8 m_SlotIdBits;
|
||||||
|
UINT8 m_SlotGenBits;
|
||||||
|
QXLPHYSICAL m_VaSlotMask;
|
||||||
|
|
||||||
|
QXLCommandRing *m_CommandRing;
|
||||||
|
QXLCursorRing *m_CursorRing;
|
||||||
|
QXLReleaseRing *m_ReleaseRing;
|
||||||
|
|
||||||
|
KEVENT m_DisplayEvent;
|
||||||
|
KEVENT m_CursorEvent;
|
||||||
|
KEVENT m_IoCmdEvent;
|
||||||
|
|
||||||
|
PUCHAR m_LogPort;
|
||||||
|
PUCHAR m_LogBuf;
|
||||||
|
|
||||||
|
KMUTEX m_MemLock;
|
||||||
|
KMUTEX m_CmdLock;
|
||||||
|
KMUTEX m_IoLock;
|
||||||
|
KMUTEX m_CrsLock;
|
||||||
|
MspaceInfo m_MSInfo[NUM_MSPACES];
|
||||||
|
|
||||||
|
UINT64 m_FreeOutputs;
|
||||||
|
UINT32 m_Pending;
|
||||||
|
};
|
||||||
|
|
||||||
|
class QxlDod {
|
||||||
|
private:
|
||||||
|
DEVICE_OBJECT* m_pPhysicalDevice;
|
||||||
|
DXGKRNL_INTERFACE m_DxgkInterface;
|
||||||
|
DXGK_DEVICE_INFO m_DeviceInfo;
|
||||||
|
|
||||||
|
DEVICE_POWER_STATE m_MonitorPowerState;
|
||||||
|
DEVICE_POWER_STATE m_AdapterPowerState;
|
||||||
|
QXL_FLAGS m_Flags;
|
||||||
|
|
||||||
|
CURRENT_BDD_MODE m_CurrentModes[MAX_VIEWS];
|
||||||
|
|
||||||
|
D3DDDI_VIDEO_PRESENT_SOURCE_ID m_SystemDisplaySourceId;
|
||||||
|
DXGKARG_SETPOINTERSHAPE m_PointerShape;
|
||||||
|
HwDeviceIntrface* m_pHWDevice;
|
||||||
|
public:
|
||||||
|
QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject);
|
||||||
|
~QxlDod(void);
|
||||||
|
#pragma code_seg(push)
|
||||||
|
#pragma code_seg()
|
||||||
|
BOOLEAN IsDriverActive() const
|
||||||
|
{
|
||||||
|
return m_Flags.DriverStarted;
|
||||||
|
}
|
||||||
|
#pragma code_seg(pop)
|
||||||
|
|
||||||
|
NTSTATUS StartDevice(_In_ DXGK_START_INFO* pDxgkStartInfo,
|
||||||
|
_In_ DXGKRNL_INTERFACE* pDxgkInterface,
|
||||||
|
_Out_ ULONG* pNumberOfViews,
|
||||||
|
_Out_ ULONG* pNumberOfChildren);
|
||||||
|
NTSTATUS StopDevice(VOID);
|
||||||
|
// Must be Non-Paged
|
||||||
|
VOID ResetDevice(VOID);
|
||||||
|
|
||||||
|
NTSTATUS DispatchIoRequest(_In_ ULONG VidPnSourceId,
|
||||||
|
_In_ VIDEO_REQUEST_PACKET* pVideoRequestPacket);
|
||||||
|
NTSTATUS SetPowerState(_In_ ULONG HardwareUid,
|
||||||
|
_In_ DEVICE_POWER_STATE DevicePowerState,
|
||||||
|
_In_ POWER_ACTION ActionType);
|
||||||
|
// Report back child capabilities
|
||||||
|
NTSTATUS QueryChildRelations(_Out_writes_bytes_(ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,
|
||||||
|
_In_ ULONG ChildRelationsSize);
|
||||||
|
|
||||||
|
NTSTATUS QueryChildStatus(_Inout_ DXGK_CHILD_STATUS* pChildStatus,
|
||||||
|
_In_ BOOLEAN NonDestructiveOnly);
|
||||||
|
|
||||||
|
// Return EDID if previously retrieved
|
||||||
|
NTSTATUS QueryDeviceDescriptor(_In_ ULONG ChildUid,
|
||||||
|
_Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
// BDD doesn't have interrupts, so just returns false
|
||||||
|
BOOLEAN InterruptRoutine(_In_ ULONG MessageNumber);
|
||||||
|
|
||||||
|
VOID DpcRoutine(VOID);
|
||||||
|
|
||||||
|
// Return DriverCaps, doesn't support other queries though
|
||||||
|
NTSTATUS QueryAdapterInfo(_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo);
|
||||||
|
|
||||||
|
NTSTATUS SetPointerPosition(_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);
|
||||||
|
|
||||||
|
NTSTATUS SetPointerShape(_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);
|
||||||
|
|
||||||
|
NTSTATUS Escape(_In_ CONST DXGKARG_ESCAPE* pEscape);
|
||||||
|
|
||||||
|
NTSTATUS PresentDisplayOnly(_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPresentDisplayOnly);
|
||||||
|
|
||||||
|
NTSTATUS QueryInterface(_In_ CONST PQUERY_INTERFACE QueryInterface);
|
||||||
|
|
||||||
|
NTSTATUS IsSupportedVidPn(_Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupportedVidPn);
|
||||||
|
|
||||||
|
NTSTATUS RecommendFunctionalVidPn(_In_ CONST DXGKARG_RECOMMENDFUNCTIONALVIDPN* CONST pRecommendFunctionalVidPn);
|
||||||
|
|
||||||
|
NTSTATUS RecommendVidPnTopology(_In_ CONST DXGKARG_RECOMMENDVIDPNTOPOLOGY* CONST pRecommendVidPnTopology);
|
||||||
|
|
||||||
|
NTSTATUS RecommendMonitorModes(_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes);
|
||||||
|
|
||||||
|
NTSTATUS EnumVidPnCofuncModality(_In_ CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModality);
|
||||||
|
|
||||||
|
NTSTATUS SetVidPnSourceVisibility(_In_ CONST DXGKARG_SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility);
|
||||||
|
|
||||||
|
NTSTATUS CommitVidPn(_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn);
|
||||||
|
|
||||||
|
NTSTATUS UpdateActiveVidPnPresentPath(_In_ CONST DXGKARG_UPDATEACTIVEVIDPNPRESENTPATH* CONST pUpdateActiveVidPnPresentPath);
|
||||||
|
|
||||||
|
NTSTATUS QueryVidPnHWCapability(_Inout_ DXGKARG_QUERYVIDPNHWCAPABILITY* pVidPnHWCaps);
|
||||||
|
|
||||||
|
// Part of PnPStop (PnP instance only), returns current mode information (which will be passed to fallback instance by dxgkrnl)
|
||||||
|
NTSTATUS StopDeviceAndReleasePostDisplayOwnership(_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_Out_ DXGK_DISPLAY_INFORMATION* pDisplayInfo);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
// Call to initialize as part of bugcheck
|
||||||
|
NTSTATUS SystemDisplayEnable(_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS Flags,
|
||||||
|
_Out_ UINT* pWidth,
|
||||||
|
_Out_ UINT* pHeight,
|
||||||
|
_Out_ D3DDDIFORMAT* pColorFormat);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
// Write out pixels as part of bugcheck
|
||||||
|
VOID SystemDisplayWrite(_In_reads_bytes_(SourceHeight * SourceStride) VOID* pSource,
|
||||||
|
_In_ UINT SourceWidth,
|
||||||
|
_In_ UINT SourceHeight,
|
||||||
|
_In_ UINT SourceStride,
|
||||||
|
_In_ INT PositionX,
|
||||||
|
_In_ INT PositionY);
|
||||||
|
PDXGKRNL_INTERFACE GetDxgkInterrface(void) { return &m_DxgkInterface;}
|
||||||
|
private:
|
||||||
|
VOID CleanUp(VOID);
|
||||||
|
NTSTATUS CheckHardware();
|
||||||
|
NTSTATUS WriteHWInfoStr(_In_ HANDLE DevInstRegKeyHandle, _In_ PCWSTR pszwValueName, _In_ PCSTR pszValue);
|
||||||
|
// Set the given source mode on the given path
|
||||||
|
NTSTATUS SetSourceModeAndPath(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode,
|
||||||
|
CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath);
|
||||||
|
|
||||||
|
// Add the current mode to the given monitor source mode set
|
||||||
|
NTSTATUS AddSingleMonitorMode(_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes);
|
||||||
|
|
||||||
|
// Add the current mode to the given VidPn source mode set
|
||||||
|
NTSTATUS AddSingleSourceMode(_In_ CONST DXGK_VIDPNSOURCEMODESET_INTERFACE* pVidPnSourceModeSetInterface,
|
||||||
|
D3DKMDT_HVIDPNSOURCEMODESET hVidPnSourceModeSet,
|
||||||
|
D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceId);
|
||||||
|
|
||||||
|
// Add the current mode (or the matching to pinned source mode) to the give VidPn target mode set
|
||||||
|
NTSTATUS AddSingleTargetMode(_In_ CONST DXGK_VIDPNTARGETMODESET_INTERFACE* pVidPnTargetModeSetInterface,
|
||||||
|
D3DKMDT_HVIDPNTARGETMODESET hVidPnTargetModeSet,
|
||||||
|
_In_opt_ CONST D3DKMDT_VIDPN_SOURCE_MODE* pVidPnPinnedSourceModeInfo,
|
||||||
|
D3DDDI_VIDEO_PRESENT_SOURCE_ID SourceId);
|
||||||
|
D3DDDI_VIDEO_PRESENT_SOURCE_ID FindSourceForTarget(D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId, BOOLEAN DefaultToZero);
|
||||||
|
NTSTATUS IsVidPnSourceModeFieldsValid(CONST D3DKMDT_VIDPN_SOURCE_MODE* pSourceMode) const;
|
||||||
|
NTSTATUS IsVidPnPathFieldsValid(CONST D3DKMDT_VIDPN_PRESENT_PATH* pPath) const;
|
||||||
|
NTSTATUS RegisterHWInfo();
|
||||||
|
};
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
MapFrameBuffer(
|
||||||
|
_In_ PHYSICAL_ADDRESS PhysicalAddress,
|
||||||
|
_In_ ULONG Length,
|
||||||
|
_Outptr_result_bytebuffer_(Length) VOID** VirtualAddress);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
UnmapFrameBuffer(
|
||||||
|
_In_reads_bytes_(Length) VOID* VirtualAddress,
|
||||||
|
_In_ ULONG Length);
|
||||||
|
|
||||||
|
UINT BPPFromPixelFormat(D3DDDIFORMAT Format);
|
||||||
|
D3DDDIFORMAT PixelFormatFromBPP(UINT BPP);
|
||||||
|
UINT SpiceFromPixelFormat(D3DDDIFORMAT Format);
|
||||||
|
|
||||||
|
VOID CopyBitsGeneric(
|
||||||
|
BLT_INFO* pDst,
|
||||||
|
CONST BLT_INFO* pSrc,
|
||||||
|
UINT NumRects,
|
||||||
|
_In_reads_(NumRects) CONST RECT *pRects);
|
||||||
|
|
||||||
|
VOID CopyBits32_32(
|
||||||
|
BLT_INFO* pDst,
|
||||||
|
CONST BLT_INFO* pSrc,
|
||||||
|
UINT NumRects,
|
||||||
|
_In_reads_(NumRects) CONST RECT *pRects);
|
||||||
|
VOID BltBits (
|
||||||
|
BLT_INFO* pDst,
|
||||||
|
CONST BLT_INFO* pSrc,
|
||||||
|
UINT NumRects,
|
||||||
|
_In_reads_(NumRects) CONST RECT *pRects);
|
||||||
|
|
||||||
|
BYTE* GetRowStart(_In_ CONST BLT_INFO* pBltInfo, CONST RECT* pRect);
|
||||||
|
VOID GetPitches(_In_ CONST BLT_INFO* pBltInfo, _Out_ LONG* pPixelPitch, _Out_ LONG* pRowPitch);
|
31
qxldod/buildAll.bat
Executable file
31
qxldod/buildAll.bat
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
call clean.bat
|
||||||
|
|
||||||
|
rem WIN8_64
|
||||||
|
setlocal
|
||||||
|
if exist Install\win8\amd64 rmdir Install\win8\amd64 /s /q
|
||||||
|
call callVisualStudio.bat 12 qxldod.vcxproj /Rebuild "Win8 Release|x64" /Out buildfre_win8_amd64.log
|
||||||
|
mkdir .\Install\Win8\x64
|
||||||
|
del /Q .\Install\Win8\x64\*
|
||||||
|
copy /Y objfre_win8_amd64\amd64\qxldod.sys .\Install\Win8\x64
|
||||||
|
copy /Y objfre_win8_amd64\amd64\qxldod.inf .\Install\Win8\x64
|
||||||
|
copy /Y objfre_win8_amd64\amd64\qxldod.cat .\Install\Win8\x64
|
||||||
|
copy /Y objfre_win8_amd64\amd64\qxldod.pdb .\Install\Win8\x64
|
||||||
|
endlocal
|
||||||
|
if %ERRORLEVEL% NEQ 0 goto :eof
|
||||||
|
|
||||||
|
rem WIN8_32
|
||||||
|
setlocal
|
||||||
|
if exist Install\win8\x86 rmdir Install\win8\x86 /s /q
|
||||||
|
call callVisualStudio.bat 12 qxldod.vcxproj /Rebuild "Win8 Release|Win32" /Out buildfre_win8_x86.log
|
||||||
|
mkdir .\Install\Win8\x86
|
||||||
|
del /Q .\Install\Win8\x86\*
|
||||||
|
copy /Y objfre_win8_x86\i386\qxldod.sys .\Install\Win8\x86
|
||||||
|
copy /Y objfre_win8_x86\i386\qxldod.inf .\Install\Win8\x86
|
||||||
|
copy /Y objfre_win8_x86\i386\qxldod.cat .\Install\Win8\x86
|
||||||
|
copy /Y objfre_win8_x86\i386\qxldod.pdb .\Install\Win8\x86
|
||||||
|
endlocal
|
||||||
|
if %ERRORLEVEL% NEQ 0 goto :eof
|
||||||
|
|
||||||
|
:eof
|
28
qxldod/callVisualStudio.bat
Executable file
28
qxldod/callVisualStudio.bat
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
call %~dp0\checkWin8Tools.bat
|
||||||
|
|
||||||
|
for /f "tokens=*" %%a in (
|
||||||
|
'cscript.exe /nologo "%~dp0\getVisualStudioCmdLine.vbs" %*'
|
||||||
|
) do (
|
||||||
|
set vs_cmd=%%a
|
||||||
|
)
|
||||||
|
|
||||||
|
IF NOT DEFINED vs_cmd (
|
||||||
|
echo Visual Studio not found
|
||||||
|
EXIT /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
SET vs_cmd_no_quotes="%vs_cmd:"=%"
|
||||||
|
IF "vs_cmd_no_quotes" == "" (
|
||||||
|
echo Visual Studio not found
|
||||||
|
EXIT /b 2
|
||||||
|
)
|
||||||
|
|
||||||
|
call %vs_cmd%
|
||||||
|
if %ERRORLEVEL% GEQ 1 (
|
||||||
|
echo Build with Visual Studio FAILED
|
||||||
|
exit /b %ERRORLEVEL%
|
||||||
|
)
|
||||||
|
|
||||||
|
exit /b 0
|
16
qxldod/checkWin8Tools.bat
Executable file
16
qxldod/checkWin8Tools.bat
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
reg query "HKLM\Software\Microsoft\Windows Kits\WDK" /v WDKProductVersion >nul 2>nul
|
||||||
|
if %ERRORLEVEL% EQU 0 goto checkVS12
|
||||||
|
reg query "HKLM\Software\Wow6432Node\Microsoft\Windows Kits\WDK" /v WDKProductVersion > nul 2>nul
|
||||||
|
if %ERRORLEVEL% EQU 0 goto checkVS12
|
||||||
|
echo ERROR building Win8 drivers: Win8 WDK is not installed
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:checkVS12
|
||||||
|
reg query HKLM\Software\Microsoft\VisualStudio\12.0 /v InstallDir > nul 2>nul
|
||||||
|
if %ERRORLEVEL% EQU 0 exit /b 0
|
||||||
|
reg query HKLM\Software\Wow6432Node\Microsoft\VisualStudio\12.0 /v InstallDir > nul 2>nul
|
||||||
|
if %ERRORLEVEL% EQU 0 exit /b 0
|
||||||
|
echo ERROR building Win8 drivers: VS11 is not installed
|
||||||
|
exit /b 2
|
12
qxldod/clean.bat
Executable file
12
qxldod/clean.bat
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
@echo on
|
||||||
|
|
||||||
|
rmdir /S /Q .\Install
|
||||||
|
|
||||||
|
rmdir /S /Q objfre_win8_x86
|
||||||
|
rmdir /S /Q objfre_win8_amd64
|
||||||
|
rmdir /S /Q objchk_win8_x86
|
||||||
|
rmdir /S /Q objchk_win8_amd64
|
||||||
|
|
||||||
|
del /F *.log *.wrn *.err
|
||||||
|
|
||||||
|
|
676
qxldod/driver.cpp
Executable file
676
qxldod/driver.cpp
Executable file
@ -0,0 +1,676 @@
|
|||||||
|
#include "driver.h"
|
||||||
|
#include "QxlDod.h"
|
||||||
|
|
||||||
|
#pragma code_seg(push)
|
||||||
|
#pragma code_seg("INIT")
|
||||||
|
// BEGIN: Init Code
|
||||||
|
|
||||||
|
//
|
||||||
|
// Driver Entry point
|
||||||
|
//
|
||||||
|
|
||||||
|
int nDebugLevel = TRACE_LEVEL_ERROR;
|
||||||
|
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
NTSTATUS
|
||||||
|
DriverEntry(
|
||||||
|
_In_ DRIVER_OBJECT* pDriverObject,
|
||||||
|
_In_ UNICODE_STRING* pRegistryPath)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
|
||||||
|
DbgPrint(TRACE_LEVEL_FATAL, ("---> KMDOD build on on %s %s\n", __DATE__, __TIME__));
|
||||||
|
|
||||||
|
#ifdef DBG
|
||||||
|
// KdBreakPoint();
|
||||||
|
#endif
|
||||||
|
// Initialize DDI function pointers and dxgkrnl
|
||||||
|
KMDDOD_INITIALIZATION_DATA InitialData = {0};
|
||||||
|
|
||||||
|
InitialData.Version = DXGKDDI_INTERFACE_VERSION;
|
||||||
|
|
||||||
|
InitialData.DxgkDdiAddDevice = DodAddDevice;
|
||||||
|
InitialData.DxgkDdiStartDevice = DodStartDevice;
|
||||||
|
InitialData.DxgkDdiStopDevice = DodStopDevice;
|
||||||
|
InitialData.DxgkDdiResetDevice = DodResetDevice;
|
||||||
|
InitialData.DxgkDdiRemoveDevice = DodRemoveDevice;
|
||||||
|
InitialData.DxgkDdiDispatchIoRequest = DodDispatchIoRequest;
|
||||||
|
InitialData.DxgkDdiInterruptRoutine = DodInterruptRoutine;
|
||||||
|
InitialData.DxgkDdiDpcRoutine = DodDpcRoutine;
|
||||||
|
InitialData.DxgkDdiQueryChildRelations = DodQueryChildRelations;
|
||||||
|
InitialData.DxgkDdiQueryChildStatus = DodQueryChildStatus;
|
||||||
|
InitialData.DxgkDdiQueryDeviceDescriptor = DodQueryDeviceDescriptor;
|
||||||
|
InitialData.DxgkDdiSetPowerState = DodSetPowerState;
|
||||||
|
InitialData.DxgkDdiUnload = DodUnload;
|
||||||
|
InitialData.DxgkDdiQueryInterface = DodQueryInterface;
|
||||||
|
InitialData.DxgkDdiQueryAdapterInfo = DodQueryAdapterInfo;
|
||||||
|
InitialData.DxgkDdiSetPointerPosition = DodSetPointerPosition;
|
||||||
|
InitialData.DxgkDdiSetPointerShape = DodSetPointerShape;
|
||||||
|
InitialData.DxgkDdiEscape = DodEscape;
|
||||||
|
InitialData.DxgkDdiIsSupportedVidPn = DodIsSupportedVidPn;
|
||||||
|
InitialData.DxgkDdiRecommendFunctionalVidPn = DodRecommendFunctionalVidPn;
|
||||||
|
InitialData.DxgkDdiEnumVidPnCofuncModality = DodEnumVidPnCofuncModality;
|
||||||
|
InitialData.DxgkDdiSetVidPnSourceVisibility = DodSetVidPnSourceVisibility;
|
||||||
|
InitialData.DxgkDdiCommitVidPn = DodCommitVidPn;
|
||||||
|
InitialData.DxgkDdiUpdateActiveVidPnPresentPath = DodUpdateActiveVidPnPresentPath;
|
||||||
|
InitialData.DxgkDdiRecommendMonitorModes = DodRecommendMonitorModes;
|
||||||
|
InitialData.DxgkDdiQueryVidPnHWCapability = DodQueryVidPnHWCapability;
|
||||||
|
InitialData.DxgkDdiPresentDisplayOnly = DodPresentDisplayOnly;
|
||||||
|
InitialData.DxgkDdiStopDeviceAndReleasePostDisplayOwnership = DodStopDeviceAndReleasePostDisplayOwnership;
|
||||||
|
InitialData.DxgkDdiSystemDisplayEnable = DodSystemDisplayEnable;
|
||||||
|
InitialData.DxgkDdiSystemDisplayWrite = DodSystemDisplayWrite;
|
||||||
|
|
||||||
|
NTSTATUS Status = DxgkInitializeDisplayOnlyDriver(pDriverObject, pRegistryPath, &InitialData);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DbgPrint(TRACE_LEVEL_ERROR, ("DxgkInitializeDisplayOnlyDriver failed with Status: 0x%X\n", Status));
|
||||||
|
}
|
||||||
|
|
||||||
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--- %s\n", __FUNCTION__));
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
// END: Init Code
|
||||||
|
#pragma code_seg(pop)
|
||||||
|
|
||||||
|
#pragma code_seg(push)
|
||||||
|
#pragma code_seg("PAGE")
|
||||||
|
|
||||||
|
//
|
||||||
|
// PnP DDIs
|
||||||
|
//
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodUnload(VOID)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> %s\n", __FUNCTION__));
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodAddDevice(
|
||||||
|
_In_ DEVICE_OBJECT* pPhysicalDeviceObject,
|
||||||
|
_Outptr_ PVOID* ppDeviceContext)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
if ((pPhysicalDeviceObject == NULL) ||
|
||||||
|
(ppDeviceContext == NULL))
|
||||||
|
{
|
||||||
|
DbgPrint(TRACE_LEVEL_ERROR, ("One of pPhysicalDeviceObject (0x%I64x), ppDeviceContext (0x%I64x) is NULL",
|
||||||
|
pPhysicalDeviceObject, ppDeviceContext));
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
*ppDeviceContext = NULL;
|
||||||
|
|
||||||
|
QxlDod* pQxl = new(NonPagedPoolNx) QxlDod(pPhysicalDeviceObject);
|
||||||
|
if (pQxl == NULL)
|
||||||
|
{
|
||||||
|
DbgPrint(TRACE_LEVEL_ERROR, ("pQxl failed to be allocated"));
|
||||||
|
return STATUS_NO_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
*ppDeviceContext = pQxl;
|
||||||
|
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodRemoveDevice(
|
||||||
|
_In_ VOID* pDeviceContext)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
|
||||||
|
if (pQxl)
|
||||||
|
{
|
||||||
|
delete pQxl;
|
||||||
|
pQxl = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodStartDevice(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ DXGK_START_INFO* pDxgkStartInfo,
|
||||||
|
_In_ DXGKRNL_INTERFACE* pDxgkInterface,
|
||||||
|
_Out_ ULONG* pNumberOfViews,
|
||||||
|
_Out_ ULONG* pNumberOfChildren)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->StartDevice(pDxgkStartInfo, pDxgkInterface, pNumberOfViews, pNumberOfChildren);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodStopDevice(
|
||||||
|
_In_ VOID* pDeviceContext)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->StopDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodDispatchIoRequest(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG VidPnSourceId,
|
||||||
|
_In_ VIDEO_REQUEST_PACKET* pVideoRequestPacket)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->DispatchIoRequest(VidPnSourceId, pVideoRequestPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodSetPowerState(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG HardwareUid,
|
||||||
|
_In_ DEVICE_POWER_STATE DevicePowerState,
|
||||||
|
_In_ POWER_ACTION ActionType)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
// If the driver isn't active, SetPowerState can still be called, however in QXL's case
|
||||||
|
// this shouldn't do anything, as it could for instance be called on QXL Fallback after
|
||||||
|
// Fallback has been stopped and QXL PnP is being started. Fallback doesn't have control
|
||||||
|
// of the hardware in this case.
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
return pQxl->SetPowerState(HardwareUid, DevicePowerState, ActionType);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryChildRelations(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_Out_writes_bytes_(ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,
|
||||||
|
_In_ ULONG ChildRelationsSize)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->QueryChildRelations(pChildRelations, ChildRelationsSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryChildStatus(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_Inout_ DXGK_CHILD_STATUS* pChildStatus,
|
||||||
|
_In_ BOOLEAN NonDestructiveOnly)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->QueryChildStatus(pChildStatus, NonDestructiveOnly);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryDeviceDescriptor(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG ChildUid,
|
||||||
|
_Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
// During stress testing of PnPStop, it is possible for QXL Fallback to get called to start then stop in quick succession.
|
||||||
|
// The first call queues a worker thread item indicating that it now has a child device, the second queues a worker thread
|
||||||
|
// item that it no longer has any child device. This function gets called based on the first worker thread item, but after
|
||||||
|
// the driver has been stopped. Therefore instead of asserting like other functions, we only warn.
|
||||||
|
DbgPrint(TRACE_LEVEL_WARNING, ("QXL (0x%I64x) is being called when not active!", pQxl));
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->QueryDeviceDescriptor(ChildUid, pDeviceDescriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// WDDM Display Only Driver DDIs
|
||||||
|
//
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodQueryAdapterInfo(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
return pQxl->QueryAdapterInfo(pQueryAdapterInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetPointerPosition(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->SetPointerPosition(pSetPointerPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetPointerShape(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->SetPointerShape(pSetPointerShape);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodEscape(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_ESCAPE* pEscape
|
||||||
|
)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
return pQxl->Escape(pEscape);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryInterface(
|
||||||
|
_In_ CONST PVOID pDeviceContext,
|
||||||
|
_In_ CONST PQUERY_INTERFACE QueryInterface
|
||||||
|
)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->QueryInterface(QueryInterface);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodPresentDisplayOnly(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPresentDisplayOnly)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->PresentDisplayOnly(pPresentDisplayOnly);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodStopDeviceAndReleasePostDisplayOwnership(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_Out_ DXGK_DISPLAY_INFORMATION* DisplayInfo)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->StopDeviceAndReleasePostDisplayOwnership(TargetId, DisplayInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodIsSupportedVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupportedVidPn)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
// This path might hit because win32k/dxgport doesn't check that an adapter is active when taking the adapter lock.
|
||||||
|
// The adapter lock is the main thing QXL Fallback relies on to not be called while it's inactive. It is still a rare
|
||||||
|
// timing issue around PnpStart/Stop and isn't expected to have any effect on the stability of the system.
|
||||||
|
DbgPrint(TRACE_LEVEL_WARNING, ("QXL (0x%I64x) is being called when not active!", pQxl));
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->IsSupportedVidPn(pIsSupportedVidPn);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendFunctionalVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDFUNCTIONALVIDPN* CONST pRecommendFunctionalVidPn)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->RecommendFunctionalVidPn(pRecommendFunctionalVidPn);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendVidPnTopology(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDVIDPNTOPOLOGY* CONST pRecommendVidPnTopology)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->RecommendVidPnTopology(pRecommendVidPnTopology);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendMonitorModes(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->RecommendMonitorModes(pRecommendMonitorModes);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodEnumVidPnCofuncModality(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModality)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->EnumVidPnCofuncModality(pEnumCofuncModality);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetVidPnSourceVisibility(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->SetVidPnSourceVisibility(pSetVidPnSourceVisibility);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodCommitVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->CommitVidPn(pCommitVidPn);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodUpdateActiveVidPnPresentPath(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_UPDATEACTIVEVIDPNPRESENTPATH* CONST pUpdateActiveVidPnPresentPath)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->UpdateActiveVidPnPresentPath(pUpdateActiveVidPnPresentPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodQueryVidPnHWCapability(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_Inout_ DXGKARG_QUERYVIDPNHWCAPABILITY* pVidPnHWCaps)
|
||||||
|
{
|
||||||
|
PAGED_CODE();
|
||||||
|
QXL_ASSERT_CHK(hAdapter != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(hAdapter);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
return pQxl->QueryVidPnHWCapability(pVidPnHWCaps);
|
||||||
|
}
|
||||||
|
|
||||||
|
//END: Paged Code
|
||||||
|
#pragma code_seg(pop)
|
||||||
|
|
||||||
|
#pragma code_seg(push)
|
||||||
|
#pragma code_seg()
|
||||||
|
// BEGIN: Non-Paged Code
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodDpcRoutine(
|
||||||
|
_In_ VOID* pDeviceContext)
|
||||||
|
{
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
if (!pQxl->IsDriverActive())
|
||||||
|
{
|
||||||
|
QXL_LOG_ASSERTION1("QXL (0x%I64x) is being called when not active!", pQxl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pQxl->DpcRoutine();
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<--- %s\n", __FUNCTION__));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
DodInterruptRoutine(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG MessageNumber)
|
||||||
|
{
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->InterruptRoutine(MessageNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodResetDevice(
|
||||||
|
_In_ VOID* pDeviceContext)
|
||||||
|
{
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
pQxl->ResetDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSystemDisplayEnable(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS Flags,
|
||||||
|
_Out_ UINT* Width,
|
||||||
|
_Out_ UINT* Height,
|
||||||
|
_Out_ D3DDDIFORMAT* ColorFormat)
|
||||||
|
{
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_VERBOSE, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
return pQxl->SystemDisplayEnable(TargetId, Flags, Width, Height, ColorFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
APIENTRY
|
||||||
|
DodSystemDisplayWrite(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ VOID* Source,
|
||||||
|
_In_ UINT SourceWidth,
|
||||||
|
_In_ UINT SourceHeight,
|
||||||
|
_In_ UINT SourceStride,
|
||||||
|
_In_ UINT PositionX,
|
||||||
|
_In_ UINT PositionY)
|
||||||
|
{
|
||||||
|
QXL_ASSERT_CHK(pDeviceContext != NULL);
|
||||||
|
DbgPrint(TRACE_LEVEL_INFORMATION, ("<---> %s\n", __FUNCTION__));
|
||||||
|
|
||||||
|
QxlDod* pQxl = reinterpret_cast<QxlDod*>(pDeviceContext);
|
||||||
|
pQxl->SystemDisplayWrite(Source, SourceWidth, SourceHeight, SourceStride, PositionX, PositionY);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(DBG)
|
||||||
|
|
||||||
|
#define RHEL_DEBUG_PORT ((PUCHAR)0x3F8)
|
||||||
|
#define TEMP_BUFFER_SIZE 256
|
||||||
|
|
||||||
|
void DebugPrintFuncSerial(const char *format, ...)
|
||||||
|
{
|
||||||
|
char buf[TEMP_BUFFER_SIZE];
|
||||||
|
NTSTATUS status;
|
||||||
|
size_t len;
|
||||||
|
va_list list;
|
||||||
|
va_start(list, format);
|
||||||
|
status = RtlStringCbVPrintfA(buf, sizeof(buf), format, list);
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
len = strlen(buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = 2;
|
||||||
|
buf[0] = 'O';
|
||||||
|
buf[1] = '\n';
|
||||||
|
}
|
||||||
|
if (len)
|
||||||
|
{
|
||||||
|
WRITE_PORT_BUFFER_UCHAR(RHEL_DEBUG_PORT, (PUCHAR)buf, (ULONG)len);
|
||||||
|
WRITE_PORT_UCHAR(RHEL_DEBUG_PORT, '\r');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebugPrintFunc(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list list;
|
||||||
|
va_start(list, format);
|
||||||
|
vDbgPrintEx(DPFLTR_DEFAULT_ID, 9 | DPFLTR_MASK, format, list);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma code_seg(pop) // End Non-Paged Code
|
||||||
|
|
255
qxldod/driver.h
Executable file
255
qxldod/driver.h
Executable file
@ -0,0 +1,255 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "BaseObject.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern "C"
|
||||||
|
DRIVER_INITIALIZE DriverEntry;
|
||||||
|
|
||||||
|
//
|
||||||
|
// PnP DDIs
|
||||||
|
//
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodUnload(VOID);
|
||||||
|
|
||||||
|
// If uncommenting ENABLE_DXGK_SAL in the sources file, all the below function prototypes should be updated to use
|
||||||
|
// the function typedef's from the header files. Additionally, annotations on the function definitions can be removed
|
||||||
|
// as they are inherited from the prototype definition here. As an example the entire 4-line prototype for BddDdiAddDevice
|
||||||
|
// is replaced by the single commented line below:
|
||||||
|
// DXGKDDI_ADD_DEVICE BddDdiAddDevice;
|
||||||
|
NTSTATUS
|
||||||
|
DodAddDevice(
|
||||||
|
_In_ DEVICE_OBJECT* pPhysicalDeviceObject,
|
||||||
|
_Outptr_ PVOID* ppDeviceContext);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodRemoveDevice(
|
||||||
|
_In_ VOID* pDeviceContext);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodStartDevice(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ DXGK_START_INFO* pDxgkStartInfo,
|
||||||
|
_In_ DXGKRNL_INTERFACE* pDxgkInterface,
|
||||||
|
_Out_ ULONG* pNumberOfViews,
|
||||||
|
_Out_ ULONG* pNumberOfChildren);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodStopDevice(
|
||||||
|
_In_ VOID* pDeviceContext);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodResetDevice(
|
||||||
|
_In_ VOID* pDeviceContext);
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodDispatchIoRequest(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG VidPnSourceId,
|
||||||
|
_In_ VIDEO_REQUEST_PACKET* pVideoRequestPacket);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodSetPowerState(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG HardwareUid,
|
||||||
|
_In_ DEVICE_POWER_STATE DevicePowerState,
|
||||||
|
_In_ POWER_ACTION ActionType);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryChildRelations(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_Out_writes_bytes_(ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,
|
||||||
|
_In_ ULONG ChildRelationsSize);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryChildStatus(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_Inout_ DXGK_CHILD_STATUS* pChildStatus,
|
||||||
|
_In_ BOOLEAN NonDestructiveOnly);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryDeviceDescriptor(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG ChildUid,
|
||||||
|
_Inout_ DXGK_DEVICE_DESCRIPTOR* pDeviceDescriptor);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
BOOLEAN
|
||||||
|
DodInterruptRoutine(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ ULONG MessageNumber);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
DodDpcRoutine(
|
||||||
|
_In_ VOID* pDeviceContext);
|
||||||
|
|
||||||
|
//
|
||||||
|
// WDDM Display Only Driver DDIs
|
||||||
|
//
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodQueryAdapterInfo(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_QUERYADAPTERINFO* pQueryAdapterInfo);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetPointerPosition(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETPOINTERPOSITION* pSetPointerPosition);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetPointerShape(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodEscape(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_ESCAPE* pEscape);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
DodQueryInterface(
|
||||||
|
_In_ CONST PVOID pDeviceContext,
|
||||||
|
_In_ CONST PQUERY_INTERFACE pQueryInterface);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodPresentDisplayOnly(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_PRESENT_DISPLAYONLY* pPresentDisplayOnly);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodIsSupportedVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_Inout_ DXGKARG_ISSUPPORTEDVIDPN* pIsSupportedVidPn);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendFunctionalVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDFUNCTIONALVIDPN* CONST pRecommendFunctionalVidPn);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendVidPnTopology(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDVIDPNTOPOLOGY* CONST pRecommendVidPnTopology);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodRecommendMonitorModes(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_RECOMMENDMONITORMODES* CONST pRecommendMonitorModes);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodEnumVidPnCofuncModality(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_ENUMVIDPNCOFUNCMODALITY* CONST pEnumCofuncModality);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSetVidPnSourceVisibility(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_SETVIDPNSOURCEVISIBILITY* pSetVidPnSourceVisibility);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodCommitVidPn(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_COMMITVIDPN* CONST pCommitVidPn);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodUpdateActiveVidPnPresentPath(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_In_ CONST DXGKARG_UPDATEACTIVEVIDPNPRESENTPATH* CONST pUpdateActiveVidPnPresentPath);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodQueryVidPnHWCapability(
|
||||||
|
_In_ CONST HANDLE hAdapter,
|
||||||
|
_Inout_ DXGKARG_QUERYVIDPNHWCAPABILITY* pVidPnHWCaps);
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodStopDeviceAndReleasePostDisplayOwnership(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_Out_ DXGK_DISPLAY_INFORMATION* DisplayInfo);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
NTSTATUS
|
||||||
|
APIENTRY
|
||||||
|
DodSystemDisplayEnable(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID TargetId,
|
||||||
|
_In_ PDXGKARG_SYSTEM_DISPLAY_ENABLE_FLAGS Flags,
|
||||||
|
_Out_ UINT* Width,
|
||||||
|
_Out_ UINT* Height,
|
||||||
|
_Out_ D3DDDIFORMAT* ColorFormat);
|
||||||
|
|
||||||
|
// Must be Non-Paged
|
||||||
|
VOID
|
||||||
|
APIENTRY
|
||||||
|
DodSystemDisplayWrite(
|
||||||
|
_In_ VOID* pDeviceContext,
|
||||||
|
_In_ VOID* Source,
|
||||||
|
_In_ UINT SourceWidth,
|
||||||
|
_In_ UINT SourceHeight,
|
||||||
|
_In_ UINT SourceStride,
|
||||||
|
_In_ UINT PositionX,
|
||||||
|
_In_ UINT PositionY);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if DBG
|
||||||
|
|
||||||
|
extern int nDebugLevel;
|
||||||
|
void DebugPrintFuncSerial(const char *format, ...);
|
||||||
|
|
||||||
|
void DebugPrintFunc(const char *format, ...);
|
||||||
|
|
||||||
|
#define DbgPrint(level, line) \
|
||||||
|
if (level > nDebugLevel) {} \
|
||||||
|
else DebugPrintFuncSerial line
|
||||||
|
#else
|
||||||
|
#define DbgPrint(level, line)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// else if (0) DebugPrintFuncSerial line \
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef TRACE_LEVEL_INFORMATION
|
||||||
|
#define TRACE_LEVEL_NONE 0 // Tracing is not on
|
||||||
|
#define TRACE_LEVEL_FATAL 1 // Abnormal exit or termination
|
||||||
|
#define TRACE_LEVEL_ERROR 2 // Severe errors that need logging
|
||||||
|
#define TRACE_LEVEL_WARNING 3 // Warnings such as allocation failure
|
||||||
|
#define TRACE_LEVEL_INFORMATION 4 // Includes non-error cases(e.g.,Entry-Exit)
|
||||||
|
#define TRACE_LEVEL_VERBOSE 5 // Detailed traces from intermediate steps
|
||||||
|
#define TRACE_LEVEL_RESERVED6 6
|
||||||
|
#define TRACE_LEVEL_RESERVED7 7
|
||||||
|
#define TRACE_LEVEL_RESERVED8 8
|
||||||
|
#define TRACE_LEVEL_RESERVED9 9
|
||||||
|
#endif // TRACE_LEVEL_INFORMATION
|
||||||
|
|
||||||
|
#define QXL_LOG_ASSERTION0(Msg) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_LOG_ASSERTION1(Msg,Param1) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_LOG_ASSERTION2(Msg,Param1,Param2) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_LOG_ASSERTION3(Msg,Param1,Param2,Param3) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_LOG_ASSERTION4(Msg,Param1,Param2,Param3,Param4) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_LOG_ASSERTION5(Msg,Param1,Param2,Param3,Param4,Param5) NT_ASSERT(FALSE)
|
||||||
|
#define QXL_ASSERT(exp) {if (!(exp)) {QXL_LOG_ASSERTION0(#exp);}}
|
||||||
|
|
||||||
|
|
||||||
|
#if DBG
|
||||||
|
#define QXL_ASSERT_CHK(exp) QXL_ASSERT(exp)
|
||||||
|
#else
|
||||||
|
#define QXL_ASSERT_CHK(exp) {}
|
||||||
|
#endif
|
28
qxldod/getVisualStudioCmdLine.vbs
Executable file
28
qxldod/getVisualStudioCmdLine.vbs
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
' $1 - Visual studio version to run (10 or 11)
|
||||||
|
' $2 ... Parameters to pass
|
||||||
|
|
||||||
|
Dim strCmdLine, strTemp
|
||||||
|
Set WshShell = Wscript.CreateObject("Wscript.Shell")
|
||||||
|
|
||||||
|
On Error Resume Next
|
||||||
|
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir")
|
||||||
|
' In case of error assume WoW64 case
|
||||||
|
If Err <> 0 Then
|
||||||
|
On Error Goto 0
|
||||||
|
strCmdLine = WshShell.RegRead("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\" + Wscript.Arguments(0) + ".0\InstallDir")
|
||||||
|
End If
|
||||||
|
|
||||||
|
On Error Goto 0
|
||||||
|
strCmdLine = chr(34) + strCmdLine + "devenv.com" + chr(34)
|
||||||
|
For i = 0 to (Wscript.Arguments.Count - 1)
|
||||||
|
If i > 0 Then
|
||||||
|
strTemp = Wscript.Arguments(i)
|
||||||
|
If InStr(strTemp, " ") Or InStr(strTemp, "|") Then
|
||||||
|
strCmdLine = strCmdLine + " " + chr(34) + strTemp + chr(34)
|
||||||
|
Else
|
||||||
|
strCmdLine = strCmdLine + " " + strTemp
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
WScript.Echo strCmdLine + vbCrLf
|
55
qxldod/include/barrier.h
Executable file
55
qxldod/include/barrier.h
Executable file
@ -0,0 +1,55 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _H_SPICE_BARRIER
|
||||||
|
#define _H_SPICE_BARRIER
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
#define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
|
||||||
|
#else
|
||||||
|
//mfence
|
||||||
|
#define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
//__asm not supported on _WIN64, so use macro instead.
|
||||||
|
#define spice_mb MemoryBarrier
|
||||||
|
#else
|
||||||
|
#define spice_mb() __asm {lock add [esp], 0}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _H_SPICE_BARRIER */
|
38
qxldod/include/end-packed.h
Executable file
38
qxldod/include/end-packed.h
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* See start-packed.h for details */
|
||||||
|
|
||||||
|
#undef SPICE_ATTR_PACKED
|
||||||
|
|
||||||
|
#if defined(__MINGW32__) || !defined(__GNUC__)
|
||||||
|
#pragma pack(pop)
|
||||||
|
#endif
|
613
qxldod/include/enums.h
Executable file
613
qxldod/include/enums.h
Executable file
@ -0,0 +1,613 @@
|
|||||||
|
/* this is a file autogenerated by spice_codegen.py */
|
||||||
|
#ifndef _H_SPICE_ENUMS
|
||||||
|
#define _H_SPICE_ENUMS
|
||||||
|
|
||||||
|
/* Generated from spice.proto, don't edit */
|
||||||
|
|
||||||
|
typedef enum SpiceLinkErr {
|
||||||
|
SPICE_LINK_ERR_OK,
|
||||||
|
SPICE_LINK_ERR_ERROR,
|
||||||
|
SPICE_LINK_ERR_INVALID_MAGIC,
|
||||||
|
SPICE_LINK_ERR_INVALID_DATA,
|
||||||
|
SPICE_LINK_ERR_VERSION_MISMATCH,
|
||||||
|
SPICE_LINK_ERR_NEED_SECURED,
|
||||||
|
SPICE_LINK_ERR_NEED_UNSECURED,
|
||||||
|
SPICE_LINK_ERR_PERMISSION_DENIED,
|
||||||
|
SPICE_LINK_ERR_BAD_CONNECTION_ID,
|
||||||
|
SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE,
|
||||||
|
|
||||||
|
SPICE_LINK_ERR_ENUM_END
|
||||||
|
} SpiceLinkErr;
|
||||||
|
|
||||||
|
typedef enum SpiceWarnCode {
|
||||||
|
SPICE_WARN_GENERAL,
|
||||||
|
|
||||||
|
SPICE_WARN_CODE_ENUM_END
|
||||||
|
} SpiceWarnCode;
|
||||||
|
|
||||||
|
typedef enum SpiceInfoCode {
|
||||||
|
SPICE_INFO_GENERAL,
|
||||||
|
|
||||||
|
SPICE_INFO_CODE_ENUM_END
|
||||||
|
} SpiceInfoCode;
|
||||||
|
|
||||||
|
typedef enum SpiceMigrateFlags {
|
||||||
|
SPICE_MIGRATE_NEED_FLUSH = (1 << 0),
|
||||||
|
SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1),
|
||||||
|
|
||||||
|
SPICE_MIGRATE_FLAGS_MASK = 0x3
|
||||||
|
} SpiceMigrateFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceCompositeFlags {
|
||||||
|
SPICE_COMPOSITE_OP0 = (1 << 0),
|
||||||
|
SPICE_COMPOSITE_OP1 = (1 << 1),
|
||||||
|
SPICE_COMPOSITE_OP2 = (1 << 2),
|
||||||
|
SPICE_COMPOSITE_OP3 = (1 << 3),
|
||||||
|
SPICE_COMPOSITE_OP4 = (1 << 4),
|
||||||
|
SPICE_COMPOSITE_OP5 = (1 << 5),
|
||||||
|
SPICE_COMPOSITE_OP6 = (1 << 6),
|
||||||
|
SPICE_COMPOSITE_OP7 = (1 << 7),
|
||||||
|
SPICE_COMPOSITE_SRC_FILTER0 = (1 << 8),
|
||||||
|
SPICE_COMPOSITE_SRC_FILTER1 = (1 << 9),
|
||||||
|
SPICE_COMPOSITE_SRC_FILTER2 = (1 << 10),
|
||||||
|
SPICE_COMPOSITE_MASK_FILTER0 = (1 << 11),
|
||||||
|
SPICE_COMPOSITE_MASK_FITLER1 = (1 << 12),
|
||||||
|
SPICE_COMPOSITE_MASK_FILTER2 = (1 << 13),
|
||||||
|
SPICE_COMPOSITE_SRC_REPEAT0 = (1 << 14),
|
||||||
|
SPICE_COMPOSITE_SRC_REPEAT1 = (1 << 15),
|
||||||
|
SPICE_COMPOSITE_MASK_REPEAT0 = (1 << 16),
|
||||||
|
SPICE_COMPOSITE_MASK_REPEAT1 = (1 << 17),
|
||||||
|
SPICE_COMPOSITE_COMPONENT_ALPHA = (1 << 18),
|
||||||
|
SPICE_COMPOSITE_HAS_MASK = (1 << 19),
|
||||||
|
SPICE_COMPOSITE_HAS_SRC_TRANSFORM = (1 << 20),
|
||||||
|
SPICE_COMPOSITE_HAS_MASK_TRANSFORM = (1 << 21),
|
||||||
|
SPICE_COMPOSITE_SOURCE_OPAQUE = (1 << 22),
|
||||||
|
SPICE_COMPOSITE_MASK_OPAQUE = (1 << 23),
|
||||||
|
SPICE_COMPOSITE_DEST_OPAQUE = (1 << 24),
|
||||||
|
|
||||||
|
SPICE_COMPOSITE_FLAGS_MASK = 0x1ffffff
|
||||||
|
} SpiceCompositeFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceNotifySeverity {
|
||||||
|
SPICE_NOTIFY_SEVERITY_INFO,
|
||||||
|
SPICE_NOTIFY_SEVERITY_WARN,
|
||||||
|
SPICE_NOTIFY_SEVERITY_ERROR,
|
||||||
|
|
||||||
|
SPICE_NOTIFY_SEVERITY_ENUM_END
|
||||||
|
} SpiceNotifySeverity;
|
||||||
|
|
||||||
|
typedef enum SpiceNotifyVisibility {
|
||||||
|
SPICE_NOTIFY_VISIBILITY_LOW,
|
||||||
|
SPICE_NOTIFY_VISIBILITY_MEDIUM,
|
||||||
|
SPICE_NOTIFY_VISIBILITY_HIGH,
|
||||||
|
|
||||||
|
SPICE_NOTIFY_VISIBILITY_ENUM_END
|
||||||
|
} SpiceNotifyVisibility;
|
||||||
|
|
||||||
|
typedef enum SpiceMouseMode {
|
||||||
|
SPICE_MOUSE_MODE_SERVER = (1 << 0),
|
||||||
|
SPICE_MOUSE_MODE_CLIENT = (1 << 1),
|
||||||
|
|
||||||
|
SPICE_MOUSE_MODE_MASK = 0x3
|
||||||
|
} SpiceMouseMode;
|
||||||
|
|
||||||
|
typedef enum SpicePubkeyType {
|
||||||
|
SPICE_PUBKEY_TYPE_INVALID,
|
||||||
|
SPICE_PUBKEY_TYPE_RSA,
|
||||||
|
SPICE_PUBKEY_TYPE_RSA2,
|
||||||
|
SPICE_PUBKEY_TYPE_DSA,
|
||||||
|
SPICE_PUBKEY_TYPE_DSA1,
|
||||||
|
SPICE_PUBKEY_TYPE_DSA2,
|
||||||
|
SPICE_PUBKEY_TYPE_DSA3,
|
||||||
|
SPICE_PUBKEY_TYPE_DSA4,
|
||||||
|
SPICE_PUBKEY_TYPE_DH,
|
||||||
|
SPICE_PUBKEY_TYPE_EC,
|
||||||
|
|
||||||
|
SPICE_PUBKEY_TYPE_ENUM_END
|
||||||
|
} SpicePubkeyType;
|
||||||
|
|
||||||
|
typedef enum SpiceClipType {
|
||||||
|
SPICE_CLIP_TYPE_NONE,
|
||||||
|
SPICE_CLIP_TYPE_RECTS,
|
||||||
|
|
||||||
|
SPICE_CLIP_TYPE_ENUM_END
|
||||||
|
} SpiceClipType;
|
||||||
|
|
||||||
|
typedef enum SpicePathFlags {
|
||||||
|
SPICE_PATH_BEGIN = (1 << 0),
|
||||||
|
SPICE_PATH_END = (1 << 1),
|
||||||
|
SPICE_PATH_CLOSE = (1 << 3),
|
||||||
|
SPICE_PATH_BEZIER = (1 << 4),
|
||||||
|
|
||||||
|
SPICE_PATH_FLAGS_MASK = 0x1b
|
||||||
|
} SpicePathFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceVideoCodecType {
|
||||||
|
SPICE_VIDEO_CODEC_TYPE_MJPEG = 1,
|
||||||
|
|
||||||
|
SPICE_VIDEO_CODEC_TYPE_ENUM_END
|
||||||
|
} SpiceVideoCodecType;
|
||||||
|
|
||||||
|
typedef enum SpiceStreamFlags {
|
||||||
|
SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0),
|
||||||
|
|
||||||
|
SPICE_STREAM_FLAGS_MASK = 0x1
|
||||||
|
} SpiceStreamFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceBrushType {
|
||||||
|
SPICE_BRUSH_TYPE_NONE,
|
||||||
|
SPICE_BRUSH_TYPE_SOLID,
|
||||||
|
SPICE_BRUSH_TYPE_PATTERN,
|
||||||
|
|
||||||
|
SPICE_BRUSH_TYPE_ENUM_END
|
||||||
|
} SpiceBrushType;
|
||||||
|
|
||||||
|
typedef enum SpiceMaskFlags {
|
||||||
|
SPICE_MASK_FLAGS_INVERS = (1 << 0),
|
||||||
|
|
||||||
|
SPICE_MASK_FLAGS_MASK = 0x1
|
||||||
|
} SpiceMaskFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceImageType {
|
||||||
|
SPICE_IMAGE_TYPE_BITMAP,
|
||||||
|
SPICE_IMAGE_TYPE_QUIC,
|
||||||
|
SPICE_IMAGE_TYPE_RESERVED,
|
||||||
|
SPICE_IMAGE_TYPE_LZ_PLT = 100,
|
||||||
|
SPICE_IMAGE_TYPE_LZ_RGB,
|
||||||
|
SPICE_IMAGE_TYPE_GLZ_RGB,
|
||||||
|
SPICE_IMAGE_TYPE_FROM_CACHE,
|
||||||
|
SPICE_IMAGE_TYPE_SURFACE,
|
||||||
|
SPICE_IMAGE_TYPE_JPEG,
|
||||||
|
SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS,
|
||||||
|
SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB,
|
||||||
|
SPICE_IMAGE_TYPE_JPEG_ALPHA,
|
||||||
|
|
||||||
|
SPICE_IMAGE_TYPE_ENUM_END
|
||||||
|
} SpiceImageType;
|
||||||
|
|
||||||
|
typedef enum SpiceImageFlags {
|
||||||
|
SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0),
|
||||||
|
SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1),
|
||||||
|
SPICE_IMAGE_FLAGS_CACHE_REPLACE_ME = (1 << 2),
|
||||||
|
|
||||||
|
SPICE_IMAGE_FLAGS_MASK = 0x7
|
||||||
|
} SpiceImageFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceBitmapFmt {
|
||||||
|
SPICE_BITMAP_FMT_INVALID,
|
||||||
|
SPICE_BITMAP_FMT_1BIT_LE,
|
||||||
|
SPICE_BITMAP_FMT_1BIT_BE,
|
||||||
|
SPICE_BITMAP_FMT_4BIT_LE,
|
||||||
|
SPICE_BITMAP_FMT_4BIT_BE,
|
||||||
|
SPICE_BITMAP_FMT_8BIT,
|
||||||
|
SPICE_BITMAP_FMT_16BIT,
|
||||||
|
SPICE_BITMAP_FMT_24BIT,
|
||||||
|
SPICE_BITMAP_FMT_32BIT,
|
||||||
|
SPICE_BITMAP_FMT_RGBA,
|
||||||
|
SPICE_BITMAP_FMT_8BIT_A,
|
||||||
|
|
||||||
|
SPICE_BITMAP_FMT_ENUM_END
|
||||||
|
} SpiceBitmapFmt;
|
||||||
|
|
||||||
|
typedef enum SpiceBitmapFlags {
|
||||||
|
SPICE_BITMAP_FLAGS_PAL_CACHE_ME = (1 << 0),
|
||||||
|
SPICE_BITMAP_FLAGS_PAL_FROM_CACHE = (1 << 1),
|
||||||
|
SPICE_BITMAP_FLAGS_TOP_DOWN = (1 << 2),
|
||||||
|
|
||||||
|
SPICE_BITMAP_FLAGS_MASK = 0x7
|
||||||
|
} SpiceBitmapFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceJpegAlphaFlags {
|
||||||
|
SPICE_JPEG_ALPHA_FLAGS_TOP_DOWN = (1 << 0),
|
||||||
|
|
||||||
|
SPICE_JPEG_ALPHA_FLAGS_MASK = 0x1
|
||||||
|
} SpiceJpegAlphaFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceImageScaleMode {
|
||||||
|
SPICE_IMAGE_SCALE_MODE_INTERPOLATE,
|
||||||
|
SPICE_IMAGE_SCALE_MODE_NEAREST,
|
||||||
|
|
||||||
|
SPICE_IMAGE_SCALE_MODE_ENUM_END
|
||||||
|
} SpiceImageScaleMode;
|
||||||
|
|
||||||
|
typedef enum SpiceRopd {
|
||||||
|
SPICE_ROPD_INVERS_SRC = (1 << 0),
|
||||||
|
SPICE_ROPD_INVERS_BRUSH = (1 << 1),
|
||||||
|
SPICE_ROPD_INVERS_DEST = (1 << 2),
|
||||||
|
SPICE_ROPD_OP_PUT = (1 << 3),
|
||||||
|
SPICE_ROPD_OP_OR = (1 << 4),
|
||||||
|
SPICE_ROPD_OP_AND = (1 << 5),
|
||||||
|
SPICE_ROPD_OP_XOR = (1 << 6),
|
||||||
|
SPICE_ROPD_OP_BLACKNESS = (1 << 7),
|
||||||
|
SPICE_ROPD_OP_WHITENESS = (1 << 8),
|
||||||
|
SPICE_ROPD_OP_INVERS = (1 << 9),
|
||||||
|
SPICE_ROPD_INVERS_RES = (1 << 10),
|
||||||
|
|
||||||
|
SPICE_ROPD_MASK = 0x7ff
|
||||||
|
} SpiceRopd;
|
||||||
|
|
||||||
|
typedef enum SpiceLineFlags {
|
||||||
|
SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2),
|
||||||
|
SPICE_LINE_FLAGS_STYLED = (1 << 3),
|
||||||
|
|
||||||
|
SPICE_LINE_FLAGS_MASK = 0xc
|
||||||
|
} SpiceLineFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceStringFlags {
|
||||||
|
SPICE_STRING_FLAGS_RASTER_A1 = (1 << 0),
|
||||||
|
SPICE_STRING_FLAGS_RASTER_A4 = (1 << 1),
|
||||||
|
SPICE_STRING_FLAGS_RASTER_A8 = (1 << 2),
|
||||||
|
SPICE_STRING_FLAGS_RASTER_TOP_DOWN = (1 << 3),
|
||||||
|
|
||||||
|
SPICE_STRING_FLAGS_MASK = 0xf
|
||||||
|
} SpiceStringFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceSurfaceFlags {
|
||||||
|
SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0),
|
||||||
|
|
||||||
|
SPICE_SURFACE_FLAGS_MASK = 0x1
|
||||||
|
} SpiceSurfaceFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceSurfaceFmt {
|
||||||
|
SPICE_SURFACE_FMT_INVALID,
|
||||||
|
SPICE_SURFACE_FMT_1_A,
|
||||||
|
SPICE_SURFACE_FMT_8_A = 8,
|
||||||
|
SPICE_SURFACE_FMT_16_555 = 16,
|
||||||
|
SPICE_SURFACE_FMT_32_xRGB = 32,
|
||||||
|
SPICE_SURFACE_FMT_16_565 = 80,
|
||||||
|
SPICE_SURFACE_FMT_32_ARGB = 96,
|
||||||
|
|
||||||
|
SPICE_SURFACE_FMT_ENUM_END
|
||||||
|
} SpiceSurfaceFmt;
|
||||||
|
|
||||||
|
typedef enum SpiceAlphaFlags {
|
||||||
|
SPICE_ALPHA_FLAGS_DEST_HAS_ALPHA = (1 << 0),
|
||||||
|
SPICE_ALPHA_FLAGS_SRC_SURFACE_HAS_ALPHA = (1 << 1),
|
||||||
|
|
||||||
|
SPICE_ALPHA_FLAGS_MASK = 0x3
|
||||||
|
} SpiceAlphaFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceResourceType {
|
||||||
|
SPICE_RES_TYPE_INVALID,
|
||||||
|
SPICE_RES_TYPE_PIXMAP,
|
||||||
|
|
||||||
|
SPICE_RESOURCE_TYPE_ENUM_END
|
||||||
|
} SpiceResourceType;
|
||||||
|
|
||||||
|
typedef enum SpiceKeyboardModifierFlags {
|
||||||
|
SPICE_KEYBOARD_MODIFIER_FLAGS_SCROLL_LOCK = (1 << 0),
|
||||||
|
SPICE_KEYBOARD_MODIFIER_FLAGS_NUM_LOCK = (1 << 1),
|
||||||
|
SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK = (1 << 2),
|
||||||
|
|
||||||
|
SPICE_KEYBOARD_MODIFIER_FLAGS_MASK = 0x7
|
||||||
|
} SpiceKeyboardModifierFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceMouseButton {
|
||||||
|
SPICE_MOUSE_BUTTON_INVALID,
|
||||||
|
SPICE_MOUSE_BUTTON_LEFT,
|
||||||
|
SPICE_MOUSE_BUTTON_MIDDLE,
|
||||||
|
SPICE_MOUSE_BUTTON_RIGHT,
|
||||||
|
SPICE_MOUSE_BUTTON_UP,
|
||||||
|
SPICE_MOUSE_BUTTON_DOWN,
|
||||||
|
|
||||||
|
SPICE_MOUSE_BUTTON_ENUM_END
|
||||||
|
} SpiceMouseButton;
|
||||||
|
|
||||||
|
typedef enum SpiceMouseButtonMask {
|
||||||
|
SPICE_MOUSE_BUTTON_MASK_LEFT = (1 << 0),
|
||||||
|
SPICE_MOUSE_BUTTON_MASK_MIDDLE = (1 << 1),
|
||||||
|
SPICE_MOUSE_BUTTON_MASK_RIGHT = (1 << 2),
|
||||||
|
|
||||||
|
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7
|
||||||
|
} SpiceMouseButtonMask;
|
||||||
|
|
||||||
|
typedef enum SpiceCursorType {
|
||||||
|
SPICE_CURSOR_TYPE_ALPHA,
|
||||||
|
SPICE_CURSOR_TYPE_MONO,
|
||||||
|
SPICE_CURSOR_TYPE_COLOR4,
|
||||||
|
SPICE_CURSOR_TYPE_COLOR8,
|
||||||
|
SPICE_CURSOR_TYPE_COLOR16,
|
||||||
|
SPICE_CURSOR_TYPE_COLOR24,
|
||||||
|
SPICE_CURSOR_TYPE_COLOR32,
|
||||||
|
|
||||||
|
SPICE_CURSOR_TYPE_ENUM_END
|
||||||
|
} SpiceCursorType;
|
||||||
|
|
||||||
|
typedef enum SpiceCursorFlags {
|
||||||
|
SPICE_CURSOR_FLAGS_NONE = (1 << 0),
|
||||||
|
SPICE_CURSOR_FLAGS_CACHE_ME = (1 << 1),
|
||||||
|
SPICE_CURSOR_FLAGS_FROM_CACHE = (1 << 2),
|
||||||
|
|
||||||
|
SPICE_CURSOR_FLAGS_MASK = 0x7
|
||||||
|
} SpiceCursorFlags;
|
||||||
|
|
||||||
|
typedef enum SpiceAudioDataMode {
|
||||||
|
SPICE_AUDIO_DATA_MODE_INVALID,
|
||||||
|
SPICE_AUDIO_DATA_MODE_RAW,
|
||||||
|
SPICE_AUDIO_DATA_MODE_CELT_0_5_1,
|
||||||
|
|
||||||
|
SPICE_AUDIO_DATA_MODE_ENUM_END
|
||||||
|
} SpiceAudioDataMode;
|
||||||
|
|
||||||
|
typedef enum SpiceAudioFmt {
|
||||||
|
SPICE_AUDIO_FMT_INVALID,
|
||||||
|
SPICE_AUDIO_FMT_S16,
|
||||||
|
|
||||||
|
SPICE_AUDIO_FMT_ENUM_END
|
||||||
|
} SpiceAudioFmt;
|
||||||
|
|
||||||
|
typedef enum SpiceTunnelServiceType {
|
||||||
|
SPICE_TUNNEL_SERVICE_TYPE_INVALID,
|
||||||
|
SPICE_TUNNEL_SERVICE_TYPE_GENERIC,
|
||||||
|
SPICE_TUNNEL_SERVICE_TYPE_IPP,
|
||||||
|
|
||||||
|
SPICE_TUNNEL_SERVICE_TYPE_ENUM_END
|
||||||
|
} SpiceTunnelServiceType;
|
||||||
|
|
||||||
|
typedef enum SpiceTunnelIpType {
|
||||||
|
SPICE_TUNNEL_IP_TYPE_INVALID,
|
||||||
|
SPICE_TUNNEL_IP_TYPE_IPv4,
|
||||||
|
|
||||||
|
SPICE_TUNNEL_IP_TYPE_ENUM_END
|
||||||
|
} SpiceTunnelIpType;
|
||||||
|
|
||||||
|
typedef enum SpiceVscMessageType {
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_Init = 1,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_Error,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_ReaderAdd,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_ReaderRemove,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_ATR,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_CardRemove,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_APDU,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_Flush,
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_FlushComplete,
|
||||||
|
|
||||||
|
SPICE_VSC_MESSAGE_TYPE_ENUM_END
|
||||||
|
} SpiceVscMessageType;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_CHANNEL_MAIN = 1,
|
||||||
|
SPICE_CHANNEL_DISPLAY,
|
||||||
|
SPICE_CHANNEL_INPUTS,
|
||||||
|
SPICE_CHANNEL_CURSOR,
|
||||||
|
SPICE_CHANNEL_PLAYBACK,
|
||||||
|
SPICE_CHANNEL_RECORD,
|
||||||
|
SPICE_CHANNEL_TUNNEL,
|
||||||
|
SPICE_CHANNEL_SMARTCARD,
|
||||||
|
SPICE_CHANNEL_USBREDIR,
|
||||||
|
SPICE_CHANNEL_PORT,
|
||||||
|
|
||||||
|
SPICE_END_CHANNEL
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_MIGRATE = 1,
|
||||||
|
SPICE_MSG_MIGRATE_DATA,
|
||||||
|
SPICE_MSG_SET_ACK,
|
||||||
|
SPICE_MSG_PING,
|
||||||
|
SPICE_MSG_WAIT_FOR_CHANNELS,
|
||||||
|
SPICE_MSG_DISCONNECTING,
|
||||||
|
SPICE_MSG_NOTIFY,
|
||||||
|
SPICE_MSG_LIST,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_ACK_SYNC = 1,
|
||||||
|
SPICE_MSGC_ACK,
|
||||||
|
SPICE_MSGC_PONG,
|
||||||
|
SPICE_MSGC_MIGRATE_FLUSH_MARK,
|
||||||
|
SPICE_MSGC_MIGRATE_DATA,
|
||||||
|
SPICE_MSGC_DISCONNECTING,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_BEGIN = 101,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_CANCEL,
|
||||||
|
SPICE_MSG_MAIN_INIT,
|
||||||
|
SPICE_MSG_MAIN_CHANNELS_LIST,
|
||||||
|
SPICE_MSG_MAIN_MOUSE_MODE,
|
||||||
|
SPICE_MSG_MAIN_MULTI_MEDIA_TIME,
|
||||||
|
SPICE_MSG_MAIN_AGENT_CONNECTED,
|
||||||
|
SPICE_MSG_MAIN_AGENT_DISCONNECTED,
|
||||||
|
SPICE_MSG_MAIN_AGENT_DATA,
|
||||||
|
SPICE_MSG_MAIN_AGENT_TOKEN,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_END,
|
||||||
|
SPICE_MSG_MAIN_NAME,
|
||||||
|
SPICE_MSG_MAIN_UUID,
|
||||||
|
SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK,
|
||||||
|
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_NACK,
|
||||||
|
|
||||||
|
SPICE_MSG_END_MAIN
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_MAIN_CLIENT_INFO = 101,
|
||||||
|
SPICE_MSGC_MAIN_MIGRATE_CONNECTED,
|
||||||
|
SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR,
|
||||||
|
SPICE_MSGC_MAIN_ATTACH_CHANNELS,
|
||||||
|
SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST,
|
||||||
|
SPICE_MSGC_MAIN_AGENT_START,
|
||||||
|
SPICE_MSGC_MAIN_AGENT_DATA,
|
||||||
|
SPICE_MSGC_MAIN_AGENT_TOKEN,
|
||||||
|
SPICE_MSGC_MAIN_MIGRATE_END,
|
||||||
|
SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS,
|
||||||
|
SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_MAIN
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_DISPLAY_MODE = 101,
|
||||||
|
SPICE_MSG_DISPLAY_MARK,
|
||||||
|
SPICE_MSG_DISPLAY_RESET,
|
||||||
|
SPICE_MSG_DISPLAY_COPY_BITS,
|
||||||
|
SPICE_MSG_DISPLAY_INVAL_LIST,
|
||||||
|
SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS,
|
||||||
|
SPICE_MSG_DISPLAY_INVAL_PALETTE,
|
||||||
|
SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_CREATE = 122,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_DATA,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_CLIP,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_DESTROY,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_FILL = 302,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_OPAQUE,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_COPY,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_BLEND,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_BLACKNESS,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_WHITENESS,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_INVERS,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_ROP3,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_STROKE,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_TEXT,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_TRANSPARENT,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND,
|
||||||
|
SPICE_MSG_DISPLAY_SURFACE_CREATE,
|
||||||
|
SPICE_MSG_DISPLAY_SURFACE_DESTROY,
|
||||||
|
SPICE_MSG_DISPLAY_STREAM_DATA_SIZED,
|
||||||
|
SPICE_MSG_DISPLAY_MONITORS_CONFIG,
|
||||||
|
SPICE_MSG_DISPLAY_DRAW_COMPOSITE,
|
||||||
|
|
||||||
|
SPICE_MSG_END_DISPLAY
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_DISPLAY_INIT = 101,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_DISPLAY
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_INPUTS_INIT = 101,
|
||||||
|
SPICE_MSG_INPUTS_KEY_MODIFIERS,
|
||||||
|
SPICE_MSG_INPUTS_MOUSE_MOTION_ACK = 111,
|
||||||
|
|
||||||
|
SPICE_MSG_END_INPUTS
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_INPUTS_KEY_DOWN = 101,
|
||||||
|
SPICE_MSGC_INPUTS_KEY_UP,
|
||||||
|
SPICE_MSGC_INPUTS_KEY_MODIFIERS,
|
||||||
|
SPICE_MSGC_INPUTS_KEY_SCANCODE,
|
||||||
|
SPICE_MSGC_INPUTS_MOUSE_MOTION = 111,
|
||||||
|
SPICE_MSGC_INPUTS_MOUSE_POSITION,
|
||||||
|
SPICE_MSGC_INPUTS_MOUSE_PRESS,
|
||||||
|
SPICE_MSGC_INPUTS_MOUSE_RELEASE,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_INPUTS
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_CURSOR_INIT = 101,
|
||||||
|
SPICE_MSG_CURSOR_RESET,
|
||||||
|
SPICE_MSG_CURSOR_SET,
|
||||||
|
SPICE_MSG_CURSOR_MOVE,
|
||||||
|
SPICE_MSG_CURSOR_HIDE,
|
||||||
|
SPICE_MSG_CURSOR_TRAIL,
|
||||||
|
SPICE_MSG_CURSOR_INVAL_ONE,
|
||||||
|
SPICE_MSG_CURSOR_INVAL_ALL,
|
||||||
|
|
||||||
|
SPICE_MSG_END_CURSOR
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_PLAYBACK_DATA = 101,
|
||||||
|
SPICE_MSG_PLAYBACK_MODE,
|
||||||
|
SPICE_MSG_PLAYBACK_START,
|
||||||
|
SPICE_MSG_PLAYBACK_STOP,
|
||||||
|
SPICE_MSG_PLAYBACK_VOLUME,
|
||||||
|
SPICE_MSG_PLAYBACK_MUTE,
|
||||||
|
|
||||||
|
SPICE_MSG_END_PLAYBACK
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_RECORD_START = 101,
|
||||||
|
SPICE_MSG_RECORD_STOP,
|
||||||
|
SPICE_MSG_RECORD_VOLUME,
|
||||||
|
SPICE_MSG_RECORD_MUTE,
|
||||||
|
|
||||||
|
SPICE_MSG_END_RECORD
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_RECORD_DATA = 101,
|
||||||
|
SPICE_MSGC_RECORD_MODE,
|
||||||
|
SPICE_MSGC_RECORD_START_MARK,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_RECORD
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_TUNNEL_INIT = 101,
|
||||||
|
SPICE_MSG_TUNNEL_SERVICE_IP_MAP,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_OPEN,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_FIN,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_CLOSE,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_DATA,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK,
|
||||||
|
SPICE_MSG_TUNNEL_SOCKET_TOKEN,
|
||||||
|
|
||||||
|
SPICE_MSG_END_TUNNEL
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_TUNNEL_SERVICE_ADD = 101,
|
||||||
|
SPICE_MSGC_TUNNEL_SERVICE_REMOVE,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_FIN,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_CLOSED,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_DATA,
|
||||||
|
SPICE_MSGC_TUNNEL_SOCKET_TOKEN,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_TUNNEL
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_SMARTCARD_DATA = 101,
|
||||||
|
|
||||||
|
SPICE_MSG_END_SMARTCARD
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_SMARTCARD_DATA = 101,
|
||||||
|
SPICE_MSGC_SMARTCARD_HEADER = 101,
|
||||||
|
SPICE_MSGC_SMARTCARD_ERROR = 101,
|
||||||
|
SPICE_MSGC_SMARTCARD_ATR = 101,
|
||||||
|
SPICE_MSGC_SMARTCARD_READER_ADD = 101,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_SMARTCARD
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_SPICEVMC_DATA = 101,
|
||||||
|
|
||||||
|
SPICE_MSG_END_SPICEVMC
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_SPICEVMC_DATA = 101,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_SPICEVMC
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSG_PORT_INIT = 201,
|
||||||
|
SPICE_MSG_PORT_EVENT,
|
||||||
|
|
||||||
|
SPICE_MSG_END_PORT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
SPICE_MSGC_PORT_EVENT = 201,
|
||||||
|
|
||||||
|
SPICE_MSGC_END_PORT
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _H_SPICE_ENUMS */
|
136
qxldod/include/ipc_ring.h
Executable file
136
qxldod/include/ipc_ring.h
Executable file
@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _H_SPICE_RING
|
||||||
|
#define _H_SPICE_RING
|
||||||
|
|
||||||
|
#include <include/types.h>
|
||||||
|
|
||||||
|
#define _SPICE_MSB_MASK4(x) \
|
||||||
|
(((x) & 0x8) ? 0x8 : \
|
||||||
|
((x) & 0x4) ? 0x4 : \
|
||||||
|
((x) & 0x2) ? 0x2 : \
|
||||||
|
((x) & 0x1) ? 0x1 : 0)
|
||||||
|
|
||||||
|
#define _SPICE_MSB_MASK8(x) \
|
||||||
|
(((x) & 0xf0) ? _SPICE_MSB_MASK4((x) >> 4) << 4 : _SPICE_MSB_MASK4(x))
|
||||||
|
|
||||||
|
#define _SPICE_MSB_MASK16(x) \
|
||||||
|
(((x) & 0xff00) ? _SPICE_MSB_MASK8((x) >> 8) << 8 : _SPICE_MSB_MASK8(x))
|
||||||
|
|
||||||
|
#define _SPICE_MSB_MASK(x) \
|
||||||
|
(((x) & 0xffff0000) ? _SPICE_MSB_MASK16((x) >> 16) << 16 : _SPICE_MSB_MASK16(x))
|
||||||
|
|
||||||
|
#define _SPICE_POWER2_ALIGN(x) _SPICE_MSB_MASK((x) * 2 - 1)
|
||||||
|
|
||||||
|
|
||||||
|
#define _SPICE_TOSHIFT_4(x) \
|
||||||
|
(((x) & 0x8) ? 3 : \
|
||||||
|
((x) & 0x4) ? 2 : \
|
||||||
|
((x) & 0x2) ? 1 : 0)
|
||||||
|
|
||||||
|
#define _SPICE_TOSHIFT_8(x) \
|
||||||
|
(((x) & 0xf0) ? _SPICE_TOSHIFT_4((x) >> 4) + 4 : _SPICE_TOSHIFT_4(x))
|
||||||
|
|
||||||
|
#define _SPICE_TOSHIFT_16(x) \
|
||||||
|
(((x) & 0xff00) ? _SPICE_TOSHIFT_8((x) >> 8) + 8 : _SPICE_TOSHIFT_8(x))
|
||||||
|
|
||||||
|
#define _SPICE_POWER2_TO_SHIFT(x) \
|
||||||
|
(((x) & 0xffff0000) ? _SPICE_TOSHIFT_16((x) >> 16) + 16 : _SPICE_TOSHIFT_16(x))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define SPICE_RING_DECLARE(name, el_type, size) \
|
||||||
|
typedef struct SPICE_ATTR_PACKED name##_ring_el { \
|
||||||
|
union { \
|
||||||
|
el_type el; \
|
||||||
|
uint8_t data[_SPICE_POWER2_ALIGN(sizeof(el_type))]; \
|
||||||
|
} ; \
|
||||||
|
} name##_ring_el; \
|
||||||
|
\
|
||||||
|
typedef struct SPICE_ATTR_PACKED name { \
|
||||||
|
uint32_t num_items; \
|
||||||
|
uint32_t prod; \
|
||||||
|
uint32_t notify_on_prod; \
|
||||||
|
uint32_t cons; \
|
||||||
|
uint32_t notify_on_cons; \
|
||||||
|
name##_ring_el items[_SPICE_POWER2_ALIGN(size)]; \
|
||||||
|
} name;
|
||||||
|
|
||||||
|
|
||||||
|
#define SPICE_RING_INIT(r) \
|
||||||
|
(r)->num_items = sizeof((r)->items) >> \
|
||||||
|
_SPICE_POWER2_TO_SHIFT(sizeof((r)->items[0])); \
|
||||||
|
(r)->prod = (r)->cons = 0; \
|
||||||
|
(r)->notify_on_prod = 1; \
|
||||||
|
(r)->notify_on_cons = 0;
|
||||||
|
|
||||||
|
|
||||||
|
#define SPICE_RING_INDEX_MASK(r) ((r)->num_items - 1)
|
||||||
|
|
||||||
|
#define SPICE_RING_IS_PACKED(r) (sizeof((r)->items[0]) == sizeof((r)->items[0]).el)
|
||||||
|
|
||||||
|
#define SPICE_RING_IS_EMPTY(r) ((r)->cons == (r)->prod)
|
||||||
|
|
||||||
|
#define SPICE_RING_IS_FULL(r) (((r)->prod - (r)->cons) == (r)->num_items)
|
||||||
|
|
||||||
|
#define SPICE_RING_PROD_ITEM(r) (&(r)->items[(r)->prod & SPICE_RING_INDEX_MASK(r)].el)
|
||||||
|
|
||||||
|
#define SPICE_RING_PROD_WAIT(r, wait) \
|
||||||
|
if (((wait) = SPICE_RING_IS_FULL(r))) { \
|
||||||
|
(r)->notify_on_cons = (r)->cons + 1; \
|
||||||
|
spice_mb(); \
|
||||||
|
(wait) = SPICE_RING_IS_FULL(r); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SPICE_RING_PUSH(r, notify) \
|
||||||
|
(r)->prod++; \
|
||||||
|
spice_mb(); \
|
||||||
|
(notify) = ((r)->prod == (r)->notify_on_prod);
|
||||||
|
|
||||||
|
|
||||||
|
#define SPICE_RING_CONS_ITEM(r) (&(r)->items[(r)->cons & SPICE_RING_INDEX_MASK(r)].el)
|
||||||
|
|
||||||
|
#define SPICE_RING_CONS_WAIT(r, wait) \
|
||||||
|
if (((wait) = SPICE_RING_IS_EMPTY(r))) { \
|
||||||
|
(r)->notify_on_prod = (r)->prod + 1; \
|
||||||
|
spice_mb(); \
|
||||||
|
(wait) = SPICE_RING_IS_EMPTY(r); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SPICE_RING_POP(r, notify) \
|
||||||
|
(r)->cons++; \
|
||||||
|
spice_mb(); \
|
||||||
|
(notify) = ((r)->cons == (r)->notify_on_cons);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _H_SPICE_RING */
|
808
qxldod/include/qxl_dev.h
Executable file
808
qxldod/include/qxl_dev.h
Executable file
@ -0,0 +1,808 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _H_QXL_DEV
|
||||||
|
#define _H_QXL_DEV
|
||||||
|
|
||||||
|
//#include <spice/types.h>
|
||||||
|
#include "barrier.h"
|
||||||
|
#include "ipc_ring.h"
|
||||||
|
#include "enums.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
#include "start-packed.h"
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define CopyRectPoint(dest, src, width, height) \
|
||||||
|
(dest)->left = (src)->x; \
|
||||||
|
(dest)->right = (src)->x + width; \
|
||||||
|
(dest)->top = (src)->y; \
|
||||||
|
(dest)->bottom = (src)->y + height;
|
||||||
|
|
||||||
|
#define CopyRect(dest, src) \
|
||||||
|
(dest)->top = (src)->top; \
|
||||||
|
(dest)->left = (src)->left; \
|
||||||
|
(dest)->bottom = (src)->bottom; \
|
||||||
|
(dest)->right = (src)->right;
|
||||||
|
|
||||||
|
#define CopyPoint(dest, src) \
|
||||||
|
(dest)->x = (src)->x; \
|
||||||
|
(dest)->y = (src)->y;
|
||||||
|
|
||||||
|
|
||||||
|
#define REDHAT_PCI_VENDOR_ID 0x1b36
|
||||||
|
|
||||||
|
/* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */
|
||||||
|
#define QXL_DEVICE_ID_STABLE 0x0100
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_REVISION_STABLE_V04=0x01,
|
||||||
|
QXL_REVISION_STABLE_V06=0x02,
|
||||||
|
QXL_REVISION_STABLE_V10=0x03,
|
||||||
|
QXL_REVISION_STABLE_V12=0x04,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define QXL_DEVICE_ID_DEVEL 0x01ff
|
||||||
|
#define QXL_REVISION_DEVEL 0x01
|
||||||
|
|
||||||
|
#define QXL_ROM_MAGIC (*(const uint32_t*)"QXRO")
|
||||||
|
#define QXL_RAM_MAGIC (*(const uint32_t*)"QXRA")
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_RAM_RANGE_INDEX,
|
||||||
|
QXL_VRAM_RANGE_INDEX,
|
||||||
|
QXL_ROM_RANGE_INDEX,
|
||||||
|
QXL_IO_RANGE_INDEX,
|
||||||
|
|
||||||
|
QXL_PCI_RANGES
|
||||||
|
};
|
||||||
|
|
||||||
|
/* qxl-1 compat: append only */
|
||||||
|
enum {
|
||||||
|
QXL_IO_NOTIFY_CMD,
|
||||||
|
QXL_IO_NOTIFY_CURSOR,
|
||||||
|
QXL_IO_UPDATE_AREA,
|
||||||
|
QXL_IO_UPDATE_IRQ,
|
||||||
|
QXL_IO_NOTIFY_OOM,
|
||||||
|
QXL_IO_RESET,
|
||||||
|
QXL_IO_SET_MODE, /* qxl-1 */
|
||||||
|
QXL_IO_LOG,
|
||||||
|
/* appended for qxl-2 */
|
||||||
|
QXL_IO_MEMSLOT_ADD,
|
||||||
|
QXL_IO_MEMSLOT_DEL,
|
||||||
|
QXL_IO_DETACH_PRIMARY,
|
||||||
|
QXL_IO_ATTACH_PRIMARY,
|
||||||
|
QXL_IO_CREATE_PRIMARY,
|
||||||
|
QXL_IO_DESTROY_PRIMARY,
|
||||||
|
QXL_IO_DESTROY_SURFACE_WAIT,
|
||||||
|
QXL_IO_DESTROY_ALL_SURFACES,
|
||||||
|
/* appended for qxl-3 */
|
||||||
|
QXL_IO_UPDATE_AREA_ASYNC,
|
||||||
|
QXL_IO_MEMSLOT_ADD_ASYNC,
|
||||||
|
QXL_IO_CREATE_PRIMARY_ASYNC,
|
||||||
|
QXL_IO_DESTROY_PRIMARY_ASYNC,
|
||||||
|
QXL_IO_DESTROY_SURFACE_ASYNC,
|
||||||
|
QXL_IO_DESTROY_ALL_SURFACES_ASYNC,
|
||||||
|
QXL_IO_FLUSH_SURFACES_ASYNC,
|
||||||
|
QXL_IO_FLUSH_RELEASE,
|
||||||
|
/* appended for qxl-4 */
|
||||||
|
QXL_IO_MONITORS_CONFIG_ASYNC,
|
||||||
|
|
||||||
|
QXL_IO_RANGE_SIZE
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef uint64_t QXLPHYSICAL;
|
||||||
|
typedef int32_t QXLFIXED; //fixed 28.4
|
||||||
|
|
||||||
|
//typedef struct SPICE_ATTR_PACKED QXLPointFix {
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPointFix {
|
||||||
|
QXLFIXED x;
|
||||||
|
QXLFIXED y;
|
||||||
|
} QXLPointFix;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPoint {
|
||||||
|
int32_t x;
|
||||||
|
int32_t y;
|
||||||
|
} QXLPoint;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPoint16 {
|
||||||
|
int16_t x;
|
||||||
|
int16_t y;
|
||||||
|
} QXLPoint16;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLRect {
|
||||||
|
int32_t top;
|
||||||
|
int32_t left;
|
||||||
|
int32_t bottom;
|
||||||
|
int32_t right;
|
||||||
|
} QXLRect;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLURect {
|
||||||
|
uint32_t top;
|
||||||
|
uint32_t left;
|
||||||
|
uint32_t bottom;
|
||||||
|
uint32_t right;
|
||||||
|
} QXLURect;
|
||||||
|
|
||||||
|
/* qxl-1 compat: append only */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLRom {
|
||||||
|
uint32_t magic;
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t update_id;
|
||||||
|
uint32_t compression_level;
|
||||||
|
uint32_t log_level;
|
||||||
|
uint32_t mode; /* qxl-1 */
|
||||||
|
uint32_t modes_offset;
|
||||||
|
uint32_t num_pages;
|
||||||
|
uint32_t pages_offset; /* qxl-1 */
|
||||||
|
uint32_t draw_area_offset; /* qxl-1 */
|
||||||
|
uint32_t surface0_area_size; /* qxl-1 name: draw_area_size */
|
||||||
|
uint32_t ram_header_offset;
|
||||||
|
uint32_t mm_clock;
|
||||||
|
/* appended for qxl-2 */
|
||||||
|
uint32_t n_surfaces;
|
||||||
|
uint64_t flags;
|
||||||
|
uint8_t slots_start;
|
||||||
|
uint8_t slots_end;
|
||||||
|
uint8_t slot_gen_bits;
|
||||||
|
uint8_t slot_id_bits;
|
||||||
|
uint8_t slot_generation;
|
||||||
|
/* appended for qxl-4 */
|
||||||
|
uint8_t client_present;
|
||||||
|
uint8_t client_capabilities[58];
|
||||||
|
uint32_t client_monitors_config_crc;
|
||||||
|
struct {
|
||||||
|
uint16_t count;
|
||||||
|
uint16_t padding;
|
||||||
|
QXLURect heads[64];
|
||||||
|
} client_monitors_config;
|
||||||
|
} QXLRom;
|
||||||
|
|
||||||
|
#define CLIENT_MONITORS_CONFIG_CRC32_POLY 0xedb88320
|
||||||
|
|
||||||
|
/* qxl-1 compat: fixed */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLMode {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t x_res;
|
||||||
|
uint32_t y_res;
|
||||||
|
uint32_t bits;
|
||||||
|
uint32_t stride;
|
||||||
|
uint32_t x_mili;
|
||||||
|
uint32_t y_mili;
|
||||||
|
uint32_t orientation;
|
||||||
|
} QXLMode;
|
||||||
|
|
||||||
|
/* qxl-1 compat: fixed */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLModes {
|
||||||
|
uint32_t n_modes;
|
||||||
|
QXLMode modes[0];
|
||||||
|
} QXLModes;
|
||||||
|
|
||||||
|
/* qxl-1 compat: append only */
|
||||||
|
typedef enum QXLCmdType {
|
||||||
|
QXL_CMD_NOP,
|
||||||
|
QXL_CMD_DRAW,
|
||||||
|
QXL_CMD_UPDATE,
|
||||||
|
QXL_CMD_CURSOR,
|
||||||
|
QXL_CMD_MESSAGE,
|
||||||
|
QXL_CMD_SURFACE,
|
||||||
|
} QXLCmdType;
|
||||||
|
|
||||||
|
/* qxl-1 compat: fixed */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCommand {
|
||||||
|
QXLPHYSICAL data;
|
||||||
|
uint32_t type;
|
||||||
|
uint32_t padding;
|
||||||
|
} QXLCommand;
|
||||||
|
|
||||||
|
#define QXL_COMMAND_FLAG_COMPAT (1<<0)
|
||||||
|
#define QXL_COMMAND_FLAG_COMPAT_16BPP (2<<0)
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCommandExt {
|
||||||
|
QXLCommand cmd;
|
||||||
|
uint32_t group_id;
|
||||||
|
uint32_t flags;
|
||||||
|
} QXLCommandExt;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLMemSlot {
|
||||||
|
uint64_t mem_start;
|
||||||
|
uint64_t mem_end;
|
||||||
|
} QXLMemSlot;
|
||||||
|
|
||||||
|
#define QXL_SURF_TYPE_PRIMARY 0
|
||||||
|
|
||||||
|
#define QXL_SURF_FLAG_KEEP_DATA (1 << 0)
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLSurfaceCreate {
|
||||||
|
uint32_t width;
|
||||||
|
uint32_t height;
|
||||||
|
int32_t stride;
|
||||||
|
uint32_t format;
|
||||||
|
uint32_t position;
|
||||||
|
uint32_t mouse_mode;
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t type;
|
||||||
|
QXLPHYSICAL mem;
|
||||||
|
} QXLSurfaceCreate;
|
||||||
|
|
||||||
|
#define QXL_COMMAND_RING_SIZE 32
|
||||||
|
#define QXL_CURSOR_RING_SIZE 32
|
||||||
|
#define QXL_RELEASE_RING_SIZE 8
|
||||||
|
|
||||||
|
SPICE_RING_DECLARE(QXLCommandRing, QXLCommand, QXL_COMMAND_RING_SIZE);
|
||||||
|
SPICE_RING_DECLARE(QXLCursorRing, QXLCommand, QXL_CURSOR_RING_SIZE);
|
||||||
|
|
||||||
|
SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, QXL_RELEASE_RING_SIZE);
|
||||||
|
|
||||||
|
#define QXL_LOG_BUF_SIZE 4096
|
||||||
|
|
||||||
|
#define QXL_INTERRUPT_DISPLAY (1 << 0)
|
||||||
|
#define QXL_INTERRUPT_CURSOR (1 << 1)
|
||||||
|
#define QXL_INTERRUPT_IO_CMD (1 << 2)
|
||||||
|
#define QXL_INTERRUPT_ERROR (1 << 3)
|
||||||
|
#define QXL_INTERRUPT_CLIENT (1 << 4)
|
||||||
|
#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG (1 << 5)
|
||||||
|
|
||||||
|
#define QXL_INTERRUPT_MASK (\
|
||||||
|
QXL_INTERRUPT_DISPLAY |\
|
||||||
|
QXL_INTERRUPT_CURSOR |\
|
||||||
|
QXL_INTERRUPT_IO_CMD |\
|
||||||
|
QXL_INTERRUPT_CLIENT_MONITORS_CONFIG)
|
||||||
|
|
||||||
|
/* qxl-1 compat: append only */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLRam {
|
||||||
|
uint32_t magic;
|
||||||
|
uint32_t int_pending;
|
||||||
|
uint32_t int_mask;
|
||||||
|
uint8_t log_buf[QXL_LOG_BUF_SIZE];
|
||||||
|
QXLCommandRing cmd_ring;
|
||||||
|
QXLCursorRing cursor_ring;
|
||||||
|
QXLReleaseRing release_ring;
|
||||||
|
QXLRect update_area;
|
||||||
|
/* appended for qxl-2 */
|
||||||
|
uint32_t update_surface;
|
||||||
|
QXLMemSlot mem_slot;
|
||||||
|
QXLSurfaceCreate create_surface;
|
||||||
|
uint64_t flags;
|
||||||
|
|
||||||
|
/* appended for qxl-4 */
|
||||||
|
|
||||||
|
/* used by QXL_IO_MONITORS_CONFIG_ASYNC */
|
||||||
|
QXLPHYSICAL monitors_config;
|
||||||
|
|
||||||
|
} QXLRam;
|
||||||
|
|
||||||
|
typedef union QXLReleaseInfo {
|
||||||
|
uint64_t id; // in
|
||||||
|
uint64_t next; // out
|
||||||
|
} QXLReleaseInfo;
|
||||||
|
|
||||||
|
typedef struct QXLReleaseInfoExt {
|
||||||
|
QXLReleaseInfo *info;
|
||||||
|
uint32_t group_id;
|
||||||
|
} QXLReleaseInfoExt;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLDataChunk {
|
||||||
|
uint32_t data_size;
|
||||||
|
QXLPHYSICAL prev_chunk;
|
||||||
|
QXLPHYSICAL next_chunk;
|
||||||
|
uint8_t data[0];
|
||||||
|
} QXLDataChunk;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLMessage {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
uint8_t data[0];
|
||||||
|
} QXLMessage;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCompatUpdateCmd {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
QXLRect area;
|
||||||
|
uint32_t update_id;
|
||||||
|
} QXLCompatUpdateCmd;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLUpdateCmd {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
QXLRect area;
|
||||||
|
uint32_t update_id;
|
||||||
|
uint32_t surface_id;
|
||||||
|
} QXLUpdateCmd;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCursorHeader {
|
||||||
|
uint64_t unique;
|
||||||
|
uint16_t type;
|
||||||
|
uint16_t width;
|
||||||
|
uint16_t height;
|
||||||
|
uint16_t hot_spot_x;
|
||||||
|
uint16_t hot_spot_y;
|
||||||
|
} QXLCursorHeader;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCursor {
|
||||||
|
QXLCursorHeader header;
|
||||||
|
uint32_t data_size;
|
||||||
|
QXLDataChunk chunk;
|
||||||
|
} QXLCursor;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_CURSOR_SET,
|
||||||
|
QXL_CURSOR_MOVE,
|
||||||
|
QXL_CURSOR_HIDE,
|
||||||
|
QXL_CURSOR_TRAIL,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define QXL_CURSUR_DEVICE_DATA_SIZE 128
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCursorCmd {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
uint8_t type;
|
||||||
|
union {
|
||||||
|
struct SPICE_ATTR_PACKED {
|
||||||
|
QXLPoint16 position;
|
||||||
|
uint8_t visible;
|
||||||
|
QXLPHYSICAL shape;
|
||||||
|
} set;
|
||||||
|
struct SPICE_ATTR_PACKED {
|
||||||
|
uint16_t length;
|
||||||
|
uint16_t frequency;
|
||||||
|
} trail;
|
||||||
|
QXLPoint16 position;
|
||||||
|
} u;
|
||||||
|
uint8_t device_data[QXL_CURSUR_DEVICE_DATA_SIZE]; //todo: dynamic size from rom
|
||||||
|
} QXLCursorCmd;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_DRAW_NOP,
|
||||||
|
QXL_DRAW_FILL,
|
||||||
|
QXL_DRAW_OPAQUE,
|
||||||
|
QXL_DRAW_COPY,
|
||||||
|
QXL_COPY_BITS,
|
||||||
|
QXL_DRAW_BLEND,
|
||||||
|
QXL_DRAW_BLACKNESS,
|
||||||
|
QXL_DRAW_WHITENESS,
|
||||||
|
QXL_DRAW_INVERS,
|
||||||
|
QXL_DRAW_ROP3,
|
||||||
|
QXL_DRAW_STROKE,
|
||||||
|
QXL_DRAW_TEXT,
|
||||||
|
QXL_DRAW_TRANSPARENT,
|
||||||
|
QXL_DRAW_ALPHA_BLEND,
|
||||||
|
QXL_DRAW_COMPOSITE
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLRasterGlyph {
|
||||||
|
QXLPoint render_pos;
|
||||||
|
QXLPoint glyph_origin;
|
||||||
|
uint16_t width;
|
||||||
|
uint16_t height;
|
||||||
|
uint8_t data[0];
|
||||||
|
} QXLRasterGlyph;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLString {
|
||||||
|
uint32_t data_size;
|
||||||
|
uint16_t length;
|
||||||
|
uint16_t flags;
|
||||||
|
QXLDataChunk chunk;
|
||||||
|
} QXLString;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCopyBits {
|
||||||
|
QXLPoint src_pos;
|
||||||
|
} QXLCopyBits;
|
||||||
|
|
||||||
|
typedef enum QXLEffectType
|
||||||
|
{
|
||||||
|
QXL_EFFECT_BLEND = 0,
|
||||||
|
QXL_EFFECT_OPAQUE = 1,
|
||||||
|
QXL_EFFECT_REVERT_ON_DUP = 2,
|
||||||
|
QXL_EFFECT_BLACKNESS_ON_DUP = 3,
|
||||||
|
QXL_EFFECT_WHITENESS_ON_DUP = 4,
|
||||||
|
QXL_EFFECT_NOP_ON_DUP = 5,
|
||||||
|
QXL_EFFECT_NOP = 6,
|
||||||
|
QXL_EFFECT_OPAQUE_BRUSH = 7
|
||||||
|
} QXLEffectType;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPattern {
|
||||||
|
QXLPHYSICAL pat;
|
||||||
|
QXLPoint pos;
|
||||||
|
} QXLPattern;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLBrush {
|
||||||
|
uint32_t type;
|
||||||
|
union {
|
||||||
|
uint32_t color;
|
||||||
|
QXLPattern pattern;
|
||||||
|
} u;
|
||||||
|
} QXLBrush;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLQMask {
|
||||||
|
uint8_t flags;
|
||||||
|
QXLPoint pos;
|
||||||
|
QXLPHYSICAL bitmap;
|
||||||
|
} QXLQMask;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLFill {
|
||||||
|
QXLBrush brush;
|
||||||
|
uint16_t rop_descriptor;
|
||||||
|
QXLQMask mask;
|
||||||
|
} QXLFill;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLOpaque {
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
QXLBrush brush;
|
||||||
|
uint16_t rop_descriptor;
|
||||||
|
uint8_t scale_mode;
|
||||||
|
QXLQMask mask;
|
||||||
|
} QXLOpaque;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCopy {
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
uint16_t rop_descriptor;
|
||||||
|
uint8_t scale_mode;
|
||||||
|
QXLQMask mask;
|
||||||
|
} QXLCopy, QXLBlend;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLTransparent {
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
uint32_t src_color;
|
||||||
|
uint32_t true_color;
|
||||||
|
} QXLTransparent;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLAlphaBlend {
|
||||||
|
uint16_t alpha_flags;
|
||||||
|
uint8_t alpha;
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
} QXLAlphaBlend;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCompatAlphaBlend {
|
||||||
|
uint8_t alpha;
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
} QXLCompatAlphaBlend;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLRop3 {
|
||||||
|
QXLPHYSICAL src_bitmap;
|
||||||
|
QXLRect src_area;
|
||||||
|
QXLBrush brush;
|
||||||
|
uint8_t rop3;
|
||||||
|
uint8_t scale_mode;
|
||||||
|
QXLQMask mask;
|
||||||
|
} QXLRop3;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLLineAttr {
|
||||||
|
uint8_t flags;
|
||||||
|
uint8_t join_style;
|
||||||
|
uint8_t end_style;
|
||||||
|
uint8_t style_nseg;
|
||||||
|
QXLFIXED width;
|
||||||
|
QXLFIXED miter_limit;
|
||||||
|
QXLPHYSICAL style;
|
||||||
|
} QXLLineAttr;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLStroke {
|
||||||
|
QXLPHYSICAL path;
|
||||||
|
QXLLineAttr attr;
|
||||||
|
QXLBrush brush;
|
||||||
|
uint16_t fore_mode;
|
||||||
|
uint16_t back_mode;
|
||||||
|
} QXLStroke;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLText {
|
||||||
|
QXLPHYSICAL str;
|
||||||
|
QXLRect back_area;
|
||||||
|
QXLBrush fore_brush;
|
||||||
|
QXLBrush back_brush;
|
||||||
|
uint16_t fore_mode;
|
||||||
|
uint16_t back_mode;
|
||||||
|
} QXLText;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLBlackness {
|
||||||
|
QXLQMask mask;
|
||||||
|
} QXLBlackness, QXLInvers, QXLWhiteness;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLClip {
|
||||||
|
uint32_t type;
|
||||||
|
QXLPHYSICAL data;
|
||||||
|
} QXLClip;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
QXL_OP_CLEAR = 0x00,
|
||||||
|
QXL_OP_SOURCE = 0x01,
|
||||||
|
QXL_OP_DST = 0x02,
|
||||||
|
QXL_OP_OVER = 0x03,
|
||||||
|
QXL_OP_OVER_REVERSE = 0x04,
|
||||||
|
QXL_OP_IN = 0x05,
|
||||||
|
QXL_OP_IN_REVERSE = 0x06,
|
||||||
|
QXL_OP_OUT = 0x07,
|
||||||
|
QXL_OP_OUT_REVERSE = 0x08,
|
||||||
|
QXL_OP_ATOP = 0x09,
|
||||||
|
QXL_OP_ATOP_REVERSE = 0x0a,
|
||||||
|
QXL_OP_XOR = 0x0b,
|
||||||
|
QXL_OP_ADD = 0x0c,
|
||||||
|
QXL_OP_SATURATE = 0x0d,
|
||||||
|
/* Note the jump here from 0x0d to 0x30 */
|
||||||
|
QXL_OP_MULTIPLY = 0x30,
|
||||||
|
QXL_OP_SCREEN = 0x31,
|
||||||
|
QXL_OP_OVERLAY = 0x32,
|
||||||
|
QXL_OP_DARKEN = 0x33,
|
||||||
|
QXL_OP_LIGHTEN = 0x34,
|
||||||
|
QXL_OP_COLOR_DODGE = 0x35,
|
||||||
|
QXL_OP_COLOR_BURN = 0x36,
|
||||||
|
QXL_OP_HARD_LIGHT = 0x37,
|
||||||
|
QXL_OP_SOFT_LIGHT = 0x38,
|
||||||
|
QXL_OP_DIFFERENCE = 0x39,
|
||||||
|
QXL_OP_EXCLUSION = 0x3a,
|
||||||
|
QXL_OP_HSL_HUE = 0x3b,
|
||||||
|
QXL_OP_HSL_SATURATION = 0x3c,
|
||||||
|
QXL_OP_HSL_COLOR = 0x3d,
|
||||||
|
QXL_OP_HSL_LUMINOSITY = 0x3e
|
||||||
|
} QXLOperator;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint32_t t00;
|
||||||
|
uint32_t t01;
|
||||||
|
uint32_t t02;
|
||||||
|
uint32_t t10;
|
||||||
|
uint32_t t11;
|
||||||
|
uint32_t t12;
|
||||||
|
} QXLTransform;
|
||||||
|
|
||||||
|
/* The flags field has the following bit fields:
|
||||||
|
*
|
||||||
|
* operator: [ 0 - 7 ]
|
||||||
|
* src_filter: [ 8 - 10 ]
|
||||||
|
* mask_filter: [ 11 - 13 ]
|
||||||
|
* src_repeat: [ 14 - 15 ]
|
||||||
|
* mask_repeat: [ 16 - 17 ]
|
||||||
|
* component_alpha: [ 18 - 18 ]
|
||||||
|
* reserved: [ 19 - 31 ]
|
||||||
|
*
|
||||||
|
* The repeat and filter values are those of pixman:
|
||||||
|
* REPEAT_NONE = 0
|
||||||
|
* REPEAT_NORMAL = 1
|
||||||
|
* REPEAT_PAD = 2
|
||||||
|
* REPEAT_REFLECT = 3
|
||||||
|
*
|
||||||
|
* The filter values are:
|
||||||
|
* FILTER_NEAREST = 0
|
||||||
|
* FILTER_BILINEAR = 1
|
||||||
|
*/
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLComposite {
|
||||||
|
uint32_t flags;
|
||||||
|
|
||||||
|
QXLPHYSICAL src;
|
||||||
|
QXLPHYSICAL src_transform; /* May be NULL */
|
||||||
|
QXLPHYSICAL mask; /* May be NULL */
|
||||||
|
QXLPHYSICAL mask_transform; /* May be NULL */
|
||||||
|
QXLPoint16 src_origin;
|
||||||
|
QXLPoint16 mask_origin;
|
||||||
|
} QXLComposite;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLCompatDrawable {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
uint8_t effect;
|
||||||
|
uint8_t type;
|
||||||
|
uint16_t bitmap_offset;
|
||||||
|
QXLRect bitmap_area;
|
||||||
|
QXLRect bbox;
|
||||||
|
QXLClip clip;
|
||||||
|
uint32_t mm_time;
|
||||||
|
union {
|
||||||
|
QXLFill fill;
|
||||||
|
QXLOpaque opaque;
|
||||||
|
QXLCopy copy;
|
||||||
|
QXLTransparent transparent;
|
||||||
|
QXLCompatAlphaBlend alpha_blend;
|
||||||
|
QXLCopyBits copy_bits;
|
||||||
|
QXLBlend blend;
|
||||||
|
QXLRop3 rop3;
|
||||||
|
QXLStroke stroke;
|
||||||
|
QXLText text;
|
||||||
|
QXLBlackness blackness;
|
||||||
|
QXLInvers invers;
|
||||||
|
QXLWhiteness whiteness;
|
||||||
|
} u;
|
||||||
|
} QXLCompatDrawable;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLDrawable {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
uint32_t surface_id;
|
||||||
|
uint8_t effect;
|
||||||
|
uint8_t type;
|
||||||
|
uint8_t self_bitmap;
|
||||||
|
QXLRect self_bitmap_area;
|
||||||
|
QXLRect bbox;
|
||||||
|
QXLClip clip;
|
||||||
|
uint32_t mm_time;
|
||||||
|
int32_t surfaces_dest[3];
|
||||||
|
QXLRect surfaces_rects[3];
|
||||||
|
union {
|
||||||
|
QXLFill fill;
|
||||||
|
QXLOpaque opaque;
|
||||||
|
QXLCopy copy;
|
||||||
|
QXLTransparent transparent;
|
||||||
|
QXLAlphaBlend alpha_blend;
|
||||||
|
QXLCopyBits copy_bits;
|
||||||
|
QXLBlend blend;
|
||||||
|
QXLRop3 rop3;
|
||||||
|
QXLStroke stroke;
|
||||||
|
QXLText text;
|
||||||
|
QXLBlackness blackness;
|
||||||
|
QXLInvers invers;
|
||||||
|
QXLWhiteness whiteness;
|
||||||
|
QXLComposite composite;
|
||||||
|
} u;
|
||||||
|
} QXLDrawable;
|
||||||
|
|
||||||
|
typedef enum QXLSurfaceCmdType {
|
||||||
|
QXL_SURFACE_CMD_CREATE,
|
||||||
|
QXL_SURFACE_CMD_DESTROY,
|
||||||
|
} QXLSurfaceCmdType;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLSurface {
|
||||||
|
uint32_t format;
|
||||||
|
uint32_t width;
|
||||||
|
uint32_t height;
|
||||||
|
int32_t stride;
|
||||||
|
QXLPHYSICAL data;
|
||||||
|
} QXLSurface;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLSurfaceCmd {
|
||||||
|
QXLReleaseInfo release_info;
|
||||||
|
uint32_t surface_id;
|
||||||
|
uint8_t type;
|
||||||
|
uint32_t flags;
|
||||||
|
union {
|
||||||
|
QXLSurface surface_create;
|
||||||
|
} u;
|
||||||
|
} QXLSurfaceCmd;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLClipRects {
|
||||||
|
uint32_t num_rects;
|
||||||
|
QXLDataChunk chunk;
|
||||||
|
} QXLClipRects;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_PATH_BEGIN = (1 << 0),
|
||||||
|
QXL_PATH_END = (1 << 1),
|
||||||
|
QXL_PATH_CLOSE = (1 << 3),
|
||||||
|
QXL_PATH_BEZIER = (1 << 4),
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPathSeg {
|
||||||
|
uint32_t flags;
|
||||||
|
uint32_t count;
|
||||||
|
QXLPointFix points[0];
|
||||||
|
} QXLPathSeg;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPath {
|
||||||
|
uint32_t data_size;
|
||||||
|
QXLDataChunk chunk;
|
||||||
|
} QXLPath;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
QXL_IMAGE_GROUP_DRIVER,
|
||||||
|
QXL_IMAGE_GROUP_DEVICE,
|
||||||
|
QXL_IMAGE_GROUP_RED,
|
||||||
|
QXL_IMAGE_GROUP_DRIVER_DONT_CACHE,
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLImageID {
|
||||||
|
uint32_t group;
|
||||||
|
uint32_t unique;
|
||||||
|
} QXLImageID;
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
QXLImageID id;
|
||||||
|
uint64_t value;
|
||||||
|
} QXLImageIDUnion;
|
||||||
|
|
||||||
|
typedef enum QXLImageFlags {
|
||||||
|
QXL_IMAGE_CACHE = (1 << 0),
|
||||||
|
QXL_IMAGE_HIGH_BITS_SET = (1 << 1),
|
||||||
|
} QXLImageFlags;
|
||||||
|
|
||||||
|
typedef enum QXLBitmapFlags {
|
||||||
|
QXL_BITMAP_DIRECT = (1 << 0),
|
||||||
|
QXL_BITMAP_UNSTABLE = (1 << 1),
|
||||||
|
QXL_BITMAP_TOP_DOWN = (1 << 2), // == SPICE_BITMAP_FLAGS_TOP_DOWN
|
||||||
|
} QXLBitmapFlags;
|
||||||
|
|
||||||
|
#define QXL_SET_IMAGE_ID(image, _group, _unique) { \
|
||||||
|
(image)->descriptor.id = (((uint64_t)_unique) << 32) | _group; \
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLImageDescriptor {
|
||||||
|
uint64_t id;
|
||||||
|
uint8_t type;
|
||||||
|
uint8_t flags;
|
||||||
|
uint32_t width;
|
||||||
|
uint32_t height;
|
||||||
|
} QXLImageDescriptor;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLPalette {
|
||||||
|
uint64_t unique;
|
||||||
|
uint16_t num_ents;
|
||||||
|
uint32_t ents[0];
|
||||||
|
} QXLPalette;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLBitmap {
|
||||||
|
uint8_t format;
|
||||||
|
uint8_t flags;
|
||||||
|
uint32_t x;
|
||||||
|
uint32_t y;
|
||||||
|
uint32_t stride;
|
||||||
|
QXLPHYSICAL palette;
|
||||||
|
QXLPHYSICAL data; //data[0] ?
|
||||||
|
} QXLBitmap;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLSurfaceId {
|
||||||
|
uint32_t surface_id;
|
||||||
|
} QXLSurfaceId;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLQUICData {
|
||||||
|
uint32_t data_size;
|
||||||
|
uint8_t data[0];
|
||||||
|
} QXLQUICData, QXLLZRGBData, QXLJPEGData;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLImage {
|
||||||
|
QXLImageDescriptor descriptor;
|
||||||
|
union { // variable length
|
||||||
|
QXLBitmap bitmap;
|
||||||
|
QXLQUICData quic;
|
||||||
|
QXLSurfaceId surface_image;
|
||||||
|
};
|
||||||
|
} QXLImage;
|
||||||
|
|
||||||
|
/* A QXLHead is a single monitor output backed by a QXLSurface.
|
||||||
|
* x and y offsets are unsigned since they are used in relation to
|
||||||
|
* the given surface, not the same as the x, y coordinates in the guest
|
||||||
|
* screen reference frame. */
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLHead {
|
||||||
|
uint32_t id;
|
||||||
|
uint32_t surface_id;
|
||||||
|
uint32_t width;
|
||||||
|
uint32_t height;
|
||||||
|
uint32_t x;
|
||||||
|
uint32_t y;
|
||||||
|
uint32_t flags;
|
||||||
|
} QXLHead;
|
||||||
|
|
||||||
|
typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
|
||||||
|
uint16_t count;
|
||||||
|
uint16_t max_allowed; /* If it is 0 no fixed limit is given by the driver */
|
||||||
|
QXLHead heads[0];
|
||||||
|
} QXLMonitorsConfig;
|
||||||
|
|
||||||
|
#include "include/end-packed.h"
|
||||||
|
|
||||||
|
#endif /* _H_QXL_DEV */
|
64
qxldod/include/start-packed.h
Executable file
64
qxldod/include/start-packed.h
Executable file
@ -0,0 +1,64 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Ideally this should all have been macros in a common headers, but
|
||||||
|
* its not possible to put pragmas into header files, so we have
|
||||||
|
* to use include magic.
|
||||||
|
*
|
||||||
|
* Use it like this:
|
||||||
|
*
|
||||||
|
* #include <spice/start-packed.h>
|
||||||
|
*
|
||||||
|
* typedef struct SPICE_ATTR_PACKED {
|
||||||
|
* ...
|
||||||
|
* } Type;
|
||||||
|
*
|
||||||
|
* #include <spice/end-packed.h>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
|
||||||
|
#define SPICE_ATTR_PACKED __attribute__ ((__packed__))
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#pragma pack(push,1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(1)
|
||||||
|
#define SPICE_ATTR_PACKED
|
||||||
|
#pragma warning(disable:4200)
|
||||||
|
#pragma warning(disable:4103)
|
||||||
|
|
||||||
|
#endif
|
397
qxldod/include/stdint.h
Executable file
397
qxldod/include/stdint.h
Executable file
@ -0,0 +1,397 @@
|
|||||||
|
/* ISO C9x 7.18 Integer types <stdint.h>
|
||||||
|
|
||||||
|
* Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* This source code is offered for use in the public domain. You may
|
||||||
|
|
||||||
|
* use, modify or distribute it freely.
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* This code is distributed in the hope that it will be useful but
|
||||||
|
|
||||||
|
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||||
|
|
||||||
|
* DISCLAIMED. This includes but is not limited to warranties of
|
||||||
|
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
*
|
||||||
|
|
||||||
|
* Date: 2000-12-02
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _STDINT_H
|
||||||
|
|
||||||
|
#define _STDINT_H
|
||||||
|
|
||||||
|
#define __need_wint_t
|
||||||
|
|
||||||
|
#define __need_wchar_t
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32_WCE
|
||||||
|
|
||||||
|
typedef _int64 int64_t;
|
||||||
|
|
||||||
|
typedef unsigned _int64 uint64_t;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
typedef long long int64_t;
|
||||||
|
|
||||||
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
|
#endif /* _WIN32_WCE */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.1.1 Exact-width integer types */
|
||||||
|
|
||||||
|
typedef signed char int8_t;
|
||||||
|
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
|
||||||
|
typedef short int16_t;
|
||||||
|
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
|
||||||
|
typedef int int32_t;
|
||||||
|
|
||||||
|
typedef unsigned uint32_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.1.2 Minimum-width integer types */
|
||||||
|
|
||||||
|
typedef signed char int_least8_t;
|
||||||
|
|
||||||
|
typedef unsigned char uint_least8_t;
|
||||||
|
|
||||||
|
typedef short int_least16_t;
|
||||||
|
|
||||||
|
typedef unsigned short uint_least16_t;
|
||||||
|
|
||||||
|
typedef int int_least32_t;
|
||||||
|
|
||||||
|
typedef unsigned uint_least32_t;
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
|
|
||||||
|
typedef long long int_least64_t;
|
||||||
|
|
||||||
|
typedef unsigned long long uint_least64_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.1.3 Fastest minimum-width integer types
|
||||||
|
|
||||||
|
* Not actually guaranteed to be fastest for all purposes
|
||||||
|
|
||||||
|
* Here we use the exact-width types for 8 and 16-bit ints.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef char int_fast8_t;
|
||||||
|
|
||||||
|
typedef unsigned char uint_fast8_t;
|
||||||
|
|
||||||
|
typedef short int_fast16_t;
|
||||||
|
|
||||||
|
typedef unsigned short uint_fast16_t;
|
||||||
|
|
||||||
|
typedef int int_fast32_t;
|
||||||
|
|
||||||
|
typedef unsigned int uint_fast32_t;
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
|
|
||||||
|
typedef long long int_fast64_t;
|
||||||
|
|
||||||
|
typedef unsigned long long uint_fast64_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.1.4 Integer types capable of holding object pointers */
|
||||||
|
|
||||||
|
#ifndef _WIN64
|
||||||
|
|
||||||
|
typedef int intptr_t;
|
||||||
|
|
||||||
|
typedef unsigned uintptr_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 7.18.1.5 Greatest-width integer types */
|
||||||
|
|
||||||
|
#ifndef _WIN32_WCE
|
||||||
|
|
||||||
|
typedef long long intmax_t;
|
||||||
|
|
||||||
|
typedef unsigned long long uintmax_t;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2 Limits of specified-width integer types */
|
||||||
|
|
||||||
|
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2.1 Limits of exact-width integer types */
|
||||||
|
|
||||||
|
#define INT8_MIN (-128)
|
||||||
|
|
||||||
|
#define INT16_MIN (-32768)
|
||||||
|
|
||||||
|
#define INT32_MIN (-2147483647 - 1)
|
||||||
|
|
||||||
|
#define INT64_MIN (-9223372036854775807LL - 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define INT8_MAX 127
|
||||||
|
|
||||||
|
#define INT16_MAX 32767
|
||||||
|
|
||||||
|
#define INT32_MAX 2147483647
|
||||||
|
|
||||||
|
#define INT64_MAX 9223372036854775807LL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define UINT8_MAX 0xff /* 255U */
|
||||||
|
|
||||||
|
#define UINT16_MAX 0xffff /* 65535U */
|
||||||
|
|
||||||
|
#define UINT32_MAX 0xffffffff /* 4294967295U */
|
||||||
|
|
||||||
|
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2.2 Limits of minimum-width integer types */
|
||||||
|
|
||||||
|
#define INT_LEAST8_MIN INT8_MIN
|
||||||
|
|
||||||
|
#define INT_LEAST16_MIN INT16_MIN
|
||||||
|
|
||||||
|
#define INT_LEAST32_MIN INT32_MIN
|
||||||
|
|
||||||
|
#define INT_LEAST64_MIN INT64_MIN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define INT_LEAST8_MAX INT8_MAX
|
||||||
|
|
||||||
|
#define INT_LEAST16_MAX INT16_MAX
|
||||||
|
|
||||||
|
#define INT_LEAST32_MAX INT32_MAX
|
||||||
|
|
||||||
|
#define INT_LEAST64_MAX INT64_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define UINT_LEAST8_MAX UINT8_MAX
|
||||||
|
|
||||||
|
#define UINT_LEAST16_MAX UINT16_MAX
|
||||||
|
|
||||||
|
#define UINT_LEAST32_MAX UINT32_MAX
|
||||||
|
|
||||||
|
#define UINT_LEAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2.3 Limits of fastest minimum-width integer types */
|
||||||
|
|
||||||
|
#define INT_FAST8_MIN INT8_MIN
|
||||||
|
|
||||||
|
#define INT_FAST16_MIN INT16_MIN
|
||||||
|
|
||||||
|
#define INT_FAST32_MIN INT32_MIN
|
||||||
|
|
||||||
|
#define INT_FAST64_MIN INT64_MIN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define INT_FAST8_MAX INT8_MAX
|
||||||
|
|
||||||
|
#define INT_FAST16_MAX INT16_MAX
|
||||||
|
|
||||||
|
#define INT_FAST32_MAX INT32_MAX
|
||||||
|
|
||||||
|
#define INT_FAST64_MAX INT64_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define UINT_FAST8_MAX UINT8_MAX
|
||||||
|
|
||||||
|
#define UINT_FAST16_MAX UINT16_MAX
|
||||||
|
|
||||||
|
#define UINT_FAST32_MAX UINT32_MAX
|
||||||
|
|
||||||
|
#define UINT_FAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2.4 Limits of integer types capable of holding
|
||||||
|
|
||||||
|
object pointers */
|
||||||
|
|
||||||
|
#define INTPTR_MIN INT32_MIN
|
||||||
|
|
||||||
|
#define INTPTR_MAX INT32_MAX
|
||||||
|
|
||||||
|
#define UINTPTR_MAX UINT32_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.2.5 Limits of greatest-width integer types */
|
||||||
|
|
||||||
|
#define INTMAX_MIN INT64_MIN
|
||||||
|
|
||||||
|
#define INTMAX_MAX INT64_MAX
|
||||||
|
|
||||||
|
#define UINTMAX_MAX UINT64_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.3 Limits of other integer types */
|
||||||
|
|
||||||
|
#define PTRDIFF_MIN INT32_MIN
|
||||||
|
|
||||||
|
#define PTRDIFF_MAX INT32_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define SIG_ATOMIC_MIN INT32_MIN
|
||||||
|
|
||||||
|
#define SIG_ATOMIC_MAX INT32_MAX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SIZE_MAX
|
||||||
|
#define SIZE_MAX UINT32_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef WCHAR_MIN /* also in wchar.h */
|
||||||
|
|
||||||
|
#define WCHAR_MIN 0
|
||||||
|
|
||||||
|
#define WCHAR_MAX 0xffff /* UINT16_MAX */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
* wint_t is unsigned short for compatibility with MS runtime
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define WINT_MIN 0
|
||||||
|
|
||||||
|
#define WINT_MAX 0xffff /* UINT16_MAX */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.4 Macros for integer constants */
|
||||||
|
|
||||||
|
#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.4.1 Macros for minimum-width integer constants
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Accoding to Douglas Gwyn <gwyn@arl.mil>:
|
||||||
|
|
||||||
|
"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
|
||||||
|
|
||||||
|
9899:1999 as initially published, the expansion was required
|
||||||
|
|
||||||
|
to be an integer constant of precisely matching type, which
|
||||||
|
|
||||||
|
is impossible to accomplish for the shorter types on most
|
||||||
|
|
||||||
|
platforms, because C99 provides no standard way to designate
|
||||||
|
|
||||||
|
an integer constant with width less than that of type int.
|
||||||
|
|
||||||
|
TC1 changed this to require just an integer constant
|
||||||
|
|
||||||
|
*expression* with *promoted* type."
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define INT8_C(val) ((int8_t) + (val))
|
||||||
|
|
||||||
|
#define UINT8_C(val) ((uint8_t) + (val##U))
|
||||||
|
|
||||||
|
#define INT16_C(val) ((int16_t) + (val))
|
||||||
|
|
||||||
|
#define UINT16_C(val) ((uint16_t) + (val##U))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define INT32_C(val) val##L
|
||||||
|
|
||||||
|
#define UINT32_C(val) val##UL
|
||||||
|
|
||||||
|
#define INT64_C(val) val##LL
|
||||||
|
|
||||||
|
#define UINT64_C(val) val##ULL
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 7.18.4.2 Macros for greatest-width integer constants */
|
||||||
|
|
||||||
|
#define INTMAX_C(val) INT64_C(val)
|
||||||
|
|
||||||
|
#define UINTMAX_C(val) UINT64_C(val)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
41
qxldod/include/types.h
Executable file
41
qxldod/include/types.h
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
/*
|
||||||
|
Copyright (C) 2009 Red Hat, Inc.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in
|
||||||
|
the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
|
||||||
|
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _H_SPICE_TYPES
|
||||||
|
#define _H_SPICE_TYPES
|
||||||
|
|
||||||
|
/* We always want the standard int types
|
||||||
|
* If they are not in stdint.h on your system,
|
||||||
|
* include the right one here. */
|
||||||
|
#include <include/stdint.h>
|
||||||
|
//#include <limits.h>
|
||||||
|
|
||||||
|
#endif /* _H_SPICE_TYPES */
|
2437
qxldod/mspace.c
Executable file
2437
qxldod/mspace.c
Executable file
File diff suppressed because it is too large
Load Diff
150
qxldod/mspace.h
Executable file
150
qxldod/mspace.h
Executable file
@ -0,0 +1,150 @@
|
|||||||
|
#ifndef _H_MSPACE
|
||||||
|
#define _H_MSPACE
|
||||||
|
|
||||||
|
#define NO_MALLINFO 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
//typedef unsigned long size_t;
|
||||||
|
typedef void (*mspace_abort_t)(void *user_data);
|
||||||
|
typedef void (*mspace_print_t)(void *user_data, char *format, ...);
|
||||||
|
|
||||||
|
void mspace_set_abort_func(mspace_abort_t f);
|
||||||
|
void mspace_set_print_func(mspace_print_t f);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace is an opaque type representing an independent
|
||||||
|
region of space that supports mspace_malloc, etc.
|
||||||
|
*/
|
||||||
|
typedef void* mspace;
|
||||||
|
|
||||||
|
/*
|
||||||
|
create_mspace creates and returns a new independent space with the
|
||||||
|
given initial capacity, or, if 0, the default granularity size. It
|
||||||
|
returns null if there is no system memory available to create the
|
||||||
|
space. If argument locked is non-zero, the space uses a separate
|
||||||
|
lock to control access. The capacity of the space will grow
|
||||||
|
dynamically as needed to service mspace_malloc requests. You can
|
||||||
|
control the sizes of incremental increases of this space by
|
||||||
|
compiling with a different DEFAULT_GRANULARITY or dynamically
|
||||||
|
setting with mallopt(M_GRANULARITY, value).
|
||||||
|
*/
|
||||||
|
//mspace create_mspace(size_t capacity, int locked);
|
||||||
|
|
||||||
|
/*
|
||||||
|
destroy_mspace destroys the given space, and attempts to return all
|
||||||
|
of its memory back to the system, returning the total number of
|
||||||
|
bytes freed. After destruction, the results of access to all memory
|
||||||
|
used by the space become undefined.
|
||||||
|
*/
|
||||||
|
//size_t destroy_mspace(mspace msp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
create_mspace_with_base uses the memory supplied as the initial base
|
||||||
|
of a new mspace. Part (less than 128*sizeof(size_t) bytes) of this
|
||||||
|
space is used for bookkeeping, so the capacity must be at least this
|
||||||
|
large. (Otherwise 0 is returned.) When this initial space is
|
||||||
|
exhausted, additional memory will be obtained from the system.
|
||||||
|
Destroying this space will deallocate all additionally allocated
|
||||||
|
space (if possible) but not the initial base.
|
||||||
|
*/
|
||||||
|
mspace create_mspace_with_base(void* base, size_t capacity, int locked, void *user_data);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_malloc behaves as malloc, but operates within
|
||||||
|
the given space.
|
||||||
|
*/
|
||||||
|
void* mspace_malloc(mspace msp, size_t bytes);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_free behaves as free, but operates within
|
||||||
|
the given space.
|
||||||
|
|
||||||
|
If compiled with FOOTERS==1, mspace_free is not actually needed.
|
||||||
|
free may be called instead of mspace_free because freed chunks from
|
||||||
|
any space are handled by their originating spaces.
|
||||||
|
*/
|
||||||
|
void mspace_free(mspace msp, void* mem);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_realloc behaves as realloc, but operates within
|
||||||
|
the given space.
|
||||||
|
|
||||||
|
If compiled with FOOTERS==1, mspace_realloc is not actually
|
||||||
|
needed. realloc may be called instead of mspace_realloc because
|
||||||
|
realloced chunks from any space are handled by their originating
|
||||||
|
spaces.
|
||||||
|
*/
|
||||||
|
void* mspace_realloc(mspace msp, void* mem, size_t newsize);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_calloc behaves as calloc, but operates within
|
||||||
|
the given space.
|
||||||
|
*/
|
||||||
|
void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_memalign behaves as memalign, but operates within
|
||||||
|
the given space.
|
||||||
|
*/
|
||||||
|
void* mspace_memalign(mspace msp, size_t alignment, size_t bytes);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_independent_calloc behaves as independent_calloc, but
|
||||||
|
operates within the given space.
|
||||||
|
*/
|
||||||
|
//void** mspace_independent_calloc(mspace msp, size_t n_elements,
|
||||||
|
// size_t elem_size, void* chunks[]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_independent_comalloc behaves as independent_comalloc, but
|
||||||
|
operates within the given space.
|
||||||
|
*/
|
||||||
|
//void** mspace_independent_comalloc(mspace msp, size_t n_elements,
|
||||||
|
// size_t sizes[], void* chunks[]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_footprint() returns the number of bytes obtained from the
|
||||||
|
system for this space.
|
||||||
|
*/
|
||||||
|
size_t mspace_footprint(mspace msp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_max_footprint() returns the peak number of bytes obtained from the
|
||||||
|
system for this space.
|
||||||
|
*/
|
||||||
|
size_t mspace_max_footprint(mspace msp);
|
||||||
|
|
||||||
|
|
||||||
|
#if !NO_MALLINFO
|
||||||
|
/*
|
||||||
|
mspace_mallinfo behaves as mallinfo, but reports properties of
|
||||||
|
the given space.
|
||||||
|
*/
|
||||||
|
struct mallinfo mspace_mallinfo(mspace msp);
|
||||||
|
#endif /* NO_MALLINFO */
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_malloc_stats behaves as malloc_stats, but reports
|
||||||
|
properties of the given space.
|
||||||
|
*/
|
||||||
|
void mspace_malloc_stats(mspace msp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
mspace_trim behaves as malloc_trim, but
|
||||||
|
operates within the given space.
|
||||||
|
*/
|
||||||
|
//int mspace_trim(mspace msp, size_t pad);
|
||||||
|
|
||||||
|
/*
|
||||||
|
An alias for mallopt.
|
||||||
|
*/
|
||||||
|
int mspace_mallopt(int, int);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}; /* end of extern "C" */
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif
|
BIN
qxldod/qxldod.inf
Executable file
BIN
qxldod/qxldod.inf
Executable file
Binary file not shown.
BIN
qxldod/qxldod.rc
Executable file
BIN
qxldod/qxldod.rc
Executable file
Binary file not shown.
290
qxldod/qxldod.vcxproj
Executable file
290
qxldod/qxldod.vcxproj
Executable file
@ -0,0 +1,290 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Win8.1 Debug|Win32">
|
||||||
|
<Configuration>Win8.1 Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Debug|Win32">
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Release|Win32">
|
||||||
|
<Configuration>Win8.1 Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Release|Win32">
|
||||||
|
<Configuration>Win8 Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Debug|x64">
|
||||||
|
<Configuration>Win8.1 Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Debug|x64">
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8.1 Release|x64">
|
||||||
|
<Configuration>Win8.1 Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Win8 Release|x64">
|
||||||
|
<Configuration>Win8 Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{A6F48FC7-97E9-48EC-BCDF-1E4F9B43AADD}</ProjectGuid>
|
||||||
|
<TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
|
||||||
|
<Configuration>Win8 Debug</Configuration>
|
||||||
|
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<RootNamespace>qxldod</RootNamespace>
|
||||||
|
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VisualStudioVersion)' == '11.0'">$(VCTargetsPath11)</VCTargetsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="PropertySheets">
|
||||||
|
<ConfigurationType>Driver</ConfigurationType>
|
||||||
|
<DriverType>WDM</DriverType>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
|
||||||
|
<TargetVersion>WindowsV6.3</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'" Label="Configuration">
|
||||||
|
<TargetVersion>Windows8</TargetVersion>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
|
||||||
|
<OutDir>objchk_win8_x86\i386\</OutDir>
|
||||||
|
<IntDir>objchk_win8_x86\i386\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
|
||||||
|
<OutDir>objchk_win8_x86\i386\</OutDir>
|
||||||
|
<IntDir>objchk_win8_x86\i386\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
|
||||||
|
<OutDir>objfre_win8_x86\i386\</OutDir>
|
||||||
|
<IntDir>objfre_win8_x86\i386\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
|
||||||
|
<OutDir>objfre_win8_x86\i386\</OutDir>
|
||||||
|
<IntDir>objfre_win8_x86\i386\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
|
||||||
|
<OutDir>objfre_win8_amd64\amd64\</OutDir>
|
||||||
|
<IntDir>objfre_win8_amd64\amd64\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
|
||||||
|
<OutDir>objfre_win8_amd64\amd64\</OutDir>
|
||||||
|
<IntDir>objfre_win8_amd64\amd64\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
|
||||||
|
<OutDir>objchk_win8_amd64\amd64\</OutDir>
|
||||||
|
<IntDir>objchk_win8_amd64\amd64\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
|
||||||
|
<OutDir>objchk_win8_amd64\amd64\</OutDir>
|
||||||
|
<IntDir>objchk_win8_amd64\amd64\</IntDir>
|
||||||
|
<TargetName>qxldod</TargetName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|Win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<ExceptionHandling>
|
||||||
|
</ExceptionHandling>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X86</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<ExceptionHandling />
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X86</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|Win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X86</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X86</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Debug|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X64</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X64</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8.1 Release|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X64</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\displib.lib;$(DDK_LIB_PATH)\ntoskrnl.lib;$(DDK_LIB_PATH)\hal.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ResourceCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(DDK_INC_PATH);$(SDK_INC_PATH);.\Include</AdditionalIncludeDirectories>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
</ClCompile>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>Inf2Cat /driver:$(OutDir) /os:8_X64</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Inf Include="qxldod.inf" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<FilesToPackage Include="$(TargetPath)" />
|
||||||
|
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="BaseObject.h" />
|
||||||
|
<ClInclude Include="driver.h" />
|
||||||
|
<ClInclude Include="QxlDod.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="BaseObject.cpp" />
|
||||||
|
<ClCompile Include="driver.cpp" />
|
||||||
|
<ClCompile Include="mspace.c" />
|
||||||
|
<ClCompile Include="QxlDod.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="qxldod.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
59
qxldod/qxldod.vcxproj.filters
Executable file
59
qxldod/qxldod.vcxproj.filters
Executable file
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Driver Files">
|
||||||
|
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
|
||||||
|
<Extensions>inf;inv;inx;mof;mc;</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Inf Include="qxldod.inf">
|
||||||
|
<Filter>Driver Files</Filter>
|
||||||
|
</Inf>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="BaseObject.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="driver.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="QxlDod.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="BaseObject.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="driver.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="QxlDod.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="mspace.c">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="qxldod.rc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
14
qxldod/resource.h
Executable file
14
qxldod/resource.h
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ generated include file.
|
||||||
|
// Used by qxldod.rc
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user