[prev in list] [next in list] [prev in thread] [next in thread]
List: nsis-commits
Subject: [NSIS-commits] SF.net SVN: nsis:[6420] NSIS/trunk/Contrib/System
From: anders_k () users ! sourceforge ! net
Date: 2013-12-09 1:17:56
Message-ID: E1VppU0-0006IC-Fn () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 6420
http://sourceforge.net/p/nsis/code/6420
Author: anders_k
Date: 2013-12-09 01:17:55 +0000 (Mon, 09 Dec 2013)
Log Message:
-----------
System::Call can call exports by ordinal with dll::#123 syntax
Modified Paths:
--------------
NSIS/trunk/Contrib/System/Source/System.c
NSIS/trunk/Contrib/System/System.html
Modified: NSIS/trunk/Contrib/System/Source/System.c
===================================================================
--- NSIS/trunk/Contrib/System/Source/System.c 2013-12-08 23:48:13 UTC (rev 6419)
+++ NSIS/trunk/Contrib/System/Source/System.c 2013-12-09 01:17:55 UTC (rev 6420)
@@ -465,7 +465,12 @@
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 @@
// 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 @@
if (tproc)
proc->Proc = tproc;
else
- proc->ProcResult = PR_ERROR;
+ if (!proc->Proc) proc->ProcResult = PR_ERROR;
}
}
break;
Modified: NSIS/trunk/Contrib/System/System.html
===================================================================
--- NSIS/trunk/Contrib/System/System.html 2013-12-08 23:48:13 UTC (rev 6419)
+++ NSIS/trunk/Contrib/System/System.html 2013-12-09 01:17:55 UTC (rev 6420)
@@ -187,7 +187,7 @@
<p><i>PARAMS</i>, <i>RETURN</i> and <i>OPTIONS</i> 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. <i>Type</i>, <i>source</i> and/or <i>destination</i> 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 <a href="#repeat">last \
two examples</a> show this.</p>
-<p><i>PROC</i> can also be repeated but must be prefixed with a hash sign (`#').</p>
+<p><i>PROC</i> can also be repeated but must be prefixed with a hash sign (`#') \
except if the hash sign is preceded by a double colon \
(<code>shell32::#18</code>).</p>
<h4>Possible <i>PROC</i> Values and Meanings</h4>
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
NSIS-commits mailing list
NSIS-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nsis-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic