horsedo
驱动小牛
驱动小牛
  • 注册日期2001-11-29
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
阅读:2159回复:6

98下VXD如何调用WDM驱动中的函数?

楼主#
更多 发布于:2002-10-21 09:57
98下WDM驱动用什么方式向VXD输出服务呢
我想在VXD中调用 NtKernCreateFile
                NtKernInternalDeviceIoControl
发送IOCTL到WDM驱动,可是不论我怎么设置和修改编译设置
总是找不到 NtKernxxx系列函数,大侠请指教,多谢!

最新喜欢:

linwnlinwn
horsedo
驱动小牛
驱动小牛
  • 注册日期2001-11-29
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2002-10-21 14:41
98下WDM驱动用什么方式向VXD输出服务呢
我想在VXD中调用 NtKernCreateFile
                NtKernInternalDeviceIoControl
发送IOCTL到WDM驱动,可是不论我怎么设置和修改编译设置
总是找不到 NtKernxxx系列函数,大侠请指教,多谢!

知道了,NtKernXXX系列函数只能在98下用,所以在VXD的makefile
中加入:TARGET = WIN98  就OK了!
fracker
驱动太牛
驱动太牛
  • 注册日期2001-06-28
  • 最后登录2021-03-30
  • 粉丝0
  • 关注0
  • 积分219分
  • 威望81点
  • 贡献值0点
  • 好评度23点
  • 原创分0分
  • 专家分1分
  • 社区居民
板凳#
发布于:2002-10-21 15:02
想问一下,你的WDM怎么安装呢?用.inf文件吗?

[编辑 -  10/21/02 by  fracker]
horsedo
驱动小牛
驱动小牛
  • 注册日期2001-11-29
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
地板#
发布于:2002-10-21 15:07
想问一下,你的WDM怎么安装呢?用.inf文件吗?

[编辑 -  10/21/02 by  fracker]

没有,我只需要开机能启动这个驱动就行了,
同2000一样写注册表重起就行了,呵呵![HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\iParse]
\"ErrorControl\"=dword:00000001
\"Start\"=dword:00000002
\"Type\"=dword:00000001
horsedo
驱动小牛
驱动小牛
  • 注册日期2001-11-29
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
地下室#
发布于:2002-10-22 08:51
还有一个问题请教,我在VXD中取得WDM驱动的一个函数的指针,
在VXD中调用这个函数没有问题
可是随后出现 pagefault
去掉对这个函数的调用没有问题了,这个是什么原因呢
这个函数指针应该可以直接引用吧
seaquester
驱动大牛
驱动大牛
  • 注册日期2002-05-22
  • 最后登录2016-06-16
  • 粉丝0
  • 关注0
  • 积分500分
  • 威望115点
  • 贡献值0点
  • 好评度107点
  • 原创分0分
  • 专家分52分
5楼#
发布于:2002-10-22 09:05
Calling WDM Services from Windows 98 VxDs

If you are developing VxDs specifically for Windows 98, you might occasionally
need to call a WDM service from a VxD. The Windows 98 DDK has some limited
support for doing this, although it isn\'t fully documented.

In subdirectory lib\\i386\\free\\win98 you\'ll find library wdmvxd.clb. This
library gives you linkage to most if not all of the WDM entry points provided
with Windows 98. Each of the object files loads registers and invokes INT 2Eh,
which traps to a system dispatcher. Before invoking the called WDM service,
the dispatcher takes care of ensuring that the stack is set up for structured
exception handling, which is supported in WDM drivers.

The library is set up to look like an import library, even though it does not
result in any imports being generated. If you use DUMPBIN with the /linkermember
switch, you\'ll see that the entry points are prefixed with __imp_. This was done
so that you can use prototypes directly from wdm.h.

For example, suppose you wanted to call RtlInitUnicodeString from a VxD.You would
need this prototype from wdm.h:

NTSYSAPI
VOID
NTAPI
RtlInitUnicodeString(
    PUNICODE_STRING DestinationString,
    PCWSTR SourceString
);

In addition, you may need these definitions:
#define NTSYSAPI __declspec(dllimport)
#define NTAPI __stdcall

Then it\'s simply a matter of having the typedef\'s and linking against wdmvxd.clb.
Use wdmvxd.clb only when absolutely necessary, and always with extreme caution.
Because IRQL is largely undefined in VxDs, there are numerous ways to get into
trouble when making these calls.
八风舞遥翩,九野弄清音。 鸣高常向月,善舞不迎人。
horsedo
驱动小牛
驱动小牛
  • 注册日期2001-11-29
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分2分
  • 威望10点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
6楼#
发布于:2002-10-22 09:15
还有一个问题请教,我在VXD中取得WDM驱动的一个函数的指针,
在VXD中调用这个函数没有问题
可是随后出现 pagefault
去掉对这个函数的调用没有问题了,这个是什么原因呢
这个函数指针应该可以直接引用吧

楼上的帖子我看过了,和我的问题不是一回事儿,呵呵
结论是VXD中取得例外一个WDM驱动的函数指针后可以直接调用,
但是要双方的调用约定一样,比如都指定为 _stdcall
游客

返回顶部