[SERVICES] Tweak the binary size a bit CORE-18071

Fixes some typos like "alread"->"already"
and kill g_dwServiceBits in rpcserver.cpp
and omit points and exclamation marks at end of prints.

On GCC8.4.0dbg RosBE2.2.1 this shrinks the file for me from 210.432 to 209.920
The file is loaded many times into memory, therefore
optimization pays off here at runtime memory consumption.

Also shorten to H. Poussineau in the header sections,
to stop git from displaying diff in that line on each review
due to that special char.
This commit is contained in:
Joachim Henze 2022-03-20 20:12:56 +01:00
parent 80c56a5f6c
commit d31a557237
5 changed files with 108 additions and 115 deletions

View file

@ -4,7 +4,7 @@
* FILE: base/system/services/rpcserver.c
* PURPOSE: RPC server interface for the advapi32 calls
* COPYRIGHT: Copyright 2005-2006 Eric Kohl
* Copyright 2006-2007 Hervé Poussineau <hpoussin@reactos.org>
* Copyright 2006-2007 H. Poussineau <hpoussin@reactos.org>
* Copyright 2007 Ged Murphy <gedmurphy@reactos.org>
*/
@ -99,7 +99,6 @@ ScmServiceMapping = {SERVICE_READ,
SERVICE_EXECUTE,
SERVICE_ALL_ACCESS};
DWORD g_dwServiceBits = 0;
/* FUNCTIONS ***************************************************************/
@ -156,7 +155,7 @@ ScmCreateManagerHandle(LPWSTR lpDatabaseName,
}
else if (_wcsicmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0)
{
DPRINT("Invalid Database name %S.\n", lpDatabaseName);
DPRINT("Invalid Database name %S\n", lpDatabaseName);
return ERROR_INVALID_NAME;
}
@ -210,7 +209,7 @@ ScmGetServiceManagerFromHandle(SC_RPC_HANDLE Handle)
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
DPRINT1("Exception: Invalid Service Manager handle!\n");
DPRINT1("Exception: Invalid Service Manager handle\n");
}
_SEH2_END;
@ -230,7 +229,7 @@ ScmGetServiceFromHandle(SC_RPC_HANDLE Handle)
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
DPRINT1("Exception: Invalid Service handle!\n");
DPRINT1("Exception: Invalid Service handle\n");
}
_SEH2_END;
@ -429,7 +428,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
(ServiceNameLen + 1) * sizeof(WCHAR));
if (*RelativeName == NULL)
{
DPRINT("Error allocating memory for boot driver name!\n");
DPRINT("Error allocating memory for boot driver name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -451,7 +450,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
if (*RelativeName == NULL)
{
DPRINT("Error allocating memory for boot driver name!\n");
DPRINT("Error allocating memory for boot driver name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -477,7 +476,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
(BufferSize + 1) * sizeof(WCHAR));
if (!Expanded)
{
DPRINT("Error allocating memory for boot driver name!\n");
DPRINT("Error allocating memory for boot driver name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -508,7 +507,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
NtPathName.Length + sizeof(UNICODE_NULL));
if (!Expanded)
{
DPRINT("Error allocating memory for boot driver name!\n");
DPRINT("Error allocating memory for boot driver name\n");
RtlFreeUnicodeString(&NtPathName);
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -529,7 +528,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
(ServiceNameLen - ExpandedLen) * sizeof(WCHAR) + 13*sizeof(WCHAR));
if (*RelativeName == NULL)
{
DPRINT("Error allocating memory for boot driver name!\n");
DPRINT("Error allocating memory for boot driver name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -663,7 +662,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
if (*lpCanonName == NULL)
{
DPRINT("Error allocating memory for canonized service name!\n");
DPRINT("Error allocating memory for canonized service name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -689,7 +688,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
if (*lpCanonName == NULL)
{
DPRINT("Error allocating memory for canonized service name!\n");
DPRINT("Error allocating memory for canonized service name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -712,7 +711,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
if (*lpCanonName == NULL)
{
DPRINT("Error allocating memory for canonized service name!\n");
DPRINT("Error allocating memory for canonized service name\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -725,7 +724,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
/* It seems to be a DOS path, convert it */
if (!RtlDosPathNameToNtPathName_U(lpServiceName, &NtServiceName, NULL, NULL))
{
DPRINT("RtlDosPathNameToNtPathName_U() failed!\n");
DPRINT("RtlDosPathNameToNtPathName_U() failed\n");
return ERROR_INVALID_PARAMETER;
}
@ -735,7 +734,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
if (*lpCanonName == NULL)
{
DPRINT("Error allocating memory for canonized service name!\n");
DPRINT("Error allocating memory for canonized service name\n");
RtlFreeUnicodeString(&NtServiceName);
return ERROR_NOT_ENOUGH_MEMORY;
}
@ -758,7 +757,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
{
/* There is a problem, free name and return */
HeapFree(GetProcessHeap(), 0, *lpCanonName);
DPRINT("Error converting named!\n");
DPRINT("Error converting named\n");
return Result;
}
@ -816,7 +815,7 @@ Int_EnumDependentServicesW(HKEY hServicesKey,
NULL);
if (dwError != ERROR_SUCCESS)
{
DPRINT("ERROR! Unable to get number of services keys.\n");
DPRINT("ERROR! Unable to get number of services keys\n");
return dwError;
}
@ -1022,7 +1021,7 @@ RCloseServiceHandle(
/* If pcbBytesNeeded returned a value then there are services running that are dependent on this service */
if (pcbBytesNeeded)
{
DPRINT("Deletion failed due to running dependencies.\n");
DPRINT("Deletion failed due to running dependencies\n");
RegCloseKey(hServicesKey);
ScmUnlockDatabase();
return ERROR_SUCCESS;
@ -1093,7 +1092,7 @@ RControlService(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1101,7 +1100,7 @@ RControlService(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT1("lpService == NULL!\n");
DPRINT1("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1174,7 +1173,7 @@ RControlService(
are dependent on this service */
if (pcbBytesNeeded != 0)
{
DPRINT("Service has running dependencies. Failed to stop service.\n");
DPRINT("Service has running dependencies. Failed to stop service\n");
return ERROR_DEPENDENT_SERVICES_RUNNING;
}
}
@ -1316,7 +1315,7 @@ RDeleteService(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1327,7 +1326,7 @@ RDeleteService(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1336,7 +1335,7 @@ RDeleteService(
if (lpService->bDeleted)
{
DPRINT("The service has already been marked for delete!\n");
DPRINT("Service has already been marked for delete\n");
dwError = ERROR_SERVICE_MARKED_FOR_DELETE;
goto Done;
}
@ -1372,7 +1371,7 @@ RLockServiceDatabase(
hMgr = ScmGetServiceManagerFromHandle(hSCManager);
if (hMgr == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1406,7 +1405,7 @@ RQueryServiceObjectSecurity(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1428,7 +1427,7 @@ RQueryServiceObjectSecurity(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1491,7 +1490,7 @@ RSetServiceObjectSecurity(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1536,7 +1535,7 @@ RSetServiceObjectSecurity(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT1("lpService == NULL!\n");
DPRINT1("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1620,7 +1619,7 @@ RQueryServiceStatus(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -1634,7 +1633,7 @@ RQueryServiceStatus(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1699,7 +1698,7 @@ RSetServiceStatus(
if (hServiceStatus == 0)
{
DPRINT("hServiceStatus == NULL!\n");
DPRINT("hServiceStatus == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1708,7 +1707,7 @@ RSetServiceStatus(
/* Check current state */
if (!ScmIsValidServiceState(lpServiceStatus->dwCurrentState))
{
DPRINT("Invalid service state!\n");
DPRINT("Invalid service state\n");
return ERROR_INVALID_DATA;
}
@ -1716,14 +1715,14 @@ RSetServiceStatus(
if (!(lpServiceStatus->dwServiceType & SERVICE_WIN32) &&
(lpServiceStatus->dwServiceType & SERVICE_DRIVER))
{
DPRINT("Invalid service type!\n");
DPRINT("Invalid service type\n");
return ERROR_INVALID_DATA;
}
/* Check accepted controls */
if (lpServiceStatus->dwControlsAccepted & ~0xFF)
{
DPRINT("Invalid controls accepted!\n");
DPRINT("Invalid controls accepted\n");
return ERROR_INVALID_DATA;
}
@ -1884,7 +1883,7 @@ RI_ScSetServiceBitsW(
if (hServiceStatus == 0)
{
DPRINT("hServiceStatus == NULL!\n");
DPRINT("hServiceStatus == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -1894,20 +1893,14 @@ RI_ScSetServiceBitsW(
if (bSetBitsOn)
{
DPRINT("Old service bits: %08lx\n", pService->dwServiceBits);
DPRINT("Old global service bits: %08lx\n", g_dwServiceBits);
pService->dwServiceBits |= dwServiceBits;
g_dwServiceBits |= dwServiceBits;
DPRINT("New service bits: %08lx\n", pService->dwServiceBits);
DPRINT("New global service bits: %08lx\n", g_dwServiceBits);
}
else
{
DPRINT("Old service bits: %08lx\n", pService->dwServiceBits);
DPRINT("Old global service bits: %08lx\n", g_dwServiceBits);
pService->dwServiceBits &= ~dwServiceBits;
g_dwServiceBits &= ~dwServiceBits;
DPRINT("New service bits: %08lx\n", pService->dwServiceBits);
DPRINT("New global service bits: %08lx\n", g_dwServiceBits);
}
return ERROR_SUCCESS;
@ -1957,7 +1950,7 @@ RChangeServiceConfigW(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -2016,7 +2009,7 @@ RChangeServiceConfigW(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -2025,7 +2018,7 @@ RChangeServiceConfigW(
if (lpService->bDeleted)
{
DPRINT("The service has already been marked for delete!\n");
DPRINT("Service has already been marked for delete\n");
dwError = ERROR_SERVICE_MARKED_FOR_DELETE;
goto done;
}
@ -2313,7 +2306,7 @@ RCreateServiceW(
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -2730,7 +2723,7 @@ REnumDependentServicesW(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -2777,7 +2770,7 @@ REnumDependentServicesW(
(dwServicesReturned + 1) * sizeof(PSERVICE));
if (!lpServicesArray)
{
DPRINT1("Could not allocate a buffer!!\n");
DPRINT1("Could not allocate buffer\n");
dwError = ERROR_NOT_ENOUGH_MEMORY;
goto Done;
}
@ -2940,7 +2933,7 @@ ROpenServiceW(
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -2957,7 +2950,7 @@ ROpenServiceW(
lpService = ScmGetServiceEntryByName(lpServiceName);
if (lpService == NULL)
{
DPRINT("Could not find the service!\n");
DPRINT("Could not find service\n");
dwError = ERROR_SERVICE_DOES_NOT_EXIST;
goto Done;
}
@ -3026,7 +3019,7 @@ RQueryServiceConfigW(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -3040,7 +3033,7 @@ RQueryServiceConfigW(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -3224,7 +3217,7 @@ RQueryServiceLockStatusW(
hMgr = ScmGetServiceManagerFromHandle(hSCManager);
if (hMgr == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -3280,7 +3273,7 @@ RStartServiceW(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -3294,7 +3287,7 @@ RStartServiceW(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -3336,7 +3329,7 @@ RGetServiceDisplayNameW(
hManager = (PMANAGER_HANDLE)hSCManager;
if (hManager->Handle.Tag != MANAGER_TAG)
{
DPRINT("Invalid manager handle!\n");
DPRINT("Invalid manager handle\n");
return ERROR_INVALID_HANDLE;
}
#endif
@ -3345,7 +3338,7 @@ RGetServiceDisplayNameW(
lpService = ScmGetServiceEntryByName(lpServiceName);
if (lpService == NULL)
{
DPRINT("Could not find the service!\n");
DPRINT("Could not find service\n");
return ERROR_SERVICE_DOES_NOT_EXIST;
}
@ -3398,7 +3391,7 @@ RGetServiceKeyNameW(
hManager = (PMANAGER_HANDLE)hSCManager;
if (hManager->Handle.Tag != MANAGER_TAG)
{
DPRINT("Invalid manager handle!\n");
DPRINT("Invalid manager handle\n");
return ERROR_INVALID_HANDLE;
}
#endif
@ -3407,7 +3400,7 @@ RGetServiceKeyNameW(
lpService = ScmGetServiceEntryByDisplayName(lpDisplayName);
if (lpService == NULL)
{
DPRINT("Could not find the service!\n");
DPRINT("Could not find service\n");
return ERROR_SERVICE_DOES_NOT_EXIST;
}
@ -3768,7 +3761,7 @@ REnumDependentServicesA(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -3820,7 +3813,7 @@ REnumDependentServicesA(
(dwServicesReturned + 1) * sizeof(PSERVICE));
if (!lpServicesArray)
{
DPRINT("Could not allocate a buffer!!\n");
DPRINT("Could not allocate buffer\n");
dwError = ERROR_NOT_ENOUGH_MEMORY;
goto Done;
}
@ -3926,7 +3919,7 @@ REnumServicesStatusA(
lpStatusPtrW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBufSize);
if (!lpStatusPtrW)
{
DPRINT("Failed to allocate buffer!\n");
DPRINT("Failed to allocate buffer\n");
return ERROR_NOT_ENOUGH_MEMORY;
}
}
@ -4097,7 +4090,7 @@ RQueryServiceConfigA(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -4111,7 +4104,7 @@ RQueryServiceConfigA(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -4328,7 +4321,7 @@ RQueryServiceLockStatusA(
hMgr = ScmGetServiceManagerFromHandle(hSCManager);
if (hMgr == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -4375,7 +4368,7 @@ RStartServiceA(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -4389,7 +4382,7 @@ RStartServiceA(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -4479,7 +4472,7 @@ RGetServiceDisplayNameA(
hManager = (PMANAGER_HANDLE)hSCManager;
if (hManager->Handle.Tag != MANAGER_TAG)
{
DPRINT("Invalid manager handle!\n");
DPRINT("Invalid manager handle\n");
return ERROR_INVALID_HANDLE;
}
#endif
@ -4508,7 +4501,7 @@ RGetServiceDisplayNameA(
if (lpService == NULL)
{
DPRINT("Could not find the service!\n");
DPRINT("Could not find service\n");
return ERROR_SERVICE_DOES_NOT_EXIST;
}
@ -4600,7 +4593,7 @@ RGetServiceKeyNameA(
hManager = (PMANAGER_HANDLE)hSCManager;
if (hManager->Handle.Tag != MANAGER_TAG)
{
DPRINT("Invalid manager handle!\n");
DPRINT("Invalid manager handle\n");
return ERROR_INVALID_HANDLE;
}
#endif
@ -4627,7 +4620,7 @@ RGetServiceKeyNameA(
if (lpService == NULL)
{
DPRINT("Could not find the service!\n");
DPRINT("Could not find service\n");
return ERROR_SERVICE_DOES_NOT_EXIST;
}
@ -4710,7 +4703,7 @@ RI_ScGetCurrentGroupStateW(
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -4782,7 +4775,7 @@ REnumServiceGroupW(
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -4797,14 +4790,14 @@ REnumServiceGroupW(
if ((dwServiceType == 0) ||
((dwServiceType & ~SERVICE_TYPE_ALL) != 0))
{
DPRINT("Not a valid Service Type!\n");
DPRINT("Invalid Service Type\n");
return ERROR_INVALID_PARAMETER;
}
if ((dwServiceState == 0) ||
((dwServiceState & ~SERVICE_STATE_ALL) != 0))
{
DPRINT("Not a valid Service State!\n");
DPRINT("Invalid Service State\n");
return ERROR_INVALID_PARAMETER;
}
@ -5442,7 +5435,7 @@ RChangeServiceConfig2W(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT("Invalid service handle!\n");
DPRINT("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -5466,7 +5459,7 @@ RChangeServiceConfig2W(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -5482,7 +5475,7 @@ RChangeServiceConfig2W(
if (lpService->bDeleted)
{
DPRINT("The service has already been marked for delete!\n");
DPRINT("Service has already been marked for delete\n");
dwError = ERROR_SERVICE_MARKED_FOR_DELETE;
goto done;
}
@ -5584,7 +5577,7 @@ RQueryServiceConfig2A(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -5598,7 +5591,7 @@ RQueryServiceConfig2A(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -5830,7 +5823,7 @@ RQueryServiceConfig2W(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -5844,7 +5837,7 @@ RQueryServiceConfig2W(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -6047,7 +6040,7 @@ RQueryServiceStatusEx(
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
DPRINT1("Invalid service handle!\n");
DPRINT1("Invalid service handle\n");
return ERROR_INVALID_HANDLE;
}
@ -6061,7 +6054,7 @@ RQueryServiceStatusEx(
lpService = hSvc->ServiceEntry;
if (lpService == NULL)
{
DPRINT("lpService == NULL!\n");
DPRINT("lpService == NULL\n");
return ERROR_INVALID_HANDLE;
}
@ -6126,7 +6119,7 @@ REnumServicesStatusExA(
pszGroupNameW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (strlen(pszGroupName) + 1) * sizeof(WCHAR));
if (!pszGroupNameW)
{
DPRINT("Failed to allocate buffer!\n");
DPRINT("Failed to allocate buffer\n");
dwError = ERROR_NOT_ENOUGH_MEMORY;
goto Done;
}
@ -6144,7 +6137,7 @@ REnumServicesStatusExA(
lpStatusPtrW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cbBufSize);
if (!lpStatusPtrW)
{
DPRINT("Failed to allocate buffer!\n");
DPRINT("Failed to allocate buffer\n");
dwError = ERROR_NOT_ENOUGH_MEMORY;
goto Done;
}
@ -6268,7 +6261,7 @@ REnumServicesStatusExW(
hManager = ScmGetServiceManagerFromHandle(hSCManager);
if (hManager == NULL)
{
DPRINT1("Invalid service manager handle!\n");
DPRINT1("Invalid service manager handle\n");
return ERROR_INVALID_HANDLE;
}
@ -6283,14 +6276,14 @@ REnumServicesStatusExW(
if ((dwServiceType == 0) ||
((dwServiceType & ~SERVICE_TYPE_ALL) != 0))
{
DPRINT("Not a valid Service Type!\n");
DPRINT("Invalid Service Type\n");
return ERROR_INVALID_PARAMETER;
}
if ((dwServiceState == 0) ||
((dwServiceState & ~SERVICE_STATE_ALL) != 0))
{
DPRINT("Not a valid Service State!\n");
DPRINT("Invalid Service State\n");
return ERROR_INVALID_PARAMETER;
}
@ -6298,7 +6291,7 @@ REnumServicesStatusExW(
if (!RtlAreAllAccessesGranted(hManager->Handle.DesiredAccess,
SC_MANAGER_ENUMERATE_SERVICE))
{
DPRINT("Insufficient access rights! 0x%lx\n",
DPRINT("Insufficient access rights 0x%lx\n",
hManager->Handle.DesiredAccess);
return ERROR_ACCESS_DENIED;
}