|
-
June 9th, 2008, 02:40 AM
#1
start service before log on
Hi,
How can I get it, that a service starts before the log on?
Thank you for your help!
M**
Last edited by M**; June 10th, 2008 at 12:25 AM.
-
June 9th, 2008, 08:45 AM
#2
Re: start service before lock on
-
June 10th, 2008, 12:27 AM
#3
Re: start service before log on
-
June 10th, 2008, 01:44 AM
#4
Re: start service before lock on
When you create your service using the CreateService function you specify the type of service as SERVICE_AUTO_START. See the doco on CreateService for more details and other options.
s
-
June 10th, 2008, 01:54 AM
#5
Re: start service before lock on
I have done that, but the service starts after the log on and not before.
Or is only the program I started with the service not visible?
M**
-
June 10th, 2008, 02:17 AM
#6
Re: start service before lock on
What does your service do? Can you explain what you mean by visible?
s
-
June 10th, 2008, 02:37 AM
#7
Re: start service before log on
My service starts an OnScreenKeyboard, which I need for the log on.
M**
-
June 10th, 2008, 07:28 PM
#8
Re: start service before log on
what have you specified for the lpServiceStartName? Better yet, please code you are using to install the service and any service configuration
-
June 10th, 2008, 07:36 PM
#9
Re: start service before lock on
1) "lock on"? - Phasers or PHoton Torpedeos...
2) "Sorry, I mine log on."....You want to lock weapons on a space mine???
(just could not resist...)
A couple of points....
1) Automatic Services start Automatically when they are needed. You can configure for an actual start (once you post your code so we can show a relatively compataible way...).
My service starts an OnScreenKeyboard, which I need for the log on.
HEre is where you are going to run into trouble. The exact nature will depend on your OS and even SP.
Login is done by a special "highly secure" program known as a "GINA". It is specifically designed to minimize tampering for fairly objious reasons.
Even if you get your "On-Screen Keyboard" to START, it is VERY unlikely that you will get it to properly interact with the default GINA.
You will be much better off simply writing a custom GINA that utilizes the functionallity of your application directly.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
June 11th, 2008, 01:24 AM
#10
Re: start service before log on
my code:
Code:
inline BOOL CServiceModule::Install()
{
if (IsInstalled())
return TRUE;
SC_HANDLE hSCM = ::OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (hSCM == NULL)
{
MessageBox(NULL, _T("Couldn't open service manager"), m_szServiceName, MB_OK);
return FALSE;
}
TCHAR szFilePath[150];
::GetModuleFileName(NULL, szFilePath, _MAX_PATH);
SC_HANDLE hService = ::CreateService(hSCM, m_szServiceName, m_szServiceName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, szFilePath, NULL, NULL, NULL, NULL, NULL);
if (hService == NULL)
{
::CloseServiceHandle(hSCM);
MessageBox(NULL, _T("Couldn't create service"), m_szServiceName, MB_OK);
return FALSE;
}
::CloseServiceHandle(hService);
::CloseServiceHandle(hSCM);
return TRUE;
}
M**
-
June 11th, 2008, 08:05 AM
#11
Re: start service before lock on
at http://msdn.microsoft.com/en-us/library/aa380543.aspx I have found that
GINA DLLs are ignored in Windows Vista.
I need something that works on vista and xp.
M**
-
June 18th, 2008, 01:12 AM
#12
Re: start service before log on
-
June 25th, 2008, 12:46 AM
#13
Re: start service before LogOn
I have an another OSK seen that before the LogOn starts, but apparently does not have its own GINA. On the computer I could not found any unknown GINA. I know only that there is a service. Has anyone of you an idea??
M**
-
June 26th, 2008, 05:48 AM
#14
Re: start service before LogOn
Okay-okay, I can't stand your suffering. 
MSDN, CreateService Function
lpLoadOrderGroup [in, optional]
The names of the load ordering group of which this service is a member. Specify NULL or an empty string if the service does not belong to a group.
The startup program uses load ordering groups to load groups of services in a specified order with respect to the other groups. The list of load ordering groups is contained in the following registry value:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ServiceGroupOrder
A service start order is defined by the group service belongs to. Just create your service with group specification. Base worked fine in my experiments - my service had been started even before main GINA interface had shown login dialog, even in XP which is well known slow goer in aspect of initializing services.
Best regards,
Igor
-
June 27th, 2008, 05:46 AM
#15
Re: start service before lock on
Hi Igor Vartanov,
thank you for your post.
I have done what you have wrote, but it doesn't work.
Code:
SC_HANDLE hService = ::CreateService(hSCM, m_szServiceName, m_szServiceName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, szFilePath, "Base", NULL, NULL, NULL, NULL );
With this change it takes a littel bit longer before the main GINA interface hade shown the login dialog, but not more.
Can you give me your sample code?
M**
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|