What is the correct way of getting this handle from my current running program?RootHandle - The ELF handle of the program using this function.
The user program is responsible for passing this, which MUST be
a valid elf handle and MUST be this program's elf handle, plus
it must have been re-opened. The handle may be re-closed after
this call, but must be open anytime a DL#? function is called.
DLOpen: how to get the Elf32_Handle roothandle?
DLOpen: how to get the Elf32_Handle roothandle?
In the autodoc for elf.library the DLOpen function is said to require an ELF handle:
- salass00
- AmigaOS Core Developer
- Posts: 530
- Joined: Sat Jun 18, 2011 3:12 pm
- Location: Finland
- Contact:
Re: DLOpen: how to get the Elf32_Handle roothandle?
Using IDOS->GetSegListInfoTags():
The elf handle must also be reopened with IElf->OpenElfTags():
And then closed when you're done with it using:
If you use libdl it takes care of all this.
Code: Select all
Elf32_Handle elfh = NULL;
IDOS->GetSegListInfoTags(seglist,
GSLI_ElfHandle, &elfh,
TAG_END);
Code: Select all
elfh = IElf->OpenElfTags(
OET_ElfHandle, elfh,
TAG_END);
Code: Select all
IElf->CloseElfTags(elfh,
CET_ReClose, TRUE,
TAG_END);