I try to read a GUID value stored as a binary
value in registry in Delphi.
When I read it with BintoHex, but the result is in reverse order.
It seems that I have to swap bytes but I thought BinToHex would do it.
I refered to this thread but I can't find the right solution : how to convert byte array to its hex representation in Delphi It seems that it is due to little Eendian.
Below, you can see the GUID stored in registry
Here is my code :
var
s : string;
buffer : pointer;
...
begin
getmem(buffer, 1024*1024);
....
reg.ReadBinaryData(iValueOfregistry, buffer^, 1024*1024);
....
bintohex(pointer(longint(buffer)+14), PChar(s), 32);
Output for s : 90E24D373F126545916439C4925E467B
GUID should be FOLDERID_Downloads GUID :
{374DE290-123F-4565-9164-39C4925E467B}
Please help