https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c9537b392b8372e00a50e…
commit c9537b392b8372e00a50e9a64f9b83f3cdb15f03
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sat Aug 24 22:57:36 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sat Aug 24 22:57:36 2019 +0200
[NETAPI32] Implement DsDeregisterDnsHostRecordsA
---
dll/win32/netapi32/netlogon.c | 52 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 50 insertions(+), 2 deletions(-)
diff --git a/dll/win32/netapi32/netlogon.c b/dll/win32/netapi32/netlogon.c
index 2c068dc176b..73a0324f0fa 100644
--- a/dll/win32/netapi32/netlogon.c
+++ b/dll/win32/netapi32/netlogon.c
@@ -313,10 +313,58 @@ DsDeregisterDnsHostRecordsA(
_In_opt_ GUID *DsaGuid,
_In_ LPSTR DnsHostName)
{
- FIXME("DsDeregisterDnsHostRecordsA(%s, %s, %p, %p, %s)\n",
+ PWSTR pServerNameW = NULL, pDnsDomainNameW = NULL;
+ PWSTR pDnsHostNameW = NULL;
+ NET_API_STATUS status = NERR_Success;
+
+ TRACE("DsDeregisterDnsHostRecordsA(%s, %s, %p, %p, %s)\n",
debugstr_a(ServerName), debugstr_a(DnsDomainName),
DomainGuid, DsaGuid, debugstr_a(DnsHostName));
- return ERROR_CALL_NOT_IMPLEMENTED;
+
+ if (ServerName != NULL)
+ {
+ pServerNameW = NetpAllocWStrFromAnsiStr((PSTR)ServerName);
+ if (pServerNameW == NULL)
+ {
+ status = ERROR_NOT_ENOUGH_MEMORY;
+ goto done;
+ }
+ }
+
+ if (DnsDomainName != NULL)
+ {
+ pDnsDomainNameW = NetpAllocWStrFromAnsiStr((PSTR)DnsDomainName);
+ if (pDnsDomainNameW == NULL)
+ {
+ status = ERROR_NOT_ENOUGH_MEMORY;
+ goto done;
+ }
+ }
+
+ pDnsHostNameW = NetpAllocWStrFromAnsiStr((PSTR)DnsDomainName);
+ if (pDnsHostNameW == NULL)
+ {
+ status = ERROR_NOT_ENOUGH_MEMORY;
+ goto done;
+ }
+
+ status = DsDeregisterDnsHostRecordsW(pServerNameW,
+ pDnsDomainNameW,
+ DomainGuid,
+ DsaGuid,
+ pDnsHostNameW);
+
+done:
+ if (pDnsHostNameW != NULL)
+ NetApiBufferFree(pDnsHostNameW);
+
+ if (pDnsDomainNameW != NULL)
+ NetApiBufferFree(pDnsDomainNameW);
+
+ if (pServerNameW != NULL)
+ NetApiBufferFree(pServerNameW);
+
+ return status;
}