Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygeninfo.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: Serial port driver 00004 * FILE: drivers/dd/serial/info.c 00005 * PURPOSE: Serial IRP_MJ_QUERY_INFORMATION operations 00006 * 00007 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) 00008 */ 00009 00010 #include "serial.h" 00011 00012 NTSTATUS NTAPI 00013 SerialQueryInformation( 00014 IN PDEVICE_OBJECT DeviceObject, 00015 IN PIRP Irp) 00016 { 00017 PIO_STACK_LOCATION Stack; 00018 PVOID SystemBuffer; 00019 ULONG BufferLength; 00020 ULONG_PTR Information = 0; 00021 NTSTATUS Status; 00022 00023 Stack = IoGetCurrentIrpStackLocation(Irp); 00024 SystemBuffer = Irp->AssociatedIrp.SystemBuffer; 00025 BufferLength = Stack->Parameters.QueryFile.Length; 00026 00027 switch (Stack->Parameters.QueryFile.FileInformationClass) 00028 { 00029 case FileStandardInformation: 00030 { 00031 PFILE_STANDARD_INFORMATION StandardInfo = (PFILE_STANDARD_INFORMATION)SystemBuffer; 00032 00033 TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FileStandardInformation\n"); 00034 if (BufferLength < sizeof(FILE_STANDARD_INFORMATION)) 00035 Status = STATUS_BUFFER_OVERFLOW; 00036 else if (!StandardInfo) 00037 Status = STATUS_INVALID_PARAMETER; 00038 else 00039 { 00040 StandardInfo->AllocationSize.QuadPart = 0; 00041 StandardInfo->EndOfFile.QuadPart = 0; 00042 StandardInfo->Directory = FALSE; 00043 StandardInfo->NumberOfLinks = 0; 00044 StandardInfo->DeletePending = FALSE; /* FIXME: should be TRUE sometimes */ 00045 Information = sizeof(FILE_STANDARD_INFORMATION); 00046 Status = STATUS_SUCCESS; 00047 } 00048 break; 00049 } 00050 case FilePositionInformation: 00051 { 00052 PFILE_POSITION_INFORMATION PositionInfo = (PFILE_POSITION_INFORMATION)SystemBuffer; 00053 00054 ASSERT(PositionInfo); 00055 00056 TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION / FilePositionInformation\n"); 00057 if (BufferLength < sizeof(FILE_POSITION_INFORMATION)) 00058 Status = STATUS_BUFFER_OVERFLOW; 00059 else if (!PositionInfo) 00060 Status = STATUS_INVALID_PARAMETER; 00061 else 00062 { 00063 PositionInfo->CurrentByteOffset.QuadPart = 0; 00064 Information = sizeof(FILE_POSITION_INFORMATION); 00065 Status = STATUS_SUCCESS; 00066 } 00067 break; 00068 } 00069 default: 00070 { 00071 TRACE_(SERIAL, "IRP_MJ_QUERY_INFORMATION: Unexpected file information class 0x%02x\n", Stack->Parameters.QueryFile.FileInformationClass); 00072 return ForwardIrpAndForget(DeviceObject, Irp); 00073 } 00074 } 00075 00076 Irp->IoStatus.Information = Information; 00077 Irp->IoStatus.Status = Status; 00078 IoCompleteRequest(Irp, IO_NO_INCREMENT); 00079 return Status; 00080 } Generated on Sat May 26 2012 04:23:13 for ReactOS by
1.7.6.1
|