View Issue Details

IDProjectCategoryView StatusLast Update
0038581FPCPackagespublic2021-04-10 15:54
ReporterMarco van de Voort Assigned ToMarco van de Voort  
Status resolvedResolutionfixed 
Product Version3.2.1 
Summary0038581: TRegistry.ReadBinaryData() Delphi incompatibility.
DescriptionI'm porting some Delphi code that reads MULTI_SZ (arrays of string) data from the registry.

The FPC one has some strange extra limitation that only allows ReadBinaryData for rdbinary and rdunknown.

  If not (RegDataType in [rdBinary, rdUnknown]) Then
    Raise ERegistryException.CreateFmt(SInvalidRegType, [Name]);

Why ?

Depending on the reason for the constraint either add rdMultiString to this list or remove the constraint all together?
TagsNo tags attached.
Fixed in Revision49165
Attached Files


Bart Broersma

2021-03-17 12:21

reporter   ~0129740

It seems this restriction has been there since revision 1.
At least on Windows lifting the restriction works just fine.
Somebody should test it with the xml implementation.

Bart Broersma

2021-03-17 13:59

reporter   ~0129741

I tested the XML implementation with the restrictions lifted.
It seems to work OK (tested: integer, multi_sz, string, int64, raw binary data).
Patch attached.
registry.readbinarydata.diff (517 bytes)   
Index: packages/fcl-registry/src/registry.pp
--- packages/fcl-registry/src/registry.pp	(revision 48960)
+++ packages/fcl-registry/src/registry.pp	(working copy)
@@ -481,8 +481,6 @@
   Result := GetData(Name, @Buffer, BufSize, RegDataType);
-  If not (RegDataType in [rdBinary, rdUnknown]) Then
-    Raise ERegistryException.CreateFmt(SInvalidRegType, [Name]);
 function TRegistry.ReadBinaryData(const Name: String; var Buffer;

Issue History

Date Modified Username Field Change
2021-03-04 15:26 Marco van de Voort New Issue
2021-03-17 12:21 Bart Broersma Note Added: 0129740
2021-03-17 13:59 Bart Broersma Note Added: 0129741
2021-03-17 13:59 Bart Broersma File Added: registry.readbinarydata.diff
2021-04-10 15:54 Marco van de Voort Assigned To => Marco van de Voort
2021-04-10 15:54 Marco van de Voort Status new => resolved
2021-04-10 15:54 Marco van de Voort Resolution open => fixed
2021-04-10 15:54 Marco van de Voort Fixed in Revision => 49165
2021-04-10 15:54 Marco van de Voort FPCTarget => -