SshInitialize

NTSTATUS __stdcall SshInitialize(INT64 a1){
  _RTL_RUN_ONCE *v1; 
  _RTL_RUN_ONCE *v2; 
  __int64 v3; 
  int v4; 

  if( !(_DWORD)a1 )
  {
    CmSiRWLockInitialize((PRTL_RUN_ONCE)&SshpLibraryListLock);
    qword_140C1E138 = (__int64)&SshpLibraryList;
    SshpLibraryList = &SshpLibraryList;
    v1 = (_RTL_RUN_ONCE *)&unk_140C1E190;
    do
    {
      CmSiRWLockInitialize(v1 - 2);
      v2[1].Value = (unsigned __int64)v2;
      v2->Value = (unsigned __int64)v2;
      v1 = v2 + 4;
    }
    while( v3 != 1 );
    SshpSessionId = 0i64;
    SshpSessionGuid = 0i64;
    SshpInitialized = 1;
    return 0;
  }
  if( (_DWORD)a1 != 3 )
  {
    v4 = -1073741811;
LABEL_12:
    SshpUninitialize();
    return v4;
  }
  v4 = SSHSupportEtwRegister();
  if( v4 < 0 )
    goto LABEL_12;
  SshpTraceHandleRegistered = 1;
  v4 = TraceLoggingRegisterEx_EtwRegister_EtwSetInformation(&dword_140C046E0);
  if( v4 < 0 )
    goto LABEL_12;
  SshpTelemetryHandleRegistered = 1;
  v4 = SshpSubscribeCallbacks();
  if( v4 < 0 )
    goto LABEL_12;
  SshpQueryRegistryValues();
  return 0;
}

Referenced by:

PoInitSystem