Author: ion
Date: Fri Sep 13 08:01:10 2013
New Revision: 60072
URL:
http://svn.reactos.org/svn/reactos?rev=60072&view=rev
Log:
[NPFS-NEW]: Activate NPFS-NEW. Let's see what happens.
Modified:
trunk/reactos/dll/win32/kernel32/client/file/npipe.c
trunk/reactos/drivers/filesystems/CMakeLists.txt
trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt
Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] Fri Sep 13 08:01:10
2013
@@ -13,8 +13,6 @@
#define NDEBUG
#include <debug.h>
DEBUG_CHANNEL(kernel32file);
-
-//#define USING_PROPER_NPFS_WAIT_SEMANTICS
/* GLOBALS ********************************************************************/
@@ -151,7 +149,6 @@
lpSecurityAttributes);
}
-
/*
* @implemented
*/
@@ -339,7 +336,6 @@
return PipeHandle;
}
-
/*
* @implemented
*/
@@ -364,17 +360,6 @@
return r;
}
-
-/*
- * When NPFS will work properly, use this code instead. It is compatible with
- * Microsoft's NPFS.SYS. The main difference is that:
- * - This code actually respects the timeout instead of ignoring it!
- * - This code validates and creates the proper names for both UNC and local pipes
- * - On NT, you open the *root* pipe directory (either \DosDevices\Pipe or
- * \DosDevices\Unc\Server\Pipe) and then send the pipe to wait on in the
- * FILE_PIPE_WAIT_FOR_BUFFER structure.
- */
-#ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
/*
* @implemented
*/
@@ -559,96 +544,6 @@
/* Success */
return TRUE;
}
-#else
-/*
- * @implemented
- */
-BOOL
-WINAPI
-WaitNamedPipeW(LPCWSTR lpNamedPipeName,
- DWORD nTimeOut)
-{
- UNICODE_STRING NamedPipeName;
- NTSTATUS Status;
- OBJECT_ATTRIBUTES ObjectAttributes;
- FILE_PIPE_WAIT_FOR_BUFFER WaitPipe;
- HANDLE FileHandle;
- IO_STATUS_BLOCK Iosb;
-
- if (RtlDosPathNameToNtPathName_U(lpNamedPipeName,
- &NamedPipeName,
- NULL,
- NULL) == FALSE)
- {
- return FALSE;
- }
-
- InitializeObjectAttributes(&ObjectAttributes,
- &NamedPipeName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
- Status = NtOpenFile(&FileHandle,
- FILE_READ_ATTRIBUTES | SYNCHRONIZE,
- &ObjectAttributes,
- &Iosb,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- FILE_SYNCHRONOUS_IO_NONALERT);
- if (!NT_SUCCESS(Status))
- {
- BaseSetLastNTError(Status);
- RtlFreeUnicodeString(&NamedPipeName);
- return FALSE;
- }
-
- /* Check what timeout we got */
- if (nTimeOut == NMPWAIT_WAIT_FOREVER)
- {
- /* Don't use a timeout */
- WaitPipe.TimeoutSpecified = FALSE;
- }
- else
- {
- /* Check if default */
- if (nTimeOut == NMPWAIT_USE_DEFAULT_WAIT)
- {
- /* Set it to 0 */
- WaitPipe.Timeout.LowPart = 0;
- WaitPipe.Timeout.HighPart = 0;
- }
- else
- {
- /* Convert to NT format */
- WaitPipe.Timeout.QuadPart = UInt32x32To64(-10000, nTimeOut);
- }
-
- /* In both cases, we do have a timeout */
- WaitPipe.TimeoutSpecified = TRUE;
- }
-
- Status = NtFsControlFile(FileHandle,
- NULL,
- NULL,
- NULL,
- &Iosb,
- FSCTL_PIPE_WAIT,
- &WaitPipe,
- sizeof(WaitPipe),
- NULL,
- 0);
- NtClose(FileHandle);
- if (!NT_SUCCESS(Status))
- {
- BaseSetLastNTError(Status);
- RtlFreeUnicodeString(&NamedPipeName);
- return FALSE;
- }
-
- RtlFreeUnicodeString(&NamedPipeName);
- return TRUE;
-}
-#endif
-
/*
* @implemented
@@ -1305,7 +1200,6 @@
}
else
{
-#if 0 /* We don't implement FSCTL_PIPE_TRANSCEIVE yet */
IO_STATUS_BLOCK Iosb;
Status = NtFsControlFile(hNamedPipe,
@@ -1339,34 +1233,6 @@
BaseSetLastNTError(Status);
return FALSE;
}
-#else /* Workaround while FSCTL_PIPE_TRANSCEIVE not available */
- DWORD nActualBytes;
-
- while (0 != nInBufferSize &&
- WriteFile(hNamedPipe, lpInBuffer, nInBufferSize, &nActualBytes,
- NULL))
- {
- lpInBuffer = (LPVOID)((char *) lpInBuffer + nActualBytes);
- nInBufferSize -= nActualBytes;
- }
-
- if (0 != nInBufferSize)
- {
- /* Must have dropped out of the while 'cause WriteFile failed */
- return FALSE;
- }
-
- if (!ReadFile(hNamedPipe, lpOutBuffer, nOutBufferSize, &nActualBytes,
- NULL))
- {
- return FALSE;
- }
-
- if (NULL != lpBytesRead)
- {
- *lpBytesRead = nActualBytes;
- }
-#endif
}
return TRUE;
Modified: trunk/reactos/drivers/filesystems/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/CMakeL…
==============================================================================
--- trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/CMakeLists.txt [iso-8859-1] Fri Sep 13 08:01:10
2013
@@ -6,6 +6,5 @@
add_subdirectory(fs_rec)
add_subdirectory(msfs)
add_subdirectory(mup)
-add_subdirectory(npfs)
add_subdirectory(npfs_new)
add_subdirectory(ntfs)
Modified: trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs_n…
==============================================================================
--- trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/npfs_new/CMakeLists.txt [iso-8859-1] Fri Sep 13
08:01:10 2013
@@ -21,9 +21,9 @@
write.c
writesup.c)
-add_library(npfs_new SHARED ${SOURCE})
-set_module_type(npfs_new kernelmodedriver)
-target_link_libraries(npfs_new ${PSEH_LIB})
-add_importlibs(npfs_new ntoskrnl hal)
-add_pch(npfs_new npfs.h)
-add_cd_file(TARGET npfs_new DESTINATION reactos/system32/drivers FOR all)
+add_library(npfs SHARED ${SOURCE})
+set_module_type(npfs kernelmodedriver)
+target_link_libraries(npfs ${PSEH_LIB})
+add_importlibs(npfs ntoskrnl hal)
+add_pch(npfs npfs.h)
+add_cd_file(TARGET npfs DESTINATION reactos/system32/drivers FOR all)