Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CryptAcquireContext failed for non-interactive user

65 views
Skip to first unread message

bgp...@gmail.com

unread,
Oct 22, 2007, 12:00:26 PM10/22/07
to
Hi all,
i have a problem when using CryptAcquireContext in application which
is started from service.
CryptAcquireContext failed with 0x80090020 - An internal error
occurred
The same application works fine when it is started from command
prompt.
As i see it can work and from service but for that i should change my
service to run under "Interactive user" or to make LogonUser in this
application with LOGON32_LOGON_INTERACTIVE

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

Andrew Tucker [MSFT]

unread,
Dec 18, 2007, 12:30:33 AM12/18/07
to


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

0 new messages