View Issue Details

IDProjectCategoryView StatusLast Update
0001924PluginsFTP (old)public2011-11-28 18:26
Reporter2useven10Assigned ToDrKnS 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.0 
Target VersionFixed in Version3.0 
Summary0001924: Ftp plugin crashes if can't load dependent dll
DescriptionFtp плагин (думаю не только он) падает при выводе сообщения о невозможности загрузить свои вспомогательные модули (*.fll) в Far3.
В фар2 сообщение выводится нормально, падения нет.
Steps To ReproduceПереименовать Plugins/FTP/lib/ftpProgress.fll, перезапустить фар3, через AltF1 выбрать ftp плагин.
Additional InformationПатч есть. Сам не коммичу - не чувствую себя достаточно уверенным в этой области.
TagsNo tags attached.

Activities

2useven10

2011-11-19 23:02

developer  

PlugLoadError.diff (2,185 bytes)
Index: PluginA.cpp
===================================================================
--- PluginA.cpp	(revision 6885)
+++ PluginA.cpp	(working copy)
@@ -1295,7 +1295,7 @@
 	return ret;
 }
 
-#define GetPluginGuid(n) &reinterpret_cast<Plugin*>(n)->GetGUID()
+#define GetPluginGuid(n) (n ? &reinterpret_cast<Plugin*>(n)->GetGUID() : nullptr)
 int WINAPI FarMessageFnA(INT_PTR PluginNumber,DWORD Flags,const char *HelpTopic,const char * const *Items,int ItemsNumber,int ButtonsNumber)
 {
 	string strHT(HelpTopic);
@@ -1317,7 +1317,7 @@
 			p[i] = AnsiToUnicode(Items[i]);
 	}
 
-	DWORD NewFlags=0;
+	FARMESSAGEFLAGS NewFlags = (Flags & (oldfar::FMSG_MB_OK * 0xF)) << (FMSG_MB_OK/oldfar::FMSG_MB_OK-1) >> (oldfar::FMSG_MB_OK/FMSG_MB_OK-1);
 	if (Flags&oldfar::FMSG_WARNING)
 		NewFlags|=FMSG_WARNING;
 	if (Flags&oldfar::FMSG_ERRORTYPE)
@@ -1328,18 +1328,6 @@
 		NewFlags|=FMSG_LEFTALIGN;
 	if (Flags&oldfar::FMSG_ALLINONE)
 		NewFlags|=FMSG_ALLINONE;
-	if (Flags&oldfar::FMSG_MB_OK)
-		NewFlags|=FMSG_MB_OK;
-	if (Flags&oldfar::FMSG_MB_OKCANCEL)
-		NewFlags|=FMSG_MB_OKCANCEL;
-	if (Flags&oldfar::FMSG_MB_ABORTRETRYIGNORE)
-		NewFlags|=FMSG_MB_ABORTRETRYIGNORE;
-	if (Flags&oldfar::FMSG_MB_YESNO)
-		NewFlags|=FMSG_MB_YESNO;
-	if (Flags&oldfar::FMSG_MB_YESNOCANCEL)
-		NewFlags|=FMSG_MB_YESNOCANCEL;
-	if (Flags&oldfar::FMSG_MB_RETRYCANCEL)
-		NewFlags|=FMSG_MB_RETRYCANCEL;
 
 	int ret = NativeInfo.Message(GetPluginGuid(PluginNumber),&FarGuid,NewFlags,(HelpTopic?strHT.CPtr():nullptr),p,ItemsNumber,ButtonsNumber);
 
Index: plclass.cpp
===================================================================
--- plclass.cpp	(revision 6885)
+++ plclass.cpp	(working copy)
@@ -270,7 +270,7 @@
 	return Key > 0?(KeyToInputRecord(Key,RecKey)!=0?TRUE:FALSE):FALSE;
 }
 
-#define GetPluginNumber(Id) (CtrlObject?CtrlObject->Plugins.PluginGuidToPluginNumber(*Id):-1)
+#define GetPluginNumber(Id) (Id ? (CtrlObject?CtrlObject->Plugins.PluginGuidToPluginNumber(*Id):-1) : -1)
 
 static int WINAPI FarGetPluginDirListW(const GUID* PluginId,HANDLE hPlugin,
                                const wchar_t *Dir,struct PluginPanelItem **pPanelItem,
PlugLoadError.diff (2,185 bytes)

2useven10

2011-11-20 00:21

developer   bugnote:0007984

Last edited: 2011-11-20 00:30

View 2 revisions

поправка:

    FARMESSAGEFLAGS NewFlags = ((Flags/oldfar::FMSG_MB_OK) & 0xF)*FMSG_MB_OK;

DrKnS

2011-11-20 01:37

administrator   bugnote:0007985

Баг и в ftp - в PluginNumber нельзя передавать 0.

Issue History

Date Modified Username Field Change
2011-11-19 23:02 2useven10 New Issue
2011-11-19 23:02 2useven10 File Added: PlugLoadError.diff
2011-11-20 00:21 2useven10 Note Added: 0007984
2011-11-20 00:30 2useven10 Note Edited: 0007984 View Revisions
2011-11-20 01:37 DrKnS Note Added: 0007985
2011-11-21 22:36 2useven10 Assigned To => DrKnS
2011-11-21 22:36 2useven10 Status new => resolved
2011-11-28 18:26 DrKnS Status resolved => closed
2011-11-28 18:26 DrKnS Resolution open => fixed
2011-11-28 18:26 DrKnS Fixed in Version => 3.0
2013-05-21 00:30 alexy Category FTP => FTP (old)