michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupportsImpl.h" michael@0: michael@0: nsresult NS_FASTCALL michael@0: NS_TableDrivenQI(void* aThis, REFNSIID aIID, void **aInstancePtr, michael@0: const QITableEntry* entries) michael@0: { michael@0: do { michael@0: if (aIID.Equals(*entries->iid)) { michael@0: nsISupports* r = michael@0: reinterpret_cast michael@0: (reinterpret_cast(aThis) + entries->offset); michael@0: NS_ADDREF(r); michael@0: *aInstancePtr = r; michael@0: return NS_OK; michael@0: } michael@0: michael@0: ++entries; michael@0: } while (entries->iid); michael@0: michael@0: *aInstancePtr = nullptr; michael@0: return NS_ERROR_NO_INTERFACE; michael@0: }