SmpKeyedStoreCreate

NTSTATUS __stdcall SmpKeyedStoreCreate(PVOID BugCheckParameter2){
  _SMKM_STORE_LIST *v1; 
  __int64 v2; 
  int v3; 
  __int64 v4; 
  _PRIVILEGE_SET *v5; 
  __int64 v6; 
  int v8; 
  __int64 v9; 
  int v10; 
  __int64 v11; 
  int v13; 
  VOID **v14; 
  _SMKM_STORE_LIST *v15; 
  _EX_RUNDOWN_REF *v16; 
  int v17; 

  v3 = *(_DWORD *)(v2 + 2172);
  v17 = -1;
  v4 = (__int64)v1;
  v5 = 0i64;
  v6 = v2;
  v8 = SmpDirtyStoreCreate(v1, (v3 & 1) != 0 ? 2048 : 512, 1, &v17);
  if( v8 < 0 )
    goto LABEL_11;
  LODWORD(v9) = SSHSupportAllocateNonPaged(48, 0x53506D73u);
  v5 = (_PRIVILEGE_SET *)v9;
  if( !v9 )
  {
    v8 = -1073741670;
LABEL_11:
    v10 = v17;
    goto LABEL_5;
  }
  *(_OWORD *)v9 = 0i64;
  *(_OWORD *)(v9 + 16) = 0i64;
  *(_OWORD *)(v9 + 32) = 0i64;
  *(_QWORD *)(v9 + 8) = v6;
  v10 = v17;
  *(_WORD *)(v9 + 16) = v17;
  LODWORD(v11) = SmpKeyedStoreEntryGet((UINT64)BugCheckParameter2, (INT64 *)(v9 + 8), 1i64, 0i64);
  if( v11 )
  {
    v10 = -1;
    v5 = 0i64;
    v8 = 0;
  }
  else
  {
    v8 = -1073741670;
  }
LABEL_5:
  if( v10 != -1 )
  {
    v13 = v10 & 0x3FF;
    v14 = (VOID **)SmKmStoreRefFromStoreIndex(v4, v13);
    SmKmStoreDeleteWhenEmpty(v15, *v14, 1ui64);
    v16 = (_EX_RUNDOWN_REF *)SmKmStoreRefFromStoreIndex(v4, v13);
    ExReleaseRundownProtection(v16 + 1);
  }
  if( v5 )
    CmSiFreeMemory(v5);
  return v8;
}

Referenced by:

SmProcessCreateNotification