标签:c style class blog code java
DWORD AdjustProcessToken(HANDLE hProcess, LPCTSTR lpPrivilegeName) { HANDLE hToken; TOKEN_PRIVILEGES tp; tp.PrivilegeCount =1; tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES,&hToken)) { return GetLastError(); } if(!LookupPrivilegeValue(NULL, lpPrivilegeName, &tp.Privileges[0].Luid)) { return GetLastError(); } if(!AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES),NULL,NULL)) { return GetLastError(); } return 0; }
标签:c style class blog code java
原文地址:http://www.cnblogs.com/hui277/p/3758595.html