1 /* Copyright 2001 Mike McCormack
2 * Copyright 2003 Juan Lang
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(netbios);
28 BOOL NETAPI_IsLocalComputer(LMCSTR ServerName);
30 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
32 TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
35 case DLL_PROCESS_ATTACH:
37 DisableThreadLibraryCalls(hinstDLL);
42 case DLL_PROCESS_DETACH:
52 /************************************************************
53 * NetServerEnum (NETAPI32.@)
55 NET_API_STATUS WINAPI NetServerEnum(
67 FIXME("Stub (%s %d %p %d %p %p %d %s %p)\n", debugstr_w(servername),
68 level, bufptr, prefmaxlen, entriesread, totalentries, servertype,
69 debugstr_w(domain), resume_handle);
71 return ERROR_NO_BROWSER_SERVERS_FOUND;
74 /************************************************************
75 * NetServerEnumEx (NETAPI32.@)
77 NET_API_STATUS WINAPI NetServerEnumEx(
86 LMCSTR FirstNameToReturn)
88 FIXME("Stub (%s %d %p %d %p %p %d %s %s)\n",
89 debugstr_w(ServerName), Level, Bufptr, PrefMaxlen, EntriesRead, totalentries,
90 servertype, debugstr_w(domain), debugstr_w(FirstNameToReturn));
92 return ERROR_NO_BROWSER_SERVERS_FOUND;
95 /************************************************************
96 * NetServerDiskEnum (NETAPI32.@)
98 NET_API_STATUS WINAPI NetServerDiskEnum(
104 LPDWORD totalentries,
105 LPDWORD Resume_Handle)
107 FIXME("Stub (%s %d %p %d %p %p %p)\n", debugstr_w(ServerName),
108 Level, Bufptr, PrefMaxlen, EntriesRead, totalentries, Resume_Handle);
110 return ERROR_NO_BROWSER_SERVERS_FOUND;
113 /************************************************************
114 * NetServerGetInfo (NETAPI32.@)
116 NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bufptr)
120 TRACE("%s %d %p\n", debugstr_w( servername ), level, bufptr );
123 if (!NETAPI_IsLocalComputer(servername))
125 FIXME("remote computers not supported\n");
126 return ERROR_INVALID_LEVEL;
129 if (!bufptr) return ERROR_INVALID_PARAMETER;
136 DWORD computerNameLen, size;
137 WCHAR computerName[MAX_COMPUTERNAME_LENGTH + 1];
139 computerNameLen = MAX_COMPUTERNAME_LENGTH + 1;
140 GetComputerNameW(computerName, &computerNameLen);
141 computerNameLen++; /* include NULL terminator */
143 size = sizeof(SERVER_INFO_101) + computerNameLen * sizeof(WCHAR);
144 ret = NetApiBufferAllocate(size, (LPVOID *)bufptr);
145 if (ret == NERR_Success)
147 /* INFO_100 structure is a subset of INFO_101 */
148 PSERVER_INFO_101 info = (PSERVER_INFO_101)*bufptr;
149 OSVERSIONINFOW verInfo;
151 info->sv101_platform_id = PLATFORM_ID_NT;
152 info->sv101_name = (LMSTR)(*bufptr + sizeof(SERVER_INFO_101));
153 memcpy(info->sv101_name, computerName,
154 computerNameLen * sizeof(WCHAR));
155 verInfo.dwOSVersionInfoSize = sizeof(verInfo);
156 GetVersionExW(&verInfo);
157 info->sv101_version_major = verInfo.dwMajorVersion;
158 info->sv101_version_minor = verInfo.dwMinorVersion;
159 /* Use generic type as no wine equivalent of DC / Server */
160 info->sv101_type = SV_TYPE_NT;
161 info->sv101_comment = NULL;
167 FIXME("level %d unimplemented\n", level);
168 ret = ERROR_INVALID_LEVEL;
174 /************************************************************
175 * NetStatisticsGet (NETAPI32.@)
177 NET_API_STATUS WINAPI NetStatisticsGet(LMSTR server, LMSTR service,
178 DWORD level, DWORD options,
181 TRACE("(%p, %p, %d, %d, %p)\n", server, service, level, options, bufptr);
182 return NERR_InternalError;
185 DWORD WINAPI NetpNetBiosStatusToApiStatus(DWORD nrc)
195 ret = NERR_NoNetworkResource;
198 ret = NERR_AlreadyExists;
201 ret = NERR_TooManyNames;
204 ret = NERR_DeleteLater;
207 ret = ERROR_REM_NOT_LIST;
210 ret = NERR_NameNotFound;
213 ret = ERROR_INVALID_PARAMETER;
216 ret = NERR_DuplicateName;
219 ret = ERROR_INVALID_PARAMETER;
222 ret = NERR_DuplicateName;
225 ret = NERR_NetworkError;
230 NET_API_STATUS WINAPI NetUseEnum(LMSTR server, DWORD level, LPBYTE* bufptr, DWORD prefmaxsize,
231 LPDWORD entriesread, LPDWORD totalentries, LPDWORD resumehandle)
233 FIXME("stub (%p, %d, %p, %d, %p, %p, %p)\n", server, level, bufptr, prefmaxsize,
234 entriesread, totalentries, resumehandle);
235 return ERROR_NOT_SUPPORTED;
238 NET_API_STATUS WINAPI NetScheduleJobAdd(LPCWSTR server, LPBYTE bufptr, LPDWORD jobid)
240 FIXME("stub (%s, %p, %p)\n", debugstr_w(server), bufptr, jobid);
244 NET_API_STATUS WINAPI NetScheduleJobEnum(LPCWSTR server, LPBYTE* bufptr, DWORD prefmaxsize, LPDWORD entriesread,
245 LPDWORD totalentries, LPDWORD resumehandle)
247 FIXME("stub (%s, %p, %d, %p, %p, %p)\n", debugstr_w(server), bufptr, prefmaxsize, entriesread, totalentries, resumehandle);
253 NET_API_STATUS WINAPI NetUseGetInfo(LMSTR server, LMSTR name, DWORD level, LPBYTE *bufptr)
255 FIXME("stub (%p, %p, %d, %p)\n", server, name, level, bufptr);
256 return ERROR_NOT_SUPPORTED;