GetTokenInformation API
From: Mike Berger (junk@junk.com)
Date: 06/24/02
- Next message: Ned Flanders: "Re: W98 users options..."
- Previous message: BillF: "Microsoft Residential Gateway"
- Next in thread: Silvio Pietersen: "Re: GetTokenInformation API"
- Reply: Silvio Pietersen: "Re: GetTokenInformation API"
- Reply: Slava M. Usov: "Re: GetTokenInformation API"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Mike Berger" <junk@junk.com> Date: Mon, 24 Jun 2002 13:01:13 -0500
I am using the GetTokenInformation API with the TokenPrivileges flag for the
TokenInformationClass. I'm not sure how to interpret the results I am
getting. The API returns a structure whose first member is the Privileges
Count. Following the Privileges Count is a variable length
LUID_AND_ATTRIBUTES structure. (The length of this structure is dependant on
the Privileges Count member).
As I use my app running under adminstrator, I get a Count of 19. I go
through each LUID_AND_ATTRIBUTES structure, and do a LookupPrivilegeName
using the LUID portion of the LUID_AND_ATTRIBUTES structure. All this seems
to work fine.
As I go through the ATTRIBUTES portion of the LUID_AND_ATTRIBUTES structure,
MSDN says this value will be SE_PRIVILEGE_ENABLED (0x00000002L),
SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001L), or
SE_PRIVILEGE_USED_FOR_ACCESS (0x80000000L). For a great majority of the
Privileges returned by the TokenPrivileges API, the ATTRIBUTES portion of
the LUID_AND_ATTRIBUTES is 0. I assume that means the privilege is disabled
(???).
My confusion is, first of all, is my assumption that these privileges are
disabled correct ?
If so, why are they even reported via the TokenPrivileges API ?
Does the TokenPrivileges API list all the *possible* privileges that a
particular user's token may have, including the privileges that do not
happen to be enabled at the time of the API call ?
If that is true, then an app could not AdjustTokenPrivileges to enable a
privilege that does not appear in the original list returned by the
TokenPrivileges API ???
Thanks for any insight,
Mike
- Next message: Ned Flanders: "Re: W98 users options..."
- Previous message: BillF: "Microsoft Residential Gateway"
- Next in thread: Silvio Pietersen: "Re: GetTokenInformation API"
- Reply: Silvio Pietersen: "Re: GetTokenInformation API"
- Reply: Slava M. Usov: "Re: GetTokenInformation API"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|