Samuel Serapion

This looks fine, why not committed ? or further tests needed?

This looks fine, why not committed ? or further tests needed?

Seems like all the previously existing code was blown away... any timeline on when it will be coming back/rewritten ? Mind you, no idea if the previous code work at all.

Seems like all the previously existing code was blown away... any timeline on when it will be coming back/rewritten ? Mind you, no idea if the previous code work at all.

Is it not possible to set the power state to something other than D3? are these not querieble from the device?

Is it not possible to set the power state to something other than D3? are these not querieble from the device?

There seems to be a reset controller block in InitializeHardware function but looking at some other sources I've seen it implemented like this int maxTries = 5; //random number//halt controllerWRI...

There seems to be a reset controller block in InitializeHardware function
but looking at some other sources I've seen it implemented like this

int maxTries = 5; //random number
//halt controller
WRITE_PORT_UCHAR(EHCI_USBCMD, 0); 
//some waiting
sleep(10000);

//actual reset
WRITE_PORT_UCHAR(EHCI_USBCMD, EHCI_USBCMD_HCRESET); 

//is controller still resetting?
while (READ_PORT_UCHAR(EHCI_USBCMD) & EHCI_USBCMD_HCRESET) 
{
	sleep(10000);
	if ( tries-- ==  0)
		return ERROR;
}

return OK;
not even a /* fixme */ ?

not even a /* fixme */ ?

whats this?

whats this?

This will break out of the case, similar to other cases in NtSetInformationThread nothing magical happening here

This will break out of the case, similar to other cases in NtSetInformationThread nothing magical happening here

PSJobLock only does this: return (PVOID)&Job->JobLock; but if its somehow prefered I will use it

PSJobLock only does this: return (PVOID)&Job->JobLock;
but if its somehow prefered I will use it

Thank you all for your comments! I have been reworking various aspects thanks to them. I'll be resubmitting an updated patch soon

Thank you all for your comments! I have been reworking various aspects thanks to them. I'll be resubmitting an updated patch soon

It could fail if we ran out of memory. AFAICS Windows doesn't care about the return code here

It could fail if we ran out of memory. AFAICS Windows doesn't care about the return code here

Maybe in regards to process/jobs limits this is important. For now I don't now anything about it... keep the FIXME ?

Maybe in regards to process/jobs limits this is important. For now I don't now anything about it... keep the FIXME ?

I belive that ObReferenceObjectByHandle will fail and we will exit with STATUS_INVALID_PARAMETER or some such

I belive that ObReferenceObjectByHandle will fail and we will exit with STATUS_INVALID_PARAMETER or some such

fixed

fixed