home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / SAMPLES / MM / MCISPY / MDM.H < prev    next >
Text File  |  1995-08-24  |  5KB  |  121 lines

  1. /*********************** START OF SPECIFICATIONS *******************************
  2. *
  3. * SOURCE FILE NAME: MDM.H
  4. *
  5. * DESCRIPTIVE NAME: Media Device Manager Component Definitions.
  6. *
  7. * FUNCTION:  Define Component Data Structures.
  8. *
  9. *
  10. *********************** END OF SPECIFICATIONS ********************************/
  11. #define  MAXSIZE      1024
  12. #define  MAXOPENS     20
  13. #define  SPY_STRING   0x5002                 /* String Interface Const   */
  14. #define  SPY_NOTIFY   0x5001                 /* Command Interface Const  */
  15. #define  SPY_DRIVER   0x5003                 /* Driver Notify  Const     */
  16. #define  SPY_ERRRC    0x5004                 /* Error Conditions Const   */
  17. #define  SPY_DEVICE   0x5005                 /* Resouce Change Msgs Const*/
  18. #define  FAILURE      0L                     /* Loader Indication Flag   */
  19. #define  SUCCESS      1L                     /* Loader Indication Flag   */
  20. #define INTIALIZE     0                      /* Loader Indication Flag   */
  21.  
  22. /* Send Command Dynamic PFN */
  23. typedef ULONG (APIENTRY fDRIVERENTRY) (USHORT lpInstance,
  24.                                        USHORT wMessage,
  25.                                        ULONG dwParam1,
  26.                                        PVOID dwParam2,
  27.                                        USHORT wUserParm);
  28. typedef fDRIVERENTRY   *DRIVERENTRY;
  29.  
  30. /* Send String Dynamic Function Prototype */
  31.  
  32. typedef ULONG (APIENTRY  fSENDSTR)   (PSZ lpstrCommandBuf,
  33.                                       PSZ lpstrReturnString,
  34.                                       USHORT  wReturnLength,
  35.                                       HWND  hCallBack,
  36.                                       USHORT  wUserParm );
  37.  
  38.  
  39. typedef fSENDSTR  *SENDSTR;
  40.  
  41. /*
  42. ** The Thread Block is a shared memory structure that is identical
  43. ** between the stub DLL and the Application (MCISPY.EXE). This structure
  44. ** Should remain identical on both sides.
  45. */
  46.  
  47. typedef struct _ThreadBlk {
  48.   USHORT      wMsg;                   /* MCI Message     */
  49.   USHORT      wDevID;                 /* Device ID       */
  50.   ULONG       dwParam1;               /* Message Flags   */
  51.   ULONG       dwParam2;               /* Message Data    */
  52.   USHORT      wUserParm;              /* User parameter  */
  53.   SZ          szCmd[1024];            /* String Command  */
  54.   PVOID       pvNotPacket;            /* Notify Packet Base Address */
  55.   ULONG       ulPID;                  /* Process Id      */
  56.   ULONG       ulReturnCode;           /* Return Code     */
  57.   HEV         SysSndsEvtSem;          /* System Sounds   */
  58.   HEV         SysSndsSyncSem;         /* System Sounds   */
  59. }THREAD_BLOCK;
  60.  
  61. typedef struct _OpenPID {
  62.   ULONG  ulDevId;                /* Open Device Id      */
  63.   ULONG  ulPID;                  /* Process Id          */
  64.   BOOL   fExclude;               /* Filter Toggle Flag  */
  65.   USHORT usDevTyp;               /* Device Type Const   */
  66. }OPENPID;
  67.  
  68. typedef struct _OpenPIDAl {
  69.   SZ     szAlias[124];           /* Open Device Alias   */
  70.   ULONG  ulPID;                  /* Process Id          */
  71.   BOOL   fExclude;               /* Filter Toggle Flag  */
  72.   SZ     szDevTyp[30];           /* Device Type String  */
  73. }OPENPIDAL;
  74.  
  75. /* This structure is identical between the application and the
  76. ** Stub DLL.
  77. */
  78.  
  79. typedef struct _OpenList {
  80.   OPENPID      ulOpenList[20];   /* Device Ids of open list    */
  81.   OPENPIDAL    szAlias[20];      /* Alias(es) of  open list    */
  82.   ULONG        ulNumOpen;        /* Total Number of Opens      */
  83. }OPEN_LIST;
  84.  
  85. /* Function Prototypes */
  86.  
  87. ULONG APIENTRY mciSendCommand  (USHORT   wDeviceID,
  88.                                 USHORT   wMessage,
  89.                                 ULONG    dwParam1,
  90.                                 PVOID    dwParam2,
  91.                                 USHORT   wUserParm);
  92.  
  93.  
  94. ULONG APIENTRY  mciSendString   (PSZ lpstrCommandBuf,
  95.                                  PSZ lpstrReturnString,
  96.                                  USHORT  wReturnLength,
  97.                                  HWND  hCallBack,
  98.                                  USHORT  wUserParm );
  99.  
  100.  
  101. int _CRT_init(void);          /* C Runtime Initialization */
  102. int _CRT_term(void);          /* C Runtime Termination    */
  103.  
  104. /* DLL Initilaztion/Termination  Routine */
  105. unsigned long _System _DLL_InitTerm (ULONG hModule,ULONG ulFlag);
  106.  
  107. /* SPY Registration Routine   */
  108. APIRET APIENTRY RegisterSpy (HWND hwndspy,ULONG ulApiMode);
  109.  
  110. /* Query Instance Information Routine */
  111.  
  112. APIRET APIENTRY QueryOpenInstance (OPEN_LIST * pulList, BOOL fAlias);
  113.  
  114. /* Sytem Input Hook Procedure to monitor Resource Change Messages */
  115.  
  116. BOOL APIENTRY  InputHookProc   (HAB   hab,  PQMSG pQmsg,ULONG ulfs);
  117.  
  118. VOID _Optlink SystemSoundsThread(PVOID ptemp);
  119.  
  120. APIRET APIENTRY SpySystemSounds (BOOL fAlias) ;
  121.