PiDqPropertyCallback

NTSTATUS __stdcall PiDqPropertyCallback(
        VOID *PropertyCallbackContext,
        _DEVPROPCOMPKEY *PropertyKey,
        UINT64 *PropertyType,
        UINT64 *BufferSize,
        UINT8 **Buffer){
  int v9; 
  VOID *v10; 
  unsigned int v11; 
  __int64 v12; 
  __int64 v13; 
  __int64 v14; 
  const wchar_t *LocaleName; 
  const wchar_t *v16; 
  DEVPROPSTORE Store; 
  PNP_OBJECT_TYPE v19; 
  NTSTATUS v20; 
  PNP_OBJECT_TYPE PnpObjectType; 
  _SECURITY_SUBJECT_CONTEXT *v22; 
  __int64 v23; 
  __int64 v24; 
  UINT64 *v25; 
  UINT64 v26; 

  v9 = 0;
  v10 = 0i64;
  v11 = 0;
  if( !*((_DWORD *)PropertyCallbackContext + 6) )
  {
LABEL_11:
    Store = PropertyKey->Store;
    if( Store )
    {
      if( Store != DEVPROP_STORE_USER )
        return -1073741811;
      v19 = 0;
      if( !*(_QWORD *)PropertyCallbackContext )
      {
        PnpObjectType = PiDqGetPnpObjectType(*(_DEV_OBJECT_TYPE *)(*(_QWORD *)(*((_QWORD *)PropertyCallbackContext + 5)
                                                                             + 24i64)
                                                                 + 16i64));
        v9 = PiDqOpenObjectRegKey(
               DEVPROP_STORE_USER,
               *((WCHAR **)PropertyCallbackContext + 4),
               PnpObjectType,
               1ui64,
               0,
               v22,
               (VOID **)PropertyCallbackContext,
               v25,
               v26);
        if( v9 == -1073741772 )
        {
          *(_QWORD *)PropertyCallbackContext = -1i64;
          v9 = 0;
        }
      }
      v10 = *(VOID **)PropertyCallbackContext;
      if( *(_QWORD *)PropertyCallbackContext == -1i64 )
      {
        v23 = *((_QWORD *)PropertyCallbackContext + 2);
        v24 = 6i64 * *((unsigned int *)PropertyCallbackContext + 6);
        *(_GUID *)(v23 + 8 * v24) = PropertyKey->Key.fmtid;
        *(_OWORD *)(v23 + 8 * v24 + 16) = *(_OWORD *)&PropertyKey->Key.pid;
        ++*((_DWORD *)PropertyCallbackContext + 6);
        goto LABEL_29;
      }
    }
    else
    {
      v19 = PiDqGetPnpObjectType(*(_DEV_OBJECT_TYPE *)(*(_QWORD *)(*((_QWORD *)PropertyCallbackContext + 5) + 24i64)
                                                     + 16i64));
    }
    if( v9 < 0 )
      return v9;
    v20 = PiDqPnPGetObjectProperty(
            *((WCHAR **)PropertyCallbackContext + 4),
            v19,
            v10,
            &PropertyKey->Key,
            PropertyKey->Store,
            0i64,
            (_DEVPROPERTY *)(*((_QWORD *)PropertyCallbackContext + 2)
                           + 48i64 * *((unsigned int *)PropertyCallbackContext + 6)));
    v9 = v20;
    if( v20 != -1073741811 )
    {
      if( v20 >= 0 )
      {
        *(_DWORD *)PropertyType = *(_DWORD *)(*((_QWORD *)PropertyCallbackContext + 2)
                                            + 48i64 * *((unsigned int *)PropertyCallbackContext + 6)
                                            + 32);
        *(_DWORD *)BufferSize = *(_DWORD *)(*((_QWORD *)PropertyCallbackContext + 2)
                                          + 48i64 * *((unsigned int *)PropertyCallbackContext + 6)
                                          + 36);
        *Buffer = *(UINT8 **)(*((_QWORD *)PropertyCallbackContext + 2)
                            + 48i64 * (unsigned int)(*((_DWORD *)PropertyCallbackContext + 6))++
                            + 40);
      }
      return v9;
    }
    v9 = 0;
LABEL_29:
    *(_DWORD *)PropertyType = 0;
    *(_DWORD *)BufferSize = 0;
    *Buffer = 0i64;
    return v9;
  }
  while( 1 )
  {
    v12 = *((_QWORD *)PropertyCallbackContext + 2);
    v13 = 48i64 * v11;
    if( PropertyKey->Key.pid == *(_DWORD *)(v13 + v12 + 16) )
    {
      v14 = *(_QWORD *)&PropertyKey->Key.fmtid.Data1 - *(_QWORD *)(v13 + v12);
      if( *(_QWORD *)&PropertyKey->Key.fmtid.Data1 == *(_QWORD *)(v13 + v12) )
        v14 = *(_QWORD *)PropertyKey->Key.fmtid.Data4 - *(_QWORD *)(v13 + v12 + 8);
      if( !v14 && PropertyKey->Store == *(_DWORD *)(v13 + v12 + 20) )
      {
        LocaleName = PropertyKey->LocaleName;
        v16 = *(const wchar_t **)(v13 + v12 + 24);
        if( LocaleName == v16 || LocaleName && v16 && !wcsicmp(LocaleName, v16) )
          break;
      }
    }
    if( ++v11 >= *((_DWORD *)PropertyCallbackContext + 6) )
      goto LABEL_11;
  }
  *(_DWORD *)PropertyType = *(_DWORD *)(*((_QWORD *)PropertyCallbackContext + 2) + 48i64 * v11 + 32);
  *(_DWORD *)BufferSize = *(_DWORD *)(*((_QWORD *)PropertyCallbackContext + 2) + 48i64 * v11 + 36);
  *Buffer = *(UINT8 **)(*((_QWORD *)PropertyCallbackContext + 2) + 48i64 * v11 + 40);
  return v9;
}

Referenced by:

No references.