Displaying 7 results from an estimated 7 matches for "service_start_pending".
2013 Aug 21
2
[PATCH 1/3] Rationalise whitespace to 4 space indentation with no trailing spaces
...viceCtrlHandler (
- SVCNAME,
- SvcCtrlHandler
- );
-
- if (!gSvcStatusHandle) {
- SvcReportEvent(TEXT("RegisterServiceCtrlHandler"));
- return;
- }
-
- gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- gSvcStatus.dwServiceSpecificExitCode = 0;
-
- ReportSvcStatus (
- SERVICE_START_PENDING,
- NO_ERROR,
- 3000
- );
-
- SvcInit (
- dwArgc,
- lpszArgv
- );
+ gSvcStatusHandle = RegisterServiceCtrlHandler (
+ SVCNAME,
+ SvcCtrlHandler
+ );
+
+ if (!gSvcStatusHandle) {
+ SvcReportEvent(TEXT("RegisterServiceCtrlHandler"));
+ return;
+...
2005 Nov 22
1
Win32 Service Timeout command
...or some additional
feedback.
Heesob, is this because of the default 2 second WaitHint value that
StartService() uses?
If so, I think the solution is to allow a "timeout=" option in the
Service.create_service method, and wrap the StartService() function in a
"while dwCurrentState == SERVICE_START_PENDING; sleep(x)" type of loop.
I''m basing my opinion on this link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc
/base/starting_a_service.asp
Does that seem a reasonable approach?
Of course, this would still mean Jamey would have to guess at a timeout
value. I...
2013 Aug 29
5
[PATCH 1/6] Rationalise whitespace to 4 space indentation with no trailing spaces
...viceCtrlHandler (
- SVCNAME,
- SvcCtrlHandler
- );
-
- if (!gSvcStatusHandle) {
- SvcReportEvent(TEXT("RegisterServiceCtrlHandler"));
- return;
- }
-
- gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- gSvcStatus.dwServiceSpecificExitCode = 0;
-
- ReportSvcStatus (
- SERVICE_START_PENDING,
- NO_ERROR,
- 3000
- );
-
- SvcInit (
- dwArgc,
- lpszArgv
- );
+ gSvcStatusHandle = RegisterServiceCtrlHandler (
+ SVCNAME,
+ SvcCtrlHandler
+ );
+
+ if (!gSvcStatusHandle) {
+ SvcReportEvent(TEXT("RegisterServiceCtrlHandler"));
+ return;
+...
2005 Nov 26
1
Another patch of win32-service for nice startup.
...Name = lpszArgv[0];
@@ -46,6 +48,15 @@
rb_raise(cDaemonError,"RegisterServiceCtrlHandler failed");
}
+ // wait for sevice initialization
+ for(i=1;TRUE;i++)
+ {
+ if(WaitForSingleObject(hStartEvent, 1000) == WAIT_OBJECT_0)
+ break;
+
+ SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000);
+ }
+
// The service has started.
SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
@@ -241,9 +252,9 @@
}
#endif
- // Create Thread for service main
- hThread = CreateThread(NULL,0,ThreadProc,0,0,&ThreadId);
- if(hThread == INVALID_HANDLE_VALUE){
+...
2005 Nov 23
0
Some code change suggestions of thenwin32-service package
...|f| f.puts("#{i}") }
> sleep 10
> end
> end
>
> I think it is not a perfect solution but at least better than
> the current
> verison.
>
> Regards,
>
> Park Heesob
This looks reasonable. Did we still want to use
SetTheServiceStatus(SERVICE_START_PENDING, NO_ERROR, checkpoint, 0)
somewhere during initialization, or does the creation of a service_init
method eliminate the need for it?
Thanks,
Dan
2006 Dec 07
0
Fwd: win32-service problems with patch
...HANDLE)0){
- ErrorStopService();
- rb_raise(cDaemonError,"RegisterServiceCtrlHandler failed");
- }
-
- // wait for sevice initialization
- for(i=1;TRUE;i++)
- {
- if(WaitForSingleObject(hStartEvent, 1000) == WAIT_OBJECT_0)
- break;
-
- SetTheServiceStatus(SERVICE_START_PENDING, 0, i, 1000);
+ // no service to stop, no service handle to notify,
+ // nothing to do but exit
+ return;
}
// The service has started.
SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
+ SetEvent(hStartEvent);
+
// Main loop for the service.
while(WaitFor...
2011 Dec 16
0
Wine release 1.3.35
...vcp90: Added _Locinfo::_Getlconv implementation.
msvcp90: Added _Locinfo::_Getname implementation.
msvcp90: Added _Locinfo::_Getdays implementation.
msvcp90: Added _Locinfo::_Getmonths implementation.
msvcp90: Added _Locinfo::_Gettnames implementation.
services: Accept SERVICE_START_PENDING as valid service start status.
services: Set result inside service_send_command.
services: Fix SERVICE_STATUS initialization in svcctl_ControlService.
services: Check process status to determine if service has terminated.
services: Don't close control_pipe when SERVICE_C...