Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
dfebf1b9
Commit
dfebf1b9
authored
Apr 18, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Only call res_init() once per process.
parent
dac19db3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
query.c
dlls/dnsapi/query.c
+13
-2
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+13
-1
No files found.
dlls/dnsapi/query.c
View file @
dfebf1b9
...
...
@@ -65,6 +65,17 @@ static CRITICAL_SECTION resolver_cs = { &resolver_cs_debug, -1, 0, 0, 0, 0 };
#define LOCK_RESOLVER() do { EnterCriticalSection( &resolver_cs ); } while (0)
#define UNLOCK_RESOLVER() do { LeaveCriticalSection( &resolver_cs ); } while (0)
static
int
resolver_initialised
;
/* call res_init() just once because of a bug in Mac OSX 10.4 */
static
void
initialise_resolver
(
void
)
{
if
(
!
resolver_initialised
)
{
res_init
();
resolver_initialised
=
1
;
}
}
static
const
char
*
dns_section_to_str
(
ns_sect
section
)
{
...
...
@@ -699,7 +710,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PIP4_ARRA
LOCK_RESOLVER
();
res_init
();
initialise_resolver
();
_res
.
options
|=
dns_map_options
(
options
);
if
(
servers
&&
(
ret
=
dns_set_serverlist
(
servers
)))
...
...
@@ -817,7 +828,7 @@ DNS_STATUS WINAPI DnsQueryConfig( DNS_CONFIG_TYPE config, DWORD flag, PWSTR adap
#ifdef HAVE_RESOLV
LOCK_RESOLVER
();
res_init
();
initialise_resolver
();
ret
=
dns_get_serverlist
(
buffer
,
len
);
UNLOCK_RESOLVER
();
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
dfebf1b9
...
...
@@ -50,6 +50,18 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
#define INADDR_NONE ~0UL
#endif
static
int
resolver_initialised
;
/* call res_init() just once because of a bug in Mac OSX 10.4 */
static
void
initialise_resolver
(
void
)
{
if
(
!
resolver_initialised
)
{
res_init
();
resolver_initialised
=
1
;
}
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
switch
(
fdwReason
)
{
...
...
@@ -1340,7 +1352,7 @@ DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
if
(
!
pOutBufLen
)
return
ERROR_INVALID_PARAMETER
;
res_init
();
initialise_resolver
();
size
=
sizeof
(
FIXED_INFO
)
+
(
_res
.
nscount
>
0
?
(
_res
.
nscount
-
1
)
*
sizeof
(
IP_ADDR_STRING
)
:
0
);
if
(
!
pFixedInfo
||
*
pOutBufLen
<
size
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment