ReactOS  0.4.15-dev-3177-gd6a0299
volinfo.c File Reference
#include "npfs.h"
Include dependency graph for volinfo.c:

Go to the source code of this file.

Macros

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_VOLINFO)
 

Functions

NTSTATUS NTAPI NpQueryFsVolumeInfo (IN PVOID Buffer, IN OUT PULONG Length)
 
NTSTATUS NTAPI NpQueryFsSizeInfo (IN PVOID Buffer, IN OUT PULONG Length)
 
NTSTATUS NTAPI NpQueryFsDeviceInfo (IN PVOID Buffer, IN OUT PULONG Length)
 
NTSTATUS NTAPI NpQueryFsAttributeInfo (IN PVOID Buffer, IN OUT PULONG Length)
 
NTSTATUS NTAPI NpQueryFsFullSizeInfo (IN PVOID Buffer, IN OUT PULONG Length)
 
NTSTATUS NTAPI NpCommonQueryVolumeInformation (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI NpFsdQueryVolumeInformation (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NPFS_BUGCHECK_FILE_ID

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_VOLINFO)

Definition at line 14 of file volinfo.c.

Function Documentation

◆ NpCommonQueryVolumeInformation()

NTSTATUS NTAPI NpCommonQueryVolumeInformation ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 134 of file volinfo.c.

136 {
137  PIO_STACK_LOCATION IoStack;
138  FS_INFORMATION_CLASS InfoClass;
139  ULONG Length;
140  PVOID Buffer;
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 }
return STATUS_NOT_SUPPORTED
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
NTSTATUS NTAPI NpQueryFsFullSizeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:118
#define FileFsFullSizeInformation
Definition: ntifs_ex.h:389
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI NpQueryFsDeviceInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:71
NTSTATUS NTAPI NpQueryFsVolumeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:20
_In_ PIRP Irp
Definition: csq.h:116
Definition: bufpool.h:45
enum _FSINFOCLASS FS_INFORMATION_CLASS
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS NTAPI NpQueryFsAttributeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:86
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
NTSTATUS NTAPI NpQueryFsSizeInfo(IN PVOID Buffer, IN OUT PULONG Length)
Definition: volinfo.c:54
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define PAGED_CODE()

Referenced by NpFsdQueryVolumeInformation().

◆ NpFsdQueryVolumeInformation()

NTSTATUS NTAPI NpFsdQueryVolumeInformation ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 181 of file volinfo.c.

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 }
FORCEINLINE VOID NpAcquireSharedVcb(VOID)
Definition: npfs.h:328
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
LONG NTSTATUS
Definition: precomp.h:26
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_PENDING
Definition: ntstatus.h:82
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:604
NTSTATUS NTAPI NpCommonQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: volinfo.c:134
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
#define PAGED_CODE()

Referenced by DriverEntry().

◆ NpQueryFsAttributeInfo()

NTSTATUS NTAPI NpQueryFsAttributeInfo ( IN PVOID  Buffer,
IN OUT PULONG  Length 
)

Definition at line 86 of file volinfo.c.

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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR L[]
Definition: oid.c:1250
#define FILE_CASE_PRESERVED_NAMES
Definition: from_kernel.h:234
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
unsigned short USHORT
Definition: pedump.c:61
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by NpCommonQueryVolumeInformation().

◆ NpQueryFsDeviceInfo()

NTSTATUS NTAPI NpQueryFsDeviceInfo ( IN PVOID  Buffer,
IN OUT PULONG  Length 
)

Definition at line 71 of file volinfo.c.

73 {
75  TRACE("Entered\n");
76 
77  InfoBuffer->DeviceType = FILE_DEVICE_NAMED_PIPE;
78  *Length -= sizeof(*InfoBuffer);
79 
80  TRACE("Leaving, Status = STATUS_SUCCESS\n");
81  return STATUS_SUCCESS;
82 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define FILE_DEVICE_NAMED_PIPE
Definition: winioctl.h:123
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by NpCommonQueryVolumeInformation().

◆ NpQueryFsFullSizeInfo()

NTSTATUS NTAPI NpQueryFsFullSizeInfo ( IN PVOID  Buffer,
IN OUT PULONG  Length 
)

Definition at line 118 of file volinfo.c.

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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by NpCommonQueryVolumeInformation().

◆ NpQueryFsSizeInfo()

NTSTATUS NTAPI NpQueryFsSizeInfo ( IN PVOID  Buffer,
IN OUT PULONG  Length 
)

Definition at line 54 of file volinfo.c.

56 {
57  PFILE_FS_SIZE_INFORMATION InfoBuffer = Buffer;
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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by NpCommonQueryVolumeInformation().

◆ NpQueryFsVolumeInfo()

NTSTATUS NTAPI NpQueryFsVolumeInfo ( IN PVOID  Buffer,
IN OUT PULONG  Length 
)

Definition at line 20 of file volinfo.c.

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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR L[]
Definition: oid.c:1250
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
unsigned short USHORT
Definition: pedump.c:61
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by NpCommonQueryVolumeInformation().