From 0dd92d7d9944b158511e27795ff6952c17fd3497 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 8 Jan 2019 20:40:50 -0800 Subject: Put pcap_win32_err_to_str() into fmtutils.c, and use it for all Win32 errors. We don't need N different places all doing their own calls to FormatMessage(); centralize it in pcap_win32_err_to_str(), now in fmtutils.c for use in rpcapd as well as libpcap. Merge in some fixes from the code in sock_fmterror(). --- fmtutils.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fmtutils.h') diff --git a/fmtutils.h b/fmtutils.h index 62c78fdb..d4a171d8 100644 --- a/fmtutils.h +++ b/fmtutils.h @@ -43,6 +43,10 @@ extern "C" { void pcap_fmt_errmsg_for_errno(char *, size_t, int, PCAP_FORMAT_STRING(const char *), ...) PCAP_PRINTFLIKE(4, 5); +#ifdef _WIN32 +void pcap_win32_err_to_str(DWORD, char *); +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.1