diff --git a/Contrib/System/Source/System.c b/Contrib/System/Source/System.c index 11ac8ab2..4a17e656 100644 --- a/Contrib/System/Source/System.c +++ b/Contrib/System/Source/System.c @@ -519,7 +519,7 @@ SystemProc *PrepareProc(BOOL NeedForCall) BOOL param_defined = FALSE; SystemProc *proc = NULL; TCHAR *ibuf, *ib, *sbuf, *cbuf, *cb; - unsigned int UsedTString = 0, aligntype; + unsigned int UsedTString = 0, aligntype, inpathq = 0; #ifdef POPT_SYNTAX2 const UINT alignflag = PAT_ALIGNFLAG; #else @@ -550,22 +550,39 @@ SystemProc *PrepareProc(BOOL NeedForCall) switch (*ib) { - case 0x0: SectionType = -1; break; + case 0x0: + SectionType = -1; + break; case _T('#'): // "...#" redefines proc unless preceded by ":", then it's an ordinal (dll::#123) - if (ib <= ibuf || *(ib-1) != _T(':') || PST_PROC != SectionType) + if ((ib <= ibuf || *(ib-1) != _T(':') || PST_PROC != SectionType) && !inpathq) 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 - ParamIndex = ((ProcType == PT_VTABLEPROC)?(2):(1)); - temp3 = temp = 0; - param_defined = FALSE; + case _T('('): + if (inpathq) + changed = FALSE; + else + { + SectionType = PST_PARAMS; + // fake-real parameter: for COM interfaces first param is Interface Pointer + ParamIndex = ((ProcType == PT_VTABLEPROC)?(2):(1)); + temp3 = temp = 0; + param_defined = FALSE; + } break; - case _T(')'): SectionType = PST_RETURN; temp3 = temp = 0; break; - case _T('?'): SectionType = PST_OPTIONS; temp = 1; break; + case _T(')'): + if (inpathq) + changed = FALSE; + else + { + SectionType = PST_RETURN; + temp3 = temp = 0; + } + break; + case _T('?'): + SectionType = PST_OPTIONS; temp = 1; + break; default: changed = FALSE; } @@ -651,16 +668,29 @@ SystemProc *PrepareProc(BOOL NeedForCall) switch (SectionType) { // Proc sections parser - case PST_PROC: + case PST_PROC: parse_next_proc_section_char: switch (*ib) { + case _T('\"'): + ib++; // Skip '\"' + if (inpathq) + { + inpathq = 0; + goto parse_next_proc_section_char; + } + else + { + inpathq++; + } + break; case _T(':'): case _T('-'): // Is it '::' if ((*(ib) == _T('-')) && (*(ib+1) == _T('>'))) { ProcType = PT_VTABLEPROC; - } else + } + else { if ((*(ib+1) != _T(':')) || (*(ib) == _T('-'))) break; ProcType = PT_PROC; @@ -671,7 +701,9 @@ SystemProc *PrepareProc(BOOL NeedForCall) { *cb = 0; lstrcpy(sbuf, cbuf); - } else *sbuf = 0; // No dll - system proc + } + else + *sbuf = 0; // No dll - system proc // Ok ChangesDone = PCD_DONE; diff --git a/Contrib/System/System.html b/Contrib/System/System.html index baa6b4d0..26d05757 100644 --- a/Contrib/System/System.html +++ b/Contrib/System/System.html @@ -434,8 +434,9 @@ System::Free $0
@@ -489,7 +490,8 @@ System::Free $0-
- To find out the index of a member in a COM interface, you need to search for the definition of this COM interface in the header files that come with Visual C/C++ or the Platform SDK. Remember the index is zero based.
+- To find out the index of a member in a COM interface, you need to search for the definition of this COM interface in the header files that come with Visual C/C++ or the Platform SDK. The index is zero based.
- If a function can't be found or the
+t
parameter type was used, an `A' or `W' will be appended to its name and it will be looked up again. This is done because a lot of Windows API functions have two versions, one for ANSI strings and one for Unicode strings. The ANSI version of the function is marked with `A' and the Unicode version is marked with `W'. For example: lstrcpyA and lstrcpyW.- Libraries in the system32 directory can be loaded without a path. All other libraries should be loaded with a quoted full path.
-System::Call "user32::MessageBox(p $HWNDPARENT, t 'NSIS System Plug-in', t 'Test', i 0)" +System::Call 'user32::MessageBox(p $HWNDPARENT, t "NSIS System Plug-in", t "Test", i 0)' +System::Call '"$InstDir\MyLibrary.dll"::MyFunction(i 42)'
System::Call "kernel32::GetModuleHandle(t 'user32.dll') p .s" @@ -672,11 +674,6 @@ Pop $0 DetailPrint "5 + 5 = $0" # 10
--System::Int64Op 64 - 25 -Pop $0 -DetailPrint "64 - 25 = $0" # 39 -
System::Int64Op 526355 * 1565487 Pop $0 DetailPrint "526355 * 1565487 = $0" # 824001909885 @@ -710,13 +707,6 @@ Pop $0 DetailPrint "0x8000000000000000 >>> 1 = $0" # 4611686018427387904 (0x4000000000000000)
--System::Int64Op 0xF0F0F0F | 0xF0F0FFF -Pop $0 -# IntFmt is 32-bit, this is just for the example -IntFmt $0 "0x%X" $0 -DetailPrint "0xF0F0F0F | 0xF0F0FFF = $0" # 0xF0F0FFF -
System::Int64Op 0x12345678 & 0xF0F0F0F0 Pop $0 # IntFmt is 32-bit, this is just for the example diff --git a/Docs/src/history.but b/Docs/src/history.but index 99aa79b0..57897886 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -18,6 +18,9 @@ ANSI targets are deprecated, consider moving to Unicode. \b Fixed -O stderr stream issue (\W{http://sf.net/p/nsis/bugs/1221}{bug #1221}) +\b Allow quoted library path in System::Call (\W{http://sf.net/p/nsis/bugs/546}{bug #546}) + + \S2{} Translations \b Updated Hindi (\W{http://sf.net/p/nsis/patches/291}{patch #291}) and Portuguese (\W{http://sf.net/p/nsis/bugs/1219}{bug #1219})