Skip to content

QueryFullProcessImageName returns 31 for WSL processes #3478

@jazzy-crane

Description

@jazzy-crane

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.17134.228]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

Start a lengthy WSL process (e.g. sleep 120)

Find the PID in task manager

OpenProcess that PID with PROCESS_QUERY_LIMITED_INFORMATION

Call QueryFullProcessImageName on the handle, with flags == 0

  • What's wrong / what should be happening instead:

QueryFullProcessImageName returns error 31 - "A device attached to the system is not functioning."

I can understand this might be by design as I am passing in flags == 0 ("The name should use the Win32 path format.") . The function does succeed with flags == 1 ("The name should use the native system path format.") and the path returned is in NT format (e.g. \Device\HarddiskVolume3\Users\Alex\AppData\Local\lxss\rootfs\bin\cat)

Another way of seeing this issue is to use the sysinternals ProcessExplorer to look at the path of the process. I assume it uses the function as above.

image

Could you clarify the desired behaviour. If by design the error code could be better, or better documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions