--- trunk/reactos/ntoskrnl/io/fs.c 2005-05-17 19:09:27 UTC (rev 15385)
+++ trunk/reactos/ntoskrnl/io/fs.c 2005-05-17 19:16:21 UTC (rev 15386)
@@ -62,115 +62,6 @@
UNIMPLEMENTED;
}
-/*
- * @implemented
- */
-NTSTATUS STDCALL
-NtFsControlFile (
- IN HANDLE DeviceHandle,
- IN HANDLE EventHandle OPTIONAL,
- IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
- IN PVOID ApcContext OPTIONAL,
- OUT PIO_STATUS_BLOCK IoStatusBlock,
- IN ULONG IoControlCode,
- IN PVOID InputBuffer,
- IN ULONG InputBufferSize,
- OUT PVOID OutputBuffer,
- IN ULONG OutputBufferSize
- )
-{
- NTSTATUS Status;
- PFILE_OBJECT FileObject;
- PDEVICE_OBJECT DeviceObject;
- PIRP Irp;
- PIO_STACK_LOCATION StackPtr;
- PKEVENT ptrEvent;
- KPROCESSOR_MODE PreviousMode;
-
- DPRINT("NtFsControlFile(DeviceHandle %x EventHandle %x ApcRoutine %x "
- "ApcContext %x IoStatusBlock %x IoControlCode %x "
- "InputBuffer %x InputBufferSize %x OutputBuffer %x "
- "OutputBufferSize %x)\n",
- DeviceHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,
- IoControlCode,InputBuffer,InputBufferSize,OutputBuffer,
- OutputBufferSize);
-
- PreviousMode = ExGetPreviousMode();
-
- /* Check granted access against the access rights from IoContolCode */
- Status = ObReferenceObjectByHandle(DeviceHandle,
- (IoControlCode >> 14) & 0x3,
- NULL,
- PreviousMode,
- (PVOID *) &FileObject,
- NULL);
- if (!NT_SUCCESS(Status))
- {
- return Status;
- }
-
- if (EventHandle != NULL)
- {
- Status = ObReferenceObjectByHandle(EventHandle,
- SYNCHRONIZE,
- ExEventObjectType,
- PreviousMode,
- (PVOID*)&ptrEvent,
- NULL);
- if (!NT_SUCCESS(Status))
- {
- ObDereferenceObject(FileObject);
- return Status;
- }
- }
- else
- {
- KeResetEvent(&FileObject->Event);
- ptrEvent = &FileObject->Event;
- }
-
- DeviceObject = FileObject->DeviceObject;
-
- Irp = IoBuildDeviceIoControlRequest(IoControlCode,
- DeviceObject,
- InputBuffer,
- InputBufferSize,
- OutputBuffer,
- OutputBufferSize,
- FALSE,
- ptrEvent,
- IoStatusBlock);
-
- /* Trigger FileObject/Event dereferencing */
- Irp->Tail.Overlay.OriginalFileObject = FileObject;
-
- Irp->RequestorMode = PreviousMode;
- Irp->Overlay.AsynchronousParameters.UserApcRoutine = ApcRoutine;
- Irp->Overlay.AsynchronousParameters.UserApcContext = ApcContext;
-
- StackPtr = IoGetNextIrpStackLocation(Irp);
- StackPtr->FileObject = FileObject;
- StackPtr->DeviceObject = DeviceObject;
- StackPtr->Parameters.FileSystemControl.InputBufferLength = InputBufferSize;
- StackPtr->Parameters.FileSystemControl.OutputBufferLength =
- OutputBufferSize;
- StackPtr->MajorFunction = IRP_MJ_FILE_SYSTEM_CONTROL;
-
- Status = IoCallDriver(DeviceObject,Irp);
- if (Status == STATUS_PENDING && (FileObject->Flags & FO_SYNCHRONOUS_IO))
- {
- KeWaitForSingleObject(ptrEvent,
- Executive,
- PreviousMode,
- FileObject->Flags & FO_ALERTABLE_IO,
- NULL);
- Status = IoStatusBlock->Status;
- }
-
- return Status;
-}
-
-
VOID INIT_FUNCTION
IoInitFileSystemImplementation(VOID)
{