System::Call can call exports by ordinal with dll::#123 syntax
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6420 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f9fae88303
commit
18c0cbe3ec
2 changed files with 14 additions and 3 deletions
|
@ -465,7 +465,12 @@ SystemProc *PrepareProc(BOOL NeedForCall)
|
|||
switch (*ib)
|
||||
{
|
||||
case 0x0: SectionType = -1; break;
|
||||
case _T('#'): SectionType = PST_PROC; ProcType = PT_NOTHING; break;
|
||||
case _T('#'): // "...#" redefines proc unless preceded by ":", then it's an ordinal (dll::#123)
|
||||
if (ib <= ibuf || *(ib-1) != _T(':') || PST_PROC != SectionType)
|
||||
SectionType = PST_PROC, ProcType = PT_NOTHING;
|
||||
else
|
||||
changed = FALSE;
|
||||
break;
|
||||
case _T('('):
|
||||
SectionType = PST_PARAMS;
|
||||
// fake-real parameter: for COM interfaces first param is Interface Pointer
|
||||
|
@ -862,6 +867,12 @@ SystemProc *PrepareProc(BOOL NeedForCall)
|
|||
|
||||
// Get proc address
|
||||
proc->Proc = NSISGetProcAddress(proc->Dll, proc->ProcName);
|
||||
if (!proc->Proc && *proc->ProcName == _T('#'))
|
||||
{
|
||||
int ordinal = myatoi(proc->ProcName+1);
|
||||
if (ordinal && IS_INTRESOURCE(ordinal))
|
||||
proc->Proc = GetProcAddress(proc->Dll, MAKEINTRESOURCEA(ordinal));
|
||||
}
|
||||
if (UsedTString || !proc->Proc)
|
||||
{
|
||||
FARPROC tproc;
|
||||
|
@ -876,7 +887,7 @@ SystemProc *PrepareProc(BOOL NeedForCall)
|
|||
if (tproc)
|
||||
proc->Proc = tproc;
|
||||
else
|
||||
proc->ProcResult = PR_ERROR;
|
||||
if (!proc->Proc) proc->ProcResult = PR_ERROR;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue