2013-09-11 23:19:20 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Named Pipe FileSystem
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: drivers/filesystems/npfs/fileinfo.c
|
|
|
|
* PURPOSE: Pipes Information
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
#include "npfs.h"
|
|
|
|
|
2013-09-12 00:05:54 +00:00
|
|
|
// File ID number for NPFS bugchecking support
|
|
|
|
#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_FILEINFO)
|
|
|
|
|
2013-09-11 23:19:20 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpSetBasicInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PFILE_BASIC_INFORMATION Buffer)
|
|
|
|
{
|
|
|
|
PAGED_CODE();
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpSetPipeInfo(IN PNP_FCB Fcb,
|
2014-10-16 16:36:17 +00:00
|
|
|
IN PNP_CCB Ccb,
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
IN PFILE_PIPE_INFORMATION Buffer,
|
2014-10-16 16:36:17 +00:00
|
|
|
IN ULONG NamedPipeEnd,
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
IN PLIST_ENTRY List)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
2014-10-16 16:36:17 +00:00
|
|
|
PNP_DATA_QUEUE ReadQueue, WriteQueue;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
PAGED_CODE();
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (Buffer->ReadMode == FILE_PIPE_MESSAGE_MODE && Fcb->NamedPipeType == FILE_PIPE_BYTE_STREAM_TYPE)
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
{
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (NamedPipeEnd != FILE_PIPE_CLIENT_END)
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
{
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (NamedPipeEnd != FILE_PIPE_SERVER_END)
|
|
|
|
{
|
2013-09-12 00:05:54 +00:00
|
|
|
NpBugCheck(NamedPipeEnd, 0, 0);
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
}
|
|
|
|
ReadQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
|
|
|
|
WriteQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
ReadQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
|
|
|
|
WriteQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
}
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (Buffer->CompletionMode != FILE_PIPE_COMPLETE_OPERATION ||
|
|
|
|
Ccb->CompletionMode[NamedPipeEnd] == FILE_PIPE_COMPLETE_OPERATION ||
|
2015-01-31 15:58:00 +00:00
|
|
|
(ReadQueue->QueueState != ReadEntries &&
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
WriteQueue->QueueState != WriteEntries))
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
{
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
Ccb->ReadMode[NamedPipeEnd] = Buffer->ReadMode & 0xFF;
|
|
|
|
Ccb->CompletionMode[NamedPipeEnd] = Buffer->CompletionMode & 0xFF;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
NpCheckForNotify(Fcb->ParentDcb, FALSE, List);
|
|
|
|
Status = STATUS_SUCCESS;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Status = STATUS_PIPE_BUSY;
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCommonSetInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PLIST_ENTRY List)
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeTypeCode;
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
ULONG InfoClass;
|
|
|
|
PVOID Buffer;
|
|
|
|
PNP_FCB Fcb;
|
|
|
|
PNP_CCB Ccb;
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
ULONG NamedPipeEnd;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
PAGED_CODE();
|
|
|
|
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
|
|
|
|
NodeTypeCode = NpDecodeFileObject(IoStack->FileObject,
|
|
|
|
(PVOID*)&Fcb,
|
|
|
|
&Ccb,
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
&NamedPipeEnd);
|
|
|
|
if (!NodeTypeCode) return STATUS_PIPE_DISCONNECTED;
|
|
|
|
if (NodeTypeCode != NPFS_NTC_CCB) return STATUS_INVALID_PARAMETER;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
|
|
|
InfoClass = IoStack->Parameters.QueryFile.FileInformationClass;
|
|
|
|
Buffer = Irp->AssociatedIrp.SystemBuffer;
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (InfoClass == FileBasicInformation) return NpSetBasicInfo(Ccb, Buffer);
|
2014-10-16 16:36:17 +00:00
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (InfoClass != FilePipeInformation) return STATUS_INVALID_PARAMETER;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
return NpSetPipeInfo(Fcb, Ccb, Buffer, NamedPipeEnd, List);
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdSetInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
2013-09-11 17:10:30 +00:00
|
|
|
LIST_ENTRY DeferredList;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
PAGED_CODE();
|
|
|
|
|
2013-09-11 17:10:30 +00:00
|
|
|
InitializeListHead(&DeferredList);
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
|
|
|
FsRtlEnterFileSystem();
|
2013-09-11 17:10:30 +00:00
|
|
|
NpAcquireExclusiveVcb();
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
2013-09-11 17:10:30 +00:00
|
|
|
Status = NpCommonSetInformation(DeviceObject, Irp, &DeferredList);
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
2013-09-11 17:10:30 +00:00
|
|
|
NpReleaseVcb();
|
|
|
|
NpCompleteDeferredIrps(&DeferredList);
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
FsRtlExitFileSystem();
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (Status != STATUS_PENDING)
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
{
|
|
|
|
Irp->IoStatus.Status = Status;
|
|
|
|
IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryBasicInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length)
|
|
|
|
{
|
|
|
|
PFILE_BASIC_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
InfoBuffer->FileAttributes = FILE_ATTRIBUTE_NORMAL;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryStandardInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length,
|
|
|
|
IN ULONG NamedPipeEnd)
|
|
|
|
{
|
|
|
|
PNP_DATA_QUEUE DataQueue;
|
|
|
|
PFILE_STANDARD_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
if (NamedPipeEnd == FILE_PIPE_SERVER_END)
|
|
|
|
{
|
|
|
|
DataQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DataQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
|
|
|
|
}
|
|
|
|
|
|
|
|
InfoBuffer->AllocationSize.LowPart = Ccb->DataQueue[FILE_PIPE_INBOUND].Quota +
|
|
|
|
Ccb->DataQueue[FILE_PIPE_OUTBOUND].Quota;
|
|
|
|
InfoBuffer->AllocationSize.HighPart = 0;
|
|
|
|
|
|
|
|
if (DataQueue->QueueState == WriteEntries)
|
|
|
|
{
|
|
|
|
InfoBuffer->EndOfFile.HighPart = 0;
|
|
|
|
InfoBuffer->EndOfFile.LowPart = DataQueue->BytesInQueue -
|
|
|
|
DataQueue->ByteOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
InfoBuffer->Directory = FALSE;
|
|
|
|
InfoBuffer->NumberOfLinks = 1;
|
|
|
|
InfoBuffer->DeletePending = TRUE;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryEaInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length)
|
|
|
|
{
|
|
|
|
PFILE_EA_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryNameInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length)
|
|
|
|
{
|
|
|
|
PFILE_NAME_INFORMATION InfoBuffer = Buffer;
|
|
|
|
USHORT NameLength;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PWCHAR Name;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
if (Ccb->NodeType == NPFS_NTC_ROOT_DCB_CCB)
|
|
|
|
{
|
|
|
|
NameLength = NpVcb->RootDcb->FullName.Length;
|
|
|
|
Name = NpVcb->RootDcb->FullName.Buffer;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NameLength = Ccb->Fcb->FullName.Length;
|
|
|
|
Name = Ccb->Fcb->FullName.Buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*Length < NameLength)
|
|
|
|
{
|
|
|
|
Status = STATUS_BUFFER_OVERFLOW;
|
2013-09-12 00:05:54 +00:00
|
|
|
NameLength = (USHORT)*Length;
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
RtlCopyMemory(InfoBuffer->FileName, Name, NameLength);
|
|
|
|
InfoBuffer->FileNameLength = NameLength;
|
|
|
|
|
|
|
|
*Length -= NameLength;
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryInternalInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length)
|
|
|
|
{
|
|
|
|
PFILE_INTERNAL_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryPositionInfo(IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length,
|
|
|
|
IN ULONG NamedPipeEnd)
|
|
|
|
{
|
|
|
|
PNP_DATA_QUEUE DataQueue;
|
|
|
|
PFILE_POSITION_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
if (NamedPipeEnd == FILE_PIPE_SERVER_END)
|
|
|
|
{
|
|
|
|
DataQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DataQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (DataQueue->QueueState == WriteEntries)
|
|
|
|
{
|
|
|
|
InfoBuffer->CurrentByteOffset.QuadPart = DataQueue->BytesInQueue -
|
|
|
|
DataQueue->ByteOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryPipeLocalInfo(IN PNP_FCB Fcb,
|
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length,
|
|
|
|
IN ULONG NamedPipeEnd)
|
|
|
|
{
|
|
|
|
PFILE_PIPE_LOCAL_INFORMATION InfoBuffer = Buffer;
|
|
|
|
PNP_DATA_QUEUE InQueue, OutQueue;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
InQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
|
|
|
|
OutQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
|
|
|
|
|
|
|
|
InfoBuffer->NamedPipeType = Fcb->NamedPipeType;
|
|
|
|
InfoBuffer->NamedPipeConfiguration = Fcb->NamedPipeConfiguration;
|
|
|
|
InfoBuffer->MaximumInstances = Fcb->MaximumInstances;
|
|
|
|
InfoBuffer->CurrentInstances = Fcb->CurrentInstances;
|
|
|
|
InfoBuffer->InboundQuota = InQueue->Quota;
|
|
|
|
InfoBuffer->OutboundQuota = OutQueue->Quota;
|
|
|
|
InfoBuffer->NamedPipeState = Ccb->NamedPipeState;
|
|
|
|
InfoBuffer->NamedPipeEnd = NamedPipeEnd;
|
|
|
|
|
|
|
|
if (NamedPipeEnd == FILE_PIPE_SERVER_END)
|
|
|
|
{
|
|
|
|
if (InQueue->QueueState == WriteEntries)
|
|
|
|
{
|
|
|
|
InfoBuffer->ReadDataAvailable = InQueue->BytesInQueue - InQueue->ByteOffset;
|
|
|
|
}
|
2013-09-11 02:04:17 +00:00
|
|
|
InfoBuffer->WriteQuotaAvailable = OutQueue->Quota - OutQueue->QuotaUsed;
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (OutQueue->QueueState == WriteEntries)
|
|
|
|
{
|
|
|
|
InfoBuffer->ReadDataAvailable = OutQueue->BytesInQueue - OutQueue->ByteOffset;
|
|
|
|
}
|
2013-09-11 02:04:17 +00:00
|
|
|
InfoBuffer->WriteQuotaAvailable = OutQueue->Quota - InQueue->QuotaUsed;
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpQueryPipeInfo(IN PNP_FCB Fcb,
|
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN OUT PULONG Length,
|
|
|
|
IN ULONG NamedPipeEnd)
|
|
|
|
{
|
|
|
|
PFILE_PIPE_INFORMATION InfoBuffer = Buffer;
|
|
|
|
|
|
|
|
*Length -= sizeof(*InfoBuffer);
|
|
|
|
|
|
|
|
RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
|
|
|
|
|
|
|
|
InfoBuffer->ReadMode = Ccb->ReadMode[NamedPipeEnd];
|
|
|
|
InfoBuffer->CompletionMode = Ccb->CompletionMode[NamedPipeEnd];
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp)
|
|
|
|
{
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
NODE_TYPE_CODE NodeTypeCode;
|
|
|
|
ULONG NamedPipeEnd;
|
|
|
|
PNP_FCB Fcb;
|
|
|
|
PNP_CCB Ccb;
|
|
|
|
FILE_INFORMATION_CLASS InfoClass;
|
|
|
|
ULONG Length;
|
|
|
|
PVOID Buffer;
|
|
|
|
PFILE_ALL_INFORMATION AllInfo;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PAGED_CODE();
|
|
|
|
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
NodeTypeCode = NpDecodeFileObject(IoStack->FileObject,
|
|
|
|
(PVOID*)&Fcb,
|
|
|
|
&Ccb,
|
|
|
|
&NamedPipeEnd);
|
|
|
|
if (!NodeTypeCode) return STATUS_PIPE_DISCONNECTED;
|
|
|
|
|
|
|
|
Buffer = Irp->AssociatedIrp.SystemBuffer;
|
|
|
|
Length = IoStack->Parameters.QueryFile.Length;
|
|
|
|
InfoClass = IoStack->Parameters.QueryFile.FileInformationClass;
|
|
|
|
|
|
|
|
if (NodeTypeCode != NPFS_NTC_CCB)
|
|
|
|
{
|
|
|
|
if (NodeTypeCode != NPFS_NTC_ROOT_DCB || InfoClass != FileNameInformation)
|
|
|
|
{
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (InfoClass)
|
|
|
|
{
|
|
|
|
case FileNameInformation:
|
|
|
|
Status = NpQueryNameInfo(Ccb, Buffer, &Length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FilePositionInformation:
|
|
|
|
Status = NpQueryPositionInfo(Ccb, Buffer, &Length, NamedPipeEnd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FilePipeInformation:
|
|
|
|
Status = NpQueryPipeInfo(Fcb, Ccb, Buffer, &Length, NamedPipeEnd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FilePipeLocalInformation:
|
|
|
|
Status = NpQueryPipeLocalInfo(Fcb, Ccb, Buffer, &Length, NamedPipeEnd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileBasicInformation:
|
|
|
|
Status = NpQueryBasicInfo(Ccb, Buffer, &Length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileStandardInformation:
|
|
|
|
Status = NpQueryStandardInfo(Ccb, Buffer, &Length, NamedPipeEnd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileInternalInformation:
|
|
|
|
Status = NpQueryInternalInfo(Ccb, Buffer, &Length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileAllInformation:
|
|
|
|
|
2020-06-23 08:15:24 +00:00
|
|
|
Length -= sizeof(FILE_ACCESS_INFORMATION) + sizeof(FILE_MODE_INFORMATION) + sizeof(FILE_ALIGNMENT_INFORMATION);
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
AllInfo = (PFILE_ALL_INFORMATION)Buffer;
|
|
|
|
NpQueryBasicInfo(Ccb, &AllInfo->BasicInformation, &Length);
|
|
|
|
NpQueryStandardInfo(Ccb, &AllInfo->StandardInformation, &Length, NamedPipeEnd);
|
|
|
|
NpQueryInternalInfo(Ccb, &AllInfo->InternalInformation, &Length);
|
|
|
|
NpQueryEaInfo(Ccb, &AllInfo->EaInformation, &Length);
|
|
|
|
NpQueryPositionInfo(Ccb, &AllInfo->PositionInformation, &Length, NamedPipeEnd);
|
2014-04-06 16:15:06 +00:00
|
|
|
Status = NpQueryNameInfo(Ccb, &AllInfo->NameInformation, &Length);
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FileEaInformation:
|
|
|
|
Status = NpQueryEaInfo(Ccb, Buffer, &Length);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
Status = STATUS_INVALID_PARAMETER;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-06-23 08:15:24 +00:00
|
|
|
Irp->IoStatus.Information = IoStack->Parameters.QueryFile.Length - Length;
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
return Status;
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdQueryInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
|
|
|
PAGED_CODE();
|
|
|
|
|
|
|
|
FsRtlEnterFileSystem();
|
2013-09-11 17:10:30 +00:00
|
|
|
NpAcquireSharedVcb();
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
|
|
|
|
Status = NpCommonQueryInformation(DeviceObject, Irp);
|
|
|
|
|
2013-09-11 17:10:30 +00:00
|
|
|
NpReleaseVcb();
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
FsRtlExitFileSystem();
|
|
|
|
|
For our 60000th commit, I bring you a complete rewrite of the Named Pipe File System. It is not yet "active", but I consider this to now be largely code complete and worthy of the prize (and I didn't want to delay other commiters any further). Once the code is reviewed, fixed, tested, and commented, it will replace our old and aging NPFS. This driver is cross-compatible with Windows Server 2003. It is expected to fix winetest incompatiblities, speed up performance, and reduce bizare RPC/SCM issues. This commit is dedicated to my best friend Rachel, who has not only always been there for me, but was also the motivating factor behind my return to my passion -- ReactOS :)
[NPFS-NEW]: Implement QueryVolume, QuerySecurity, SetSecurity. Everything but Directory Query, Fast I/O, and a few rare FSCTLs is implemented now. The former two will come in an upcoming commit.
[NPFS-NEW]: Major cleanup in the way some member variables were being addressed. Reference them as array members based on the correct FILE_PIPE defines from now on. Also fix a lot of formatting issues. Fix a bunch of bugs that were found. Use FILE_PIPE_SERVER_END and FILE_PIPE_CLIENT_END intead of a BOOLEAN. Use TRUE/FALSE/STATUS_SUCCESS/NULL/etc when needed intead of 0/1. The code formatting can/should still be improved, but this was a big help.
svn path=/trunk/; revision=60000
2013-09-10 08:36:25 +00:00
|
|
|
if (Status != STATUS_PENDING)
|
[NPFS-NEW]: Implement Close, Cleanup, Disconnect, Flush, Listen, Peek, SetInfo, Transceive, Wait, Write. Only QueryInfo remains as critical functionality to support the Kernel32 APIs. Code is WIP, untested, and ugly! But it is now 90% complete. r60000 should hopefully finalize the implementation. As long as I didn't forget a file :)
svn path=/trunk/; revision=59999
2013-09-10 02:23:32 +00:00
|
|
|
{
|
|
|
|
Irp->IoStatus.Status = Status;
|
|
|
|
IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2013-09-11 23:19:20 +00:00
|
|
|
/* EOF */
|