summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db3x_autobackups/backup.c14
-rw-r--r--db3x_autobackups/commonheaders.h16
-rw-r--r--db3x_autobackups/db3x_mmap.dsp4
-rw-r--r--db3x_autobackups/db3x_mmap.vcproj4
-rw-r--r--db3x_autobackups/db3x_mmap_8.vcproj11
-rw-r--r--db3x_autobackups/dbsettings.c14
-rw-r--r--db3x_autobackups/options.c32
-rw-r--r--db3x_autobackups/version.h6
8 files changed, 43 insertions, 58 deletions
diff --git a/db3x_autobackups/backup.c b/db3x_autobackups/backup.c
index 43ef4fb..da8d9d5 100644
--- a/db3x_autobackups/backup.c
+++ b/db3x_autobackups/backup.c
@@ -76,7 +76,7 @@ int RotateBackups(HWND progress_dialog, DWORD start_time) {
itoa(options.num_backups - 1, num1, 10);
strcat(backupfilename1, num1);
strcat(backupfilename1, ".dat");
- DeleteFile(backupfilename1);
+ DeleteFileA(backupfilename1);
for(i = options.num_backups - 1; i > 0 && GetWindowLong(progress_dialog, GWL_USERDATA) == 0; i--) {
strcpy(backupfilename1, options.folder);
@@ -91,7 +91,7 @@ int RotateBackups(HWND progress_dialog, DWORD start_time) {
strcat(backupfilename2, num2);
strcat(backupfilename2, ".dat");
- MoveFile(backupfilename1, backupfilename2);
+ MoveFileA(backupfilename1, backupfilename2);
if(GetTickCount() - start_time >= SHOW_PROGRESS_TIME)
ShowWindow(progress_dialog, SW_SHOW);
@@ -122,7 +122,7 @@ int Backup() {
DWORD start_time = GetTickCount();
// ensure the backup folder exists (either create it or return non-zero signifying error)
- if(!CreateDirectory(options.folder, 0)) {
+ if(!CreateDirectoryA(options.folder, 0)) {
DWORD err = GetLastError();
if(err != ERROR_ALREADY_EXISTS) {
return 1;
@@ -132,7 +132,7 @@ int Backup() {
if(!options.disable_progress) {
progress_dialog = CreateDialog(g_hInst, MAKEINTRESOURCE(IDD_COPYPROGRESS), 0, DlgProcProgress);
prog = GetDlgItem(progress_dialog, IDC_PROGRESS);
- SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, Translate("Rotating backup files..."));
+ SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Rotating backup files..."));
}
@@ -141,11 +141,11 @@ int Backup() {
strcpy(backup_filename, options.folder);
strcat(backup_filename, "\\db_backup0.dat");
- hBackupFile = CreateFile(backup_filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
+ hBackupFile = CreateFileA(backup_filename, GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if(hBackupFile != INVALID_HANDLE_VALUE) {
if(!options.disable_progress) {
- SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, Translate("Copying database file..."));
+ SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
SendMessage(prog, PBM_SETPOS, (WPARAM)(int)(0), 0);
UpdateWindow(progress_dialog);
}
@@ -201,7 +201,7 @@ int Backup() {
CloseHandle(hBackupFile);
if(!options.disable_progress && GetWindowLong(progress_dialog, GWL_USERDATA) != 0)
- DeleteFile(backup_filename);
+ DeleteFileA(backup_filename);
else
DBWriteContactSettingDword(0, "db3x", "LastBackupTimestamp", (DWORD)time(0));
diff --git a/db3x_autobackups/commonheaders.h b/db3x_autobackups/commonheaders.h
index 0fc6dc3..4c86eb3 100644
--- a/db3x_autobackups/commonheaders.h
+++ b/db3x_autobackups/commonheaders.h
@@ -24,22 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MIRANDA_VER 0x0700
#define _WIN32_WINNT 0x0501
-#include <windows.h>
-
-#include <malloc.h>
-
-#if defined( UNICODE ) && !defined( _UNICODE )
- #define _UNICODE
-#endif
-#include <tchar.h>
-#ifdef _DEBUG
- #define _ALPHA_BASE_ 1 // defined for CVS builds
- #define _ALPHA_FUSE_ 1 // defined for fuse powered core
- #define _CRTDBG_MAP_ALLOC
- #include <stdlib.h>
-#endif
+#include "m_stdhdr.h"
+#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
#include <string.h>
diff --git a/db3x_autobackups/db3x_mmap.dsp b/db3x_autobackups/db3x_mmap.dsp
index 0d57355..5a6e402 100644
--- a/db3x_autobackups/db3x_mmap.dsp
+++ b/db3x_autobackups/db3x_mmap.dsp
@@ -25,8 +25,8 @@ CFG=db3x_mmap - Win32 Debug Unicode
# Begin Project
# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""$/Miranda/miranda/plugins/db3x_mmap", WKIAAAAA"
-# PROP Scc_LocalPath "."
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
diff --git a/db3x_autobackups/db3x_mmap.vcproj b/db3x_autobackups/db3x_mmap.vcproj
index eac78fe..1366ca2 100644
--- a/db3x_autobackups/db3x_mmap.vcproj
+++ b/db3x_autobackups/db3x_mmap.vcproj
@@ -5,9 +5,7 @@
Name="db3x_mmap"
ProjectGUID="{20D781FB-4A20-4B75-B863-304A47182966}"
SccProjectName=""
- SccAuxPath=""
- SccLocalPath=""
- SccProvider="">
+ SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
diff --git a/db3x_autobackups/db3x_mmap_8.vcproj b/db3x_autobackups/db3x_mmap_8.vcproj
index a3c18c2..f7a490b 100644
--- a/db3x_autobackups/db3x_mmap_8.vcproj
+++ b/db3x_autobackups/db3x_mmap_8.vcproj
@@ -5,6 +5,8 @@
Name="db3x_mmap"
ProjectGUID="{20D781FB-4A20-4B75-B863-304A47182966}"
RootNamespace="db3x_mmap"
+ SccProjectName=""
+ SccLocalPath=""
>
<Platforms>
<Platform
@@ -19,7 +21,6 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -75,6 +76,7 @@
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/dbx_mmap.dll"
+ LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
GenerateMapFile="false"
@@ -110,7 +112,6 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
@@ -212,7 +213,6 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
@@ -270,6 +270,7 @@
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/dbx_mmap.dll"
+ LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
@@ -306,7 +307,6 @@
OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
@@ -335,9 +335,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="3"
- InlineFunctionExpansion="2"
+ InlineFunctionExpansion="1"
FavorSizeOrSpeed="2"
- OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories="../../include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DB3X_EXPORTS"
diff --git a/db3x_autobackups/dbsettings.c b/db3x_autobackups/dbsettings.c
index e111918..518cff3 100644
--- a/db3x_autobackups/dbsettings.c
+++ b/db3x_autobackups/dbsettings.c
@@ -230,14 +230,14 @@ static __inline int GetContactSettingWorker(HANDLE hContact,DBCONTACTGETSETTING
if ( settingNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("GetContactSettingWorker() got a > 255 setting name length. \n");
+ OutputDebugStringA("GetContactSettingWorker() got a > 255 setting name length. \n");
#endif
return 1;
}
if ( moduleNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("GetContactSettingWorker() got a > 255 module name length. \n");
+ OutputDebugStringA("GetContactSettingWorker() got a > 255 module name length. \n");
#endif
return 1;
}
@@ -553,14 +553,14 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam)
if ( settingNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("WriteContactSetting() got a > 255 setting name length. \n");
+ OutputDebugStringA("WriteContactSetting() got a > 255 setting name length. \n");
#endif
return 1;
}
if ( moduleNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("WriteContactSetting() got a > 255 module name length. \n");
+ OutputDebugStringA("WriteContactSetting() got a > 255 module name length. \n");
#endif
return 1;
}
@@ -590,7 +590,7 @@ static int WriteContactSetting(WPARAM wParam,LPARAM lParam)
{ int len = ( dbcws->value.type != DBVT_BLOB ) ? strlen(dbcws->value.pszVal) : dbcws->value.cpbVal;
if ( len >= 0xFFFF ) {
#ifdef _DEBUG
- OutputDebugString("WriteContactSetting() writing huge string/blob, rejecting ( >= 0xFFFF ) \n");
+ OutputDebugStringA("WriteContactSetting() writing huge string/blob, rejecting ( >= 0xFFFF ) \n");
#endif
return 1;
}
@@ -819,14 +819,14 @@ static int DeleteContactSetting(WPARAM wParam,LPARAM lParam)
if ( settingNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("DeleteContactSetting() got a > 255 setting name length. \n");
+ OutputDebugStringA("DeleteContactSetting() got a > 255 setting name length. \n");
#endif
return 1;
}
if ( moduleNameLen > 0xFE )
{
#ifdef _DEBUG
- OutputDebugString("DeleteContactSetting() got a > 255 module name length. \n");
+ OutputDebugStringA("DeleteContactSetting() got a > 255 module name length. \n");
#endif
return 1;
}
diff --git a/db3x_autobackups/options.c b/db3x_autobackups/options.c
index b6e7034..5dfd428 100644
--- a/db3x_autobackups/options.c
+++ b/db3x_autobackups/options.c
@@ -45,13 +45,13 @@ int BackupService(WPARAM wParam, LPARAM lParam);
int SetBackupTimer(void);
int LoadOptions(void) {
- DBVARIANT dbv;
+ DBVARIANT dbv = {0};
options.backup_types = (BackupType)DBGetContactSettingByte(0, "db3x", "BackupType", (BYTE)(BT_EXIT | BT_PERIODIC));
options.period = (unsigned int)DBGetContactSettingWord(0, "db3x", "Period", 1);
options.period_type = (PeriodType)DBGetContactSettingByte(0, "db3x", "PeriodType", (BYTE)PT_DAYS);
- if(!DBGetContactSetting(0, "db3x", "Folder", &dbv) && dbv.type == DBVT_ASCIIZ) {
+ if(!DBGetContactSettingString(0, "db3x", "Folder", &dbv) && dbv.type == DBVT_ASCIIZ) {
if(strlen(dbv.pszVal) >= 2 && dbv.pszVal[1] == ':') {
strncpy(options.folder, dbv.pszVal, MAX_PATH);
} else {
@@ -135,7 +135,7 @@ int SetDlgState(HWND hwndDlg) {
EnableWindow(hwndCtrl, new_options.backup_types & BT_PERIODIC);
}
- SetDlgItemText(hwndDlg, IDC_ED_PERIOD, itoa(new_options.period, buff, 10));
+ SetDlgItemTextA(hwndDlg, IDC_ED_PERIOD, itoa(new_options.period, buff, 10));
switch(new_options.period_type) {
case PT_DAYS:
@@ -148,9 +148,9 @@ int SetDlgState(HWND hwndDlg) {
break;
}
- SetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, itoa(new_options.num_backups, buff, 10));
+ SetDlgItemTextA(hwndDlg, IDC_ED_NUMBACKUPS, itoa(new_options.num_backups, buff, 10));
- SetDlgItemText(hwndDlg, IDC_ED_FOLDER, new_options.folder);
+ SetDlgItemTextA(hwndDlg, IDC_ED_FOLDER, new_options.folder);
CheckDlgButton(hwndDlg, IDC_CHK_NOPROG, new_options.disable_progress ? BST_CHECKED : BST_UNCHECKED);
@@ -161,7 +161,7 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
char buff[10];
char folder_buff[MAX_PATH];
- BROWSEINFO bi;
+ BROWSEINFOA bi;
LPCITEMIDLIST pidl;
switch ( msg ) {
@@ -231,9 +231,9 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
bi.lParam = 0;
bi.iImage = 0;
- if((pidl = SHBrowseForFolder(&bi)) != 0) {
- SHGetPathFromIDList(pidl, folder_buff);
- SetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff);
+ if((pidl = SHBrowseForFolderA(&bi)) != 0) {
+ SHGetPathFromIDListA(pidl, folder_buff);
+ SetDlgItemTextA(hwndDlg, IDC_ED_FOLDER, folder_buff);
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
CoTaskMemFree((void *)pidl);
@@ -252,20 +252,20 @@ BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_NOTIFY:
if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
- GetDlgItemText(hwndDlg, IDC_ED_PERIOD, buff, sizeof(buff));
+ GetDlgItemTextA(hwndDlg, IDC_ED_PERIOD, buff, sizeof(buff));
new_options.period = atoi(buff);
- GetDlgItemText(hwndDlg, IDC_ED_NUMBACKUPS, buff, sizeof(buff));
+ GetDlgItemTextA(hwndDlg, IDC_ED_NUMBACKUPS, buff, sizeof(buff));
new_options.num_backups = atoi(buff);
- GetDlgItemText(hwndDlg, IDC_ED_FOLDER, folder_buff, MAX_PATH);
+ GetDlgItemTextA(hwndDlg, IDC_ED_FOLDER, folder_buff, MAX_PATH);
{
BOOL folder_ok = TRUE;
- if(!CreateDirectory(folder_buff, 0)) {
+ if(!CreateDirectoryA(folder_buff, 0)) {
DWORD err = GetLastError();
if(err != ERROR_ALREADY_EXISTS) {
char msg_buff[512];
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0);
- MessageBox(0, msg_buff, Translate("Error Creating Backup Folder"), MB_OK | MB_ICONERROR);
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, err, 0, msg_buff, 512, 0);
+ MessageBoxA(0, msg_buff, Translate("Error Creating Backup Folder"), MB_OK | MB_ICONERROR);
folder_ok = FALSE;
}
}
@@ -295,7 +295,7 @@ int OptInit(WPARAM wParam, LPARAM lParam) {
odp.cbSize = OPTIONPAGE_OLD_SIZE2;
odp.position = -790000000;
odp.hInstance = g_hInst;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS);
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
odp.pszTitle = Translate("Database Backups");
odp.pszGroup = Translate("Services");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/db3x_autobackups/version.h b/db3x_autobackups/version.h
index 16fcf0a..6bea6ad 100644
--- a/db3x_autobackups/version.h
+++ b/db3x_autobackups/version.h
@@ -1,3 +1,3 @@
-#define __FILEVERSION_STRING 0,7,5,0
-#define __VERSION_STRING "0.7.5.0"
-#define __VERSION_DWORD 0x00070500
+#define __FILEVERSION_STRING 0,7,5,1
+#define __VERSION_STRING "0.7.5.1"
+#define __VERSION_DWORD 0x00070501