Cold boot

T

Thore Berntsen

I have found code for warm booting a device in this newsgruop, but I can't
find any to cold boot a device. Can anyone help?

Thore Berntsen
Norway
 
P

Paul G. Tobey [eMVP]

I think that what you might want is SetCleanRebootFlag() before
IOCTL_HAL_REBOOT, which clears the indicator in RAM that the system uses to
determine whether there is valid 'stuff' in the RAM filesystem and object
store. In C, its declaration is:

void SetCleanRebootFlag(void);

so it should be easy to P/Invoke.

Paul T.
 
C

Ctitanic

Here is the code for VB .NET that I found in somewhere, I really don't
remember where...

Public Function CTL_CODE( _
ByVal DeviceType As Integer, _
ByVal Func As Integer, _
ByVal Method As Integer, _
ByVal Access As Integer) As Integer

Return (DeviceType << 16) Or (Access << 14) Or (Func << 2) Or
Method

End Function 'CTL_CODE

<DllImport("Coredll.dll")> _
Public Function KernelIoControl _
( _
ByVal dwIoControlCode As Integer, _
ByVal lpInBuf As IntPtr, _
ByVal nInBufSize As Integer, _
ByVal lpOutBuf As IntPtr, _
ByVal nOutBufSize As Integer, _
ByRef lpBytesReturned As Integer _
) As Integer
End Function

Public Function ResetPocketPC() As Integer
Dim bytesReturned As Integer = 0
Dim IOCTL_HAL_REBOOT As Integer = CTL_CODE(FILE_DEVICE_HAL, _
15, METHOD_BUFFERED, FILE_ANY_ACCESS)
Return KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, _
IntPtr.Zero, 0, bytesReturned)
End Function 'ResetPocketPC
 

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

Similar Threads

Desktop or device 2
DateTimePicker - Where is it? 3
TabPage 2
Detecting network connection 5
Fileversion 3
Query SP version 3
Globalization of Menus 3
Timezone and Regional Settings 2

Top