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
21cbdaa1
Commit
21cbdaa1
authored
May 31, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Support using custom handle types with the implicit_handle attribute.
parent
4fc0d3c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
10 deletions
+26
-10
client.c
tools/widl/client.c
+7
-7
header.c
tools/widl/header.c
+7
-2
parser.y
tools/widl/parser.y
+12
-1
No files found.
tools/widl/client.c
View file @
21cbdaa1
...
@@ -75,7 +75,7 @@ static void check_pointers(const var_t *func)
...
@@ -75,7 +75,7 @@ static void check_pointers(const var_t *func)
static
void
write_function_stubs
(
type_t
*
iface
,
unsigned
int
*
proc_offset
)
static
void
write_function_stubs
(
type_t
*
iface
,
unsigned
int
*
proc_offset
)
{
{
const
statement_t
*
stmt
;
const
statement_t
*
stmt
;
const
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
const
var_t
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
int
method_count
=
0
;
int
method_count
=
0
;
if
(
!
implicit_handle
)
if
(
!
implicit_handle
)
...
@@ -245,7 +245,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
...
@@ -245,7 +245,7 @@ static void write_function_stubs(type_t *iface, unsigned int *proc_offset)
}
}
else
if
(
implicit_handle
)
else
if
(
implicit_handle
)
{
{
print_client
(
"__frame->_Handle = %s;
\n
"
,
implicit_handle
);
print_client
(
"__frame->_Handle = %s;
\n
"
,
implicit_handle
->
name
);
fprintf
(
client
,
"
\n
"
);
fprintf
(
client
,
"
\n
"
);
}
}
...
@@ -334,7 +334,7 @@ static void write_stubdescdecl(type_t *iface)
...
@@ -334,7 +334,7 @@ static void write_stubdescdecl(type_t *iface)
static
void
write_stubdescriptor
(
type_t
*
iface
,
int
expr_eval_routines
)
static
void
write_stubdescriptor
(
type_t
*
iface
,
int
expr_eval_routines
)
{
{
const
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
const
var_t
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
print_client
(
"static const MIDL_STUB_DESC %s_StubDesc =
\n
"
,
iface
->
name
);
print_client
(
"static const MIDL_STUB_DESC %s_StubDesc =
\n
"
,
iface
->
name
);
print_client
(
"{
\n
"
);
print_client
(
"{
\n
"
);
...
@@ -345,7 +345,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
...
@@ -345,7 +345,7 @@ static void write_stubdescriptor(type_t *iface, int expr_eval_routines)
print_client
(
"{
\n
"
);
print_client
(
"{
\n
"
);
indent
++
;
indent
++
;
if
(
implicit_handle
)
if
(
implicit_handle
)
print_client
(
"&%s,
\n
"
,
implicit_handle
);
print_client
(
"&%s,
\n
"
,
implicit_handle
->
name
);
else
else
print_client
(
"&%s__MIDL_AutoBindHandle,
\n
"
,
iface
->
name
);
print_client
(
"&%s__MIDL_AutoBindHandle,
\n
"
,
iface
->
name
);
indent
--
;
indent
--
;
...
@@ -423,12 +423,12 @@ static void write_clientinterfacedecl(type_t *iface)
...
@@ -423,12 +423,12 @@ static void write_clientinterfacedecl(type_t *iface)
static
void
write_implicithandledecl
(
type_t
*
iface
)
static
void
write_implicithandledecl
(
type_t
*
iface
)
{
{
const
char
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
const
var_t
*
implicit_handle
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
if
(
implicit_handle
)
if
(
implicit_handle
)
{
{
fprintf
(
client
,
"handle_t %s;
\n
"
,
implicit_handle
);
write_type_decl
(
client
,
implicit_handle
->
type
,
implicit_handle
->
name
);
fprintf
(
client
,
"
\n
"
);
fprintf
(
client
,
"
;
\n
\n
"
);
}
}
}
}
...
...
tools/widl/header.c
View file @
21cbdaa1
...
@@ -1078,14 +1078,19 @@ static void write_com_interface_end(FILE *header, type_t *iface)
...
@@ -1078,14 +1078,19 @@ static void write_com_interface_end(FILE *header, type_t *iface)
static
void
write_rpc_interface_start
(
FILE
*
header
,
const
type_t
*
iface
)
static
void
write_rpc_interface_start
(
FILE
*
header
,
const
type_t
*
iface
)
{
{
unsigned
int
ver
=
get_attrv
(
iface
->
attrs
,
ATTR_VERSION
);
unsigned
int
ver
=
get_attrv
(
iface
->
attrs
,
ATTR_VERSION
);
const
char
*
var
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
const
var_t
*
var
=
get_attrp
(
iface
->
attrs
,
ATTR_IMPLICIT_HANDLE
);
fprintf
(
header
,
"/*****************************************************************************
\n
"
);
fprintf
(
header
,
"/*****************************************************************************
\n
"
);
fprintf
(
header
,
" * %s interface (v%d.%d)
\n
"
,
iface
->
name
,
MAJORVERSION
(
ver
),
MINORVERSION
(
ver
));
fprintf
(
header
,
" * %s interface (v%d.%d)
\n
"
,
iface
->
name
,
MAJORVERSION
(
ver
),
MINORVERSION
(
ver
));
fprintf
(
header
,
" */
\n
"
);
fprintf
(
header
,
" */
\n
"
);
fprintf
(
header
,
"#ifndef __%s_INTERFACE_DEFINED__
\n
"
,
iface
->
name
);
fprintf
(
header
,
"#ifndef __%s_INTERFACE_DEFINED__
\n
"
,
iface
->
name
);
fprintf
(
header
,
"#define __%s_INTERFACE_DEFINED__
\n\n
"
,
iface
->
name
);
fprintf
(
header
,
"#define __%s_INTERFACE_DEFINED__
\n\n
"
,
iface
->
name
);
if
(
var
)
fprintf
(
header
,
"extern handle_t %s;
\n
"
,
var
);
if
(
var
)
{
fprintf
(
header
,
"extern "
);
write_type_decl
(
header
,
var
->
type
,
var
->
name
);
fprintf
(
header
,
";
\n
"
);
}
if
(
old_names
)
if
(
old_names
)
{
{
fprintf
(
header
,
"extern RPC_IF_HANDLE %s%s_ClientIfHandle;
\n
"
,
prefix_client
,
iface
->
name
);
fprintf
(
header
,
"extern RPC_IF_HANDLE %s%s_ClientIfHandle;
\n
"
,
prefix_client
,
iface
->
name
);
...
...
tools/widl/parser.y
View file @
21cbdaa1
...
@@ -522,7 +522,7 @@ attribute: { $$ = NULL; }
...
@@ -522,7 +522,7 @@ attribute: { $$ = NULL; }
| tIGNORE { $$ = make_attr(ATTR_IGNORE); }
| tIGNORE { $$ = make_attr(ATTR_IGNORE); }
| tIIDIS '(' expr ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIIDIS '(' expr ')' { $$ = make_attrp(ATTR_IIDIS, $3); }
| tIMMEDIATEBIND { $$ = make_attr(ATTR_IMMEDIATEBIND); }
| tIMMEDIATEBIND { $$ = make_attr(ATTR_IMMEDIATEBIND); }
| tIMPLICITHANDLE '('
tHANDLET aIDENTIFIER ')' { $$ = make_attrp(ATTR_IMPLICIT_HANDLE, $4
); }
| tIMPLICITHANDLE '('
arg ')' { $$ = make_attrp(ATTR_IMPLICIT_HANDLE, $3
); }
| tIN { $$ = make_attr(ATTR_IN); }
| tIN { $$ = make_attr(ATTR_IN); }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tINPUTSYNC { $$ = make_attr(ATTR_INPUTSYNC); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
| tLENGTHIS '(' m_exprs ')' { $$ = make_attrp(ATTR_LENGTHIS, $3); }
...
@@ -2124,6 +2124,17 @@ static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs)
...
@@ -2124,6 +2124,17 @@ static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs)
if (!allowed_attr[attr->type].on_interface)
if (!allowed_attr[attr->type].on_interface)
error_loc("inapplicable attribute %s for interface %s\n",
error_loc("inapplicable attribute %s for interface %s\n",
allowed_attr[attr->type].display_name, name);
allowed_attr[attr->type].display_name, name);
if (attr->type == ATTR_IMPLICIT_HANDLE)
{
const var_t *var = attr->u.pval;
if (type_get_type( var->type) == TYPE_BASIC &&
type_basic_get_type( var->type ) == TYPE_BASIC_HANDLE)
continue;
if (is_aliaschain_attr( var->type, ATTR_HANDLE ))
continue;
error_loc("attribute %s requires a handle type in interface %s\n",
allowed_attr[attr->type].display_name, name);
}
}
}
return attrs;
return attrs;
}
}
...
...
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