How can I print HardwareIDs? I understand they are MULTI_REG_SZ - multiple strings each terminating with \0. Is there some function for that.
Currently I wrote my own function as follows:
VOID DebugPrintStr (ULONG DebugPrintLevel,
PCWCHAR Buffer,
ULONG Length)
{
NTSTATUS status;
ULONG i; // index into the Buffer pointing to the begining of the next string
ULONG j; // length of the current string
for (i = 0, j = 0; i < Length; i += (j + 1)) {
DbgPrintEx (DPFLTR_IHVDRIVER_ID, DebugPrintLevel, “%ws\n”, &Buffer[i]);
/* get the end of this string
*/
status = RtlStringCchLengthW (
&Buffer[i],
Length + 1 - i, /* remaining MAX including the next ‘\0’ */
&j); /* length of upto (but not including) next ‘\0’ */
}
}
And this is what I get? I’m not sure why I’m getting so many ‘?’.
Help. Thanks.
Intel-2920
???DisIntel-2920
Internal_IDE_Channel
??? ??
??DisIntel-2920
J??? ???l-29???†??
?DisIntel-2920
??? ???l-29???†??
DisIntel-2920
??? ???l-29???†??
isIntel-2920
??? ???l-29???†??
sIntel-2920
??? ???l-29???†??
Intel-2920
??? ???l-29???†??
ntel-2920
??? ???l-29???†??
tel-2920
??? ???l-29???†??
el-2920
??? ???l-29???†??
??? ???l-29???†??
??? ???l-29???†??
??? ???l-29???†??
??? ???l-29???†??
??? ???l-29???†??
??? ???l-29???†??
???
???l-29???†??
???
???l-29???†??
???
???l-29???†??
???
???l-29???†??
???
???l-29???†??