Re: CryptAcquireContext returns ERROR_FILE_NOT_FOUND

From: tlviewer (tlviewerSHRUB_at_yahoo.CHENEY.com)
Date: 04/02/04


Date: Fri, 2 Apr 2004 11:46:58 -0800


"Jean Erasmus" <anonymous@discussions.microsoft.com> wrote in message news:3B597B3C-E9AD-49DF-9428-CB26B230E2FB@microsoft.com...
> Hi Ryan,
>
> Thanks for the advice. Do you maybe have source code for Visual Basic 6 for LoadUserProfile ?

In this group the language of choice is that of the SDK: VC.
Only rarely will you get support for using VB. Nevertheless I prefer to
use VB for most of my Crypto code.

For a good source of VB declares, including LoadUserProfile, see
http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html

hth,
tlviewer
>
> Regards,
>
> Jean Erasmus
>
> ----- Ryan Menezes [MSFT] wrote: -----
>
> As long as the profile is loaded it should work, alternately you can try
> creating keys using CRYPT_MACHINECONTEXT so that they are available even
> when profile is not loaded. As John suggested if you use LogonUser then do
> an explicit LoadUserProfile
>
> --
> Thanks,
> Ryan Menezes [MS]
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "Jean Erasmus" <anonymous@discussions.microsoft.com> wrote in message
> news:7BCEF0AE-1E3D-455A-BA9C-6C769FDE5CF5@microsoft.com...
> > Hi John,
> >> I wasn't aware that my code needed to do a logon. I created a COM+
> application under COM+ services called Crypto. On the idenity tab I set the
> account under which the application will run to Administrator. The
> activation is set to a server application. Now surely this should work?
> >> Regards,
> >> Jean Erasmus
> >> ----- John Banes [MS] wrote: -----
> >> This error code typically means that the user profile has not been
> loaded.
> > Is your code doing a logon of the Administrator account and
> impersonating,
> > but forgetting to load the profile?
> >> Regards,
> > John Banes
> > [Microsoft Security Developer]
> >> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > Please do not send email directly to this alias. This alias is for
> newsgroup
> > purposes only.
> >> "Jean Erasmus" <anonymous@discussions.microsoft.com> wrote in message
> > news:736F1B07-5C08-4D0C-AB70-FD3E55B045CE@microsoft.com...
> >> Hi There,
> >>> I have a VB6 COM object that calls the CryptoAPI. When I call
> > CryptAcquireContext I get an ERROR_FILE_NOT_FOUND. The COM
> application runs
> > as Administrator.
> >>> Can anybody help?
> >>> Regards,
> >> Jean Erasmus
> >>>