// JP opened flex table

Click to See Complete Forum and Search --> : weird scenario in my filesystem driver


Entrant_phil
July 19th, 2008, 06:42 AM
hi guys:

i've been facing a weird problem up 3 days, tht is i hooked both IRP_MJ_READ and IRP_MJ_WRITE, and IoVolumeDeviceToDosName worked very well in my own IRP_MJ_WRITE dispatch routine,and the same invoking of IoVolumeDeviceToDosName in my own IRP_MJ_READ dispatch routine always showing me a BSOD! error code 0x0000000a;this's my code in IRP_MJ_READ:

NTSTATUS status=STATUS_SUCCESS;
PFILE_OBJECT pFileObject=0;
UNICODE_STRING name,volume;
PIO_STACK_LOCATION pCurStack=0;
wchar_t nameBuffer[256]={0};

RtlInitEmptyUnicodeString( &name, nameBuffer, sizeof(nameBuffer) );
pCurStack=IoGetCurrentIrpStackLocation(pIrp);

if(pCurStack)
pFileObject=pCurStack->FileObject;

if(pFileObject)
{
status=IoVolumeDeviceToDosName(pFileObject->DeviceObject,&volume);

if(NT_SUCCESS(status))
{
DbgPrint("My_MJ_Read %ws \r\n",volume.Buffer);
ExFreePool(volume.Buffer);
}

}

somehow the same code worked well in IRP_MJ_WRITE dispath routine;
what exactly maked this happened? do i missed something?thank you very much;

Have a nice day! thx again;

Entrant_phil
July 30th, 2008, 02:17 AM
ahua tht was a IRQL issuse it's okay once i put this code (KeGetCurrentIrql() == PASSIVE_LEVEL) into my routine ;

//JP added flex table