API for Warm Reboot

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am developing an Application for PPC 2002 and Windows CE.NET 4.2 device.
I want to Warm Reboot the Devices Programmatically.

In google i found some people refering to "KernelIoControl" for Warm
Reboot.....
But i can't find any where how to use it.

Can any tell me which api and how to use it.

Waiting for ur Response....
Thanks in Advance,
Murthy
 
Hi Murthy!

This comes from an older project using embedded c++ 3.


#include <winioctl.h> // soft reset, dllimport KernelIoControl
#define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED,
FILE_ANY_ACCESS)

extern "C" __declspec(dllimport) BOOL KernelIoControl(DWORD dwIoControlCode,
LPVOID lpInBuf, DWORD nInBufSize,

void main()
{
KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
}


Hope it helps!
Martin
 
Take a look at the OpenNETCF library, I can't remember which class this is
in, but I know it's possible to reboot the device with their latest library.

Regards
Simon.
 
public class Reset {

[DllImport("CoreDll.dll", SetLastError = true, CharSet = CharSet.Auto)]

private static extern bool KernelIoControl(int dwIoControlCode, IntPtr
lpInBuf, int nInBufSize, IntPtr lpOutBuf, int nOutBufSize, IntPtr
lpBytesReturned);

public static bool SoftReset() {

return KernelIoControl(16842812, IntPtr.Zero, 0, IntPtr.Zero, 0,
IntPtr.Zero);

}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top