ZwSetSystemInformation为什么加载不上驱动

fke_999 2011-07-24 08:11:57
ZwSetSystemInformation为什么加载不上驱动, 我的系统是xp sp2,编绎的是标准例子,没有错,就是驱动加载不上
#define SystemLoadAndCallImage 38
typedef long NTSTATUS;
bool load_sysfile()
{
SYSTEM_LOAD_AND_CALL_IMAGE GregsImage;

WCHAR daPath[] = L"\\??\\C:\\Helloddk.SYS";

//////////////////////////////////////////////////////////////
// get DLL entry points
//////////////////////////////////////////////////////////////
if( !(RtlInitUnicodeString = (RTLINITUNICODESTRING)
GetProcAddress( GetModuleHandle("ntdll.dll")
,"RtlInitUnicodeString"
)))
{
printf("RtlInitUnicodeString\n");
return false;
}

if(!(ZwSetSystemInformation = (ZWSETSYSTEMINFORMATION)
GetProcAddress(
GetModuleHandle("ntdll.dll")
,"ZwSetSystemInformation" )))
{
printf("Get--ZwSetSystemInformation\n");
return false;
}

RtlInitUnicodeString(
&(GregsImage.ModuleName)
,daPath
);

if(
!NT_SUCCESS(
ZwSetSystemInformation(
SystemLoadAndCallImage
,&GregsImage
,sizeof(SYSTEM_LOAD_AND_CALL_IMAGE))))
{
printf("ZwSetSystemInformation\n");//到这失败了
return false;
}

return true;
}
...全文
45 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fke_999 2011-07-25
  • 打赏
  • 举报
回复
..确实
jackyjkchen 2011-07-24
  • 打赏
  • 举报
回复
擦,发错了吧

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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