From 3ccd712341ed9e76252bd595c5a797d6c8ea8992 Mon Sep 17 00:00:00 2001
From: Alexey Kulakov <panda75@bk.ru>
Date: Sat, 28 Jul 2012 18:35:29 +0000
Subject: Delphi API updates

git-svn-id: http://svn.miranda-ng.org/main/trunk@1229 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 include/delphi/m_api.pas                   |  25 ++++---
 include/delphi/m_core.inc                  |  15 ++++
 include/delphi/m_database.inc              |  17 +++++
 include/delphi/m_db_int.inc                | 114 ++++++++++++++++++++++++-----
 include/delphi/m_newawaysys.inc            | 108 ---------------------------
 include/delphi/reserve/m_newawaysys.inc    | 108 +++++++++++++++++++++++++++
 include/delphi/reserve/m_statusplugins.inc |  10 +--
 7 files changed, 252 insertions(+), 145 deletions(-)
 delete mode 100644 include/delphi/m_newawaysys.inc
 create mode 100644 include/delphi/reserve/m_newawaysys.inc

(limited to 'include')

diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas
index 133d3cf8b1..92c39c164d 100644
--- a/include/delphi/m_api.pas
+++ b/include/delphi/m_api.pas
@@ -156,18 +156,21 @@ const
 }
   ME_SYSTEM_MODULEUNLOAD:pAnsiChar = 'Miranda/System/UnloadModule';
 
-  { Database plugin stuff  }
-
-  // grokHeader() error codes
+{
+  Each service mode plugin must implement MS_SERVICEMODE_LAUNCH 
+   This service might return one of the following values:
+	SERVICE_CONTINUE - load Miranda normally, like there's no service plugins at all
+	SERVICE_ONLYDB - load database and then execute service plugin only
+	SERVICE_MONOPOLY - execute only service plugin, even without database
+	SERVICE_FAILED - terminate Miranda execution
+}
 const
-   EGROKPRF_NOERROR   = 0;
-   EGROKPRF_CANTREAD  = 1; // can't open the profile for reading
-   EGROKPRF_UNKHEADER = 2; // header not supported, not a supported profile
-   EGROKPRF_VERNEWER  = 3; // header correct, version in profile newer than reader/writer
-   EGROKPRF_DAMAGED   = 4; // header/version fine, other internal data missing, damaged.
-// makeDatabase() error codes
-   EMKPRF_CREATEFAILED = 1; // for some reason CreateFile() didnt like something
+  SERVICE_CONTINUE = 0;
+  SERVICE_ONLYDB   = 1;
+  SERVICE_MONOPOLY = 2;
+  SERVICE_FAILED   = (-1);
 
+  MS_SERVICEMODE_LAUNCH:PansiChar = 'ServiceMode/Launch';
 
 {-- end newpluginapi --}
 
@@ -242,8 +245,6 @@ var
   {$include m_timezones.inc}
   {$include m_crypto.inc}
 
-  {$include m_newawaysys.inc}
-
 implementation
 
 const
diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc
index 4a7b6480f0..1923840366 100644
--- a/include/delphi/m_core.inc
+++ b/include/delphi/m_core.inc
@@ -27,6 +27,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 const
   CoreDLL = 'mir_core.dll';
 
+///////////////////////////////////////////////////////////////////////////////
+// command line support
+
+// Parse ptszCmdLine. it must NOT be a constant (content will be patched)
+procedure CmdLine_Parse(ptszCmdLine:PWideChar); stdcall;
+                        external CoreDLL name 'CmdLine_Parse';
+
+function CmdLine_GetOption(ptszParameter:PWideChar):PWideChar; stdcall;
+                           external CoreDLL name 'CmdLine_GetOption';
+
 ///////////////////////////////////////////////////////////////////////////////
 // database functions
 
@@ -530,6 +540,9 @@ function Utf8EncodeW(const src:PWideChar):PAnsiChar;stdcall;
 
 function Ucs2toUtf8Len(const src:pWideChar):int; stdcall;
                        external CoreDLL name 'Ucs2toUtf8Len';
+
+function Utf8CheckString(const astr:PAnsiChar):bool;stdcall;
+                         external CoreDLL name 'Utf8CheckString';
 }
 // aliases
 function mir_utf8decode(str:PAnsiChar; var ucs2:pWideChar):PAnsiChar;stdcall;
@@ -550,6 +563,8 @@ function mir_utf8encodew(const src:PWideChar):PAnsiChar;stdcall;
 function mir_utf8lenW(const src:pWideChar):int; stdcall;
                        external CoreDLL name 'Ucs2toUtf8Len';
 
+function mir_utf8checkstring(const astr:PAnsiChar):bool;stdcall;
+                         external CoreDLL name 'Utf8CheckString';
 
 ///////////////////////////////////////////////////////////////////////////////
 
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc
index 5ce91df2b3..784610fe3b 100644
--- a/include/delphi/m_database.inc
+++ b/include/delphi/m_database.inc
@@ -26,6 +26,23 @@ const
   MS_DB_GETPROFILEPATH :PAnsiChar = 'DB/GetProfilePath';
   MS_DB_GETPROFILEPATHW:PAnsiChar = 'DB/GetProfilePathW';
 
+  {
+  Sets the default profile name programmatically
+  Analog of Database/DefaultProfile in mirandaboot.ini
+    wParam = (WPARAM)(TCHAR*)ptszProfileName
+    lParam = 0 (unused)
+  }
+  MS_DB_SETDEFAULTPROFILE:PAnsiChar = 'DB/SetDefaultProfile';
+
+  {
+  Checks the specified profile like dbtool did.
+  Implemented in the dbchecker plugins, thus it might not exist
+    wParam = (WPARAM)(TCHAR*)ptszProfileName
+    lParam = 0 (unused)
+  }
+
+  MS_DB_CHECKPROFILE:PAnsiChar = 'DB/CheckProfile';
+
 type
   PDBCONTACTGETSETTING = ^TDBCONTACTGETSETTING;
   TDBCONTACTGETSETTING = record
diff --git a/include/delphi/m_db_int.inc b/include/delphi/m_db_int.inc
index 979ee2cb14..f00489ac5d 100644
--- a/include/delphi/m_db_int.inc
+++ b/include/delphi/m_db_int.inc
@@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 {$IFNDEF M_DB_INT}
 {$DEFINE M_DB_INT}
 
+///////////////////////////////////////////////////////////////////////////////
+// basic database interface
 type
   PMIDatabase = ^TMIDatabase;
   TMIDatabase = interface
@@ -63,32 +65,71 @@ type
     function EnumResidentSettings(pFunc:TDBMODULEENUMPROC; pParam:pointer):bool; stdcall;
   end;
 
+///////////////////////////////////////////////////////////////////////////////
+// basic database checker interface
+
+const
+  STATUS_MESSAGE = 0;
+  STATUS_WARNING = 1;
+  STATUS_ERROR   = 2;
+  STATUS_FATAL   = 3;
+  STATUS_SUCCESS = 4;
+
+type
+  pDBCHeckCallback = ^tDBCHeckCallback;
+  tDBCHeckCallback = record
+    cbSize:int;
+    spaceProcessed,
+    spaceUsed: dword;
+    hOutFile:THANDLE;
+    bCheckOnly,
+    bBackup,
+    bAggressive,
+    bEraseHistory,
+    bMarkRead,
+    bConvertUtf:int;
+    pfnAddLogMessage: procedure(_type:int; const szFormat:PWideChar{;...}); cdecl;
+  end;
+
+type
+  PMIDatabaseChecker = ^MIDatabaseChecker;
+  MIDatabaseChecker = interface
+	  function Start(callback:PDBCHeckCallback):bool;stdcall;
+    function CheckDb(phase:int; firstTime:int):bool; stdcall;
+    procedure Destroy(); stdcall;
+  end;
+
+///////////////////////////////////////////////////////////////////////////////
+// Each database plugin should register itself using this structure
+
+
+{
+ Codes for DATABASELINK functions
+}
+const
+// grokHeader() error codes
+  EGROKPRF_NOERROR   = 0;
+  EGROKPRF_CANTREAD  = 1; // can't open the profile for reading
+  EGROKPRF_UNKHEADER = 2; // header not supported, not a supported profile
+  EGROKPRF_VERNEWER  = 3; // header correct, version in profile newer than reader/writer
+  EGROKPRF_DAMAGED   = 4; // header/version fine, other internal data missing, damaged.
+
+// makeDatabase() error codes
+  EMKPRF_CREATEFAILED = 1; // for some reason CreateFile() didnt like something
+
 type
   PDATABASELINK = ^TDATABASELINK;
   TDATABASELINK = record
     cbSize : int;
-    {
-      returns what the driver can do given the flag
-    }
-    getCapability : function (flag:int):int; cdecl;
-    {
-       buf: pointer to a string buffer
-       cch: length of buffer
-       shortName: if true, the driver should return a short but descriptive name, e.g. "3.xx profile"
-       Affect: The database plugin must return a "friendly name" into buf and not exceed cch bytes,
-         e.g. "Database driver for 3.xx profiles"
-       Returns: 0 on success, non zero on failure
-    }
-    getFriendlyName : function (buf:TChar; cch:size_t; shortName:int):int; cdecl;
+    szShortName:PAnsiChar;  // uniqie short database name
+    szFullName:TChar;  // in English, auto-translated by the core
     {
       profile: pointer to a string which contains full path + name
       Affect: The database plugin should create the profile, the filepath will not exist at
         the time of this call, profile will be C:\..\<name>.dat
-      Note: Do not prompt the user in anyway about this operation.
-      Note: Do not initialise internal data structures at this point!
       Returns: 0 on success, non zero on failure - error contains extended error information, see EMKPRF_
     }
-    makeDatabase : function (profile:TChar; error:Pint):int; cdecl;
+    makeDatabase : function (const profile:TChar):int; cdecl;
     {
       profile: [in] a null terminated string to file path of selected profile
       error: [in/out] pointer to an int to set with error if any
@@ -99,18 +140,51 @@ type
         etc.
       Returns: 0 on success, non zero on failure
     }
-    grokHeader : function (profile:TChar; error:Pint):int; cdecl;
+    grokHeader : function (const profile:TChar):int; cdecl;
     {
-      Affect: Tell the database to create all services/hooks that a 3.xx legecy database might support into link
+      Affect: Tell the database to create all services/hooks that a 3.xx legacy database might support into link,
+        which is a DATABASELINK structure
       Returns: 0 on success, nonzero on failure
     }
-    Load : function (profile:TChar):PMIDatabase; cdecl;
+    Load : function (const profile:TChar):PMIDatabase; cdecl;
     {
       Affect: The database plugin should shutdown, unloading things from the core and freeing internal structures
       Returns: 0 on success, nonzero on failure
       Note: Unload() might be called even if Load() was never called, wasLoaded is set to 1 if Load() was ever called.
     }
-    Unload : function (wasLoaded:int):int; cdecl;
+    Unload : function (db:PMIDatabase):int; cdecl;
+    {
+      Returns a pointer to the database checker or NULL if a database doesn't support checking
+      When you don't need this object aanymore,  call its Destroy() method
+    }
+    CheckDB : function (const profile:PWideChar; error:pint):PMIDatabaseChecker;cdecl;
   end;
 
+///////////////////////////////////////////////////////////////////////////////
+// Database list's services
+
+const
+{
+  MS_DB_REGISTER_PLUGIN : registers a database plugin
+  wParam : 0 (unused)
+  lParam : DATABASELINK* = database link description
+}
+  MS_DB_REGISTER_PLUGIN:PAnsiChar = 'DB/RegisterPlugin';
+
+{
+  MS_DB_FIND_PLUGIN : looks for a database plugin suitable to open this file
+  wParam : 0 (unused)
+  lParam : const TCHAR* = name of the database file
+  returns DATABASELINK* of the required plugin or NULL on error
+}
+  MS_DB_FIND_PLUGIN:PAnsiChar = 'DB/FindPlugin';
+
+{
+  MS_DB_GET_CURRENT : returns the database pointer for the current profile
+  wParam : 0 (unused)
+  lParam : 0 (unused)
+  returns MIDatabase* of the current profile or NULL on error
+}
+  MS_DB_GET_CURRENT:PAnsiChar = 'DB/GetCurrentDb';
+
 {$ENDIF}
diff --git a/include/delphi/m_newawaysys.inc b/include/delphi/m_newawaysys.inc
deleted file mode 100644
index 1a12135d0b..0000000000
--- a/include/delphi/m_newawaysys.inc
+++ /dev/null
@@ -1,108 +0,0 @@
-{
-  New Away System plugin for Miranda IM
-  Copyright (C) 2005 Chervov Dmitry
-
-    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 M_NEWAWAYSYS}
-{$DEFINE M_NEWAWAYSYS}
-
-const
-// NAS_PROTOINFO::Flags constants
-  PIF_NO_CLIST_SETSTATUSMODE = 1; // NAS won't call MS_CLIST_SETSTATUSMODE service on a global status change, if this flag is set. it's useful if you want to change the global message and status in NAS without changing current "real" protocol statuses. NAS ignores this flag if szProto != NULL
-  PIF_NOTTEMPORARY           = 2; // usually you should NOT set this flag
-// MS_NAS_SETSTATE: NAS will overwrite current user-defined message for szProto if this flag is specified; otherwise (if the flag isn't specified), your szMsg will be stored only until the next szProto status change, and won't overwrite any messages specified by user
-// MS_NAS_GETSTATE: NAS ignores any temporary messages and returns only non-temporary ones. this flag affects something only when status == 0
-
-type
-  PNAS_PROTOINFO = ^TNAS_PROTOINFO;
-  TNAS_PROTOINFO = record
-    cbSize : int;
-    szProto: PAnsiChar; // pointer to protocol modulename (NULL means global)
-    Msg    : TChar; // pointer to the status message (may be NULL -
-                    // means that there's no specific message for this protocol)
-{
-  Be aware that MS_NAS_GETSTATE allocates memory for szMsg through Miranda's
-  memory management interface (MS_SYSTEM_GET_MMI). And MS_NAS_SETSTATE expects
-  szMsg to be allocated through the same service. MS_NAS_SETSTATE deallocates szMsg.
-}
-    status : WORD; // status mode. 0 means current (NAS will overwrite 0 with
-                   // the current status mode)
-{
-  for MS_NAS_GETSTATE if the specified status is not 0, MS_NAS_GETSTATE will
-  return the default/last status message (depends on settings) - i.e. the same
-  message that will be shown by default when user changes status to the specified
-  one. please note that, for example, if current status mode is ID_STATUS_AWAY,
-  then status messages returned by MS_NAS_GETSTATE for status=0 and
-  status=ID_STATUS_AWAY may be different! for status=ID_STATUS_AWAY it always
-  returns the default/last status message, and for status=0 it returns
-  _current_ status message.
-}
-    Flags  : int;
-  end;
-
-const
-// MS_NAS_GETSTATE
-// Fills specified array of NAS_PROTOINFO items with protocol data.
-// You must construct the array and specify cbSize and szProto fields of
-// all items in the array before calling this service.
-// Remember to free szMsg fields through Miranda's MMI if you don't pass them back to NAS through MS_NAS_SETSTATE later.
-// wParam = (WPARAM)(NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items to be filled.
-// lParam = (LPARAM)(int)protoCount - number of items in pi.
-// returns 0 on success
-  MS_NAS_GETSTATEA:PAnsiChar = 'NewAwaySystem/GetStateA';
-  MS_NAS_GETSTATEW:PAnsiChar = 'NewAwaySystem/GetStateW';
-
-// MS_NAS_SETSTATE
-// Changes status mode and message of specified protocols.
-// (Note that this service deallocates szMsg field of the specified items through
-// Miranda's MMI, so the array is not valid anymore after MS_NAS_SETSTATE returns!)
-// wParam = (NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items.
-// lParam = (LPARAM)(int)protoCount - number of items in pi.
-// returns 0 on success
-  MS_NAS_SETSTATEA:PAnsiChar = 'NewAwaySystem/SetStateA';
-  MS_NAS_SETSTATEW:PAnsiChar = 'NewAwaySystem/SetStateW';
-var
-  MS_NAS_GETSTATE:PAnsiChar absolute MS_NAS_GETSTATEW;
-  MS_NAS_SETSTATE:PAnsiChar absolute MS_NAS_SETSTATEW;
-
-const
-// NAS_ISWINFO::Flags constants
-  ISWF_NOCOUNTDOWN = 1; // don't start the countdown to close the window
-  ISWF_UNICODE     = 2; // specifies that NAS_ISWINFO::szMsg is a WCHAR*
-type
-  PNAS_ISWINFO = ^TNAS_ISWINFO;
-  TNAS_ISWINFO = record
-    cbSize  :int;
-    szProto :PAnsiChar;   // pointer to initial protocol modulename (NULL means
-                      // global); ignored when hContact is not NULL.
-    hContact:THANDLE; // NAS will select this contact in the window initially,
-                      // if it's not NULL.
-    Msg     :TChar;   // pointer to an initial status message (may be NULL,
-                      // NAS will use the default message then)
-    status  :word;    // status mode. 0 means current.
-    iFlags  :int;     // a combination of ISWF_ constants
-  end;
-
-const
-// MS_NAS_INVOKESTATUSWINDOW
-// Invokes the status message change window.
-// Though if the window is open already, this service just activates an existing window and changes protocol status (i.e. it ignores szMsg and hContact). This behavior may change in future.
-// wParam = (WPARAM)(NAS_ISWINFO*)iswi - pointer to a NAS_ISWINFO structure.
-// lParam = 0
-// returns HWND of the window on success, or NULL on failure.
-  MS_NAS_INVOKESTATUSWINDOW:PAnsiChar = 'NewAwaySystem/InvokeStatusWindow';
-
-{$ENDIF}
diff --git a/include/delphi/reserve/m_newawaysys.inc b/include/delphi/reserve/m_newawaysys.inc
new file mode 100644
index 0000000000..1a12135d0b
--- /dev/null
+++ b/include/delphi/reserve/m_newawaysys.inc
@@ -0,0 +1,108 @@
+{
+  New Away System plugin for Miranda IM
+  Copyright (C) 2005 Chervov Dmitry
+
+    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 M_NEWAWAYSYS}
+{$DEFINE M_NEWAWAYSYS}
+
+const
+// NAS_PROTOINFO::Flags constants
+  PIF_NO_CLIST_SETSTATUSMODE = 1; // NAS won't call MS_CLIST_SETSTATUSMODE service on a global status change, if this flag is set. it's useful if you want to change the global message and status in NAS without changing current "real" protocol statuses. NAS ignores this flag if szProto != NULL
+  PIF_NOTTEMPORARY           = 2; // usually you should NOT set this flag
+// MS_NAS_SETSTATE: NAS will overwrite current user-defined message for szProto if this flag is specified; otherwise (if the flag isn't specified), your szMsg will be stored only until the next szProto status change, and won't overwrite any messages specified by user
+// MS_NAS_GETSTATE: NAS ignores any temporary messages and returns only non-temporary ones. this flag affects something only when status == 0
+
+type
+  PNAS_PROTOINFO = ^TNAS_PROTOINFO;
+  TNAS_PROTOINFO = record
+    cbSize : int;
+    szProto: PAnsiChar; // pointer to protocol modulename (NULL means global)
+    Msg    : TChar; // pointer to the status message (may be NULL -
+                    // means that there's no specific message for this protocol)
+{
+  Be aware that MS_NAS_GETSTATE allocates memory for szMsg through Miranda's
+  memory management interface (MS_SYSTEM_GET_MMI). And MS_NAS_SETSTATE expects
+  szMsg to be allocated through the same service. MS_NAS_SETSTATE deallocates szMsg.
+}
+    status : WORD; // status mode. 0 means current (NAS will overwrite 0 with
+                   // the current status mode)
+{
+  for MS_NAS_GETSTATE if the specified status is not 0, MS_NAS_GETSTATE will
+  return the default/last status message (depends on settings) - i.e. the same
+  message that will be shown by default when user changes status to the specified
+  one. please note that, for example, if current status mode is ID_STATUS_AWAY,
+  then status messages returned by MS_NAS_GETSTATE for status=0 and
+  status=ID_STATUS_AWAY may be different! for status=ID_STATUS_AWAY it always
+  returns the default/last status message, and for status=0 it returns
+  _current_ status message.
+}
+    Flags  : int;
+  end;
+
+const
+// MS_NAS_GETSTATE
+// Fills specified array of NAS_PROTOINFO items with protocol data.
+// You must construct the array and specify cbSize and szProto fields of
+// all items in the array before calling this service.
+// Remember to free szMsg fields through Miranda's MMI if you don't pass them back to NAS through MS_NAS_SETSTATE later.
+// wParam = (WPARAM)(NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items to be filled.
+// lParam = (LPARAM)(int)protoCount - number of items in pi.
+// returns 0 on success
+  MS_NAS_GETSTATEA:PAnsiChar = 'NewAwaySystem/GetStateA';
+  MS_NAS_GETSTATEW:PAnsiChar = 'NewAwaySystem/GetStateW';
+
+// MS_NAS_SETSTATE
+// Changes status mode and message of specified protocols.
+// (Note that this service deallocates szMsg field of the specified items through
+// Miranda's MMI, so the array is not valid anymore after MS_NAS_SETSTATE returns!)
+// wParam = (NAS_PROTOINFO*)pi - pointer to an array of NAS_PROTOINFO items.
+// lParam = (LPARAM)(int)protoCount - number of items in pi.
+// returns 0 on success
+  MS_NAS_SETSTATEA:PAnsiChar = 'NewAwaySystem/SetStateA';
+  MS_NAS_SETSTATEW:PAnsiChar = 'NewAwaySystem/SetStateW';
+var
+  MS_NAS_GETSTATE:PAnsiChar absolute MS_NAS_GETSTATEW;
+  MS_NAS_SETSTATE:PAnsiChar absolute MS_NAS_SETSTATEW;
+
+const
+// NAS_ISWINFO::Flags constants
+  ISWF_NOCOUNTDOWN = 1; // don't start the countdown to close the window
+  ISWF_UNICODE     = 2; // specifies that NAS_ISWINFO::szMsg is a WCHAR*
+type
+  PNAS_ISWINFO = ^TNAS_ISWINFO;
+  TNAS_ISWINFO = record
+    cbSize  :int;
+    szProto :PAnsiChar;   // pointer to initial protocol modulename (NULL means
+                      // global); ignored when hContact is not NULL.
+    hContact:THANDLE; // NAS will select this contact in the window initially,
+                      // if it's not NULL.
+    Msg     :TChar;   // pointer to an initial status message (may be NULL,
+                      // NAS will use the default message then)
+    status  :word;    // status mode. 0 means current.
+    iFlags  :int;     // a combination of ISWF_ constants
+  end;
+
+const
+// MS_NAS_INVOKESTATUSWINDOW
+// Invokes the status message change window.
+// Though if the window is open already, this service just activates an existing window and changes protocol status (i.e. it ignores szMsg and hContact). This behavior may change in future.
+// wParam = (WPARAM)(NAS_ISWINFO*)iswi - pointer to a NAS_ISWINFO structure.
+// lParam = 0
+// returns HWND of the window on success, or NULL on failure.
+  MS_NAS_INVOKESTATUSWINDOW:PAnsiChar = 'NewAwaySystem/InvokeStatusWindow';
+
+{$ENDIF}
diff --git a/include/delphi/reserve/m_statusplugins.inc b/include/delphi/reserve/m_statusplugins.inc
index a638dd1f24..5925be2d6a 100644
--- a/include/delphi/reserve/m_statusplugins.inc
+++ b/include/delphi/reserve/m_statusplugins.inc
@@ -25,10 +25,10 @@
 type
   PROTOCOLSETTINGEX = record
     cbSize    :integer;
-    szName    :PAnsiChar;   // pointer to protocol modulename
-    szMsg     :PAnsiChar;   // pointer to the status message (may be NULL)
-    status    :word;    // the status
-    lastStatus:word;    // last status
+    szName    :PAnsiChar; // pointer to protocol modulename
+    szMsg     :TChar;     // pointer to the status message (may be NULL)
+    status    :word;      // the status
+    lastStatus:word;      // last status
     tszAccName:TChar;
   end;
 
@@ -160,7 +160,7 @@ const
 // returns 0
   MS_KS_ANNOUNCESTATUSCHANGE:PAnsiChar = 'KeepStatus/AnnounceStatusChange';
 
-function announce_status_change(szProto:PAnsiChar;newstatus:integer;szMsg:PAnsiChar):integer;// cdecl;
+function announce_status_change(szProto:PAnsiChar;newstatus:integer;szMsg:TChar):integer;// cdecl;
 var
   ps:PROTOCOLSETTINGEX;
 begin
-- 
cgit v1.2.3