CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005
    Posts
    73

    Arrow weird scenario in my filesystem driver

    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;

  2. #2
    Join Date
    Jan 2005
    Posts
    73

    Talking Re: weird scenario in my filesystem driver

    ahua tht was a IRQL issuse it's okay once i put this code (KeGetCurrentIrql() == PASSIVE_LEVEL) into my routine ;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured