[8/8] widl: consider ptrs to user-marshalled types as pointers-to-nonpointers

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Sat Jan 10 15:38:39 CST 2009


typdef [wire_marshal(wirefoo)] foo * pfoo;
made widl incorrectly set the RPC_FC_P_DEREF bit for pfoo. But this
declares a user-marshalled pointer, so the RPC runtime must not dereference
it before passing it on to the UserFoo functions.
---
 tools/widl/header.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/widl/header.h b/tools/widl/header.h
index 3f0eec1..f572440 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -61,7 +61,8 @@ extern int is_const_decl(const var_t *var);
 
 static inline int last_ptr(const type_t *type)
 {
-    return is_ptr(type) && !is_declptr(type_pointer_get_ref(type));
+    const type_t * ref = type_pointer_get_ref(type);
+    return is_ptr(type) && (is_user_type(ref) || !is_declptr(ref));
 }
 
 static inline int last_array(const type_t *type)
-- 
1.5.6.5




More information about the wine-devel mailing list