Freigeben über


GetClassFileOrMime function

Gets the CLSID of the object to instantiate for the specified file.

Syntax

HRESULT GetClassFileOrMime(
             LPBC    pBC,
             LPCWSTR szFilename,
             LPVOID  pBuffer,
             DWORD   cbSize,
             LPCWSTR szMime,
  _Reserved_ DWORD   dwReserved,
             CLSID   *pclsid
);

Parameters

  • pBC
    A pointer to a bind context that can affect the mapping to a CLSID. This parameter is usually NULL. It can be used to override system CLSID mappings when it is used with RegisterMediaTypeClass.

  • szFilename
    A pointer to a string variable that contains the file name. Can be set to NULL.

  • pBuffer
    A pointer to a buffer that contains data from the beginning of the file. Can be set to NULL.

  • cbSize
    An unsigned long integer value that contains the size of pBuffer.

  • szMime
    A pointer to a string variable that contains the MIME type of the file. Can be set to NULL.

  • dwReserved
    Reserved. Must be set to 0.

  • pclsid
    A pointer to a CLSID that receives the CLSID of the object to instantiate for the specified file.

Return value

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Windows Internet Explorer 9. This function can also return a class identifier (CLSID) from structured storage files if sniffing is allowed for the security zone (URLACTION_ALLOW_STRUCTURED_STORAGE_SNIFFING is enabled) and sniffing is not disabled for the process by using FEATURE_RESTRICT_CDL_CLSIDSNIFF. Structured storage sniffing is enabled by default in the Local intranet and Trusted sites zones.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Product

Internet Explorer 3.0

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll