blob: 1dee49bd10dd666f19e858db010cdffde5ab3d6f [file] [log] [blame]
Stefan Leichter73db9002001-01-12 23:15:54 +00001/* NSPAPI.H -- winsock 1.1
2 * not supported on win95
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00003 *
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
Stefan Leichter73db9002001-01-12 23:15:54 +000019 */
20
21#ifndef _WINE_NSPAPI_
22#define _WINE_NSPAPI_
23
Stefan Leichter73db9002001-01-12 23:15:54 +000024#ifdef __cplusplus
25extern "C" {
26#endif /* defined(__cplusplus) */
27/*
28 * constants
29 */
30#define XP_CONNECTIONLESS 0x00000001
31#define XP_GUARANTEED_DELIVERY 0x00000002
32#define XP_GUARANTEED_ORDER 0x00000004
33#define XP_MESSAGE_ORIENTED 0x00000008
34#define XP_PSEUDO_STREAM 0x00000010
35#define XP_GRACEFUL_CLOSE 0x00000020
36#define XP_EXPEDITED_DATA 0x00000040
37#define XP_CONNECT_DATA 0x00000080
38#define XP_DISCONNECT_DATA 0x00000100
39#define XP_SUPPORTS_BROADCAST 0x00000200
40#define XP_SUPPORTS_MULTICAST 0x00000400
41#define XP_BANDWITH_ALLOCATION 0x00000800
42#define XP_FRAGMENTATION 0x00001000
43#define XP_ENCRYPTS 0x00002000
44
45/*
46 * structures
47 */
Vincent Béron9a624912002-05-31 23:06:46 +000048typedef struct _PROTOCOL_INFOA
Stefan Leichter73db9002001-01-12 23:15:54 +000049{
50 DWORD dwServiceFlags;
51 INT iAddressFamily;
52 INT iMaxSockAddr;
53 INT iMinSockAddr;
54 INT iSocketType;
55 INT iProtocol;
56 DWORD dwMessageSize;
57 LPSTR lpProtocol;
Andrew John Hughes1f7dbca2003-01-30 00:23:39 +000058} PROTOCOL_INFOA, *PPROTOCOL_INFOA, *LPPROTOCOL_INFOA;
Stefan Leichter73db9002001-01-12 23:15:54 +000059
Vincent Béron9a624912002-05-31 23:06:46 +000060typedef struct _PROTOCOL_INFOW
Stefan Leichter73db9002001-01-12 23:15:54 +000061{
62 DWORD dwServiceFlags;
63 INT iAddressFamily;
64 INT iMaxSockAddr;
65 INT iMinSockAddr;
66 INT iSocketType;
67 INT iProtocol;
68 DWORD dwMessageSize;
69 LPWSTR lpProtocol;
Andrew John Hughes1f7dbca2003-01-30 00:23:39 +000070} PROTOCOL_INFOW, *PPROTOCOL_INFOW, *LPPROTOCOL_INFOW;
Stefan Leichter73db9002001-01-12 23:15:54 +000071
Andrew John Hughes1f7dbca2003-01-30 00:23:39 +000072DECL_WINELIB_TYPE_AW(PROTOCOL_INFO)
73DECL_WINELIB_TYPE_AW(PPROTOCOL_INFO)
74DECL_WINELIB_TYPE_AW(LPPROTOCOL_INFO)
75
76typedef struct _SERVICE_ADDRESS
77{
78 DWORD dwAddressType;
79 DWORD dwAddressFlags;
80 DWORD dwAddressLength;
81 DWORD dwPrincipalLength;
82 BYTE* lpAddress;
83 BYTE* lpPrincipal;
84} SERVICE_ADDRESS, *PSERVICE_ADDRESS, *LPSERVICE_ADDRESS;
85
86typedef struct _SERVICE_ADDRESSES
87{
88 DWORD dwAddressCount;
89 SERVICE_ADDRESS Addresses[1];
90} SERVICE_ADDRESSES, *PSERVICE_ADDRESSES, *LPSERVICE_ADDRESSES;
91
92typedef struct _SERVICE_INFOA
93{
94 LPGUID lpServiceType;
95 LPSTR lpServiceName;
96 LPSTR lpComment;
97 LPSTR lpLocale;
98 DWORD dwDisplayHint;
99 DWORD dwVersion;
100 DWORD dwTime;
101 LPSTR lpMachineName;
102 LPSERVICE_ADDRESSES lpServiceAddress;
103 BLOB ServiceSpecificInfo;
104} SERVICE_INFOA, *PSERVICE_INFOA, *LPSERVICE_INFOA;
105
106typedef struct _SERVICE_INFOW
107{
108 LPGUID lpServiceType;
109 LPWSTR lpServiceName;
110 LPWSTR lpComment;
111 LPWSTR lpLocale;
112 DWORD dwDisplayHint;
113 DWORD dwVersion;
114 DWORD dwTime;
115 LPSTR lpMachineName;
116 LPSERVICE_ADDRESSES lpServiceAddress;
117 BLOB ServiceSpecificInfo; /* May point to SERVICE_TYPE_INFO_ABS */
118} SERVICE_INFOW, *PSERVICE_INFOW, *LPSERVICE_INFOW;
119
120DECL_WINELIB_TYPE_AW(SERVICE_INFO)
121DECL_WINELIB_TYPE_AW(PSERVICE_INFO)
122DECL_WINELIB_TYPE_AW(LPSERVICE_INFO)
123
124typedef struct _SERVICE_TYPE_VALUE_ABSA
125{
126 DWORD dwNameSpace; /* Name space or set of name spaces */
127 DWORD dwValueType; /* Type of the value data */
128 DWORD dwValueSize; /* Size of the value data */
129 LPSTR lpValueName; /* Name of the value */
130 PVOID lpValue; /* Pointer to the value data */
131} SERVICE_TYPE_VALUE_ABSA, *PSERVICE_TYPE_VALUE_ABSA, *LPSERVICE_TYPE_VALUE_ABSA;
132
133typedef struct _SERVICE_TYPE_VALUE_ABSW
134{
135 DWORD dwNameSpace; /* Name space or set of name spaces */
136 DWORD dwValueType; /* Type of the value data */
137 DWORD dwValueSize; /* Size of the value data */
138 LPWSTR lpValueName; /* Name of the value */
139 PVOID lpValue; /* Pointer to the value data */
140} SERVICE_TYPE_VALUE_ABSW, *PSERVICE_TYPE_VALUE_ABSW, *LPSERVICE_TYPE_VALUE_ABSW;
141
142DECL_WINELIB_TYPE_AW(SERVICE_TYPE_VALUE_ABS)
143DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_VALUE_ABS)
144DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_VALUE_ABS)
145
146typedef struct _SERVICE_TYPE_INFO_ABSA
147{
148 LPSTR lpTypeName; /* Name of the network service type */
149 DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
150 SERVICE_TYPE_VALUE_ABSA Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
151} SERVICE_TYPE_INFO_ABSA, *PSERVICE_TYPE_INFO_ABSA, *LPSERVICE_TYPE_INFO_ABSA;
152
153typedef struct _SERVICE_TYPE_INFO_ABSW
154{
155 LPWSTR lpTypeName; /* Name of the network service type */
156 DWORD dwValueCount; /* Number of SERVICE_TYPE_VALUE_ABS structures */
157 SERVICE_TYPE_VALUE_ABSW Values[1]; /* Array of SERVICE_TYPE_VALUE_ABS structures */
158} SERVICE_TYPE_INFO_ABSW, *PSERVICE_TYPE_INFO_ABSW, *LPSERVICE_TYPE_INFO_ABSW;
159
160DECL_WINELIB_TYPE_AW(SERVICE_TYPE_INFO_ABS)
161DECL_WINELIB_TYPE_AW(PSERVICE_TYPE_INFO_ABS)
162DECL_WINELIB_TYPE_AW(LPSERVICE_TYPE_INFO_ABS)
163
164typedef void (*LPSERVICE_CALLBACK_PROC)(LPARAM lParam, HANDLE hAsyncTaskHandle);
165
166typedef struct _SERVICE_ASYNC_INFO
167{
168 LPSERVICE_CALLBACK_PROC lpServiceCallbackProc;
169 LPARAM lParam;
170 HANDLE hAsyncTaskHandle;
171} SERVICE_ASYNC_INFO, *PSERVICE_ASYNC_INFO, *LPSERVICE_ASYNC_INFO;
Stefan Leichter73db9002001-01-12 23:15:54 +0000172
173/*
174 * function prototypes
175 */
Hans Leidekker38537942005-07-18 09:09:24 +0000176INT WINAPI GetAddressByNameA(DWORD dwNameSpace, LPGUID lpServiceType, LPSTR lpServiceName,
177 LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
178 LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPSTR lpAliasBuffer,
179 LPDWORD lpdwAliasBufferLength);
180INT WINAPI GetAddressByNameW(DWORD dwNameSpace, LPGUID lpServiceType, LPWSTR lpServiceName,
181 LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
182 LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPWSTR lpAliasBuffer,
183 LPDWORD lpdwAliasBufferLength);
184#define GetAddressByName WINELIB_NAME_AW(GetAddressByName)
Andrew John Hughes1f7dbca2003-01-30 00:23:39 +0000185INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType);
186INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType);
187#define GetTypeByName WINELIB_NAME_AW(GetTypeByName)
188INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
189 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
190INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
191 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags);
192#define SetService WINELIB_NAME_AW(SetService)
Stefan Leichter73db9002001-01-12 23:15:54 +0000193
194#ifdef __cplusplus
195} /* extern "C" */
196#endif /* defined(__cplusplus) */
197
198#endif /* _WINE_NSPAPI_ */