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
b3ff6803
Commit
b3ff6803
authored
Nov 28, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Rename the wrappers around HeapAlloc() &Co to use the new standard naming.
parent
ac527f1e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
49 deletions
+49
-49
dnsapi.h
dlls/dnsapi/dnsapi.h
+13
-13
name.c
dlls/dnsapi/name.c
+4
-4
query.c
dlls/dnsapi/query.c
+12
-12
record.c
dlls/dnsapi/record.c
+20
-20
No files found.
dlls/dnsapi/dnsapi.h
View file @
b3ff6803
...
...
@@ -19,19 +19,19 @@
*/
static
inline
void
*
dns
_alloc
(
SIZE_T
size
)
static
inline
void
*
heap
_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
static
inline
void
*
dns_zero_alloc
(
SIZE_T
size
)
static
inline
void
*
heap_alloc_zero
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
static
inline
void
dns
_free
(
LPVOID
mem
)
static
inline
BOOL
heap
_free
(
LPVOID
mem
)
{
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
LPSTR
dns_strdup_a
(
LPCSTR
src
)
...
...
@@ -39,7 +39,7 @@ static inline LPSTR dns_strdup_a( LPCSTR src )
LPSTR
dst
;
if
(
!
src
)
return
NULL
;
dst
=
dns
_alloc
(
(
lstrlenA
(
src
)
+
1
)
*
sizeof
(
char
)
);
dst
=
heap
_alloc
(
(
lstrlenA
(
src
)
+
1
)
*
sizeof
(
char
)
);
if
(
dst
)
lstrcpyA
(
dst
,
src
);
return
dst
;
}
...
...
@@ -49,7 +49,7 @@ static inline char *dns_strdup_u( const char *src )
char
*
dst
;
if
(
!
src
)
return
NULL
;
dst
=
dns
_alloc
(
(
strlen
(
src
)
+
1
)
*
sizeof
(
char
)
);
dst
=
heap
_alloc
(
(
strlen
(
src
)
+
1
)
*
sizeof
(
char
)
);
if
(
dst
)
strcpy
(
dst
,
src
);
return
dst
;
}
...
...
@@ -59,7 +59,7 @@ static inline LPWSTR dns_strdup_w( LPCWSTR src )
LPWSTR
dst
;
if
(
!
src
)
return
NULL
;
dst
=
dns
_alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
);
dst
=
heap
_alloc
(
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
dst
)
lstrcpyW
(
dst
,
src
);
return
dst
;
}
...
...
@@ -70,7 +70,7 @@ static inline LPWSTR dns_strdup_aw( LPCSTR str )
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
dns
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
if
((
ret
=
heap
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
...
...
@@ -82,7 +82,7 @@ static inline LPWSTR dns_strdup_uw( const char *str )
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
dns
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
if
((
ret
=
heap
_alloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
...
...
@@ -94,7 +94,7 @@ static inline LPSTR dns_strdup_wa( LPCWSTR str )
if
(
str
)
{
DWORD
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ret
=
dns
_alloc
(
len
)))
if
((
ret
=
heap
_alloc
(
len
)))
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
}
return
ret
;
...
...
@@ -106,7 +106,7 @@ static inline char *dns_strdup_wu( LPCWSTR str )
if
(
str
)
{
DWORD
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ret
=
dns
_alloc
(
len
)))
if
((
ret
=
heap
_alloc
(
len
)))
WideCharToMultiByte
(
CP_UTF8
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
}
return
ret
;
...
...
@@ -120,7 +120,7 @@ static inline char *dns_strdup_au( LPCSTR src )
if
(
ret
)
{
dst
=
dns_strdup_wu
(
ret
);
dns
_free
(
ret
);
heap
_free
(
ret
);
}
return
dst
;
}
...
...
@@ -133,7 +133,7 @@ static inline LPSTR dns_strdup_ua( const char *src )
if
(
ret
)
{
dst
=
dns_strdup_wa
(
ret
);
dns
_free
(
ret
);
heap
_free
(
ret
);
}
return
dst
;
}
...
...
dlls/dnsapi/name.c
View file @
b3ff6803
...
...
@@ -63,8 +63,8 @@ BOOL WINAPI DnsNameCompare_A( PCSTR name1, PCSTR name2 )
ret
=
DnsNameCompare_W
(
name1W
,
name2W
);
dns
_free
(
name1W
);
dns
_free
(
name2W
);
heap
_free
(
name1W
);
heap
_free
(
name2W
);
return
ret
;
}
...
...
@@ -115,7 +115,7 @@ DNS_STATUS WINAPI DnsValidateName_A( PCSTR name, DNS_NAME_FORMAT format )
nameW
=
dns_strdup_aw
(
name
);
ret
=
DnsValidateName_W
(
nameW
,
format
);
dns
_free
(
nameW
);
heap
_free
(
nameW
);
return
ret
;
}
...
...
@@ -133,7 +133,7 @@ DNS_STATUS WINAPI DnsValidateName_UTF8( PCSTR name, DNS_NAME_FORMAT format )
nameW
=
dns_strdup_uw
(
name
);
ret
=
DnsValidateName_W
(
nameW
,
format
);
dns
_free
(
nameW
);
heap
_free
(
nameW
);
return
ret
;
}
...
...
dlls/dnsapi/query.c
View file @
b3ff6803
...
...
@@ -180,7 +180,7 @@ static char *dns_dname_from_msg( ns_msg msg, const unsigned char *pos )
pos
,
dname
,
sizeof
(
dname
)
);
len
=
strlen
(
dname
);
str
=
dns
_alloc
(
len
+
1
);
str
=
heap
_alloc
(
len
+
1
);
if
(
str
)
strcpy
(
str
,
dname
);
return
str
;
}
...
...
@@ -190,7 +190,7 @@ static char *dns_str_from_rdata( const unsigned char *rdata )
char
*
str
;
unsigned
int
len
=
rdata
[
0
];
str
=
dns
_alloc
(
len
+
1
);
str
=
heap
_alloc
(
len
+
1
);
if
(
str
)
{
memcpy
(
str
,
++
rdata
,
len
);
...
...
@@ -302,7 +302,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
r
->
Data
.
MINFO
.
pNameErrorsMailbox
=
dns_dname_from_msg
(
msg
,
pos
);
if
(
!
r
->
Data
.
MINFO
.
pNameErrorsMailbox
)
{
dns_free
(
r
->
Data
.
MINFO
.
pNameMailbox
);
heap_free
(
r
->
Data
.
MINFO
.
pNameMailbox
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
...
...
@@ -379,7 +379,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
r
->
Data
.
SOA
.
pNameAdministrator
=
dns_dname_from_msg
(
msg
,
pos
);
if
(
!
r
->
Data
.
SOA
.
pNameAdministrator
)
{
dns_free
(
r
->
Data
.
SOA
.
pNamePrimaryServer
);
heap_free
(
r
->
Data
.
SOA
.
pNamePrimaryServer
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
...
...
@@ -418,7 +418,7 @@ static DNS_STATUS dns_copy_rdata( ns_msg msg, const ns_rr *rr, DNS_RECORDA *r, W
r
->
Data
.
TXT
.
pStringArray
[
i
]
=
dns_str_from_rdata
(
pos
);
if
(
!
r
->
Data
.
TXT
.
pStringArray
[
i
])
{
while
(
i
>
0
)
dns
_free
(
r
->
Data
.
TXT
.
pStringArray
[
--
i
]
);
while
(
i
>
0
)
heap
_free
(
r
->
Data
.
TXT
.
pStringArray
[
--
i
]
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
i
++
;
...
...
@@ -455,13 +455,13 @@ static DNS_STATUS dns_copy_record( ns_msg msg, ns_sect section,
if
(
dns_ns_parserr
(
&
msg
,
section
,
num
,
&
rr
)
<
0
)
return
DNS_ERROR_BAD_PACKET
;
if
(
!
(
record
=
dns_zero_alloc
(
dns_get_record_size
(
&
rr
)
)))
if
(
!
(
record
=
heap_alloc_zero
(
dns_get_record_size
(
&
rr
)
)))
return
ERROR_NOT_ENOUGH_MEMORY
;
record
->
pName
=
dns_strdup_u
(
rr
.
name
);
if
(
!
record
->
pName
)
{
dns
_free
(
record
);
heap
_free
(
record
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
...
...
@@ -472,8 +472,8 @@ static DNS_STATUS dns_copy_record( ns_msg msg, ns_sect section,
if
((
ret
=
dns_copy_rdata
(
msg
,
&
rr
,
record
,
&
dlen
)))
{
dns
_free
(
record
->
pName
);
dns
_free
(
record
);
heap
_free
(
record
->
pName
);
heap
_free
(
record
);
return
ret
;
}
record
->
wDataLength
=
dlen
;
...
...
@@ -517,7 +517,7 @@ static DNS_STATUS dns_do_query_netbios( PCSTR name, DNS_RECORDA **recp )
for
(
i
=
0
;
i
<
header
->
node_count
;
i
++
)
{
record
=
dns_zero_alloc
(
sizeof
(
DNS_RECORDA
)
);
record
=
heap_alloc_zero
(
sizeof
(
DNS_RECORDA
)
);
if
(
!
record
)
{
status
=
ERROR_NOT_ENOUGH_MEMORY
;
...
...
@@ -687,7 +687,7 @@ DNS_STATUS WINAPI DnsQuery_A( PCSTR name, WORD type, DWORD options, PVOID server
DnsRecordListFree
(
(
DNS_RECORD
*
)
resultW
,
DnsFreeRecordList
);
}
dns
_free
(
nameW
);
heap
_free
(
nameW
);
return
status
;
}
...
...
@@ -764,7 +764,7 @@ DNS_STATUS WINAPI DnsQuery_W( PCWSTR name, WORD type, DWORD options, PVOID serve
DnsRecordListFree
(
(
DNS_RECORD
*
)
resultA
,
DnsFreeRecordList
);
}
dns
_free
(
nameU
);
heap
_free
(
nameU
);
return
status
;
}
...
...
dlls/dnsapi/record.c
View file @
b3ff6803
...
...
@@ -416,7 +416,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
TRACE
(
"(%p,%d,%d)
\n
"
,
src
,
in
,
out
);
size
=
FIELD_OFFSET
(
DNS_RECORD
,
Data
)
+
src
->
wDataLength
;
dst
=
dns_zero_alloc
(
size
);
dst
=
heap_alloc_zero
(
size
);
if
(
!
dst
)
return
NULL
;
memcpy
(
dst
,
src
,
size
);
...
...
@@ -443,7 +443,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
if
(
!
dst
->
Data
.
TXT
.
pStringArray
[
i
])
{
while
(
i
>
0
)
dns
_free
(
dst
->
Data
.
TXT
.
pStringArray
[
--
i
]
);
while
(
i
>
0
)
heap
_free
(
dst
->
Data
.
TXT
.
pStringArray
[
--
i
]
);
goto
error
;
}
}
...
...
@@ -460,7 +460,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dns_strcpyX
(
src
->
Data
.
MINFO
.
pNameErrorsMailbox
,
in
,
out
);
if
(
!
dst
->
Data
.
MINFO
.
pNameErrorsMailbox
)
{
dns
_free
(
dst
->
Data
.
MINFO
.
pNameMailbox
);
heap
_free
(
dst
->
Data
.
MINFO
.
pNameMailbox
);
goto
error
;
}
break
;
...
...
@@ -512,7 +512,7 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dns_strcpyX
(
src
->
Data
.
SOA
.
pNameAdministrator
,
in
,
out
);
if
(
!
dst
->
Data
.
SOA
.
pNameAdministrator
)
{
dns
_free
(
dst
->
Data
.
SOA
.
pNamePrimaryServer
);
heap
_free
(
dst
->
Data
.
SOA
.
pNamePrimaryServer
);
goto
error
;
}
break
;
...
...
@@ -530,8 +530,8 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
return
dst
;
error:
dns
_free
(
dst
->
pName
);
dns
_free
(
dst
);
heap
_free
(
dst
->
pName
);
heap
_free
(
dst
);
return
NULL
;
}
...
...
@@ -554,7 +554,7 @@ VOID WINAPI DnsRecordListFree( PDNS_RECORD list, DNS_FREE_TYPE type )
{
for
(
r
=
list
;
(
list
=
r
);
r
=
next
)
{
dns
_free
(
r
->
pName
);
heap
_free
(
r
->
pName
);
switch
(
r
->
wType
)
{
...
...
@@ -564,27 +564,27 @@ VOID WINAPI DnsRecordListFree( PDNS_RECORD list, DNS_FREE_TYPE type )
case
DNS_TYPE_X25
:
{
for
(
i
=
0
;
i
<
r
->
Data
.
TXT
.
dwStringCount
;
i
++
)
dns
_free
(
r
->
Data
.
TXT
.
pStringArray
[
i
]
);
heap
_free
(
r
->
Data
.
TXT
.
pStringArray
[
i
]
);
break
;
}
case
DNS_TYPE_MINFO
:
case
DNS_TYPE_RP
:
{
dns
_free
(
r
->
Data
.
MINFO
.
pNameMailbox
);
dns
_free
(
r
->
Data
.
MINFO
.
pNameErrorsMailbox
);
heap
_free
(
r
->
Data
.
MINFO
.
pNameMailbox
);
heap
_free
(
r
->
Data
.
MINFO
.
pNameErrorsMailbox
);
break
;
}
case
DNS_TYPE_AFSDB
:
case
DNS_TYPE_RT
:
case
DNS_TYPE_MX
:
{
dns
_free
(
r
->
Data
.
MX
.
pNameExchange
);
heap
_free
(
r
->
Data
.
MX
.
pNameExchange
);
break
;
}
case
DNS_TYPE_NXT
:
{
dns
_free
(
r
->
Data
.
NXT
.
pNameNext
);
heap
_free
(
r
->
Data
.
NXT
.
pNameNext
);
break
;
}
case
DNS_TYPE_CNAME
:
...
...
@@ -596,23 +596,23 @@ VOID WINAPI DnsRecordListFree( PDNS_RECORD list, DNS_FREE_TYPE type )
case
DNS_TYPE_NS
:
case
DNS_TYPE_PTR
:
{
dns
_free
(
r
->
Data
.
PTR
.
pNameHost
);
heap
_free
(
r
->
Data
.
PTR
.
pNameHost
);
break
;
}
case
DNS_TYPE_SIG
:
{
dns
_free
(
r
->
Data
.
SIG
.
pNameSigner
);
heap
_free
(
r
->
Data
.
SIG
.
pNameSigner
);
break
;
}
case
DNS_TYPE_SOA
:
{
dns
_free
(
r
->
Data
.
SOA
.
pNamePrimaryServer
);
dns
_free
(
r
->
Data
.
SOA
.
pNameAdministrator
);
heap
_free
(
r
->
Data
.
SOA
.
pNamePrimaryServer
);
heap
_free
(
r
->
Data
.
SOA
.
pNameAdministrator
);
break
;
}
case
DNS_TYPE_SRV
:
{
dns
_free
(
r
->
Data
.
SRV
.
pNameTarget
);
heap
_free
(
r
->
Data
.
SRV
.
pNameTarget
);
break
;
}
default:
...
...
@@ -620,7 +620,7 @@ VOID WINAPI DnsRecordListFree( PDNS_RECORD list, DNS_FREE_TYPE type )
}
next
=
r
->
pNext
;
dns
_free
(
r
);
heap
_free
(
r
);
}
break
;
}
...
...
@@ -680,7 +680,7 @@ BOOL WINAPI DnsRecordSetCompare( PDNS_RECORD set1, PDNS_RECORD set2,
DNS_RRSET_ADD
(
rr1
,
u
);
ret
=
FALSE
;
}
else
dns
_free
(
u
);
else
heap
_free
(
u
);
}
}
...
...
@@ -696,7 +696,7 @@ BOOL WINAPI DnsRecordSetCompare( PDNS_RECORD set1, PDNS_RECORD set2,
DNS_RRSET_ADD
(
rr2
,
u
);
ret
=
FALSE
;
}
else
dns
_free
(
u
);
else
heap
_free
(
u
);
}
}
...
...
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