2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: drivers/fs/np/fsctrl.c
5 * PURPOSE: Named pipe filesystem
6 * PROGRAMMER: David Welch <welch@cwcom.net>
11 /* INCLUDES ******************************************************************/
18 //#define USING_PROPER_NPFS_WAIT_SEMANTICS
20 /* FUNCTIONS *****************************************************************/
22 static DRIVER_CANCEL NpfsListeningCancelRoutine
;
24 NpfsListeningCancelRoutine(IN PDEVICE_OBJECT DeviceObject
,
27 PNPFS_WAITER_ENTRY Waiter
;
29 Waiter
= (PNPFS_WAITER_ENTRY
)&Irp
->Tail
.Overlay
.DriverContext
;
31 DPRINT("NpfsListeningCancelRoutine() called for <%wZ>\n",
32 &Waiter
->Ccb
->Fcb
->PipeName
);
34 IoReleaseCancelSpinLock(Irp
->CancelIrql
);
37 KeLockMutex(&Waiter
->Ccb
->Fcb
->CcbListLock
);
38 RemoveEntryList(&Waiter
->Entry
);
39 KeUnlockMutex(&Waiter
->Ccb
->Fcb
->CcbListLock
);
41 Irp
->IoStatus
.Status
= STATUS_CANCELLED
;
42 Irp
->IoStatus
.Information
= 0;
43 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
48 NpfsAddListeningServerInstance(PIRP Irp
,
51 PNPFS_WAITER_ENTRY Entry
;
54 Entry
= (PNPFS_WAITER_ENTRY
)&Irp
->Tail
.Overlay
.DriverContext
;
58 KeLockMutex(&Ccb
->Fcb
->CcbListLock
);
60 IoMarkIrpPending(Irp
);
61 InsertTailList(&Ccb
->Fcb
->WaiterListHead
, &Entry
->Entry
);
63 IoAcquireCancelSpinLock(&oldIrql
);
66 (void)IoSetCancelRoutine(Irp
, NpfsListeningCancelRoutine
);
67 IoReleaseCancelSpinLock(oldIrql
);
68 KeUnlockMutex(&Ccb
->Fcb
->CcbListLock
);
69 return STATUS_PENDING
;
71 IoReleaseCancelSpinLock(oldIrql
);
73 RemoveEntryList(&Entry
->Entry
);
75 Irp
->IoStatus
.Status
= STATUS_CANCELLED
;
76 Irp
->IoStatus
.Information
= 0;
77 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
78 KeUnlockMutex(&Ccb
->Fcb
->CcbListLock
);
80 return STATUS_CANCELLED
;
85 NpfsConnectPipe(PIRP Irp
,
88 PIO_STACK_LOCATION IoStack
;
89 PFILE_OBJECT FileObject
;
91 PLIST_ENTRY current_entry
;
96 DPRINT("NpfsConnectPipe()\n");
98 /* Fail, if the CCB is not a pipe CCB */
99 if (Ccb
->Type
!= CCB_PIPE
)
101 DPRINT("Not a pipe\n");
102 return STATUS_ILLEGAL_FUNCTION
;
105 /* Fail, if the CCB is not a server end CCB */
106 if (Ccb
->PipeEnd
!= FILE_PIPE_SERVER_END
)
108 DPRINT("Not the server end\n");
109 return STATUS_ILLEGAL_FUNCTION
;
112 if (Ccb
->PipeState
== FILE_PIPE_CONNECTED_STATE
)
114 KeResetEvent(&Ccb
->ConnectEvent
);
115 return STATUS_PIPE_CONNECTED
;
118 if (Ccb
->PipeState
== FILE_PIPE_CLOSING_STATE
)
119 return STATUS_PIPE_CLOSING
;
121 DPRINT("Waiting for connection...\n");
124 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
125 FileObject
= IoStack
->FileObject
;
126 Flags
= FileObject
->Flags
;
128 /* search for a listening client fcb */
129 KeLockMutex(&Fcb
->CcbListLock
);
131 current_entry
= Fcb
->ClientCcbListHead
.Flink
;
132 while (current_entry
!= &Fcb
->ClientCcbListHead
)
134 ClientCcb
= CONTAINING_RECORD(current_entry
,
138 if (ClientCcb
->PipeState
== 0)
140 /* found a passive (waiting) client CCB */
141 DPRINT("Passive (waiting) client CCB found -- wake the client\n");
142 KeSetEvent(&ClientCcb
->ConnectEvent
, IO_NO_INCREMENT
, FALSE
);
147 if (ClientCcb
->PipeState
== FILE_PIPE_LISTENING_STATE
)
149 /* found a listening client CCB */
150 DPRINT("Listening client CCB found -- connecting\n");
152 /* connect client and server CCBs */
153 Ccb
->OtherSide
= ClientCcb
;
154 ClientCcb
->OtherSide
= Ccb
;
156 /* set connected state */
157 Ccb
->PipeState
= FILE_PIPE_CONNECTED_STATE
;
158 ClientCcb
->PipeState
= FILE_PIPE_CONNECTED_STATE
;
160 KeUnlockMutex(&Fcb
->CcbListLock
);
162 /* FIXME: create and initialize data queues */
164 /* signal client's connect event */
165 DPRINT("Setting the ConnectEvent for %x\n", ClientCcb
);
166 KeSetEvent(&ClientCcb
->ConnectEvent
, IO_NO_INCREMENT
, FALSE
);
168 return STATUS_PIPE_CONNECTED
;
172 current_entry
= current_entry
->Flink
;
175 /* no listening client fcb found */
176 DPRINT("No listening client fcb found -- waiting for client\n");
178 Ccb
->PipeState
= FILE_PIPE_LISTENING_STATE
;
180 Status
= NpfsAddListeningServerInstance(Irp
, Ccb
);
182 KeUnlockMutex(&Fcb
->CcbListLock
);
184 if (Flags
& FO_SYNCHRONOUS_IO
)
186 KeWaitForSingleObject(&Ccb
->ConnectEvent
,
193 DPRINT("NpfsConnectPipe() done (Status %lx)\n", Status
);
200 NpfsDisconnectPipe(PNPFS_CCB Ccb
)
207 DPRINT("NpfsDisconnectPipe()\n");
209 /* Fail, if the CCB is not a pipe CCB */
210 if (Ccb
->Type
!= CCB_PIPE
)
212 DPRINT("Not a pipe\n");
213 return STATUS_ILLEGAL_FUNCTION
;
216 /* Fail, if the CCB is not a server end CCB */
217 if (Ccb
->PipeEnd
!= FILE_PIPE_SERVER_END
)
219 DPRINT("Not the server end\n");
220 return STATUS_ILLEGAL_FUNCTION
;
224 KeLockMutex(&Fcb
->CcbListLock
);
226 if (Ccb
->PipeState
== FILE_PIPE_DISCONNECTED_STATE
)
228 DPRINT("Pipe is already disconnected\n");
229 Status
= STATUS_PIPE_DISCONNECTED
;
231 else if ((!Ccb
->OtherSide
) && (Ccb
->PipeState
== FILE_PIPE_CONNECTED_STATE
))
233 ExAcquireFastMutex(&Ccb
->DataListLock
);
234 Ccb
->PipeState
= FILE_PIPE_DISCONNECTED_STATE
;
235 ExReleaseFastMutex(&Ccb
->DataListLock
);
236 Status
= STATUS_SUCCESS
;
238 else if (Ccb
->PipeState
== FILE_PIPE_CONNECTED_STATE
)
240 Server
= (Ccb
->PipeEnd
== FILE_PIPE_SERVER_END
);
241 OtherSide
= Ccb
->OtherSide
;
242 //Ccb->OtherSide = NULL;
243 Ccb
->PipeState
= FILE_PIPE_DISCONNECTED_STATE
;
244 /* Lock the server first */
247 ExAcquireFastMutex(&Ccb
->DataListLock
);
248 ExAcquireFastMutex(&OtherSide
->DataListLock
);
252 ExAcquireFastMutex(&OtherSide
->DataListLock
);
253 ExAcquireFastMutex(&Ccb
->DataListLock
);
255 OtherSide
->PipeState
= FILE_PIPE_DISCONNECTED_STATE
;
256 //OtherSide->OtherSide = NULL;
258 * Signaling the write event. If is possible that an other
259 * thread waits for an empty buffer.
261 KeSetEvent(&OtherSide
->ReadEvent
, IO_NO_INCREMENT
, FALSE
);
262 KeSetEvent(&OtherSide
->WriteEvent
, IO_NO_INCREMENT
, FALSE
);
265 ExReleaseFastMutex(&OtherSide
->DataListLock
);
266 ExReleaseFastMutex(&Ccb
->DataListLock
);
270 ExReleaseFastMutex(&Ccb
->DataListLock
);
271 ExReleaseFastMutex(&OtherSide
->DataListLock
);
273 Status
= STATUS_SUCCESS
;
275 else if (Ccb
->PipeState
== FILE_PIPE_LISTENING_STATE
)
278 PNPFS_WAITER_ENTRY WaitEntry
= NULL
;
279 BOOLEAN Complete
= FALSE
;
282 Entry
= Ccb
->Fcb
->WaiterListHead
.Flink
;
283 while (Entry
!= &Ccb
->Fcb
->WaiterListHead
)
285 WaitEntry
= CONTAINING_RECORD(Entry
, NPFS_WAITER_ENTRY
, Entry
);
286 if (WaitEntry
->Ccb
== Ccb
)
288 RemoveEntryList(Entry
);
289 Irp
= CONTAINING_RECORD(Entry
, IRP
, Tail
.Overlay
.DriverContext
);
290 Complete
= (NULL
== IoSetCancelRoutine(Irp
, NULL
));
293 Entry
= Entry
->Flink
;
300 Irp
->IoStatus
.Status
= STATUS_PIPE_BROKEN
;
301 Irp
->IoStatus
.Information
= 0;
302 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
305 Ccb
->PipeState
= FILE_PIPE_DISCONNECTED_STATE
;
306 Status
= STATUS_SUCCESS
;
308 else if (Ccb
->PipeState
== FILE_PIPE_CLOSING_STATE
)
310 Status
= STATUS_PIPE_CLOSING
;
314 Status
= STATUS_UNSUCCESSFUL
;
316 KeUnlockMutex(&Fcb
->CcbListLock
);
321 NpfsWaitPipe(PIRP Irp
,
324 PLIST_ENTRY current_entry
;
327 PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe
;
328 PLARGE_INTEGER TimeOut
;
330 PEXTENDED_IO_STACK_LOCATION IoStack
;
331 PFILE_OBJECT FileObject
;
334 IoStack
= (PEXTENDED_IO_STACK_LOCATION
)IoGetCurrentIrpStackLocation(Irp
);
336 FileObject
= IoStack
->FileObject
;
339 DPRINT("Waiting on Pipe %wZ\n", &FileObject
->FileName
);
341 WaitPipe
= (PFILE_PIPE_WAIT_FOR_BUFFER
)Irp
->AssociatedIrp
.SystemBuffer
;
344 ASSERT(Ccb
->Fcb
->Vcb
);
349 /* Lock the pipe list */
350 KeLockMutex(&Vcb
->PipeListLock
);
352 /* File a pipe with the given name */
353 Fcb
= NpfsFindPipe(Vcb
,
354 &FileObject
->FileName
);
356 /* Unlock the pipe list */
357 KeUnlockMutex(&Vcb
->PipeListLock
);
359 /* Fail if not pipe was found */
362 DPRINT("No pipe found!\n", Fcb
);
363 return STATUS_OBJECT_NAME_NOT_FOUND
;
366 /* search for listening server */
367 current_entry
= Fcb
->ServerCcbListHead
.Flink
;
368 while (current_entry
!= &Fcb
->ServerCcbListHead
)
370 ServerCcb
= CONTAINING_RECORD(current_entry
,
374 if (ServerCcb
->PipeState
== FILE_PIPE_LISTENING_STATE
)
376 /* found a listening server CCB */
377 DPRINT("Listening server CCB found -- connecting\n");
379 return STATUS_SUCCESS
;
382 current_entry
= current_entry
->Flink
;
385 /* No listening server fcb found, so wait for one */
387 /* If a timeout specified */
388 if (WaitPipe
->TimeoutSpecified
)
390 /* NMPWAIT_USE_DEFAULT_WAIT = 0 */
391 if (WaitPipe
->Timeout
.QuadPart
== 0)
393 TimeOut
= &Fcb
->TimeOut
;
397 TimeOut
= &WaitPipe
->Timeout
;
406 Status
= KeWaitForSingleObject(&Ccb
->ConnectEvent
,
412 DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status
);
418 NpfsWaitPipe2(PIRP Irp
,
421 PLIST_ENTRY current_entry
;
424 PFILE_PIPE_WAIT_FOR_BUFFER WaitPipe
;
425 LARGE_INTEGER TimeOut
;
427 #ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
429 UNICODE_STRING PipeName
;
432 DPRINT("NpfsWaitPipe\n");
434 WaitPipe
= (PFILE_PIPE_WAIT_FOR_BUFFER
)Irp
->AssociatedIrp
.SystemBuffer
;
436 #ifdef USING_PROPER_NPFS_WAIT_SEMANTICS
437 /* Fail, if the CCB does not represent the root directory */
438 if (Ccb
->Type
!= CCB_DIRECTORY
)
439 return STATUS_ILLEGAL_FUNCTION
;
441 /* Calculate the pipe name length and allocate the buffer */
442 PipeName
.Length
= WaitPipe
->NameLength
+ sizeof(WCHAR
);
443 PipeName
.MaximumLength
= PipeName
.Length
+ sizeof(WCHAR
);
444 PipeName
.Buffer
= ExAllocatePool(NonPagedPool
, PipeName
.MaximumLength
);
445 if (PipeName
.Buffer
== NULL
)
447 DPRINT1("Could not allocate memory for the pipe name!\n");
448 return STATUS_NO_MEMORY
;
451 /* Copy the pipe name into the buffer, prepend a backslash and append a 0 character */
452 PipeName
.Buffer
[0] = L
'\\';
453 RtlCopyMemory(&PipeName
.Buffer
[1],
455 WaitPipe
->NameLength
);
456 PipeName
.Buffer
[PipeName
.Length
/ sizeof(WCHAR
)] = 0;
458 DPRINT("Waiting for Pipe %wZ\n", &PipeName
);
463 /* Lock the pipe list */
464 KeLockMutex(&Vcb
->PipeListLock
);
466 /* File a pipe with the given name */
467 Fcb
= NpfsFindPipe(Vcb
,
470 /* Unlock the pipe list */
471 KeUnlockMutex(&Vcb
->PipeListLock
);
473 /* Release the pipe name buffer */
474 ExFreePool(PipeName
.Buffer
);
476 /* Fail if not pipe was found */
479 DPRINT("No pipe found!\n", Fcb
);
480 return STATUS_OBJECT_NAME_NOT_FOUND
;
483 DPRINT("Fcb %p\n", Fcb
);
487 if (Ccb
->PipeState
!= 0)
489 DPRINT("Pipe is not in passive (waiting) state!\n");
490 return STATUS_UNSUCCESSFUL
;
494 /* search for listening server */
495 current_entry
= Fcb
->ServerCcbListHead
.Flink
;
496 while (current_entry
!= &Fcb
->ServerCcbListHead
)
498 ServerCcb
= CONTAINING_RECORD(current_entry
,
502 if (ServerCcb
->PipeState
== FILE_PIPE_LISTENING_STATE
)
504 /* found a listening server CCB */
505 DPRINT("Listening server CCB found -- connecting\n");
507 return STATUS_SUCCESS
;
510 current_entry
= current_entry
->Flink
;
513 /* No listening server fcb found */
515 /* If no timeout specified, use the default one */
516 if (WaitPipe
->TimeoutSpecified
)
517 TimeOut
= WaitPipe
->Timeout
;
519 TimeOut
= Fcb
->TimeOut
;
522 Status
= KeWaitForSingleObject(&Ccb
->ConnectEvent
,
528 DPRINT("KeWaitForSingleObject() returned (Status %lx)\n", Status
);
535 * FUNCTION: Return current state of a pipe
537 * Irp = Pointer to I/O request packet
538 * IrpSp = Pointer to current stack location of Irp
540 * Status of operation
544 * FUNCTION: Peek at a pipe (get information about messages)
546 * Irp = Pointer to I/O request packet
547 * IoStack = Pointer to current stack location of Irp
549 * Status of operation
552 NpfsPeekPipe(PIRP Irp
,
553 PIO_STACK_LOCATION IoStack
)
555 ULONG OutputBufferLength
;
556 ULONG ReturnLength
= 0;
557 PFILE_PIPE_PEEK_BUFFER Reply
;
561 ULONG MessageCount
= 0;
563 ULONG ReadDataAvailable
;
566 DPRINT("NpfsPeekPipe\n");
568 OutputBufferLength
= IoStack
->Parameters
.DeviceIoControl
.OutputBufferLength
;
569 DPRINT("OutputBufferLength: %lu\n", OutputBufferLength
);
571 /* Validate parameters */
572 if (OutputBufferLength
< sizeof(FILE_PIPE_PEEK_BUFFER
))
574 DPRINT1("Buffer too small\n");
575 return STATUS_INVALID_PARAMETER
;
578 Ccb
= IoStack
->FileObject
->FsContext2
;
579 Reply
= (PFILE_PIPE_PEEK_BUFFER
)Irp
->AssociatedIrp
.SystemBuffer
;
583 Reply
->NamedPipeState
= Ccb
->PipeState
;
585 Reply
->ReadDataAvailable
= Ccb
->ReadDataAvailable
;
586 DPRINT("ReadDataAvailable: %lu\n", Ccb
->ReadDataAvailable
);
588 ExAcquireFastMutex(&Ccb
->DataListLock
);
589 BufferPtr
= Ccb
->ReadPtr
;
590 DPRINT("BufferPtr = %x\n", BufferPtr
);
591 if (Ccb
->Fcb
->PipeType
== FILE_PIPE_BYTE_STREAM_TYPE
)
593 DPRINT("Byte Stream Mode\n");
594 Reply
->MessageLength
= Ccb
->ReadDataAvailable
;
595 DPRINT("Reply->MessageLength %lu\n",Reply
->MessageLength
);
598 if (Reply
->Data
[0] && (OutputBufferLength
>= Ccb
->ReadDataAvailable
+ FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER
, Data
[0])))
600 ReturnLength
= Ccb
->ReadDataAvailable
;
601 memcpy(&Reply
->Data
[0], (PVOID
)BufferPtr
, Ccb
->ReadDataAvailable
);
606 DPRINT("Message Mode\n");
607 ReadDataAvailable
=Ccb
->ReadDataAvailable
;
609 if (ReadDataAvailable
> 0)
611 memcpy(&Reply
->MessageLength
, BufferPtr
, sizeof(ULONG
));
613 while ((ReadDataAvailable
> 0) && (BufferPtr
< Ccb
->WritePtr
))
615 memcpy(&MessageLength
, BufferPtr
, sizeof(MessageLength
));
617 ASSERT(MessageLength
> 0);
619 DPRINT("MessageLength = %lu\n",MessageLength
);
620 ReadDataAvailable
-= MessageLength
;
623 /* If its the first message, copy the Message if the size of buffer is large enough */
627 && (OutputBufferLength
>= (MessageLength
+ FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER
, Data
[0]))))
629 memcpy(&Reply
->Data
[0], (PVOID
)((ULONG_PTR
)BufferPtr
+ sizeof(MessageLength
)), MessageLength
);
630 ReturnLength
= MessageLength
;
634 BufferPtr
=(PVOID
)((ULONG_PTR
)BufferPtr
+ MessageLength
+ sizeof(MessageLength
));
635 DPRINT("BufferPtr = %x\n", BufferPtr
);
636 DPRINT("ReadDataAvailable: %lu\n", ReadDataAvailable
);
639 if (ReadDataAvailable
!= 0)
641 DPRINT1("Possible memory corruption.\n");
646 ExReleaseFastMutex(&Ccb
->DataListLock
);
648 Reply
->NumberOfMessages
= MessageCount
;
650 Irp
->IoStatus
.Information
= ReturnLength
+ FIELD_OFFSET(FILE_PIPE_PEEK_BUFFER
, Data
[0]);
651 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
653 Status
= STATUS_SUCCESS
;
655 DPRINT("NpfsPeekPipe done\n");
662 NpfsFileSystemControl(PDEVICE_OBJECT DeviceObject
,
665 PIO_STACK_LOCATION IoStack
;
666 PFILE_OBJECT FileObject
;
672 DPRINT("NpfsFileSystemContol(DeviceObject %p Irp %p)\n", DeviceObject
, Irp
);
674 Vcb
= (PNPFS_VCB
)DeviceObject
->DeviceExtension
;
675 IoStack
= IoGetCurrentIrpStackLocation(Irp
);
676 DPRINT("IoStack: %p\n", IoStack
);
677 FileObject
= IoStack
->FileObject
;
678 DPRINT("FileObject: %p\n", FileObject
);
679 Ccb
= FileObject
->FsContext2
;
680 DPRINT("CCB: %p\n", Ccb
);
682 DPRINT("Pipe: %p\n", Fcb
);
683 DPRINT("PipeName: %wZ\n", &Fcb
->PipeName
);
685 Irp
->IoStatus
.Information
= 0;
687 switch (IoStack
->Parameters
.FileSystemControl
.FsControlCode
)
689 case FSCTL_PIPE_ASSIGN_EVENT
:
690 DPRINT1("Assign event not implemented\n");
691 Status
= STATUS_NOT_IMPLEMENTED
;
694 case FSCTL_PIPE_DISCONNECT
:
695 DPRINT("Disconnecting pipe %wZ\n", &Fcb
->PipeName
);
696 Status
= NpfsDisconnectPipe(Ccb
);
699 case FSCTL_PIPE_LISTEN
:
700 DPRINT("Connecting pipe %wZ\n", &Fcb
->PipeName
);
701 Status
= NpfsConnectPipe(Irp
, Ccb
);
704 case FSCTL_PIPE_PEEK
:
705 DPRINT("Peeking pipe %wZ\n", &Fcb
->PipeName
);
706 Status
= NpfsPeekPipe(Irp
, (PIO_STACK_LOCATION
)IoStack
);
709 case FSCTL_PIPE_QUERY_EVENT
:
710 DPRINT1("Query event not implemented\n");
711 Status
= STATUS_NOT_IMPLEMENTED
;
714 case FSCTL_PIPE_TRANSCEIVE
:
715 /* If you implement this, please remove the workaround in
716 lib/kernel32/file/npipe.c function TransactNamedPipe() */
717 DPRINT1("Transceive not implemented\n");
718 Status
= STATUS_NOT_IMPLEMENTED
;
721 case FSCTL_PIPE_WAIT
:
722 DPRINT("Waiting for pipe %wZ\n", &Fcb
->PipeName
);
723 Status
= NpfsWaitPipe(Irp
, Ccb
);
726 case FSCTL_PIPE_IMPERSONATE
:
727 DPRINT1("Impersonate not implemented\n");
728 Status
= STATUS_NOT_IMPLEMENTED
;
731 case FSCTL_PIPE_SET_CLIENT_PROCESS
:
732 DPRINT1("Set client process not implemented\n");
733 Status
= STATUS_NOT_IMPLEMENTED
;
736 case FSCTL_PIPE_QUERY_CLIENT_PROCESS
:
737 DPRINT1("Query client process not implemented\n");
738 Status
= STATUS_NOT_IMPLEMENTED
;
741 case FSCTL_PIPE_INTERNAL_READ
:
742 DPRINT1("Internal read not implemented\n");
743 Status
= STATUS_NOT_IMPLEMENTED
;
746 case FSCTL_PIPE_INTERNAL_WRITE
:
747 DPRINT1("Internal write not implemented\n");
748 Status
= STATUS_NOT_IMPLEMENTED
;
751 case FSCTL_PIPE_INTERNAL_TRANSCEIVE
:
752 DPRINT1("Internal transceive not implemented\n");
753 Status
= STATUS_NOT_IMPLEMENTED
;
756 case FSCTL_PIPE_INTERNAL_READ_OVFLOW
:
757 DPRINT1("Internal read overflow not implemented\n");
758 Status
= STATUS_NOT_IMPLEMENTED
;
762 DPRINT1("Unrecognized IoControlCode: %x\n",
763 IoStack
->Parameters
.FileSystemControl
.FsControlCode
);
764 Status
= STATUS_UNSUCCESSFUL
;
767 if (Status
!= STATUS_PENDING
)
769 Irp
->IoStatus
.Status
= Status
;
771 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
779 NpfsFlushBuffers(PDEVICE_OBJECT DeviceObject
,
782 /* FIXME: Implement */
784 Irp
->IoStatus
.Status
= STATUS_SUCCESS
;
785 Irp
->IoStatus
.Information
= 0;
787 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
789 return STATUS_SUCCESS
;