Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results
The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I have a USB composite device (one winusb interface - winusb.sys, one uvc interface - usbvideo.sys) capable of waking up the host from S3 state using the winusb interface. On host side, I have my system service able to communicate with the device, so after RESUME everything is ok on the computers without Modern Standby.
On the computers with Modern Standby the behavior is different. My device sends the wake up packet (I saw this in my device's UART port) then, in the BeagleBone Protocol Analyzer traces I see:
As a user, it looks the host doesn't wake up (the screen is still off). My system service, which communicates with the device, doesn't wake up even if, from DAM (Desktop Activity Moderator ) point of view, it is in Session 0 group.
On the other hand, the computer wakes up from Modern Standby using an external USB keyboard or the embedded finger print sensor.
Any hints where to look and what to check? Any tool I can use to be sure that my wake up packet is reaching the winusb driver?
Upcoming OSR Seminars | ||
---|---|---|
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead! | ||
Internals & Software Drivers | 19-23 June 2023 | Live, Online |
Writing WDF Drivers | 10-14 July 2023 | Live, Online |
Kernel Debugging | 16-20 October 2023 | Live, Online |
Developing Minifilters | 13-17 November 2023 | Live, Online |
Comments
I succeeded to take traces with logman in winusb and usbccgp drivers. I tried to compare the similar traces from a computer with modern standby and one without modern standby. And they are completely different when my device triggers the wake up:
without modern standby
00008099 winusb 4 6964 4 0 07\22\2022-13:08:49:242 Starting Read Io Target for WdfUsbPipe (00006AF6F1B6B208)
00008100 winusb 852 14756 7 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_QUERY_DEVICE_INFORMATION
00008101 winusb 852 14756 7 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_VERSION_EXCHANGE
00008102 winusb 852 14756 7 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_GET_DESCRIPTOR
00008103 winusb 852 14756 4 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_GET_DESCRIPTOR
00008104 winusb 852 14756 4 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_GET_DESCRIPTOR
00008105 winusb 852 14756 4 0 07\22\2022-13:08:49:600 IOCTL_WINUSB_RESET_DEFAULTS
00008106 winusb 852 14756 6 0 07\22\2022-13:08:49:601 IOCTL_WINUSB_GET_DESCRIPTOR
00008107 winusb 852 14756 6 0 07\22\2022-13:08:49:601 IOCTL_WINUSB_GET_DESCRIPTOR
with modern standby
00017635 winusb 4 37320 5 0 07\22\2022-11:27:04:396 Handling Device Cleanup (000027F467C3A708)
00017636 winusb 4 34752 4 0 07\22\2022-11:27:04:653 DriverObject 0xFFFFD80B9FAE8A70
00017637 winusb 4 34752 4 0 07\22\2022-11:27:04:653 ResetPortEnabled is set to FALSE
00017638 winusb 4 34752 4 0 07\22\2022-11:27:04:653 CyclePortEnabled is set to FALSE
00017639 winusb 4 34752 4 0 07\22\2022-11:27:04:653 Default PowerPolicy: WinUSB is the power policy owner.
00017640 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: EnableIdle = 0x00000001(true)
00017641 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: SystemWakeEnabled = 0x00000001(true)
00017642 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: SuspendDelay = 100 ms
00017643 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: DeviceIdleEnabled = 0x00000001(true)
00017644 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: UserSetDeviceIdleEnabled = 0x00000000(false)
00017645 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: DefaultDeviceIdleState = 0x00000001(true)
00017646 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PowerPolicy: IdleConfigured = 0x00000000(false)
00017647 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: ShortPacketTerminate = 0x00000000(false)
00017648 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: AutoClearStall = 0x00000000(false)
00017649 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: PipeTransferTimeout = 0
00017650 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: IgnoreShortPackets = 0x00000000(false)
00017651 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: AllowPartialReads = 0x00000001(true)
00017652 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: AutoFlush = 0x00000000(false)
00017653 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: RawIo = 0x00000000(false)
00017654 winusb 4 34752 4 0 07\22\2022-11:27:04:654 Default PipePolicy: ResetOnResume = 0x00000000(false)
00017655 winusb 4 34752 7 0 07\22\2022-11:27:04:665 Preparing hardware for WDF device (000027F46845F4C8)
00017656 winusb 4 34752 0 0 07\22\2022-11:27:04:666 Created UsbDevice (000027F46C859F98)
00017657 winusb 4 34752 0 0 07\22\2022-11:27:04:667 Resetting Default settings for WDFDevice (000027F46845F4C8)
00017658 winusb 4 34752 0 0 07\22\2022-11:27:04:667 Starting Read Io Target for WdfUsbPipe (000027F45C216AF8)
00017659 winusb 4 31308 3 0 07\22\2022-11:27:05:677 Stopping Read Io Target for WdfUsbPipe (000027F45C216AF8) to cancel pending IO
I think this is a dead end. I have no idea where to focus. Any hints?