DrvDbDispatchDriverFile

NTSTATUS __stdcall DrvDbDispatchDriverFile(INT64 a1, WCHAR *a2, INT64 a3, INT64 a4, INT64 a5){
  signed int ObjectContext; 
  int v7; 
  INT64 *v8; 
  wchar_t *v9; 
  int v10; 
  int v11; 
  int v12; 
  int v13; 
  int v14; 
  int v15; 
  int v16; 
  INT64 v18; 
  UINT64 PropertyType; 
  VOID *PropertyBuffer; 
  UINT64 PropertySize; 
  UINT64 *v23; 
  _DRVDB_CONTEXT *pDrvDbCtx[3]; 

  pDrvDbCtx[0] = 0i64;
  ObjectContext = PnpCtxGetObjectContext((HPNPCTX *)a1, a3, (VOID **)pDrvDbCtx);
  if( ObjectContext < 0 )
    return ObjectContext;
  v8 = (INT64 *)pDrvDbCtx[0];
  v9 = (wchar_t *)*((unsigned int *)pDrvDbCtx[0] + 3);
  if( ((unsigned int)v9 & 0x10000000) == 0 )
  {
    if( !(_DWORD)v9 )
      return -1073740697;
    if( v7 == 2 )
    {
      if( *(_BYTE *)(a5 + 4) )
      {
LABEL_13:
        v9 = (wchar_t *)((unsigned int)v9 >> 30);
        LOBYTE(v9) = (unsigned __int8)v9 & 1;
        goto LABEL_15;
      }
    }
    else
    {
      if( v7 <= 2 )
      {
LABEL_11:
        LOBYTE(v9) = 1;
        goto LABEL_15;
      }
      if( v7 <= 4 )
        goto LABEL_13;
      if( v7 > 6 && v7 != 8 )
      {
        if( v7 != 9 )
          goto LABEL_11;
        goto LABEL_13;
      }
    }
    v9 = (wchar_t *)((unsigned int)v9 >> 31);
LABEL_15:
    ObjectContext = (_BYTE)v9 == 0 ? 0xC0000022 : 0;
    if( !(_BYTE)v9 )
      return ObjectContext;
  }
  v10 = v7 - 1;
  if( !v10 )
    return DrvDbValidateDriverInfFileName(v9);
  v11 = v10 - 1;
  if( !v11 )
    return DrvDbOpenDriverFileRegKey(
             (INT64 *)pDrvDbCtx[0],
             (INT64)a2,
             *(unsigned int *)a5,
             *(_BYTE *)(a5 + 4),
             *(_QWORD *)(a5 + 8),
             a5 + 16);
  v12 = v11 - 1;
  if( v12 )
  {
    v13 = v12 - 1;
    if( !v13 )
      return DrvDbDeleteObjectRegKey(pDrvDbCtx[0], DRVDB_BASE_KEY_TYPE_DRIVER_FILES, a2, 0i64);
    v14 = v13 - 1;
    if( v14 )
    {
      v15 = v14 - 1;
      if( v15 )
      {
        v16 = v15 - 2;
        if( v16 )
        {
          if( v16 != 1 )
            return -1073741811;
          LODWORD(PropertySize) = *(_DWORD *)(a5 + 40);
          LODWORD(PropertyType) = *(_DWORD *)(a5 + 24);
          return DrvDbSetDriverFileMappedProperty(
                   pDrvDbCtx[0],
                   a2,
                   *(VOID **)a5,
                   *(_DEVPROPKEY **)(a5 + 16),
                   PropertyType,
                   *(VOID **)(a5 + 32),
                   PropertySize);
        }
        else
        {
          LODWORD(PropertySize) = *(_DWORD *)(a5 + 40);
          return DrvDbGetDriverFileMappedProperty(
                   pDrvDbCtx[0],
                   a2,
                   *(VOID **)a5,
                   *(_DEVPROPKEY **)(a5 + 16),
                   *(UINT64 **)(a5 + 24),
                   *(UINT8 **)(a5 + 32),
                   PropertySize,
                   *(UINT64 **)(a5 + 48));
        }
      }
      else
      {
        LODWORD(PropertyType) = *(_DWORD *)(a5 + 32);
        return DrvDbGetDriverFileMappedPropertyKeys(
                 pDrvDbCtx[0],
                 a2,
                 *(VOID **)a5,
                 *(_DEVPROPKEY **)(a5 + 24),
                 PropertyType,
                 *(UINT64 **)(a5 + 40));
      }
    }
    else
    {
      LODWORD(v23) = 0;
      LODWORD(PropertyBuffer) = *(_DWORD *)(a5 + 24);
      return DrvDbGetObjectList(
               pDrvDbCtx[0],
               DRVDB_BASE_KEY_TYPE_DRIVER_FILES,
               *(VOID **)a5,
               *(_QWORD *)(a5 + 8),
               *(_QWORD *)(a5 + 16),
               (INT64)PropertyBuffer,
               *(_QWORD *)(a5 + 32),
               (INT64)v23);
    }
  }
  v18 = *(unsigned int *)a5;
  LODWORD(pDrvDbCtx[0]) = 0;
  ObjectContext = DrvDbOpenDriverFileRegKey(v8, (INT64)a2, v18, 1, a5 + 8, (INT64)pDrvDbCtx);
  if( ObjectContext >= 0 )
    *(_BYTE *)(a5 + 16) = LODWORD(pDrvDbCtx[0]) == 1;
  return ObjectContext;
}

Referenced by:

No references.