PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Patrick Harvey on May 11, 2005, 06:27:57 PM

Title: weird dots showing in regedit when I set a string registry k
Post by: Patrick Harvey on May 11, 2005, 06:27:57 PM
Hello...

I have a new "weird" issue writing a string to the registry...  this time I am writing a string as shown below:

   Dim a As Long
   a= FF_SetRegistryString (%hkey_local_machine, "System\CurrentControlSet\Control\Wow","DefaultSeparateVDM", "yes")

When I open regedit, it shows a new value of "yes..." but when I right-click the key and view it, I see the correct "yes" there and not "yes..." as regedit shows....  If I modify the key by hand and type "yes" then just "yes" appears as the value of the key (with no ... after it).  If I use this code to set the value to "yes" (when regedit shows "yes..." and I look at the value with ff_getregistrystring, it also shows a correct "yes" with no ... after it.  Does anyone know what is happening and if I should be concerned about these ... characters when I set the value.

Patrick
Title: weird dots showing in regedit when I set a string registry k
Post by: Roger Garstang on May 11, 2005, 08:14:18 PM
Could be nuls or spaces getting added some how.  I'd have to check out the function.
Title: thanks for the offer of help....
Post by: Patrick Harvey on May 11, 2005, 11:30:15 PM
thanks for the offer of help - it's really weird!

Patrick
Title: weird dots showing in regedit when I set a string registry k
Post by: Roger Garstang on May 12, 2005, 12:21:10 AM
Yup, look in the Utility file that FF creates that has all your FF Wrapper functions you use and is compiled into the app:

The line below I believe is the problem:

dwSize = SizeOf(zRegVal)


zRegVal is Asciiz * 1024, so SizeOf= 1024.  Should use Len...and probably Len + 1 to count the Nul as the help for RegSetValueEx states.  I believe the dots are from around 1000+ nul characters being wrote, but when opened they are trimed off in the textbox.  Paul was probably thinking too hard on the DWORD style of the function which uses SizeOf.

LEN could probably be used for both and maybe even somehow combine all the functions into one.
Title: Interesting...and thanks
Post by: Patrick Harvey on May 12, 2005, 12:28:49 AM
Roger, Thanks!

I'll see if I can get it working tomorrow...

TO confirm, you're telling me to change Sizeof(xx) to Len(xx)+1 right?

Patrick
Title: weird dots showing in regedit when I set a string registry k
Post by: Roger Garstang on May 12, 2005, 12:34:41 AM
Yup, then hopefully no dots.  If you recompile the file will overwrite your changes though, so there are 1 of 4 options:

1. If you aren't going to be adding any more wrapper functions to the project put a Read Only Attribute on the Utility file.

2. Copy the Wrapper function into your program and give it a different name so you can change it however you want.

3. Maybe Paul is reading and will give us an updated FF_Functions.src.

4.  Crack the encryption of FF_Functions.src and change the function...Paul may not like that though.
Title: hmmm...what to do....
Post by: Patrick Harvey on May 12, 2005, 12:40:02 AM
Thanks Roger...  

I tried making the util file read only before with another issue and you get an error that says the file "can't be accessed.".....so.....

I'll have to experiment tomorrow when I have the program in front of me...  a permanent solution would be cool however (can you help Paul?) for future projects...  I plan on making a lot of future registry changes in various utilities...

thanks for the help..!

Patrick
Title: got it working!
Post by: Patrick Harvey on May 12, 2005, 02:33:07 PM
Hi Roger -

Thanks for the help!  I got it working.  I copied Paul's function, renamed it, made the change you recommended (Len(x)) and then put it into my program - it worked!  Yea!

Patrick
Title: weird dots showing in regedit when I set a string registry k
Post by: TechSupport on May 12, 2005, 04:01:03 PM
I will fix this tonight when I can access the source code. Thanks for pointing out the problem.
Title: Thanks
Post by: Patrick Harvey on May 12, 2005, 05:50:54 PM
Paul:

I just wanted to thank you again for your helpful and friendly attitude - I really enjoy Firefly now and can't imagine life without it - thanks for being such a friend and helper to us "newbies"!

Patrick