Win32 API calls - RegEnumKeyEx

Win32 API calls - RegEnumKeyEx

Post by Walter Sco » Wed, 06 Dec 2000 09:57:36



  Does anyone have the table information for this call?  So far, I have come up with the table below but, the call appears to return a string of x'20's.  It's also very possible that I'm misunderstanding the function itself.  I'm trying to get a list of the subkeys of a key - in particular, I'm trying to get a list of the subkeys of HKEY_USERS.
  Failing that, can anyone point me to information on 'converting' Visual Basic references to SAS 'routine' tables?
                                                                  TIA,
                                                                   Walter

routine RegEnumKeyExA
module=ADVAPI32
minarg=8
maxarg=8
returns=long
stackpop=called;
arg 1 num input byvalue format=pib4.;        * handle to the key to enumerate;
arg 2 num input byvalue format=pib8.;        * subkey index;
arg 3 char output byaddr format=$cstr200.;   * subkey name;
arg 4 num update byaddr format=pib4.;        * size of the subkey buffer;
arg 5 num input byvalue format=pib4.;        * reserved, MUST be NULL;
arg 6 char update byaddr format=$cstr200.;   * class string buffer,  NULL;
arg 7 num update byaddr format=pib4.;        * size of class string buffer,  NULL;
arg 8 num output byaddr format=pib8.;        * pointer to a variable that receives the time/date subkey was last written to;

/* Test code */
filename sascbtbl 'c:\winapi32.txt';
data _null_;
length skeyname $200;
skeyndx=0;
skeyname='';
sknmsz=0;
filetime=0;
nc='';  /* nullchar */
nv=0;   /*null value */
enumkey:
hmainkey=2147483651;  /* HKEY_USERS */
rc=modulen('*e','RegEnumKeyExA',hmainkey,skeyndx,skeyname,sknmsz,nv,nc,nv,filetime);
put / '*****' "skeyndx=" skeyndx +5 'rc=' rc /
  "skeyname=" skeyname +5 "sknmsz=" sknmsz / +5 "filetime=" filetime;
skeyndx+1;
if rc~=259 then link enumkey;
run;

 
 
 

Win32 API calls - RegEnumKeyEx

Post by Lex Janse » Wed, 06 Dec 2000 04:00:00


Walter,

see: www.qual-it.com.au
they have a great SUGA paper on this topic including a download with great
examples.

Regards,

Lex Jansen


  Does anyone have the table information for this call?  So far, I have come
up with the table below but, the call appears to return a string of x'20's.
It's also very possible that I'm misunderstanding the function itself.  I'm
trying to get a list of the subkeys of a key - in particular, I'm trying to
get a list of the subkeys of HKEY_USERS.
  Failing that, can anyone point me to information on 'converting' Visual
Basic references to SAS 'routine' tables?
                                                                  TIA,
                                                                   Walter

routine RegEnumKeyExA
module=ADVAPI32
minarg=8
maxarg=8
returns=long
stackpop=called;
arg 1 num input byvalue format=pib4.;        * handle to the key to
enumerate;
arg 2 num input byvalue format=pib8.;        * subkey index;
arg 3 char output byaddr format=$cstr200.;   * subkey name;
arg 4 num update byaddr format=pib4.;        * size of the subkey buffer;
arg 5 num input byvalue format=pib4.;        * reserved, MUST be NULL;
arg 6 char update byaddr format=$cstr200.;   * class string buffer,  NULL;
arg 7 num update byaddr format=pib4.;        * size of class string buffer,
NULL;
arg 8 num output byaddr format=pib8.;        * pointer to a variable that
receives the time/date subkey was last written to;

/* Test code */
filename sascbtbl 'c:\winapi32.txt';
data _null_;
length skeyname $200;
skeyndx=0;
skeyname='';
sknmsz=0;
filetime=0;
nc='';  /* nullchar */
nv=0;   /*null value */
enumkey:
hmainkey=2147483651;  /* HKEY_USERS */
rc=modulen('*e','RegEnumKeyExA',hmainkey,skeyndx,skeyname,sknmsz,nv,nc,nv,fi
letime);
put / '*****' "skeyndx=" skeyndx +5 'rc=' rc /
  "skeyname=" skeyname +5 "sknmsz=" sknmsz / +5 "filetime=" filetime;
skeyndx+1;
if rc~=259 then link enumkey;
run;