Changeset 1856 for box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp
- Timestamp:
- 23/09/2007 10:18:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp
r1853 r1856 200 200 } 201 201 202 int InstallService(const char* pConfigFileName )202 int InstallService(const char* pConfigFileName, const std::string& rServiceName) 203 203 { 204 204 if (pConfigFileName != NULL) … … 236 236 237 237 std::string cmdWithArgs(cmd); 238 cmdWithArgs += " -s ";238 cmdWithArgs += " -s -S \"" + rServiceName + "\""; 239 239 240 240 if (pConfigFileName != NULL) … … 245 245 } 246 246 247 std::string serviceDesc = "Box Backup (" + rServiceName + ")"; 248 247 249 SC_HANDLE newService = CreateService( 248 250 scm, 249 SERVICE_NAME,250 "Box Backup",251 rServiceName.c_str(), 252 serviceDesc.c_str(), 251 253 SERVICE_ALL_ACCESS, 252 254 SERVICE_WIN32_OWN_PROCESS, … … 313 315 } 314 316 315 int RemoveService( void)317 int RemoveService(const std::string& rServiceName) 316 318 { 317 319 SC_HANDLE scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); … … 324 326 } 325 327 326 SC_HANDLE service = OpenService(scm, SERVICE_NAME,328 SC_HANDLE service = OpenService(scm, rServiceName.c_str(), 327 329 SERVICE_ALL_ACCESS|DELETE); 328 330 DWORD err = GetLastError();
Note: See TracChangeset
for help on using the changeset viewer.
