DrvDbDispatchDriverDatabase

NTSTATUS __stdcall DrvDbDispatchDriverDatabase(INT64 a1, INT64 a2, INT64 a3, INT64 a4, UINT64 *a5){
  wchar_t *v5; 
  int ObjectContext; 
  int v7; 
  WCHAR *v8; 
  int v9; 
  int v10; 
  int v11; 
  int v12; 
  int v13; 
  int v16; 
  int v17; 
  const WCHAR *PropertyType; 
  VOID *BufferSize; 
  UINT64 *PropertySize; 
  _DRVDB_NODE *DatabaseNode; 
  _DRVDB_CONTEXT *pDrvDbCtx; 
  UINT64 *savedregs; 

  pDrvDbCtx = 0i64;
  ObjectContext = PnpCtxGetObjectContext((HPNPCTX *)a1, a3, (VOID **)&pDrvDbCtx);
  if( ObjectContext < 0 )
    return ObjectContext;
  v9 = v7 - 1;
  if( !v9 )
    return DrvDbValidateDriverDatabaseName(v5);
  v10 = v9 - 1;
  if( !v10 )
    return DrvDbOpenDriverDatabaseRegKey(
             (_UNICODE_STRING **)pDrvDbCtx,
             v8,
             *(unsigned int *)a5,
             *((_BYTE *)a5 + 4),
             (VOID **)a5[1],
             a5 + 2);
  v11 = v10 - 1;
  if( v11 )
  {
    v12 = v11 - 1;
    if( v12 )
    {
      v13 = v12 - 1;
      if( v13 )
      {
        v16 = v13 - 1;
        if( v16 )
        {
          v17 = v16 - 2;
          if( v17 )
          {
            if( v17 != 1 )
              return -1073741811;
            LODWORD(BufferSize) = *((_DWORD *)a5 + 10);
            LODWORD(PropertyType) = *((_DWORD *)a5 + 6);
            return DrvDbSetDriverDatabaseMappedProperty(
                     (_UNICODE_STRING **)pDrvDbCtx,
                     v8,
                     (VOID *)*a5,
                     (_DEVPROPKEY *)a5[2],
                     (UINT64)PropertyType,
                     (UINT8 *)a5[4],
                     (UINT64)BufferSize);
          }
          else
          {
            LODWORD(BufferSize) = *((_DWORD *)a5 + 10);
            return DrvDbGetDriverDatabaseMappedProperty(
                     pDrvDbCtx,
                     v8,
                     (VOID *)*a5,
                     (_DEVPROPKEY *)a5[2],
                     (UINT64 *)a5[3],
                     (UINT8 *)a5[4],
                     (UINT64)BufferSize,
                     (UINT64 *)a5[6]);
          }
        }
        else
        {
          LODWORD(PropertyType) = *((_DWORD *)a5 + 8);
          return DrvDbGetDriverDatabaseMappedPropertyKeys(
                   pDrvDbCtx,
                   v8,
                   (VOID *)*a5,
                   (_DEVPROPKEY *)a5[3],
                   (UINT64)PropertyType,
                   (UINT64 *)a5[5]);
        }
      }
      else
      {
        LODWORD(PropertyType) = *((_DWORD *)a5 + 6);
        return DrvDbGetDriverDatabaseList(
                 pDrvDbCtx,
                 *a5,
                 (INT64 *)a5[1],
                 (HPNPCTX *)a5[2],
                 PropertyType,
                 a5[4],
                 BufferSize,
                 PropertySize,
                 (WCHAR *)DatabaseNode,
                 (UINT64)pDrvDbCtx,
                 savedregs);
      }
    }
    else
    {
      DatabaseNode = 0i64;
      ObjectContext = DrvDbFindDatabaseNode(pDrvDbCtx, v8, &DatabaseNode);
      if( ObjectContext < 0 )
        return ObjectContext;
      if( (DatabaseNode[14] & 0x10) == 0 )
        return -1073741790;
      return DrvDbDestroyDatabaseNode(pDrvDbCtx, DatabaseNode);
    }
  }
  LODWORD(DatabaseNode) = 0;
  ObjectContext = DrvDbOpenDriverDatabaseRegKey(
                    (_UNICODE_STRING **)pDrvDbCtx,
                    v8,
                    *(unsigned int *)a5,
                    1u,
                    (VOID **)a5 + 1,
                    (UINT64 *)&DatabaseNode);
  if( ObjectContext >= 0 )
    *((_BYTE *)a5 + 16) = (_DWORD)DatabaseNode == 1;
  return ObjectContext;
}

Referenced by:

No references.