This behavior is by design because that is the nature of Unicode characters. The lower batch, below value 256, have a zero following them because they are (generally) a 16-bit value so the MSB will be zero.
I would use the TCHAR macros if you are going to compile in both modes. Here's an example:
const int BufferSize = 299;
TCHAR friendlyName[BufferSize+1] = { 0 };
if( ! SetupDiGetDeviceRegistryProperty( hDeviceInfo, &devInfoData,
SPDRP_FRIENDLYNAME, nullptr,
friendlyName, BufferSize, nullptr ) )
{
TRACE( _T( "device does not have this property set\n" ) );
}