Hi All,
Problem : I was building a code of swapBuffers driver via swapBuffers.c file with “nmake” utility in XP WinDDK checked
environment. It creates a “swapBuffers.sys”(18 KB) file in objchk_wxp_x86 folder. It acts perfectly i.e. it is loaded via
“fltmc load swapBuffers” command perfectly and unloaded via " fltmc unload swapBuffers". But the same code run in Visual
studio 6.0 environment with the following settings, makes a driver but the size of swapBuffer.sys vary(17 KB). when i try to
load or unload this driver, it not work and gives an error message "Load failed with error: 0x80070002 , The system cannot
find the file specified."
Driver build environment settings:
Create project in Visual studio 6.0(VC++ 6.0)
* File -> New… -> Projects
* Chose Win32 Dynamic-link Library
* Enter project name and directory path (as usually)
* OK -> An empty DLL project -> Finish -> OK
Change project settings
* Project -> Settings
* Chose “All Configurations” in “Settings for” combo.
*Projet Settings:
-> C/C++ tab.
* Chose “General” in “Category” combo
* Chose “Program Database” in “Debug info” combo for “Win32 Debug” configuration.
* Chose “Code Generation” in “Category” combo
* Chose “__stdcall” in “Calling convention” combo
* Chose “8 Bytes *” in “Struct member alignment” combo
* Chose “Preprocessor” in “Category” combo
* Enter paths to DDK INCLUDE directories into “Additional include directories” edit in following
string:
$(BASEDIR)\inc,$(BASEDIR)\inc\ddk,$(BASEDIR)\inc\api,$(BASEDIR)\inc\crt,$(BASEDIR)\inc\wdf\kmdf
* Enter the following predefined constants into “Preprocessor definitions” edit(comma separated) :
DBG,DEBUG,_DEBUG,WIN32,_CONSOLE,_MBCS,X86 ( Win32Debug) configuration.
* Remove “/GZ” from “Project Options” edit in “Win32 Debug” configuration.
-> Link tab.
* Chose “General” in “Category” combo :
* Enter driver binary’es name in “Output filename” : “./Debug/swapBuffers.sys”
* Uncheck “Link incrementally” box.
* Chose “Input” in “Category” combo
* Check “Ignore all default libraries” box .
* Enter following list of .lib files in “Object/library modules” box(space separated) :
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib fltLib.lib fltMgr.lib wdm.lib
msvcrt.lib ntoskrnl.lib
* Chose “Output” in “Category” combo
* Enter “DriverEntry” value in “Entry point symbol” edit.
* Chose “Debug” in “Category” combo
* Uncheck “Separate types” checkbox.
* Change “/subsystem:xxxxx” to “/subsystem:native”(for all configuration such as Debug, release and
All) and add “/driver” to “Project Options” edit (separately for each configuration).
* OK.
* File -> Save Workspace.
Why the size of created driver different for the same source file, but different environment ?
Any information or idea will be appreciated.
Thank you