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
41373881
Commit
41373881
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: Add support for marshalling and unmarshalling conformant strings.
parent
7f2419ce
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
10 deletions
+64
-10
client.c
tools/widl/client.c
+2
-1
server.c
tools/widl/server.c
+2
-1
typegen.c
tools/widl/typegen.c
+58
-6
typegen.h
tools/widl/typegen.h
+2
-2
No files found.
tools/widl/client.c
View file @
41373881
...
...
@@ -128,6 +128,7 @@ static void write_function_stubs(type_t *iface)
var_t
*
var
;
int
method_count
=
0
;
unsigned
int
proc_offset
=
0
;
unsigned
int
type_offset
=
2
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
...
...
@@ -226,7 +227,7 @@ static void write_function_stubs(type_t *iface)
/* marshal arguments */
marshall_arguments
(
client
,
indent
,
func
);
marshall_arguments
(
client
,
indent
,
func
,
&
type_offset
);
/* send/receive message */
/* print_client("NdrNsSendReceive(\n"); */
...
...
tools/widl/server.c
View file @
41373881
...
...
@@ -95,6 +95,7 @@ static void write_function_stubs(type_t *iface)
var_t
*
var
;
var_t
*
explicit_handle_var
;
unsigned
int
proc_offset
=
0
;
unsigned
int
type_offset
=
2
;
while
(
NEXT_LINK
(
func
))
func
=
NEXT_LINK
(
func
);
while
(
func
)
...
...
@@ -197,7 +198,7 @@ static void write_function_stubs(type_t *iface)
indent
-=
2
;
fprintf
(
server
,
"
\n
"
);
unmarshall_arguments
(
server
,
indent
,
func
);
unmarshall_arguments
(
server
,
indent
,
func
,
&
type_offset
);
}
print_server
(
"if (_StubMsg.Buffer > _StubMsg.BufferEnd)
\n
"
);
...
...
tools/widl/typegen.c
View file @
41373881
...
...
@@ -281,7 +281,7 @@ unsigned int get_required_buffer_size(type_t *type)
}
}
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
)
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
,
unsigned
int
*
type_offset
)
{
unsigned
int
last_size
=
0
;
var_t
*
var
;
...
...
@@ -332,8 +332,8 @@ void marshall_arguments(FILE *file, int indent, func_t *func)
break
;
default:
error
(
"marshall_arguments: Unsupported type: %s (0x%02x, ptr_level: 0)
\n
"
,
var
->
name
,
var
->
type
->
type
);
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
if
(
alignment
!=
0
)
...
...
@@ -351,17 +351,43 @@ void marshall_arguments(FILE *file, int indent, func_t *func)
last_size
=
size
;
}
else
if
(
var
->
ptr_level
==
1
)
{
if
(
is_attr
(
var
->
attrs
,
ATTR_STRING
))
{
switch
(
var
->
type
->
type
)
{
case
RPC_FC_CHAR
:
case
RPC_FC_WCHAR
:
print_file
(
file
,
indent
,
"NdrConformantStringMarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d]);
\n
"
,
var
->
name
,
*
type_offset
);
break
;
default:
error
(
"marshall_arguments: Unsupported [string] type: %s (0x%02x, ptr_level: 1)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
}
else
{
switch
(
var
->
type
->
type
)
{
default:
error
(
"marshall_arguments: Unsupported type: %s (0x%02x, ptr_level: 1)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
}
last_size
=
1
;
}
else
{
error
(
"marshall_arguments: Pointer level %d not supported for variable %s
\n
"
,
var
->
ptr_level
,
var
->
name
);
last_size
=
0
;
last_size
=
1
;
}
var
=
PREV_LINK
(
var
);
}
}
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
)
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
,
unsigned
int
*
type_offset
)
{
unsigned
int
last_size
=
0
;
var_t
*
var
;
...
...
@@ -413,8 +439,8 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func)
break
;
default:
error
(
"unmarshall_arguments: Unsupported type: %s (0x%02x, ptr_level: 0)
\n
"
,
var
->
name
,
var
->
type
->
type
);
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
if
(
alignment
!=
0
)
...
...
@@ -432,10 +458,36 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func)
last_size
=
size
;
}
else
if
(
var
->
ptr_level
==
1
)
{
if
(
is_attr
(
var
->
attrs
,
ATTR_STRING
))
{
switch
(
var
->
type
->
type
)
{
case
RPC_FC_CHAR
:
case
RPC_FC_WCHAR
:
print_file
(
file
,
indent
,
"NdrConformantStringUnmarshall(&_StubMsg, (unsigned char *)%s, &__MIDL_TypeFormatString.Format[%d], 0);
\n
"
,
var
->
name
,
*
type_offset
);
break
;
default:
error
(
"unmarshall_arguments: Unsupported [string] type: %s (0x%02x, ptr_level: 1)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
}
else
{
switch
(
var
->
type
->
type
)
{
default:
error
(
"unmarshall_arguments: Unsupported type: %s (0x%02x, ptr_level: 1)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
}
last_size
=
1
;
}
else
{
error
(
"unmarshall_arguments: Pointer level %d not supported for variable %s
\n
"
,
var
->
ptr_level
,
var
->
name
);
last_size
=
0
;
last_size
=
1
;
}
var
=
PREV_LINK
(
var
);
...
...
tools/widl/typegen.h
View file @
41373881
...
...
@@ -23,7 +23,7 @@
void
write_procformatstring
(
FILE
*
file
,
type_t
*
iface
);
void
write_typeformatstring
(
FILE
*
file
,
type_t
*
iface
);
unsigned
int
get_required_buffer_size
(
type_t
*
type
);
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
,
unsigned
int
*
type_offset
);
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
,
unsigned
int
*
type_offset
);
size_t
get_size_procformatstring_var
(
var_t
*
var
);
size_t
get_size_typeformatstring_var
(
var_t
*
var
);
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