Skip to content

Latest commit

 

History

History
137 lines (97 loc) · 4.57 KB

nf-sercx-sercxdeviceinitconfig.md

File metadata and controls

137 lines (97 loc) · 4.57 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:sercx.SerCxDeviceInitConfig
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.
serports\sercxdeviceinitconfig.htm
serports
04/23/2018
SerCxDeviceInitConfig function
1/SerCxDeviceInitConfig, SerCxDeviceInitConfig, SerCxDeviceInitConfig method [Serial Ports], serports.sercxdeviceinitconfig
sercx.h
Universal
Available starting with Windows 8.
PASSIVE_LEVEL
Windows
SerCxDeviceInitConfig
sercx/SerCxDeviceInitConfig
APIRef
kbSyntax
COM
1.0\Sercx.h
SerCxDeviceInitConfig

SerCxDeviceInitConfig function

-description

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.

-parameters

-param DeviceInit [in, out]

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

-returns

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.
//

...

-see-also

EvtDriverDeviceAdd

WDFDEVICE_INIT

WdfDeviceCreate

WdfDeviceInitAssignSDDLString