From 2bf0cf70258e411fff4f4ed06e5cb8bc6a0f6e8d Mon Sep 17 00:00:00 2001 From: anders_k Date: Sat, 17 Aug 2019 20:13:07 +0000 Subject: [PATCH] VC6 cannot handle class reference initialization in structs git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7114 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/Win/Propkey.nsh | 10 ++++++++-- Source/build.cpp | 2 +- Source/manifest.cpp | 2 +- Source/manifest.h | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Include/Win/Propkey.nsh b/Include/Win/Propkey.nsh index 71212176..be8ba051 100644 --- a/Include/Win/Propkey.nsh +++ b/Include/Win/Propkey.nsh @@ -151,14 +151,20 @@ ${V_SetVT} ${pV} ${VT_EMPTY} System::Call 'OLEAUT32::#9(p${pV})' !macroend !macro VariantCopy pDstV pSrcV sysretHR -System::Call 'OLEAUT32::#10(p${pDstV},p${pSrcV})i.${sysretHR}' +System::Call 'OLEAUT32::#10(p${pDstV},p${pSrcV})i.${sysretHR}' ; (Frees the destination variant before it copies the source) !macroend !macro VariantChangeType pDstV pSrcV Flags VT sysretHR System::Call 'OLEAUT32::#12(p${pDstV},p${pSrcV},i${Flags},i${VT})i.${sysretHR}' !macroend + + !macro PropVariantClear pPV -System::Call 'OLE32::PropVariantClear(p${pV})' ; Win95+, WinNT4.SP2+ +System::Call 'OLE32::PropVariantClear(p${pV})' ; WinNT4.SP0+, Win98+, IE4+ !macroend +!macro PropVariantCopy pDstV pSrcV sysretHR +System::Call 'OLE32::PropVariantCopy(p${pDstV},p${pSrcV})i.${sysretHR}' ; WinNT4.SP0+, Win98+, IE4+ (PropVariantCopy does not free the destination before it copies the source) +!macroend + !macro IPropertyStorage_ReadPropById pPS ID pPV sysoutHR System::Call '*(p${PRSPEC_PROPID},p${ID})p.s' diff --git a/Source/build.cpp b/Source/build.cpp index 710938ca..1bb7fa4e 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -2384,7 +2384,7 @@ int CEXEBuild::SetManifest() { try { init_res_editor(); - manifest::SPECIFICATION spec = { (manifest::flags) manifest_flags, manifest_dpiaware, manifest_dpiawareness.c_str(), manifest_lpaware, manifest_sosl, manifest_maxversiontested.c_str() }; + manifest::SPECIFICATION spec = { (manifest::flags) manifest_flags, manifest_dpiaware, manifest_dpiawareness.c_str(), manifest_lpaware, &manifest_sosl, manifest_maxversiontested.c_str() }; string manifest = manifest::generate(manifest_comctl, manifest_exec_level, spec); if (manifest == "") diff --git a/Source/manifest.cpp b/Source/manifest.cpp index 68ed5c8b..d38894f9 100644 --- a/Source/manifest.cpp +++ b/Source/manifest.cpp @@ -97,7 +97,7 @@ string generate(comctl comctl_selection, exec_level exec_level_selection, const dpiaware dpia = spec.DPIA; const TCHAR *dpia2 = spec.DPIA2; longpathaware lpa = spec.lpaware; - SupportedOSList& sosl = spec.SOSL; + SupportedOSList& sosl = *spec.pSOSL; const TCHAR *mvt = spec.MaxVersionTested; bool default_or_empty_sosl = sosl.isdefaultlist() || !sosl.getcount(); diff --git a/Source/manifest.h b/Source/manifest.h index 84cc8d6d..0ed5f3ac 100644 --- a/Source/manifest.h +++ b/Source/manifest.h @@ -99,7 +99,7 @@ namespace manifest dpiaware DPIA; const TCHAR *DPIA2; // Win10FU1607+ longpathaware lpaware; - SupportedOSList& SOSL; + SupportedOSList*pSOSL; const TCHAR *MaxVersionTested; // Win10FU1903+ github.com/microsoft/AppConsult-WinAppsModernizationWorkshop/tree/master/Exercise2 } SPECIFICATION;