Commit 016206c1 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Move mailslot set and query info implementation to ntdll.

parent 861282bf
...@@ -1641,31 +1641,32 @@ BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize, ...@@ -1641,31 +1641,32 @@ BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
LPDWORD lpNextSize, LPDWORD lpMessageCount, LPDWORD lpNextSize, LPDWORD lpMessageCount,
LPDWORD lpReadTimeout ) LPDWORD lpReadTimeout )
{ {
BOOL r; FILE_MAILSLOT_QUERY_INFORMATION info;
IO_STATUS_BLOCK iosb;
NTSTATUS status;
TRACE("%p %p %p %p %p\n",hMailslot, TRACE("%p %p %p %p %p\n",hMailslot, lpMaxMessageSize,
lpMaxMessageSize,lpNextSize,lpMessageCount,lpReadTimeout); lpNextSize, lpMessageCount, lpReadTimeout);
SERVER_START_REQ( set_mailslot_info ) status = NtQueryInformationFile( hMailslot, &iosb, &info, sizeof info,
{ FileMailslotQueryInformation );
req->handle = hMailslot;
req->flags = 0; if( status != STATUS_SUCCESS )
r = !wine_server_call_err( req );
if( r )
{ {
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
if( lpMaxMessageSize ) if( lpMaxMessageSize )
*lpMaxMessageSize = reply->max_msgsize; *lpMaxMessageSize = info.MaximumMessageSize;
if( lpNextSize ) if( lpNextSize )
*lpNextSize = reply->next_msgsize; *lpNextSize = info.NextMessageSize;
if( lpMessageCount ) if( lpMessageCount )
*lpMessageCount = reply->msg_count; *lpMessageCount = info.MessagesAvailable;
if( lpReadTimeout ) if( lpReadTimeout )
*lpReadTimeout = reply->read_timeout; *lpReadTimeout = info.ReadTimeout.QuadPart / -10000;
}
}
SERVER_END_REQ;
return r; return TRUE;
} }
...@@ -1684,20 +1685,21 @@ BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize, ...@@ -1684,20 +1685,21 @@ BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
*/ */
BOOL WINAPI SetMailslotInfo( HANDLE hMailslot, DWORD dwReadTimeout) BOOL WINAPI SetMailslotInfo( HANDLE hMailslot, DWORD dwReadTimeout)
{ {
BOOL r; FILE_MAILSLOT_SET_INFORMATION info;
IO_STATUS_BLOCK iosb;
NTSTATUS status;
TRACE("%p %ld\n", hMailslot, dwReadTimeout); TRACE("%p %ld\n", hMailslot, dwReadTimeout);
SERVER_START_REQ( set_mailslot_info ) info.ReadTimeout.QuadPart = dwReadTimeout * -10000;
status = NtSetInformationFile( hMailslot, &iosb, &info, sizeof info,
FileMailslotSetInformation );
if( status != STATUS_SUCCESS )
{ {
req->handle = hMailslot; SetLastError( RtlNtStatusToDosError(status) );
req->flags = MAILSLOT_SET_READ_TIMEOUT; return FALSE;
req->read_timeout = dwReadTimeout;
r = !wine_server_call_err( req );
} }
SERVER_END_REQ; return TRUE;
return r;
} }
......
...@@ -941,7 +941,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, ...@@ -941,7 +941,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
0, /* FilePipeInformation */ 0, /* FilePipeInformation */
0, /* FilePipeLocalInformation */ 0, /* FilePipeLocalInformation */
0, /* FilePipeRemoteInformation */ 0, /* FilePipeRemoteInformation */
0, /* FileMailslotQueryInformation */ sizeof(FILE_MAILSLOT_QUERY_INFORMATION), /* FileMailslotQueryInformation */
0, /* FileMailslotSetInformation */ 0, /* FileMailslotSetInformation */
0, /* FileCompressionInformation */ 0, /* FileCompressionInformation */
0, /* FileObjectIdInformation */ 0, /* FileObjectIdInformation */
...@@ -1093,6 +1093,27 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, ...@@ -1093,6 +1093,27 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io,
} }
} }
break; break;
case FileMailslotQueryInformation:
{
FILE_MAILSLOT_QUERY_INFORMATION *info = ptr;
SERVER_START_REQ( set_mailslot_info )
{
req->handle = hFile;
req->flags = 0;
io->u.Status = wine_server_call( req );
if( io->u.Status == STATUS_SUCCESS )
{
info->MaximumMessageSize = reply->max_msgsize;
info->MailslotQuota = 0;
info->NextMessageSize = reply->next_msgsize;
info->MessagesAvailable = reply->msg_count;
info->ReadTimeout.QuadPart = reply->read_timeout * -10000;
}
}
SERVER_END_REQ;
}
break;
default: default:
FIXME("Unsupported class (%d)\n", class); FIXME("Unsupported class (%d)\n", class);
io->u.Status = STATUS_NOT_IMPLEMENTED; io->u.Status = STATUS_NOT_IMPLEMENTED;
...@@ -1229,6 +1250,21 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io, ...@@ -1229,6 +1250,21 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
else io->u.Status = STATUS_INVALID_PARAMETER_3; else io->u.Status = STATUS_INVALID_PARAMETER_3;
break; break;
case FileMailslotSetInformation:
{
FILE_MAILSLOT_SET_INFORMATION *info = ptr;
SERVER_START_REQ( set_mailslot_info )
{
req->handle = handle;
req->flags = MAILSLOT_SET_READ_TIMEOUT;
req->read_timeout = info->ReadTimeout.QuadPart / -10000;
io->u.Status = wine_server_call( req );
}
SERVER_END_REQ;
}
break;
default: default:
FIXME("Unsupported class (%d)\n", class); FIXME("Unsupported class (%d)\n", class);
io->u.Status = STATUS_NOT_IMPLEMENTED; io->u.Status = STATUS_NOT_IMPLEMENTED;
......
...@@ -436,6 +436,18 @@ typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION ...@@ -436,6 +436,18 @@ typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION
ULONG ReparseTag; ULONG ReparseTag;
} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION; } FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION;
typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
ULONG MaximumMessageSize;
ULONG MailslotQuota;
ULONG NextMessageSize;
ULONG MessagesAvailable;
LARGE_INTEGER ReadTimeout;
} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
typedef struct _FILE_MAILSLOT_SET_INFORMATION {
LARGE_INTEGER ReadTimeout;
} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
typedef struct _FILE_ALL_INFORMATION typedef struct _FILE_ALL_INFORMATION
{ {
FILE_BASIC_INFORMATION BasicInformation; FILE_BASIC_INFORMATION BasicInformation;
......
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