GetIScsiSessionListA function (iscsidsc.h)

The GetIscsiSessionList function retrieves the list of active iSCSI sessions.

Syntax

ISDSC_STATUS ISDSC_API GetIScsiSessionListA(
  [in, out] ULONG                *BufferSize,
  [out]     ULONG                *SessionCount,
  [out]     PISCSI_SESSION_INFOA SessionInfo
);

Parameters

[in, out] BufferSize

A pointer to a location that, on input, contains the size, in bytes, of the caller-allocated buffer that SessionInfo points to. If the operation succeeds, the location receives the size, in bytes, of the session information data that was retrieved.

If the operation fails because the output buffer size was insufficient, the location receives the size, in bytes, of the buffer size required to contain the output data.

[out] SessionCount

A pointer to a location that, on input, contains the number of ISCSI_SESSION_INFO structures that the buffer that SessionInfo points to can contain. If the operation succeeds, the location receives the number of ISCSI_SESSION_INFO structures that were retrieved.

[out] SessionInfo

A pointer to a buffer that contains a series of contiguous structures of type ISCSI_SESSION_INFO that describe the active login sessions.

Return value

Returns ERROR_SUCCESS if the operation succeeds and ERROR_INSUFFICIENT_BUFFER if the size of the buffer at SessionInfo was insufficient to hold the output data.

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

Remarks

Note

The iscsidsc.h header defines GetIScsiSessionList as an alias that 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 is 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_SESSION_INFO