[PATCH v5 1/2] ntoskrnl.exe: Implement IoRegisterDeviceInterface

Zebediah Figura z.figura12 at gmail.com
Fri Oct 5 14:44:45 CDT 2018


> +    required = 0;
> +    SetupDiGetDeviceInterfaceDetailW( infoset, &infoData, NULL, 0,
&required, NULL );
> +    if (required == 0)
> +    {
> +        ERR( "Failed to get required size for interface\n" );
> +        return STATUS_UNSUCCESSFUL;
> +    }
> +
> +    required += sizeof(WCHAR);
> +
> +    data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY , required +
sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_W) );

I think this is redundant, SetupDiGetDeviceInterfaceDetail() will return
the required length including the size of the struct.

Otherwise this patch looks correct to me.



More information about the wine-devel mailing list