Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding networking.h to provide RAII and iterator support for networking calls #497

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,369 changes: 1,369 additions & 0 deletions include/wil/network.h

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions include/wil/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -5081,6 +5081,27 @@ typedef shared_any<unique_socket> shared_socket;
typedef weak_any<shared_socket> weak_socket;
#endif // __WIL_WINSOCKAPI_STL

#if (defined _WS2TCPIP_H_) && !defined(__WIL_WS2TCPIP_H_)) || defined(WIL_DOXYGEN)
/// @cond
#define __WIL_WS2TCPIP_H_
/// @endcond
typedef unique_any<PADDRINFOA, decltype(&::freeaddrinfo), ::freeaddrinfo> unique_addrinfo_ansi;
typedef unique_any<PADDRINFOW, decltype(&::FreeAddrInfoW), ::FreeAddrInfoW> unique_addrinfo;
// not defining a type for FreeAddrInfoEx(PADDRINFOEXA) as that API is formally __declspec(deprecated)
typedef unique_any<PADDRINFOEXW, decltype(&::FreeAddrInfoExW), ::FreeAddrInfoExW> unique_addrinfoex;
#endif // __WIL_WS2TCPIP_H_
#if (defined(__WIL_WS2TCPIP_H_) && !defined(__WIL_WS2TCPIP_H_STL) && defined(WIL_RESOURCE_STL)) || defined(WIL_DOXYGEN)
/// @cond
#define __WIL_WS2TCPIP_H_STL
/// @endcond
typedef shared_any<unique_addrinfo_ansi> shared_addrinfo_ansi;
typedef weak_any<unique_addrinfo_ansi> weak_addrinfo_ansi;
typedef shared_any<unique_addrinfo> shared_addrinfo;
typedef weak_any<unique_addrinfo> weak_addrinfo;
typedef shared_any<unique_addrinfoex> shared_addrinfoex;
typedef weak_any<unique_addrinfoex> weak_addrinfoex;
#endif // __WIL_WS2TCPIP_H_STL

#if (defined(_WINGDI_) && !defined(__WIL_WINGDI_) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(NOGDI) && !defined(WIL_KERNEL_MODE)) || \
defined(WIL_DOXYGEN)
/// @cond
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ find_package(Catch2 CONFIG REQUIRED)

include_directories(${DETOURS_INCLUDE_DIRS})
add_definitions(-DNOMINMAX)
link_libraries(${DETOURS_LIBRARY} Catch2::Catch2WithMain)
link_libraries(${DETOURS_LIBRARY} Catch2::Catch2WithMain ws2_32.lib ntdll.lib)

add_subdirectory(app)
add_subdirectory(cpplatest)
Expand Down
Loading
Loading