none
I cannot get my driver to load after trying a LOT of things RRS feed

Answers

  • You can't use the OSRLoader easily with KMDF.  You should have an INX file in the project that will produce an INF file which you should use to install the driver.   Basically, look up "Add legacy hardware" and follow the steps with the INF file and the sys file (this is slightly different depending on the target OS).


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by DriverDK Saturday, July 20, 2013 9:04 PM
    Saturday, July 20, 2013 4:05 PM
  • I could not find an INX file in the project,so I decided to try using "LoadDrv",which resulted in it loading the driver but did not print hello world(and yes,I am capturing events from the kernel using dbgview).

    Also I noticed that the service could not unload(i'll try restarting my computer later and see if that fixes the problem).

    edit:got it,thanks!

    ~solved.

    Saturday, July 20, 2013 6:53 PM

All replies

  • Which specific sample did you start with? How did you build it?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Saturday, July 20, 2013 3:14 PM
  • I built it with vs2012(I do not know how to do it with the ddk in windows 8 though I would appreciate it if someone explained how) and the sample I used:

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh439665(v=vs.85).aspx

    #include <ntddk.h>
    #include <wdf.h>
    DRIVER_INITIALIZE DriverEntry;
    EVT_WDF_DRIVER_DEVICE_ADD KmdfSmallEvtDeviceAdd;
    
    NTSTATUS DriverEntry(_In_ PDRIVER_OBJECT  DriverObject, _In_ PUNICODE_STRING RegistryPath)
    {
        NTSTATUS status;
        WDF_DRIVER_CONFIG config;
     
        KdPrintEx(( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfSmall: DriverEntry\n" ));
        WDF_DRIVER_CONFIG_INIT(&config, KmdfSmallEvtDeviceAdd);
        status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &config, WDF_NO_HANDLE);
        return status;
    }
    
    NTSTATUS KmdfSmallEvtDeviceAdd(_In_ WDFDRIVER Driver, _Inout_ PWDFDEVICE_INIT DeviceInit)
    {
        NTSTATUS status;
        WDFDEVICE hDevice;
        UNREFERENCED_PARAMETER(Driver);
    
        KdPrintEx(( DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "KmdfSmall: KmdfSmallEvtDeviceAdd\n" ));
        status = WdfDeviceCreate(&DeviceInit, WDF_NO_OBJECT_ATTRIBUTES, &hDevice);
        return status;
    }

    edit:

    and I cannot enable deployment due to not being able to understand  http://msdn.microsoft.com/en-us/library/windows/hardware/hh698272(v=vs.85).aspx 

    http://i.imgur.com/LicHcwJ.png

    • Edited by DriverDK Saturday, July 20, 2013 3:41 PM typo
    Saturday, July 20, 2013 3:35 PM
  • You can't use the OSRLoader easily with KMDF.  You should have an INX file in the project that will produce an INF file which you should use to install the driver.   Basically, look up "Add legacy hardware" and follow the steps with the INF file and the sys file (this is slightly different depending on the target OS).


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by DriverDK Saturday, July 20, 2013 9:04 PM
    Saturday, July 20, 2013 4:05 PM
  • I could not find an INX file in the project,so I decided to try using "LoadDrv",which resulted in it loading the driver but did not print hello world(and yes,I am capturing events from the kernel using dbgview).

    Also I noticed that the service could not unload(i'll try restarting my computer later and see if that fixes the problem).

    edit:got it,thanks!

    ~solved.

    Saturday, July 20, 2013 6:53 PM