From 32f95a35514701ed16413125b440c16d90f52b4a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Mar 2015 09:28:31 +0000 Subject: V813: Decreased performance Change-Id: I8a7528366156b288dc422b09cff0d5a32cde3c91 --- .../win32/customactions/shellextensions/vistaspecial.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'setup_native') diff --git a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx index ab039e2c48fe..162d54d0969d 100644 --- a/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx +++ b/setup_native/source/win32/customactions/shellextensions/vistaspecial.cxx @@ -63,7 +63,6 @@ static inline void OutputDebugStringFormat( LPCSTR, ... ) } #endif - static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty ) { std::_tstring result; @@ -82,14 +81,14 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro return result; } -static BOOL RemoveCompleteDirectory( std::_tstring sPath ) +static BOOL RemoveCompleteDirectory(const std::_tstring& rPath) { bool bDirectoryRemoved = true; - std::_tstring sPattern = sPath + TEXT("\\") + TEXT("*.*"); + std::_tstring sPattern = rPath + TEXT("\\") + TEXT("*.*"); WIN32_FIND_DATA aFindData; - // Finding all content in sPath + // Finding all content in rPath HANDLE hFindContent = FindFirstFile( sPattern.c_str(), &aFindData ); @@ -106,7 +105,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath ) if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) && ( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 )) { - std::_tstring sCompleteFileName = sPath + TEXT("\\") + sFileName; + std::_tstring sCompleteFileName = rPath + TEXT("\\") + sFileName; if ( aFindData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY ) { @@ -129,7 +128,7 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath ) // -> first removing content -> closing handle -> remove empty directory - if( !( RemoveDirectory(sPath.c_str()) ) ) + if( !( RemoveDirectory(rPath.c_str()) ) ) { bDirectoryRemoved = false; } @@ -138,8 +137,6 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath ) return bDirectoryRemoved; } - - extern "C" UINT __stdcall RenamePrgFolder( MSIHANDLE handle ) { std::_tstring sOfficeInstallPath = GetMsiProperty(handle, TEXT("INSTALLLOCATION")); -- cgit v1.2.3