Privilege

zhaozj2021-02-16  67

Privilege level (source code) bfbd (original) keyword VC API process

// Extraction Process Press Bool UpdateProcess Privilege (Handle HPRocess, LPCTSTSTSTRLPPRIVIVILEGENAME = SE_DEBUG_NAME) // HProcess [in]: Target Process // LPPRIVILEGENAME [IN]: Privilege to upgrade, target privilege // return value: TRUE: success; FALSE: failed {HANDLE hToken; if (:: OpenProcessToken (hProcess, TOKEN_ALL_ACCESS, & hToken)) {LUID destLuid; if (:: LookupPrivilegeValue (NULL, lpPrivilegeName, & destLuid)) {TOKEN_PRIVILEGES TokenPrivileges; TokenPrivileges.PrivilegeCount = 1 ; TokenPrivileges.Privileges [0] .Attributes = SE_PRIVILEGE_ENABLED; TokenPrivileges.Privileges [0] .Luid = destLuid; int iResult; if (iResult = :: AdjustTokenPrivileges (hToken, FALSE, & TokenPrivileges, 0, NULL, NULL)) {return TRUE }}} Return false;}

转载请注明原文地址:https://www.9cbs.com/read-23056.html

New Post(0)