[PATCH v5 1/2] ntoskrnl.exe: Implement IoRegisterDeviceInterface
v 5: More comments from Zebediah Figura and Dmitry Timoshkov Signed-off-by: Aric Stewart <aric(a)codeweavers.com> --- dlls/ntoskrnl.exe/Makefile.in | 2 +- dlls/ntoskrnl.exe/ntoskrnl.c | 135 ++++++++++++++++++++++++++++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- include/ddk/wdm.h | 1 + 4 files changed, 138 insertions(+), 2 deletions(-)
+ 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.
participants (2)
-
Aric Stewart -
Zebediah Figura