How to Soft Reset by VB.NET
Hi
I'm using Symbol PDT8100 windows mobile OS and my applications on VB.NET 2003.
Whenever I used to softboot the symtem by pressing Func+End+Light.. most of the time it is getting Hardbooted and I'm loosing all the datas.
Thatswhy I believe if reset by an application, it won't get hardbooted. Can someone help me the coding?
Thanks in advance
By
Mohamed Faisel
Re: How to Soft Reset by VB.NET
Yes, you must use the
KernelIoControl of coredll API
Here is an example http://www.pinvoke.net/default.aspx/...ernelIoControl
it does HARD reset, The params must be set here:
Code:
uint IOCTL_HAL_REBOOT = CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS);
Also the IOCTL_HAL_REBOOT is that does all the work. Here a param of
0x00000101 is set for it (in DEVICE_HAL). Do try a 0x101003C i think it reboots but NOT 100% sure. Maybe pete can give more info...
Re: How to Soft Reset by VB.NET
Hi,
Try....
Code:
Shared<DllImport("Coredll.dll")> _
Function KernelIoControl(dwIoControlCode As Integer, lpInBuf As IntPtr, nInBufSize As Integer, lpOutBuf As IntPtr, nOutBufSize As Integer, ByRef lpBytesReturned As Integer) As Integer
Shared<DllImport("Coredll.dll")> _
Sub SetCleanRebootFlag()
Public Sub hardReset()
Me.reset(True)
End Sub 'hardReset
Public Sub softReset()
Me.reset(False)
End Sub 'softReset
Private Sub reset(hardReset As Boolean)
Dim IOCTL_HAL_REBOOT As Integer = &H101003C
Dim bytesReturned As Integer = 0
If hardReset Then
SetCleanRebootFlag()
End If
KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, bytesReturned)
End Sub 'reset
very carefully :)
Pete
Re: How to Soft Reset by VB.NET
Oh. So it was 101003C :wave:
I was not sure. So if it burns your PDA or something blame it on pete,ok :D
Re: How to Soft Reset by VB.NET
That's why I said carefully :)
The code should allow for a hard reset or a soft reset.
It may be worthwhile asking for confirmation before it happens.
I would also back up, and, as usual, there are no guarantees :)
Pete
Re: How to Soft Reset by VB.NET
How to Soft Reset by VB.NET from Desktop? Is possible?
Thank you
Re: How to Soft Reset by VB.NET
Hi,
the only way I can think, would be to use 'RAPI' to start a program on the PPC to do a soft reset