Re: CertAddCertificateContextToStore

From: Mario (nospam.mario.dambauer_at_nospam.gmx.at)
Date: 04/07/04

  • Next message: Rhett Gong [MSFT]: "RE: Launch apps that require admin rights under all accounts."
    Date: Wed, 7 Apr 2004 11:17:00 +0200
    
    

    hm, ok...

    One other strange thing is, that my program works without any problem when I
    manually import the certificate via mmc and than delete the certificate.
    In this case my program works as is works on xp professional...

    Perhaps it is that something is missing in the registry....

    I try to find the problem...

    "Valery Pryamikov" <Valery@nospam.harper.no> wrote in message
    news:OnkVeK$GEHA.3904@TK2MSFTNGP12.phx.gbl...
    > Mario,
    > Unfortunately I can't give you more info on this, sorry. I found the
    problem
    > on FSC Pocket LOOX October last year, confirmed that it was a bug, but
    never
    > have checked its status after that. I'd recommend you to contact your
    vendor
    > support.
    >
    > -Valery.
    >
    > http://www.harper.no/valery
    >
    > "Mario" <nospam.mario.dambauer@nospam.gmx.at> wrote in message
    > news:uafREQ9GEHA.1720@tk2msftngp13.phx.gbl...
    > > Thats exactly whats going on, I can import the root cert without a
    > > problem!!!!
    > >
    > > What is this bug about?
    > > can you give me a little bit more info?
    > >
    > > Thanks!!!
    > >
    > >
    > > "Valery Pryamikov" <Valery@nospam.harper.no> wrote in message
    > > news:OkoM6H9GEHA.2844@tk2msftngp13.phx.gbl...
    > >> I can't say anything regarding XP-Embedded (I have never tried it or
    even
    > >> saw it), but you can try to run your program with different store and
    see
    > > if
    > >> it makes a difference. It could be just a bug like the one I saw in the
    > >> first distribution of PocketPC 2003 from Fujitsu Siemens for Pocket
    LOOX
    > >> where certificate import was working for "Root" but returned
    > > E_ACCESSDENIED
    > >> for "My" store.
    > >>
    > >> -Valery.
    > >>
    > >> http://www.harper.no/valery
    > >>
    > >> "Mario" <nospam.mario.dambauer@nospam.gmx.at> wrote in message
    > >> news:uq9TQn8GEHA.1720@tk2msftngp13.phx.gbl...
    > >> >
    > >> > Thanks Valery, thats clear, but how to fix this error?
    > >> >
    > >> > My code works on XP-Professional, but on XP-Embedded I always get
    this
    > >> > error...
    > >> >
    > >> > Is it possible that the store is not existing?
    > >> > Or could it be a problem that I am using the Administrator User on XP
    > >> > Embedded (there I have only the admin user)
    > >> >
    > >> > Any ideas would be helpful....
    > >> >
    > >> > Thanks
    > >> >
    > >> > "Valery Pryamikov" <Valery@nospam.harper.no> wrote in message
    > >> > news:OK1Reb8GEHA.3176@TK2MSFTNGP12.phx.gbl...
    > >> >> Hi,
    > >> >>
    > >> >> 2147942405 == 0x80070005 == E_ACCESSDENIED.
    > >> >>
    > >> >> -Valery.
    > >> >>
    > >> >> http://www.harper.no/valery
    > >> >>
    > >> >> "Mario" <nospam.mario.dambauer@nospam.gmx.at> wrote in message
    > >> >> news:eAlkk06GEHA.3880@TK2MSFTNGP10.phx.gbl...
    > >> >> > When I try to run CertAddCertificateContextToStore I get an error
    > >> > message:
    > >> >> >
    > >> >> > Application Error
    > >> >> > The instruction at ".." referenced mem at "..". The mem could net
    be
    > >> >> > written"....
    > >> >> >
    > >> >> > The returned error code of GetLastError is: 2147942405
    > >> >> >
    > >> >> > I don't know whats wrong, I am using this code:
    > >> >> >
    > >> >> > pfxStore = PFXImportCertStore(&blob, password,
    CRYPT_MACHINE_KEYSET
    > >> >> > |
    > >> >> > CRYPT_EXPORTABLE);
    > >> >> > ...
    > >> >> > myStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL,
    > >> >> > CERT_STORE_OPEN_EXISTING_FLAG | CERT_SYSTEM_STORE_LOCAL_MACHINE,
    > >> >> > L"MY");
    > >> >> > ...
    > >> >> > while (0 != (pctx = CertEnumCertificatesInStore(pfxStore, pctx)))
    > >> >> > ....
    > >> >> > if (!CertAddCertificateContextToStore(myStore, pctx,
    > >> >> > CERT_STORE_ADD_NEW,
    > >> >> > NULL))
    > >> >> > {
    > >> >> > err = GetLastError();
    > >> >> > ...
    > >> >> >
    > >> >> > myStore and pctx are valid pointers, but the result is always the
    > > same!
    > >> >> >
    > >> >> > Any ideas on fixing this error?
    > >> >> > Thanks in advance.
    > >> >> >
    > >> >> > Mario
    > >> >> >
    > >> >> >
    > >> >>
    > >> >>
    > >> >
    > >> >
    > >>
    > >>
    > >
    > >
    >
    >


  • Next message: Rhett Gong [MSFT]: "RE: Launch apps that require admin rights under all accounts."

    Relevant Pages

    • Re: How to avoid "Data connections have been disabled"
      ... I assume when you opened mmc console and File>Add.Remove a Snap-in you selected ... I was able to drag my certificate to ... Expand and open Personal Certificates folder. ... Select your SelfCert DC and drag it to the Trusted Root ...
      (microsoft.public.excel.misc)
    • Re: Decrypting a W2K encrypted file
      ... MMC, it says that his certificate is there, but it can't find his private ... We never wrote efsrecvr. ... >> The user's password has since changed though, I'll get him to switch it ...
      (microsoft.public.win2000.security)
    • Re: SSL help
      ... Go to 2nd site to and generate the CSR using IIS MMC. ... > put the first SSL certificate on the server, ... The centrally located server name ... > certificate for www.bizunit1.com. ...
      (microsoft.public.inetserver.iis.security)
    • Re: Win2003 CA certificates with Outlook2003
      ... The certificates MMC does not have the option to revtieve pending requests ... But when I go back to the client and into that Certificate MMC ... >> can see that private key related message under validity period. ... Template field is USER. ...
      (microsoft.public.windows.server.security)
    • TLS, Exchange 2003, 2 Virtual Servers.
      ... I'm not sure if this is a bug in exchange but I have the following ... Now, if I remove my certificate from VS2, re-assign it it lets me send ... Am at an absolute end as to why this works once and then stops!! ...
      (microsoft.public.exchange.admin)