Author: hbelusca Date: Mon Oct 26 23:15:40 2015 New Revision: 69719
URL: http://svn.reactos.org/svn/reactos?rev=69719&view=rev Log: [SERVMAN] - Explicitely use UNICODE versions of OpenSCManager and OpenService. - When OpenSCManager or OpenService fail, they return a NULL handle (not INVALID_HANDLE_VALUE).
Modified: trunk/reactos/base/applications/mscutils/servman/delete.c trunk/reactos/base/applications/mscutils/servman/dependencies_tv2.c trunk/reactos/base/applications/mscutils/servman/query.c
Modified: trunk/reactos/base/applications/mscutils/servman/delete.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/servman/delete.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/delete.c [iso-8859-1] Mon Oct 26 23:15:40 2015 @@ -17,14 +17,14 @@ SC_HANDLE hSc; BOOL bRet = FALSE;
- hSCManager = OpenSCManager(NULL, - NULL, - SC_MANAGER_ALL_ACCESS); + hSCManager = OpenSCManagerW(NULL, + NULL, + SC_MANAGER_ALL_ACCESS); if (hSCManager) { - hSc = OpenService(hSCManager, - Info->pCurrentService->lpServiceName, - DELETE); + hSc = OpenServiceW(hSCManager, + Info->pCurrentService->lpServiceName, + DELETE); if (hSc) { if (DeleteService(hSc))
Modified: trunk/reactos/base/applications/mscutils/servman/dependencies_tv2.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/servman/dependencies_tv2.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/dependencies_tv2.c [iso-8859-1] Mon Oct 26 23:15:40 2015 @@ -17,14 +17,14 @@ DWORD dwBytesNeeded, dwCount; BOOL bRet = FALSE;
- hSCManager = OpenSCManager(NULL, - NULL, - SC_MANAGER_ALL_ACCESS); + hSCManager = OpenSCManagerW(NULL, + NULL, + SC_MANAGER_ALL_ACCESS); if (hSCManager) { - hService = OpenService(hSCManager, - lpServiceName, - SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS); + hService = OpenServiceW(hSCManager, + lpServiceName, + SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS); if (hService) { /* Does this have any dependencies? */
Modified: trunk/reactos/base/applications/mscutils/servman/query.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils/... ============================================================================== --- trunk/reactos/base/applications/mscutils/servman/query.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/servman/query.c [iso-8859-1] Mon Oct 26 23:15:40 2015 @@ -273,10 +273,10 @@ Info->pAllServices = NULL; }
- ScHandle = OpenSCManager(NULL, - NULL, - SC_MANAGER_ENUMERATE_SERVICE); - if (ScHandle != INVALID_HANDLE_VALUE) + ScHandle = OpenSCManagerW(NULL, + NULL, + SC_MANAGER_ENUMERATE_SERVICE); + if (ScHandle != NULL) { if (!EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, @@ -336,16 +336,16 @@ SC_HANDLE hScm; BOOL bRet = FALSE;
- hScm = OpenSCManager(NULL, - NULL, - SC_MANAGER_ENUMERATE_SERVICE); - if (hScm != INVALID_HANDLE_VALUE) + hScm = OpenSCManagerW(NULL, + NULL, + SC_MANAGER_ENUMERATE_SERVICE); + if (hScm != NULL) { SC_HANDLE hService;
- hService = OpenService(hScm, - pService->lpServiceName, - SERVICE_QUERY_STATUS); + hService = OpenServiceW(hScm, + pService->lpServiceName, + SERVICE_QUERY_STATUS); if (hService) { DWORD size;