Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ntddk.h>
- #include "main.h"
- NTSTATUS __stdcall DriverEntry(IN PDRIVER_OBJECT DriverObject,
- IN PUNICODE_STRING RegistryPath);
- VOID __stdcall DriverUnload(IN PDRIVER_OBJECT DriverObject);
- NTSTATUS
- __stdcall
- DriverEntry(IN PDRIVER_OBJECT DriverObject,
- IN PUNICODE_STRING RegistryPath)
- {
- DbgPrint("DriverEntry() start");
- NTSTATUS status;
- if( STATUS_SUCCESS != (
- status = InitializeDeviceAndSLink(DriverObject) ) )
- {
- return ( STATUS_FAILED_DRIVER_ENTRY );
- }
- // Register I/O Request Packet handlers
- PDRIVER_DISPATCH *dispatchTable;
- dispatchTable = DriverObject->MajorFunction;
- DriverObject->DriverUnload = DriverUnload;
- dispatchTable[IRP_MJ_DEVICE_CONTROL] = (PVOID) DeviceControlRoutine;
- dispatchTable[IRP_MJ_CREATE] = (PVOID) DeviceOpenHandleRoutine;
- dispatchTable[IRP_MJ_CLOSE] = (PVOID) DeviceCloseHandleRoutine;
- // if( STATUS_SUCCESS != (
- // status = InitializeHiders(DriverObject) ) )
- // {
- // return ( STATUS_FAILED_DRIVER_ENTRY );
- // }
- DbgPrint("DriverEntry() end");
- return ( status );
- }
- VOID
- __stdcall
- DriverUnload(IN PDRIVER_OBJECT DriverObject)
- {
- DbgPrint("DriverUnload() start");
- // UnInitializeHiders();
- // UnInitializeDeviceAndSLink();
- DbgPrint("DriverUnload() end");
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment