共用方式為


WMCheckURLExtension function (wmsdkvalidate.h)

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The WMCheckURLExtension function examines the file name extension in the URL or file name that is passed in as an argument. The extension is compared to a list of supported file types in an attempt to determine whether the file can be opened by the objects of this SDK.

If you are writing an application that can handle many different file types, you can use this function to try to quickly determine whether the file can be read using objects of the Windows Media Format SDK.

Syntax

HRESULT WMCheckURLExtension(
  [in] LPCWSTR pwszURL
);

Parameters

[in] pwszURL

A wide-character null-terminated string containing a file name or URL.

Return value

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

Return code Description
S_OK
The function succeeded, and the file extension is supported. This result does not indicate verification of the contents of the file, just the extension.
NS_E_INVALID_NAME
The URL passed is not of a type supported by the objects of the Windows Media Format SDK.
E_INVALIDARG
pwszURL is NULL.

Remarks

This function cannot report with absolute certainty whether a particular URL can be handled, as this cannot be determined until the URL is opened.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only],Windows Media Format 9 Series SDK, or later versions of the SDK
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wmsdkvalidate.h (include Wmsdkidl.h)
Library Wmvcore.lib
DLL Wmvcore.dll

See also

Functions