Share via


IWMSServer::get_FileDescriptions

banner art

Previous Next

IWMSServer::get_FileDescriptions

The get_FileDescriptions method retrieves an IWMSFileDescriptions interface containing a collection of IWMSFileDescription interfaces that describe content files, playlist files, and directories.

Syntax

  HRESULT get_FileDescriptions(
  BSTR  path,
  WMS_FILE_TYPE  Type,
  IWMSFileDescriptions**  pVal
);

Parameters

path

[in] BSTR containing the file path name.

Type

[in] Member of the WMS_FILE_TYPE enumeration type. This must be one of the following values.

Value Description
WMS_FILE_DIRECTORY Indicates the item is a directory.
WMS_FILE_MEDIA Indicates the item is a digital media file.
WMS_FILE_PLAYLIST Indicates the item is a playlist.
WMS_FILE_STREAM_FORMAT Indicates the item is a stream format file.
WMS_FILE_UNSPECIFIED Indicates the file type is either unknown or unspecified.

pVal

[out] Pointer to a pointer to an IWMSFileDescriptions interface.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
E_POINTER 0x80004003 Indicates that pVal is a NULL pointer argument.
ERROR_FILE_NOT_FOUND 0x00000002 Indicates that the data source plug-in was not able to find the indicated file. This error is returned by the WMS File Data Source plug-in, but other plug-ins could return different error codes.
ERROR_PATH_NOT_FOUND 0x00000003 Indicates that the path indicated by path was not found.
NS_E_DATA_SOURCE_ENUMERATION_NOT_SUPPORTED 0xC00D1580L Indicates that the data source plug-in that the server is attempting to use to access the path referenced by path does not support the enumeration of files.
NS_E_SOURCE_PLUGIN_NOT_FOUND 0xC00D157EL Indicates that the server was not able to find an enabled data source plug-in to access the indicated file.

Remarks

You can only retrieve an IWMSFileDescriptions interface for files that have registered media parsers or playlist parsers. The first parameter must start with an appropriate prefix to identify the type of storage system. For an NTFS or FAT file system, use the file:// prefix. For example, file://C:\asfroot specifies the root directory of a server running on an NTFS or FAT file system and retrieves a collection of IWMSFileDescription interfaces for the files and folders in that directory.

This method is not supported for cache proxy publishing points.

This method requires the Network Service account to have read and browse access to the specified path.

This method calls AddRef internally. To avoid memory leaks, you must call Release when you are finished using the interface.

Example Code

#include <windows.h>
#include <atlbase.h>    // Includes CComBSTR.
#include "wmsserver.h"

// Declare variables and interfaces.
IWMSServer              *pServer;
IWMSFileDescriptions    *pFileDescriptions;

HRESULT         hr;
CComBSTR        bstrText;

// Initialize the COM library and retrieve a pointer
// to an IWMSServer interface.
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_WMSServer,
                      NULL,
                      CLSCTX_ALL,
                      IID_IWMSServer,
                      (void **)&pServer);
if (FAILED(hr)) goto EXIT;

// Retrieve a list of file descriptions for
// the specified path.
bstrText = "c:\\";
hr = pServer->get_FileDescriptions(bstrText, WMS_FILE_MEDIA,
                                   &pFileDescriptions);
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary COM objects and uninitialize COM.

Requirements

Header: wmsserver.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next