Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygencreate.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/create.c 00005 * PURPOSE: Serial IRP_MJ_CREATE operations 00006 * 00007 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org) 00008 */ 00009 00010 #include "serial.h" 00011 00012 NTSTATUS NTAPI 00013 SerialCreate( 00014 IN PDEVICE_OBJECT DeviceObject, 00015 IN PIRP Irp) 00016 { 00017 PIO_STACK_LOCATION Stack; 00018 PSERIAL_DEVICE_EXTENSION DeviceExtension; 00019 NTSTATUS Status; 00020 00021 TRACE_(SERIAL, "IRP_MJ_CREATE\n"); 00022 Stack = IoGetCurrentIrpStackLocation(Irp); 00023 DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension; 00024 00025 if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE) 00026 { 00027 INFO_(SERIAL, "Not a directory\n"); 00028 Status = STATUS_NOT_A_DIRECTORY; 00029 goto ByeBye; 00030 } 00031 00032 if(DeviceExtension->IsOpened) 00033 { 00034 WARN_(SERIAL, "COM%lu is already opened\n", DeviceExtension->ComPort); 00035 Status = STATUS_ACCESS_DENIED; 00036 goto ByeBye; 00037 } 00038 00039 INFO_(SERIAL, "Open COM%lu: successfull\n", DeviceExtension->ComPort); 00040 DeviceExtension->IsOpened = TRUE; 00041 Status = STATUS_SUCCESS; 00042 00043 ByeBye: 00044 Irp->IoStatus.Status = Status; 00045 Irp->IoStatus.Information = 0; 00046 IoCompleteRequest(Irp, IO_NO_INCREMENT); 00047 return Status; 00048 } Generated on Sat May 26 2012 04:15:53 for ReactOS by
1.7.6.1
|