[ros-dev] Retrieving the computer name of a named pipe client

Timo Kreuzer timo.kreuzer at web.de
Mon Oct 10 21:22:31 UTC 2016


You need to send an FSCTL to the named pipe file system driver.

// defined in ntifs.h
#define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE 
CTL_CODE(FILE_DEVICE_NAMED_PIPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)

     static const char AttributeName[] = "ClientComputerName";

     Status = NtFsControlFile(NamedPipeHandle,
                              EventHandle,
                              NULL,
                              NULL,
                              &IoStatusBlock,
FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE,
                              (PVOID)AttributeName,
                              sizeof(AttributeName),
                              NameBuffer,
                              NameBufferLength);

Obviously this has to be implemented in ournpfs as well. :)

Regards,
Timo


Am 10.10.2016 um 13:21 schrieb Colin Finck:
> Hi all,
>
> For implementing the RpcBindingServerFromClient rpcrt4.dll API  function
> needed by my Printing Stack, I need to know how to retrieve the computer
> name of a named pipe client.
> Vista and later implement GetNamedPipeClientComputerName in kernel32.dll
> which does exactly this, but this is neither supported under Windows
> Server 2003 nor implemented in ReactOS and WINE.
>
> Determining client information is a basic feature of network
> communication, so it should be possible under Windows 2003 as well.
> Additionally, RpcBindingServerFromClient returns the proper computer
> name of the client, when using named pipes over the ncacn_np transport.
> It must have got it somehow.
>
> Hoping for some ideas from your side!
>
>
> Colin
>
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20161010/f1a76feb/attachment.html>


More information about the Ros-dev mailing list