From: <dan...@us...> - 2009-01-25 13:41:22
|
Revision: 1207 http://cegcc.svn.sourceforge.net/cegcc/?rev=1207&view=rev Author: dannybackx Date: 2009-01-25 13:41:11 +0000 (Sun, 25 Jan 2009) Log Message: ----------- Clear up the confusion, I hope. Modified Paths: -------------- trunk/cegcc/src/w32api/ChangeLog.ce trunk/cegcc/src/w32api/include/winbase.h Added Paths: ----------- trunk/cegcc/src/w32api/include/msgqueue.h trunk/cegcc/src/w32api/include/pm.h Modified: trunk/cegcc/src/w32api/ChangeLog.ce =================================================================== --- trunk/cegcc/src/w32api/ChangeLog.ce 2009-01-25 10:16:33 UTC (rev 1206) +++ trunk/cegcc/src/w32api/ChangeLog.ce 2009-01-25 13:41:11 UTC (rev 1207) @@ -1,3 +1,12 @@ +2009-01-25 Danny Backx <dan...@us...> + + * include/pm.h: Merge with version submitted by Lars Munch. + * include/winbase.h: Move SetSystemPowerState to pm.h for CE. + +2009-01-11 Danny Backx <dan...@us...> + + * include/pm.h, include/msgqueue.h: Add. + 2008-10-07 Pedro Alves <ped...@us...> * include/secext.h (EXTENDED_NAME_FORMAT): Allow on _WIN32_WCE >= Added: trunk/cegcc/src/w32api/include/msgqueue.h =================================================================== --- trunk/cegcc/src/w32api/include/msgqueue.h (rev 0) +++ trunk/cegcc/src/w32api/include/msgqueue.h 2009-01-25 13:41:11 UTC (rev 1207) @@ -0,0 +1,48 @@ +/* + * msgqueue.h + */ +#ifndef _MSGQUEUE_H_ +#define _MSGQUEUE_H_ + +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct MSGQUEUEOPTIONS_OS { + DWORD dwSize; + DWORD dwFlags; + DWORD dwMaxMessages; + DWORD cbMaxMessage; + BOOL bReadAccess; +} MSGQUEUEOPTIONS, *LPMSGQUEUEOPTIONS, *PMSGQUEUEOPTIONS; + +typedef struct MSGQUEUEINFO { + DWORD dwSize; + DWORD dwFlags; + DWORD dwMaxMessages; + DWORD cbMaxMessage; + DWORD dwCurrentMessages; + DWORD dwMaxQueueMessages; + WORD wNumReaders; + WORD wNumWriters; +} MSGQUEUEINFO, *PMSGQUEUEINFO, *LPMSGQUEUEINFO; + +HANDLE CreateMsgQueue(LPCWSTR lpszName, LPMSGQUEUEOPTIONS lpOptions); +BOOL CloseMsgQueue(HANDLE hMsgQ); +BOOL ReadMsgQueue(HANDLE hMsgQ, LPVOID lpBuffer, + DWORD cbBufferSize, LPDWORD lpNumberOfBytesRead, + DWORD dwTimeout, DWORD *pdwFlags); + +#define MSGQUEUE_NOPRECOMMIT 1 /* ?? */ +#define MSGQUEUE_ALLOW_BROKEN 2 /* ?? */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _MSGQUEUE_H_ */ Property changes on: trunk/cegcc/src/w32api/include/msgqueue.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/cegcc/src/w32api/include/pm.h =================================================================== --- trunk/cegcc/src/w32api/include/pm.h (rev 0) +++ trunk/cegcc/src/w32api/include/pm.h 2009-01-25 13:41:11 UTC (rev 1207) @@ -0,0 +1,101 @@ +/* + * pm.h + */ +#ifndef _PM_H_ +#define _PM_H_ + +#if __GNUC__ >= 3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32_WCE) && (_WIN32_WCE >= 0x0400) + +#define POWER_NAME (DWORD)(0x00000001) +#define POWER_FORCE (DWORD)(0x00001000) + +typedef enum _CEDEVICE_POWER_STATE { + PwrDeviceUnspecified = -1, + D0 = 0, + D1, + D2, + D3, + D4, + PwrDeviceMaximum +} CEDEVICE_POWER_STATE, *PCEDEVICE_POWER_STATE; + +typedef struct _POWER_CAPABILITIES { + UCHAR DeviceDx; + UCHAR WakeFromDx; + UCHAR InrushDx; + DWORD Power[5]; + DWORD Latency[5]; + DWORD Flags; +} POWER_CAPABILITIES, *PPOWER_CAPABILITIES; + +typedef struct { + DWORD Message; + DWORD Flags; + DWORD Length; + WCHAR SystemPowerState[1]; +} POWER_BROADCAST, *PPOWER_BROADCAST; + +typedef struct _POWER_BROADCAST_POWER_INFO { + DWORD dwBatteryLifeTime; + DWORD dwBatteryFullLifeTime; + DWORD dwBackupBatteryLifeTime; + DWORD dwBackupBatteryFullLifeTime; + BYTE bACLineStatus; + BYTE bBatteryFlag; + BYTE bBatteryLifePercent; + BYTE bBackupBatteryFlag; + BYTE bBackupBatteryLifePercent; +} POWER_BROADCAST_POWER_INFO, *PPOWER_BROADCAST_POWER_INFO; + +/* Power broadcast values are guessed by experimentation */ +#define PBT_RESUME 2 + +HANDLE SetPowerRequirement( + PVOID pvDevice, + CEDEVICE_POWER_STATE DeviceState, + ULONG DeviceFlags, + PVOID pvSystemState, + ULONG StateFlags); + +DWORD ReleasePowerRequirement(HANDLE hPowerReq); + +#define POWER_STATE(f) ((f) & 0xFFFF0000) // power state mask +#define POWER_STATE_ON (DWORD)(0x00010000) // on state +#define POWER_STATE_OFF (DWORD)(0x00020000) // no power, full off +#define POWER_STATE_CRITICAL (DWORD)(0x00040000) // critical off +#define POWER_STATE_BOOT (DWORD)(0x00080000) // boot state +#define POWER_STATE_IDLE (DWORD)(0x00100000) // idle state +#define POWER_STATE_SUSPEND (DWORD)(0x00200000) // suspend state +#define POWER_STATE_UNATTENDED (DWORD)(0x00400000) // Unattended state. +#define POWER_STATE_RESET (DWORD)(0x00800000) // reset state +#define POWER_STATE_USERIDLE (DWORD)(0x01000000) // user idle state +#define POWER_STATE_PASSWORD (DWORD)(0x10000000) // This state is password protected. + +HANDLE RequestPowerNotifications(HANDLE hMsgQ, DWORD Flags); +BOOL StopPowerNotifications(HANDLE h); + +DWORD DevicePowerNotify(PVOID,CEDEVICE_POWER_STATE,DWORD); +DWORD GetDevicePower(PVOID,DWORD,PCEDEVICE_POWER_STATE); +DWORD GetSystemPowerState(LPWSTR,DWORD,PDWORD); +HANDLE RegisterPowerRelationship(PVOID,PVOID,PPOWER_CAPABILITIES,DWORD); +DWORD ReleasePowerRelationship(HANDLE); +DWORD SetDevicePower(PVOID,DWORD,CEDEVICE_POWER_STATE); +DWORD SetSystemPowerState(LPCWSTR,DWORD,DWORD); + + +#endif /* _WIN32_WCE */ + +#ifdef __cplusplus +} +#endif + +#endif /* _PM_H_ */ + Property changes on: trunk/cegcc/src/w32api/include/pm.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/cegcc/src/w32api/include/winbase.h =================================================================== --- trunk/cegcc/src/w32api/include/winbase.h 2009-01-25 10:16:33 UTC (rev 1206) +++ trunk/cegcc/src/w32api/include/winbase.h 2009-01-25 13:41:11 UTC (rev 1207) @@ -2027,10 +2027,7 @@ WINBASEAPI BOOL WINAPI SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR,BOOL,PACL,BOOL); WINBASEAPI BOOL WINAPI SetStdHandle(DWORD,HANDLE); #define SetSwapAreaSize(w) (w) -#if (_WIN32_WCE >= 0x0400) -WINBASEAPI DWORD WINAPI SetSystemPowerState(LPCWSTR, DWORD, DWORD); -#else -/* Only on Windows Server 2008, Windows Server 2003, or Windows 2000 Server. */ +#if !defined (_WIN32_WCE) WINBASEAPI BOOL WINAPI SetSystemPowerState(BOOL,BOOL); #endif WINBASEAPI BOOL WINAPI SetSystemTime(const SYSTEMTIME*); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |