Amis aider moi j'ai besoin de changer le privilège pour nous de changer la date de l'ordinateur dans Windows 7, car l'utilisateur n'est pas un administrateur, j'ai fait tout le code, le mettre dans la dernière fonction qui modifie le privilège qu'il donne erreur 998 disant ne pas accéder à la ressource de mémoire, si vous changez de false à true dans la fonction, qui ne tiendrait pas compte du changement il pas l'erreur et immédiatement exécute la fonction NewState le problème et peut m'aider ce que je fais mal ... .
LUID is Structure LowPart is int on 4 bytes //Type C : DWORD HighPart is int on 4 bytes //Type C : LONG END LUID_AND_ATTRIBUTES is Structure LUID is LUID //Type C : LUID Attributes is int //Type C : DWORD END TOKEN_PRIVILEGES is Structure PrivilegeCount is int //Type C : DWORD Privileges is LUID_AND_ATTRIBUTES //LUID_AND_ATTRIBUTES is another structure END NewState is TOKEN_PRIVILEGES PreviousState is TOKEN_PRIVILEGES
// Modificar Privilegio FunctionReturn is boolean // C type:BOOL ProcessHandle is system int // C type:HANDLE DesiredAccess is int // C type:DWORD TokenHandle is system int // C type:PHANDLE ProcessHandle=API("KERNEL32","GetCurrentProcess") DesiredAccess = 32 FunctionReturn=API("ADVAPI32.DLL","OpenProcessToken",ProcessHandle,DesiredAccess,&TokenHandle)
lpSystemName is system int = Null // C type:LPCSTR, this is the address of a string, you also have the ability to specify a string directly lpName is system int // C type:LPCSTR, this is the address of a string, you also have the ability to specify a string directly lpLuid is LUID // C type:PLUID
FunctionReturn=API("ADVAPI32.DLL","LookupPrivilegeValueA",Null,"SeSystemtimePrivilege",&lpLuid) DisableAllPrivileges is boolean // C type:BOOL BufferLength is int // C type:DWORD ReturnLength is system int // C type:PDWORD
NewState.PrivilegeCount = 1 NewState.Privileges.Luid = lpLuid NewState.Privileges.Attributes = 2 // SE_PRIVILEGE_ENABLED
FunctionReturn=API("ADVAPI32.DLL","AdjustTokenPrivileges",TokenHandle,False,&NewState,0,0,0) IF NOT FunctionReturn THEN Error(ErrorInfo()) END Info(FunctionReturn+" "+ProcessHandle) |