From 10091bbca1380a1d8e3b9d61b8c175490036af5b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 2 Dec 2016 22:21:55 +0300 Subject: old shit died now there's no need to create fake services & events --- include/delphi/m_core.inc | 8 +++++++ include/delphi/m_system.inc | 38 ------------------------------ include/m_system.h | 57 +++++++++------------------------------------ 3 files changed, 19 insertions(+), 84 deletions(-) (limited to 'include') diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 3428109f97..f5af2c3ca4 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -152,6 +152,14 @@ function CallProtoService(const szModule:PAnsiChar;const szService:PAnsiChar;wPa function mir_urlEncode(url:PAnsiChar): PAnsiChar; stdcall; external CoreDLL name 'mir_urlEncode'; +/////////////////////////////////////////////////////////////////////////////// +// wait handles + +type + MWaitableStub = procedure; stdcall; + +procedure Miranda_WaitOnHandle(pFunc:MWaitableStub; hEvent:THANDLE); stdcall; external AppDll; + /////////////////////////////////////////////////////////////////////////////// // exceptions diff --git a/include/delphi/m_system.inc b/include/delphi/m_system.inc index 55bd148a67..2567b8c2b9 100644 --- a/include/delphi/m_system.inc +++ b/include/delphi/m_system.inc @@ -96,44 +96,6 @@ const } MS_SYSTEM_GETVERSIONTEXT:PAnsiChar = 'Miranda/System/GetVersionText'; - { Adds a HANDLE to the list to be checked in the main message loop v0.1.2.0+ - wParam=(WPARAM)(HANDLE)hObject - lParam=(LPARAM)(const AnsiChar*)pszService - returns 0 on success or nonzero on failure - Causes pszService to be CallService()d (wParam=hObject,lParam=0) from the - main thread whenever hObject is signalled. - The Miranda message loop has a MsgWaitForMultipleObjects() call in it to - implement this feature. See the documentation for that function for - information on what objects are supported. - There is a limit of MAXIMUM_WAIT_OBJECTS minus one (MWO is defined in winnt.h - to be 64) on the number of handles MSFMO() can process. This service will - return nonzero if that many handles are already being waited on. - As of writing, the following parts of Miranda are thread-safe, so can be - called from any thread: - All of modules.h except NotifyEventHooks() - Read-only parts of m_database.h (since the write parts will call hooks) - All of m_langpack.h - for all other routines your mileage may vary, but I would strongly recommend - that you call them from the main thread, or ask about it on plugin-dev if you - think it really ought to work. - Update during 0.1.2.0 development, 16/10/01: - NotifyEventHooks() now translates all calls into the context of the main - thread, which means that all of m_database.h is now completely safe. - Update during 0.1.2.2 development, 17/4/02: - The main thread's message loop now also deals with asynchronous procedure - calls. Loop up QueueUserAPC() for a neater way to accomplish a lot of the - things that used to require ms_system_waitonhandle. - Miranda is compiled with the multithreaded runtime - don't forget to do the - same with your plugin. - } - MS_SYSTEM_WAITONHANDLE:PAnsiChar = 'Miranda/System/WaitOnHandle'; - - {Removes a HANDLE from the wait list v0.1.2.0+ } - {wParam=(WPARAM)(HANDLE)hObject } - {lParam=0 } - {returns 0 on success or nonzero on failure. } - MS_SYSTEM_REMOVEWAIT:PAnsiChar = 'Miranda/System/RemoveWait'; - { wParam=0 lParam=0 diff --git a/include/m_system.h b/include/m_system.h index 4d5757c593..f0b16ea385 100644 --- a/include/m_system.h +++ b/include/m_system.h @@ -91,54 +91,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //version 1.2.3.3210 is 0x0001, 0x0002, 0x0003, 0x0C8a #define MS_SYSTEM_GETFILEVERSION "Miranda/System/GetFileVersion" -//gets the version of Miranda encoded as text v0.1.0.1+ -//wParam = cch -//lParam = (LPARAM)(char*)pszVersion -//cch is the size of the buffer pointed to by pszVersion, in bytes -//may return a build qualifier, such as "0.1.0.1 alpha" -//returns 0 on success, nonzero on failure +// gets the version of Miranda encoded as text v0.1.0.1+ +// wParam = cch +// lParam = (LPARAM)(char*)pszVersion +// cch is the size of the buffer pointed to by pszVersion, in bytes +// may return a build qualifier, such as "0.1.0.1 alpha" +// returns 0 on success, nonzero on failure #define MS_SYSTEM_GETVERSIONTEXT "Miranda/System/GetVersionText" -//Adds a HANDLE to the list to be checked in the main message loop v0.1.2.0+ -//wParam = (WPARAM)(HANDLE)hObject -//lParam = (LPARAM)(const char*)pszService -//returns 0 on success or nonzero on failure -//Causes pszService to be CallService()d (wParam = hObject, lParam = 0) from the -//main thread whenever hObject is signalled. -//The Miranda message loop has a MsgWaitForMultipleObjects() call in it to -//implement this feature. See the documentation for that function for -//information on what objects are supported. -//There is a limit of MAXIMUM_WAIT_OBJECTS minus one (MWO is defined in winnt.h -//to be 64) on the number of handles MSFMO() can process. This service will -//return nonzero if that many handles are already being waited on. - -//As of writing, the following parts of Miranda are thread-safe, so can be -//called from any thread: -//All of modules.h except NotifyEventHooks() -//Read-only parts of m_database.h (since the write parts will call hooks) -//All of m_langpack.h -//for all other routines your mileage may vary, but I would strongly recommend -//that you call them from the main thread, or ask about it on plugin-dev if you -//think it really ought to work. - -//Update during 0.1.2.0 development, 16/10/01: -//NotifyEventHooks() now translates all calls into the context of the main -//thread, which means that all of m_database.h is now completely safe. - -//Update during 0.1.2.2 development, 17/4/02: -//The main thread's message loop now also deals with asynchronous procedure -//calls. Loop up QueueUserAPC() for a neater way to accomplish a lot of the -//things that used to require ms_system_waitonhandle. - -//Miranda is compiled with the multithreaded runtime - don't forget to do the -//same with your plugin. -#define MS_SYSTEM_WAITONHANDLE "Miranda/System/WaitOnHandle" - -//Removes a HANDLE from the wait list v0.1.2.0+ -//wParam = (WPARAM)(HANDLE)hObject -//lParam = 0 -//returns 0 on success or nonzero on failure. -#define MS_SYSTEM_REMOVEWAIT "Miranda/System/RemoveWait" +// Adds an event to the list to be checked in the main message loop +// when a handle gets triggered, an appopriate stub gets called + +typedef void (CALLBACK *MWaitableStub)(void); +MIR_APP_DLL(void) Miranda_WaitOnHandle(MWaitableStub pFunc, HANDLE hEvent = NULL); /* wParam = 0 -- cgit v1.2.3