CmGetMatchingDeviceContainerList

NTSTATUS __stdcall CmGetMatchingDeviceContainerList(
        HPNPCTX *hPnpCtx,
        UINT8 *MatchCallbackRoutine,
        HPNPCTX *a3,
        const WCHAR *a4,
        _CM_OBJECT_TYPE arg20,
        VOID *a6,
        VOID *MatchCallbackContext,
        WCHAR *Buffer,
        INT64 BufferLength,
        UINT64 *RequiredLength,
        UINT64 Flags){
  __int64(__fastcall *v15)(HPNPCTX *, _QWORD, __int64, __int64, int, INT64 *); 
  int v16; 
  NTSTATUS MatchingDeviceContainerListWorker; 
  NTSTATUS v18; 
  int v20; 
  int v21; 
  NTSTATUS v22; 
  UINT64 *a5; 
  INT64 v24[12]; 

  memset(v24, 0i64, 0x58u);
  v15 = (__int64(__fastcall *)(HPNPCTX *, _QWORD, __int64, __int64, int, INT64 *))*((_QWORD *)hPnpCtx + 63);
  v24[3] = (INT64)a3;
  LODWORD(v24[5]) = arg20;
  v24[2] = (INT64)MatchCallbackRoutine;
  v24[4] = (INT64)a4;
  v24[6] = (INT64)a6;
  LODWORD(v24[7]) = (_DWORD)MatchCallbackContext;
  if( v15 )
  {
    v16 = v15(hPnpCtx, 0i64, 5i64, 4i64, 1, v24);
    if( v16 == -1073741822 )
    {
      v15 = 0i64;
    }
    else
    {
      if( v16 == -1073741536 )
        return v24[0];
      if( v16 )
        return -1073741595;
    }
  }
  LODWORD(a5) = v24[5];
  MatchingDeviceContainerListWorker = CmGetMatchingDeviceContainerListWorker(hPnpCtx, v24[2], v24[3], v24[4], a5);
  v18 = MatchingDeviceContainerListWorker;
  if( !v15 )
    return v18;
  LODWORD(v24[0]) = MatchingDeviceContainerListWorker;
  v20 = v15(hPnpCtx, 0i64, 5i64, 4i64, 2, v24);
  v21 = v20;
  if( v20 == -1073741822 )
    return v18;
  if( v20 == -1073741536 )
    return v24[0];
  v22 = v18;
  if( v21 )
    return -1073741595;
  return v22;
}

Referenced by:

PnpDispatchDeviceContainer