reactos/modules/rostests/apitests/afd/AfdHelpers.h
Thomas Faber 680d69d373
[AFD_APITEST] Introduce a test for directly creating and using sockets via AFD. CORE-9810
The initial tests in send.c validate correct behavior of send/sendto on
disconnected sockets (CORE-9810), fixed in r68129.
However, the helper functions are generic, so they can be used for additional
tests against AFD. Because AFD's create packet structure changes between
Windows versions, the functions check the OS version to determine the right
layout.
Tests succeed on Win2003 as well as Win10.
2018-03-05 14:52:56 +01:00

41 lines
922 B
C

/*
* PROJECT: ReactOS API Tests
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
* PURPOSE: Utility function declarations for calling AFD
* COPYRIGHT: Copyright 2015 Thomas Faber (thomas.faber@reactos.org)
*/
#pragma once
NTSTATUS
AfdCreateSocket(
_Out_ PHANDLE SocketHandle,
_In_ int AddressFamily,
_In_ int SocketType,
_In_ int Protocol);
NTSTATUS
AfdBind(
_In_ HANDLE SocketHandle,
_In_ const struct sockaddr *Address,
_In_ ULONG AddressLength);
NTSTATUS
AfdConnect(
_In_ HANDLE SocketHandle,
_In_ const struct sockaddr *Address,
_In_ ULONG AddressLength);
NTSTATUS
AfdSend(
_In_ HANDLE SocketHandle,
_In_ const void *Buffer,
_In_ ULONG BufferLength);
NTSTATUS
AfdSendTo(
_In_ HANDLE SocketHandle,
_In_ const void *Buffer,
_In_ ULONG BufferLength,
_In_ const struct sockaddr *Address,
_In_ ULONG AddressLength);