9行代码解决微信pc多开

HANDLE hMutex = CreateMutexW(NULL, FALSE, L"_WeChat_App_Instance_Identity_Mutex_Name");
SID_IDENTIFIER_AUTHORITY SIDAuthWorld = SECURITY_WORLD_SID_AUTHORITY; 
PSID pEveryoneSID = NULL;
char szBuffer[4096];
PACL pAcl = (PACL)szBuffer;
AllocateAndInitializeSid(&SIDAuthWorld,1,SECURITY_WORLD_RID,0, 0, 0, 0, 0, 0, 0,&pEveryoneSID);
InitializeAcl(pAcl, sizeof(szBuffer), ACL_REVISION);
AddAccessDeniedAce(pAcl, ACL_REVISION, MUTEX_ALL_ACCESS, pEveryoneSID);
SetSecurityInfo(hMutex, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pAcl, NULL);

posted @ 2020-07-02 09:55  曲完丶人终散  阅读(519)  评论(0编辑  收藏  举报