Mail Archives: cygwin/1996/12/02/05:39:44
> >> Anyone explored the possibilities of running cygwin programs as services
> >> under NT?
> >
> >I can't think of any reason why you wouldn't be able to do that. As long
> >as you can create structs with longs in them and callback functions, and
> >as long as you can call DLL functions, you should be fine.
> >-
>
> Services must be multithreaded, so you need to be able to handle that.
I don't think it's really the point. There actually has to be only one thread
besides the process' main thread, the one that is produced by the call to
StartServiceCtrlDispatcher (Service_Table);
It's true that it's convenient to make a service multithreaded, at least to be
able easily pause and resume it, but there's no such a requirement at all.
I just don't see how one using cygwin32 gcc can build an application that uses
Win32 SDK API. Say you need to use winsvc.h #include file for the data structures
like SERVICE_TABLE_ENTRY to be defined and there it starts -- gcc gives a lot
of stuff like "in the file included from service.c: winsvc.h: ..."
The solution is maybe to compile separately the code for the service itself by gcc
and all the stuff you need to `decorate' the application as an NT service by MS VC++
and then link it together (I don't know whether it's possible or not)
Regards,
Dmitri Makarov.
dimm AT vnet DOT ibm DOT com
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -