═══ 1. Multimedia MCI Message Spy (MCISPY) ═══ The Multimedia MCI Message Spy (MCISPY) is a sample program that can be used to monitor Media Control Interface (MCI) messages that are exchanged between various devices in the OS/2 Multimedia subsystem. The application is used to understand the device interactions to application requests in the MMPM/2 subsystem. In order to begin monitoring messages select Spy On pull down from the menu bar and choose start spying. Messages will be intercepted only after this choice is made. A description of how MCISPY traps MCI messages Follows. ┌────────────────┐ │ Shared Memory │ │ (Named) │ ├────────────────┤ ┌──────────────┐ APIs Exported │ │ │ │ │ │ │ True MDM │ │ Stub or │ │ renamed │ mciSendCommand() │ Proxy │ Forwarder entry │ to MCI.DLL │ ─────────────────┤ MDM.DLL ├─────────────────────┤ containing │ mciSendString() │ │ Forwarder entry │ the API │ ─────────────────┤ maintain Open ├─────────────────────┤ workers. │ mdmDriverNotify()│ Device Ids │ Forwarder entry │ │ ─────────────────┤ ├─────────────────────┤ │ │ Notify Spy │ │ │ │ Application │ │ │ └────────────────┘ └──────────────┘ ┌─────────────────┐ │ Shared Memory │ │ (Named) │ ├─────────────────┤ │ │ │ MCISPY │ │ Application │ │ │ │ │ │ │ └─────────────────┘ MDM and MCI Message monitoring application interaction. The above diagram depicts a high level view of how MCI messages are monitored. MDM is the MCI interface provider. The MCISPY application comprises of an EXE (MCISPY.EXE) and a corresponding DLL pair. The above diagram depicts the MCISPY application implementation model. The diagram shows a stub or proxy DLL which replaces the true MDM.DLL renaming existing MDM to MCI. The proxy MDM exports the same APIs at the same ordinals as true MDM. The stub or proxy MDM has forwarder entries into the true MDM (renamed to MCI.DLL) for API workers, ie it exports the APIs and also imports the same APIs from the true MDM. MCISPY monitors both the MCI string interface and the MCI command interface. The display consits of originating Process ID (PID), device Id, MCI message Flags, User parameter and Data. The above fields are displayed for the MCI command interface. For the string interface the PID and the string input is displayed. The MCISPY application has 5 groups of possible user actions provided for by the application. The user menu has the following groups of choices. Logfile enables the user to select a logfile to log the displayed messages. The menubar pull down choice Enable message Logging item must be selected to turn on message logging. The Edit group of menu permit editing operations on the displayed screen contents. Copy,Delete,Discard, and Font operations on the application screen contents are permitted. The View permits viewing of installed multimedia devices in the system and also provides a simple MCI Flag parser. The user enters the Flag value (in hex) and selects a MCI message and the parser displays what the flag combination is. The Filter pulldown has various means by which messages can be filtered. The Disable choices (String Interface,Command Interface, and Driver Notifications) respectively filter inputs from the above APIs. Filtering by MCI Messages is permitted. If MCI_OPEN is filtered then the application will not see MCI_OPEN messages at all till it is turned of. To turn off reinvoke the Filter by Messages choice and select or deslect the message. Filter by Device types allows a device type filter which behaves similarly. Filtering by active device Ids is also permitted. There are provisions to disable frequently occurring timer messages like MCI_SETPOSITION_ADVISE. MCISPY also displays error return codes as they occur. To enable logging of messages to a file select enable message logging from the menu bar under LogFile. Messages will be written to the default log file "MCISPY.LOG". Select Open to specify a different log file. The Edit choices are intended for clearing messages on the screen and other related operations. Copy is supported. Clear All clears all displayed messages. Select text first before copying. Set font sets the window font. ═══ 2. Help for MCISPY Keys ═══ The following keys can be used to control the MCISPY App Alt+L Select LogFile from menu bar. Alt+E Select Edit from menu bar. Alt+V Select View from menu bar. Alt+F Select Filter from menu bar. Alt+H Select Help from menu bar. ═══ 3. MCISPY Filter MCI Messages ═══ You can filter or exclude messages you do not want to see. The list box contains the list of all Multimedia MCI messages. You can select the message(s) you want to exclude(not displayed) and select the "OK" pushbutton. Initially no message filter is in effect and hence all MCI messages are displayed. The "All" pushbutton selects all items in the listbox. The "None" pushbutton deselects all items in the listbox. The "Timer on" pushbutton selects the timer messages like MM_MCIPOSITIONCHANGE. The "Timer Off" pushbutton deselects the timer messages. the "Actions On" pushbutton selects the MCI Actions group of messages like MCI_PLAY, MCI_RECORD, MCI_PAUSE, MCI_RESUME, MCI_SEEK, and MCI_STOP. The 'Actions Off" pushbutton deselects the actions group. To cancel any existing message filter in effect invoke the dialog again and exit making a new selection or without selecting anything. All Internal Filter members for the particular type are reset on entry to the dialog. ═══ 4. MCISPY Device Type Filter ═══ You can filter or exclude messages you do not want to see for a particular device. If the device type filter is in effect for a particular device you will not see any messages (including String interface) for that device. CAVEAT If the device was automatically opened by using an element to identify the device then the filtering may not work. list box contains the list of all Multimedia device types . You can select the device you want to exclude(not displayed) and select the "OK" pushbutton. To cancel any existing device type filter invoke the dialog again and exit without choosing anything. ═══ 5. MCISPY Device Id or Alias Filter ═══ You can filter or exclude messages you do not want to see for a particular device Id or alias. If the device Id filter is in effect for a particular device Id you will not see any messages for that device id or alias. CAVEAT If the device was automatically opened by using an element to identify the device then the filtering may not work. list box contains the list of all Multimedia device Id(s) and alias(es) currently open . You can select the device Id or alias you want to exclude(not displayed) and select the "OK" pushbutton. To cancel any existing device Id or alias filter invoke the dialog again and exit without choosing anything or something else. ═══ 6. MCISPY Display MCI Flag values ═══ MCISPY Displays Flag values in hex as seen by the mciSendCommand interface. For certain predetermined messages you can see the textual representation of the hex value. For example on MCI_ACQUIRE message a flag value of 102(hex) means MCI_EXCLUSIVE and MCI_WAIT. Enter the value of the flag in the entry field at the top (in hex). Select the message for which the flag value was used. Select Display to display the flag values in the Results list box. Use Clear to clear the contents of the Results List box. To dismiss dialog select cancel In order to add additional messages and flag values modify the source code provided. ═══ 7. MCISPY View Installed Multimedia Devices ═══ This dialog displays all the installed multimedia devices in the system. The display includes logical device, physical device and product information associated with each device. ═══ 8. MCISPY Open Log File ═══ You can open a Log file on any drive or in any directory by using this dialog. Opening of the Log file merely provides a file name to the application. Subsequently if logging is enabled all messages will be logged to the file just opened. The default Log file is MCISPY.LOG in the current directory. Select OK to dismiss the dialog.