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
86c3a2e7
Commit
86c3a2e7
authored
Dec 26, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Fix SEGVs with client and server code generation when an
interface has no methods.
parent
73a25d31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
81 deletions
+92
-81
client.c
tools/widl/client.c
+29
-25
server.c
tools/widl/server.c
+28
-24
typegen.c
tools/widl/typegen.c
+35
-32
No files found.
tools/widl/client.c
View file @
86c3a2e7
...
...
@@ -403,32 +403,33 @@ static void write_formatdesc( const char *str )
static
void
write_formatstringsdecl
(
type_t
*
iface
)
{
func_t
*
func
;
var_t
*
var
;
int
byte_count
=
1
;
print_client
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
3
);
/* FIXME */
/* determine the proc format string size */
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
if
(
iface
->
funcs
)
{
/* argument list size */
if
(
func
->
args
)
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
/* argument list size */
if
(
func
->
args
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
var_t
*
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
}
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
print_client
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
byte_count
);
...
...
@@ -492,15 +493,18 @@ void write_client(ifref_t *ifaces)
fprintf
(
client
,
" */
\n
"
);
fprintf
(
client
,
"
\n
"
);
write_formatstringsdecl
(
iface
->
iface
);
write_implicithandledecl
(
iface
->
iface
);
write_clientinterfacedecl
(
iface
->
iface
);
write_stubdescdecl
(
iface
->
iface
);
write_bindinghandledecl
(
iface
->
iface
);
write_function_stubs
(
iface
->
iface
);
write_stubdescriptor
(
iface
->
iface
);
if
(
iface
->
iface
->
funcs
)
{
write_formatstringsdecl
(
iface
->
iface
);
write_implicithandledecl
(
iface
->
iface
);
write_clientinterfacedecl
(
iface
->
iface
);
write_stubdescdecl
(
iface
->
iface
);
write_bindinghandledecl
(
iface
->
iface
);
write_function_stubs
(
iface
->
iface
);
write_stubdescriptor
(
iface
->
iface
);
}
print_client
(
"#if !defined(__RPC_WIN32__)
\n
"
);
print_client
(
"#error Invalid build platform for this stub.
\n
"
);
...
...
tools/widl/server.c
View file @
86c3a2e7
...
...
@@ -428,32 +428,33 @@ static void write_formatdesc( const char *str )
static
void
write_formatstringsdecl
(
type_t
*
iface
)
{
func_t
*
func
;
var_t
*
var
;
int
byte_count
=
1
;
print_server
(
"#define TYPE_FORMAT_STRING_SIZE %d
\n
"
,
3
);
/* FIXME */
/* determine the proc format string size */
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
if
(
iface
->
funcs
)
{
/* argument list size */
if
(
func
->
args
)
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
/* argument list size */
if
(
func
->
args
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
var_t
*
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
byte_count
+=
2
;
/* FIXME: determine real size */
var
=
PREV_LINK
(
var
);
}
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
/* return value size */
byte_count
+=
2
;
/* FIXME: determine real size */
func
=
PREV_LINK
(
func
);
}
print_server
(
"#define PROC_FORMAT_STRING_SIZE %d
\n
"
,
byte_count
);
...
...
@@ -503,14 +504,17 @@ void write_server(ifref_t *ifaces)
fprintf
(
server
,
" */
\n
"
);
fprintf
(
server
,
"
\n
"
);
write_formatstringsdecl
(
iface
->
iface
);
write_serverinterfacedecl
(
iface
->
iface
);
write_stubdescdecl
(
iface
->
iface
);
write_function_stubs
(
iface
->
iface
);
write_stubdescriptor
(
iface
->
iface
);
write_dispatchtable
(
iface
->
iface
);
if
(
iface
->
iface
->
funcs
)
{
write_formatstringsdecl
(
iface
->
iface
);
write_serverinterfacedecl
(
iface
->
iface
);
write_stubdescdecl
(
iface
->
iface
);
write_function_stubs
(
iface
->
iface
);
write_stubdescriptor
(
iface
->
iface
);
write_dispatchtable
(
iface
->
iface
);
}
print_server
(
"#if !defined(__RPC_WIN32__)
\n
"
);
print_server
(
"#error Invalid build platform for this stub.
\n
"
);
...
...
tools/widl/typegen.c
View file @
86c3a2e7
...
...
@@ -119,7 +119,6 @@ static size_t write_procformatstring_var(FILE *file, int indent, var_t *var, int
void
write_procformatstring
(
FILE
*
file
,
type_t
*
iface
)
{
int
indent
=
0
;
func_t
*
func
=
iface
->
funcs
;
var_t
*
var
;
unsigned
int
type_offset
=
2
;
...
...
@@ -130,32 +129,34 @@ void write_procformatstring(FILE *file, type_t *iface)
print_file
(
file
,
indent
,
"{
\n
"
);
indent
++
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
if
(
iface
->
funcs
)
{
/* emit argument data */
if
(
func
->
args
)
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
for
(;
func
;
func
=
PREV_LINK
(
func
))
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
/* emit argument data */
if
(
func
->
args
)
{
write_procformatstring_var
(
file
,
indent
,
var
,
FALSE
,
&
type_offset
);
var
=
PREV_LINK
(
var
);
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
write_procformatstring_var
(
file
,
indent
,
var
,
FALSE
,
&
type_offset
);
var
=
PREV_LINK
(
var
);
}
}
/* emit return value data */
var
=
func
->
def
;
if
(
is_void
(
var
->
type
,
NULL
))
{
print_file
(
file
,
indent
,
"0x5b, /* FC_END */
\n
"
);
print_file
(
file
,
indent
,
"0x5c, /* FC_PAD */
\n
"
);
}
else
write_procformatstring_var
(
file
,
indent
,
var
,
TRUE
,
&
type_offset
);
}
/* emit return value data */
var
=
func
->
def
;
if
(
is_void
(
var
->
type
,
NULL
))
{
print_file
(
file
,
indent
,
"0x5b, /* FC_END */
\n
"
);
print_file
(
file
,
indent
,
"0x5c, /* FC_PAD */
\n
"
);
}
else
write_procformatstring_var
(
file
,
indent
,
var
,
TRUE
,
&
type_offset
);
func
=
PREV_LINK
(
func
);
}
print_file
(
file
,
indent
,
"0x0
\n
"
);
...
...
@@ -214,7 +215,6 @@ static size_t write_typeformatstring_var(FILE *file, int indent, var_t *var)
void
write_typeformatstring
(
FILE
*
file
,
type_t
*
iface
)
{
int
indent
=
0
;
func_t
*
func
=
iface
->
funcs
;
var_t
*
var
;
print_file
(
file
,
indent
,
"static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
\n
"
);
...
...
@@ -225,20 +225,23 @@ void write_typeformatstring(FILE *file, type_t *iface)
indent
++
;
print_file
(
file
,
indent
,
"NdrFcShort(0x0),
\n
"
);
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
if
(
iface
->
funcs
)
{
if
(
func
->
args
)
func_t
*
func
=
iface
->
funcs
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
for
(;
func
;
func
=
PREV_LINK
(
func
))
{
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
if
(
func
->
args
)
{
write_typeformatstring_var
(
file
,
indent
,
var
);
var
=
PREV_LINK
(
var
);
var
=
func
->
args
;
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
write_typeformatstring_var
(
file
,
indent
,
var
);
var
=
PREV_LINK
(
var
);
}
}
}
func
=
PREV_LINK
(
func
);
}
print_file
(
file
,
indent
,
"0x0
\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