Commit c78fce9e authored by Alexandre Julliard's avatar Alexandre Julliard

dnsapi: Implement Wow64 entry points in the Unix library.

parent fc67bbf2
...@@ -139,11 +139,6 @@ struct get_serverlist_params ...@@ -139,11 +139,6 @@ struct get_serverlist_params
DWORD *len; DWORD *len;
}; };
struct set_serverlist_params
{
const IP4_ARRAY *addrs;
};
struct query_params struct query_params
{ {
const char *name; const char *name;
......
...@@ -124,7 +124,7 @@ static DNS_STATUS map_h_errno( int error ) ...@@ -124,7 +124,7 @@ static DNS_STATUS map_h_errno( int error )
static NTSTATUS resolv_get_searchlist( void *args ) static NTSTATUS resolv_get_searchlist( void *args )
{ {
struct get_searchlist_params *params = args; const struct get_searchlist_params *params = args;
DNS_TXT_DATAW *list = params->list; DNS_TXT_DATAW *list = params->list;
DWORD i, needed, str_needed = 0; DWORD i, needed, str_needed = 0;
char *ptr, *end; char *ptr, *end;
...@@ -170,7 +170,7 @@ static inline int filter( unsigned short sin_family, USHORT family ) ...@@ -170,7 +170,7 @@ static inline int filter( unsigned short sin_family, USHORT family )
static NTSTATUS resolv_get_serverlist( void *args ) static NTSTATUS resolv_get_serverlist( void *args )
{ {
struct get_serverlist_params *params = args; const struct get_serverlist_params *params = args;
DNS_ADDR_ARRAY *addrs = params->addrs; DNS_ADDR_ARRAY *addrs = params->addrs;
struct __res_state *state = &_res; struct __res_state *state = &_res;
DWORD i, found, total, needed; DWORD i, found, total, needed;
...@@ -238,7 +238,7 @@ static NTSTATUS resolv_get_serverlist( void *args ) ...@@ -238,7 +238,7 @@ static NTSTATUS resolv_get_serverlist( void *args )
static NTSTATUS resolv_get_serverlist( void *args ) static NTSTATUS resolv_get_serverlist( void *args )
{ {
struct get_serverlist_params *params = args; const struct get_serverlist_params *params = args;
DNS_ADDR_ARRAY *addrs = params->addrs; DNS_ADDR_ARRAY *addrs = params->addrs;
DWORD needed, found, i; DWORD needed, found, i;
...@@ -305,8 +305,7 @@ static NTSTATUS resolv_get_serverlist( void *args ) ...@@ -305,8 +305,7 @@ static NTSTATUS resolv_get_serverlist( void *args )
static NTSTATUS resolv_set_serverlist( void *args ) static NTSTATUS resolv_set_serverlist( void *args )
{ {
struct set_serverlist_params *params = args; const IP4_ARRAY *addrs = args;
const IP4_ARRAY *addrs = params->addrs;
int i; int i;
init_resolver(); init_resolver();
...@@ -328,7 +327,7 @@ static NTSTATUS resolv_set_serverlist( void *args ) ...@@ -328,7 +327,7 @@ static NTSTATUS resolv_set_serverlist( void *args )
static NTSTATUS resolv_query( void *args ) static NTSTATUS resolv_query( void *args )
{ {
struct query_params *params = args; const struct query_params *params = args;
DNS_STATUS ret = ERROR_SUCCESS; DNS_STATUS ret = ERROR_SUCCESS;
int len; int len;
...@@ -342,7 +341,7 @@ static NTSTATUS resolv_query( void *args ) ...@@ -342,7 +341,7 @@ static NTSTATUS resolv_query( void *args )
return ret; return ret;
} }
unixlib_entry_t __wine_unix_call_funcs[] = const unixlib_entry_t __wine_unix_call_funcs[] =
{ {
resolv_get_searchlist, resolv_get_searchlist,
resolv_get_serverlist, resolv_get_serverlist,
...@@ -350,4 +349,77 @@ unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -350,4 +349,77 @@ unixlib_entry_t __wine_unix_call_funcs[] =
resolv_query, resolv_query,
}; };
#ifdef _WIN64
typedef ULONG PTR32;
static NTSTATUS wow64_resolv_get_searchlist( void *args )
{
struct
{
PTR32 list;
PTR32 len;
} const *params32 = args;
struct get_searchlist_params params =
{
ULongToPtr(params32->list),
ULongToPtr(params32->len)
};
return resolv_get_searchlist( &params );
}
static NTSTATUS wow64_resolv_get_serverlist( void *args )
{
struct
{
USHORT family;
PTR32 addrs;
PTR32 len;
} const *params32 = args;
struct get_serverlist_params params =
{
params32->family,
ULongToPtr(params32->addrs),
ULongToPtr(params32->len)
};
return resolv_get_serverlist( &params );
}
static NTSTATUS wow64_resolv_query( void *args )
{
struct
{
PTR32 name;
WORD type;
DWORD options;
PTR32 buf;
PTR32 len;
} const *params32 = args;
struct query_params params =
{
ULongToPtr(params32->name),
params32->type,
params32->options,
ULongToPtr(params32->buf),
ULongToPtr(params32->len)
};
return resolv_query( &params );
}
const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{
wow64_resolv_get_searchlist,
wow64_resolv_get_serverlist,
resolv_set_serverlist,
wow64_resolv_query,
};
#endif /* _WIN64 */
#endif /* HAVE_RESOLV */ #endif /* HAVE_RESOLV */
...@@ -170,7 +170,6 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser ...@@ -170,7 +170,6 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser
DNS_STATUS ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED; DNS_STATUS ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED;
unsigned char answer[4096]; unsigned char answer[4096];
DWORD len = sizeof(answer); DWORD len = sizeof(answer);
struct set_serverlist_params servlist_params = { servers };
struct query_params query_params = { name, type, options, answer, &len }; struct query_params query_params = { name, type, options, answer, &len };
TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ), TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ),
...@@ -179,7 +178,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser ...@@ -179,7 +178,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser
if (!name || !result) if (!name || !result)
return ERROR_INVALID_PARAMETER; return ERROR_INVALID_PARAMETER;
if ((ret = RESOLV_CALL( set_serverlist, &servlist_params ))) return ret; if ((ret = RESOLV_CALL( set_serverlist, servers ))) return ret;
ret = RESOLV_CALL( query, &query_params ); ret = RESOLV_CALL( query, &query_params );
if (!ret) if (!ret)
......
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