[PATCH 4/5] msvcrt: Provide EXE entry points in importlib.

Jacek Caban jacek at codeweavers.com
Tue Jan 21 12:58:50 CST 2020

Signed-off-by: Jacek Caban <jacek at codeweavers.com>

Those are very minimalistic, but Wine is very minimalistic about used 
features, so it should be enough for our needs. We can extend it to 
support more features like DLL-aware atexit() or global constructors if 

After experimenting, I think that crt importlib seems the best place for 
this and it's what MSVC does. mingw instead has separated object files 
with entry point implementation that are linked into modules. Both this 
solution and having them in winecrt0 (which would be another 
possibility) introduces problematic dependency on msvcrt importlib. This 
can be done, but leads to some unpleasant problems with supporting 
multiple runtimes. Having it in crt importlibs will allow easy 

  dlls/msvcrt/Makefile.in    |  5 ++++
  dlls/msvcrt/crt_gccmain.c  | 31 ++++++++++++++++++++
  dlls/msvcrt/crt_main.c     | 59 +++++++++++++++++++++++++++++++++++++
  dlls/msvcrt/crt_winmain.c  | 58 ++++++++++++++++++++++++++++++++++++
  dlls/msvcrt/crt_wmain.c    | 59 +++++++++++++++++++++++++++++++++++++
  dlls/msvcrt/crt_wwinmain.c | 60 ++++++++++++++++++++++++++++++++++++++
  6 files changed, 272 insertions(+)
  create mode 100644 dlls/msvcrt/crt_gccmain.c
  create mode 100644 dlls/msvcrt/crt_main.c
  create mode 100644 dlls/msvcrt/crt_winmain.c
  create mode 100644 dlls/msvcrt/crt_wmain.c
  create mode 100644 dlls/msvcrt/crt_wwinmain.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-msvcrt-Provide-EXE-entry-points-in-importlib.txt
Type: text/x-patch
Size: 9477 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200121/c445d4d7/attachment-0001.bin>

More information about the wine-devel mailing list