a2ffcefd524eea7ea402edf0c072e84abdb71ce2
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
23 WINE_DEFAULT_DEBUG_CHANNEL(netapi32
);
25 BOOL WINAPI
DllMain (HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
27 TRACE("%p,%x,%p\n", hinstDLL
, fdwReason
, lpvReserved
);
30 case DLL_PROCESS_ATTACH
:
31 DisableThreadLibraryCalls(hinstDLL
);
35 case DLL_PROCESS_DETACH
:
36 if (lpvReserved
) break;
44 /************************************************************
45 * NetServerGetInfo (NETAPI32.@)
47 NET_API_STATUS WINAPI
NetServerGetInfo(LMSTR servername
, DWORD level
, LPBYTE
* bufptr
)
51 TRACE("%s %d %p\n", debugstr_w( servername
), level
, bufptr
);
54 if (!NETAPI_IsLocalComputer(servername
))
56 FIXME("remote computers not supported\n");
57 return ERROR_INVALID_LEVEL
;
60 if (!bufptr
) return ERROR_INVALID_PARAMETER
;
67 DWORD computerNameLen
, size
;
68 WCHAR computerName
[MAX_COMPUTERNAME_LENGTH
+ 1];
70 computerNameLen
= MAX_COMPUTERNAME_LENGTH
+ 1;
71 GetComputerNameW(computerName
, &computerNameLen
);
72 computerNameLen
++; /* include NULL terminator */
74 size
= sizeof(SERVER_INFO_101
) + computerNameLen
* sizeof(WCHAR
);
75 ret
= NetApiBufferAllocate(size
, (LPVOID
*)bufptr
);
76 if (ret
== NERR_Success
)
78 /* INFO_100 structure is a subset of INFO_101 */
79 PSERVER_INFO_101 info
= (PSERVER_INFO_101
)*bufptr
;
80 OSVERSIONINFOW verInfo
;
82 info
->sv101_platform_id
= PLATFORM_ID_NT
;
83 info
->sv101_name
= (LMSTR
)(*bufptr
+ sizeof(SERVER_INFO_101
));
84 memcpy(info
->sv101_name
, computerName
,
85 computerNameLen
* sizeof(WCHAR
));
86 verInfo
.dwOSVersionInfoSize
= sizeof(verInfo
);
87 GetVersionExW(&verInfo
);
88 info
->sv101_version_major
= verInfo
.dwMajorVersion
;
89 info
->sv101_version_minor
= verInfo
.dwMinorVersion
;
90 /* Use generic type as no wine equivalent of DC / Server */
91 info
->sv101_type
= SV_TYPE_NT
;
92 info
->sv101_comment
= NULL
;
98 FIXME("level %d unimplemented\n", level
);
99 ret
= ERROR_INVALID_LEVEL
;