Authors: Martin Fuchs <martin-fuchs@gmx.net>, Ge van Geldorp <ge@gse.nl>
[wine] / dlls / wsock32 / service.c
1 /*
2  * WSOCK32 specific functions
3  *
4  * Copyright (C) 2002 Andrew Hughes
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
21 #include "config.h"
22
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "winsock2.h"
29 #include "wtypes.h"
30 #include "nspapi.h"
31
32 #include "wine/debug.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(winsock);
35
36 /******************************************************************************
37  *          GetTypeByNameA     [WSOCK32.1113]
38  *
39  * Retrieve a service type GUID for a network service specified by name.
40  *
41  * PARAMETERS
42  *      lpServiceName [I] NUL-terminated ASCII string that uniquely represents the name of the service
43  *      lpServiceType [O] Destination for the service type GUID
44  *
45  * RETURNS
46  *      Success: 0. lpServiceType contains the requested GUID
47  *      Failure: SOCKET_ERROR. GetLastError() can return ERROR_SERVICE_DOES_NOT_EXIST
48  *
49  * NOTES
50  *      Obsolete Microsoft-specific extension to Winsock 1.1.
51  *      Protocol-independent name resolution provides equivalent functionality in Winsock 2.
52  *
53  * BUGS
54  *      Unimplemented
55  */
56 INT WINAPI GetTypeByNameA(LPSTR lpServiceName, LPGUID lpServiceType)
57 {
58    /* tell the user they've got a substandard implementation */
59    FIXME("wsock32: GetTypeByNameA(%p, %p): stub/n", lpServiceName, lpServiceType);
60    
61    /* some programs may be able to compensate if they know what happened */
62    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
63    return SOCKET_ERROR; /* error value */
64 }
65
66
67 /******************************************************************************
68  *          GetTypeByNameW     [WSOCK32.1114]
69  *
70  * See GetTypeByNameA.
71  */
72 INT WINAPI GetTypeByNameW(LPWSTR lpServiceName, LPGUID lpServiceType)
73 {
74     /* tell the user they've got a substandard implementation */
75     FIXME("wsock32: GetTypeByNameW(%p, %p): stub/n", lpServiceName, lpServiceType);
76     
77     /* some programs may be able to compensate if they know what happened */
78     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
79     return SOCKET_ERROR; /* error value */
80 }
81
82 /******************************************************************************
83  *          SetServiceA     [WSOCK32.1117]
84  *
85  * Register or unregister a network service with one or more namespaces.
86  *
87  * PARAMETERS
88  *      dwNameSpace        [I] Name space or set of name spaces within which the function will operate
89  *      dwOperation        [I] Operation to perform
90  *      dwFlags            [I] Flags to modify the function's operation
91  *      lpServiceInfo      [I] Pointer to a ASCII SERVICE_INFO structure
92  *      lpServiceAsyncInfo [I] Reserved for future use.  Must be NULL.
93  *      lpdwStatusFlags    [O] Destination for function status information
94  *
95  * RETURNS
96  *      Success: 0.
97  *      Failure: SOCKET_ERROR. GetLastError() can return ERROR_ALREADY_REGISTERED
98  *
99  * NOTES
100  *      Obsolete Microsoft-specific extension to Winsock 1.1,
101  *      Protocol-independent name resolution provides equivalent functionality in Winsock 2.
102  *
103  * BUGS
104  *      Unimplemented.
105  */
106 INT WINAPI SetServiceA(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOA lpServiceInfo,
107                        LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
108 {
109    /* tell the user they've got a substandard implementation */
110    FIXME("wsock32: SetServiceA(%lu, %lu, %lu, %p, %p, %p): stub/n", dwNameSpace, dwOperation, dwFlags,
111            lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
112     
113    /* some programs may be able to compensate if they know what happened */
114    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
115    return SOCKET_ERROR; /* error value */ 
116 }
117
118 /******************************************************************************
119  *          SetServiceW     [WSOCK32.1118]
120  *
121  * See SetServiceA.
122  */
123 INT WINAPI SetServiceW(DWORD dwNameSpace, DWORD dwOperation, DWORD dwFlags, LPSERVICE_INFOW lpServiceInfo,
124                        LPSERVICE_ASYNC_INFO lpServiceAsyncInfo, LPDWORD lpdwStatusFlags)
125 {
126    /* tell the user they've got a substandard implementation */
127    FIXME("wsock32: SetServiceW(%lu, %lu, %lu, %p, %p, %p): stub/n", dwNameSpace, dwOperation, dwFlags,
128            lpServiceInfo, lpServiceAsyncInfo, lpdwStatusFlags);
129     
130    /* some programs may be able to compensate if they know what happened */
131    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
132    return SOCKET_ERROR; /* error value */ 
133 }