Bienvenido a Tecnohackers

Tecnohackers » Programacion » Area de Programacion » Programacion a Bajo Nivel. APIs, Hooking, ASM, C/C++, etc.
 » 

Reiniciar - Reboot Function



Autor Tema: Reiniciar - Reboot Function  (Leído 893 veces)

Desconectado P4|3L0

  • Asiduo
  • *
  • Mensajes: 75
  • TecnoHacker un nuevo proyecto.
    • http://www.tecnohacker.com
Reiniciar - Reboot Function
« en: Diciembre 29, 2009, 04:46:44 pm »
Ya puse un code de Apagar, ahora que ya sabemos apagar ahora reiniciaremos.  ;D

Código: You are not allowed to view links. Register or Login
#include <windows.h>

      int main()
      {
HANDLE hToken;
TOKEN_PRIVILEGES tokpr;
if (OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
      {
LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &tokpr.Privileges[0].Luid);
tokpr.PrivilegeCount = 1;
tokpr.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(AdjustTokenPrivileges(hToken, FALSE, &tokpr, 0, (PTOKEN_PRIVILEGES)NULL, 0))
      {
ExitWindowsEx(EWX_REBOOT,NULL);
}
}
}



Tags:
Tags:

 


SMF 2.0.19 | SMF © 2016, Simple Machines
Paginas Afiliadas
Twitter - FaceBook - Daraxblog
Designed by Smf Personal