Windows Driver Development with Eclipse - windows

Is that possible to integrate WDK into Eclipse? WDK seems to have its own compiler and debugger, so I wonder if there is a plug-in or it could be done manually?

See DDKBUILD for an example of how to launch the WDK build procedure from a bath file:
http://www.osronline.com/article.cfm?article=43
Typically all you need to do is modify this procedure to fit your IDE.
-scott

Run Eclipse from build environment that you need (free or checked with needed architecture)
Create project or import C/C++ / Existing code as makefile project. Select GNU Toolchain.
Properties -> Builders -> New -> Environment -> Select, select all variables, mark "add to all configurations", select "replace native environment with specified on". On the Main tab select full path to build.exe of the selected build environment. Select your project directory in workspace as "working directory"
Properties -> C/C++ Build -> On Bulder Settings tab remove "Use default build command" flag and type "build"
Properties -> C/C++ Build -> Tool Chain Editor -> Select Tools. Personaly I selected msvc compilers.
Properties -> C/C++ General -> Paths and Symbols -> select includes that you need including WDK ones
Enjoy

Related

How to run MFC application in windows XP without C++ redistributable support

My Development Environment is
C++
Visual Studio 2008
Windows 7
I'm going to start a project (MFC application) and final result (exe) should run on windows xp, vista ,windows 7 or windows 8 without installing any extra packages (like Visual C++ Redistributable package).
Questions:
Which kind of project I should select in visual studio?
What are the project settings I should specify?
You have to use MFC as a static library. Pay attention in project creation wizard for this option.
These are the basic things you have to consider when you start a project in Visual studio that need to run in target computer without installing any other redistribute components.
You have to select project type Win32-> Win32 Console Application or Win32-> Win32 Project as your console or GUI requirements.
You must select No Common Language Runtime support in right click project in solution explorer -> Properties -> General -> Common Language Runtime support
Your application need run-time assemblies to run in target computer. There is two methods to deploy run time DLLs in target computer
Assemblies link statically ( right click project in solution explorer -> Properties -> General -> Use of MFC and Use of ATL). but if your application combine with multiple DLL EXE and LIBs, this method is quite troublesome.
Deploy Runtime DLLs in target computer as private assemblies (I personally recommend this method). More details here
Expanding upon what's already been said..
You need to set the project to build as a static library:
Right click the project
Go to "Properties->Configuration Properties->General->Project Defaults->Use of MFC" set to "Use MFC in a Static Library"
You may also need to turn off the /MD flag if you're using it, and swap it out for '/MT' instead:
Right click the project
Go to "Properties->Configuration Properties->C/C++->Code Generation->Runtime Library" set to "Multi-threaded /MT"

Force visual studio to have same include directories between debug and release mode

I was wondering if there is a way to synchronize settings for include and link directories between debug and release configurations for project/solution?
More precisely, is there any way to tell visual studio I would like project properties
C/C++ - > General -> "Additional Include Directories"
Linker -> General -> "Additional Library Directories"
Linker -> Input -> "Additional Dependencies"
to be same for debug and release configuration, or somehow efficiently/automatically forward those settings from one configuration to the other configurations? Perhaps there is any plugin/script for that, since it is only necessary to change few lines in project text file to do what I want?
I'm currently using visual studio 2005, but I think this feature should not depend too much on version of the studio, so please post answers/solutions for any version of visual studio.
Use property sheets: create a property sheet containing the common properties, then include it in each build configuration. Do everything via the Property Manager window; be careful now: any change you want to make to the common properties must be made in the property sheet, not in the project properties!

Setting up eclipse for windows driver development

I am trying to write a user-mode windows(XP, Vista & 7) virtual printer driver using WDK 7.1.0 . I plan to use eclipse IDE for development, so wanted to know if I can set it up for the same. I am looking to do following:-
1) Eclipse to recognize win32 apis (C and C++) and hence provide features like autocompletion for its function names
2) Eclipse to use compiler provided with WDK
3) Debug the code through eclipse (Not sure if this is possible or not)
OR would you suggest some other development environment for windows driver development ?
Run Eclipse from build environment that you need (free or checked with needed architecture)
Create project or import C/C++ / Existing code as makefile project. Select GNU Toolchain.
Properties -> Builders -> New -> Environment -> Select, select all variables, mark "add to all configurations", select "replace native environment with specified on". On the Main tab select full path to build.exe of the selected build environment. Select your project directory in workspace as "working directory"
Properties -> C/C++ Build -> On Bulder Settings tab remove "Use default build command" flag and type "build"
Properties -> C/C++ Build -> Tool Chain Editor -> Select Tools. Personaly I selected msvc compilers.
Properties -> C/C++ General -> Paths and Symbols -> select includes that you need including WDK ones
Enjoy
Definitely you should use MS Visual Studio with VisualDDK addon.
It allows you to compile/debug even kernel mode drivers local or remotely.

Visual C++ 2010 project properties macros - how to edit?

I need to change the value of macro TargetExt. How can I do this? I can't find a way to do that from IDE (??!) and those macros aren't stored in project file either.
Go to: Project -> NAME properties... -> Configuration properties -> Target Extension

Using WinPcap in VC++ programs

I am trying to include WinPcap library in one of my Visual C++ program and I am using Visual Studio 10 Ultimate.
In the documentation it says
To add a preprocessor definition, you
must select Properties from the
Project menu, then select C/C++ from
the list control on the left, and
under the category Preprocessor, you
must add the definition under the
Preprocessor Definitions text box.
Project -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions-> Added WPCAP
I have performed this step successfully, then
To add a new library to the project,
you must select Properties from the
Project menu, then select Linker from
the list control on the left, and
under the category Input add the name
of the new library in the Additional
Dependencies text box.
Project -> Properties -> Linker -> Input -> Additional Dependencies -> Added wpcap.lib
Now I have problem while performing the third step.
To add a new path where Microsoft
Visual Studio will look for the
libraries, you must select Options
from the Tools menu, then Project and
Solutions from the list control on the
left, VC++ Directories, then choose
Library Files in the Show directories
for combobox, and the add the path in
the box below.
Tools -> Options -> Project and Solutions -> VC++ Directories.
Here it says VC++ Directories editing in Tools > Options has been deprecated.
Now where is this user property sheet located ? Can some one point me in a right direction?
Thanks.
It is now a project property and located in project properties -> VC++ Directories.

Resources