search for: registerservicectrlhandl

Displaying 9 results from an estimated 9 matches for "registerservicectrlhandl".

2013 Aug 21
2
[PATCH 1/3] Rationalise whitespace to 4 space indentation with no trailing spaces
...d successfully\n"); + } - CloseServiceHandle (schService); + CloseServiceHandle (schService); CloseServiceHandle (schSCManager); } -VOID -WINAPI +VOID +WINAPI SvcMain ( - DWORD dwArgc, - LPTSTR *lpszArgv + DWORD dwArgc, + LPTSTR *lpszArgv ) { - gSvcStatusHandle = RegisterServiceCtrlHandler ( - SVCNAME, - SvcCtrlHandler - ); - - if (!gSvcStatusHandle) { - SvcReportEvent(TEXT("RegisterServiceCtrlHandler")); - return; - } - - gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - gSvcStatus.dwServiceSpecificExitCode = 0; - - ReportSvcStatus ( - SERVICE_START...
2013 Aug 29
5
[PATCH 1/6] Rationalise whitespace to 4 space indentation with no trailing spaces
...d successfully\n"); + } - CloseServiceHandle (schService); + CloseServiceHandle (schService); CloseServiceHandle (schSCManager); } -VOID -WINAPI +VOID +WINAPI SvcMain ( - DWORD dwArgc, - LPTSTR *lpszArgv + DWORD dwArgc, + LPTSTR *lpszArgv ) { - gSvcStatusHandle = RegisterServiceCtrlHandler ( - SVCNAME, - SvcCtrlHandler - ); - - if (!gSvcStatusHandle) { - SvcReportEvent(TEXT("RegisterServiceCtrlHandler")); - return; - } - - gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS; - gSvcStatus.dwServiceSpecificExitCode = 0; - - ReportSvcStatus ( - SERVICE_START...
2005 Nov 26
1
Another patch of win32-service for nice startup.
...static HANDLE hStopEvent; static SERVICE_STATUS_HANDLE ssh; static DWORD dwServiceState; @@ -33,6 +34,7 @@ { DWORD bRet; DWORD dwWaitRes; + int i; // Obtain the name of the service. LPTSTR lpszServiceName = 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. SetTheServiceStatu...
2006 Jun 18
1
Win32-Service and threading
...le win32 services before I suspected some threading issues, so I did some digging first just in Ruby using DL, I created a call to GetCurrentThreadID and in logging I displayed the Current TID -- and we are switching system threads in the ruby interpreter. Looking at service.c, I see you are using RegisterServiceCtrlHandler, there is no guarantee that it will be called from the main thread (matter of fact it generally won''t). In Service_Ctrl, you make an rb_funcall using the call back hash, which then calls back into the interpreter while the main thread is still running under mainloop. My side effect was...
2007 Nov 24
5
Service.start arguments failing or causing segfault
Hi, Unless I''m mistaken the final arguments to Service.start should be passed to the Daemon''s service_main method. Correct? I modified the Service.start method (now in CVS) to look something like this: def self.start(service, host=nil, *args) ... num_args = args.length if args.empty? args = nil else args.unshift(service) # Necessary?
2006 Jun 28
3
[Fwd: [ruby] win32-service : RegisterServiceCtrlHandlerEx]
Thoughts? -------------- next part -------------- An embedded message was scrubbed... From: "Romuald du Song" <rdusong at gmail.com> Subject: [ruby] win32-service : RegisterServiceCtrlHandlerEx Date: Mon, 26 Jun 2006 00:02:10 +0200 Size: 2587 Url: http://rubyforge.org/pipermail/win32utils-devel/attachments/20060628/8f12e8f1/attachment-0001.mht
2007 Dec 28
0
Wine release 0.9.52
...er: Fix possible NULL dereference. ntoskrnl.exe: Added implementation for IoCreateDriver and IoDeleteDriver. ntoskrnl.exe: Allow returning data in ioctls along with a positive non-zero status. user32: Set the WSF_VISIBLE flag on the main window station. advapi32: Reimplement RegisterServiceCtrlHandler on top of RegisterServiceCtrlHandlerEx. advapi32: Fix RegisterServiceCtrlHandler spec entry. advapi32: Use exponential backoff when waiting for a service to start. advapi32: Replace the list of services with an array. advapi32: Return from StartServiceCtrlDispatcher when a...
2006 Dec 07
0
Fwd: win32-service problems with patch
...TheServiceStatus(DWORD dwCurrentState,DWORD dwWin32ExitCode, DWORD dwCheckPoint, DWORD dwWaitHint); @@ -57,27 +51,27 @@ (LPHANDLER_FUNCTION)Service_Ctrl); if(ssh == (SERVICE_STATUS_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, +...
2006 Jun 18
7
[Fwd: Ruby Win32-Service]
Thoughts? Dan -------------- next part -------------- An embedded message was scrubbed... From: "Patrick Hurley" <phurley at gmail.com> Subject: Ruby Win32-Service Date: Sun, 18 Jun 2006 12:46:01 -0400 Size: 2863 Url: http://rubyforge.org/pipermail/win32utils-devel/attachments/20060618/cc346796/attachment.eml