From aa0422b2eddd0f4ea48c741c11ef87f74b0dcc27 Mon Sep 17 00:00:00 2001 From: svenbarth Date: Thu, 15 Aug 2019 11:41:36 +0000 Subject: [PATCH] * fix for Mantis #35964: reestablish pre r42594 behavior for WinCE as at least Windows Mobile does not support the required COM functions Note: in theory Windows CE *can* support these functions, but it dependends on the provider whether they're indeed supported (e.g. Windows Mobile does not). Probably this should be revisited once we support the "delayed" directive. git-svn-id: trunk@42696 - --- packages/winunits-base/src/comobj.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/winunits-base/src/comobj.pp b/packages/winunits-base/src/comobj.pp index 3f70d1e1c7..0f01378f46 100644 --- a/packages/winunits-base/src/comobj.pp +++ b/packages/winunits-base/src/comobj.pp @@ -946,8 +946,13 @@ implementation if printcom then WriteLn('LockServer: ', fLock); {$endif} +{$ifndef wince} Result := CoLockObjectExternal(Self, fLock, True); ComServer.CountObject(fLock); +{$else} + RunError(217); + Result:=0; +{$endif} end; @@ -1018,7 +1023,9 @@ implementation destructor TComObjectFactory.Destroy; begin +{$ifndef wince} if fIsRegistered <> dword(-1) then CoRevokeClassObject(fIsRegistered); +{$endif} ComClassManager.RemoveObjectFactory(Self); end; @@ -1050,9 +1057,13 @@ implementation if printcom then WriteLn('TComObjectFactory.RegisterClassObject'); {$endif} +{$ifndef wince} if FInstancing <> ciInternal then OleCheck(CoRegisterClassObject(FClassID, Self, CLSCTX_LOCAL_SERVER, reg_flags(), @FIsRegistered)); +{$else} + RunError(217); +{$endif} end;