?
Mark offers some third party utilities. That's good, but I'll show a more handy-IMHO: How to configure and use Visual Studio for compiling drivers.?
Has fun
- Setup Visual Studio 2008.
- Setup DDK (WDK).
- Add to VS paths DDK include files, libs and bins.
- Create New Empty "Win32 project" and add source file (i.e.? HELLOWORLD.C).
- Configure Project Properties (all configurations):
- c\c++-general-debug Information Format = Program Database (/zi)
- c\c++-Preprocessor-preprocessor definitions = _x86_ [Add also DBG for Debug Config]
- C\c++-Code generation-enable C + + Exceptions = No
- C\c++-Code generation-basic Runtime Checks = Default
- C\c++-Code generation-buffer Security Check = No? (/GS-)
- c\c++-Advanced-calling convention = __stdcall (/gz)
- C\c++-Advanced-compile as = Compile as C Code (/TC) [If you is going to use plain c]
- Linker-general-output File =? $ (OutDir) \$ (ProjectName). SYS
- Linker-general-enable Incremental linking = Default
- Linker-input-additional Dependencies =? ntoskrnl.lib Hal.lib $ (NOINHERIT)? [Add needed libs here e.g.? ntoskrnl.lib Hal.lib]
- Linker-input-ignore all Default Libraries = Yes (/nodefaultlib)
- Linker-manifest file-generate Manifest = No
- Linker-system-subsystem = Native (/subsystem:native)
- Linker-system-driver = Driver (/driver)
- Linker-advanced-entry point = DriverEntry
- Linker-advanced-base Address = 0x10000
- linker-advanced-randomized Base Address = Disable (/dynamicbase:no)
(should be the default value)
- Linker-advanced-data Execution Prevention? (DEP) = Disable (/nxcompat:no)
(should be the default value)
?
- OK. Done. Now your can test it with simple code, e.g.:
Hide??? Copy Code
#include"Ntddk.h"
?
NTSTATUS
DriverEntry (Pdriver_object driverobject,punicode_string
Registrypath)
{
return status_unsuccessful;
}
Vs2008+windows DDK 7 Environment configuration