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
dbd4f9e9
Commit
dbd4f9e9
authored
Mar 29, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite: Use CRT allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f859e8b2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
33 deletions
+12
-33
reader.c
dlls/xmllite/reader.c
+4
-12
writer.c
dlls/xmllite/writer.c
+5
-16
xmllite_private.h
dlls/xmllite/xmllite_private.h
+3
-5
No files found.
dlls/xmllite/reader.c
View file @
dbd4f9e9
...
...
@@ -3632,11 +3632,7 @@ HRESULT WINAPI CreateXmlReader(REFIID riid, void **obj, IMalloc *imalloc)
TRACE
(
"(%s, %p, %p)
\n
"
,
wine_dbgstr_guid
(
riid
),
obj
,
imalloc
);
if
(
imalloc
)
reader
=
IMalloc_Alloc
(
imalloc
,
sizeof
(
*
reader
));
else
reader
=
heap_alloc
(
sizeof
(
*
reader
));
if
(
!
reader
)
if
(
!
(
reader
=
m_alloc
(
imalloc
,
sizeof
(
*
reader
))))
return
E_OUTOFMEMORY
;
memset
(
reader
,
0
,
sizeof
(
*
reader
));
...
...
@@ -3682,21 +3678,17 @@ HRESULT WINAPI CreateXmlReaderInputWithEncodingName(IUnknown *stream,
if
(
!
stream
||
!
ppInput
)
return
E_INVALIDARG
;
if
(
imalloc
)
readerinput
=
IMalloc_Alloc
(
imalloc
,
sizeof
(
*
readerinput
));
else
readerinput
=
heap_alloc
(
sizeof
(
*
readerinput
));
if
(
!
readerinput
)
return
E_OUTOFMEMORY
;
if
(
!
(
readerinput
=
m_alloc
(
imalloc
,
sizeof
(
*
readerinput
))))
return
E_OUTOFMEMORY
;
memset
(
readerinput
,
0
,
sizeof
(
*
readerinput
));
readerinput
->
IXmlReaderInput_iface
.
lpVtbl
=
&
xmlreaderinputvtbl
;
readerinput
->
ref
=
1
;
readerinput
->
imalloc
=
imalloc
;
readerinput
->
stream
=
NULL
;
if
(
imalloc
)
IMalloc_AddRef
(
imalloc
);
readerinput
->
encoding
=
parse_encoding_name
(
encoding
,
-
1
);
readerinput
->
hint
=
hint
;
readerinput
->
baseuri
=
readerinput_strdupW
(
readerinput
,
base_uri
);
readerinput
->
pending
=
0
;
hr
=
alloc_input_buffer
(
readerinput
);
if
(
hr
!=
S_OK
)
...
...
dlls/xmllite/writer.c
View file @
dbd4f9e9
...
...
@@ -1865,13 +1865,8 @@ HRESULT WINAPI CreateXmlWriter(REFIID riid, void **obj, IMalloc *imalloc)
TRACE
(
"(%s, %p, %p)
\n
"
,
wine_dbgstr_guid
(
riid
),
obj
,
imalloc
);
if
(
imalloc
)
writer
=
IMalloc_Alloc
(
imalloc
,
sizeof
(
*
writer
));
else
writer
=
heap_alloc
(
sizeof
(
*
writer
));
if
(
!
writer
)
if
(
!
(
writer
=
m_alloc
(
imalloc
,
sizeof
(
*
writer
))))
return
E_OUTOFMEMORY
;
memset
(
writer
,
0
,
sizeof
(
*
writer
));
writer
->
IXmlWriter_iface
.
lpVtbl
=
&
xmlwriter_vtbl
;
...
...
@@ -1899,12 +1894,9 @@ static HRESULT create_writer_output(IUnknown *stream, IMalloc *imalloc, xml_enco
*
out
=
NULL
;
if
(
imalloc
)
writeroutput
=
IMalloc_Alloc
(
imalloc
,
sizeof
(
*
writeroutput
));
else
writeroutput
=
heap_alloc
(
sizeof
(
*
writeroutput
));
if
(
!
writeroutput
)
if
(
!
(
writeroutput
=
m_alloc
(
imalloc
,
sizeof
(
*
writeroutput
))))
return
E_OUTOFMEMORY
;
memset
(
writeroutput
,
0
,
sizeof
(
*
writeroutput
));
writeroutput
->
IXmlWriterOutput_iface
.
lpVtbl
=
&
xmlwriteroutputvtbl
;
writeroutput
->
ref
=
1
;
...
...
@@ -1912,21 +1904,18 @@ static HRESULT create_writer_output(IUnknown *stream, IMalloc *imalloc, xml_enco
if
(
imalloc
)
IMalloc_AddRef
(
imalloc
);
writeroutput
->
encoding
=
encoding
;
writeroutput
->
stream
=
NULL
;
hr
=
init_output_buffer
(
writeroutput
);
if
(
FAILED
(
hr
))
{
IUnknown_Release
(
&
writeroutput
->
IXmlWriterOutput_iface
);
return
hr
;
}
if
(
encoding_name
)
{
if
(
encoding_name
)
{
unsigned
int
size
=
(
lstrlenW
(
encoding_name
)
+
1
)
*
sizeof
(
WCHAR
);
writeroutput
->
encoding_name
=
writeroutput_alloc
(
writeroutput
,
size
);
memcpy
(
writeroutput
->
encoding_name
,
encoding_name
,
size
);
}
else
writeroutput
->
encoding_name
=
NULL
;
writeroutput
->
written
=
0
;
IUnknown_QueryInterface
(
stream
,
&
IID_IUnknown
,
(
void
**
)
&
writeroutput
->
output
);
...
...
dlls/xmllite/xmllite_private.h
View file @
dbd4f9e9
...
...
@@ -21,14 +21,12 @@
#ifndef __XMLLITE_PRIVATE__
#define __XMLLITE_PRIVATE__
#include "wine/heap.h"
static
inline
void
*
m_alloc
(
IMalloc
*
imalloc
,
size_t
len
)
{
if
(
imalloc
)
return
IMalloc_Alloc
(
imalloc
,
len
);
else
return
heap_
alloc
(
len
);
return
m
alloc
(
len
);
}
static
inline
void
*
m_realloc
(
IMalloc
*
imalloc
,
void
*
mem
,
size_t
len
)
...
...
@@ -36,7 +34,7 @@ static inline void *m_realloc(IMalloc *imalloc, void *mem, size_t len)
if
(
imalloc
)
return
IMalloc_Realloc
(
imalloc
,
mem
,
len
);
else
return
heap_
realloc
(
mem
,
len
);
return
realloc
(
mem
,
len
);
}
static
inline
void
m_free
(
IMalloc
*
imalloc
,
void
*
mem
)
...
...
@@ -44,7 +42,7 @@ static inline void m_free(IMalloc *imalloc, void *mem)
if
(
imalloc
)
IMalloc_Free
(
imalloc
,
mem
);
else
heap_
free
(
mem
);
free
(
mem
);
}
typedef
enum
...
...
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