Commit 86397e1d authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed handling of mailslot read timeout to avoid compiler warnings.

parent 7bde557d
......@@ -1672,7 +1672,10 @@ HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize,
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
attr.SecurityQualityOfService = NULL;
if (lReadTimeout != MAILSLOT_WAIT_FOREVER)
timeout.QuadPart = (ULONGLONG) lReadTimeout * -10000;
else
timeout.QuadPart = ((LONGLONG)0x7fffffff << 32) | 0xffffffff;
status = NtCreateMailslotFile( &handle, GENERIC_READ | GENERIC_WRITE, &attr,
&iosb, 0, 0, nMaxMessageSize, &timeout );
......
......@@ -2061,7 +2061,7 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHANDLE pHandle, ULONG DesiredAccess,
req->access = DesiredAccess;
req->attributes = (attr) ? attr->Attributes : 0;
req->max_msgsize = MaxMessageSize;
req->read_timeout = TimeOut->QuadPart / -10000;
req->read_timeout = (TimeOut->QuadPart <= 0) ? TimeOut->QuadPart / -10000 : -1;
wine_server_add_data( req, attr->ObjectName->Buffer + 4,
attr->ObjectName->Length - 4*sizeof(WCHAR) );
ret = wine_server_call( req );
......
......@@ -3532,7 +3532,7 @@ struct create_mailslot_request
unsigned int access;
unsigned int attributes;
unsigned int max_msgsize;
unsigned int read_timeout;
int read_timeout;
/* VARARG(name,unicode_str); */
};
struct create_mailslot_reply
......@@ -3564,13 +3564,13 @@ struct set_mailslot_info_request
struct request_header __header;
obj_handle_t handle;
unsigned int flags;
unsigned int read_timeout;
int read_timeout;
};
struct set_mailslot_info_reply
{
struct reply_header __header;
unsigned int max_msgsize;
unsigned int read_timeout;
int read_timeout;
unsigned int msg_count;
unsigned int next_msgsize;
};
......@@ -4208,6 +4208,6 @@ union generic_reply
struct set_mailslot_info_reply set_mailslot_info_reply;
};
#define SERVER_PROTOCOL_VERSION 198
#define SERVER_PROTOCOL_VERSION 199
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -56,7 +56,7 @@ struct mailslot
struct fd *fd;
struct fd *write_fd;
unsigned int max_msgsize;
unsigned int read_timeout;
int read_timeout;
struct list writers;
};
......@@ -207,8 +207,7 @@ static void mailslot_queue_async( struct fd *fd, void *apc, void *user,
return;
}
if (mailslot->read_timeout != MAILSLOT_WAIT_FOREVER)
timeout = &mailslot->read_timeout;
if (mailslot->read_timeout != -1) timeout = &mailslot->read_timeout;
fd_queue_async_timeout( fd, apc, user, iosb, type, count, timeout );
}
......
......@@ -2475,7 +2475,7 @@ enum message_type
unsigned int access; /* wanted access rights */
unsigned int attributes; /* object attributes */
unsigned int max_msgsize;
unsigned int read_timeout;
int read_timeout;
VARARG(name,unicode_str); /* mailslot name */
@REPLY
obj_handle_t handle; /* handle to the mailslot */
......@@ -2497,10 +2497,10 @@ enum message_type
@REQ(set_mailslot_info)
obj_handle_t handle; /* handle to the mailslot */
unsigned int flags;
unsigned int read_timeout;
int read_timeout;
@REPLY
unsigned int max_msgsize;
unsigned int read_timeout;
int read_timeout;
unsigned int msg_count;
unsigned int next_msgsize;
@END
......
......@@ -3052,7 +3052,7 @@ static void dump_create_mailslot_request( const struct create_mailslot_request *
fprintf( stderr, " access=%08x,", req->access );
fprintf( stderr, " attributes=%08x,", req->attributes );
fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize );
fprintf( stderr, " read_timeout=%08x,", req->read_timeout );
fprintf( stderr, " read_timeout=%d,", req->read_timeout );
fprintf( stderr, " name=" );
dump_varargs_unicode_str( cur_size );
}
......@@ -3080,13 +3080,13 @@ static void dump_set_mailslot_info_request( const struct set_mailslot_info_reque
{
fprintf( stderr, " handle=%p,", req->handle );
fprintf( stderr, " flags=%08x,", req->flags );
fprintf( stderr, " read_timeout=%08x", req->read_timeout );
fprintf( stderr, " read_timeout=%d", req->read_timeout );
}
static void dump_set_mailslot_info_reply( const struct set_mailslot_info_reply *req )
{
fprintf( stderr, " max_msgsize=%08x,", req->max_msgsize );
fprintf( stderr, " read_timeout=%08x,", req->read_timeout );
fprintf( stderr, " read_timeout=%d,", req->read_timeout );
fprintf( stderr, " msg_count=%08x,", req->msg_count );
fprintf( stderr, " next_msgsize=%08x", req->next_msgsize );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment