Changeset 86 for trunk/sources/win32service/win32service/src/svc/svc.cpp
- Timestamp:
- 08/20/10 12:19:08 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/win32service/win32service/src/svc/svc.cpp
r78 r86 3 3 #include <tchar.h> 4 4 #include <strsafe.h> 5 #include "svc/Svc.h" 5 #include "svc/svc.h" 6 #include "svc/svcdefines.h" 7 #include "svc/serviceregistry.h" 6 8 #include "rtmpserver/rtmpserver.h" 7 9 #include "svccontrol.h" … … 9 11 10 12 #pragma comment(lib, "advapi32.lib") 11 12 #define SVCNAME TEXT("evo") //name of the service13 14 13 15 14 // … … 30 29 { 31 30 SvcInstall(); 31 //OpenRegistry(); 32 32 return; 33 33 }else if( lstrcmpi( argv[1], TEXT("uninstallService")) == 0) 34 34 { 35 AddSvcCommand(argv[1]); 36 bool result = svcconfig(svcCommand);//Delete service 35 DoDeleteSvc(); 37 36 return; 38 37 } … … 52 51 } 53 52 54 // Control the service 55 if( lstrcmpi( argv[1], TEXT("startService")) == 0 || lstrcmpi( argv[1], TEXT("stopService")) == 0) 56 { 57 AddSvcCommand(argv[1]); 58 svccontrol(svcCommand);//Start/Stop service 59 return; 60 } else { 53 // Control the service and start the server normally 54 if( lstrcmpi( argv[1], TEXT("startService")) == 0) 55 { 56 DoStartSvc(); 57 return; 58 } else if( lstrcmpi( argv[1], TEXT("stopService")) == 0) 59 { 60 DoStopSvc(); 61 return; 62 }else { 61 63 if ( argc == 1 ) //if no argument, assume that rtmpserver is started normally 62 64 { 63 AddSvcCommand(TEXT("query")); 64 if (!svcconfig(svcCommand)){ 65 if (!DoQuerySvc){ 65 66 printf("Server will start normally.\n\n"); 66 67 rtmpserver(); … … 76 77 } 77 78 78 }79 80 //Populates the svcCommand array81 VOID AddSvcCommand(TCHAR * command)82 {83 svcCommand[0] = TEXT("");84 svcCommand[1] = command;85 svcCommand[2] = SVCNAME;86 79 } 87 80
Note: See TracChangeset
for help on using the changeset viewer.
