ver 3: More comments from Zebediah Figura
Signed-off-by: Aric Stewart aric@codeweavers.com --- dlls/ntoskrnl.exe/Makefile.in | 2 +- dlls/ntoskrnl.exe/ntoskrnl.c | 133 ++++++++++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/ddk/wdm.h | 1 + 4 files changed, 136 insertions(+), 2 deletions(-)
Aric Stewart aric@codeweavers.com wrote:
- ptr = strchrW( id, '\' );
- while ((ptr = strchrW( id, '\' )))
*ptr = '#';
This can't work.
Aric Stewart aric@codeweavers.com wrote:
do
{
rc = SetupDiEnumDeviceInfo( infoset, index, &devInfo );
if (IsEqualGUID( &devInfo.ClassGuid, class_guid ))
Without an rc check IsEqualGUID() will use bogus data.
{
BOOL check;
check = SetupDiGetDeviceInstanceIdW( infoset, &devInfo, id, size, &required );
if (check && strcmpW( id, instance_id ) == 0)
break;
}
index++;
} while (rc);
There are other places in the patch that don't check the API result before using bogus data in case of an error.