Paul Durrant [Mon, 6 Sep 2021 13:35:29 +0000 (14:35 +0100)]
Fix build with later WDKs
- Adds alias for GetProjectInfoForReference target to version.vcxproj
Later kits seemed to have renamed the build target, and will fail without
this alias target.
- Adds "/fd sha256" to signtool command line
WDK 20344 and later require binaries signed with a SHA256 file digest, or
the build outputs are deleted
- Squash warnings 4061 and 26052 to avoid bogus noise.
Owen Smith [Fri, 5 Mar 2021 10:36:03 +0000 (10:36 +0000)]
Add CodeQL build stage
CodeQL logs will be required for future WHQL submissions. Add a stage
that generates the required SARIF files. CodeQL is a semantic code
analysis engine, which will highlight vunerabilities that will need
fixing.
In order to use CodeQL, the CodeQL binaries must be on the path and the
Windows-Driver-Developer-Supplemental-Tools must be on the path defined
by the CODEQL_QUERY_SUITE environment variable (if defined), or under
the parent folder (if CODEQL_QUERY_SUITE variable is not defined)
Note: Due to the way the codeql command line is built, using quotes in a
MSBuild command line is not possible, so generate a batch file to wrap
the command line.
Paul Durrant [Mon, 22 Feb 2021 10:10:40 +0000 (10:10 +0000)]
Bring XENBUS interface versions up to date...
... and update binding accordingly. Also remove PDO revisions 0x09000000 and
0x09000001 as they rely on versions of the XENBUS_STORE interface that are
no longer supported.
Inherit versioning info from environment if present
As the drivers stabilize and mature, there is an ever-growing
chance that other opensource virtualization projects will adopt
them. Allow external projects to inject their own versioning
into the drivers instead of hardcoding the latest winpv version.
Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com> Acked-by: Owen Smith <owen.smith@citrix.com>
Often times we only need to build a driver for a single
targeted architecture. Continue to build both by default,
but allow the user to specify one if desired.
Signed-off-by: Nicholas Tsirakis <tsirakisn@ainfosec.com>
Use [string]::IsNullOrEmpty($Arch)
These bugchecks have been observed in recent updates of Server 2019.
This patch, rather than replacing calls to MmAllocatePagesForMdlEx() with
calls to MmMapLockedPagesSpecifyCache(), just avoids passing
MM_DONT_ZERO_ALLOCATION to work round the bug.
The patch instead passes MM_ALLOCATE_FULLY_REQUIRED, which arguably should
have always been passed for allocations larger than a single page. It also
fixes a formatting issue.
Reported-by: Jan Bakuwel <jan.bakuwel@gmail.com> Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Paul Durrant [Thu, 5 Dec 2019 17:05:39 +0000 (17:05 +0000)]
Fix the revision table
XENVKBD delegates interface queries for XENBUS_STORE and XENBUS_SUSPEND
and hence it should encode revisions for these and create PDOs with
appropriate CompatibleIDs.
Owen Smith [Fri, 14 Jun 2019 15:16:06 +0000 (16:16 +0100)]
Add PowerShell build scripts, version.vcxproj
Based on the sequence of commits to xenbus, add powershell scripts to
build the solution using the EWDK
version.vcxproj generates versioned files (version.h and xenvkbd.inf) using
scripts/genfiles.ps1
Strips duplicated functionality from build.py to produce consistent
builds between python and powershell.
Owen Smith [Fri, 24 Aug 2018 16:46:43 +0000 (17:46 +0100)]
Conditionally package DPInst
Since DPInst.exe is not shipped with the Windows Driver Kit 10, an
environment variable must point to local copies. Make the inclusion of
DPInst conditional on DPINST_REDIST being defined and that path
existing. This simplifies building packages which do not require DPInst
for installation, and removes a required step to create a working build.
Paul Durrant [Thu, 19 Jul 2018 11:21:46 +0000 (12:21 +0100)]
Work around yet another bug in SDV
It appears that SDV objects to the symbol 'Constrain' being defined,
presumably because it uses it internally in some way. This patch
therefore re-codes the static inline Constrain function in ring.c as a
macro to avoid the clash.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 1 Feb 2018 14:33:14 +0000 (14:33 +0000)]
Dynamically build key-code to usage map
This patch creates a header defining the linux keycodes used by the
vkbd protocol and macros to map those (by name) to HID usage codes.
A new function then makes use of these of the new definitions and macros
to create a direct mapping from key-code to usage dynamically during
ring initialization.
The patch also adds missing locking inside the DPC and a shutdown race
which could occasionally free the ring structure from underneath the DPC.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Wed, 31 Jan 2018 17:06:11 +0000 (17:06 +0000)]
Fix HID code for KEY_ENTER
The VkbdKeyCodeToUsage array has the value for KEY_ESCAPE (0x29)
incorrectly placed in this entry. This patch replaces that with 0x28, which
is the correct code for the ENTER key.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Paul Durrant [Thu, 25 Jan 2018 14:11:08 +0000 (14:11 +0000)]
Make sure Mdl->StartVa is set by __AllocatePages()
wdm.h carries this comment:
// Notice that while in the context of the subject thread, the base virtual
// address of a buffer mapped by an MDL may be referenced using the
// following:
//
// Mdl->StartVa | Mdl->ByteOffset
//
Hence it is important that a mapped MDL has a valid StartVa field as well
as a valid MappedSystemVa field. Unfortunately, for reasons best known to
Microsoft, MmMapLockedPagesSpecifyCache() does not ensure this is the
case, so it needs to be fixed up by __AllocatePages() itself.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Owen Smith [Thu, 20 Jul 2017 11:22:54 +0000 (12:22 +0100)]
Update kbdif.h and use feature-raw-pointer
Updates the xen public header to include the definition of
[feature|request]-raw-pointer.
Renames VkbdStandalone to RawPointer and uses the newly defined feature
and request names.
Paul Durrant [Mon, 12 Jun 2017 10:15:21 +0000 (11:15 +0100)]
Remove the SDV run from build.py
SDV appears to be broken for this driver as follows:
SDV is building for <Windows 10 Release|x64>
Build 'xenvkbd' ... Done
The call to Slamcl returned with exit code:=1.
This happened while compiling compile6.cmd.
The compile step failed for 'xenvkbd' .
SDV exit code: 5
SDV encountered errors when scanning the driver. Please ensure roletypes are present and/or consult SDV documentation.
C:\Program Files (x86)\Windows Kits\10\build\windowsdriver.Sdv.targets(120,9): error MSB3075: The command "staticdv.exe /check:default.sdv" exited with code 5. Please verify that you have sufficient rights to run this command. [C:\Jenkins\Workspace\XENVKBD-master\vs2015\xenvkbd\xenvkbd.vcxproj]
Done Building Project "C:\Jenkins\Workspace\XENVKBD-master\vs2015\xenvkbd\xenvkbd.vcxproj" (sdv target(s)) -- FAILED.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>