Commit 8041c9bd authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

hhctrl.ocx: Don't use GWLP_USERDATA to store private data.

parent fb16ce1f
...@@ -227,7 +227,7 @@ static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam) ...@@ -227,7 +227,7 @@ static void SB_OnLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam)
static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam) static void SB_OnLButtonUp(HWND hWnd, WPARAM wParam, LPARAM lParam)
{ {
HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
POINT pt; POINT pt;
pt.x = (short)LOWORD(lParam); pt.x = (short)LOWORD(lParam);
...@@ -278,7 +278,7 @@ static void HH_RegisterSizeBarClass(HHInfo *pHHInfo) ...@@ -278,7 +278,7 @@ static void HH_RegisterSizeBarClass(HHInfo *pHHInfo)
wcex.style = 0; wcex.style = 0;
wcex.lpfnWndProc = SizeBar_WndProc; wcex.lpfnWndProc = SizeBar_WndProc;
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = sizeof(LONG_PTR);
wcex.hInstance = hhctrl_hinstance; wcex.hInstance = hhctrl_hinstance;
wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_SIZEWE); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_SIZEWE);
...@@ -324,7 +324,7 @@ static BOOL HH_AddSizeBar(HHInfo *pHHInfo) ...@@ -324,7 +324,7 @@ static BOOL HH_AddSizeBar(HHInfo *pHHInfo)
return FALSE; return FALSE;
/* store the pointer to the HH info struct */ /* store the pointer to the HH info struct */
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo); SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
pHHInfo->hwndSizeBar = hWnd; pHHInfo->hwndSizeBar = hWnd;
return TRUE; return TRUE;
...@@ -428,7 +428,7 @@ static void ResizeTabChild(HHInfo *info, int tab) ...@@ -428,7 +428,7 @@ static void ResizeTabChild(HHInfo *info, int tab)
static LRESULT Child_OnSize(HWND hwnd) static LRESULT Child_OnSize(HWND hwnd)
{ {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); HHInfo *info = (HHInfo*)GetWindowLongPtrW(hwnd, 0);
RECT rect; RECT rect;
if(!info || hwnd != info->WinType.hwndNavigation) if(!info || hwnd != info->WinType.hwndNavigation)
...@@ -447,7 +447,7 @@ static LRESULT Child_OnSize(HWND hwnd) ...@@ -447,7 +447,7 @@ static LRESULT Child_OnSize(HWND hwnd)
static LRESULT OnTabChange(HWND hwnd) static LRESULT OnTabChange(HWND hwnd)
{ {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hwnd, GWLP_USERDATA); HHInfo *info = (HHInfo*)GetWindowLongPtrW(hwnd, 0);
int tab_id, tab_index, i; int tab_id, tab_index, i;
TRACE("%p\n", hwnd); TRACE("%p\n", hwnd);
...@@ -586,7 +586,7 @@ static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LP ...@@ -586,7 +586,7 @@ static LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LP
case WM_SIZE: case WM_SIZE:
return Child_OnSize(hWnd); return Child_OnSize(hWnd);
case WM_NOTIFY: { case WM_NOTIFY: {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, 0);
NMHDR *nmhdr = (NMHDR*)lParam; NMHDR *nmhdr = (NMHDR*)lParam;
switch(nmhdr->code) { switch(nmhdr->code) {
...@@ -669,7 +669,7 @@ static void HH_RegisterChildWndClass(HHInfo *pHHInfo) ...@@ -669,7 +669,7 @@ static void HH_RegisterChildWndClass(HHInfo *pHHInfo)
wcex.style = 0; wcex.style = 0;
wcex.lpfnWndProc = Child_WndProc; wcex.lpfnWndProc = Child_WndProc;
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = sizeof(LONG_PTR);
wcex.hInstance = hhctrl_hinstance; wcex.hInstance = hhctrl_hinstance;
wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
...@@ -735,7 +735,7 @@ static void DisplayPopupMenu(HHInfo *info) ...@@ -735,7 +735,7 @@ static void DisplayPopupMenu(HHInfo *info)
static void TB_OnClick(HWND hWnd, DWORD dwID) static void TB_OnClick(HWND hWnd, DWORD dwID)
{ {
HHInfo *info = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *info = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
switch (dwID) switch (dwID)
{ {
...@@ -967,7 +967,7 @@ static BOOL HH_AddNavigationPane(HHInfo *info) ...@@ -967,7 +967,7 @@ static BOOL HH_AddNavigationPane(HHInfo *info)
if (!hWnd) if (!hWnd)
return FALSE; return FALSE;
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)info); SetWindowLongPtrW(hWnd, 0, (LONG_PTR)info);
hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE, hwndTabCtrl = CreateWindowExW(dwExStyles, WC_TABCONTROLW, szEmpty, dwStyles | WS_VISIBLE,
0, TAB_TOP_PADDING, 0, TAB_TOP_PADDING,
...@@ -1039,7 +1039,7 @@ static BOOL HH_AddHTMLPane(HHInfo *pHHInfo) ...@@ -1039,7 +1039,7 @@ static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
return FALSE; return FALSE;
/* store the pointer to the HH info struct */ /* store the pointer to the HH info struct */
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo); SetWindowLongPtrW(hWnd, 0, (LONG_PTR)pHHInfo);
ShowWindow(hWnd, SW_SHOW); ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd); UpdateWindow(hWnd);
...@@ -1151,7 +1151,7 @@ static BOOL AddSearchTab(HHInfo *info) ...@@ -1151,7 +1151,7 @@ static BOOL AddSearchTab(HHInfo *info)
info->search.hwndContainer = hwndContainer; info->search.hwndContainer = hwndContainer;
info->tabs[TAB_SEARCH].hwnd = hwndContainer; info->tabs[TAB_SEARCH].hwnd = hwndContainer;
SetWindowLongPtrW(hwndContainer, GWLP_USERDATA, (LONG_PTR)info); SetWindowLongPtrW(hwndContainer, 0, (LONG_PTR)info);
ResizeTabChild(info, TAB_SEARCH); ResizeTabChild(info, TAB_SEARCH);
...@@ -1191,7 +1191,7 @@ static void ResizePopupChild(HHInfo *info) ...@@ -1191,7 +1191,7 @@ static void ResizePopupChild(HHInfo *info)
static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK HelpPopup_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
HHInfo *info = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *info = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
switch (message) switch (message)
{ {
...@@ -1221,7 +1221,7 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara ...@@ -1221,7 +1221,7 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara
switch(nmhdr->code) switch(nmhdr->code)
{ {
case NM_DBLCLK: { case NM_DBLCLK: {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, 0);
IndexSubItem *iter; IndexSubItem *iter;
if(info == 0 || lParam == 0) if(info == 0 || lParam == 0)
...@@ -1234,7 +1234,7 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara ...@@ -1234,7 +1234,7 @@ static LRESULT CALLBACK PopupChild_WndProc(HWND hWnd, UINT message, WPARAM wPara
return 0; return 0;
} }
case NM_RETURN: { case NM_RETURN: {
HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, 0);
IndexSubItem *iter; IndexSubItem *iter;
LVITEMW lvItem; LVITEMW lvItem;
...@@ -1276,7 +1276,7 @@ static BOOL AddIndexPopup(HHInfo *info) ...@@ -1276,7 +1276,7 @@ static BOOL AddIndexPopup(HHInfo *info)
wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = HelpPopup_WndProc; wcex.lpfnWndProc = HelpPopup_WndProc;
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = sizeof(LONG_PTR);
wcex.hInstance = hhctrl_hinstance; wcex.hInstance = hhctrl_hinstance;
wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
...@@ -1290,7 +1290,7 @@ static BOOL AddIndexPopup(HHInfo *info) ...@@ -1290,7 +1290,7 @@ static BOOL AddIndexPopup(HHInfo *info)
wcex.style = 0; wcex.style = 0;
wcex.lpfnWndProc = PopupChild_WndProc; wcex.lpfnWndProc = PopupChild_WndProc;
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = sizeof(LONG_PTR);
wcex.hInstance = hhctrl_hinstance; wcex.hInstance = hhctrl_hinstance;
wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
...@@ -1338,8 +1338,8 @@ static BOOL AddIndexPopup(HHInfo *info) ...@@ -1338,8 +1338,8 @@ static BOOL AddIndexPopup(HHInfo *info)
info->popup.hwndCallback = hwndCallback; info->popup.hwndCallback = hwndCallback;
info->popup.hwndPopup = hwndPopup; info->popup.hwndPopup = hwndPopup;
info->popup.hwndList = hwndList; info->popup.hwndList = hwndList;
SetWindowLongPtrW(hwndPopup, GWLP_USERDATA, (LONG_PTR)info); SetWindowLongPtrW(hwndPopup, 0, (LONG_PTR)info);
SetWindowLongPtrW(hwndCallback, GWLP_USERDATA, (LONG_PTR)info); SetWindowLongPtrW(hwndCallback, 0, (LONG_PTR)info);
ResizePopupChild(info); ResizePopupChild(info);
ShowWindow(hwndList, SW_SHOW); ShowWindow(hwndList, SW_SHOW);
...@@ -1382,7 +1382,7 @@ static void ExpandContract(HHInfo *pHHInfo) ...@@ -1382,7 +1382,7 @@ static void ExpandContract(HHInfo *pHHInfo)
static LRESULT Help_OnSize(HWND hWnd) static LRESULT Help_OnSize(HWND hWnd)
{ {
HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); HHInfo *pHHInfo = (HHInfo *)GetWindowLongPtrW(hWnd, 0);
DWORD dwSize; DWORD dwSize;
RECT rc; RECT rc;
...@@ -1423,7 +1423,7 @@ static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPA ...@@ -1423,7 +1423,7 @@ static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_SIZE: case WM_SIZE:
return Help_OnSize(hWnd); return Help_OnSize(hWnd);
case WM_CLOSE: case WM_CLOSE:
ReleaseHelpViewer((HHInfo *)GetWindowLongPtrW(hWnd, GWLP_USERDATA)); ReleaseHelpViewer((HHInfo *)GetWindowLongPtrW(hWnd, 0));
return 0; return 0;
case WM_DESTROY: case WM_DESTROY:
if(hh_process) if(hh_process)
...@@ -1454,7 +1454,7 @@ static BOOL HH_CreateHelpWindow(HHInfo *info) ...@@ -1454,7 +1454,7 @@ static BOOL HH_CreateHelpWindow(HHInfo *info)
wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = Help_WndProc; wcex.lpfnWndProc = Help_WndProc;
wcex.cbClsExtra = 0; wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0; wcex.cbWndExtra = sizeof(LONG_PTR);
wcex.hInstance = hhctrl_hinstance; wcex.hInstance = hhctrl_hinstance;
wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION); wcex.hIcon = LoadIconW(NULL, (LPCWSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW); wcex.hCursor = LoadCursorW(NULL, (LPCWSTR)IDC_ARROW);
...@@ -1518,7 +1518,7 @@ static BOOL HH_CreateHelpWindow(HHInfo *info) ...@@ -1518,7 +1518,7 @@ static BOOL HH_CreateHelpWindow(HHInfo *info)
UpdateWindow(hWnd); UpdateWindow(hWnd);
/* store the pointer to the HH info struct */ /* store the pointer to the HH info struct */
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)info); SetWindowLongPtrW(hWnd, 0, (LONG_PTR)info);
info->WinType.hwndHelp = hWnd; info->WinType.hwndHelp = hWnd;
return TRUE; return TRUE;
......
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