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
767056dc
Commit
767056dc
authored
Apr 22, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 22, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsResetHeap.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
19fecc4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
7 deletions
+109
-7
reader.c
dlls/webservices/reader.c
+32
-6
reader.c
dlls/webservices/tests/reader.c
+75
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices.h
include/webservices.h
+1
-0
No files found.
dlls/webservices/reader.c
View file @
767056dc
...
...
@@ -157,33 +157,48 @@ struct heap
struct
prop
prop
[
sizeof
(
heap_props
)
/
sizeof
(
heap_props
[
0
])];
};
static
BOOL
ensure_heap
(
struct
heap
*
heap
)
{
SIZE_T
size
;
if
(
heap
->
handle
)
return
TRUE
;
if
(
prop_get
(
heap
->
prop
,
heap
->
prop_count
,
WS_HEAP_PROPERTY_MAX_SIZE
,
&
size
,
sizeof
(
size
)
)
!=
S_OK
)
return
FALSE
;
if
(
!
(
heap
->
handle
=
HeapCreate
(
0
,
0
,
size
)))
return
FALSE
;
return
TRUE
;
}
void
*
ws_alloc
(
WS_HEAP
*
handle
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
if
(
!
ensure_heap
(
heap
))
return
NULL
;
return
HeapAlloc
(
heap
->
handle
,
0
,
size
);
}
static
void
*
ws_alloc_zero
(
WS_HEAP
*
handle
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
if
(
!
ensure_heap
(
heap
))
return
NULL
;
return
HeapAlloc
(
heap
->
handle
,
HEAP_ZERO_MEMORY
,
size
);
}
void
*
ws_realloc
(
WS_HEAP
*
handle
,
void
*
ptr
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
if
(
!
ensure_heap
(
heap
))
return
NULL
;
return
HeapReAlloc
(
heap
->
handle
,
0
,
ptr
,
size
);
}
static
void
*
ws_realloc_zero
(
WS_HEAP
*
handle
,
void
*
ptr
,
SIZE_T
size
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
if
(
!
ensure_heap
(
heap
))
return
NULL
;
return
HeapReAlloc
(
heap
->
handle
,
HEAP_ZERO_MEMORY
,
ptr
,
size
);
}
void
ws_free
(
WS_HEAP
*
handle
,
void
*
ptr
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
if
(
!
heap
->
handle
)
return
;
HeapFree
(
heap
->
handle
,
0
,
ptr
);
}
...
...
@@ -233,12 +248,6 @@ HRESULT WINAPI WsCreateHeap( SIZE_T max_size, SIZE_T trim_size, const WS_HEAP_PR
prop_set
(
heap
->
prop
,
heap
->
prop_count
,
WS_HEAP_PROPERTY_MAX_SIZE
,
&
max_size
,
sizeof
(
max_size
)
);
prop_set
(
heap
->
prop
,
heap
->
prop_count
,
WS_HEAP_PROPERTY_TRIM_SIZE
,
&
trim_size
,
sizeof
(
trim_size
)
);
if
(
!
(
heap
->
handle
=
HeapCreate
(
0
,
0
,
max_size
)))
{
heap_free
(
heap
);
return
E_OUTOFMEMORY
;
}
*
handle
=
(
WS_HEAP
*
)
heap
;
return
S_OK
;
}
...
...
@@ -257,6 +266,23 @@ void WINAPI WsFreeHeap( WS_HEAP *handle )
heap_free
(
heap
);
}
/**************************************************************************
* WsResetHeap [webservices.@]
*/
HRESULT
WINAPI
WsResetHeap
(
WS_HEAP
*
handle
,
WS_ERROR
*
error
)
{
struct
heap
*
heap
=
(
struct
heap
*
)
handle
;
TRACE
(
"%p %p
\n
"
,
handle
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
heap
)
return
E_INVALIDARG
;
HeapDestroy
(
heap
->
handle
);
heap
->
handle
=
NULL
;
return
S_OK
;
}
struct
node
*
alloc_node
(
WS_XML_NODE_TYPE
type
)
{
struct
node
*
ret
;
...
...
dlls/webservices/tests/reader.c
View file @
767056dc
...
...
@@ -2850,6 +2850,80 @@ static void test_repeating_element(void)
WsFreeHeap
(
heap
);
}
static
void
test_WsResetHeap
(
void
)
{
HRESULT
hr
;
WS_HEAP
*
heap
;
SIZE_T
requested
,
actual
;
ULONG
size
;
void
*
ptr
;
hr
=
WsCreateHeap
(
1
<<
16
,
0
,
NULL
,
0
,
&
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
requested
=
0xdeadbeef
;
size
=
sizeof
(
requested
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_REQUESTED_SIZE
,
&
requested
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
requested
,
"got %u
\n
"
,
(
ULONG
)
requested
);
actual
=
0xdeadbeef
;
size
=
sizeof
(
actual
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_ACTUAL_SIZE
,
&
actual
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
actual
,
"got %u
\n
"
,
(
ULONG
)
actual
);
hr
=
WsAlloc
(
heap
,
128
,
&
ptr
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
requested
=
0xdeadbeef
;
size
=
sizeof
(
requested
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_REQUESTED_SIZE
,
&
requested
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
requested
==
128
,
"got %u
\n
"
,
(
ULONG
)
requested
);
actual
=
0xdeadbeef
;
size
=
sizeof
(
actual
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_ACTUAL_SIZE
,
&
actual
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
actual
==
128
,
"got %u
\n
"
,
(
ULONG
)
actual
);
hr
=
WsAlloc
(
heap
,
1
,
&
ptr
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
requested
=
0xdeadbeef
;
size
=
sizeof
(
requested
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_REQUESTED_SIZE
,
&
requested
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
requested
==
129
,
"got %u
\n
"
,
(
ULONG
)
requested
);
actual
=
0xdeadbeef
;
size
=
sizeof
(
actual
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_ACTUAL_SIZE
,
&
actual
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
actual
==
384
,
"got %u
\n
"
,
(
ULONG
)
actual
);
hr
=
WsResetHeap
(
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsResetHeap
(
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
requested
=
0xdeadbeef
;
size
=
sizeof
(
requested
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_REQUESTED_SIZE
,
&
requested
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
!
requested
,
"got %u
\n
"
,
(
ULONG
)
requested
);
actual
=
0xdeadbeef
;
size
=
sizeof
(
actual
);
hr
=
WsGetHeapProperty
(
heap
,
WS_HEAP_PROPERTY_ACTUAL_SIZE
,
&
actual
,
size
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
todo_wine
ok
(
actual
==
128
,
"got %u
\n
"
,
(
ULONG
)
actual
);
WsFreeHeap
(
heap
);
}
START_TEST
(
reader
)
{
test_WsCreateError
();
...
...
@@ -2874,4 +2948,5 @@ START_TEST(reader)
test_text_field_mapping
();
test_complex_struct_type
();
test_repeating_element
();
test_WsResetHeap
();
}
dlls/webservices/webservices.spec
View file @
767056dc
...
...
@@ -135,7 +135,7 @@
@ stub WsRequestSecurityToken
@ stub WsResetChannel
@ stub WsResetError
@ st
ub WsResetHeap
@ st
dcall WsResetHeap(ptr ptr)
@ stub WsResetListener
@ stub WsResetMessage
@ stub WsResetMetadata
...
...
include/webservices.h
View file @
767056dc
...
...
@@ -955,6 +955,7 @@ HRESULT WINAPI WsReadToStartElement(WS_XML_READER*, const WS_XML_STRING*, const
BOOL
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsReadType
(
WS_XML_READER
*
,
WS_TYPE_MAPPING
,
WS_TYPE
,
const
void
*
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
WS_ERROR
*
);
HRESULT
WINAPI
WsResetHeap
(
WS_HEAP
*
,
WS_ERROR
*
);
HRESULT
WINAPI
WsSetChannelProperty
(
WS_CHANNEL
*
,
WS_CHANNEL_PROPERTY_ID
,
const
void
*
,
ULONG
,
WS_ERROR
*
);
HRESULT
WINAPI
WsSetErrorProperty
(
WS_ERROR
*
,
WS_ERROR_PROPERTY_ID
,
const
void
*
,
ULONG
);
HRESULT
WINAPI
WsSetInput
(
WS_XML_READER
*
,
const
WS_XML_READER_ENCODING
*
,
const
WS_XML_READER_INPUT
*
,
...
...
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