]> xenbits.xensource.com Git - pvdrivers/win/xennet.git/commit
Stop using RtlStringCbPrintfA()
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 27 Jan 2016 14:52:57 +0000 (14:52 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 27 Jan 2016 15:02:31 +0000 (15:02 +0000)
commitdeb4a73dedbb026d0e030901ee6f4dd74f452646
tree26d515f3ff0d97fc5d3e3e79e53744b114bb5b50
parent4abbd6fbcc02492fd745b85c22ff766d55921bcb
Stop using RtlStringCbPrintfA()

It appears that linking an NDIS driver with any ntstrsafe function (when
building with VS2012 and the 8.0 WDK at least) has the side effect of
requiring use of DbgPrint(). Whilst this may not sound like a problem, it
is. This is because the NDISTest 6.0 1c_KernelCalls test insists that any
use of DbgPrint is illegal and so it's impossible to logo an NDIS driver
using ntstrsafe functions.

This patch works around the issue by dynamically linking (at run-time) to
the ntdll _snprintf_s function as a replacement for calls to
RtlStringCbPrintfA(). This entails importing the dynamic linking code from
XENVIF since MmGetSystemRoutineAddress() doesn't seem to work for that
symbol.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xennet/adapter.c
src/xennet/link.c [new file with mode: 0644]
src/xennet/link.h [new file with mode: 0644]
vs2012/xennet/xennet.vcxproj
vs2013/xennet/xennet.vcxproj