MCPcopy Create free account
hub / github.com/DiscordMessenger/dm / Init

Method Init

src/windows/InstanceMutex.cpp:12–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12HRESULT InstanceMutex::Init()
13{
14#ifdef DISABLE_SINGLE_INSTANCE
15 return 0;
16#else
17
18 m_handle = CreateMutex(NULL, TRUE, TEXT("DiscordMessenger"));
19
20 const DWORD error = GetLastError();
21 if (error == ERROR_ALREADY_EXISTS)
22 Close();
23
24 return error;
25#endif
26}
27
28InstanceMutex::~InstanceMutex()
29{

Callers 3

WindowProcFunction · 0.45
ForceSingleInstanceFunction · 0.45
WinMainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected