wine/ server/trace.c server/protocol.def serve ...
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 21 09:23:50 CST 2005
ChangeSet ID: 21376
CVSROOT: /opt/cvs-commit
Module name: wine
Changes by: julliard at winehq.org 2005/11/21 09:23:49
Modified files:
server : trace.c protocol.def mailslot.c
include/wine : server_protocol.h
dlls/ntdll : file.c
dlls/kernel : sync.c
Log message:
Fixed handling of mailslot read timeout to avoid compiler warnings.
Patch: http://cvs.winehq.org/patch.py?id=21376
Old revision New revision Changes Path
1.268 1.269 +3 -3 wine/server/trace.c
1.161 1.162 +3 -3 wine/server/protocol.def
1.12 1.13 +2 -3 wine/server/mailslot.c
1.162 1.163 +4 -4 wine/include/wine/server_protocol.h
1.104 1.105 +1 -1 wine/dlls/ntdll/file.c
1.91 1.92 +4 -1 wine/dlls/kernel/sync.c
Index: wine/server/trace.c
diff -u -p wine/server/trace.c:1.268 wine/server/trace.c:1.269
--- wine/server/trace.c:1.268 21 Nov 2005 15:23:49 -0000
+++ wine/server/trace.c 21 Nov 2005 15:23:49 -0000
@@ -3052,7 +3052,7 @@ static void dump_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_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 );
}
Index: wine/server/protocol.def
diff -u -p wine/server/protocol.def:1.161 wine/server/protocol.def:1.162
--- wine/server/protocol.def:1.161 21 Nov 2005 15:23:49 -0000
+++ wine/server/protocol.def 21 Nov 2005 15:23:49 -0000
@@ -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
Index: wine/server/mailslot.c
diff -u -p wine/server/mailslot.c:1.12 wine/server/mailslot.c:1.13
--- wine/server/mailslot.c:1.12 21 Nov 2005 15:23:49 -0000
+++ wine/server/mailslot.c 21 Nov 2005 15:23:49 -0000
@@ -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
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 );
}
Index: wine/include/wine/server_protocol.h
diff -u -p wine/include/wine/server_protocol.h:1.162 wine/include/wine/server_protocol.h:1.163
--- wine/include/wine/server_protocol.h:1.162 21 Nov 2005 15:23:50 -0000
+++ wine/include/wine/server_protocol.h 21 Nov 2005 15:23:50 -0000
@@ -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 */
Index: wine/dlls/ntdll/file.c
diff -u -p wine/dlls/ntdll/file.c:1.104 wine/dlls/ntdll/file.c:1.105
--- wine/dlls/ntdll/file.c:1.104 21 Nov 2005 15:23:50 -0000
+++ wine/dlls/ntdll/file.c 21 Nov 2005 15:23:50 -0000
@@ -2061,7 +2061,7 @@ NTSTATUS WINAPI NtCreateMailslotFile(PHA
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 );
Index: wine/dlls/kernel/sync.c
diff -u -p wine/dlls/kernel/sync.c:1.91 wine/dlls/kernel/sync.c:1.92
--- wine/dlls/kernel/sync.c:1.91 21 Nov 2005 15:23:50 -0000
+++ wine/dlls/kernel/sync.c 21 Nov 2005 15:23:50 -0000
@@ -1672,7 +1672,10 @@ HANDLE WINAPI CreateMailslotW( LPCWSTR l
attr.SecurityDescriptor = sa ? sa->lpSecurityDescriptor : NULL;
attr.SecurityQualityOfService = NULL;
- timeout.QuadPart = (ULONGLONG) lReadTimeout * -10000;
+ 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 );
More information about the wine-cvs
mailing list