From 4c1f36cb68d744fe5ed3d52a4ea531b72b1dcac3 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 30 Jun 2010 16:11:03 +0200 Subject: [PATCH] server: Return the total length of the target in query_symlink. --- include/wine/server_protocol.h | 4 +++- server/protocol.def | 1 + server/request.h | 3 ++- server/symlink.c | 1 + server/trace.c | 4 +++- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 20bb4a297bf..1a78bc2e77a 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4395,7 +4395,9 @@ struct query_symlink_request struct query_symlink_reply { struct reply_header __header; + data_size_t total; /* VARARG(target_name,unicode_str); */ + char __pad_12[4]; }; @@ -5485,6 +5487,6 @@ union generic_reply struct set_cursor_reply set_cursor_reply; }; -#define SERVER_PROTOCOL_VERSION 401 +#define SERVER_PROTOCOL_VERSION 402 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/protocol.def b/server/protocol.def index e4e8ec3fdbf..e41cd183ab8 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3057,6 +3057,7 @@ enum message_type @REQ(query_symlink) obj_handle_t handle; /* handle to the symlink */ @REPLY + data_size_t total; /* total needed size for name */ VARARG(target_name,unicode_str); /* target name */ @END diff --git a/server/request.h b/server/request.h index ef6adea8613..722fc25c679 100644 --- a/server/request.h +++ b/server/request.h @@ -1980,7 +1980,8 @@ C_ASSERT( FIELD_OFFSET(struct open_symlink_reply, handle) == 8 ); C_ASSERT( sizeof(struct open_symlink_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct query_symlink_request, handle) == 12 ); C_ASSERT( sizeof(struct query_symlink_request) == 16 ); -C_ASSERT( sizeof(struct query_symlink_reply) == 8 ); +C_ASSERT( FIELD_OFFSET(struct query_symlink_reply, total) == 8 ); +C_ASSERT( sizeof(struct query_symlink_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_object_info_request, handle) == 12 ); C_ASSERT( sizeof(struct get_object_info_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_object_info_reply, access) == 8 ); diff --git a/server/symlink.c b/server/symlink.c index 2ec7ed5affd..2330fde1cea 100644 --- a/server/symlink.c +++ b/server/symlink.c @@ -214,6 +214,7 @@ DECL_HANDLER(query_symlink) SYMBOLIC_LINK_QUERY, &symlink_ops ); if (!symlink) return; + reply->total = symlink->len; if (get_reply_max_size() < symlink->len) set_error( STATUS_BUFFER_TOO_SMALL ); else diff --git a/server/trace.c b/server/trace.c index ec87dab3643..fd2318e102c 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3594,7 +3594,8 @@ static void dump_query_symlink_request( const struct query_symlink_request *req static void dump_query_symlink_reply( const struct query_symlink_reply *req ) { - dump_varargs_unicode_str( " target_name=", cur_size ); + fprintf( stderr, " total=%u", req->total ); + dump_varargs_unicode_str( ", target_name=", cur_size ); } static void dump_get_object_info_request( const struct get_object_info_request *req ) @@ -4607,6 +4608,7 @@ static const struct { "GENERIC_NOT_MAPPED", STATUS_GENERIC_NOT_MAPPED }, { "HANDLES_CLOSED", STATUS_HANDLES_CLOSED }, { "HANDLE_NOT_CLOSABLE", STATUS_HANDLE_NOT_CLOSABLE }, + { "HOST_UNREACHABLE", STATUS_HOST_UNREACHABLE }, { "ILLEGAL_FUNCTION", STATUS_ILLEGAL_FUNCTION }, { "INSTANCE_NOT_AVAILABLE", STATUS_INSTANCE_NOT_AVAILABLE }, { "INSUFFICIENT_RESOURCES", STATUS_INSUFFICIENT_RESOURCES }, -- 2.11.4.GIT