SmpKeyedStoreCreate

NTSTATUS __stdcall SmpKeyedStoreCreate(PVOID BugCheckParameter2){
  INT64 v1; 
  __int64 v2; 
  int v3; 
  INT64 v4; 
  struct _PRIVILEGE_SET *v5; 
  __int64 v6; 
  NTSTATUS v8; 
  INT64 NonPaged; 
  int v10; 
  unsigned int v12; 
  INT64 *v13; 
  INT64 v14; 
  struct _EX_RUNDOWN_REF *v15; 
  int a4; 
  v3 = *(_DWORD *)(v2 + 2172);
  a4 = -1;
  v4 = v1;
  v5 = 0i64;
  v6 = v2;
  v8 = SmpDirtyStoreCreate(v1, (v3 & 1) != 0 ? 2048 : 512, 1i64, &a4);
  if( v8 < 0 )
    goto LABEL_11;
  NonPaged = SSHSupportAllocateNonPaged(0x30ui64, 0x53506D73u);
  v5 = (struct _PRIVILEGE_SET *)NonPaged;
  if( !NonPaged )
  {
    v8 = -1073741670;
LABEL_11:
    v10 = a4;
    goto LABEL_5;
  }
  *(_OWORD *)NonPaged = 0i64;
  *(_OWORD *)(NonPaged + 16) = 0i64;
  *(_OWORD *)(NonPaged + 32) = 0i64;
  *(_QWORD *)(NonPaged + 8) = v6;
  v10 = a4;
  *(_WORD *)(NonPaged + 16) = a4;
  if( SmpKeyedStoreEntryGet((UINT64)BugCheckParameter2, (INT64 *)(NonPaged + 8), 1i64, 0i64) )
  {
    v10 = -1;
    v5 = 0i64;
    v8 = 0;
  }
  else
  {
    v8 = -1073741670;
  }
LABEL_5:
  if( v10 != -1 )
  {
    v12 = v10 & 0x3FF;
    v13 = (INT64 *)SmKmStoreRefFromStoreIndex(v4, v12);
    SmKmStoreDeleteWhenEmpty(v14, *v13);
    v15 = (struct _EX_RUNDOWN_REF *)SmKmStoreRefFromStoreIndex(v4, v12);
    ExReleaseRundownProtection(v15 + 1);
  }
  if( v5 )
    CmSiFreeMemory(v5);
  return v8;
}

Referenced by:

SmProcessCreateNotification