RtkRtssAttachEx

RtkRtssAttachEx attaches a kernel device driver to RTSS.

Syntax

RTSSINST RtkRtssAttachEx(
    LONG MaxWFSO,
    PULONG pErrorCode,
    VOID (RTKAPI *Routine) (PVOID Context, LONG reason), 
    PVOID Context,
);

Parameters

MaxWFSO

The count of the number of wait-for-single-objects the user requires. The required minimum is one.

pErrorCode

A pointer to a location where additional error information may be returned. This location need not be defined; the user may pass a NULL value. If defined, this location is set to NULL if no error occurred.

Routine

The call back function to be called when RTX is starting a normal stop, or system is starting a normal shutdown.

Context

The argument to the call back function.

Return Values

If the function succeeds, the return value is a non-zero RTSSINST.

If the function fails, the return value is zero.

Remarks

This call is made only once by a kernel-resident device driver. The returned instance must be used for all subsequent RTKAPI calls. This call is usually made at, but not restricted to, driver entry.

If the device driver caller starts at boot time - you have to, first, set RTX to start at the boot time, and second, make this call ONCE in the Driver Dispatch routine, NEVER in the DriverEntry() routine.

The function pointed to by Routine is called when RTX is starting a normal stop through RTX Properties, or system is starting a normal shutdown. The source of the stop notification is presented to this function in the reason argument. For this version, the reason argument has the following value: RT_SHUTDOWN_NT_SYSTEM_SHUTDOWN. The function is called by Windows system thread at IRQL_DISPATCH level. Driver writer should use this call back function to close all the RTX handlers created or opened previously. After this function returns, RTK drivers should never make any further RTKAPI calls since RTX has called RtkRtssDetach internally.

NOTE:  When system stops not in a normal shutdown (i.e., blue screen or stop screen), the call back function is not called.

Requirements

Header Rtkapi.h
Library rtx_rtk.lib

See Also:

Windows Drivers and the RTX Subsystem Startup

RtkRtssDetach

RtkRtssAttach

IntervalZero.com | Support | Give Feedback