mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
[ADVAPI32] Add or improve TRACE messages in the service manager functions
This commit is contained in:
parent
e4cd48813b
commit
51bbab834c
1 changed files with 57 additions and 18 deletions
|
@ -79,7 +79,7 @@ ScCreateStatusBinding(VOID)
|
||||||
LPWSTR pszStringBinding;
|
LPWSTR pszStringBinding;
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
|
|
||||||
TRACE("ScCreateStatusBinding() called\n");
|
TRACE("ScCreateStatusBinding()\n");
|
||||||
|
|
||||||
status = RpcStringBindingComposeW(NULL,
|
status = RpcStringBindingComposeW(NULL,
|
||||||
L"ncacn_np",
|
L"ncacn_np",
|
||||||
|
@ -116,7 +116,7 @@ ScDestroyStatusBinding(VOID)
|
||||||
{
|
{
|
||||||
RPC_STATUS status;
|
RPC_STATUS status;
|
||||||
|
|
||||||
TRACE("ScDestroyStatusBinding() called\n");
|
TRACE("ScDestroyStatusBinding()\n");
|
||||||
|
|
||||||
if (hStatusBinding == NULL)
|
if (hStatusBinding == NULL)
|
||||||
return RPC_S_OK;
|
return RPC_S_OK;
|
||||||
|
@ -141,7 +141,8 @@ ScLookupServiceByServiceName(IN LPCWSTR lpServiceName,
|
||||||
{
|
{
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
TRACE("ScLookupServiceByServiceName(%S) called\n", lpServiceName);
|
TRACE("ScLookupServiceByServiceName(%S)\n",
|
||||||
|
lpServiceName);
|
||||||
|
|
||||||
if (lpActiveServices[0].bOwnProcess)
|
if (lpActiveServices[0].bOwnProcess)
|
||||||
{
|
{
|
||||||
|
@ -171,7 +172,7 @@ ScServiceMainStubA(LPVOID Context)
|
||||||
{
|
{
|
||||||
PSERVICE_THREAD_PARAMSA ThreadParams = Context;
|
PSERVICE_THREAD_PARAMSA ThreadParams = Context;
|
||||||
|
|
||||||
TRACE("ScServiceMainStubA() called\n");
|
TRACE("ScServiceMainStubA(%p)\n", Context);
|
||||||
|
|
||||||
/* Call the main service routine and free the arguments vector */
|
/* Call the main service routine and free the arguments vector */
|
||||||
(ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
|
(ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
|
||||||
|
@ -192,7 +193,7 @@ ScServiceMainStubW(LPVOID Context)
|
||||||
{
|
{
|
||||||
PSERVICE_THREAD_PARAMSW ThreadParams = Context;
|
PSERVICE_THREAD_PARAMSW ThreadParams = Context;
|
||||||
|
|
||||||
TRACE("ScServiceMainStubW() called\n");
|
TRACE("ScServiceMainStubW(%p)\n", Context);
|
||||||
|
|
||||||
/* Call the main service routine and free the arguments vector */
|
/* Call the main service routine and free the arguments vector */
|
||||||
(ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
|
(ThreadParams->lpServiceMain)(ThreadParams->dwArgCount,
|
||||||
|
@ -219,6 +220,9 @@ ScConnectControlPipe(HANDLE *hPipe)
|
||||||
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
|
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
|
||||||
DWORD dwProcessId;
|
DWORD dwProcessId;
|
||||||
|
|
||||||
|
TRACE("ScConnectControlPipe(%p)\n",
|
||||||
|
hPipe);
|
||||||
|
|
||||||
/* Get the service number and create the named pipe */
|
/* Get the service number and create the named pipe */
|
||||||
RtlZeroMemory(&QueryTable,
|
RtlZeroMemory(&QueryTable,
|
||||||
sizeof(QueryTable));
|
sizeof(QueryTable));
|
||||||
|
@ -431,12 +435,14 @@ ScStartService(PACTIVE_SERVICE lpService,
|
||||||
PSERVICE_THREAD_PARAMSA ThreadParamsA;
|
PSERVICE_THREAD_PARAMSA ThreadParamsA;
|
||||||
PSERVICE_THREAD_PARAMSW ThreadParamsW;
|
PSERVICE_THREAD_PARAMSW ThreadParamsW;
|
||||||
|
|
||||||
|
TRACE("ScStartService(%p %p)\n",
|
||||||
|
lpService, ControlPacket);
|
||||||
|
|
||||||
if (lpService == NULL || ControlPacket == NULL)
|
if (lpService == NULL || ControlPacket == NULL)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
TRACE("ScStartService(Size: %lu, Service: '%S') called\n",
|
TRACE("Size: %lu\n", ControlPacket->dwSize);
|
||||||
ControlPacket->dwSize,
|
TRACE("Service: %S\n", (PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset));
|
||||||
(PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset));
|
|
||||||
|
|
||||||
/* Set the service status handle */
|
/* Set the service status handle */
|
||||||
lpService->hServiceStatus = ControlPacket->hServiceStatus;
|
lpService->hServiceStatus = ControlPacket->hServiceStatus;
|
||||||
|
@ -519,12 +525,14 @@ ScControlService(PACTIVE_SERVICE lpService,
|
||||||
{
|
{
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
|
TRACE("ScControlService(%p %p)\n",
|
||||||
|
lpService, ControlPacket);
|
||||||
|
|
||||||
if (lpService == NULL || ControlPacket == NULL)
|
if (lpService == NULL || ControlPacket == NULL)
|
||||||
return ERROR_INVALID_PARAMETER;
|
return ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
TRACE("ScControlService(Size: %lu, Service: '%S') called\n",
|
TRACE("Size: %lu\n", ControlPacket->dwSize);
|
||||||
ControlPacket->dwSize,
|
TRACE("Service: %S\n", (PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset));
|
||||||
(PWSTR)((ULONG_PTR)ControlPacket + ControlPacket->dwServiceNameOffset));
|
|
||||||
|
|
||||||
if (lpService->HandlerFunction)
|
if (lpService->HandlerFunction)
|
||||||
{
|
{
|
||||||
|
@ -539,7 +547,7 @@ ScControlService(PACTIVE_SERVICE lpService,
|
||||||
lpService->HandlerContext);
|
lpService->HandlerContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("ScControlService() done (error %lu)\n", dwError);
|
TRACE("ScControlService() done (Error %lu)\n", dwError);
|
||||||
|
|
||||||
return dwError;
|
return dwError;
|
||||||
}
|
}
|
||||||
|
@ -558,7 +566,8 @@ ScServiceDispatcher(HANDLE hPipe,
|
||||||
SCM_REPLY_PACKET ReplyPacket;
|
SCM_REPLY_PACKET ReplyPacket;
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
TRACE("ScDispatcherLoop() called\n");
|
TRACE("ScServiceDispatcher(%p %p %lu)\n",
|
||||||
|
hPipe, ControlPacket, dwBufferSize);
|
||||||
|
|
||||||
if (ControlPacket == NULL || dwBufferSize < sizeof(SCM_CONTROL_PACKET))
|
if (ControlPacket == NULL || dwBufferSize < sizeof(SCM_CONTROL_PACKET))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -648,6 +657,9 @@ RegisterServiceCtrlHandlerA(LPCSTR lpServiceName,
|
||||||
UNICODE_STRING ServiceNameU;
|
UNICODE_STRING ServiceNameU;
|
||||||
SERVICE_STATUS_HANDLE hServiceStatus;
|
SERVICE_STATUS_HANDLE hServiceStatus;
|
||||||
|
|
||||||
|
TRACE("RegisterServiceCtrlHandlerA(%s %p %p)\n",
|
||||||
|
debugstr_a(lpServiceName), lpHandlerProc);
|
||||||
|
|
||||||
RtlInitAnsiString(&ServiceNameA, lpServiceName);
|
RtlInitAnsiString(&ServiceNameA, lpServiceName);
|
||||||
if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&ServiceNameU, &ServiceNameA, TRUE)))
|
if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&ServiceNameU, &ServiceNameA, TRUE)))
|
||||||
{
|
{
|
||||||
|
@ -676,6 +688,9 @@ RegisterServiceCtrlHandlerW(LPCWSTR lpServiceName,
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
PACTIVE_SERVICE Service;
|
PACTIVE_SERVICE Service;
|
||||||
|
|
||||||
|
TRACE("RegisterServiceCtrlHandlerW(%s %p %p)\n",
|
||||||
|
debugstr_w(lpServiceName), lpHandlerProc);
|
||||||
|
|
||||||
dwError = ScLookupServiceByServiceName(lpServiceName, &Service);
|
dwError = ScLookupServiceByServiceName(lpServiceName, &Service);
|
||||||
if ((dwError != ERROR_SUCCESS) || (Service == NULL))
|
if ((dwError != ERROR_SUCCESS) || (Service == NULL))
|
||||||
{
|
{
|
||||||
|
@ -692,7 +707,7 @@ RegisterServiceCtrlHandlerW(LPCWSTR lpServiceName,
|
||||||
Service->HandlerFunction = lpHandlerProc;
|
Service->HandlerFunction = lpHandlerProc;
|
||||||
Service->HandlerFunctionEx = NULL;
|
Service->HandlerFunctionEx = NULL;
|
||||||
|
|
||||||
TRACE("RegisterServiceCtrlHandler returning 0x%p\n", Service->hServiceStatus);
|
TRACE("RegisterServiceCtrlHandler returning %p\n", Service->hServiceStatus);
|
||||||
|
|
||||||
return Service->hServiceStatus;
|
return Service->hServiceStatus;
|
||||||
}
|
}
|
||||||
|
@ -712,6 +727,9 @@ RegisterServiceCtrlHandlerExA(LPCSTR lpServiceName,
|
||||||
UNICODE_STRING ServiceNameU;
|
UNICODE_STRING ServiceNameU;
|
||||||
SERVICE_STATUS_HANDLE hServiceStatus;
|
SERVICE_STATUS_HANDLE hServiceStatus;
|
||||||
|
|
||||||
|
TRACE("RegisterServiceCtrlHandlerExA(%s %p %p)\n",
|
||||||
|
debugstr_a(lpServiceName), lpHandlerProc, lpContext);
|
||||||
|
|
||||||
RtlInitAnsiString(&ServiceNameA, lpServiceName);
|
RtlInitAnsiString(&ServiceNameA, lpServiceName);
|
||||||
if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&ServiceNameU, &ServiceNameA, TRUE)))
|
if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&ServiceNameU, &ServiceNameA, TRUE)))
|
||||||
{
|
{
|
||||||
|
@ -742,6 +760,9 @@ RegisterServiceCtrlHandlerExW(LPCWSTR lpServiceName,
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
PACTIVE_SERVICE Service;
|
PACTIVE_SERVICE Service;
|
||||||
|
|
||||||
|
TRACE("RegisterServiceCtrlHandlerExW(%s %p %p)\n",
|
||||||
|
debugstr_w(lpServiceName), lpHandlerProc, lpContext);
|
||||||
|
|
||||||
dwError = ScLookupServiceByServiceName(lpServiceName, &Service);
|
dwError = ScLookupServiceByServiceName(lpServiceName, &Service);
|
||||||
if ((dwError != ERROR_SUCCESS) || (Service == NULL))
|
if ((dwError != ERROR_SUCCESS) || (Service == NULL))
|
||||||
{
|
{
|
||||||
|
@ -776,6 +797,7 @@ VOID
|
||||||
WINAPI
|
WINAPI
|
||||||
I_ScIsSecurityProcess(VOID)
|
I_ScIsSecurityProcess(VOID)
|
||||||
{
|
{
|
||||||
|
FIXME("I_ScIsSecurityProcess()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -794,6 +816,9 @@ I_ScPnPGetServiceName(IN SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
{
|
{
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
|
TRACE("I_ScPnPGetServiceName(%lu %p %lu)\n",
|
||||||
|
hServiceStatus, lpServiceName, cchServiceName);
|
||||||
|
|
||||||
for (i = 0; i < dwActiveServiceCount; i++)
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
{
|
{
|
||||||
if (lpActiveServices[i].hServiceStatus == hServiceStatus)
|
if (lpActiveServices[i].hServiceStatus == hServiceStatus)
|
||||||
|
@ -823,6 +848,10 @@ I_ScSetServiceBitsA(SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
|
||||||
|
TRACE("I_ScSetServiceBitsA(%lu %lx %u %u %s)\n",
|
||||||
|
hServiceStatus, dwServiceBits, bSetBitsOn, bUpdateImmediately,
|
||||||
|
debugstr_a(lpString));
|
||||||
|
|
||||||
RpcTryExcept
|
RpcTryExcept
|
||||||
{
|
{
|
||||||
bResult = RI_ScSetServiceBitsA((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
|
bResult = RI_ScSetServiceBitsA((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
|
||||||
|
@ -858,6 +887,10 @@ I_ScSetServiceBitsW(SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
{
|
{
|
||||||
BOOL bResult;
|
BOOL bResult;
|
||||||
|
|
||||||
|
TRACE("I_ScSetServiceBitsW(%lu %lx %u %u %s)\n",
|
||||||
|
hServiceStatus, dwServiceBits, bSetBitsOn, bUpdateImmediately,
|
||||||
|
debugstr_w(lpString));
|
||||||
|
|
||||||
RpcTryExcept
|
RpcTryExcept
|
||||||
{
|
{
|
||||||
bResult = RI_ScSetServiceBitsW((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
|
bResult = RI_ScSetServiceBitsW((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
|
||||||
|
@ -888,6 +921,9 @@ SetServiceBits(SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
BOOL bSetBitsOn,
|
BOOL bSetBitsOn,
|
||||||
BOOL bUpdateImmediately)
|
BOOL bUpdateImmediately)
|
||||||
{
|
{
|
||||||
|
TRACE("SetServiceBits(%lu %lx %u %u)\n",
|
||||||
|
hServiceStatus, dwServiceBits, bSetBitsOn, bUpdateImmediately);
|
||||||
|
|
||||||
return I_ScSetServiceBitsW(hServiceStatus,
|
return I_ScSetServiceBitsW(hServiceStatus,
|
||||||
dwServiceBits,
|
dwServiceBits,
|
||||||
bSetBitsOn,
|
bSetBitsOn,
|
||||||
|
@ -907,7 +943,8 @@ SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
{
|
{
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
|
||||||
TRACE("SetServiceStatus(hServiceStatus %lu) called\n", hServiceStatus);
|
TRACE("SetServiceStatus(%lu %p)\n",
|
||||||
|
hServiceStatus, lpServiceStatus);
|
||||||
|
|
||||||
RpcTryExcept
|
RpcTryExcept
|
||||||
{
|
{
|
||||||
|
@ -927,7 +964,7 @@ SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("SetServiceStatus() done (ret %lu)\n", dwError);
|
TRACE("SetServiceStatus() done\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -948,7 +985,8 @@ StartServiceCtrlDispatcherA(const SERVICE_TABLE_ENTRYA *lpServiceStartTable)
|
||||||
DWORD dwBufSize;
|
DWORD dwBufSize;
|
||||||
BOOL bRet = TRUE;
|
BOOL bRet = TRUE;
|
||||||
|
|
||||||
TRACE("StartServiceCtrlDispatcherA() called\n");
|
TRACE("StartServiceCtrlDispatcherA(%p)\n",
|
||||||
|
lpServiceStartTable);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (lpServiceStartTable[i].lpServiceProc != NULL)
|
while (lpServiceStartTable[i].lpServiceProc != NULL)
|
||||||
|
@ -1044,7 +1082,8 @@ StartServiceCtrlDispatcherW(const SERVICE_TABLE_ENTRYW *lpServiceStartTable)
|
||||||
DWORD dwBufSize;
|
DWORD dwBufSize;
|
||||||
BOOL bRet = TRUE;
|
BOOL bRet = TRUE;
|
||||||
|
|
||||||
TRACE("StartServiceCtrlDispatcherW() called\n");
|
TRACE("StartServiceCtrlDispatcherW(%p)\n",
|
||||||
|
lpServiceStartTable);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (lpServiceStartTable[i].lpServiceProc != NULL)
|
while (lpServiceStartTable[i].lpServiceProc != NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue