diff options
author | Thomas Preud'homme <robotux@celest.fr> | 2017-11-24 23:24:09 +0000 |
---|---|---|
committer | Thomas Preud'homme <robotux@celest.fr> | 2017-11-24 23:24:09 +0000 |
commit | b3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (patch) | |
tree | 8fce8a51adfb245db8ab2a76831661780c0c713e /plugins/PluginLoader | |
parent | e297dbd8052ef4e66f069e2dd1865ae7fa8af28e (diff) |
New upstream version 1.2.3.6
Diffstat (limited to 'plugins/PluginLoader')
32 files changed, 600 insertions, 564 deletions
diff --git a/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h b/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h index ad08d4f..f9b5349 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h +++ b/plugins/PluginLoader/catchcopy-v0002/DebugEngineMacro.h @@ -1,12 +1,15 @@ /** \file DebugEngineMacro.h \brief Define the macro for the debug \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef DEBUGENGINEMACRO_H #define DEBUGENGINEMACRO_H +#ifdef WIN32 +# define __func__ __FUNCTION__ +#endif + /// \brief Macro for the debug log #ifdef ULTRACOPIER_PLUGIN_DEBUG #if defined (__FILE__) && defined (__LINE__) diff --git a/plugins/PluginLoader/catchcopy-v0002/Environment.h b/plugins/PluginLoader/catchcopy-v0002/Environment.h index 94fd104..265a5a6 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/Environment.h +++ b/plugins/PluginLoader/catchcopy-v0002/Environment.h @@ -1,8 +1,7 @@ /** \file Environment.h
\brief Define the environment variable and global function
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#include "Variable.h"
/// \brief The global include
diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ar/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts index b27aefe..dd3552b 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/de/translation.ts @@ -5,8 +5,14 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation>Im Normalfall ist für 32 oder 64-Bit-Beriebsysteme nur die jeweilige dll wichtig. Die UAC kann geöffnet werden um die dll zu laden.</translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> - <translation>Alle DLLs sind importants</translation> + <translatorcomment>fix english</translatorcomment> + <translation>Alle DLLs sind wichtig (32Bit + 64Bit)</translation> </message> </context> </TS> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/el/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts new file mode 100644 index 0000000..e4aa3ce --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/en/translation.ts @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="en"> +<context> + <name>OptionsWidget</name> + <message> + <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> + <source>All the dlls are importants</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts index 4629456..577444d 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/es/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation>Todas las dlls son importantes</translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts index 40efc6d..809ffee 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/fr/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation>Dans la plupart des cas, seule la DLL 64 bits est importante pour un OS 64 bits, et la DLL 32 bits pour un OS 32 bits. Lorsqu'elle est importante,le chargement d'une DLL peut nécessiter une confirmation (UAC).</translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation>Toutes les dlls sont importantes</translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/hi/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts new file mode 100644 index 0000000..30fce33 --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/hu/translation.ts @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0" language="hu"> +<context> + <name>OptionsWidget</name> + <message> + <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation>Normális esetben csak a 64 bites dll fontos a 64 bites és a 32 bites dll a 32 bites operációs rendszer számára.Amikor lényeges, az UAC megnyitható a dll betöltéséhez.</translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> + <source>All the dlls are importants</source> + <translation>Az összes dll fontos</translation> + </message> +</context> +</TS> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/id/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts index c87f684..ba6fb10 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/it/translation.ts @@ -1,12 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> -<TS version="2.0"> +<TS version="2.0" language="it_IT"> <context> <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation>Solitamente, la dll 64Bit è indispensabile solo per sistemi operativi a 64Bit, e la dll 32Bit per sistemi operativi a 32Bits. Quando è necessario, l' UAC (il controllo dell'account utente) può essere aperto per caricare la dll.</translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> - <translation type="unfinished"></translation> + <translation>Tutte le dll sono necessarie</translation> </message> </context> </TS> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ja/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts index 9d16334..48aea93 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ko/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="+17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+3"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/nl/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/no/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pl/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/pt/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts index 480851d..239b785 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/ru/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation>Все библиотеки являются важным</translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/th/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/tr/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts index c87f684..a1b2048 100644 --- a/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts +++ b/plugins/PluginLoader/catchcopy-v0002/Languages/zh/translation.ts @@ -5,6 +5,11 @@ <name>OptionsWidget</name> <message> <location filename="../../OptionsWidget.ui" line="17"/> + <source>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../../OptionsWidget.ui" line="20"/> <source>All the dlls are importants</source> <translation type="unfinished"></translation> </message> diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp index 4d616e4..563e855 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.cpp @@ -3,37 +3,37 @@ OptionsWidget::OptionsWidget(QWidget *parent) :
QWidget(parent),
- ui(new Ui::OptionsWidget)
+ ui(new Ui::OptionsWidget)
{
- ui->setupUi(this);
+ ui->setupUi(this);
}
OptionsWidget::~OptionsWidget()
{
- delete ui;
+ //delete ui;//attached to the main program, then it's the main program responsive the delete
}
void OptionsWidget::setAllDllIsImportant(bool allDllIsImportant)
{
- ui->allDllIsImportant->setChecked(allDllIsImportant);
+ ui->allDllIsImportant->setChecked(allDllIsImportant);
}
void OptionsWidget::setDebug(bool Debug)
{
- ui->Debug->setChecked(Debug);
+ ui->Debug->setChecked(Debug);
}
void OptionsWidget::on_allDllIsImportant_toggled(bool checked)
{
- emit sendAllDllIsImportant(ui->allDllIsImportant->isChecked());
+ emit sendAllDllIsImportant(checked);
}
void OptionsWidget::retranslate()
{
- ui->retranslateUi(this);
+ ui->retranslateUi(this);
}
void OptionsWidget::on_Debug_toggled(bool checked)
{
- emit sendDebug(ui->Debug->isChecked());
+ emit sendDebug(checked);
}
diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h index cbbf61c..cbbf61c 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.h diff --git a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui index 4fc0727..c741676 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui +++ b/plugins/PluginLoader/catchcopy-v0002/OptionsWidget.ui @@ -13,6 +13,9 @@ <layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="allDllIsImportant">
+ <property name="toolTip">
+ <string>In normal case, only the dll 64Bits is important with 64Bits OS, and 32Bits dll with 32Bits OS. When it's important, the UAC can be opened to load the dll.</string>
+ </property>
<property name="text">
<string>All the dlls are importants</string>
</property>
diff --git a/plugins/PluginLoader/catchcopy-v0002/Variable.h b/plugins/PluginLoader/catchcopy-v0002/Variable.h index 8179c93..90e1557 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/Variable.h +++ b/plugins/PluginLoader/catchcopy-v0002/Variable.h @@ -1,14 +1,14 @@ /** \file Variable.h
\brief Define the environment variable
\author alpha_one_x86
-\version 0.3
-\date 2010 */
+\licence GPL3, see the file COPYING */
#ifndef VARIABLE_H
#define VARIABLE_H
//Un-comment this next line to put ultracopier plugin in debug mode
#define ULTRACOPIER_PLUGIN_DEBUG
+//#define ULTRACOPIER_PLUGIN_ALL_IN_ONE
#endif // VARIABLE_H
diff --git a/plugins/PluginLoader/catchcopy-v0002/documentation.dox b/plugins/PluginLoader/catchcopy-v0002/documentation.dox index e8aaaa7..08ccc4a 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/documentation.dox +++ b/plugins/PluginLoader/catchcopy-v0002/documentation.dox @@ -10,13 +10,13 @@ \section mainpage_overview Overview - Is the plugin to load the catchcopy plugin into the windows file manager.\n - More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. Is part of Ultracopier 0.3 project. + Is the plugin to load the catchcopy plugin into the windows file manager. Mostly it use the command: regsvr32 /s catchcopy32.dll/catchcopy64.dll\n + More informations on <a href="http://ultracopier-wiki.first-world.info/">the wiki of ultracopier</a>. \section mainpage_platforms Platforms - This plugin might be usable in all environments where you find Qt 4.\n - To be compatible with the official Ultracopier plugins, you need compil it with Gcc, Qt4.8, and same env as Ultracopier have been compiled, see the documentation. + Ultracopier might be usable in all environments where you find Qt 5.\n + Ultracopier requires Qt 5.0 or newer. Tested on Qt 5.0. \section mainpage_downloads Downloads @@ -28,7 +28,7 @@ In function if Ultracopier is compiled by portable version, try load the dll by other way. \section license GPL Version 3 - The code source is under GPL3. The image is extacted from Oxygen icon pack of KDE4. + The code source is under GPL3. */ diff --git a/plugins/PluginLoader/catchcopy-v0002/informations.xml b/plugins/PluginLoader/catchcopy-v0002/informations.xml index 568ad06..0b62f30 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/informations.xml +++ b/plugins/PluginLoader/catchcopy-v0002/informations.xml @@ -17,11 +17,10 @@ <description xml:lang="en"><![CDATA[Plugin loader for catchcopy v0002. Allow to receive copy list from plugin/explorer compatible with catchcopy.]]></description> <description xml:lang="fr"><![CDATA[Chargeur de plugin pour catchcopy v0002. Permet de recevoir un liste de copie venant d'un plugin/explorateur avec catchcopy.]]></description> <!-- Version of this release of this plugin, need be like that's: A.B.C.D, where A, B, C and D is number --> - <version>0.3.1.0</version> + <version>1.2.3.6</version> <!-- This internal name should never change, because it is used to detect when a particular plugin is updated. It must comprise only lower case ASCII characters (a-z), numerical digits (0-9), "-", "." or "_", and it must be be unique within the category. And have size lower than 64 char. --> <name>catchcopy-v0002</name> <!-- Dependency checking. This is used to check when a plugin may not be compatible with an updated version of either Ultracopier or another plugin. This example only checks Ultracopier. --> <dependencies><![CDATA[ - >=ultracopier-0.3.1.0 ]]></dependencies> </package>
\ No newline at end of file diff --git a/plugins/PluginLoader/catchcopy-v0002/plugin.json b/plugins/PluginLoader/catchcopy-v0002/plugin.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/plugins/PluginLoader/catchcopy-v0002/plugin.json @@ -0,0 +1 @@ +{}
\ No newline at end of file diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp index d69cf91..2009e0a 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.cpp @@ -1,543 +1,442 @@ /** \file pluginLoader.cpp \brief Define the session plugin loader test -\author alpha_one_x86 -\version 0.3 -\date 2010 */ +\author alpha_one_x86 */ #include "pluginLoader.h" #include "PlatformMacro.h" +#include <QFile> +#include <QDir> +#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE +#include <QCoreApplication> +#endif + #ifdef ULTRACOPIER_PLUGIN_DEBUG - #define NORMAL_EXT "d.dll" - #define SECOND_EXT ".dll" + #define NORMAL_EXT "d.dll" + #define SECOND_EXT ".dll" #else - #define NORMAL_EXT ".dll" - #define SECOND_EXT "d.dll" + #define NORMAL_EXT ".dll" + #define SECOND_EXT "d.dll" #endif #define CATCHCOPY_DLL_32 "catchcopy32" #define CATCHCOPY_DLL_64 "catchcopy64" -PluginLoader::PluginLoader() +WindowsExplorerLoader::WindowsExplorerLoader() { - //set the startup value into the variable - dllChecked=false; - optionsEngine=NULL; - allDllIsImportant=false; - Debug=false; - needBeRegistred=false; - changeOfArchDetected=false; - is64Bits=false; - connect(&optionsWidget,SIGNAL(sendAllDllIsImportant(bool)),this,SLOT(setAllDllIsImportant(bool))); - connect(&optionsWidget,SIGNAL(sendDebug(bool)),this,SLOT(setDebug(bool))); + //set the startup value into the variable + dllChecked=false; + optionsEngine=NULL; + allDllIsImportant=false; + Debug=false; + needBeRegistred=false; + changeOfArchDetected=false; + is64Bits=false; + optionsWidget=new OptionsWidget(); + connect(optionsWidget,&OptionsWidget::sendAllDllIsImportant,this,&WindowsExplorerLoader::setAllDllIsImportant); + connect(optionsWidget,&OptionsWidget::sendDebug,this,&WindowsExplorerLoader::setDebug); #if defined(_M_X64)//64Bits - is64Bits=true; + is64Bits=true; #else//32Bits - char *arch=getenv("windir"); - if(arch!=NULL) - { - QDir dir; - if(dir.exists(QString(arch)+"\\SysWOW64\\")) - is64Bits=true; - /// \note commented because it do a crash at the startup, and useless, because is global variable, it should be removed only by the OS - //delete arch; - } + char *arch=getenv("windir"); + if(arch!=NULL) + { + QDir dir; + if(dir.exists(QString(arch)+"\\SysWOW64\\")) + is64Bits=true; + /// \note commented because it do a crash at the startup, and useless, because is global variable, it should be removed only by the OS + //delete arch; + } #endif } -PluginLoader::~PluginLoader() +WindowsExplorerLoader::~WindowsExplorerLoader() { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"destructor"); - setEnabled(false); + //delete optionsWidget;//attached to the main program, then it's the main program responsive the delete + setEnabled(false); } -void PluginLoader::setEnabled(bool needBeRegistred) +void WindowsExplorerLoader::setEnabled(const bool &needBeRegistred) { - if(!checkExistsDll()) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("No dll exists")); - emit newState(Uncaught); - if(!needBeRegistred) - correctlyLoaded.clear(); - return; - } - if(this->needBeRegistred==needBeRegistred) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Double event dropped")); - return; - } - this->needBeRegistred=needBeRegistred; - int index=0; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant)); + if(!checkExistsDll()) + { + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + if(needBeRegistred) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Uncaught); + #else + emit newState(Ultracopier::Uncaught); + #endif + if(!needBeRegistred) + correctlyLoaded.clear(); + return; + } + if(this->needBeRegistred==needBeRegistred) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Double event dropped: %1").arg(needBeRegistred)); + if(needBeRegistred) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Uncaught); + return; + } + this->needBeRegistred=needBeRegistred; + int index=0; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, needBeRegistred: %1, allDllIsImportant: %2").arg(needBeRegistred).arg(allDllIsImportant)); - bool oneHaveFound=false; - index=0; - while(index<importantDll.size()) - { - if(QFile::exists(pluginPath+importantDll.at(index))) - { - oneHaveFound=true; - break; - } - index++; - } - if(!oneHaveFound) - { - index=0; - while(index<secondDll.size()) - { - if(QFile::exists(pluginPath+secondDll.at(index))) - { - oneHaveFound=true; - break; - } - index++; - } - } - if(!oneHaveFound) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("No dll have found")); - emit newState(Uncaught); - if(!needBeRegistred) - correctlyLoaded.clear(); - return; - } + bool oneHaveFound=false; + index=0; + while(index<importantDll.size()) + { + if(QFile::exists(pluginPath+importantDll.at(index))) + { + oneHaveFound=true; + break; + } + index++; + } + if(!oneHaveFound) + { + index=0; + while(index<secondDll.size()) + { + if(QFile::exists(pluginPath+secondDll.at(index))) + { + oneHaveFound=true; + break; + } + index++; + } + } + if(!oneHaveFound) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("No dll have found")); + emit newState(Ultracopier::Uncaught); + if(!needBeRegistred) + correctlyLoaded.clear(); + return; + } - index=0; - bool importantDll_is_loaded=false,secondDll_is_loaded=false; - bool importantDll_have_bug=false,secondDll_have_bug=false; - int importantDll_count=0,secondDll_count=0; - while(index<importantDll.size()) - { - if(!RegisterShellExtDll(pluginPath+importantDll.at(index),needBeRegistred,false)) - { - if(changeOfArchDetected) - { - setEnabled(needBeRegistred); - return; - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"the important dll have failed: "+importantDll.at(index)); - importantDll_have_bug=true; - } - else - { - if(needBeRegistred) - correctlyLoaded << importantDll.at(index); - importantDll_is_loaded=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the important dll have been loaded: "+importantDll.at(index)); - } - importantDll_count++; - index++; - } - index=0; - while(index<secondDll.size()) - { - if(!RegisterShellExtDll(pluginPath+secondDll.at(index),needBeRegistred, - !( - (needBeRegistred && allDllIsImportant) - || - (!needBeRegistred && correctlyLoaded.contains(secondDll.at(index))) - ) - )) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"the second dll have failed: "+secondDll.at(index)); - secondDll_have_bug=true; - } - else - { - if(needBeRegistred) - correctlyLoaded << secondDll.at(index); - secondDll_is_loaded=true; - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"the second dll have been loaded: "+secondDll.at(index)); - } - secondDll_count++; - index++; - } + index=0; + bool importantDll_is_loaded=false,secondDll_is_loaded=false; + bool importantDll_have_bug=false,secondDll_have_bug=false; + int importantDll_count=0,secondDll_count=0; + while(index<importantDll.size()) + { + if(!RegisterShellExtDll(pluginPath+importantDll.at(index),needBeRegistred, + !( + (needBeRegistred) + || + (!needBeRegistred && correctlyLoaded.contains(importantDll.at(index))) + ) + )) + { + if(changeOfArchDetected) + { + setEnabled(needBeRegistred); + return; + } + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"the important dll have failed: "+importantDll.at(index)); + importantDll_have_bug=true; + } + else + { + importantDll_is_loaded=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the important dll have been loaded: "+importantDll.at(index)); + } + importantDll_count++; + index++; + } + index=0; + while(index<secondDll.size()) + { + if(!RegisterShellExtDll(pluginPath+secondDll.at(index),needBeRegistred, + !( + (needBeRegistred && allDllIsImportant) + || + (!needBeRegistred && correctlyLoaded.contains(secondDll.at(index))) + ) + )) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"the second dll have failed: "+secondDll.at(index)); + secondDll_have_bug=true; + } + else + { + secondDll_is_loaded=true; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"the second dll have been loaded: "+secondDll.at(index)); + } + secondDll_count++; + index++; + } - CatchState importantDll_state,secondDll_state; - if(importantDll_count==0) - { - if(needBeRegistred) - importantDll_state=Caught; - else - importantDll_state=Uncaught; - } - else - { - if(importantDll_is_loaded) - { - if(!importantDll_have_bug) - importantDll_state=Caught; - else - importantDll_state=Semiuncaught; - } - else - importantDll_state=Uncaught; - } - if(secondDll_count==0) - if(needBeRegistred) - secondDll_state=Caught; - else - secondDll_state=Uncaught; - else - { - if(secondDll_is_loaded) - { - if(!secondDll_have_bug) - secondDll_state=Caught; - else - secondDll_state=Semiuncaught; - } - else - secondDll_state=Uncaught; - } + Ultracopier::CatchState importantDll_state,secondDll_state; + if(importantDll_count==0) + { + if(needBeRegistred) + importantDll_state=Ultracopier::Caught; + else + importantDll_state=Ultracopier::Uncaught; + } + else + { + if(importantDll_is_loaded) + { + if(!importantDll_have_bug) + importantDll_state=Ultracopier::Caught; + else + importantDll_state=Ultracopier::Semiuncaught; + } + else + importantDll_state=Ultracopier::Uncaught; + } + if(secondDll_count==0) + if(needBeRegistred) + secondDll_state=Ultracopier::Caught; + else + secondDll_state=Ultracopier::Uncaught; + else + { + if(secondDll_is_loaded) + { + if(!secondDll_have_bug) + secondDll_state=Ultracopier::Caught; + else + secondDll_state=Ultracopier::Semiuncaught; + } + else + secondDll_state=Ultracopier::Uncaught; + } - if((importantDll_state==Uncaught && secondDll_state==Uncaught) || !needBeRegistred || (importantDll_count==0 && secondDll_count==0)) - emit newState(Uncaught); - else if(importantDll_state==Caught) - emit newState(Caught); - else - emit newState(Semiuncaught); - - if(!needBeRegistred) - correctlyLoaded.clear(); -} + if((importantDll_state==Ultracopier::Uncaught && secondDll_state==Ultracopier::Uncaught) || !needBeRegistred || (importantDll_count==0 && secondDll_count==0)) + emit newState(Ultracopier::Uncaught); + else if(importantDll_state==Ultracopier::Caught) + emit newState(Ultracopier::Caught); + else + emit newState(Ultracopier::Semiuncaught); -bool PluginLoader::checkExistsDll() -{ - if(dllChecked) - { - if(importantDll.size()>0 || secondDll.size()>0) - return true; - else - return false; - } - dllChecked=true; - - if(is64Bits) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"64Bits is important"); - importantDll << CATCHCOPY_DLL_64; - secondDll << CATCHCOPY_DLL_32; - } - else - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Information,"32Bits is important"); - importantDll << CATCHCOPY_DLL_32; - secondDll << CATCHCOPY_DLL_64; - } - - int index=0; - while(index<importantDll.size()) - { - if(!QFile::exists(pluginPath+importantDll.at(index)+NORMAL_EXT)) - { - if(!QFile::exists(pluginPath+importantDll.at(index)+SECOND_EXT)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"file not found, drop to the list: "+importantDll.at(index)); - importantDll.removeAt(index); - index--; - } - else - importantDll[index]+=SECOND_EXT; - } - else - importantDll[index]+=NORMAL_EXT; - index++; - } - index=0; - while(index<secondDll.size()) - { - if(!QFile::exists(pluginPath+secondDll.at(index)+NORMAL_EXT)) - { - if(!QFile::exists(pluginPath+secondDll.at(index)+SECOND_EXT)) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"file not found, drop to the list: "+secondDll.at(index)); - secondDll.removeAt(index); - index--; - } - else - secondDll[index]+=SECOND_EXT; - } - else - secondDll[index]+=NORMAL_EXT; - index++; - } - if(importantDll.size()>0 || secondDll.size()>0) - return true; - else - return false; + if(!needBeRegistred) + correctlyLoaded.clear(); } -void PluginLoader::setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion) +bool WindowsExplorerLoader::checkExistsDll() { - Q_UNUSED(options); - this->pluginPath=pluginPath; - this->optionsEngine=options; - if(optionsEngine!=NULL) - { - QList<QPair<QString, QVariant> > KeysList; - KeysList.append(qMakePair(QString("allDllIsImportant"),QVariant(false))); - KeysList.append(qMakePair(QString("Debug"),QVariant(false))); - optionsEngine->addOptionGroup(KeysList); - allDllIsImportant=optionsEngine->getOptionValue("allDllIsImportant").toBool(); - Debug=optionsEngine->getOptionValue("Debug").toBool(); - optionsWidget.setAllDllIsImportant(allDllIsImportant); - optionsWidget.setDebug(Debug); - } -} + if(dllChecked) + { + if(importantDll.size()>0 || secondDll.size()>0) + return true; + else + return false; + } + dllChecked=true; -bool PluginLoader::RegisterShellExtDll(QString dllPath, bool bRegister,bool quiet) -{ - if(Debug) - { - QString message; - if(bRegister) - message+=QString("Try load the dll: %1, and ").arg(dllPath); - else - message+=QString("Try unload the dll: %1, and ").arg(dllPath); - if(quiet) - message+=QString("don't open the UAC"); - else - message+=QString("open the UAC if needed"); - QMessageBox::information(NULL,"Debug",message); - } - ////////////////////////////// First way to load ////////////////////////////// - - wchar_t arrayArg[65535]; - int size_lenght; - // first try - load dll and register it manually. - HRESULT hResult = S_OK; - // if failed - try by loading extension manually (would fail on vista when running as user) - hResult = CoInitializeEx(NULL, COINIT_MULTITHREADED); - if(SUCCEEDED(hResult)) - { - HRESULT (STDAPICALLTYPE *pfn)(void); - size_lenght=dllPath.toWCharArray(arrayArg); - HINSTANCE hMod = LoadLibrary(arrayArg); // load the dll - if(hMod == NULL) - hResult = HRESULT_FROM_WIN32(GetLastError()); - if(SUCCEEDED(hResult) && !hMod) - hResult = E_FAIL; - if(SUCCEEDED(hResult)) - { - (FARPROC&)pfn = GetProcAddress(hMod, (bRegister ? "DllRegisterServer" : "DllUnregisterServer")); - if(pfn == NULL) - hResult = E_FAIL; - if(SUCCEEDED(hResult)) - hResult = (*pfn)(); - - CoFreeLibrary(hMod); - } - CoUninitialize(); - if(SUCCEEDED(hResult) && SCODE_CODE(hResult) != ERROR_ACCESS_DENIED) - return true; - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("fail by LoadLibrary: %1, error code: %2").arg(dllPath).arg((quint32)hResult)); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("fail by CoInitializeEx: %1, error code: %2").arg(dllPath).arg((quint32)hResult)); - - ////////////////////////////// Second way to load ////////////////////////////// - QStringList arguments; - if(!Debug) - arguments.append("/s"); - if(!bRegister) - arguments.append("/u"); - arguments.append(dllPath); - QString argumentsString; - for (int i = 0; i < arguments.size(); ++i) { - if(argumentsString.isEmpty()) - argumentsString+=arguments.at(i); - else - if(i == arguments.size()) - argumentsString+=" \""+arguments.at(i)+"\""; - else - argumentsString+=' '+arguments.at(i); - } - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: regsvr32 "+argumentsString); - int result=QProcess::execute("regsvr32",arguments); - bool ok=false; - if(result==0) - ok=true; - #if ! defined(_M_X64) - if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll - { - changeOfArchDetected=true; - QStringList temp; - temp = importantDll; - secondDll = importantDll; - importantDll = temp; - return false; - } - #endif - if(result==5) - { - if(!quiet || (!bRegister && correctlyLoaded.contains(dllPath))) - { - ////////////////////////////// Last way to load ////////////////////////////// - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"try it in win32"); - // try with regsvr32, win32 because for admin dialog + if(is64Bits) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"64Bits is important"); + importantDll << CATCHCOPY_DLL_64; + secondDll << CATCHCOPY_DLL_32; + } + else + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"32Bits is important"); + importantDll << CATCHCOPY_DLL_32; + secondDll << CATCHCOPY_DLL_64; + } - size_lenght=argumentsString.toWCharArray(arrayArg); - //size_lenght*sizeof(wchar_t) - wcscpy(arrayArg+size_lenght*sizeof(wchar_t),TEXT("\0")); - SHELLEXECUTEINFO sei; - memset(&sei, 0, sizeof(sei)); - sei.cbSize = sizeof(sei); - sei.fMask = SEE_MASK_UNICODE; - sei.lpVerb = TEXT("runas"); - sei.lpFile = TEXT("regsvr32.exe"); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght)); - sei.lpParameters = arrayArg; - sei.nShow = SW_SHOW; - ok=ShellExecuteEx(&sei); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"not try because need be quiet: "+dllPath); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("regsvr32 terminated with: %1").arg(result)); - correctlyLoaded.remove(dllPath); - if(!bRegister) - HardUnloadDLL(dllPath); - return ok; + int index=0; + while(index<importantDll.size()) + { + if(!QFile::exists(pluginPath+importantDll.at(index)+NORMAL_EXT)) + { + if(!QFile::exists(pluginPath+importantDll.at(index)+SECOND_EXT)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("file not found, drop to the list: %1 and %2").arg(pluginPath+importantDll.at(index)+NORMAL_EXT).arg(pluginPath+importantDll.at(index)+SECOND_EXT)); + importantDll.removeAt(index); + index--; + } + else + importantDll[index]+=SECOND_EXT; + } + else + importantDll[index]+=NORMAL_EXT; + index++; + } + index=0; + while(index<secondDll.size()) + { + if(!QFile::exists(pluginPath+secondDll.at(index)+NORMAL_EXT)) + { + if(!QFile::exists(pluginPath+secondDll.at(index)+SECOND_EXT)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("file not found, drop to the list: %1 and %2").arg(pluginPath+secondDll.at(index)+NORMAL_EXT).arg(pluginPath+secondDll.at(index)+SECOND_EXT)); + secondDll.removeAt(index); + index--; + } + else + secondDll[index]+=SECOND_EXT; + } + else + secondDll[index]+=NORMAL_EXT; + index++; + } + if(importantDll.size()>0 || secondDll.size()>0) + return true; + else + return false; } -Q_EXPORT_PLUGIN2(pluginLoader, PluginLoader); - -bool WINAPI PluginLoader::DLLEjecteurW(DWORD dwPid,PWSTR szDLLPath) +void WindowsExplorerLoader::setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion) { - /* Search address of module */ - MODULEENTRY32W meModule; - meModule.dwSize = sizeof(meModule); - HANDLE hSnapshot = NULL; - - hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwPid); - if(hSnapshot == NULL) - return false; - - /* Search the right modules of the process */ - Module32FirstW(hSnapshot, &meModule); - do{ - if((lstrcmpiW(meModule.szModule,szDLLPath) == 0) || (lstrcmpiW(meModule.szExePath,szDLLPath) == 0))break; - }while(Module32NextW(hSnapshot, &meModule)); - - /* Get handle of the process */ - HANDLE hProcess; - - hProcess = OpenProcess(PROCESS_ALL_ACCESS, false,dwPid); - if(hProcess == NULL) - { - CloseHandle(hSnapshot); - return false; - } - - LPTHREAD_START_ROUTINE lpthThreadFunction; - /* Get addresse of FreeLibrary in kernel32.dll */ - lpthThreadFunction = (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(L"kernel32.dll"), "FreeLibrary"); - if(lpthThreadFunction == NULL) - { - CloseHandle(hProcess); - CloseHandle(hSnapshot); - return false; - } - - /* Creation the remote thread */ - DWORD dwThreadID = 0; - HANDLE hThread = NULL; - hThread = CreateRemoteThread(hProcess, NULL, 0, lpthThreadFunction,meModule.modBaseAddr, 0, &dwThreadID); - if(hThread == NULL) - { - CloseHandle(hSnapshot); - CloseHandle(hProcess); - return false; - } - - WaitForSingleObject(hThread,INFINITE); - - CloseHandle(hProcess); - CloseHandle(hThread); - - return true; + Q_UNUSED(options); + Q_UNUSED(writePath); + Q_UNUSED(pluginPath); + Q_UNUSED(portableVersion); + #ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE + this->pluginPath=QCoreApplication::applicationDirPath()+"/"; + #else + this->pluginPath=pluginPath; + #endif + this->optionsEngine=options; + if(optionsEngine!=NULL) + { + QList<QPair<QString, QVariant> > KeysList; + KeysList.append(qMakePair(QStringLiteral("allDllIsImportant"),QVariant(false))); + KeysList.append(qMakePair(QStringLiteral("Debug"),QVariant(false))); + optionsEngine->addOptionGroup(KeysList); + allDllIsImportant=optionsEngine->getOptionValue("allDllIsImportant").toBool(); + Debug=optionsEngine->getOptionValue("Debug").toBool(); + optionsWidget->setAllDllIsImportant(allDllIsImportant); + optionsWidget->setDebug(Debug); + } } -void PluginLoader::HardUnloadDLL(QString myDllName) +bool WindowsExplorerLoader::RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet) { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start: "+myDllName); - HANDLE hSnapShot1; - PROCESSENTRY32 uProcess; - HANDLE hSnapShot2; - MODULEENTRY32 me32; - QString DllLoaded = ""; - QString DllLoadedName = ""; - QString DllLoadedPath = ""; - bool bResult; - bool r; - short NbProcess; - NbProcess=0; - - hSnapShot1 = CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); - - uProcess.dwSize = (DWORD) sizeof(PROCESSENTRY32); - - r = Process32First(hSnapShot1, &uProcess); + if(Debug) + { + QString message; + if(bRegister) + message+=QStringLiteral("Try load the dll: %1, and ").arg(dllPath); + else + message+=QStringLiteral("Try unload the dll: %1, and ").arg(dllPath); + if(quiet) + message+=QStringLiteral("don't open the UAC"); + else + message+=QStringLiteral("open the UAC if needed"); + QMessageBox::information(NULL,"Debug",message); + } + if(bRegister && correctlyLoaded.contains(dllPath)) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Try dual load: %1").arg(dllPath)); + return false; + } + ////////////////////////////// First way to load ////////////////////////////// + QStringList arguments; + if(!Debug) + arguments.append("/s"); + if(!bRegister) + arguments.append("/u"); + arguments.append(dllPath); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: regsvr32 "+arguments.join(" ")); + int result; + #ifdef Q_OS_WIN32 + QProcess process; + process.start("regsvr32",arguments); + if(!process.waitForStarted()) + result=985; + else if(!process.waitForFinished()) + result=984; + else + { + result=process.exitCode(); + QString out=QString::fromLocal8Bit(process.readAllStandardOutput()); + QString outError=QString::fromLocal8Bit(process.readAllStandardError()); + if(!out.isEmpty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 output: "+out); + if(!outError.isEmpty()) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"regsvr32 error output: "+outError); + } + #else + result=0; + #endif + bool ok=false; + if(result==0) + { + if(bRegister) + correctlyLoaded << dllPath; + ok=true; + } + #if ! defined(_M_X64) + if(result==999 && !changeOfArchDetected)//code of wrong arch for the dll + { + changeOfArchDetected=true; + QStringList temp; + temp = importantDll; + secondDll = importantDll; + importantDll = temp; + return false; + } + #endif + if(result==5) + { + if(!quiet || (!bRegister && correctlyLoaded.contains(dllPath))) + { + arguments.last()=QStringLiteral("\"%1\"").arg(arguments.last()); + ////////////////////////////// Last way to load ////////////////////////////// + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"try it in win32"); + // try with regsvr32, win32 because for admin dialog - while ( r ) - { - r = Process32Next(hSnapShot1, &uProcess); - QString myProcessName; - myProcessName=QString::fromWCharArray(uProcess.szExeFile); - if (uProcess.th32ProcessID < 99999) - { - hSnapShot2 = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, uProcess.th32ProcessID ); - if (hSnapShot2 != INVALID_HANDLE_VALUE) - { - me32.dwSize = sizeof(me32); - bResult = Module32First( hSnapShot2, &me32 ); - while( bResult ) - { - DllLoaded=QString::fromWCharArray(me32.szExePath); - DllLoadedName=QString::fromWCharArray(me32.szModule); - if (DllLoaded == myDllName) - { - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"The path: "+DllLoaded); - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - DLLEjecteurW(uProcess.th32ProcessID,me32.szExePath); - } - bResult = Module32Next( hSnapShot2, &me32 ); - } - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"(int)hSnapShot2 != -1 for "+myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - if(hSnapShot2) - CloseHandle(hSnapShot2); - } - else - ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"uProcess.th32ProcessID > 99999 for "+myProcessName+" ("+QString::number(uProcess.th32ProcessID)+")"); - } - CloseHandle(hSnapShot1); + #ifdef Q_OS_WIN32 + wchar_t arrayArg[65535]; + int size_lenght=arguments.join(" ").toWCharArray(arrayArg); + //size_lenght*sizeof(wchar_t) + wcscpy(arrayArg+size_lenght*sizeof(wchar_t),TEXT("\0")); + SHELLEXECUTEINFO sei; + memset(&sei, 0, sizeof(sei)); + sei.cbSize = sizeof(sei); + sei.fMask = SEE_MASK_UNICODE; + sei.lpVerb = TEXT("runas"); + sei.lpFile = TEXT("regsvr32.exe"); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"in win32 mode: arrayArg: "+QString::fromWCharArray(arrayArg,size_lenght)); + sei.lpParameters = arrayArg; + sei.nShow = SW_SHOW; + ok=ShellExecuteEx(&sei); + #else + ok=true; + #endif + if(ok && bRegister) + correctlyLoaded << dllPath; + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"not try because need be quiet: "+dllPath); + } + else + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("regsvr32 terminated with: %1").arg(result)); + if(!bRegister) + correctlyLoaded.remove(dllPath); + return ok; } /// \brief to get the options widget, NULL if not have -QWidget * PluginLoader::options() +QWidget * WindowsExplorerLoader::options() { - return &optionsWidget; + return optionsWidget; } -void PluginLoader::newLanguageLoaded() +void WindowsExplorerLoader::newLanguageLoaded() { - optionsWidget.retranslate(); + optionsWidget->retranslate(); } -void PluginLoader::setAllDllIsImportant(bool allDllIsImportant) +void WindowsExplorerLoader::setAllDllIsImportant(bool allDllIsImportant) { - this->allDllIsImportant=allDllIsImportant; - optionsEngine->setOptionValue("allDllIsImportant",allDllIsImportant); + this->allDllIsImportant=allDllIsImportant; + optionsEngine->setOptionValue("allDllIsImportant",allDllIsImportant); } -void PluginLoader::setDebug(bool Debug) +void WindowsExplorerLoader::setDebug(bool Debug) { - this->Debug=Debug; - optionsEngine->setOptionValue("Debug",Debug); + this->Debug=Debug; + optionsEngine->setOptionValue("Debug",Debug); } diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h index 79ba305..0246cd1 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.h @@ -1,67 +1,63 @@ /** \file pluginLoader.h \brief Define the plugin loader \author alpha_one_x86 -\version 0.3 -\date 2010 */ +\licence GPL3, see the file COPYING */ #ifndef PLUGIN_LOADER_TEST_H #define PLUGIN_LOADER_TEST_H #include <QObject> -#include <QtCore> #include <QMessageBox> #include <QString> #include <QStringList> #include <QProcess> #include <QSet> -#include <windows.h> -#include <tlhelp32.h> +#ifdef Q_OS_WIN32 + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include <windows.h> + #include <tlhelp32.h> +#endif #include "../../../interface/PluginInterface_PluginLoader.h" #include "Environment.h" #include "OptionsWidget.h" /// \brief \brief Define the plugin loader -class PluginLoader : public PluginInterface_PluginLoader +class WindowsExplorerLoader : public PluginInterface_PluginLoader { - Q_OBJECT - Q_INTERFACES(PluginInterface_PluginLoader) + Q_OBJECT + Q_PLUGIN_METADATA(IID "first-world.info.ultracopier.PluginInterface.PluginLoader/1.0.0.0" FILE "plugin.json") + Q_INTERFACES(PluginInterface_PluginLoader) public: - PluginLoader(); - ~PluginLoader(); - /// \brief try enable/disable the catching - void setEnabled(bool); - /// \brief to set resources, writePath can be empty if read only mode - void setResources(OptionInterface * options,QString writePath,QString pluginPath,bool portableVersion); - /// \brief to get the options widget, NULL if not have - QWidget * options(); + WindowsExplorerLoader(); + ~WindowsExplorerLoader(); + /// \brief try enable/disable the catching + void setEnabled(const bool &needBeRegistred); + /// \brief to set resources, writePath can be empty if read only mode + void setResources(OptionInterface * options,const QString &writePath,const QString &pluginPath,const bool &portableVersion); + /// \brief to get the options widget, NULL if not have + QWidget * options(); public slots: - /// \brief to reload the translation, because the new language have been loaded - void newLanguageLoaded(); + /// \brief to reload the translation, because the new language have been loaded + void newLanguageLoaded(); private: - QString pluginPath; - QStringList importantDll,secondDll; - QSet<QString> correctlyLoaded; - bool RegisterShellExtDll(QString dllPath, bool bRegister,bool quiet); - bool checkExistsDll(); - bool dllChecked; - bool needBeRegistred; - bool WINAPI DLLEjecteurW(DWORD dwPid,PWSTR szDLLPath); - void HardUnloadDLL(QString myDllName); - OptionInterface * optionsEngine; - OptionsWidget optionsWidget; - bool allDllIsImportant,Debug; - bool changeOfArchDetected,is64Bits; -signals: - void newState(CatchState); - #ifdef ULTRACOPIER_PLUGIN_DEBUG - /// \brief To debug source - void debugInformation(DebugLevel level,QString fonction,QString text,QString file,int ligne); - #endif + QString pluginPath; + QStringList importantDll,secondDll; + QSet<QString> correctlyLoaded; + bool RegisterShellExtDll(const QString &dllPath, const bool &bRegister,const bool &quiet); + bool checkExistsDll(); + bool dllChecked; + bool needBeRegistred; + OptionInterface * optionsEngine; + OptionsWidget *optionsWidget; + bool allDllIsImportant,Debug; + bool changeOfArchDetected,is64Bits; private slots: - void setAllDllIsImportant(bool allDllIsImportant); - void setDebug(bool Debug); + void setAllDllIsImportant(bool allDllIsImportant); + void setDebug(bool Debug); }; #endif // PLUGIN_LOADER_TEST_H diff --git a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro index f383793..0d11721 100755..100644 --- a/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro +++ b/plugins/PluginLoader/catchcopy-v0002/pluginLoader.pro @@ -1,3 +1,8 @@ +CONFIG += c++11
+QMAKE_CXXFLAGS+="-std=c++0x -Wall -Wextra"
+mac:QMAKE_CXXFLAGS+="-stdlib=libc++"
+
+QT += widgets
TEMPLATE = lib
CONFIG += plugin
HEADERS = \
@@ -13,27 +18,33 @@ SOURCES = \ pluginLoader.cpp \
OptionsWidget.cpp
TARGET = $$qtLibraryTarget(pluginLoader)
-TRANSLATIONS += Languages/fr/translation.ts \
- Languages/ar/translation.ts \
- Languages/zh/translation.ts \
- Languages/es/translation.ts \
+TRANSLATIONS += Languages/ar/translation.ts \
Languages/de/translation.ts \
Languages/el/translation.ts \
+ Languages/en/translation.ts \
+ Languages/es/translation.ts \
+ Languages/fr/translation.ts \
+ Languages/hi/translation.ts \
+ Languages/hu/translation.ts \
+ Languages/id/translation.ts \
Languages/it/translation.ts \
Languages/ja/translation.ts \
- Languages/id/translation.ts \
- Languages/pl/translation.ts \
- Languages/ru/translation.ts \
- Languages/tr/translation.ts \
- Languages/th/translation.ts \
- Languages/hi/translation.ts \
+ Languages/ko/translation.ts \
Languages/nl/translation.ts \
Languages/no/translation.ts \
+ Languages/pl/translation.ts \
Languages/pt/translation.ts \
- Languages/ko/translation.ts
+ Languages/ru/translation.ts \
+ Languages/th/translation.ts \
+ Languages/tr/translation.ts \
+ Languages/zh/translation.ts
-LIBS += -lole32
+win32:LIBS += -lole32 -lshell32
FORMS += \
OptionsWidget.ui
+CONFIG(static, static|shared) {
+DEFINES += ULTRACOPIER_PLUGIN_ALL_IN_ONE
+}
+
|