diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2022-09-09 17:13:15 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2022-09-09 17:13:15 +0200 |
commit | 683db70689b8e09fda983b254325fdc4b409ea14 (patch) | |
tree | bc8f40525e662d5f72ec40b0c8127676150ff8cf /ksocket/ksocket.h | |
parent | 38495d423f23b145a4377f87a536db5d2721f814 (diff) |
Cleaned up includes, splitted common.h in the ksocket and examples part.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'ksocket/ksocket.h')
-rw-r--r-- | ksocket/ksocket.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/ksocket/ksocket.h b/ksocket/ksocket.h new file mode 100644 index 0000000..0a6717e --- /dev/null +++ b/ksocket/ksocket.h @@ -0,0 +1,99 @@ +#pragma once +#include "wsk.h" +#include <ntddk.h> + +#define STATUS_UNSUPPORTED_WINDOWS_VERSION \ + (STATUS_SEVERITY_ERROR | (1 << 29) | (1 << 16) | 1) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _KSOCKET KSOCKET, *PKSOCKET; + +NTSTATUS +NTAPI +KsInitialize(VOID); + +VOID NTAPI KsDestroy(VOID); + +NTSTATUS +NTAPI +KsGetAddrInfo(_In_ PUNICODE_STRING NodeName, _In_ PUNICODE_STRING ServiceName, + _In_ PADDRINFOEXW Hints, _Out_ PADDRINFOEXW *Result); + +VOID NTAPI KsFreeAddrInfo(_In_ PADDRINFOEXW AddrInfo); + +NTSTATUS +NTAPI +KsCreateSocket(_Out_ PKSOCKET *Socket, _In_ ADDRESS_FAMILY AddressFamily, + _In_ USHORT SocketType, _In_ ULONG Protocol, _In_ ULONG Flags); + +NTSTATUS +NTAPI +KsCreateConnectionSocket(_Out_ PKSOCKET *Socket, + _In_ ADDRESS_FAMILY AddressFamily, + _In_ USHORT SocketType, _In_ ULONG Protocol); + +NTSTATUS +NTAPI +KsCreateListenSocket(_Out_ PKSOCKET *Socket, _In_ ADDRESS_FAMILY AddressFamily, + _In_ USHORT SocketType, _In_ ULONG Protocol); + +NTSTATUS +NTAPI +KsCreateDatagramSocket(_Out_ PKSOCKET *Socket, + _In_ ADDRESS_FAMILY AddressFamily, + _In_ USHORT SocketType, _In_ ULONG Protocol); + +NTSTATUS +NTAPI +KsCloseSocket(_In_ PKSOCKET Socket); + +NTSTATUS +NTAPI +KsBind(_In_ PKSOCKET Socket, _In_ PSOCKADDR LocalAddress); + +NTSTATUS +NTAPI +KsAccept(_In_ PKSOCKET Socket, _Out_ PKSOCKET *NewSocket, + _Out_opt_ PSOCKADDR LocalAddress, _Out_opt_ PSOCKADDR RemoteAddress); + +NTSTATUS +NTAPI +KsConnect(_In_ PKSOCKET Socket, _In_ PSOCKADDR RemoteAddress); + +NTSTATUS +NTAPI +KsSendRecv(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags, _In_ BOOLEAN Send); + +NTSTATUS +NTAPI +KsSendRecvUdp(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags, _In_ PSOCKADDR RemoteAddress, + _In_ BOOLEAN Send); + +NTSTATUS +NTAPI +KsSend(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags); + +NTSTATUS +NTAPI +KsRecv(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags); + +NTSTATUS +NTAPI +KsSendTo(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags, _In_ PSOCKADDR RemoteAddress); + +NTSTATUS +NTAPI +KsRecvFrom(_In_ PKSOCKET Socket, _In_ PVOID Buffer, _Inout_ PULONG Length, + _In_ ULONG Flags, _In_ PSOCKADDR RemoteAddress); + +#ifdef __cplusplus +} +#endif |