Article View: borland.public.cppbuilder.nativeapi
Article #2259Re: Both OpenThreadToken & OpenProcessToken Fails
From: Bob Gonder
Date: Sun, 18 Mar 2007 00:38
Date: Sun, 18 Mar 2007 00:38
16 lines
1442 bytes
1442 bytes
Maurice Anderson wrote: >The problem is OpenThreadToken fails with "An attempt was made to reference >a token that does not exist". And OpenProcessToken fails with "Access >Denied". Never used this stuff, but from the help, and your errors, this is what I'd look at: > if(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, true, &hToken)) I think "true" should be "FALSE" to get the thread token. > if(OpenProcessToken(GetCurrentProcess(), You are reporting an error if it succeeds.
Technical Details
Message-ID:
<ii1pv25jc2o1k1n12jdkhfniie4k22h4ks@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45fc6c49$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,314803bcf5c6fe3 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Both OpenThreadToken & OpenProcessToken Fails Date: Sat, 17 Mar 2007 17:38:17 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <ii1pv25jc2o1k1n12jdkhfniie4k22h4ks@4ax.com> References: <45fc6c49$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.77.145.18 X-Trace: newsgroups.borland.com 1174178295 67.77.145.18 (17 Mar 2007 17:38:15 -0800) Lines: 18 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail