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
:
36 DisableThreadLibraryCalls(hinstDLL
);
40 case DLL_PROCESS_DETACH
:
41 if (lpvReserved
) break;
49 /************************************************************
50 * NetServerEnum (NETAPI32.@)
52 NET_API_STATUS WINAPI
NetServerEnum(
64 FIXME("Stub (%s %d %p %d %p %p %d %s %p)\n", debugstr_w(servername
),
65 level
, bufptr
, prefmaxlen
, entriesread
, totalentries
, servertype
,
66 debugstr_w(domain
), resume_handle
);
68 return ERROR_NO_BROWSER_SERVERS_FOUND
;
71 /************************************************************
72 * NetServerEnumEx (NETAPI32.@)
74 NET_API_STATUS WINAPI
NetServerEnumEx(
83 LMCSTR FirstNameToReturn
)
85 FIXME("Stub (%s %d %p %d %p %p %d %s %s)\n",
86 debugstr_w(ServerName
), Level
, Bufptr
, PrefMaxlen
, EntriesRead
, totalentries
,
87 servertype
, debugstr_w(domain
), debugstr_w(FirstNameToReturn
));
89 return ERROR_NO_BROWSER_SERVERS_FOUND
;
92 /************************************************************
93 * NetServerDiskEnum (NETAPI32.@)
95 NET_API_STATUS WINAPI
NetServerDiskEnum(
101 LPDWORD totalentries
,
102 LPDWORD Resume_Handle
)
104 FIXME("Stub (%s %d %p %d %p %p %p)\n", debugstr_w(ServerName
),
105 Level
, Bufptr
, PrefMaxlen
, EntriesRead
, totalentries
, Resume_Handle
);
107 return ERROR_NO_BROWSER_SERVERS_FOUND
;
110 /************************************************************
111 * NetServerGetInfo (NETAPI32.@)
113 NET_API_STATUS WINAPI
NetServerGetInfo(LMSTR servername
, DWORD level
, LPBYTE
* bufptr
)
117 TRACE("%s %d %p\n", debugstr_w( servername
), level
, bufptr
);
120 if (!NETAPI_IsLocalComputer(servername
))
122 FIXME("remote computers not supported\n");
123 return ERROR_INVALID_LEVEL
;
126 if (!bufptr
) return ERROR_INVALID_PARAMETER
;
133 DWORD computerNameLen
, size
;
134 WCHAR computerName
[MAX_COMPUTERNAME_LENGTH
+ 1];
136 computerNameLen
= MAX_COMPUTERNAME_LENGTH
+ 1;
137 GetComputerNameW(computerName
, &computerNameLen
);
138 computerNameLen
++; /* include NULL terminator */
140 size
= sizeof(SERVER_INFO_101
) + computerNameLen
* sizeof(WCHAR
);
141 ret
= NetApiBufferAllocate(size
, (LPVOID
*)bufptr
);
142 if (ret
== NERR_Success
)
144 /* INFO_100 structure is a subset of INFO_101 */
145 PSERVER_INFO_101 info
= (PSERVER_INFO_101
)*bufptr
;
146 OSVERSIONINFOW verInfo
;
148 info
->sv101_platform_id
= PLATFORM_ID_NT
;
149 info
->sv101_name
= (LMSTR
)(*bufptr
+ sizeof(SERVER_INFO_101
));
150 memcpy(info
->sv101_name
, computerName
,
151 computerNameLen
* sizeof(WCHAR
));
152 verInfo
.dwOSVersionInfoSize
= sizeof(verInfo
);
153 GetVersionExW(&verInfo
);
154 info
->sv101_version_major
= verInfo
.dwMajorVersion
;
155 info
->sv101_version_minor
= verInfo
.dwMinorVersion
;
156 /* Use generic type as no wine equivalent of DC / Server */
157 info
->sv101_type
= SV_TYPE_NT
;
158 info
->sv101_comment
= NULL
;
164 FIXME("level %d unimplemented\n", level
);
165 ret
= ERROR_INVALID_LEVEL
;
171 /************************************************************
172 * NetStatisticsGet (NETAPI32.@)
174 NET_API_STATUS WINAPI
NetStatisticsGet(LMSTR server
, LMSTR service
,
175 DWORD level
, DWORD options
,
178 TRACE("(%p, %p, %d, %d, %p)\n", server
, service
, level
, options
, bufptr
);
179 return NERR_InternalError
;
182 DWORD WINAPI
NetpNetBiosStatusToApiStatus(DWORD nrc
)
192 ret
= NERR_NoNetworkResource
;
195 ret
= NERR_AlreadyExists
;
198 ret
= NERR_TooManyNames
;
201 ret
= NERR_DeleteLater
;
204 ret
= ERROR_REM_NOT_LIST
;
207 ret
= NERR_NameNotFound
;
210 ret
= ERROR_INVALID_PARAMETER
;
213 ret
= NERR_DuplicateName
;
216 ret
= ERROR_INVALID_PARAMETER
;
219 ret
= NERR_DuplicateName
;
222 ret
= NERR_NetworkError
;
227 NET_API_STATUS WINAPI
NetUseEnum(LMSTR server
, DWORD level
, LPBYTE
* bufptr
, DWORD prefmaxsize
,
228 LPDWORD entriesread
, LPDWORD totalentries
, LPDWORD resumehandle
)
230 FIXME("stub (%p, %d, %p, %d, %p, %p, %p)\n", server
, level
, bufptr
, prefmaxsize
,
231 entriesread
, totalentries
, resumehandle
);
232 return ERROR_NOT_SUPPORTED
;
235 NET_API_STATUS WINAPI
NetScheduleJobAdd(LPCWSTR server
, LPBYTE bufptr
, LPDWORD jobid
)
237 FIXME("stub (%s, %p, %p)\n", debugstr_w(server
), bufptr
, jobid
);
241 NET_API_STATUS WINAPI
NetScheduleJobEnum(LPCWSTR server
, LPBYTE
* bufptr
, DWORD prefmaxsize
, LPDWORD entriesread
,
242 LPDWORD totalentries
, LPDWORD resumehandle
)
244 FIXME("stub (%s, %p, %d, %p, %p, %p)\n", debugstr_w(server
), bufptr
, prefmaxsize
, entriesread
, totalentries
, resumehandle
);
250 NET_API_STATUS WINAPI
NetUseGetInfo(LMSTR server
, LMSTR name
, DWORD level
, LPBYTE
*bufptr
)
252 FIXME("stub (%p, %p, %d, %p)\n", server
, name
, level
, bufptr
);
253 return ERROR_NOT_SUPPORTED
;