eclipse-4diac / 4diac-forte

Eclipse Public License 2.0
31 stars 33 forks source link

win32: Forte as a Windows service #106

Open kumajaya opened 7 months ago

kumajaya commented 7 months ago

Hijack main entry point and replaced by wmain for Windows service entry. Keep all files header description including the license statement. Not sure about the license compatibility to Eclise's EPL.

Based on: https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/master/OneCodeTeam/A%20basic%20Windows%20service%20in%20C%2B%2B%20(CppWindowsService)%202

FORTE as a Windows service current status:

kumajaya commented 7 months ago

@azoitl With this changes, main.cpp looks messy now. How if I keep SampleService.cpp as a separate file and then create some dummies function call (endForte and _main) in test/arch/win32/* to make forte test build happy? Or how to tell forte test build to exclude some files?

kumajaya commented 7 months ago

Ready for review, no more crashes listed in Windows Logs. Need an opinion on the dummies function in forte_boost_tester.cpp, is there a better solution?

kumajaya commented 7 months ago

Ready for review, no more crashes listed in Windows Logs. Need an opinion on the dummies function in forte_boost_tester.cpp, is there a better solution?

Just found the solution. I will push update later today.

kumajaya commented 7 months ago

Finish. Change trackable per commit.

kumajaya commented 7 months ago

Run service on LocalSystem account to make it have a permission to write log file, for compatibility to Windows 7. Use unicode version of freopen to reduce string conversion.

kumajaya commented 6 months ago

Change the logging redirection using a more portable and simple way by manipulating rdbuf.