function TDeviceListener.QueryInterface(constref iid: TGuid; out obj): HRESULT;
stdcall;
begin
// Returning S_OK blinging is not entirely correct, but sort of does the job for proof-of-concept
Result := S_OK;
end;
function TDeviceListener._AddRef(): HRESULT; stdcall;
begin
Inc(FRefCount);
Result:=FRefCount;
end;
function TDeviceListener._Release(): HRESULT; stdcall;
begin
Dec(FRefCount);
Result:=FRefCount;
end;