🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3722

Re: Registry Problems

#3722
From: Michel Leunen
Date: Sat, 29 Apr 2006 15:07
42 lines
2224 bytes
Chris wrote:

> String __fastcall TfrmServerAdmin::MyGetRegVal(String  KeyToOpen, String 
> KeyToRead, String & Default, int RootKey)
> {
>    String RetVal;
> 
>    TRegistry *thisreg = new TRegistry;
>    thisreg->RootKey =  (void*)RootKey; // Registry Section
>    thisreg->OpenKey(KeyToOpen,false);
>    RetVal = thisreg->ReadString(KeyToRead);
>    delete thisreg;
>    if (RetVal != "")
>       return RetVal;
>    else
>       return Default;
> }

You don't check for errors in this function. Openkey return false on 
error and ReadString may throw.


>  Could it be 
> anti-spyware/anti-virus software? 

There are applications that prevent from changing the 
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Run key like 
anti-spyware, anti-virus or stand alone software monitoring the run key. 
For instance:
http://www.mlin.net/StartupMonitor.shtml
Maybe, your customer is running such an application. If I'm not 
mistaken, Bit-Defender, the Microsoft anti-spyware does this and most of 
the antivirus programs.

Michel
-- 
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
Technical Details
Message-ID: <445380a8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44532c52$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,b99e639ffcfc4f13
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Sat, 29 Apr 2006 17:07:47 +0200
From: Michel Leunen <nospam@noreply.please>
Organization: www.leunen.com
User-Agent: Thunderbird 1.5.0.2 (Windows/20060308)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Registry Problems
References: <44532c52$1@newsgroups.borland.com>
In-Reply-To: <44532c52$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.246.238.168
Message-ID: <445380a8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1146323112 81.246.238.168 (29 Apr 2006 08:05:12 -0700)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail