Thanks for the PROBLEM-REPORT-FORM!
Are you sure you have ACE 5.5.4? This fix was added prior to 5.5.4:
Mon Oct 16 14:24:25 UTC 2006 Steve Huston <shu...@riverace.com>
* ace/WFMO_Reactor.cpp (ok_to_wait): In the ACE_HAS_WINCE
block,
change fwaitAll arg from TRUE to FALSE - it must be FALSE on
WinCE (thru WinMobile 5) per MSDN. Thanks to Drew Reynaud
<drewreynaud at hotmail dot com> for this fix.
-Steve
--
Steve Huston, Riverace Corporation
What do you want from ACE?
Take our survey at
http://acehelp.riverace.com//LoginSurvey.asp?SurveyID=106
-----Original Message-----
From: ace-bugs...@cse.wustl.edu
[mailto:ace-bugs...@cse.wustl.edu] On Behalf Of Kreger, Robert E
Sent: Thursday, November 30, 2006 6:09 AM
To: ace-...@cse.wustl.edu
Subject: [ace-bugs] Windows CE : Reactor does not work
ACE VERSION: 5.5.4
HOST MACHINE and OPERATING SYSTEM:
Windows 2003 SP1
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
COMPILER NAME AND VERSION (AND PATCHLEVEL):
OS: Microsoft Pocket PC Version 5.1.1.195
Manufacture: Fujitsu Siemens Computers
CPU: PXA270-624MHz
Visual Studio 2005
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
specific file, simply state which one]:
#include "ace/config-win32.h"
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
use a link to a platform-specific file, simply state which one
(unless this isn't used in this case, e.g., with Microsoft Visual
C++)]:
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
(used by MPC when you generate your own makefiles):
Used the default ace_WinCE.vcproj with a couple of minor linker
changes.
AREA/CLASS/EXAMPLE AFFECTED:
DOES THE PROBLEM AFFECT:
COMPILATION? No.
LINKING? No.
EXECUTION? Yes.
ACE is affected because it can't start a reactor.
OTHER (please specify)?
SYNOPSIS:
The call to WaitForMultipleOjbects in wfmo_reactor.cpp has an
invalid parameter.
DESCRIPTION:
The reactor fails to start because it can't wait on two events with
"wait for all" set to true.
As stated by Microsoft: Windows CE does not support fWaitAll being
set to true for WaitForMultipleOjbects.
Please see the artical:
http://msdn2.microsoft.com/en-US/library/aa450987.aspx
REPEAT BY:
I have attaced a zip file with the sample program that failes on
windows CE 5.0, but here are
the contents from main.
#include "stdafx.h"
#include <windows.h>
//ace
//This is our own custom auto link with ACE file, this would be a
nice addition to ace also
//I have attached it for your viewing pleasure.
#include "ace/link_with_ace.hpp"
#include "ace/Init_ACE.h"
#include "ace/os_main.h"
#include "ace/Reactor.h"
int ACE_TMAIN(int argc, ACE_TCHAR* argv[])
{
int lReturn = ACE_Reactor::instance()->run_reactor_event_loop();
if(lReturn == -1 )
{
::MessageBox(0,ACE_TEXT("ACE does not work on windows
ce"),ACE_TEXT(""),MB_OK);
}
return 0;
}
SAMPLE FIX/WORKAROUND:
Starting at around line 1755 in file WFMO_Reactor.cpp
#elif defined (ACE_HAS_WINCE)
//ACE 5.5.4 Bug Start
//result = ::WaitForMultipleObjects (sizeof
this->atomic_wait_array_ / sizeof (ACE_HANDLE),
// this->atomic_wait_array_,
// TRUE,
// timeout);
//break; // CE does not have WAIT_IO_COMPLETION defined.
//ACE 5.5.4 Bug Stop
//Fix Start
DWORD lSize = sizeof(this->atomic_wait_array_)/sizeof(ACE_HANDLE);
for(DWORD lIndex = 0; lIndex < lSize; ++lIndex)
{
result = ::WaitForMultipleObjects(1,
&this->atomic_wait_array_[lIndex],
FALSE, //this is key, ce only
supports false here
timeout);
//Break on first error
if (result != WAIT_OBJECT_0 )
break;
}
//Fix Start
break; // CE does not have WAIT_IO_COMPLETION defined.
#else
Thank you for the very fast response.
You are correct I have version 5.5 not 5.5.4, sorry.
I just looked at the 5.5.4 CE fix and I don't think it results
in the same functionality as on Win32.
1 ACE 5.5.4
1 #elif defined (ACE_HAS_WINCE)
1 result = ::WaitForMultipleObjects (sizeof
this->atomic_wait_array_ / sizeof (ACE_HANDLE),
1 this->atomic_wait_array_,
1 FALSE, // Must be FALSE on
WinCE
1 timeout);
1 break; // CE does not have WAIT_IO_COMPLETION defined.
1 #else
It looks like this will return when one handle is signaled; but
it should only return when both are, correct?
2 ACE 5.5 with my fix.
2 DWORD lSize = sizeof(this->atomic_wait_array_)/sizeof(ACE_HANDLE);
2 for(DWORD lIndex = 0; lIndex < lSize; ++lIndex)
2 {
2 result = ::WaitForMultipleObjects(1,
2 &this->atomic_wait_array_[lIndex],
2 FALSE, //this is key, ce only supports false here
2 timeout);
2 //Break on first error
2 if (result != WAIT_OBJECT_0 )
2 break;
2 }
I think this alternate fix will result in more similar
functionality to Win32.
Thanks,
Rob