Implement NetpNetbiosStatusToApiStatus.
[wine/multimedia.git] / dlls / netapi32 / netapi32.c
blob900815c2d6f943ff55d82ba3efc263a92168ebce
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "config.h"
21 #include "wine/debug.h"
22 #include "netbios.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(netbios);
26 HMODULE NETAPI32_hModule = 0;
28 BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
30 TRACE("%p,%lx,%p\n", hinstDLL, fdwReason, lpvReserved);
32 switch (fdwReason) {
33 case DLL_PROCESS_ATTACH:
35 DisableThreadLibraryCalls(hinstDLL);
36 NETAPI32_hModule = hinstDLL;
37 NetBIOSInit();
38 NetBTInit();
39 break;
41 case DLL_PROCESS_DETACH:
43 NetBIOSShutdown();
44 break;
48 return TRUE;
51 NET_API_STATUS WINAPI NetServerEnum(
52 LPCWSTR servername,
53 DWORD level,
54 LPBYTE* bufptr,
55 DWORD prefmaxlen,
56 LPDWORD entriesread,
57 LPDWORD totalentries,
58 DWORD servertype,
59 LPCWSTR domain,
60 LPDWORD resume_handle
63 FIXME("Stub (%p, %ld %p %ld %p %p %ld %s %p)\n",servername, level, bufptr,
64 prefmaxlen, entriesread, totalentries, servertype, debugstr_w(domain), resume_handle);
66 return ERROR_NO_BROWSER_SERVERS_FOUND;
70 /************************************************************
71 * NetStatisticsGet (NETAPI32.@)
73 NET_API_STATUS WINAPI NetStatisticsGet(LPWSTR server, LPWSTR service,
74 DWORD level, DWORD options,
75 LPBYTE *bufptr)
77 TRACE("(%p, %p, %ld, %ld, %p)\n", server, service, level, options, bufptr);
78 return NERR_InternalError;
81 DWORD WINAPI NetpNetBiosStatusToApiStatus(DWORD nrc)
83 DWORD ret;
85 switch (nrc)
87 case NRC_GOODRET:
88 ret = NO_ERROR;
89 break;
90 case NRC_NORES:
91 ret = NERR_NoNetworkResource;
92 break;
93 case NRC_DUPNAME:
94 ret = NERR_AlreadyExists;
95 break;
96 case NRC_NAMTFUL:
97 ret = NERR_TooManyNames;
98 break;
99 case NRC_ACTSES:
100 ret = NERR_DeleteLater;
101 break;
102 case NRC_REMTFUL:
103 ret = ERROR_REM_NOT_LIST;
104 break;
105 case NRC_NOCALL:
106 ret = NERR_NameNotFound;
107 break;
108 case NRC_NOWILD:
109 ret = ERROR_INVALID_PARAMETER;
110 break;
111 case NRC_INUSE:
112 ret = NERR_DuplicateName;
113 break;
114 case NRC_NAMERR:
115 ret = ERROR_INVALID_PARAMETER;
116 break;
117 case NRC_NAMCONF:
118 ret = NERR_DuplicateName;
119 break;
120 default:
121 ret = NERR_NetworkError;
123 return ret;