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
0f12f358
Commit
0f12f358
authored
Sep 15, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Implemented __finally support in server functions.
parent
3bab54cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
30 deletions
+39
-30
server.c
tools/widl/server.c
+39
-30
No files found.
tools/widl/server.c
View file @
0f12f358
...
...
@@ -63,21 +63,38 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
/* check for a defined binding handle */
explicit_handle_var
=
get_explicit_handle_var
(
func
);
print_server
(
"void __RPC_STUB %s_%s( PRPC_MESSAGE _pRpcMessage )
\n
"
,
iface
->
name
,
get_name
(
def
));
/* write the functions body */
fprintf
(
server
,
"{
\n
"
);
print_server
(
"struct __frame_%s_%s
\n
{
\n
"
,
iface
->
name
,
get_name
(
def
));
indent
++
;
print_server
(
"struct __server_frame __f, * const __frame = &__f;
\n
"
);
print_server
(
"__DECL_EXCEPTION_FRAME
\n
"
);
print_server
(
"MIDL_STUB_MESSAGE _StubMsg;
\n
"
);
/* Declare arguments */
declare_stub_args
(
server
,
indent
,
func
);
print_server
(
"RPC_STATUS _Status;
\n
"
);
fprintf
(
server
,
"
\n
"
);
indent
--
;
print_server
(
"};
\n\n
"
);
print_server
(
"static void __finally_%s_%s("
,
iface
->
name
,
get_name
(
def
));
fprintf
(
server
,
" struct __frame_%s_%s *__frame )
\n
{
\n
"
,
iface
->
name
,
get_name
(
def
));
indent
++
;
write_remoting_arguments
(
server
,
indent
,
func
,
"__frame->"
,
PASS_OUT
,
PHASE_FREE
);
if
(
has_full_pointer
)
write_full_pointer_free
(
server
,
indent
,
func
);
indent
--
;
print_server
(
"}
\n\n
"
);
print_server
(
"void __RPC_STUB %s_%s( PRPC_MESSAGE _pRpcMessage )
\n
"
,
iface
->
name
,
get_name
(
def
));
/* write the functions body */
fprintf
(
server
,
"{
\n
"
);
indent
++
;
print_server
(
"struct __frame_%s_%s __f, * const __frame = &__f;
\n
"
,
iface
->
name
,
get_name
(
def
));
if
(
has_out_arg_or_return
(
func
))
print_server
(
"RPC_STATUS _Status;
\n
"
);
fprintf
(
server
,
"
\n
"
);
print_server
(
"((void)(_Status));
\n
"
);
print_server
(
"NdrServerInitializeNew(
\n
"
);
indent
++
;
print_server
(
"_pRpcMessage,
\n
"
);
...
...
@@ -85,13 +102,13 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
print_server
(
"&%s_StubDesc);
\n
"
,
iface
->
name
);
indent
--
;
fprintf
(
server
,
"
\n
"
);
print_server
(
"RpcExceptionInit( __server_filter, __
server_finally );
\n
"
);
print_server
(
"RpcExceptionInit( __server_filter, __
finally_%s_%s );
\n
"
,
iface
->
name
,
get_name
(
def
)
);
write_parameters_init
(
server
,
indent
,
func
,
""
);
write_parameters_init
(
server
,
indent
,
func
,
"
__frame->
"
);
if
(
explicit_handle_var
)
{
print_server
(
"%s = _pRpcMessage->Handle;
\n
"
,
explicit_handle_var
->
name
);
print_server
(
"
__frame->
%s = _pRpcMessage->Handle;
\n
"
,
explicit_handle_var
->
name
);
fprintf
(
server
,
"
\n
"
);
}
...
...
@@ -117,7 +134,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
fprintf
(
server
,
"
\n
"
);
/* unmarshall arguments */
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_IN
,
PHASE_UNMARSHAL
);
write_remoting_arguments
(
server
,
indent
,
func
,
"
__frame->
"
,
PASS_IN
,
PHASE_UNMARSHAL
);
}
print_server
(
"if (__frame->_StubMsg.Buffer > __frame->_StubMsg.BufferEnd)
\n
"
);
...
...
@@ -138,11 +155,11 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
fprintf
(
server
,
"
\n
"
);
/* Assign 'out' arguments */
assign_stub_out_args
(
server
,
indent
,
func
,
""
);
assign_stub_out_args
(
server
,
indent
,
func
,
"
__frame->
"
);
/* Call the real server function */
if
(
!
is_void
(
get_func_return_type
(
func
)))
print_server
(
"_RetVal = "
);
print_server
(
"_
_frame->_
RetVal = "
);
else
print_server
(
""
);
fprintf
(
server
,
"%s%s"
,
prefix_server
,
get_name
(
def
));
...
...
@@ -167,11 +184,12 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
int
is_ch_ptr
=
is_aliaschain_attr
(
var
->
type
,
ATTR_CONTEXTHANDLE
)
?
FALSE
:
TRUE
;
print_server
(
"("
);
write_type_decl_left
(
server
,
var
->
type
);
fprintf
(
server
,
")%sNDRSContextValue(%s)"
,
is_ch_ptr
?
""
:
"*"
,
var
->
name
);
fprintf
(
server
,
")%sNDRSContextValue(__frame->%s)"
,
is_ch_ptr
?
""
:
"*"
,
var
->
name
);
}
else
{
print_server
(
"%s
%s"
,
var
->
type
->
declarray
?
"*"
:
""
,
get_name
(
var
)
);
print_server
(
"%s
__frame->%s"
,
var
->
type
->
declarray
?
"*"
:
""
,
var
->
name
);
}
}
fprintf
(
server
,
");
\n
"
);
...
...
@@ -184,10 +202,10 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
if
(
has_out_arg_or_return
(
func
))
{
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_OUT
,
PHASE_BUFFERSIZE
);
write_remoting_arguments
(
server
,
indent
,
func
,
"
__frame->
"
,
PASS_OUT
,
PHASE_BUFFERSIZE
);
if
(
!
is_void
(
get_func_return_type
(
func
)))
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_RETURN
,
PHASE_BUFFERSIZE
);
write_remoting_arguments
(
server
,
indent
,
func
,
"
__frame->
"
,
PASS_RETURN
,
PHASE_BUFFERSIZE
);
print_server
(
"_pRpcMessage->BufferLength = __frame->_StubMsg.BufferLength;
\n
"
);
fprintf
(
server
,
"
\n
"
);
...
...
@@ -202,23 +220,18 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
}
/* marshall arguments */
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_OUT
,
PHASE_MARSHAL
);
write_remoting_arguments
(
server
,
indent
,
func
,
"
__frame->
"
,
PASS_OUT
,
PHASE_MARSHAL
);
/* marshall the return value */
if
(
!
is_void
(
get_func_return_type
(
func
)))
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_RETURN
,
PHASE_MARSHAL
);
write_remoting_arguments
(
server
,
indent
,
func
,
"
__frame->
"
,
PASS_RETURN
,
PHASE_MARSHAL
);
indent
--
;
print_server
(
"}
\n
"
);
print_server
(
"RpcFinally
\n
"
);
print_server
(
"{
\n
"
);
indent
++
;
write_remoting_arguments
(
server
,
indent
,
func
,
""
,
PASS_OUT
,
PHASE_FREE
);
if
(
has_full_pointer
)
write_full_pointer_free
(
server
,
indent
,
func
);
print_server
(
"__finally_%s_%s( __frame );
\n
"
,
iface
->
name
,
get_name
(
def
));
indent
--
;
print_server
(
"}
\n
"
);
print_server
(
"RpcEndFinally
\n
"
);
...
...
@@ -384,10 +397,6 @@ static void init_server(void)
print_server
(
" return RPC_BAD_STUB_DATA_EXCEPTION_FILTER;
\n
"
);
print_server
(
"}
\n
"
);
print_server
(
"
\n
"
);
print_server
(
"static void __server_finally( struct __server_frame *__frame )
\n
"
);
print_server
(
"{
\n
"
);
print_server
(
"}
\n
"
);
print_server
(
"
\n
"
);
}
...
...
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