[PATCH] user32: Add EnableNonClientDpiScaling stub.

Zhiyi Zhang zzhang at codeweavers.com
Wed Feb 19 09:21:00 CST 2020



On 2/19/20 11:00 PM, Sven Baars wrote:
> Signed-off-by: Sven Baars <sbaars at codeweavers.com>
> ---
> This stops No Man Sky from crashing on start with Proton.
>
>  dlls/user32/user32.spec | 1 +
>  dlls/user32/win.c       | 9 +++++++++
>  include/winuser.h       | 1 +
>  3 files changed, 11 insertions(+)
>
> diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
> index 1aedc32de2..d2a1487971 100644
> --- a/dlls/user32/user32.spec
> +++ b/dlls/user32/user32.spec
> @@ -205,6 +205,7 @@
>  @ stdcall EmptyClipboard()
>  @ stdcall EnableMenuItem(long long long)
>  @ stdcall EnableMouseInPointer(long)
> +@ stdcall EnableNonClientDpiScaling(long)
>  @ stdcall EnableScrollBar(long long long)
>  @ stdcall EnableWindow(long long)
>  @ stdcall EndDeferWindowPos(long)
> diff --git a/dlls/user32/win.c b/dlls/user32/win.c
> index 3323ed3e41..eb2fa70edd 100644
> --- a/dlls/user32/win.c
> +++ b/dlls/user32/win.c
> @@ -4244,3 +4244,12 @@ BOOL WINAPI SetWindowCompositionAttribute(HWND hwnd, void *data)
>      SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
>      return FALSE;
>  }
> +
> +/**********************************************************************
> + *              EnableNonClientDpiScaling (USER32.@)
> + */
> +BOOL WINAPI EnableNonClientDpiScaling(HWND hwnd)
> +{
> +    FIXME("(%p): stub\n", hwnd);
> +    return FALSE;
> +}
Since you are returning a FALSE to indicate failure.
You should call SetLastError(ERROR_CALL_NOT_IMPLEMENTED)
to set error code as well.

> diff --git a/include/winuser.h b/include/winuser.h
> index 718f6e1c54..5fd774d295 100644
> --- a/include/winuser.h
> +++ b/include/winuser.h
> @@ -3702,6 +3702,7 @@ WINUSERAPI INT         WINAPI DrawTextExW(HDC,LPWSTR,INT,LPRECT,UINT,LPDRAWTEXTP
>  WINUSERAPI BOOL        WINAPI EmptyClipboard(void);
>  WINUSERAPI BOOL        WINAPI EnableMenuItem(HMENU,UINT,UINT);
>  WINUSERAPI BOOL        WINAPI EnableMouseInPointer(BOOL);
> +WINUSERAPI BOOL        WINAPI EnableNonClientDpiScaling(HWND);
>  WINUSERAPI BOOL        WINAPI EnableScrollBar(HWND,UINT,UINT);
>  WINUSERAPI BOOL        WINAPI EnableWindow(HWND,BOOL);
>  WINUSERAPI BOOL        WINAPI EndDeferWindowPos(HDWP);




More information about the wine-devel mailing list