@@ -108,11 +108,11 @@ int CSvrCtrl::Start(const wchar_t* szSvrName)
108
108
if (SelfElevat () == true )
109
109
return 0 ;
110
110
111
- SC_HANDLE schService{ nullptr };
112
- SERVICE_STATUS_PROCESS ssStatus{ 0 };
113
- DWORD dwOldCheckPoint{ 0 };
114
- DWORD dwStartTickCount{ 0 };
115
- DWORD dwBytesNeeded{ 0 };
111
+ SC_HANDLE schService{};
112
+ SERVICE_STATUS_PROCESS ssStatus{};
113
+ DWORD dwOldCheckPoint{};
114
+ DWORD dwStartTickCount{};
115
+ DWORD dwBytesNeeded{};
116
116
117
117
schService = OpenService (m_hSCManager, szSvrName, SERVICE_ALL_ACCESS);
118
118
@@ -203,7 +203,7 @@ int CSvrCtrl::Stop(const wchar_t* szSvrName)
203
203
if (schService == nullptr )
204
204
return -5 ;
205
205
206
- DWORD dwError{ 0 };
206
+ DWORD dwError{};
207
207
SERVICE_STATUS ssStatus;
208
208
if (ControlService (schService, SERVICE_CONTROL_STOP, &ssStatus) == 0 )
209
209
dwError = GetLastError ();
@@ -222,7 +222,7 @@ int CSvrCtrl::Pause(const wchar_t* szSvrName)
222
222
if (schService == nullptr )
223
223
return -5 ;
224
224
225
- DWORD dwError{ 0 };
225
+ DWORD dwError{};
226
226
SERVICE_STATUS ssStatus;
227
227
if (ControlService (schService, SERVICE_CONTROL_PAUSE, &ssStatus) == 0 )
228
228
dwError = GetLastError ();
@@ -241,7 +241,7 @@ int CSvrCtrl::Continue(const wchar_t* szSvrName)
241
241
if (schService == nullptr )
242
242
return -5 ;
243
243
244
- DWORD dwError{ 0 };
244
+ DWORD dwError{};
245
245
SERVICE_STATUS ssStatus;
246
246
if (ControlService (schService, SERVICE_CONTROL_CONTINUE, &ssStatus) == 0 )
247
247
dwError = GetLastError ();
@@ -319,9 +319,9 @@ bool CSvrCtrl::SelfElevat()
319
319
return false ;
320
320
321
321
// check if elevated on Vista and 7
322
- HANDLE Token{ nullptr };
323
- TOKEN_ELEVATION Elevation{ 0 }; // Token type only available with Vista/7
324
- DWORD ReturnSize{ 0 };
322
+ HANDLE Token{};
323
+ TOKEN_ELEVATION Elevation{}; // Token type only available with Vista/7
324
+ DWORD ReturnSize{};
325
325
326
326
if (!OpenProcessToken (GetCurrentProcess (), TOKEN_READ, &Token) ||
327
327
!GetTokenInformation (Token, TokenElevation, &Elevation, sizeof (Elevation), &ReturnSize))
0 commit comments