How to Build and Register the Data Source Sample

You must use Microsoft Visual Studio .NET to build the WMS SDK Sample Data Source plug-in. To build the plug-in, perform the following steps:

  1. Start Visual Studio .NET.

  2. On the File menu, click Open Solution.

  3. In Open Solution, navigate to the \Program Files\Microsoft Platform SDK\Samples\multimedia\WindowsMediaServices9\DataSource folder, and then click sdksamplestorageplugin.sln.

  4. On the Build menu, click Build Solution to build and register the WMS SDK Sample Data Source plug-in.

Registering a plug-in creates the registry structure which makes the plug-in available to Windows Media Services. To make the plug-in visible to the server, the CLSID of a data source plug-in must be placed beneath both the HKEY_CLASSES_ROOT and the HKEY_LOCAL_MACHINE registry keys. The sample plug-in uses a registry script, SDKSampleStorageSystem.rgs, and calls regsvr32 in the command line property of the custom build step to register the plug-in.

If you must re-register the WMS SDK Sample Data Source plug-in after it is built, you can do so manually on the command line by supplying the .dll path to the regsvr32 command, as illustrated by the following example.

regsvr32 /s /c "C:\Program Files\Microsoft Platform SDK\Samples\multimedia\WindowsMediaServices9\DataSource\Release\SDKSampleStoragePlugin.dll" 

Data Source plug-ins also contain some extra registration details that indicate to Windows Media Services when to use that data source plug-in. The following two lines can be found in the SDKSampleStorageSystem.rgs file included with this sample plug-in.

val 'URL Prefix' = s 'sample://'
val 'URL Suffix' = s ''

This information informs Windows Media Services that the sample plug-in can be used to access files which contain the prefix sample://. For example, if Windows Media Services attempts to stream a playlist file like the one below, the sample data source plug-in will be used to access that file.

<?wsx version='1.0'?>
<smil>
    <media src="sample://c:\wmpub\wmroot\media_file.wmv"/>
</smil>

See Also

Concepts

Data Source Plug-in Sample