MCI_RESERVE

This MCI command message allocates contiguous disk space for this device driver instance's workspace for use by subsequent recording.

Parameters

DWORD lParam1

The following flags apply to all devices supporting MCI_RESERVE:


MCI_NOTIFY

Specifies that MCI should post the MM_MCINOTIFY message when this command completes. The window that receives this message is specified in the dwCallback field of the data structure identified by lParam2.

MCI_TEST

Queries the device to determine if it can execute the command. The device returns an error if it is incapable of executing the command. It returns no error if it can handle the command. MCI returns control to the application without executing the command.

MCI_WAIT

Specifies that the operation should complete before MCI returns control to the application.

MCI_DGV_RESERVE_IN

Indicates the lpstrPath field of the data structure identified by lParam2 contains a pointer to a buffer containing the location of a temporary file. The buffer contains only the drive and directory path of the file used to hold recorded data; the filename is specified by the device driver. This temporary file is deleted when the device instance is closed unless it is explicitly saved. If this flag is omitted, the device driver specifies where disk space is allocated.

MCI_DGV_RESERVE_SIZE

Indicates the dwSize field of the data structure identified by lParam2 specifies the approximate amount of disk space to reserve in the workspace for recording. The value is specified in the current time format. The amount of disk space is estimated from the requested time and which file format and video and audio algorithm and quality values are in effect. If this flag is omitted, the device driver may use an device driver defined default.

LPMCI_DGV_RESERVE_PARMS lParam2

Specifies a far pointer to the MCI_DGV_RESERVE_PARMS data structure.

Return Value

Returns zero if successful. Otherwise, it returns an MCI error code.

Comments

If the workspace contains unsaved data, then this data is lost. If disk space is not reserved prior to recording, MCI_RECORD will perform an implied reserve with device-specific default parameters. On some implementations, reserve is not required and might be ignored by the device driver. Explicitly reserving space gives you better control over when the delay for disk allocation will occur, how much space will be allocated, and where the disk space is allocated. The amount and location of disk space already reserved for this device instance can be changed by issuing another MCI_RESERVE. Any allocated, and still unused, disk space is not deallocated until any recorded data is saved or until the device driver instance is closed.

If video is turned off with the MCI_OFF flag of the MCI_SETVIDEO command then the space reserved does not include any video. If audio is turned off with the MCI_OFF flag of the MCI_SETAUDIO command then the space reserved does not include any audio. If both audio and video are turned off or if the requested size is zero then no space is reserved and any existing reserved space is deallocated.

See Also

MCI_RECORD