PnpConvertDevpropcompkeyArrayToString

INT64 __stdcall PnpConvertDevpropcompkeyArrayToString(
        DEVPROPCOMPKEY *CompKeyArray,
        UINT64 CompKeyArrayLength,
        WCHAR *CompKeyArrayString,
        UINT64 CompKeyArrayStringSize,
        UINT64 *RequiredSize){
  unsigned int v5; 
  WCHAR *v6; 
  unsigned int v7; 
  unsigned int v9; 
  unsigned int v10; 
  int v11; 
  INT64 result; 
  UINT64 v13; 
  v5 = CompKeyArrayStringSize;
  v6 = CompKeyArrayString;
  LODWORD(v13) = 0;
  v7 = CompKeyArrayLength;
  v9 = CompKeyArrayStringSize;
  v10 = 2;
  if( (unsigned int)CompKeyArrayStringSize >= 2 )
    *CompKeyArrayString = 0;
  v11 = 0;
  if( (_DWORD)CompKeyArrayLength )
  {
    while( 1 )
    {
      result = ConvertDevpropcompkeyToString(&CompKeyArray[v11], v6, v5, &v13);
      if( (int)(result + 0x80000000) >= 0 && (_DWORD)result != -1073741789 )
        break;
      if( v10 + (_DWORD)v13 - 2 < v10 )
        return 3221225621i64;
      v10 += v13 - 2;
      if( v5 >= (unsigned __int64)(unsigned int)v13 - 2 )
      {
        v5 += 2 - v13;
        v6 += ((unsigned __int64)(unsigned int)v13 - 2) >> 1;
      }
      if( ++v11 >= v7 )
        goto LABEL_10;
    }
  }
  else
  {
LABEL_10:
    result = 0i64;
    if( RequiredSize )
      *(_DWORD *)RequiredSize = v10;
    if( v10 > v9 )
      return 3221225507i64;
  }
  return result;
}

Referenced by:

PiDqIrpQueryCreate