一个菜鸟问题

yiyefangzhou24 2011-02-22 10:12:42
请问我使用的是微软的WDK中自带编译器编译出现问题,显示如下[code=C]/C++
D:\aaa>build
path contains nonexistant c:\program files\windows7master, removing
BUILD: Compile and Link for x86
BUILD: Loading c:\winddk\7600.16385.1\build.dat...
BUILD: Computing Include file dependencies:
BUILD: Start time: Tue Feb 22 10:11:52 2011
BUILD: Examining d:\aaa directory for files to compile.
BUILD: Saving c:\winddk\7600.16385.1\build.dat...
BUILD: Compiling and Linking d:\aaa directory
Configuring OACR for 'root:x86chk' - <OACR on>
BUILD: Finish time: Tue Feb 22 10:11:53 2011
BUILD: Done

0 files compiled - 1 Warning[/code]
请问错误在第几行?怎么看出来的
谢谢
...全文
105 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
yiyefangzhou24 2011-02-22
  • 打赏
  • 举报
回复
[code=C]/C++#include<ntddk.h>


typedef struct _ServiceDescriptorEnty
{
unsigned int *ServiceTableBase;
unsigned int *ServiceCounterTableBase;
unsigned int NumberOfServices;
unsigned char *ParamTableBase;
}ServiceDescripforTableEnty, *PServiceDescriptorTableEnty;

extern PServiceDescriptorTableEntry KeServiceDescriptorTable;



NTSTATUS ZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
);

NTSTATUS HookZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
);

NTSTATUS DriverEntry(IN PDRIVER_OBJECT driver,
IN PUNICODE_STRING reg_path)
{
_asm
{
cli;
mov eax,cr0;
and eax,0fffeffffh;
mov cr0,eax;
}

(((PServiceDescriptorTableEnty)KeServiceDescriptorTable)->ServiceTableBase[*(PULONG)(PUCHAR)ZwOpenProcess+1)];

_asm
{
cli;
mov eax,cr0;
and eax,0x10000;
mov cr0,eax;
}

driver->DriverUnload=DriverUnload;
return STATUS_SUCCESS;
}


NTSTATUS HookZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
)
{
NTSTATUS rc;
ULONG dwPID;
rc=(NTSTATUS)(REALZWOPENPROCESS)RealZwOpenProcess(ProcessHandle,
DesiredAccess,ObjectAttributes,ClientId);
if(ClientId!=NULL)
{
dwPID=(ULONG)ClientId->UniqueProcess;
if(dwPID==1024)
{
DbgPrintf("PID 1024 has been accessed,need forbidden");
ProcessHandle=INVALID_HANDLE_VALUE;
rc=STATUS_ACCESS_DENIED;
}
}
return rc;
}[/code]
yiyefangzhou24 2011-02-22
  • 打赏
  • 举报
回复
我把程序贴出来看看,初学,要被耻笑了[code=C]/C++#include<ntddk.h>


typedef struct _ServiceDescriptorEnty
{
unsigned int *ServiceTableBase;
unsigned int *ServiceCounterTableBase;
unsigned int NumberOfServices;
unsigned char *ParamTableBase;
}ServiceDescripforTableEnty, *PServiceDescriptorTableEnty;

extern PServiceDescriptorTableEntry KeServiceDescriptorTable;



NTSTATUS ZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
);

NTSTATUS HookZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
);

NTSTATUS DriverEntry(IN PDRIVER_OBJECT driver,
IN PUNICODE_STRING reg_path)
{
_asm
{
cli;
mov eax,cr0;
and eax,0fffeffffh;
mov cr0,eax;
}

(((PServiceDescriptorTableEnty)KeServiceDescriptorTable)->ServiceTableBase[*(PULONG)(PUCHAR)ZwOpenProcess+1)];

_asm
{
cli;
mov eax,cr0;
and eax,0x10000;
mov cr0,eax;
}

driver->DriverUnload=DriverUnload;
return STATUS_SUCCESS;
}


NTSTATUS HookZwOpenProcess(
out PHANDLE ProcessHandle,
in ACCESS_MASK DesiredAccess,
in POBJECT_ATTRIBUTES ObjectAttributes,
in_opt PCLIENT_ID ClientId
)
{
NTSTATUS rc;
ULONG dwPID;
rc=(NTSTATUS)(REALZWOPENPROCESS)RealZwOpenProcess(ProcessHandle,
DesiredAccess,ObjectAttributes,ClientId);
if(ClientId!=NULL)
{
dwPID=(ULONG)ClientId->UniqueProcess;
if(dwPID==1024)
{
DbgPrintf("PID 1024 has been accessed,need forbidden");
ProcessHandle=INVALID_HANDLE_VALUE;
rc=STATUS_ACCESS_DENIED;
}
}
return rc;
}[/code]
yiyefangzhou24 2011-02-22
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 sxqinge 的回复:]
你双击下编译器提示出错的那些行就行了,然后系统会自动将光标定位到你双击的错误行上。
一般都是从第一个错误开始处理
[/Quote]
我直接用的是WDk包中的X86 checked build environment不是用VC架构的编译环境
zhanshen2891 2011-02-22
  • 打赏
  • 举报
回复
我记得,我用这个的时候它都会把错误和警告都显示的很清楚啊,不知道你这是怎么回事。
sxqinge 2011-02-22
  • 打赏
  • 举报
回复
你双击下编译器提示出错的那些行就行了,然后系统会自动将光标定位到你双击的错误行上。
一般都是从第一个错误开始处理
yiyefangzhou24 2011-02-22
  • 打赏
  • 举报
回复
有一个warning,目录下没有生成编译连接后的文件(sys文件)
pjl1119 2011-02-22
  • 打赏
  • 举报
回复
寡人眼拙,未看出有错误...

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧