<< Click to Display Table of Contents >> Navigation: WinLicense > WinLicense SDK > Miscellaneous Functions > WLHardwareGetUsbIdAt |
The WLHardwareGetUsbIdAt function retrieves hardware ID for a specific USB drive that was found on the system. You need to first call the function WLHardwareGetNumberUsbDrives to know the number of USB drives that were found on the system. After that, you have to iterate over all found USB drives calling the function WLHardwareGetUsbIdAt.
bool WLHardwareGetUsbIdAt( int Index, char* pHardwareId ); |
function WLHardwareGetUsbIdAt( Index:Integer; pHardwareId:PAnsiChar ):Boolean; stdcall; |
Public Declare Function WLHardwareGetUsbIdAt Lib "WinLicenseSDK.dll" ( ByVal Index As Integer, ByVal pHardwareId As String ) As Boolean |
[C#] [DllImport(WINLICENSE_SDK_DLL, CallingConvention = CallingConvention.StdCall)] public static extern bool WLHardwareGetUsbIdAt(int Index, StringBuilder HardwareId);
[Visual Basic] <DllImport("WinlicenseSDK.dll", CallingConvention:=CallingConvention.StdCall)> Public Shared Function WLHardwareGetUsbIdAt(Index As Integer, ByRef HardwareId As String) As Boolean End Function |
Parameters
Index
[in] Index of the specific USB drive to retrieve the hardware ID
pHardwareId
[out] Pointer to a buffer that will receive a null-terminated string with the hardware ID for the USB drive at the given position.
Return Values
If the function succeeds, the return value is True.
If the function fails, the return value is False.
Remarks
The format of the hardware ID in the current implementation of WinLicense is as follows:
XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX (where 'X' can be [0-9, A-F])