mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 13:14:41 +00:00
Fix the signature of Nt/ZwCreateNamedPipe, the 8th to 10th arguments are ULONGs instead of BOOLEANs.
svn path=/trunk/; revision=12303
This commit is contained in:
parent
52bbffc39f
commit
09e71d4f7d
3 changed files with 79 additions and 84 deletions
|
@ -1,5 +1,4 @@
|
||||||
|
/* $Id: zw.h,v 1.39 2004/12/23 20:12:51 ekohl Exp $
|
||||||
/* $Id: zw.h,v 1.38 2004/12/14 00:41:23 gdalsnes Exp $
|
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -830,9 +829,9 @@ NtCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle,
|
||||||
IN ULONG ShareAccess,
|
IN ULONG ShareAccess,
|
||||||
IN ULONG CreateDisposition,
|
IN ULONG CreateDisposition,
|
||||||
IN ULONG CreateOptions,
|
IN ULONG CreateOptions,
|
||||||
IN BOOLEAN WriteModeMessage,
|
IN ULONG NamedPipeType,
|
||||||
IN BOOLEAN ReadModeMessage,
|
IN ULONG ReadMode,
|
||||||
IN BOOLEAN NonBlocking,
|
IN ULONG CompletionMode,
|
||||||
IN ULONG MaxInstances,
|
IN ULONG MaxInstances,
|
||||||
IN ULONG InBufferSize,
|
IN ULONG InBufferSize,
|
||||||
IN ULONG OutBufferSize,
|
IN ULONG OutBufferSize,
|
||||||
|
@ -846,9 +845,9 @@ ZwCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle,
|
||||||
IN ULONG ShareAccess,
|
IN ULONG ShareAccess,
|
||||||
IN ULONG CreateDisposition,
|
IN ULONG CreateDisposition,
|
||||||
IN ULONG CreateOptions,
|
IN ULONG CreateOptions,
|
||||||
IN BOOLEAN WriteModeMessage,
|
IN ULONG NamedPipeType,
|
||||||
IN BOOLEAN ReadModeMessage,
|
IN ULONG ReadMode,
|
||||||
IN BOOLEAN NonBlocking,
|
IN ULONG CompletionMode,
|
||||||
IN ULONG MaxInstances,
|
IN ULONG MaxInstances,
|
||||||
IN ULONG InBufferSize,
|
IN ULONG InBufferSize,
|
||||||
IN ULONG OutBufferSize,
|
IN ULONG OutBufferSize,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: npipe.c,v 1.20 2004/10/08 23:24:01 weiden Exp $
|
/* $Id: npipe.c,v 1.21 2004/12/23 20:13:19 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -73,14 +73,14 @@ CreateNamedPipeW(LPCWSTR lpName,
|
||||||
ACCESS_MASK DesiredAccess;
|
ACCESS_MASK DesiredAccess;
|
||||||
ULONG CreateOptions;
|
ULONG CreateOptions;
|
||||||
ULONG CreateDisposition;
|
ULONG CreateDisposition;
|
||||||
BOOLEAN WriteModeMessage;
|
ULONG WriteModeMessage;
|
||||||
BOOLEAN ReadModeMessage;
|
ULONG ReadModeMessage;
|
||||||
BOOLEAN NonBlocking;
|
ULONG NonBlocking;
|
||||||
IO_STATUS_BLOCK Iosb;
|
IO_STATUS_BLOCK Iosb;
|
||||||
ULONG ShareAccess, Attributes;
|
ULONG ShareAccess, Attributes;
|
||||||
LARGE_INTEGER DefaultTimeOut;
|
LARGE_INTEGER DefaultTimeOut;
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
|
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
|
||||||
|
|
||||||
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName,
|
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName,
|
||||||
&NamedPipeName,
|
&NamedPipeName,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -90,10 +90,10 @@ CreateNamedPipeW(LPCWSTR lpName,
|
||||||
SetLastError(ERROR_PATH_NOT_FOUND);
|
SetLastError(ERROR_PATH_NOT_FOUND);
|
||||||
return(INVALID_HANDLE_VALUE);
|
return(INVALID_HANDLE_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("Pipe name: %wZ\n", &NamedPipeName);
|
DPRINT("Pipe name: %wZ\n", &NamedPipeName);
|
||||||
DPRINT("Pipe name: %S\n", NamedPipeName.Buffer);
|
DPRINT("Pipe name: %S\n", NamedPipeName.Buffer);
|
||||||
|
|
||||||
Attributes = OBJ_CASE_INSENSITIVE;
|
Attributes = OBJ_CASE_INSENSITIVE;
|
||||||
if(lpSecurityAttributes)
|
if(lpSecurityAttributes)
|
||||||
{
|
{
|
||||||
|
@ -107,13 +107,10 @@ CreateNamedPipeW(LPCWSTR lpName,
|
||||||
Attributes,
|
Attributes,
|
||||||
NULL,
|
NULL,
|
||||||
SecurityDescriptor);
|
SecurityDescriptor);
|
||||||
|
|
||||||
DesiredAccess = 0;
|
DesiredAccess = 0;
|
||||||
|
|
||||||
ShareAccess = 0;
|
ShareAccess = 0;
|
||||||
|
|
||||||
CreateDisposition = FILE_OPEN_IF;
|
CreateDisposition = FILE_OPEN_IF;
|
||||||
|
|
||||||
CreateOptions = 0;
|
CreateOptions = 0;
|
||||||
if (dwOpenMode & FILE_FLAG_WRITE_THROUGH)
|
if (dwOpenMode & FILE_FLAG_WRITE_THROUGH)
|
||||||
{
|
{
|
||||||
|
@ -135,53 +132,53 @@ CreateNamedPipeW(LPCWSTR lpName,
|
||||||
{
|
{
|
||||||
CreateOptions = CreateOptions | FILE_PIPE_OUTBOUND;
|
CreateOptions = CreateOptions | FILE_PIPE_OUTBOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwPipeMode & PIPE_TYPE_BYTE)
|
if (dwPipeMode & PIPE_TYPE_BYTE)
|
||||||
{
|
{
|
||||||
WriteModeMessage = FALSE;
|
WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
|
||||||
}
|
}
|
||||||
else if (dwPipeMode & PIPE_TYPE_MESSAGE)
|
else if (dwPipeMode & PIPE_TYPE_MESSAGE)
|
||||||
{
|
{
|
||||||
WriteModeMessage = TRUE;
|
WriteModeMessage = FILE_PIPE_MESSAGE_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WriteModeMessage = FALSE;
|
WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwPipeMode & PIPE_READMODE_BYTE)
|
if (dwPipeMode & PIPE_READMODE_BYTE)
|
||||||
{
|
{
|
||||||
ReadModeMessage = FALSE;
|
ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
|
||||||
}
|
}
|
||||||
else if (dwPipeMode & PIPE_READMODE_MESSAGE)
|
else if (dwPipeMode & PIPE_READMODE_MESSAGE)
|
||||||
{
|
{
|
||||||
ReadModeMessage = TRUE;
|
ReadModeMessage = FILE_PIPE_MESSAGE_MODE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ReadModeMessage = FALSE;
|
ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dwPipeMode & PIPE_WAIT)
|
if (dwPipeMode & PIPE_WAIT)
|
||||||
{
|
{
|
||||||
NonBlocking = FALSE;
|
NonBlocking = FILE_PIPE_QUEUE_OPERATION;
|
||||||
}
|
}
|
||||||
else if (dwPipeMode & PIPE_NOWAIT)
|
else if (dwPipeMode & PIPE_NOWAIT)
|
||||||
{
|
{
|
||||||
NonBlocking = TRUE;
|
NonBlocking = FILE_PIPE_COMPLETE_OPERATION;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NonBlocking = FALSE;
|
NonBlocking = FILE_PIPE_QUEUE_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES)
|
if (nMaxInstances >= PIPE_UNLIMITED_INSTANCES)
|
||||||
{
|
{
|
||||||
nMaxInstances = ULONG_MAX;
|
nMaxInstances = ULONG_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000;
|
DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000;
|
||||||
|
|
||||||
Status = NtCreateNamedPipeFile(&PipeHandle,
|
Status = NtCreateNamedPipeFile(&PipeHandle,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -196,17 +193,17 @@ CreateNamedPipeW(LPCWSTR lpName,
|
||||||
nInBufferSize,
|
nInBufferSize,
|
||||||
nOutBufferSize,
|
nOutBufferSize,
|
||||||
&DefaultTimeOut);
|
&DefaultTimeOut);
|
||||||
|
|
||||||
RtlFreeUnicodeString(&NamedPipeName);
|
RtlFreeUnicodeString(&NamedPipeName);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("NtCreateNamedPipe failed (Status %x)!\n", Status);
|
DPRINT("NtCreateNamedPipe failed (Status %x)!\n", Status);
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
return(INVALID_HANDLE_VALUE);
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(PipeHandle);
|
return PipeHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -251,7 +248,6 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
|
||||||
&NamedPipeName,
|
&NamedPipeName,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (!r)
|
if (!r)
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
@ -611,7 +607,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe,
|
||||||
IO_STATUS_BLOCK StatusBlock;
|
IO_STATUS_BLOCK StatusBlock;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
if(lpState != NULL)
|
if (lpState != NULL)
|
||||||
{
|
{
|
||||||
FILE_PIPE_INFORMATION PipeInfo;
|
FILE_PIPE_INFORMATION PipeInfo;
|
||||||
|
|
||||||
|
@ -620,7 +616,7 @@ GetNamedPipeHandleStateW(HANDLE hNamedPipe,
|
||||||
&PipeInfo,
|
&PipeInfo,
|
||||||
sizeof(FILE_PIPE_INFORMATION),
|
sizeof(FILE_PIPE_INFORMATION),
|
||||||
FilePipeInformation);
|
FilePipeInformation);
|
||||||
if(!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastErrorByStatus(Status);
|
SetLastErrorByStatus(Status);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -24,53 +24,53 @@ NtCreateNamedPipeFile(PHANDLE FileHandle,
|
||||||
ULONG ShareAccess,
|
ULONG ShareAccess,
|
||||||
ULONG CreateDisposition,
|
ULONG CreateDisposition,
|
||||||
ULONG CreateOptions,
|
ULONG CreateOptions,
|
||||||
BOOLEAN NamedPipeType,
|
ULONG NamedPipeType,
|
||||||
BOOLEAN ReadMode,
|
ULONG ReadMode,
|
||||||
BOOLEAN CompletionMode,
|
ULONG CompletionMode,
|
||||||
ULONG MaximumInstances,
|
ULONG MaximumInstances,
|
||||||
ULONG InboundQuota,
|
ULONG InboundQuota,
|
||||||
ULONG OutboundQuota,
|
ULONG OutboundQuota,
|
||||||
PLARGE_INTEGER DefaultTimeout)
|
PLARGE_INTEGER DefaultTimeout)
|
||||||
{
|
{
|
||||||
NAMED_PIPE_CREATE_PARAMETERS Buffer;
|
NAMED_PIPE_CREATE_PARAMETERS Buffer;
|
||||||
|
|
||||||
DPRINT("NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, "
|
DPRINT("NtCreateNamedPipeFile(FileHandle %x, DesiredAccess %x, "
|
||||||
"ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %S)\n",
|
"ObjectAttributes %x ObjectAttributes->ObjectName->Buffer %S)\n",
|
||||||
FileHandle,DesiredAccess,ObjectAttributes,
|
FileHandle,DesiredAccess,ObjectAttributes,
|
||||||
ObjectAttributes->ObjectName->Buffer);
|
ObjectAttributes->ObjectName->Buffer);
|
||||||
|
|
||||||
ASSERT_IRQL(PASSIVE_LEVEL);
|
ASSERT_IRQL(PASSIVE_LEVEL);
|
||||||
|
|
||||||
if (DefaultTimeout != NULL)
|
if (DefaultTimeout != NULL)
|
||||||
{
|
{
|
||||||
Buffer.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart;
|
Buffer.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart;
|
||||||
Buffer.TimeoutSpecified = TRUE;
|
Buffer.TimeoutSpecified = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Buffer.TimeoutSpecified = FALSE;
|
Buffer.TimeoutSpecified = FALSE;
|
||||||
}
|
}
|
||||||
Buffer.NamedPipeType = NamedPipeType;
|
Buffer.NamedPipeType = NamedPipeType;
|
||||||
Buffer.ReadMode = ReadMode;
|
Buffer.ReadMode = ReadMode;
|
||||||
Buffer.CompletionMode = CompletionMode;
|
Buffer.CompletionMode = CompletionMode;
|
||||||
Buffer.MaximumInstances = MaximumInstances;
|
Buffer.MaximumInstances = MaximumInstances;
|
||||||
Buffer.InboundQuota = InboundQuota;
|
Buffer.InboundQuota = InboundQuota;
|
||||||
Buffer.OutboundQuota = OutboundQuota;
|
Buffer.OutboundQuota = OutboundQuota;
|
||||||
|
|
||||||
return IoCreateFile(FileHandle,
|
return IoCreateFile(FileHandle,
|
||||||
DesiredAccess,
|
DesiredAccess,
|
||||||
ObjectAttributes,
|
ObjectAttributes,
|
||||||
IoStatusBlock,
|
IoStatusBlock,
|
||||||
NULL,
|
NULL,
|
||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
ShareAccess,
|
ShareAccess,
|
||||||
CreateDisposition,
|
CreateDisposition,
|
||||||
CreateOptions,
|
CreateOptions,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
CreateFileTypeNamedPipe,
|
CreateFileTypeNamedPipe,
|
||||||
(PVOID)&Buffer,
|
(PVOID)&Buffer,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue