mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 13:22:48 +01:00
Core: Fix many "errors"/warnings and coding style (1)
Extractors, worldserver, authserver, shared and collision affected Errors were found using Cppcheck, open-source static analysis tool
This commit is contained in:
@@ -52,8 +52,6 @@ typedef WINADVAPI BOOL (WINAPI *CSD_T)(SC_HANDLE, DWORD, LPCVOID);
|
||||
|
||||
bool WinServiceInstall()
|
||||
{
|
||||
CSD_T ChangeService_Config2;
|
||||
HMODULE advapi32;
|
||||
SC_HANDLE serviceControlManager = OpenSCManager(0, 0, SC_MANAGER_CREATE_SERVICE);
|
||||
|
||||
if (serviceControlManager)
|
||||
@@ -79,7 +77,7 @@ bool WinServiceInstall()
|
||||
0); // no password
|
||||
if (service)
|
||||
{
|
||||
advapi32 = GetModuleHandle("ADVAPI32.DLL");
|
||||
HMODULE advapi32 = GetModuleHandle("ADVAPI32.DLL");
|
||||
if (!advapi32)
|
||||
{
|
||||
CloseServiceHandle(service);
|
||||
@@ -87,7 +85,7 @@ bool WinServiceInstall()
|
||||
return false;
|
||||
}
|
||||
|
||||
ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
|
||||
CSD_T ChangeService_Config2 = (CSD_T) GetProcAddress(advapi32, "ChangeServiceConfig2A");
|
||||
if (!ChangeService_Config2)
|
||||
{
|
||||
CloseServiceHandle(service);
|
||||
|
||||
Reference in New Issue
Block a user