Compartilhar via


AdvertiseInterface (Compact 2013)

3/26/2014

This function allows a driver to announce what interfaces it exposes.

Syntax

BOOL AdvertiseInterface(
  const GUID* devclass,
  LPCWSTR name,
  BOOL fAdd
);

Parameters

  • devclass
    [in] Pointer to a device interface globally unique identifier (GUID). It cannot be NULL.
  • name
    [in] Name of the interface instance. Use this name to identify this instance in whatever way the interface requires. This name must be unique in the interface's access namespace. Therefore, "DSK2:" might be available in both the generic stream interface namespace and the block interface namespace, and will probably, but not necessarily, refer to the same actual driver.
  • fAdd
    [in] Data to specify whether to add or remove the interface. Set to TRUE if the interface was added. Set to FALSE if the interface was removed.

Return Value

TRUE indicates success. FALSE indicates failure. Reasons for failure include a GUID that is not unique and name, permission denied, and insufficient memory to track the interface. It also fails if you attempt to remove an interface that was never added.

Remarks

Adding an interface with AdvertiseInterface allocates resources within the Device Manager. Be sure to advertise its removal before the driver is unloaded.

Requirements

Header

winbase.h

Library

coredll.lib

See Also

Reference

Device Manager Functions