Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Went to the simplest approach. #54

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ManOnTheMountainTech
Copy link
Collaborator

  • Look for intellimouse taillight arrival
  • Start a worker thread to thunk to pageable code
  • Set the taillight black
  • Rebased with main

@ManOnTheMountainTech ManOnTheMountainTech self-assigned this Feb 22, 2024
@ManOnTheMountainTech ManOnTheMountainTech added the bug Something isn't working label Feb 22, 2024
TailLight/device.h Outdated Show resolved Hide resolved
TailLight/device.h Outdated Show resolved Hide resolved
TailLight/driver.h Outdated Show resolved Hide resolved
TailLight/debug.h Outdated Show resolved Hide resolved
@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Feb 22, 2024 via email

@forderud
Copy link
Owner

This is my interpretation of what the documentation says to do at https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdfiotarget/nf-wdfiotarget-wdfiotargetopen. “If a call to WdfIoTargetOpen fails, the driver should call WdfObjectDelete https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdfobject/nf-wdfobject-wdfobjectdelete to delete the I/O target object.”

I fully agree with you on that. You should still delete the target object if WdfIoTargetOpen fail. My request was only that you should move the code that performs the deletion to the calling function.

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Feb 22, 2024 via email

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Feb 22, 2024 via email

@forderud
Copy link
Owner

WDF assigns a generic pool tag to allocations unless overridden. I was probably getting around to setting the Intellimouse WDF pool tag but never completed the task. The goal was to be able to narrow down leaky code by specific pool tags. In any case it’s removed.

I still see the pool tag change in this PR. You'll need to (force) push your changes if you want to update the PR on the server.

@forderud
Copy link
Owner

@ManOnTheMountainTech Any progress on updating this PR?

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Feb 26, 2024 via email

@forderud
Copy link
Owner

forderud commented Mar 3, 2024

Gentle reminder.

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Mar 3, 2024 via email

@forderud
Copy link
Owner

forderud commented Mar 4, 2024

I’ve been working on it yesterday and today. The PnP callback is only being called once on another old system that I set up. The symbolic link returned is failing to open. On another machine, OpenTarget is working as there are more callbacks.

That's probably good, but I'm struggling to understand why that prevents you from updating the PR to address the other review comments you received more than a week ago.

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Mar 4, 2024 via email

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Mar 4, 2024 via email

@forderud
Copy link
Owner

forderud commented Mar 4, 2024

Do you want (a) checkin to occur first, then the questions to the PR answered, or (b) can I answer first, then checkin?

Do as you wish.

@ManOnTheMountainTech
Copy link
Collaborator Author

ManOnTheMountainTech commented Mar 5, 2024 via email

@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from f4c40c2 to 06e7b02 Compare March 6, 2024 02:34
TailLight/device.h Outdated Show resolved Hide resolved
TailLight/device.cpp Outdated Show resolved Hide resolved
TailLight/device.cpp Outdated Show resolved Hide resolved
TailLight/SetBlack.h Outdated Show resolved Hide resolved
TailLight/device.cpp Outdated Show resolved Hide resolved
@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from d9f4fed to e240868 Compare March 18, 2024 04:11
TailLight/device.cpp Outdated Show resolved Hide resolved
@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from e240868 to b8f1b6c Compare March 18, 2024 17:17
@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from b8f1b6c to 7d8200c Compare March 21, 2024 00:24
TailLight/vfeature.h Outdated Show resolved Hide resolved
TailLight/vfeature.cpp Outdated Show resolved Hide resolved
TailLight/driver.cpp Outdated Show resolved Hide resolved
TailLight/driver.cpp Outdated Show resolved Hide resolved
TailLight/device.cpp Outdated Show resolved Hide resolved
TailLight/device.cpp Outdated Show resolved Hide resolved
TailLight/TailLight.h Outdated Show resolved Hide resolved
@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from 7d8200c to 53dc946 Compare March 21, 2024 21:23
Restore taillight pool tag to WDF allocations.

Simplified code by querying strings from only IO targets.

Change comments to not use American expressions. Got to matching based on the PDO name. Tie PnP callback removal to the lifetime of the device object.

Revert KdPrintEx to KdPrint. Add documentation and document multithreaded code. Swith to RAII in SetBlackAsync for the target. Improvements for better readability and reliability versus performance.

Use C copy trick and update a comment.
…m struct size of 8 bytes (3) Log SetBlackAsync failures
@ManOnTheMountainTech ManOnTheMountainTech force-pushed the private/bryan/simplest_black_taillight branch from 6e6bbd6 to 5a479d7 Compare March 27, 2024 20:10
Copy link
Owner

@forderud forderud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updated PR Bryan. I've now tested your changes and hereby confirm that they do indeed appear to fix #44 with no observed side-effects.

I will perform some more tests on my end and try to incorporate your changes afterwards.

@forderud
Copy link
Owner

forderud commented Apr 1, 2024

Kernel log observed when attaching an IntelliMouse:

TailLight: DriverEntry - WDF version built on Apr  1 2024 02:24:37
TailLight: PdoName: \Device\000000ba
TailLight: SetBlackAsync: Device \Device\00000069 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000005c not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000057 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000060 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000005d not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000005e not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000061 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000007d not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000063 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000062 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000054 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000007c not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b5 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000007e not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000006b not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000005f not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000055 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000006a not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000006c not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000081 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000007f not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000080 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000065 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000066 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000056 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b7 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000082 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000067 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b8 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000068 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b9 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\00000064 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\0000005b not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b4 not known to control the taillight so failing
TailLight: SetBlackAsync: Device \Device\000000b6 not known to control the taillight so failing
DimpHidAddDevice: Failed to open device \\?\HID#VID_045E&PID_082A&MI_00&Col01#7&bb7cab7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} (err=5).
DimpHidAddDevice: Failed to open device \\?\HID#VID_045E&PID_082A&MI_01&Col01#7&181f730b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD (err=5).
TailLight: SetFeatureFilter
TailLight: SetBlackCompletionRoutine WdfRequestSend status: 0x0
Entered KbfEvtIoDeviceControl
Enter IOCTL_KBFILTR_SET_KEYBOARD_FILTERS 
State: NotBlocking
m_ModifierKeyState == 0x0, m_blockedModifierKeyStateWhenLayoutIsSet == 0x0
Entered KbfEvtIoDeviceControl
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter
TailLight: SetFeatureFilter

The 22 TailLight: SetFeatureFilter entries appear to be a preexisting condition, and not a regression in this PR. The 35 not known to control the taillight so failing entries are new. They're not really indicative of a failure or problem, but rather low specificity for the IoRegisterPlugPlayNotification that subscribes to all GUID_DEVINTERFACE_HID events. I wonder if this can be somehow narrowed down to reduce callback "noise"(?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants