From 5d86252d01b43b40c9c34d5c12b731e85a8ffc1c Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 22 Mar 2016 15:43:24 -0400 Subject: socket interfaces: sc_getpeername: initial integration. Integration of this function into the library has been delayed since the AFD ioctl operation, while succeeding, seems to only memset the caller's address buffer, and accordingly to never copy the remote socket address to it. Callers of sc_getpeername() should therefore first check the return value for success -- which may be used as indication that the socket is connected -- and then test the returned address buffer for validity. --- include/ntapi/nt_socket.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/ntapi/nt_socket.h') diff --git a/include/ntapi/nt_socket.h b/include/ntapi/nt_socket.h index fcf6d96..c984b92 100644 --- a/include/ntapi/nt_socket.h +++ b/include/ntapi/nt_socket.h @@ -413,6 +413,11 @@ typedef int32_t __cdecl ntapi_sc_getsockname( __in uint16_t * addrlen, __out nt_io_status_block * iosb __optional); +typedef int32_t __cdecl ntapi_sc_getpeername( + __in nt_socket * hssocket, + __in nt_sockaddr * addr, + __in uint16_t * addrlen, + __out nt_io_status_block * iosb __optional); typedef int32_t __cdecl ntapi_sc_server_accept_connection( __in nt_socket * hssocket, -- cgit v1.2.3