diff options
author | midipix <writeonce@midipix.org> | 2016-03-22 20:24:54 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-03-22 20:24:54 -0400 |
commit | 20ee45c9cab81301f529a642e0470b9edc0e385a (patch) | |
tree | 486c780de0065567027d0b588668f94b90cf3bc6 | |
parent | f6998ce8dfacafa959563171583ec4d781188898 (diff) | |
download | ntapi-20ee45c9cab81301f529a642e0470b9edc0e385a.tar.bz2 ntapi-20ee45c9cab81301f529a642e0470b9edc0e385a.tar.xz |
socket interfaces: sc_shutdown(): remove non-native code path and constants.
-rw-r--r-- | include/ntapi/nt_socket.h | 8 | ||||
-rw-r--r-- | src/socket/ntapi_sc_shutdown.c | 26 |
2 files changed, 5 insertions, 29 deletions
diff --git a/include/ntapi/nt_socket.h b/include/ntapi/nt_socket.h index 35d6e34..bcb1722 100644 --- a/include/ntapi/nt_socket.h +++ b/include/ntapi/nt_socket.h @@ -192,11 +192,6 @@ #define NT_AFD_DISCONNECT_WR (0x01u) #define NT_AFD_DISCONNECT_RD (0x02u) -/* socket portable shutdown options */ -#define NT_SHUT_RD (0x00u) -#define NT_SHUT_WR (0x01u) -#define NT_SHUT_RDWR (0x02u) - /* send, sendto, sendmsg: *nix flags and bit place-holders */ #define NT_MSG_OOB (0x00000001u) #define NT_MSG_PEEK (0x00000002u) @@ -403,8 +398,7 @@ typedef int32_t __cdecl ntapi_sc_recv( typedef int32_t __cdecl ntapi_sc_shutdown( __in nt_socket * hssocket, - __in uintptr_t psxhow, - __in uintptr_t afdhow, + __in uint32_t afdhow, __out nt_io_status_block * iosb __optional); diff --git a/src/socket/ntapi_sc_shutdown.c b/src/socket/ntapi_sc_shutdown.c index 0aa5c36..acbc09b 100644 --- a/src/socket/ntapi_sc_shutdown.c +++ b/src/socket/ntapi_sc_shutdown.c @@ -13,8 +13,7 @@ int32_t __cdecl __ntapi_sc_shutdown( __in nt_socket * hssocket, - __in uintptr_t psxhow, - __in uintptr_t afdhow, + __in uint32_t afdhow, __out nt_io_status_block * iosb __optional) { nt_afd_disconnect_info afd_disconnect; @@ -22,27 +21,10 @@ int32_t __cdecl __ntapi_sc_shutdown( iosb = iosb ? iosb : &siosb; - if (afdhow == 0) { - switch (psxhow) { - case NT_SHUT_RD: - afdhow = NT_AFD_DISCONNECT_RD; - break; + if (afdhow & ~(NT_AFD_DISCONNECT_RD | NT_AFD_DISCONNECT_WR)) + return NT_STATUS_INVALID_PARAMETER; - case NT_SHUT_WR: - afdhow = NT_AFD_DISCONNECT_WR; - break; - - case NT_SHUT_RDWR: - afdhow = NT_AFD_DISCONNECT_RD | NT_AFD_DISCONNECT_WR; - break; - - default: - return NT_STATUS_INVALID_PARAMETER_2; - break; - } - } - - afd_disconnect.shutdown_flags = (uint32_t)afdhow; + afd_disconnect.shutdown_flags = afdhow; afd_disconnect.unknown[0] = 0xff; afd_disconnect.unknown[1] = 0xff; afd_disconnect.unknown[2] = 0xff; |