次の方法で共有


PUPNPCALLBACK (Windows Embedded CE 6.0)

1/6/2010

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.

Syntax

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 Value

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

Header upnpdevapi.h
Library Upnpcapi.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

UPnP C Device Host Functions
UpnpRemoveDevice
UPNPDEVICEINFO