function with variable arguments in kernel mode

2019-09-03 02:23发布

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?

0条回答
登录 后发表回答