Commit 6055d04f authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

comctl32/tests: Fix some problems revealed by compilation in 64-bit mode.

parent 2d830632
...@@ -137,7 +137,7 @@ struct subclass_info ...@@ -137,7 +137,7 @@ struct subclass_info
static LRESULT WINAPI datetime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI datetime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -182,9 +182,9 @@ static HWND create_datetime_control(DWORD style, DWORD exstyle) ...@@ -182,9 +182,9 @@ static HWND create_datetime_control(DWORD style, DWORD exstyle)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(hWndDateTime, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(hWndDateTime, GWLP_WNDPROC,
(LONG)datetime_subclass_proc); (LONG_PTR)datetime_subclass_proc);
SetWindowLongA(hWndDateTime, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hWndDateTime, GWLP_USERDATA, (LONG_PTR)info);
return hWndDateTime; return hWndDateTime;
} }
......
...@@ -402,7 +402,7 @@ struct subclass_info ...@@ -402,7 +402,7 @@ struct subclass_info
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -533,9 +533,9 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems) ...@@ -533,9 +533,9 @@ static HWND create_custom_header_control(HWND hParent, BOOL preloadHeaderItems)
SetWindowPos(childHandle, winpos.hwndInsertAfter, winpos.x, winpos.y, SetWindowPos(childHandle, winpos.hwndInsertAfter, winpos.x, winpos.y,
winpos.cx, winpos.cy, 0); winpos.cx, winpos.cy, 0);
info->oldproc = (WNDPROC)SetWindowLongA(childHandle, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(childHandle, GWLP_WNDPROC,
(LONG)header_subclass_proc); (LONG_PTR)header_subclass_proc);
SetWindowLongA(childHandle, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(childHandle, GWLP_USERDATA, (LONG_PTR)info);
return childHandle; return childHandle;
} }
......
...@@ -212,7 +212,7 @@ static HWND create_parent_window(void) ...@@ -212,7 +212,7 @@ static HWND create_parent_window(void)
static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -256,9 +256,9 @@ static HWND create_listview_control(void) ...@@ -256,9 +256,9 @@ static HWND create_listview_control(void)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG)listview_subclass_proc); (LONG_PTR)listview_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd; return hwnd;
} }
...@@ -286,16 +286,16 @@ static HWND create_custom_listview_control(DWORD style) ...@@ -286,16 +286,16 @@ static HWND create_custom_listview_control(DWORD style)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG)listview_subclass_proc); (LONG_PTR)listview_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd; return hwnd;
} }
static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -326,9 +326,9 @@ static HWND subclass_header(HWND hwndListview) ...@@ -326,9 +326,9 @@ static HWND subclass_header(HWND hwndListview)
return NULL; return NULL;
hwnd = ListView_GetHeader(hwndListview); hwnd = ListView_GetHeader(hwndListview);
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG)header_subclass_proc); (LONG_PTR)header_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd; return hwnd;
} }
...@@ -773,13 +773,13 @@ static void test_customdraw(void) ...@@ -773,13 +773,13 @@ static void test_customdraw(void)
insert_column(hwnd, 1); insert_column(hwnd, 1);
insert_item(hwnd, 0); insert_item(hwnd, 0);
oldwndproc = (WNDPROC)SetWindowLongPtr(hwndparent, GWL_WNDPROC, oldwndproc = (WNDPROC)SetWindowLongPtr(hwndparent, GWLP_WNDPROC,
(INT_PTR)cd_wndproc); (LONG_PTR)cd_wndproc);
InvalidateRect(hwnd, NULL, TRUE); InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd); UpdateWindow(hwnd);
SetWindowLongPtr(hwndparent, GWL_WNDPROC, (INT_PTR)oldwndproc); SetWindowLongPtr(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc);
DestroyWindow(hwnd); DestroyWindow(hwnd);
} }
......
...@@ -441,7 +441,7 @@ static HWND create_parent_window(void) ...@@ -441,7 +441,7 @@ static HWND create_parent_window(void)
static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -487,9 +487,9 @@ static HWND create_monthcal_control(DWORD style, HWND parent_window) ...@@ -487,9 +487,9 @@ static HWND create_monthcal_control(DWORD style, HWND parent_window)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(hwnd, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC,
(LONG)monthcal_subclass_proc); (LONG_PTR)monthcal_subclass_proc);
SetWindowLongA(hwnd, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hwnd, GWLP_USERDATA, (LONG_PTR)info);
return hwnd; return hwnd;
} }
......
...@@ -343,7 +343,7 @@ struct subclass_info ...@@ -343,7 +343,7 @@ struct subclass_info
static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -397,8 +397,8 @@ static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT ...@@ -397,8 +397,8 @@ static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT
assert(tabHandle); assert(tabHandle);
info->oldproc = (WNDPROC)SetWindowLongA(tabHandle, GWL_WNDPROC, (LONG)tabSubclassProcess); info->oldproc = (WNDPROC)SetWindowLongPtrA(tabHandle, GWLP_WNDPROC, (LONG_PTR)tabSubclassProcess);
SetWindowLongA(tabHandle, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(tabHandle, GWLP_USERDATA, (LONG_PTR)info);
tcNewTab.mask = mask; tcNewTab.mask = mask;
......
...@@ -445,7 +445,7 @@ static HWND create_parent_window(void){ ...@@ -445,7 +445,7 @@ static HWND create_parent_window(void){
} }
static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ static LRESULT WINAPI trackbar_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
struct subclass_info *info = (struct subclass_info *) GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *) GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -485,9 +485,9 @@ static HWND create_trackbar(DWORD style, HWND parent){ ...@@ -485,9 +485,9 @@ static HWND create_trackbar(DWORD style, HWND parent){
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(hWndTrack, GWL_WNDPROC, (LONG)trackbar_subclass_proc); info->oldproc = (WNDPROC)SetWindowLongPtrA(hWndTrack, GWLP_WNDPROC, (LONG_PTR)trackbar_subclass_proc);
SetWindowLongA(hWndTrack, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(hWndTrack, GWLP_USERDATA, (LONG_PTR)info);
return hWndTrack; return hWndTrack;
} }
......
...@@ -574,7 +574,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP ...@@ -574,7 +574,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
WNDPROC *lpOldProc = (WNDPROC*)GetWindowLongA(hwnd, GWL_USERDATA); WNDPROC lpOldProc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
msg.message = message; msg.message = message;
msg.flags = sent|wparam|lparam; msg.flags = sent|wparam|lparam;
...@@ -584,7 +584,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP ...@@ -584,7 +584,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
add_message(MsgSequences, LISTVIEW_SEQ_INDEX, &msg); add_message(MsgSequences, LISTVIEW_SEQ_INDEX, &msg);
defwndproc_counter++; defwndproc_counter++;
ret = CallWindowProcA(*lpOldProc, hwnd, message, wParam, lParam); ret = CallWindowProcA(lpOldProc, hwnd, message, wParam, lParam);
defwndproc_counter--; defwndproc_counter--;
return ret; return ret;
...@@ -592,7 +592,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP ...@@ -592,7 +592,7 @@ static LRESULT WINAPI TreeviewWndProc(HWND hwnd, UINT message, WPARAM wParam, LP
static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
WNDPROC *pOldWndProc; WNDPROC pOldWndProc;
switch(msg) { switch(msg) {
...@@ -604,16 +604,9 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa ...@@ -604,16 +604,9 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
SetFocus(hTree); SetFocus(hTree);
pOldWndProc = HeapAlloc(GetProcessHeap(), 0, sizeof(WNDPROC));
if ( !ok(pOldWndProc != NULL, "Failed to allocate memory for subclass_info.\n") )
{
PostQuitMessage(1);
break;
}
/* Record the old WNDPROC so we can call it after recording the messages */ /* Record the old WNDPROC so we can call it after recording the messages */
*pOldWndProc = (WNDPROC)SetWindowLongA(hTree, GWL_WNDPROC, (LONG)TreeviewWndProc); pOldWndProc = (WNDPROC)SetWindowLongPtrA(hTree, GWLP_WNDPROC, (LONG_PTR)TreeviewWndProc);
SetWindowLongA(hTree, GWL_USERDATA, (LONG)pOldWndProc); SetWindowLongPtrA(hTree, GWLP_USERDATA, (LONG_PTR)pOldWndProc);
return 0; return 0;
} }
......
...@@ -259,7 +259,7 @@ struct subclass_info ...@@ -259,7 +259,7 @@ struct subclass_info
static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -298,16 +298,16 @@ static HWND create_edit_control(void) ...@@ -298,16 +298,16 @@ static HWND create_edit_control(void)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(edit, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(edit, GWLP_WNDPROC,
(LONG)edit_subclass_proc); (LONG_PTR)edit_subclass_proc);
SetWindowLongA(edit, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(edit, GWLP_USERDATA, (LONG_PTR)info);
return edit; return edit;
} }
static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
struct subclass_info *info = (struct subclass_info *)GetWindowLongA(hwnd, GWL_USERDATA); struct subclass_info *info = (struct subclass_info *)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
static long defwndproc_counter = 0; static long defwndproc_counter = 0;
LRESULT ret; LRESULT ret;
struct message msg; struct message msg;
...@@ -348,9 +348,9 @@ static HWND create_updown_control(void) ...@@ -348,9 +348,9 @@ static HWND create_updown_control(void)
return NULL; return NULL;
} }
info->oldproc = (WNDPROC)SetWindowLongA(updown, GWL_WNDPROC, info->oldproc = (WNDPROC)SetWindowLongPtrA(updown, GWLP_WNDPROC,
(LONG)updown_subclass_proc); (LONG_PTR)updown_subclass_proc);
SetWindowLongA(updown, GWL_USERDATA, (LONG)info); SetWindowLongPtrA(updown, GWLP_USERDATA, (LONG_PTR)info);
return updown; return updown;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment