Author Topic: Where is RegGetValue ?  (Read 6207 times)

Zen

  • Member
  • ****
  • Posts: 962
  • slightly red-shifted
Where is RegGetValue ?
« on: June 03, 2015, 04:06:29 AM »
I'm writing some Registry search code, which is tedious and boring.
Registry Functions, MSDN
...And, because I'm inept,...I'm just thrashing what would otherwise be a functional, if incredibly bloated, program.
So,...I invoke alot. And, I tried to invoke RegGetValue, only to discover when I tried to compile the executable, that RegGetValue is not prototyped in Advapi32.inc with the rest of the Registry Functions. It's OK,...I can use RegEnumValue,...it has the same functionality, and, is actually more fun,...
Apparently, RegGetValue was added in Windows Vista. Has anybody else noticed this ? Would anybody here actually use it ?
If I create the prototype in my source, Advapi32.lib still doesn't link to the actual function, does it ?
Zen

dedndave

  • Member
  • *****
  • Posts: 8828
  • Still using Abacus 2.0
    • DednDave
Re: Where is RegGetValue ?
« Reply #1 on: June 03, 2015, 04:45:17 AM »
no - you would also need to create a new LIB file
you could use Erol's tools for that job

but, there's really no need to use that function
in fact, if you do, it will probably make you incompatible with XP

TWell

  • Member
  • ****
  • Posts: 743
Re: Where is RegGetValue ?
« Reply #2 on: June 03, 2015, 04:53:25 AM »
Shlwapi.lib has registry functions too.
here

jj2007

  • Member
  • *****
  • Posts: 12953
  • Assembler is fun ;-)
    • MasmBasic
Re: Where is RegGetValue ?
« Reply #3 on: June 03, 2015, 06:06:04 AM »
I'm writing some Registry search code, which is tedious and boring.

It is, it is. And it's awfully slow - just try the built-in search of regedit ::)
But there is a fast alternative, see attachment (open the *.asc in WordPad). Line 5 has the gotcha, and porting it to plain Masm32 should be fairly easy and straightforward.

Zen

  • Member
  • ****
  • Posts: 962
  • slightly red-shifted
Re: Where is RegGetValue ?
« Reply #4 on: June 03, 2015, 06:42:08 AM »
DAVE, TWELL, and JOCHEN,
Thanks,...this is exactly what I needed to know.
In fact, I have already coded the Registry search with RegEnumValue, and, it's just what I needed. It's better, in fact.

I've been playing around with Japheth's original COMView, which is so useful. I somehow managed to lose the source code (he used to give it away), but, re-creating the functionality is not too challenging. So, that's what I'm working on, updating COMView. Hopefully, I can add some cool new features. Running a 32-bit App on WOW64 can be weird if you are accessing the Registry: Accessing an Alternate Registry View.
If you have any wild ideas,...I'd love to hear them.  :icon_mrgreen:

...I have a couple of ideas that definitely within the realm of Mission Impossible,...
Zen

jj2007

  • Member
  • *****
  • Posts: 12953
  • Assembler is fun ;-)
    • MasmBasic
Re: Where is RegGetValue ?
« Reply #5 on: June 03, 2015, 10:21:35 AM »
Running a 32-bit App on WOW64 can be weird

KEY_QUERY_VALUE or KEY_WOW64_64KEY if needed, but it's rarely relevant. In fact, if you find a nice example where the difference is important, let me know - I need one for SetReg64...

Zen

  • Member
  • ****
  • Posts: 962
  • slightly red-shifted
Re: Where is RegGetValue ?
« Reply #6 on: June 07, 2015, 05:24:48 AM »
Humor: Was The Windows Registry a Good Idea?, Aug 2007

Good Review by Raymond Chen here: Why Is the Registry a Hierarchical Database Instead of a Relational One?, Sept 2011

...Here is an astute observation from Raymond Chen:
Quote from: RAYMOND CHEN
Given the heterogeneity of the data the registry needs to keep track of, imposing some sort of uniform schema is doomed to failure.

...In addition (Raymond Chen, again):
Quote from: RAYMOND CHEN
In other words, make it a total free-for-all. In which case, why do you need a schema at all? Just leave it as an unregulated collection of name/value pairs governed by convention rather than rigid rules, as long as the code which writes the information and the code which reads it agree on the format of the information and where to look for it.
Zen