ReactOS 0.4.16-dev-106-g10b08aa
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{
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}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define FALSE
Definition: types.h:117
#define TRACE_(x)
Definition: compat.h:76
DRIVER_DISPATCH SerialQueryInformation
Definition: serial.h:235
@ FilePositionInformation
Definition: from_kernel.h:75
Status
Definition: gdiplustypes.h:25
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
#define ASSERT(a)
Definition: mode.c:44
#define FILE_STANDARD_INFORMATION
Definition: disk.h:54
struct _FILE_POSITION_INFORMATION FILE_POSITION_INFORMATION
struct _FILE_POSITION_INFORMATION * PFILE_POSITION_INFORMATION
#define IoCompleteRequest
Definition: irp.c:1240
struct _FILE_STANDARD_INFORMATION * PFILE_STANDARD_INFORMATION
#define FileStandardInformation
Definition: propsheet.cpp:61
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
LARGE_INTEGER CurrentByteOffset
Definition: nt_native.h:955
LARGE_INTEGER AllocationSize
Definition: propsheet.cpp:54
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define IO_NO_INCREMENT
Definition: iotypes.h:598