[PATCH v2] api-ms-win-crt-private-l1-1-0: Implement _o__fileno, _o__setmode, _o__wfopen

Qian Hong fracting at gmail.com
Fri May 15 13:14:07 CDT 2020


Hi Emilio,

Thanks for the work, I love your blog post.
It's interesting that you wrote:
"""
the above two wouldn’t actually be that much of a problem if … Wine
wasn’t slow. When running full fledged applications or games, it
really isn’t, but there is a very noticeable overhead when running a
lot of short-lived processes. That accumulates to several minutes over
a full Firefox compilation.
"""

I was working on using Wine as a cross-compile platform a few years
ago, and I encountered exactly the same problem.
Sabastian wrote a patch to improve Wine performance for short-lived
processes, I recommend you to give it a try, it brought significant
improvement for me:
https://github.com/wine-staging/wine-staging/tree/master/patches/gdi32-Lazy_Font_Initialization

Hopefully, someone would review the Wine-Staging patch and bring it to
Wine master branch someday :)
(Our Wine-Staging maintainers are doing an amazing job on upstreaming
patches, thank you!)

On Sat, 16 May 2020 at 03:50, Emilio Cobos Álvarez <emilio at crisal.io> wrote:
>
> By delegating to the ucrtbase implementation.
>
> This allows me to get a Firefox build cross-compiled as described in [1], but with newer MSVC
> versions.
>
> [1]: https://glandium.org/blog/?p=4020
>
> Signed-off-by: Emilio Cobos Álvarez <emilio at crisal.io>
> ---
>  .../api-ms-win-crt-private-l1-1-0.spec                      | 6 +++---
>  dlls/ucrtbase/ucrtbase.spec                                 | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
> index 8d6ff5e89f..8e00661c8c 100644
> --- a/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
> +++ b/dlls/api-ms-win-crt-private-l1-1-0/api-ms-win-crt-private-l1-1-0.spec
> @@ -270,7 +270,7 @@
>  @ stub _o__fgetwchar
>  @ stub _o__filelength
>  @ stub _o__filelengthi64
> -@ stub _o__fileno
> +@ cdecl _o__fileno(ptr) ucrtbase._o__fileno
>  @ stub _o__findclose
>  @ stub _o__findfirst32
>  @ stub _o__findfirst32i64
> @@ -673,7 +673,7 @@
>  @ stub _o__set_thread_local_invalid_parameter_handler
>  @ stub _o__seterrormode
>  @ stub _o__setmbcp
> -@ stub _o__setmode
> +@ cdecl _o__setmode(long long) ucrtbase._o__setmode
>  @ stub _o__setsystime
>  @ stub _o__sleep
>  @ stub _o__sopen
> @@ -832,7 +832,7 @@
>  @ stub _o__wfindnext32i64
>  @ stub _o__wfindnext64
>  @ stub _o__wfindnext64i32
> -@ stub _o__wfopen
> +@ cdecl _o__wfopen(wstr wstr) ucrtbase._o__wfopen
>  @ stub _o__wfopen_s
>  @ stub _o__wfreopen
>  @ stub _o__wfreopen_s
> diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
> index d7c0700696..2d77c74274 100644
> --- a/dlls/ucrtbase/ucrtbase.spec
> +++ b/dlls/ucrtbase/ucrtbase.spec
> @@ -934,7 +934,7 @@
>  @ stub _o__fgetwchar
>  @ stub _o__filelength
>  @ stub _o__filelengthi64
> -@ stub _o__fileno
> +@ cdecl _o__fileno(ptr) MSVCRT__fileno
>  @ stub _o__findclose
>  @ stub _o__findfirst32
>  @ stub _o__findfirst32i64
> @@ -1337,7 +1337,7 @@
>  @ stub _o__set_thread_local_invalid_parameter_handler
>  @ stub _o__seterrormode
>  @ stub _o__setmbcp
> -@ stub _o__setmode
> +@ cdecl _o__setmode(long long) MSVCRT__setmode
>  @ stub _o__setsystime
>  @ stub _o__sleep
>  @ stub _o__sopen
> @@ -1496,7 +1496,7 @@
>  @ stub _o__wfindnext32i64
>  @ stub _o__wfindnext64
>  @ stub _o__wfindnext64i32
> -@ stub _o__wfopen
> +@ cdecl _o__wfopen(wstr wstr) MSVCRT__wfopen
>  @ stub _o__wfopen_s
>  @ stub _o__wfreopen
>  @ stub _o__wfreopen_s
> --
> 2.26.2
>
>


-- 
Regards,
Qian Hong



More information about the wine-devel mailing list