diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-10-27 09:10:29 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2007-10-27 09:10:29 +0000 |
commit | e270d3193a2a5b958e6416ce340246e790f7bd86 (patch) | |
tree | 9357c7e63dabce90bd15b437388b801d482acaf3 /Game/Code/Classes/UPluginInterface.pas | |
parent | 2b83fa1741b6b2d4c7548cd165f2158f9fdb351f (diff) | |
download | usdx-e270d3193a2a5b958e6416ce340246e790f7bd86.tar.gz usdx-e270d3193a2a5b958e6416ce340246e790f7bd86.tar.xz usdx-e270d3193a2a5b958e6416ce340246e790f7bd86.zip |
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
Diffstat (limited to '')
-rw-r--r-- | Game/Code/Classes/UPluginInterface.pas | 48 |
1 files changed, 11 insertions, 37 deletions
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 @@ -9,11 +9,6 @@ interface uses uPluginDefs;
//---------------
-// Procedure that Sets the PluginInterface Record
-//---------------
- Procedure Init_PluginInterface;
-
-//---------------
// Methods for Plugin
//---------------
{******** Hook specific Methods ********}
@@ -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.
|