#include #include #include #include "debug.h" // c:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i\notify.h int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { DWORD rc= 0; DebugSetLogfile("appevt.log"); if (_tcsstr(lpCmdLine, _T("disable"))) { if (!CeRunAppAtEvent(_T("repllog.exe"), NOTIFICATION_EVENT_NONE)) { error("CeRunAppAtEvent(none)"); return 1; } debug("disabled\n"); } else if (_tcsstr(lpCmdLine, _T("enable"))) { if (!CeRunAppAtEvent(_T("repllog.exe"), NOTIFICATION_EVENT_RNDIS_FN_DETECTED)) { error("CeRunAppAtEvent(rndis)"); return 1; } debug("enabled\n"); } else if (_tcsstr(lpCmdLine, _T("usboff"))) { rc= SetDevicePower(_T("UFN1:"), POWER_NAME, D4); } else if (_tcsstr(lpCmdLine, _T("usb"))) { rc= SetDevicePower(_T("UFN1:"), POWER_NAME, PwrDeviceUnspecified); } else if (_tcsstr(lpCmdLine, _T("usbon"))) { rc= SetDevicePower(_T("UFN1:"), POWER_NAME, D0); } debug("rc=%08lx\n", rc); return 0; }