Subject: H
From: [email-masked] (Tsoloane Moahloli)

7 Apr 1998 01:12:17 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: Gnu Win32 Mailing List <[email-masked]>

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
"[email-masked]" with one line of text: "help".