Commit b97c9be3 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wpcap: Try to enable 32-bit mmap() support in libpcap.

This feature will be available in version 1.11.
parent 2432c123
...@@ -1425,6 +1425,7 @@ int CDECL pcap_wsockinit( void ) ...@@ -1425,6 +1425,7 @@ int CDECL pcap_wsockinit( void )
#define PCAP_CHAR_ENC_LOCAL 0 #define PCAP_CHAR_ENC_LOCAL 0
#define PCAP_CHAR_ENC_UTF_8 1 #define PCAP_CHAR_ENC_UTF_8 1
#define PCAP_MMAP_32BIT 2
int CDECL pcap_init( unsigned int opt, char *errbuf ) int CDECL pcap_init( unsigned int opt, char *errbuf )
{ {
...@@ -1450,9 +1451,16 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved ) ...@@ -1450,9 +1451,16 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved )
{ {
char errbuf[PCAP_ERRBUF_SIZE]; char errbuf[PCAP_ERRBUF_SIZE];
struct init_params params = { PCAP_CHAR_ENC_UTF_8, errbuf }; struct init_params params = { PCAP_CHAR_ENC_UTF_8, errbuf };
BOOL is_wow64;
if (PCAP_CALL( init, &params ) == PCAP_ERROR) if (PCAP_CALL( init, &params ) == PCAP_ERROR)
WARN( "failed to enable UTF-8 encoding %s\n", debugstr_a(errbuf) ); WARN( "failed to enable UTF-8 encoding %s\n", debugstr_a(errbuf) );
if (IsWow64Process( GetCurrentProcess(), &is_wow64 ) && is_wow64)
{
params.opt = PCAP_MMAP_32BIT;
if (PCAP_CALL( init, &params ) == PCAP_ERROR)
WARN( "failed to enable 32-bit mmap() %s\n", debugstr_a(errbuf) );
}
} }
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment