Author: gedmurphy
Date: Wed Sep 12 12:41:00 2007
New Revision: 29013
URL:
http://svn.reactos.org/svn/reactos?rev=29013&view=rev
Log:
Receive a client service handle from advapi32 so we can get a permenant link between the
SCM and the service
Modified:
trunk/reactos/base/system/services/database.c
trunk/reactos/base/system/services/rpcserver.c
trunk/reactos/base/system/services/services.h
Modified: trunk/reactos/base/system/services/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
==============================================================================
--- trunk/reactos/base/system/services/database.c (original)
+++ trunk/reactos/base/system/services/database.c Wed Sep 12 12:41:00 2007
@@ -116,12 +116,12 @@
PSERVICE
-ScmGetServiceEntryByServiceStatusHandle(ULONG Handle)
+ScmGetServiceEntryByClientHandle(ULONG Handle)
{
PLIST_ENTRY ServiceEntry;
PSERVICE CurrentService;
- DPRINT("ScmGetServiceEntryByServiceStatusHandle() called\n");
+ DPRINT("ScmGetServiceEntryByClientHandle() called\n");
DPRINT("looking for %lu\n", Handle);
ServiceEntry = ServiceListHead.Flink;
@@ -131,7 +131,7 @@
SERVICE,
ServiceListEntry);
- if (CurrentService->hServiceStatus == Handle)
+ if (CurrentService->hClient == Handle)
{
DPRINT1("Found service: '%S'\n",
CurrentService->lpDisplayName);
return CurrentService;
@@ -640,13 +640,14 @@
DPRINT("ArgsLength: %ld TotalLength: %ld\n", ArgsLength, TotalLength);
/* Allocate a control packet */
- ControlPacket = (SCM_CONTROL_PACKET*) HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- sizeof(SCM_CONTROL_PACKET) + (TotalLength - 1) *
sizeof(WCHAR));
+ ControlPacket = (SCM_CONTROL_PACKET*)HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ sizeof(SCM_CONTROL_PACKET) +
(TotalLength - 1) * sizeof(WCHAR));
if (ControlPacket == NULL)
return ERROR_NOT_ENOUGH_MEMORY;
ControlPacket->dwControl = SERVICE_CONTROL_START;
+ ControlPacket->hClient = Service->hClient;
ControlPacket->dwSize = TotalLength;
Ptr = &ControlPacket->szArguments[0];
wcscpy(Ptr, Service->lpServiceName);
@@ -793,7 +794,7 @@
/* Read SERVICE_STATUS_HANDLE from pipe */
if (!ReadFile(Service->ControlPipeHandle,
- (LPVOID)&Service->hServiceStatus,
+ (LPVOID)&Service->hClient,
sizeof(DWORD),
&dwRead,
NULL))
@@ -804,8 +805,7 @@
}
else
{
- DPRINT("Received service status %lu\n",
Service->hServiceStatus);
- DPRINT("calling ScmSendStartCommand on %S\n",
Service->lpDisplayName);
+ DPRINT("Received service status %lu\n", Service->hClient);
/* Send start command */
dwError = ScmSendStartCommand(Service, lpArgs);
Modified: trunk/reactos/base/system/services/rpcserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c (original)
+++ trunk/reactos/base/system/services/rpcserver.c Wed Sep 12 12:41:00 2007
@@ -717,7 +717,7 @@
if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS;
- lpService = ScmGetServiceEntryByServiceStatusHandle((ULONG)hServiceStatus);
+ lpService = ScmGetServiceEntryByClientHandle((ULONG)hServiceStatus);
if (lpService == NULL)
{
DPRINT1("lpService == NULL!\n");
Modified: trunk/reactos/base/system/services/services.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/servi…
==============================================================================
--- trunk/reactos/base/system/services/services.h (original)
+++ trunk/reactos/base/system/services/services.h Wed Sep 12 12:41:00 2007
@@ -41,7 +41,7 @@
BOOL bDeleted;
DWORD dwResumeCount;
- SERVICE_STATUS_HANDLE hServiceStatus;
+ CLIENT_HANDLE hClient;
SERVICE_STATUS Status;
DWORD dwStartType;
DWORD dwErrorControl;
@@ -105,7 +105,7 @@
PSERVICE ScmGetServiceEntryByName(LPWSTR lpServiceName);
PSERVICE ScmGetServiceEntryByDisplayName(LPWSTR lpDisplayName);
PSERVICE ScmGetServiceEntryByResumeCount(DWORD dwResumeCount);
-PSERVICE ScmGetServiceEntryByServiceStatusHandle(ULONG ThreadId);
+PSERVICE ScmGetServiceEntryByClientHandle(ULONG ThreadId);
DWORD ScmCreateNewServiceRecord(LPWSTR lpServiceName,
PSERVICE *lpServiceRecord);
DWORD ScmMarkServiceForDelete(PSERVICE pService);