Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/PluginMutex.cpp

Issue 5750789393874944: [IE] First round of ATL removal (Closed)
Patch Set: Defect corrections Created June 26, 2014, 3:18 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/plugin/Wrapper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginMutex.h" 3 #include "PluginMutex.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "sddl.h" 5 #include "sddl.h"
6 6
7 7
8 CPluginMutex::CPluginMutex(const std::wstring & name, int errorSubidBase) 8 CPluginMutex::CPluginMutex(const std::wstring & name, int errorSubidBase)
9 : m_isLocked(false), m_errorSubidBase(errorSubidBase), mutex_name( L"Global\\A dblockPlus" + name ) 9 : m_isLocked(false), m_errorSubidBase(errorSubidBase), mutex_name( L"Global\\A dblockPlus" + name )
10 { 10 {
11 if (m_errorSubidBase != PLUGIN_ERROR_MUTEX_DEBUG_FILE) 11 if (m_errorSubidBase != PLUGIN_ERROR_MUTEX_DEBUG_FILE)
12 { 12 {
13 DEBUG_MUTEX( "Mutex::Create name:" + mutex_name ) 13 DEBUG_MUTEX( "Mutex::Create name:" + mutex_name )
14 } 14 }
15 m_hMutex = ::CreateMutexW( NULL, FALSE, mutex_name.c_str() ); 15 m_hMutex = ::CreateMutexW( NULL, FALSE, mutex_name.c_str() );
16 if (m_hMutex == NULL) 16 if (m_hMutex == NULL)
17 { 17 {
18 DWORD error = GetLastError(); 18 DWORD error = GetLastError();
19 m_hMutex = OpenMutexW( MUTEX_ALL_ACCESS, FALSE, mutex_name.c_str() ); 19 m_hMutex = OpenMutexW( MUTEX_ALL_ACCESS, FALSE, mutex_name.c_str() );
20 if (m_hMutex == NULL) 20 if (m_hMutex == NULL)
21 { 21 {
22 mutex_name = L"Local\\AdblockPlus" + name;
22 m_hMutex = ::CreateMutexW( NULL, FALSE, mutex_name.c_str() ); 23 m_hMutex = ::CreateMutexW( NULL, FALSE, mutex_name.c_str() );
23 if (m_hMutex == NULL) 24 if (m_hMutex == NULL)
24 { 25 {
25 m_hMutex = OpenMutexW( NULL, FALSE, mutex_name.c_str() ); 26 m_hMutex = OpenMutexW( NULL, FALSE, mutex_name.c_str() );
26 if (m_hMutex == NULL) 27 if (m_hMutex == NULL)
27 { 28 {
28 DWORD error = GetLastError(); 29 DWORD error = GetLastError();
29 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_MUTEX, PLUGIN_ERROR_MUT EX_CREATE + m_errorSubidBase, L"Mutex::CreateMutex"); 30 DEBUG_ERROR_LOG(::GetLastError(), PLUGIN_ERROR_MUTEX, PLUGIN_ERROR_MUT EX_CREATE + m_errorSubidBase, L"Mutex::CreateMutex");
30 } 31 }
31 } 32 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 93 }
93 } 94 }
94 95
95 m_hMutex = NULL; 96 m_hMutex = NULL;
96 } 97 }
97 98
98 bool CPluginMutex::IsLocked() const 99 bool CPluginMutex::IsLocked() const
99 { 100 {
100 return m_isLocked; 101 return m_isLocked;
101 } 102 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/Wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld