DrvDbSplitDeviceIdDriverInfMatch

NTSTATUS __stdcall DrvDbSplitDeviceIdDriverInfMatch(
        WCHAR *DriverInfMatch,
        WCHAR *DriverInfName,
        UINT64 DriverInfNameLen,
        _DRVDB_DRIVER_INF_MATCH_DATA *DriverInfMatchData){
  int v5; 
  unsigned int v7; 
  unsigned __int8 v9; 
  WORD *v10; 
  WORD *v11; 
  __int64 v12; 
  WORD *v13; 
  WORD *v14; 
  NTSTATUS v15; 
  unsigned int v16; 
  unsigned int v18; 
  UINT64 dwFlags; 
  unsigned int v20; 

  v20 = DriverInfNameLen;
  v5 = 0;
  v7 = DriverInfNameLen;
  v9 = -1;
  v10 = wcschr(DriverInfMatch, 92);
  v11 = v10;
  if( v10 )
  {
    v12 = v10 - DriverInfMatch;
    if( DriverInfMatchData )
    {
      v13 = wcschr(v10 + 1, 92);
      v14 = v13;
      if( v13 )
      {
        *v13 = 0;
        v18 = wcstol(v13 + 1, 0i64, 16i64);
        if( v18 > 0xFF )
          LOBYTE(v18) = -1;
        v9 = v18;
      }
      if( v11[1] == 42 )
      {
        DriverInfMatchData->Type = 3;
        LOWORD(v16) = 0;
      }
      else
      {
        v15 = wcstol(v11 + 1, 0i64, 16i64);
        if( v15 )
        {
          v16 = v15 - 1;
          DriverInfMatchData->Type = 2;
          if( v16 > 0xFFFF )
            LOWORD(v16) = -1;
        }
        else
        {
          DriverInfMatchData->Type = 1;
          LOWORD(v16) = 0;
        }
      }
      DriverInfMatchData->Index = v16;
      if( v14 )
        *v14 = 92;
      v7 = v20;
    }
  }
  else
  {
    v12 = -1i64;
    do
      ++v12;
    while( DriverInfMatch[v12] );
    if( DriverInfMatchData )
    {
      DriverInfMatchData->Type = 0;
      DriverInfMatchData->Index = 0;
    }
  }
  if( !DriverInfName
    || (LODWORD(dwFlags) = 2304,
        v5 = RtlStringCchCopyNExW(DriverInfName, v7, DriverInfMatch, (unsigned int)v12, 0i64, 0i64, dwFlags),
        v5 >= 0) )
  {
    if( DriverInfMatchData )
      DriverInfMatchData->FeatureScore = v9;
  }
  return v5;
}

Referenced by:

DrvDbSetDeviceIdDriverInfMatches
PiDevCfgFindDeviceDriver