diff options
Diffstat (limited to 'ldap/synctools/passwordsync/passhook/passhook.cpp')
-rw-r--r-- | ldap/synctools/passwordsync/passhook/passhook.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ldap/synctools/passwordsync/passhook/passhook.cpp b/ldap/synctools/passwordsync/passhook/passhook.cpp new file mode 100644 index 00000000..ff49d575 --- /dev/null +++ b/ldap/synctools/passwordsync/passhook/passhook.cpp @@ -0,0 +1,47 @@ +// Created: 2-8-2005 +// Author(s): Scott Bridges +#include <windows.h> +#include <ntsecapi.h> +#include "../passhand.h" + +#ifndef STATUS_SUCCESS +#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) +#endif + +NTSTATUS NTAPI PasswordChangeNotify( + PUNICODE_STRING UserName, + ULONG RelativeId, + PUNICODE_STRING Password) +{ + PasswordHandler ourPasswordHandler; + HANDLE passhookEventHandle = OpenEvent(EVENT_MODIFY_STATE, FALSE, PASSHAND_EVENT_NAME); + + ourPasswordHandler.LoadSet("passhook.dat"); + ourPasswordHandler.PushUserPass(UserName, Password); + ourPasswordHandler.SaveSet("passhook.dat"); + + if(passhookEventHandle == NULL) + { + // ToDo: Generate event sync service not running. + } + else + { + SetEvent(passhookEventHandle); + } + + return STATUS_SUCCESS; +} + +BOOL NTAPI PasswordFilter( + PUNICODE_STRING UserName, + PUNICODE_STRING FullName, + PUNICODE_STRING Password, + BOOL SetOperation) +{ + return TRUE; +} + +BOOL NTAPI InitializeChangeNotify() +{ + return TRUE; +}
\ No newline at end of file |