News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Where is RegGetValue ?

Started by Zen, June 03, 2015, 04:06:29 AM

Previous topic - Next topic

Zen

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 ?

dedndave

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

Shlwapi.lib has registry functions too.
here

jj2007

Quote from: Zen on June 03, 2015, 04:06:29 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

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,...

jj2007

Quote from: Zen on June 03, 2015, 06:42:08 AMRunning 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

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 CHENGiven 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 CHENIn 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.