Closed vadimgrn closed 3 years ago
@vadimgrn : Thanks for your PR. I have uploaded several commits on dev_temp branch. They are built from your ab77ab2..723f9d5. e4a8f34 will be done later.
@vadimgrn : I've done to apply your PR into dev_temp branch. Please understand for selective pull from your commits. Your work is very helpful.
You've added at least one bug and removed most of my changes without explanation. But it is your repository and your rules.
@vadimgrn :
You've added at least one bug removed most of my changes without explanation.
I'm sorry for that. For my late explanation for removal or modifications of your commits,
I believe to merge most of your great works, but please let me know about removed codes and the bug.
driver/vhci/vhci_plugin.c
else {
vpdo->num_configurations = dsc_dev->bNumConfigurations;
} else {
/* TODO: can happen? */
vpdo->vendor = 0;
vpdo->product = 0;
vpdo->revision = 0;
vpdo->usbclass = 0;
vpdo->subclass = 0;
vpdo->protocol = 0;
vpdo->speed = USB_SPEED_LOW; // must be USB_SPEED_UNKNOWN
vpdo->num_configurations = 1; // MUST BE ZERO, number of configurations is not known
}
@vadimgrn : Your comment is definitely correct.
But my intention is that the current implementation changes codes less and is consistent with composite detection logic. Currently, there's no mechanism to update 0 num_configurations. I think that the current code would be fine because the else part is never called. usbpi.exe does not proceed to attach if it fails to get the descriptor.
In such case the else section should be removed. If I were you, I would replace all lines in else section with NT_ASSERT(!"message" ).
@vadimgrn : I agree. I'll do it later.
@vadimgrn : I agree. I'll do it later.
Those codes are removed without leaving assert at 62de496. They are unreachable codes and confusing.