From: dale@mkseast.uucp (Dale Gass)
Subject: Re: Getting user/kernel CPU times for current process...
Organization: Mortice Kern Systems, Atlantic Canada Branch
Date: Mon, 25 Jan 1993 19:26:36 GMT

alistair@microsoft.com (Alistair Banks) writes:
>In article <1993Jan17.143256.1671@mkseast.uucp> dale@mkseast.uucp (Dale Gass) writes:
>>I'm trying to find a way to for a proces to find out the the amount of CPU 
>>time (user and system if possible) that it (and it's children, if possible) 
>>have consumed.
>
>You'll find all this information available through the win32
>registry APIs - 

Where exactly in the registry would this information be??  Where would
it's location be documented?  (I don't mind any lack of documentation
if the information were in a place where I could find it with regedit...)

> if you're debugging/disassembling any code today,
>you'll find that we won't be using those APIs in future, and that they'll
>go away. 

Well, between July and October beta's, a bunch of stuff that I was using
moved/disappeared in the registry, so I'm not too confident of the undocumented
registry items being more stable than undocumented API's...  

Such changes are certainly excusable in these early betas, but will (are?) 
these registry items documented anywhere eventually?  Whether it's a
registry item or an API, I seem to be on my own finding this information.

> The full registry functionality was somewhat later to be
>implemented, and so early utilities used APIs which are only
>temporary - the great advantage in using the registry is that these
>statistics can be gatherd for any process on any machine, local or
>remote 

Hmmm.  Between the July->October betas, I noticed what I think was a trend
in the other direction:

	I was using the registry to grab information about users, such as
	their home directories, etc..  This I stumbled across in
	SECURITY\SAM\Domains\Account\Users\HomeDir, etc...  (Things
	were a little screwy in the Reigstry format, though; sometimes
	the "type" field was used to hold the actual data; a bit 
	disconcerting but not too hard to figure out...)

	In the October release, these registry entries have disappeared,
	and I see no equivalents...  After a bit of digging, I found
	a suite of undocumented API's: LsaOpenPolicy(), LsaLookupSids(),
	LsaClose(), etc., etc...  (Lsa is the "local security authority"
	according to a comment in winerror.h.)

	Now, I don't mind using a registry entry to get the same
	information that I can from the Lsa calls, but the info just
	doesn't appear to be there...

So where can I find another user's home directory, script, etc., in a
MicroSoft-condoned way??

> [we don't document APIs which are going away and which we know to
> be temporary, another great Microsoft tradition!] -- Alistair

While this is certainly understandable, it is frustrating when the only
way to access certain information (another user's home directory, for
example) appears to be via undocumented calls.  I don't mind undocumented
API's for-internal-use-only, if there is a developer level point of
access for that same information...

-dale
-- 
 Dale Gass, Mortice Kern Systems, Atlantic Canada Branch
Business: dale@east.mks.com, Pleasure: dale@mkseast.uucp
Newsgroups: comp.os.ms-windows.programmer.win32