驱动程序的默认行为
[与此页关联的功能(MCI)是一项旧功能。 它已被 MediaPlayer取代。 MediaPlayer 已针对 Windows 10 和 Windows 11 进行了优化。 Microsoft强烈建议新代码尽可能使用 MediaPlayer 而不是 MCI。 Microsoft建议重写使用旧 API 的现有代码,以尽可能使用新 API。]
在许多情况下,MCI 命令规范定义了特定设备类型的驱动程序的默认值和行为。 由于多媒体设备可以具有广泛的功能(和限制),因此可能存在未定义的行为区域。 此外,驱动程序可能会根据设备的功能以不同的方式处理异常。
例如,请考虑使用 mciSendString 函数发送到波形音频驱动程序的以下命令:
mciSendString("open sound.wav alias sound", lpszReturnString,
lstrlen(lpszReturnString), NULL);
mciSendString("play sound notify", lpszReturnString,
lstrlen(lpszReturnString), NULL);
mciSendString("record sound from 0 notify", lpszReturnString,
lstrlen(lpszReturnString), NULL);
记录 命令返回“范围外参数”值,并停止上一 播放 命令启动的播放。 在停止播放之前,驱动程序可能会期望驱动程序先验证录制命令,但驱动程序先停止播放。