The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: stanley on October 23, 2009, 12:11:20 PM

Title: Difference between RegQueryValueEx and RegQueryValue
Post by: stanley on October 23, 2009, 12:11:20 PM
What is the difference between RegQueryValueEx  and RegQueryValue.?

why are we using RegQueryValueExW and RegQueryValueExA ?

explain the purpose kindly :P
Title: Re: Difference between RegQueryValueEx and RegQueryValue
Post by: Slugsnack on October 23, 2009, 12:28:56 PM
RegQueryValue is outdated and has been superceded by RegQueryValueEx so should not be used

The difference between the W/A versions of APIs is that the W is for unicode/widechar and A is for ANSI. ANSI strings are simply an array of character bytes whereas widechar is slightly different with each character taking up 2 bytes.
Title: Re: Difference between RegQueryValueEx and RegQueryValue
Post by: silentenigma on October 23, 2009, 03:28:41 PM
ANSI support 256 different characters so it will take 8 bit to store single character but;

UNICODE support 65536 different character,so it will take 16 bit to store single character and it is more complex.

This differences should consider while you interact with unmanaged code(win32 api),export functions etc.
Title: Re: Difference between RegQueryValueEx and RegQueryValue
Post by: akane on October 23, 2009, 06:58:48 PM
The major difference is that RegQueryValue can return only strings (normal/multi/expandable), and does not return type of returned data.
Title: Re: Difference between RegQueryValueEx and RegQueryValue
Post by: Slugsnack on October 23, 2009, 11:32:00 PM
http://msdn.microsoft.com/en-us/library/cc500348.aspx
Title: Re: Difference between RegQueryValueEx and RegQueryValue
Post by: stanley on October 25, 2009, 08:36:10 PM
Thanks to all !! for your kind reply :bg