Author: ekohl
Date: Sun Jul 2 20:21:27 2017
New Revision: 75270
URL:
http://svn.reactos.org/svn/reactos?rev=75270&view=rev
Log:
[NETAPI32]
- Add DsGetDcSiteCoverageA stub.
- Implement DsGetDcSiteCoverageW.
[SDK/INCLUDE]
Add DsGetDcSiteCoverageA/W prototypes to dsgetdc.h.
Modified:
trunk/reactos/dll/win32/netapi32/netapi32.spec
trunk/reactos/dll/win32/netapi32/netlogon.c
trunk/reactos/sdk/include/psdk/dsgetdc.h
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] Sun Jul 2 20:21:27 2017
@@ -16,8 +16,8 @@
@ stub DsGetDcNextW
@ stub DsGetDcOpenA
@ stub DsGetDcOpenW
-@ stub DsGetDcSiteCoverageA
-@ stub DsGetDcSiteCoverageW
+@ stdcall DsGetDcSiteCoverageA(str ptr str)
+@ stdcall DsGetDcSiteCoverageW(wstr ptr wstr)
@ stub DsGetForestTrustInformationW
@ stdcall DsGetSiteNameA(str str)
@ stdcall DsGetSiteNameW(wstr wstr)
Modified: trunk/reactos/dll/win32/netapi32/netlogon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/netlogo…
==============================================================================
--- trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/netapi32/netlogon.c [iso-8859-1] Sun Jul 2 20:21:27 2017
@@ -84,7 +84,7 @@
{
FIXME("DsAddressToSiteNamesA(%s, %lu, %p, %p)\n",
debugstr_a(ComputerName), EntryCount, SocketAddresses, SiteNames);
- return ERROR_NO_LOGON_SERVERS;
+ return ERROR_CALL_NOT_IMPLEMENTED;
}
@@ -190,16 +190,6 @@
}
-VOID
-WINAPI
-DsRoleFreeMemory(
- _In_ PVOID Buffer)
-{
- TRACE("DsRoleFreeMemory(%p)\n", Buffer);
- HeapFree(GetProcessHeap(), 0, Buffer);
-}
-
-
DWORD
WINAPI
DsGetDcNameA(
@@ -237,13 +227,93 @@
DWORD
WINAPI
+DsGetDcSiteCoverageA(
+ _In_opt_ LPCSTR ServerName,
+ _Out_ PULONG EntryCount,
+ _Out_ LPSTR **SiteNames)
+{
+ FIXME("DsGetDcSiteCoverageA(%s, %p, %p)\n",
+ debugstr_a(ServerName), EntryCount, SiteNames);
+ return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+
+DWORD
+WINAPI
+DsGetDcSiteCoverageW(
+ _In_opt_ LPCWSTR ServerName,
+ _Out_ PULONG EntryCount,
+ _Out_ LPWSTR **SiteNames)
+{
+ PNL_SITE_NAME_ARRAY SiteNameArray = NULL;
+ PWSTR *SiteNamesBuffer = NULL, Ptr;
+ ULONG BufferSize, i;
+ NET_API_STATUS status;
+
+ TRACE("DsGetDcSiteCoverageA(%s, %p, %p)\n",
+ debugstr_w(ServerName), EntryCount, SiteNames);
+
+ *EntryCount = 0;
+ *SiteNames = NULL;
+
+ RpcTryExcept
+ {
+ status = DsrGetDcSiteCoverageW((PWSTR)ServerName,
+ &SiteNameArray);
+ if (status == NERR_Success)
+ {
+ if (SiteNameArray->EntryCount == 0)
+ {
+ status = ERROR_INVALID_PARAMETER;
+ }
+ else
+ {
+ BufferSize = SiteNameArray->EntryCount * sizeof(PWSTR);
+ for (i = 0; i < SiteNameArray->EntryCount; i++)
+ BufferSize += SiteNameArray->SiteNames[i].Length + sizeof(WCHAR);
+
+ status = NetApiBufferAllocate(BufferSize, (PVOID*)&SiteNamesBuffer);
+ if (status == NERR_Success)
+ {
+ ZeroMemory(SiteNamesBuffer, BufferSize);
+
+ Ptr = (PWSTR)((ULONG_PTR)SiteNamesBuffer +
SiteNameArray->EntryCount * sizeof(PWSTR));
+ for (i = 0; i < SiteNameArray->EntryCount; i++)
+ {
+ SiteNamesBuffer[i] = Ptr;
+ CopyMemory(Ptr,
+ SiteNameArray->SiteNames[i].Buffer,
+ SiteNameArray->SiteNames[i].Length);
+
+ Ptr = (PWSTR)((ULONG_PTR)Ptr +
SiteNameArray->SiteNames[i].Length + sizeof(WCHAR));
+ }
+
+ *EntryCount = SiteNameArray->EntryCount;
+ *SiteNames = SiteNamesBuffer;
+ }
+ }
+
+ MIDL_user_free(SiteNameArray);
+ }
+ }
+ RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+ {
+ status = I_RpcMapWin32Status(RpcExceptionCode());
+ }
+ RpcEndExcept;
+
+ return status;
+}
+
+
+DWORD
+WINAPI
DsGetSiteNameA(
_In_ LPCSTR ComputerName,
_Out_ LPSTR *SiteName)
{
FIXME("DsGetSiteNameA(%s, %p)\n",
debugstr_a(ComputerName), SiteName);
-
return ERROR_CALL_NOT_IMPLEMENTED;
}
@@ -271,6 +341,16 @@
RpcEndExcept;
return status;
+}
+
+
+VOID
+WINAPI
+DsRoleFreeMemory(
+ _In_ PVOID Buffer)
+{
+ TRACE("DsRoleFreeMemory(%p)\n", Buffer);
+ HeapFree(GetProcessHeap(), 0, Buffer);
}
Modified: trunk/reactos/sdk/include/psdk/dsgetdc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/psdk/dsgetdc.h…
==============================================================================
--- trunk/reactos/sdk/include/psdk/dsgetdc.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/psdk/dsgetdc.h [iso-8859-1] Sun Jul 2 20:21:27 2017
@@ -124,6 +124,20 @@
ULONG Flags,
PDOMAIN_CONTROLLER_INFOW* DomainControllerInfo);
+DWORD
+WINAPI
+DsGetDcSiteCoverageA(
+ LPCSTR ServerName,
+ PULONG EntryCount,
+ LPSTR **SiteNames);
+
+DWORD
+WINAPI
+DsGetDcSiteCoverageW(
+ LPCWSTR ServerName,
+ PULONG EntryCount,
+ LPWSTR **SiteNames);
+
#ifdef UNICODE
typedef DOMAIN_CONTROLLER_INFOW DOMAIN_CONTROLLER_INFO, *PDOMAIN_CONTROLLER_INFO;
typedef DS_DOMAIN_TRUSTSW DS_DOMAIN_TRUSTS, *PDS_DOMAIN_TRUSTS;
@@ -131,6 +145,7 @@
#define DsAddressToSiteNamesEx DsAddressToSiteNamesExW
#define DsEnumerateDomainTrusts DsEnumerateDomainTrustsW
#define DsGetDcName DsGetDcNameW
+#define DsGetDcSiteCoverage DsGetDcSiteCoverageW
#else
typedef DOMAIN_CONTROLLER_INFOA DOMAIN_CONTROLLER_INFO, *PDOMAIN_CONTROLLER_INFO;
typedef DS_DOMAIN_TRUSTSA DS_DOMAIN_TRUSTS, *PDS_DOMAIN_TRUSTS;
@@ -138,6 +153,7 @@
#define DsAddressToSiteNamesEx DsAddressToSiteNamesExA
#define DsEnumerateDomainTrusts DsEnumerateDomainTrustsA
#define DsGetDcName DsGetDcNameA
+#define DsGetDcSiteCoverage DsGetDcSiteCoverageA
#endif
#ifdef __cplusplus