So I’m experimenting with HSA. I created a driver (kmdf), and it works fine from a desktop test app. I am appending the INF at the end of this post.
I used this as a guide: https://docs.microsoft.com/en-us/windows-hardware/drivers/devapps/hardware-support-app--hsa--steps-for-driver-developers and made the
following assumptions:
- I don’t need anything signed as long as i’m in dev mode and have test signing on.
- I can name my own custom capability and I don’t need my app to have a real store ID.
Now on to the app, using this guide:
https://docs.microsoft.com/en-us/windows-hardware/drivers/devapps/hardware-support-app--hsa--steps-for-app-developers
I created a SCCD and modified the app manifest accordingly.
I tried to get connected to it from UWP, and that’s where things broke. My attempt was something like this:
var selector = CustomDevice.GetDeviceSelector(new Guid(“{4D8E7CE0-5CF2-4831-A89D-AE4C760FD151}”));
var info = await DeviceInformation.FindAllAsync(selector, null, DeviceInformationKind.DeviceInterface);
but I get back an empty set (the 4D… guid is the GUID in [*_Device.NT.Interfaces] , see the INF at the end of this post). What am I doing wrong? Or did I go off the rails somewhere ealier? I suspect I’m getting confused by all the GUIDs in play here.
This is my SCCD (the app package family name matches the one from the app):
<?xml version="1.0" encoding="utf-8"?>
FFFF
This is my app manifest:
<?xml version="1.0" encoding="utf-8"?>
<mp:phoneidentity phoneproductid=“6185cbda-baf7-4db3-b572-59d32453ebac” phonepublisherid=“00000000-0000-0000-0000-000000000000”></mp:phoneidentity>
Test Lab
NRomanov
Assets\StoreLogo.png
<uap:visualelements displayname=“Test Lab” square150x150logo=“Assets\Square150x150Logo.png” square44x44logo=“Assets\Square44x44Logo.png” description=“biosed” backgroundcolor=“transparent”>
<uap:defaulttile wide310x150logo=“Assets\Wide310x150Logo.png”>
</uap:defaulttile>
<uap:splashscreen image=“Assets\SplashScreen.png”></uap:splashscreen>
</uap:visualelements>
<uap4:customcapability name=“Test.Lab_qfffwpkpf5cy2”></uap4:customcapability>
This is my driver’s INF (driver shows up correctly in device manger and I can start/stop it, and do ioctls from desktop test app):
[Version]
Signature=“$WINDOWS NT$”
Class=%ClassName%
ClassGuid=%ClassGuid%
Provider=%ManufacturerName%
CatalogFile=testlab1.cat
DriverVer= ; TODO: set DriverVer in stampinf property pages
[DestinationDirs]
DefaultDestDir = 12
testlab1_Device_CoInstaller_CopyFiles = 11
; ================= Class section =====================
[ClassInstall32]
Addreg=TestlabReg
[TestlabReg]
HKR,0,%ClassName%
HKR,Icon,-5
[SourceDisksNames]
1 = %DiskName%,“”
[SourceDisksFiles]
testlab1.sys = 1,
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%testlab1.DeviceDesc%=testlab1_Device, Root\testlab1
[testlab1_Device.NT]
CopyFiles=Drivers_Dir
[Drivers_Dir]
testlab1.sys
;-------------- Service installation
[testlab1_Device.NT.Services]
AddService = testlab1,%SPSVCINST_ASSOCSERVICE%, testlab1_Service_Inst
; -------------- testlab1 driver install sections
[testlab1_Service_Inst]
DisplayName = %testlab1.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\testlab1.sys
;
;— testlab1_Device Coinstaller installation ------
;
[testlab1_Device.NT.CoInstallers]
AddReg=testlab1_Device_CoInstaller_AddReg
CopyFiles=testlab1_Device_CoInstaller_CopyFiles
[testlab1_Device_CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller”
[testlab1_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
[testlab1_Device.NT.Wdf]
KmdfService = testlab1, testlab1_wdfsect
[testlab1_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName=“ChangeMe”
ClassName=“TestLab”
ClassGuid=“{A7DC9878-C387-4E3E-B785-91323C695BC4}”
DiskName = “testlab1 Installation Disk”
testlab1.DeviceDesc = “Test Lab Driver”
testlab1.SVCDESC = “Test Lab Driver”
KMYFACE=“{4D8E7CE0-5CF2-4831-A89D-AE4C760FD151}”
[testlab1_Device.NT.Interfaces]
AddInterface= %KMYFACE%,AddInterfaceSection
[AddInterfaceSection]
AddProperty= AddInterfaceSection.AddProps
[AddInterfaceSection.AddProps]
{A4DE9E9E-83E9-494A-A3C2-584DF8982E55}, 8, 0x2012, “Test.Lab_qfffwpkpf5cy2”