GetDevicesForIScsiSessionA function (iscsidsc.h)

The GetDevicesForIscsiSession function retrieves information about the devices associated with the current session.

Syntax

ISDSC_STATUS ISDSC_API GetDevicesForIScsiSessionA(
  [in]      PISCSI_UNIQUE_SESSION_ID  UniqueSessionId,
  [in, out] ULONG                     *DeviceCount,
  [out]     PISCSI_DEVICE_ON_SESSIONA Devices
);

Parameters

[in] UniqueSessionId

A pointer to a structure of type ISCSI_UNIQUE_SESSION_ID that contains the session identifier for the session.

[in, out] DeviceCount

A pointer to a location that, on input, contains the number of elements of type ISCSI_DEVICE_ON_SESSION that can fit in the buffer that Devices points to. If the operation succeeds, the location receives the number of elements retrieved. If GetDevicesForIscsiSession returns ERROR_INSUFFICIENT_BUFFER, the location still receives the number of elements the buffer is capable of containing.

[out] Devices

An array of ISCSI_DEVICE_ON_SESSION-type structures that, on output, receives information about each device associated with the session.

Return value

Returns ERROR_SUCCESS if the operation succeeds and ERROR_INSUFFICIENT_BUFFER if the caller allocated insufficient buffer space for the array in Devices.

Otherwise, GetDevicesForIscsiSession returns the appropriate Win32 or iSCSI error code on failure.

Remarks

Note

The iscsidsc.h header defines GetDevicesForIScsiSession as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header iscsidsc.h
Library Iscsidsc.lib
DLL Iscsidsc.dll

See also

ISCSI_DEVICE_ON_SESSION

ISCSI_UNIQUE_SESSION_ID