Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6 security patch via Setup Wizard
Message
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00737599
Message ID:
00740021
Views:
29
>>John,
>>
>>How about this: consider the problem to be that of creating a generic UDF to update a given registry entry with a specified REG_DWORD type of value. A complementary UDF to retrieve a given REG_DWORD value would also be useful. As I mentioned before, the FCC's registry class only supports REG_SZ.
>>
>>Yes, I undertand that it sounds simple, yet, to date no one has found it to be so simple as to simply post the code. Surely there are many people more qualified to do this than I, yourself included. On the other hand, I may be the most qualified (or at least the most motivated) to thoroughly test it. I've wasted a few days on this already, John, so I hope you don't think I'm too lazy! :-)
>>
>>Of course I could spend still more time looking for the answer, but I have other more pressing tasks to attend to at the moment. Lacking any further assistance, it will probably be quite a while before I get around to making this particular fix. On the other hand, if anyone would care to supply the required generic registry maniputation logic, I would be strongly inclined to incorporate and test those program changes without delay, and I will gladly share the results with all. I do think it would be in everyone's best interest to have a clear resolution of this security flaw as soon as possible. Does that sound fair?
>>
>Mike,
>
>If you're talking about modifiying the Registry in the FFC, it's really pretty straight forward. Here are the type definitions and some code
#DEFINE REG_SZ	1 && Data string
>#DEFINE REG_EXPAND_SZ 	2 && Unicode string
>#DEFINE REG_BINARY		3 && Binary data in any form.
>#DEFINE REG_DWORD 		4	&& A 32-bit number.
>* The code in SetKeyValue
>LPARAMETERS cValueName, cValue, nType
>
>LOCAL nValueSize, nErrCode, lntype
>IF PCOUNT() < 3
>  lntype = REG_SZ
>ELSE
>  lntype = nType
>ENDIF
>DO CASE
>  CASE TYPE("This.nCurrentKey") # 'N' OR This.nCurrentKey = 0
>    nErrCode = ERROR_BADKEY
>  CASE TYPE("cValueName") # "C"
>    nErrCode = ERROR_BADPARM
>  OTHERWISE
>    nErrCode = ERROR_SUCCESS
>ENDCASE
>IF nErrCode = ERROR_SUCCESS
>  IF nType # REG_DWORD
>    IF nType = REG_SZ
>      * Make sure we null terminate this guy
>      cValue = cValue + CHR(0)
>    ENDIF
>    nValueSize = LEN(cValue)
>  ELSE
>    nValueSize = 4
>  ENDIF
>  * Set the key value here
>  nErrCode = RegSetValueEx(This.nCurrentKey, cValueName, 0, lntype, cValue, nValueSize)
>ENDIF
>RETURN nErrCode
All you have to do is make similar changes to the GetKeyValue method.

Thanks, George. This looks like what I was after. Thanks, too, for your indispensable LNKFILES.DLL!

Mike
Montage

"Free at last..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform