Jungo WinDriver  
Official Documentation

◆ WDU_GetStringDesc()

DWORD DLLCALLCONV WDU_GetStringDesc ( _In_ WDU_DEVICE_HANDLE  hDevice,
_In_ BYTE  bStrIndex,
_Outptr_ PBYTE  pbBuf,
_In_ DWORD  dwBufSize,
_In_ WDU_LANGID  langID,
_Outptr_ PDWORD  pdwDescSize 
)

Reads a string descriptor from a device by string index.

Parameters
[in]hDeviceA unique identifier for the device/interface.
[in]bStrIndexIndex of the string descriptor to read.
[out]pbBufPointer to a buffer to be filled with the string descriptor that is read from the device. If the buffer is smaller than the string descriptor (dwBufSize < *pdwDescSize), the returned descriptor will be truncated to dwBufSize bytes.
[in]dwBufSizeThe size of the pbBuf buffer, in bytes.
[in]langIDThe language ID to be used in the get string descriptor request that is sent to the device. If langID is 0, the request will use the first supported language ID returned by the device.
[out]pdwDescSizeAn optional DWORD pointer to be filled with the size of the string descriptor read from the device. If this parameter is NULL, the funWDU_StreamReadction will not return the size of the string descriptor.
Returns
WinDriver Error Code
WDU_DEVICE *pDevice;
DWORD dwStatus;
BYTE bSerialNum[0x100];
DWORD dwSerialDescSize = 0;
dwStatus = WDU_GetDeviceInfo(hDevice, &pDevice);
if (dwStatus)
{
return;
}
if (!pDevice->Descriptor.iSerialNumber)
{
printf("Serial number is not available\n");
goto Exit;
}
bSerialNum, sizeof(bSerialNum), 0, &dwSerialDescSize);
Exit:
if (pDevice)
free(pDevice);
void __cdecl free(void *buf)
UCHAR iSerialNumber
Index of serial number string descriptor.
Definition: windrvr_usb.h:205
WDU_DEVICE_DESCRIPTOR Descriptor
CDevice descriptor information structure.
Definition: windrvr_usb.h:259
DWORD DLLCALLCONV WDU_GetStringDesc(_In_ WDU_DEVICE_HANDLE hDevice, _In_ BYTE bStrIndex, _Outptr_ PBYTE pbBuf, _In_ DWORD dwBufSize, _In_ WDU_LANGID langID, _Outptr_ PDWORD pdwDescSize)
Reads a string descriptor from a device by string index.
DWORD DLLCALLCONV WDU_GetDeviceInfo(_In_ WDU_DEVICE_HANDLE hDevice, _Outptr_ WDU_DEVICE **ppDeviceInfo)
Gets configuration information from the device including all the descriptors in a WDU_DEVICE struct.
unsigned char BYTE
Definition: windrvr.h:332