Guest User

Untitled

a guest
Jan 6th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. #include <ntddk.h>
  2.  
  3. #include "main.h"
  4.  
  5.  
  6. NTSTATUS __stdcall DriverEntry(IN PDRIVER_OBJECT DriverObject,
  7. IN PUNICODE_STRING RegistryPath);
  8.  
  9. VOID __stdcall DriverUnload(IN PDRIVER_OBJECT DriverObject);
  10.  
  11. NTSTATUS
  12. __stdcall
  13. DriverEntry(IN PDRIVER_OBJECT DriverObject,
  14. IN PUNICODE_STRING RegistryPath)
  15. {
  16. DbgPrint("DriverEntry() start");
  17.  
  18. NTSTATUS status;
  19.  
  20. if( STATUS_SUCCESS != (
  21. status = InitializeDeviceAndSLink(DriverObject) ) )
  22. {
  23. return ( STATUS_FAILED_DRIVER_ENTRY );
  24. }
  25.  
  26. // Register I/O Request Packet handlers
  27. PDRIVER_DISPATCH *dispatchTable;
  28. dispatchTable = DriverObject->MajorFunction;
  29. DriverObject->DriverUnload = DriverUnload;
  30.  
  31. dispatchTable[IRP_MJ_DEVICE_CONTROL] = (PVOID) DeviceControlRoutine;
  32. dispatchTable[IRP_MJ_CREATE] = (PVOID) DeviceOpenHandleRoutine;
  33. dispatchTable[IRP_MJ_CLOSE] = (PVOID) DeviceCloseHandleRoutine;
  34.  
  35. // if( STATUS_SUCCESS != (
  36. // status = InitializeHiders(DriverObject) ) )
  37. // {
  38. // return ( STATUS_FAILED_DRIVER_ENTRY );
  39. // }
  40.  
  41. DbgPrint("DriverEntry() end");
  42.  
  43. return ( status );
  44. }
  45.  
  46. VOID
  47. __stdcall
  48. DriverUnload(IN PDRIVER_OBJECT DriverObject)
  49. {
  50. DbgPrint("DriverUnload() start");
  51.  
  52. // UnInitializeHiders();
  53.  
  54. // UnInitializeDeviceAndSLink();
  55.  
  56. DbgPrint("DriverUnload() end");
  57.  
  58. return;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment