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
[NTOS:PNP] Implement PlugPlayControlStartDevice control class and use it #3481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, achieved two improvements, one remains the same :)
✔️ Tested on VirtualBox with LiveCD - ISAPNP read data port
now appears in Device Manager.
✔️ Networking works now both in LiveCD and in 2nd stage setup.
✖️ PS/2 keyboard and mouse in 3rd stage with Standard HAL still not working for me, the same error code in Device Manager.
Status = NtPlugPlayControl(PlugPlayControlDeviceStatus, &PlugPlayData, sizeof(PlugPlayData)); | ||
if (NT_SUCCESS(Status)) | ||
{ | ||
return (_Bool)((PlugPlayData.DeviceStatus & DN_DRIVER_LOADED) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (_Bool)((PlugPlayData.DeviceStatus & DN_DRIVER_LOADED) && | |
return (BOOLEAN)((PlugPlayData.DeviceStatus & DN_DRIVER_LOADED) && |
(you can use the same return type as the function.)
f82c761
to
022499a
Compare
…l class PlugPlayControlResetDevice shares the input structure with several other control classes. Source: ProcessHacker sources https://github.com/processhacker/phnt/blob/e9c8121f41b00cd24e31eb466c9795785096b764/ntpnpapi.h
This control class is triggered when a driver is being installed for a non-critical device. The driver info should already be in the registry so we just need to push the device through the state graph Meanwhile, combine the code for similar control classes into PiControlSyncDeviceAction routine CORE-17463 CORE-17490
Instead of PlugPlayControlResetDevice, PlugPlayControlStartDevice should be used for a newly installed device. For usetup, add a device status check before starting attempt, so we're not touching devices which are already started. CORE-17463 CORE-17490
022499a
to
abbc5ba
Compare
This adds another action for starting devices after usermode PnP service enables the driver for it.
PlugPlayControlResetDevice
is wrong in this case, because it returns the device node back toDeviceNodeUninitialized
state, which is an overkill here (initialization phase is completed successfully, no need to repeat it)Should fix: CORE-17490, CORE-17463