| Текущее время: 08 мар 2026, 22:38 |
The device link is not complete until you have software reading the data. Here is a minimal C++ example using WinUSB API to read pen coordinates:
#include <windows.h> #include <winusb.h> #include <setupapi.h>// Use the same GUID from the INF // 337FD5C2-7F7D-4F8E-B7F7-8F8B8E8D8F8A DEFINE_GUID(GUID_DEVINTERFACE_MyTablet, 0x337fd5c2, 0x7f7d, 0x4f8e, 0xb7, 0xf7, 0x8f, 0x8b, 0x8e, 0x8d, 0x8f, 0x8a);
int main() // 1. Find the device using SetupDi API // 2. Create a WinUSB handle via CreateFile // 3. Read from the interrupt pipe (pen data)
HANDLE hDevice = CreateFile(devicePath, ...); WINUSB_INTERFACE_HANDLE hWinUsb; WinUsb_Initialize(hDevice, &hWinUsb); UCHAR penPacket[8]; DWORD bytesTransferred; while (true) WinUsb_ReadPipe(hWinUsb, 0x81, penPacket, 8, &bytesTransferred, NULL); // Parse X, Y, pressure from packet // Send to GUI or game engine
The direct wired connection between your tablet and PC. A faulty link causes disconnections or "Device Descriptor Failed" errors. The device link is not complete until you
; ; Graphics Tablet - WinUSB Driver Package ;[Version] Signature = "$Windows NT$" Class = HIDClass ClassGuid = 745a17a0-74d3-11d0-b6fe-00a0c90f57da Provider = %ManufacturerName% CatalogFile = GraphicsTablet.cat DriverVer = 03/15/2025,1.0.0.0 PnpLockdown = 1
[SourceDisksNames] 1 = %DiskName%
[SourceDisksFiles]
[Manufacturer] %ManufacturerName% = DeviceList, NTamd64, NTarm64, NTx86
[DeviceList.NTamd64] %DeviceName% = WinUSB_Install, USB\VID_1234&PID_5678 The direct wired connection between your tablet and PC
[DeviceList.NTarm64] %DeviceName% = WinUSB_Install, USB\VID_1234&PID_5678
[DeviceList.NTx86] %DeviceName% = WinUSB_Install, USB\VID_1234&PID_5678
[WinUSB_Install] Include = machine.inf Needs = WinUSB.NT AddReg = WinUSB_AddReg
[WinUSB_Install.HW] AddReg = WinUSB_HWAddReg
[WinUSB_HWAddReg] ; Enable selective suspend for power saving HKR,,"DeviceIdleEnabled",0x00010001,1 HKR,,"SelectiveSuspendEnabled",0x00010001,1 HKR,,"EnhancedPowerManagementEnabled",0x00010001,1 Graphics Tablet - WinUSB Driver Package
[WinUSB_AddReg] HKR,,DeviceInterfaceGUIDs,0x00010000,"7A5E4A5C-0F1D-4A5B-8E2A-9C4D3F2A1B0C"
[WinUSB_Install.Services] AddService = WinUsb,0x00000002,WinUSB_Service
[WinUSB_Service] DisplayName = %WinUSBSvcName% ServiceType = 1 StartType = 3 ErrorControl = 1 ServiceBinary = %12%\WinUsb.sys
[WinUSB_Install.Wdf] KmdfService = WinUsb, WinUSB_wdfsect
[WinUSB_wdfsect] KmdfLibraryVersion = 1.15
[Strings] ManufacturerName = "YourCompany" DeviceName = "Graphics Tablet (WinUSB)" DiskName = "Graphics Tablet Driver Installation Disk" WinUSBSvcName = "WinUSB Driver for Graphics Tablet"