summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas')
-rw-r--r--plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas b/plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas
new file mode 100644
index 0000000000..a6a32f2901
--- /dev/null
+++ b/plugins/!NotAdopted/Chess4Net/NonRefInterfacedObjectUnit.pas
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+// All code below is exclusively owned by author of Chess4Net - Pavel Perminov
+// (packpaul@mail.ru, packpaul1@gmail.com).
+// Any changes, modifications, borrowing and adaptation are a subject for
+// explicit permition from the owner.
+
+unit NonRefInterfacedObjectUnit;
+
+interface
+
+type
+ TNonRefInterfacedObject = class(TObject, IInterface)
+ protected
+ function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
+ function _AddRef: Integer; stdcall;
+ function _Release: Integer; stdcall;
+ end;
+
+implementation
+
+////////////////////////////////////////////////////////////////////////////////
+// TNonRefInterfacedObject
+
+function TNonRefInterfacedObject.QueryInterface(const IID: TGUID; out Obj): HResult;
+begin
+ if GetInterface(IID, Obj) then
+ Result := 0
+ else
+ Result := E_NOINTERFACE;
+end;
+
+
+function TNonRefInterfacedObject._AddRef: Integer;
+begin
+ Result := -1;
+end;
+
+
+function TNonRefInterfacedObject._Release: Integer;
+begin
+ Result := -1;
+end;
+
+end.