diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c index ddf4e110..f335106a 100644 --- a/Contrib/System/Source/System.c +++ b/Contrib/System/Source/System.c @@ -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; diff --git a/Contrib/System/System.html b/Contrib/System/System.html index f2695928..bd592f82 100644 --- a/Contrib/System/System.html +++ b/Contrib/System/System.html @@ -187,7 +187,7 @@ DetailPrint $4

PARAMS, RETURN and OPTIONS can be repeated many times in one Get/Call line. When repeating, a lot can be omitted, and only what you wish to change can be used. Type, source and/or destination can be omitted for each parameter, even the return value. Options can be added or removed. This allows you to define function prototypes and save on some typing. The last two examples show this.

-

PROC can also be repeated but must be prefixed with a hash sign (`#').

+

PROC can also be repeated but must be prefixed with a hash sign (`#') except if the hash sign is preceded by a double colon (shell32::#18).

Possible PROC Values and Meanings