Hi Marius, You provided a very detailed and useful description for those who might hit similar problems. I know nothing about WACK. But I ported Xerces to Windows CE 5.0 and later family (embedded). During the porting, I did quite similar steps as you describe. But I think Windows CE and Windows Compact 2013 were less restrictive than WACK. Some comments are below.
XERCES_USE_TRANSCODER_WINDOWS -> XERCES_USE_TRANSCODER_ICONV XERCES_USE_WIN32_MSGLOADER -> XERCES_USE_MSGLOADER_INMEMORY Yes, I did this as well. Remove the preprocessors definition related to NETACCESSOR. Yes. WindowsMutexMgr.cpp worked for me, as InitializeCriticalSection is available in Windows CE. However I decided to use XERCES_USE_MUTEXMGR_NOTHREAD, as I wanted full manual control over threads in my application. I had some minor problems with WindowsFileMgr.cpp, but eventually I managed to port it after some changes, as I thought it is too restrictive to use just strings and to have no access to file buffering (I do not remember what exactly I did two years ago, but I can look at my version control system if needed). Cheers, Igor > Sent: Monday, October 30, 2017 at 10:23 AM > From: "Marius Cojocaru" <mariusade...@gmail.com> > To: c-users@xerces.apache.org > Subject: Re: Xerces DLL WACK validation for windows store application > > Hello Igor, > > Your answer did provide a hint on how to keep trying making changes in the > xerces project to be able to pass validation but the actual fix required > quite a few steps in making this work. > > The changes required for making xerces.3.1.1 WACK compatible (XercesLib > project only) are the following: > > 1. Change the preprocessors definition: > XERCES_USE_TRANSCODER_WINDOWS -> XERCES_USE_TRANSCODER_ICONV > XERCES_USE_WIN32_MSGLOADER -> XERCES_USE_MSGLOADER_INMEMORY > > 2. Remove the preprocessors definition related to NETACCESSOR > > 3. WindowsMutexMgr.cpp is using InitializeCriticalSection(newCS); > The function is not available for windows 8.1 app build. > There are 2 options: > 3.1. Replace InitializeCriticalSection(newCS) with > InitializeCriticalSectionEx(newCS, 0, 0) > 3.2. Replace preprocessor definition XERCES_USE_MUTEXMGR_WINDOWS with > XERCES_USE_MUTEXMGR_NOTHREAD but this will make Xerces not thread safe. > > 4. WindowsFileMgr.cpp has many incompatible function calls. If you remove > the XERCES_USE_FILEMGR_WINDOWS there will be a compiler error stating that > "No File Manager configured for platform! You must configure it." > There are 2 options: > 4.1. comment the line mgr = new (memmmgr) WindowsFileMgr; from > PlatformUtils.cpp > 4.2. Remove XERCES_USE_FILEMGR_WINDOWS and comment (from PlatformUtils.cpp) > the line #error No File Manager configured for platform! You must configure > it. > I think that the pragma error should not be present there, because it is > possible to use xerces without reading files, only by sending strings. > > 5. In visual studio, make sure to remove the files that are not needed and > add the correct ones or you will still get compilation errors. > e.g. remove Win32TransService.cpp and add IconvTransService.cpp > > Please let me know if any of the above steps seem like a terrible idea to > do. > > Best regards, > Marius Cojocaru > > PS I hope the instructions are clear enough and that they could apply for > newer versions of Xerces (I needed Xerces 3.1.1 for my project) > I did not mention the steps required to make the XercesLib project have a > (Windows 8.1) statement and get the compiler complain about some existing > functions but this is beyond the explanation of this thread. > > On Sat, Oct 28, 2017 at 4:14 PM, Igor Toujilov <name1390453...@mail.com> > wrote: > > > Hi Marius, > > I know Win32TransService causes problems because it uses registry keys, > > which are Windows version-specific. That is why in my Windows projects I do > > not use Windows-specific preprocessor definitions even when compiling to > > native Windows libraries. This will disable Win32TransService, and Xerces > > will use its own transcoding functions instead. I hope this configuration > > will work for you as well. > > > > Cheers, > > Igor > > > > > > > Sent: Saturday, October 28, 2017 at 1:48 PM > > > From: "Marius Cojocaru" <mariusade...@gmail.com> > > > To: c-users@xerces.apache.org > > > Subject: Re: Xerces DLL WACK validation for windows store application > > > > > > Hello Igor, > > > Thank you for the quick reply. However, the problem is still there > > because > > > the xerces code contains calls to system functions that are not allowed > > by > > > wack certificate. > > > One example is the function getenv() that is used in one place, but there > > > are several other calls to functions that access the registry and are not > > > allowed. Those functions are present in the files mentioned in the > > previous > > > email. > > > > > > Best regards, > > > Marius Cojocaru > > > > > > On Oct 28, 2017 15:33, "Igor Toujilov" <name1390453...@mail.com> wrote: > > > > > > > Hi Marius, > > > > You can take the Xerces source code, create a Windows DLL project from > > it, > > > > add required features like a WACK certificate, and compile it. > > > > > > > > Cheers, > > > > Igor > > > > > > > > > > > > > Sent: Friday, October 27, 2017 at 1:30 PM > > > > > From: "Marius Cojocaru" <mariusade...@gmail.com> > > > > > To: c-users@xerces.apache.org > > > > > Subject: Xerces DLL WACK validation for windows store application > > > > > > > > > > Hello, > > > > > > > > > > My name is Marius Cojocaru and I am using xerces 3.1 succesfully on a > > > > > company project. > > > > > Common code is used to compile the project on linux and windows for > > > > > building an API. > > > > > A request has been made to support windows applications (windows 8.1 > > SDK) > > > > > and I am not able to validate the xerces DLLs for that purpose. > > > > > There are a lot of unsupported calls from Win32TransService and > > > > > Win32MsgLoader. > > > > > I tried using xerces 3.2 as well but the same issues are found. > > > > > Do you know if it is even possible to create a WACK certified dll for > > > > > apache Xerces or should I move to using native parsers like > > System.xml > > > > (or > > > > > MSXML or XMLLie) on windows 8.1 sdk. > > > > > > > > > > Best regards, > > > > > Marius Cojocaru > > > > > > > > > > > > > > >