Advertisement
Guest User

driver.c + driver.h

a guest
Apr 8th, 2019
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. // Driver.c
  2. #include <ntddk.h>
  3. #include <wdf.h>
  4. #include "Driver.h"
  5. DRIVER_INITIALIZE DriverEntry;
  6.  
  7. NTSTATUS DriverEntry(struct _DRIVER_OBJECT* DriverObject, PUNICODE_STRING RegistryPath)
  8. {
  9.     UNREFERENCED_PARAMETER(DriverObject);
  10.     UNREFERENCED_PARAMETER(RegistryPath);
  11.  
  12.     return STATUS_SUCCESS;
  13. }
  14.  
  15. // Driver.h
  16. #pragma once
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22.     __declspec(dllexport) UINT_PTR Control(PDEVICE_OBJECT DeviceObject, ULONG code) {
  23.         UNREFERENCED_PARAMETER(DeviceObject);
  24.         UINT_PTR Status = 1;
  25.         if (code == 1) {
  26.             DbgPrintEx(0, 0, "Hi");
  27.             Status = 1;
  28.         }
  29.         return Status;
  30.     }
  31.  
  32. #ifdef __cplusplus
  33. }
  34. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement