home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / objsafe.idl < prev    next >
Text File  |  1998-04-25  |  4KB  |  85 lines

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Copyright 1996-1997 Microsoft Corporation. All Rights Reserved.
  4. //
  5. //  Contents:   Object Safety Interfaces (should come from ObjSafe.idl)
  6. //
  7. //----------------------------------------------------------------------------
  8.  
  9. cpp_quote("//=--------------------------------------------------------------------------=")
  10. cpp_quote("// ObjSafe.h")
  11. cpp_quote("//=--------------------------------------------------------------------------=")
  12. cpp_quote("// (C) Copyright 1995-1997 Microsoft Corporation.  All Rights Reserved.")
  13. cpp_quote("//")
  14. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  15. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  16. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  17. cpp_quote("// PARTICULAR PURPOSE.")
  18. cpp_quote("//=--------------------------------------------------------------------------=")
  19. cpp_quote("")
  20. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  21. cpp_quote("")
  22. cpp_quote("//---------------------------------------------------------------------------=")
  23. cpp_quote("// Object Safety Interfaces.")
  24. cpp_quote("")
  25.  
  26. #ifndef DO_NO_IMPORTS
  27. import "unknwn.idl";
  28. #endif
  29.  
  30. cpp_quote("//+--------------------------------------------------------------------------=")
  31. cpp_quote("//")
  32. cpp_quote("//  Contents:   IObjectSafety definition")
  33. cpp_quote("//")
  34. cpp_quote("//")
  35. cpp_quote("//  IObjectSafety should be implemented by objects that have interfaces which")
  36. cpp_quote("//      support \"untrusted\" clients (for example, scripts). It allows the owner of")
  37. cpp_quote("//      the object to specify which interfaces need to be protected from untrusted")
  38. cpp_quote("//      use. Examples of interfaces that might be protected in this way are:")
  39. cpp_quote("//")
  40. cpp_quote("//      IID_IDispatch           - \"Safe for automating with untrusted automation client or script\"")
  41. cpp_quote("//      IID_IPersist*           - \"Safe for initializing with untrusted data\"")
  42. cpp_quote("//      IID_IActiveScript       - \"Safe for running untrusted scripts\"")
  43. cpp_quote("//")
  44. cpp_quote("//---------------------------------------------------------------------------=")
  45.  
  46. cpp_quote("#ifndef _LPSAFEOBJECT_DEFINED")
  47. cpp_quote("#define _LPSAFEOBJECT_DEFINED")
  48. cpp_quote("")
  49.  
  50. cpp_quote("// Option bit definitions for IObjectSafety:")
  51. cpp_quote("#define    INTERFACESAFE_FOR_UNTRUSTED_CALLER    0x00000001    // Caller of interface may be untrusted")
  52. cpp_quote("#define    INTERFACESAFE_FOR_UNTRUSTED_DATA    0x00000002    // Data passed into interface may be untrusted")
  53. cpp_quote("#define    INTERFACE_USES_DISPEX                0x00000004    // Object knows to use IDispatchEx")
  54. cpp_quote("#define    INTERFACE_USES_SECURITY_MANAGER        0x00000008    // Object knows to use IInternetHostSecurityManager")
  55. cpp_quote("")
  56.  
  57. cpp_quote("// {CB5BDC81-93C1-11cf-8F20-00805F2CD064}")
  58. cpp_quote("DEFINE_GUID(IID_IObjectSafety, 0xcb5bdc81, 0x93c1, 0x11cf, 0x8f, 0x20, 0x0, 0x80, 0x5f, 0x2c, 0xd0, 0x64);")
  59.  
  60. cpp_quote("EXTERN_C GUID CATID_SafeForScripting;")
  61. cpp_quote("EXTERN_C GUID CATID_SafeForInitializing;")
  62.  
  63. cpp_quote("")
  64. [
  65.     object,
  66.     uuid(CB5BDC81-93C1-11cf-8F20-00805F2CD064),
  67.     pointer_default(unique)
  68. ]
  69. interface IObjectSafety : IUnknown
  70. {
  71.     HRESULT GetInterfaceSafetyOptions(
  72.         [in]  REFIID    riid,                    // Interface that we want options for
  73.         [out] DWORD    *    pdwSupportedOptions,    // Options meaningful on this interface
  74.         [out] DWORD *    pdwEnabledOptions);        // current option values on this interface
  75.  
  76.     HRESULT SetInterfaceSafetyOptions(
  77.         [in]  REFIID    riid,                    // Interface to set options for
  78.         [in]  DWORD        dwOptionSetMask,        // Options to change
  79.         [in]  DWORD        dwEnabledOptions);        // New option values
  80. }
  81.  
  82. typedef [unique] IObjectSafety *LPOBJECTSAFETY;
  83.  
  84. cpp_quote("#endif")
  85.