diff --git a/src/AmtPtpDeviceSpiKm/AppleDefinition.h b/src/AmtPtpDeviceSpiKm/AppleDefinition.h
index 9203e6b..0f5d39a 100644
--- a/src/AmtPtpDeviceSpiKm/AppleDefinition.h
+++ b/src/AmtPtpDeviceSpiKm/AppleDefinition.h
@@ -1,6 +1,7 @@
#pragma once
#define SPI_TRACKPAD_MAX_FINGERS 10
+#define DEVICE_VID 0x8910
typedef struct _SPI_TRACKPAD_FINGER
{
diff --git a/src/AmtPtpDeviceSpiKm/Hid.c b/src/AmtPtpDeviceSpiKm/Hid.c
index a561bd6..aae1364 100644
--- a/src/AmtPtpDeviceSpiKm/Hid.c
+++ b/src/AmtPtpDeviceSpiKm/Hid.c
@@ -340,7 +340,9 @@ AmtPtpGetDeviceAttribs(
}
pDeviceAttributes->Size = sizeof(HID_DEVICE_ATTRIBUTES);
- pDeviceAttributes->VendorID = pDeviceContext->HidVendorID;
+ // Okay here's one thing: we cannot report the real ID here, otherwise there's will be some great conflict with the USB/BT driver.
+ // Therefore Vendor ID is changed to a hardcoded number
+ pDeviceAttributes->VendorID = DEVICE_VID;
pDeviceAttributes->ProductID = pDeviceContext->HidProductID;
pDeviceAttributes->VersionNumber = pDeviceContext->HidVersionNumber;
diff --git a/src/AmtPtpDeviceUniversalPkg/AmtPtpDevice.inf b/src/AmtPtpDeviceUniversalPkg/AmtPtpDevice.inf
index 24538ac..6d16f8f 100644
--- a/src/AmtPtpDeviceUniversalPkg/AmtPtpDevice.inf
+++ b/src/AmtPtpDeviceUniversalPkg/AmtPtpDevice.inf
@@ -22,11 +22,13 @@ PtpUmDrivers_Dir = 13
AmtPtpDeviceUsbKm.sys = 1,,
AmtPtpDeviceUsbUm.dll = 1,,
AmtPtpDeviceSpiKm.sys = 1,,
+AmtPtpHidFilter.sys = 1,,
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
+; Apple T2
%AmtPtpDeviceUsbKm.DeviceDesc%=AmtPtpDeviceUsbKm_Device, USB\Vid_05ac&Pid_0273&MI_02
%AmtPtpDeviceUsbKm.DeviceDesc%=AmtPtpDeviceUsbKm_Device, USB\Vid_05ac&Pid_0274&MI_02
%AmtPtpDeviceUsbKm.DeviceDesc%=AmtPtpDeviceUsbKm_Device, USB\Vid_05ac&Pid_0277&MI_02
@@ -41,6 +43,7 @@ AmtPtpDeviceSpiKm.sys = 1,,
%AmtPtpDeviceUsbKm.DeviceDesc%=AmtPtpDeviceUsbKm_Device, USB\Vid_05ac&Pid_0291&MI_02
%AmtPtpDeviceUsbKm.DeviceDesc%=AmtPtpDeviceUsbKm_Device, USB\Vid_05ac&Pid_0340&MI_02
+; Traditional Mac trackpad
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0236&MI_01
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0237&MI_01
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0238&MI_01
@@ -67,8 +70,8 @@ AmtPtpDeviceSpiKm.sys = 1,,
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0274&MI_02
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0290&MI_02
%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0291&MI_02
-%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0265&MI_01
+; SPI
%AmtPtpDeviceSpiKm.DeviceDesc%=AmtPtpDeviceSpiKm_Device, SPI\VID_05ac&PID_0272&MI_02
%AmtPtpDeviceSpiKm.DeviceDesc%=AmtPtpDeviceSpiKm_Device, SPI\VID_05ac&PID_0273&MI_02
%AmtPtpDeviceSpiKm.DeviceDesc%=AmtPtpDeviceSpiKm_Device, SPI\VID_05ac&PID_0275&MI_02
@@ -80,14 +83,72 @@ AmtPtpDeviceSpiKm.sys = 1,,
%AmtPtpDeviceSpiKm.DeviceDesc%=AmtPtpDeviceSpiKm_Device, SPI\VID_05ac&PID_0290&MI_02
%AmtPtpDeviceSpiKm.DeviceDesc%=AmtPtpDeviceSpiKm_Device, SPI\VID_05ac&PID_0291&MI_02
-; USB KM
+; Magic Trackpad 2 USB
+; Note: this will be a last few versions where Magic Trackpad 2 uses this old implementation
+%AmtPtpDeviceUsbUm.DeviceDesc%=AmtPtpDeviceUsbUm_Install, USB\Vid_05ac&Pid_0265&MI_01
+; Magic Trackpad 2 Bluetooth
+%AmtPtpHidFilter.DeviceDesc%=AmtPtpHidFilter_MiniPortDevice, HID\{00001124-0000-1000-8000-00805f9b34fb}_VID&0001004c_PID&0265&Col01
+%AmtPtpHidFilter.NullDeviceDesc%=AmtPtpHidFilter_NullDevice, HID\{00001124-0000-1000-8000-00805f9b34fb}_VID&0001004c_PID&0265&Col02
-[AmtPtpDeviceUsbKm_Device.NT]
-CopyFiles=PtpKmDrivers_Dir
+; Null Device
+[AmtPtpHidFilter_NullDevice]
+; Nothing!
+
+[AmtPtpHidFilter_NullDevice.Services]
+AddService = ,2 ; no value for the service name
+
+; File paylods for each set of driver
+[FilterDriver_Payload]
+AmtPtpHidFilter.sys
[PtpKmDrivers_Dir]
AmtPtpDeviceUsbKm.sys
+[PtpUmDrivers_Dir]
+AmtPtpDeviceUsbUm.dll
+
+[SpiKmDrivers_Dir]
+AmtPtpDeviceSpiKm.sys
+
+; Microsoft HID KMDF driver install sections
+[mshidkmdf_Service_Inst]
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %10%\System32\Drivers\mshidkmdf.sys
+
+; PTP filter
+[AmtPtpHidFilter_MiniPortDevice.NT]
+CopyFiles=FilterDriver_Payload
+
+[AmtPtpHidFilter_MiniPortDevice.NT.Services]
+AddService = AmtPtpHidFilter,, AmtPtpHidFilter_Service_Inst
+AddService = mshidkmdf, %SPSVCINST_ASSOCSERVICE%, mshidkmdf_Service_Inst
+
+[AmtPtpHidFilter_MiniPortDevice.NT.HW]
+AddReg=AmtPtpHidFilter_AddReg
+
+[AmtPtpHidFilter_AddReg]
+HKR,,FriendlyName,,%AmtPtpHidFilter.DeviceDesc%
+HKR,,"LowerFilters",0x00010008,"AmtPtpHidFilter"
+
+[AmtPtpHidFilter_MiniPortDevice.NT.Wdf]
+KmdfService = AmtPtpHidFilter, AmtPtpHidFilter_wdfsect
+
+[AmtPtpHidFilter_Service_Inst]
+DisplayName = %AmtPtpHidFilter.SVCDESC%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %13%\AmtPtpHidFilter.sys
+
+[AmtPtpHidFilter_wdfsect]
+KmdfLibraryVersion = $KMDFVERSION$
+
+; USB KM
+[AmtPtpDeviceUsbKm_Device.NT]
+CopyFiles=PtpKmDrivers_Dir
+
[AmtPtpDeviceUsbKm_Device.NT.Services]
AddService = AmtPtpDeviceUsbKm,, AmtPtpDeviceUsbKm_Service_Inst
AddService = mshidkmdf, %SPSVCINST_ASSOCSERVICE%, mshidkmdf_Service_Inst
@@ -99,13 +160,6 @@ AddReg=AmtPtpDeviceUsbKm_AddReg
HKR,,FriendlyName,,%AmtPtpDeviceUsbKm.DeviceDesc%
HKR,,"LowerFilters",0x00010008,"AmtPtpDeviceUsbKm"
-; -------------- Microsoft HID KMDF driver install sections
-[mshidkmdf_Service_Inst]
-ServiceType = 1 ; SERVICE_KERNEL_DRIVER
-StartType = 3 ; SERVICE_DEMAND_START
-ErrorControl = 1 ; SERVICE_ERROR_NORMAL
-ServiceBinary = %10%\System32\Drivers\mshidkmdf.sys
-
; -------------- AmtPtpDeviceUsbKm driver install sections
[AmtPtpDeviceUsbKm_Service_Inst]
DisplayName = %AmtPtpDeviceUsbKm.SVCDESC%
@@ -131,9 +185,6 @@ AddReg=AmtPtpDeviceUsbUm_AddReg
AddService=mshidumdf, 0x000001fa, MSHIDUMDF_ServiceInstall ; flag 0x2 sets this as the service for the device
AddService=WUDFRd,0x000001f8,WUDFRD_ServiceInstall ; this service is installed because its a filter.
-[AmtPtpDeviceUsbUm_Install.NT.CoInstallers]
-AddReg=UsbUmCoInstallers_AddReg
-
[AmtPtpDeviceUsbUm_Install.NT.Wdf]
UmdfDispatcher=NativeUSB
UmdfService=AmtPtpDeviceUsbUm,AmtPtpDeviceUsbUm_Install
@@ -165,19 +216,10 @@ StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys
-[PtpUmDrivers_Dir]
-AmtPtpDeviceUsbUm.dll
-
-[UsbUmCoInstallers_AddReg]
-HKR,,CoInstallers32,0x00010000,"WUDFCoinstaller.dll"
-
; SPI KM
[AmtPtpDeviceSpiKm_Device.NT]
CopyFiles=SpiKmDrivers_Dir
-[SpiKmDrivers_Dir]
-AmtPtpDeviceSpiKm.sys
-
[AmtPtpDeviceSpiKm_Device.NT.Services]
AddService = AmtPtpDeviceSpiKm,, AmtPtpDeviceSpiKm_Service_Inst
AddService = mshidkmdf, %SPSVCINST_ASSOCSERVICE%, mshidkmdf_Service_Inst ;flag 0x2 sets this as the service for the device
@@ -188,7 +230,6 @@ AddReg = AmtPtpDeviceSpiKm_Device.NT.AddReg
[AmtPtpDeviceSpiKm_Device.NT.AddReg]
HKR,,"LowerFilters",0x00010008,"AmtPtpDeviceSpiKm"
-; -------------- AmtPtpDeviceSpiKm driver install sections
[AmtPtpDeviceSpiKm_Service_Inst]
DisplayName = %AmtPtpDeviceSpiKm.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
@@ -215,3 +256,7 @@ AmtPtpDeviceSpiKm.DeviceDesc = "Apple SPI Precision Touchpad Device"
AmtPtpDeviceSpiKm.SVCDESC = "Apple SPI Precision Touchpad Driver Service"
AmtPtpDeviceUsbKm.SVCDESC = "Apple USB Precision Touchpad Service"
WudfRdDisplayName = "Windows Driver Foundation - User-mode Driver Framework Reflector"
+AmtPtpHidRootDevice.DeviceDesc = "Apple Multi-touch Trackpad HID Device"
+AmtPtpHidFilter.DeviceDesc = "Apple Multi-touch Trackpad HID Filter"
+AmtPtpHidFilter.NullDeviceDesc = "Apple Multi-touch Auxiliary Services"
+AmtPtpHidFilter.SVCDESC = "Apple Multi-touch Trackpad HID Filter Service"
diff --git a/src/AmtPtpDeviceUniversalPkg/AmtPtpDeviceUniversalPkg.vcxproj b/src/AmtPtpDeviceUniversalPkg/AmtPtpDeviceUniversalPkg.vcxproj
index b9196c7..2b7123b 100644
--- a/src/AmtPtpDeviceUniversalPkg/AmtPtpDeviceUniversalPkg.vcxproj
+++ b/src/AmtPtpDeviceUniversalPkg/AmtPtpDeviceUniversalPkg.vcxproj
@@ -48,6 +48,9 @@
{87efa31b-25eb-4944-a30a-300171bfff57}
+
+ {ee63c42b-f401-4f55-adbb-14c16bd3b18c}
+
@@ -184,7 +187,7 @@
TestSign
-
+
http://timestamp.digicert.com
$(ProductionCertPath)
ProductionSign
@@ -200,6 +203,30 @@
*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
DbgengKernelDebugger
@@ -295,4 +322,4 @@
-
+
\ No newline at end of file
diff --git a/src/AmtPtpDeviceUsbUm/Hid.c b/src/AmtPtpDeviceUsbUm/Hid.c
index f439954..e5c9d36 100644
--- a/src/AmtPtpDeviceUsbUm/Hid.c
+++ b/src/AmtPtpDeviceUsbUm/Hid.c
@@ -222,7 +222,9 @@ AmtPtpGetDeviceAttribs(
pDeviceAttributes->Size = sizeof(HID_DEVICE_ATTRIBUTES);
pDeviceAttributes->ProductID = pContext->DeviceDescriptor.idProduct;
- pDeviceAttributes->VendorID = pContext->DeviceDescriptor.idVendor;
+ // Okay here's one thing: we cannot report the real ID here, otherwise there's will be some great conflict with the USB/BT driver.
+ // Therefore Vendor ID is changed to a hardcoded number
+ pDeviceAttributes->VendorID = DEVICE_VID;
pDeviceAttributes->VersionNumber = DEVICE_VERSION;
WdfRequestSetInformation(
diff --git a/src/AmtPtpDeviceUsbUm/include/Hid.h b/src/AmtPtpDeviceUsbUm/include/Hid.h
index a8d63ba..bd50b60 100644
--- a/src/AmtPtpDeviceUsbUm/include/Hid.h
+++ b/src/AmtPtpDeviceUsbUm/include/Hid.h
@@ -17,6 +17,7 @@
typedef UCHAR HID_REPORT_DESCRIPTOR, *PHID_REPORT_DESCRIPTOR;
#define DEVICE_VERSION 0x01
+#define DEVICE_VID 0x8910
#define AAPL_PTP_USERMODE_CONFIGURATION_APP_TLC \
USAGE_PAGE_1, 0x00, 0xff, /* Usage Page: Vendor defined */ \
diff --git a/src/AmtPtpHidFilter/Hid.c b/src/AmtPtpHidFilter/Hid.c
index 3494822..52c7a9d 100644
--- a/src/AmtPtpHidFilter/Hid.c
+++ b/src/AmtPtpHidFilter/Hid.c
@@ -76,8 +76,10 @@ PtpFilterGetDeviceAttribs(
}
pDeviceAttributes->Size = sizeof(HID_DEVICE_ATTRIBUTES);
+ // Okay here's one thing: we cannot report the real ID here, otherwise there's will be some great conflict with the USB/BT driver.
+ // Therefore Vendor ID is changed to a hardcoded number
pDeviceAttributes->ProductID = deviceContext->ProductID;
- pDeviceAttributes->VendorID = deviceContext->VendorID;
+ pDeviceAttributes->VendorID = DEVICE_VID;
pDeviceAttributes->VersionNumber = DEVICE_VERSION;
WdfRequestSetInformation(Request, sizeof(HID_DEVICE_ATTRIBUTES));
diff --git a/src/AmtPtpHidFilter/include/HidCommon.h b/src/AmtPtpHidFilter/include/HidCommon.h
index f996709..8649461 100644
--- a/src/AmtPtpHidFilter/include/HidCommon.h
+++ b/src/AmtPtpHidFilter/include/HidCommon.h
@@ -39,4 +39,5 @@
#define BEGIN_COLLECTION 0xa1
#define END_COLLECTION 0xc0
+#define DEVICE_VID 0x8910
#define DEVICE_VERSION 0x100
\ No newline at end of file