summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Common.h
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-22 21:06:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-22 21:06:15 +0000
commit36e1481e95302d388cc834405dd7b0e5eb27747b (patch)
tree8d1226ee91d905bf9c08e8862df0a432e27df967 /plugins/PluginUpdater/src/Common.h
parent763c87a6be8344d1a3950d2ba133840c7c25c596 (diff)
PluginUpdater:
- separating flies from cutlets; - Update dialog stores the state of each file; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Common.h')
-rw-r--r--plugins/PluginUpdater/src/Common.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h
index 8c101c5e84..5011421482 100644
--- a/plugins/PluginUpdater/src/Common.h
+++ b/plugins/PluginUpdater/src/Common.h
@@ -72,9 +72,9 @@ struct FILEURL
struct FILEINFO
{
- TCHAR tszOldName[MAX_PATH], tszNewName[MAX_PATH];
+ TCHAR tszOldName[MAX_PATH], tszNewName[MAX_PATH];
FILEURL File;
- BOOL bEnabled, bDeleteOnly;
+ BOOL bEnabled, bDeleteOnly;
};
typedef OBJLIST<FILEINFO> FILELIST;
@@ -147,17 +147,51 @@ INT_PTR MenuCommand(WPARAM wParam,LPARAM lParam);
INT_PTR ShowListCommand(WPARAM wParam,LPARAM lParam);
INT_PTR EmptyFolder(WPARAM wParam,LPARAM lParam);
-INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgMsgPop(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+int ImageList_AddIconFromIconLib(HIMAGELIST hIml, const char *name);
+
bool unzip(const TCHAR *ptszZipFile, TCHAR *ptszDestPath, TCHAR *ptszBackPath);
void strdel(TCHAR *parBuffer, int len);
-//////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+struct ServListEntry
+{
+ ServListEntry(const char* _name, const char* _hash, int _crc) :
+ m_name( mir_a2t(_name)),
+ m_bNeedFree(true),
+ m_crc(_crc)
+ {
+ strncpy(m_szHash, _hash, sizeof(m_szHash));
+ }
+
+ ServListEntry(TCHAR* _name) :
+ m_name(_name),
+ m_bNeedFree(false)
+ {
+ }
+
+ ~ServListEntry()
+ {
+ if (m_bNeedFree)
+ mir_free(m_name);
+ }
+
+ TCHAR *m_name;
+ char m_szHash[32+1];
+ bool m_bNeedFree;
+ int m_crc;
+};
+
+typedef OBJLIST<ServListEntry> SERVLIST;
+
+///////////////////////////////////////////////////////////////////////////////
+int CalculateModuleHash(const TCHAR *tszFileName, char *dest);
BOOL IsRunAsAdmin();
BOOL IsProcessElevated();
+bool PrepareEscalation();
int SafeCreateDirectory(const TCHAR *ptszDirName);
int SafeCopyFile(const TCHAR *ptszSrc, const TCHAR *ptszDst);