Results 1 to 7 of 7

Thread: How to Soft Reset by VB.NET

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2007
    Posts
    7

    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

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    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...
    Last edited by sapator; Sep 26th, 2007 at 06:20 AM.

  3. #3
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: How to Soft Reset by VB.NET

    Oh. So it was 101003C
    I was not sure. So if it burns your PDA or something blame it on pete,ok

  5. #5
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  6. #6
    Lively Member
    Join Date
    Oct 2006
    Location
    Spain
    Posts
    97

    Re: How to Soft Reset by VB.NET

    How to Soft Reset by VB.NET from Desktop? Is possible?

    Thank you

  7. #7
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width