[Lazarus] Remote Registry...

Michael Van Canneyt michael at freepascal.org
Fri Aug 23 09:50:07 CEST 2013



On Fri, 23 Aug 2013, Flávio Etrusco wrote:

> On Thu, Aug 22, 2013 at 9:55 PM, waldo kitty <wkitty42 at windstream.net> wrote:
>> On 8/22/2013 16:46, Liyuan Garcia Caballero wrote:
>>>
>>> Hi guys,
>>>
>>> I need access to remote registry of Microsoft Window and get a data,
>>> it's posible with Pascal?
>>
>>
>> of course it is possible... the question is how are you expecting to be able
>> to perform this task...
>>
>>> Somebody can share one code?
>>
>>
>> no but possibly an idea or two... write a remote "server" that accesses the
>> registry for whatever you want... then talk to it via a local "client"...
>>
>> in reality, it should be no different than using ssh or rdp into the remote
>> host and starting the remote machine's regedit or similar... capturing that
>> information and feeding it back across the link...
>>
>> NOTE: i use the term "server" above because you are wanting to connect to a
>> remote system and pull data from it... in the most general terms, that makes
>> it a server... the connecting package on the local side is then considered a
>> client...
>>
>
>
> I guess he means this:
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms724840%28v=vs.85%29.aspx

Currently this is not supported by FPC.

What needs to be done is implement

function TRegistry.RegistryConnect(const UNCName: string): Boolean;
begin
   Result := False;
end;

in packages/fcl-registry/src.

The function indicated by Flavio must be used for this.

So I'd guess that would be something like:

function TRegistry.RegistryConnect(const UNCName: string): Boolean;

Var
   Res : HKey;

begin
   Result := RegConnectRegistryA(PAnsiChar(UNCName),FRootKey, at HKey);
   if Result then
     FCurentKey:=Res;
end;


Michael.


More information about the Lazarus mailing list