mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 22:49:12 +00:00
[NETAPI32]
- Add DsAddressToSiteNamesA stub. - Implement DsAddressToSiteNamesW. [SDK/INCLUDE] Add DsAddressToSiteNamesA/W and DsAddressToSiteNamesExA/W prototypes to dsgetdc.h. svn path=/trunk/; revision=75268
This commit is contained in:
parent
cf2dee2914
commit
84eb2fc018
3 changed files with 123 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
|||
@ stub CredpValidateTargetName
|
||||
@ stub DsAddressToSiteNamesA
|
||||
@ stdcall DsAddressToSiteNamesA(str long ptr str)
|
||||
@ stub DsAddressToSiteNamesExA
|
||||
@ stub DsAddressToSiteNamesExW
|
||||
@ stub DsAddressToSiteNamesW
|
||||
@ stdcall DsAddressToSiteNamesW(wstr long ptr wstr)
|
||||
@ stub DsDeregisterDnsHostRecordsA
|
||||
@ stub DsDeregisterDnsHostRecordsW
|
||||
8 stdcall DsEnumerateDomainTrustsA(wstr long ptr ptr)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "netapi32.h"
|
||||
#include <winsock2.h>
|
||||
#include <rpc.h>
|
||||
#include <dsrole.h>
|
||||
#include <dsgetdc.h>
|
||||
|
@ -73,6 +74,92 @@ LOGONSRV_HANDLE_unbind(LOGONSRV_HANDLE pszSystemName,
|
|||
}
|
||||
|
||||
|
||||
DWORD
|
||||
WINAPI
|
||||
DsAddressToSiteNamesA(
|
||||
_In_opt_ LPCSTR ComputerName,
|
||||
_In_ DWORD EntryCount,
|
||||
_In_ PSOCKET_ADDRESS SocketAddresses,
|
||||
_Out_ LPSTR **SiteNames)
|
||||
{
|
||||
FIXME("DsAddressToSiteNamesA(%s, %lu, %p, %p)\n",
|
||||
debugstr_a(ComputerName), EntryCount, SocketAddresses, SiteNames);
|
||||
return ERROR_NO_LOGON_SERVERS;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
WINAPI
|
||||
DsAddressToSiteNamesW(
|
||||
_In_opt_ LPCWSTR ComputerName,
|
||||
_In_ DWORD EntryCount,
|
||||
_In_ PSOCKET_ADDRESS SocketAddresses,
|
||||
_Out_ LPWSTR **SiteNames)
|
||||
{
|
||||
PNL_SITE_NAME_ARRAY SiteNameArray = NULL;
|
||||
PWSTR *SiteNamesBuffer = NULL, Ptr;
|
||||
ULONG BufferSize, i;
|
||||
NET_API_STATUS status;
|
||||
|
||||
TRACE("DsAddressToSiteNamesW(%s, %lu, %p, %p)\n",
|
||||
debugstr_w(ComputerName), EntryCount, SocketAddresses, SiteNames);
|
||||
|
||||
if (EntryCount == 0)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
*SiteNames = NULL;
|
||||
|
||||
RpcTryExcept
|
||||
{
|
||||
status = DsrAddressToSiteNamesW((PWSTR)ComputerName,
|
||||
EntryCount,
|
||||
(PNL_SOCKET_ADDRESS)SocketAddresses,
|
||||
&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));
|
||||
}
|
||||
|
||||
*SiteNames = SiteNamesBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
MIDL_user_free(SiteNameArray);
|
||||
}
|
||||
}
|
||||
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
status = I_RpcMapWin32Status(RpcExceptionCode());
|
||||
}
|
||||
RpcEndExcept;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
DWORD
|
||||
WINAPI
|
||||
DsEnumerateDomainTrustsA(
|
||||
|
|
|
@ -62,6 +62,36 @@ typedef struct _DS_DOMAIN_TRUSTSW
|
|||
GUID DomainGuid;
|
||||
} DS_DOMAIN_TRUSTSW, *PDS_DOMAIN_TRUSTSW;
|
||||
|
||||
DWORD WINAPI
|
||||
DsAddressToSiteNamesA(
|
||||
LPCSTR ComputerName,
|
||||
DWORD EntryCount,
|
||||
PSOCKET_ADDRESS SocketAddresses,
|
||||
LPSTR **SiteNames);
|
||||
|
||||
DWORD WINAPI
|
||||
DsAddressToSiteNamesW(
|
||||
LPCWSTR ComputerName,
|
||||
DWORD EntryCount,
|
||||
PSOCKET_ADDRESS SocketAddresses,
|
||||
LPWSTR **SiteNames);
|
||||
|
||||
DWORD WINAPI
|
||||
DsAddressToSiteNamesExA(
|
||||
LPCSTR ComputerName,
|
||||
DWORD EntryCount,
|
||||
PSOCKET_ADDRESS SocketAddresses,
|
||||
LPSTR **SiteNames,
|
||||
LPSTR **SubnetNames);
|
||||
|
||||
DWORD WINAPI
|
||||
DsAddressToSiteNamesExW(
|
||||
LPCWSTR ComputerName,
|
||||
DWORD EntryCount,
|
||||
PSOCKET_ADDRESS SocketAddresses,
|
||||
LPWSTR **SiteNames,
|
||||
LPWSTR **SubnetNames);
|
||||
|
||||
DWORD WINAPI
|
||||
DsEnumerateDomainTrustsA(
|
||||
LPSTR ServerName,
|
||||
|
@ -97,11 +127,15 @@ DsGetDcNameW(
|
|||
#ifdef UNICODE
|
||||
typedef DOMAIN_CONTROLLER_INFOW DOMAIN_CONTROLLER_INFO, *PDOMAIN_CONTROLLER_INFO;
|
||||
typedef DS_DOMAIN_TRUSTSW DS_DOMAIN_TRUSTS, *PDS_DOMAIN_TRUSTS;
|
||||
#define DsAddressToSiteNames DsAddressToSiteNamesW
|
||||
#define DsAddressToSiteNamesEx DsAddressToSiteNamesExW
|
||||
#define DsEnumerateDomainTrusts DsEnumerateDomainTrustsW
|
||||
#define DsGetDcName DsGetDcNameW
|
||||
#else
|
||||
typedef DOMAIN_CONTROLLER_INFOA DOMAIN_CONTROLLER_INFO, *PDOMAIN_CONTROLLER_INFO;
|
||||
typedef DS_DOMAIN_TRUSTSA DS_DOMAIN_TRUSTS, *PDS_DOMAIN_TRUSTS;
|
||||
#define DsAddressToSiteNames DsAddressToSiteNamesA
|
||||
#define DsAddressToSiteNamesEx DsAddressToSiteNamesExA
|
||||
#define DsEnumerateDomainTrusts DsEnumerateDomainTrustsA
|
||||
#define DsGetDcName DsGetDcNameA
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue