ReactOS 0.4.15-dev-7897-g78dc504
volinfo.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Named Pipe FileSystem
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/filesystems/npfs/volinfo.c
5 * PURPOSE: Named Pipe FileSystem Volume Information
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "npfs.h"
12
13// File ID number for NPFS bugchecking support
14#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_VOLINFO)
15
16/* FUNCTIONS ******************************************************************/
17
22{
25 USHORT NameLength;
26 TRACE("Entered\n");
27
29
30 InfoBuffer->SupportsObjects = 0;
31
32 NameLength = 18;
33 InfoBuffer->VolumeLabelLength = 18;
34
35 if (*Length < 18)
36 {
37 NameLength = (USHORT)*Length;
39 }
40 else
41 {
43 }
44
45 RtlCopyMemory(InfoBuffer->VolumeLabel, L"NamedPipe", NameLength);
46 *Length -= NameLength;
47
48 TRACE("Leaving, Status = %lx\n", Status);
49 return Status;
50}
51
56{
58 TRACE("Entered\n");
59
60 *Length -= sizeof(*InfoBuffer);
61
62 InfoBuffer->SectorsPerAllocationUnit = 1;
63 InfoBuffer->BytesPerSector = 1;
64
65 TRACE("Leaving, Status = STATUS_SUCCESS\n");
66 return STATUS_SUCCESS;
67}
68
73{
75 TRACE("Entered\n");
76
78 *Length -= sizeof(*InfoBuffer);
79
80 TRACE("Leaving, Status = STATUS_SUCCESS\n");
81 return STATUS_SUCCESS;
82}
83
88{
91 USHORT NameLength;
92 TRACE("Entered\n");
93
94 NameLength = (USHORT)(*Length - 12);
95 if (NameLength < 8)
96 {
97 *Length = 0;
99 }
100 else
101 {
102 *Length -= 20;
103 NameLength = 8;
105 }
106
107 InfoBuffer->MaximumComponentNameLength = 0xFFFFFFFF;
108 InfoBuffer->FileSystemNameLength = 8;
110 RtlCopyMemory(InfoBuffer->FileSystemName, L"NPFS", NameLength);
111
112 TRACE("Leaving, Status = %lx\n", Status);
113 return Status;
114}
115
117NTAPI
120{
122 TRACE("Entered\n");
123
124 *Length -= sizeof(*InfoBuffer);
125
126 RtlZeroMemory(InfoBuffer, sizeof(*InfoBuffer));
127
128 TRACE("Leaving, Status = STATUS_SUCCESS\n");
129 return STATUS_SUCCESS;
130}
131
133NTAPI
135 IN PIRP Irp)
136{
137 PIO_STACK_LOCATION IoStack;
138 FS_INFORMATION_CLASS InfoClass;
142 PAGED_CODE();
143 TRACE("Entered\n");
144
146 Buffer = Irp->AssociatedIrp.SystemBuffer;
147 Length = IoStack->Parameters.QueryVolume.Length;
148 InfoClass = IoStack->Parameters.QueryVolume.FsInformationClass;
149
151
152 switch (InfoClass)
153 {
156 break;
159 break;
162 break;
165 break;
168 break;
169 default:
171 break;
172 }
173
174 Irp->IoStatus.Information = IoStack->Parameters.QueryVolume.Length - Length;
175 TRACE("Leaving, Status = %lx\n", Status);
176 return Status;
177}
178
180NTAPI
182 IN PIRP Irp)
183{
185 PAGED_CODE();
186 TRACE("Entered\n");
187
190
192
193 NpReleaseVcb();
195
196 if (Status != STATUS_PENDING)
197 {
198 Irp->IoStatus.Status = Status;
200 }
201
202 TRACE("Leaving, Status = %lx\n", Status);
203 return Status;
204}
205
206/* EOF */
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
Definition: bufpool.h:45
_In_ PIRP Irp
Definition: csq.h:116
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
FORCEINLINE VOID NpAcquireSharedVcb(VOID)
Definition: npfs.h:328
@ FileFsDeviceInformation
Definition: from_kernel.h:222
@ FileFsAttributeInformation
Definition: from_kernel.h:223
@ FileFsVolumeInformation
Definition: from_kernel.h:219
@ FileFsSizeInformation
Definition: from_kernel.h:221
enum _FSINFOCLASS FS_INFORMATION_CLASS
#define FILE_CASE_PRESERVED_NAMES
Definition: from_kernel.h:234
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
NTSTATUS NTAPI NpQueryFsAttributeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:86
NTSTATUS NTAPI NpQueryFsSizeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:54
NTSTATUS NTAPI NpQueryFsDeviceInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:71
NTSTATUS NTAPI NpQueryFsFullSizeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:118
NTSTATUS NTAPI NpFsdQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volinfo.c:181
NTSTATUS NTAPI NpQueryFsVolumeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:20
NTSTATUS NTAPI NpCommonQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volinfo.c:134
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define FileFsFullSizeInformation
Definition: ntifs_ex.h:389
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define L(x)
Definition: ntvdm.h:50
unsigned short USHORT
Definition: pedump.c:61
#define FILE_DEVICE_NAMED_PIPE
Definition: winioctl.h:123
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define TRACE(s)
Definition: solgame.cpp:4
struct _IO_STACK_LOCATION::@3978::@3991 QueryVolume
union _IO_STACK_LOCATION::@1564 Parameters
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:604