From e270d3193a2a5b958e6416ce340246e790f7bd86 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Sat, 27 Oct 2007 09:10:29 +0000 Subject: Finished pluginloader, plugininterface Some fixes and error management (needs improvement) in Core and Service/Hook classes. "Clean Plugin Unloading on Error" finished Some debuging messages on startup. to Fix this remove old Plugins from Pluginfolder git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@535 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UPluginInterface.pas | 48 ++++++++-------------------------- 1 file changed, 11 insertions(+), 37 deletions(-) (limited to 'Game/Code/Classes/UPluginInterface.pas') diff --git a/Game/Code/Classes/UPluginInterface.pas b/Game/Code/Classes/UPluginInterface.pas index 6d17d51d..a9cc7e46 100644 --- a/Game/Code/Classes/UPluginInterface.pas +++ b/Game/Code/Classes/UPluginInterface.pas @@ -8,11 +8,6 @@ unit uPluginInterface; interface uses uPluginDefs; -//--------------- -// Procedure that Sets the PluginInterface Record -//--------------- - Procedure Init_PluginInterface; - //--------------- // Methods for Plugin //--------------- @@ -59,29 +54,8 @@ uses uPluginDefs; otherwise 0} Function ServiceExists (ServiceName: PChar): Integer; stdcall; -var - PluginInterface: TUS_PluginInterface; - implementation - -//--------------- -// Procedure that Sets the PluginInterface Record -//--------------- -Procedure Init_PluginInterface; -begin - PluginInterface.CreateHookableEvent := CreateHookableEvent; - PluginInterface.DestroyHookableEvent := DestroyHookableEvent; - PluginInterface.NotivyEventHooks := NotivyEventHooks; - PluginInterface.HookEvent := HookEvent; - PluginInterface.UnHookEvent := UnHookEvent; - PluginInterface.EventExists := EventExists; - - PluginInterface.CreateService := CreateService; - PluginInterface.DestroyService := DestroyService; - PluginInterface.CallService := CallService; - PluginInterface.ServiceExists := ServiceExists; -end; - +uses UCore; {******** Hook specific Methods ********} //--------------- @@ -90,7 +64,7 @@ end; //--------------- Function CreateHookableEvent (EventName: PChar): THandle; stdcall; begin - + Result := Core.Hooks.AddEvent(EventName); end; //--------------- @@ -99,7 +73,7 @@ end; //--------------- Function DestroyHookableEvent (hEvent: THandle): integer; stdcall; begin - + Result := Core.Hooks.DelEvent(hEvent); end; //--------------- @@ -109,7 +83,7 @@ end; //--------------- Function NotivyEventHooks (hEvent: THandle; wParam, lParam: dWord): integer; stdcall; begin - + Result := Core.Hooks.CallEventChain(hEvent, wParam, lParam); end; //--------------- @@ -118,7 +92,7 @@ end; //--------------- Function HookEvent (EventName: PChar; HookProc: TUS_Hook): THandle; stdcall; begin - + Result := Core.Hooks.AddSubscriber(EventName, HookProc); end; //--------------- @@ -127,7 +101,7 @@ end; //--------------- Function UnHookEvent (hHook: THandle): Integer; stdcall; begin - + Result := Core.Hooks.DelSubscriber(hHook); end; //--------------- @@ -136,7 +110,7 @@ end; //--------------- Function EventExists (EventName: PChar): Integer; stdcall; begin - + Result := Core.Hooks.EventExists(EventName); end; {******** Service specific Methods ********} @@ -146,7 +120,7 @@ end; //--------------- Function CreateService (ServiceName: PChar; ServiceProc: TUS_Service): THandle; stdcall; begin - + Result := Core.Services.AddService(ServiceName, ServiceProc); end; //--------------- @@ -155,7 +129,7 @@ end; //--------------- Function DestroyService (hService: THandle): integer; stdcall; begin - + Result := Core.Services.DelService(hService); end; //--------------- @@ -164,7 +138,7 @@ end; //--------------- Function CallService (ServiceName: PChar; wParam, lParam: dWord): integer; stdcall; begin - + Result := Core.Services.CallService(ServiceName, wParam, lParam); end; //--------------- @@ -173,7 +147,7 @@ end; //--------------- Function ServiceExists (ServiceName: PChar): Integer; stdcall; begin - + Result := Core.Services.ServiceExists(ServiceName); end; end. -- cgit v1.2.3