Vote count:
0
I have following program that reads all CLSID registry keys and displays their name on a listbox; it is written in Delphi, but the question is not specific to Delphi; it is rather a question about the Windows Registry.
procedure TForm2.Button1Click(Sender: TObject);
var
guid: string;
reg: TRegistry;
sl: TStringList;
i: Integer;
name: string;
begin
memo1.Clear;
reg := TRegistry.Create;
sl := TStringList.Create;
memo1.Lines.BeginUpdate;
try
reg.RootKey := HKEY_CLASSES_ROOT;
if reg.OpenKeyReadOnly('\CLSID\') then
begin
reg.GetKeyNames(sl);
reg.CloseKey;
for i := 1 to sl.Count-1 do
begin
guid := sl.Strings[i];
if reg.OpenKeyReadOnly('\CLSID\'+guid) then
begin
try
name := reg.ReadString('');
except
name := '!!! <ERROR1> !!!';
end;
reg.CloseKey;
end;
memo1.Lines.Add(guid + ' ' + name);
end;
end;
finally
sl.Free;
reg.Free;
memo1.Lines.EndUpdate;
end;
end;
The problem is that following registry keys do exist (they are listed in GetKeyNames), but they cannot be read (reading the default value). I get the Exception "Invalid data type for ''".
The keys which fail are:
{33297C9D-2A25-1679-1475-A1CE3901C86D} !!! <ERROR1> !!!
{45049248-47E9-7CEE-A822-1E555F74D237} !!! <ERROR1> !!!
{69C5BE90-E717-97A6-CCEF-C44D93111A5A} !!! <ERROR1> !!!
{8663D540-C578-44AE-9D24-4A9D9A4881C3} !!! <ERROR1> !!!
{9A73B3FA-50DF-3410-930D-51C35FC9237E} !!! <ERROR1> !!!
{EACF7497-3D67-8044-DE95-81429597BB8F} !!! <ERROR1> !!!
These keys do not appear in regedit.exe, even if I run RegEdit in the NT-AUTHORITY\SYSTEM context (which shows really everything).
Do you have the same problem, or is my registry somehow damaged?
asked 3 mins ago
Some CLSID Registry keys exist but cannot be read
Aucun commentaire:
Enregistrer un commentaire