Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
22c293bd
Commit
22c293bd
authored
Sep 05, 2023
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wsdapi: Use CRT allocation functions.
parent
1e8393f9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
44 deletions
+41
-44
address.c
dlls/wsdapi/address.c
+2
-2
discovery.c
dlls/wsdapi/discovery.c
+9
-10
memory.c
dlls/wsdapi/memory.c
+2
-2
msgparams.c
dlls/wsdapi/msgparams.c
+2
-2
network.c
dlls/wsdapi/network.c
+15
-16
soap.c
dlls/wsdapi/soap.c
+11
-12
No files found.
dlls/wsdapi/address.c
View file @
22c293bd
...
...
@@ -91,7 +91,7 @@ static ULONG WINAPI IWSDUdpAddressImpl_Release(IWSDUdpAddress *iface)
if
(
ref
==
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -354,7 +354,7 @@ HRESULT WINAPI WSDCreateUdpAddress(IWSDUdpAddress **ppAddress)
*
ppAddress
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
calloc
(
1
,
sizeof
(
*
obj
));
if
(
!
obj
)
{
...
...
dlls/wsdapi/discovery.c
View file @
22c293bd
...
...
@@ -25,7 +25,6 @@
#include "wsdapi_internal.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "guiddef.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wsdapi
);
...
...
@@ -95,20 +94,20 @@ static ULONG WINAPI IWSDiscoveryPublisherImpl_Release(IWSDiscoveryPublisher *ifa
{
IWSDiscoveryPublisherNotify_Release
(
sink
->
notificationSink
);
list_remove
(
&
sink
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
free
(
sink
);
}
DeleteCriticalSection
(
&
This
->
notification_sink_critical_section
);
LIST_FOR_EACH_ENTRY_SAFE
(
msg_id
,
msg_id_cursor
,
&
This
->
message_ids
,
struct
message_id
,
entry
)
{
heap_
free
(
msg_id
->
id
);
free
(
msg_id
->
id
);
list_remove
(
&
msg_id
->
entry
);
heap_
free
(
msg_id
);
free
(
msg_id
);
}
DeleteCriticalSection
(
&
This
->
message_ids_critical_section
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -149,7 +148,7 @@ static HRESULT WINAPI IWSDiscoveryPublisherImpl_RegisterNotificationSink(IWSDisc
return
E_INVALIDARG
;
}
sink
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
sink
));
sink
=
calloc
(
1
,
sizeof
(
*
sink
));
if
(
!
sink
)
{
...
...
@@ -189,7 +188,7 @@ static HRESULT WINAPI IWSDiscoveryPublisherImpl_UnRegisterNotificationSink(IWSDi
{
IWSDiscoveryPublisherNotify_Release
(
pSink
);
list_remove
(
&
sink
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
sink
);
free
(
sink
);
LeaveCriticalSection
(
&
impl
->
notification_sink_critical_section
);
return
S_OK
;
...
...
@@ -421,7 +420,7 @@ HRESULT WINAPI WSDCreateDiscoveryPublisher(IWSDXMLContext *pContext, IWSDiscover
*
ppPublisher
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
calloc
(
1
,
sizeof
(
*
obj
));
if
(
!
obj
)
{
...
...
@@ -439,7 +438,7 @@ HRESULT WINAPI WSDCreateDiscoveryPublisher(IWSDXMLContext *pContext, IWSDiscover
if
(
FAILED
(
ret
))
{
WARN
(
"Unable to create XML context
\n
"
);
heap_
free
(
obj
);
free
(
obj
);
return
ret
;
}
}
...
...
@@ -454,7 +453,7 @@ HRESULT WINAPI WSDCreateDiscoveryPublisher(IWSDXMLContext *pContext, IWSDiscover
if
(
FAILED
(
ret
))
{
WARN
(
"Unable to register default namespaces
\n
"
);
heap_
free
(
obj
);
free
(
obj
);
return
ret
;
}
...
...
dlls/wsdapi/memory.c
View file @
22c293bd
...
...
@@ -74,7 +74,7 @@ static void free_allocation(struct memory_allocation *item)
list_remove
(
&
item
->
entry
);
item
->
magic
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
item
);
free
(
item
);
}
void
*
WINAPI
WSDAllocateLinkedMemory
(
void
*
pParent
,
SIZE_T
cbSize
)
...
...
@@ -84,7 +84,7 @@ void * WINAPI WSDAllocateLinkedMemory(void *pParent, SIZE_T cbSize)
TRACE
(
"(%p, %Iu)
\n
"
,
pParent
,
cbSize
);
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MEMORY_ALLOCATION_SIZE
+
cbSize
);
ptr
=
malloc
(
MEMORY_ALLOCATION_SIZE
+
cbSize
);
if
(
ptr
==
NULL
)
{
...
...
dlls/wsdapi/msgparams.c
View file @
22c293bd
...
...
@@ -81,7 +81,7 @@ static ULONG IWSDMessageParametersImpl_Release(IWSDMessageParameters *iface)
IWSDAddress_Release
(
This
->
remoteAddress
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -310,7 +310,7 @@ HRESULT WINAPI WSDCreateUdpMessageParameters(IWSDUdpMessageParameters **ppTxPara
*
ppTxParams
=
NULL
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
calloc
(
1
,
sizeof
(
*
obj
));
if
(
!
obj
)
return
E_OUTOFMEMORY
;
obj
->
base
.
IWSDMessageParameters_iface
.
lpVtbl
=
(
IWSDMessageParametersVtbl
*
)
&
udpMsgParamsVtbl
;
...
...
dlls/wsdapi/network.c
View file @
22c293bd
...
...
@@ -24,7 +24,6 @@
#include "wsdapi_internal.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "iphlpapi.h"
#include "bcrypt.h"
...
...
@@ -92,8 +91,8 @@ static DWORD WINAPI sending_thread(LPVOID lpParam)
MULTICAST_UDP_REPEAT
);
closesocket
(
params
->
sock
);
heap_
free
(
params
->
data
);
heap_
free
(
params
);
free
(
params
->
data
);
free
(
params
);
return
0
;
}
...
...
@@ -120,7 +119,7 @@ static BOOL send_udp_multicast_of_type(char *data, int length, int max_initial_d
goto
cleanup
;
}
adapter_addresses
=
(
IP_ADAPTER_ADDRESSES
*
)
heap_
alloc
(
bufferSize
);
adapter_addresses
=
m
alloc
(
bufferSize
);
if
(
adapter_addresses
==
NULL
)
{
...
...
@@ -170,9 +169,9 @@ static BOOL send_udp_multicast_of_type(char *data, int length, int max_initial_d
setsockopt
(
s
,
IPPROTO_IP
,
IP_MULTICAST_TTL
,
&
ttl
,
sizeof
(
ttl
));
/* Set up the thread parameters */
send_params
=
heap_
alloc
(
sizeof
(
*
send_params
));
send_params
=
m
alloc
(
sizeof
(
*
send_params
));
send_params
->
data
=
heap_
alloc
(
length
);
send_params
->
data
=
m
alloc
(
length
);
memcpy
(
send_params
->
data
,
data
,
length
);
send_params
->
length
=
length
;
send_params
->
sock
=
s
;
...
...
@@ -203,8 +202,8 @@ static BOOL send_udp_multicast_of_type(char *data, int length, int max_initial_d
WARN
(
"CreateThread failed (error %ld)
\n
"
,
GetLastError
());
closesocket
(
s
);
heap_
free
(
send_params
->
data
);
heap_
free
(
send_params
);
free
(
send_params
->
data
);
free
(
send_params
);
continue
;
}
...
...
@@ -215,7 +214,7 @@ static BOOL send_udp_multicast_of_type(char *data, int length, int max_initial_d
ret
=
TRUE
;
cleanup:
heap_
free
(
adapter_addresses
);
free
(
adapter_addresses
);
return
ret
;
}
...
...
@@ -359,7 +358,7 @@ static DWORD WINAPI listening_thread(LPVOID params)
SOCKADDR_STORAGE
source_addr
;
char
*
buffer
;
buffer
=
heap_
alloc
(
RECEIVE_BUFFER_SIZE
);
buffer
=
m
alloc
(
RECEIVE_BUFFER_SIZE
);
address_len
=
parameter
->
ipv6
?
sizeof
(
SOCKADDR_IN6
)
:
sizeof
(
SOCKADDR_IN
);
while
(
parameter
->
impl
->
publisherStarted
)
...
...
@@ -386,8 +385,8 @@ static DWORD WINAPI listening_thread(LPVOID params)
/* The publisher has been stopped */
closesocket
(
parameter
->
listening_socket
);
heap_
free
(
buffer
);
heap_
free
(
parameter
);
free
(
buffer
);
free
(
parameter
);
return
0
;
}
...
...
@@ -477,7 +476,7 @@ static int start_listening(IWSDiscoveryPublisherImpl *impl, SOCKADDR_STORAGE *bi
}
/* Allocate memory for thread parameters */
parameter
=
heap_alloc
(
sizeof
(
listener_thread_params
));
parameter
=
malloc
(
sizeof
(
*
parameter
));
parameter
->
impl
=
impl
;
parameter
->
listening_socket
=
s
;
...
...
@@ -498,7 +497,7 @@ static int start_listening(IWSDiscoveryPublisherImpl *impl, SOCKADDR_STORAGE *bi
cleanup:
closesocket
(
s
);
heap_
free
(
parameter
);
free
(
parameter
);
return
0
;
}
...
...
@@ -519,7 +518,7 @@ static BOOL start_listening_on_all_addresses(IWSDiscoveryPublisherImpl *impl, UL
}
/* Get size of buffer for adapters */
adapter_addresses
=
(
IP_ADAPTER_ADDRESSES
*
)
heap_
alloc
(
bufferSize
);
adapter_addresses
=
m
alloc
(
bufferSize
);
if
(
adapter_addresses
==
NULL
)
{
...
...
@@ -554,7 +553,7 @@ static BOOL start_listening_on_all_addresses(IWSDiscoveryPublisherImpl *impl, UL
}
cleanup:
heap_
free
(
adapter_addresses
);
free
(
adapter_addresses
);
return
(
ret
==
ERROR_SUCCESS
)
&&
(
valid_listeners
>
0
);
}
...
...
dlls/wsdapi/soap.c
View file @
22c293bd
...
...
@@ -25,7 +25,6 @@
#include "wsdapi_internal.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "webservices.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wsdapi
);
...
...
@@ -106,7 +105,7 @@ static char *wide_to_utf8(LPCWSTR wide_string, int *length)
if
(
*
length
<
0
)
return
NULL
;
new_string
=
heap_
alloc
(
*
length
);
new_string
=
m
alloc
(
*
length
);
WideCharToMultiByte
(
CP_UTF8
,
0
,
wide_string
,
-
1
,
new_string
,
*
length
,
NULL
,
NULL
);
return
new_string
;
...
...
@@ -114,7 +113,7 @@ static char *wide_to_utf8(LPCWSTR wide_string, int *length)
static
WS_XML_STRING
*
populate_xml_string
(
LPCWSTR
str
)
{
WS_XML_STRING
*
xml
=
heap_alloc_zero
(
sizeof
(
WS_XML_STRING
));
WS_XML_STRING
*
xml
=
calloc
(
1
,
sizeof
(
*
xml
));
int
utf8Length
;
if
(
xml
==
NULL
)
...
...
@@ -124,7 +123,7 @@ static WS_XML_STRING *populate_xml_string(LPCWSTR str)
if
(
xml
->
bytes
==
NULL
)
{
heap_
free
(
xml
);
free
(
xml
);
return
NULL
;
}
...
...
@@ -140,9 +139,9 @@ static inline void free_xml_string(WS_XML_STRING *value)
if
(
value
==
NULL
)
return
;
heap_
free
(
value
->
bytes
);
free
(
value
->
bytes
);
heap_
free
(
value
);
free
(
value
);
}
static
HRESULT
write_xml_attribute
(
WSDXML_ATTRIBUTE
*
attribute
,
WS_XML_WRITER
*
writer
)
...
...
@@ -850,7 +849,7 @@ static HRESULT write_and_send_message(IWSDiscoveryPublisherImpl *impl, WSD_SOAP_
if
(
ret
!=
S_OK
)
return
ret
;
/* Prefix the XML header */
full_xml
=
heap_
alloc
(
xml_length
+
xml_header_len
+
1
);
full_xml
=
m
alloc
(
xml_length
+
xml_header_len
+
1
);
if
(
full_xml
==
NULL
)
{
...
...
@@ -873,7 +872,7 @@ static HRESULT write_and_send_message(IWSDiscoveryPublisherImpl *impl, WSD_SOAP_
ret
=
send_udp_unicast
(
full_xml
,
xml_length
+
xml_header_len
,
remote_address
,
max_initial_delay
);
}
heap_
free
(
full_xml
);
free
(
full_xml
);
WsFreeHeap
(
heap
);
return
ret
;
...
...
@@ -1293,7 +1292,7 @@ static HRESULT wide_text_to_ulonglong(LPCWSTR text, ULONGLONG *value)
if
(
utf8_length
==
1
)
return
E_FAIL
;
ret
=
str_to_uint64
((
const
unsigned
char
*
)
utf8_text
,
utf8_length
-
1
,
MAX_UINT64
,
value
);
heap_
free
(
utf8_text
);
free
(
utf8_text
);
return
ret
;
}
...
...
@@ -1635,15 +1634,15 @@ static BOOL is_duplicate_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id)
}
}
msg_id
=
heap_
alloc
(
sizeof
(
*
msg_id
));
msg_id
=
m
alloc
(
sizeof
(
*
msg_id
));
if
(
!
msg_id
)
goto
end
;
len
=
(
lstrlenW
(
id
)
+
1
)
*
sizeof
(
WCHAR
);
msg_id
->
id
=
heap_
alloc
(
len
);
msg_id
->
id
=
m
alloc
(
len
);
if
(
!
msg_id
->
id
)
{
heap_
free
(
msg_id
);
free
(
msg_id
);
goto
end
;
}
...
...
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