Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working udf [CORE5945] #6201

Closed
firebird-automations opened this issue Oct 19, 2018 · 3 comments
Closed

not working udf [CORE5945] #6201

firebird-automations opened this issue Oct 19, 2018 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: andrey (someonesomeone)

not working udf

error message:
Invalid token.
invalid request BLR at offset 39.
function GEN_UUID_SEQUENTIAL is not defined.
module name or entrypoint could not be found.

source code:
library uuid;

{declare external function gen_uuid_sequential
returns char(16) character set octets free_it
entry_point 'gen_uuid_sequential' module_name 'uuid.dll'}

function UuidCreateSequential(var guid: TGUID): HResult; stdcall; external 'RPCRT4.dll';
function ib_util_malloc(l: integer): pointer; cdecl; external 'ib_util.dll';

function gen_uuid_sequential: PAnsiChar; cdecl; export;
var
uid: TGUID;
begin
Result := ib_util_malloc(16);
UuidCreateSequential(uid);
Move(uid, Result^, SizeOf(uid));
end;

exports
gen_uuid_sequential;

begin
isMultiThread := True;
end.

checking project code:

procedure TForm1.Button1Click(Sender: TObject);
type
PGuid= ^TGuid;
var
gen_uuid_sequential: function(): PAnsiChar;
LibHandle: THandle;
FileName: string;
Error: DWORD;
g: PGuid;
begin
FileName:= ExtractFilePath(Application.ExeName) + 'uuid.dll';
@gen_uuid_sequential := nil;
LibHandle := SafeLoadLibrary(FileName);
if LibHandle >= 32 then
begin
@gen_uuid_sequential := GetProcAddress(LibHandle, 'gen_uuid_sequential');
if @gen_uuid_sequential <> nil then
begin
g := PGuid(gen_uuid_sequential());
ShowMessage(GuidToString(g^));
end;
end
else
begin
Error:= GetLastError();
ShowMessage('Error: ' + IntToStr(Error));
end;
FreeLibrary(LibHandle);
end;

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

This looks for me like support question.
You probably have 64bit server and 32 udf which can not be mixed at all

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Karol is correct, the issue is likely due to mixing of 64/32 engine and UDF, or some other configuration issue, that should be address via the appropriate support forum. As such, this item is not appropriate for the tracker.

If the issue turns out to be something which does require a code/project change, this item can/will be re-opened.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant