Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _INC_P2P
      7 #define _INC_P2P
      8 #if (_WIN32_WINNT >= 0x0600)
      9 
     10 #ifdef __cplusplus
     11 extern "C" {
     12 #endif
     13 
     14 typedef enum _PEER_APPLICATION_REGISTRATION_TYPE {
     15   PEER_APPLICATION_CURRENT_USER,
     16   PEER_APPLICATION_ALL_USERS
     17 } PEER_APPLICATION_REGISTRATION_TYPE, PEER_APPLICATION_REGISTRATION_FLAGS;
     18 
     19 typedef enum _PEER_CHANGE_TYPE {
     20   PEER_CHANGE_ADDED,
     21   PEER_CHANGE_DELETED,
     22   PEER_CHANGE_UPDATED
     23 } PEER_CHANGE_TYPE;
     24 
     25 typedef enum _PEER_COLLAB_EVENT_TYPE {
     26   PEER_EVENT_WATCHLIST_CHANGED,
     27   PEER_EVENT_ENDPOINT_CHANGED,
     28   PEER_EVENT_ENDPOINT_PRESENCE_CHANGED,
     29   PEER_EVENT_ENDPOINT_APPLICATION_CHANGED,
     30   PEER_EVENT_ENDPOINT_OBJECT_CHANGED,
     31   PEER_EVENT_MY_ENDPOINT_CHANGED,
     32   PEER_EVENT_MY_PRESENCE_CHANGED,
     33   PEER_EVENT_MY_APPLICATION_CHANGED,
     34   PEER_EVENT_MY_OBJECT_CHANGED,
     35   PEER_EVENT_PEOPLE_NEAR_ME_CHANGED,
     36   PEER_EVENT_REQUEST_STATUS_CHANGED
     37 } PEER_COLLAB_EVENT_TYPE;
     38 
     39 typedef enum _PEER_GROUP_AUTHENTICATION_SCHEME {
     40   PEER_GROUP_GMC_AUTHENTICATION        = 0x00000001,
     41   PEER_GROUP_PASSWORD_AUTHENTICATION   = 0x00000002
     42 } PEER_GROUP_AUTHENTICATION_SCHEME;
     43 
     44 typedef enum _PEER_GROUP_ISSUE_CREDENTIAL_FLAGS {
     45   PEER_GROUP_STORE_CREDENTIALS   = 0x0001
     46 } PEER_GROUP_ISSUE_CREDENTIAL_FLAGS;
     47 
     48 typedef enum _PEER_INVITATION_RESPONSE_TYPE {
     49   PEER_INVITATION_RESPONSE_DECLINED,
     50   PEER_INVITATION_RESPONSE_ACCEPTED,
     51   PEER_INVITATION_RESPONSE_EXPIRED,
     52   PEER_INVITATION_RESPONSE_ERROR
     53 } PEER_INVITATION_RESPONSE_TYPE;
     54 
     55 typedef enum _PEER_PRESENCE_STATUS {
     56   PEER_PRESENCE_OFFLINE,
     57   PEER_PRESENCE_OUT_TO_LUNCH,
     58   PEER_PRESENCE_AWAY,
     59   PEER_PRESENCE_BE_RIGHT_BACK,
     60   PEER_PRESENCE_IDLE,
     61   PEER_PRESENCE_BUSY,
     62   PEER_PRESENCE_ON_THE_PHONE,
     63   PEER_PRESENCE_ONLINE
     64 } PEER_PRESENCE_STATUS;
     65 
     66 typedef enum _PEER_PUBLICATION_SCOPE {
     67   PEER_PUBLICATION_SCOPE_NONE,
     68   PEER_PUBLICATION_SCOPE_NEAR_ME,
     69   PEER_PUBLICATION_SCOPE_INTERNET,
     70   PEER_PUBLICATION_SCOPE_ALL
     71 } PEER_PUBLICATION_SCOPE;
     72 
     73 typedef enum _PEER_SIGNIN_FLAGS {
     74   PEER_SIGNIN_NONE,
     75   PEER_SIGNIN_NEAR_ME,
     76   PEER_SIGNIN_INTERNET,
     77   PEER_SIGNIN_ALL
     78 } PEER_SIGNIN_FLAGS;
     79 
     80 typedef enum _PEER_WATCH_PERMISSION {
     81   PEER_WATCH_BLOCKED,
     82   PEER_WATCH_ALLOWED
     83 } PEER_WATCH_PERMISSION;
     84 
     85 typedef struct _PEER_CONTACT *PPEER_CONTACT;
     86 typedef struct _PEER_ENDPOINT *PPEER_ENDPOINT;
     87 typedef struct _PEER_INVITATION *PPEER_INVITATION;
     88 typedef struct _PEER_OBJECT *PPEER_OBJECT;
     89 typedef struct _PEER_PEOPLE_NEAR_ME *PPEER_PEOPLE_NEAR_ME;
     90 typedef struct _PEER_PRESENCE_INFO *PPEER_PRESENCE_INFO;
     91 typedef LPVOID HPEERENUM;
     92 typedef LPVOID HPEEREVENT;
     93 
     94 typedef struct peer_address_tag {
     95   DWORD        dwSize;
     96   SOCKADDR_IN6 sin6;
     97 } PEER_ADDRESS, *PPEER_ADDRESS;
     98 
     99 typedef struct _PEER_APP_LAUNCH_INFO {
    100   PPEER_CONTACT    pContact;
    101   PPEER_ENDPOINT   pEndpoint;
    102   PPEER_INVITATION pInvitation;
    103 } PEER_APP_LAUNCH_INFO, *PPEER_APP_LAUNCH_INFO;
    104 typedef const PEER_APP_LAUNCH_INFO *PCPEER_APP_LAUNCH_INFO;
    105 
    106 typedef struct peer_data_tag {
    107   ULONG cbData;
    108   PBYTE pbData;
    109 } PEER_DATA, *PPEER_DATA;
    110 
    111 typedef struct _PEER_APPLICATION {
    112   GUID      id;
    113   PEER_DATA data;
    114   PWSTR     pwzDescription;
    115 } PEER_APPLICATION, *PPEER_APPLICATION;
    116 typedef const PEER_APPLICATION *PCPEER_APPLICATION;
    117 
    118 typedef struct _PEER_APPLICATION_REGISTRATION_INFO {
    119   PEER_APPLICATION application;
    120   PWSTR            pwzApplicationToLaunch;
    121   PWSTR            pwzApplicationArguments;
    122   DWORD            dwPublicationScope;
    123 } PEER_APPLICATION_REGISTRATION_INFO, *PPEER_APPLICATION_REGISTRATION_INFO;
    124 typedef const PEER_APPLICATION_REGISTRATION_INFO *PCPEER_APPLICATION_REGISTRATION_INFO;
    125 
    126 typedef struct _PEER_EVENT_APPLICATION_CHANGED_DATA {
    127   PPEER_CONTACT     pContact;
    128   PPEER_ENDPOINT    pEndpoint;
    129   PEER_CHANGE_TYPE  changeType;
    130   PPEER_APPLICATION pApplication;
    131 } PEER_EVENT_APPLICATION_CHANGED_DATA, *PPEER_EVENT_APPLICATION_CHANGED_DATA;
    132 
    133 typedef struct _PEER_EVENT_ENDPOINT_CHANGED_DATA {
    134   PPEER_CONTACT  pContact;
    135   PPEER_ENDPOINT pEndpoint;
    136 } PEER_EVENT_ENDPOINT_CHANGED_DATA, *PPEER_EVENT_ENDPOINT_CHANGED_DATA;
    137 
    138 typedef struct _PEER_EVENT_OBJECT_CHANGED_DATA {
    139   PPEER_CONTACT    pContact;
    140   PPEER_ENDPOINT   pEndpoint;
    141   PEER_CHANGE_TYPE changeType;
    142   PPEER_OBJECT     pObject;
    143 } PEER_EVENT_OBJECT_CHANGED_DATA, *PPEER_EVENT_OBJECT_CHANGED_DATA;
    144 
    145 typedef struct _PEER_EVENT_PEOPLE_NEAR_ME_CHANGED_DATA {
    146   PEER_CHANGE_TYPE     changeType;
    147   PPEER_PEOPLE_NEAR_ME pPeopleNearMe;
    148 } PEER_EVENT_PEOPLE_NEAR_ME_CHANGED_DATA, *PPEER_EVENT_PEOPLE_NEAR_ME_CHANGED_DATA;
    149 
    150 typedef struct _PEER_EVENT_PRESENCE_CHANGED_DATA {
    151   PPEER_CONTACT       pContact;
    152   PPEER_ENDPOINT      pEndpoint;
    153   PEER_CHANGE_TYPE    changeType;
    154   PPEER_PRESENCE_INFO pPresenceInfo;
    155 } PEER_EVENT_PRESENCE_CHANGED_DATA, *PPEER_EVENT_PRESENCE_CHANGED_DATA;
    156 
    157 typedef struct _PEER_EVENT_REQUEST_STATUS_CHANGED_DATA {
    158   PPEER_ENDPOINT pEndpoint;
    159   HRESULT        hrChange;
    160 } PEER_EVENT_REQUEST_STATUS_CHANGED_DATA, *PPEER_EVENT_REQUEST_STATUS_CHANGED_DATA;
    161 
    162 typedef struct _PEER_EVENT_WATCHLIST_CHANGED_DATA {
    163   PPEER_CONTACT    pContact;
    164   PEER_CHANGE_TYPE changeType;
    165 } PEER_EVENT_WATCHLIST_CHANGED_DATA, *PPEER_EVENT_WATCHLIST_CHANGED_DATA;
    166 
    167 typedef struct _PEER_INVITATION {
    168   GUID      applicationId;
    169   PEER_DATA applicationData;
    170   PWSTR     pwzMessage;
    171 } PEER_INVITATION, *PPEER_INVITATION;
    172 typedef const PEER_INVITATION *PCPEER_INVITATION;
    173 
    174 typedef union _PEER_COLLAB_EVENT_DATA {
    175   PEER_COLLAB_EVENT_TYPE eventType;
    176   __C89_NAMELESS union {
    177     PEER_EVENT_WATCHLIST_CHANGED_DATA watchlistChangedData;
    178     PEER_EVENT_PRESENCE_CHANGED_DATA presenceChangedData;
    179     PEER_EVENT_APPLICATION_CHANGED_DATA applicationChangedData;
    180     PEER_EVENT_OBJECT_CHANGED_DATA objectChangedData;
    181     PEER_EVENT_ENDPOINT_CHANGED_DATA endpointChangedData;
    182     PEER_EVENT_PEOPLE_NEAR_ME_CHANGED_DATA peopleNearMeChangedData;
    183     PEER_EVENT_REQUEST_STATUS_CHANGED_DATA requestStatusChangedData;
    184   } DUMMYUNIONNAME;
    185 } PEER_COLLAB_EVENT_DATA, *PPEER_COLLAB_EVENT_DATA;
    186 
    187 typedef struct _PEER_COLLAB_EVENT_REGISTRATION{
    188   PEER_COLLAB_EVENT_TYPE eventType;
    189   GUID *                 pInstance;
    190 } PEER_COLLAB_EVENT_REGISTRATION, *PPEER_COLLAB_EVENT_REGISTRATION;
    191 typedef const PEER_COLLAB_EVENT_REGISTRATION *PCPEER_COLLAB_EVENT_REGISTRATION;
    192 
    193 typedef struct {
    194   PEER_INVITATION_RESPONSE_TYPE action;
    195   PWSTR                         pwzMessage;
    196   HRESULT                       hrExtendedInfo;
    197 } PEER_INVITATION_RESPONSE, *PPEER_INVITATION_RESPONSE;
    198 typedef const PEER_INVITATION_RESPONSE *PCPEER_INVITATION_RESPONSE;
    199 
    200 typedef struct _PEER_CONTACT {
    201   PWSTR                 pwzPeerName;
    202   PWSTR                 pwzNickName;
    203   PWSTR                 pwzDisplayName;
    204   PWSTR                 pwzEmailAddress;
    205   WINBOOL              fWatch;
    206   PEER_WATCH_PERMISSION WatcherPermissions;
    207   PEER_DATA             credentials;
    208 } PEER_CONTACT, *PPEER_CONTACT;
    209 typedef const PEER_CONTACT *PCPEER_CONTACT;
    210 
    211 typedef struct _PEER_ENDPOINT {
    212   PEER_ADDRESS address;
    213   PWSTR        pwzEndpointName;
    214 } PEER_ENDPOINT, *PPEER_ENDPOINT;
    215 typedef const PEER_ENDPOINT *PCPEER_ENDPOINT;
    216 
    217 typedef struct _PEER_OBJECT {
    218   GUID      id;
    219   PEER_DATA data;
    220   DWORD     dwPublicationScope;
    221 } PEER_OBJECT, *PPEER_OBJECT;
    222 typedef const PEER_OBJECT *PCPEER_OBJECT;
    223 
    224 typedef struct _PEER_PEOPLE_NEAR_ME {
    225   PWSTR         pwzNickName;
    226   PEER_ENDPOINT endpoint;
    227   GUID          id;
    228 } PEER_PEOPLE_NEAR_ME, *PPEER_PEOPLE_NEAR_ME, *PCPEER_PEOPLE_NEAR_ME, **PPPEER_PEOPLE_NEAR_ME;
    229 
    230 typedef struct _PEER_PRESENCE_INFO {
    231   PEER_PRESENCE_STATUS status;
    232   PWSTR                pwzDescriptiveText;
    233 } PEER_PRESENCE_INFO, *PPEER_PRESENCE_INFO;
    234 typedef const PEER_PRESENCE_INFO *PCPEER_PRESENCE_INFO;
    235 
    236 HRESULT WINAPI PeerCollabAddContact(
    237   PCWSTR pwzContactData,
    238   PPEER_CONTACT *ppContact
    239 );
    240 
    241 HRESULT WINAPI PeerCollabAsyncInviteContact(
    242   PCPEER_CONTACT pcContact,
    243   PPEER_ENDPOINT pcEndpoint,
    244   PCPEER_INVITATION pcInvitation,
    245   HANDLE hEvent,
    246   HANDLE *phInvitation
    247 );
    248 
    249 HRESULT WINAPI PeerCollabAsyncInviteEndpoint(
    250   PPEER_ENDPOINT pcEndpoint,
    251   PCPEER_INVITATION pcInvitation,
    252   HANDLE hEvent,
    253   HANDLE *phInvitation
    254 );
    255 
    256 HRESULT WINAPI PeerCollabCancelInvitation(
    257   HANDLE hInvitation
    258 );
    259 
    260 HRESULT WINAPI PeerCollabCloseHandle(
    261   HANDLE handle
    262 );
    263 
    264 HRESULT WINAPI PeerCollabDeleteContact(
    265   PCWSTR pwzPeerName
    266 );
    267 
    268 HRESULT WINAPI PeerCollabDeleteEndpointData(
    269   PCPEER_ENDPOINT pcEndpoint
    270 );
    271 
    272 HRESULT WINAPI PeerCollabDeleteObject(
    273   const GUID *pObjectId
    274 );
    275 
    276 HRESULT WINAPI PeerCollabEnumApplicationRegistrationInfo(
    277   PEER_APPLICATION_REGISTRATION_TYPE registrationType,
    278   HPEERENUM *phPeerEnum
    279 );
    280 
    281 HRESULT WINAPI PeerCollabEnumApplications(
    282   PCPEER_ENDPOINT pcEndpoint,
    283   const GUID *pApplicationId,
    284   HPEERENUM *phPeerEnum
    285 );
    286 
    287 HRESULT WINAPI PeerCollabEnumContacts(
    288   HPEERENUM *phPeerEnum
    289 );
    290 
    291 HRESULT WINAPI PeerCollabEnumEndpoints(
    292   PCPEER_CONTACT pcContact,
    293   HPEERENUM *phPeerEnum
    294 );
    295 
    296 HRESULT  WINAPI PeerCollabEnumObjects(
    297   PCPEER_ENDPOINT pcEndpoint,
    298   const GUID *pObjectId,
    299   HPEERENUM *phPeerEnum
    300 );
    301 
    302 HRESULT WINAPI PeerCollabEnumPeopleNearMe(
    303   HPEERENUM *phPeerEnum
    304 );
    305 
    306 HRESULT WINAPI PeerCollabExportContact(
    307   PWSTR pwzPeerName,
    308   PWSTR *ppwzContactData
    309 );
    310 
    311 HRESULT  WINAPI PeerCollabGetAppLaunchInfo(
    312   PPEER_APP_LAUNCH_INFO *ppLaunchInfo
    313 );
    314 
    315 HRESULT WINAPI PeerCollabGetApplicationRegistrationInfo(
    316   const GUID *pApplicationId,
    317   PEER_APPLICATION_REGISTRATION_TYPE registrationType,
    318   PPEER_APPLICATION_REGISTRATION_INFO *ppRegInfo
    319 );
    320 
    321 HRESULT WINAPI PeerCollabGetContact(
    322   PWSTR pwzPeerName,
    323   PCPEER_CONTACT *ppContact
    324 );
    325 
    326 HRESULT WINAPI PeerCollabGetEndpointName(
    327   PWSTR *ppwzEndpointName
    328 );
    329 
    330 HRESULT WINAPI PeerCollabGetEventData(
    331   HPEEREVENT hPeerEvent,
    332   PPEER_COLLAB_EVENT_DATA *ppEventData
    333 );
    334 
    335 HRESULT  WINAPI PeerCollabGetInvitationResponse(
    336   HANDLE hInvitation,
    337   PPEER_INVITATION_RESPONSE *ppInvitationResponse
    338 );
    339 
    340 HRESULT WINAPI PeerCollabGetPresenceInfo(
    341   PCPEER_ENDPOINT pEndpoint,
    342   PPEER_PRESENCE_INFO *ppPresenceInfo
    343 );
    344 
    345 HRESULT  WINAPI PeerCollabGetSigninOptions(
    346   DWORD *dwSigninOptions
    347 );
    348 
    349 HRESULT WINAPI PeerCollabInviteContact(
    350   PCPEER_CONTACT pcContact,
    351   PCPEER_ENDPOINT pcEndpoint,
    352   const PCPEER_INVITATION pcInvitation,
    353   PPEER_INVITATION_RESPONSE *ppResponse
    354 );
    355 
    356 HRESULT  WINAPI PeerCollabInviteEndpoint(
    357   PCPEER_ENDPOINT pcEndpoint,
    358   PCPEER_INVITATION pcInvitation,
    359   PPEER_INVITATION_RESPONSE *ppResponse
    360 );
    361 
    362 HRESULT WINAPI PeerCollabParseContact(
    363   PWSTR pwzContactData,
    364   PCPEER_CONTACT *ppContact
    365 );
    366 
    367 HRESULT WINAPI PeerCollabQueryContactData(
    368   PCPEER_ENDPOINT pcEndpoint,
    369   PWSTR *ppwzContactData
    370 );
    371 
    372 HRESULT WINAPI PeerCollabRefreshEndpointData(
    373   PCPEER_ENDPOINT pcEndpoint
    374 );
    375 
    376 HRESULT  WINAPI PeerCollabRegisterApplication(
    377   PCPEER_APPLICATION_REGISTRATION_INFO pcApplication,
    378   PEER_APPLICATION_REGISTRATION_FLAGS registrationType
    379 );
    380 
    381 HRESULT  WINAPI PeerCollabRegisterEvent(
    382   HANDLE hEvent,
    383   DWORD cEventRegistration,
    384   PPEER_COLLAB_EVENT_REGISTRATION pEventRegistrations,
    385   HPEEREVENT *phPeerEvent
    386 );
    387 
    388 HRESULT WINAPI PeerCollabSetEndpointName(
    389   PCWSTR pwzEndpointName
    390 );
    391 
    392 HRESULT  WINAPI PeerCollabSetObject(
    393   PCPEER_OBJECT pcObject
    394 );
    395 
    396 HRESULT WINAPI PeerCollabSetPresenceInfo(
    397   PCPEER_PRESENCE_INFO pcPresenceInfo
    398 );
    399 
    400 HRESULT WINAPI PeerCollabShutdown(void);
    401 
    402 HRESULT  WINAPI PeerCollabSignin(
    403   HWND hwndParent,
    404   DWORD dwSigninOptions
    405 );
    406 
    407 HRESULT  WINAPI PeerCollabSignout(
    408   DWORD dwSignoutOptions
    409 );
    410 
    411 HRESULT  WINAPI PeerCollabStartup(
    412   WORD wVersionRequested
    413 );
    414 
    415 HRESULT WINAPI PeerCollabSubscribeEndpointData(
    416   PCPEER_ENDPOINT pcEndpoint
    417 );
    418 
    419 HRESULT  WINAPI PeerCollabUnregisterApplication(
    420   const GUID *pApplicationID,
    421   PEER_APPLICATION_REGISTRATION_FLAGS registrationType
    422 );
    423 
    424 HRESULT  WINAPI PeerCollabUnregisterEvent(
    425   HPEEREVENT hPeerEvent
    426 );
    427 
    428 HRESULT WINAPI PeerCollabUnsubscribeEndpointData(
    429   PCPEER_ENDPOINT pcEndpoint
    430 );
    431 
    432 HRESULT  WINAPI PeerCollabUpdateContact(
    433   PCPEER_CONTACT pContact
    434 );
    435 
    436 #ifdef __cplusplus
    437 }
    438 #endif
    439 #endif /* (_WIN32_WINNT >= 0x0600) */
    440 #endif /*_INC_P2P*/
    441