Try with the following function for driver Side:-
RtlUnicodeToUTF8N()
The RtlUnicodeToUTF8N routine converts a Unicode string to a UTF-8 string.
RtlUTF8ToUnicodeN()
The RtlUTF8ToUnicodeN routine converts a UTF-8 string to a Unicode string.
RtlxUnicodeStringToAnsiSize
The RtlxUnicodeStringToAnsiSize routine returns the number of bytes required for a NULL-terminated ANSI string that is equivalent to a specified Unicode string.
RtlxAnsiStringToUnicodeSize
The RtlxAnsiStringToUnicodeSize routine returns the number of bytes that are required for a NULL-terminated Unicode string that is equivalent to a specified ANSI string.
Try with the following function forApplication Side:-
wmemset(HubPhyPath,0,MAX_PHY_PATH_LEN);
wcscat(HubPhyPath,PHY_DRIVE_PREFIX);
wcscat(HubPhyPath,pConnectionName->NodeName);
CString sHubPath(stArrayOfDevice[giDriveNumber].strHubName);
MultiByteToWideChar( CP_ACP, 0, DevPath, -1, gDevicePhysicalPath, iCnt);
wmemcpy(strHubName, stArrayOfDevice[DeviceNum].strHubName, wcslen(stArrayOfDevice[DeviceNum].strHubName));
/* Copy the physical path of device to global structure */
wmemset(gDevicePhysicalPath, 0x00, UFD_STRING_PATH_LENGTH);
wmemset(stArrayOfDevice[gdwDriveIndex].gAryDevicePhysicalPath, 0x00, UFD_STRING_PATH_LENGTH);
CString stTmp(pDeviceDetailData->DevicePath);
MultiByteToWideChar( CP_ACP, 0, stTmp, -1, gDevicePhysicalPath, stTmp.GetLength());
MultiByteToWideChar( CP_ACP, 0, stTmp, -1, stArrayOfDevice[gdwDriveIndex].gAryDevicePhysicalPath, stTmp.GetLength());
wmemcpy(stArrayOfDevice[.gdwDriveIndex].strHubName, HubPhyPath, wcslen(HubPhyPath));
//wmemcpy(stArrayOfDevice[gdwDriveIndex].strHubName, strHubName, strHubName.GetLength());
wmemset(strHubName, 0x00, DEVICE_STRING_INFO_LENGTH);
MultiByteToWideChar( CP_ACP, 0, strHubName, -1, .strHubName, strHubName.GetLength());