how can I compile this using g++ ? would a sample command line for compilation would be something like,
g++ myDriver.cpp -lndis ? also any tips on where to get the libraries for this ? thank you in advance..
How are you? I am teaching Driver Development here in India . Asked my students to Google you. Thanks for the excellent article. Please note with VS2015 is is a one stop build all.So your article might need some refurbishing.
All the best & regards
ananda vardhana WDK and WinDbg downloads - Windows Hardware Dev Center[^]
Hello, this is pretty weird, but I will explain what happened.
When I ran the code from the first tutorial, everything worked fine (Win7 x64, removed the x86 definition), except for the WriteDirectIo function. It would actually run, but when the handle was closed I would get a blue screen saying PROCESS_HAS_LOCKED_PAGES or so. I fixed this by unlocking the pages within the WriteDirectIo function just before it returns the status. Worked!! All good.
So I go on to the second tutorial code... and now it is inversed!! The code only works without unlocking the pages in the WriteDirectIo function! I cannot understand this situation, any ideas??
I did try to call last the WriteFile function on the load routine, in case WriteDirectIo would leave the memory locked when closing the handle, but that wasnt it, it worked just fine.
At first I thought, that the DeviceControl requests would fix the situation in between starting and closing the device, but I was wrong.
How can different errors occur with the same code??
Hi all. The question I am posting over here might seem simple for many people but since I am new in driver development I hope I am excused
I have implemented a callout (filter) driver on windows 7 at the ALE_CONNECT_REDIRECT layer. I want to pass from user space the value of one variable so while searching online I found this really really helpful article on IOCTLs.
I have implemented an IOCTL using the METHOD_IN_DIRECT and then I tried to create a user space application in order to send the data I wanted from the userspace at my driver (for demonstration purposes the name of the service let's assume it is x). The application uses CreateFile in order to get a handle at the driver and then uses DeviceIoControl. However DeviceIoControl is always returning 0. This means that the handle was not correctly obtained. At CreateFile method I have tried various ways to name the device/driver I want to open (for example "\\.\x"). Also what about the dwShareMode parameter of CreateFile? I currently have set it to GENERIC_WRITE.
I tried this with the source code and it works for
if i use DeviceIoControl from service program
but I am not able to get the text in user mode when i call IOCTL_EXAMPLE_SAMPLE_BUFFERED_IO
The buffer returned is empty.I tried with both macros #define __USE_DIRECT__
I was just wondering if there is a mechanism for communicating (synchronous) between two kernel mode drivers (WDM drivers)?
Also if there is a way to communicate between a WDM driver and a WDF (KMDF) driver?
I tried to implement a virtual serial port, but encountered a problem. I could see the device inside "Ports" of Device Manager. But I couldn't find the virtual port from Hyper Terminal. I checked the registry. The virtual port didn't exist in HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM. The following is my inf file. Any response will be appreciate.
we tried to use the tutorial source files but we dont know which files to compile with DDK & which with VC (version 6)
we tried to create .sys with ddk & to compile the userdriver with VC but it doesn't work.
pleeeeeeease help us
It's very simple - just create a project using the wizard here
and add the files in the samples (Driver)
you will need to erase how many lines... (#define _X86_ - if I remember)
Not the driver file you cold compile with VC++ with no problem
i am trying to write a deriver with interface with the user like in you example.
i have a driver that works in kernel mode (.sys) with IOCONTROL function in it.
i created a user.exe that calls the driver using the DeviceIOcontrol function in order to do that.
the problem is that after i created the .exe & .sys and tried to debug, ( with VC 6) i got this announcments:
loaded `ntdll.dll` , no matching symbolic information found.
loaded `c:WINDOWS\system32\kernel32.dll`, no matching symbolic information found.
i don't know what to do, the driver is working without the user interface but i can't make the user call the driver functions
what to do??????
Thanks a lot
Last Visit: 31-Dec-99 19:00 Last Update: 3-Mar-24 16:38