diff --git a/reactos/dll/win32/netapi32/browser.c b/reactos/dll/win32/netapi32/browser.c index 5a05ccbd8cf..1e654859ce8 100644 --- a/reactos/dll/win32/netapi32/browser.c +++ b/reactos/dll/win32/netapi32/browser.c @@ -257,6 +257,69 @@ I_BrowserSetNetlogonState( } +NET_API_STATUS +WINAPI +NetBrowserStatisticsGet( + _In_ LPWSTR ServerName, + _In_ DWORD Level, + _Out_ LPBYTE *Buffer) +{ + BROWSER_STATISTICS_STRUCT StatisticsStruct; + BROWSER_STATISTICS_100_CONTAINER Level100Container = {0, NULL}; + BROWSER_STATISTICS_101_CONTAINER Level101Container = {0, NULL}; + NET_API_STATUS status; + + TRACE("NetBrowserStatisticsGet(%s %lu %p)\n", + debugstr_w(ServerName), Level, Buffer); + + if (Level != 100 && Level != 101) + return ERROR_INVALID_LEVEL; + + StatisticsStruct.Level = Level; + switch (Level) + { + case 100: + StatisticsStruct.Statistics.Level100 = &Level100Container; + break; + + case 101: + StatisticsStruct.Statistics.Level101 = &Level101Container; + break; + } + + RpcTryExcept + { + status = NetrBrowserStatisticsGet(ServerName, + Level, + &StatisticsStruct); + + switch (Level) + { + case 100: + if (StatisticsStruct.Statistics.Level100->Buffer != NULL) + { + *Buffer = (LPBYTE)StatisticsStruct.Statistics.Level100->Buffer; + } + break; + + case 101: + if (StatisticsStruct.Statistics.Level101->Buffer != NULL) + { + *Buffer = (LPBYTE)StatisticsStruct.Statistics.Level101->Buffer; + } + break; + } + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + status = I_RpcMapWin32Status(RpcExceptionCode()); + } + RpcEndExcept; + + return status; +} + + NET_API_STATUS WINAPI NetServerEnum( @@ -270,11 +333,22 @@ NetServerEnum( _In_opt_ LMCSTR domain, _Inout_opt_ LPDWORD resume_handle) { - FIXME("NetServerEnum(%s %lu %p %lu %p %p %lu %s %p)\n", + TRACE("NetServerEnum(%s %lu %p %lu %p %p %lu %s %p)\n", debugstr_w(servername), level, bufptr, prefmaxlen, entriesread, totalentries, servertype, debugstr_w(domain), resume_handle); - return ERROR_NO_BROWSER_SERVERS_FOUND; + if (resume_handle != NULL) + *resume_handle = 0; + + return NetServerEnumEx(servername, + level, + bufptr, + prefmaxlen, + entriesread, + totalentries, + servertype, + domain, + NULL); } diff --git a/reactos/dll/win32/netapi32/netapi32.spec b/reactos/dll/win32/netapi32/netapi32.spec index 7fb07ff08fc..4377d587922 100644 --- a/reactos/dll/win32/netapi32/netapi32.spec +++ b/reactos/dll/win32/netapi32/netapi32.spec @@ -109,7 +109,7 @@ @ stdcall NetAuditClear(wstr wstr wstr) @ stdcall NetAuditRead(wstr wstr ptr long ptr long long ptr long ptr ptr) @ stdcall NetAuditWrite(long ptr long wstr ptr) -@ stub NetBrowserStatisticsGet +@ stdcall NetBrowserStatisticsGet(wstr long ptr) @ stdcall NetConfigGet(wstr wstr wstr ptr) @ stdcall NetConfigGetAll(wstr wstr ptr) @ stdcall NetConfigSet(wstr wstr wstr long long ptr long) diff --git a/reactos/sdk/include/psdk/lmbrowsr.h b/reactos/sdk/include/psdk/lmbrowsr.h index b92c822de93..6de9b25a76a 100644 --- a/reactos/sdk/include/psdk/lmbrowsr.h +++ b/reactos/sdk/include/psdk/lmbrowsr.h @@ -72,6 +72,7 @@ NET_API_STATUS WINAPI I_BrowserSetNetlogonState(LPWSTR,LPWSTR,LPWSTR,DWORD); NET_API_STATUS WINAPI I_BrowserQueryStatistics(LPCWSTR,LPBROWSER_STATISTICS*); NET_API_STATUS WINAPI I_BrowserResetStatistics(LPCWSTR); NET_API_STATUS WINAPI I_BrowserDebugTrace(PWCHAR,PCHAR); +NET_API_STATUS WINAPI NetBrowserStatisticsGet(PWSTR,DWORD,PBYTE*); #ifdef __cplusplus } #endif diff --git a/reactos/sdk/include/reactos/idl/browser.idl b/reactos/sdk/include/reactos/idl/browser.idl index 569448a6716..08d3e0e90f2 100644 --- a/reactos/sdk/include/reactos/idl/browser.idl +++ b/reactos/sdk/include/reactos/idl/browser.idl @@ -122,7 +122,7 @@ typedef struct _BROWSER_STATISTICS_STRUCT [case(101)] PBROWSER_STATISTICS_101_CONTAINER Level101; [default] ; } Statistics; -}BROWSER_STATISTICS_STRUCT, *PBROWSER_STATISTICS_STRUCT, *LPBROWSER_STATISTICS_STRUCT; +} BROWSER_STATISTICS_STRUCT, *PBROWSER_STATISTICS_STRUCT, *LPBROWSER_STATISTICS_STRUCT; [ uuid(6BFFD098-A112-3610-9833-012892020162), @@ -188,7 +188,7 @@ interface browser /* Function 8 */ NET_API_STATUS __stdcall - I_BrowserrStatisticsGet( + NetrBrowserStatisticsGet( [in, string, unique] BROWSER_IDENTIFY_HANDLE ServerName, [in] DWORD Level, [in, out] LPBROWSER_STATISTICS_STRUCT StatisticsStruct);