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) {
 | 
					bool UnsafeShowOpenWithDropdown(const QString &filepath, QPoint menuPosition) {
 | 
				
			||||||
 | 
						if (!Dlls::SHAssocEnumHandlers || !Dlls::SHCreateItemFromParsingName) {
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto window = App::wnd();
 | 
						auto window = App::wnd();
 | 
				
			||||||
	if (!window) return false;
 | 
						if (!window) {
 | 
				
			||||||
 | 
							return false;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto parentHWND = window->psHwnd();
 | 
						auto parentHWND = window->psHwnd();
 | 
				
			||||||
	auto wstringPath = QDir::toNativeSeparators(filepath).toStdWString();
 | 
						auto wstringPath = QDir::toNativeSeparators(filepath).toStdWString();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,9 +84,6 @@ using namespace Platform;
 | 
				
			||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
    QStringList _initLogs;
 | 
					    QStringList _initLogs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool useOpenWith = false;
 | 
					 | 
				
			||||||
	bool useOpenAs = false;
 | 
					 | 
				
			||||||
	bool useShellapi = false;
 | 
					 | 
				
			||||||
	bool themeInited = false;
 | 
						bool themeInited = false;
 | 
				
			||||||
	bool finished = true;
 | 
						bool finished = true;
 | 
				
			||||||
	QMargins simpleMargins, margins;
 | 
						QMargins simpleMargins, margins;
 | 
				
			||||||
| 
						 | 
					@ -96,10 +93,6 @@ namespace {
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		_PsInitializer() {
 | 
							_PsInitializer() {
 | 
				
			||||||
			Dlls::start();
 | 
								Dlls::start();
 | 
				
			||||||
 | 
					 | 
				
			||||||
			useOpenWith = (Dlls::SHAssocEnumHandlers != nullptr) && (Dlls::SHCreateItemFromParsingName != nullptr);
 | 
					 | 
				
			||||||
			useOpenAs = (Dlls::SHOpenWithDialog != nullptr) || (Dlls::OpenAs_RunDLL != nullptr);
 | 
					 | 
				
			||||||
			useShellapi = (Dlls::SHQueryUserNotificationState != nullptr);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	_PsInitializer _psInitializer;
 | 
						_PsInitializer _psInitializer;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue