[SERVICES]

- Disable an unuseful DPRINT.
- Remove a redundant variable lpConfig.

svn path=/trunk/; revision=58444
This commit is contained in:
Hermès Bélusca-Maïto 2013-03-08 21:19:12 +00:00
parent 4691b190f5
commit 5cd9147a13

View file

@ -2655,7 +2655,6 @@ DWORD RQueryServiceConfigW(
LPWSTR lpDependencies = NULL; LPWSTR lpDependencies = NULL;
DWORD dwDependenciesLength = 0; DWORD dwDependenciesLength = 0;
DWORD dwRequiredSize; DWORD dwRequiredSize;
LPQUERY_SERVICE_CONFIGW lpConfig = NULL;
WCHAR lpEmptyString[] = {0,0}; WCHAR lpEmptyString[] = {0,0};
LPWSTR lpStr; LPWSTR lpStr;
@ -2718,7 +2717,7 @@ DWORD RQueryServiceConfigW(
else else
dwRequiredSize += 2 * sizeof(WCHAR); dwRequiredSize += 2 * sizeof(WCHAR);
if (lpService->lpGroup != NULL) if ((lpService->lpGroup != NULL) && (lpService->lpGroup->lpGroupName != NULL))
dwRequiredSize += (DWORD)((wcslen(lpService->lpGroup->lpGroupName) + 1) * sizeof(WCHAR)); dwRequiredSize += (DWORD)((wcslen(lpService->lpGroup->lpGroupName) + 1) * sizeof(WCHAR));
else else
dwRequiredSize += 2 * sizeof(WCHAR); dwRequiredSize += 2 * sizeof(WCHAR);
@ -2744,13 +2743,12 @@ DWORD RQueryServiceConfigW(
} }
else else
{ {
lpConfig = (LPQUERY_SERVICE_CONFIGW)lpServiceConfig; lpServiceConfig->dwServiceType = lpService->Status.dwServiceType;
lpConfig->dwServiceType = lpService->Status.dwServiceType; lpServiceConfig->dwStartType = lpService->dwStartType;
lpConfig->dwStartType = lpService->dwStartType; lpServiceConfig->dwErrorControl = lpService->dwErrorControl;
lpConfig->dwErrorControl = lpService->dwErrorControl; lpServiceConfig->dwTagId = lpService->dwTag;
lpConfig->dwTagId = lpService->dwTag;
lpStr = (LPWSTR)(lpConfig + 1); lpStr = (LPWSTR)(lpServiceConfig + 1);
/* Append the image path */ /* Append the image path */
if (lpImagePath != NULL) if (lpImagePath != NULL)
@ -2762,7 +2760,7 @@ DWORD RQueryServiceConfigW(
wcscpy(lpStr, lpEmptyString); wcscpy(lpStr, lpEmptyString);
} }
lpConfig->lpBinaryPathName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpBinaryPathName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (wcslen(lpStr) + 1); lpStr += (wcslen(lpStr) + 1);
/* Append the group name */ /* Append the group name */
@ -2775,7 +2773,7 @@ DWORD RQueryServiceConfigW(
wcscpy(lpStr, lpEmptyString); wcscpy(lpStr, lpEmptyString);
} }
lpConfig->lpLoadOrderGroup = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpLoadOrderGroup = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (wcslen(lpStr) + 1); lpStr += (wcslen(lpStr) + 1);
/* Append Dependencies */ /* Append Dependencies */
@ -2790,7 +2788,7 @@ DWORD RQueryServiceConfigW(
wcscpy(lpStr, lpEmptyString); wcscpy(lpStr, lpEmptyString);
} }
lpConfig->lpDependencies = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpDependencies = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
if (lpDependencies != NULL) if (lpDependencies != NULL)
lpStr += dwDependenciesLength; lpStr += dwDependenciesLength;
else else
@ -2806,7 +2804,7 @@ DWORD RQueryServiceConfigW(
wcscpy(lpStr, lpEmptyString); wcscpy(lpStr, lpEmptyString);
} }
lpConfig->lpServiceStartName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpServiceStartName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (wcslen(lpStr) + 1); lpStr += (wcslen(lpStr) + 1);
/* Append the display name */ /* Append the display name */
@ -2819,7 +2817,7 @@ DWORD RQueryServiceConfigW(
wcscpy(lpStr, lpEmptyString); wcscpy(lpStr, lpEmptyString);
} }
lpConfig->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpDisplayName = (LPWSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
} }
if (pcbBytesNeeded != NULL) if (pcbBytesNeeded != NULL)
@ -2900,15 +2898,17 @@ DWORD RStartServiceW(
SC_RPC_LOCK Lock = NULL; SC_RPC_LOCK Lock = NULL;
DWORD i; DWORD i;
#ifndef NDEBUG
DPRINT("RStartServiceW(%p %lu %p) called\n", hService, argc, argv); DPRINT("RStartServiceW(%p %lu %p) called\n", hService, argc, argv);
DPRINT(" argc: %lu\n", argc); DPRINT(" argc: %lu\n", argc);
if (argv != NULL) if (argv != NULL)
{ {
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
{ {
DPRINT(" argv[%lu]: %S\n", i, argv[i]); DPRINT(" argv[%lu]: %S\n", i, argv[i].StringPtr);
} }
} }
#endif
if (ScmShutdown) if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS; return ERROR_SHUTDOWN_IN_PROGRESS;
@ -3892,7 +3892,6 @@ DWORD RQueryServiceConfigA(
LPWSTR lpDependencies = NULL; LPWSTR lpDependencies = NULL;
DWORD dwDependenciesLength = 0; DWORD dwDependenciesLength = 0;
DWORD dwRequiredSize; DWORD dwRequiredSize;
LPQUERY_SERVICE_CONFIGA lpConfig = NULL;
CHAR lpEmptyString[]={0,0}; CHAR lpEmptyString[]={0,0};
LPSTR lpStr; LPSTR lpStr;
@ -3982,11 +3981,10 @@ DWORD RQueryServiceConfigA(
} }
else else
{ {
lpConfig = (LPQUERY_SERVICE_CONFIGA)lpServiceConfig; lpServiceConfig->dwServiceType = lpService->Status.dwServiceType;
lpConfig->dwServiceType = lpService->Status.dwServiceType; lpServiceConfig->dwStartType = lpService->dwStartType;
lpConfig->dwStartType = lpService->dwStartType; lpServiceConfig->dwErrorControl = lpService->dwErrorControl;
lpConfig->dwErrorControl = lpService->dwErrorControl; lpServiceConfig->dwTagId = lpService->dwTag;
lpConfig->dwTagId = lpService->dwTag;
lpStr = (LPSTR)(lpServiceConfig + 1); lpStr = (LPSTR)(lpServiceConfig + 1);
@ -4009,7 +4007,7 @@ DWORD RQueryServiceConfigA(
strcpy(lpStr, lpEmptyString); strcpy(lpStr, lpEmptyString);
} }
lpConfig->lpBinaryPathName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpBinaryPathName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (strlen((LPSTR)lpStr) + 1); lpStr += (strlen((LPSTR)lpStr) + 1);
if (lpService->lpGroup && lpService->lpGroup->lpGroupName) if (lpService->lpGroup && lpService->lpGroup->lpGroupName)
@ -4028,7 +4026,7 @@ DWORD RQueryServiceConfigA(
strcpy(lpStr, lpEmptyString); strcpy(lpStr, lpEmptyString);
} }
lpConfig->lpLoadOrderGroup = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpLoadOrderGroup = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (strlen(lpStr) + 1); lpStr += (strlen(lpStr) + 1);
/* Append Dependencies */ /* Append Dependencies */
@ -4048,7 +4046,7 @@ DWORD RQueryServiceConfigA(
strcpy(lpStr, lpEmptyString); strcpy(lpStr, lpEmptyString);
} }
lpConfig->lpDependencies = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpDependencies = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
if (lpDependencies) if (lpDependencies)
lpStr += dwDependenciesLength; lpStr += dwDependenciesLength;
else else
@ -4070,7 +4068,7 @@ DWORD RQueryServiceConfigA(
strcpy(lpStr, lpEmptyString); strcpy(lpStr, lpEmptyString);
} }
lpConfig->lpServiceStartName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpServiceStartName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
lpStr += (strlen(lpStr) + 1); lpStr += (strlen(lpStr) + 1);
if (lpService->lpDisplayName) if (lpService->lpDisplayName)
@ -4089,7 +4087,7 @@ DWORD RQueryServiceConfigA(
strcpy(lpStr, lpEmptyString); strcpy(lpStr, lpEmptyString);
} }
lpConfig->lpDisplayName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpConfig); lpServiceConfig->lpDisplayName = (LPSTR)((ULONG_PTR)lpStr - (ULONG_PTR)lpServiceConfig);
} }
if (pcbBytesNeeded != NULL) if (pcbBytesNeeded != NULL)