server: Return the total length of the target in query_symlink.

This commit is contained in:
Alexandre Julliard 2010-06-30 16:11:03 +02:00
parent 4b9258d165
commit 4c1f36cb68
5 changed files with 10 additions and 3 deletions

View File

@ -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 */

View File

@ -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

View File

@ -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 );

View File

@ -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

View File

@ -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 },