DBGSTATIC
VOID
SfFsNotification(IN PDEVICE_OBJECT DeviceObject,
IN BOOLEAN FsActive)
{
NTSTATUS status;
PDEVICE_OBJECT deviceObject;
PDEVICE_OBJECT nextAttachedDevice;
PDEVICE_OBJECT fsDevice;
UNICODE_STRING TempString;
PAGED_CODE();
if(FsActive)
{
PDEVICE_EXTENSION deviceExtension;
//
// The file system has registered as an active file system. If it is
// a disk-based file system attach to it.
//
ExAcquireResourceExclusiveLite(&FsLock, TRUE);
KmdQueryObjectName(DeviceObject, &FSType[TypeNum]);
RtlInitUnicodeString(&TempString, L"\Fat");
if(RtlCompareUnicodeString(&FSType[TypeNum], &TempString, TRUE) == 0)
{
TypeNum ++;
return;
}
TypeNum ++;
status = IoCreateDevice(MyDriverObject,
sizeof(DEVICE_EXTENSION),
(PUNICODE_STRING) NULL,
DeviceObject->DeviceType,
0,
FALSE,
&deviceObject);
… …
}
FSType[TypeNum] is current file system type ,when it is NTFS ,I let the program return.
My computer’s file system is NTFS. The result is it cannot start the OS. But if I change TempString to other file system type,the OS can start normally.
Are there some problems I do like this?