Cromon

MapDriver.cpp

Oct 19th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. NTSTATUS DriverEntry(PDRIVER_OBJECT  pDriverObject, PUNICODE_STRING  pRegistryPath)
  2. {
  3.     NTSTATUS NtStatus = STATUS_SUCCESS;
  4.     UINT uiIndex = 0;
  5.     PDEVICE_OBJECT pDeviceObject = NULL;
  6.     UNICODE_STRING usDriverName, usDosDeviceName;
  7.  
  8.     RtlInitUnicodeString(&usDriverName, L"\\Device\\ManualMapDevice");
  9.     RtlInitUnicodeString(&usDosDeviceName, L"\\DosDevices\\ManualMapDevice");
  10.  
  11.     NtStatus = IoCreateDevice(pDriverObject, 0,
  12.                               &usDriverName,
  13.                               FILE_DEVICE_UNKNOWN,
  14.                               FILE_DEVICE_SECURE_OPEN,
  15.                               FALSE, &pDeviceObject);
  16. };
Advertisement
Add Comment
Please, Sign In to add comment