在应用程序中使用系统功能重启系统的最佳方法是什么

在应用程序中使用系统功能重启系统的最佳方法是什么

本文介绍了在应用程序中使用系统功能重启系统的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的开发人员,

问候!!!!

因为,我想重新启动基于WinCE 7的系统应用。我正在使用一个系统定义的函数  SetSystemPowerState。
以下是示例代码 -

As, i would like to reboot my WinCE 7 based system with an application. I am using one system defined function SetSystemPowerState.Below is the sample code -

DWORD result;
	result = SetSystemPowerState(NULL, POWER_STATE_BOOT,0);
	if(result){
		DEBUGMSG(TRUE,(TEXT("The system is going to boot\r\n")));
	}
	else{

		DEBUGMSG(TRUE,(TEXT("ERROR: While trying to reboot the system :%d\r\n"),GetLastError()));
	}

但是,当我运行我的应用程序时,我收到了以下调试消息 -

But, when I run my application I got the following debug messages -

 100418 PID:4740016 TID:319004e CePerf.dll is absent - performance data will not be recorded
 100422 PID:2cc0652 TID:234063a OSAXST1: >>> Loading Module 'coredll.dll' (0x9E411740) at address 0x40010000-0x40165000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100423 PID:2cc0652 TID:234063a OSAXST1: >>> Loading Module 'System_Reboot_DEBUG.exe' (0x9E4C379C) at address 0x00010000-0x00016000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
PB Debugger Loaded 'System_Reboot_DEBUG.exe', no matching symbolic information found.
 100435 PID:2cc0652 TID:234063a OSAXST1: >>> Loading Module 'locale.dll' (0x9E412C00) at address 0x40170000-0x401B1000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100526 PID:2cc0652 TID:234063a OSAXST1: >>> Loading Module 'normalize.dll' (0x9E412E3C) at address 0x401E0000-0x401FF000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100535 PID:2cc0652 TID:234063a CePerf.dll is absent - performance data will not be recorded
 100537 PID:400002 TID:db0006 PM: DEBUGCHK failed in file d:\bt\2034\public\common\oak\drivers\pm\pdd\default\pwsdef.cpp at line 424
 100538 PID:400002 TID:db0006 DefaultPowerStateManager::PlatformMapPowerStateHint: returning 2
 100539 PID:2cc0652 TID:234063a The system is going to boot
 100539 PID:2cc0652 TID:234063a Dll list:
 100543 PID:2cc0652 TID:234063a OSAXST1: <<< Unloading Module 'coredll.dll' (0x9E411740) at address 0x40010000-0x40165000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100543 PID:2cc0652 TID:234063a OSAXST1: <<< Unloading Module 'normalize.dll' (0x9E412E3C) at address 0x401E0000-0x401FF000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100544 PID:2cc0652 TID:234063a OSAXST1: <<< Unloading Module 'locale.dll' (0x9E412C00) at address 0x40170000-0x401B1000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
 100545 PID:2cc0652 TID:234063a OSAXST1: <<< Unloading Module 'System_Reboot_DEBUG.exe' (0x9E4C379C) at address 0x00010000-0x00016000 in Process 'System_Reboot_DEBUG.exe' (0x9E4C379C)
PB Debugger Unloaded symbols for 'System_Reboot_DEBUG.exe'

但是,系统无法启动。根据上述观察得出的任何结论???

But, the system does not boot. Any conclusion with the above observations???

推荐答案

对于x86平台 - 请尝试使用SetSystemPowerState(NULL, POWER_STATE_RESET ,POWER_FORCE)。

for x86 platforms - try SetSystemPowerState (NULL, POWER_STATE_RESET, POWER_FORCE) instead.

默认重启例程位于@ WINCE700\platform\common\src\x86\common\ioctl\reboot.c,但自定义BSP可能将其移植到自身。

Default reboot routine is located @ WINCE700\platform\common\src\x86\common\ioctl\reboot.c, but custom BSP may port it to itself.

祝你好运。


这篇关于在应用程序中使用系统功能重启系统的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 20:02