🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3969

Re: OpenProcess() returns different handles

#3969
From: Eric Noel
Date: Sun, 09 Apr 2006 20:54
13 lines
1406 bytes
Wiebe Vos wrote:
> I sucessfully launch an app with CreateProcess(...)
> However thereafter OpenProcess ( PROCESS_ALL_ACCESS,  true, 
> processInfo.dwProcessId)
> returns a handle that differs from processInfo.hProcess
> (In fact it returns a different handle each time when called.)
> Why?

WAD. Think of it as if you were opening a file handle - you can open the 
same file multiple times, each handle can have different access, and be 
used independently. Same idea in this case for your process handle.

- Eric
Technical Details
Message-ID: <443974ee$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44397058@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8a9918c2e9877ca0
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sun, 09 Apr 2006 13:54:35 -0700
From: Eric Noel <eric.no@spam.rcs100.com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: OpenProcess() returns different handles
References: <44397058@newsgroups.borland.com>
In-Reply-To: <44397058@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 207.224.24.86
Message-ID: <443974ee$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1144616174 207.224.24.86 (9 Apr 2006 13:56:14 -0700)
Lines: 13
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail