service.c 8.69 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * WSOCK32 specific functions
 *
 * Copyright (C) 2002 Andrew Hughes
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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
19 20 21 22
 */

#include "config.h"

23 24 25
#include <stdarg.h>

#include "windef.h"
26 27 28 29 30 31 32 33 34 35
#include "winbase.h"
#include "winerror.h"
#include "winsock2.h"
#include "wtypes.h"
#include "nspapi.h"

#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(winsock);

36 37 38 39 40
INT WINAPI GetAddressByNameA(DWORD dwNameSpace, LPGUID lpServiceType, LPSTR lpServiceName,
    LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
    LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPSTR lpAliasBuffer,
    LPDWORD lpdwAliasBufferLength)
{
41
    FIXME("(0x%08x, %s, %s, %p, 0x%08x, %p, %p, %p, %p, %p) stub\n", dwNameSpace,
42 43 44 45 46 47 48 49 50 51 52 53 54
          debugstr_guid(lpServiceType), debugstr_a(lpServiceName), lpiProtocols,
          dwResolution, lpServiceAsyncInfo, lpCsaddrBuffer, lpdwBufferLength,
          lpAliasBuffer, lpdwAliasBufferLength);
 
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return SOCKET_ERROR;
}

INT WINAPI GetAddressByNameW(DWORD dwNameSpace, LPGUID lpServiceType, LPWSTR lpServiceName,
    LPINT lpiProtocols, DWORD dwResolution, LPSERVICE_ASYNC_INFO lpServiceAsyncInfo,
    LPVOID lpCsaddrBuffer, LPDWORD lpdwBufferLength, LPWSTR lpAliasBuffer,
    LPDWORD lpdwAliasBufferLength)
{
55
    FIXME("(0x%08x, %s, %s, %p, 0x%08x, %p, %p, %p, %p, %p) stub\n", dwNameSpace,
56 57 58 59 60 61 62 63
          debugstr_guid(lpServiceType), debugstr_w(lpServiceName), lpiProtocols,
          dwResolution, lpServiceAsyncInfo, lpCsaddrBuffer, lpdwBufferLength,
          lpAliasBuffer, lpdwAliasBufferLength);

    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return SOCKET_ERROR;
}

64 65 66
/******************************************************************************
 *          GetTypeByNameA     [WSOCK32.1113]
 *
Jon Griffiths's avatar
Jon Griffiths committed
67
 * Retrieve a service type GUID for a network service specified by name.
68 69
 *
 * PARAMETERS
Jon Griffiths's avatar
Jon Griffiths committed
70 71
 *      lpServiceName [I] NUL-terminated ASCII string that uniquely represents the name of the service
 *      lpServiceType [O] Destination for the service type GUID
72 73
 *
 * RETURNS
Jon Griffiths's avatar
Jon Griffiths committed
74 75
 *      Success: 0. lpServiceType contains the requested GUID
 *      Failure: SOCKET_ERROR. GetLastError() can return ERROR_SERVICE_DOES_NOT_EXIST
76 77 78 79 80 81 82 83 84 85 86
 *
 * NOTES
 *      Obsolete Microsoft-specific extension to Winsock 1.1.
 *      Protocol-independent name resolution provides equivalent functionality in Winsock 2.
 *
 * BUGS
 *      Unimplemented
 */
INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType)
{
   /* tell the user they've got a substandard implementation */
87
   FIXME("wsock32: GetTypeByNameA(%p, %p): stub\n", lpServiceName, lpServiceType);
88 89 90 91 92 93 94 95 96 97
   
   /* some programs may be able to compensate if they know what happened */
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return SOCKET_ERROR; /* error value */
}


/******************************************************************************
 *          GetTypeByNameW     [WSOCK32.1114]
 *
Jon Griffiths's avatar
Jon Griffiths committed
98
 * See GetTypeByNameA.
99 100 101 102
 */
INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType)
{
    /* tell the user they've got a substandard implementation */
103
    FIXME("wsock32: GetTypeByNameW(%p, %p): stub\n", lpServiceName, lpServiceType);
104 105 106 107 108 109 110 111 112
    
    /* some programs may be able to compensate if they know what happened */
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return SOCKET_ERROR; /* error value */
}

/******************************************************************************
 *          SetServiceA     [WSOCK32.1117]
 *
Jon Griffiths's avatar
Jon Griffiths committed
113
 * Register or unregister a network service with one or more namespaces.
114 115
 *
 * PARAMETERS
Jon Griffiths's avatar
Jon Griffiths committed
116 117 118 119 120 121
 *      dwNameSpace        [I] Name space or set of name spaces within which the function will operate
 *      dwOperation        [I] Operation to perform
 *      dwFlags            [I] Flags to modify the function's operation
 *      lpServiceInfo      [I] Pointer to a ASCII SERVICE_INFO structure
 *      lpServiceAsyncInfo [I] Reserved for future use.  Must be NULL.
 *      lpdwStatusFlags    [O] Destination for function status information
122 123
 *
 * RETURNS
Jon Griffiths's avatar
Jon Griffiths committed
124 125
 *      Success: 0.
 *      Failure: SOCKET_ERROR. GetLastError() can return ERROR_ALREADY_REGISTERED
126 127
 *
 * NOTES
Jon Griffiths's avatar
Jon Griffiths committed
128
 *      Obsolete Microsoft-specific extension to Winsock 1.1,
129 130 131 132 133 134 135 136 137
 *      Protocol-independent name resolution provides equivalent functionality in Winsock 2.
 *
 * BUGS
 *      Unimplemented.
 */
INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
                       LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
{
   /* tell the user they've got a substandard implementation */
138
   FIXME("wsock32: SetServiceA(%u, %u, %u, %p, %p, %p): stub\n", dwNameSpace, dwOperation, dwFlags,
139 140 141 142 143 144 145 146 147 148
           lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
    
   /* some programs may be able to compensate if they know what happened */
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return SOCKET_ERROR; /* error value */ 
}

/******************************************************************************
 *          SetServiceW     [WSOCK32.1118]
 *
Jon Griffiths's avatar
Jon Griffiths committed
149
 * See SetServiceA.
150 151 152 153 154
 */
INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
                       LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
{
   /* tell the user they've got a substandard implementation */
155
   FIXME("wsock32: SetServiceW(%u, %u, %u, %p, %p, %p): stub\n", dwNameSpace, dwOperation, dwFlags,
156 157 158 159 160 161
           lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
    
   /* some programs may be able to compensate if they know what happened */
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return SOCKET_ERROR; /* error value */ 
}
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196

/******************************************************************************
 *          GetServiceA     [WSOCK32.1119]
 *
 * Get information about a network service.
 *
 * PARAMETERS
 *      dwNameSpace        [I] Name space or set of name spaces within which the function 
 *                             will operate.
 *      lpGuid             [I] Pointer to GUID of network service type.
 *      lpServiceName      [I] NUL-terminated ASCII string that uniquely represents the name 
 *                             of the service.
 *      dwProperties       [I] Flags specifying which information to return in lpBuffer.
 *      lpBuffer           [O] Pointer to buffer where the function returns an array
 *                             of NS_SERVICE_INFO.
 *      lpdwBufferSize     [I/O] Size of lpBuffer.  A greater number on output
 *                               indicates an error.
 *      lpServiceAsyncInfo [O] Reserved.  Set to NULL.
 *
 * RETURNS
 *      Success: 0.
 *      Failure: SOCKET_ERROR. GetLastError() returns ERROR_INSUFFICIENT_BUFFER
 *               or ERROR_SERVICE_NOT_FOUND.
 *
 * NOTES
 *      Obsolete Microsoft-specific extension to Winsock 1.1,
 *      Protocol-independent name resolution provides equivalent functionality in Winsock 2.
 *
 * BUGS
 *      Unimplemented.
 */
INT WINAPI GetServiceA(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
                       DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
                       LPSERVICE_ASYNC_INFO lpServiceAsyncInfo)
{
197
   FIXME("(%u, %p, %s, %u, %p, %p, %p): stub\n", dwNameSpace,
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
         lpGuid, lpServiceName, dwProperties, lpBuffer, lpdwBufferSize, lpServiceAsyncInfo);

   /* some programs may be able to compensate if they know what happened */
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return SOCKET_ERROR;
}

/******************************************************************************
 *          GetServiceW     [WSOCK32.1120]
 *
 * See GetServiceA.
 */
INT WINAPI GetServiceW(DWORD dwNameSpace, LPGUID lpGuid, LPSTR lpServiceName,
                       DWORD dwProperties, LPVOID lpBuffer, LPDWORD lpdwBufferSize,
                       LPSERVICE_ASYNC_INFO lpServiceAsyncInfo)
{
214
   FIXME("(%u, %p, %s, %u, %p, %p, %p): stub\n", dwNameSpace,
215 216 217 218 219 220
         lpGuid, lpServiceName, dwProperties, lpBuffer, lpdwBufferSize, lpServiceAsyncInfo);

   /* some programs may be able to compensate if they know what happened */
   SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
   return SOCKET_ERROR;
}