iapplet.idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:13k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //+---------------------------------------------------------------------------
  2. //
  3. //  Copyright 1999 Microsoft Corporation. All Rights Reserved.
  4. //
  5. //  Contents:   NetMeeting Applet interfaces
  6. //
  7. //----------------------------------------------------------------------------
  8. import "oaidl.idl";
  9. import "ocidl.idl";
  10. #define UUID_IAppletSession         e65dc590-a4d9-11d2-b724-00104bc51339
  11. #define UUID_IAppletSessionNotify   f7c10ec0-a4d9-11d2-b724-00104bc51339
  12. #define UUID_IApplet                07970b30-a4da-11d2-b724-00104bc51339
  13. #define UUID_IAppletNotify          16153670-a4da-11d2-b724-00104bc51339
  14. #include "nmapptyp.h"
  15. /* ------ octet string ------ */
  16. typedef struct tagAppletOctetString
  17.     ULONG   cbStrSize; 
  18.     [size_is(cbStrSize)] BYTE* pbValue; 
  19. }
  20.     AppletOctetString;
  21. typedef struct tagAppletLongString
  22. {
  23. ULONG   nStrLen;
  24. [size_is(nStrLen)] ULONG *pnValue;
  25. }
  26. AppletLongString;
  27. /* ------ object, session, and registry keys ------ */
  28. typedef struct tagAppletObjectKey
  29. {
  30. AppletKeyType       eType;
  31. AppletLongString    lstrObjectID;
  32. AppletOctetString   ostrH221NonStdID;
  33. }
  34. AppletObjectKey;
  35. typedef struct tagAppletSessionKey
  36. {
  37.     AppletObjectKey             AppletProtocolKey;
  38.     AppletSessionID             nSessionID;
  39. }
  40.     AppletSessionKey;
  41. typedef struct tagAppletRegistryKey
  42. {
  43.     AppletSessionKey            SessionKey;
  44.     AppletOctetString           ostrResourceID;
  45. }
  46.     AppletRegistryKey;
  47. /* ------ registry request ------ */
  48. typedef struct tagAppletRegistryRequest
  49. {
  50.     AppletRegistryCommand       eCommand;
  51.     AppletRegistryKey           RegistryKey;
  52.     // register channel
  53.     AppletChannelID             nChannelID;
  54.     // set parameter
  55.     AppletOctetString           ostrParamValue;
  56.     AppletModificationRights    eParamModifyRights;
  57.     // allocate handle
  58.     ULONG cHandles;
  59. }
  60.     AppletRegistryRequest;
  61. /* ------ channel request ------ */
  62. typedef struct tagAppletChannelRequest
  63. {
  64.     AppletChannelCommand      eCommand;
  65.     AppletChannelID           nChannelID;
  66.     ULONG                     cUsers;
  67.     [size_is(cUsers)] AppletUserID *aUsers;
  68. }
  69.     AppletChannelRequest;
  70. /* ------ token request ------ */
  71. typedef struct tagAppletTokenRequest
  72. {
  73.     AppletTokenCommand        eCommand;
  74.     AppletTokenID             nTokenID;
  75.     AppletUserID              uidGiveTo;
  76.     HRESULT                   hrGiveResponse;
  77. }
  78.     AppletTokenRequest;
  79. /* ------ capability ------ */
  80. typedef struct tagAppletCapabilityID
  81. {
  82.     AppletCapIDType         eType;
  83.     AppletObjectKey         nNonStdCap;
  84.     ULONG                   nStdCap;
  85. }
  86.     AppletCapabilityID;
  87. typedef struct tagAppletCapability
  88. {
  89.     AppletCapabilityID      CapID;
  90.     AppletCapabilityClass   CapClass;
  91.     ULONG                   cEntities;
  92. }
  93.     AppletCapability;
  94. typedef struct tagAppletCapability2
  95. {
  96.     AppletCapabilityID      CapID;
  97.     AppletOctetString      *pCapData;
  98. }
  99.     AppletCapability2;
  100. typedef struct tagAppletProtocolEntity
  101. {
  102.     AppletSessionKey        SessionKey;
  103.     AppletChannelType       eStartupChannelType;
  104.     BOOL                    fMustBeInvoked;    
  105.     ULONG                   cExpectedCapabilities;
  106.     [size_is(cExpectedCapabilities)] AppletCapability **apExpectedCapabilities;
  107. }
  108.     AppletProtocolEntity;
  109. //
  110. // T120 Applet Session Callback
  111. //
  112. typedef struct tagAppletRecord
  113. {
  114.     AppletNodeID            nNodeID;
  115.     AppletEntityID          nEntityID;
  116.     BOOL                    fEnrolledActively;
  117.     BOOL                    fConductingCapable;
  118.     AppletChannelType       eStartupChannelType; 
  119.     AppletUserID            nAppletUserID;
  120.     ULONG                   cCapabilities;
  121.     [size_is(cCapabilities)] AppletCapability2 **apCapabilities;
  122. }
  123.     AppletRecord;
  124. typedef struct tagAppletRoster
  125. {
  126.     AppletSessionKey        SessionKey;
  127.     BOOL                    fRosterChanged;
  128.     ULONG                   nInstanceNumber;
  129.     BOOL                    fNodesAdded;
  130.     BOOL                    fNodesRemoved;
  131.     BOOL                    fCapabilitiesChanged;
  132.     ULONG                   cRecords;
  133.     [size_is(cRecords)] AppletRecord **apAppletRecords;
  134.     ULONG                   cCapabilities;
  135.     [size_is(cCapabilities)] AppletCapability **apCapabilities;
  136. }
  137.     AppletRoster;
  138. typedef struct tagAppletRegistryItem
  139. {
  140.     AppletRegistryItemType  ItemType;
  141.     // channel
  142.     AppletChannelID         nChannelID;
  143.     // token
  144.     AppletTokenID           nTokenID;
  145.     // parameter
  146.     AppletOctetString       ostrParamValue;
  147. }
  148.     AppletRegistryItem;
  149. typedef struct tagAppletRegistryEntryOwner
  150. {
  151.     BOOL                    fEntryOwned;
  152.     AppletNodeID            nOwnerNodeID;
  153.     AppletEntityID          nOwnerEntityID;
  154. }
  155.     AppletRegistryEntryOwner;
  156. typedef struct tagAppletSessionRequest
  157. {
  158.     // session specific
  159.     AppletSessionKey        SessionKey;
  160.     // applet enroll
  161.     AppletChannelType       nStartupChannelType;
  162.     // collapsed capability
  163.     ULONG                   cCollapsedCaps;
  164.     [size_is(cCollapsedCaps)] AppletCapability **apCollapsedCaps; 
  165.     // non-collapsing capability
  166.     ULONG                   cNonCollapsedCaps;
  167.     [size_is(cNonCollapsedCaps)] AppletCapability2 **apNonCollapsedCaps; 
  168.     // static channels
  169.     ULONG                   cStaticChannels;
  170.     [size_is(cStaticChannels)] AppletChannelID *aStaticChannels; 
  171.     // dynamic channels
  172.     ULONG                   cDynamicChannels;
  173.     [size_is(cDynamicChannels)] AppletRegistryKey *aChannelRegistryKeys; 
  174. }
  175.     AppletSessionRequest;
  176. [
  177.     object,
  178.     uuid(UUID_IAppletSessionNotify),
  179.     pointer_default(unique)
  180. ]
  181. interface IAppletSessionNotify : IUnknown
  182. {
  183.     HRESULT JoinSessionConfirm(
  184.                     [in] HRESULT            hrResult,
  185.                     [in] AppletUserID       uidMyself,
  186.                     [in] AppletNodeID       nidMyself,
  187.                     [in] AppletSessionID    sidMyself,
  188.                     [in] AppletEntityID     eidMyself,
  189.                     [in] ULONG              cDynamicChannels,
  190.                     [in,size_is(cDynamicChannels)] AppletChannelID aDynamicChannels[]);
  191.     HRESULT LeaveSessionIndication(
  192.                     [in] AppletReason   eReason,
  193.                     [in] AppletUserID   uidLeave);
  194.     HRESULT SendDataIndication(
  195.                     [in] BOOL               fUniformSend,
  196.                     [in] AppletUserID       uidInitiator,
  197.                     [in] AppletChannelID    nChannelID,
  198.                     [in] AppletPriority     eDataPriority,
  199.                     [in] AppletOctetString  Data);
  200.     HRESULT RosterReportIndication(
  201.                     [in] ULONG              cRosters,
  202.                     [in,size_is(cRosters)] AppletRoster **apAppRosters);
  203.     HRESULT InquireRosterConfirm(
  204.                     [in] HRESULT            hrResult,
  205.                     [in] ULONG              cRosters,
  206.                     [in,size_is(cRosters)] AppletRoster **apAppRosters);
  207.     HRESULT InvokeAppletConfirm(
  208.                     [in] AppletRequestTag   nReqTag,
  209.                     [in] HRESULT            hrResult);
  210.     HRESULT RegistryConfirm(
  211.                     [in] AppletRegistryCommand      eCommand,
  212.                     [in] HRESULT                    hrResult,
  213.                     [in] AppletRegistryKey         *pRegistryKey,
  214.                     [in] AppletRegistryItem        *pRegistryItem,
  215.                     [in] AppletRegistryEntryOwner  *pEntryOwner,
  216.                     [in] AppletModificationRights   eRights);
  217.     HRESULT AllocateHandleConfirm(
  218.                     [in] HRESULT                hrResult,
  219.                     [in] ULONG                  nFirstHandle,
  220.                     [in] ULONG                  cHandles);
  221.     HRESULT ChannelConfirm(
  222.                     [in] AppletChannelCommand   eCommand,
  223.                     [in] HRESULT                hrResult,
  224.                     [in] AppletChannelID        nChannelID);
  225.     HRESULT ChannelIndication(
  226.                     [in] AppletChannelCommand   eCommand,
  227.                     [in] AppletChannelID        nChannelID,
  228.                     [in] AppletReason           eReason,
  229.                     [in] AppletUserID           uidManager);
  230.     HRESULT TokenConfirm(
  231.                     [in] AppletTokenCommand     eCommand,
  232.                     [in] HRESULT                hrResult,
  233.                     [in] AppletTokenID          nTokenID);
  234.     HRESULT TestTokenConfirm(
  235.                     [in] AppletTokenID          nTokenID,
  236.                     [in] AppletTokenStatus      eStatus);
  237.     HRESULT TokenIndication(
  238.                     [in] AppletTokenCommand     eCommand,
  239.                     [in] AppletReason           eReason,
  240.                     [in] AppletTokenID          nTokenID,
  241.                     [in] AppletUserID           uidInitiator);
  242. };
  243. [
  244.     object,
  245.     uuid(UUID_IAppletSession),
  246.     pointer_default(unique)
  247. ]
  248. interface IAppletSession : IUnknown
  249. {
  250.     /* ------ Basic Info ------ */
  251.     HRESULT GetConfID([out] AppletConfID *pnConfID);
  252.     HRESULT IsThisNodeTopProvider([out] BOOL *pfTopProvider);
  253.     /* ------ Join Conference ------ */
  254.     HRESULT Join([in] AppletSessionRequest *pRequest);
  255.     HRESULT Leave(void);
  256.     /* ------ Send Data ------ */
  257.     HRESULT SendData(
  258.                     [in] BOOL               fUniformSend,
  259.                     [in] AppletChannelID    nChannelID,
  260.                     [in] AppletPriority     ePriority,
  261.                     [in] ULONG              cbBufSize,
  262.                     [in,size_is(cbBufSize)] BYTE *pBuffer);
  263.     /* ------ Invoke Applet ------ */
  264.     HRESULT InvokeApplet(
  265.                     [out] AppletRequestTag     *pnReqTag,
  266.                     [in] AppletProtocolEntity  *pAPE,
  267.                     [in] ULONG                  cNodes,
  268.                     [in,size_is(cNodes)] AppletNodeID aNodeIDs[]);
  269.     /* ------ Inquiry ------ */
  270.     HRESULT InquireRoster([in] AppletSessionKey *pSessionKey);
  271.     /* ------ Registry Services ------ */
  272.     HRESULT RegistryRequest([in] AppletRegistryRequest *pRequest);
  273.     /* ------ Channel Services ------ */
  274.     HRESULT ChannelRequest([in] AppletChannelRequest *pRequest);
  275.     /* ------ Token Services ------ */
  276.     HRESULT TokenRequest([in] AppletTokenRequest *pRequest);
  277.     /* ------ Notification registration / unregistration------ */
  278.     HRESULT Advise( [in] IAppletSessionNotify   *pNotify,
  279.                     [out] DWORD                 *pdwCookie);
  280.     HRESULT UnAdvise([in] DWORD dwCookie);
  281. };
  282. [
  283.     object,
  284.     uuid(UUID_IAppletNotify),
  285.     pointer_default(unique)
  286. ]
  287. interface IAppletNotify : IUnknown
  288. {
  289.     HRESULT PermitToJoinSessionIndication(
  290.                     [in] AppletConfID   nConfID,
  291.                     [in] BOOL           fPermissionGranted);
  292.     HRESULT AutoJoinSessionIndication(
  293.                     [in] IAppletSession    *pSession,
  294.                     [in] HRESULT            hrResult,
  295.                     [in] AppletUserID       uidMyself,
  296.                     [in] AppletNodeID       nidMyself,
  297.                     [in] AppletSessionID    sidMyself,
  298.                     [in] AppletEntityID     eidMyself,
  299.                     [in] ULONG              cDynamicChannels,
  300.                     [in,size_is(cDynamicChannels)] AppletChannelID aDynamicChannels[]);
  301. };
  302. [
  303.     object,
  304.     uuid(UUID_IApplet),
  305.     pointer_default(unique)
  306. ]
  307. interface IApplet : IUnknown
  308. {
  309.     /* ------ Initialization ------ */
  310.     HRESULT Initialize(void);
  311.     /* ------ Auto Join ------ */
  312.     HRESULT RegisterAutoJoin([in] AppletSessionRequest *pRequest);
  313.     HRESULT UnregisterAutoJoin(void);
  314.     /* ------ Session ------ */
  315.     HRESULT CreateSession(
  316.                     [out] IAppletSession **ppSession,
  317.                     [in] AppletConfID nConfID);
  318.     /* ------ Notification registration / unregistration------ */
  319.     HRESULT Advise( [in] IAppletNotify *pNotify,
  320.                     [out] DWORD *pdwCookie);
  321.     HRESULT UnAdvise([in] DWORD dwCookie);
  322. };
  323. // These version numbers should match the version attribute in the library definitoen below
  324. cpp_quote("enum { NmApplet_Ver_Major = 1};")
  325. cpp_quote("enum { NmApplet_Ver_Minor = 0};")
  326. [
  327. uuid(8C3ADF96-CCFE-11d2-AD10-00C04F72DD47),
  328. version(1.0),
  329. helpstring("NmApplet 1.0 Type Library")
  330. ]
  331. library NmApplet
  332. {
  333. importlib("stdole32.tlb");
  334. importlib("stdole2.tlb");
  335. [
  336. uuid(8C3ADF99-CCFE-11d2-AD10-00C04F72DD47),
  337. helpstring("NetMeeting Applet")
  338. ]
  339. coclass NmApplet
  340. {
  341. [default] interface IApplet;
  342. };
  343. };