Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

FltGetFileNameInformation on MailSlot

MariushZdrabazdanskiMariushZdrabazdanski Member Posts: 5

Hi, I'm trying to apply FltGetFileNameInformation when opening MailSlot, as a result I get STATUS_OBJECT_NAME_INVALID

Can you tell me what it may be related to?

This code works with NamedPipe

PFLT_FILE_NAME_INFORMATION NameInformation;

status = FltGetFileNameInformation(
        Data,
        FLT_FILE_NAME_NORMALIZED | FLT_FILE_NAME_QUERY_DEFAULT,
        &NameInformation);

Comments

  • MariushZdrabazdanskiMariushZdrabazdanski Member Posts: 5
    edited August 19

    In user space app call

    DesiredAccess = 0x80140000  
    ObjectAttributes.RootDirectory = NULL
    ObjectAttributes.ObjectName = {Length=0x0024 MaximumLength=0x0026 Buffer=0x090b39c0 L"\\??\\mailslot\\Lilo1" }  _UNICODE_STRING *
    CreateOptions = FILE_WRITE_THROUGH
    MailslotQuota = 0
    MaxMessageSize = 0
    ReadTimeOut = 0xffffffff
    
    NtCreateMailslotFile(
            MailslotFileHandle,
            DesiredAccess,
            ObjectAttributes,
            IoStatusBlock,
            CreateOptions,
            MailslotQuota,
            MaxMessageSize,
            ReadTimeOut);
    
  • MariushZdrabazdanskiMariushZdrabazdanski Member Posts: 5
    edited August 20

    Okey, I solved wthis
    MailSlots unsupport FLT_FILE_NAME_NORMALIZED
    It is written about this here https://community.osr.com/discussion/71813/re-fltgetfilenameinformation-returns-invalid-device-request-for-named

    PFLT_FILE_NAME_INFORMATION NameInformation;

    status = FltGetFileNameInformation(
            Data,
            FLT_FILE_NAME_NORMALIZED | FLT_FILE_NAME_QUERY_DEFAULT,
            &NameInformation);
    
        // test if mailslot
        // mailslots unsupport FLT_FILE_NAME_NORMALIZED
        if (!NT_SUCCESS(status)) {
            status = FltGetFileNameInformation(
                Data,
                FLT_FILE_NAME_OPENED | FLT_FILE_NAME_QUERY_DEFAULT,
                &NameInformation);
        }
    
  • Admin, can you close discussion?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 15 November 2021 Live, Online
Writing WDF Drivers TBD Live, Online
Developing Minifilters 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online