dispatch_stub.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_WIN_DISPATCH_STUB_H_
  5. #define BASE_WIN_DISPATCH_STUB_H_
  6. #include <wrl/client.h>
  7. #include <wrl/implements.h>
  8. namespace base {
  9. namespace win {
  10. namespace test {
  11. // An unimplemented IDispatch subclass for testing purposes.
  12. class DispatchStub
  13. : public Microsoft::WRL::RuntimeClass<
  14. Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
  15. IDispatch> {
  16. public:
  17. DispatchStub() = default;
  18. DispatchStub(const DispatchStub&) = delete;
  19. DispatchStub& operator=(const DispatchStub&) = delete;
  20. // IDispatch:
  21. IFACEMETHODIMP GetTypeInfoCount(UINT*) override;
  22. IFACEMETHODIMP GetTypeInfo(UINT, LCID, ITypeInfo**) override;
  23. IFACEMETHODIMP GetIDsOfNames(REFIID, LPOLESTR*, UINT, LCID, DISPID*) override;
  24. IFACEMETHODIMP Invoke(DISPID,
  25. REFIID,
  26. LCID,
  27. WORD,
  28. DISPPARAMS*,
  29. VARIANT*,
  30. EXCEPINFO*,
  31. UINT*) override;
  32. };
  33. } // namespace test
  34. } // namespace win
  35. } // namespace base
  36. #endif // BASE_WIN_DISPATCH_STUB_H_