|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Creating a Windows NT/2000/XP Service |
|
![]() Oluseyi Staff Member since: 5/14/2001 From: New York, NY, United States |
||||
|
|
||||
| Hey Dean, excellent article! Don't have a computer with MSVC, etc, accessible, so I can't test anything, but I do have one quick question. There's a Win32 API called ServiceMain, right? How does that factor in the mix? And all the calls in the article, where exactly are they made (are they inside the ServiceMain, at global scope...)? Thanks a ton. P.S. I should send you some ARMS-type email soon, once I get a prototype of something related to those Next Generation Computing threads up. |
||||
|
||||
![]() Dean Harding Member since: 2/28/2001 From: Sydney, Australia |
||||
|
|
||||
Wow, I wrote this article sooo long ago ServiceMain is the name of a placeholder function which you define and pass to StartServiceCtrlDispatcher. I called it ServiceDispatch in the article.All the functions are called from the regular main (or WinMain - it doesn't matter if it's a console app or a Windows app) function.There's nothing special about a service, it just has to call a few extra methods when it starts to update it's status in the service control manager... Looking forward to the ARMS stuff diff-like algorithms lately, something which would be useful for ARMS (though I'd probably prefer a 3rd-party diff tool - I just can't find one that I like, which is GPL or otherwise free If I had my way, I'd have all of you shot! codeka.com - Just click it. |
||||
|
||||
![]() liquiddark GDNet+ Member since: 4/14/2001 From: Kitchener, Canada |
||||
|
|
||||
| One thing that would have been useful to mention: any service running on the settings you've detailed and which has an associated GUI is a serious security risk via the WM_TIMER route. For example, until the security patches, RunAs had this problem. ld |
||||
|
||||
![]() Houdini Member since: 3/16/2000 From: Sylvania, OH, United States |
||||
|
|
||||
| Good article Dean! I wish GameDev would have posted it a little earlier, as I had the task of converting our server into a service just last week. This would have made my job a little easier One thing you could have mentioned, however, is how to allow the service to log error messages to the Windows Event Log. - Houdini |
||||
|
||||
![]() El_Bosso Member since: 11/20/2000 |
||||
|
|
||||
| Perhaps you should write an add-on. ;-) Bosso |
||||
|
||||
![]() Dean Harding Member since: 2/28/2001 From: Sydney, Australia |
||||
|
|
||||
quote: Yes, but I mentioned running in interactive mode only for debugging (so you can see popups and such). Besides, I wrote the article before that vulnerability was known about For anyone who is interested, here's the microsoft article which talks about this vulnerability. If I had my way, I'd have all of you shot! codeka.com - Just click it. [edited by - Dean Harding on March 21, 2003 5:32:50 PM] |
||||
|
||||
![]() Genagen Member since: 9/16/2001 From: Czech Republic |
||||
|
|
||||
| Very good service framework (much more detailed than presented one in this article) can be found on here. |
||||
|
||||
![]() anekin Member since: 10/16/2001 From: panama, Panama |
||||
|
|
||||
| It's a great article. Very instructive and easy to learn.. Good work!!!! |
||||
|
||||
![]() LordShade Member since: 4/14/2002 |
||||
|
|
||||
| Talk about spewing MSDN documentation! If you're going to write an article, please be somewhat original. I know developing services is really quite simple once you get into it but come on. I expect articles to have more 'meat' than MSDN and this one failed miserably. Granted, it did provide service implementation in a more condensed form but I find that the ATL Service Wizard to be highly effective in creating the basics of a service. |
||||
|
||||
![]() pprice001 Member since: 11/26/2002 From: United Kingdom |
||||
|
|
||||
| Thanks for the great tutorial, but I have a question, I am trying to define a pure virtual function in the basic template to force any derived classes into some kind of standardised usage. but I get an error as saying this is not possible. Can this be done? error Main.cpp C:\ShadowMgr\ServiceMgr\Main.cpp(8) : error C2259: 'CService' : cannot instantiate abstract class due to following members: c:\shadowmgr\servicemgr\service.h(13) : see declaration of 'CService' C:\ShadowMgr\ServiceMgr\Main.cpp(8) : warning C4259: 'bool __thiscall CService::RunTest(void)' : pure virtual function was not defined c:\shadowmgr\servicemgr\service.h(38) : see declaration of 'RunTest' Thanks in advanced |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|