Post by GabiThanks for you answer.
this is really my problem how can i change a privilage to
my calling process.(programically )
The answer depends on what you want to do. Short answer: chances are that
you can not grant yourself a privilege that you don't hold.
Note that in Win32, privileges are associated with "principals", i.e. users.
Threads run in the context of principals. A thread can do what the
associated principal can do. This is different than in some other
environments where (access) checks are made based on stretches of code which
are secured or not. In Win32, it is the user context, not the code which is
all important,
Note that a principal may hold a privilege or not. Note too, that privileges
would be damned near meaningless if every principal could grant itself a
privilege which it does not hold.
In addition, as an extra sanity (my word) check, though NOT security check,
sometimes you will find that privileges are granted but not enabled. Some
Win32 functions not only check that a privilege is granted but ALSO check
that they are enabled. Where they are granted but not enabled, some
functions fail.
In this case you are at perfect liberty to enable a disabled privilege which
has been granted to you. But in general, you can't just grant yourself new
privileges. The user accounts that can do that are usually few and far
between. Where they are not, the administrator is asleep at the wheel. :-)
You, are your system administrator, will have to determine whether the user
in whose context you run LogonUser() has the SE_TCB_NAME privilege.
Usually, it is the LocalSystem account that can do LogonUser() "out of the
box". Services (which by the way must be installed by administrators) by
default run as LocalSystem. It is often a good idea to limit calls to
LogonUser() to services running as LocalSystem. If you can't do that you
might want to read this link for an alternate solution to the same problem:
http://support.microsoft.com/?id=180548
Regards,
Will
P.S. Please post follow-up in the kernel group