From 6064bfec538038fd1e1ccf4da54fa859241f98fa Mon Sep 17 00:00:00 2001 From: Pavel Perminov Date: Wed, 26 Sep 2012 19:14:19 +0000 Subject: Current line of development release (344 rev. truncated adjusted copy) git-svn-id: http://svn.miranda-ng.org/main/trunk@1669 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Chess4Net/NonRefInterfacedObjectUnit.pas | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 plugins/Chess4Net/NonRefInterfacedObjectUnit.pas (limited to 'plugins/Chess4Net/NonRefInterfacedObjectUnit.pas') diff --git a/plugins/Chess4Net/NonRefInterfacedObjectUnit.pas b/plugins/Chess4Net/NonRefInterfacedObjectUnit.pas new file mode 100644 index 0000000000..a6a32f2901 --- /dev/null +++ b/plugins/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. -- cgit v1.2.3