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
12159aec
Commit
12159aec
authored
Dec 12, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Support explicit binding handles.
parent
759e3c9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
2 deletions
+98
-2
client.c
tools/widl/client.c
+28
-2
header.c
tools/widl/header.c
+41
-0
header.h
tools/widl/header.h
+1
-0
server.c
tools/widl/server.c
+28
-0
No files found.
tools/widl/client.c
View file @
12159aec
...
...
@@ -124,6 +124,7 @@ static void write_function_stubs(type_t *iface)
{
func_t
*
func
=
iface
->
funcs
;
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
int
explicit_handle
=
is_attr
(
iface
->
attrs
,
ATTR_EXPLICIT_HANDLE
);
var_t
*
var
;
int
method_count
=
0
;
unsigned
int
proc_offset
=
0
;
...
...
@@ -132,6 +133,26 @@ static void write_function_stubs(type_t *iface)
while
(
func
)
{
var_t
*
def
=
func
->
def
;
var_t
*
explicit_handle_var
;
/* check for a defined binding handle */
explicit_handle_var
=
get_explicit_handle_var
(
func
);
if
(
explicit_handle
)
{
if
(
!
explicit_handle_var
)
{
error
(
"%s() does not define an explicit binding handle!
\n
"
,
def
->
name
);
return
;
}
}
else
if
(
implicit_handle
)
{
if
(
explicit_handle_var
)
{
error
(
"%s() must not define a binding handle!
\n
"
,
def
->
name
);
return
;
}
}
write_type
(
client
,
def
->
type
,
def
,
def
->
tname
);
fprintf
(
client
,
" "
);
...
...
@@ -157,7 +178,7 @@ static void write_function_stubs(type_t *iface)
fprintf
(
client
,
" _RetVal;
\n
"
);
}
if
(
implicit_handle
)
if
(
implicit_handle
||
explicit_handle_var
)
print_client
(
"RPC_BINDING_HANDLE _Handle = 0;
\n
"
);
print_client
(
"RPC_MESSAGE _RpcMessage;
\n
"
);
...
...
@@ -181,6 +202,11 @@ static void write_function_stubs(type_t *iface)
print_client
(
"_Handle = %s;
\n
"
,
implicit_handle
);
fprintf
(
client
,
"
\n
"
);
}
else
if
(
explicit_handle_var
)
{
print_client
(
"_Handle = %s;
\n
"
,
explicit_handle_var
->
name
);
fprintf
(
client
,
"
\n
"
);
}
/* emit the message buffer size */
print_client
(
"_StubMsg.BufferLength ="
);
...
...
@@ -191,7 +217,7 @@ static void write_function_stubs(type_t *iface)
indent
++
;
print_client
(
"(PMIDL_STUB_MESSAGE)&_StubMsg,
\n
"
);
print_client
(
"_StubMsg.BufferLength,
\n
"
);
if
(
implicit_handle
)
if
(
implicit_handle
||
explicit_handle_var
)
print_client
(
"_Handle);
\n
"
);
else
print_client
(
"%s__MIDL_AutoBindHandle);
\n
"
,
iface
->
name
);
...
...
tools/widl/header.c
View file @
12159aec
...
...
@@ -502,6 +502,28 @@ void write_library(const char *name, attr_t *attr) {
fprintf
(
header
,
"
\n
"
);
}
var_t
*
get_explicit_handle_var
(
func_t
*
func
)
{
var_t
*
var
;
if
(
!
func
->
args
)
return
NULL
;
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
if
(
var
->
type
->
type
==
RPC_FC_IGNORE
)
return
var
;
var
=
PREV_LINK
(
var
);
}
return
NULL
;
}
/********** INTERFACES **********/
int
is_object
(
attr_t
*
a
)
...
...
@@ -739,10 +761,29 @@ static void write_method_proto(type_t *iface)
static
void
write_function_proto
(
type_t
*
iface
)
{
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
int
explicit_handle
=
is_attr
(
iface
->
attrs
,
ATTR_EXPLICIT_HANDLE
);
var_t
*
explicit_handle_var
;
func_t
*
cur
=
iface
->
funcs
;
while
(
NEXT_LINK
(
cur
))
cur
=
NEXT_LINK
(
cur
);
while
(
cur
)
{
var_t
*
def
=
cur
->
def
;
/* check for a defined binding handle */
explicit_handle_var
=
get_explicit_handle_var
(
cur
);
if
(
explicit_handle
)
{
if
(
!
explicit_handle_var
)
{
error
(
"%s() does not define an explicit binding handle!
\n
"
,
def
->
name
);
return
;
}
}
else
if
(
implicit_handle
)
{
if
(
explicit_handle_var
)
{
error
(
"%s() must not define a binding handle!
\n
"
,
def
->
name
);
return
;
}
}
/* FIXME: do we need to handle call_as? */
write_type
(
header
,
def
->
type
,
def
,
def
->
tname
);
fprintf
(
header
,
" "
);
...
...
tools/widl/header.h
View file @
12159aec
...
...
@@ -42,5 +42,6 @@ extern void write_constdef(var_t *v);
extern
void
write_externdef
(
var_t
*
v
);
extern
void
write_library
(
const
char
*
name
,
attr_t
*
attr
);
extern
void
write_user_types
(
void
);
extern
var_t
*
get_explicit_handle_var
(
func_t
*
func
);
#endif
tools/widl/server.c
View file @
12159aec
...
...
@@ -89,8 +89,11 @@ static void write_parameters_init(func_t *func)
static
void
write_function_stubs
(
type_t
*
iface
)
{
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
int
explicit_handle
=
is_attr
(
iface
->
attrs
,
ATTR_EXPLICIT_HANDLE
);
func_t
*
func
=
iface
->
funcs
;
var_t
*
var
;
var_t
*
explicit_handle_var
;
unsigned
int
proc_offset
=
0
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
...
...
@@ -98,6 +101,25 @@ static void write_function_stubs(type_t *iface)
{
var_t
*
def
=
func
->
def
;
/* check for a defined binding handle */
explicit_handle_var
=
get_explicit_handle_var
(
func
);
if
(
explicit_handle
)
{
if
(
!
explicit_handle_var
)
{
error
(
"%s() does not define an explicit binding handle!
\n
"
,
def
->
name
);
return
;
}
}
else
if
(
implicit_handle
)
{
if
(
explicit_handle_var
)
{
error
(
"%s() must not define a binding handle!
\n
"
,
def
->
name
);
return
;
}
}
write_type
(
server
,
def
->
type
,
def
,
def
->
tname
);
fprintf
(
server
,
" __RPC_STUB
\n
"
);
fprintf
(
server
,
"%s_"
,
iface
->
name
);
...
...
@@ -152,6 +174,12 @@ static void write_function_stubs(type_t *iface)
write_parameters_init
(
func
);
if
(
explicit_handle_var
)
{
print_server
(
"%s = _pRpcMessage->Handle;
\n
"
,
explicit_handle_var
->
name
);
fprintf
(
server
,
"
\n
"
);
}
print_server
(
"RpcTryFinally
\n
"
);
print_server
(
"{
\n
"
);
indent
++
;
...
...
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