A
andy zheng
Has anybody know How
in Winlogon notificatin funtion Reboot XPe
//Entrance function for the DLL
BOOL WINAPI LibMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
//Disable DLL_THREAD_ATTACH & DLL_THREAD_DETACH
//notification calls. This is a performance optimization
//for multi-threaded applications that do not need
//thread-level notifications of attachment or detachment.
DisableThreadLibraryCalls (hInstance);
}
break;
}
return TRUE;
}
//Event handler for the Winlogon Logon event
VOID WLXventLogon (PWLX_NOTIFICATION_INFO pInfo)
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
if( Check_HW_is_change() == false) return;
OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hT
oken);
LookupPrivilegeValue(0, SE_SHUTDOWN_NAME,&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken,false,&tkp,0,(PTOKEN_PRIVILEGES)NULL,0);
// Now call the Win32 API to force windows to shutdown and restart.
ExitWindowsEx(EWX_REBOOT|EWX_FORCE,0);
}
the result XPe show CTRL+ALT+DEL screen.
Any help is appreciated. Thanks in advance.
-andy zheng
in Winlogon notificatin funtion Reboot XPe
//Entrance function for the DLL
BOOL WINAPI LibMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{
//Disable DLL_THREAD_ATTACH & DLL_THREAD_DETACH
//notification calls. This is a performance optimization
//for multi-threaded applications that do not need
//thread-level notifications of attachment or detachment.
DisableThreadLibraryCalls (hInstance);
}
break;
}
return TRUE;
}
//Event handler for the Winlogon Logon event
VOID WLXventLogon (PWLX_NOTIFICATION_INFO pInfo)
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
if( Check_HW_is_change() == false) return;
OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hT
oken);
LookupPrivilegeValue(0, SE_SHUTDOWN_NAME,&tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken,false,&tkp,0,(PTOKEN_PRIVILEGES)NULL,0);
// Now call the Win32 API to force windows to shutdown and restart.
ExitWindowsEx(EWX_REBOOT|EWX_FORCE,0);
}
the result XPe show CTRL+ALT+DEL screen.
Any help is appreciated. Thanks in advance.
-andy zheng