Re: Detecting Process Privileges
From: Pavel Lebedinsky (m_pll)
Date: 12/19/03
- Next message: Pieter Philippaerts: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- Previous message: Rhett Gong: "RE: CryptAcquireContext() question."
- In reply to: Jeffrey Hamblin: "Re: Detecting Process Privileges"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 18 Dec 2003 18:02:03 -0800
Actually, often the right thing to do is to attempt the operation
(open the reg key for write access, or whatever it is that
you're trying to do) and check the result. If it says "access denied"
then you don't have access.
You can use CheckTokenMembership to check if the caller
is a member of the local admins group, but then only admins
will be able to run your program.
"Jeffrey Hamblin" wrote:
> CheckTokenMembership can do this for you.
>
> "Elisha Berns" <e.berns@computer.org> wrote in message
> news:03eb01c3c4de$c74f9090$a301280a@phx.gbl...
> > Forgive the ignorance about security matters, this is
> > perhaps a newbie question:
> >
> > During installation of a font I need to write to a
> > registry key to make sure the font is properly installed.
> > Apparently this only works if the current process
> > has "admin" privileges.
> >
> > So how can I detect that the current process, or user,
> > has "admin" write privileges for this reg key?
> >
> > Thanks for any help here,
> >
> > Elisha Berns
- Next message: Pieter Philippaerts: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- Previous message: Rhett Gong: "RE: CryptAcquireContext() question."
- In reply to: Jeffrey Hamblin: "Re: Detecting Process Privileges"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|