Author: sginsberg
Date: Mon Sep 15 12:47:16 2008
New Revision: 36263
URL:
http://svn.reactos.org/svn/reactos?rev=36263&view=rev
Log:
- Implement IoSetFileOrigin
Modified:
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Mon Sep 15 12:47:16 2008
@@ -2418,15 +2418,38 @@
}
/*
- * @unimplemented
+ * @implemented
*/
NTSTATUS
NTAPI
IoSetFileOrigin(IN PFILE_OBJECT FileObject,
IN BOOLEAN Remote)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ NTSTATUS Status = STATUS_SUCCESS;
+ BOOLEAN FlagSet;
+
+ /* Get the flag status */
+ FlagSet = FileObject->Flags & FO_REMOTE_ORIGIN ? TRUE : FALSE;
+
+ /* Don't set the flag if it was set already, and don't remove it if it
wasn't set */
+ if (Remote && !FlagSet)
+ {
+ /* Set the flag */
+ FileObject->Flags |= FO_REMOTE_ORIGIN;
+ }
+ else if (!Remote && FlagSet)
+ {
+ /* Remove the flag */
+ FileObject->Flags &= ~FO_REMOTE_ORIGIN;
+ }
+ else
+ {
+ /* Fail */
+ Status = STATUS_INVALID_PARAMETER_MIX;
+ }
+
+ /* Return status */
+ return Status;
}
/*