📄 [转贴]在visual studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.htm
字号:
<TD
style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"
vAlign=top width="20%" bgColor=#ffffff height="100%"><FONT face=Gulim
color=#000066><B>sky_2003</B></FONT><BR>
<TABLE cellSpacing=0 cellPadding=0 width="98%">
<TBODY>
<TR>
<TD align=middle><BR><BR></TD></TR></TBODY></TABLE><BR><BR><!----><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/8.gif">
<BR>级别: <FONT color=#555555>驱动牛犊</FONT><BR>精华: <FONT
color=green><B>0</B></FONT><BR>发帖: <FONT
color=green><B>43</B></FONT><BR>威望: <FONT color=#984b98><B>14
点</B></FONT><BR>积分: <FONT color=#984b98><B>87 分</B></FONT><BR><!---->贡献值:
<FONT color=red><B>0 点</B></FONT><BR><!---->注册时间:2005-06-07<BR></TD>
<TD vAlign=top width="80%" bgColor=#ffffff height="100%">
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" height="100%"
cellSpacing=0 cellPadding=6 width="99%" align=center>
<TBODY>
<TR height="100%">
<TD vAlign=top bgColor=#ffffff colSpan=6><!----><A
href="http://blog.zndev.com/blog.php?bbsuid=107651"
target=_blank><IMG alt=进入个人主页
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/homepage.gif"
align=absMiddle></A> <!----><A
href="http://bbs.zndev.com/profile.php?action=show&uid=107651"><IMG
alt=查看作者资料
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/profile.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/message.php?action=write&touid=107651"><IMG
alt=发送短消息
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/message.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/sendemail.php?uid=107651"><IMG alt=发送邮件
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/email.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/sendemail.php?action=tofriend&tid=101492"><IMG
alt=推荐此帖
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/emailto.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/post.php?action=quote&fid=11&tid=101492&pid=&article=0"><IMG
alt=引用回复这个帖子
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/quote.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/post.php?action=modify&fid=11&tid=101492&pid=&article=0"><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/edit.gif"
align=absMiddle></A> <!----><BR><BR><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/4.gif"
align=left border=0> <SPAN class=tpc_title>[转贴]在Visual Studio
6.0集成环境中开发设备驱动程序的设置方法</SPAN><BR><!----><BR><SPAN
class=tpc_content><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/wink.gif"><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/wink.gif"><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/wink.gif">刚刚找到的,纯粹转贴,希望仍然对此迷惑的同志们有所帮助!!!<BR><BR><BR>在Windows上,Windows
DDK提供的开发环境是基于命令行的,操作起来极为不便,相信进行过驱动程序开发的朋友一定对此深恶痛绝。另一方面,Visual Studio
6.0却给我们提供了非常友好易用的集成环境,让我们有如虎添翼之感。<BR> 那么,能否利用Visual
Studio的集成环境来开发驱动程序呢?笔者经过多方探索,并结合自己开发驱动的经验,摸索出了一套实用的方法,通过对Visual
Studio集成环境的简单设置,创建了自己的驱动开发集成环境了。 下面笔者的一些经验奉献出来与大家共享,如有不当,欢迎指正。<BR><BR>0.系统要求已安装<BR> DDK<BR> Visual
C++6.0(安装时选上所有工具)<BR><BR>1.改造ddk\bin\setenv.bat<BR> 把要求mstools的有关语句注释掉(若想在命令行环境开发驱动则还需加入call
VC_DIR\VC98\Bin\Vcvars32. bat),以便能在命令行使用vc的相关工具;若只想在IDE环境开发就不必调用Vcvars32.bat,因为相关工具的路径信息可以在vc环境中设置.)<BR><BR>2.创建一个目录DriverEnv(目录名随意),作为你开发驱动的大本营<BR><BR>3.在该目录下创建一个批处理文件MakeDrvr.bat,内容如下:<BR>@echo
off<BR>if "%1"=="" goto usage<BR>if "%3"=="" goto usage<BR>if not
exist %1\bin\setenv.bat goto usage<BR>call %1\bin\setenv %1
%4<BR>%2<BR><BR>cd %3<BR>build -b -w %5 %6 %7 %8 %9<BR><BR>goto
exit<BR><BR>:usage<BR>echo usage MakeDrvr DDK_dir Driver_Drive
Driver_Dir free/checked [build_options]<BR>echo eg MakeDrvr
%%DDKROOT%% C: %%WDMBOOK%% free
-cef<BR>:exit<BR> 该批处理首先对传递的参数作一些检查,然后调用ddk的setenv命令设置环境变量,然后改变目录为源程序所<BR>在驱动器和目录,并最后调用build,-b保证显示完全的错误信息,-w保证在屏幕上输出警告,在vc
ide里的output窗口中可以看到这些错误和警告。<BR><BR>4.建立一个空白工程<BR> 选File的new菜单项,然后选project栏的makefile,然后输入路径,一路next下去即可,visual
studio提供两种配置win32 debug和win32
release.<BR><BR>5.修改这两种配置<BR> 选project的settings菜单项win32
debug:<BR> 在Build Command Line一栏填入MakeDrvr DDK_DIR SOURCE_DRIVE
SOURCE_DIR checked [build options]<BR> 在Rebuild all options一栏填入
-nmake /a<BR> 在output
file一栏填入与sources文件中的TARGETNAME相同的文件名<BR> 在Browse info file
name一栏填入obj\i386\checked\(与TARGETNAME相同的文件名,见下述).bsc<BR><BR> win32
release:<BR> 在Build Command Line一栏填入MakeDrvr DDK_DIR SOURCE_DRIVE
SOURCE_DIR free [build options]<BR> 在Rebuild all options一栏填入 -nmake
/a<BR> 在output file一栏填入与sources文件中的TARGETNAME相同的文件名<BR> 在Browse
info file
name一栏填入obj\i386\free\(与TARGETNAME相同的文件名).bsc<BR> 注:DDK_DIR一般可以写成%BASEDIR%,build
options一般为-cef即已足够<BR><BR>6.添加源文件到工程<BR> 可以新建,也可以添加,这和普通的win32开发一样。<BR><BR>7.添加资源文件<BR> 选INSERT的RESOURCE菜单项即可
8.把文件makefile放入源程序目录,其内容总是<BR>#<BR># DO NOT EDIT THIS FILE!!! Edit
.\sources. if you want to add a new source<BR># file to this
component. This file merely indirects to the real make file<BR>#
that is shared by all the driver components of the Windows NT
DDK<BR>#<BR><BR>!INCLUDE
$(NTMAKEENV)\makefile.def<BR><BR>9.把文件Sources放入源程序目录,内容为<BR> TARGETNAME=RamDrive//这是要生成的驱动程序.sys文件的名字<BR> TARGETPATH=obj
//.sys文件所在目录的上层目录,(由于ddk的bug)应手工在obj目录下创建checked和free目录,以作为.sys的最终存放目录<BR> TARGETTYPE=DRIVER
//驱动程序的类型,一般不变<BR> INCLUDES=$(BASEDIR)\inc
//ddk包含文件路径,一般不变<BR> SOURCES=RamDrive.cpp RamDrive.rc
//源文件(不要头文件),资源文件<BR> BROWSER_INFO = 1
//若想要浏览信息,则要有本行;否则可无<BR><BR>10.因为MakeDrvr.bat在DriverEnv目录,所以应把该目录添加到vc的Executable
files里面<BR> 选tools的options菜单项,然后选directories页,在show directories
for一栏选择Executable files,然后添加即可.<BR><BR> 至此,环境设置完毕,你可以按F7,
build你的驱动程序了。 <BR><BR><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/redface.gif">
<IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/redface.gif">
<IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/redface.gif"><BR><BR><BR><FONT
color=gray>[ 此贴被sky_2003在2005-11-04 10:15重新编辑 ]</FONT></SPAN><BR><!----></TD></TR>
<TR vAlign=bottom bgColor=#ffffff>
<TD colSpan=6><!---->
<TABLE cellSpacing=1 cellPadding=4 bgColor=#e7e3e7>
<TBODY>
<TR>
<TD class=t_one><A href="http://www.zndev.com/trade.php"><FONT
color=red>驱网网上商城-开发板,开发资料光盘</FONT></A></TD></TR></TBODY></TABLE><!----></TD></TR>
<TR vAlign=bottom bgColor=#ffffff>
<TD colSpan=5><!----><FONT color=red>[楼 主]</FONT>
<!----><B>Posted:</B>2005-11-04 08:54|</TD>
<TD align=right><A href="javascript:scroll(0,0)"><IMG alt=顶端
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/top.gif"></A>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE width="98%" align=center>
<TBODY>
<TR>
<TD height=1></TD></TR></TBODY></TABLE><!---->
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" cellSpacing=1
cellPadding=0 width="98%" align=center bgColor=#e7e3e7>
<TBODY>
<TR>
<TD
style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px"
vAlign=top width="20%" bgColor=#ffffff height="100%"><FONT face=Gulim
color=#000066><B>dpj2005</B></FONT><BR>
<TABLE cellSpacing=0 cellPadding=0 width="98%">
<TBODY>
<TR>
<TD align=middle><BR><BR></TD></TR></TBODY></TABLE><BR><BR><!----><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/8.gif">
<BR>级别: <FONT color=#555555>驱动牛犊</FONT><BR>精华: <FONT
color=green><B>0</B></FONT><BR>发帖: <FONT
color=green><B>5</B></FONT><BR>威望: <FONT color=#984b98><B>1
点</B></FONT><BR>积分: <FONT color=#984b98><B>5 分</B></FONT><BR><!---->贡献值:
<FONT color=red><B>0 点</B></FONT><BR><!---->注册时间:2005-10-19<BR></TD>
<TD vAlign=top width="80%" bgColor=#ffffff height="100%">
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" height="100%"
cellSpacing=0 cellPadding=6 width="99%" align=center>
<TBODY>
<TR height="100%">
<TD vAlign=top bgColor=#ffffff colSpan=6><!----><A
href="http://blog.zndev.com/blog.php?bbsuid=122509"
target=_blank><IMG alt=进入个人主页
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/homepage.gif"
align=absMiddle></A> <!----><A
href="http://bbs.zndev.com/profile.php?action=show&uid=122509"><IMG
alt=查看作者资料
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/profile.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/message.php?action=write&touid=122509"><IMG
alt=发送短消息
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/message.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/sendemail.php?uid=122509"><IMG alt=发送邮件
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/email.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/sendemail.php?action=tofriend&tid=101492"><IMG
alt=推荐此帖
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/emailto.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/post.php?action=quote&fid=11&tid=101492&pid=682687&article=1"><IMG
alt=引用回复这个帖子
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/quote.gif"
align=absMiddle></A> <A
href="http://bbs.zndev.com/post.php?action=modify&fid=11&tid=101492&pid=682687&article=1"><IMG
src="[转贴]在Visual Studio 6_0集成环境中开发设备驱动程序的设置方法 驱动开发网技术社区 - powered by phpwind_net.files/edit.gif"
align=absMiddle></A> <!----><BR><BR><SPAN
class=tpc_title></SPAN><BR><!----><BR><SPAN
class=tpc_content>狂顶!!!!!!!!!!!!!!!!!!!!</SPAN><BR><!----></TD></TR>
<TR vAlign=bottom bgColor=#ffffff>
<TD colSpan=6><!---->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -