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
09634860
Commit
09634860
authored
Oct 22, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsCreateXmlBuffer.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e7d44ee6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
8 deletions
+59
-8
reader.c
dlls/webservices/reader.c
+13
-7
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices_private.h
dlls/webservices/webservices_private.h
+11
-0
writer.c
dlls/webservices/writer.c
+34
-0
No files found.
dlls/webservices/reader.c
View file @
09634860
...
...
@@ -158,6 +158,18 @@ struct heap
WS_HEAP_PROPERTY
prop
[
sizeof
(
heap_props
)
/
sizeof
(
heap_props
[
0
])];
};
void
*
ws_alloc
(
WS_HEAP
*
handle
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
return
HeapAlloc
(
heap
->
handle
,
0
,
size
);
}
void
ws_free
(
WS_HEAP
*
handle
,
void
*
ptr
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
HeapFree
(
heap
->
handle
,
0
,
ptr
);
}
static
struct
heap
*
alloc_heap
(
void
)
{
static
const
ULONG
count
=
sizeof
(
heap_props
)
/
sizeof
(
heap_props
[
0
]);
...
...
@@ -1103,12 +1115,6 @@ HRESULT WINAPI WsReadToStartElement( WS_XML_READER *handle, const WS_XML_STRING
return
read_to_startelement
(
reader
,
found
);
}
static
void
*
read_alloc
(
WS_HEAP
*
handle
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
return
HeapAlloc
(
heap
->
handle
,
0
,
size
);
}
static
WCHAR
*
xmltext_to_widechar
(
WS_HEAP
*
heap
,
const
WS_XML_TEXT
*
text
)
{
WCHAR
*
ret
;
...
...
@@ -1119,7 +1125,7 @@ static WCHAR *xmltext_to_widechar( WS_HEAP *heap, const WS_XML_TEXT *text )
{
const
WS_XML_UTF8_TEXT
*
utf8
=
(
const
WS_XML_UTF8_TEXT
*
)
text
;
int
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
char
*
)
utf8
->
value
.
bytes
,
utf8
->
value
.
length
,
NULL
,
0
);
if
(
!
(
ret
=
read
_alloc
(
heap
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
if
(
!
(
ret
=
ws
_alloc
(
heap
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
MultiByteToWideChar
(
CP_UTF8
,
0
,
(
char
*
)
utf8
->
value
.
bytes
,
utf8
->
value
.
length
,
ret
,
len
);
ret
[
len
]
=
0
;
break
;
...
...
dlls/webservices/webservices.spec
View file @
09634860
...
...
@@ -35,7 +35,7 @@
@ stub WsCreateServiceProxy
@ stub WsCreateServiceProxyFromTemplate
@ stdcall WsCreateWriter(ptr long ptr ptr)
@ st
ub WsCreateXmlBuffer
@ st
dcall WsCreateXmlBuffer(ptr ptr long ptr ptr)
@ stub WsCreateXmlSecurityToken
@ stub WsDateTimeToFileTime
@ stub WsDecodeUrl
...
...
dlls/webservices/webservices_private.h
View file @
09634860
...
...
@@ -16,6 +16,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
struct
xmlbuf
{
WS_HEAP
*
heap
;
void
*
ptr
;
SIZE_T
size_allocated
;
SIZE_T
size
;
};
void
*
ws_alloc
(
WS_HEAP
*
,
SIZE_T
)
DECLSPEC_HIDDEN
;
void
ws_free
(
WS_HEAP
*
,
void
*
)
DECLSPEC_HIDDEN
;
static
inline
void
*
heap_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
...
dlls/webservices/writer.c
View file @
09634860
...
...
@@ -152,6 +152,40 @@ void WINAPI WsFreeWriter( WS_XML_WRITER *handle )
heap_free
(
writer
);
}
#define XML_BUFFER_INITIAL_ALLOCATED_SIZE 256
static
struct
xmlbuf
*
alloc_xmlbuf
(
WS_HEAP
*
heap
)
{
struct
xmlbuf
*
ret
;
if
(
!
(
ret
=
ws_alloc
(
heap
,
sizeof
(
*
ret
)
)))
return
NULL
;
if
(
!
(
ret
->
ptr
=
ws_alloc
(
heap
,
XML_BUFFER_INITIAL_ALLOCATED_SIZE
)))
{
ws_free
(
heap
,
ret
);
return
NULL
;
}
ret
->
heap
=
heap
;
ret
->
size_allocated
=
XML_BUFFER_INITIAL_ALLOCATED_SIZE
;
ret
->
size
=
0
;
return
ret
;
}
/**************************************************************************
* WsCreateXmlBuffer [webservices.@]
*/
HRESULT
WINAPI
WsCreateXmlBuffer
(
WS_HEAP
*
heap
,
const
WS_XML_BUFFER_PROPERTY
*
properties
,
ULONG
count
,
WS_XML_BUFFER
**
handle
,
WS_ERROR
*
error
)
{
struct
xmlbuf
*
xmlbuf
;
if
(
!
heap
||
!
handle
)
return
E_INVALIDARG
;
if
(
count
)
FIXME
(
"properties not implemented
\n
"
);
if
(
!
(
xmlbuf
=
alloc_xmlbuf
(
heap
)))
return
E_OUTOFMEMORY
;
*
handle
=
(
WS_XML_BUFFER
*
)
xmlbuf
;
return
S_OK
;
}
/**************************************************************************
* WsGetWriterProperty [webservices.@]
*/
...
...
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