delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/07/01:12:17

From: tsoloane AT is DOT co DOT za (Tsoloane Moahloli)
Subject: H
7 Apr 1998 01:12:17 -0700 :
Message-ID: <3528EB1F.51CEC48D.cygnus.gnu-win32@is.co.za>
Mime-Version: 1.0
To: Gnu Win32 Mailing List <gnu-win32 AT cygnus DOT com>

Hi there,

The following code segment seems to be somewhat errornous, or is this a
bug in cygwin - I am using Beta 19 with ecgs 1.02.  call seems to be
returning ERROR_SUCCESS but my machine things seems to think otherwise.
Oh yeah, I am running winnt 4 with service pack 3.

the code segment..
    //Get appropriate info on the key..
    DWORD namelen, keys, maxvaluelen, values;
    if((RegQueryInfoKey(wwwkey, NULL, NULL, NULL, NULL, NULL, NULL,
&values, &namelen, &maxvaluelen, NULL, NULL))!=ERROR_SUCCESS)
    {
 perror("RegQueryKeyInfo:  Unable to get Registry Key Info..");
 exit(1);
    }
    printf("values       -  %d\n", values);
    printf("namelen      -  %d\n", namelen);
    printf("maxvaluelen  -  %d\n", maxvaluelen);

    //Ladies and Gentlemen, Let the fun begin.  Now read each Reg key 1
by one
    //act on it....
    DWORD count, size;
    LPSTR instring, keyName;

    namelen++;
    keyName=(LPSTR)malloc(namelen + 1);

    if(keyName==NULL)
    {
 err_sys("Memory Error!!!");
    }
    for(count=0;count<values;count++)
    {
 unsigned long x;
 //Enumerate the Value...
 if((x==RegEnumValue(wwwkey, count, keyName, &namelen, NULL, NULL, NULL,
NULL))!=ERROR_SUCCESS)
 {
     printf("count %d; keyName %s maxcount %d error number %lu\n",
count, keyName, values, x);
     perror("Unable to get Values from Registry");
     exit(1);
 }

the Output when compiled and run...
values       -  10
namelen      -  16
maxvaluelen  -  76
count 0; keyName /, maxcount 10 error number 0
Unable to get Values from Registry: error 0

Any pertinent comments would be appreciated....


--
 Windows 95: n.  32 bit extensions and a graphical shell for a 16 bit
 patch to an 8 bit operating system originally coded for a 4 bit
 microprocessor, written by a 2 bit company that can't stand 1 bit of
 competition.


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019