Hi,
How can I get it, that a service starts before the log on?
Thank you for your help!
M**
Printable View
Hi,
How can I get it, that a service starts before the log on?
Thank you for your help!
M**
What "lock on"?
Sorry, I mine log 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
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**
What does your service do? Can you explain what you mean by visible?
s
My service starts an OnScreenKeyboard, which I need for the log on.
M**
what have you specified for the lpServiceStartName? Better yet, please code you are using to install the service and any service configuration
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...).
HEre is where you are going to run into trouble. The exact nature will depend on your OS and even SP.Quote:
My service starts an OnScreenKeyboard, which I need for the log on.
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.
my code:
M**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;
}
at http://msdn.microsoft.com/en-us/library/aa380543.aspx I have found thatI need something that works on vista and xp.Quote:
GINA DLLs are ignored in Windows Vista.
M**
Can nobody help me??
M**
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**
Okay-okay, I can't stand your suffering. :)
MSDN, CreateService Function
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.Quote:
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
Hi Igor Vartanov,
thank you for your post.
I have done what you have wrote, but it doesn't work.
With this change it takes a littel bit longer before the main GINA interface hade shown the login dialog, but not more.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 );
Can you give me your sample code?
M**