问题广告密码过滤DLL实现
我在为我的广告实现密码过滤器DLL时遇到了问题,因此我将其减少到下面的代码中所示,当用户更改密码时,它仍然不起作用,因为我遇到了此错误:“无法更新密码。
Voici Mon Fichier dllmain.cpp :
#include "pch.h"
#include <SDKDDKVer.h>
#include <windows.h>
#include <stdio.h>
#include <ntsecapi.h>
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
__declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void)
{
return TRUE;
}
__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(
PUNICODE_STRING AccountName,
PUNICODE_STRING FullName,
PUNICODE_STRING Password,
BOOLEAN SetOperation
)
{
return TRUE;
}
__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(
PUNICODE_STRING UserName,
ULONG RelativeId,
PUNICODE_STRING NewPassword
)
{
return 0;
}
我用 Visual Studio 2022 编译DLL,然后将其发送到c:\ Windows \ System32
中的AD中。然后,我添加System \\ currentControlset \\ Control \\ LSA
的subkey 通知软件包在我的dll的名称中。最后我重新启动了广告。
我认为我已经最小化了代码,但仍然返回“ True”,但它仍然不起作用...
I have problems implementing a password filter DLL for my AD so I reduced it to the minimum as shown in the code below and when a user changes the password, it still doesn't work because I get this error : "Unable to update the password. The value provided for the new password doest not meet the length, complexity, or history requirements of the domain".
Voici mon fichier dllmain.cpp :
#include "pch.h"
#include <SDKDDKVer.h>
#include <windows.h>
#include <stdio.h>
#include <ntsecapi.h>
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
__declspec(dllexport) BOOLEAN __stdcall InitializeChangeNotify(void)
{
return TRUE;
}
__declspec(dllexport) BOOLEAN __stdcall PasswordFilter(
PUNICODE_STRING AccountName,
PUNICODE_STRING FullName,
PUNICODE_STRING Password,
BOOLEAN SetOperation
)
{
return TRUE;
}
__declspec(dllexport) NTSTATUS __stdcall PasswordChangeNotify(
PUNICODE_STRING UserName,
ULONG RelativeId,
PUNICODE_STRING NewPassword
)
{
return 0;
}
I compile my DLL with Visual Studio 2022 then I send it to my AD in C:\Windows\System32
. Then I add in the subkey Notification Packages of SYSTEM\\CurrentControlSet\\Control\\Lsa
in Regedit the name of my DLL. Then finally I reboot the AD.
I think I have minimized the code and still returns "True" but it still doesn't work...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论