2 * Copyright 1995 Martin von Loewis
20 #include "stackframe.h"
26 LONG
RELAY32_CallWindowProcConvStruct( WNDPROC func
, int hwnd
, int message
,
27 int wParam
, LPARAM lParam16
)
32 NCCALCSIZE_PARAMS32 nccs
;
39 return CallWndProc32(func
,hwnd
,message
,wParam
,(int)lParam16
);
40 lParam
= PTR_SEG_TO_LIN(lParam16
);
42 case WM_GETMINMAXINFO
:
43 STRUCT32_MINMAXINFO16to32(lParam
,&st
.mmi
);
44 result
=CallWndProc32(func
,hwnd
,message
,wParam
,(int)&st
.mmi
);
45 STRUCT32_MINMAXINFO32to16(&st
.mmi
,lParam
);
47 case WM_WINDOWPOSCHANGING
:
48 case WM_WINDOWPOSCHANGED
:
49 STRUCT32_WINDOWPOS16to32(lParam
,&wp
);
50 result
=CallWndProc32(func
,hwnd
,message
,wParam
,(int)&wp
);
51 STRUCT32_WINDOWPOS32to16(&wp
,lParam
);
54 STRUCT32_NCCALCSIZE16to32Flat(lParam
,&st
.nccs
);
55 if(wParam
&& ((NCCALCSIZE_PARAMS
*)lParam
)->lppos
)
57 STRUCT32_WINDOWPOS16to32(PTR_SEG_TO_LIN(((NCCALCSIZE_PARAMS
*)lParam
)->lppos
),&wp
);
60 else st
.nccs
.lppos
= 0;
61 result
=CallWndProc32(func
,hwnd
,message
,wParam
,(int)&st
.nccs
);
62 STRUCT32_NCCALCSIZE32to16Flat(&st
.nccs
,lParam
);
63 if(wParam
&& ((NCCALCSIZE_PARAMS
*)lParam
)->lppos
)
64 STRUCT32_WINDOWPOS32to16(&wp
,PTR_SEG_TO_LIN(((NCCALCSIZE_PARAMS
*)lParam
)->lppos
));
67 lpcs
= (CREATESTRUCT
*)lParam
;
68 STRUCT32_CREATESTRUCT16to32(lParam
,&st
.cs
);
69 st
.cs
.lpszName
= HIWORD(lpcs
->lpszName
) ?
70 PTR_SEG_TO_LIN(lpcs
->lpszName
) : (char*)lpcs
->lpszName
;
71 st
.cs
.lpszClass
= HIWORD(lpcs
->lpszClass
) ?
72 PTR_SEG_TO_LIN(lpcs
->lpszClass
) : (char*)lpcs
->lpszClass
;
73 result
=CallWndProc32(func
,hwnd
,message
,wParam
,(int)&st
.cs
);
74 STRUCT32_CREATESTRUCT32to16(&st
.cs
,lParam
);
75 lpcs
->lpszName
= HIWORD(st
.cs
.lpszName
) ?
76 MAKE_SEGPTR(st
.cs
.lpszName
) : (SEGPTR
)st
.cs
.lpszName
;
77 lpcs
->lpszClass
= HIWORD(st
.cs
.lpszClass
) ?
78 MAKE_SEGPTR(st
.cs
.lpszClass
) : (SEGPTR
)st
.cs
.lpszClass
;
82 return CallWndProc32(func
,hwnd
,message
,wParam
,(int)lParam
);
84 fprintf(stderr
,"No conversion function for message %d\n",message
);
86 return CallWndProc32(func
,hwnd
,message
,wParam
,(int)lParam
);