Share via


Other versions of this page are also available for the following:

Windows Mobile SupportedWindows Embedded CE Supported


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


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


  • devclass
    [in] Pointer to a device interface globally unique identifier (GUID). It cannot be NULL. For information on the predefined device interface GUIDs, see Device Interfaces.
  • 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.


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


Header winbase.h
Library coredll.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also


Device Interfaces