- Explicitely use UNICODE versions of OpenSCManager and OpenService.
- When OpenSCManager or OpenService fail, they return a NULL handle (not INVALID_HANDLE_VALUE).
svn path=/trunk/; revision=69719
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))
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? */
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,
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;