Re: Detecting Process Privileges

From: Pavel Lebedinsky (m_pll)
Date: 12/19/03


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



Relevant Pages

  • Re: Problems with locales
    ... english font. ... This system font is defined by a reg key. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Old updates being represented.
    ... Security Update Information, then click on Windows XP ... Scroll down to the File Information heading and compare the files listed to the ones on the system. ... The reg key shows it was updated but I had installed a Beta version of a Security Suite and that may have reverted Lsasrv.dll. ... www.cobracat.com (home of the Australian Cobra Catamaran) ...
    (microsoft.public.windowsupdate)