Is there any idea what to do and where can be the problem, because i
don't like the above workarounds.
CryptAcquireContext work fine and when my service is started with
Local Service account but in this case i have problem to reach private
keys on smart card.
OS is Windows server 2003, under XP all is OK.
Thanks in advance
Sounds like you are having issues because the user profile is not
getting loaded when the service is not interactive. Try calling
LoadUserProfile to make sure the profile is fully loaded before
calling CryptAcquireContext. LoadUserProfile details are on MSDN at
http://msdn2.microsoft.com/en-us/library/aa374341.aspx