#define NDEBUG
#include "../include/debug.h"
-/* FIXME - defined in ntifs.h */
-#if !defined(FILE_PIPE_BYTE_STREAM_TYPE) && !defined(FILE_PIPE_MESSAGE_TYPE)
-#define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000
-#define FILE_PIPE_MESSAGE_TYPE 0x00000001
-#endif
-
/* FUNCTIONS ****************************************************************/
/*
ULONG ShareAccess, Attributes;
LARGE_INTEGER DefaultTimeOut;
PSECURITY_DESCRIPTOR SecurityDescriptor = NULL;
-
+
if (nMaxInstances == 0 || nMaxInstances > PIPE_UNLIMITED_INSTANCES)
{
- SetLastError(ERROR_INVALID_PARAMETER);
- return INVALID_HANDLE_VALUE;
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return INVALID_HANDLE_VALUE;
}
Result = RtlDosPathNameToNtPathName_U((LPWSTR)lpName,
CreateOptions = 0;
if (dwOpenMode & FILE_FLAG_WRITE_THROUGH)
- CreateOptions |= FILE_WRITE_THROUGH;
+ CreateOptions = CreateOptions | FILE_WRITE_THROUGH;
+
if (!(dwOpenMode & FILE_FLAG_OVERLAPPED))
- CreateOptions |= FILE_SYNCHRONOUS_IO_NONALERT;
+ CreateOptions = CreateOptions | FILE_SYNCHRONOUS_IO_NONALERT;
- if (dwOpenMode & PIPE_ACCESS_INBOUND)
+ if (dwOpenMode & PIPE_ACCESS_OUTBOUND)
{
- ShareAccess |= FILE_SHARE_WRITE;
- DesiredAccess |= GENERIC_READ;
+ ShareAccess |= FILE_SHARE_READ;
+ DesiredAccess |= GENERIC_WRITE;
}
- if (dwOpenMode & PIPE_ACCESS_OUTBOUND)
+ if (dwOpenMode & PIPE_ACCESS_INBOUND)
{
- ShareAccess |= FILE_SHARE_READ;
- DesiredAccess |= GENERIC_WRITE;
+ ShareAccess |= FILE_SHARE_WRITE;
+ DesiredAccess |= GENERIC_READ;
}
-
if (dwPipeMode & PIPE_TYPE_MESSAGE)
- WriteModeMessage = FILE_PIPE_MESSAGE_TYPE;
+ WriteModeMessage = FILE_PIPE_MESSAGE_MODE;
else
- WriteModeMessage = FILE_PIPE_BYTE_STREAM_TYPE;
+ WriteModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
if (dwPipeMode & PIPE_READMODE_MESSAGE)
- ReadModeMessage = FILE_PIPE_MESSAGE_MODE;
+ ReadModeMessage = FILE_PIPE_MESSAGE_MODE;
else
- ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
+ ReadModeMessage = FILE_PIPE_BYTE_STREAM_MODE;
if (dwPipeMode & PIPE_NOWAIT)
NonBlocking = FILE_PIPE_COMPLETE_OPERATION;
else
- NonBlocking = FILE_PIPE_QUEUE_OPERATION;
+ NonBlocking = FILE_PIPE_QUEUE_OPERATION;
DefaultTimeOut.QuadPart = nDefaultTimeOut * -10000LL;
/*
* @implemented
*/
-BOOL
+BOOL
STDCALL
SetNamedPipeHandleState(HANDLE hNamedPipe,
LPDWORD lpMode,
Settings.ReadMode = (*lpMode & PIPE_READMODE_MESSAGE) ?
FILE_PIPE_MESSAGE_MODE: FILE_PIPE_BYTE_STREAM_MODE;
- /* Send the changes to the Driver */
+ /* Send the changes to the Driver */
Status = NtSetInformationFile(hNamedPipe,
&Iosb,
&Settings,
return(FALSE);
}
}
-
+
/* Check if the Collection count or Timeout are being changed */
if (lpMaxCollectionCount || lpCollectDataTimeout)
{
}
}
- /* Now set the new settings */
- RemoteSettings.MaximumCollectionCount = (lpMaxCollectionCount) ?
- *lpMaxCollectionCount :
+ /* Now set the new settings */
+ RemoteSettings.MaximumCollectionCount = (lpMaxCollectionCount) ?
+ *lpMaxCollectionCount :
RemoteSettings.MaximumCollectionCount;
if (lpCollectDataTimeout)
{