nspapi.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /* NSPAPI.H -- winsock 1.1
  2. * not supported on win95
  3. *
  4. * Copyright (C) 2001 Stefan Leichter
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef _WINE_NSPAPI_
  21. #define _WINE_NSPAPI_
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif /* defined(__cplusplus) */
  25. /*
  26. * constants
  27. */
  28. #define XP_CONNECTIONLESS 0x00000001
  29. #define XP_GUARANTEED_DELIVERY 0x00000002
  30. #define XP_GUARANTEED_ORDER 0x00000004
  31. #define XP_MESSAGE_ORIENTED 0x00000008
  32. #define XP_PSEUDO_STREAM 0x00000010
  33. #define XP_GRACEFUL_CLOSE 0x00000020
  34. #define XP_EXPEDITED_DATA 0x00000040
  35. #define XP_CONNECT_DATA 0x00000080
  36. #define XP_DISCONNECT_DATA 0x00000100
  37. #define XP_SUPPORTS_BROADCAST 0x00000200
  38. #define XP_SUPPORTS_MULTICAST 0x00000400
  39. #define XP_BANDWITH_ALLOCATION 0x00000800
  40. #define XP_FRAGMENTATION 0x00001000
  41. #define XP_ENCRYPTS 0x00002000
  42. /*
  43. * structures
  44. */
  45. typedef struct _PROTOCOL_INFOA
  46. {
  47. DWORD dwServiceFlags;
  48. INT iAddressFamily;
  49. INT iMaxSockAddr;
  50. INT iMinSockAddr;
  51. INT iSocketType;
  52. INT iProtocol;
  53. DWORD dwMessageSize;
  54. LPSTR lpProtocol;
  55. } PROTOCOL_INFOA, *PPROTOCOL_INFOA, *LPPROTOCOL_INFOA;
  56. typedef struct _PROTOCOL_INFOW
  57. {
  58. DWORD dwServiceFlags;
  59. INT iAddressFamily;
  60. INT iMaxSockAddr;
  61. INT iMinSockAddr;
  62. INT iSocketType;
  63. INT iProtocol;
  64. DWORD dwMessageSize;
  65. LPWSTR lpProtocol;
  66. } PROTOCOL_INFOW, *PPROTOCOL_INFOW, *LPPROTOCOL_INFOW;
  67. DECL_WINELIB_TYPE_AW(PROTOCOL_INFO)
  68. DECL_WINELIB_TYPE_AW(PPROTOCOL_INFO)
  69. DECL_WINELIB_TYPE_AW(LPPROTOCOL_INFO)
  70. typedef struct _SERVICE_ADDRESS
  71. {
  72. DWORD dwAddressType;
  73. DWORD dwAddressFlags;
  74. DWORD dwAddressLength;
  75. DWORD dwPrincipalLength;
  76. BYTE* lpAddress;
  77. BYTE* lpPrincipal;
  78. } SERVICE_ADDRESS, *PSERVICE_ADDRESS, *LPSERVICE_ADDRESS;
  79. typedef struct _SERVICE_ADDRESSES
  80. {
  81. DWORD dwAddressCount;
  82. SERVICE_ADDRESS Addresses[1];
  83. } SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES;
  84. typedef struct _SERVICE_INFOA
  85. {
  86. LPGUID lpServiceType;
  87. LPSTR lpServiceName;
  88. LPSTR lpComment;
  89. LPSTR lpLocale;
  90. DWORD dwDisplayHint;
  91. DWORD dwVersion;
  92. DWORD dwTime;
  93. LPSTR lpMachineName;
  94. LPSERVICE_ADDRESSES lpServiceAddress;
  95. BLOB ServiceSpecificInfo;
  96. } SERVICE_INFOA, *PSERVICE_INFOA, *LPSERVICE_INFOA;
  97. typedef struct _SERVICE_INFOW
  98. {
  99. LPGUID lpServiceType;
  100. LPWSTR lpServiceName;
  101. LPWSTR lpComment;
  102. LPWSTR lpLocale;
  103. DWORD dwDisplayHint;
  104. DWORD dwVersion;
  105. DWORD dwTime;
  106. LPSTR lpMachineName;
  107. LPSERVICE_ADDRESSES lpServiceAddress;
  108. BLOB ServiceSpecificInfo; /* May point to SERVICE_TYPE_INFO_ABS */
  109. } SERVICE_INFOW, *PSERVICE_INFOW, *LPSERVICE_INFOW;
  110. DECL_WINELIB_TYPE_AW(SERVICE_INFO)
  111. DECL_WINELIB_TYPE_AW(PSERVICE_INFO)
  112. DECL_WINELIB_TYPE_AW(LPSERVICE_INFO)
  113. typedef struct _SERVICE_TYPE_VALUE_ABSA
  114. {
  115. DWORD dwNameSpace; /* Name space or set of name spaces */
  116. DWORD dwValueType; /* Type of the value data */
  117. DWORD dwValueSize; /* Size of the value data */
  118. LPSTR lpValueName; /* Name of the value */
  119. PVOID lpValue; /* Pointer to the value data */
  120. } SERVICE_TYPE_VALUE_ABSA, *PSERVICE_TYPE_VALUE_ABSA, *LPSERVICE_TYPE_VALUE_ABSA;
  121. typedef struct _SERVICE_TYPE_VALUE_ABSW
  122. {
  123. DWORD dwNameSpace; /* Name space or set of name spaces */
  124. DWORD dwValueType; /* Type of the value data */
  125. DWORD dwValueSize; /* Size of the value data */
  126. LPWSTR lpValueName; /* Name of the value */
  127. PVOID lpValue; /* Pointer to the value data */
  128. } SERVICE_TYPE_VALUE_ABSW, *PSERVICE_TYPE_VALUE_ABSW, *LPSERVICE_TYPE_VALUE_ABSW;
  129. DECL_WINELIB_TYPE_AW(SERVICE_TYPE_VALUE_ABS)
  130. DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_VALUE_ABS)
  131. DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_VALUE_ABS)
  132. typedef struct _SERVICE_TYPE_INFO_ABSA
  133. {
  134. LPSTR lpTypeName; /* Name of the network service type */
  135. DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
  136. SERVICE_TYPE_VALUE_ABSA Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
  137. } SERVICE_TYPE_INFO_ABSA, *PSERVICE_TYPE_INFO_ABSA, *LPSERVICE_TYPE_INFO_ABSA;
  138. typedef struct _SERVICE_TYPE_INFO_ABSW
  139. {
  140. LPWSTR lpTypeName; /* Name of the network service type */
  141. DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
  142. SERVICE_TYPE_VALUE_ABSW Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
  143. } SERVICE_TYPE_INFO_ABSW, *PSERVICE_TYPE_INFO_ABSW, *LPSERVICE_TYPE_INFO_ABSW;
  144. DECL_WINELIB_TYPE_AW(SERVICE_TYPE_INFO_ABS)
  145. DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_INFO_ABS)
  146. DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_INFO_ABS)
  147. typedef void (*LPSERVICE_CALLBACK_PROC)(LPARAM lParam, HANDLE hAsyncTaskHandle);
  148. typedef struct _SERVICE_ASYNC_INFO
  149. {
  150. LPSERVICE_CALLBACK_PROC lpServiceCallbackProc;
  151. LPARAM lParam;
  152. HANDLE hAsyncTaskHandle;
  153. } SERVICE_ASYNC_INFO, *PSERVICE_ASYNC_INFO, *LPSERVICE_ASYNC_INFO;
  154. /*
  155. * function prototypes
  156. */
  157. INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType);
  158. INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType);
  159. #define GetTypeByName WINELIB_NAME_AW(GetTypeByName)
  160. INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
  161. LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
  162. INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
  163. LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
  164. #define SetService WINELIB_NAME_AW(SetService)
  165. #ifdef __cplusplus
  166. } /* extern "C" */
  167. #endif /* defined(__cplusplus) */
  168. #endif /* _WINE_NSPAPI_ */