Thread: RegEnumValue: data types?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User subdene's Avatar
    Join Date
    Jan 2002
    Posts
    367
    The reason being is that you have not declared a size for your buffer. Therefore, the RegEnumValue function will be writing to memory which has not been allocated for it, and could possibly lead to stack corruption. Allocate the buffer to whatever size is required, i.e.

    BYTE data[valueSize]; and in your function call dont pass the address of the ptr but just pass the ptr.

    valueResult=RegEnumValue(hsubkey, i, valueName, &valueNameSize, NULL, &type, data,
    &dataSize);

    Hope this helps a bit, btw you probably might not need a buffer that size or declared locally on the statck. But i haven't really had a proper look at that reg function.
    Be a leader and not a follower.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    69
    woo, that fixed up the problem with the strings. now i just need to know how to interpret the DWORD's and BINARY values

    heh, the DWORD only needs a cast to display
    Last edited by talz13; 06-28-2004 at 12:16 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extending basic data types.
    By nempo in forum C++ Programming
    Replies: 23
    Last Post: 09-25-2007, 03:28 PM
  2. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. gcc problem
    By bjdea1 in forum Linux Programming
    Replies: 13
    Last Post: 04-29-2002, 06:51 PM
  5. Using enumerated data types
    By SXO in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2001, 06:26 PM