2015-06-06 12:52:13 +00:00
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
|
|
|
|
// All rights reserved
|
2015-06-08 14:24:47 +00:00
|
|
|
// This file was released under the GPLv2 on June 2015.
|
2015-06-06 12:52:13 +00:00
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
#include "udffs.h"
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
UDFDriverUnload(
|
|
|
|
IN PDRIVER_OBJECT DriverObject
|
|
|
|
)
|
|
|
|
{
|
|
|
|
// UNICODE_STRING uniWin32NameString;
|
|
|
|
LARGE_INTEGER delay;
|
|
|
|
|
|
|
|
//
|
|
|
|
// All *THIS* driver needs to do is to delete the device object and the
|
|
|
|
// symbolic link between our device name and the Win32 visible name.
|
|
|
|
//
|
|
|
|
// Almost every other driver ever written would need to do a
|
|
|
|
// significant amount of work here deallocating stuff.
|
|
|
|
//
|
|
|
|
|
2017-06-03 20:09:21 +00:00
|
|
|
UDFPrint( ("UDF: Unloading!!\n") );
|
2015-06-06 12:52:13 +00:00
|
|
|
|
|
|
|
// prevent mount oparations
|
|
|
|
UDFGlobalData.UDFFlags |= UDF_DATA_FLAGS_BEING_UNLOADED;
|
|
|
|
|
|
|
|
// wait for all volumes to be dismounted
|
|
|
|
delay.QuadPart = 10*1000*1000*10;
|
|
|
|
while(TRUE) {
|
2017-06-03 20:09:21 +00:00
|
|
|
UDFPrint(("Poll...\n"));
|
2015-06-06 12:52:13 +00:00
|
|
|
KeDelayExecutionThread(KernelMode, FALSE, &delay);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Create counted string version of our Win32 device name.
|
|
|
|
|
|
|
|
|
|
|
|
// RtlInitUnicodeString( &uniWin32NameString, DOS_DEVICE_NAME );
|
|
|
|
|
|
|
|
|
|
|
|
// Delete the link from our device name to a name in the Win32 namespace.
|
|
|
|
|
2021-06-11 12:29:21 +00:00
|
|
|
|
2015-06-06 12:52:13 +00:00
|
|
|
// IoDeleteSymbolicLink( &uniWin32NameString );
|
|
|
|
|
|
|
|
|
|
|
|
// Finally delete our device object
|
|
|
|
|
|
|
|
|
|
|
|
// IoDeleteDevice( DriverObject->DeviceObject );
|
|
|
|
}
|