ReactOS  0.4.14-dev-55-g2da92ac
info.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: Serial port driver
4  * FILE: drivers/dd/serial/info.c
5  * PURPOSE: Serial IRP_MJ_QUERY_INFORMATION operations
6  *
7  * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
8  */
9 
10 #include "serial.h"
11 
12 #include <debug.h>
13 
17  IN PIRP Irp)
18 {
19  PIO_STACK_LOCATION Stack;
20  PVOID SystemBuffer;
24 
26  SystemBuffer = Irp->AssociatedIrp.SystemBuffer;
27  BufferLength = Stack->Parameters.QueryFile.Length;
28 
29  switch (Stack->Parameters.QueryFile.FileInformationClass)
30  {
32  {
33  PFILE_STANDARD_INFORMATION StandardInfo = (PFILE_STANDARD_INFORMATION)SystemBuffer;
34 
35  TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n");
38  else if (!StandardInfo)
40  else
41  {
42  StandardInfo->AllocationSize.QuadPart = 0;
43  StandardInfo->EndOfFile.QuadPart = 0;
44  StandardInfo->Directory = FALSE;
45  StandardInfo->NumberOfLinks = 0;
46  StandardInfo->DeletePending = FALSE; /* FIXME: should be TRUE sometimes */
49  }
50  break;
51  }
53  {
54  PFILE_POSITION_INFORMATION PositionInfo = (PFILE_POSITION_INFORMATION)SystemBuffer;
55 
56  ASSERT(PositionInfo);
57 
58  TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n");
61  else if (!PositionInfo)
63  else
64  {
65  PositionInfo->CurrentByteOffset.QuadPart = 0;
68  }
69  break;
70  }
71  default:
72  {
73  TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION: Unexpected file information class 0x%02x\n", Stack->Parameters.QueryFile.FileInformationClass);
75  }
76  }
77 
78  Irp->IoStatus.Information = Information;
79  Irp->IoStatus.Status = Status;
81  return Status;
82 }
#define IN
Definition: typedefs.h:38
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI SerialQueryInformation(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: info.c:15
struct _FILE_POSITION_INFORMATION FILE_POSITION_INFORMATION
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG BufferLength
Definition: usbdlib.h:225
#define IoCompleteRequest
Definition: irp.c:1240
LARGE_INTEGER CurrentByteOffset
Definition: nt_native.h:955
#define TRACE_(x)
Definition: compat.h:66
LARGE_INTEGER AllocationSize
Definition: propsheet.cpp:54
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
struct _FILE_STANDARD_INFORMATION * PFILE_STANDARD_INFORMATION
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:61
#define FileStandardInformation
Definition: propsheet.cpp:61
struct _FILE_POSITION_INFORMATION * PFILE_POSITION_INFORMATION
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2966
Iosb Information
Definition: create.c:4377
LONGLONG QuadPart
Definition: typedefs.h:112