Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Building and deploying a basic WDF Kernel Mode Driver

, 20 Apr 2006 MIT
An article about developing a driver for the WDF Kernel Mode Driver Foundation.
wdf_kmdf_basic_src.zip
basic.inf
makefile
sources
#include "ProtoTypes.h"

#pragma alloc_text(PAGE, EvtDeviceD0Entry)
#pragma alloc_text(PAGE, EvtDeviceD0Exit)

/*............................................................................*/
/* this function is called when the device is either started or woken up.     */
/*............................................................................*/
NTSTATUS
EvtDeviceD0Entry(
    IN WDFDEVICE  Device,
    IN WDF_POWER_DEVICE_STATE  PreviousState
    )
{
  NTSTATUS status = STATUS_SUCCESS;

  UNREFERENCED_PARAMETER(Device);
  UNREFERENCED_PARAMETER(PreviousState);

  KdPrint((__DRIVER_NAME "--> EvtDeviceD0Entry\n"));

  KdPrint((__DRIVER_NAME "<-- EvtDeviceD0Entry\n"));

  return status;
}

/*............................................................................*/
/* this function is called when the device is powered down.                   */
/* the current IO is left pending, because otherwise the continuous interrupt */
/* read IO will also be cancelled, and it would have to be reconfigured.      */
/*............................................................................*/
NTSTATUS
EvtDeviceD0Exit(
    IN WDFDEVICE  Device,
    IN WDF_POWER_DEVICE_STATE  TargetState
    )
{
  NTSTATUS status = STATUS_SUCCESS;

  UNREFERENCED_PARAMETER(Device);
  UNREFERENCED_PARAMETER(TargetState);

  KdPrint((__DRIVER_NAME "--> EvtDeviceD0Exit\n"));

  KdPrint((__DRIVER_NAME "<-- EvtDeviceD0Exit\n"));

  return status;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

Bruno van Dooren
Web Developer
Belgium Belgium
I am a professional software developer with an interest in everything that is about making hardware work.
 
In the course of my work, I have programmed device drivers and services on Windows and linux.
 
I have written firmware for embedded devices in C and assembly language, and have designed and implemented real-time applications for testing of sattelite payload equipment.
 
Generally, finding out how to interface hardware with software is my hobby and job.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141216.1 | Last Updated 20 Apr 2006
Article Copyright 2006 by Bruno van Dooren
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid