From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/win32u/class.c | 10 ++++++---- server/class.c | 4 ++++ server/protocol.def | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dlls/win32u/class.c b/dlls/win32u/class.c index 06c9dcc4600..19663e6dce9 100644 --- a/dlls/win32u/class.c +++ b/dlls/win32u/class.c @@ -676,6 +676,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *nam req->client_ptr = wine_server_client_ptr( class ); req->atom = wine_server_add_atom( req, name ); req->fnid = fnid; + req->ansi = ansi; req->name_offset = version->Length / sizeof(WCHAR); ret = !wine_server_call_err( req ); locator = reply->locator; @@ -925,7 +926,7 @@ INT WINAPI NtUserGetClassName( HWND hwnd, BOOL real, UNICODE_STRING *name ) } /* Set class info with the wine server. */ -static BOOL server_set_class_info( HWND hwnd, INT offset, LONG_PTR newval, UINT size, ULONG_PTR *oldval ) +static BOOL server_set_class_info( HWND hwnd, INT offset, LONG_PTR newval, UINT size, ULONG_PTR *oldval, BOOL ansi ) { BOOL ret; @@ -935,6 +936,7 @@ static BOOL server_set_class_info( HWND hwnd, INT offset, LONG_PTR newval, UINT req->offset = offset; req->size = size; req->new_info = newval; + req->ansi = ansi; ret = !wine_server_call_err( req ); *oldval = reply->old_info; } @@ -959,18 +961,18 @@ static ULONG_PTR set_class_long_size( HWND hwnd, INT offset, LONG_PTR newval, UI case GCLP_HICONSM: case GCLP_HMODULE: case GCLP_MENUNAME: - server_set_class_info( hwnd, offset, newval, size, &retval ); + server_set_class_info( hwnd, offset, newval, size, &retval, ansi ); break; case GCLP_WNDPROC: newval = (ULONG_PTR)alloc_winproc( (WNDPROC)newval, ansi ); - if (!server_set_class_info( hwnd, offset, newval, size, &retval )) break; + if (!server_set_class_info( hwnd, offset, newval, size, &retval, ansi )) break; retval = (ULONG_PTR)get_winproc( (WNDPROC)retval, ansi ); break; case GCL_CBCLSEXTRA: /* cannot change this one */ RtlSetLastWin32Error( ERROR_INVALID_PARAMETER ); break; default: - if (offset >= 0) server_set_class_info( hwnd, offset, newval, size, &retval ); + if (offset >= 0) server_set_class_info( hwnd, offset, newval, size, &retval, ansi ); else RtlSetLastWin32Error( ERROR_INVALID_INDEX ); break; } diff --git a/server/class.c b/server/class.c index 28e263b0395..8a2f56b4473 100644 --- a/server/class.c +++ b/server/class.c @@ -47,6 +47,7 @@ struct window_class atom_t atom; /* class atom for versioned class */ unsigned int fnid; /* builtin control FNID, or 0 */ client_ptr_t client_ptr; /* pointer to class in client address space */ + bool ansi; /* class wndproc is ansi */ class_shm_t *shared; /* class in session shared memory */ }; @@ -60,6 +61,7 @@ static struct window_class *create_class( struct process *process, int local, in class->process = (struct process *)grab_object( process ); class->count = 0; + class->ansi = false; if (!(class->shared = alloc_shared_object( offsetof(class_shm_t, extra[cls_extra]) ))) goto failed; @@ -252,6 +254,7 @@ DECL_HANDLER(create_class) class->atom = atom; class->fnid = req->fnid; class->client_ptr = req->client_ptr; + class->ansi = !!req->ansi; SHARED_WRITE_BEGIN( class->shared, class_shm_t ) { @@ -330,6 +333,7 @@ DECL_HANDLER(set_class_info) case GCLP_WNDPROC: reply->old_info = shared->info.wndproc; shared->info.wndproc = req->new_info; + class->ansi = !!req->ansi; break; case GCLP_HCURSOR: reply->old_info = shared->info.cursor; diff --git a/server/protocol.def b/server/protocol.def index 3adb403e9c1..9a105d2536c 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -3298,6 +3298,7 @@ enum caret_state @REQ(create_class) atom_t atom; /* class atom */ unsigned int fnid; /* FNID for builtin classes, or 0 */ + unsigned int ansi; /* class wndproc is ansi */ client_ptr_t client_ptr; /* pointer to class in client address space */ data_size_t name_offset; /* base class name offset for specified atom */ VARARG(info,class_info); /* class info */ @@ -3326,6 +3327,7 @@ enum caret_state int offset; /* offset of the info */ data_size_t size; /* size of the info value to write */ lparam_t new_info; /* new class info value */ + unsigned int ansi; /* new class info is ansi */ @REPLY lparam_t old_info; /* previous class info value */ @END -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11123