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
e644c2cd
Commit
e644c2cd
authored
Jun 03, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add support for generating old-style interpreted stubs for servers.
parent
9c4d01f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
+23
-8
server.c
tools/widl/server.c
+23
-8
No files found.
tools/widl/server.c
View file @
e644c2cd
...
@@ -49,18 +49,15 @@ static void print_server(const char *format, ...)
...
@@ -49,18 +49,15 @@ static void print_server(const char *format, ...)
va_end
(
va
);
va_end
(
va
);
}
}
static
void
write_function_stub
s
(
type_t
*
iface
,
unsigned
int
*
proc_offset
)
static
void
write_function_stub
(
const
type_t
*
iface
,
const
var_t
*
func
,
unsigned
int
proc_offset
)
{
{
const
statement_t
*
stmt
;
const
var_t
*
var
;
const
var_t
*
var
;
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
)
)
{
unsigned
char
explicit_fc
,
implicit_fc
;
unsigned
char
explicit_fc
,
implicit_fc
;
var_t
*
func
=
stmt
->
u
.
var
;
int
has_full_pointer
=
is_full_pointer_function
(
func
);
int
has_full_pointer
=
is_full_pointer_function
(
func
);
const
var_t
*
handle_var
=
get_func_handle_var
(
iface
,
func
,
&
explicit_fc
,
&
implicit_fc
);
const
var_t
*
handle_var
=
get_func_handle_var
(
iface
,
func
,
&
explicit_fc
,
&
implicit_fc
);
if
(
is_interpreted_func
(
iface
,
func
))
return
;
print_server
(
"struct __frame_%s_%s
\n
{
\n
"
,
iface
->
name
,
get_name
(
func
));
print_server
(
"struct __frame_%s_%s
\n
{
\n
"
,
iface
->
name
,
get_name
(
func
));
indent
++
;
indent
++
;
print_server
(
"__DECL_EXCEPTION_FRAME
\n
"
);
print_server
(
"__DECL_EXCEPTION_FRAME
\n
"
);
...
@@ -128,7 +125,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
...
@@ -128,7 +125,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
print_server
(
"if ((_pRpcMessage->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
\n
"
);
print_server
(
"if ((_pRpcMessage->DataRepresentation & 0x0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION)
\n
"
);
indent
++
;
indent
++
;
print_server
(
"NdrConvert(&__frame->_StubMsg, (PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);
\n
"
,
print_server
(
"NdrConvert(&__frame->_StubMsg, (PFORMAT_STRING)&__MIDL_ProcFormatString.Format[%u]);
\n
"
,
*
proc_offset
);
proc_offset
);
indent
--
;
indent
--
;
fprintf
(
server
,
"
\n
"
);
fprintf
(
server
,
"
\n
"
);
...
@@ -239,6 +236,18 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
...
@@ -239,6 +236,18 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
indent
--
;
indent
--
;
fprintf
(
server
,
"}
\n
"
);
fprintf
(
server
,
"}
\n
"
);
fprintf
(
server
,
"
\n
"
);
fprintf
(
server
,
"
\n
"
);
}
static
void
write_function_stubs
(
type_t
*
iface
,
unsigned
int
*
proc_offset
)
{
const
statement_t
*
stmt
;
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
)
)
{
var_t
*
func
=
stmt
->
u
.
var
;
write_function_stub
(
iface
,
func
,
*
proc_offset
);
/* update proc_offset */
/* update proc_offset */
func
->
procstring_offset
=
*
proc_offset
;
func
->
procstring_offset
=
*
proc_offset
;
...
@@ -260,6 +269,9 @@ static void write_dispatchtable(type_t *iface)
...
@@ -260,6 +269,9 @@ static void write_dispatchtable(type_t *iface)
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
)
)
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
)
)
{
{
var_t
*
func
=
stmt
->
u
.
var
;
var_t
*
func
=
stmt
->
u
.
var
;
if
(
is_interpreted_func
(
iface
,
func
))
print_server
(
"NdrServerCall,
\n
"
);
else
print_server
(
"%s_%s,
\n
"
,
iface
->
name
,
get_name
(
func
));
print_server
(
"%s_%s,
\n
"
,
iface
->
name
,
get_name
(
func
));
method_count
++
;
method_count
++
;
}
}
...
@@ -288,7 +300,7 @@ static void write_routinetable(type_t *iface)
...
@@ -288,7 +300,7 @@ static void write_routinetable(type_t *iface)
{
{
var_t
*
func
=
stmt
->
u
.
var
;
var_t
*
func
=
stmt
->
u
.
var
;
if
(
is_local
(
func
->
attrs
))
continue
;
if
(
is_local
(
func
->
attrs
))
continue
;
print_server
(
"(SERVER_ROUTINE)%s
,
\n
"
,
func
->
name
);
print_server
(
"(SERVER_ROUTINE)%s
%s,
\n
"
,
prefix_server
,
get_name
(
func
)
);
}
}
indent
--
;
indent
--
;
print_server
(
"};
\n\n
"
);
print_server
(
"};
\n\n
"
);
...
@@ -468,6 +480,8 @@ static void write_server_routines(const statement_list_t *stmts)
...
@@ -468,6 +480,8 @@ static void write_server_routines(const statement_list_t *stmts)
unsigned
int
proc_offset
=
0
;
unsigned
int
proc_offset
=
0
;
int
expr_eval_routines
;
int
expr_eval_routines
;
if
(
need_inline_stubs_file
(
stmts
))
{
write_exceptions
(
server
);
write_exceptions
(
server
);
print_server
(
"
\n
"
);
print_server
(
"
\n
"
);
print_server
(
"struct __server_frame
\n
"
);
print_server
(
"struct __server_frame
\n
"
);
...
@@ -484,6 +498,7 @@ static void write_server_routines(const statement_list_t *stmts)
...
@@ -484,6 +498,7 @@ static void write_server_routines(const statement_list_t *stmts)
print_server
(
" (__frame->code == RPC_S_INVALID_BOUND);
\n
"
);
print_server
(
" (__frame->code == RPC_S_INVALID_BOUND);
\n
"
);
print_server
(
"}
\n
"
);
print_server
(
"}
\n
"
);
print_server
(
"
\n
"
);
print_server
(
"
\n
"
);
}
write_formatstringsdecl
(
server
,
indent
,
stmts
,
need_stub
);
write_formatstringsdecl
(
server
,
indent
,
stmts
,
need_stub
);
expr_eval_routines
=
write_expr_eval_routines
(
server
,
server_token
);
expr_eval_routines
=
write_expr_eval_routines
(
server
,
server_token
);
...
...
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