From: Eugene_Nechamkin@spectrumsignal.com Subject: Re: Building a Windows NT Device Driver from VC4.2 Date: Mon, 29 Dec 1997 19:21:41 -0600 Message-ID: <883428560.1191706635@dejanews.com> Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode Organization: Deja News Posting Service Path: news.mitre.org!blanket.mitre.org!news.tufts.edu!cam-news-feed5.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.maxwell.syr.edu!nntp2.dejanews.com!grunt.dejanews.com!not-for-mail References: <01bd10ab$66dc2f40$034975c0@assaf> X-Article-Creation-Date: Mon Dec 29 20:49:20 1997 GMT X-Authenticated-Sender: Eugene_Nechamkin@spectrumsignal.com X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.01; Windows NT) X-Originating-IP-Addr: 134.87.211.198 () Lines: 111 In article <01bd10ab$66dc2f40$034975c0@assaf>, "Assaf Wodeslavsky" wrote: > Is it possible to build from the Developer's Studio instead of the Command > Line? > > Could someone please instruct me where to read up or better just tell me > which button to press? Assaf, I am using MSDEV 4.2 with the following simple DRVBLD.BAT file which does what you want: ------------------------------------------------------------------------------------------------------ @echo off if "%1" == "checked" goto ch_pars if "%1" == "CHECKED" goto ch_pars if "%1" == "free" goto ch_pars if "%1" == "FREE" goto ch_pars goto usage :ch_pars if "%2" == "" goto usage if "%3" == "" goto usage if NOT exist %2\nul goto usage if NOT exist %3\nul goto usage goto exec :usage echo ------------------------------------------------- > usage.txt echo Wrong Parameter(s). >> usage.txt echo Usage: >> usage.txt echo DRVBLD {CHECKED or FREE} {src_drv} {src_dir} >> usage.txt echo For example: >> usage.txt echo DRVBLD CHECKED D: ..\SRC >> usage.txt echo ------------------------------------------------- >> usage.txt type usage.txt goto endend :exec net stop udrv call %BASEDIR%\bin\setenv.bat %BASEDIR% %1 %2 cd %3 if EXIST .\BUILD.ERR del .\build.err if EXIST .\ok.txt del .\ok.txt if EXIST .\err.txt del .\err.txt if NOT EXIST .\I386\%1\nul mkdir .\I386\%1 rem === Let's build and copy it ====== BUILD -ce if EXIST .\BUILD.ERR goto err copy .\I386\%1\MYDRV.SYS %SYSTEMROOT%\SYSTEM32\DRIVERS rem === SoftICE stuff ========== C:\NTICE\NMSYM.EXE /UNLOAD:MYDRV.SYS C:\NTICE\NMSYM.EXE /TRANS:ALWAYS /SOURCE:.\; /LOAD %SYSTEMROOT%\SYSTEM32\DRIVERS\MYDRV.SYS net start udrv echo ----------------- > ok.txt echo ---- SUCCESS ---- >> ok.txt echo ----------------- >> ok.txt type ok.txt goto end :err echo ---------------- > err.txt echo ---- ERRORS ---- >> err.txt echo ---------------- >> err.txt type err.txt :end rem === Let's show all results === if EXIST BUILD.LOG type BUILD.LOG :endend ------------------------------------------------------------------------- ------------- This BAT file can work with any development directory structure. This BAT file does the folowing: - checkes the validity of input parameters, - stops the driver, - runs the SETENV.BAT file, - creates the BUILD directory (if it does not exist), - runs the BUILD utility, - copys the .SYS file to the \WINNT\SYSTEM32\DRIVERS directory, - builds and loads symbol table for NuMEGA's SoftICE debugger, - displays all the results in the "Build" tab of the "Output" window in MSDEV. If any errors were reported then you can as usual double-click on the line with an error, and this will automatically show you the place in your source code. To use this BAT file do the following: 1. Find all places in this BAT file with the string "MYDRV" and replace this string with the name of your driver 2. Create a new MSDEV project with the type "Makefile", 3. Place DRVBLD.BAT file in any directory in your PATH (I prefer to save it in the same directory where MSDEV's .MAK file is). 4. In the "Build/Settings" menu of MSDEV, "Build command line" edit box type in the follwing: DRVBLD.BAT checked for DEBUG configuration, or: DRVBLD.BAT free for RELEASEconfiguration. - drive letter where all driver's source files are, - full directory name where all driver's source files are. For exmple, if all your driver's files are in the same direcrtory where MSDEV's .MAK file is, then the command lline would be: DRVBLD.BAT checked D: .\ Good Luck. Eugene. -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet