summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/Import_SA
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mmap_SA/Import_SA')
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/ICQserver.c73
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/ICQserver.h62
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/Version.rc38
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/docs/import-ICQ_Db_Specs.txt1004
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/docs/import-license.txt340
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/docs/import-readme.txt128
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/docs/import-translation.txt55
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/encryption.c315
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.dep110
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.dsp238
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.dsw29
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.h118
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import.mak516
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa.vcproj616
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj642
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters91
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_8.vcproj552
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/import_sa_9.vcproj998
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/main.c553
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.c1492
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirabilis.h200
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/miranda.c1502
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirandadb0700.h148
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c208
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/progress.c103
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/res/import.icobin0 -> 9574 bytes
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/res/pass.icobin0 -> 8550 bytes
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/resource.h68
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/resource.rc322
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/version.h22
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/wizard.c215
31 files changed, 10758 insertions, 0 deletions
diff --git a/plugins/Dbx_mmap_SA/Import_SA/ICQserver.c b/plugins/Dbx_mmap_SA/Import_SA/ICQserver.c
new file mode 100644
index 0000000000..62666c7531
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/ICQserver.c
@@ -0,0 +1,73 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+// ==============
+// == INCLUDES ==
+// ==============
+
+#include "import.h"
+
+#include "ICQserver.h"
+
+// ====================
+// ====================
+// == IMPLEMENTATION ==
+// ====================
+// ====================
+
+BOOL CALLBACK ICQserverPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ SendMessage(GetParent(hdlg),WIZM_DISABLEBUTTON,0,0);
+ SendMessage(GetParent(hdlg),WIZM_ENABLEBUTTON,1,0);
+ SendMessage(GetParent(hdlg),WIZM_DISABLEBUTTON,2,0);
+ TranslateDialogDefault(hdlg);
+ ICQserverImport();
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_FINISHED,(LPARAM)FinishedPageProc);
+ break;
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg),WM_CLOSE,0,0);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static void ICQserverImport()
+{
+ // Clear last update stamp
+ DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvLastUpdate");
+ DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvRecordCount");
+
+ // Enable contacts downloading
+ DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerCList", 1);
+ DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "AddServerNew", 1);
+ DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerNicks", 1);
+ DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "ServerAddRemove", 1);
+}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/ICQserver.h b/plugins/Dbx_mmap_SA/Import_SA/ICQserver.h
new file mode 100644
index 0000000000..864890a978
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/ICQserver.h
@@ -0,0 +1,62 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001,2002,2003,2004 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+
+
+#ifndef ICQSERVER_H
+#define ICQSERVER_H
+
+#include <windows.h>
+
+// ======================
+// == GLOBAL FUNCTIONS ==
+// ======================
+
+// =====================
+// == LOCAL FUNCTIONS ==
+// =====================
+
+// Main function
+static void ICQserverImport();
+
+// GUI callbacks
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+
+// ======================
+// == GLOBAL VARIABLES ==
+// ======================
+
+extern int cICQAccounts;
+extern char ** szICQModuleName;
+extern TCHAR ** tszICQAccountName;
+extern int iICQAccount;
+
+// =====================
+// == LOCAL VARIABLES ==
+// =====================
+
+// =============
+// == DEFINES ==
+// =============
+
+#endif \ No newline at end of file
diff --git a/plugins/Dbx_mmap_SA/Import_SA/Version.rc b/plugins/Dbx_mmap_SA/Import_SA/Version.rc
new file mode 100644
index 0000000000..4784a68f66
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/Version.rc
@@ -0,0 +1,38 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "afxres.h"
+#include "version.h"
+
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#endif //_WIN32
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION __FILEVERSION_STRING
+ PRODUCTVERSION __FILEVERSION_STRING
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x0L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "FileDescription", __DESCRIPTIONSHORT
+ VALUE "InternalName", __PLUGIN_NAME
+ VALUE "LegalCopyright", __COPYRIGHT
+ VALUE "OriginalFilename", __FILENAME
+ VALUE "ProductName", __PLUGIN_NAME
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0, 1200
+ END
+END
diff --git a/plugins/Dbx_mmap_SA/Import_SA/docs/import-ICQ_Db_Specs.txt b/plugins/Dbx_mmap_SA/Import_SA/docs/import-ICQ_Db_Specs.txt
new file mode 100644
index 0000000000..7308d85f9b
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/docs/import-ICQ_Db_Specs.txt
@@ -0,0 +1,1004 @@
+
+The latest version of this document is always at:
+http://cvs.sourceforge.net/viewcvs.py/miranda-icq/Plugins/import/docs/import-ICQ_Db_Specs.txt
+
+============================================================================
+= ICQ_Db_Specs.txt -- Updated 2002-07-08
+=
+= This document describes parts of the fileformat used by the databases in
+= ICQ 99a - 2002a and is based on the 99a & 99b database specifications as
+= described in "ICQNEWDB.TXT" by Derek Soeder.
+=
+= Current maintainer: Strickz (strickz at miranda-im.org)
+=
+=
+=
+= To understand the file format as a whole it is also necessary to read
+= icqnewdb.txt and icqprop.txt. I have tried to use the same syntax in
+= this document to make it easier to understand and compare the different
+= parts.
+=
+= The information in this document is in no way guaranteed to be correct, use
+= at own your own risk and feel free to send me any corrections you may have.
+=
+============================================================================
+
+
+
+***
+*** File Headers
+***
+
+
+ ================================================================
+ == Format of IDX main header (20 BYTES):
+ ================================================================
+ 00000000 3 LONGS Unknown, but always 4, 20, 8.
+ (04,00,00,00,14h,00,00,00,08,00,00,00)
+ 0000000C LONG IDX pointer to root entry
+ 00000010 LONG ICQ database version
+ 10 = ICQ 99a
+ 14 = ICQ 99b
+ 17 = ICQ 2000a
+ 18 = ICQ 2000b
+ 19 = ICQ 2001a,2001b,2002a,2003a
+ 00000014 --- Start of first IDX page header
+
+
+ ================================================================
+ == Format of IDX page header (205 BYTES):
+ ================================================================
+ 00000000 5 LONGS Unknown, but always 201, 0, 0, 0, 0.
+ 00000014 LONG Pointer to next page header. -1 if this is the
+ last page.
+ 00000018 LONG Unknown, always 1?
+ 0000001C LONG Number of bytes in each slot (20)
+ 00000020 LONG Number of fragments in the page with one
+ or more consecutive free slots.
+ 00000024 LONG Number of empty slots in this page.
+ 00000028 10 LONGS Unknown, always 0?
+ 00000050 125 BYTES Allocation bitmap
+ 000000CD --- 1000 list entries (slots)
+
+
+ Notes by Derek:
+ --------------
+ Apparently, if you start at the root entry and walk the chain via
+ the LONG at offset +8 in each following IDX entry, you'll eventually
+ arrive at a complete chain of valid entries (entry status = -2).
+
+ Notes by Strickz:
+ ----------------
+ Initially an IDX file is 20225 bytes large: 20 bytes main header + 205 bytes
+ (first page header) + 20000 bytes (first IDX page). The file is always resized
+ in blocks of 20205 bytes (one page with header), I'm guessing this isn't done
+ until some data wants to be written and there is no fragment large enough to
+ hold it.
+
+ Offset 0c64: This is a bitmap that shows the status of all slots in the
+ page. Each page is divided into 1000 slots which requires a bitmap of
+ 1000/8 = 225 bytes. It would probably be possible to go through all entries in
+ the database by using the bitmap directly, page by page, instead of traversing
+ the chain.
+
+ Offset 0x20: I don't really see what practical use this value has. It can be
+ used as a measurement of the degree of fragmentation of the page, but keeping this
+ updated each write should slow things down... And it offers no speed-up
+ either, to write something to a page you still have to scan for a fragment large
+ enough for your data.
+
+
+ ================================================================
+ == Format of IDX linked list entry (20 BYTES each):
+ ================================================================
+
+ 00000000 LONG entry status? :
+ -2 = valid IDX entry
+ else = ?
+ 00000004 LONG DAT entry number:
+ 1..15 = ???a
+ 1005 = My Details
+ 1006 = Address Book?
+ 1007 = Sound themes
+ 1009 Unknown, about 222 bytes of binary data. I don't
+ recognize the data yet but there is a pattern.
+ 1014 = Chats event folder?
+ 1015 = A list of nicks with some data
+ 1025 = Looks related to Message archive. Contains several lists,
+ System, Sent & Received, From Web, Messages, etc... Lists
+ contains nicks or UINs with some data attached.
+ 1050 = Unknown
+ 1051 = Unknown
+ 1052 = Unknown
+ 1100 = Unknown
+ 1101 = Looks likes external app info
+ 1102 = Objectionable Words List?
+ 1110 = ICQ Servers List
+ 2001+ = user events/contact info
+ 00000008 LONG IDX pointer to next entry (-1 = none)
+ 0000000C LONG IDX pointer to previous entry (-1 = none)
+ 00000010 LONG DAT pointer to corresponding DAT entry (-1 = none)
+
+
+ Notes by Strickz:
+ ----------------
+ The chain is not a simple double linked list, there are several smaller chains that
+ merge into the main chain at different points.
+ The root entry has a DAT-ptr that doesn't point into the DAT file, if you use it
+ with the IDX file you arrive at a chain fragment that end up in the main chain.
+
+ All entries with status -2 points to a entry in the DAT file.
+
+
+ ===============================================================
+ == Format of DAT main header (8 BYTES):
+ ================================================================
+ 00000000 2 LONG Unknown, but always 4, 8.
+ (04,00,00,00,08,00,00,00)
+ 00000008 --- Start of first DAT page header
+
+
+ ================================================================
+ == Format of DAT page header (205 BYTES):
+ ================================================================
+ 00000000 6 LONGS Unknown, but always 201, 0, 0, 0, 0, 0.
+ 00000014 LONG Pointer to next page header. -1 if this is the
+ last page.
+ 00000018 LONG Unknown, always 0?
+ 0000001C LONG Number of bytes in each slot (64)
+ 00000020 LONG Number of fragments in the page with one
+ or more consecutive free slots.
+ 00000024 LONG Number of empty slots in this page
+ 00000028 10 LONGS Unknown, always 0?
+ 00000050 125 BYTES Allocation bitmap
+ 000000CD --- One page of DAT entries
+
+
+
+***
+*** My details
+***
+
+
+ ================================================================
+ == Format of My Details v99a (ICQ 99a) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed? (-1 = MyDetails)
+ 00000008 LONG DAT entry number = 1005
+ 0000000C BYTE First byte of signature = E4h
+ 0000000D UNKNOWN 15 Rest of signature
+ 23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Label = 55534552h ('USER')
+ 00000022 LONG User entry status: 6 = "My Details"
+ 00000026 44 BYTEs Unused??? (0)
+ 00000052 WORD // Separator value
+ 00000054 LONG Number of default event WAV entries
+ 00000058 --- List of consecutive default event WAV entries
+ $+00000000 38 BYTEs Unused??? (0)
+ +00000026 WORD // Separator value
+ +00000028 LONG Number of user properties
+ 0000002C --- List of consecutive user properties
+ $+00000000 --- 99a user information for owner of this DAT file
+
+ $+00000000 WORD length of password
+ +00000002 ASCIIZ user's ICQ password
+ $+00000000 LONG ??? (1)
+ +00000004 14 BYTEs ??? (03 00 00 00 00 01 00 00 00 00 00 00 00 00)
+ +00000012 WORD length of POP3 account user name
+ +00000014 ASCIIZ POP3 account user name
+ $+00000000 WORD length of POP3 account password
+ +00000002 ASCIIZ POP3 account password
+ $+00000000 WORD length of POP3 server name
+ +00000002 ASCIIZ POP3 server name
+ $+00000000 1 BYTE ??? (10/0Ah)
+ +00000001 20 BYTEs ??? (0)
+ +00000015 LONG Number of contact groups
+ +00000019 --- List of consecutive contact group entries
+ $+00000000 LONG unused??? (0)
+ +00000004 BYTE ??? (1)
+ +00000005 WORD // Separator value
+ +00000007 LONG Number of additional user properties
+ +0000000B --- List of consecutive user properties
+
+
+ >> Format of 99a user information:
+ $+00000000 WORD length of user name
+ +00000002 ASCIIZ user name (what user is called; usually nickname)
+ $+00000000 WORD length of nickname
+ +00000002 ASCIIZ nickname
+ $+00000000 WORD length of First Name
+ +00000002 ASCIIZ First Name
+ $+00000000 WORD length of Last Name
+ +00000002 ASCIIZ Last Name
+ $+00000000 WORD length of primary e-mail address
+ +00000002 ASCIIZ primary e-mail address
+ $+00000000 LONG UIN of this user
+ +00000004 BYTE authorization -- 0:required to add user, 1:none
+ +00000005 CHAR GMT offset (negative count of half-hours):
+ +00000006 DWORD current/last IP address (network byte order)
+ +0000000A BYTE gender -- 0:Not Specified, 1:Female, 2:Male
+ +0000000B LONG Home Country
+ +0000000F LONG age of user (-1 = not entered)
+ +00000013 WORD length of Home City text
+ +00000015 ASCIIZ Home City text
+ $+00000000 WORD length of Home State text
+ +00000002 ASCIIZ Home State text
+ $+00000000 WORD length of additional details text
+ +00000002 ASCIIZ additional details text (info specified by user)
+ $+00000000 WORD length of user's Homepage URL
+ +00000002 ASCIIZ user's Homepage URL
+ $+00000000 WORD length of Home Phone number
+ +00000002 ASCIIZ Home Phone number
+ $+00000000 WORD length of notes text
+ +00000002 ASCIIZ notes text (empty in My Details)
+
+ $+00000000 LONG Home Zip Code (0 = not entered)
+ +00000004 LONG timestamp of last Phonebook update
+ +00000008 LONG unused??? (0)
+ +0000000C LONG number of Phonebook entries
+ +00000010 --- list of consecutive Phonebook entries
+
+// verkar vara tom i mydetails
+ $+00000000 WORD length of picture file name
+ +00000002 ASCIIZ local path and file name of user's saved picture
+ $+00000000 8 BYTEs unused??? (0) 6??
+ +00000008 WORD //separator value <-- redan här är det 2 bytes fel
+ +0000000A LONG timestamp of last My Details update
+ +0000000E WORD length of secondary e-mail address
+ +00000010 ASCIIZ secondary e-mail address
+ $+00000000 WORD length of old e-mail address
+ +00000002 ASCIIZ old e-mail address
+ $+00000000 LONG ??? (0)
+ +00000004 BYTE day of birthdate
+ +00000005 BYTE month of birthdate (1..12 = January..December)
+ +00000006 BYTE year of birthday (0..99 = 1900..1999) //Y2K!!!
+ +00000007 LONG ??? 2
+ +0000000B LONG ??? 1
+ +0000000F 3 BYTEs languages spoken
+ +00000012 WORD length of Home Street Address
+ +00000014 ASCIIZ Home Street Address
+ $+00000000 WORD length of Home Fax number
+ +00000002 ASCIIZ Home Fax number
+ $+00000000 WORD length of Home Cellular number
+ +00000002 ASCIIZ Home Cellular number
+ $+00000000 LONG ??? (0)
+ +00000004 WORD length of Company Div/Dept
+ +00000006 ASCIIZ Company Div/Dept
+ $+00000000 BYTE Occupation
+ +00000001 LONG ??? (0)
+ +00000005 WORD length of Company Position
+ +00000007 ASCIIZ Company Position
+ $+00000000 WORD length of Company Name
+ +00000002 ASCIIZ Company Name
+ $+00000000 WORD length of Work Street Address
+ +00000002 ASCIIZ Work Street Address
+ $+00000000 WORD length of Work State text
+ +00000002 ASCIIZ Work State text
+ $+00000000 WORD length of Work City text
+ +00000002 ASCIIZ Work City text
+ $+00000000 LONG Work Zip Code (0 = not entered)
+ +00000004 LONG Work Country (see "Home Country" for values)
+ +00000008 WORD length of Work Phone number
+ +0000000A ASCIIZ Work Phone number
+ $+00000000 WORD length of Work Fax number
+ +00000002 ASCIIZ Work Fax number
+ $+00000000 WORD length of Work Homepage URL
+ +00000002 ASCIIZ Work Homepage URL
+ $+00000000 WORD length of Past Background #1 keywords
+ +00000002 ASCIIZ Past Background #1 keywords
+ $+00000000 WORD Past Bkg. #1 category
+ +00000002 WORD length of Past Background #2 keywords
+ +00000004 ASCIIZ Past Background #2 keywords
+ $+00000000 WORD Past Bkg. #2 category (see list for Past Bkg. #1)
+ +00000002 WORD length of Past Background #3 keywords
+ +00000004 ASCIIZ Past Background #3 keywords
+ $+00000000 WORD Past Bkg. #3 category (see list for Past Bkg. #1)
+ +00000002 WORD length of Affiliation #1 keywords
+ +00000004 ASCIIZ Affiliation #1 keywords
+ $+00000000 WORD Affiliation #1 category
+ +00000002 WORD length of Affiliation #2 keywords
+ +00000004 ASCIIZ Affiliation #2 keywords
+ $+00000000 WORD Affiliation #2 category (see list for Affil. #1)
+ +00000002 WORD length of Affiliation #3 keywords
+ +00000004 ASCIIZ Affiliation #3 keywords
+ $+00000000 WORD Affiliation #3 category (see list for Affil. #1)
+ +00000002 20 BYTEs unused??? (0)
+ +00000016 WORD length of Interest #1 keywords
+ +00000018 ASCIIZ Interest #1 keywords
+ $+00000000 WORD Interest #1 category
+ +00000002 WORD length of Interest #2 keywords
+ +00000004 ASCIIZ Interest #2 keywords
+ $+00000000 WORD Interest #2 category (see list for Interest #1)
+ +00000002 WORD length of Interest #3 keywords
+ +00000004 ASCIIZ Interest #3 keywords
+ $+00000000 WORD Interest #3 category (see list for Interest #1)
+ +00000002 WORD length of Interest #4 keywords
+ +00000004 ASCIIZ Interest #4 keywords
+ $+00000000 WORD Interest #4 category (see list for Interest #1)
+ +00000002 40 BYTES unused??? (0)
+
+
+
+ ================================================================
+ == Format of My Details v99b (ICQ 99b) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG -1 (Entry is not filed)
+ 00000008 LONG DAT entry number = 1005
+ 0000000C BYTE first byte of signature = E4h
+ 0000000D UNKNOWN 15 Rest of signature
+ 23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG label = 55534552h ('USER')
+ 00000022 LONG user entry status: 6 = "My Details"
+ 00000026 LONG 0 (Unknown, most likely an unused group entry)
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of user event WAV entries
+ 00000030 --- List of consecutive user event WAV entries
+ $+00000000 WORD // Separator value
+ +00000002 LONG Number of property blocks
+ +00000006 --- List of consecutive property blocks
+ +00000000 DWORD Timestamp
+ 00000004 LONG Unknown (0)
+ +00000008 LONG Number of Phonebook entries
+ +0000000C --- List of consecutive Phonebook entries
+ $+00000000 WORD // Separator value
+ +00000002 DWORD Timestamp
+ $+00000006 LONG Number of contact groups
+ +0000000A --- List of consecutive contact groups
+
+
+
+ ================================================================
+ == Format of My Details v2000/2 (ICQ 2000a/2000b/2002a) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG -1 (Entry is not filed)
+ 00000008 LONG DAT entry number = 1005
+ 0000000C BYTE first byte of signature = E4h
+ 0000000D UNKNOWN 15 Rest of signature
+ 23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG label = 55534552h ('USER')
+ 00000022 LONG user entry status: 6 = "My Details"
+ 00000026 LONG 0 (Unknown, most likely an unused group entry)
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of user event WAV entries
+ 00000030 --- List of consecutive user event WAV entries
+ $+00000000 WORD // Separator value
+ +00000002 LONG Number of property blocks
+ +00000006 --- List of consecutive property blocks
+ $+00000000 WORD // Separator value
+ +00000002 LONG Timestamp, time of last update?
+ +00000006 LONG Number of contact groups
+ +0000000A --- List of consecutive contact groups
+
+
+
+ ================================================================
+ == Format of My Details v2001a (ICQ 2001a/2001b) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG -1 (Entry is not filed)
+ 00000008 LONG DAT entry number = 1005
+ 0000000C BYTE first byte of signature = E4h
+ 0000000D UNKNOWN 15 Rest of signature
+ 23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG label = 55534552h ('USER')
+ 00000022 LONG User entry status: 6 = "My Details"
+ 00000026 LONG 0 (Unknown, most likely an unused group entry)
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of property blocks
+ 00000030 List of consecutive property blocks
+ $+00000000 WORD // Separator value
+ +00000002 LONG Time of last information update? (local time)
+ Example: 7D,FE,56,3C (32bit date+time, with seconds)
+ = 01-29-2002, 19:56:45
+ +00000006 LONG Number of contact groups
+ +0000000A --- List of consecutive contact groups
+
+
+
+
+***
+*** Messages
+***
+
+
+ ================================================================
+ == URL Message format (ICQ 99a-2002a)
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Entry type?
+ 0 = Message
+ 00000008 LONG DAT entry number
+ 0000000C UNKNOWN 16 Signature
+ E0,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ or:
+ A0,C0,0C,2F,5C,95,D3,11,8D,D7,00,10,4B,06,46,2E
+ 0000001C WORD // Separator value
+ 0000001E LONG Filing flags
+ bit 0 = filed in 0:Outgoing, 1:Incoming
+ bit 1 = filed in 'Deleted Items', 0:No, 1:Yes
+ bit 2 = filed in 'MessageDialog', 0:No, 1:Yes
+ 00000022 WORD Entry sub type
+ 4 = URL
+ 00000024 LONG UIN of sender/receiver
+ 00000028 WORD Length of description and url (incl. NULL)
+ 0000002C ASCIIZ Description and URL. This is a single string but with
+ two parts. They are separated with one FEh BYTE (-2).
+ $+00000000 LONG Status of receiving user:
+ 0: Online, FFC, Invisible, Offline
+ 4: Away
+ 14: N/A
+ -1: Occupied, DND,
+ 00000004 LONG Sent or received
+ 0: Received
+ 1: Sent
+ 00000008 WORD // Separator value
+ 0000000A LONG Timestamp
+ 0000000D UNKNOWN 27 Zeroes
+
+
+ Notes by Strickz:
+ 1. When a URL message is received it is first stored in a longer format, when it
+ has been read it is rewritten with the smaller format described above.
+ 2. I haven't seen any syntax difference between the two signatures, so I treat them
+ exactly the same for now.
+
+
+ ================================================================
+ == Short Message Format (ICQ 99a-2002a)
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Entry type?
+ 0 = Message
+ 5 = Unread message
+ 00000008 LONG DAT entry number
+ 0000000C UNKNOWN 16 Signature
+ E0,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Filing flags
+ bit 0 = filed in 0:Outgoing, 1:Incoming
+ bit 1 = filed in 'Deleted Items', 0:No, 1:Yes
+ bit 2 = filed in 'MessageDialog', 0:No, 1:Yes
+ Unread messages = 0
+ 00000022 WORD Entry sub type
+ 1 = Message
+ 00000024 LONG UIN of sender/receiver
+ 00000028 WORD Length of message text
+ 0000002C ASCIIZ Message text
+ $+00000000 LONG Status of receiving user:
+ 0: Online, FFC, Invisible, Offline
+ 4: Away
+ 14: N/A
+ -1: Occupied, DND,
+ 00000004 LONG Sent or received
+ 0: Received
+ 1: Sent
+ +00000008 WORD // Separator value
+ +0000000A LONG Timestamp
+ +0000000E UNKNOWN 27 27 zeroes
+
+
+
+ ================================================================
+ == Long Message Format
+ ================================================================
+
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Entry type?
+ 0 = Message
+ 5 = Unread message
+ 00000008 LONG DAT entry number
+ 0000000C UNKNOWN 16 Signature
+ 50,3B,C1,5C,5C,95,D3,11,8D,D7,00,10,4B,06,46,2E
+ 0000001C WORD // Separator value
+ 0000001E LONG Filing flags
+ bit 0 = filed in 0:Outgoing, 1:Incoming
+ bit 1 = filed in 'Deleted Items', 0:No, 1:Yes
+ bit 2 = filed in 'MessageDialog', 0:No, 1:Yes
+ Unread messages = 0
+ 00000022 WORD Entry sub type
+ 1 = Message
+ 00000024 LONG UIN of sender/receiver
+ 00000028 WORD Length of text
+ When received from 2002a this is 1 and text is only a
+ NULL character
+ 0000002A ASCIIZ ANSI text
+ $+00000000 LONG Status of receiving user:
+ 0: Online, FFC, Invisible, Offline, DND, Occupied
+ 4: Away
+ 14: N/A
+ Value is always 0 when receiving client was Miranda
+ 00000004 LONG Sent or received
+ 0: Received
+ 1: Sent
+ 00000008 WORD // Separator value
+ 0000000A LONG Timestamp
+ 0000000E UNKNOWN 19 Zeroes
+ 00000021 WORD Length of Rich text
+ When message was sent to online 2002a user, this is 0 and the rich
+ text is missing.
+ 00000023 ASCIIZ Rich Text
+ $+00000000 WORD Length of UTF8 text
+ +00000002 ASCIIZ UTF8 Text
+ $+00000000 LONG Unknown, always 0
+ +00000004 LONG Unknown, always 0
+ +00000009 LONG Unknown, received: 00800080h
+ sent : 00FFFFFFh
+
+
+ Notes: The long format can keep up to three copies of the message text,
+ two versions in plain text format and one in rich text format. The reason
+ for this is unknown but it looks pretty stupid. The rich text version is never
+ used once a message has been sent/received. Yet it is stored in the database making
+ each message entry 2-3 times larger.
+
+
+
+
+
+ ================================================================
+ == URL format Miranda (unread event)
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ 5 = Unread?
+ 00000008 LONG DAT entry number?
+ 0000000C UNKNOWN 16 Signature
+ EA,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Filing status?
+ bit 0 = filed as 0:Sent, 1:Received
+ bit 1 = in Deleted Items -- 0:no, 1:yes
+ bit 2 = in Messages -- 0:no, 1:yes
+ 0 = Unread
+ 00000022 WORD 1Ah (26)
+ 00000024 LONG UIN of sender/receiver
+ 00000028 LONg Length of description and url (incl. NULL)
+ 0000002C ASCIIZ Description and URL
+* $+00000000 LONG 4
+* 00000004 LONG 0
+ 00000008 WORD // Separator value
+ 0000000A LONG Timestamp
+ 0000000D UNKNOWN 27 Zeroes
+
+ 00000028 WORD Length of signature and the textstring+zeroes ++ START OF BLOCK
+ 0000002A UNKNOWN 16 Another signature?
+ 37,1C,58,72,E9,87,D4,11,A4,C1,00,D0,B7,59,B1,D9
+ 0000003C WORD 0
+ 0000003E LONG Length of textstring (no terminating zero)
+* 00000042 ASCIIZ String: "Send URL"
+ $+00000000 LONG 0
+ +00000005 LONG 1
+ +00000009 UNKNOWN 11 Zeroes ++ ENDS BLOCK
+
+ +0000000F LONG Looks like length of url+4 bytes.
+ +00000013 LONG Length of URL message content
+ +00000017 ASCIIZ Description+URL, the two parts are separated with
+ one FEh BYTE (-2). Not NULL terminated.
+
+
+ ================================================================
+ == URL format 2002a (unread)
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ 5 = Unread?
+ 00000008 LONG DAT entry number?
+ 0000000C UNKNOWN 16 Signature
+ EA,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Filing status?
+ bit 0 = filed as 0:Sent, 1:Received
+ bit 1 = in Deleted Items -- 0:no, 1:yes
+ bit 2 = in Messages -- 0:no, 1:yes
+ 0 = Unread
+ 00000022 WORD 1Ah (26)
+ 00000024 LONG UIN of sender/receiver
+ 00000028 LONG 1 (length?)
+ 0000002C UNKNOWN 1 0, Terminating zero of an empty string?
+* 0000002D UNKNOWN 6 Zeroes
+ 00000033 WORD // Separator value
+ 00000035 LONG Timestamp
+ 00000039 UNKNOWN 27 Zeroes
+
+ 00000054 WORD Length of signature and the textstring+zeroes ++ START OF BLOCK
+ 00000056 UNKNOWN 16 Another signature?
+ 37,1C,58,72,E9,87,D4,11,A4,C1,00,D0,B7,59,B1,D9
+ 00000066 WORD 0
+ 0000006C LONG Length of textstring (no terminating zero)
+ 0000005F ASCIIZ String: "Send Web Page Address (URL)"
+ $+00000000 BYTE 0 (terminating null?)
+ +00000001 LONG 0
+ +00000005 LONG 1
+ +00000009 UNKNOWN 6 Zeroes ++ ENDS BLOCK
+
+ +0000000F LONG Looks like length of url+4 bytes. I have seen entries where ++ START OF BLOCK
+ this value overflows the total event size at offset 0 by
+ 2 bytes. Bug in ICQ?
+ +00000013 LONG Length of URL message content (excl. NULL)
+ +00000017 ASCIIZ Description+URL, the two parts are separated with
+ one FEh BYTE (-2). ++ ENDS BLOCK
+
+ $+00000000 WORD 0
+
+
+
+***
+*** Contact
+***
+
+
+ ================================================================
+ == Format of Contact v99a (ICQ 99a) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ -1 = not filed? (Ex. MyDetails)
+ 0 = Messages?
+ 1 = Contact list?
+ 2 = Ignore list?
+ 9 = System Messages?
+ 00000008 LONG DAT entry number = 1005
+ 0000000C UNKNOWN 16 Signature
+ E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Label = 55534552h ('USER')
+ 00000022 LONG User entry status:
+ 2 = active
+ 3 = Awaiting authorization
+ 5 = removed from contact list
+ 12 = deleted from address book?
+ 13 = outdated/defunct???
+ 14 = outdated/defunct???
+ 00000026 LONG GroupID of contact group containing user
+ 0000002A 40 BYTEs Unknown
+ 00000052 WORD // Separator value
+ 00000054 LONG Number of user event WAV entries
+ 00000058 --- List of consecutive user event WAV entries
+ $+00000000 38 BYTEs Unknown
+ +00000026 WORD // Separator value
+ +00000028 --- 99a user information for this contact
+ See 'My Details v99a' for syntax
+
+
+
+ ================================================================
+ == Format of Contact (Db99b) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ -1 = not filed? (Ex. MyDetails)
+ 0 = Messages?
+ 1 = Contact list?
+ 2 = Ignore list?
+ 9 = System Messages?
+ 00000008 LONG DAT entry number = 1005
+ 0000000C UNKNOWN 16 Signature
+ E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Label = 55534552h ('USER')
+ 00000022 LONG User entry status:
+ 2 = active
+ 3 = Awaiting authorization
+ 5 = removed from contact list
+ 12 = deleted from address book?
+ 13 = outdated/defunct???
+ 14 = outdated/defunct???
+ 00000026 LONG GroupID of contact group containing user
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of user event WAV entries
+ 00000030 --- List of consecutive user event WAV entries
+ $+00000000 WORD // Separator value
+ +00000002 LONG Number of property blocks
+ +00000006 --- List of consecutive property blocks
+ +00000000 DWORD Timestamp
+ 00000004 LONG Unknown (0)
+ +00000008 LONG Number of Phonebook entries
+ +0000000C --- List of consecutive Phonebook entries
+ $+00000000 WORD // Separator value
+ +00000002 DWORD Timestamp
+
+
+
+ ================================================================
+ == Format of Contact v2000a & v2000b (ICQ 2000a/2000b) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ -1 = not filed? (Ex. MyDetails)
+ 0 = Messages?
+ 1 = Contact list?
+ 2 = Ignore list?
+ 9 = System Messages?
+ 00000008 LONG DAT entry number = 1005
+ 0000000C UNKNOWN 16 Signature
+ E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Label = 55534552h ('USER')
+ 00000022 LONG User entry status:
+ 2 = active
+ 3 = Awaiting authorization
+ 5 = removed from contact list
+ 12 = deleted from address book?
+ 13 = outdated/defunct???
+ 14 = outdated/defunct???
+ 00000026 LONG GroupID of contact group containing user
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of user event WAV entries
+ 00000030 --- List of consecutive user event WAV entries
+ $+00000000 WORD // Separator value
+ +00000002 LONG Number of property blocks
+ +00000006 --- List of consecutive property blocks
+ $+00000000 WORD // Separator value
+ +00000002 LONG Timestamp, time of last update?
+
+
+
+ ================================================================
+ == Format of Contact v2001a (ICQ 2001a/2001b) data:
+ ================================================================
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ -1 = not filed? (Ex. MyDetails)
+ 0 = Messages?
+ 1 = Contact list?
+ 2 = Ignore list?
+ 9 = System Messages?
+ 00000008 LONG DAT entry number = 1005
+ 0000000C UNKNOWN 16 Signature
+ E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG Label = 55534552h ('USER')
+ 00000022 LONG User entry status:
+ 2 = active
+ 3 = Awaiting authorization
+ 5 = removed from contact list
+ 12 = deleted from address book?
+ 13 = outdated/defunct???
+ 14 = outdated/defunct???
+ 00000026 LONG GroupID of contact group containing user
+ 0000002A WORD // Separator value
+ 0000002C LONG Number of property blocks
+ 00000030 --- List of consecutive property blocks
+ $+00000000 WORD // Separator value
+ +00000002 LONG Timestamp, time of last update
+
+
+
+ ================================================================
+ == Format of Contact v2002a (ICQ 2002a) data:
+ ================================================================
+
+ 00000000 LONG The following number of bytes in data
+ 00000004 LONG Where entry is filed?
+ -1 = not filed? (Ex. MyDetails)
+ 0 = Messages?
+ 1 = Contact list?
+ 2 = Ignore list?
+ 9 = System Messages?
+ 00000008 LONG DAT entry number = 1005
+ 0000000C UNKNOWN 16 Signature
+ E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ 0000001C WORD // Separator value
+ 0000001E LONG label = 55534552h ('USER')
+ 00000022 LONG User entry status:
+ 2 = active
+ 3 = Awaiting authorization
+ 5 = removed from contact list
+ 12 = deleted from address book?
+ 13 = outdated/defunct???
+ 14 = outdated/defunct???
+ 00000026 LONG GroupID of contact group containing user
+ 0000002A WORD // Separator value
+ 0000002C LONG Unknown, 0
+ 00000030 WORD // Separator value
+ 00000032 LONG Number of property blocks
+ 00000036 List of consecutive property blocks
+ $+00000000 WORD // Separator value
+ +00000002 LONG Timestamp, time of last update
+
+
+ >> Contact properties that sounds interesting
+ Property Data type Description
+ ----------------------------------- ----------- -----------------------------
+ UserCategory LONG Unknown (Entry status?)
+ RealGroupID LONG Same as GroupID above?
+ ----------------------------------- ----------- -----------------------------
+ Comment: The question here is, if the same information appears both in header
+ and in properties, which one should we use? Can they be different?
+
+
+
+***
+*** General
+***
+
+
+ >> Separator values
+ The separator value appears in many places. It is a 2-byte value and
+ reflects the version of ICQ that the database was used with. Exactly
+ when and how the values get updated is still a bit unclear. Not all
+ entries get updated when the ICQ version is updated, there are always
+ a couple of entries that are left with the old value but they still appear
+ correctly in the history.
+
+
+ Version Separator value ICQ release date
+ ----------------- ------------------- ----------------
+ ICQ 2003a v5.45 21,02
+ ICQ 2002a 16,02 (534) 19/04 2002
+ ICQ 2002a 15,02 (533) 25/03 2002
+ ICQ 2001b v5.18 06,02 (518) 28/11 2001
+ ICQ 2001b v5.17 05,02 (517) 12/11 2001
+ ICQ 2001b v5.16 04,02 (516) 08/11 2001
+ ICQ 2001b v5.15 03,02 (515) 30/10 2001
+ ICQ 2001 v4.70 15/10 2001
+ ICQ 2001 v4.65 01,D1 (465) 04/09 2001
+ ICQ 200 v4.63 07/02 2001
+ ICQ 200 v4.60 25/10 2000
+ ICQ 200 v4.56 26/09 2000
+ ICQ 2000b v4.55 21/09 2000
+ ICQ 2000a v4.31 31/05 2000
+ ICQ 2000a v4.30 11/05 2000
+ ICQ 2000a v4.29 24/04 2000
+ ICQ 99b v3.19 31/08 2000
+ ICQ 99b v3.18 29/08 1999
+ ICQ 99b v3.17 16/08 1999
+ ICQ 99b v3.01 ?
+ ICQ 99a v2.24 01/08 1999
+ ICQ 99a v2.22 15/06 1999
+ ICQ 99a v2.21 18/05 1999
+ ICQ 99a v2.20 03/05 1999
+ ICQ 99a v2.15 13/04 1999
+ ICQ 99a v2.05 CD,00 (205) ?
+ ICQ 98 v1.52 98,00 (152) ? 1998
+
+
+
+ >> Format of property block:
+ 00000000 WORD // Separator value
+ 00000004 LONG Number of user properties
+ 00000008 --- List of consecutive user properties
+
+
+ >> Format of each property:
+ 00000000 WORD Length of property name
+ 00000002 ASCIIZ Property name
+ $+00000000 BYTE Property value type:
+ 100 / 64h = CHAR
+ 101 / 65h = BYTE
+ 102 / 66h = WORD
+ 103 / 67h = INTEGER
+ 104 / 68h = DWORD
+ 105 / 69h = LONG
+ 107 / 6bh = ASCIIZ (1 WORD + String)
+ 109 / 6dh = Sublist (see below)
+ 111 / 6fh = DWORD (length) + BYTE array
+ +00000001 <var> Property value
+
+
+ >> Format of 6D sub list
+ 00000000 LONG Number of properties in sub list
+ 00000004 BYTE Sublist type? (6B or 6E)
+ 00000005 --- List of consecutive 6D6B or 6D6E properties
+
+ Comment: There appears to exist two variations, the 6B- & the 6E-variation.
+ 6B is just a list of strings, 6E is a complete property list which
+ means that it can be recursive.
+
+ >> Format of the 6D6B property
+ 00000000 WORD Length of string
+ 00000002 ASCIZZ String
+
+ >> Format of the 6D6E property
+ 00000000 WORD // Separator value
+ 00000002 LONG Number of properties
+ 00000006 --- List of consecutive properties
+
+ Comment: This is the same as a standard property block.
+
+
+ >> Format of Wav entry:
+ 00000000 WORD //separator value
+ 00000002 LONG user event for which Wav will be played:
+ 1 = Message
+ 2 = Chat
+ 3 = File
+ 4 = URL
+ 10 = Externals
+ 19 = Contact
+ 20 = Phone
+ 2007 = User ID // Not in My Details
+ 2010 = Online Alert
+ 00000006 LONG 0:play default WAV, 1:play the user-specified WAV
+ 0000000A WORD length of file name
+ 0000000C ASCIIZ full path and file name of WAV
+
+
+ >> Format of contact group (2000a and later):
+ 00000000 WORD // Separator value
+ 00000002 LONG Number of group properties
+ 00000006 List of group properties
+
+ Comment: This is the same as a standard property block.
+
+ >> Known group properties
+ Property Data type Description
+ ----------------------------------- ----------- -----------------------------
+ FirstState LONG Unknown (Visual state?)
+ GroupID LONG 3 = Awaiting authorization, 1000 and over
+ means a user defined group
+ GroupName ASCIIZ Name of the group
+ ParentID LONG Unknown (always 0 in my test DBs)
+ ----------------------------------- ----------- -----------------------------
+ Comment: Only GroupID and GroupName seems to be required
+
+
+ >> Format of contact group (99a & 99b):
+ 00000000 LONG Group ID:
+ 3 = Awaiting authorization, 1000 and over
+ means a user defined group
+ 00000004 WORD Length of group name
+ 00000006 ASCIIZ Group name
+ $+00000000 LONG Unknown, usually -1
+ +00000004 WORD Group visual status, 0 = Closed, 1 = Open
+
+
+ >> Format of Event WAV entry (99a):
+ 00000000 WORD // Separator value
+ 00000002 LONG User event for which WAV will be played:
+ 1 = Message
+ 2 = Chat
+ 3 = File
+ 4 = URL
+ 10 = Externals
+ 19 = Contact
+ 20 = Phone
+ 2007 = User ID //not in My Details
+ 2010 = Online Alert
+ 00000006 LONG 0 = Play default WAV, 1 = play the user-specified WAV
+ 0000000A WORD length of file name
+ 0000000C ASCIIZ full path and file name of WAV
+
+
+ >> Format of Phonebook entry (99a & 99b):
+ 00000000 WORD length of phone number entry name
+ 00000002 ASCIIZ phone number entry name
+ $+00000000 WORD length of area code text
+ +00000002 ASCIIZ area code text
+ $+00000000 WORD length of prefix text
+ +00000002 ASCIIZ prefix text
+ $+00000000 WORD length of country name
+ +00000002 ASCIIZ country name
+ $+00000000 WORD ??? (0) 1
+ +00000002 WORD length of number (last 4 digits) text
+ +00000004 ASCIIZ number text
+
+
+ >> Timestamps
+
+ >> Entry types
+
+ 00h - Message
+ 09h - System message
+ 0Bh - Chat log?
+
+ >> DAT Signatures
+
+ DAT signatures are sequences of 16 bytes that appear in the beginning of most
+ database entry types. They could be useful if you want to scan a DAT file for
+ certain types of data without using the IDX file.
+
+ Various messages: E0,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ Chat request: E1,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ File request: E2,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ My Details: E4,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ Contact: E5,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ Reminder: E6,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
+ Note: EE,23,A3,DB,DF,B8,D1,11,8A,65,00,60,08,71,A3,91
diff --git a/plugins/Dbx_mmap_SA/Import_SA/docs/import-license.txt b/plugins/Dbx_mmap_SA/Import_SA/docs/import-license.txt
new file mode 100644
index 0000000000..ca3fe8d547
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/docs/import-license.txt
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/plugins/Dbx_mmap_SA/Import_SA/docs/import-readme.txt b/plugins/Dbx_mmap_SA/Import_SA/docs/import-readme.txt
new file mode 100644
index 0000000000..0ad0b7b1d2
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/docs/import-readme.txt
@@ -0,0 +1,128 @@
+
+ Import Plugin for Miranda IM
+ ____________________________
+
+
+About
+_____
+
+This Miranda IM plugin allows you to import contacts and messages
+from your Mirabilis ICQ database and from Miranda IM profiles. Please note
+that this plugin does not import settings and preferences.
+
+
+
+Installation
+____________
+
+Simply copy "import.dll" into your Miranda IM plugin directory (usually
+"C:\Program Files\Miranda IM\Plugins\") and restart Miranda IM.
+
+You start the import by selecting "Import..." in the main menu.
+
+
+
+Changes
+_______
+
+0.9.2
+
+Bugfixes:
+ - Another crash with non-IM contacts.
+ - Miranda IM visibility lists were imported wrong.
+ - Some general stability improvements when dealing with corrupted
+ Miranda IM databases.
+
+
+0.9.1
+
+Bugfixes:
+ - No longer crashes when importing Miranda contacts from a protocol
+ with no unique ID setting (Weather, RSS, etc).
+
+
+0.9
+
+Bugfixes:
+ - Don't auto run wizard until at least one protocol is installed.
+ - Don't enable Mirabilis import unless ICQ is installed.
+ - Memory leaks.
+
+New features:
+ - Supports all installed protocols.
+ - 20% smaller.
+
+
+0.8.1
+
+Bugfixes:
+ - Fixed a crash while importing from Miranda IM databases.
+
+New features:
+ - Added AIM support for Miranda IM import.
+ - Added YAHOO support for Miranda IM import.
+
+
+0.8
+
+Bugfixes:
+ - Fixed two memory leaks and a crash while importing from Miranda IM databases.
+
+New features:
+ - Added ICQ Corp support for Miranda IM import (thanks Sergey).
+
+
+
+Known Problems
+______________
+
+- It is not possible to import from Mirabilis ICQ 2003b. This feature is being
+ worked on and will be available in a future version.
+
+- Weather stations, RSS feeds, and other non-IM items are not imported when you
+ import contacts from a Miranda IM database. It has not yet been decided if
+ this feature will be added or not.
+
+
+
+Support and Bug Reporting
+_________________________
+
+We cannot give support through e-mail or instant messages. Please visit the Miranda IM
+help page at http://www.miranda-im.org/help/ if you need help with this plugin.
+
+If the help page does not answer your question, please visit the Miranda IM support
+forum at: http://forums.miranda-im.org and we will try to assist you. Remember that
+everyone involved in this project are unpaid volounteers, so keep it friendly.
+
+If you want to report a bug, do so in the official bug tracker at:
+http://bugs.miranda-im.org/
+
+
+
+Contact
+_______
+
+Current maintainer is Martin Öberg.
+E-mail: strickz at miranda-im.org
+
+
+
+License and Copyright
+_____________________
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/plugins/Dbx_mmap_SA/Import_SA/docs/import-translation.txt b/plugins/Dbx_mmap_SA/Import_SA/docs/import-translation.txt
new file mode 100644
index 0000000000..d971470cf0
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/docs/import-translation.txt
@@ -0,0 +1,55 @@
+Miranda Language Pack Version 1
+Locale: 0809
+Authors: Miranda IM Development Team
+Author-email: project-info@miranda-im.org
+Last-Modified-Using: Miranda IM 0.6.1
+Plugins-included:
+
+; Generated by lpgen on Thu Jan 11 20:52:59 2007
+; Translations: 35
+
+; main.c
+;[&Import...]
+
+; mirabilis.c
+;[The given file does not exist. Please check that you have entered the name correctly.]
+;[Mirabilis Import]
+;[Mirabilis ICQ database indexes (*.idx)\0*.IDX\0All Files (*)\0*\0]
+
+; miranda.c
+;[Miranda Import]
+;[Miranda IM database (*.dat)\0*.DAT\0All Files (*)\0*\0]
+
+; wizard.c
+;[Finish]
+;[Cancel]
+
+; resource.rc
+;[From a Miranda IM database.]
+;[From a Mirabilis ICQ (99a - 2003a) database.]
+;[Use the Find/Add contacts tool to populate my contact list.]
+;[Do not load the import plugin at startup again]
+;[Progress1]
+;[Import all contacts and all messages]
+;[Only import contacts]
+;[&Next >]
+;[&Other Database...]
+;[&Other Profile...]
+;[< &Back]
+;[Choose how you would like to import:]
+;[This wizard will help you import contacts and message history from Mirabilis ICQ, as well as letting you import from other Miranda IM profiles.]
+;[Click ]
+;[If you wish to import more information, click ]
+;[You will probably never need to use this wizard again, so you can save memory by not loading it every time you start Miranda. This will mean that the import menu item will no longer be available.]
+;[Import completed]
+;[If at a future date you wish to use the wizard again, you can make it load again by going to the Plugins section of the Options dialog box.]
+;[Miranda has found Mirabilis ICQ databases corresponding to the following ICQ numbers. Please select the one you wish to import, or click ]
+;[Miranda has found Miranda profiles with the following names. Please select the one you wish to import, or click ]
+;[Now importing...]
+;[Select this if you want to import as much data as possible. This is the recommended option.]
+;[Select this if you want to import contacts but don't want to import any message history.]
+;[Miranda has now been configured to automatically download the contacts in your server-side contact list the next time you connect to ICQ.]
+;[If you want to change the way Miranda handles server-side contacts at a later time, you can do this in the ]
+;[&Filename:]
+;[Import Information Wizard]
+
diff --git a/plugins/Dbx_mmap_SA/Import_SA/encryption.c b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
new file mode 100644
index 0000000000..6cb98d20c1
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/encryption.c
@@ -0,0 +1,315 @@
+// (C) Artem Shpynov aka FYR and Igonin Vitaliy aka chaos.persei, 2007 - 2008
+
+#include "import.h"
+
+typedef struct{
+ void* (__stdcall *GenerateKey)(char* pwd);
+ void (__stdcall *FreeKey)(void* key);
+ void (__stdcall *EncryptMem)(BYTE* data, int size, void* key);
+ void (__stdcall *DecryptMem)(BYTE* data, int size, void* key);
+
+ char* Name;
+ char* Info;
+ char* Author;
+ char* Site;
+ char* Email;
+
+ DWORD Version;
+
+ WORD uid;
+} Cryptor;
+
+typedef struct{
+ char dllname[255];
+ HMODULE hLib;
+ Cryptor* cryptor;
+} CryptoModule;
+
+BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+char encryptKey[255];
+size_t encryptKeyLength;
+
+int wrongPass = 0;
+void* key;
+
+Cryptor* CryptoEngine = NULL;
+
+int ModulesCount = 0;
+CryptoModule* Modules[100];
+
+
+void zero_fill(BYTE * pBuf, size_t bufSize)
+{
+ size_t i;
+ for(i = 0; i < bufSize; i++)
+ pBuf[i] = 0;
+}
+
+void InitSecurity()
+{
+ HMODULE hLib;
+ WIN32_FIND_DATAA fd;
+ HANDLE hFile;
+
+ Cryptor* (__stdcall *GetCryptor)();
+
+ {
+ TCHAR szMirandaDir[MAX_PATH];
+ TCHAR *str2;
+
+ szMirandaDir[ 0 ] = 0;
+
+ GetModuleFileName(NULL,szMirandaDir,SIZEOF(szMirandaDir));
+ str2 = _tcsrchr(szMirandaDir,'\\');
+ if( str2 != NULL )
+ *str2=0;
+ _tchdir(szMirandaDir);
+ }
+
+ hFile = FindFirstFileA(".\\plugins\\cryptors\\*.dll", &fd);
+
+ AddMessage(LPGEN("Scanning cryptors directory"));
+
+ ModulesCount = 0;
+ while (hFile != INVALID_HANDLE_VALUE)
+ {
+ char tmp[MAX_PATH], buf[255];
+ strcpy(tmp, ".\\plugins\\cryptors\\");
+ strcat(tmp, fd.cFileName);
+
+ hLib = LoadLibraryA(tmp);
+ if(hLib){
+ GetCryptor = (Cryptor* (__stdcall *)()) GetProcAddress(hLib, "GetCryptor");
+ if(GetCryptor){
+ //TCHAR Name[100], Version[100], DllName[100];
+
+
+ Modules[ModulesCount] = (CryptoModule*) malloc(sizeof(CryptoModule));
+ Modules[ModulesCount]->cryptor = GetCryptor();
+ strcpy(Modules[ModulesCount]->dllname, fd.cFileName);
+ Modules[ModulesCount]->hLib = hLib;
+
+ _snprintf(buf,SIZEOF(buf),"%d.%d.%d.%d", HIBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), HIBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)));
+ // Unsane: none
+/*
+#ifdef _UNICODE
+ mbstowcs(Name, Modules[ModulesCount]->cryptor->Name, 100);
+ mbstowcs(Version, buf, 100);
+ mbstowcs(DllName, Modules[ModulesCount]->dllname, 100);
+#else
+
+ strcpy(Name, Modules[ModulesCount]->cryptor->Name);
+ strcpy(Version, buf);
+ strcpy(DllName, Modules[ModulesCount]->dllname);
+#endif
+*/
+ AddMessage(LPGEN("Cryptor loaded: %s [%s] (%s)"), Modules[ModulesCount]->cryptor->Name, buf, Modules[ModulesCount]->dllname);
+
+ ModulesCount++;
+ }else{
+ FreeLibrary(hLib);
+ }
+ }
+ if(ModulesCount >= 100) break;
+ if(!FindNextFileA(hFile, &fd)) break;
+ }
+
+ AddMessage(LPGEN("%d crypto modules loaded"), ModulesCount);
+}
+
+void UnloadSecurity()
+{
+ int i;
+
+ if(CryptoEngine) CryptoEngine->FreeKey(key);
+
+ for(i = 0; i < ModulesCount; i++)
+ {
+ FreeLibrary(Modules[i]->hLib);
+ free(Modules[i]);
+ }
+}
+
+void EncoderInit()
+{
+ encryptKey[encryptKeyLength] = 0;
+ key = CryptoEngine->GenerateKey(encryptKey);
+}
+
+void EncodeCopyMemory(BYTE * dst, void * src, size_t size )
+{
+ memcpy(dst, src, size);
+ CryptoEngine->EncryptMem(dst, (int)size, key);
+}
+
+void DecodeCopyMemory(BYTE * dst, void * src, size_t size )
+{
+ memcpy(dst, src, size);
+ CryptoEngine->DecryptMem(dst, (int)size, key);
+}
+
+
+void EncodeMemory(BYTE * mem, size_t size)
+{
+ CryptoEngine->EncryptMem(mem, (int)size, key);
+}
+
+void DecodeMemory(BYTE * mem, size_t size)
+{
+ CryptoEngine->DecryptMem(mem, (int)size, key);
+}
+
+int bCheckingPass = 0;
+
+int CheckPassword(WORD checkWord, WORD cryptorUID, TCHAR * szDBName)
+{
+ WORD ver;
+ int res;
+
+ if(bCheckingPass) return 0;
+ bCheckingPass = 1;
+
+ {
+ int i;
+ int Found = 0;
+ for(i = 0; i < ModulesCount; i++){
+ if(cryptorUID == Modules[i]->cryptor->uid){
+ CryptoEngine = Modules[i]->cryptor;
+ Found = 1;
+ break;
+ }
+ }
+ if(!Found){
+ AddMessage(LPGEN("Sorry, but your database encrypted with unknown module"), MB_OK);
+ bCheckingPass = 0;
+ return 0;
+ }
+ }
+
+ {
+ //wchar_t Name[100], Author[100];
+
+ // Unsane: none
+ AddMessage(LPGEN("Database encrypted with %s by %s"), CryptoEngine->Name, CryptoEngine->Author);
+ }
+
+ while(1){
+ res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOGIN), NULL, (DLGPROC)DlgStdInProc, (LPARAM)szDBName);
+ if(res == IDCANCEL)
+ {
+ wrongPass = 0;
+ bCheckingPass = 0;
+ return 0;
+ }
+ if(encryptKeyLength < 1) continue;
+ EncoderInit();
+ DecodeCopyMemory((BYTE*)&ver, &checkWord, sizeof(checkWord));
+ if(ver == 0x5195)
+ {
+ wrongPass = 0;
+ bCheckingPass = 0;
+ return 1;
+ }
+ wrongPass++;
+ }
+
+ bCheckingPass = 0;
+}
+
+
+UINT oldLangID = 0;
+void LanguageChanged(HWND hDlg)
+{
+ UINT LangID = (UINT)GetKeyboardLayout(0);
+ char Lang[3] = {0};
+ if (LangID != oldLangID)
+ {
+ oldLangID = LangID;
+ GetLocaleInfoA(MAKELCID((LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2);
+ SetDlgItemTextA(hDlg, IDC_LANG, Lang);
+ }
+}
+
+BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
+{
+ HICON hIcon = 0;
+ TCHAR tszHeaderTxt[256];
+ switch(uMsg)
+ {
+ case WM_INITDIALOG:
+ {
+ HWND hwndCtrl;
+ TranslateDialogDefault(hDlg);
+
+ hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_PASS));
+ SendMessage(GetDlgItem(hDlg, IDC_HEADERBAR), WM_SETICON, 0, (LPARAM)hIcon);
+
+ if(!wrongPass)
+ {
+ mir_sntprintf(tszHeaderTxt, SIZEOF(tszHeaderTxt), _T("%s\n%s"), TranslateT("Please type in your password for"), lParam);
+ SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), tszHeaderTxt);
+ }
+ else
+ {
+ if (wrongPass > 2)
+ {
+ hwndCtrl = GetDlgItem(hDlg, IDC_USERPASS);
+ EnableWindow(hwndCtrl, FALSE);
+ hwndCtrl = GetDlgItem(hDlg, IDOK);
+ EnableWindow(hwndCtrl, FALSE);
+
+ SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Too many errors!"));
+ }
+ else
+ SetWindowText(GetDlgItem(hDlg, IDC_HEADERBAR), TranslateT("Password is not correct!"));
+ }
+ oldLangID = 0;
+ SetTimer(hDlg,1,200,NULL);
+ LanguageChanged(hDlg);
+ return TRUE;
+ }
+
+ case WM_CTLCOLORSTATIC:
+ {
+ if ((HWND)lParam == GetDlgItem(hDlg, IDC_LANG))
+ {
+ SetTextColor((HDC)wParam, GetSysColor(COLOR_HIGHLIGHTTEXT));
+ SetBkMode((HDC)wParam, TRANSPARENT);
+ return (BOOL)GetSysColorBrush(COLOR_HIGHLIGHT);
+ }
+
+ return FALSE;
+ }
+
+ case WM_COMMAND:
+ {
+ UINT uid = LOWORD(wParam);
+
+ if(uid == IDOK){
+ if(!GetWindowLongPtr(hDlg,GWLP_USERDATA))
+ {
+ encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
+ EndDialog(hDlg,IDOK);
+ }else{
+
+ }
+ }else if(uid == IDCANCEL){
+ EndDialog(hDlg,IDCANCEL);
+ }
+ }
+ case WM_TIMER:
+ {
+ LanguageChanged(hDlg);
+ return FALSE;
+ }
+ case WM_DESTROY:
+ {
+ KillTimer(hDlg, 1);
+ DestroyIcon(hIcon);
+ return FALSE;
+ }
+ }
+
+ return FALSE;
+}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.dep b/plugins/Dbx_mmap_SA/Import_SA/import.dep
new file mode 100644
index 0000000000..a19a392168
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.dep
@@ -0,0 +1,110 @@
+# Microsoft Developer Studio Generated Dependency File, included by import.mak
+
+.\ICQserver.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\ICQserver.h"\
+ ".\import.h"\
+
+
+.\main.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\import.h"\
+
+
+.\mirabilis.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\import.h"\
+ ".\mirabilis.h"\
+
+
+.\miranda.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\import.h"\
+ ".\mirandadb0700.h"\
+
+
+.\progress.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\import.h"\
+
+
+.\wizard.c : \
+ "..\..\include\m_clist.h"\
+ "..\..\include\m_database.h"\
+ "..\..\include\m_findadd.h"\
+ "..\..\include\m_langpack.h"\
+ "..\..\include\m_plugins.h"\
+ "..\..\include\m_protocols.h"\
+ "..\..\include\m_protomod.h"\
+ "..\..\include\m_protosvc.h"\
+ "..\..\include\m_system.h"\
+ "..\..\include\m_utils.h"\
+ "..\..\include\newpluginapi.h"\
+ "..\..\include\statusmodes.h"\
+ "..\..\include\win2k.h"\
+ ".\import.h"\
+
+
+.\resource.rc : \
+ ".\import.ico"\
+
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.dsp b/plugins/Dbx_mmap_SA/Import_SA/import.dsp
new file mode 100644
index 0000000000..ca414238ee
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.dsp
@@ -0,0 +1,238 @@
+# Microsoft Developer Studio Project File - Name="import" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=import - Win32 Debug Unicode
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "import.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "import.mak" CFG="import - Win32 Debug Unicode"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "import - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /Yu"import.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /map /debug /machine:I386 /out:"../../bin/release/plugins/import.dll" /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR /Yu"import.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /pdb:"../../Bin/Debug/Plugins/import.pdb" /map:"../../Bin/Debug/Plugins/import.map" /debug /machine:I386 /out:"../../bin/debug/plugins/import.dll" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "import___Win32_Release_Unicode"
+# PROP BASE Intermediate_Dir "import___Win32_Release_Unicode"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release_Unicode"
+# PROP Intermediate_Dir "Release_Unicode"
+# PROP Ignore_Export_Lib 1
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /Yu"import.h" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /map /machine:I386 /out:"../../bin/release/plugins/import.dll" /ALIGN:4096 /ignore:4108
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /map /debug /machine:I386 /out:"../../bin/release unicode/plugins/import.dll" /ALIGN:4096 /ignore:4108
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "import___Win32_Debug_Unicode"
+# PROP BASE Intermediate_Dir "import___Win32_Debug_Unicode"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_Unicode"
+# PROP Intermediate_Dir "Debug_Unicode"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR /Yu"import.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /pdb:"../../Bin/Debug/Plugins/import.pdb" /map:"../../Bin/Debug/Plugins/import.map" /debug /machine:I386 /out:"../../bin/debug/plugins/import.dll" /pdbtype:sept
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /pdb:"../../Bin/Debug/Plugins/import.pdb" /map:"../../Bin/Debug/Plugins/import.map" /debug /machine:I386 /out:"../../bin/debug unicode/plugins/import.dll" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "import - Win32 Release"
+# Name "import - Win32 Debug"
+# Name "import - Win32 Release Unicode"
+# Name "import - Win32 Debug Unicode"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\ICQserver.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.c
+# ADD CPP /Yc"import.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\mirabilis.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\miranda.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\progress.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\wizard.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\ICQserver.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\import.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mirabilis.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\mirandadb0700.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\import.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# End Group
+# Begin Group "Documentation"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=".\docs\import-ICQ_Db_Specs.txt"
+# End Source File
+# Begin Source File
+
+SOURCE=".\docs\import-license.txt"
+# End Source File
+# Begin Source File
+
+SOURCE=".\docs\import-readme.txt"
+# End Source File
+# Begin Source File
+
+SOURCE=".\docs\import-translation.txt"
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.dsw b/plugins/Dbx_mmap_SA/Import_SA/import.dsw
new file mode 100644
index 0000000000..0efffe9da1
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "import"=".\import.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.h b/plugins/Dbx_mmap_SA/Import_SA/import.h
new file mode 100644
index 0000000000..8ac41c66c9
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.h
@@ -0,0 +1,118 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001,2002,2003,2004 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+
+//#define _LOGGING 1
+
+#define MIRANDA_VER 0x0900
+#define MIRANDA_CUSTOM_LP
+
+#define WINVER 0x0501
+#define _WIN32_WINNT 0x0501
+#define _WIN32_IE 0x0501
+
+#include <m_stdhdr.h>
+
+#include <windows.h>
+#include <commctrl.h> // datetimepicker
+
+#include <stddef.h>
+#include <time.h>
+#include <io.h>
+
+#include <win2k.h>
+#include <newpluginapi.h>
+#include <m_langpack.h>
+#include <m_system.h>
+#include <m_database.h>
+#include <m_protocols.h>
+#include <m_protosvc.h>
+#include <m_protomod.h>
+#include <m_utils.h>
+#include <m_findadd.h>
+#include <m_clist.h>
+
+// Unsane: none
+#include "resource.h"
+
+// ** Global constants
+
+#define IMPORT_MODULE "MIMImport" // Module name
+#define IMPORT_SERVICE "MIMImport/Import" // Service for menu item
+
+// Keys
+#define IMP_KEY_FR "FirstRun" // First run
+
+
+#define WIZM_GOTOPAGE (WM_USER+10) //wParam=resource id, lParam=dlgproc
+#define WIZM_DISABLEBUTTON (WM_USER+11) //wParam=0:back, 1:next, 2:cancel
+#define WIZM_SETCANCELTEXT (WM_USER+12) //lParam=(char*)newText
+#define WIZM_ENABLEBUTTON (WM_USER+13) //wParam=0:back, 1:next, 2:cancel
+
+#define PROGM_SETPROGRESS (WM_USER+10) //wParam=0..100
+#define PROGM_ADDMESSAGE (WM_USER+11) //lParam=(char*)szText
+#define SetProgress(n) SendMessage(hdlgProgress,PROGM_SETPROGRESS,n,0)
+
+#define ICQOSCPROTONAME "ICQ"
+#define MSNPROTONAME "MSN"
+#define YAHOOPROTONAME "YAHOO"
+#define NSPPROTONAME "NET_SEND"
+#define ICQCORPPROTONAME "ICQ Corp"
+#define AIMPROTONAME "AIM"
+
+// Import type
+#define IMPORT_CONTACTS 0
+#define IMPORT_ALL 1
+#define IMPORT_CUSTOM 2
+
+// Custom import options
+#define IOPT_ADDUNKNOWN 1
+#define IOPT_MSGSENT 2
+#define IOPT_MSGRECV 4
+#define IOPT_URLSENT 8
+#define IOPT_URLRECV 16
+#define IOPT_AUTHREQ 32
+#define IOPT_ADDED 64
+#define IOPT_FILESENT 128
+#define IOPT_FILERECV 256
+#define IOPT_OTHERSENT 512
+#define IOPT_OTHERRECV 1024
+#define IOPT_SYSTEM 2048
+#define IOPT_CONTACTS 4096
+#define IOPT_GROUPS 8192
+
+
+struct MM_INTERFACE mmi;
+struct UTF8_INTERFACE utfi;
+
+// Unsane: none
+extern HINSTANCE hInst;
+
+void AddMessage( const char* fmt, ... );
+void DecodeMemory(BYTE * mem, size_t size);
+void DecodeCopyMemory(BYTE * dst, void * src, size_t size );
+
+int CreateGroup(BYTE type, const char* name, HANDLE hContact);
+
+extern HWND hdlgProgress;
+
+extern DWORD nDupes, nContactsCount, nMessagesCount, nGroupsCount, nSkippedEvents, nSkippedContacts;
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import.mak b/plugins/Dbx_mmap_SA/Import_SA/import.mak
new file mode 100644
index 0000000000..3b227e2398
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import.mak
@@ -0,0 +1,516 @@
+# Microsoft Developer Studio Generated NMAKE File, Based on import.dsp
+!IF "$(CFG)" == ""
+CFG=import - Win32 Debug Unicode
+!MESSAGE No configuration specified. Defaulting to import - Win32 Debug Unicode.
+!ENDIF
+
+!IF "$(CFG)" != "import - Win32 Release" && "$(CFG)" != "import - Win32 Debug" && "$(CFG)" != "import - Win32 Release Unicode" && "$(CFG)" != "import - Win32 Debug Unicode"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "import.mak" CFG="import - Win32 Debug Unicode"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "import - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "import - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+
+ALL : "..\..\bin\release\plugins\import.dll"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ICQserver.obj"
+ -@erase "$(INTDIR)\import.pch"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\mirabilis.obj"
+ -@erase "$(INTDIR)\miranda.obj"
+ -@erase "$(INTDIR)\progress.obj"
+ -@erase "$(INTDIR)\resource.res"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\wizard.obj"
+ -@erase "$(OUTDIR)\import.exp"
+ -@erase "$(OUTDIR)\import.map"
+ -@erase "$(OUTDIR)\import.pdb"
+ -@erase "..\..\bin\release\plugins\import.dll"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /Fp"$(INTDIR)\import.pch" /Yu"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "NDEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\import.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /incremental:no /pdb:"$(OUTDIR)\import.pdb" /map:"$(INTDIR)\import.map" /debug /machine:I386 /out:"../../bin/release/plugins/import.dll" /implib:"$(OUTDIR)\import.lib" /ALIGN:4096 /ignore:4108
+LINK32_OBJS= \
+ "$(INTDIR)\ICQserver.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\mirabilis.obj" \
+ "$(INTDIR)\miranda.obj" \
+ "$(INTDIR)\progress.obj" \
+ "$(INTDIR)\wizard.obj" \
+ "$(INTDIR)\resource.res"
+
+"..\..\bin\release\plugins\import.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "..\..\bin\debug\plugins\import.dll" "$(OUTDIR)\import.bsc"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ICQserver.obj"
+ -@erase "$(INTDIR)\ICQserver.sbr"
+ -@erase "$(INTDIR)\import.pch"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\main.sbr"
+ -@erase "$(INTDIR)\mirabilis.obj"
+ -@erase "$(INTDIR)\mirabilis.sbr"
+ -@erase "$(INTDIR)\miranda.obj"
+ -@erase "$(INTDIR)\miranda.sbr"
+ -@erase "$(INTDIR)\progress.obj"
+ -@erase "$(INTDIR)\progress.sbr"
+ -@erase "$(INTDIR)\resource.res"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\wizard.obj"
+ -@erase "$(INTDIR)\wizard.sbr"
+ -@erase "$(OUTDIR)\import.bsc"
+ -@erase "$(OUTDIR)\import.exp"
+ -@erase "$(OUTDIR)\import.lib"
+ -@erase "..\..\bin\debug\plugins\import.dll"
+ -@erase "..\..\bin\debug\plugins\import.ilk"
+ -@erase "..\..\Bin\Debug\Plugins\import.map"
+ -@erase "..\..\Bin\Debug\Plugins\import.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\import.pch" /Yu"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "_DEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\import.bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\ICQserver.sbr" \
+ "$(INTDIR)\main.sbr" \
+ "$(INTDIR)\mirabilis.sbr" \
+ "$(INTDIR)\miranda.sbr" \
+ "$(INTDIR)\progress.sbr" \
+ "$(INTDIR)\wizard.sbr"
+
+"$(OUTDIR)\import.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /incremental:yes /pdb:"../../Bin/Debug/Plugins/import.pdb" /map:"../../Bin/Debug/Plugins/import.map" /debug /machine:I386 /out:"../../bin/debug/plugins/import.dll" /implib:"$(OUTDIR)\import.lib" /pdbtype:sept
+LINK32_OBJS= \
+ "$(INTDIR)\ICQserver.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\mirabilis.obj" \
+ "$(INTDIR)\miranda.obj" \
+ "$(INTDIR)\progress.obj" \
+ "$(INTDIR)\wizard.obj" \
+ "$(INTDIR)\resource.res"
+
+"..\..\bin\debug\plugins\import.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+OUTDIR=.\Release_Unicode
+INTDIR=.\Release_Unicode
+
+ALL : "..\..\bin\release unicode\plugins\import.dll"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ICQserver.obj"
+ -@erase "$(INTDIR)\import.pch"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\mirabilis.obj"
+ -@erase "$(INTDIR)\miranda.obj"
+ -@erase "$(INTDIR)\progress.obj"
+ -@erase "$(INTDIR)\resource.res"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\wizard.obj"
+ -@erase "$(OUTDIR)\import.exp"
+ -@erase "$(OUTDIR)\import.map"
+ -@erase "$(OUTDIR)\import.pdb"
+ -@erase "..\..\bin\release unicode\plugins\import.dll"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /Fp"$(INTDIR)\import.pch" /Yu"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "NDEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\import.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /incremental:no /pdb:"$(OUTDIR)\import.pdb" /map:"$(INTDIR)\import.map" /debug /machine:I386 /out:"../../bin/release unicode/plugins/import.dll" /implib:"$(OUTDIR)\import.lib" /ALIGN:4096 /ignore:4108
+LINK32_OBJS= \
+ "$(INTDIR)\ICQserver.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\mirabilis.obj" \
+ "$(INTDIR)\miranda.obj" \
+ "$(INTDIR)\progress.obj" \
+ "$(INTDIR)\wizard.obj" \
+ "$(INTDIR)\resource.res"
+
+"..\..\bin\release unicode\plugins\import.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+OUTDIR=.\Debug_Unicode
+INTDIR=.\Debug_Unicode
+# Begin Custom Macros
+OutDir=.\Debug_Unicode
+# End Custom Macros
+
+ALL : "..\..\bin\debug unicode\plugins\import.dll" "$(OUTDIR)\import.bsc"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ICQserver.obj"
+ -@erase "$(INTDIR)\ICQserver.sbr"
+ -@erase "$(INTDIR)\import.pch"
+ -@erase "$(INTDIR)\main.obj"
+ -@erase "$(INTDIR)\main.sbr"
+ -@erase "$(INTDIR)\mirabilis.obj"
+ -@erase "$(INTDIR)\mirabilis.sbr"
+ -@erase "$(INTDIR)\miranda.obj"
+ -@erase "$(INTDIR)\miranda.sbr"
+ -@erase "$(INTDIR)\progress.obj"
+ -@erase "$(INTDIR)\progress.sbr"
+ -@erase "$(INTDIR)\resource.res"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\wizard.obj"
+ -@erase "$(INTDIR)\wizard.sbr"
+ -@erase "$(OUTDIR)\import.bsc"
+ -@erase "$(OUTDIR)\import.exp"
+ -@erase "$(OUTDIR)\import.lib"
+ -@erase "..\..\bin\debug unicode\plugins\import.dll"
+ -@erase "..\..\bin\debug unicode\plugins\import.ilk"
+ -@erase "..\..\Bin\Debug\Plugins\import.map"
+ -@erase "..\..\Bin\Debug\Plugins\import.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\import.pch" /Yu"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
+RSC_PROJ=/l 0x809 /fo"$(INTDIR)\resource.res" /d "_DEBUG"
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\import.bsc"
+BSC32_SBRS= \
+ "$(INTDIR)\ICQserver.sbr" \
+ "$(INTDIR)\main.sbr" \
+ "$(INTDIR)\mirabilis.sbr" \
+ "$(INTDIR)\miranda.sbr" \
+ "$(INTDIR)\progress.sbr" \
+ "$(INTDIR)\wizard.sbr"
+
+"$(OUTDIR)\import.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /base:"0x22000000" /dll /incremental:yes /pdb:"../../Bin/Debug/Plugins/import.pdb" /map:"../../Bin/Debug/Plugins/import.map" /debug /machine:I386 /out:"../../bin/debug unicode/plugins/import.dll" /implib:"$(OUTDIR)\import.lib" /pdbtype:sept
+LINK32_OBJS= \
+ "$(INTDIR)\ICQserver.obj" \
+ "$(INTDIR)\main.obj" \
+ "$(INTDIR)\mirabilis.obj" \
+ "$(INTDIR)\miranda.obj" \
+ "$(INTDIR)\progress.obj" \
+ "$(INTDIR)\wizard.obj" \
+ "$(INTDIR)\resource.res"
+
+"..\..\bin\debug unicode\plugins\import.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("import.dep")
+!INCLUDE "import.dep"
+!ELSE
+!MESSAGE Warning: cannot find "import.dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "import - Win32 Release" || "$(CFG)" == "import - Win32 Debug" || "$(CFG)" == "import - Win32 Release Unicode" || "$(CFG)" == "import - Win32 Debug Unicode"
+SOURCE=.\ICQserver.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+
+"$(INTDIR)\ICQserver.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+
+"$(INTDIR)\ICQserver.obj" "$(INTDIR)\ICQserver.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+
+"$(INTDIR)\ICQserver.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+
+"$(INTDIR)\ICQserver.obj" "$(INTDIR)\ICQserver.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ENDIF
+
+SOURCE=.\main.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+CPP_SWITCHES=/nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /Fp"$(INTDIR)\import.pch" /Yc"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+
+"$(INTDIR)\main.obj" "$(INTDIR)\import.pch" : $(SOURCE) "$(INTDIR)"
+ $(CPP) @<<
+ $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\import.pch" /Yc"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+
+"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" "$(INTDIR)\import.pch" : $(SOURCE) "$(INTDIR)"
+ $(CPP) @<<
+ $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+CPP_SWITCHES=/nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /Fp"$(INTDIR)\import.pch" /Yc"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+
+"$(INTDIR)\main.obj" "$(INTDIR)\import.pch" : $(SOURCE) "$(INTDIR)"
+ $(CPP) @<<
+ $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+CPP_SWITCHES=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_USRDLL" /D "IMPORT_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\import.pch" /Yc"import.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+
+"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" "$(INTDIR)\import.pch" : $(SOURCE) "$(INTDIR)"
+ $(CPP) @<<
+ $(CPP_SWITCHES) $(SOURCE)
+<<
+
+
+!ENDIF
+
+SOURCE=.\mirabilis.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+
+"$(INTDIR)\mirabilis.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+
+"$(INTDIR)\mirabilis.obj" "$(INTDIR)\mirabilis.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+
+"$(INTDIR)\mirabilis.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+
+"$(INTDIR)\mirabilis.obj" "$(INTDIR)\mirabilis.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ENDIF
+
+SOURCE=.\miranda.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+
+"$(INTDIR)\miranda.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+
+"$(INTDIR)\miranda.obj" "$(INTDIR)\miranda.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+
+"$(INTDIR)\miranda.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+
+"$(INTDIR)\miranda.obj" "$(INTDIR)\miranda.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ENDIF
+
+SOURCE=.\progress.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+
+"$(INTDIR)\progress.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+
+"$(INTDIR)\progress.obj" "$(INTDIR)\progress.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+
+"$(INTDIR)\progress.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+
+"$(INTDIR)\progress.obj" "$(INTDIR)\progress.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ENDIF
+
+SOURCE=.\wizard.c
+
+!IF "$(CFG)" == "import - Win32 Release"
+
+
+"$(INTDIR)\wizard.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug"
+
+
+"$(INTDIR)\wizard.obj" "$(INTDIR)\wizard.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Release Unicode"
+
+
+"$(INTDIR)\wizard.obj" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ELSEIF "$(CFG)" == "import - Win32 Debug Unicode"
+
+
+"$(INTDIR)\wizard.obj" "$(INTDIR)\wizard.sbr" : $(SOURCE) "$(INTDIR)" "$(INTDIR)\import.pch"
+
+
+!ENDIF
+
+SOURCE=.\resource.rc
+
+"$(INTDIR)\resource.res" : $(SOURCE) "$(INTDIR)"
+ $(RSC) $(RSC_PROJ) $(SOURCE)
+
+
+
+!ENDIF
+
+
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa.vcproj b/plugins/Dbx_mmap_SA/Import_SA/import_sa.vcproj
new file mode 100644
index 0000000000..27c67dd232
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa.vcproj
@@ -0,0 +1,616 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="import_sa"
+ ProjectGUID="{962F0513-40CE-469E-B87B-8634EA48D9AC}"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2"
+ WholeProgramOptimization="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ GlobalOptimizations="TRUE"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="TRUE"
+ ExceptionHandling="FALSE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="TRUE"
+ UsePrecompiledHeader="3"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerOutput="3"
+ BrowseInformation="1"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="TRUE"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="vc7to6.lib comctl32.lib oldnames.lib"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="../../lib"
+ IgnoreAllDefaultLibraries="TRUE"
+ GenerateDebugInformation="TRUE"
+ GenerateMapFile="TRUE"
+ MapFileName="$(OutDir)/$(ProjectName).map"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="TRUE"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ ExceptionHandling="FALSE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="3"
+ PrecompiledHeaderThrough="import.h"
+ BrowseInformation="1"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="TRUE"
+ GenerateDebugInformation="TRUE"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="TRUE"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="1">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ ExceptionHandling="FALSE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ BufferSecurityCheck="TRUE"
+ UsePrecompiledHeader="3"
+ PrecompiledHeaderThrough="import.h"
+ BrowseInformation="1"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="TRUE"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="TRUE"
+ GenerateDebugInformation="TRUE"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="TRUE"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="1"
+ WholeProgramOptimization="FALSE">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ GlobalOptimizations="TRUE"
+ FavorSizeOrSpeed="2"
+ OmitFramePointers="FALSE"
+ OptimizeForProcessor="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="TRUE"
+ ExceptionHandling="FALSE"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="TRUE"
+ UsePrecompiledHeader="3"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerOutput="3"
+ BrowseInformation="1"
+ BrowseInformationFile="$(IntDir)/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="TRUE"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="vc7to6.lib comctl32.lib oldnames.lib"
+ AdditionalLibraryDirectories="../../lib"
+ IgnoreAllDefaultLibraries="TRUE"
+ GenerateDebugInformation="TRUE"
+ GenerateMapFile="TRUE"
+ MapFileName="$(OutDir)/$(ProjectName).map"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="TRUE"
+ SuppressStartupBanner="TRUE"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+ <File
+ RelativePath="encryption.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="ICQserver.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="main.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="1"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ UsePrecompiledHeader="1"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ UsePrecompiledHeader="1"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ UsePrecompiledHeader="1"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="mirabilis.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="miranda.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="progress.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="wizard.c">
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ BasicRuntimeChecks="3"
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="1"
+ AdditionalIncludeDirectories=""
+ BrowseInformation="1"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl">
+ <File
+ RelativePath="ICQserver.h">
+ </File>
+ <File
+ RelativePath="import.h">
+ </File>
+ <File
+ RelativePath="mirabilis.h">
+ </File>
+ <File
+ RelativePath="mirandadb0700.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ <File
+ RelativePath="import.ico">
+ </File>
+ <File
+ RelativePath="resource.rc">
+ </File>
+ </Filter>
+ <Filter
+ Name="Documentation"
+ Filter="">
+ <File
+ RelativePath="docs\import-ICQ_Db_Specs.txt">
+ </File>
+ <File
+ RelativePath="docs\import-license.txt">
+ </File>
+ <File
+ RelativePath="docs\import-readme.txt">
+ </File>
+ <File
+ RelativePath="docs\import-translation.txt">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj
new file mode 100644
index 0000000000..ce18f2a4d3
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj
@@ -0,0 +1,642 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug Unicode|Win32">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug Unicode|x64">
+ <Configuration>Debug Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|Win32">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Unicode|x64">
+ <Configuration>Release Unicode</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>import_sa</ProjectName>
+ <ProjectGuid>{9299B507-1AF9-4C93-9560-5F637D1E0C9E}</ProjectGuid>
+ <RootNamespace>import_sa</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30128.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">true</IgnoreImportLibrary>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">true</IgnoreImportLibrary>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Release/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ALIGN:4096 /ignore:4108 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>
+ </MapFileName>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>.\Release/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ALIGN:4096 /ignore:4108 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>
+ </MapFileName>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Debug/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>
+ </MapFileName>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>.\Debug/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>
+ </MapFileName>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Debug/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <MapFileName>
+ </MapFileName>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>.\Debug/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>false</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Precise</FloatingPointModel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>
+ </MapFileName>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Release/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ALIGN:4096 /ignore:4108 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>.\Release/import.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>import.h</PrecompiledHeaderFile>
+ <AssemblerListingLocation>
+ </AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>../../../include;../../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/ALIGN:4096 /ignore:4108 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
+ <BaseAddress>0x22000000</BaseAddress>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="encryption.c" />
+ <ClCompile Include="ICQserver.c" />
+ <ClCompile Include="main.c">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug Unicode|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release Unicode|x64'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="mirabilis.c" />
+ <ClCompile Include="miranda.c" />
+ <ClCompile Include="progress.c" />
+ <ClCompile Include="wizard.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ICQserver.h" />
+ <ClInclude Include="import.h" />
+ <ClInclude Include="mirabilis.h" />
+ <ClInclude Include="mirandadb0700.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="version.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="docs\import-ICQ_Db_Specs.txt" />
+ <None Include="docs\import-license.txt" />
+ <None Include="docs\import-readme.txt" />
+ <None Include="docs\import-translation.txt" />
+ <None Include="res\import.ico" />
+ <None Include="res\pass.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ <ResourceCompile Include="Version.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters
new file mode 100644
index 0000000000..af9d0a9c31
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_10.vcxproj.filters
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{a952b5a4-0c48-4471-ac27-3fa8f97ba56e}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{1a2203c1-a6f3-40e3-9b09-b2e5ab72dbbc}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{e10cb216-83c1-4eb2-95ec-09f1e42a2c96}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ <Filter Include="Documentation">
+ <UniqueIdentifier>{8ad8cb39-e207-46f6-8fbf-1f5871148568}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="ICQserver.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="main.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mirabilis.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="miranda.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="progress.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="wizard.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="encryption.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="ICQserver.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="import.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mirabilis.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mirandadb0700.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="version.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="docs\import-ICQ_Db_Specs.txt">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="docs\import-license.txt">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="docs\import-readme.txt">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="docs\import-translation.txt">
+ <Filter>Documentation</Filter>
+ </None>
+ <None Include="res\import.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\pass.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ <ResourceCompile Include="Version.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa_8.vcproj b/plugins/Dbx_mmap_SA/Import_SA/import_sa_8.vcproj
new file mode 100644
index 0000000000..d6662fdd68
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_8.vcproj
@@ -0,0 +1,552 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="import_sa"
+ ProjectGUID="{9299B507-1AF9-4C93-9560-5F637D1E0C9E}"
+ RootNamespace="import_sa"
+ SccProjectName=""
+ SccLocalPath=""
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="2"
+ FavorSizeOrSpeed="2"
+ OmitFramePointers="true"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="0"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comctl32.lib"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+ GenerateMapFile="false"
+ MapFileName=""
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="encryption.c"
+ >
+ </File>
+ <File
+ RelativePath="ICQserver.c"
+ >
+ </File>
+ <File
+ RelativePath="main.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="mirabilis.c"
+ >
+ </File>
+ <File
+ RelativePath="miranda.c"
+ >
+ </File>
+ <File
+ RelativePath="progress.c"
+ >
+ </File>
+ <File
+ RelativePath="wizard.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="ICQserver.h"
+ >
+ </File>
+ <File
+ RelativePath="import.h"
+ >
+ </File>
+ <File
+ RelativePath="mirabilis.h"
+ >
+ </File>
+ <File
+ RelativePath="mirandadb0700.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="import.ico"
+ >
+ </File>
+ <File
+ RelativePath="resource.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Documentation"
+ >
+ <File
+ RelativePath="docs\import-ICQ_Db_Specs.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-license.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-readme.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-translation.txt"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Dbx_mmap_SA/Import_SA/import_sa_9.vcproj b/plugins/Dbx_mmap_SA/Import_SA/import_sa_9.vcproj
new file mode 100644
index 0000000000..6ebaec1644
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/import_sa_9.vcproj
@@ -0,0 +1,998 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="import_sa"
+ ProjectGUID="{9299B507-1AF9-4C93-9560-5F637D1E0C9E}"
+ RootNamespace="import_sa"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;*&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;*&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Debug/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="false"
+ ExceptionHandling="0"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="0"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalDependencies="comctl32.lib"
+ SuppressStartupBanner="true"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;*&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(TargetDir)$(TargetName).pdb"
+ GenerateMapFile="false"
+ MapFileName=""
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;X86&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release Unicode|x64"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)64/Plugins"
+ IntermediateDirectory="$(SolutionDir)$(ConfigurationName)64/Obj/$(ProjectName)"
+ ConfigurationType="2"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="3"
+ TypeLibraryName=".\Release/import.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="3"
+ InlineFunctionExpansion="1"
+ EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="2"
+ WholeProgramOptimization="true"
+ AdditionalIncludeDirectories="../../../include;../../ExternalAPI"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IMPORT_EXPORTS"
+ StringPooling="true"
+ ExceptionHandling="0"
+ RuntimeLibrary="2"
+ BufferSecurityCheck="false"
+ EnableFunctionLevelLinking="true"
+ FloatingPointModel="2"
+ RuntimeTypeInfo="false"
+ UsePrecompiledHeader="2"
+ PrecompiledHeaderThrough="import.h"
+ AssemblerListingLocation=""
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ CompileAs="0"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="true"
+ AdditionalOptions="/ALIGN:4096 /ignore:4108"
+ AdditionalDependencies="comctl32.lib"
+ AdditionalManifestDependencies="type=&apos;Win32&apos; name=&apos;Microsoft.Windows.Common-Controls&apos; version=&apos;6.0.0.0&apos; processorArchitecture=&apos;*&apos; publicKeyToken=&apos;6595b64144ccf1df&apos; language=&apos;*&apos;"
+ GenerateDebugInformation="true"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ LinkTimeCodeGeneration="1"
+ BaseAddress="0x22000000"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ ImportLibrary="$(IntDir)/$(TargetName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="encryption.c"
+ >
+ </File>
+ <File
+ RelativePath="ICQserver.c"
+ >
+ </File>
+ <File
+ RelativePath="main.c"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release Unicode|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="mirabilis.c"
+ >
+ </File>
+ <File
+ RelativePath="miranda.c"
+ >
+ </File>
+ <File
+ RelativePath="progress.c"
+ >
+ </File>
+ <File
+ RelativePath="wizard.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath="ICQserver.h"
+ >
+ </File>
+ <File
+ RelativePath="import.h"
+ >
+ </File>
+ <File
+ RelativePath="mirabilis.h"
+ >
+ </File>
+ <File
+ RelativePath="mirandadb0700.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="import.ico"
+ >
+ </File>
+ <File
+ RelativePath="resource.rc"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Documentation"
+ >
+ <File
+ RelativePath="docs\import-ICQ_Db_Specs.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-license.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-readme.txt"
+ >
+ </File>
+ <File
+ RelativePath="docs\import-translation.txt"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.c b/plugins/Dbx_mmap_SA/Import_SA/main.c
new file mode 100644
index 0000000000..8a5b2a39f8
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/main.c
@@ -0,0 +1,553 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "import.h"
+#include "version.h"
+
+void FreeVariant( DBVARIANT* dbv );
+void WriteVariant( HANDLE hContact, const char* module, const char* var, DBVARIANT* dbv );
+
+BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei);
+
+
+int nImportOption;
+int nCustomOptions;
+int hLangpack;
+
+int cICQAccounts = 0;
+char ** szICQModuleName = NULL;
+TCHAR ** tszICQAccountName = NULL;
+int iICQAccount = 0;
+
+static HANDLE hHookModulesLoaded = NULL;
+static HANDLE hHookOnExit = NULL;
+static HANDLE hImportService = NULL;
+
+INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+static HWND hwndWizard = NULL;
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ __VERSION_DWORD,
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ __AUTHORWEB,
+ UNICODE_AWARE,
+ 0, //{2D77A746-00A6-4343-BFC5-F808CDD772EA}
+ {0x2d77a746, 0xa6, 0x4343, { 0xbf, 0xc5, 0xf8, 0x8, 0xcd, 0xd7, 0x72, 0xea }}
+};
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+static INT_PTR ImportCommand(WPARAM wParam,LPARAM lParam)
+{
+ if (IsWindow(hwndWizard)) {
+ SetForegroundWindow(hwndWizard);
+ SetFocus(hwndWizard);
+ }
+ else hwndWizard = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc);
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// MirandaPluginInfoEx - returns an information about a plugin
+
+__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 8, 0, 0))
+ return NULL;
+
+ return &pluginInfo;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// MirandaPluginInterfaces - returns the protocol interface to the core
+
+static const MUUID interfaces[] = {MIID_IMPORT, MIID_LAST};
+
+__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Performs a primary set of actions upon plugin loading
+
+static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ int nProtocols = 0;
+ int n;
+ PROTOCOLDESCRIPTOR **ppProtos = NULL;
+
+ if (DBGetContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 1))
+ return 0;
+
+ // Only autorun import wizard if at least one protocol is installed
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&nProtocols, (LPARAM)&ppProtos);
+ for (n=0; n < nProtocols; n++) {
+ if (ppProtos[n]->type == PROTOTYPE_PROTOCOL) {
+ CallService(IMPORT_SERVICE, 0, 0);
+ DBWriteContactSettingByte(NULL, IMPORT_MODULE, IMP_KEY_FR, 1);
+ break;
+ } }
+ return 0;
+}
+
+static int OnExit(WPARAM wParam, LPARAM lParam)
+{
+ if ( hwndWizard )
+ SendMessage(hwndWizard, WM_CLOSE, 0, 0);
+ return 0;
+}
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+ mir_getMMI( &mmi );
+ mir_getUTFI( &utfi );
+ mir_getLP( &pluginInfo );
+
+ hImportService = CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
+ {
+ CLISTMENUITEM mi;
+ ZeroMemory(&mi, sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_IMPORT));
+ mi.pszName = LPGEN("&Import...");
+ mi.position = 500050000;
+ mi.pszService = IMPORT_SERVICE;
+ CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+ }
+ hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
+ hHookOnExit = HookEvent(ME_SYSTEM_OKTOEXIT, OnExit);
+ {
+ INITCOMMONCONTROLSEX icex;
+ icex.dwSize = sizeof(icex);
+ icex.dwICC = ICC_DATE_CLASSES;
+ InitCommonControlsEx(&icex);
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Unload a plugin
+
+int __declspec(dllexport) Unload(void)
+{
+ if (hHookModulesLoaded)
+ UnhookEvent(hHookModulesLoaded);
+ if (hHookOnExit)
+ UnhookEvent(hHookOnExit);
+ if (hImportService)
+ DestroyServiceFunction(hImportService);
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+BOOL IsProtocolLoaded(char* pszProtocolName)
+{
+ return CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)pszProtocolName) ? TRUE : FALSE;
+}
+
+BOOL EnumICQAccounts()
+{
+ int count, i = 0;
+ PROTOACCOUNT ** accs;
+
+ while (cICQAccounts)
+ {
+ cICQAccounts--;
+ free(szICQModuleName[cICQAccounts]);
+ free(tszICQAccountName[cICQAccounts]);
+ }
+
+ ProtoEnumAccounts(&count, &accs);
+ szICQModuleName = (char**)realloc(szICQModuleName, count * sizeof(char**));
+ tszICQAccountName = (TCHAR**)realloc(tszICQAccountName, count * sizeof(TCHAR**));
+ while (i < count)
+ {
+ if ((0 == strcmp(ICQOSCPROTONAME, accs[i]->szProtoName)) && accs[i]->bIsEnabled)
+ {
+ szICQModuleName[cICQAccounts] = strdup(accs[i]->szModuleName);
+ tszICQAccountName[cICQAccounts] = _tcsdup(accs[i]->tszAccountName);
+ cICQAccounts++;
+ }
+ i++;
+ }
+ return cICQAccounts != 0;
+}
+
+void FreeICQAccountsList()
+{
+ while (cICQAccounts)
+ {
+ cICQAccounts--;
+ free(szICQModuleName[cICQAccounts]);
+ free(tszICQAccountName[cICQAccounts]);
+ }
+
+ if (szICQModuleName)
+ free(szICQModuleName);
+ if (tszICQAccountName)
+ free(tszICQAccountName);
+
+ szICQModuleName = NULL;
+ tszICQAccountName = NULL;
+}
+
+HANDLE HContactFromNumericID(char* pszProtoName, char* pszSetting, DWORD dwID)
+{
+ char* szProto;
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact != NULL)
+ {
+ if (DBGetContactSettingDword(hContact, pszProtoName, pszSetting, 0) == dwID)
+ {
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto != NULL && !strcmp(szProto, pszProtoName))
+ return hContact;
+ }
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ return INVALID_HANDLE_VALUE;
+}
+
+HANDLE HContactFromID(char* pszProtoName, char* pszSetting, char* pszID)
+{
+ DBVARIANT dbv;
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact != NULL) {
+ char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if ( !lstrcmpA(szProto, pszProtoName)) {
+ if (DBGetContactSettingString(hContact, pszProtoName, pszSetting, &dbv) == 0) {
+ if (strcmp(pszID, dbv.pszVal) == 0) {
+ DBFreeVariant(&dbv);
+ return hContact;
+ }
+ DBFreeVariant(&dbv);
+ }
+ }
+
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ return INVALID_HANDLE_VALUE;
+}
+
+HANDLE HistoryImportFindContact(HWND hdlgProgress, char* szModuleName, DWORD uin, int addUnknown)
+{
+ HANDLE hContact = HContactFromNumericID(szModuleName, "UIN", uin);
+ if (hContact == NULL) {
+ AddMessage( LPGEN("Ignored event from/to self"));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if (hContact != INVALID_HANDLE_VALUE)
+ return hContact;
+
+ if (!addUnknown)
+ return INVALID_HANDLE_VALUE;
+
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)szModuleName);
+ DBWriteContactSettingDword(hContact, szModuleName, "UIN", uin);
+ AddMessage( LPGEN("Added contact %u (found in history)"), uin );
+ return hContact;
+}
+
+HANDLE AddContact(HWND hdlgProgress, char* pszProtoName, char* pszUniqueSetting,
+ DBVARIANT* id, DBVARIANT* nick, DBVARIANT* group)
+{
+ HANDLE hContact;
+ char szid[ 40 ];
+ char* pszUserID = ( id->type == DBVT_DWORD ) ? _ltoa( id->dVal, szid, 10 ) : id->pszVal;
+
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ if ( CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)pszProtoName) != 0) {
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ AddMessage( LPGEN("Failed to add %s contact %s"), pszProtoName, pszUserID );
+ FreeVariant( id );
+ FreeVariant( nick );
+ FreeVariant( group );
+ return INVALID_HANDLE_VALUE;
+ }
+
+ WriteVariant( hContact, pszProtoName, pszUniqueSetting, id );
+
+ if ( group->type )
+ CreateGroup( group->type, group->pszVal, hContact );
+
+ if ( nick->type && nick->pszVal[0] ) {
+ WriteVariant( hContact, "CList", "MyHandle", nick );
+ if (nick->type == DBVT_UTF8) {
+ char *tmp = mir_utf8decodeA(nick->pszVal);
+ AddMessage( LPGEN("Added %s contact %s, '%s'"), pszProtoName, pszUserID, tmp );
+ mir_free(tmp);
+ }
+ else AddMessage( LPGEN("Added %s contact %s, '%s'"), pszProtoName, pszUserID, nick->pszVal );
+ }
+ else AddMessage( LPGEN("Added %s contact %s"), pszProtoName, pszUserID );
+
+ FreeVariant( id );
+ FreeVariant( nick );
+ FreeVariant( group );
+ return hContact;
+}
+
+// ------------------------------------------------
+// Creates a group with a specified name in the
+// Miranda contact list.
+// If contact is specified adds it to group
+// ------------------------------------------------
+// Returns 1 if successful and 0 when it fails.
+int CreateGroup(BYTE type, const char* name, HANDLE hContact)
+{
+ int groupId;
+ TCHAR *tmp, *tszGrpName;
+ char groupIdStr[11];
+ size_t cbName;
+
+ if (type == DBVT_UTF8)
+ tmp = mir_utf8decodeT( name );
+ else if (type == DBVT_WCHAR)
+ tmp = mir_u2t(( wchar_t* )name );
+ else
+ tmp = mir_a2t( name );
+
+ if ( tmp == NULL )
+ return 0;
+
+ cbName = _tcslen(tmp);
+ tszGrpName = _alloca(( cbName+2 )*sizeof( TCHAR ));
+ tszGrpName[0] = 1 | GROUPF_EXPANDED;
+ _tcscpy( tszGrpName+1, tmp );
+ mir_free( tmp );
+
+ // Check for duplicate & find unused id
+ for (groupId = 0; ; groupId++) {
+ DBVARIANT dbv;
+ itoa(groupId, groupIdStr,10);
+ if (DBGetContactSettingTString(NULL, "CListGroups", groupIdStr, &dbv))
+ break;
+
+ if ( !lstrcmp(dbv.ptszVal + 1, tszGrpName + 1 )) {
+ if (hContact)
+ DBWriteContactSettingTString( hContact, "CList", "Group", tszGrpName+1 );
+ else {
+ char *str = mir_t2a(tszGrpName + 1);
+ AddMessage( LPGEN("Skipping duplicate group %s."), str);
+ mir_free(str);
+ }
+
+ DBFreeVariant(&dbv);
+ return 0;
+ }
+
+ DBFreeVariant(&dbv);
+ }
+
+ DBWriteContactSettingTString( NULL, "CListGroups", groupIdStr, tszGrpName );
+
+ if (hContact)
+ DBWriteContactSettingTString( hContact, "CList", "Group", tszGrpName+1 );
+
+ return 1;
+}
+
+// Returns TRUE if the event already exist in the database
+BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei)
+{
+ static DWORD dwPreviousTimeStamp = -1;
+ static HANDLE hPreviousContact = INVALID_HANDLE_VALUE;
+ static HANDLE hPreviousDbEvent = NULL;
+
+ HANDLE hExistingDbEvent;
+ DWORD dwEventTimeStamp;
+ DBEVENTINFO dbeiExisting;
+
+ // get last event
+ if (!(hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0)))
+ return FALSE;
+
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting);
+ dwEventTimeStamp = dbeiExisting.timestamp;
+
+ // compare with last timestamp
+ if (dbei.timestamp > dwEventTimeStamp)
+ {
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dwEventTimeStamp;
+ return FALSE;
+ }
+
+ if (hContact != hPreviousContact)
+ {
+ hPreviousContact = hContact;
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dwEventTimeStamp;
+
+ // get first event
+ if (!(hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRST, (WPARAM)hContact, 0)))
+ return FALSE;
+
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting);
+ dwEventTimeStamp = dbeiExisting.timestamp;
+
+ // compare with first timestamp
+ if (dbei.timestamp <= dwEventTimeStamp)
+ {
+ // remember event
+ dwPreviousTimeStamp = dwEventTimeStamp;
+ hPreviousDbEvent = hExistingDbEvent;
+
+ if ( dbei.timestamp != dwEventTimeStamp )
+ return FALSE;
+ }
+
+ }
+ // check for equal timestamps
+ if (dbei.timestamp == dwPreviousTimeStamp)
+ {
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hPreviousDbEvent, (LPARAM)&dbeiExisting);
+
+ if ((dbei.timestamp == dbeiExisting.timestamp) &&
+ (dbei.eventType == dbeiExisting.eventType) &&
+ (dbei.cbBlob == dbeiExisting.cbBlob) &&
+ ((dbei.flags&DBEF_SENT) == (dbeiExisting.flags&DBEF_SENT)))
+ return TRUE;
+
+ // find event with another timestamp
+ hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hPreviousDbEvent, 0);
+ while (hExistingDbEvent != NULL)
+ {
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting);
+
+ if (dbeiExisting.timestamp != dwPreviousTimeStamp)
+ {
+ // use found event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dbeiExisting.timestamp;
+ break;
+ }
+
+ hPreviousDbEvent = hExistingDbEvent;
+ hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hExistingDbEvent, 0);
+ }
+ }
+
+ hExistingDbEvent = hPreviousDbEvent;
+
+ if (dbei.timestamp <= dwPreviousTimeStamp)
+ {
+ // look back
+ while (hExistingDbEvent != NULL)
+ {
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting);
+
+ if (dbei.timestamp > dbeiExisting.timestamp)
+ {
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dbeiExisting.timestamp;
+ return FALSE;
+ }
+
+ // Compare event with import candidate
+ if ((dbei.timestamp == dbeiExisting.timestamp) &&
+ (dbei.eventType == dbeiExisting.eventType) &&
+ (dbei.cbBlob == dbeiExisting.cbBlob) &&
+ ((dbei.flags&DBEF_SENT) == (dbeiExisting.flags&DBEF_SENT)))
+ {
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dbeiExisting.timestamp;
+ return TRUE;
+ }
+
+ // Get previous event in chain
+ hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hExistingDbEvent, 0);
+ }
+
+ }
+ else
+ {
+ // look forward
+ while (hExistingDbEvent != NULL)
+ {
+ ZeroMemory(&dbeiExisting, sizeof(dbeiExisting));
+ dbeiExisting.cbSize = sizeof(dbeiExisting);
+ CallService(MS_DB_EVENT_GET, (WPARAM)hExistingDbEvent, (LPARAM)&dbeiExisting);
+
+ if (dbei.timestamp < dbeiExisting.timestamp)
+ {
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dbeiExisting.timestamp;
+ return FALSE;
+ }
+
+ // Compare event with import candidate
+ if ((dbei.timestamp == dbeiExisting.timestamp) &&
+ (dbei.eventType == dbeiExisting.eventType) &&
+ (dbei.cbBlob == dbeiExisting.cbBlob) &&
+ ((dbei.flags&DBEF_SENT) == (dbeiExisting.flags&DBEF_SENT)))
+ {
+ // remember event
+ hPreviousDbEvent = hExistingDbEvent;
+ dwPreviousTimeStamp = dbeiExisting.timestamp;
+ return TRUE;
+ }
+
+ // Get next event in chain
+ hExistingDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hExistingDbEvent, 0);
+ }
+
+ }
+ // reset last event
+ hPreviousContact = INVALID_HANDLE_VALUE;
+ return FALSE;
+}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
new file mode 100644
index 0000000000..6d99757d4d
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.c
@@ -0,0 +1,1492 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+// ==============
+// == INCLUDES ==
+// ==============
+
+#include "import.h"
+#include "mirabilis.h"
+
+BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei);
+BOOL IsProtocolLoaded(char* pszProtocolName);
+HANDLE HContactFromNumericID(char* pszProtoName, char* pszSetting, DWORD dwID);
+HANDLE AddContact(HWND hdlgProgress, char* pszProtoName, char* pszUniqueSetting, DBVARIANT* id, DBVARIANT* nick, DBVARIANT* group);
+
+// ====================
+// ====================
+// == IMPLEMENTATION ==
+// ====================
+// ====================
+
+static void SearchForDatabases(HWND hdlg, const TCHAR *dbPath, const TCHAR *type)
+{
+ HANDLE hFind;
+ WIN32_FIND_DATA fd;
+ TCHAR szSearchPath[MAX_PATH];
+ TCHAR szRootName[MAX_PATH],*str2;
+
+ int i;
+
+ wsprintf(szSearchPath, _T("%s\\*.idx"), dbPath);
+ hFind=FindFirstFile(szSearchPath,&fd);
+ if(hFind!=INVALID_HANDLE_VALUE) {
+ do {
+ lstrcpy(szRootName,fd.cFileName);
+ str2=_tcsrchr(szRootName,'.');
+ if(str2!=NULL) *str2=0;
+ if(lstrlen(szRootName)>3 && !lstrcmpi(szRootName+lstrlen(szRootName)-3,_T("tmp")))
+ continue;
+ lstrcat(szRootName,type);
+ i=SendDlgItemMessage(hdlg,IDC_LIST,LB_ADDSTRING,0,(LPARAM)szRootName);
+ str2 = (TCHAR*)mir_alloc((lstrlen(dbPath) + 2+lstrlen(fd.cFileName))*sizeof(TCHAR));
+ wsprintf(str2, _T("%s\\%s"), dbPath, fd.cFileName);
+ SendDlgItemMessage(hdlg,IDC_LIST,LB_SETITEMDATA,i,(LPARAM)str2);
+ }
+ while( FindNextFile( hFind, &fd ));
+
+ FindClose(hFind);
+ }
+}
+
+INT_PTR CALLBACK MirabilisPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ {
+ HKEY hKey;
+ LONG lResult;
+ int i;
+ TranslateDialogDefault(hdlg);
+ if (ERROR_SUCCESS != (lResult = RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Mirabilis\\ICQ\\DefaultPrefs"), 0, KEY_QUERY_VALUE, &hKey)))
+ lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Mirabilis\\ICQ\\DefaultPrefs"), 0, KEY_QUERY_VALUE, &hKey);
+
+ if (lResult == ERROR_SUCCESS) {
+ TCHAR dbPath[MAX_PATH];
+ DWORD cch;
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("New Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (99a)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("99b Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (99b)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2000a Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2000a)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2000b Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2000b)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2001a Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2001a)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2001b Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2001b)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2002a Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2002a)"));
+ cch=sizeof(dbPath);
+ if(ERROR_SUCCESS==RegQueryValueEx(hKey,_T("2003a Database"),NULL,NULL,(LPBYTE)dbPath,&cch))
+ SearchForDatabases(hdlg,dbPath,_T(" (2003a)"));
+ }
+
+ for (i = 0; i < cICQAccounts; i++)
+ {
+ SendDlgItemMessage(hdlg, IDC_MIRABILISACCOUNT, CB_ADDSTRING, 0, (LPARAM)tszICQAccountName[i]);
+ }
+ SendDlgItemMessage(hdlg, IDC_MIRABILISACCOUNT, CB_SETCURSEL, 0, 0);
+
+ SetTimer(hdlg,1,2000,NULL);
+ SendMessage(hdlg,WM_TIMER,0,0);
+ return TRUE;
+ }
+ case WM_TIMER:
+ { HANDLE hMirabilisMutex;
+ hMirabilisMutex=OpenMutexA(MUTEX_ALL_ACCESS,FALSE,"Mirabilis ICQ Mutex");
+ if(hMirabilisMutex!=NULL) {
+ CloseHandle(hMirabilisMutex);
+ ShowWindow(GetDlgItem(hdlg,IDC_MIRABILISRUNNING),SW_SHOW);
+ }
+ else ShowWindow(GetDlgItem(hdlg,IDC_MIRABILISRUNNING),SW_HIDE);
+ }
+ break;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_IMPORTTYPE,(LPARAM)ImportTypePageProc);
+ break;
+ case IDOK:
+ { TCHAR filename[MAX_PATH];
+ GetDlgItemText(hdlg,IDC_FILENAME,filename,SIZEOF(filename));
+ if(_taccess(filename,4)) {
+ MessageBox(hdlg,TranslateT("The given file does not exist. Please check that you have entered the name correctly."),TranslateT("Mirabilis Import"),MB_OK);
+ break;
+ }
+ lstrcpy(importFile,filename);
+ iICQAccount = SendDlgItemMessage(hdlg, IDC_MIRABILISACCOUNT, CB_GETCURSEL, 0, 0);
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_OPTIONS,(LPARAM)MirabilisOptionsPageProc);
+ break;
+ }
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg),WM_CLOSE,0,0);
+ break;
+ case IDC_LIST:
+ if(HIWORD(wParam)==LBN_SELCHANGE) {
+ int sel=SendDlgItemMessage(hdlg,IDC_LIST,LB_GETCURSEL,0,0);
+ if(sel==LB_ERR) break;
+ SetDlgItemText(hdlg,IDC_FILENAME,(TCHAR*)SendDlgItemMessage(hdlg,IDC_LIST,LB_GETITEMDATA,sel,0));
+ }
+ break;
+ case IDC_OTHER:
+ { OPENFILENAME ofn;
+ TCHAR str[MAX_PATH], text[256];
+ int index;
+
+ // TranslateTS doesnt translate \0 separated strings
+ index = mir_sntprintf(text, 64, _T("%s (*.idx)"), TranslateT("Mirabilis ICQ database indexes")) + 1;
+ _tcscpy(text + index, _T("*.idx")); index += 6;
+ index += mir_sntprintf(text + index, 64, _T("%s (*.*)"), TranslateT("All Files")) + 1;
+ _tcscpy(text + index, _T("*.*")); index += 4;
+ text[index] = 0;
+
+ GetDlgItemText(hdlg,IDC_FILENAME,str,SIZEOF(str));
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hdlg;
+ ofn.lpstrFilter = text;
+ ofn.lpstrFile = str;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_DONTADDTORECENT;
+ ofn.nMaxFile = SIZEOF(str);
+ ofn.lpstrDefExt = _T("idx");
+ if(GetOpenFileName(&ofn))
+ SetDlgItemText(hdlg,IDC_FILENAME,str);
+ break;
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ { int i;
+ for(i=SendDlgItemMessage(hdlg,IDC_LIST,LB_GETCOUNT,0,0)-1;i>=0;i--)
+ mir_free((char*)SendDlgItemMessage(hdlg,IDC_LIST,LB_GETITEMDATA,i,0));
+ break;
+ }
+ }
+ return FALSE;
+}
+
+
+INT_PTR CALLBACK MirabilisOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ EnableWindow(GetDlgItem(hdlg, IDC_RADIO_ALL), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_STATIC_ALL), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_RADIO_CONTACTS), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDC_STATIC_CONTACTS), TRUE);
+ CheckDlgButton(hdlg, IDC_RADIO_ALL, BST_CHECKED);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_MIRABILISDB, (LPARAM)MirabilisPageProc);
+ break;
+ case IDOK:
+ if (IsDlgButtonChecked(hdlg, IDC_RADIO_ALL)) {
+ DoImport = MirabilisImport;
+ nImportOption = IMPORT_ALL;
+ nCustomOptions = IOPT_MSGSENT|IOPT_MSGRECV|IOPT_URLSENT|IOPT_URLRECV;
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_PROGRESS, (LPARAM)ProgressPageProc);
+ break;
+ }
+ if (IsDlgButtonChecked(hdlg, IDC_RADIO_CONTACTS)) {
+ DoImport = MirabilisImport;
+ nImportOption = IMPORT_CONTACTS;
+ nCustomOptions = 0;
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_PROGRESS, (LPARAM)ProgressPageProc);
+ break;
+ }
+ break;
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+static int GetHighestIndexEntry(void)
+{
+ struct TIdxIndexEntry *entry;
+ DWORD ofs;
+
+ ofs=*(PDWORD)(pIdx+12);
+ for(;;) {
+ entry=(struct TIdxIndexEntry*)(pIdx+ofs);
+ if(entry->entryIdLow==(DWORD)-2) return ((struct TIdxDatEntry*)entry)->entryId;
+ if(entry->ofsHigher>=0xF0000000) ofs=entry->ofsInHere;
+ else ofs=entry->ofsHigher;
+ }
+}
+
+static int GetIdDatOfs(DWORD id)
+{
+ struct TIdxIndexEntry *entry;
+ DWORD ofs = *(PDWORD)(pIdx+12);
+ for(;;) {
+ entry=(struct TIdxIndexEntry*)(pIdx+ofs);
+ if(entry->entryIdLow==(DWORD)-2) {
+ if(entry->entryIdHigh==id) return ((struct TIdxDatEntry*)entry)->datOfs;
+ return 0;
+ }
+ if(id<entry->entryIdLow) ofs=entry->ofsLower;
+ else if(entry->ofsHigher<0xF0000000 && id>=entry->entryIdHigh) ofs=entry->ofsHigher;
+ else ofs=entry->ofsInHere;
+ }
+ return 0;
+}
+
+static int GetDatEntryType(DWORD ofs)
+{
+ return *(int*)(pDat+ofs+4);
+}
+
+DWORD GetDBVersion()
+{
+ dwDBVersion = *(PDWORD)(pIdx+16);
+
+ switch (dwDBVersion) {
+ case DBV99A:
+ AddMessage( LPGEN("This looks like a ICQ 99a database."));
+ break;
+ case DBV99B:
+ AddMessage( LPGEN("This looks like a ICQ 99b database."));
+ break;
+ case DBV2000A:
+ AddMessage( LPGEN("This looks like a ICQ 2000a database."));
+ break;
+ case DBV2000B:
+ AddMessage( LPGEN("This looks like a ICQ 2000b database."));
+ break;
+ case DBV2001A:
+ AddMessage( LPGEN("This looks like a ICQ 2001, 2002 or 2003a database."));
+ break;
+ default:
+ AddMessage( LPGEN("This database is an unknown version."));
+ return 0;
+ }
+
+ return dwDBVersion;
+}
+
+int GetEntryVersion(WORD wSeparatorValue)
+{
+ int nVersion;
+
+ if (wSeparatorValue < ENTRYV99A)
+ nVersion = 0; // Cannot handle ICQ98 contacts
+ else if ((wSeparatorValue >= ENTRYV99A) && (wSeparatorValue < ENTRYV99B))
+ nVersion = ENTRYV99A;
+ else if ((wSeparatorValue >= ENTRYV99B) && (wSeparatorValue < ENTRYV2000A))
+ nVersion = ENTRYV99B;
+ else if ((wSeparatorValue >= ENTRYV2000A) && (wSeparatorValue < ENTRYV2000B))
+ nVersion = ENTRYV2000A;
+ else if ((wSeparatorValue >= ENTRYV2000B) && (wSeparatorValue < ENTRYV2001A))
+ nVersion = ENTRYV2000B;
+ else if ((wSeparatorValue >= ENTRYV2001A) && (wSeparatorValue < ENTRYV2001B))
+ nVersion = ENTRYV2001A;
+ else if ((wSeparatorValue >= ENTRYV2001B) && (wSeparatorValue < ENTRYV2002A))
+ nVersion = ENTRYV2001B;
+ else if (wSeparatorValue >= ENTRYV2002A)
+ nVersion = ENTRYV2002A;
+ else
+ nVersion = ENTRYVUNKNOWN; // Just in case... Skip undocumented contact versions
+
+ return nVersion;
+}
+
+DWORD ReadSubList(DWORD dwOffset)
+{
+ DWORD dwSubType, dwProperties, n;
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Attempting to parse sub list at offset %u."), dwOffset);
+ #endif
+
+ // Check number of properties in sub list
+ dwProperties = *(PDWORD)(pDat+dwOffset);
+ dwOffset+=4;
+
+ // Check sub list type
+ dwSubType = *(PBYTE)(pDat+dwOffset);
+ dwOffset+=1;
+
+ switch (dwSubType){
+ case 0x6B:
+ for(n=0;n<dwProperties;n++) dwOffset+=*(PWORD)(pDat+dwOffset)+2;
+ break;
+ case 0x6E:
+ for(n=0;n<dwProperties;n++) {
+ if (!(dwOffset = ReadPropertyBlock(dwOffset, NULL, NULL))) return 0;
+ }
+ break;
+ default:
+ // Unknown sub list type
+ AddMessage( LPGEN("Error: Unknown sub list type (%u) at offset %u."), dwSubType, dwOffset);
+ return 0;
+ }
+
+ return dwOffset;
+}
+
+DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult)
+{
+ DWORD n, dwProperties, nameOfs;
+ WORD nameLen;
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Attempting to parse property block at offset %u."), dwOffset );
+ #endif
+
+ // Reset search result
+ if (SearchWord) *nSearchResult = 0;
+
+ // Check number of properties in block
+ dwOffset+=2;
+ dwProperties = *(PDWORD)(pDat+dwOffset);
+
+ // Scan all properties and search for
+ // 'SearchWord' (if it has been specified).
+ dwOffset+=4;
+ for(n=0;n<dwProperties;n++) {
+ nameLen=*(PWORD)(pDat+dwOffset); // Length of current property name
+ dwOffset+=2;
+ nameOfs=dwOffset; // Save pointer to start of name
+ dwOffset+=nameLen; // dwOffset now points to property value type
+
+ if ( SearchWord ) {
+ // Is this the property we are searching for?
+ if(!lstrcmpA((char*)(pDat+nameOfs),SearchWord)){
+ *nSearchResult = 1;
+ return dwOffset;
+ } }
+
+ // Increase 'dwOffset' to point to length of next property
+ switch(*(pDat+dwOffset)) {
+ case 0x64:
+ case 0x65: dwOffset+=2; break;
+ case 0x66:
+ case 0x67: dwOffset+=3; break;
+ case 0x68:
+ case 0x69: dwOffset+=5; break;
+ case 0x6b: dwOffset+=*(PWORD)(pDat+dwOffset+1)+3; break;
+ case 0x6d:
+ dwOffset = ReadSubList(dwOffset+1);
+ if (!dwOffset) return 0;
+ break;
+ case 0x6f: dwOffset+=*(PDWORD)(pDat+dwOffset+1)+5; break;
+ default:
+ // Unknown property value type
+ AddMessage( LPGEN("Error: Unknown datatype (%u) at offset %u."), *(pDat+dwOffset), dwOffset);
+ return 0;
+ } }
+
+ // We have reached the end without finding
+ // the property we searched for
+ if (SearchWord) *nSearchResult = 0;
+
+ // Return offset to the byte right after the
+ // property list
+ return dwOffset;
+}
+
+DWORD ReadPropertyBlockList(DWORD dwOffset, char* SearchWord, int* nSearchResult)
+{
+ DWORD dwBlocks, n;
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Attempting to parse property block list at offset %u."), dwOffset );
+ #endif
+
+ // Check number of blocks in list
+ dwBlocks = *(PDWORD)(pDat+dwOffset);
+
+ // Scan all blocks and search for 'SearchWord' (if
+ // it has been specified).
+ dwOffset += 4;
+ for(n = 0;n<dwBlocks;n++) {
+ if (!(dwOffset = ReadPropertyBlock(dwOffset, SearchWord, nSearchResult))) {
+ AddMessage( LPGEN("Failed to read Property block."));
+ return 0;
+ }
+ if (SearchWord)
+ // Was the property found in the block?
+ if (*nSearchResult) return dwOffset;
+ }
+
+ // We have reached the end without finding
+ // the property we searched for
+ if (SearchWord) *nSearchResult = 0;
+
+ // Return offset to the byte right after the
+ // property list
+ return dwOffset;
+}
+
+DWORD ReadWavList(DWORD dwOffset)
+{
+ DWORD dwWavEntries, n;
+ WORD wNameLen;
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Attempting to parse wav file list at offset %u."), dwOffset);
+ #endif
+
+ // Check number of wav entries
+ dwWavEntries = *(PDWORD)(pDat+dwOffset);
+
+ // Read entire list
+ dwOffset+=4;
+ for(n = 0;n<dwWavEntries;n++) {
+ wNameLen = *(PWORD)(pDat+dwOffset+0x0A);
+ dwOffset += wNameLen + 0x0C;
+ }
+
+ // Return the offset to the byte right
+ // after the list
+ return dwOffset;
+}
+
+DWORD FindMyDetails(void)
+{
+ DWORD dwOffset = GetIdDatOfs(1005);
+
+ if (!dwOffset) return 0;
+ if(*(PDWORD)(pDat+dwOffset+0x08) != 1005) return 0;
+ if(*(PBYTE)(pDat+dwOffset+0x0C) != 0xE4) return 0;
+ if(*(int*)(pDat+dwOffset+0x1e) != 'USER') return 0;
+ if(*(PDWORD)(pDat+dwOffset+0x22) != 6) return 0;
+
+ return dwOffset;
+}
+
+// dwOffset must point to MyDetails
+DWORD FindGroupList(DWORD dwOffset)
+{
+ DWORD n, dwPhoneEntries;
+ WORD wSeparatorValue;
+ int nFormat;
+
+ wSeparatorValue = *(PWORD)(pDat+dwOffset+0x1c);
+ nFormat = GetEntryVersion(wSeparatorValue);
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Attempting to parse group list, type %d."), nFormat );
+ #endif
+
+ switch (nFormat) {
+ case ENTRYV99A:
+ if (!(dwOffset = ReadWavList(dwOffset+0x54))) return 0;
+ if (!(dwOffset = ReadPropertyBlock(dwOffset+38, NULL, NULL))) return 0;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // User name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Nick name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // First name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Last name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Primary e-mail
+ dwOffset += 0x13; // Various fixed length data
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home city
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home state
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Additional details
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // User homepage
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home phone number
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Notes
+ dwOffset += 0x08; // Various fixed length data
+ dwOffset += 0x04; // ++ UNKNOWN ++
+ dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook starts here
+ dwOffset += 0x04;
+ for(n = 0;n<dwPhoneEntries;n++){
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += 2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ }
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Picture file name
+ dwOffset += 0x06; // ++ UNKNOWN ++ (8 enligt spec)
+ dwOffset += 0x06; // Various fixed length data
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Secondary e-mail
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Old e-mail
+ dwOffset += 0x04; // ++ UNKNOWN ++
+ dwOffset += 0x03; // Various fixed length data
+ dwOffset += 0x08; // ++ UNKNOWN ++
+ dwOffset += 0x03; // Various fixed length data
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home street address
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home fax number
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Home cell phone number
+ dwOffset += 0x04; // ++ UNKNOWN ++
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Company Div/Dept
+ dwOffset += 0x01; // Occupation
+ dwOffset += 0x04; // ++ UNKNOWN ++
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Company position
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Company name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work street address
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work state
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work city
+ dwOffset += 0x08; // Various fixed length data
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work phone number
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work fax number
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Work homepage
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Past background #1
+ dwOffset += 0x02; // Past background #1 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Past background #2
+ dwOffset += 0x02; // Past background #2 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Past background #3
+ dwOffset += 0x02; // Past background #3 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Affiliation #1
+ dwOffset += 0x02; // Affiliation #1 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Affiliation #2
+ dwOffset += 0x02; // Affiliation #2 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Affiliation #3
+ dwOffset += 0x02; // Affiliation #3 category
+ dwOffset += 0x14; // ++ UNKNOWN ++
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Interest #1
+ dwOffset += 0x02; // Interest #1 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Interest #2
+ dwOffset += 0x02; // Interest #2 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Interest #3
+ dwOffset += 0x02; // Interest #3 category
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Interest #4
+ dwOffset += 0x02; // Interest #4 category
+ dwOffset += 0x28; // ++ UNKNOWN ++
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // Password
+ dwOffset += 0x04; // ++ UNKNOWN ++
+ dwOffset += 0x0E; // ++ UNKNOWN ++
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // POP3 account name
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // POP3 account password
+ dwOffset += *(PWORD)(pDat+dwOffset)+2; // POP server name
+ dwOffset += 0x15; // ++ UNKNOWN ++
+ return dwOffset;
+
+ case ENTRYV99B:
+ if (!(dwOffset = ReadWavList(dwOffset+0x2C))) return 0;
+ if (!(dwOffset = ReadPropertyBlockList(dwOffset+0x02, NULL, NULL))) return 0;
+ dwOffset += 0x08;
+ dwPhoneEntries = *(PDWORD)(pDat+dwOffset); // Phonebook
+ dwOffset += 0x04;
+ for(n = 0;n<dwPhoneEntries;n++){
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ dwOffset += 2;
+ dwOffset += *(PWORD)(pDat+dwOffset)+2;
+ }
+ return dwOffset + 0x06;
+
+ case ENTRYV2000A:
+ case ENTRYV2000B:
+ case ENTRYV2002A:
+ if (!(dwOffset = ReadWavList(dwOffset+0x2C))) return 0;
+ if (!(dwOffset = ReadPropertyBlockList(dwOffset+0x02, NULL, NULL))) return 0;
+ return dwOffset + 0x06;
+
+ case ENTRYV2001A:
+ case ENTRYV2001B:
+ if (!(dwOffset = ReadPropertyBlockList(dwOffset+0x2C, NULL, NULL))) return 0;
+ return dwOffset + 0x06;
+
+ default:
+ AddMessage( LPGEN("default"));
+ return 0;
+ }
+}
+
+// ------------------------------------------------
+// Finds the name of a group with a specific GroupID.
+// ------------------------------------------------
+// dwGroupID is the GroupID of the group.
+// Returns a pointer to the name string or NULL if
+// it was not found.
+char* GetGroupName(DWORD dwGroupID)
+{
+ DWORD dwGroups, n, tmpOfs, dwOffset;
+ char* strGroupName = 0;
+ int nSearchResult;
+
+ // Check for the existence of any group
+ if (!dwGroupListOfs) return 0;
+ dwOffset = dwGroupListOfs;
+ dwGroups = *(PDWORD)(pDat + dwOffset);
+ if (dwGroups == 0) return 0;
+
+ dwOffset += 4;
+
+ // Examine all groups
+ switch (dwDBVersion) {
+ case DBV99A:
+ case DBV99B:
+ for (n = 0; n < dwGroups; n++){
+ if (dwGroupID == *(PDWORD)(pDat + dwOffset)){
+ if (*(PWORD)(pDat + dwOffset + 4) > 1)
+ return 6 + (char*)(pDat + dwOffset);
+
+ break;
+ }
+ else
+ // Skip to next group
+ dwOffset += *(PWORD)(pDat + dwOffset + 4) + 12;
+ }
+ break;
+
+ case DBV2000A:
+ case DBV2000B:
+ case DBV2001A:
+ for (n = 0; n < dwGroups; n++){
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupID", &nSearchResult)){
+ if (nSearchResult) {
+ if (dwGroupID == *(PDWORD)(pDat + tmpOfs + 1)){
+ strGroupName = 3 + (char*)(pDat + ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult));
+ if (nSearchResult) {
+ if ((DWORD)*(strGroupName - 2) > 1)
+ return strGroupName;
+ break;
+ } } } }
+
+ // Skip to next group
+ if ( dwOffset != ReadPropertyBlock(dwOffset, NULL, NULL))
+ break;
+ }
+ break;
+ }
+
+ // The GroupID was not found, or it was found
+ // but the group did not have a name, or there
+ // was an error during parsing.
+ return 0;
+}
+
+// ------------------------------------------------
+// Scans a group list and adds all found groups to
+// the Miranda contact list
+// ------------------------------------------------
+// dwOffset must point to the number of entries in
+// the following group list.
+// Returns the number of added groups, or -1 if an error
+// occurred
+
+int ImportGroups()
+{
+ DWORD dwGroups, n, tmpOfs, dwOffset;
+ int nImported = 0;
+ int nSearchResult, nFormat;
+ WORD wSeparatorValue;
+
+ if (!(dwOffset = FindMyDetails())) {
+ AddMessage( LPGEN("ERROR: Failed to find owner information."));
+ return -1;
+ }
+
+ wSeparatorValue = *(PWORD)(pDat + dwOffset + 0x1c);
+ nFormat = GetEntryVersion(wSeparatorValue);
+
+ dwGroupListOfs = dwOffset = FindGroupList(dwOffset);
+ if (!dwOffset) {
+ AddMessage( LPGEN("ERROR: Failed to find contact list groups."));
+ #ifdef _LOGGING
+ { // If this is a debug build, dump MyDetails block to disk
+ FILE *stream;
+ DWORD dwSize;
+ dwOffset = FindMyDetails();
+ dwSize = *(PDWORD)(pDat + dwOffset);
+ stream = fopen("import_grouplist_dump.bin", "w");
+ fwrite(pDat + dwOffset, 1, dwSize, stream);
+ fclose(stream);
+ }
+ #endif
+ return -1;
+ }
+
+ // Check number of groups
+ dwGroups = *(PDWORD)(pDat + dwOffset);
+ if (dwGroups > 0)
+ AddMessage( LPGEN("Importing groups."));
+ else {
+ AddMessage( LPGEN("This database does not contain any contact groups."));
+ return 0;
+ }
+
+ dwOffset += 4;
+
+ // Import all groups with a name
+ switch (nFormat) {
+ case ENTRYV99A:
+ case ENTRYV99B:
+ for (n = 0; n < dwGroups; n++){
+ if (*(PWORD)(pDat+dwOffset+4) > 1) {
+ if ( CreateGroup(DBVT_ASCIIZ, (char*)(pDat + dwOffset) + 6, NULL ))
+ nImported++;
+ dwOffset += *(PWORD)(pDat + dwOffset + 4) + 12;
+ } }
+ break;
+
+ case ENTRYV2000A:
+ case ENTRYV2000B:
+ case ENTRYV2001A:
+ case ENTRYV2001B:
+ case ENTRYV2002A:
+ for (n = 0; n < dwGroups; n++){
+ if (tmpOfs = ReadPropertyBlock(dwOffset, "GroupName", &nSearchResult)){
+ if (nSearchResult) {
+ if (CreateGroup( DBVT_ASCIIZ, (char*)(pDat + tmpOfs + 3), NULL ))
+ nImported++;
+ } }
+
+ dwOffset = ReadPropertyBlock(dwOffset, NULL, NULL);
+ if (!dwOffset) {
+ AddMessage( LPGEN("ERROR: An error occurred while importing groups."));
+ AddMessage( LPGEN("All groups may not have not been imported."));
+ #ifdef _LOGGING
+ { // If this is a debug build, dump MyDetails block to disk
+ FILE *stream;
+ DWORD dwSize;
+ dwOffset = FindMyDetails();
+ dwSize = *(PDWORD)(pDat + dwOffset);
+ stream = fopen("import_grouplist_dump.bin", "w");
+ fwrite(pDat + dwOffset, 1, dwSize, stream);
+ fclose(stream);
+ }
+ #endif
+ return -1;
+ } }
+ break;
+
+ default:
+ return -1;
+ }
+
+ return nImported;
+}
+
+// Imports the contact at offset dwOffset
+// Returns the HANDLE of the Miranda contact
+// or INVALID_HANDLE_VALUE on failure
+
+HANDLE ImportContact(DWORD dwOffset)
+{
+ int nContactVersion, nSearchResult;
+ BYTE Status;
+ WORD wSeparatorValue;
+ DWORD dwGroup, dwUIN = 0, tmpOfs = 0;
+ char *strNickname = 0, *strGroupName = 0;
+
+ if (*(int*)(pDat + dwOffset + 4) != DATENTRY_CONTACT)
+ return INVALID_HANDLE_VALUE;
+
+ if (*(int*)(pDat + dwOffset + 0x1e) != 'USER')
+ return INVALID_HANDLE_VALUE;
+
+ #ifdef _LOGGING
+ { // If this is a debug build, dump contact to disk
+ FILE *stream;
+ DWORD dwSize;
+ dwSize = *(PDWORD)(pDat + dwOffset);
+ stream = fopen("import_last_contact.bin", "w");
+ fwrite(pDat + dwOffset, 1, dwSize, stream);
+ fclose(stream);
+ }
+ #endif
+
+ Status = *(pDat + dwOffset + 0x22);
+ wSeparatorValue = *(PWORD)(pDat + dwOffset + 0x1c);
+ nContactVersion = GetEntryVersion(wSeparatorValue);
+
+ dwGroup = *(PDWORD)(pDat + dwOffset + 0x26);
+ if (dwGroup >= 1000)
+ strGroupName = GetGroupName(dwGroup);
+
+ if (Status == 5)
+ return INVALID_HANDLE_VALUE; // Skip deleted contacts
+
+ if ((Status != 2) && (Status != 3)) {
+ AddMessage( LPGEN("Skipping inactive contact."));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if ((nContactVersion < ENTRYV99A) || (nContactVersion == 0)) {
+ AddMessage( LPGEN("Skipping contact with unsupported version."));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ switch(nContactVersion){
+ case ENTRYV99A:
+ if (!(dwOffset = ReadWavList(dwOffset + 0x54))) return INVALID_HANDLE_VALUE;
+ if (!(dwOffset = ReadPropertyBlock(dwOffset + 0x26, NULL, NULL))) return INVALID_HANDLE_VALUE;
+ // Check for custom nickname
+ if (*(PWORD)(pDat + dwOffset) > 1) strNickname = (char*)(dwOffset + pDat + 2);
+ // Find UIN
+ dwOffset += *(PWORD)(pDat + dwOffset) + 2; // Custom nick name
+ dwOffset += *(PWORD)(pDat + dwOffset) + 2; // Nick name
+ dwOffset += *(PWORD)(pDat + dwOffset) + 2; // First name
+ dwOffset += *(PWORD)(pDat + dwOffset) + 2; // Last name
+ dwOffset += *(PWORD)(pDat + dwOffset) + 2; // E-mail
+ dwUIN = *(PDWORD)(pDat + dwOffset); // UIN
+ break;
+
+ case ENTRYV99B:
+ case ENTRYV2000A:
+ case ENTRYV2000B:
+ if (!(dwOffset = ReadWavList(dwOffset + 0x2C))) return INVALID_HANDLE_VALUE;
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x02, "UIN", &nSearchResult);
+ if (nSearchResult) dwUIN = *(PDWORD)(pDat + tmpOfs + 1);
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x02, "MyDefinedHandle", &nSearchResult);
+ if (nSearchResult) strNickname = (char*)(tmpOfs + pDat + 3);
+ break;
+
+ case ENTRYV2001A:
+ case ENTRYV2001B:
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x2C, "MyDefinedHandle", &nSearchResult);
+ if (nSearchResult) strNickname = (char*)(tmpOfs + pDat + 3);
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x2C, "UIN", &nSearchResult);
+ if (nSearchResult) dwUIN = *(PDWORD)(pDat + tmpOfs + 1);
+ break;
+
+ case ENTRYV2002A:
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x32, "MyDefinedHandle", &nSearchResult);
+ if (nSearchResult) strNickname = (char*)(tmpOfs + pDat + 3);
+ tmpOfs = ReadPropertyBlockList(dwOffset + 0x32, "UIN", &nSearchResult);
+ if (nSearchResult) dwUIN = *(PDWORD)(pDat + tmpOfs + 1);
+ break;
+ }
+
+ if (!dwUIN) {
+ AddMessage( LPGEN("Skipping unrecognizable contact."));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if (dwUIN < 10000) {
+ AddMessage( LPGEN("Skipping non-ICQ contact %u."), dwUIN );
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if (HContactFromNumericID( szICQModuleName[ iICQAccount ], "UIN", dwUIN) == INVALID_HANDLE_VALUE) {
+ DBVARIANT id, nick, group;
+ id.type = DBVT_DWORD; id.dVal = dwUIN;
+ if ( strNickname != NULL && strlen(strNickname) > 0 )
+ nick.type = DBVT_ASCIIZ, nick.pszVal = strNickname;
+ else
+ nick.type = DBVT_DELETED;
+ group.type = DBVT_ASCIIZ, group.pszVal = strGroupName;
+ return AddContact(hdlgProgress, szICQModuleName[ iICQAccount ], "UIN", &id, &nick, &group);
+ }
+ else {
+ if ((strNickname != NULL) && (strlen(strNickname) > 0))
+ AddMessage( LPGEN("Skipping duplicate ICQ contact %u, %s"), dwUIN, strNickname);
+ else
+ AddMessage( LPGEN("Skipping duplicate ICQ contact %u"), dwUIN);
+ }
+
+ // Failure
+ return INVALID_HANDLE_VALUE;
+}
+
+BOOL ImportMessage(DWORD dwOffset)
+{
+ struct TDatMessage *msg = (struct TDatMessage*)(pDat + dwOffset);
+ struct TDatEntryFooter *footer;
+ DBEVENTINFO dbei;
+ HANDLE hContact;
+ int nUCTOffset;
+ TIME_ZONE_INFORMATION TimeZoneInformation;
+ int nHistoryCount = 0;
+
+ // Get timestamp offset. In ICQ, event timestamps are stored
+ // as UTC + (0-TZ offset). YES! That's the negation of the
+ // timezone offset, only God and Mirabilis knows why.
+ GetTimeZoneInformation(&TimeZoneInformation);
+ nUCTOffset = -TimeZoneInformation.Bias * 60;
+
+ // Ignore messages in 'Deleted' folder
+ if (msg->filingStatus&FILING_DELETED)
+ return FALSE;
+
+ // Skip messages from non-icq contacts
+ if (msg->uin < 10000) {
+ AddMessage( LPGEN("Ignoring msg from user %d at ofs %d."), msg->uin, dwOffset );
+ return FALSE;
+ }
+
+ // Ignore received messages?
+ if (( msg->filingStatus & FILING_RECEIVED ) && !( nCustomOptions & IOPT_MSGRECV ))
+ return FALSE;
+
+ // Ignores sent messages?
+ if ( !(msg->filingStatus & FILING_RECEIVED) && !( nCustomOptions & IOPT_MSGSENT ))
+ return FALSE;
+
+ // Check if contact exists in Miranda database
+ hContact = HistoryImportFindContact(hdlgProgress, szICQModuleName[ iICQAccount ], msg->uin, nCustomOptions&IOPT_ADDUNKNOWN);
+ if (hContact == INVALID_HANDLE_VALUE)
+ return FALSE; // Contact couldn't be found/added
+
+ // Convert the event to a Miranda dbevent
+ footer = (struct TDatEntryFooter*)(pDat + dwOffset + msg->textLen + offsetof(struct TDatMessage, text));
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = footer->sent == 1 ? DBEF_SENT : DBEF_READ;
+ dbei.szModule = szICQModuleName[ iICQAccount ];
+ // Convert timestamp
+ dbei.timestamp = footer->timestamp + nUCTOffset;
+ dbei.cbBlob = msg->textLen;
+ dbei.pBlob = (PBYTE)alloca(msg->textLen);
+ CopyMemory(dbei.pBlob, msg->text, dbei.cbBlob);
+ dbei.pBlob[dbei.cbBlob - 1] = 0;
+
+ // Check for duplicate entries
+ if (IsDuplicateEvent(hContact, dbei)) {
+ nDupes++;
+ }
+ else {
+ if (CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei))
+ nMessagesCount++;
+ }
+
+ return TRUE;
+}
+
+BOOL ImportExtendedMessage(DWORD dwOffset)
+{
+ struct TDatMessage *msg = (struct TDatMessage*)(pDat + dwOffset);
+ struct TDatEntryFooter *footer;
+ DBEVENTINFO dbei;
+ HANDLE hContact;
+ int nUCTOffset;
+ TIME_ZONE_INFORMATION TimeZoneInformation;
+ int nHistoryCount = 0;
+ char* pszText = 0;
+ DWORD dwRichTextOffset = 0;
+ DWORD wRichTextLength = 0;
+ DWORD wLength = 0;
+ BOOL bFreeMe = FALSE;
+
+ // Get timestamp offset. In ICQ, event timestamps are stored
+ // as UTC + (0-TZ offset). YES! That's the negation of the
+ // timezone offset, only God and Mirabilis knows why.
+ GetTimeZoneInformation(&TimeZoneInformation);
+ nUCTOffset = -TimeZoneInformation.Bias * 60;
+
+ // Ignore messages in 'Deleted' folder
+ if (msg->filingStatus&FILING_DELETED)
+ return FALSE;
+
+ // Skip messages from non-icq contacts
+ if (msg->uin < 10000) {
+ AddMessage( LPGEN("Ignoring msg from user %d at ofs %d."), msg->uin, dwOffset );
+ return FALSE;
+ }
+
+ // Ignore received messages?
+ if (( msg->filingStatus & FILING_RECEIVED) && !( nCustomOptions & IOPT_MSGRECV ))
+ return FALSE;
+
+ // Ignore sent messages?
+ if ( !( msg->filingStatus & FILING_RECEIVED ) && !( nCustomOptions & IOPT_MSGSENT ))
+ return FALSE;
+
+ // Check if contact exists in Miranda database
+ hContact = HistoryImportFindContact(hdlgProgress, szICQModuleName[ iICQAccount ], msg->uin, nCustomOptions&IOPT_ADDUNKNOWN);
+ if (hContact == INVALID_HANDLE_VALUE)
+ return FALSE; // Contact couldn't be found/added
+
+ // Find a piece of usable text content
+ if (msg->textLen <= 1) {
+ // Skip past the RTF segment
+ wRichTextLength = *(PWORD)(pDat + dwOffset + 0x2A + msg->textLen + 0x21);
+ dwRichTextOffset = dwOffset + 0x2A + msg->textLen + 0x23;
+
+ // Use the UTF-8 text segment
+ wLength = *(PWORD)(pDat + dwRichTextOffset + wRichTextLength);
+ if (wLength <= 1) {
+ AddMessage( LPGEN("Ignoring msg with no text from %d ofs %d."), msg->uin, dwOffset );
+ return FALSE;
+ }
+ pszText = _strdup(pDat + dwRichTextOffset + wRichTextLength + 2);
+ bFreeMe = TRUE;
+ mir_utf8decode(pszText, NULL);
+ wLength = (DWORD)strlen(pszText)+1;
+ }
+ else {
+ // Use the ANSI text segment
+ wLength = msg->textLen;
+ pszText = pDat + dwOffset + 0x2A;
+ }
+
+ // Convert the event to a Miranda dbevent
+ footer = (struct TDatEntryFooter*)(pDat + dwOffset + msg->textLen + offsetof(struct TDatMessage, text));
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = footer->sent == 1 ? DBEF_SENT : DBEF_READ;
+ dbei.szModule = szICQModuleName[ iICQAccount ];
+ // Convert timestamp
+ dbei.timestamp = footer->timestamp + nUCTOffset;
+ dbei.cbBlob = wLength;
+ dbei.pBlob = (PBYTE)calloc(wLength,1);
+ CopyMemory(dbei.pBlob, pszText, dbei.cbBlob);
+ dbei.pBlob[dbei.cbBlob - 1] = 0;
+
+ // Check for duplicate entries
+ if (IsDuplicateEvent(hContact, dbei)) {
+ nDupes++;
+ }
+ else {
+ if (CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei))
+ nMessagesCount++;
+ }
+
+ free(dbei.pBlob);
+ if (bFreeMe)
+ free(pszText);
+
+ return TRUE;
+}
+
+BOOL ImportURLMessage(DWORD dwOffset)
+{
+ struct TDatMessage *msg = (struct TDatMessage*)(pDat + dwOffset);
+ struct TDatEntryFooter *footer;
+ DBEVENTINFO dbei;
+ HANDLE hContact;
+ int nUCTOffset;
+ TIME_ZONE_INFORMATION TimeZoneInformation;
+ int nHistoryCount = 0;
+ char *pSeparator;
+
+ // Get timestamp offset. In ICQ, event timestamps are stored
+ // as UTC + (0-TZ offset). YES! That's the negation of the
+ // timezone offset, only God and Mirabilis knows why.
+ GetTimeZoneInformation(&TimeZoneInformation);
+ nUCTOffset = -TimeZoneInformation.Bias * 60;
+
+ // Ignore URLs in 'Deleted' folder
+ if (msg->filingStatus&FILING_DELETED)
+ return FALSE;
+
+ // Skip URLs from non-icq contacts
+ if (msg->uin < 10000) {
+ AddMessage( LPGEN("Ignoring msg from user %d at ofs %d."), msg->uin, dwOffset );
+ return FALSE;
+ }
+
+ // Ignore received URLs?
+ if (( msg->filingStatus & FILING_RECEIVED ) && !( nCustomOptions & IOPT_URLRECV ))
+ return FALSE;
+
+ // Ignores sent URLs?
+ if ( !( msg->filingStatus & FILING_RECEIVED ) && !( nCustomOptions & IOPT_URLSENT ))
+ return FALSE;
+
+ // Check if contact exists in Miranda database
+ hContact = HistoryImportFindContact(hdlgProgress, szICQModuleName[ iICQAccount ], msg->uin, nCustomOptions&IOPT_ADDUNKNOWN);
+ if (hContact == INVALID_HANDLE_VALUE)
+ return FALSE; // Contact couldn't be found/added
+
+ // Convert the event to a Miranda dbevent
+ footer = (struct TDatEntryFooter*)(pDat + dwOffset + msg->textLen + offsetof(struct TDatMessage, text));
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.eventType = EVENTTYPE_URL;
+ dbei.flags = footer->sent == 1 ? DBEF_SENT : DBEF_READ;
+ dbei.szModule = szICQModuleName[ iICQAccount ];
+ // Convert timestamp
+ dbei.timestamp = footer->timestamp + nUCTOffset;
+ dbei.cbBlob = msg->textLen;
+ dbei.pBlob = (PBYTE)alloca(msg->textLen);
+ CopyMemory(dbei.pBlob, msg->text, dbei.cbBlob);
+ dbei.pBlob[dbei.cbBlob - 1] = 0;
+ // Separate URL and description
+ pSeparator = strchr((char*)dbei.pBlob, 0xFE);
+ if (pSeparator != NULL)
+ *pSeparator = 0;
+
+ // Check for duplicate entries
+ if (IsDuplicateEvent(hContact, dbei))
+ nDupes++;
+ else if (CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei))
+ nMessagesCount++;
+
+ return TRUE;
+}
+
+BOOL ImportEvent(DWORD dwOffset)
+{
+ struct TDatMessage *msg = (struct TDatMessage*)(pDat + dwOffset);
+
+ // Events have IDs > 2000
+ if (msg->hdr.entryId < 2001) {
+ AddMessage( LPGEN("Skipping event with ID < 2001."));
+ return FALSE;
+ }
+
+ // Separate code paths based on the event signature
+ switch (msg->hdr.subType) {
+
+ case SUBTYPE_MESSAGE: // All kinds of messages
+ switch (msg->type) {
+ case 1: // Normal message
+ if ((nCustomOptions&IOPT_MSGRECV) || (nCustomOptions&IOPT_MSGSENT)) {
+ return ImportMessage(dwOffset);
+ }
+ break;
+
+ case 4: // URL
+ if ((nCustomOptions&IOPT_URLSENT) || (nCustomOptions&IOPT_URLRECV)) {
+ return ImportURLMessage(dwOffset);
+ }
+ break;
+
+ case 6: // Request for authorization
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Request for auth.' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 7: // Authorization request denied
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Auth. denied' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 8: // Authorization request accepted
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Auth. accepted' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 9: // System message
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'System message', ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 12: // You were added
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'You were added' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 13: // WWWPager ?
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'WWW Pager' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 14: // Email Express ?
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Email Express' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 19: // Contact list
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Contact' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 21: // Phonecall request?
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Phonecall' msg (?), ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 26: // SMS request?
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'SMS' msg (?), ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 29: // Active list invitation ??
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 29 msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 30: // Birthday reminder
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 'Birthday' msg (?), ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case 32: // Unknown (Tomer)
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Skipping 32 msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ default:
+ AddMessage( LPGEN("Skipping unknown 0xE0 subtype (%d), ofs %d."), msg->type, dwOffset );
+
+ #ifdef _LOGGING
+ { // If this is a debug build, dump entry to disk
+ FILE *stream;
+ DWORD dwSize = *(PDWORD)(pDat + dwOffset);
+ wsprintfA(str, "import_unknown_E0subtype_%u-%u.bin", msg->type, dwOffset);
+ stream = fopen(str, "w");
+ fwrite(pDat + dwOffset, 1, dwSize, stream);
+ fclose(stream);
+ }
+ #endif
+
+ return FALSE;
+ }
+ break;
+
+ case SUBTYPE_CHATREQUEST: // 0xE1
+ #ifdef _LOGGING
+ if (nImportOption != IMPORT_CONTACTS)
+ AddMessage( LPGEN("Skipping 'Chat request' msg, ofs %d."), dwOffset );
+ #endif
+ break;
+
+ case SUBTYPE_FILEREQUEST: // 0xE2
+ #ifdef _LOGGING
+ if (nImportOption != IMPORT_CONTACTS)
+ AddMessage( LPGEN("Skipping file message offset %d."), dwOffset );
+ #endif
+ break;
+
+ case 0xE3: // External (IPhone, Battlecom) Maybe general voice calls?
+ #ifdef _LOGGING
+ if (nImportOption != IMPORT_CONTACTS)
+ AddMessage( LPGEN("Skipping message type 0xE3 at offset %d."), dwOffset );
+ #endif
+ break;
+
+ case 0xE4: // My details
+ break;
+ case 0xE5: // Contact
+ break;
+ case 0xE6: // Reminder
+ break;
+ case 0xE7: // Addressbook
+ break;
+ case 0xEC: // Voice message
+ break;
+ case 0xED: // Unknown, something to do with chatting and .CHT files
+ // if (importHistory) {
+ // wsprintf(str, "Skipping message type 0xED at offset %d.", dwOffset);
+ // AddMessage( LPGEN(str);
+ // }
+ break;
+ case 0xEE: // Note
+ break;
+ case 0xEF: // Event folder
+ break;
+ // case 0xF0: // Unknown
+ // if (importHistory) {
+ // wsprintf(str, "Skipping message type 0xF0 at offset %d.", dwOffset);
+ // AddMessage( LPGEN(str);
+ // }
+ // break;
+ case 0xF1: // Server list
+ break;
+ // case 0xF6: // Unknown
+ // if (importHistory) {
+ // wsprintf(str, "Skipping message type 0xF6 at offset %d.", dwOffset);
+ // AddMessage( LPGEN(str);
+ // }
+ // break;
+ case 0x50: // Extended message, ICQ 2000a+?
+ if (nImportOption != IMPORT_CONTACTS) {
+ return ImportExtendedMessage(dwOffset);
+ }
+ break;
+
+ case 0xA0: // URL message type 2
+ if (nImportOption != IMPORT_CONTACTS) {
+ if ((msg->filingStatus&FILING_RECEIVED) || (nCustomOptions&IOPT_URLRECV)) {
+ return ImportURLMessage(dwOffset);
+ }
+ }
+ break;
+
+ default:
+ if (nImportOption != IMPORT_CONTACTS) {
+ AddMessage( LPGEN("Skipping unknown event type %d at offset %d."), msg->hdr.subType, dwOffset );
+
+#ifdef _LOGGING
+ { // If this is a debug build, dump entry to disk
+ FILE *stream;
+ DWORD dwSize;
+ dwSize = *(PDWORD)(pDat + dwOffset);
+ wsprintfA(str, "import_unknown_eventtype_%u-%u.bin", msg->hdr.subType, dwOffset);
+ stream = fopen(str, "w");
+ fwrite(pDat + dwOffset, 1, dwSize, stream);
+ fclose(stream);
+ }
+#endif
+
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+
+static void MirabilisImport(HWND hdlgProgressWnd)
+{
+ HANDLE hIdx, hDat, hIdxMapping, hDatMapping;
+ DWORD i, ofs, highestIndexEntry;
+ TCHAR datFilename[MAX_PATH];
+ MSG msg;
+ DWORD dwTimer;
+
+
+ int status = 0;
+ hdlgProgress = hdlgProgressWnd;
+ nDupes = nContactsCount = nMessagesCount = 0;
+
+ SetProgress(0);
+ lstrcpy(datFilename, importFile);
+ {
+ TCHAR* str2;
+ str2 = _tcsrchr(datFilename,'.');
+ if ( str2 != NULL )
+ lstrcpy(str2, _T(".dat"));
+ }
+
+ hIdx = CreateFile(importFile, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ if (hIdx == INVALID_HANDLE_VALUE) {
+ AddMessage( LPGEN("Failed to open index file"));
+ AddMessage( LPGEN("Import aborted"));
+ SetProgress(100);
+ return;
+ }
+
+ hDat = CreateFile(datFilename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
+ if (hDat == INVALID_HANDLE_VALUE) {
+ AddMessage( LPGEN("Failed to open database file"));
+ AddMessage( LPGEN("Import aborted"));
+ SetProgress(100);
+ return;
+ }
+
+ // Creating file mappings
+ hIdxMapping = CreateFileMapping(hIdx, NULL, PAGE_READONLY, 0, 0, NULL);
+ hDatMapping = CreateFileMapping(hDat, NULL, PAGE_READONLY, 0, 0, NULL);
+
+ // Mapping views of files
+ pIdx = (PBYTE)MapViewOfFile(hIdxMapping, FILE_MAP_READ, 0, 0, 0);
+ pDat = (PBYTE)MapViewOfFile(hDatMapping, FILE_MAP_READ, 0, 0, 0);
+
+ // Is this a supported format?
+ if (GetDBVersion()) {
+ AddMessage( "" );
+
+ highestIndexEntry = GetHighestIndexEntry();
+
+ // Import groups
+ nGroupsCount = ImportGroups();
+ if (nGroupsCount < 0) {
+ AddMessage( LPGEN("Group import was not completed."));
+ nGroupsCount = 0;
+ }
+ AddMessage( "" );
+
+ // Start benchmark timer
+ dwTimer = time(NULL);
+
+ if ( !IsProtocolLoaded( szICQModuleName[iICQAccount] )) {
+ AddMessage( LPGEN("ICQ account is not installed."));
+ AddMessage( LPGEN("No ICQ contacts or history will be imported."));
+ AddMessage( "" );
+ }
+ else {
+ // Configure database for fast writing
+ CallService(MS_DB_SETSAFETYMODE, FALSE, 0);
+
+ // Import contacts
+ AddMessage( LPGEN("Importing contacts"));
+ for (i = 2001; i <= highestIndexEntry; i++) { //event ids start at 2001
+ if (!(i%10)) {
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+ if (!(i%100))
+ SetProgress(100 * (i - 2001) / (highestIndexEntry - 2001));
+
+ ofs = GetIdDatOfs(i);
+ if (ofs != 0) {
+ if (ImportContact(ofs) != INVALID_HANDLE_VALUE)
+ nContactsCount++;
+ }
+ }
+ AddMessage( "" );
+
+ // Import history
+ if (nImportOption != IMPORT_CONTACTS) {
+ AddMessage( LPGEN("Importing history (this may take a while)"));
+ for (i = 2001; i <= highestIndexEntry; i++) { //event ids start at 2001
+ if (!(i%10)) {
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ if (!(i%100))
+ SetProgress(100 * (i - 2001) / (highestIndexEntry - 2001));
+
+ ofs = GetIdDatOfs(i);
+ if (ofs != 0) ImportEvent(ofs);
+ }
+ AddMessage( "" );
+ }
+
+ // Restore database writing mode
+ CallService(MS_DB_SETSAFETYMODE, TRUE, 0);
+ }
+
+ dwTimer = time(NULL) - dwTimer;
+
+ AddMessage( LPGEN("Import completed in %d seconds."), dwTimer );
+ SetProgress(100);
+ AddMessage( LPGEN("Added %d contacts and %d groups."), nContactsCount, nGroupsCount );
+ if ( nImportOption != IMPORT_CONTACTS )
+ AddMessage( LPGEN("Added %d events and skipped %d duplicates."), nMessagesCount, nDupes );
+ }
+
+ UnmapViewOfFile(pDat);
+ UnmapViewOfFile(pIdx);
+ CloseHandle(hDatMapping);
+ CloseHandle(hIdxMapping);
+ CloseHandle(hDat);
+ CloseHandle(hIdx);
+}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirabilis.h b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.h
new file mode 100644
index 0000000000..47f10141e1
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirabilis.h
@@ -0,0 +1,200 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001,2002,2003,2004 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+
+
+#ifndef MIRABILIS_H
+#define MIRABILIS_H
+
+#include <windows.h>
+#include <newpluginapi.h>
+#include <m_database.h>
+
+// ======================
+// == GLOBAL FUNCTIONS ==
+// ======================
+
+HANDLE HistoryImportFindContact(HWND hdlgProgress, char* szModuleName, DWORD uin,int addUnknown);
+
+// =====================
+// == LOCAL FUNCTIONS ==
+// =====================
+
+
+// Main function
+static void MirabilisImport(HWND hdlgProgressWnd);
+
+// GUI callbacks
+INT_PTR CALLBACK ImportTypePageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK ProgressPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK MirabilisPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK MirabilisOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+// Helper functions for entries
+static int GetHighestIndexEntry(void);
+static int GetIdDatOfs(DWORD id);
+static int GetDatEntryType(DWORD ofs);
+DWORD FindMyDetails(void);
+
+// Parsing functions
+DWORD GetDBVersion();
+int GetEntryVersion(WORD wSeparatorValue);
+DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult);
+DWORD ReadSubList(DWORD dwOffset);
+DWORD ReadPropertyBlock(DWORD dwOffset, char* SearchWord, int* nSearchResult);
+DWORD ReadPropertyBlockList(DWORD dwOffset, char* SearchWord, int* nSearchResult);
+DWORD ReadWavList(DWORD ofs);
+DWORD FindGroupList(DWORD dwOffset);
+char* GetGroupName(DWORD dwGroupID);
+int ImportGroups();
+static HANDLE ImportContact(DWORD dwOffset);
+
+BOOL ImportEvent(DWORD dwOffset);
+BOOL ImportMessage(DWORD dwOffset);
+BOOL ImportExtendedMessage(DWORD dwOffset);
+BOOL ImportURLMessage(DWORD dwOffset);
+
+
+
+
+// ======================
+// == GLOBAL VARIABLES ==
+// ======================
+
+extern TCHAR importFile[MAX_PATH];
+extern void (*DoImport)(HWND);
+extern int nImportOption;
+extern int nCustomOptions;
+
+
+extern int cICQAccounts;
+extern char ** szICQModuleName;
+extern TCHAR ** tszICQAccountName;
+extern int iICQAccount;
+
+// =====================
+// == LOCAL VARIABLES ==
+// =====================
+
+static DWORD dwDBVersion;
+static DWORD dwGroupListOfs;
+static PBYTE pIdx,pDat;
+
+// =============
+// == DEFINES ==
+// =============
+
+// Contact versions
+// These numbers are not 100% accurate
+#define ENTRYVUNKNOWN -1
+#define ENTRYV99A 200
+#define ENTRYV99B 300
+#define ENTRYV2000A 400
+#define ENTRYV2000B 455
+#define ENTRYV2001A 500
+#define ENTRYV2001B 515
+#define ENTRYV2002A 533
+
+// Database versions
+#define DBV99A 10
+#define DBV99B 14
+#define DBV2000A 17
+#define DBV2000B 18
+#define DBV2001A 19 // This is used by ICQ 2001a, 2001b & 2002a
+
+#define DATENTRY_UNFILED (DWORD)(-1)
+#define DATENTRY_MESSAGE 0
+#define DATENTRY_CONTACT 1
+#define DATENTRY_IGNORED 2
+#define DATENTRY_SYSTEM 9
+
+#define MAX_NON_ICQ_CONTACTS 100
+
+#define SUBTYPE_NEWMESSAGE 0x50
+#define SUBTYPE_NEWURL 0xA0
+
+#define SUBTYPE_MESSAGE 0xE0 //Message / URL Message / Request For Authorization / "Authorization" / System Request / "You Were Added" / Contacts List
+#define SUBTYPE_CHATREQUEST 0xE1
+#define SUBTYPE_FILEREQUEST 0xE2
+#define SUBTYPE_MYDETAILS 0xE4
+#define SUBTYPE_CONTACTINFO 0xE5
+#define SUBTYPE_REMINDER 0xE6
+#define SUBTYPE_ADDRESSBOOK 0xE7
+#define SUBTYPE_VOICEMSG 0xEC //???
+#define SUBTYPE_NOTE 0xEE
+#define SUBTYPE_EVENTFOLDER 0xEF
+#define SUBTYPE_SERVERLIST 0xF1 //and objectionable word list
+#define SUBTYPE_X1 0xF6 //(new to ICQ 99b???)
+
+#define FILING_RECEIVED 0x01
+#define FILING_DELETED 0x02
+#define FILING_MESSAGE 0x04
+#define MSGTYPE_MESSAGE 1
+#define MSGTYPE_URL 4
+#define MSGTYPE_CLIST 19
+#include <pshpack1.h>
+
+struct TIdxDatEntry {
+ DWORD status; //-2=valid, else is an index entry
+ DWORD entryId;
+ DWORD ofsNext,ofsPrev;
+ DWORD datOfs;
+};
+
+struct TIdxIndexEntry {
+ DWORD entryIdLow;
+ DWORD entryIdHigh;
+ DWORD ofsLower;
+ DWORD ofsInHere;
+ DWORD ofsHigher;
+};
+
+struct TDatEntryHeader {
+ DWORD entrySize; //in bytes
+ DWORD entryType; //DATENTRY_* constant
+ DWORD entryId; //same as in index
+ BYTE subType; //SUBTYPE_* constant
+ BYTE signature[15];
+};
+
+struct TDatEntryFooter {
+ DWORD unknown;
+ DWORD sent; //1 if sent, 0 if received
+ WORD separator;
+ DWORD timestamp; //unix time
+};
+
+struct TDatMessage {
+ struct TDatEntryHeader hdr; //hdr.entryType==DATENTRY_MESSAGE && hdr.subType==MSGTYPE_MESSAGE
+ WORD separator;
+ DWORD filingStatus; //FILING_* flags
+ WORD type; //MSGTYPE_* constant
+ DWORD uin;
+ WORD textLen;
+ char text[1]; //0xFE separates description & URL in URLs
+ //a struct TDatEntryFooter comes here
+};
+
+#include <poppack.h>
+
+#endif
diff --git a/plugins/Dbx_mmap_SA/Import_SA/miranda.c b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
new file mode 100644
index 0000000000..6812557533
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/miranda.c
@@ -0,0 +1,1502 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+// ==============
+// == INCLUDES ==
+// ==============
+
+#include "import.h"
+
+#include "mirandadb0700.h"
+
+// ======================
+// == GLOBAL FUNCTIONS ==
+// ======================
+
+HANDLE HContactFromNumericID(char* pszProtoName, char* pszSetting, DWORD dwID);
+HANDLE HContactFromID(char* pszProtoName, char* pszSetting, char* pszID);
+
+HANDLE AddContact(HWND hdlgProgress, char* pszProtoName, char* pszUniqueSetting, DBVARIANT* id, DBVARIANT* nick, DBVARIANT* group);
+
+BOOL IsProtocolLoaded(char* pszProtocolName);
+BOOL IsDuplicateEvent(HANDLE hContact, DBEVENTINFO dbei);
+
+INT_PTR CALLBACK ImportTypePageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK ProgressPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK MirandaOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+// =====================
+// == LOCAL FUNCTIONS ==
+// =====================
+
+void MirandaImport(HWND hdlgProgress);
+int CheckFileFormat(HANDLE hFile);
+static HANDLE ImportContact(HANDLE hDbFile, struct DBContact Contact);
+static void ImportHistory(HANDLE hDbFile, struct DBContact Contact, PROTOCOLDESCRIPTOR **protocol, int protoCount);
+static int ImportGroups(HANDLE hDbFile, struct DBHeader *pdbHeader);
+
+#define NEWSTR_ALLOCA(A) (A==NULL)?NULL:strcpy((char*)alloca(strlen(A)+1),A)
+
+// Comment: The Find* functions only return a file offset.
+// The Get* functions actually reads the requested
+// data from the file and gives you a pointer to a structure
+// containing the data.
+
+DWORD FindFirstContact(struct DBHeader* pDbHeader);
+DWORD FindNextContact(struct DBContact* pDbContact);
+DWORD FindNextEvent(HANDLE hDbFile, DWORD dwOffset);
+DWORD FindOwnerContact(struct DBHeader* pDbHeader);
+
+int GetContactCount(struct DBHeader* pDbHeader);
+BOOL GetContact(HANDLE hDbFile, DWORD dwOffset, struct DBContact* pDbContact);
+BOOL GetSetting(HANDLE hDbFile, struct DBContact* pDbContact, char* pszModuleName, char* pszSettingName, DBVARIANT* pValue);
+char* GetNextSetting(char* pDbSetting);
+BOOL GetSettings(HANDLE hDbFile, DWORD dwOffset, struct DBContactSettings** pDbSettings);
+struct DBContactSettings* GetSettingsGroupByModuleName(HANDLE hdbFile, struct DBContact* pDbContact, char* pszName);
+DWORD GetBlobSize(struct DBContactSettings* pDbSettings);
+int GetSettingByName(struct DBContactSettings* pDbSettings, char* pszSettingName, DBVARIANT* pValue);
+int GetSettingValue(char* pBlob,DBVARIANT* pValue);
+
+BOOL GetEvent(HANDLE hDbFile, DWORD dwOffset, DBEVENTINFO* pDBEI);
+char* GetName(HANDLE hDbFile, DWORD dwOffset);
+
+
+// ======================
+// == GLOBAL VARIABLES ==
+// ======================
+
+extern void (*DoImport)(HWND);
+extern int nImportOption;
+extern int nCustomOptions;
+
+
+// =====================
+// == LOCAL VARIABLES ==
+// =====================
+
+TCHAR importFile[MAX_PATH];
+HWND hdlgProgress;
+DWORD dwFileSize;
+
+DWORD nDupes;
+DWORD nContactsCount;
+DWORD nMessagesCount;
+DWORD nGroupsCount;
+DWORD nSkippedEvents;
+DWORD nSkippedContacts;
+
+time_t dwSinceDate = 0;
+
+// =============
+// == DEFINES ==
+// =============
+
+#define EVENTTYPE_MESSAGE 0
+#define EVENTTYPE_URL 1
+#define EVENTTYPE_FILE 1002
+
+
+// Supported database versions
+#define DB_INVALID 0x00000000 // Unknown or corrupted DAT
+#define DB_000700 0x00000700 // Miranda 0.1.0.0 - 0.1.2.2+
+
+// DAT file signature
+struct DBSignature {
+ char name[15];
+ BYTE eof;
+};
+
+static struct DBSignature dbSignature={"Miranda ICQ DB",0x1A};
+
+// Unsane: Secured signature
+static struct DBSignature dbSignatureEncrypted={"Miranda ICQ SD",0x1A};
+
+// ====================
+// ====================
+// == IMPLEMENTATION ==
+// ====================
+// ====================
+
+static void SearchForLists(HWND hdlg, const TCHAR *mirandaPath, const TCHAR *mirandaProf, const TCHAR *pattern, const TCHAR *type)
+{
+ HANDLE hFind;
+ WIN32_FIND_DATA fd;
+ TCHAR szSearchPath[MAX_PATH];
+ TCHAR szRootName[MAX_PATH];
+ TCHAR* str2;
+ int i;
+
+ mir_sntprintf(szSearchPath, SIZEOF(szSearchPath), _T("%s\\%s"), mirandaPath, pattern);
+ hFind = FindFirstFile(szSearchPath, &fd);
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ _tcscpy(szRootName, fd.cFileName);
+ str2 = _tcsrchr(szRootName, '.');
+ if (str2 != NULL) *str2 = 0;
+ if (mirandaProf == NULL || _tcsicmp(mirandaProf, szRootName))
+ {
+ _tcscat(szRootName, type);
+ i = SendDlgItemMessage(hdlg, IDC_LIST, LB_ADDSTRING, 0, (LPARAM)szRootName);
+ str2 = (TCHAR*)mir_alloc((_tcslen(mirandaPath) + 2 + _tcslen(fd.cFileName)) * sizeof(TCHAR));
+ wsprintf(str2, _T("%s\\%s"), mirandaPath, fd.cFileName);
+ SendDlgItemMessage(hdlg, IDC_LIST, LB_SETITEMDATA, i, (LPARAM)str2);
+ }
+ }
+ while( FindNextFile( hFind, &fd ));
+
+ FindClose( hFind );
+ }
+}
+
+INT_PTR CALLBACK MirandaPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ {
+ TCHAR *pfd, *pfd1, *pfd2, *pfn;
+
+ REPLACEVARSDATA dat = {0};
+ dat.cbSize = sizeof(dat);
+ dat.dwFlags = RVF_TCHAR;
+
+ pfd = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)_T("%miranda_path%\\Profiles"), (LPARAM)&dat);
+ pfd1 = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)_T("%miranda_path%"), (LPARAM)&dat);
+ pfd2 = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)_T("%miranda_profile%"), (LPARAM)&dat);
+ pfn = (TCHAR*)CallService(MS_UTILS_REPLACEVARS, (WPARAM)_T("%miranda_profilename%"), (LPARAM)&dat);
+
+ SearchForLists(hdlg, pfd2, pfn, _T("*.dat"), _T(" (Miranda IM v0.x)"));
+ // Unsane: check for exclude equal or used profiles
+ if (lstrcmpi(pfd1, pfd2))
+ SearchForLists(hdlg, pfd1, NULL, _T("*.dat"), _T(" (Miranda IM v0.x)"));
+ if (lstrcmpi(pfd, pfd2))
+ SearchForLists(hdlg, pfd, NULL, _T("*.dat"), _T(" (Miranda IM v0.x)"));
+
+ mir_free(pfn);
+ mir_free(pfd2);
+ mir_free(pfd1);
+ mir_free(pfd);
+ return TRUE;
+ }
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_IMPORTTYPE,(LPARAM)ImportTypePageProc);
+ break;
+
+ case IDOK:
+ {
+ TCHAR filename[MAX_PATH];
+
+ GetDlgItemText(hdlg, IDC_FILENAME, filename, SIZEOF(filename));
+ if (_taccess(filename, 4)) {
+ MessageBox(hdlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK);
+ break;
+ }
+ lstrcpy(importFile, filename);
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_OPTIONS,(LPARAM)MirandaOptionsPageProc);
+ }
+ break;
+
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg),WM_CLOSE,0,0);
+ break;
+
+ case IDC_LIST:
+ if(HIWORD(wParam)==LBN_SELCHANGE) {
+ int sel = SendDlgItemMessage(hdlg, IDC_LIST, LB_GETCURSEL, 0, 0);
+ if (sel == LB_ERR) break;
+ SetDlgItemText(hdlg, IDC_FILENAME, (TCHAR*)SendDlgItemMessage(hdlg, IDC_LIST, LB_GETITEMDATA, sel, 0));
+ }
+ break;
+
+ case IDC_OTHER:
+ {
+ OPENFILENAME ofn;
+ TCHAR str[MAX_PATH], text[256];
+ TCHAR *pfd;
+ int index;
+
+ pfd = Utils_ReplaceVarsT(_T("%miranda_profile%"));
+
+ // TranslateTS doesnt translate \0 separated strings
+ index = mir_sntprintf(text, 64, _T("%s (*.dat)"), TranslateT("Miranda IM database")) + 1;
+ _tcscpy(text + index, _T("*.dat")); index += 6;
+ index += mir_sntprintf(text + index, 64, _T("%s (*.*)"), TranslateT("All Files")) + 1;
+ _tcscpy(text + index, _T("*.*")); index += 4;
+ text[index] = 0;
+
+ GetDlgItemText(hdlg, IDC_FILENAME, str, SIZEOF(str));
+ ZeroMemory(&ofn, sizeof(ofn));
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hdlg;
+ ofn.lpstrFilter = text;
+ ofn.lpstrDefExt = _T("dat");
+ ofn.lpstrFile = str;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_DONTADDTORECENT;
+ ofn.nMaxFile = SIZEOF(str);
+ ofn.lpstrInitialDir = pfd;
+ if (GetOpenFileName(&ofn))
+ SetDlgItemText(hdlg,IDC_FILENAME,str);
+
+ mir_free(pfd);
+ break;
+ }
+ }
+ break;
+ case WM_DESTROY:
+ {
+ int i;
+
+ for(i=SendDlgItemMessage(hdlg,IDC_LIST,LB_GETCOUNT,0,0)-1;i>=0;i--)
+ mir_free((char*)SendDlgItemMessage(hdlg,IDC_LIST,LB_GETITEMDATA,i,0));
+ break;
+ } }
+
+ return FALSE;
+}
+
+
+INT_PTR CALLBACK MirandaOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ EnableWindow(GetDlgItem(hdlg,IDC_RADIO_ALL), TRUE);
+ EnableWindow(GetDlgItem(hdlg,IDC_STATIC_ALL), TRUE);
+ EnableWindow(GetDlgItem(hdlg,IDC_RADIO_CONTACTS), TRUE);
+ EnableWindow(GetDlgItem(hdlg,IDC_STATIC_CONTACTS), TRUE);
+ EnableWindow(GetDlgItem(hdlg,IDC_RADIO_CUSTOM), TRUE);
+ EnableWindow(GetDlgItem(hdlg,IDC_STATIC_CUSTOM), TRUE);
+ CheckDlgButton(hdlg,IDC_RADIO_ALL,BST_UNCHECKED);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_MIRANDADB,(LPARAM)MirandaPageProc);
+ break;
+
+ case IDOK:
+ if(IsDlgButtonChecked(hdlg,IDC_RADIO_ALL)) {
+ nImportOption = IMPORT_ALL;
+ nCustomOptions = 0;//IOPT_MSGSENT|IOPT_MSGRECV|IOPT_URLSENT|IOPT_URLRECV;
+ DoImport = MirandaImport;
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_PROGRESS,(LPARAM)ProgressPageProc);
+ break;
+ }
+
+ if(IsDlgButtonChecked(hdlg,IDC_RADIO_CONTACTS)) {
+ nImportOption = IMPORT_CONTACTS;
+ nCustomOptions = 0;
+ DoImport = MirandaImport;
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_PROGRESS,(LPARAM)ProgressPageProc);
+ break;
+ }
+
+ if(IsDlgButtonChecked(hdlg,IDC_RADIO_CUSTOM)) {
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_ADVOPTIONS,(LPARAM)MirandaAdvOptionsPageProc);
+ break;
+ }
+ break;
+
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static const UINT InControls[]={IDC_IN_MSG,IDC_IN_URL,IDC_IN_FT,IDC_IN_OTHER};
+static const UINT OutControls[]={IDC_OUT_MSG,IDC_OUT_URL,IDC_OUT_FT,IDC_OUT_OTHER};
+static const UINT SysControls[]={IDC_CONTACTS, IDC_SYSTEM};
+
+INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ {
+ struct tm *TM = NULL;
+ struct _SYSTEMTIME ST = {0};
+
+ dwSinceDate = DBGetContactSettingDword(NULL,IMPORT_MODULE,"ImportSinceTS",time(NULL));
+
+ TM = localtime(&dwSinceDate);
+
+ ST.wYear = TM->tm_year + 1900;
+ ST.wMonth = TM->tm_mon + 1;
+ ST.wDay = TM->tm_mday;
+
+ DateTime_SetSystemtime(GetDlgItem(hdlg,IDC_DATETIMEPICKER),GDT_VALID,&ST);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_OPTIONS,(LPARAM)MirandaOptionsPageProc);
+ break;
+
+ case IDOK:
+ DoImport = MirandaImport;
+ nImportOption = IMPORT_CUSTOM;
+ nCustomOptions = 0;
+
+ if (IsDlgButtonChecked(hdlg,IDC_CONTACTS))
+ nCustomOptions |= IOPT_CONTACTS | IOPT_GROUPS;
+ if (IsDlgButtonChecked(hdlg,IDC_SYSTEM))
+ nCustomOptions |= IOPT_SYSTEM;
+
+ // incoming
+ if (IsDlgButtonChecked(hdlg,IDC_IN_MSG))
+ nCustomOptions |= IOPT_MSGRECV;
+ if (IsDlgButtonChecked(hdlg,IDC_IN_URL))
+ nCustomOptions |= IOPT_URLRECV;
+ if (IsDlgButtonChecked(hdlg,IDC_IN_FT))
+ nCustomOptions |= IOPT_FILERECV;
+ if (IsDlgButtonChecked(hdlg,IDC_IN_OTHER))
+ nCustomOptions |= IOPT_OTHERRECV;
+
+ // outgoing
+ if (IsDlgButtonChecked(hdlg,IDC_OUT_MSG))
+ nCustomOptions |= IOPT_MSGSENT;
+ if (IsDlgButtonChecked(hdlg,IDC_OUT_URL))
+ nCustomOptions |= IOPT_URLSENT;
+ if (IsDlgButtonChecked(hdlg,IDC_OUT_FT))
+ nCustomOptions |= IOPT_FILESENT;
+ if (IsDlgButtonChecked(hdlg,IDC_OUT_OTHER))
+ nCustomOptions |= IOPT_OTHERSENT;
+
+ // since date
+ dwSinceDate = 0;
+
+ if ( IsDlgButtonChecked( hdlg, IDC_SINCE )) {
+ struct _SYSTEMTIME ST = {0};
+
+ if (DateTime_GetSystemtime(GetDlgItem(hdlg,IDC_DATETIMEPICKER), &ST) == GDT_VALID) {
+ struct tm TM = {0};
+
+ TM.tm_mday = ST.wDay;
+ TM.tm_mon = ST.wMonth - 1;
+ TM.tm_year = ST.wYear - 1900;
+
+ dwSinceDate = mktime(&TM);
+
+ DBWriteContactSettingDword(NULL,IMPORT_MODULE,"ImportSinceTS",dwSinceDate);
+ } }
+
+ if (nCustomOptions)
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_PROGRESS,(LPARAM)ProgressPageProc);
+ break;
+
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+
+ case IDC_SINCE:
+ EnableWindow(GetDlgItem(hdlg, IDC_DATETIMEPICKER), IsDlgButtonChecked(hdlg, IDC_SINCE));
+ break;
+
+ if (HIWORD(wParam) != STN_CLICKED)
+ break;
+
+ case IDC_ALL:
+ case IDC_INCOMING:
+ case IDC_OUTGOING:
+ {
+ int i;
+
+ if (LOWORD(wParam) == IDC_ALL)
+ for (i = 0; i < sizeof(SysControls)/sizeof(SysControls[0]); i++)
+ CheckDlgButton(hdlg,SysControls[i], !IsDlgButtonChecked(hdlg,SysControls[i]));
+
+ if (LOWORD(wParam) != IDC_OUTGOING)
+ for (i = 0; i < sizeof(InControls)/sizeof(InControls[0]); i++)
+ CheckDlgButton(hdlg,InControls[i], !IsDlgButtonChecked(hdlg,InControls[i]));
+
+ if (LOWORD(wParam) != IDC_INCOMING)
+ for (i = 0; i < sizeof(OutControls)/sizeof(OutControls[0]); i++)
+ CheckDlgButton(hdlg,OutControls[i], !IsDlgButtonChecked(hdlg,OutControls[i]));
+ }
+ break;
+
+ case IDC_MSG:
+ CheckDlgButton(hdlg,IDC_IN_MSG, !IsDlgButtonChecked(hdlg,IDC_IN_MSG));
+ CheckDlgButton(hdlg,IDC_OUT_MSG, !IsDlgButtonChecked(hdlg,IDC_OUT_MSG));
+ break;
+
+ case IDC_URL:
+ CheckDlgButton(hdlg,IDC_IN_URL, !IsDlgButtonChecked(hdlg,IDC_IN_URL));
+ CheckDlgButton(hdlg,IDC_OUT_URL, !IsDlgButtonChecked(hdlg,IDC_OUT_URL));
+ break;
+
+ case IDC_FT:
+ CheckDlgButton(hdlg,IDC_IN_FT, !IsDlgButtonChecked(hdlg,IDC_IN_FT));
+ CheckDlgButton(hdlg,IDC_OUT_FT, !IsDlgButtonChecked(hdlg,IDC_OUT_FT));
+ break;
+
+ case IDC_OTHER:
+ CheckDlgButton(hdlg,IDC_IN_OTHER, !IsDlgButtonChecked(hdlg,IDC_IN_OTHER));
+ CheckDlgButton(hdlg,IDC_OUT_OTHER, !IsDlgButtonChecked(hdlg,IDC_OUT_OTHER));
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+#ifndef INVALID_SET_FILE_POINTER
+#define INVALID_SET_FILE_POINTER ((DWORD)-1)
+#endif
+
+// Read header from file, returns null on failure
+struct DBHeader* GetHeader(HANDLE hDbFile)
+{
+ struct DBHeader* pdbHeader;
+ DWORD dwBytesRead;
+
+ if (( pdbHeader = calloc(1, sizeof(struct DBHeader))) == NULL )
+ return NULL;
+
+ // Goto start of file
+ if (SetFilePointer(hDbFile, 0, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return FALSE;
+
+ // Read header
+ if ( !ReadFile(hDbFile, pdbHeader, sizeof(struct DBHeader), &dwBytesRead, NULL ) ||
+ dwBytesRead != sizeof(struct DBHeader))
+ return NULL;
+
+ // Return pointer to header
+ return pdbHeader;
+}
+
+// Unsane: database crypted status
+BOOL bEncrypted;
+// Unsane: crypted database work fuction
+int CheckPassword(WORD version, WORD cryptorUID, TCHAR * szDBName);
+void InitSecurity();
+
+int CheckFileFormat(HANDLE hDbFile)
+{
+ struct DBHeader* pdbHeader;
+ TCHAR* tszDbName;
+
+ // Read header
+ if (( pdbHeader = GetHeader(hDbFile)) == NULL )
+ return DB_INVALID;
+
+ // Check header signature
+ bEncrypted = FALSE;
+ if (memcmp(pdbHeader->signature, &dbSignature, sizeof(pdbHeader->signature))) {
+ // Unsane: if not encrypted signature
+ if (memcmp(pdbHeader->signature, &dbSignatureEncrypted, sizeof(pdbHeader->signature))){
+ AddMessage( LPGEN("Signature mismatch" ));
+ return DB_INVALID;
+ }
+ AddMessage(LPGEN("Database is Secured MMAP database"));
+ // Unsane: check password
+ InitSecurity();
+ tszDbName = _tcsrchr(importFile, _T('\\')) + 1;
+ if (CheckPassword(pdbHeader->checkWord, pdbHeader->cryptorUID, tszDbName)){
+ AddMessage(LPGEN("Secured MMAP: authorization successful"));
+ bEncrypted = TRUE;
+ }
+ else
+ {
+ AddMessage(LPGEN("You are not authorized for access to Database"));
+ return DB_INVALID;
+ }
+ }
+
+ // Determine Miranda version
+ switch (pdbHeader->checkWord) {
+ case DB_000700:
+ AddMessage( LPGEN("This looks like a Miranda database, version 0.1.0.0 or above." ));
+ free(pdbHeader);
+ return DB_000700;
+
+ default:
+ if (!bEncrypted){
+ AddMessage( LPGEN("Version mismatch" ));
+ free(pdbHeader);
+ return DB_INVALID;
+ }
+ break;
+} }
+
+// High level Miranda DB access functions
+// Returns true if pValue points to the requested value
+
+BOOL GetSetting(HANDLE hDbFile, struct DBContact* pDbContact, char* pszModuleName, char* pszSettingName, DBVARIANT* pValue)
+{
+ struct DBContactSettings* pDbSettings;
+ if ( pDbSettings = GetSettingsGroupByModuleName(hDbFile, pDbContact, pszModuleName)) {
+ if ( GetSettingByName( pDbSettings, pszSettingName, pValue )) {
+ free(pDbSettings);
+ return TRUE;
+ }
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Failed to find setting %s" ), pszSettingName );
+ #endif
+ free(pDbSettings);
+ }
+#ifdef _LOGGING
+ else AddMessage( LPGEN("Failed to find module %s" ), pszModuleName );
+#endif
+
+ // Search failed
+ pValue->type = 0;
+ return FALSE;
+}
+
+// **
+// ** CONTACT CHAIN
+// **
+
+// Return offset to first contact
+DWORD FindFirstContact(struct DBHeader* pDbHeader)
+{
+ if (!pDbHeader)
+ return 0;
+
+ return pDbHeader->ofsFirstContact;
+}
+
+DWORD FindOwnerContact(struct DBHeader* pDbHeader)
+{
+ if (!pDbHeader)
+ return 0;
+
+ return pDbHeader->ofsUser;
+}
+
+// Return offset to next contact
+DWORD FindNextContact(struct DBContact* pDbContact)
+{
+ if (!pDbContact)
+ return 0;
+
+ if (pDbContact->signature != DBCONTACT_SIGNATURE)
+ return 0;
+
+ return pDbContact->ofsNext;
+}
+
+
+// Read the contact at offset 'dwOffset'
+// Returns true if successful and pDbContact points to the contact struct
+// pDbContact must point to allocated struct
+BOOL GetContact(HANDLE hDbFile, DWORD dwOffset, struct DBContact* pDbContact)
+{
+ DWORD dwBytesRead;
+
+ // Early reject
+ if (dwOffset == 0 || dwOffset >= dwFileSize)
+ return FALSE;
+
+ // ** Read and verify the struct
+
+ if (SetFilePointer(hDbFile, (LONG)dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return FALSE;
+
+ if ((!ReadFile(hDbFile, pDbContact, sizeof(struct DBContact), &dwBytesRead, NULL)) ||
+ (dwBytesRead != sizeof(struct DBContact)))
+ return FALSE;
+
+ if ((pDbContact->signature != DBCONTACT_SIGNATURE) ||
+ (pDbContact->ofsNext >= dwFileSize))
+ return FALSE; // Contact corrupted
+
+ return TRUE;
+}
+
+// Return ptr to next setting in settings struct
+char* GetNextSetting(char* pDbSetting)
+{
+ // Get next setting
+ pDbSetting = pDbSetting + *pDbSetting+1; // Skip name
+ switch( *(BYTE*)pDbSetting ) {
+ case DBVT_BYTE:
+ pDbSetting = pDbSetting+1+1;
+ break;
+
+ case DBVT_WORD:
+ pDbSetting = pDbSetting+1+2;
+ break;
+
+ case DBVT_DWORD:
+ pDbSetting = pDbSetting+1+4;
+ break;
+
+ case DBVT_ASCIIZ:
+ case DBVT_UTF8:
+ case DBVT_BLOB:
+ case DBVTF_VARIABLELENGTH:
+ pDbSetting = pDbSetting + 3 + *(WORD*)(pDbSetting+1);
+ break;
+
+ case DBVT_DELETED:
+ AddMessage( LPGEN("DEBUG: Deleted setting treated as 0-length setting"));
+ pDbSetting = pDbSetting+1;
+ break;
+
+ default:
+ // Unknown datatype assert
+ AddMessage( LPGEN("ERROR: Faulty settings chain"));
+ return NULL;
+ }
+
+ return pDbSetting;
+}
+
+
+// **
+// ** SETTINGS CHAIN
+// **
+
+// Return the settings at offset 'dwOffset'
+BOOL GetSettingsGroup(HANDLE hDbFile, DWORD dwOffset, struct DBContactSettings** pDbSettings)
+{
+ DWORD dwBytesRead, dwBlobSize, dwHead;
+ struct DBContactSettings pSettings;
+
+ // Early reject
+ if (dwOffset == 0 || dwOffset >= dwFileSize)
+ return FALSE;
+
+ // ** Read and verify the struct
+ if (SetFilePointer(hDbFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return FALSE;
+
+ dwHead = offsetof(struct DBContactSettings, blob);
+ if ((!ReadFile(hDbFile, &pSettings, dwHead, &dwBytesRead, NULL)) ||
+ (dwBytesRead != dwHead))
+ return FALSE;
+
+ if (pSettings.signature != DBCONTACTSETTINGS_SIGNATURE)
+ return FALSE; // Setttings corrupted
+
+ // ** Read the struct and the following blob
+ dwBlobSize = pSettings.cbBlob;
+ if (!(*pDbSettings = calloc(1, sizeof(struct DBContactSettings) + dwBlobSize)))
+ return FALSE;
+
+ memcpy(*pDbSettings, &pSettings, dwHead );
+
+ if ((!ReadFile(hDbFile, (*pDbSettings)->blob, sizeof(struct DBContactSettings) - dwHead + dwBlobSize, &dwBytesRead, NULL)) ||
+ (dwBytesRead != sizeof(struct DBContactSettings) - dwHead + dwBlobSize))
+ {
+ free(*pDbSettings);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+// pDbContact is a ptr to a struct DBContact
+// Returns pointer to a struct DBContactSettings or NULL
+struct DBContactSettings* GetSettingsGroupByModuleName(HANDLE hDbFile, struct DBContact* pDbContact, char* pszName)
+{
+ char* pszGroupName;
+ struct DBContactSettings* pSettingsGroup;
+ DWORD dwGroupOfs;
+
+ // Get ptr to first settings group
+ if (!(dwGroupOfs = pDbContact->ofsFirstSettings))
+ return NULL; // No settings exists in this contact
+
+ // Loop over all settings groups
+ while (dwGroupOfs && dwGroupOfs < dwFileSize) {
+ pSettingsGroup = NULL;
+
+ // Read and verify the struct
+ if (!GetSettingsGroup(hDbFile, dwGroupOfs, &pSettingsGroup))
+ return NULL; // Bad struct
+
+ // Struct OK, now get the name
+ if ((pszGroupName = GetName(hDbFile, pSettingsGroup->ofsModuleName))) {
+
+ // Is it the right one?
+ if (strcmp(pszGroupName, pszName) == 0) {
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Found module: %s"), pszGroupName );
+ #endif
+ return pSettingsGroup;
+ }
+ #ifdef _LOGGING
+ else AddMessage( LPGEN("Ignoring module: %s"), pszGroupName );
+ #endif
+ }
+ else AddMessage( LPGEN("Warning: Found module with no name"));
+
+ dwGroupOfs = pSettingsGroup->ofsNext;
+
+ if (pSettingsGroup)
+ free(pSettingsGroup);
+ }
+
+ // Search failed
+ return NULL;
+}
+
+// pDbSettings must point to a complete DBContactSettings struct in memory
+int GetSettingByName(struct DBContactSettings* pDbSettings, char* pszSettingName, DBVARIANT* dbv)
+{
+ char pszName[256];
+ // We need at least one setting to start with
+ char* pDbSetting = pDbSettings->blob;
+ if ( !pDbSetting )
+ return FALSE;
+
+ // ** pDbSettings now points to the first setting in this module
+
+ // Loop over all settings
+ while (pDbSetting && *pDbSetting) {
+ memcpy(pszName, pDbSetting+1, *pDbSetting);
+ pszName[*pDbSetting] = 0;
+
+ // Is this the right one?
+ if (strcmp(pszSettingName, pszName) == 0) {
+ return GetSettingValue(pDbSetting, dbv);
+ }
+
+ #ifdef _LOGGING
+ AddMessage( LPGEN("Ignoring setting: %s"), pszName );
+ #endif
+ pDbSetting = GetNextSetting(pDbSetting);
+ }
+
+ // Search failed
+ return FALSE;
+}
+
+// dwSettingpointer points to a valid DBSettings struct
+int GetSettingValue(char* pBlob, DBVARIANT* dbv)
+{
+ #ifdef _LOGGING
+ {
+ char* pszName = calloc((*pBlob)+1, 1);
+ memcpy(pszName, pBlob+1, *pBlob);
+ AddMessage( LPGEN("Getting type %u value for setting: %s"), (BYTE)*(pBlob+(*pBlob)+1), pszName );
+ free(pszName);
+ }
+ #endif
+
+ // Skip name
+ pBlob = pBlob + (*pBlob)+1;
+ dbv->type = ( BYTE )*pBlob++;
+
+ // Check what type it is
+ switch( dbv->type ) {
+ case DBVT_BYTE:
+ dbv->bVal = *pBlob;
+ return TRUE;
+
+ case DBVT_WORD:
+ // Unsane: encrypt WORDs
+ if (bEncrypted)
+ DecodeMemory(pBlob, sizeof(pBlob));
+ dbv->wVal = *(WORD*)pBlob;
+ return TRUE;
+
+ case DBVT_DWORD:
+ // Unsane: encrypt DWORDs
+ if (bEncrypted)
+ DecodeMemory(pBlob, sizeof(pBlob));
+ dbv->dVal = *(DWORD*)pBlob;
+ return TRUE;
+
+ case DBVT_ASCIIZ:
+ case DBVT_UTF8:
+ // Unsane: encrypt STRINGs
+ dbv->cchVal = *(WORD*)pBlob;
+ dbv->pszVal = calloc( dbv->cchVal+1, sizeof( char ));
+ if (bEncrypted)
+ DecodeCopyMemory(dbv->pszVal, pBlob+2, dbv->cchVal);
+ else
+ memcpy( dbv->pszVal, pBlob+2, dbv->cchVal );
+ dbv->pszVal[ dbv->cchVal ] = 0;
+
+ return TRUE;
+
+ case DBVTF_VARIABLELENGTH:
+ case DBVT_BLOB:
+ dbv->cpbVal = *(WORD*)pBlob;
+ dbv->pbVal = calloc( dbv->cpbVal+1, sizeof( char ));
+ // Unsane: encrypt other
+ if (bEncrypted)
+ DecodeCopyMemory(dbv->pszVal, pBlob+2, dbv->cchVal);
+ else
+ memcpy( dbv->pbVal, pBlob+2, dbv->cpbVal );
+ dbv->pbVal[ dbv->cpbVal ] = 0;
+ return TRUE;
+
+ case DBVT_DELETED:
+ AddMessage( LPGEN("DEBUG: Deleted setting treated as 0-length setting"));
+
+ default:
+ dbv->type = DBVT_DELETED;
+ }
+
+ return FALSE;
+}
+
+void FreeVariant( DBVARIANT* dbv )
+{
+ switch( dbv->type ) {
+ case DBVT_ASCIIZ:
+ case DBVT_UTF8:
+ if ( dbv->pszVal )
+ free( dbv->pszVal );
+ break;
+
+ case DBVTF_VARIABLELENGTH:
+ case DBVT_BLOB:
+ if ( dbv->pbVal )
+ free( dbv->pbVal );
+ break;
+ }
+
+ dbv->type = 0;
+}
+
+void WriteVariant( HANDLE hContact, const char* module, const char* var, DBVARIANT* dbv )
+{
+ DBCONTACTWRITESETTING dbw;
+ dbw.szModule = module;
+ dbw.szSetting = var;
+ dbw.value = *dbv;
+ CallService( MS_DB_CONTACT_WRITESETTING, (WPARAM)hContact, (LPARAM)&dbw );
+}
+
+// Returns true if pDBEI has been filled in with nice values
+// Don't forget to free those pointers!
+BOOL GetEvent(HANDLE hDbFile, DWORD dwOffset, DBEVENTINFO* pDBEI)
+{
+ DWORD dwBytesRead;
+ struct DBEvent pEvent;
+ static char pBlob[65536];
+
+ // Early reject
+ if (dwOffset == 0 || dwOffset >= dwFileSize)
+ return FALSE;
+
+ // ** Read and verify the struct
+ if (SetFilePointer(hDbFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return FALSE;
+
+ if (!ReadFile(hDbFile, &pEvent, offsetof(struct DBEvent, blob), &dwBytesRead, NULL) ||
+ (dwBytesRead != offsetof(struct DBEvent, blob)))
+ return FALSE;
+
+ if (pEvent.signature != DBEVENT_SIGNATURE)
+ return FALSE; // Event corrupted
+
+ // ** Read the blob
+ if ((!ReadFile(hDbFile, pBlob, pEvent.cbBlob, &dwBytesRead, NULL)) ||
+ (dwBytesRead != pEvent.cbBlob))
+ {
+ return FALSE;
+ }
+
+ // ** Copy the static part to the event info struct
+ pDBEI->timestamp = pEvent.timestamp;
+ pDBEI->eventType = pEvent.eventType;
+ pDBEI->cbSize = sizeof(DBEVENTINFO);
+ pDBEI->cbBlob = pEvent.cbBlob;
+ pDBEI->pBlob = pBlob;
+ pDBEI->flags = (pEvent.flags & ~(DBEF_SENT+DBEF_READ)) +
+ ((pEvent.flags & DBEF_SENT) ? DBEF_SENT : DBEF_READ ); // Imported events are always marked READ
+
+ if (!(pDBEI->szModule = GetName(hDbFile, pEvent.ofsModuleName))) {
+ return FALSE;
+ }
+
+ // Unsane: encrypt dbevent
+ if (bEncrypted)
+ DecodeMemory(pDBEI->pBlob, pDBEI->cbBlob);
+
+ return TRUE;
+}
+
+// Returns a pointer to a string with the name
+// from a DBModuleName struct if given a file offset
+// Returns NULL on failure
+char* GetName(HANDLE hDbFile, DWORD dwOffset)
+{
+ static DWORD dwLastOffset = 0;
+ static HANDLE hLastDbFile = NULL;
+ static char szName[256] = {0};
+
+ DWORD dwBytesRead;
+ struct DBModuleName pModule;
+
+ // Early reject
+ if (dwOffset == 0 || dwOffset >= dwFileSize)
+ return FALSE;
+
+ // Quick lookup
+ if (dwOffset == dwLastOffset && hDbFile == hLastDbFile)
+ return szName;
+
+ // ** Read and verify the name struct
+ if (SetFilePointer(hDbFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return NULL;
+
+ if ((!ReadFile(hDbFile, &pModule, offsetof(struct DBModuleName, name), &dwBytesRead, NULL)) ||
+ (dwBytesRead != offsetof(struct DBModuleName, name)))
+ return NULL;
+
+ if (pModule.signature != DBMODULENAME_SIGNATURE) {
+ AddMessage( LPGEN("Modulename corrupted"));
+ return NULL; // ModuleName corrupted
+ }
+
+ // ** Name struct OK, now read name into string buffer
+ if ((!ReadFile(hDbFile, szName, pModule.cbName, &dwBytesRead, NULL)) || (dwBytesRead != pModule.cbName)) {
+ return NULL;
+ }
+
+ // terminate string
+ szName[pModule.cbName] = 0;
+
+ // update last offset
+ dwLastOffset = dwOffset;
+ hLastDbFile = hDbFile;
+
+ return szName;
+}
+
+DWORD FindNextEvent(HANDLE hDbFile, DWORD dwOffset)
+{
+ DWORD dwBytesRead;
+ struct DBEvent pEvent;
+
+ // Early reject
+ if (dwOffset == 0 || dwOffset >= dwFileSize)
+ return FALSE;
+
+ // ** Read and verify the struct
+ if (SetFilePointer(hDbFile, dwOffset, NULL, FILE_BEGIN) == INVALID_SET_FILE_POINTER)
+ return FALSE;
+
+ if ((!ReadFile(hDbFile, &pEvent, sizeof(struct DBEvent), &dwBytesRead, NULL)) ||
+ (dwBytesRead != sizeof(struct DBEvent)))
+ return FALSE;
+
+ if ( pEvent.signature != DBEVENT_SIGNATURE || pEvent.ofsNext > dwFileSize )
+ return FALSE; // Event corrupted
+
+ return pEvent.ofsNext;
+}
+
+int ImportGroups(HANDLE hDbFile, struct DBHeader* pdbHeader)
+{
+ struct DBContactSettings* pDbSettings;
+ struct DBContact DbContact;
+ char* pSetting;
+ DWORD dwOffset;
+ int nGroups = 0;
+
+ // Find owner data
+ dwOffset = pdbHeader->ofsUser;
+ if (!GetContact(hDbFile, dwOffset, &DbContact)) {
+ AddMessage( LPGEN("No owner found."));
+ return -1;
+ }
+
+ // Find the module with the groups, and import them all
+ if ( pDbSettings = GetSettingsGroupByModuleName( hDbFile, &DbContact, "CListGroups" )) {
+ /*if (bEncrypted)
+ DecodeMemory(pDbSettings->blob, pDbSettings->cbBlob);*/
+ pSetting = pDbSettings->blob;
+ while ( pSetting && *pSetting ) {
+ DBVARIANT dbv;
+ if ( GetSettingValue( pSetting, &dbv )) {
+ if ( CreateGroup( dbv.type, dbv.pszVal+1, NULL ))
+ nGroups++;
+ FreeVariant( &dbv );
+ }
+ pSetting = GetNextSetting(pSetting);
+ }
+ free(pDbSettings);
+
+ /*if (bEncrypted)
+ EncodeMemory(pDbSettings->blob, pDbSettings->cbBlob);*/
+ }
+
+ return nGroups;
+}
+
+HANDLE ImportContact(HANDLE hDbFile, struct DBContact Contact)
+{
+ HANDLE hContact;
+ DBVARIANT group, nick, dbv;
+ char* pszProtoName;
+ char* pszUniqueSetting;
+ char* pszUserName;
+ char id[ 40 ];
+
+ // Check what protocol this contact belongs to
+ if ( !GetSetting( hDbFile, &Contact, "Protocol", "p", &dbv )) {
+ AddMessage( LPGEN("Skipping contact with no protocol"));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ pszProtoName = NEWSTR_ALLOCA( dbv.pszVal );
+ FreeVariant( &dbv );
+
+ if ( !IsProtocolLoaded( pszProtoName )) {
+ AddMessage( LPGEN("Skipping contact, %s not installed."), pszProtoName );
+ return INVALID_HANDLE_VALUE;
+ }
+
+ // Skip protocols with no unique id setting (some non IM protocols return NULL)
+ pszUniqueSetting = (char*)CallProtoService(pszProtoName, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if ( !pszUniqueSetting || (INT_PTR)pszUniqueSetting == CALLSERVICE_NOTFOUND ) {
+ AddMessage( LPGEN("Skipping non-IM contact (%s)"), pszProtoName );
+ return INVALID_HANDLE_VALUE;
+ }
+
+ if ( !GetSetting(hDbFile, &Contact, pszProtoName, pszUniqueSetting, &dbv )) {
+ AddMessage( LPGEN("Skipping %s contact, ID not found"), pszProtoName );
+ return INVALID_HANDLE_VALUE;
+ }
+
+ // Does the contact already exist?
+ if ( dbv.type == DBVT_DWORD ) {
+ pszUserName = _ltoa( dbv.dVal, id, 10 );
+ hContact = HContactFromNumericID( pszProtoName, pszUniqueSetting, dbv.dVal );
+ }
+ else {
+ pszUserName = NEWSTR_ALLOCA( dbv.pszVal );
+ hContact = HContactFromID( pszProtoName, pszUniqueSetting, dbv.pszVal );
+ }
+
+ if ( hContact != INVALID_HANDLE_VALUE ) {
+ AddMessage( LPGEN("Skipping duplicate %s contact %s"), pszProtoName, pszUserName );
+ FreeVariant( &dbv );
+ return INVALID_HANDLE_VALUE;
+ }
+ // No, add contact and copy some important settings
+ GetSetting(hDbFile, &Contact, "CList", "Group", &group);
+
+ if ( !GetSetting( hDbFile, &Contact, "CList", "MyHandle", &nick ))
+ GetSetting(hDbFile, &Contact, pszProtoName, "Nick", &nick );
+
+ hContact = AddContact( hdlgProgress, pszProtoName, pszUniqueSetting, &dbv, &nick, &group );
+
+ if ( hContact != INVALID_HANDLE_VALUE) {
+
+ // Hidden?
+ if ( GetSetting( hDbFile, &Contact, "CList", "Hidden", &dbv )) {
+ WriteVariant( hContact, "CList", "Hidden", &dbv );
+ FreeVariant( &dbv );
+ }
+ // Ignore settings
+ if ( GetSetting( hDbFile, &Contact, "Ignore", "Mask1", &dbv )) {
+ WriteVariant( hContact, "Ignore", "Mask1", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // Apparent mode
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "ApparentMode", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "ApparentMode", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // Nick
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "Nick", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "Nick", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // Myhandle
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "MyHandle", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "MyHandle", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // First name
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "FirstName", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "FirstName", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // Last name
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "LastName", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "LastName", &dbv );
+ FreeVariant( &dbv );
+ }
+
+ // About
+ if ( GetSetting( hDbFile, &Contact, pszProtoName, "About", &dbv )) {
+ WriteVariant( hContact, pszProtoName, "About", &dbv );
+ FreeVariant( &dbv );
+ }
+ }
+ else AddMessage( LPGEN("Unknown error while adding %s contact %s"), pszProtoName, pszUserName );
+
+ return hContact;
+}
+
+// This function should always be called after contact import. That is
+// why there are no messages for errors related to contacts. Those
+// would only be a repetition of the messages printed during contact
+// import.
+
+static void ImportHistory(HANDLE hDbFile, struct DBContact Contact, PROTOCOLDESCRIPTOR **protocol, int protoCount)
+{
+ HANDLE hContact = INVALID_HANDLE_VALUE;
+ DWORD dwOffset;
+ MSG msg;
+ DBVARIANT proto;
+ int i, skipAll, bIsVoidContact;
+
+ // Is it contats history import?
+ if ( protoCount == 0 ) {
+
+ // Check what protocol this contact belongs to
+ if ( GetSetting( hDbFile, &Contact, "Protocol", "p", &proto )) {
+
+ // Protocol installed?
+ if ( IsProtocolLoaded( proto.pszVal )) {
+ // Is contact in database?
+ char* pszUniqueSetting = (char*)CallProtoService( proto.pszVal, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+
+ // Skip protocols with no unique id setting (some non IM protocols return NULL)
+ if ( pszUniqueSetting && ( INT_PTR )pszUniqueSetting != CALLSERVICE_NOTFOUND ) {
+ DBVARIANT dbv;
+ if ( GetSetting( hDbFile, &Contact, proto.pszVal, pszUniqueSetting, &dbv )) {
+ if ( dbv.type == DBVT_DWORD )
+ hContact = HContactFromNumericID( proto.pszVal, pszUniqueSetting, dbv.dVal );
+ else
+ hContact = HContactFromID( proto.pszVal, pszUniqueSetting, dbv.pszVal );
+ FreeVariant( &dbv );
+ } } }
+ FreeVariant( &proto );
+ }
+ }
+ else hContact = NULL; //system history import
+
+ // OK to import this chain?
+ if (hContact == INVALID_HANDLE_VALUE) {
+ nSkippedContacts++;
+ return;
+ }
+
+ i = skipAll = 0;
+ bIsVoidContact = CallService( MS_DB_EVENT_GETCOUNT, ( WPARAM )hContact, 0 ) == 0;
+
+ // Get the start of the event chain
+ dwOffset = Contact.ofsFirstEvent;
+ while (dwOffset) {
+ int skip = 0;
+
+ // Copy the event and import it
+ DBEVENTINFO dbei = { 0 };
+ if (GetEvent(hDbFile, dwOffset, &dbei)) {
+ // check protocols during system history import
+ if (hContact == NULL) {
+ int i;
+ skipAll = 1;
+
+ for(i = 0; i < protoCount; i++)
+ if (!strcmp(dbei.szModule, protocol[i]->szName)) { //&& protocol[i]->type == PROTOTYPE_PROTOCOL)
+ skipAll = 0;
+ break;
+ }
+
+ skip = skipAll;
+ }
+
+ // custom filtering
+ if (!skip && nImportOption == IMPORT_CUSTOM) {
+ BOOL sent = (dbei.flags&DBEF_SENT);
+
+ if (dbei.timestamp < (DWORD)dwSinceDate)
+ skip = 1;
+
+ if (!skip) {
+ if (hContact) {
+ skip = 1;
+ switch(dbei.eventType) {
+ case EVENTTYPE_MESSAGE:
+ if ((sent?IOPT_MSGSENT:IOPT_MSGRECV)&nCustomOptions)
+ skip = 0;
+ break;
+ case EVENTTYPE_FILE:
+ if ((sent?IOPT_FILESENT:IOPT_FILERECV)&nCustomOptions)
+ skip = 0;
+ break;
+ case EVENTTYPE_URL:
+ if ((sent?IOPT_URLSENT:IOPT_URLRECV)&nCustomOptions)
+ skip = 0;
+ break;
+ default:
+ if ((sent?IOPT_OTHERSENT:IOPT_OTHERRECV)&nCustomOptions)
+ skip = 0;
+ break;
+ }
+ }
+ else if ( !( nCustomOptions & IOPT_SYSTEM ))
+ skip = 1;
+ }
+
+ if (skip)
+ nSkippedEvents++;
+ }
+
+ if (!skip) {
+ // Check for duplicate entries
+ if ( !IsDuplicateEvent( hContact, dbei )) {
+ // Add dbevent
+ if (!bIsVoidContact)
+ dbei.flags &= ~DBEF_FIRST;
+ if (CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei))
+ nMessagesCount++;
+ else
+ AddMessage( LPGEN("Failed to add message"));
+ }
+ else
+ nDupes++;
+ }
+ }
+
+ if ( !( i%10 )) {
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ } }
+
+ // skip this chain if needed
+ if ( skipAll )
+ break;
+
+ // Get next event
+ dwOffset = FindNextEvent(hDbFile, dwOffset);
+ i++;
+ }
+}
+
+static void MirandaImport(HWND hdlg)
+{
+ int nDBVersion;
+ int i;
+ int nNumberOfContacts = 0;
+ MSG msg;
+ DWORD dwTimer;
+ DWORD dwOffset;
+ HANDLE hFile;
+ char* pszModuleName = NULL;
+ struct DBHeader* pdbHeader = NULL;
+ struct DBContact Contact;
+
+ // Just to keep the macros happy
+ hdlgProgress = hdlg;
+
+ // Reset statistics
+ nSkippedEvents = 0;
+ nDupes = 0;
+ nContactsCount = 0;
+ nMessagesCount = 0;
+ nGroupsCount = 0;
+ nSkippedContacts = 0;
+ SetProgress(0);
+
+ // Open database
+ hFile = CreateFile(importFile,
+ GENERIC_READ, // open for reading
+ 0, // do not share
+ NULL, // no security
+ OPEN_EXISTING, // existing file only
+ FILE_ATTRIBUTE_NORMAL, // normal file
+ NULL); // no attr. template
+
+ // Read error
+ if (hFile == INVALID_HANDLE_VALUE) {
+ AddMessage( LPGEN("Could not open file."));
+ SetProgress(100);
+ return;
+ }
+
+ // Check filesize
+ dwFileSize = GetFileSize(hFile, NULL) ;
+ if ((dwFileSize == INVALID_FILE_SIZE) || (dwFileSize < sizeof(struct DBHeader))) {
+ AddMessage( LPGEN("This is not a valid Miranda IM database."));
+ SetProgress(100);
+ CloseHandle(hFile);
+ return;
+ }
+
+ // Check header and database version
+ nDBVersion = CheckFileFormat(hFile);
+ if (nDBVersion == DB_INVALID) {
+ AddMessage( LPGEN("This is not a valid Miranda IM database."));
+ SetProgress(100);
+ CloseHandle(hFile);
+ return;
+ }
+
+ // Load database header
+ if (!(pdbHeader = GetHeader(hFile))) {
+ AddMessage( LPGEN("Read failure."));
+ SetProgress(100);
+ CloseHandle(hFile);
+ return;
+ }
+
+ // Get number of contacts
+ nNumberOfContacts = pdbHeader->contactCount;
+ AddMessage( LPGEN("Number of contacts in database: %d"), nNumberOfContacts );
+ AddMessage( "" );
+
+ // Configure database for fast writing
+ CallService(MS_DB_SETSAFETYMODE, FALSE, 0);
+
+ // Start benchmark timer
+ dwTimer = time(NULL);
+
+ // Import Groups
+ if (nImportOption == IMPORT_ALL || (nCustomOptions & IOPT_GROUPS)) {
+ AddMessage( LPGEN("Importing groups."));
+ nGroupsCount = ImportGroups(hFile, pdbHeader);
+ if (nGroupsCount == -1)
+ AddMessage( LPGEN("Group import failed."));
+
+ AddMessage( "" );
+ }
+ // End of Import Groups
+
+ // Import Contacts
+ if (nImportOption != IMPORT_CUSTOM || (nCustomOptions & IOPT_CONTACTS)) {
+ AddMessage( LPGEN("Importing contacts."));
+ i = 1;
+ dwOffset = FindFirstContact(pdbHeader);
+ while (dwOffset && (dwOffset < dwFileSize)) {
+ if (!GetContact(hFile, dwOffset, &Contact)) {
+ AddMessage( LPGEN("ERROR: Chain broken, no valid contact at %d"), dwOffset );
+ SetProgress(100);
+ break;
+ }
+
+ if (ImportContact(hFile, Contact) != INVALID_HANDLE_VALUE)
+ nContactsCount++;
+
+ // Update progress bar
+ SetProgress(100 * i / nNumberOfContacts);
+ i++;
+
+ // Process queued messages
+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ // Get next contact in chain
+ dwOffset = FindNextContact(&Contact);
+ }
+ }
+ else AddMessage( LPGEN("Skipping new contacts import."));
+ AddMessage( "" );
+ // End of Import Contacts
+
+ // Import history
+ if (nImportOption != IMPORT_CONTACTS) {
+ // Import NULL contact message chain
+ if (nImportOption == IMPORT_ALL || (nCustomOptions & IOPT_SYSTEM)) {
+ AddMessage( LPGEN("Importing system history."));
+ dwOffset = FindOwnerContact(pdbHeader);
+ if (!GetContact(hFile, dwOffset, &Contact)) {
+ AddMessage( LPGEN("ERROR: Chain broken, no valid contact at %d"), dwOffset );
+ SetProgress(100);
+ }
+ else {
+ PROTOCOLDESCRIPTOR **protocol;
+ int protoCount;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protoCount, (LPARAM)&protocol);
+
+ if (protoCount > 0)
+ ImportHistory(hFile, Contact, protocol, protoCount);
+ }
+ }
+ else AddMessage( LPGEN("Skipping system history import."));
+
+ AddMessage( "" );
+
+ // Import other contact messages
+ if (nImportOption == IMPORT_ALL || (nCustomOptions & 2046)) { // 2 - 1024 types
+ AddMessage( LPGEN("Importing history."));
+ dwOffset = FindFirstContact(pdbHeader);
+ for(i=1; i <= nNumberOfContacts; i++) {
+ if (!GetContact(hFile, dwOffset, &Contact)) {
+ AddMessage( LPGEN("ERROR: Chain broken, no valid contact at %d"), dwOffset );
+ SetProgress(100);
+ break;
+ }
+
+ ImportHistory(hFile, Contact, NULL, 0);
+
+ SetProgress(100 * i / nNumberOfContacts);
+ dwOffset = FindNextContact(&Contact);
+ }
+ }
+ else AddMessage( LPGEN("Skipping history import."));
+
+ AddMessage( "" );
+ }
+ // End of Import History
+
+ // Restore database writing mode
+ CallService(MS_DB_SETSAFETYMODE, TRUE, 0);
+
+ // Clean up before exit
+ CloseHandle(hFile);
+ free(pdbHeader);
+
+ // Stop timer
+ dwTimer = time(NULL) - dwTimer;
+
+ // Print statistics
+ AddMessage( LPGEN("Import completed in %d seconds."), dwTimer );
+ SetProgress(100);
+ AddMessage((nImportOption == IMPORT_CONTACTS) ?
+ LPGEN("Added %d contacts and %d groups.") : LPGEN("Added %d contacts, %d groups and %d events."),
+ nContactsCount, nGroupsCount, nMessagesCount);
+
+ if ( nImportOption != IMPORT_CONTACTS ) {
+ if (nSkippedContacts)
+ AddMessage( LPGEN("Skipped %d contacts."), nSkippedContacts );
+
+ AddMessage((nImportOption == IMPORT_CUSTOM) ?
+ LPGEN("Skipped %d duplicates and %d filtered events.") : LPGEN("Skipped %d duplicates."),
+ nDupes, nSkippedEvents);
+} }
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirandadb0700.h b/plugins/Dbx_mmap_SA/Import_SA/mirandadb0700.h
new file mode 100644
index 0000000000..07216ddbcf
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirandadb0700.h
@@ -0,0 +1,148 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001,2002,2003,2004 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+
+
+//all offsets are relative to the start of the file
+//offsets are 0 if there is nothing in the chain or this is the last in the
+//chain
+
+
+
+
+/* tree diagram
+
+DBHeader
+ |-->end of file (plain offset)
+ |-->first contact (DBContact)
+ | |-->next contact (DBContact)
+ | | \--> ...
+ | |-->first settings (DBContactSettings)
+ | | |-->next settings (DBContactSettings)
+ | | | \--> ...
+ | | \-->module name (DBModuleName)
+ | \-->first/last/firstunread event
+ |-->user contact (DBContact)
+ | |-->next contact=NULL
+ | |-->first settings as above
+ | \-->first/last/firstunread event as above
+ \-->first module name (DBModuleName)
+ \-->next module name (DBModuleName)
+ \--> ...
+*/
+
+#define DB_THIS_VERSION 0x00000700u
+
+#include <pshpack1.h>
+// Unsane: added "checkWord", "cryptorUID" and removed "version" fields
+struct DBHeader {
+ BYTE signature[16]; // 'Miranda ICQ DB',0,26
+ /*
+ DWORD version; //as 4 bytes, ie 1.2.3.10=0x0102030a
+ //this version is 0x00000700
+ */
+
+ WORD checkWord;
+ WORD cryptorUID;
+ DWORD ofsFileEnd; //offset of the end of the database - place to write
+ //new structures
+ DWORD slackSpace; //a counter of the number of bytes that have been
+ //wasted so far due to deleting structures and/or
+ //re-making them at the end. We should compact when
+ //this gets above a threshold
+ DWORD contactCount; //number of contacts in the chain,excluding the user
+ DWORD ofsFirstContact; //offset to first struct DBContact in the chain
+ DWORD ofsUser; //offset to struct DBContact representing the user
+ DWORD ofsFirstModuleName; //offset to first struct DBModuleName in the chain
+};
+
+#define DBCONTACT_SIGNATURE 0x43DECADEu
+struct DBContact {
+ DWORD signature;
+ DWORD ofsNext; //offset to the next contact in the chain. zero if
+ //this is the 'user' contact or the last contact
+ //in the chain
+ DWORD ofsFirstSettings; //offset to the first DBContactSettings in the
+ //chain for this contact.
+ DWORD eventCount; //number of events in the chain for this contact
+ DWORD ofsFirstEvent,ofsLastEvent; //offsets to the first and last DBEvent in
+ //the chain for this contact
+ DWORD ofsFirstUnreadEvent; //offset to the first (chronological) unread event
+ //in the chain, 0 if all are read
+ DWORD timestampFirstUnread; //timestamp of the event at ofsFirstUnreadEvent
+};
+
+#define DBMODULENAME_SIGNATURE 0x4DDECADEu
+struct DBModuleName {
+ DWORD signature;
+ DWORD ofsNext; //offset to the next module name in the chain
+ BYTE cbName; //number of characters in this module name
+ char name[1]; //name, no nul terminator
+};
+
+#define DBCONTACTSETTINGS_SIGNATURE 0x53DECADEu
+struct DBContactSettings {
+ DWORD signature;
+ DWORD ofsNext; //offset to the next contactsettings in the chain
+ DWORD ofsModuleName; //offset to the DBModuleName of the owner of these
+ //settings
+ DWORD cbBlob; //size of the blob in bytes. May be larger than the
+ //actual size for reducing the number of moves
+ //required using granularity in resizing
+ BYTE blob[1]; //the blob. a back-to-back sequence of DBSetting
+ //structs, the last has cbName=0
+};
+
+/* not a valid structure, content is figured out on the fly
+struct DBSetting {
+ BYTE cbName; //number of bytes in the name of this setting
+ //this =0 marks the end
+ char szName[...]; //setting name, excluding nul
+ BYTE dataType; //type of data. see m_database.h, db/contact/getsetting
+ union { //a load of types of data, length is defined by dataType
+ BYTE bVal; WORD wVal; DWORD dVal;
+ struct {
+ WORD cbString;
+ char szVal[...]; //excludes nul terminator
+ };
+ struct {
+ WORD cbBlob;
+ BYTE blobVal[...];
+ };
+ };
+};
+*/
+
+#define DBEVENT_SIGNATURE 0x45DECADEu
+struct DBEvent {
+ DWORD signature;
+ DWORD ofsPrev,ofsNext; //offset to the previous and next events in the
+ //chain. Chain is sorted chronologically
+ DWORD ofsModuleName; //offset to a DBModuleName struct of the name of
+ //the owner of this event
+ DWORD timestamp; //seconds since 00:00:00 01/01/1970
+ DWORD flags; //see m_database.h, db/event/add
+ WORD eventType; //module-defined event type
+ DWORD cbBlob; //number of bytes in the blob
+ BYTE blob[1]; //the blob. module-defined formatting
+};
+#include <poppack.h>
diff --git a/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
new file mode 100644
index 0000000000..232d295f8d
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/mirandahistory.c
@@ -0,0 +1,208 @@
+/*
+Miranda ICQ: the free icq client for MS Windows
+Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+#include <windows.h>
+#include <stdio.h>
+#include <time.h>
+#include "resource.h"
+#include "import.h"
+
+BOOL CALLBACK MirandaPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK FinishedPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK ProgressPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+extern char importFile[MAX_PATH];
+extern void (*DoImport)(HWND);
+static void OldMirandaHistoryImport(HWND hdlgProgress);
+HANDLE HContactFromUIN(DWORD uin);
+HANDLE HistoryImportFindContact(HWND hdlgProgress,DWORD uin,int addUnknown);
+static DWORD importOptions;
+
+BOOL CALLBACK MirandaHistoryPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ CheckDlgButton(hdlg,IDC_ADDUNKNOWN,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_MSGRECV,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_MSGSENT,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_URLRECV,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_URLSENT,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_AUTHREQ,BST_CHECKED);
+ CheckDlgButton(hdlg,IDC_ADDED,BST_CHECKED);
+ return TRUE;
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_MIRANDADB,(LPARAM)MirandaPageProc);
+ break;
+ case IDOK:
+ importOptions=0;
+ if(IsDlgButtonChecked(hdlg,IDC_ADDUNKNOWN)) importOptions|=IOPT_ADDUNKNOWN;
+ if(IsDlgButtonChecked(hdlg,IDC_MSGSENT)) importOptions|=IOPT_MSGSENT;
+ if(IsDlgButtonChecked(hdlg,IDC_MSGRECV)) importOptions|=IOPT_MSGRECV;
+ if(IsDlgButtonChecked(hdlg,IDC_URLSENT)) importOptions|=IOPT_URLSENT;
+ if(IsDlgButtonChecked(hdlg,IDC_URLRECV)) importOptions|=IOPT_URLRECV;
+ if(IsDlgButtonChecked(hdlg,IDC_AUTHREQ)) importOptions|=IOPT_AUTHREQ;
+ if(IsDlgButtonChecked(hdlg,IDC_ADDED)) importOptions|=IOPT_ADDED;
+ DoImport=OldMirandaHistoryImport;
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_PROGRESS,(LPARAM)ProgressPageProc);
+ break;
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg),WM_CLOSE,0,0);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+#define HISTORY_MSGRECV 1
+#define HISTORY_MSGSEND 2
+#define HISTORY_URLRECV 3
+#define HISTORY_URLSEND 4
+#define HISTORY_AUTHREQ 5
+#define HISTORY_ADDED 6
+#define issent(t) ((t)==HISTORY_MSGSEND || (t)==HISTORY_URLSEND)
+static int historyTypeToOption[]={0,IOPT_MSGRECV,IOPT_MSGSENT,IOPT_URLRECV,IOPT_URLSENT,IOPT_AUTHREQ,IOPT_ADDED};
+
+static PBYTE ReadHistoryLines(FILE *fp,int *cbBlob)
+{
+ char str[2048];
+ char *blob;
+ int ofs;
+ *cbBlob=0;
+ blob=NULL;
+ while(fgets(str,sizeof(str),fp) && lstrcmp(str,"\xEE\xEE\xEE\xEE\r\n")) {
+ ofs=*cbBlob;
+ *cbBlob+=lstrlen(str);
+ blob=(char*)realloc(blob,*cbBlob+1);
+ lstrcpy(blob+ofs,str);
+ }
+ if(*cbBlob) {
+ (*cbBlob)--;
+ blob[*cbBlob-1]=0;
+ }
+ else {
+ *cbBlob=1;
+ blob=(char*)malloc(1);
+ blob[0]=0;
+ }
+ return (PBYTE)blob;
+}
+
+static void OldMirandaHistoryImport(HWND hdlgProgress)
+{
+ int fileSize;
+ FILE *fp;
+ char str[2048],*eol,*timeofs;
+ HANDLE hContact;
+ int type;
+ DWORD uin;
+ struct tm tmEventTime;
+ DBEVENTINFO dbei;
+
+ AddMessage("Old Miranda history import routines initialised");
+ fp=fopen(importFile,"rb");
+ AddMessage("Calibrating status support functions");
+ fseek(fp,0,SEEK_END);
+ fileSize=ftell(fp);
+ fseek(fp,0,SEEK_SET);
+ SetProgress(0);
+
+ ZeroMemory(&dbei,sizeof(dbei));
+ dbei.cbSize=sizeof(dbei);
+ dbei.szModule=ICQOSCPROTONAME;
+
+ while(!feof(fp)) {
+ SetProgress(100*ftell(fp)/fileSize);
+ if(fgets(str,sizeof(str),fp)==NULL) break;
+ eol=str+lstrlen(str)-1;
+
+ while(*eol=='\r' || *eol=='\n' && eol!=str-1)
+ *(eol--)=0;
+
+ if(lstrlen(str)<20) continue;
+ type=*eol;
+ uin=strtoul(str,NULL,10);
+ if(uin==0) continue; //skip MSN
+ timeofs=str+lstrlen(str)-20;
+ tmEventTime.tm_hour=atoi(timeofs);
+ timeofs=strchr(timeofs,':');
+ if(timeofs==NULL) continue;
+ tmEventTime.tm_min=atoi(timeofs+1);
+ tmEventTime.tm_sec=0;
+ tmEventTime.tm_isdst=-1;
+ tmEventTime.tm_mday=atoi(timeofs+7);
+ tmEventTime.tm_mon=atoi(timeofs+10)-1;
+ tmEventTime.tm_year=atoi(timeofs+13)-1900;
+ dbei.timestamp=mktime(&tmEventTime)+_timezone;
+ if(!(importOptions&historyTypeToOption[type])) continue;
+ hContact=HistoryImportFindContact(hdlgProgress,uin,importOptions&IOPT_ADDUNKNOWN);
+ if(hContact==INVALID_HANDLE_VALUE) break;
+ dbei.flags=issent(type)?DBEF_SENT:DBEF_READ;
+ switch(type) {
+ case HISTORY_MSGRECV:
+ case HISTORY_MSGSEND:
+ dbei.eventType=EVENTTYPE_MESSAGE;
+ dbei.pBlob=ReadHistoryLines(fp,&dbei.cbBlob);
+ CallService(MS_DB_EVENT_ADD,(WPARAM)hContact,(LPARAM)&dbei);
+ break;
+ case HISTORY_URLRECV:
+ case HISTORY_URLSEND:
+ dbei.eventType=EVENTTYPE_URL;
+ dbei.pBlob=ReadHistoryLines(fp,&dbei.cbBlob);
+ { char *endOfUrl;
+ endOfUrl=strchr(dbei.pBlob,'\r');
+ if(endOfUrl!=NULL) {
+ *endOfUrl=0;
+ dbei.cbBlob--;
+ MoveMemory(endOfUrl+1,endOfUrl+2,dbei.cbBlob-(endOfUrl-dbei.pBlob));
+ }
+ }
+ CallService(MS_DB_EVENT_ADD,(WPARAM)hContact,(LPARAM)&dbei);
+ break;
+ case HISTORY_AUTHREQ:
+ dbei.eventType=EVENTTYPE_AUTHREQUEST;
+ dbei.pBlob=ReadHistoryLines(fp,&dbei.cbBlob);
+ dbei.pBlob=(PBYTE)realloc(dbei.pBlob,dbei.cbBlob+8);
+ MoveMemory(dbei.pBlob+8,dbei.pBlob,dbei.cbBlob);
+ *(PDWORD)dbei.pBlob=uin;
+ *(char*)(dbei.pBlob+4)=0; //leave nick, first, last, email blank
+ *(char*)(dbei.pBlob+5)=0;
+ *(char*)(dbei.pBlob+6)=0;
+ *(char*)(dbei.pBlob+7)=0;
+ dbei.cbBlob+=8;
+ CallService(MS_DB_EVENT_ADD,(WPARAM)(HANDLE)NULL,(LPARAM)&dbei);
+ break;
+ case HISTORY_ADDED:
+ dbei.eventType=EVENTTYPE_ADDED;
+ dbei.pBlob=(PBYTE)malloc(8);
+ dbei.cbBlob=8;
+ *(PDWORD)dbei.pBlob=uin;
+ *(char*)(dbei.pBlob+4)=0; //leave nick, first, last, email blank
+ *(char*)(dbei.pBlob+5)=0;
+ *(char*)(dbei.pBlob+6)=0;
+ *(char*)(dbei.pBlob+7)=0;
+ CallService(MS_DB_EVENT_ADD,(WPARAM)(HANDLE)NULL,(LPARAM)&dbei);
+ break;
+ }
+ }
+ AddMessage("Terminating cached I/O access");
+ fclose(fp);
+ AddMessage("Import completed successfully");
+ SetProgress(100);
+} \ No newline at end of file
diff --git a/plugins/Dbx_mmap_SA/Import_SA/progress.c b/plugins/Dbx_mmap_SA/Import_SA/progress.c
new file mode 100644
index 0000000000..1417868947
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/progress.c
@@ -0,0 +1,103 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include <windows.h>
+#include <stdio.h>
+#include <commctrl.h>
+
+#include "import.h"
+
+#define PROGM_START (WM_USER+100)
+
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
+
+void (*DoImport)(HWND);
+
+INT_PTR CALLBACK ProgressPageProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam)
+{
+ switch(message) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ SendMessage(GetParent(hdlg),WIZM_DISABLEBUTTON,0,0);
+ SendMessage(GetParent(hdlg),WIZM_DISABLEBUTTON,1,0);
+ SendMessage(GetParent(hdlg),WIZM_DISABLEBUTTON,2,0);
+ SendDlgItemMessage(hdlg,IDC_PROGRESS,PBM_SETRANGE,0,MAKELPARAM(0,100));
+ PostMessage(hdlg,PROGM_START,0,0);
+ return TRUE;
+
+ case PROGM_SETPROGRESS:
+ SendDlgItemMessage(hdlg,IDC_PROGRESS,PBM_SETPOS,wParam,0);
+ break;
+
+ case PROGM_ADDMESSAGE:
+ {
+ int i=SendDlgItemMessage(hdlg,IDC_STATUS,LB_ADDSTRING,0,lParam);
+ SendDlgItemMessage(hdlg,IDC_STATUS,LB_SETTOPINDEX,i,0);
+ }
+ break;
+
+ case PROGM_START:
+ DoImport(hdlg);
+ SendMessage(GetParent(hdlg),WIZM_ENABLEBUTTON,1,0);
+ SendMessage(GetParent(hdlg),WIZM_ENABLEBUTTON,2,0);
+ break;
+
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDOK:
+ PostMessage(GetParent(hdlg),WIZM_GOTOPAGE,IDD_FINISHED,(LPARAM)FinishedPageProc);
+ break;
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg),WM_CLOSE,0,0);
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+void AddMessage( const char* fmt, ... )
+{
+ va_list args;
+ char msgBuf[ 4096 ];
+ va_start( args, fmt );
+
+ mir_vsnprintf( msgBuf, sizeof(msgBuf), Translate(fmt), args );
+
+ #ifdef _LOGGING
+ {
+ FILE *stream;
+ stream = fopen("Import Debug.log", "a");
+ fprintf(stream, "%s\n", msgBuf);
+ fclose(stream);
+ }
+ #endif
+
+ #if defined( _UNICODE )
+ { TCHAR* str = mir_a2t( msgBuf );
+ SendMessage( hdlgProgress, PROGM_ADDMESSAGE, 0, ( LPARAM )str );
+ mir_free( str );
+ }
+ #else
+ SendMessage( hdlgProgress, PROGM_ADDMESSAGE, 0, ( LPARAM )msgBuf );
+ #endif
+}
diff --git a/plugins/Dbx_mmap_SA/Import_SA/res/import.ico b/plugins/Dbx_mmap_SA/Import_SA/res/import.ico
new file mode 100644
index 0000000000..2d6094d7de
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/res/import.ico
Binary files differ
diff --git a/plugins/Dbx_mmap_SA/Import_SA/res/pass.ico b/plugins/Dbx_mmap_SA/Import_SA/res/pass.ico
new file mode 100644
index 0000000000..908883520a
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/res/pass.ico
Binary files differ
diff --git a/plugins/Dbx_mmap_SA/Import_SA/resource.h b/plugins/Dbx_mmap_SA/Import_SA/resource.h
new file mode 100644
index 0000000000..915ee8097b
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/resource.h
@@ -0,0 +1,68 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDC_BACK 3
+#define IDD_WIZARD 101
+#define IDD_OPTIONS 102
+#define IDD_ICQSERVER 104
+#define IDD_LOGIN 105
+#define IDD_IMPORTTYPE 106
+#define IDD_WIZARDINTRO 107
+#define IDD_FINISHED 108
+#define IDD_MIRABILISDB 109
+#define IDD_MIRANDADB 110
+#define IDD_PROGRESS 111
+#define IDD_ADVOPTIONS 112
+#define IDI_IMPORT 177
+#define IDI_PASS 178
+#define IDC_MIRABILIS 1000
+#define IDC_DONTLOADPLUGIN 1001
+#define IDC_MIRANDA 1002
+#define IDC_USEFINDADD 1003
+#define IDC_OTHER 1004
+#define IDC_LIST 1005
+#define IDC_FILENAME 1006
+#define IDC_PROGRESS 1007
+#define IDC_STATUS 1008
+#define IDC_MIRABILISRUNNING 1009
+#define IDC_MIRABILISACCOUNT 1010
+#define IDC_RADIO_ALL 1011
+#define IDC_RADIO_CONTACTS 1012
+#define IDC_RADIO_CUSTOM 1013
+#define IDC_STATIC_ALL 1014
+#define IDC_STATIC_CONTACTS 1015
+#define IDC_STATIC_CUSTOM 1016
+#define IDC_USERPASS 1017
+#define IDC_LANG 1018
+#define IDC_DATETIMEPICKER 1019
+#define IDC_IN_FT 1020
+#define IDC_CONTACTS 1021
+#define IDC_SYSTEM 1022
+#define IDC_SINCE 1023
+#define IDC_IN_MSG 1024
+#define IDC_IN_URL 1025
+#define IDC_OUT_FT 1026
+#define IDC_OUT_MSG 1027
+#define IDC_OUT_URL 1028
+#define IDC_IN_OTHER 1029
+#define IDC_OUT_OTHER 1030
+#define IDC_INCOMING 1031
+#define IDC_OUTGOING 1032
+#define IDC_ALL 1033
+#define IDC_MSG 1034
+#define IDC_URL 1035
+#define IDC_FT 1036
+#define IDC_HEADERBAR 1037
+#define IDC_STATIC -1
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 106
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1038
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/Dbx_mmap_SA/Import_SA/resource.rc b/plugins/Dbx_mmap_SA/Import_SA/resource.rc
new file mode 100644
index 0000000000..c37ea1cccf
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/resource.rc
@@ -0,0 +1,322 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Ðóññêèé (Ðîññèÿ) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_IMPORT ICON "res/import.ico"
+IDI_PASS ICON "res/pass.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_LOGIN DIALOGEX 0, 0, 190, 86
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOPMOST | WS_EX_TOOLWINDOW
+CAPTION "Miranda MMAP Secured Database"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_HEADERBAR,"MHeaderbarCtrl",0x0,0,0,190,26
+ CTEXT "EN",IDC_LANG,158,34,13,13,SS_CENTERIMAGE | NOT WS_GROUP
+ EDITTEXT IDC_USERPASS,21,34,128,14,ES_PASSWORD | ES_AUTOHSCROLL | WS_GROUP
+ DEFPUSHBUTTON "OK",IDOK,36,71,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,102,71,50,14
+END
+
+IDD_IMPORTTYPE DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Choose how you would like to import:",IDC_STATIC,5,16,210,8
+ CONTROL "From a Miranda IM database.",IDC_MIRANDA,"Button",BS_AUTORADIOBUTTON,11,31,204,10
+ CONTROL "From a Mirabilis ICQ (99a - 2003a) database.",IDC_MIRABILIS,
+ "Button",BS_AUTORADIOBUTTON,11,46,204,10
+ CONTROL "Use the Find/Add contacts tool to populate my contact list.",IDC_USEFINDADD,
+ "Button",BS_AUTORADIOBUTTON,11,61,204,10
+END
+
+IDD_WIZARDINTRO DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "This wizard will help you import contacts and message history from Mirabilis ICQ, as well as letting you import from other Miranda IM profiles.",IDC_STATIC,33,12,182,32
+ ICON IDI_IMPORT,IDC_STATIC,5,12,20,20
+ LTEXT "Click ""Next"" to choose the information you wish to import, or click ""Cancel"" to exit the wizard and continue using Miranda.",IDC_STATIC,33,49,182,25
+ CTEXT "It is recommended that you create a backup of your current Miranda profile before importing.",IDC_STATIC,30,81,182,21
+END
+
+IDD_FINISHED DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "If you wish to import more information, click ""Next"" to return to the start of the wizard, otherwise click ""Finish"" to start using Miranda.",IDC_STATIC,5,20,210,16
+ LTEXT "You will probably never need to use this wizard again, so you can save memory by not loading it every time you start Miranda. This will mean that the import menu item will no longer be available.",IDC_STATIC,5,41,210,24
+ CONTROL "Do not load the import plugin at startup again",IDC_DONTLOADPLUGIN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,97,210,10
+ LTEXT "Import completed",IDC_STATIC,5,7,210,8
+ LTEXT "If at a future date you wish to use the wizard again, you can make it load again by going to the Plugins section of the Options dialog box.",IDC_STATIC,5,69,210,24
+END
+
+IDD_MIRABILISDB DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Miranda has found Mirabilis ICQ databases corresponding to the following ICQ numbers. Please select the one you wish to import, or click ""Other Database"" if your database is not listed.",IDC_STATIC,5,5,210,24
+ LISTBOX IDC_LIST,5,31,210,36,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Other Database...",IDC_OTHER,149,69,66,14
+ RTEXT "&Filename:",IDC_STATIC,5,88,34,8
+ EDITTEXT IDC_FILENAME,42,86,173,12,ES_AUTOHSCROLL
+ CTEXT "Warning: Mirabilis ICQ running. Import may not be reliable.",IDC_MIRABILISRUNNING,5,101,210,8
+ RTEXT "&Account:",IDC_STATIC,6,74,34,8
+ COMBOBOX IDC_MIRABILISACCOUNT,42,71,102,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_MIRANDADB DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Miranda has found Miranda profiles with the following names. Please select the one you wish to import, or click ""Other Profile"" if your profile is not listed, or if the list is empty.",IDC_STATIC,5,10,210,24
+ LISTBOX IDC_LIST,5,36,210,36,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "&Other Profile...",IDC_OTHER,149,74,66,14
+ RTEXT "&Filename:",IDC_STATIC,5,93,34,8
+ EDITTEXT IDC_FILENAME,41,91,174,12,ES_AUTOHSCROLL
+END
+
+IDD_PROGRESS DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Now importing...",IDC_STATIC,5,11,62,8
+ CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH | WS_BORDER,5,24,210,10
+ LISTBOX IDC_STATUS,5,38,210,61,NOT LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | LBS_NOSEL | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_WIZARD DIALOGEX 0, 0, 220, 143
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CAPTION | WS_SYSMENU
+CAPTION "Import Information Wizard"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "&Next >",IDOK,120,124,45,13
+ PUSHBUTTON "Cancel",IDCANCEL,170,124,45,13
+ PUSHBUTTON "< &Back",IDC_BACK,75,124,45,13
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,-7,115,234,1
+END
+
+IDD_OPTIONS DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "Import all contacts and all messages",IDC_RADIO_ALL,
+ "Button",BS_AUTORADIOBUTTON | BS_LEFT | BS_TOP | WS_TABSTOP,7,10,206,11
+ CONTROL "Only import contacts",IDC_RADIO_CONTACTS,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,42,206,10
+ CONTROL "Custom import",IDC_RADIO_CUSTOM,"Button",BS_AUTORADIOBUTTON | WS_DISABLED | WS_TABSTOP,7,74,206,10
+ LTEXT "Select this if you want to import as much data as possible. This is the recommended option.",IDC_STATIC_ALL,26,20,187,16
+ LTEXT "Select this if you want to import contacts but don't want to import any message history.",IDC_STATIC_CONTACTS,26,52,187,16
+ LTEXT "Select this if you want to cutomize what to import.",IDC_STATIC_CUSTOM,26,84,187,16,WS_DISABLED
+END
+
+IDD_ICQSERVER DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ LTEXT "Miranda has now been configured to automatically download the contacts in your server-side contact list the next time you connect to ICQ.",IDC_STATIC,7,9,206,31
+ LTEXT "If you want to change the way Miranda handles server-side contacts at a later time, you can do this in the ""ICQ Contacts"" page in the Miranda options.",IDC_STATIC,7,44,206,37
+END
+
+IDD_ADVOPTIONS DIALOGEX 0, 0, 220, 114
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ CONTROL "New contacts && groups",IDC_CONTACTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,16,100,10
+ CONTROL "System history",IDC_SYSTEM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,16,98,10
+ LTEXT "Select items to import:",IDC_ALL,10,3,201,10,SS_NOTIFY
+ CTEXT "Incoming",IDC_INCOMING,2,34,86,10,SS_NOTIFY
+ CTEXT "Outgoing",IDC_OUTGOING,132,34,86,10,SS_NOTIFY
+ CONTROL "",IDC_IN_MSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,44,10,10
+ CONTROL "",IDC_IN_URL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,56,10,10
+ CONTROL "",IDC_IN_FT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,68,10,10
+ CONTROL "",IDC_IN_OTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,80,10,10
+ CONTROL "",IDC_OUT_MSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,44,10,10
+ CONTROL "",IDC_OUT_URL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,56,10,10
+ CONTROL "",IDC_OUT_FT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,68,10,10
+ CONTROL "",IDC_OUT_OTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,80,10,10
+ CONTROL "Only since:",IDC_SINCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,99,100,10
+ CONTROL "",IDC_DATETIMEPICKER,"SysDateTimePick32",DTS_RIGHTALIGN | WS_DISABLED | WS_TABSTOP,120,97,81,15
+ CTEXT "Messages",IDC_MSG,54,44,112,8,SS_NOTIFY
+ CTEXT "URLs",IDC_URL,54,56,112,8,SS_NOTIFY
+ CTEXT "File Transfers",IDC_FT,54,68,112,8,SS_NOTIFY
+ CTEXT "Other",IDC_OTHER,54,80,112,8,SS_NOTIFY
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,93,222,1
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,31,223,1
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_LOGIN, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 175
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 78
+ END
+
+ IDD_IMPORTTYPE, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 215
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_WIZARDINTRO, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 215
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_FINISHED, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 215
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_MIRABILISDB, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 215
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_MIRANDADB, DIALOG
+ BEGIN
+ LEFTMARGIN, 3
+ RIGHTMARGIN, 216
+ TOPMARGIN, 1
+ BOTTOMMARGIN, 113
+ END
+
+ IDD_PROGRESS, DIALOG
+ BEGIN
+ LEFTMARGIN, 5
+ RIGHTMARGIN, 215
+ TOPMARGIN, 5
+ BOTTOMMARGIN, 109
+ END
+
+ IDD_WIZARD, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 215
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 137
+ END
+
+ IDD_OPTIONS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 111
+ END
+
+ IDD_ICQSERVER, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 107
+ END
+
+ IDD_ADVOPTIONS, DIALOG
+ BEGIN
+ VERTGUIDE, 10
+ VERTGUIDE, 45
+ VERTGUIDE, 110
+ VERTGUIDE, 120
+ VERTGUIDE, 175
+ TOPMARGIN, 3
+ HORZGUIDE, 16
+ HORZGUIDE, 34
+ HORZGUIDE, 104
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#endif // Ðóññêèé (Ðîññèÿ) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Dbx_mmap_SA/Import_SA/version.h b/plugins/Dbx_mmap_SA/Import_SA/version.h
new file mode 100644
index 0000000000..43c674195b
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/version.h
@@ -0,0 +1,22 @@
+#include <m_version.h>
+
+#define __FILEVERSION_STRING MIRANDA_VERSION_FILEVERSION
+#define __VERSION_STRING MIRANDA_VERSION_STRING
+#define __VERSION_DWORD MIRANDA_VERSION_DWORD
+#ifdef _UNICODE
+#if defined(WIN64) || defined(_WIN64)
+ #define __PLUGIN_NAME "Import secured contacts and messages (Unicode x64)"
+#else
+ #define __PLUGIN_NAME "Import secured contacts and messages (Unicode)"
+#endif
+#else
+ #define __PLUGIN_NAME "Import secured contacts and messages "
+#endif
+#define __INTERNAL_NAME "Import_sa"
+#define __FILENAME "Import_sa.dll"
+#define __DESCRIPTION "Imports contacts and messages from Mirabilis ICQ and Miranda IM. Enhanced modification with encrypted database support."
+#define __DESCRIPTIONSHORT "Miranda IM Secured Import Plugin."
+#define __AUTHOR "Miranda team"
+#define __AUTHOREMAIL "info@miranda-im.org"
+#define __AUTHORWEB "http://www.miranda-im.org"
+#define __COPYRIGHT "© 2000-2011 Martin Oberg, Richard Hughes, Dmitry Kuzkin, George Hazan"
diff --git a/plugins/Dbx_mmap_SA/Import_SA/wizard.c b/plugins/Dbx_mmap_SA/Import_SA/wizard.c
new file mode 100644
index 0000000000..0584cba073
--- /dev/null
+++ b/plugins/Dbx_mmap_SA/Import_SA/wizard.c
@@ -0,0 +1,215 @@
+/*
+
+Import plugin for Miranda IM
+
+Copyright (C) 2001-2005 Martin Öberg, Richard Hughes, Roland Rabien & Tristan Van de Vreede
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+#include "import.h"
+
+INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK MirabilisPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK MirandaPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
+INT_PTR CALLBACK ICQserverPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam);
+
+extern HINSTANCE hInst;
+BOOL IsProtocolLoaded(char* pszProtocolName);
+BOOL EnumICQAccounts();
+void FreeICQAccountsList();
+
+INT_PTR CALLBACK ImportTypePageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch( message ) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ CheckDlgButton(hdlg, IDC_MIRANDA, BST_CHECKED);
+
+ // Disable Mirabilis import if ICQ isn't loaded.
+ if (!EnumICQAccounts())
+ EnableWindow(GetDlgItem(hdlg, IDC_MIRABILIS), FALSE);
+
+ return TRUE;
+
+ case WM_COMMAND:
+ switch( LOWORD( wParam )) {
+ case IDC_BACK:
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc);
+ break;
+
+ case IDOK:
+ if (IsDlgButtonChecked(hdlg, IDC_MIRANDA))
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_MIRANDADB, (LPARAM)MirandaPageProc);
+ else if (IsDlgButtonChecked(hdlg, IDC_MIRABILIS))
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_MIRABILISDB, (LPARAM)MirabilisPageProc);
+ else if (IsDlgButtonChecked(hdlg, IDC_USEFINDADD)) {
+ CallService(MS_FINDADD_FINDADD, 0, 0);
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_FINISHED, (LPARAM)FinishedPageProc);
+ }
+ break;
+
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+ } }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch( message ) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ SendMessage(GetParent(hdlg), WIZM_DISABLEBUTTON, 0, 0);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch( LOWORD( wParam )) {
+ case IDOK:
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_IMPORTTYPE, (LPARAM)ImportTypePageProc);
+ break;
+
+ case IDCANCEL:
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+ } }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch( message ) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ SendMessage(GetParent(hdlg), WIZM_DISABLEBUTTON, 0, 0);
+ SendMessage(GetParent(hdlg), WIZM_SETCANCELTEXT, 0, (LPARAM)TranslateT("Finish"));
+ CheckDlgButton(hdlg, IDC_DONTLOADPLUGIN, BST_UNCHECKED);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch( LOWORD( wParam )) {
+ case IDOK:
+ PostMessage(GetParent(hdlg), WIZM_GOTOPAGE, IDD_IMPORTTYPE, (LPARAM)ImportTypePageProc);
+ break;
+
+ case IDCANCEL:
+ if ( IsDlgButtonChecked( hdlg, IDC_DONTLOADPLUGIN )) {
+ char sModuleFileName[MAX_PATH];
+ char *pszFileName;
+
+ GetModuleFileNameA(hInst, sModuleFileName, sizeof(sModuleFileName));
+ pszFileName = strrchr(sModuleFileName, '\\' );
+ if (pszFileName == NULL)
+ pszFileName = sModuleFileName;
+ else
+ pszFileName++;
+
+ // We must lower case here because if a DLL is loaded in two
+ // processes, its file name from GetModuleFileName in one process may
+ // differ in case from its file name in the other process. This will
+ // prevent the plugin from disabling/enabling correctly (this fix relies
+ // on the plugin loader to ignore case)
+ CharLowerA(pszFileName);
+ DBWriteContactSettingByte(NULL, "PluginDisable", pszFileName, 1);
+ }
+ PostMessage(GetParent(hdlg), WM_CLOSE, 0, 0);
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK WizardDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ static HWND hwndPage;
+
+ switch ( message ) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hdlg);
+ hwndPage = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARDINTRO), hdlg, WizardIntroPageProc);
+ SetWindowPos(hwndPage, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
+ ShowWindow(hwndPage, SW_SHOW);
+ ShowWindow(hdlg, SW_SHOW);
+ SendMessage(hdlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_IMPORT)));
+ return TRUE;
+
+ case WIZM_GOTOPAGE:
+ DestroyWindow(hwndPage);
+ EnableWindow(GetDlgItem(hdlg, IDC_BACK), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDOK), TRUE);
+ EnableWindow(GetDlgItem(hdlg, IDCANCEL), TRUE);
+ SetDlgItemText(hdlg, IDCANCEL, TranslateT("Cancel"));
+ hwndPage = CreateDialog(hInst, MAKEINTRESOURCE(wParam), hdlg, (DLGPROC)lParam);
+ SetWindowPos(hwndPage, 0, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
+ ShowWindow(hwndPage, SW_SHOW);
+ break;
+
+ case WIZM_DISABLEBUTTON:
+ switch ( wParam ) {
+ case 0:
+ EnableWindow(GetDlgItem(hdlg, IDC_BACK), FALSE);
+ break;
+
+ case 1:
+ EnableWindow(GetDlgItem(hdlg, IDOK), FALSE);
+ break;
+
+ case 2:
+ EnableWindow(GetDlgItem(hdlg, IDCANCEL), FALSE);
+ break;
+ }
+ break;
+
+ case WIZM_ENABLEBUTTON:
+ switch ( wParam ) {
+ case 0:
+ EnableWindow(GetDlgItem(hdlg, IDC_BACK), TRUE);
+ break;
+
+ case 1:
+ EnableWindow(GetDlgItem(hdlg, IDOK), TRUE);
+ break;
+
+ case 2:
+ EnableWindow(GetDlgItem(hdlg, IDCANCEL), TRUE);
+ break;
+ }
+ break;
+
+ case WIZM_SETCANCELTEXT:
+ SetDlgItemText(hdlg, IDCANCEL, (TCHAR*)lParam);
+ break;
+
+ case WM_COMMAND:
+ SendMessage(hwndPage, WM_COMMAND, wParam, lParam);
+ break;
+
+ case WM_CLOSE:
+ DestroyWindow(hwndPage);
+ DestroyWindow(hdlg);
+
+ FreeICQAccountsList();
+ break;
+ }
+
+ return FALSE;
+}