mstask: Use wide-char string literals.
[wine.git] / dlls / wsock32 / service.c
blob2b6e4e7b58d7ddb9d84e7b0cf9c5836b69de2a3b
1 /*
2 * WSOCK32 specific functions
4 * Copyright (C) 2002 Andrew Hughes
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winerror.h"
26 #include "winsock2.h"
27 #include "wtypes.h"
28 #include "nspapi.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(winsock);
34 INT WINAPI GetAddressByNameA(DWORD dwNameSpace, LPGUID lpServiceType, LPSTR lpServiceName,
35 LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
36 LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPSTR lpAliasBuffer,
37 LPDWORD lpdwAliasBufferLength)
39 FIXME("(0x%08x, %s, %s, %p, 0x%08x, %p, %p, %p, %p, %p) stub\n", dwNameSpace,
40 debugstr_guid(lpServiceType), debugstr_a(lpServiceName), lpiProtocols,
41 dwResolution, lpServiceAsyncInfo, lpCsaddrBuffer, lpdwBufferLength,
42 lpAliasBuffer, lpdwAliasBufferLength);
44 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
45 return SOCKET_ERROR;
48 INT WINAPI GetAddressByNameW(DWORD dwNameSpace, LPGUID lpServiceType, LPWSTR lpServiceName,
49 LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
50 LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPWSTR lpAliasBuffer,
51 LPDWORD lpdwAliasBufferLength)
53 FIXME("(0x%08x, %s, %s, %p, 0x%08x, %p, %p, %p, %p, %p) stub\n", dwNameSpace,
54 debugstr_guid(lpServiceType), debugstr_w(lpServiceName), lpiProtocols,
55 dwResolution, lpServiceAsyncInfo, lpCsaddrBuffer, lpdwBufferLength,
56 lpAliasBuffer, lpdwAliasBufferLength);
58 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
59 return SOCKET_ERROR;
62 /******************************************************************************
63 * GetTypeByNameA [WSOCK32.1113]
65 * Retrieve a service type GUID for a network service specified by name.
67 * PARAMETERS
68 * lpServiceName [I] NUL-terminated ASCII string that uniquely represents the name of the service
69 * lpServiceType [O] Destination for the service type GUID
71 * RETURNS
72 * Success: 0. lpServiceType contains the requested GUID
73 * Failure: SOCKET_ERROR. GetLastError() can return ERROR_SERVICE_DOES_NOT_EXIST
75 * NOTES
76 * Obsolete Microsoft-specific extension to Winsock 1.1.
77 * Protocol-independent name resolution provides equivalent functionality in Winsock 2.
79 * BUGS
80 * Unimplemented
82 INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType)
84 /* tell the user they've got a substandard implementation */
85 FIXME("wsock32: GetTypeByNameA(%p, %p): stub\n", lpServiceName, lpServiceType);
87 /* some programs may be able to compensate if they know what happened */
88 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
89 return SOCKET_ERROR; /* error value */
93 /******************************************************************************
94 * GetTypeByNameW [WSOCK32.1114]
96 * See GetTypeByNameA.
98 INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType)
100 /* tell the user they've got a substandard implementation */
101 FIXME("wsock32: GetTypeByNameW(%p, %p): stub\n", lpServiceName, lpServiceType);
103 /* some programs may be able to compensate if they know what happened */
104 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
105 return SOCKET_ERROR; /* error value */
108 /******************************************************************************
109 * SetServiceA [WSOCK32.1117]
111 * Register or unregister a network service with one or more namespaces.
113 * PARAMETERS
114 * dwNameSpace [I] Name space or set of name spaces within which the function will operate
115 * dwOperation [I] Operation to perform
116 * dwFlags [I] Flags to modify the function's operation
117 * lpServiceInfo [I] Pointer to a ASCII SERVICE_INFO structure
118 * lpServiceAsyncInfo [I] Reserved for future use. Must be NULL.
119 * lpdwStatusFlags [O] Destination for function status information
121 * RETURNS
122 * Success: 0.
123 * Failure: SOCKET_ERROR. GetLastError() can return ERROR_ALREADY_REGISTERED
125 * NOTES
126 * Obsolete Microsoft-specific extension to Winsock 1.1,
127 * Protocol-independent name resolution provides equivalent functionality in Winsock 2.
129 * BUGS
130 * Unimplemented.
132 INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
133 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
135 /* tell the user they've got a substandard implementation */
136 FIXME("wsock32: SetServiceA(%u, %u, %u, %p, %p, %p): stub\n", dwNameSpace, dwOperation, dwFlags,
137 lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
139 /* some programs may be able to compensate if they know what happened */
140 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
141 return SOCKET_ERROR; /* error value */
144 /******************************************************************************
145 * SetServiceW [WSOCK32.1118]
147 * See SetServiceA.
149 INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
150 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
152 /* tell the user they've got a substandard implementation */
153 FIXME("wsock32: SetServiceW(%u, %u, %u, %p, %p, %p): stub\n", dwNameSpace, dwOperation, dwFlags,
154 lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
156 /* some programs may be able to compensate if they know what happened */
157 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
158 return SOCKET_ERROR; /* error value */
161 /******************************************************************************
162 * GetServiceA [WSOCK32.1119]
164 * Get information about a network service.
166 * PARAMETERS
167 * dwNameSpace [I] Name space or set of name spaces within which the function
168 * will operate.
169 * lpGuid [I] Pointer to GUID of network service type.
170 * lpServiceName [I] NUL-terminated ASCII string that uniquely represents the name
171 * of the service.
172 * dwProperties [I] Flags specifying which information to return in lpBuffer.
173 * lpBuffer [O] Pointer to buffer where the function returns an array
174 * of NS_SERVICE_INFO.
175 * lpdwBufferSize [I/O] Size of lpBuffer. A greater number on output
176 * indicates an error.
177 * lpServiceAsyncInfo [O] Reserved. Set to NULL.
179 * RETURNS
180 * Success: 0.
181 * Failure: SOCKET_ERROR. GetLastError() returns ERROR_INSUFFICIENT_BUFFER
182 * or ERROR_SERVICE_NOT_FOUND.
184 * NOTES
185 * Obsolete Microsoft-specific extension to Winsock 1.1,
186 * Protocol-independent name resolution provides equivalent functionality in Winsock 2.
188 * BUGS
189 * Unimplemented.
191 INT WINAPI GetServiceA(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
192 DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
193 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo)
195 FIXME("(%u, %p, %s, %u, %p, %p, %p): stub\n", dwNameSpace,
196 lpGuid, lpServiceName, dwProperties, lpBuffer, lpdwBufferSize, lpServiceAsyncInfo);
198 /* some programs may be able to compensate if they know what happened */
199 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
200 return SOCKET_ERROR;
203 /******************************************************************************
204 * GetServiceW [WSOCK32.1120]
206 * See GetServiceA.
208 INT WINAPI GetServiceW(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
209 DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
210 LPSERVICE_ASYNC_INFO lpServiceAsyncInfo)
212 FIXME("(%u, %p, %s, %u, %p, %p, %p): stub\n", dwNameSpace,
213 lpGuid, lpServiceName, dwProperties, lpBuffer, lpdwBufferSize, lpServiceAsyncInfo);
215 /* some programs may be able to compensate if they know what happened */
216 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
217 return SOCKET_ERROR;