Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Tue, 9 Sep 2008 15:56:08 -0700 (PDT),    group: microsoft.public.platformsdk.security        back       


OpenSCManager() never returns   
I've written a custom smart card credential provider for Vista log
on / log off.  To facilitate smart card removal behavior once the
user's successfully logged on, I've written a service with a thread
that watches for smart card removal and acts depending on the card
removal settings (lock, log off, shutdown, do nothing).

The service is started in the cred prov's ReportResult(), immediately
before the user is logged on, after winlogon has verified the users
credentials.

In stress testing, when performing repeated card removal -> pc lock ->
fast user switches to different accounts, I'm intermittently seeing
the DoStartSvc() stop at OpenSCManager() and never return.  There's no
return value from the function at all, the whole service starting
mechanism just dies and the service never starts.

How can a function of this category just not return?  Could it be an
issue with the service control manager's status?  If so, is there a
way to wait for the manager to start, using something like
NotifyServiceStatusChange()?

VOID DoStartSvc(LPTSTR szCardSettings)
{
    SERVICE_STATUS_PROCESS ssStatus;
    DWORD dwOldCheckPoint;
    DWORD dwStartTickCount;
    DWORD dwWaitTime;
    DWORD dwBytesNeeded;

    // Get a handle to the SCM database.
    schSCManager = OpenSCManager(
                                NULL,
                                NULL,
                                SC_MANAGER_ALL_ACCESS)));

    // etc, etc
}
date: Tue, 9 Sep 2008 15:56:08 -0700 (PDT)   author:   alexsd

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us