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
60f1b851
Commit
60f1b851
authored
Sep 11, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsCreateError and WsFreeError.
parent
dccb4293
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
12 deletions
+145
-12
Makefile.in
dlls/webservices/Makefile.in
+2
-1
main.c
dlls/webservices/main.c
+0
-10
reader.c
dlls/webservices/reader.c
+142
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/Makefile.in
View file @
60f1b851
...
...
@@ -2,4 +2,5 @@ MODULE = webservices.dll
IMPORTLIB
=
webservices
C_SRCS
=
\
main.c
main.c
\
reader.c
dlls/webservices/main.c
View file @
60f1b851
...
...
@@ -42,13 +42,3 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
return
TRUE
;
}
/**************************************************************************
* WsCreateError [webservices.@]
*/
HRESULT
WINAPI
WsCreateError
(
const
WS_ERROR_PROPERTY
*
properties
,
ULONG
count
,
WS_ERROR
**
error
)
{
FIXME
(
"%p %u %p: stub
\n
"
,
properties
,
count
,
error
);
if
(
error
)
*
error
=
NULL
;
return
E_NOTIMPL
;
}
dlls/webservices/reader.c
0 → 100644
View file @
60f1b851
/*
* Copyright 2015 Hans Leidekker for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "webservices.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
webservices
);
static
inline
void
*
heap_alloc
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
}
static
inline
void
*
heap_alloc_zero
(
SIZE_T
size
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
}
static
inline
void
*
heap_realloc
(
void
*
mem
,
SIZE_T
size
)
{
return
HeapReAlloc
(
GetProcessHeap
(),
0
,
mem
,
size
);
}
static
inline
BOOL
heap_free
(
void
*
mem
)
{
return
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
const
struct
{
ULONG
size
;
BOOL
readonly
;
}
error_props
[]
=
{
{
sizeof
(
ULONG
),
TRUE
},
/* WS_ERROR_PROPERTY_STRING_COUNT */
{
sizeof
(
ULONG
),
FALSE
},
/* WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE */
{
sizeof
(
LANGID
),
FALSE
}
/* WS_ERROR_PROPERTY_LANGID */
};
struct
error
{
ULONG
prop_count
;
WS_ERROR_PROPERTY
prop
[
sizeof
(
error_props
)
/
sizeof
(
error_props
[
0
])];
};
static
struct
error
*
alloc_error
(
void
)
{
static
const
ULONG
count
=
sizeof
(
error_props
)
/
sizeof
(
error_props
[
0
]);
struct
error
*
ret
;
ULONG
i
,
size
=
sizeof
(
*
ret
)
+
count
*
sizeof
(
WS_ERROR_PROPERTY
);
char
*
ptr
;
for
(
i
=
0
;
i
<
count
;
i
++
)
size
+=
error_props
[
i
].
size
;
if
(
!
(
ret
=
heap_alloc_zero
(
size
)))
return
NULL
;
ptr
=
(
char
*
)
&
ret
->
prop
[
count
];
for
(
i
=
0
;
i
<
count
;
i
++
)
{
ret
->
prop
[
i
].
value
=
ptr
;
ret
->
prop
[
i
].
valueSize
=
error_props
[
i
].
size
;
ptr
+=
ret
->
prop
[
i
].
valueSize
;
}
ret
->
prop_count
=
count
;
return
ret
;
}
static
HRESULT
set_error_prop
(
struct
error
*
error
,
WS_ERROR_PROPERTY_ID
id
,
const
void
*
value
,
ULONG
size
)
{
if
(
id
>=
error
->
prop_count
||
size
!=
error_props
[
id
].
size
||
error_props
[
id
].
readonly
)
return
E_INVALIDARG
;
memcpy
(
error
->
prop
[
id
].
value
,
value
,
size
);
return
S_OK
;
}
/**************************************************************************
* WsCreateError [webservices.@]
*/
HRESULT
WINAPI
WsCreateError
(
const
WS_ERROR_PROPERTY
*
properties
,
ULONG
count
,
WS_ERROR
**
handle
)
{
struct
error
*
error
;
LANGID
langid
=
GetUserDefaultUILanguage
();
HRESULT
hr
;
ULONG
i
;
TRACE
(
"%p %u %p
\n
"
,
properties
,
count
,
handle
);
if
(
!
handle
)
return
E_INVALIDARG
;
if
(
!
(
error
=
alloc_error
()))
return
E_OUTOFMEMORY
;
set_error_prop
(
error
,
WS_ERROR_PROPERTY_LANGID
,
&
langid
,
sizeof
(
langid
)
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
properties
[
i
].
id
==
WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE
)
{
heap_free
(
error
);
return
E_INVALIDARG
;
}
hr
=
set_error_prop
(
error
,
properties
[
i
].
id
,
properties
[
i
].
value
,
properties
[
i
].
valueSize
);
if
(
hr
!=
S_OK
)
{
heap_free
(
error
);
return
hr
;
}
}
*
handle
=
(
WS_ERROR
*
)
error
;
return
S_OK
;
}
/**************************************************************************
* WsFreeError [webservices.@]
*/
void
WINAPI
WsFreeError
(
WS_ERROR
*
handle
)
{
struct
error
*
error
=
(
struct
error
*
)
handle
;
TRACE
(
"%p
\n
"
,
handle
);
heap_free
(
error
);
}
dlls/webservices/webservices.spec
View file @
60f1b851
...
...
@@ -49,7 +49,7 @@
@ stub WsFlushBody
@ stub WsFlushWriter
@ stub WsFreeChannel
@ st
ub WsFreeError
@ st
dcall WsFreeError(ptr)
@ stub WsFreeHeap
@ stub WsFreeListener
@ stub WsFreeMessage
...
...
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