阅读:2350回复:14
有谁调通了《Windows WDM 设备驱动程序开发指南》上的例子我按照书上的设置,好像没问题了,却出现下面的错误。MakeDrvr是.bat文件怎么说不是批处理文件呢? 这本书我早就买了,刚开始学的时候一头雾水,同书上的例子一个都调不同,感到驱动太难了,就放弃了 那知道现在搞的项目要用到他了,没办法了,救救吧!! --------------------Configuration: Wdm1 - Win32 Free-------------------- \'MakeDrvr\' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 Error executing c:\\winnt\\system32\\cmd.exe. Wdm1.sys - 1 error(s), 0 warning(s) 另外能解释一下MakeDrvr.bat中的意思吗? %1 %3...是什么意思? @echo off if \"%1\"==\"\" goto usage if \"%3\"==\"\" goto usage if not exist %1\\bin\\setenv.bat goto usage call %1\\bin\\setenv %1 %4 %2 cd %3 build -b -w %5 %6 %7 %8 %9 goto exit :usage echo usage MakeDrvr DDK_dir Driver_Drive Driver_Dir free/checked [build_options] echo eg MakeDrvr %%DDKROOT%% C: %%WDMBOOK%% free -cef :exit |
|
沙发#
发布于:2003-12-31 09:59
没有人知道吗?
waiting... ... |
|
板凳#
发布于:2003-12-31 10:36
呵呵,我最近也要开始写驱动了.
这本书,我也看了一部分,还是没掌握该如何入手:( 你这个问题,我前几天也遇到了.刚才看了一下,由于系统找不到MakeDrvr.bat这个命令,所以不能用.你把这个批处理拷到c盘下, 就ok了. |
|
地板#
发布于:2003-12-31 11:39
楼上说的对,我把所有的例子都调试通了。
|
|
地下室#
发布于:2003-12-31 15:35
应该不是吧,我把MakeDrvr.bat考到了c:下的一个目录,并在path环境变量中加了这路经,一定要把它考到c:\\下吗。我回去试试,谢了
|
|
5楼#
发布于:2003-12-31 16:08
个人认为这本书还是挺好的,它上面的例子我用W2KDDK调通了几个,你可能没有设置对。
|
|
|
6楼#
发布于:2003-12-31 16:52
%1是bat带的第一个参数,%2是第二个。。。 比如 xxx.bat a b %1 是a |
|
7楼#
发布于:2003-12-31 20:17
谢谢:arthurtu
明白了 asslittle: 你这个问题,我前几天也遇到了.刚才看了一下,由于系统找不到MakeDrvr.bat这个命令,所以不能用.你把这个批处理拷到c盘下, 就ok了. 我按你说的copy到c:还是不行,我把她考到c:\\winnt\\下就可以了 编译没有报错 但又有问题了,在vc6里编译好像事没问题了,但我发现vc根本没有编译,我把原来的 wdm1.sys,delete掉,根本找不到有wdm1.sys文件生成,哪未能介绍一下vc究竟怎么编译makefile工程的 另外编译成功的弟兄,能不能把你们的传上来,让我看看是我设的问题还是我的程序就有问题 |
|
8楼#
发布于:2004-01-01 13:07
你要用ds里的工具把source文件转换成dsw工程,还要通过ds生成的包含设置环境变量的快捷方式进vc才能编译驱动。
|
|
9楼#
发布于:2004-01-01 13:56
你要用ds里的工具把source文件转换成dsw工程,还要通过ds生成的包含设置环境变量的快捷方式进vc才能编译驱动。 你能说详细点吗,ds是什么,工具又是什么。代码我把她传上来了,又时间帮我看看,目录里又dsp文件啊,开他会自动生成dsw文件,太菜了,我以前学java的,用java做了点东西,vc刚开始学。我做了个网站,有100m空间,驱动的朋友需要什么可以留个言,我又的话把它放上去,因为我的网站几乎没人访问(but me),所以速度还可以。我在驱动网上得到这么多热心人的帮助,自己水平不行没有能力帮助别人,有时也挺惭愧的 |
|
|
10楼#
发布于:2004-01-01 14:11
忘了说网址了(我的网和驱动没有任何关系,只是方便驱动网友下急用软件,没有广告之意) http://www.3dproductshow.com/ 需要什么软件e-mail通知我:client@3dproductshow.com |
|
11楼#
发布于:2004-01-02 16:41
知道了,2000里的DDKROOT 环境变量没有设,还是数没看仔细
谢谢各位了,这本书还是挺好的 |
|
12楼#
发布于:2004-01-02 21:18
有又问题了!!!!!!
《Windows WDM 设备驱动程序开发指南》第82页最后一段是什么意思: 他是这么说的:c:\\98ddk\\inc\\win98\\setupapi.h头文件的vc++5版已经过时了,所以程序代码特别包括windows 98 DDK版本 有谁能解释一下这句话吗? 该怎么处理,我在vc++6种编译确实出现了如下错误,好像这些错误都是因为ULONG_PTR引起的,ULONG_PTR不知道在哪定义的 --------------------Configuration: Wdm1Test - Win32 Debug-------------------- Compiling... Wdm1Test.cpp c:\\ntddk\\inc\\setupapi.h(514) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(514) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(514) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(526) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(526) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(526) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(667) : error C2146: syntax error : missing \';\' before identifier \'ClassInstallReserved\' c:\\ntddk\\inc\\setupapi.h(667) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(667) : error C2501: \'ClassInstallReserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(680) : error C2146: syntax error : missing \';\' before identifier \'ClassInstallReserved\' c:\\ntddk\\inc\\setupapi.h(680) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(680) : error C2501: \'ClassInstallReserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1185) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1185) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1185) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1196) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1196) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1196) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1211) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1211) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1211) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1220) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1220) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1220) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1267) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1267) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1267) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1279) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1279) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1279) : error C2501: \'Reserved\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1303) : error C2146: syntax error : missing \';\' before identifier \'PrivateData\' c:\\ntddk\\inc\\setupapi.h(1303) : error C2501: \'DWORD_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1303) : error C2501: \'PrivateData\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1361) : error C2146: syntax error : missing \';\' before identifier \'Reserved\' c:\\ntddk\\inc\\setupapi.h(1361) : error C2501: \'ULONG_PTR\' : missing storage-class or type specifiers c:\\ntddk\\inc\\setupapi.h(1361) : error C2501: \'Reserved\' : missing storage-class or type specifiers Error executing cl.exe. Wdm1Test.exe - 36 error(s), 0 warning(s) |
|
13楼#
发布于:2004-01-20 19:15
解释: \"c:\\98ddk\\inc\\win98\\setupapi.h头文件的vc++5版已经过时了,所以程序代码特别包括windows 98 DDK版本\"
安装98DDK就解决了。 或者利用Vc6.0的头文件,名字我忘记了。可以通过查所调用的函数得到头文件的名字。 |
|
14楼#
发布于:2004-01-24 19:43
将这句“#include \"c:\\98ddk\\inc\\win98\\setupapi.h\"”改成
“#include <setupapi.h>”就行了。 |
|