Source code of Windows XP (NT5)
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.

252 lines
6.9 KiB

  1. /****************************************************************************
  2. *
  3. * $Archive: S:/STURGEON/SRC/INCLUDE/VCS/apimsm.h_v $
  4. *
  5. * INTEL Corporation Prorietary Information
  6. *
  7. * This listing is supplied under the terms of a license agreement
  8. * with INTEL Corporation and may not be copied nor disclosed except
  9. * in accordance with the terms of that agreement.
  10. *
  11. * Copyright (c) 1993-1994 Intel Corporation.
  12. *
  13. * $Revision: 1.11 $
  14. * $Date: Apr 15 1996 08:52:10 $
  15. * $Author: RKUHN $
  16. *
  17. * Deliverable:
  18. *
  19. * Abstract:
  20. * Media Service Manager "public" header file. This file contains
  21. * #defines, typedefs, struct definitions and prototypes used by
  22. * and in conjunction with MSM. Any EXE or DLL which interacts with
  23. * MSM will include this header file.
  24. *
  25. * Notes:
  26. *
  27. ***************************************************************************/
  28. #ifndef APIMSM_H
  29. #define APIMSM_H
  30. #include <apierror.h>
  31. #ifdef __cplusplus
  32. extern "C" { // Assume C declarations for C++.
  33. #endif // __cplusplus
  34. #ifndef DllImport
  35. #define DllImport __declspec( dllimport )
  36. #endif // DllImport
  37. #ifndef DllExport
  38. #define DllExport __declspec( dllexport )
  39. #endif // DllExport
  40. // Product Identifier
  41. //
  42. #define MAX_PRODUCTID_LENGTH 50
  43. typedef char PRODUCTID[MAX_PRODUCTID_LENGTH], *LPPRODUCTID;
  44. // Service identifier
  45. //
  46. #define MAX_SERVICEID_LENGTH 50
  47. typedef char SERVICEID[MAX_SERVICEID_LENGTH], *LPSERVICEID;
  48. // Registry defines
  49. //
  50. #define MSM_REG_SERVICEID "MediaServiceManager"
  51. #define MSM_REG_RMSPATH "RMSPath"
  52. #define MSM_REG_SERVICES "Services"
  53. // Defines for handle returned by MSM
  54. //
  55. typedef DWORD HSESSION, *LPHSESSION;
  56. typedef DWORD HSERVICE, *LPHSERVICE;
  57. typedef DWORD HPORT, *LPHPORT;
  58. typedef DWORD HLINK, *LPHLINK;
  59. typedef DWORD HSYNC, *LPHSYNC;
  60. // Defines for cookies passed in by application
  61. //
  62. typedef DWORD ERRORCOOKIE, *LPERRORCOOKIE;
  63. typedef DWORD SERVICECOOKIE, *LPSERVICECOOKIE;
  64. typedef DWORD PORTCOOKIE, *LPPORTCOOKIE;
  65. // Typedef for application callbacks made by MSM
  66. //
  67. typedef void (CALLBACK *MSM_ERRORCALLBACK) (ERRORCOOKIE, HRESULT);
  68. typedef HRESULT (CALLBACK *MSM_SERVICECALLBACK) (HSERVICE, SERVICECOOKIE, WPARAM, LPARAM, LPARAM);
  69. typedef HRESULT (CALLBACK *MSM_PORTCALLBACK) (HSERVICE, HPORT, PORTCOOKIE, WPARAM, LPARAM, LPARAM);
  70. // Typedefs for MSM application entry points to ensure stricter checking
  71. // when functions are called via pointers
  72. //
  73. typedef HRESULT (*MSM_OPENSESSION) (LPPRODUCTID, MSM_ERRORCALLBACK, DWORD, LPHSESSION);
  74. typedef HRESULT (*MSM_CLOSESESSION) (HSESSION);
  75. typedef HRESULT (*MSM_OPENSERVICE) (HSESSION, LPSERVICEID, MSM_SERVICECALLBACK, SERVICECOOKIE, LPARAM, LPARAM, LPHSERVICE);
  76. typedef HRESULT (*MSM_CLOSESERVICE) (HSERVICE);
  77. typedef HRESULT (*MSM_SENDSERVICECMD) (HSERVICE, HPORT, WORD, LPARAM, LPARAM);
  78. typedef HRESULT (*MSM_OPENPORT) (HSERVICE, MSM_PORTCALLBACK, PORTCOOKIE, LPARAM, LPARAM, LPHPORT);
  79. typedef HRESULT (*MSM_CLOSEPORT) (HPORT);
  80. typedef HRESULT (*MSM_LINKPORTS) (HPORT, HPORT, LPHLINK);
  81. typedef HRESULT (*MSM_UNLINKPORTS) (HLINK);
  82. typedef HRESULT (*MSM_SYNCPORTS) (HPORT, HPORT, LPHSYNC);
  83. typedef HRESULT (*MSM_UNSYNCPORTS) (HSYNC);
  84. typedef struct _MSMAPI
  85. {
  86. MSM_OPENSESSION MSM_OpenSession;
  87. MSM_CLOSESESSION MSM_CloseSession;
  88. MSM_OPENSERVICE MSM_OpenService;
  89. MSM_CLOSESERVICE MSM_CloseService;
  90. MSM_SENDSERVICECMD MSM_SendServiceCmd;
  91. MSM_OPENPORT MSM_OpenPort;
  92. MSM_CLOSEPORT MSM_ClosePort;
  93. MSM_LINKPORTS MSM_LinkPorts;
  94. MSM_UNLINKPORTS MSM_UnlinkPorts;
  95. MSM_SYNCPORTS MSM_SyncPorts;
  96. MSM_UNSYNCPORTS MSM_UnsyncPorts;
  97. }
  98. MSMAPI, *LPMSMAPI;
  99. // ERROR CALLBACK
  100. //
  101. extern void CALLBACK MSM_ErrorCallback
  102. (
  103. ERRORCOOKIE dAppErrorCookie,// Application error cookie
  104. HRESULT hResult // Error information.
  105. );
  106. // SESSION CONTROL
  107. //
  108. extern DllExport HRESULT MSM_OpenSession
  109. (
  110. LPPRODUCTID pszAppId, // String identifies app's registry section.
  111. MSM_ERRORCALLBACK pErrorCallback, // Pointer to callback function for errors
  112. ERRORCOOKIE dAppErrorCookie,// Application error cookie returned on aync errors
  113. LPHSESSION phSession // Pointer to location to store the session handle
  114. );
  115. extern DllExport HRESULT MSM_CloseSession
  116. (
  117. HSESSION hSession // Handle of session to be closed.
  118. );
  119. // SERVICE CONTROL
  120. //
  121. extern HRESULT CALLBACK MSM_ServiceCallback
  122. (
  123. HSERVICE hService, // Handle of service to be closed.
  124. SERVICECOOKIE dServiceCookie, // Application service cookie
  125. WPARAM wParam, // Pass through word param
  126. LPARAM lParamIn, // Pass through long param in
  127. LPARAM lParamOut // Pass through long param out
  128. );
  129. extern DllExport HRESULT MSM_OpenService
  130. (
  131. HSESSION hSession, // MSM session-instance handle.
  132. LPSERVICEID pszServiceId, // Unique service-type identifier.
  133. MSM_SERVICECALLBACK pServiceCallback,// Application callback for service
  134. SERVICECOOKIE dAppServiceCookie,// Application service cookie
  135. LPARAM lParamIn, // Pass through long param in
  136. LPARAM lParamOut, // Pass through long param out
  137. LPHSERVICE phService // Pointer to location to store the service handle
  138. );
  139. extern DllExport HRESULT MSM_CloseService
  140. (
  141. HSERVICE hService // Handle of service to be closed.
  142. );
  143. extern DllExport HRESULT MSM_SendServiceCmd
  144. (
  145. HSERVICE hService, // Service-instance handle.
  146. HPORT hPort, // Port-instance handle.
  147. WORD wCommand, // Service-specific command.
  148. LPARAM lParamIn, // Pass through long param in
  149. LPARAM lParamOut // Pass through long param out
  150. );
  151. // PORT CONTROL
  152. //
  153. extern HRESULT CALLBACK MSM_PortCallback
  154. (
  155. HSERVICE hService, // Handle of service.
  156. HPORT hPort, // Handle of port.
  157. PORTCOOKIE dAppPortCookie, // Application port cookie
  158. WPARAM wParam, // Pass through word param
  159. LPARAM lParamIn, // Pass through long param in
  160. LPARAM lParamOut // Pass through long param out
  161. );
  162. extern DllExport HRESULT MSM_OpenPort
  163. (
  164. HSERVICE hService, // Service-instance handle.
  165. MSM_PORTCALLBACK pPortCallback, // Application callback for port
  166. PORTCOOKIE dAppPortCookie, // Application port cookie
  167. LPARAM lParamIn, // Pass through long param in
  168. LPARAM lParamOut, // Pass through long param out
  169. LPHPORT phPort // Pointer to location to store the port handle
  170. );
  171. extern DllExport HRESULT MSM_ClosePort
  172. (
  173. HPORT hPort // Handle of port to be closed.
  174. );
  175. // LINK CONTROL
  176. //
  177. extern DllExport HRESULT MSM_LinkPorts
  178. (
  179. HPORT hSrcPort, // Source port of linked stream.
  180. HPORT hSnkPort, // Sink port of linked stream.
  181. LPHLINK phLink // Pointer to location to store the link handle
  182. );
  183. extern DllExport HRESULT MSM_UnlinkPorts
  184. (
  185. HLINK hLink // Handle of link to be disabled.
  186. );
  187. // SYNC CONTROL
  188. //
  189. extern DllExport HRESULT MSM_SyncPorts
  190. (
  191. HPORT hTargetPort, // Target port to sync with
  192. HPORT hSyncPort, // Syncbc port to be sync'ed
  193. LPHSYNC phSync // Pointer to location to store the sync handle
  194. );
  195. extern DllExport HRESULT MSM_UnsyncPorts
  196. (
  197. HSYNC hSync // Handle of sync to be disabled.
  198. );
  199. #ifdef __cplusplus
  200. } // End of extern "C" {
  201. #endif // __cplusplus
  202. #endif // APIMSM_H