Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetFinalPathNameByHandleW flags #1520

Closed
ChrisDenton opened this issue Apr 4, 2023 · 0 comments
Closed

GetFinalPathNameByHandleW flags #1520

ChrisDenton opened this issue Apr 4, 2023 · 0 comments
Assignees

Comments

@ChrisDenton
Copy link
Contributor

GetFinalPathNameByHandleW is defined in the metadata as (note the dwFlags):

// Windows.Win32.Storage.FileSystem.Apis
public static extern uint GetFinalPathNameByHandleW(
    [In] HANDLE hFile,
    [Out][NativeArrayInfo(CountParamIndex = 2)] PWSTR lpszFilePath,
    [In] uint cchFilePath,
    [In] FILE_NAME dwFlags
);

The FILE_NAME type is:

// Windows.Win32.Storage.FileSystem
public enum FILE_NAME : uint
{
    FILE_NAME_NORMALIZED = 0u,
    FILE_NAME_OPENED = 8u
}

However, the flags are meant to be a FILE_NAME or-ed with a VOLUME_NAME.

Btw, the VOLUME_NAME types are in the metadata but only as loose consts and not an enum (it's also in a different namespace):

// Windows.Win32.System.WindowsProgramming.Apis
public const uint VOLUME_NAME_DOS = 0u;
public const uint VOLUME_NAME_GUID = 1u;
public const uint VOLUME_NAME_NT = 2u;
public const uint VOLUME_NAME_NONE = 4u;
@mikebattista mikebattista self-assigned this Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants