Subject Re: [firebird-support] UDF with string parameter in Terminal Server
Author Vlad Khorsun
""Gustavo"" ...
> Hello:
>
> I have a problem using an UDF with a string parameter in Terminal Server.
>
> I wrote a simple UDF in Delphi. The code is the following:
>
> function MMPruebaString(CualAlias: PChar): PChar;
> begin
> Result:= CualAlias;
> end;
>
> Then I compiled it making MMudf.dll, I copied it in the server, in "C:\Arch
> ivos de programa\Firebird\Firebird_2_0\UDF". Then I created a DataBase and
> I declared the UDF with the following command:
>
> DECLARE EXTERNAL FUNCTION MMPruebaString
> CSTRING(1000)
> RETURNS CSTRING(1000) FREE_IT
> ENTRY_POINT 'MMPruebaString'
> MODULE_NAME 'MMudf';

You use FREE_IT but not allocate memory. Even adding cdecl can't keep
your server from crash

Regards,
Vlad