9.3 Device Status Changes

Status changes of logical services (which typically reflect changes in physical devices) are reported as system events. This is in addition to being reported by the WFS_INF_xxx_STATUS query of the WFSGetInfo or WFSAsyncGetInfo functions. The WFSRESULT data structure (defined in Section 8.1) is utilized as follows:

Field Description

RequestID (not used)

hService Service handle identifying the session that created the result

tsTimestamp Time the status change occurred (local time, in a Win32 SYSTEMTIME structure)

hResult (not used)

u.dwEventID = WFS_SYSE_DEVICE_STATUS

lpBuffer Pointer to a WFSDEVSTATUS structure:

typedef struct wfs_devstatus {
 LPSTR   lpszPhysicalName;
 LPSTR   lpszWorkstationName;
 DWORD   dwState;
} WFSDEVSTATUS, * LPWFSDEVSTATUS;

The members of this structure are:

Field Description

lpszPhysicalName Pointer to the physical service name of the service that changed its state.

lpszWorkstationName Pointer to the name of the workstation in which the logical service name is defined.

dwState Specifies the new state of the physical device managed by the service as one of the following:

Value Meaning

WFS_STAT_DEVONLINE The device is online (i.e., powered on and operable).

WFS_STAT_DEVOFFLINE The device is offline (e.g., the operator has taken the device offline).

WFS_STAT_DEVPOWEROFF The device is powered off.

WFS_STAT_DEVNODEVICE There is no device connected.

WFS_STAT_DEVHWERROR The device is inoperable due to a hardware error.

WFS_STAT_DEVUSERERROR The device is inoperable because a person is preventing proper device operation.