From e3665f5f9a5e3773cf60847bbf2f4cd8e5000ca2 Mon Sep 17 00:00:00 2001
From: Vitaly Perov <vitperov@etersoft.ru>
Date: Fri, 29 Jul 2011 18:01:37 +0400
Subject: [PATCH] Revert "fix WINPROC_AllocProc args (eterbug #6585), it broke
 regedit right menu"

This reverts commit 36400dff7869d6a7a2d9867f4122a67ae67b240b.
---
 dlls/user32/win.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index 6c8d8a4..d2f9f53 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -2225,7 +2225,10 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
             retval = WIN_GetWindowLong( hwnd, offset, size, unicode );
             GetClassNameA(hwnd,classname,sizeof classname);
             TRACE("classname = %s\n",classname);
-            proc = WINPROC_AllocProc( NULL, unicode && strcmp(classname,"V8Window") );
+            if ( unicode && strcmp(classname,"V8Window") ) 
+                proc = WINPROC_AllocProc( NULL, (WNDPROC)newval );
+            else 
+                proc = WINPROC_AllocProc( (WNDPROC)newval, NULL );
             if (proc) 
                 wndPtr->winproc = proc;
             if (WINPROC_IsUnicode( proc, unicode )) 
@@ -2237,7 +2240,8 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
         {
             retval = (ULONG_PTR)WINPROC_GetProc( wndPtr->winproc, unicode );
 
-            proc = WINPROC_AllocProc( (WNDPROC)newval, unicode );
+            if (unicode) proc = WINPROC_AllocProc( NULL, (WNDPROC)newval );
+            else proc = WINPROC_AllocProc( (WNDPROC)newval, NULL );
             if (proc) wndPtr->winproc = proc;
             if (WINPROC_IsUnicode( proc, unicode )) wndPtr->flags |= WIN_ISUNICODE;
             else wndPtr->flags &= ~WIN_ISUNICODE;
-- 
1.7.5.4
