Author: ekohl
Date: Sat Jun 24 14:59:14 2017
New Revision: 75184
URL:
http://svn.reactos.org/svn/reactos?rev=75184&view=rev
Log:
[NETAPI32]
Implement I_BrowserQueryOtherDomains, I_BrowserQueryStatistics and
I_BrowserResetNetlogonState. This functions calls their counterpart in the computer
browser service.
Modified:
trunk/reactos/dll/win32/netapi32/browser.c
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/sdk/include/psdk/lmbrowsr.h
trunk/reactos/sdk/include/reactos/idl/browser.idl
Modified: trunk/reactos/dll/win32/netapi32/browser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/browser…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/browser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/browser.c [iso-8859-1] Sat Jun 24 14:59:14 2017
@@ -12,6 +12,7 @@
#include <rpc.h>
#include <lmbrowsr.h>
+#include <lmserver.h>
#include "browser_c.h"
@@ -113,6 +114,72 @@
NET_API_STATUS
WINAPI
+I_BrowserQueryOtherDomains(
+ _In_opt_ LPCWSTR ServerName,
+ _Out_ LPBYTE *BufPtr,
+ _Out_ LPDWORD EntriesRead,
+ _Out_ LPDWORD TotalEntries)
+{
+ SERVER_INFO_100_CONTAINER Level100Container = {0, NULL};
+ SERVER_ENUM_STRUCT EnumStruct;
+ NET_API_STATUS status;
+
+ TRACE("I_BrowserQueryOtherDomains(%s %p %p %p)\n",
+ debugstr_w(ServerName), BufPtr, EntriesRead, TotalEntries);
+
+ EnumStruct.Level = 100;
+ EnumStruct.ServerInfo.Level100 = &Level100Container;
+
+ RpcTryExcept
+ {
+ status = I_BrowserrQueryOtherDomains((PWSTR)ServerName,
+ &EnumStruct,
+ TotalEntries);
+
+ if (status == NERR_Success || status == ERROR_MORE_DATA)
+ {
+ *BufPtr = (LPBYTE)EnumStruct.ServerInfo.Level100->Buffer;
+ *EntriesRead = EnumStruct.ServerInfo.Level100->EntriesRead;
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+I_BrowserQueryStatistics(
+ _In_opt_ LPCWSTR ServerName,
+ _Inout_ LPBROWSER_STATISTICS *Statistics)
+{
+ NET_API_STATUS status;
+
+ TRACE("I_BrowserQueryStatistics(%s %p)\n",
+ debugstr_w(ServerName), Statistics);
+
+ RpcTryExcept
+ {
+ status = I_BrowserrQueryStatistics((PWSTR)ServerName,
+ Statistics);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
I_BrowserResetStatistics(
_In_opt_ LPCWSTR ServerName)
{
@@ -124,6 +191,30 @@
RpcTryExcept
{
status = I_BrowserrResetStatistics((PWSTR)ServerName);
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+NET_API_STATUS
+WINAPI
+I_BrowserResetNetlogonState(
+ _In_ LPCWSTR ServerName)
+{
+ NET_API_STATUS status;
+
+ TRACE("I_BrowserResetNetlogonState(%s)\n",
+ debugstr_w(ServerName));
+
+ RpcTryExcept
+ {
+ status = I_BrowserrResetNetlogonState((PWSTR)ServerName);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
Modified: trunk/reactos/dll/win32/netapi32/netapi32.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netapi3…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netapi32.spec [iso-8859-1] Sat Jun 24 14:59:14 2017
@@ -41,9 +41,9 @@
@ stub I_BrowserDebugCall
@ stub I_BrowserDebugTrace
@ stdcall I_BrowserQueryEmulatedDomains(wstr ptr ptr)
-@ stub I_BrowserQueryOtherDomains
-@ stub I_BrowserQueryStatistics
-@ stub I_BrowserResetNetlogonState
+@ stdcall I_BrowserQueryOtherDomains(wstr ptr ptr ptr)
+@ stdcall I_BrowserQueryStatistics(wstr ptr)
+@ stdcall I_BrowserResetNetlogonState(wstr)
@ stdcall I_BrowserResetStatistics(wstr)
@ stub I_BrowserServerEnum
@ stdcall I_BrowserSetNetlogonState(wstr wstr wstr long)
Modified: trunk/reactos/sdk/include/psdk/lmbrowsr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/lmbrowsr.…
==============================================================================
--- trunk/reactos/sdk/include/psdk/lmbrowsr.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/lmbrowsr.h [iso-8859-1] Sat Jun 24 14:59:14 2017
@@ -1,5 +1,5 @@
-#ifndef _LMBROWSR_
-#define _LMBROWSR_
+#ifndef _LMBROWSR_H
+#define _LMBROWSR_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
Modified: trunk/reactos/sdk/include/reactos/idl/browser.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/br…
==============================================================================
--- trunk/reactos/sdk/include/reactos/idl/browser.idl [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/reactos/idl/browser.idl [iso-8859-1] Sat Jun 24 14:59:14
2017
@@ -6,7 +6,7 @@
typedef [handle] wchar_t *BROWSER_IDENTIFY_HANDLE;
-cpp_quote("#ifndef _LMBROWSR_")
+cpp_quote("#ifndef _LMBROWSR_H")
typedef struct _BROWSER_EMULATED_DOMAIN
{
LPWSTR DomainName;
@@ -21,11 +21,13 @@
[size_is(EntriesRead)] PBROWSER_EMULATED_DOMAIN Buffer;
} BROWSER_EMULATED_DOMAIN_CONTAINER, *PBROWSER_EMULATED_DOMAIN_CONTAINER;
+cpp_quote("#ifndef _LMSERVER_H")
typedef struct _SERVER_INFO_100
{
DWORD sv100_platform_id;
LPWSTR sv100_name;
} SERVER_INFO_100, *PSERVER_INFO_100, *LPSERVER_INFO_100;
+cpp_quote("#endif")
typedef struct _SERVER_INFO_100_CONTAINER
{
@@ -43,6 +45,84 @@
} ServerInfo;
} SERVER_ENUM_STRUCT, *PSERVER_ENUM_STRUCT, *LPSERVER_ENUM_STRUCT;
+cpp_quote("#ifndef _LMBROWSR_H")
+typedef struct _BROWSER_STATISTICS
+{
+ LARGE_INTEGER StatisticsStartTime;
+ LARGE_INTEGER NumberOfServerAnnouncements;
+ LARGE_INTEGER NumberOfDomainAnnouncements;
+ ULONG NumberOfElectionPackets;
+ ULONG NumberOfMailslotWrites;
+ ULONG NumberOfGetBrowserServerListRequests;
+ ULONG NumberOfServerEnumerations;
+ ULONG NumberOfDomainEnumerations;
+ ULONG NumberOfOtherEnumerations;
+ ULONG NumberOfMissedServerAnnouncements;
+ ULONG NumberOfMissedMailslotDatagrams;
+ ULONG NumberOfMissedGetBrowserServerListRequests;
+ ULONG NumberOfFailedServerAnnounceAllocations;
+ ULONG NumberOfFailedMailslotAllocations;
+ ULONG NumberOfFailedMailslotReceives;
+ ULONG NumberOfFailedMailslotWrites;
+ ULONG NumberOfFailedMailslotOpens;
+ ULONG NumberOfDuplicateMasterAnnouncements;
+ LARGE_INTEGER NumberOfIllegalDatagrams;
+} BROWSER_STATISTICS,*PBROWSER_STATISTICS,*LPBROWSER_STATISTICS;
+
+typedef struct _BROWSER_STATISTICS_100
+{
+ LARGE_INTEGER StartTime;
+ LARGE_INTEGER NumberOfServerAnnouncements;
+ LARGE_INTEGER NumberOfDomainAnnouncements;
+ ULONG NumberOfElectionPackets;
+ ULONG NumberOfMailslotWrites;
+ ULONG NumberOfGetBrowserServerListRequests;
+ LARGE_INTEGER NumberOfIllegalDatagrams;
+} BROWSER_STATISTICS_100,*PBROWSER_STATISTICS_100;
+
+typedef struct _BROWSER_STATISTICS_101
+{
+ LARGE_INTEGER StartTime;
+ LARGE_INTEGER NumberOfServerAnnouncements;
+ LARGE_INTEGER NumberOfDomainAnnouncements;
+ ULONG NumberOfElectionPackets;
+ ULONG NumberOfMailslotWrites;
+ ULONG NumberOfGetBrowserServerListRequests;
+ LARGE_INTEGER NumberOfIllegalDatagrams;
+ ULONG NumberOfMissedServerAnnouncements;
+ ULONG NumberOfMissedMailslotDatagrams;
+ ULONG NumberOfMissedGetBrowserServerListRequests;
+ ULONG NumberOfFailedServerAnnounceAllocations;
+ ULONG NumberOfFailedMailslotAllocations;
+ ULONG NumberOfFailedMailslotReceives;
+ ULONG NumberOfFailedMailslotWrites;
+ ULONG NumberOfFailedMailslotOpens;
+ ULONG NumberOfDuplicateMasterAnnouncements;
+} BROWSER_STATISTICS_101,*PBROWSER_STATISTICS_101;
+cpp_quote("#endif")
+
+typedef struct _BROWSER_STATISTICS_100_CONTAINER
+{
+ DWORD EntriesRead;
+ [size_is(EntriesRead)] PBROWSER_STATISTICS_100 Buffer;
+} BROWSER_STATISTICS_100_CONTAINER, *PBROWSER_STATISTICS_100_CONTAINER;
+
+typedef struct _BROWSER_STATISTICS_101_CONTAINER
+{
+ DWORD EntriesRead;
+ [size_is(EntriesRead)] PBROWSER_STATISTICS_101 Buffer;
+} BROWSER_STATISTICS_101_CONTAINER, *PBROWSER_STATISTICS_101_CONTAINER;
+
+typedef struct _BROWSER_STATISTICS_STRUCT
+{
+ DWORD Level;
+ [switch_is(Level)] union _BROWSER_STATISTICS_UNION
+ {
+ [case(100)] PBROWSER_STATISTICS_100_CONTAINER Level100;
+ [case(101)] PBROWSER_STATISTICS_101_CONTAINER Level101;
+ [default] ;
+ } Statistics;
+}BROWSER_STATISTICS_STRUCT, *PBROWSER_STATISTICS_STRUCT, *LPBROWSER_STATISTICS_STRUCT;
[
uuid(6BFFD098-A112-3610-9833-012892020162),
@@ -68,7 +148,7 @@
__stdcall
BrowserOpnum1NotUsedOnWire(void);
- /* Function 2 (BrowserrQueryOtherDomains) */
+ /* Function 2 */
NET_API_STATUS
__stdcall
I_BrowserrQueryOtherDomains(
@@ -76,20 +156,23 @@
[in, out] LPSERVER_ENUM_STRUCT InfoStruct,
[out] LPDWORD TotalEntries);
- /* Function 3 (BrowserrResetNetlogonState) */
- NET_API_STATUS
- __stdcall
- BrowserOpnum3NotUsedOnWire(void);
+ /* Function 3 */
+ NET_API_STATUS
+ __stdcall
+ I_BrowserrResetNetlogonState(
+ [in, string, unique] BROWSER_IDENTIFY_HANDLE ServerName);
/* Function 4 (BrowserrDebugTrace) */
NET_API_STATUS
__stdcall
BrowserOpnum4NotUsedOnWire(void);
- /* Function 5 (BrowserrQueryStatistics) */
- NET_API_STATUS
- __stdcall
- BrowserOpnum5NotUsedOnWire(void);
+ /* Function 5 */
+ NET_API_STATUS
+ __stdcall
+ I_BrowserrQueryStatistics(
+ [in, string, unique] BROWSER_IDENTIFY_HANDLE ServerName,
+ [out] LPBROWSER_STATISTICS *Statistics);
/* Function 6 */
NET_API_STATUS
@@ -102,10 +185,13 @@
__stdcall
BrowserOpnum7NotUsedOnWire(void);
- /* Function 8 (NetrBrowserStatisticsGet) */
- NET_API_STATUS
- __stdcall
- BrowserOpnum8NotUsedOnWire(void);
+ /* Function 8 */
+ NET_API_STATUS
+ __stdcall
+ I_BrowserrStatisticsGet(
+ [in, string, unique] BROWSER_IDENTIFY_HANDLE ServerName,
+ [in] DWORD Level,
+ [in, out] LPBROWSER_STATISTICS_STRUCT StatisticsStruct);
/* Function 9 */
NET_API_STATUS