Rob Shearman
1a0d28bf02
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
2008-04-22 13:05:18 +02:00
Rob Shearman
39a1fa672a
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc.
...
Remove the conversion of pointer types into base types as this was only
needed due to lack of proper type resolving.
2008-04-22 13:05:04 +02:00
Rob Shearman
80ab2a7c6d
widl: Move expression functions to a new file, expr.c.
2008-04-22 13:04:58 +02:00
Rob Shearman
95ac84e20b
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
2008-04-22 13:04:19 +02:00
Rob Shearman
cc3682cf12
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
2008-04-22 13:04:03 +02:00
Rob Shearman
ea9932557a
widl: Add support for '%' operator in expressions.
2008-04-21 13:36:19 +02:00
Rob Shearman
d27c7601e5
widl: Add support for arrays in expressions.
2008-04-21 13:36:19 +02:00
Rob Shearman
03d5017416
widl: Add support for "->" and "." operators in expressions.
2008-04-21 13:36:19 +02:00
Rob Shearman
6a0c5a4fe9
widl: Store function and function pointer types completely within type_t type.
2008-04-02 19:53:09 +02:00
Rob Shearman
a04b150839
widl: Add a function to get the return type of a parsed function.
...
This clarifies its use in code and makes it simpler to change the way
functions are parsed into types.
2008-04-02 19:52:49 +02:00
Rob Shearman
f8ea9ec163
widl: Make sure that string types are always written out by write_string_tfs and not write_simple_pointer.
...
This is because write_string_tfs has support for the full range of
string types, write_simple_pointer doesn't have access to the var
attributes which are needed to properly detect strings, and
write_string_tfs sets the typestring offset to after the pointer is
written and write_remoting_arg depends on this.
2008-03-27 17:33:09 +01:00
Rob Shearman
f4a9619364
widl: Fix detection of non-pointer context handles.
...
is_ptr cannot be used because it follows the chain of types into the
type which has the context_handle attribute, which is typically "void *"
and so causes these context handles to be incorrectly detected as
context handles. Instead, we can use is_aliaschain_ptr to follow the
chain of aliases without following pointers and the absence of the
context_handle attribute indicates that it must be present on a type
after following a pointer.
2008-03-27 17:33:06 +01:00
Rob Shearman
8a0cb2b5c5
widl: Use is_string_type for detecting strings in write_typeformatstring_var to make it consistent with write_remoting_arg.
...
Fix the is_string_type function used for detecting strings by only
examining aliases instead of both aliases and pointers. This is due to
the requirement that pointers to strings be handled as pointers and so
not detected as strings.
2008-03-27 17:32:58 +01:00
Dan Hipschman
2d7b1f18b1
widl: Allow is_string_type to work for typedef'd types.
2008-02-22 12:04:26 +01:00
Rob Shearman
c233ba105e
widl: Remove unused headers.
2008-02-15 11:06:21 +01:00
Rob Shearman
661b01f922
widl: Output code for initialising and freeing full pointer translation tables.
2008-02-04 11:49:13 +01:00
Rob Shearman
5af6012fba
widl: Write out code for initialising out-only client context handles.
2008-01-21 11:39:13 +01:00
Austin English
90f89fa74d
tools: Spelling fixes.
2008-01-18 12:52:09 +01:00
Rob Shearman
a3040cea58
widl: Use symbolic names for some of the context handle attributes.
2008-01-07 21:33:53 +01:00
Rob Shearman
06ed169bc5
widl: Fix context handle "cannot be null" detection.
...
The "cannot be null" attibute is applied to a parameter if and only if
it is in-only.
2008-01-07 21:33:50 +01:00
Rob Shearman
e998892a23
widl: Fix the conditions under which array freeing code is output.
...
It doesn't matter whether or not the array is declared as a pointer or
is declared using array subscripts - the array is still allocated by the
unmarshalling function and so needs to be freed.
Fix a typo that caused varying arrays never to be freed.
Fix another typo with the check for conformant arrays being performed
twice, redundantly.
2008-01-07 12:37:08 +01:00
Rob Shearman
15af19c6ec
widl: Add support for strict context handles.
2008-01-07 12:32:21 +01:00
Rob Shearman
807001441d
widl: Output calls for the new versions of the marshalling and unmarshalling routines for server context handles.
...
This needs to be done to match the call to NdrContextHandleInitialize
and because we default to using strict context handles.
2008-01-07 12:32:00 +01:00
Rob Shearman
13f9c71960
widl: Make the offset of conformant string types point to the start of the conformant string format chars, not the pointer type.
...
Otherwise, writing a type at top-level could cause the pointer format
string to be used in non-top-level places which may cause memory
corruption during freeing.
2008-01-07 12:02:57 +01:00
Rob Shearman
9aaff94fb7
widl: Check that the buffer has enough space before unmarshalling base types in generated code.
2007-12-31 17:13:46 +01:00
Rob Shearman
6e7dcde26e
widl: Add support for generating code for out-only context handles by calling NdrContextHandleInitialize.
2007-12-26 13:27:06 +01:00
Rob Shearman
3e5f7457f6
widl: Fix pointer detection in structures and arrays.
...
write_embedded_types doesn't descend into all types contained by the
array or structure, so create a new function, type_has_pointers, for the
purpose of descending into all types and returning whether or not
pointers are present.
2007-12-26 13:26:02 +01:00
Rob Shearman
7f3abe7757
widl: Fix the generation of temporary variables for declared arrays.
...
These need to include their array part so use var->type instead of
var->ref->type.
2007-12-24 13:30:33 +01:00
Rob Shearman
b57a322b02
widl: Tweak the rules for when to call pfnFree for arrays.
...
Varying arrays that aren't unmarshalled shouldn't be freed, but
conformant arrays that aren't unmarshalled should.
2007-12-21 12:43:18 +01:00
Rob Shearman
37c8d8ecac
widl: Fix the length used when clearing alignment space in generated files.
...
Only do the clearing when marshalling a base type.
2007-12-19 19:34:47 +01:00
Rob Shearman
57947d9f9c
widl: The detection of types is highly dependent on the ordering of the various type detection functions.
...
Therefore, needs_freeing would have to duplicate a lot of
write_remoting_arg in order to get the detection right. Because of
this, it is easier and will cause less problems in the future to
simply move the logic of needs_freeing into write_remoting_arg in the
appropriate handling code for the detected type.
2007-12-19 18:32:13 +01:00
Rob Shearman
b81f4c24db
widl: Only base types or reference pointers to base types don't need to be freed.
...
There are other cases where calls to Free functions can be omitted (such
as types always unmarshalled using buffer memory with no embedded
pointers), but these are easier dealt with inside the relevent case in
write_remoting_arg.
2007-12-17 11:57:25 +01:00
Rob Shearman
32cf944e9c
widl: Clear padding in the buffer due to alignment.
2007-12-17 11:57:10 +01:00
Rob Shearman
9896938fab
widl: Don't write redundant FC_RP type format out for conformant strings, unless it is a top level variable.
2007-12-14 12:23:33 +01:00
Rob Shearman
9741751962
widl: Remove some confusion in how version numbers are packed into an attribute by defining some macros for this purpose.
...
Remove unneeded includes.
2007-12-12 16:03:35 +01:00
Rob Shearman
d458a599eb
widl: Add support for non-basetype return types.
2007-12-11 18:07:05 +01:00
Rob Shearman
85e87ae829
widl: iid_is should take expressions, not just identifiers.
2007-12-10 14:40:37 +01:00
Rob Shearman
72d9569cc4
widl: Support the address-of operator in expressions.
2007-12-10 14:40:29 +01:00
Rob Shearman
8ead7fe797
widl: Make sure to generate freeing calls for all non-simple structures with pointers and pointers to user marshalled types.
2007-12-10 14:40:14 +01:00
Rob Shearman
e6f2329676
widl: Arrays should have freeing code generated on the server side, even if they are [in] parameters.
2007-12-10 14:40:10 +01:00
Rob Shearman
701a25c4b2
widl: Always write a freeing function for arrays in generated code.
...
Fix the conditions under which pfnFree is called to only include arrays
that will have been allocated, instead of being pointed to the buffer.
2007-12-10 14:40:07 +01:00
Michael Stefaniuc
7f5757f683
tools: Remove duplicate includes.
2007-11-19 13:54:52 +01:00
Dan Hipschman
a0ac63961d
widl: Don't rely on type_memsize to return 0 for all conformant arrays.
2007-11-06 13:02:56 +01:00
Dan Hipschman
b0bc8e58de
widl: Don't output a void conformance for NdrClearOutParameters.
2007-11-05 13:24:37 +01:00
Dan Hipschman
8d15820f79
widl: Handle pointers to conformant arrays (e.g., "[size_is(, n)] int **p; ").
2007-11-05 13:24:37 +01:00
Dan Hipschman
9825ac7a1a
widl: Fix a crash in compare_expr.
2007-10-25 12:54:57 +02:00
Dan Hipschman
f974facf5a
widl: Allow void pointers with iid_is attributes.
2007-10-25 12:54:52 +02:00
Dan Hipschman
ff8930f2bf
widl: Fix problems with variable-size user types.
2007-10-22 13:47:56 +02:00
Francois Gouget
599c74296c
widl: Add the trailing '\n' to an error message.
2007-10-19 11:45:52 +02:00
Dan Hipschman
1d0f9378bc
widl: Detect conformant arrays of user types correctly.
2007-10-18 12:09:23 +02:00