- Fix crashes in calls to ScmAssignNewTag. - ScmrCreateServiceW: Assign a group to the service. Modified: trunk/reactos/subsys/system/services/rpcserver.c _____
Modified: trunk/reactos/subsys/system/services/rpcserver.c --- trunk/reactos/subsys/system/services/rpcserver.c 2006-01-01 15:21:03 UTC (rev 20515) +++ trunk/reactos/subsys/system/services/rpcserver.c 2006-01-01 15:32:40 UTC (rev 20516) @@ -220,12 +220,11 @@
DWORD -ScmAssignNewTag(LPWSTR lpServiceGroup, - LPDWORD lpdwTagId) +ScmAssignNewTag(PSERVICE lpService) { /* FIXME */ - DPRINT("Assigning new tag in group %S\n", lpServiceGroup); - *lpdwTagId = 0; + DPRINT("Assigning new tag to service %S\n", lpService->lpServiceName); + lpService->dwTag = 0; return ERROR_SUCCESS; }
@@ -927,10 +926,10 @@
if (lpdwTagId != NULL) { - dwError = ScmAssignNewTag(lpService->lpGroup->lpGroupName, - &lpService->dwTag); + dwError = ScmAssignNewTag(lpService); if (dwError != ERROR_SUCCESS) goto done; + dwError = RegSetValueExW(hServiceKey, L"Tag", 0, @@ -939,6 +938,7 @@ sizeof(DWORD)); if (dwError != ERROR_SUCCESS) goto done; + *lpdwTagId = lpService->dwTag; }
@@ -1073,6 +1073,23 @@ wcscpy(lpService->lpDisplayName, lpDisplayName); }
+ /* Assign the service to a group */ + if (lpLoadOrderGroup != NULL && *lpLoadOrderGroup != 0) + { + dwError = ScmSetServiceGroup(lpService, + lpLoadOrderGroup); + if (dwError != ERROR_SUCCESS) + goto done; + } + + /* Assign a new tag */ + if (lpdwTagId != NULL) + { + dwError = ScmAssignNewTag(lpService); + if (dwError != ERROR_SUCCESS) + goto done; + } + /* Write service data to the registry */ /* Create the service key */ dwError = ScmCreateServiceKey(lpServiceName, @@ -1161,10 +1178,6 @@
if (lpdwTagId != NULL) { - dwError = ScmAssignNewTag(lpService->lpGroup->lpGroupName, - &lpService->dwTag); - if (dwError != ERROR_SUCCESS) - goto done; dwError = RegSetValueExW(hServiceKey, L"Tag", 0,