https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c87482b1df14fbb7f384d…
commit c87482b1df14fbb7f384d884ebc532228a8d00e9
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sat Dec 15 17:17:14 2018 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sat Dec 15 17:18:32 2018 +0100
[NETAPI32] Implement NetRegisterDomainNameChangeNotification() and
NetUnregisterDomainNameChangeNotification().
---
dll/win32/netapi32/misc.c | 52 ++++++++++++++++++++++++++++++++++++++++
dll/win32/netapi32/netapi32.spec | 4 ++--
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/dll/win32/netapi32/misc.c b/dll/win32/netapi32/misc.c
index 650068fa96..0d236e2ed4 100644
--- a/dll/win32/netapi32/misc.c
+++ b/dll/win32/netapi32/misc.c
@@ -18,6 +18,38 @@ WINE_DEFAULT_DEBUG_CHANNEL(netapi32);
/* FUNCTIONS *****************************************************************/
+NET_API_STATUS
+WINAPI
+NetRegisterDomainNameChangeNotification(
+ _Out_ PHANDLE NotificationEventHandle)
+{
+ HANDLE EventHandle;
+ NTSTATUS Status;
+
+ TRACE("NetRegisterDomainNameChangeNotification(%p)\n",
+ NotificationEventHandle);
+
+ if (NotificationEventHandle == NULL)
+ return ERROR_INVALID_PARAMETER;
+
+ EventHandle = CreateEventW(NULL, FALSE, FALSE, NULL);
+ if (EventHandle == NULL)
+ return GetLastError();
+
+ Status = LsaRegisterPolicyChangeNotification(PolicyNotifyDnsDomainInformation,
+ NotificationEventHandle);
+ if (!NT_SUCCESS(Status))
+ {
+ CloseHandle(EventHandle);
+ return NetpNtStatusToApiStatus(Status);
+ }
+
+ *NotificationEventHandle = EventHandle;
+
+ return NERR_Success;
+}
+
+
NET_API_STATUS
WINAPI
NetStatisticsGet(
@@ -83,6 +115,26 @@ NetStatisticsGet(
}
+NET_API_STATUS
+WINAPI
+NetUnregisterDomainNameChangeNotification(
+ _In_ HANDLE NotificationEventHandle)
+{
+ NTSTATUS Status;
+
+ TRACE("NetUnregisterDomainNameChangeNotification(%p)\n",
+ NotificationEventHandle);
+
+ if (NotificationEventHandle == NULL)
+ return ERROR_INVALID_PARAMETER;
+
+ Status = LsaUnregisterPolicyChangeNotification(PolicyNotifyDnsDomainInformation,
+ NotificationEventHandle);
+
+ return NetpNtStatusToApiStatus(Status);
+}
+
+
NET_API_STATUS
WINAPI
NetpNtStatusToApiStatus(
diff --git a/dll/win32/netapi32/netapi32.spec b/dll/win32/netapi32/netapi32.spec
index d573ef5fa6..dda3b36b6e 100644
--- a/dll/win32/netapi32/netapi32.spec
+++ b/dll/win32/netapi32/netapi32.spec
@@ -181,7 +181,7 @@
@ stdcall NetMessageNameEnum(wstr long ptr long ptr ptr ptr)
@ stdcall NetMessageNameGetInfo(wstr wstr long ptr)
@ stdcall NetQueryDisplayInformation(wstr long long long long ptr ptr)
-@ stub NetRegisterDomainNameChangeNotification
+@ stdcall NetRegisterDomainNameChangeNotification(ptr)
@ stub NetRemoteComputerSupports
@ stdcall NetRemoteTOD(wstr ptr)
@ stdcall NetRemoveAlternateComputerName(wstr wstr wstr wstr long)
@@ -234,7 +234,7 @@
@ stdcall NetShareSetInfo(wstr wstr long ptr ptr)
@ stdcall NetStatisticsGet(wstr wstr long long ptr)
@ stdcall NetUnjoinDomain(wstr wstr wstr long)
-@ stub NetUnregisterDomainNameChangeNotification
+@ stdcall NetUnregisterDomainNameChangeNotification(ptr)
@ stdcall NetUseAdd(wstr long ptr ptr)
@ stdcall NetUseDel(wstr wstr long)
@ stdcall NetUseEnum(wstr long ptr long ptr ptr ptr)