Microsoft DirectX 9.0


This topic applies to Windows XP Service Pack 1 only.

The LockProfile method locks the Stream Buffer Sink filter's profile, thereby fixing the number of streams and their media types. This method can also specify the name and location of the stub file that points to the backing files.


HRESULT LockProfile(
  LPCWSTR  pszFilename



[in]  Pointer to a null-terminated wide-character string that specifies the full path name of the stub file. If the specified file already exists, the method fails. If pszFilename is NULL, the stub file is created in the current directory with a default file name.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK The method succeeded.
E_UNEXPECTED The call failed, possibly because it was called with a non-null file name more than once.
VFW_E_UNSUPPORTED_STREAM The call failed because there are no streams in the profile.


The profile describes the number of input streams, their media types, and the location of the stub file that points to the temporary backing files. The profile must be locked before the Stream Buffer Source filter can read data from the backing files. Applications can lock the profile explicitly by calling the LockProfile method, or implicitly by running the filter graph that contains the Stream Buffer Sink filter.

After the profile is locked, the Stream Buffer Sink filter does not accept any new pin connections. Pins already connected can be reconnected, but only with the same media type. The profile is unlocked when the graph stops.

The stub file is automatically deleted when the last process closes the file handle. This occurs when the capture graph stops and no render graphs are reading the file.

The LockProfile method can be called multiple times with the value NULL, but only once with a non-NULL file name. After the filter graph runs, calling the method with NULL succeeds but has no effect, and calling the method with a file name fails.

The name of the stub file can be given to the Stream Buffer Source filter through that filter's IFileSourceFilter::Load method.


Include Sbe.h.

See Also