Windows CE Restart



  • Hallo,

    ich progge gerade mit dem eMbedded VC++ für CE...da gibts irgendwie kein ExitWindowsEx und kumpanen 😕 wie kann ich denn nen soft reset bei CE erreichen...

    weiß das jemand 🙂



  • Hi!

    Try the following code:

    extern "C" // Use extern "c" for C++ file only
    {
    #include "PKFUNCS.H"
    };

    ...

    KernelIoControl(IOCTL_HAL_REBOOT,
    NULL, 0,
    NULL, 0,
    NULL);

    Hope this helps.
    astrid
    PS: The NG microsoft.public.windowsce.app.development would be a better place to ask!



  • Hallo,

    schaut ja ganz gut aus aber ich hab kein "PKFUNCS.H" file?!
    also auch kein KernelIoControl... 😞

    was tun 😕

    [ Dieser Beitrag wurde am 19.02.2003 um 15:23 Uhr von RPD editiert. ]



  • #ifdef __cplusplus 
        extern "C" {
    #endif
        BOOL KernelIoControl(
            DWORD dwIoControlCode, 
            LPVOID lpInBuf, DWORD nInBufSize, 
            LPVOID lpOutBuf, 
            DWORD nOutBufSize, 
            LPDWORD lpBytesReturned);
    #ifdef __cplusplus 
    }
    #endif
    


  • First you need some definitions that are not included in Pocket PC SDK, but you can find it in <pkfuncs.h> file from the Platform Builder ( 😕 ).



  • ich hab das ganze platform sdk. da is kein pkfuncs.h 😞
    hat jemand das? und wenn woher...



  • wahrscheinlich:

    Platform SDK != Platform Builder

    Ich glaub dieser Platform Builder kostet glaub ich was. GOOGLE einfach.
    Aber die Deklaration von KernelIoControl sollte doch reichen. Außer das brauch noch irgendwelche Libs.



  • ok ich brauch noch die Coredll.dll...

    was bleibt ist das IOCTL_HAL_REBOOT unbekannt ist, wie muß ich den den definen?
    😕



  • #define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
    


  • merci, so hab code gegoogelt der macht nen hard reset

    #include <winioctl.h >
    #define IOCTL_HAL_REBOOT CTL_CODE(FILE_DEVICE_HAL, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
    
    extern "C" __declspec(dllimport)void SetCleanRebootFlag(void);
    
    extern "C" __declspec(dllimport) BOOL KernelIoControl(
        DWORD dwIoControlCode, 
        LPVOID lpInBuf, 
        DWORD nInBufSize, 
        LPVOID lpOutBuf, 
        DWORD nOutBufSize, 
        LPDWORD lpBytesReturned);
    
    BOOL HardResetPocketPC()
    {
        SetCleanRebootFlag();
        return KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
    }
    

    ich brauch aber nen soft reset, sonst is ja alles weg, was nicht der sinn der sache ist... 🙂



  • sorry 🙄
    wußte ich nicht. ich kenn mich sowieso nicht mit den teilen aus. hab das nur per google gefunden. :p



  • Trotzdem vielen dank!

    so geht der soft reset...

    #include <winioctl.h>
    
    #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, 
        LPVOID lpOutBuf, 
        DWORD nOutBufSize, 
        LPDWORD lpBytesReturned);
    
    BOOL ResetPocketPC()
    {
        return KernelIoControl(IOCTL_HAL_REBOOT, NULL, 0, NULL, 0, NULL);
    }
    

    😉 😃

    danke nochmal...



  • 🙂

    Also lags an SetCleanRebootFlag(); ? Oder was ist der Unterschied? 😕



  • exactly 😉 🕶


Anmelden zum Antworten