一份很简单的代码,就是用Dbgprint输出一些信息。
代码写成这样可以编译通过
#include <ntddk.h>
NTKERNELAPI
NTSTATUS
PsLookupProcessByProcessId (
IN PVOID ProcessId,
OUT PEPROCESS *Process
);
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
DbgPrint("Drv Loading!\n");
//NTSTATUS st;
//PEPROCESS eprocess;
//UNICODE_STRING spath;
return STATUS_SUCCESS;
}
但是如果把NTSTATUS st这一行的注释符去掉,就会报错。
错误信息是这样的
c:\DDK\test\Test.c(18) : error C2275: 'NTSTATUS' : illegal use of this type as an expression
c:\DDK\inc\wxp\ntdef.h(560) : see declaration of 'NTSTATUS'
c:\DDK\test\Test.c(18) : error C2146: syntax error : missing ';' before identifier 'st'
c:\DDK\test\Test.c(18) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\DDK\test\Test.c(18) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\DDK\test\Test.c(18) : error C2143: syntax error : missing ';' before 'identifier'
c:\DDK\test\Test.c(18) : error C2065: 'st' : undeclared identifier
如果把UNICODE_STRING spath;这一行的注释符也去掉的话,错误又变成了
c:\DDK\test\Test.c(17) : error C2275: 'UNICODE_STRING' : illegal use of this type as an expression
c:\DDK\inc\wxp\ntdef.h(1095) : see declaration of 'UNICODE_STRING'
c:\DDK\test\Test.c(17) : error C2146: syntax error : missing ';' before identifier 'spath'
c:\DDK\test\Test.c(17) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\DDK\test\Test.c(17) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
c:\DDK\test\Test.c(17) : error C2143: syntax error : missing ';' before 'identifier'
c:\DDK\test\Test.c(17) : error C2065: 'spath' : undeclared identifier
拜托各位帮忙帮忙,我都快要崩溃了......
谢谢!
[培训]《安卓高级研修班(网课)》月薪三万计划,掌握调试、分析还原ollvm、vmp的方法,定制art虚拟机自动化脱壳的方法