function with variable arguments in kernel mode

核能气质少年 提交于 2020-01-07 05:42:08

问题


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?

来源:https://stackoverflow.com/questions/15195239/function-with-variable-arguments-in-kernel-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!