FltCreateFile( ) open a fileStream failed

feizzer 120 Reputation points
2023-07-14T07:45:29.7866667+00:00

use FltCreateFile() open a fileStream like this

status = FltCreateFile(
        g_pFilterHandle,
        FltObjects->Instance,
        &hFile,
        GENERIC_READ,
        &struAttr,
        &struStatusBlock,
        0,
        FILE_ATTRIBUTE_NORMAL,
        FILE_SHARE_READ,
        FILE_OPEN,
        FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT,
        NULL,
        0,
        IO_FORCE_ACCESS_CHECK
);

// 

return with 0xc0000034 STATUS_OBJECT_NAME_NOT_FOUND

The format of the file is /??/c:/user/dell/test.txt:stream , I'm pretty sure this file exists.

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,507 questions
{count} votes

Accepted answer
  1. Limitless Technology 43,991 Reputation points
    2023-07-17T13:39:30.9266667+00:00

    Hello there,

    The FltCreateFile() function you mentioned appears to be related to the Filter Manager API in Windows, specifically for file system filter drivers. If you're encountering an issue where FltCreateFile() fails to open a file stream, there could be several possible reasons. Here are a few troubleshooting steps you can try:

    Check file path and permissions:

    Ensure that the file path you are providing to FltCreateFile() is correct and valid.

    Verify that the file exists and that the user account running the code has sufficient permissions to access the file.

    Verify filter driver registration:

    Confirm that your filter driver is registered correctly and loaded in the system.

    Check the driver's registration status and make sure it is active.

    Review the return value and error codes:

    After calling FltCreateFile(), check the return value and any associated error codes.

    The function typically returns an NTSTATUS value, which can provide information about the specific error encountered.

    Refer to the Microsoft documentation for FltCreateFile() to understand the possible error codes and their meanings.

    Debug and diagnose the issue:

    If possible, enable debugging capabilities for your filter driver and set breakpoints to track the execution flow.

    Use logging or debugging tools to capture additional information about the failure, such as error messages or stack traces.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments

0 additional answers

Sort by: Most helpful