home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / mmpm2tk / mmpmtlk2 / inc / ssm.inc < prev   
Encoding:
Text File  |  1992-05-06  |  22.7 KB  |  390 lines

  1. ;***************************************************************************  
  2. ;                                                                             
  3. ;  Module Name: SSM.H                                                         
  4. ;                                                                             
  5. ;  OS/2 2.0 Multimedia Extensions Sync/Stream Manager Definitions file        
  6. ;                                                                             
  7. ;  Copyright (c) International Business Machines Corporation 1991, 1992       
  8. ;                         All Rights Reserved                                 
  9. ;                                                                             
  10. ;***************************************************************************  
  11. MAX_SPI_NAME    EQU    9       ;  Maximum ASCIIZ stream handler name/class    
  12.                              ;  and device driver name                      
  13. ;***************************************************************************  
  14. ;                                                                             
  15. ;   Forward Declarations                                                      
  16. ;                                                                             
  17. ;***************************************************************************  
  18. ;***************************************************************************  
  19. ;                                                                             
  20. ;   Global Type Declarations                                                  
  21. ;                                                                             
  22. ;***************************************************************************  
  23.  
  24. lockh    STRUC
  25. Memory_lock    DB    16 DUP (?)
  26. lockh    ENDS
  27. RC    EQU    ULONG                      ;  Used for all return codes            
  28.  
  29. slave    STRUC
  30. slave_hstreamSlave    DD    ?          ;  Handle for this slave              
  31. slave_mmtimeStart    DD    ?           ;  Offset in master stream time to start   
  32. slave    ENDS
  33.  
  34. hand    STRUC
  35. hand_szHandlerClass    DB    MAX_SPI_NAME DUP (?) ;  Stream handler class        
  36. hand_szHandlerName    DB    MAX_SPI_NAME DUP (?)  ;  Stream handler name         
  37. hand    ENDS
  38. INCLUDE spcb.INC
  39. INCLUDE evcb.INC
  40. INCLUDE acb.INC
  41. INCLUDE dcb.INC
  42. ;***************************************************************************  
  43. ;  INI file support defines                                                   
  44. ;***************************************************************************  
  45. ;  RCDATA defines:                                                            
  46. SPI_RESOURCE    EQU    1                ;  RCDATA resource number              
  47. SH_DLL_TYPE    EQU    0                ;  DLL type stream handler             
  48. SH_PDD_TYPE    EQU    1                ;  PDD type stream handler             
  49. SPCBSIZE    EQU    72              ;  SPCB length, the Resource compiler  
  50.                                        ;    doesn't allow sizeof(SPCB).       
  51. ifdef XXXXX
  52. endif
  53. ;***************************************************************************  
  54. ;                                                                             
  55. ;   Function Prototypes for SPI functions                                     
  56. ;   All use Pure C calling convention                                         
  57. ;   Six major categories:                                                     
  58. ;      - stream creation                                                      
  59. ;      - stream control                                                       
  60. ;      - event handling                                                       
  61. ;      - sync handling                                                        
  62. ;      - configuration                                                        
  63. ;      - stream protocol programming                                          
  64. ;***************************************************************************  
  65. ;  SpiStopStream() ulFlags defines:                                           
  66. SPI_STOP_STREAM    EQU    0000H          ;  Only stop this one stream       
  67.                                            ;  The default is to pause the data            
  68.                                            ;   stream. No change to data buffers.         
  69.                                            ;   synchronous call (no event notification)   
  70. SPI_STOP_SLAVES    EQU    0001H          ;  Stop this master and any slaves             
  71. SPI_STOP_FLUSH    EQU    0002H          ;  Stop and flush all filled buffers.          
  72.                                            ;   Stops the Src & Tgt SH, lets the           
  73.                                            ;   Tgt SH run until out of buffers            
  74.                                            ;   thereby, "flushing" all buffers.           
  75.                                            ;   Tgt SH stops when out of buffers           
  76.                                            ;   (This is a ASYNCHRONOUS call, event        
  77.                                            ;    notification sent to appl when done.)     
  78. SPI_STOP_DISCARD    EQU    0004H          ;  Stop and discard all filled buffers.        
  79.                                            ;   Stops the Src & Tgt SH                     
  80.                                            ;   then discards all buffers current for      
  81.                                            ;   this stream.                               
  82.                                            ;   (This is a ASYNCHRONOUS call, event        
  83.                                            ;    notification sent to appl when done.)     
  84. ;***************************************************************************  
  85. ;                                                                             
  86. ;   Function Prototypes for SMH functions                                     
  87. ;   All use Pure C calling convention                                         
  88. ;  NOTE ABOUT POINTERS:                                                       
  89. ;   0:32 linear addresses for ring 3 (DLL) stream handlers                    
  90. ;   16:16 selector/offset addresses for ring 0 (PDD) stream handlers          
  91. ;***************************************************************************  
  92.  
  93. smh_common    STRUC
  94. smhfunc_ulFunction    DD    ?        ;  SMH command function                     
  95. smhfunc_hid    DD    ?               ;  handler ID                               
  96. smh_common    ENDS
  97. ;***************************************************************************  
  98. SMH_REGISTER    EQU    0               ;  (Valid only from ring 3 stream   
  99.                                                ;   handler)                   
  100.  
  101. parm_reg    STRUC
  102. smhreg_ulFunction    DD    ?                  ;  SMH command function        
  103. smhreg_pszSHName    DD    ?                   ;  Max size = 8 characters     
  104. smhreg_phidSrc    DD    ?                     ;  (9 including null)          
  105. smhreg_phidTgt    DD    ?
  106. smhreg_pshcfnEntry    DD    ?                 ;  Handler entry point for SHC's    
  107.                                                ;   Only used for Ring 0 handlers.  
  108. smhreg_ulFlags    DD    ?
  109. smhreg_ulMaxNumStreams    DD    ?             ;  Max # of streams            
  110. smhreg_ulMaxNumEvents    DD    ?              ;  Max # of events/stream      
  111. parm_reg    ENDS
  112. REGISTER_TGT_HNDLR    EQU    0001H          ;  This handler is Target.     
  113. REGISTER_SRC_HNDLR    EQU    0002H          ;  This handler is Source.     
  114.                                                ;  Handlr can be both.         
  115. REGISTER_NONSTREAMING    EQU    0004H          ;  Handler is non-streaming.   
  116. VALIDREGISTERFLAGS    EQU    (REGISTER_TGT_HNDLR  OR  REGISTER_SRC_HNDLR  OR  REGISTER_NONSTREAMING)
  117. ;  Notes:                                                                       
  118. ;   - Since ring 0 (DD) stream handlers can not use the IDC interface to the    
  119. ;     sync/stream manager during DD initialization time, it must use the IOCTL  
  120. ;     function to perform the SMH_REGISTER function. The addresses are 16:16    
  121. ;     for this IOCTl instead of 0:32, because it comes form a device driver.    
  122. SSMDD_CATEGORY    EQU    0081H     ;  Category (For ring 0 stream handler)   
  123. IOCTL_FUNC_SMH_REGISTER    EQU    0040H     ;  Function (For ring 0 stream handler)   
  124. ;***************************************************************************  
  125. SMH_DEREGISTER    EQU    1               ;  SMH_Deregister()            
  126.  
  127. parm_dereg    STRUC
  128. smhder_ulFunction    DD    ?                  ;  SMH command function        
  129. smhder_pszSHName    DD    ?                   ;  Max size = 8 char, 9 includes   
  130. parm_dereg    ENDS
  131. ;***************************************************************************  
  132. SMH_REPORTEVENT    EQU    2               ;  SMH_ReportEvent()           
  133.  
  134. parm_event    STRUC
  135. smhrev_ulFunction    DD    ?                  ;  SMH command function        
  136. smhrev_hid    DD    ?
  137. smhrev_hevent    DD    ?                      ;  Used only for explicit events     
  138.                                                ;   Must be 0 for sync and implicit  
  139.                                                ;   events (i.e. error events)       
  140. smhrev_pevcbEvent    DD    ?                  ;  Event status & HSTREAM            
  141. parm_event    ENDS
  142. ;***************************************************************************  
  143. SMH_NOTIFY    EQU    3               ;  SMH_Notify()                
  144.  
  145. parm_notify    STRUC
  146. smhnot_ulFunction    DD    ?       ;  Input - SMH command function           
  147. smhnot_hid    DD    ?              ;  Input                                  
  148. smhnot_hstream    DD    ?          ;  Input                                  
  149. smhnot_ulFlags    DD    ?          ;  Input/Output                           
  150. smhnot_ulGetNumEntries    DD    ?  ;  Input/Output - # of entries in table   
  151. smhnot_ulRetNumEntries    DD    ?  ;  Input/Output - # of entries in table   
  152. smhnot_pGetBufTab    DD    ?       ;  Output - Ptr to buffer/record table    
  153. smhnot_pRetBufTab    DD    ?       ;  Input - Ptr to buffer/record table     
  154. parm_notify    ENDS
  155.  
  156. srcbuftab    STRUC
  157. srcbuftab_pBuffer    DD    ?      ;  Ptr to buffer                               
  158. srcbuftab_pRecord    DD    ?      ;  Ptr to record in buffer (split-streams only)    
  159. srcbuftab_ulLength    DD    ?     ;  Max buf length on GetEmpty, Filled          
  160.                                ;  (actual) rec/buf length on ReturnFull.      
  161. srcbuftab_ulMessageParm    DD    ? ;  Message to passed to application           
  162. srcbuftab_mmtimeOffset    DD    ? ;  mmtime offset from beginning of buffer      
  163. srcbuftab    ENDS
  164.  
  165. tgtbuftab    STRUC
  166. tgtbuftab_pBuffer    DD    ?      ;  Ptr to buffer                               
  167. tgtbuftab_ulBufId    DD    ?      ;  Buffer ID. Passed to SH on GetFull, must    
  168.                                ;  be passed back to SSM on ReturnEmpty.       
  169. tgtbuftab_ulLength    DD    ?     ;  Filled (actual) buffer length on GetFull,   
  170.                                ;  unused on ReturnEmpty.                      
  171. tgtbuftab_ulMessageParm    DD    ? ;  Message to passed to application           
  172. tgtbuftab_mmtimeOffset    DD    ? ;  mmtime offset from beginning of buffer      
  173. tgtbuftab    ENDS
  174. ; SMH_ulFlags:                                                                
  175. BUF_GETEMPTY    EQU    00000001H    ;  Ptr returned in SMH_pGetBuffer    
  176. BUF_RETURNFULL    EQU    00000002H    ;  Ptr passed in SMH_pRetBuffer      
  177. BUF_GETFULL    EQU    00000004H    ;  Ptr returned in SMH_pGetBuffer    
  178. BUF_RETURNEMPTY    EQU    00000008H    ;  Ptr passed in SMH_pRetBuffer      
  179. BUF_GIVEBUF    EQU    00000010H    ;  Ptr passed in SMH_pRetBuffer      
  180. BUF_EOS    EQU    00000100H    ;  End of stream. Source sets this on   
  181.                                          ;   last buffer. Target sets it after   
  182.                                          ;   consuming the laset buffer.         
  183. BUF_RECORDS    EQU    00004000H    ;  One or more records (Split-stream)   
  184. BUF_LASTRECORD    EQU    00008000H    ;  (BUF_RETURNFULL only) Mark           
  185.                                          ;  these record(s) as being the         
  186.                                          ;  last in the buffer. So the SSM       
  187.                                          ;  knows the maximum # of records       
  188.                                          ;  produced for this buffer.            
  189.                                          ;  (Split stream only)                  
  190. ; SMH_ulFlags: (Available at ring 0 only)                                        
  191. BUF_LINEAR    EQU    00010000H    ;  Ptrs are Global linear (Ring 0 only)   
  192. BUF_PHYSICAL    EQU    00020000H    ;  Ptrs are physical (Ring 0 only)        
  193.                                          ;  (valid only for phyically              
  194.                                          ;   contiguous buffers)                   
  195. BUF_RESERVED    EQU    00040000H    ;  Reserved                               
  196. VALIDSOURCEFLAGS    EQU    (BUF_RETURNFULL OR BUF_GETEMPTY OR BUF_EOS OR BUF_LASTRECORD OR BUF_PHYSICAL OR BUF_LINEAR OR BUF_RECORDS OR BUF_GIVEBUF)
  197. VALIDTARGETFLAGS    EQU    (BUF_RETURNEMPTY OR BUF_GETFULL OR BUF_PHYSICAL OR BUF_LINEAR OR BUF_EOS)
  198. ;***************************************************************************  
  199. SMH_LOCKMEM    EQU    4               ;  SMH_LockMem()               
  200.  
  201. parm_lockm    STRUC
  202. smhloc_ulFunction    DD    ?                  ;  SMH command function        
  203. smhloc_pBuffer    DD    ?
  204. smhloc_ulBufSize    DD    ?
  205. smhloc_plockh    DD    ?
  206. smhloc_ulFlags    DD    ?
  207. parm_lockm    ENDS
  208. ; SMH_ulFlags:                                                                
  209. SSM_LOCKMEM    EQU    0000H          ;  Lock Memory.                
  210. SSM_UNLOCKMEM    EQU    0001H          ;  Unlock memory.              
  211. SSM_CONTIGLOCK    EQU    0002H          ;  Lock memory contiguously.   
  212. ;***************************************************************************  
  213. ;***************************************************************************  
  214. ;                                                                             
  215. ;   Function Prototypes for SHC functions (Stream Handler Functions)          
  216. ;   All use Pure C calling convention                                         
  217. ;                                                                             
  218. ;  NOTE ABOUT POINTERS:                                                       
  219. ;   0:32 linear addresses for ring 3 (DLL) stream handlers                    
  220. ;   16:16 selector/offset addresses for ring 0 (PDD) stream handlers          
  221. ;***************************************************************************  
  222.  
  223. shc_common    STRUC
  224. shcfunc_ulFunction    DD    ?        ;  Handler command function                 
  225. shcfunc_hid    DD    ?               ;  handler ID                               
  226. shc_common    ENDS
  227. ;***************************************************************************  
  228. SHC_ASSOCIATE    EQU    0 
  229.  
  230. parm_assoc    STRUC
  231. shcass_ulFunction    DD    ?        ;  Handler command function               
  232. shcass_hid    DD    ?               ;  handler ID                             
  233. shcass_hstream    DD    ?           ;  handle of stream instance              
  234. shcass_pacb    DD    ?              ;  pointer to associate control block     
  235. parm_assoc    ENDS
  236. ;***************************************************************************  
  237. SHC_CLOSE    EQU    1 
  238.  
  239. parm_close    STRUC
  240. shcclo_ulFunction    DD    ?        ;  Handler command function               
  241. shcclo_hid    DD    ?               ;  handler ID                             
  242. parm_close    ENDS
  243. ;***************************************************************************  
  244. SHC_CREATE    EQU    2 
  245.  
  246. parm_create    STRUC
  247. shccrt_ulFunction    DD    ?        ;  Handler command function               
  248. shccrt_hid    DD    ?               ;  handler ID                             
  249. shccrt_hstream    DD    ?           ;  handle of stream instance              
  250. shccrt_spcbkey    DB    SIZE SPCBKEY DUP (?)           ;  type of stream to create               
  251. shccrt_pspcb    DD    ?             ;  Pointer to SPCB from handler           
  252. shccrt_hstreamBuf    DD    ?        ;  Used for split streams or to associate  
  253.                                     ;  another stream with this stream.       
  254. shccrt_pdcb    DD    ?              ;  pointer to device control block        
  255. parm_create    ENDS
  256. ;***************************************************************************  
  257. SHC_DESTROY    EQU    3 
  258.  
  259. parm_destroy    STRUC
  260. shcdes_ulFunction    DD    ?        ;  Handler command function               
  261. shcdes_hid    DD    ?               ;  handler ID                             
  262. shcdes_hstream    DD    ?           ;  handle of stream instance              
  263. parm_destroy    ENDS
  264. ;***************************************************************************  
  265. SHC_START    EQU    4 
  266.  
  267. parm_start    STRUC
  268. shcstr_ulFunction    DD    ?        ;  Handler command function               
  269. shcstr_hid    DD    ?               ;  handler ID                             
  270. shcstr_hstream    DD    ?           ;  handle of stream instance              
  271. shcstr_ulFlags    DD    ?           ;  Start flags                            
  272. parm_start    ENDS
  273. ;  ulFlags:                                                                   
  274. FLUSH_START    EQU    0001H     ;  This start is a result of a Flush Stop command.   
  275. ;***************************************************************************  
  276. SHC_STOP    EQU    5 
  277.  
  278. parm_stop    STRUC
  279. shcstp_ulFunction    DD    ?        ;  Handler command function               
  280. shcstp_hid    DD    ?               ;  handler ID                             
  281. shcstp_hstream    DD    ?           ;  handle of stream instance              
  282. shcstp_ulFlags    DD    ?           ;  Stop flags (refer to ulFlags defines under   
  283.                                     ;   SpiStopStream() call.                 
  284. parm_stop    ENDS
  285. ;***************************************************************************  
  286. SHC_SEEK    EQU    6 
  287.  
  288. parm_seek    STRUC
  289. shcsek_ulFunction    DD    ?        ;  Handler command function               
  290. shcsek_hid    DD    ?               ;  handler ID                             
  291. shcsek_hstream    DD    ?           ;  handle of stream instance              
  292. shcsek_ulFlags    DD    ?           ;  Seek flag (refer to ulFlags defines    
  293.                                     ;   under SpiSeekStream() call).          
  294. shcsek_lSeekPoint    DD    ?        ;  seek to point , mmtime or other        
  295. parm_seek    ENDS
  296. ;***************************************************************************  
  297. SHC_ENABLE_EVENT    EQU    7 
  298.  
  299. parm_enevent    STRUC
  300. shceev_ulFunction    DD    ?        ;  Handler command function               
  301. shceev_hid    DD    ?               ;  handler ID                             
  302. shceev_hevent    DD    ?            ;  handle of event to enable              
  303. shceev_pevcbUser    DD    ?         ;  User event information (e.g. hstream   
  304.                                     ;   EventType, EventSubType)              
  305. parm_enevent    ENDS
  306. ;***************************************************************************  
  307. SHC_DISABLE_EVENT    EQU    8 
  308.  
  309. parm_disevent    STRUC
  310. shcdev_ulFunction    DD    ?        ;  Handler command function               
  311. shcdev_hid    DD    ?               ;  handler ID                             
  312. shcdev_hstream    DD    ?           ;  handle to stream for this event        
  313. shcdev_hevent    DD    ?            ;  handle of event to disable             
  314. parm_disevent    ENDS
  315. ;***************************************************************************  
  316. SHC_ENABLE_SYNC    EQU    9 
  317.  
  318. parm_ensync    STRUC
  319. shcesy_ulFunction    DD    ?        ;  Handler command function               
  320. shcesy_hid    DD    ?               ;  handler ID                             
  321. shcesy_hstream    DD    ?           ;  handle of stream instance              
  322. shcesy_ulFlags    DD    ?           ;  Sync flags                             
  323. shcesy_mmtimeSync    DD    ?        ;  granularity of sync interval (if null, use default)   
  324. shcesy_pevcbSyncPulse    DD    ?  ;  Sync pulse EVCB information            
  325. shcesy_ulSyncPulseSem    DD    ?    ;  Optional 16 bit system                 
  326.                                     ;  Semaphore for handler                  
  327. parm_ensync    ENDS
  328. ;  ulFlags:                                                                   
  329. SYNC_MASTER    EQU    0000H     ;  The handler will be a master for this sync  
  330. SYNC_SLAVE    EQU    0001H     ;  The handler will be a slave for this sync   
  331. ;***************************************************************************  
  332. SHC_DISABLE_SYNC    EQU    10 
  333.  
  334. parm_dissync    STRUC
  335. shcdsy_ulFunction    DD    ?        ;  Handler command function               
  336. shcdsy_hid    DD    ?               ;  handler ID                             
  337. shcdsy_hstream    DD    ?           ;  handle of stream instance              
  338. parm_dissync    ENDS
  339. ;***************************************************************************  
  340. SHC_GET_TIME    EQU    11 
  341.  
  342. parm_gtime    STRUC
  343. shcgti_ulFunction    DD    ?        ;  Handler command function               
  344. shcgti_hid    DD    ?               ;  handler ID                             
  345. shcgti_hstream    DD    ?           ;  handle of stream instance              
  346. shcgti_mmtimeCurrent    DD    ?     ;  Returns current stream time            
  347. parm_gtime    ENDS
  348. ;***************************************************************************  
  349. SHC_GET_PROTOCOL    EQU    12 
  350.  
  351. parm_gprot    STRUC
  352. shcgpt_ulFunction    DD    ?        ;  Handler command function               
  353. shcgpt_hid    DD    ?               ;  handler ID                             
  354. shcgpt_spcbkey    DB    SIZE SPCBKEY DUP (?)           ;  key of SPCB                            
  355. shcgpt_pspcb    DD    ?             ;  ptr to SPCB (output)                   
  356. parm_gprot    ENDS
  357. ;***************************************************************************  
  358. SHC_INSTALL_PROTOCOL    EQU    13 
  359.  
  360. parm_instprot    STRUC
  361. shcipt_ulFunction    DD    ?        ;  Handler command function               
  362. shcipt_hid    DD    ?               ;  handler ID                             
  363. shcipt_spcbkey    DB    SIZE SPCBKEY DUP (?)           ;  key of SPCB                            
  364. shcipt_pspcb    DD    ?             ;  ptr to SPCB to install                 
  365. shcipt_ulFlags    DD    ?           ;  Install / Deinstall flags              
  366. parm_instprot    ENDS
  367. ;***************************************************************************  
  368. SHC_ENUMERATE_PROTOCOLS    EQU    14 
  369.  
  370. parm_enumprot    STRUC
  371. shcqpi_ulFunction    DD    ?        ;  Handler command function               
  372. shcqpi_hid    DD    ?               ;  handler ID                             
  373. shcqpi_paSPCBKeys    DD    ?        ;  ptr to buffer to fill with SPCB keys   
  374. shcqpi_pulNumSPCBKeys    DD    ?    ;  # of entries buffer on input,          
  375.                                     ;   # of SPCB key on output.              
  376. parm_enumprot    ENDS
  377. ;***************************************************************************  
  378. SHC_NEGOTIATE_RESULT    EQU    15 
  379.  
  380. parm_negotiate    STRUC
  381. shcneg_ulFunction    DD    ?        ;  Handler command function               
  382. shcneg_hid    DD    ?               ;  handler ID                             
  383. shcneg_hstream    DD    ?           ;  handle of stream instance              
  384. shcneg_pspcb    DD    ?             ;  Ptr to negotiated SPCB                 
  385. shcneg_ulErrorStatus    DD    ?     ;  On error, indicates which field in the  
  386. parm_negotiate    ENDS
  387. ;***************************************************************************  
  388. ;   Reserved - SHC command       16L                                          
  389. ;***************************************************************************  
  390.