Module: wine Branch: master Commit: fdbbee506226239631937c4d60c2efbc81274c9a URL: https://gitlab.winehq.org/wine/wine/-/commit/fdbbee506226239631937c4d60c2efb...
Author: Hans Leidekker hans@codeweavers.com Date: Mon Feb 6 17:08:11 2023 +0100
wpcap: Enable UTF-8 encoding in libpcap.
---
dlls/wpcap/wpcap.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/wpcap/wpcap.c b/dlls/wpcap/wpcap.c index 2a3be168fdf..39a65885723 100644 --- a/dlls/wpcap/wpcap.c +++ b/dlls/wpcap/wpcap.c @@ -1424,6 +1424,7 @@ int CDECL pcap_wsockinit( void ) }
#define PCAP_CHAR_ENC_LOCAL 0 +#define PCAP_CHAR_ENC_UTF_8 1
int CDECL pcap_init( unsigned int opt, char *errbuf ) { @@ -1442,10 +1443,19 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved ) switch (reason) { case DLL_PROCESS_ATTACH: + { DisableThreadLibraryCalls( hinst ); - if (__wine_init_unix_call()) - ERR( "No pcap support, expect problems\n" ); + if (__wine_init_unix_call()) ERR( "No pcap support, expect problems\n" ); + else + { + char errbuf[PCAP_ERRBUF_SIZE]; + struct init_params params = { PCAP_CHAR_ENC_UTF_8, errbuf }; + + if (PCAP_CALL( init, ¶ms ) == PCAP_ERROR) + WARN( "failed to enable UTF-8 encoding %s\n", debugstr_a(errbuf) ); + } break; + } case DLL_PROCESS_DETACH: if (reserved) break; free_datalinks();