I am trying to implement function with variable params in kernel mode.
call to function:
a,b,c are integer variables
WriteLogFile("test of trace logs=%d =%d =%d \n",a,b,c);
Function:
NTSTATUS WriteLogFile(const char* str,...)
{
va_list vl;
va_start(vl,str);
RtlStringCbPrintfA(buffer, sizeof(buffer), str,vl);
then i am using zwwriteffile to write usermode text file.
va_end(vl);
}
output:
test of trace logs=1953719889=-1681971698 =1953719668
I am getting some garbage values. why?