} /* WriteEventLogEntry */
+// bsize is to be a strlen(src)
+// dest has to have enough place, i.e at least (2*strlen(src) + 2)
+void __ansi_to_wchar( USHORT *dest, UCHAR *src, int bsize)
+{
+ int i;
+
+ for (i=0; i<bsize; ++i)
+ *dest++ = *src++;
+ *dest = 0;
+}
VOID
mlx4_err(
// print to Debugger
va_start(list, format);
buf[MAX_BUFFER_SIZE - 1] = '\0';
- RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format, list);
+ if (RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format, list))
+ return;
DbgPrint( (char*)buf );
va_end(list);
// print to Event Log
- if (!RtlStringCchPrintfW(wbuf, sizeof(wbuf)/sizeof(wbuf[0]), L"%S", buf))
- WriteEventLogEntryStr( mdev->pdev->p_self_do, (ULONG)EVENT_MLX4_ANY_ERROR, 0, 0, wbuf, 0, 0 );
+ // print to Event Log
+ __ansi_to_wchar( wbuf, buf, (int)strlen((void*)buf) );
+ WriteEventLogEntryStr( mdev->pdev->p_self_do, (ULONG)EVENT_MLX4_ANY_ERROR, 0, 0, wbuf, 0, 0 );
}
VOID