Hi All,
Please help me in fixing this problem , In my Kernel driver code i am trying to print some traces,
for that i am allocating a buff from non paged pool and formatting it.
After that trying to print it through DbgPrint.and after printing freeing the buff.
For Formatting the Buff, i am using RtlStringCchPrintfW function call.
But i am getting an bugcheck just after calling RtlStringCchPrintfW.
pls check my code below and tell me anything wrong.
PWCHAR pBuf = NULL;
pBuf = ExAllocatePoolWithTagNonPagedPool, MAX_TRACEBUFF_SIZE ,BUS_POOL_TAG);
RtlStringCchPrintfW(pBuf, MAX_TRACEBUFF_SIZE,
L"%-4d:%-4d:%-4d\n"
L"Configuration[%d]\n"
L"%-40ws" L"%d\n"
L"%-40ws" L"%d\n",
min,sec,mls,pConfig->bConfigurationValue,
L" wTotalLength",pConfig->wTotalLength,
L" bNumInterfaces",pConfig->bNumInterfaces
);
in the above call
pBuf ---->is buffer pointer.
MAX_TRACEBUFF_SIZE ---->buffer size
L"%-4d:%-4d:%-4d\n" |
L"Configuration[%d]\n" |-------->format string
L"%-40ws" L"%d\n" |
L"%-40ws" L"%d\n", |
min,sec,mls,pConfig->bConfigurationValue, |
L" wTotalLength",pConfig->wTotalLength, |–>arguments
L" bNumInterfaces",pConfig->bNumInterfaces |
The IRQL while calling this is DISPATCH LEVEL.
Thanks,
Get your own web address for just $1.99/1st yr. We’ll help. Yahoo! Small Business.