IRP_MJ_CREATE (Serial)

The IRP_MJ_CREATE request opens a serial device.

When Sent

A client must open a serial device before it can access the port or a device connected to the port.

Input Parameters

None.

Output Parameters

None.

I/O Status Block

The Information field is set to zero.

The Status field is set to one of the following values:

  • STATUS_SUCCESS
    The serial device was successfully opened.

  • STATUS_ACCESS_DENIED
    The device is already open.

  • STATUS_DELETE_PENDING
    Serial is in the process of removing the device.

  • STATUS_INSUFFICIENT_RESOURCES
    The device is not in a Plug and Play Started state, or the driver could not allocate an internal data structure.

  • STATUS_NOT_A_DIRECTORY
    A serial device cannot be opened as a directory.

  • STATUS_PENDING
    Serial queued the request for later processing.

  • STATUS_SHARED_IRQ_BUSY
    The interrupt assigned to the device is in use by another open device.

Operation

A serial device must be opened before it can be used. A serial device is an exclusive device; only one file can be open on a port at any given time.

Requirements

Header

Wdm.h (include Wdm.h or Ntddk.h)

See also

IRP_MJ_WRITE (Serial)

 

 

Send comments about this topic to Microsoft