StarBurn SDK (Software Development Kit)
ContentsIndexHome
PreviousUpNext
StarBurn_GetDeviceNameByDeviceAddress Function
C++
__stdcall STARBURN_IMPEX_API EXCEPTION_NUMBER StarBurn_GetDeviceNameByDeviceAddress(IN UCHAR p__UCHAR__DevicePort, IN UCHAR p__UCHAR__DeviceBus, IN UCHAR p__UCHAR__DeviceID, IN UCHAR p__UCHAR__DeviceLUN, OUT PCHAR p__PCHAR__DeviceName);
Parameters 
Description 
IN UCHAR p__UCHAR__DevicePort 
Device port.
 
IN UCHAR p__UCHAR__DeviceBus 
Device bus.
 
IN UCHAR p__UCHAR__DeviceID 
Device ID.
 
IN UCHAR p__UCHAR__DeviceLUN 
Device LUN.
 
OUT PCHAR p__PCHAR__DeviceName 
Pointer to the buffer device name will be copied to. 

Execution status. EN_SUCCESS if device name was located by device address.

This function gets device name by device address.

Good idea is to fill the device name with zeros before submitting it to this function. Buffer must be large enough to hold all the device name.

This example gets device name by device address. 

 

// Somewhere in the data region
EXCEPTION_NUMBER l__EXCEPTION_NUMBER;
CHAR l__CHAR__DeviceName[ MAX_PATH ];

// Prepare device name
RtlZeroMemory(
    &l__CHAR__DeviceName,
    sizeof( l__CHAR__DeviceName )
    );

// Try to get device name by device address 0:0:1:0
l__EXCEPTION_NUMBER =
StarBurn_GetDeviceNameByDeviceAddress(
    0,
    1,
    0,
    0,
    ( PCHAR )( &l__CHAR__DeviceName )
    );

// Check for correct reply
if ( l__EXCEPTION_NUMBER != EN_SUCCESS )
{
// Handle error here...
}

// Perform actions with device name here...