aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UServices.pas
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-27 09:10:29 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-27 09:10:29 +0000
commite270d3193a2a5b958e6416ce340246e790f7bd86 (patch)
tree9357c7e63dabce90bd15b437388b801d482acaf3 /Game/Code/Classes/UServices.pas
parent2b83fa1741b6b2d4c7548cd165f2158f9fdb351f (diff)
downloadusdx-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 'Game/Code/Classes/UServices.pas')
-rw-r--r--Game/Code/Classes/UServices.pas14
1 files changed, 13 insertions, 1 deletions
diff --git a/Game/Code/Classes/UServices.pas b/Game/Code/Classes/UServices.pas
index fce81bd8..0028576b 100644
--- a/Game/Code/Classes/UServices.pas
+++ b/Game/Code/Classes/UServices.pas
@@ -22,7 +22,7 @@ type
Hash: Integer; //4 Bit Hash of the Services Name
Name: TServiceName; //Name of this Service
- Owner: Integer; //If > 0 [DLLMan Pluginindex + 1]; 0 - undefined, On Error Full shutdown, If < 0 [ModuleIndex - 1]
+ Owner: Integer; //If < 0 [-(DLLMan Pluginindex + 1)]; 0 - undefined, On Error Full shutdown, If < 0 [ModuleIndex - 1]
Next: PServiceInfo; //Pointer to the Next Service in teh list
@@ -63,6 +63,7 @@ var
ServiceManager: TServiceManager;
implementation
+uses UCore;
//------------
// Create - Creates Class and Set Standard Values
@@ -125,6 +126,9 @@ begin
Cur.Name := String(ServiceName);
Cur.Hash := NametoHash(Cur.Name);
+ //Add Owner to Service
+ Cur.Owner := Core.CurExecuted;
+
//Add Service to the List
If (FirstService = nil) then
FirstService := Cur;
@@ -208,18 +212,26 @@ Function TServiceManager.CallService(const ServiceName: PChar; const wParam, lPa
var
SExists: Integer;
Service: PServiceInfo;
+ CurExecutedBackup: Integer; //backup of Core.CurExecuted Attribute
begin
Result := SERVICE_NOT_FOUND;
SExists := ServiceExists(ServiceName);
If (SExists <> 0) then
begin
+ //Backup CurExecuted
+ CurExecutedBackup := Core.CurExecuted;
+
Service := ptr(SExists);
+
If (Service.isClass) then
//Use Proc of Class
Result := Service.ProcOfClass(wParam, lParam)
Else
//Use normal Proc
Result := Service.Proc(wParam, lParam);
+
+ //Restore CurExecuted
+ Core.CurExecuted := CurExecutedBackup;
end;
{$IFDEF DEBUG}