ReactOS 0.4.15-dev-7906-g1b85a5f
create.c File Reference
#include "serial.h"
#include <debug.h>
Include dependency graph for create.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ SerialCreate()

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

Definition at line 15 of file create.c.

18{
20 PSERIAL_DEVICE_EXTENSION DeviceExtension;
22
23 TRACE_(SERIAL, "IRP_MJ_CREATE\n");
25 DeviceExtension = (PSERIAL_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
26
27 if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
28 {
29 INFO_(SERIAL, "Not a directory\n");
31 goto ByeBye;
32 }
33
34 if(DeviceExtension->IsOpened)
35 {
36 WARN_(SERIAL, "COM%lu is already opened\n", DeviceExtension->ComPort);
38 goto ByeBye;
39 }
40
41 INFO_(SERIAL, "Open COM%lu: successfull\n", DeviceExtension->ComPort);
42 DeviceExtension->IsOpened = TRUE;
44
45ByeBye:
46 Irp->IoStatus.Status = Status;
47 Irp->IoStatus.Information = 0;
49 return Status;
50}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
#define TRACE_(x)
Definition: compat.h:76
struct _SERIAL_DEVICE_EXTENSION * PSERIAL_DEVICE_EXTENSION
Status
Definition: gdiplustypes.h:25
if(dx< 0)
Definition: linetemp.h:194
#define IoCompleteRequest
Definition: irp.c:1240
#define INFO_(ch,...)
Definition: debug.h:159
#define WARN_(ch,...)
Definition: debug.h:157
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_NOT_A_DIRECTORY
Definition: udferr_usr.h:169
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
#define IO_NO_INCREMENT
Definition: iotypes.h:598