mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 12:32:47 +00:00
Added an unload handler for easier testing
svn path=/trunk/; revision=8125
This commit is contained in:
parent
02b8eb1430
commit
28c16df7d2
1 changed files with 14 additions and 1 deletions
|
@ -28,6 +28,9 @@ IO_CSQ Csq;
|
||||||
LIST_ENTRY IrpQueue;
|
LIST_ENTRY IrpQueue;
|
||||||
KSPIN_LOCK IrpQueueLock;
|
KSPIN_LOCK IrpQueueLock;
|
||||||
|
|
||||||
|
/* Device object */
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CSQ Callbacks
|
* CSQ Callbacks
|
||||||
*/
|
*/
|
||||||
|
@ -155,7 +158,18 @@ NTSTATUS NTAPI DispatchIoctl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID NTAPI Unload(PDRIVER_OBJECT DriverObject)
|
VOID NTAPI Unload(PDRIVER_OBJECT DriverObject)
|
||||||
|
/*
|
||||||
|
* Function: called by the OS to release resources before unload
|
||||||
|
*/
|
||||||
{
|
{
|
||||||
|
UNICODE_STRING LinkName;
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&LinkName, DOS_DEVICE_NAME);
|
||||||
|
|
||||||
|
IoDeleteSymbolicLink(&LinkName);
|
||||||
|
|
||||||
|
if(DeviceObject)
|
||||||
|
IoDeleteDevice(DeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -167,7 +181,6 @@ NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING Registry
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
UNICODE_STRING NtName;
|
UNICODE_STRING NtName;
|
||||||
UNICODE_STRING DosName;
|
UNICODE_STRING DosName;
|
||||||
PDEVICE_OBJECT DeviceObject;
|
|
||||||
|
|
||||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)DispatchCreateCloseCleanup;
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = (PDRIVER_DISPATCH)DispatchCreateCloseCleanup;
|
||||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)DispatchCreateCloseCleanup;
|
DriverObject->MajorFunction[IRP_MJ_CLOSE] = (PDRIVER_DISPATCH)DispatchCreateCloseCleanup;
|
||||||
|
|
Loading…
Reference in a new issue