wine/win32/struct32.c
Alexandre Julliard f0cbfa0c5c Release 970215
Sat Feb 15 11:59:17 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [*/*]
	Converted a lot of functions to Win32 types.
	Removed HWND type.

Fri Feb 14 15:09:19 1997  Onno Hovers <onno@stack.nl>

	* [memory/global.c]
	Implemented GMEM_MOVEABLE blocks for Win32.

Fri Feb 14 00:24:39 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [loader/task.c] [windows/queue.c]
	Do not read X events while in the intertask SendMessage().

	* [misc/lstr.c]
	Fixed CharPrev32A().

	* [windows/hook.c] [include/hook.h]
	Restored broken WH_CALLWNDPROC functionality for dialogs, etc...

	* [windows/win.c] [windows/defwnd.c] [windows/mdi.c]
	  [windows/event.c] [controls/edit.c] 
	Added WIN_ISWIN32 flag to windows created by Win32 calls. 
	Several new Win32 messages are sent when this flag is on.
	
	* [msdos/dosmem.c] [memory/global.c]
	Some changes in DOS memory allocation.

Fri Feb  7 21:46:03 1997  Andrew Taylor  <andrew@riscan.com>

	* [win32/security.c]
	Added SID manipulation functions.

	* [include/debug.h]
	Added debugging class "security".

Fri  Feb 7 20:46:33 1997  Robert Pouliot <krynos@clic.net>

	* [debugger/msc.c] [debugger/source.c] 
	  [documentation/wine_os2.txt] [loader/signal.c]
	Some more changes for OS/2. Doesn't work yet.

Fri  Feb 7 09:31:17 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [scheduler/process.c]
	Added ExpandEnvironmentStrings*.

	* [misc/ntdll.c] [include/ntdll.h]
	Added some new functions.

	* [objects/cursoricon.c]
	CURSORICON_LoadHandler: check against some bizarre out of memory
	conditions.
	
	* [windows/mdi.c]
	Fixed DefFrameProc32*, added TranslateMDISysAccel32.

Wed Feb  5 01:31:05 1997  John Zero <john@globe.graphisoft.hu>

	* [resources/sysres_Hu.rc] [misc/ole2nls.c] [misc/main.c]
	  [programs/progman/Hu.rc] [programs/winhelp/Hu.rc]
	Added Hungarian language support.
1997-02-15 14:29:56 +00:00

154 lines
4.9 KiB
C

/*
* Win32 structure conversion functions
*
* Copyright 1996 Martin von Loewis
*/
#include <stdio.h>
#include "windows.h"
#include "winerror.h"
#include "struct32.h"
#include "stddebug.h"
#include "debug.h"
void STRUCT32_MSG16to32(const MSG16 *msg16,MSG32 *msg32)
{
msg32->hwnd=(HWND32)msg16->hwnd;
msg32->message=msg16->message;
msg32->wParam=msg16->wParam;
msg32->lParam=msg16->lParam;
msg32->time=msg16->time;
msg32->pt.x=msg16->pt.x;
msg32->pt.y=msg16->pt.y;
}
void STRUCT32_MSG32to16(const MSG32 *msg32,MSG16 *msg16)
{
msg16->hwnd=(HWND16)msg32->hwnd;
msg16->message=msg32->message;
msg16->wParam=msg32->wParam;
msg16->lParam=msg32->lParam;
msg16->time=msg32->time;
msg16->pt.x=msg32->pt.x;
msg16->pt.y=msg32->pt.y;
}
void STRUCT32_MINMAXINFO32to16( const MINMAXINFO32 *from, MINMAXINFO16 *to )
{
CONV_POINT32TO16( &from->ptReserved, &to->ptReserved );
CONV_POINT32TO16( &from->ptMaxSize, &to->ptMaxSize );
CONV_POINT32TO16( &from->ptMaxPosition, &to->ptMaxPosition );
CONV_POINT32TO16( &from->ptMinTrackSize, &to->ptMinTrackSize );
CONV_POINT32TO16( &from->ptMaxTrackSize, &to->ptMaxTrackSize );
}
void STRUCT32_MINMAXINFO16to32( const MINMAXINFO16 *from, MINMAXINFO32 *to )
{
CONV_POINT16TO32( &from->ptReserved, &to->ptReserved );
CONV_POINT16TO32( &from->ptMaxSize, &to->ptMaxSize );
CONV_POINT16TO32( &from->ptMaxPosition, &to->ptMaxPosition );
CONV_POINT16TO32( &from->ptMinTrackSize, &to->ptMinTrackSize );
CONV_POINT16TO32( &from->ptMaxTrackSize, &to->ptMaxTrackSize );
}
void STRUCT32_WINDOWPOS32to16( const WINDOWPOS32* from, WINDOWPOS16* to )
{
to->hwnd = (HWND16)from->hwnd;
to->hwndInsertAfter = (HWND16)from->hwndInsertAfter;
to->x = (INT16)from->x;
to->y = (INT16)from->y;
to->cx = (INT16)from->cx;
to->cy = (INT16)from->cy;
to->flags = (UINT16)from->flags;
}
void STRUCT32_WINDOWPOS16to32( const WINDOWPOS16* from, WINDOWPOS32* to )
{
to->hwnd = (HWND32)from->hwnd;
to->hwndInsertAfter = (HWND32)from->hwndInsertAfter;
to->x = (INT32)from->x;
to->y = (INT32)from->y;
to->cx = (INT32)from->cx;
to->cy = (INT32)from->cy;
to->flags = (UINT32)from->flags;
}
void STRUCT32_NCCALCSIZE32to16Flat( const NCCALCSIZE_PARAMS32* from,
NCCALCSIZE_PARAMS16* to, int validRects )
{
CONV_RECT32TO16( &from->rgrc[0], &to->rgrc[0] );
if (validRects)
{
CONV_RECT32TO16( &from->rgrc[1], &to->rgrc[1] );
CONV_RECT32TO16( &from->rgrc[2], &to->rgrc[2] );
}
}
void STRUCT32_NCCALCSIZE16to32Flat( const NCCALCSIZE_PARAMS16* from,
NCCALCSIZE_PARAMS32* to, int validRects )
{
CONV_RECT16TO32( &from->rgrc[0], &to->rgrc[0] );
if (validRects)
{
CONV_RECT32TO16( &from->rgrc[1], &to->rgrc[1] );
CONV_RECT32TO16( &from->rgrc[2], &to->rgrc[2] );
}
}
/* The strings are not copied */
void STRUCT32_CREATESTRUCT32Ato16( const CREATESTRUCT32A* from,
CREATESTRUCT16* to )
{
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE16)from->hInstance;
to->hMenu = (HMENU16)from->hMenu;
to->hwndParent = (HWND16)from->hwndParent;
to->cy = (INT16)from->cy;
to->cx = (INT16)from->cx;
to->y = (INT16)from->y;
to->x = (INT16)from->x;
to->style = from->style;
to->dwExStyle = from->dwExStyle;
}
void STRUCT32_CREATESTRUCT16to32A( const CREATESTRUCT16* from,
CREATESTRUCT32A *to )
{
to->lpCreateParams = from->lpCreateParams;
to->hInstance = (HINSTANCE32)from->hInstance;
to->hMenu = (HMENU32)from->hMenu;
to->hwndParent = (HWND32)from->hwndParent;
to->cy = (INT32)from->cy;
to->cx = (INT32)from->cx;
to->y = (INT32)from->y;
to->x = (INT32)from->x;
to->style = from->style;
to->dwExStyle = from->dwExStyle;
}
/* The strings are not copied */
void STRUCT32_MDICREATESTRUCT32Ato16( const MDICREATESTRUCT32A* from,
MDICREATESTRUCT16* to )
{
to->hOwner = (HINSTANCE16)from->hOwner;
to->x = (INT16)from->x;
to->y = (INT16)from->y;
to->cx = (INT16)from->cx;
to->cy = (INT16)from->cy;
to->style = from->style;
to->lParam = from->lParam;
}
void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16* from,
MDICREATESTRUCT32A *to )
{
to->hOwner = (HINSTANCE32)from->hOwner;
to->x = (INT32)from->x;
to->y = (INT32)from->y;
to->cx = (INT32)from->cx;
to->cy = (INT32)from->cy;
to->style = from->style;
to->lParam = from->lParam;
}