Obtaining the Driver State

The client application obtains the driver state by sending ICM_GETSTATE. The client application determines the size of the buffer needed for the state information by sending this message with dwParam1 set to NULL. Your driver should respond to the message by returning the size of the buffer it needs for state information.

After it determines the buffer size, the client application resends the message with dwParam1 pointing to a block of memory it allocated. The dwParam2 parameter specifies the size of the memory block. Your driver should respond by filling the memory with its state information. If your driver uses state information, include only optional decompression parameters with the state information. State information typically includes the setup specified by the user in the dialog box resulting from an ICM_CONFIGURE message. Any information required for decompressing the image data must be included with the format data. When done, your driver should return the size of the state information.

The client application does not validate any data in the state information. It simply stores the state information in the ‘strd’ data chunk of the AVI file.