Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.4 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: _extension.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // Classes to support the new Espresso Extensions interfaces.
  8. //
  9. //-----------------------------------------------------------------------------
  10. #pragma once
  11. typedef UUID ExtensionID;
  12. typedef UUID OperationID;
  13. struct LTAPIENTRY LOCEXTENSIONMENU
  14. {
  15. LOCEXTENSIONMENU();
  16. CLString strMenuName; // Name of the Menu
  17. IID iidProcess; // IID for the process interface the
  18. // menu requires
  19. OperationID idOp; // Allows a single DLL to implement
  20. };
  21. typedef CArray<LOCEXTENSIONMENU, LOCEXTENSIONMENU &> CLocMenuArray;
  22. DECLARE_INTERFACE_(ILocExtension, IUnknown)
  23. {
  24. //
  25. // IUnknown standard Interface
  26. //
  27. STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR*ppvObj) PURE;
  28. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  29. STDMETHOD_(ULONG, Release)(THIS) PURE;
  30. //
  31. // Standard Debugging interfaces
  32. //
  33. STDMETHOD_(void, AssertValidInterface)(THIS) CONST_METHOD PURE;
  34. //
  35. // ILocExtension methods
  36. //
  37. //
  38. // In Initialize, extension will...
  39. // Add any menus it needs to the array of menu obejcts
  40. // Register any options it has with Espresso
  41. // Ignore the IUnknown for now.
  42. STDMETHOD(Initialize)(IUnknown *) PURE;
  43. //
  44. // Since extensions may have state, we can't use QueryInterface.
  45. // This method has similar semantics, except that in most cases
  46. // we expect to get a new objects. Also, QI on a returned
  47. // object doesn't have to support ILocExtension.
  48. STDMETHOD(GetExtension)(const OperationID &, LPVOID FAR*ppvObj) PURE;
  49. //
  50. // In UnInitialize the extension will...
  51. // UnRegister any of its options.
  52. STDMETHOD(UnInitialize)(void) PURE;
  53. };
  54. struct __declspec(uuid("{9F9D180E-6F38-11d0-98FD-00C04FC2C6D8}"))
  55. ILocExtension;
  56. LTAPIENTRY void UUIDToString(const UUID &, CLString &);
  57. LTAPIENTRY void RegisterExtension(const ExtensionID &,
  58. const TCHAR *szDescription, HINSTANCE,
  59. const CLocMenuArray &);
  60. LTAPIENTRY void UnRegisterExtension(const ExtensionID &);
  61. LTAPIENTRY BOOL RegisterExtensionOptions(CLocUIOptionSet *);
  62. LTAPIENTRY void UnRegisterExtensionOptions(const TCHAR *szName);
  63. //
  64. // Extensions need to export the following function:
  65. // STDAPI GetExtension(ILocExtension *&);
  66. typedef HRESULT (STDAPICALLTYPE *PFNExtensionEntryPoint)(ILocExtension *&);