Article View: borland.public.cppbuilder.nativeapi
Article #631Re: Shutting down
From: Remy Lebeau (TeamB)
Date: Mon, 11 Feb 2008 18:25
Date: Mon, 11 Feb 2008 18:25
27 lines
2038 bytes
2038 bytes
"Jos�" <jose@127.0.0.1> wrote in message
news:nr01r35bb4etpk28l2uf89a7f01bvlvsqk@4ax.com...
> LookupPrivilegeValue(
> NULL, // lookup privilege on local system
> "SE_SHUTDOWN_NAME", // privilege to lookup
> &luid ) ; // receives LUID of privilege
SE_SHUTDOWN_NAME is a precompiler macro, not a string. The actual string
value is "SeShutdownPrivilege". To use SE_SHUTDOWN_NAME, you need to get
rid of the quotation marks, ie:
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &luid);
> I think the trouble is the first parameter of AdjustTokenPrivileges,
> which, according to the help file "TokenHandle identifies the access
> token that contains the privileges to be modified". That's Greek to
> me.
You need to use OpenThreadToken() and/or OpenProcessToken() to get the
required access token. I suggest you go to http://www.deja.com and search
through the newsgroup archives. Examples of using AdjustTokenPrivileges()
have been posted many times before.
Gambit
Technical Details
Message-ID:
<47b0930c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<nr01r35bb4etpk28l2uf89a7f01bvlvsqk@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fa244e8cf53430f X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <nr01r35bb4etpk28l2uf89a7f01bvlvsqk@4ax.com> Subject: Re: Shutting down Date: Mon, 11 Feb 2008 10:25:52 -0800 Lines: 29 Organization: Lebeau Software X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 NNTP-Posting-Host: 207.178.157.90 Message-ID: <47b0930c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1202754316 207.178.157.90 (11 Feb 2008 10:25:16 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail