Page 2 of 2

Posted: Fri Mar 16, 2007 9:31 am
by dell_jockey
SkyManager wrote:This link seems not working
Ring's NTService library is part of the PBOSL suite - and has been for quite some time. Check out http://www.purebasic.fr/english/viewtopic.php?t=17100

Posted: Fri Mar 16, 2007 10:11 am
by SkyManager
When I run the PBOL4 example and perform a "-u" uninstallation, the NTService status is changed into "Disabled" and not remove from the NT Service list.
What can we do to fix this :?:

Posted: Fri Mar 16, 2007 3:17 pm
by techjunkie
SkyManager wrote:When I run the PBOL4 example and perform a "-u" uninstallation, the NTService status is changed into "Disabled" and not remove from the NT Service list.
What can we do to fix this :?:
Works fine for me, on WinXP Pro SP2.
[EDIT]
That is, if I stop the service before the uninstall. Haven't tried without it, but that seems stupid... :roll:

Posted: Sat Mar 17, 2007 1:04 am
by SkyManager
I am using W2K+SP4 with PB4.02

Posted: Sat Mar 17, 2007 1:27 pm
by techjunkie
SkyManager wrote:I am using W2K+SP4 with PB4.02
I have another machine with the same config, I can give it a try - but it should work... :wink:

Posted: Wed Feb 13, 2008 1:37 pm
by techjunkie
If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, you can also specify the following value.

Code: Select all

#SERVICE_INTERACTIVE_PROCESS = $100
so the service can interact with the Desktop.

Example,

Code: Select all

T_SERVICE = CreateService_(T_SCMANAGER, AppExeName, ServiceName, #SERVICE_ALL_ACCESS, (#SERVICE_WIN32_OWN_PROCESS | #SERVICE_INTERACTIVE_PROCESS), #SERVICE_DEMAND_START, #SERVICE_ERROR_NORMAL, AppHome + AppExeFileName, 0, 0, 0, 0, 0) 

Posted: Wed Feb 13, 2008 2:10 pm
by maw
Be ware though, that in Vista, Server 2008 and all future Windows versions interactive services doesn't work! This is also true if you use Fast User Switching in XP. The service will start as usual but can neither show output or recieve input from a user!

Here is an explaination of why: http://blogs.technet.com/voy/archive/20 ... erver.aspx

techjunkie wrote:If you specify either SERVICE_WIN32_OWN_PROCESS
or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, you can also specify the following value.

Code: Select all

#SERVICE_INTERACTIVE_PROCESS = $100
so the service can interact with the Desktop.

Example,

Code: Select all

T_SERVICE = CreateService_(T_SCMANAGER, AppExeName, ServiceName, #SERVICE_ALL_ACCESS, (#SERVICE_WIN32_OWN_PROCESS | #SERVICE_INTERACTIVE_PROCESS), #SERVICE_DEMAND_START, #SERVICE_ERROR_NORMAL, AppHome + AppExeFileName, 0, 0, 0, 0, 0) 

Posted: Wed Feb 13, 2008 2:18 pm
by techjunkie
maw wrote:Be ware though, that in Vista, Server 2008 and all future Windows versions interactive services doesn't work! This is also true if you use Fast User Switching in XP.
Thanks! :D I must test that on my Vista machine. I just use it to get the Window Handlers when the service is started with the System account - I must see what happens on Vista... :lol:

Re: Windows Service Framework

Posted: Fri Sep 30, 2011 4:11 pm
by rootbear
it's amazing that after a couple of years, the code is still valid!

I got another 'crash' issue here, i should call myself mr. crash ;)

here you go:

copy & paste the code and tested, working!

and then I added EnableExplicit, did adjustment here and there,

myservice -i
net start myservice

wait, it crashes!!

copy and paste the original code again, it's still working without crash!

i start to compare my version with original version, the only things i added are
poorman's debug like:

Code: Select all

_WriteLog("into function ServiceMain ")
and i start to remove those lines from my version step by step.
still crashes, keep doing so till ... i remove this line

Code: Select all

Procedure ServiceMain()
;;_WriteLog("into function ServiceMain ")
voila!

but WHY?!