Name of Named Pipe Given Handle

Dec 3, 2014 at 5:36pm
I'm trying to retrieve the name of a named pipe given it's handle. For example the handle generated by CreateNamedPipe.

I found a way to do exactly that by creating a duplicate of the handle using NtDuplicateObject and then using NtQueryObject on the duplicate. Sadly I've been told I can't use NtQueryObject because it is unsupported/undocumented like many native API functions.

Are there any alternatives or workarounds? Appreciate any feedback.
Dec 9, 2014 at 7:13pm
To answer my own question here. GetFileInformationByHandleEx does exactly this using FileNameInfo for the FileInformationClass parameter and a handle generated by CreateNamedPipe.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa364953(v=vs.85).aspx
Topic archived. No new replies allowed.