2 Replies - 423 Views - Last Post: 30 November 2017 - 10:41 AM Rate Topic: -----

#1 jhave_21  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 23-September 17

Can I make a device driver with code blocks?

Posted 29 November 2017 - 06:35 PM

hello, would like ask if it is possible to make device drivers with code blocks(using C). as much as I understand the things that I read about WDK, the only way I understand it is that you can use it to debug drivers that you have written(the ability to show you errors about the code),
what if I have a driver something like this
#include <nttdk.h>
NSTATUS DriverEntry(PDRIVER_OBJECT driverObject, PUNICODE_STRING registryPath)
{
 DbgPrint("hello, nice to meet you\n");
 driverObject->DriverUnload = onunload; // calling the function

 return STATUS_SUCESS
}



and I compiled it with code blocks(MinGW compiler), will it work, or should I really download visual studio and dowbload WDK?
thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Can I make a device driver with code blocks?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13954
  • View blog
  • Posts: 55,700
  • Joined: 12-June 08

Re: Can I make a device driver with code blocks?

Posted 29 November 2017 - 08:48 PM

What device are you trying to drive?
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 6112
  • View blog
  • Posts: 21,040
  • Joined: 05-May 12

Re: Can I make a device driver with code blocks?

Posted 30 November 2017 - 10:41 AM

Yes, but you will have to jump through some serious hoops to emulate the behaviour of the old NTBUILD.EXE or the newer MSBuild based WinDDK build system. Nothing stops you from using Code::Blocks as your editor, but you'll like like have to build at the command line. This somewhat devalues the point of using an IDE if you are simply using the IDE just for editing.

Anyway, if you were using the older WinDDK along with it's accompanying NTBUILD.EXE, you would have been in the same boat as well. You provide your own editor (or use Notepad), and then build on the command line.

If I recall correctly, the newer WinDDK's do builds using MSBuild. Visual Studio can host the MSBuild build engine so technically you could stay within VS and never have to hit the command line. It's been a few years since I've had to build any drivers. At that time, the MSBuild based WinDDK was just being rolled out. I recall going to command line to build anyway, but instead of running `ntbuild`, I would run `msbuild`. That was mostly out of habit though.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1