WARM BOOT - VB.NET

Discussion in 'Microsoft Dot NET Compact Framework' started by Mobile Boy 36, Jun 9, 2004.

  1. Is there a way to perform a warm boot on a pocket pc 2003 device from within
    vb.net code? Managed or unmanged. Does someone have a working piece of code
    please?

    This was my version but it doesn't seem to work, although it worked well in
    EVB.



    Private Const GENERIC_READ As Integer = &H80000000
    Private Const GENERIC_WRITE As Integer = &H40000000
    Private Const OPEN_EXISTING As Integer = 3
    Private Const WBFILE_ATTRIBUTE_NORMAL As Integer = &H80
    Private Const INVALID_HANDLE_VALUE As Integer = -1
    Private Const IOCTL_TERMINAL_RESET As Integer = &H22C802

    Private Declare Function CreateFile Lib "Coredll" Alias "CreateFileW" (ByVal
    lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode As
    Integer, ByVal lpSecurityAttributes As Integer, ByVal dwCreationDisposition
    As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile As
    Integer) As Integer
    Private Declare Function DeviceIoControl Lib "Coredll" (ByVal hDevice As
    Integer, ByVal dwIoControlCode As Integer, ByVal lpInBuffer As String, ByVal
    nInBufferSize As Integer, ByVal lpOutBuffer As String, ByVal nOutBufferSize
    As Integer, ByVal lpBytesReturned As Integer, ByVal lpOverlapped As Integer)
    As Integer
    Private Declare Function CloseHandle Lib "Coredll" (ByVal hObject As
    Integer) As Integer


    Public Shared Sub WarmReset()

    Dim dwBytes As Integer
    Dim hFile As Integer
    Dim dwCode As Integer

    'vbNullPtr --> Nothing

    hFile = CreateFile("SYI1:", GENERIC_READ Or GENERIC_WRITE, 0,
    Nothing, OPEN_EXISTING, WBFILE_ATTRIBUTE_NORMAL, 0)
    If (hFile <> INVALID_HANDLE_VALUE) Then
    DeviceIoControl(hFile, IOCTL_TERMINAL_RESET, Nothing, 0,
    Nothing, 0, dwBytes, Nothing)
    CloseHandle(hFile)
    End If

    End Sub




    Best regards,

    Mobile boy
     
    Mobile Boy 36, Jun 9, 2004
    #1
    1. Advertisements

  2. There is a VB.NET routine to reboot the device in this post:-
    http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=39f25a01-27d1-45c9-b2ae-a045ff7cf700

    Peter

    --
    Peter Foot
    Windows Embedded MVP
    www.inthehand.com | www.opennetcf.org

    "Mobile Boy 36" <> wrote in message
    news:40c6cf8e$0$13203$...
    > Is there a way to perform a warm boot on a pocket pc 2003 device from
    > within
    > vb.net code? Managed or unmanged. Does someone have a working piece of
    > code
    > please?
    >
    > This was my version but it doesn't seem to work, although it worked well
    > in
    > EVB.
    >
    >
    >
    > Private Const GENERIC_READ As Integer = &H80000000
    > Private Const GENERIC_WRITE As Integer = &H40000000
    > Private Const OPEN_EXISTING As Integer = 3
    > Private Const WBFILE_ATTRIBUTE_NORMAL As Integer = &H80
    > Private Const INVALID_HANDLE_VALUE As Integer = -1
    > Private Const IOCTL_TERMINAL_RESET As Integer = &H22C802
    >
    > Private Declare Function CreateFile Lib "Coredll" Alias "CreateFileW"
    > (ByVal
    > lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal dwShareMode
    > As
    > Integer, ByVal lpSecurityAttributes As Integer, ByVal
    > dwCreationDisposition
    > As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile As
    > Integer) As Integer
    > Private Declare Function DeviceIoControl Lib "Coredll" (ByVal hDevice As
    > Integer, ByVal dwIoControlCode As Integer, ByVal lpInBuffer As String,
    > ByVal
    > nInBufferSize As Integer, ByVal lpOutBuffer As String, ByVal
    > nOutBufferSize
    > As Integer, ByVal lpBytesReturned As Integer, ByVal lpOverlapped As
    > Integer)
    > As Integer
    > Private Declare Function CloseHandle Lib "Coredll" (ByVal hObject As
    > Integer) As Integer
    >
    >
    > Public Shared Sub WarmReset()
    >
    > Dim dwBytes As Integer
    > Dim hFile As Integer
    > Dim dwCode As Integer
    >
    > 'vbNullPtr --> Nothing
    >
    > hFile = CreateFile("SYI1:", GENERIC_READ Or GENERIC_WRITE, 0,
    > Nothing, OPEN_EXISTING, WBFILE_ATTRIBUTE_NORMAL, 0)
    > If (hFile <> INVALID_HANDLE_VALUE) Then
    > DeviceIoControl(hFile, IOCTL_TERMINAL_RESET, Nothing, 0,
    > Nothing, 0, dwBytes, Nothing)
    > CloseHandle(hFile)
    > End If
    >
    > End Sub
    >
    >
    >
    >
    > Best regards,
    >
    > Mobile boy
    >
    >
     
    Peter Foot [MVP], Jun 9, 2004
    #2
    1. Advertisements

  3. Thans Peter, this code is working well...
    "Peter Foot [MVP]" <> wrote in message
    news:...
    > There is a VB.NET routine to reboot the device in this post:-
    >

    http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=39f25a01-27d1-45c9-b2ae-a045ff7cf700
    >
    > Peter
    >
    > --
    > Peter Foot
    > Windows Embedded MVP
    > www.inthehand.com | www.opennetcf.org
    >
    > "Mobile Boy 36" <> wrote in message
    > news:40c6cf8e$0$13203$...
    > > Is there a way to perform a warm boot on a pocket pc 2003 device from
    > > within
    > > vb.net code? Managed or unmanged. Does someone have a working piece of
    > > code
    > > please?
    > >
    > > This was my version but it doesn't seem to work, although it worked well
    > > in
    > > EVB.
    > >
    > >
    > >
    > > Private Const GENERIC_READ As Integer = &H80000000
    > > Private Const GENERIC_WRITE As Integer = &H40000000
    > > Private Const OPEN_EXISTING As Integer = 3
    > > Private Const WBFILE_ATTRIBUTE_NORMAL As Integer = &H80
    > > Private Const INVALID_HANDLE_VALUE As Integer = -1
    > > Private Const IOCTL_TERMINAL_RESET As Integer = &H22C802
    > >
    > > Private Declare Function CreateFile Lib "Coredll" Alias "CreateFileW"
    > > (ByVal
    > > lpFileName As String, ByVal dwDesiredAccess As Integer, ByVal

    dwShareMode
    > > As
    > > Integer, ByVal lpSecurityAttributes As Integer, ByVal
    > > dwCreationDisposition
    > > As Integer, ByVal dwFlagsAndAttributes As Integer, ByVal hTemplateFile

    As
    > > Integer) As Integer
    > > Private Declare Function DeviceIoControl Lib "Coredll" (ByVal hDevice As
    > > Integer, ByVal dwIoControlCode As Integer, ByVal lpInBuffer As String,
    > > ByVal
    > > nInBufferSize As Integer, ByVal lpOutBuffer As String, ByVal
    > > nOutBufferSize
    > > As Integer, ByVal lpBytesReturned As Integer, ByVal lpOverlapped As
    > > Integer)
    > > As Integer
    > > Private Declare Function CloseHandle Lib "Coredll" (ByVal hObject As
    > > Integer) As Integer
    > >
    > >
    > > Public Shared Sub WarmReset()
    > >
    > > Dim dwBytes As Integer
    > > Dim hFile As Integer
    > > Dim dwCode As Integer
    > >
    > > 'vbNullPtr --> Nothing
    > >
    > > hFile = CreateFile("SYI1:", GENERIC_READ Or GENERIC_WRITE, 0,
    > > Nothing, OPEN_EXISTING, WBFILE_ATTRIBUTE_NORMAL, 0)
    > > If (hFile <> INVALID_HANDLE_VALUE) Then
    > > DeviceIoControl(hFile, IOCTL_TERMINAL_RESET, Nothing, 0,
    > > Nothing, 0, dwBytes, Nothing)
    > > CloseHandle(hFile)
    > > End If
    > >
    > > End Sub
    > >
    > >
    > >
    > >
    > > Best regards,
    > >
    > > Mobile boy
    > >
    > >

    >
    >
     
    Mobile Boy 36, Jun 10, 2004
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Ponomarev

    ANN: 9Rays.Net releases Spices.VSIP.Net (Spices.Net Visual Studio Integration pack)

    Al Ponomarev, Jul 7, 2004, in forum: Microsoft Dot NET Compact Framework
    Replies:
    0
    Views:
    181
    Al Ponomarev
    Jul 7, 2004
  2. Jim

    How can I install a new driver under warm boot not cold boot?

    Jim, Jul 7, 2006, in forum: Microsoft Dot NET Compact Framework
    Replies:
    0
    Views:
    265
  3. Guest

    API for Warm Reboot

    Guest, Sep 15, 2006, in forum: Microsoft Dot NET Compact Framework
    Replies:
    5
    Views:
    2,980
    Sergey Bogdanov
    Sep 19, 2006
  4. Ivo

    Warm boot

    Ivo, Mar 29, 2007, in forum: Microsoft Dot NET Compact Framework
    Replies:
    2
    Views:
    192
    Paul G. Tobey [eMVP]
    Mar 29, 2007
  5. Murthy

    changing InCall volume with out warm rebooting

    Murthy, Jan 28, 2008, in forum: Microsoft Dot NET Compact Framework
    Replies:
    5
    Views:
    290
    Guest
    Jan 30, 2008
Loading...

Share This Page