PUPNPCALLBACK

This callback function is an application-defined function. It must be implemented by a device that supplies a pointer to the UpnpAddDevice function. The device hosting service calls this function when network messages are received. The PUPNPCALLBACK name for this function is a placeholder for the function name defined by the application.

typedef DWORD (*PUPNPCALLBACK) (
  UPNPCB_ID callbackId,
  PVOID pvUserContext,
  PVOID pvSvcParam
);

Parameters

  • callbackId
    Callback identifier. Can contain one of the following values.
    UPNPCB_ID pvSvcParam When to call
    UPNPCB_INIT Null Before first action or subscribe request
    UPNPCB_SUBSCRIBING pszServiceId Subscribe request
    UPNPCB_UNSUBSCRIBING pszServiceId Unsubscribe request
    UPNPCB_CONTROL PUPNPSERVICECONTROL Control action
    UPNPCB_SHUTDOWN Null When the UpnpRemoveDevice function is called
  • pvUserContext
    Application context, this value is obtained from the UPNPDEVICEINFO structure.
  • pvSvcParam
    Service parameter. See above for a list of possible values.

Return Values

The callback should return TRUE for success and FALSE to indicate a failure.

Remarks

The callback function may ignore notifications that it is not interested in and return TRUE. It should handle at least the UPNCB_CONTROL notification as this notification specifies how control actions are processed.

The following functions should only be called inside the UPNPCALLBACK function when the UPNPCB_ID is UPNPCB_CONTROL:

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Upnpdevapi.h.
Link Library: Upnpcapi.lib.

See Also

UpnpRemoveDevice | UPNPDEVICEINFO

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.