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

wpcap: Implement pcap_init().

parent c589e978
......@@ -230,6 +230,12 @@ static NTSTATUS wrap_getnonblock( void *args )
return pcap_getnonblock( (pcap_t *)(ULONG_PTR)params->handle, params->errbuf );
}
static NTSTATUS wrap_init( void *args )
{
const struct init_params *params = args;
return pcap_init( params->opt, params->errbuf );
}
static NTSTATUS wrap_lib_version( void *args )
{
const struct lib_version_params *params = args;
......@@ -465,6 +471,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
wrap_get_tstamp_precision,
wrap_geterr,
wrap_getnonblock,
wrap_init,
wrap_lib_version,
wrap_list_datalinks,
wrap_list_tstamp_types,
......
......@@ -174,6 +174,12 @@ struct get_tstamp_precision_params
UINT64 handle;
};
struct init_params
{
int opt;
char *errbuf;
};
struct lib_version_params
{
char *version;
......@@ -348,6 +354,7 @@ enum pcap_funcs
unix_get_tstamp_precision,
unix_geterr,
unix_getnonblock,
unix_init,
unix_lib_version,
unix_list_datalinks,
unix_list_tstamp_types,
......
......@@ -1399,6 +1399,20 @@ int CDECL pcap_wsockinit( void )
return 0;
}
#define PCAP_CHAR_ENC_LOCAL 0
int CDECL pcap_init( unsigned int opt, char *errbuf )
{
struct init_params params;
TRACE( "%u, %p\n", opt, errbuf );
if (opt == PCAP_CHAR_ENC_LOCAL) FIXME( "need to convert to/from local encoding\n" );
params.opt = opt;
params.errbuf = errbuf;
return PCAP_CALL( init, &params );
}
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, void *reserved )
{
switch (reason)
......
......@@ -45,7 +45,7 @@
@ cdecl pcap_getnonblock(ptr ptr)
@ stub pcap_hopen_offline
@ stub pcap_hopen_offline_with_tstamp_precision
@ stub pcap_init
@ cdecl pcap_init(long ptr)
@ stub pcap_inject
@ stub pcap_is_swapped
@ cdecl pcap_lib_version()
......
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