SerCxDeviceInitConfig function (sercx.h)

The SerCxDeviceInitConfig method is called by the serial controller driver to attach the serial framework extension (SerCx) to the I/O pipeline for a framework device object (FDO or PDO) that it is creating.

Syntax

NTSTATUS SerCxDeviceInitConfig(
  [in, out] PWDFDEVICE_INIT DeviceInit
);

Parameters

[in, out] DeviceInit

A pointer to the WDFDEVICE_INIT structure that is to be configured.

Return value

SerCxDeviceInitConfig returns STATUS_SUCCESS if the call is successful. Possible error return values include the following status code.

Return code Description
STATUS_INSUFFICIENT_RESOURCES
Could not allocate system resources (typically memory).

Remarks

This method associates SerCx's configuration information with the WDFDEVICE_INIT structure for the framework device object (PDO or FDO) that is to be created. Call SerCxDeviceInitConfig before you call the WdfDeviceCreate method to create the device object.

The controller driver's EvtDriverDeviceAdd callback function receives a pointer to an initialized WDFDEVICE_INIT structure as an input parameter.

SerCx sets a default security descriptor that the serial controller driver can, if necessary, override. For example, this default security descriptor enables a user-mode driver to send an I/O request to a peripheral device that is connected to a port on the serial controller. To change this setting in the security descriptor, the serial controller driver can call the WdfDeviceInitAssignSDDLString method. This call must occur after the SerCxDeviceInitConfig call, but before the call to the WdfDeviceCreate method.

Examples

In the following code example, a controller driver's EvtDriverDeviceAdd callback function passes an initialized WDFDEVICE_INIT structure to the SerCxDeviceInitConfig method. The call to SerCxDeviceInitConfig must occur before the WdfDeviceCreate call that creates the FDO for the serial controller device (UART).

//
// FxDeviceInit is a pointer to an initialized WDFDEVICE_INIT structure.
// Drivers receive a pointer to this structure as an input parameter to an
// EvtDriverDeviceAdd callback function, or as a return value from the
// WdfControlDeviceInitAllocate method.
//

status = SerCxDeviceInitConfig(FxDeviceInit);

if (!NT_SUCCESS(status))
{
    return status;
}

// 
// Set WDF and SerCx device-level configuration options.
//

...

//
// Call the WdfDeviceCreate method.
//

...

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header sercx.h
IRQL PASSIVE_LEVEL

See also

EvtDriverDeviceAdd

WDFDEVICE_INIT

WdfDeviceCreate

WdfDeviceInitAssignSDDLString