mirror of https://github.com/procxx/kepka.git
				
				
				
			Alpha 1.0.20: fix crash in old Windows versions.
A shell32 method SHCreateItemFromParsingName was used without checking if it was successfully loaded from shell32.dll (Vista+).
This commit is contained in:
		
							parent
							
								
									5aab168b3e
								
							
						
					
					
						commit
						ee45bbe4c6
					
				| 
						 | 
				
			
			@ -135,8 +135,14 @@ void UnsafeOpenEmailLink(const QString &email) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool UnsafeShowOpenWithDropdown(const QString &filepath, QPoint menuPosition) {
 | 
			
		||||
	if (!Dlls::SHAssocEnumHandlers || !Dlls::SHCreateItemFromParsingName) {
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	auto window = App::wnd();
 | 
			
		||||
	if (!window) return false;
 | 
			
		||||
	if (!window) {
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	auto parentHWND = window->psHwnd();
 | 
			
		||||
	auto wstringPath = QDir::toNativeSeparators(filepath).toStdWString();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -84,9 +84,6 @@ using namespace Platform;
 | 
			
		|||
namespace {
 | 
			
		||||
    QStringList _initLogs;
 | 
			
		||||
 | 
			
		||||
	bool useOpenWith = false;
 | 
			
		||||
	bool useOpenAs = false;
 | 
			
		||||
	bool useShellapi = false;
 | 
			
		||||
	bool themeInited = false;
 | 
			
		||||
	bool finished = true;
 | 
			
		||||
	QMargins simpleMargins, margins;
 | 
			
		||||
| 
						 | 
				
			
			@ -96,10 +93,6 @@ namespace {
 | 
			
		|||
	public:
 | 
			
		||||
		_PsInitializer() {
 | 
			
		||||
			Dlls::start();
 | 
			
		||||
 | 
			
		||||
			useOpenWith = (Dlls::SHAssocEnumHandlers != nullptr) && (Dlls::SHCreateItemFromParsingName != nullptr);
 | 
			
		||||
			useOpenAs = (Dlls::SHOpenWithDialog != nullptr) || (Dlls::OpenAs_RunDLL != nullptr);
 | 
			
		||||
			useShellapi = (Dlls::SHQueryUserNotificationState != nullptr);
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
	_PsInitializer _psInitializer;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue