Release 960611

Tue Jun 11 15:20:43 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [debugger/break.c] [loader/signal.c]
	Fixed breakpoints in 32-bit code.

	* [include/windows.h]
	Added many more Win32 versions of standard structures.

	* [include/winreg.h] [misc/registry.c]
	Moved private types into registry.c.

	* [memory/string.c] (New file)
	Moved most string functions from misc/lstr.c; added Win32 version
	of all functions.

	* [misc/wsprintf.c]
	Implemented Win32 wsprintf functions.

	* [objects/bitmap.c]
	Implemented Win32 bitmap functions.

	* [windows/dialog.c]
	Don't set dialog procedure before the controls are created. This
	avoids a crash in Winhelp.

Tue Jun 11 14:10:06 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>

	* [controls/menu.c] [if1632/user.spec] [windows/message.c]
	Replace PeekMessage with PeekMessage16.

	* [if1632/kernel32.spec][misc/main.c]
	GetVersion32,GetVersionEx32A,GetVersionEx32W: new functions.
	MAIN_ParseVersion: new function, new command line option -winver.
	GetVersion: modified to take command line argument into account.

	* [if1632/kernel32.spec] [win32/process.c]
	FreeLibrary32: new function.
	TlsAlloc: initialize Tls to zero.
	InterlockedIncrement,InterlockedDecrement,InterlockedExchange: new
	functions.

	* [if1632/kernel32.spec]
	SetErrorMode,GetActiveWindow: new relays to existing functions.

	* [if1632/kernel32.spec][win32/user32.c]
	PeekMessage32A,PeekMessage32W: new functions.

	* [include/struct32.h][include/windows.h]
	Moved MSG32 to windows.h.
	Renamed MSG to MSG16.
	Modified prototypes to use MSG16

	* [include/winbase.h]
	OSVERSIONINFO32A,OSVERSIONINFO32W: new structures.

Sun Jun  9 20:53:30 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [if1632/Makefile.in] [loader/builtin.c]
	version.dll,lz32.dll added.

	* [include/lzexpand.h] [if1632/lz32.spec] [if1632/lzexpand.spec]
	  [misc/lzexpand.c]
	lz32.dll added.
	Modified to new function naming standard.

	* [include/ver.h] [if1632/ver.spec] [if1632/version.spec] [misc/ver.c]
	version.dll added (win32 version of ver.dll).
	Modified to new function naming standard.
	Use registry to look up a LOCALE langids too.
	(VerInstallFile,VerFindFile still stubs)

Fri Jun  7 20:40:20 1996  Albrecht Kleine  <kleine@ak.sax.de>

	* [files/file.c]
	Added a warning if GetTempFileName() gets a bad drive parameter.

	* [misc/commdlg.c]
	Changed file listbox color to gray in SaveFile dialog 
	(just like Windows does this).
This commit is contained in:
Alexandre Julliard 1996-06-11 16:02:08 +00:00
parent 1e9ac79811
commit d90840e180
122 changed files with 3889 additions and 2178 deletions

View File

@ -1,13 +1,12 @@
This is release 960606 of Wine, the MS Windows emulator. This is still a
This is release 960611 of Wine, the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work correctly.
Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960606: (see ChangeLog for details)
- More Win32 code.
- Window repainting fixes.
WHAT'S NEW with Wine-960611: (see ChangeLog for details)
- (surprise) More Win32 code.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -16,10 +15,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960606.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960606.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960606.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960606.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960611.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960611.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960611.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960611.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

View File

@ -1,3 +1,84 @@
----------------------------------------------------------------------
Tue Jun 11 15:20:43 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [debugger/break.c] [loader/signal.c]
Fixed breakpoints in 32-bit code.
* [include/windows.h]
Added many more Win32 versions of standard structures.
* [include/winreg.h] [misc/registry.c]
Moved private types into registry.c.
* [memory/string.c] (New file)
Moved most string functions from misc/lstr.c; added Win32 version
of all functions.
* [misc/wsprintf.c]
Implemented Win32 wsprintf functions.
* [objects/bitmap.c]
Implemented Win32 bitmap functions.
* [windows/dialog.c]
Don't set dialog procedure before the controls are created. This
avoids a crash in Winhelp.
Tue Jun 11 14:10:06 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [controls/menu.c] [if1632/user.spec] [windows/message.c]
Replace PeekMessage with PeekMessage16.
* [if1632/kernel32.spec][misc/main.c]
GetVersion32,GetVersionEx32A,GetVersionEx32W: new functions.
MAIN_ParseVersion: new function, new command line option -winver.
GetVersion: modified to take command line argument into account.
* [if1632/kernel32.spec] [win32/process.c]
FreeLibrary32: new function.
TlsAlloc: initialize Tls to zero.
InterlockedIncrement,InterlockedDecrement,InterlockedExchange: new
functions.
* [if1632/kernel32.spec]
SetErrorMode,GetActiveWindow: new relays to existing functions.
* [if1632/kernel32.spec][win32/user32.c]
PeekMessage32A,PeekMessage32W: new functions.
* [include/struct32.h][include/windows.h]
Moved MSG32 to windows.h.
Renamed MSG to MSG16.
Modified prototypes to use MSG16
* [include/winbase.h]
OSVERSIONINFO32A,OSVERSIONINFO32W: new structures.
Sun Jun 9 20:53:30 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [if1632/Makefile.in] [loader/builtin.c]
version.dll,lz32.dll added.
* [include/lzexpand.h] [if1632/lz32.spec] [if1632/lzexpand.spec]
[misc/lzexpand.c]
lz32.dll added.
Modified to new function naming standard.
* [include/ver.h] [if1632/ver.spec] [if1632/version.spec] [misc/ver.c]
version.dll added (win32 version of ver.dll).
Modified to new function naming standard.
Use registry to look up a LOCALE langids too.
(VerInstallFile,VerFindFile still stubs)
Fri Jun 7 20:40:20 1996 Albrecht Kleine <kleine@ak.sax.de>
* [files/file.c]
Added a warning if GetTempFileName() gets a bad drive parameter.
* [misc/commdlg.c]
Changed file listbox color to gray in SaveFile dialog
(just like Windows does this).
----------------------------------------------------------------------
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>

View File

@ -20,7 +20,7 @@ static void BUTTON_CheckAutoRadioButton( WND *wndPtr );
#define MAX_BTN_TYPE 12
static WORD maxCheckState[MAX_BTN_TYPE] =
static const WORD maxCheckState[MAX_BTN_TYPE] =
{
BUTTON_UNCHECKED, /* BS_PUSHBUTTON */
BUTTON_UNCHECKED, /* BS_DEFPUSHBUTTON */
@ -38,7 +38,7 @@ static WORD maxCheckState[MAX_BTN_TYPE] =
typedef void (*pfPaint)( WND *wndPtr, HDC hdc, WORD action );
static pfPaint btnPaintFunc[MAX_BTN_TYPE] =
static const pfPaint btnPaintFunc[MAX_BTN_TYPE] =
{
PB_Paint, /* BS_PUSHBUTTON */
PB_Paint, /* BS_DEFPUSHBUTTON */
@ -97,9 +97,9 @@ LRESULT ButtonWndProc(HWND32 hWnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case WM_CREATE:
if (!hbitmapCheckBoxes)
{
BITMAP bmp;
BITMAP16 bmp;
hbitmapCheckBoxes = LoadBitmap(0, MAKEINTRESOURCE(OBM_CHECKBOXES));
GetObject( hbitmapCheckBoxes, sizeof(bmp), (LPSTR)&bmp );
GetObject16( hbitmapCheckBoxes, sizeof(bmp), &bmp );
checkBoxWidth = bmp.bmWidth / 4;
checkBoxHeight = bmp.bmHeight / 3;
}
@ -255,7 +255,7 @@ static void PB_Paint( WND *wndPtr, HDC hDC, WORD action )
HPEN16 hOldPen;
HBRUSH hOldBrush;
DWORD dwTextSize;
TEXTMETRIC tm;
TEXTMETRIC16 tm;
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
GetClientRect16(wndPtr->hwndSelf, &rc);
@ -296,8 +296,8 @@ static void PB_Paint( WND *wndPtr, HDC hDC, WORD action )
/* draw button label, if any: */
if (wndPtr->text && wndPtr->text[0])
{
LOGBRUSH lb;
GetObject(sysColorObjects.hbrushBtnFace,sizeof(LOGBRUSH),(LPSTR)&lb);
LOGBRUSH16 lb;
GetObject16( sysColorObjects.hbrushBtnFace, sizeof(lb), &lb );
if (wndPtr->dwStyle & WS_DISABLED &&
GetSysColor(COLOR_GRAYTEXT)==lb.lbColor)
/* don't write gray text on gray bkg */
@ -372,7 +372,7 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
RECT16 rc;
HBRUSH hBrush;
int textlen, delta, x, y;
TEXTMETRIC tm;
TEXTMETRIC16 tm;
SIZE16 size;
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;

View File

@ -48,11 +48,11 @@ static WORD CBitHeight, CBitWidth;
static int COMBO_Init()
{
BITMAP bm;
BITMAP16 bm;
dprintf_combo(stddeb, "COMBO_Init\n");
hComboBit = LoadBitmap(0, MAKEINTRESOURCE(OBM_COMBO));
GetObject(hComboBit, sizeof(BITMAP), (LPSTR)&bm);
GetObject16( hComboBit, sizeof(bm), &bm );
CBitHeight = bm.bmHeight;
CBitWidth = bm.bmWidth;
return 0;
@ -1208,7 +1208,7 @@ static INT32 COMBO_DlgDirList( HWND32 hDlg, LPARAM path, INT32 idCBox,
char temp[512] = "A:\\";
int drive = DRIVE_GetCurrentDrive();
temp[0] += drive;
lstrcpyn( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
lstrcpyn32A( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
AnsiLower( temp );
SetDlgItemText32A( hDlg, idStatic, temp );
}

View File

@ -198,8 +198,8 @@ BOOL SetDeskWallPaper( LPCSTR filename )
infoPtr->fTileWallPaper = GetProfileInt( "desktop", "TileWallPaper", 0 );
if (hbitmap)
{
BITMAP bmp;
GetObject( hbitmap, sizeof(bmp), (LPSTR)&bmp );
BITMAP16 bmp;
GetObject16( hbitmap, sizeof(bmp), &bmp );
infoPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
infoPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
}

View File

@ -2743,7 +2743,7 @@ static LRESULT EDIT_WM_SetFocus(WND *wndPtr, WPARAM wParam, LPARAM lParam)
*/
static LRESULT EDIT_WM_SetFont(WND *wndPtr, WPARAM wParam, LPARAM lParam)
{
TEXTMETRIC tm;
TEXTMETRIC16 tm;
EDITSTATE *es = EDITSTATEPTR(wndPtr);
LPARAM sel = EDIT_EM_GetSel(wndPtr, 0, 0L);
HDC hdc;

View File

@ -106,7 +106,7 @@ void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent)
/* create dummy hdc to set text height */
if ((hdc = GetDC(0)))
{
TEXTMETRIC tm;
TEXTMETRIC16 tm;
GetTextMetrics( hdc, &tm );
lphl->StdItemHeight = tm.tmHeight;
dprintf_listbox(stddeb,"CreateListBoxStruct: font height %d\n",
@ -305,8 +305,8 @@ int ListBoxFindMouse(LPHEADLIST lphl, int X, int Y)
void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls)
{
HANDLE hTemp = USER_HEAP_ALLOC( sizeof(MEASUREITEMSTRUCT) );
MEASUREITEMSTRUCT *lpmeasure = (MEASUREITEMSTRUCT *) USER_HEAP_LIN_ADDR(hTemp);
HANDLE hTemp = USER_HEAP_ALLOC( sizeof(MEASUREITEMSTRUCT16) );
MEASUREITEMSTRUCT16 *lpmeasure = (MEASUREITEMSTRUCT16 *) USER_HEAP_LIN_ADDR(hTemp);
if (lpmeasure == NULL) {
fprintf(stdnimp,"ListBoxAskMeasure() out of memory !\n");
@ -1274,7 +1274,7 @@ static LONG LBSetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
/* or are we guaranteed to get a LBSetFont before the first insert/add? */
if ((hdc = GetDC(0)))
{
TEXTMETRIC tm;
TEXTMETRIC16 tm;
GetTextMetrics( hdc, &tm );
lphl->StdItemHeight = tm.tmHeight;
dprintf_listbox(stddeb,"LBSetFont: new font %d with height %d\n",
@ -2107,7 +2107,7 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, UINT attrib )
p = filespec;
if ((p2 = strrchr( p, '\\' ))) p = p2 + 1;
if ((p2 = strrchr( p, '/' ))) p = p2 + 1;
lstrcpyn( mask, p, sizeof(mask) );
lstrcpyn32A( mask, p, sizeof(mask) );
if (p != filespec)
{
p[-1] = '\0';
@ -2151,7 +2151,7 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, UINT attrib )
int drive = DRIVE_GetCurrentDrive();
strcpy( temp, "A:\\" );
temp[0] += drive;
lstrcpyn( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
lstrcpyn32A( temp + 3, DRIVE_GetDosCwd(drive), sizeof(temp)-3 );
AnsiLower( temp );
/* Can't use PostMessage() here, because the string is on the stack */
SetDlgItemText32A( hDlg, idStatic, temp );

View File

@ -132,18 +132,18 @@ static HMENU MENU_CopySysMenu(void)
*/
BOOL MENU_Init()
{
BITMAP bm;
BITMAP16 bm;
/* Load bitmaps */
if (!(hStdCheck = LoadBitmap( 0, MAKEINTRESOURCE(OBM_CHECK) )))
return FALSE;
GetObject( hStdCheck, sizeof(BITMAP), (LPSTR)&bm );
GetObject16( hStdCheck, sizeof(bm), &bm );
check_bitmap_width = bm.bmWidth;
check_bitmap_height = bm.bmHeight;
if (!(hStdMnArrow = LoadBitmap( 0, MAKEINTRESOURCE(OBM_MNARROW) )))
return FALSE;
GetObject( hStdMnArrow, sizeof(BITMAP), (LPSTR)&bm );
GetObject16( hStdMnArrow, sizeof(bm), &bm );
arrow_bitmap_width = bm.bmWidth;
arrow_bitmap_height = bm.bmHeight;
@ -331,8 +331,8 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if (lpitem->item_flags & MF_OWNERDRAW)
{
MEASUREITEMSTRUCT *mis;
if (!(mis = SEGPTR_NEW(MEASUREITEMSTRUCT))) return;
MEASUREITEMSTRUCT16 *mis;
if (!(mis = SEGPTR_NEW(MEASUREITEMSTRUCT16))) return;
mis->CtlType = ODT_MENU;
mis->itemID = lpitem->item_id;
mis->itemData = (DWORD)lpitem->text;
@ -362,9 +362,8 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
if (lpitem->item_flags & MF_BITMAP)
{
BITMAP bm;
if (GetObject( (HBITMAP16)(UINT32)lpitem->text,
sizeof(BITMAP), (LPSTR)&bm ))
BITMAP16 bm;
if (GetObject16( (HBITMAP16)(UINT32)lpitem->text, sizeof(bm), &bm ))
{
lpitem->rect.right += bm.bmWidth;
lpitem->rect.bottom += bm.bmHeight;
@ -1119,7 +1118,7 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode )
flags );
str = res;
if (!unicode) res += strlen(str) + 1;
else res += (STRING32_lstrlenW((LPCWSTR)str) + 1) * sizeof(WCHAR);
else res += (lstrlen32W((LPCWSTR)str) + 1) * sizeof(WCHAR);
if (flags & MF_POPUP)
{
HMENU hSubMenu = CreatePopupMenu();
@ -1540,7 +1539,7 @@ static void MENU_KeyRight( HWND hwndOwner, HMENU hmenu, HMENU *hmenuCurrent )
static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, int x, int y,
HWND hwnd, const RECT16 *lprect )
{
MSG *msg;
MSG16 *msg;
HLOCAL16 hMsg;
POPUPMENU *menu;
HMENU hmenuCurrent = hmenu;
@ -1555,8 +1554,8 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, int x, int y,
MENU_ButtonDown( hwnd, hmenu, &hmenuCurrent, pt );
}
SetCapture( hwnd );
hMsg = USER_HEAP_ALLOC( sizeof(MSG) );
msg = (MSG *)USER_HEAP_LIN_ADDR( hMsg );
hMsg = USER_HEAP_ALLOC( sizeof(MSG16) );
msg = (MSG16 *)USER_HEAP_LIN_ADDR( hMsg );
while (!fClosed)
{
if (!MSG_InternalGetMessage( (SEGPTR)USER_HEAP_SEG_ADDR(hMsg), 0,
@ -1695,7 +1694,7 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, int x, int y,
if (!fClosed) fRemove = TRUE;
if (fRemove) /* Remove the message from the queue */
PeekMessage( msg, 0, msg->message, msg->message, PM_REMOVE );
PeekMessage16( msg, 0, msg->message, msg->message, PM_REMOVE );
}
USER_HEAP_FREE( hMsg );
ReleaseCapture();
@ -2019,7 +2018,7 @@ int GetMenuString( HMENU hMenu, UINT wItemID,
str[0] = '\0';
if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0;
if (!IS_STRING_ITEM(item->item_flags)) return 0;
lstrcpyn( str, item->text, nMaxSiz );
lstrcpyn32A( str, item->text, nMaxSiz );
dprintf_menu( stddeb, "GetMenuString: returning '%s'\n", str );
return strlen(str);
}

View File

@ -288,7 +288,7 @@ BOOL DEBUG_ShouldContinue( struct sigcontext_struct *context,
0 : CS_reg(DEBUG_context);
addr.off = EIP_reg(DEBUG_context);
bpnum = DEBUG_FindBreakpoint( &addr );
bpnum = DEBUG_FindBreakpoint( &addr );
breakpoints[0].enabled = 0; /* disable the step-over breakpoint */
if ((bpnum != 0) && (bpnum != -1))
@ -299,6 +299,12 @@ BOOL DEBUG_ShouldContinue( struct sigcontext_struct *context,
fprintf( stderr, "\n" );
return FALSE;
}
/* If there's no breakpoint and we are not single-stepping, then we */
/* must have encountered an int3 in the Windows program; let's skip it. */
if ((bpnum == -1) && !(EFL_reg(DEBUG_context) & STEP_FLAG))
EIP_reg(DEBUG_context)++;
/* no breakpoint, continue if in continuous mode */
return (mode == EXEC_CONT);
}

View File

@ -123,11 +123,11 @@ static BOOL db_disasm_16 = FALSE;
#define XA 34 /* for 'fstcw %ax' */
struct inst {
char * i_name; /* name */
short i_has_modrm; /* has regmodrm byte */
short i_size; /* operand size */
int i_mode; /* addressing modes */
char * i_extra; /* pointer to extra opcode table */
const char *i_name; /* name */
short i_has_modrm; /* has regmodrm byte */
short i_size; /* operand size */
int i_mode; /* addressing modes */
const char *i_extra; /* pointer to extra opcode table */
};
#define op1(x) (x)
@ -135,14 +135,14 @@ struct inst {
#define op3(x,y,z) ((x)|((y)<<8)|((z)<<16))
struct finst {
char * f_name; /* name for memory instruction */
int f_size; /* size for memory instruction */
int f_rrmode; /* mode for rr instruction */
char * f_rrname; /* name for rr instruction
const char *f_name; /* name for memory instruction */
int f_size; /* size for memory instruction */
int f_rrmode; /* mode for rr instruction */
const char *f_rrname; /* name for rr instruction
(or pointer to table) */
};
static char * db_Grp6[] = {
static const char * const db_Grp6[] = {
"sldt",
"str",
"lldt",
@ -153,7 +153,7 @@ static char * db_Grp6[] = {
""
};
static char * db_Grp7[] = {
static const char * const db_Grp7[] = {
"sgdt",
"sidt",
"lgdt",
@ -164,7 +164,7 @@ static char * db_Grp7[] = {
"invlpg"
};
static char * db_Grp8[] = {
static const char * const db_Grp8[] = {
"",
"",
"",
@ -175,7 +175,7 @@ static char * db_Grp8[] = {
"btc"
};
static struct inst db_inst_0f0x[] = {
static const struct inst db_inst_0f0x[] = {
/*00*/ { "", TRUE, NONE, op1(Ew), (char *)db_Grp6 },
/*01*/ { "", TRUE, NONE, op1(Ew), (char *)db_Grp7 },
/*02*/ { "lar", TRUE, LONG, op2(E,R), 0 },
@ -195,7 +195,7 @@ static struct inst db_inst_0f0x[] = {
/*0f*/ { "", FALSE, NONE, 0, 0 },
};
static struct inst db_inst_0f2x[] = {
static const struct inst db_inst_0f2x[] = {
/*20*/ { "mov", TRUE, LONG, op2(CR,E), 0 }, /* use E for reg */
/*21*/ { "mov", TRUE, LONG, op2(DR,E), 0 }, /* since mod == 11 */
/*22*/ { "mov", TRUE, LONG, op2(E,CR), 0 },
@ -215,7 +215,7 @@ static struct inst db_inst_0f2x[] = {
/*2f*/ { "", FALSE, NONE, 0, 0 },
};
static struct inst db_inst_0f8x[] = {
static const struct inst db_inst_0f8x[] = {
/*80*/ { "jo", FALSE, NONE, op1(Dl), 0 },
/*81*/ { "jno", FALSE, NONE, op1(Dl), 0 },
/*82*/ { "jb", FALSE, NONE, op1(Dl), 0 },
@ -235,7 +235,7 @@ static struct inst db_inst_0f8x[] = {
/*8f*/ { "jnle", FALSE, NONE, op1(Dl), 0 },
};
static struct inst db_inst_0f9x[] = {
static const struct inst db_inst_0f9x[] = {
/*90*/ { "seto", TRUE, NONE, op1(Eb), 0 },
/*91*/ { "setno", TRUE, NONE, op1(Eb), 0 },
/*92*/ { "setb", TRUE, NONE, op1(Eb), 0 },
@ -255,7 +255,7 @@ static struct inst db_inst_0f9x[] = {
/*9f*/ { "setnle",TRUE, NONE, op1(Eb), 0 },
};
static struct inst db_inst_0fax[] = {
static const struct inst db_inst_0fax[] = {
/*a0*/ { "push", FALSE, NONE, op1(Si), 0 },
/*a1*/ { "pop", FALSE, NONE, op1(Si), 0 },
/*a2*/ { "", FALSE, NONE, 0, 0 },
@ -275,7 +275,7 @@ static struct inst db_inst_0fax[] = {
/*a7*/ { "imul", TRUE, LONG, op2(E,R), 0 },
};
static struct inst db_inst_0fbx[] = {
static const struct inst db_inst_0fbx[] = {
/*b0*/ { "", FALSE, NONE, 0, 0 },
/*b1*/ { "", FALSE, NONE, 0, 0 },
/*b2*/ { "lss", TRUE, LONG, op2(E, R), 0 },
@ -295,7 +295,7 @@ static struct inst db_inst_0fbx[] = {
/*bf*/ { "movsw", TRUE, LONG, op2(E, R), 0 },
};
static struct inst db_inst_0fcx[] = {
static const struct inst db_inst_0fcx[] = {
/*c0*/ { "xadd", TRUE, BYTE, op2(R, E), 0 },
/*c1*/ { "xadd", TRUE, LONG, op2(R, E), 0 },
/*c2*/ { "", FALSE, NONE, 0, 0 },
@ -314,7 +314,7 @@ static struct inst db_inst_0fcx[] = {
/*cf*/ { "bswap", FALSE, LONG, op1(Ri), 0 },
};
static struct inst db_inst_0fdx[] = {
static const struct inst db_inst_0fdx[] = {
/*c0*/ { "cmpxchg",TRUE, BYTE, op2(R, E), 0 },
/*c1*/ { "cmpxchg",TRUE, LONG, op2(R, E), 0 },
/*c2*/ { "", FALSE, NONE, 0, 0 },
@ -333,7 +333,7 @@ static struct inst db_inst_0fdx[] = {
/*cf*/ { "", FALSE, NONE, 0, 0 },
};
static struct inst *db_inst_0f[] = {
static const struct inst * const db_inst_0f[] = {
db_inst_0f0x,
0,
db_inst_0f2x,
@ -352,43 +352,43 @@ static struct inst *db_inst_0f[] = {
0
};
static char * db_Esc92[] = {
static const char * const db_Esc92[] = {
"fnop", "", "", "", "", "", "", ""
};
static char * db_Esc93[] = {
static const char * const db_Esc93[] = {
"", "", "", "", "", "", "", ""
};
static char * db_Esc94[] = {
static const char * const db_Esc94[] = {
"fchs", "fabs", "", "", "ftst", "fxam", "", ""
};
static char * db_Esc95[] = {
static const char * const db_Esc95[] = {
"fld1", "fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz",""
};
static char * db_Esc96[] = {
static const char * const db_Esc96[] = {
"f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp",
"fincstp"
};
static char * db_Esc97[] = {
static const char * const db_Esc97[] = {
"fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos"
};
static char * db_Esca4[] = {
static const char * const db_Esca4[] = {
"", "fucompp","", "", "", "", "", ""
};
static char * db_Escb4[] = {
static const char * const db_Escb4[] = {
"", "", "fnclex","fninit","", "", "", ""
};
static char * db_Esce3[] = {
static const char * const db_Esce3[] = {
"", "fcompp","", "", "", "", "", ""
};
static char * db_Escf4[] = {
static const char * const db_Escf4[] = {
"fnstsw","", "", "", "", "", "", ""
};
static struct finst db_Esc8[] = {
static const struct finst db_Esc8[] = {
/*0*/ { "fadd", SNGL, op2(STI,ST), 0 },
/*1*/ { "fmul", SNGL, op2(STI,ST), 0 },
/*2*/ { "fcom", SNGL, op2(STI,ST), 0 },
@ -399,7 +399,7 @@ static struct finst db_Esc8[] = {
/*7*/ { "fdivr", SNGL, op2(STI,ST), 0 },
};
static struct finst db_Esc9[] = {
static const struct finst db_Esc9[] = {
/*0*/ { "fld", SNGL, op1(STI), 0 },
/*1*/ { "", NONE, op1(STI), "fxch" },
/*2*/ { "fst", SNGL, op1(X), (char *)db_Esc92 },
@ -410,7 +410,7 @@ static struct finst db_Esc9[] = {
/*7*/ { "fnstcw", NONE, op1(X), (char *)db_Esc97 },
};
static struct finst db_Esca[] = {
static const struct finst db_Esca[] = {
/*0*/ { "fiadd", WORD, 0, 0 },
/*1*/ { "fimul", WORD, 0, 0 },
/*2*/ { "ficom", WORD, 0, 0 },
@ -421,7 +421,7 @@ static struct finst db_Esca[] = {
/*7*/ { "fidivr", WORD, 0, 0 }
};
static struct finst db_Escb[] = {
static const struct finst db_Escb[] = {
/*0*/ { "fild", WORD, 0, 0 },
/*1*/ { "", NONE, 0, 0 },
/*2*/ { "fist", WORD, 0, 0 },
@ -432,7 +432,7 @@ static struct finst db_Escb[] = {
/*7*/ { "fstp", EXTR, 0, 0 },
};
static struct finst db_Escc[] = {
static const struct finst db_Escc[] = {
/*0*/ { "fadd", DBLR, op2(ST,STI), 0 },
/*1*/ { "fmul", DBLR, op2(ST,STI), 0 },
/*2*/ { "fcom", DBLR, op2(ST,STI), 0 },
@ -443,7 +443,7 @@ static struct finst db_Escc[] = {
/*7*/ { "fdivr", DBLR, op2(ST,STI), "fdiv" },
};
static struct finst db_Escd[] = {
static const struct finst db_Escd[] = {
/*0*/ { "fld", DBLR, op1(STI), "ffree" },
/*1*/ { "", NONE, 0, 0 },
/*2*/ { "fst", DBLR, op1(STI), 0 },
@ -454,7 +454,7 @@ static struct finst db_Escd[] = {
/*7*/ { "fnstsw", NONE, 0, 0 },
};
static struct finst db_Esce[] = {
static const struct finst db_Esce[] = {
/*0*/ { "fiadd", LONG, op2(ST,STI), "faddp" },
/*1*/ { "fimul", LONG, op2(ST,STI), "fmulp" },
/*2*/ { "ficom", LONG, 0, 0 },
@ -465,7 +465,7 @@ static struct finst db_Esce[] = {
/*7*/ { "fidivr", LONG, op2(ST,STI), "fdivp" },
};
static struct finst db_Escf[] = {
static const struct finst db_Escf[] = {
/*0*/ { "fild", LONG, 0, 0 },
/*1*/ { "", LONG, 0, 0 },
/*2*/ { "fist", LONG, 0, 0 },
@ -476,12 +476,12 @@ static struct finst db_Escf[] = {
/*7*/ { "fstp", QUAD, 0, 0 },
};
static struct finst *db_Esc_inst[] = {
static const struct finst * const db_Esc_inst[] = {
db_Esc8, db_Esc9, db_Esca, db_Escb,
db_Escc, db_Escd, db_Esce, db_Escf
};
static char * db_Grp1[] = {
static const char * const db_Grp1[] = {
"add",
"or",
"adc",
@ -492,7 +492,7 @@ static char * db_Grp1[] = {
"cmp"
};
static char * db_Grp2[] = {
static const char * const db_Grp2[] = {
"rol",
"ror",
"rcl",
@ -503,7 +503,7 @@ static char * db_Grp2[] = {
"sar"
};
static struct inst db_Grp3[] = {
static const struct inst db_Grp3[] = {
{ "test", TRUE, NONE, op2(I,E), 0 },
{ "test", TRUE, NONE, op2(I,E), 0 },
{ "not", TRUE, NONE, op1(E), 0 },
@ -514,7 +514,7 @@ static struct inst db_Grp3[] = {
{ "idiv", TRUE, NONE, op2(E,A), 0 },
};
static struct inst db_Grp4[] = {
static const struct inst db_Grp4[] = {
{ "inc", TRUE, BYTE, op1(E), 0 },
{ "dec", TRUE, BYTE, op1(E), 0 },
{ "", TRUE, NONE, 0, 0 },
@ -525,7 +525,7 @@ static struct inst db_Grp4[] = {
{ "", TRUE, NONE, 0, 0 }
};
static struct inst db_Grp5[] = {
static const struct inst db_Grp5[] = {
{ "inc", TRUE, LONG, op1(E), 0 },
{ "dec", TRUE, LONG, op1(E), 0 },
{ "call", TRUE, NONE, op1(Eind),0 },
@ -536,7 +536,7 @@ static struct inst db_Grp5[] = {
{ "", TRUE, NONE, 0, 0 }
};
static struct inst db_inst_table[256] = {
static const struct inst db_inst_table[256] = {
/*00*/ { "add", TRUE, BYTE, op2(R, E), 0 },
/*01*/ { "add", TRUE, LONG, op2(R, E), 0 },
/*02*/ { "add", TRUE, BYTE, op2(E, R), 0 },
@ -827,7 +827,7 @@ static struct inst db_inst_table[256] = {
/*ff*/ { "", TRUE, NONE, 0, (char *)db_Grp5 },
};
static struct inst db_bad_inst =
static const struct inst db_bad_inst =
{ "???", FALSE, NONE, 0, 0 }
;
@ -842,12 +842,12 @@ static struct inst db_bad_inst =
struct i_addr {
int is_reg; /* if reg, reg number is in 'disp' */
int disp;
char * base;
char * index;
const char * base;
const char * index;
int ss;
};
static char * db_index_reg_16[8] = {
static const char * const db_index_reg_16[8] = {
"%bx,%si",
"%bx,%di",
"%bp,%si",
@ -858,20 +858,20 @@ static char * db_index_reg_16[8] = {
"%bx"
};
static char * db_reg[3][8] = {
static const char * const db_reg[3][8] = {
{ "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh" },
{ "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di" },
{ "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi" }
};
static char * db_seg_reg[8] = {
static const char * const db_seg_reg[8] = {
"%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", ""
};
/*
* lengths for size attributes
*/
static int db_lengths[] = {
static const int db_lengths[] = {
1, /* BYTE */
2, /* WORD */
4, /* LONG */
@ -1051,10 +1051,10 @@ void db_disasm_esc( DBG_ADDR *addr, int inst, int short_addr,
int size, char *seg )
{
int regmodrm;
struct finst *fp;
const struct finst *fp;
int mod;
struct i_addr address;
char * name;
const char * name;
get_value_inc(regmodrm, addr, 1, FALSE);
fp = &db_Esc_inst[inst - 0xd8][f_reg(regmodrm)];
@ -1134,8 +1134,8 @@ void DEBUG_Disasm( DBG_ADDR *addr )
int size;
int short_addr;
char * seg;
struct inst * ip;
char * i_name;
const struct inst *ip;
const char *i_name;
int i_size;
int i_mode;
int regmodrm = 0;

View File

@ -25,7 +25,7 @@ struct name_hash
#define NR_NAME_HASH 128
static struct name_hash * name_hash_table[NR_NAME_HASH] = {0,};
static struct name_hash * name_hash_table[NR_NAME_HASH];
static unsigned int name_hash( const char * name )
{

View File

@ -95,7 +95,7 @@ void DEBUG_PrintAddress( const DBG_ADDR *addr, int addrlen )
void DEBUG_Help(void)
{
int i = 0;
static const char * helptext[] =
static const char * const helptext[] =
{
"The commands accepted by the Wine debugger are a small subset",
"of the commands that gdb would accept. The commands currently",

View File

@ -182,7 +182,7 @@ int DIR_Init(void)
*/
UINT DIR_GetTempDosDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_TempDosDir, count );
if (path) lstrcpyn32A( path, DIR_TempDosDir, count );
return strlen( DIR_TempDosDir );
}
@ -192,7 +192,7 @@ UINT DIR_GetTempDosDir( LPSTR path, UINT count )
*/
UINT DIR_GetTempUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_TempUnixDir, count );
if (path) lstrcpyn32A( path, DIR_TempUnixDir, count );
return strlen( DIR_TempUnixDir );
}
@ -202,7 +202,7 @@ UINT DIR_GetTempUnixDir( LPSTR path, UINT count )
*/
UINT DIR_GetWindowsUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_WindowsUnixDir, count );
if (path) lstrcpyn32A( path, DIR_WindowsUnixDir, count );
return strlen( DIR_WindowsUnixDir );
}
@ -212,7 +212,7 @@ UINT DIR_GetWindowsUnixDir( LPSTR path, UINT count )
*/
UINT DIR_GetSystemUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_SystemUnixDir, count );
if (path) lstrcpyn32A( path, DIR_SystemUnixDir, count );
return strlen( DIR_SystemUnixDir );
}
@ -223,7 +223,7 @@ UINT DIR_GetSystemUnixDir( LPSTR path, UINT count )
UINT DIR_GetDosPath( int element, LPSTR path, UINT count )
{
if ((element < 0) || (element >= DIR_PathElements)) return 0;
if (path) lstrcpyn( path, DIR_DosPath[element], count );
if (path) lstrcpyn32A( path, DIR_DosPath[element], count );
return strlen( DIR_DosPath[element] );
}
@ -242,7 +242,7 @@ BYTE GetTempDrive( BYTE ignored )
*/
UINT GetWindowsDirectory( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_WindowsDosDir, count );
if (path) lstrcpyn32A( path, DIR_WindowsDosDir, count );
return strlen( DIR_WindowsDosDir );
}
@ -252,6 +252,6 @@ UINT GetWindowsDirectory( LPSTR path, UINT count )
*/
UINT GetSystemDirectory( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_SystemDosDir, count );
if (path) lstrcpyn32A( path, DIR_SystemDosDir, count );
return strlen( DIR_SystemDosDir );
}

View File

@ -397,7 +397,7 @@ static int DOSFS_FindUnixName( const char *path, const char *name,
if (!strcmp( dos_name, hash_name )) break;
}
}
if (dirent) lstrcpyn( buffer, dirent->d_name, maxlen );
if (dirent) lstrcpyn32A( buffer, dirent->d_name, maxlen );
closedir( dir );
dprintf_dosfs( stddeb, "DOSFS_FindUnixName(%s,%s) -> %s\n",
path, name, dirent ? buffer : "** Not found **" );
@ -422,7 +422,7 @@ const char *DOSFS_IsDevice( const char *name )
for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++)
{
const char *dev = DOSFS_Devices[i][0];
if (!lstrncmpi( dev, name, strlen(dev) ))
if (!lstrncmpi32A( dev, name, strlen(dev) ))
{
p = name + strlen( dev );
if (!*p || (*p == '.')) return DOSFS_Devices[i][1];
@ -468,7 +468,7 @@ const char * DOSFS_GetUnixFileName( const char * name, int check_last )
DOS_ERROR( ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk );
return NULL;
}
lstrcpyn( buffer, DRIVE_GetRoot(drive), MAX_PATHNAME_LEN );
lstrcpyn32A( buffer, DRIVE_GetRoot(drive), MAX_PATHNAME_LEN );
if (buffer[1]) root = buffer + strlen(buffer);
else root = buffer; /* root directory */
@ -478,8 +478,8 @@ const char * DOSFS_GetUnixFileName( const char * name, int check_last )
}
else
{
lstrcpyn( root + 1, DRIVE_GetUnixCwd(drive),
MAX_PATHNAME_LEN - (int)(root - buffer) - 1 );
lstrcpyn32A( root + 1, DRIVE_GetUnixCwd(drive),
MAX_PATHNAME_LEN - (int)(root - buffer) - 1 );
if (root[1]) *root = '/';
}
@ -582,7 +582,7 @@ const char * DOSFS_GetDosTrueName( const char *name, int unix_format )
else
{
*p++ = '\\';
lstrcpyn( p, DRIVE_GetDosCwd(drive), sizeof(buffer) - 3 );
lstrcpyn32A( p, DRIVE_GetDosCwd(drive), sizeof(buffer) - 3 );
if (*p) p += strlen(p); else p--;
}
*p = '\0';
@ -605,7 +605,7 @@ const char * DOSFS_GetDosTrueName( const char *name, int unix_format )
*p++ = '\\';
if (unix_format) /* Hash it into a DOS name */
{
lstrcpyn( p, DOSFS_Hash( name, FALSE ), len );
lstrcpyn32A( p, DOSFS_Hash( name, FALSE ), len );
len -= strlen(p);
p += strlen(p);
while (!IS_END_OF_NAME(*name)) name++;
@ -678,7 +678,7 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
if (!*drive_path) drive_root = 1;
}
dprintf_dosfs(stddeb, "DOSFS_FindNext: drive_root = %d\n", drive_root);
lstrcpyn( buffer, path, sizeof(buffer) - 1 );
lstrcpyn32A( buffer, path, sizeof(buffer) - 1 );
}
strcat( buffer, "/" );
@ -695,7 +695,7 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
if (drive_root && (dirent->d_name[0] == '.') &&
(!dirent->d_name[1] ||
((dirent->d_name[1] == '.') && !dirent->d_name[2]))) continue;
lstrcpyn( p, dirent->d_name, sizeof(buffer) - (int)(p - buffer) );
lstrcpyn32A( p, dirent->d_name, sizeof(buffer) - (int)(p - buffer) );
if (!FILE_Stat( buffer, &entry->attr, &entry->size,
&entry->date, &entry->time ))
@ -705,7 +705,7 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
}
if (entry->attr & ~attr) continue;
strcpy( entry->name, hash_name );
lstrcpyn( entry->unixname, dirent->d_name, sizeof(entry->unixname) );
lstrcpyn32A( entry->unixname, dirent->d_name, sizeof(entry->unixname));
dprintf_dosfs( stddeb, "DOSFS_FindNext: returning %s %02x %ld\n",
entry->name, entry->attr, entry->size );
cur_pos += count;

View File

@ -72,7 +72,7 @@ static DRIVETYPE DRIVE_GetDriveType( const char *name )
PROFILE_GetWineIniString( name, "Type", "hd", buffer, sizeof(buffer) );
for (i = 0; i < sizeof(DRIVE_Types)/sizeof(DRIVE_Types[0]); i++)
{
if (!lstrcmpi( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
if (!lstrcmpi32A( buffer, DRIVE_Types[i] )) return (DRIVETYPE)i;
}
fprintf( stderr, "%s: unknown type '%s', defaulting to 'hd'.\n",
name, buffer );
@ -362,7 +362,7 @@ int DRIVE_Chdir( int drive, const char *path )
dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:,%s)\n", 'A' + drive, path );
strcpy( buffer, "A:" );
buffer[0] += drive;
lstrcpyn( buffer + 2, path, sizeof(buffer) - 2 );
lstrcpyn32A( buffer + 2, path, sizeof(buffer) - 2 );
if (!(unix_cwd = DOSFS_GetUnixFileName( buffer, TRUE ))) return 0;
if (!FILE_Stat( unix_cwd, &attr, NULL, NULL, NULL )) return 0;
@ -374,7 +374,7 @@ int DRIVE_Chdir( int drive, const char *path )
unix_cwd += strlen( DOSDrives[drive].root );
while (*unix_cwd == '/') unix_cwd++;
buffer[2] = '/';
lstrcpyn( buffer + 3, unix_cwd, sizeof(buffer) - 3 );
lstrcpyn32A( buffer + 3, unix_cwd, sizeof(buffer) - 3 );
if (!(dos_cwd = DOSFS_GetDosTrueName( buffer, TRUE ))) return 0;
dprintf_dosfs( stddeb, "DRIVE_Chdir(%c:): unix_cwd=%s dos_cwd=%s\n",
@ -388,7 +388,7 @@ int DRIVE_Chdir( int drive, const char *path )
if (pTask && (pTask->curdrive & 0x80) &&
((pTask->curdrive & ~0x80) == drive))
{
lstrcpyn( pTask->curdir, dos_cwd + 2, sizeof(pTask->curdir) );
lstrcpyn32A( pTask->curdir, dos_cwd + 2, sizeof(pTask->curdir) );
DRIVE_LastTask = GetCurrentTask();
}
return 1;
@ -511,7 +511,7 @@ UINT32 GetCurrentDirectory( UINT32 buflen, LPSTR buf )
*buf = '\0';
return 0;
}
lstrcpyn( buf, s, buflen );
lstrcpyn32A( buf, s, buflen );
return strlen(s); /* yes */
}

View File

@ -5,6 +5,7 @@
* Copyright 1996 Alexandre Julliard
*/
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@ -43,7 +44,7 @@ typedef struct tagDOS_FILE
} DOS_FILE;
/* Global files array */
static DOS_FILE DOSFiles[MAX_OPEN_FILES] = { { 0, }, };
static DOS_FILE DOSFiles[MAX_OPEN_FILES];
static DOS_FILE *FILE_First = DOSFiles;
static DOS_FILE *FILE_LastUsed = DOSFiles;
@ -599,12 +600,12 @@ HFILE FILE_Dup2( HFILE hFile1, HFILE hFile2 )
/***********************************************************************
* FILE_Read
*/
LONG FILE_Read( HFILE hFile, void *buffer, LONG count )
INT32 FILE_Read( HFILE hFile, LPVOID buffer, UINT32 count )
{
DOS_FILE *file;
LONG result;
INT32 result;
dprintf_file( stddeb, "FILE_Read: %d %p %ld\n", hFile, buffer, count );
dprintf_file( stddeb, "FILE_Read: %d %p %d\n", hFile, buffer, count );
if (!(file = FILE_GetFile( hFile ))) return -1;
if (!count) return 0;
if ((result = read( file->unix_handle, buffer, count )) == -1)
@ -622,6 +623,14 @@ INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
UINT num = unique ? (unique & 0xffff) : time(NULL) & 0xffff;
char *p;
if ((drive & TF_FORCEDRIVE) &&
!DRIVE_IsValid( toupper(drive & ~TF_FORCEDRIVE) - 'A' ))
{
drive &= ~TF_FORCEDRIVE;
fprintf( stderr, "Warning: GetTempFileName: invalid drive %d specified\n",
drive );
}
if (drive & TF_FORCEDRIVE)
{
sprintf( buffer, "%c:", drive & ~TF_FORCEDRIVE );
@ -638,7 +647,7 @@ INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
if (unique)
{
lstrcpyn( buffer, DOSFS_GetDosTrueName( buffer, FALSE ), 144 );
lstrcpyn32A( buffer, DOSFS_GetDosTrueName( buffer, FALSE ), 144 );
dprintf_file( stddeb, "GetTempFileName: returning %s\n", buffer );
return unique;
}
@ -659,7 +668,7 @@ INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
sprintf( p, "%04x.tmp", num );
} while (num != (unique & 0xffff));
lstrcpyn( buffer, DOSFS_GetDosTrueName( buffer, FALSE ), 144 );
lstrcpyn32A( buffer, DOSFS_GetDosTrueName( buffer, FALSE ), 144 );
dprintf_file( stddeb, "GetTempFileName: returning %s\n", buffer );
return num;
}
@ -696,7 +705,7 @@ HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
if (mode & OF_PARSE)
{
if (!(dosName = DOSFS_GetDosTrueName( name, FALSE ))) goto error;
lstrcpyn( ofs->szPathName, dosName, sizeof(ofs->szPathName) );
lstrcpyn32A( ofs->szPathName, dosName, sizeof(ofs->szPathName) );
ofs->fFixedDisk = (GetDriveType( dosName[0]-'A' ) != DRIVE_REMOVABLE);
dprintf_file( stddeb, "OpenFile(%s): OF_PARSE, res = '%s', %d\n",
name, ofs->szPathName, hFileRet );
@ -712,8 +721,8 @@ HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
if (mode & OF_CREATE)
{
if (!(file = FILE_Create( name, 0666, FALSE ))) goto error;
lstrcpyn( ofs->szPathName, DOSFS_GetDosTrueName( name, FALSE ),
sizeof(ofs->szPathName) );
lstrcpyn32A( ofs->szPathName, DOSFS_GetDosTrueName( name, FALSE ),
sizeof(ofs->szPathName) );
goto success;
}
@ -721,7 +730,7 @@ HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
/* First try the current directory */
lstrcpyn( ofs->szPathName, name, sizeof(ofs->szPathName) );
lstrcpyn32A( ofs->szPathName, name, sizeof(ofs->szPathName) );
if ((unixName = DOSFS_GetUnixFileName( ofs->szPathName, TRUE )) != NULL)
goto found;
@ -784,8 +793,8 @@ HFILE OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
found:
dprintf_file( stddeb, "OpenFile: found '%s'\n", unixName );
lstrcpyn( ofs->szPathName, DOSFS_GetDosTrueName( ofs->szPathName, FALSE ),
sizeof(ofs->szPathName) );
lstrcpyn32A(ofs->szPathName, DOSFS_GetDosTrueName( ofs->szPathName, FALSE),
sizeof(ofs->szPathName) );
if (mode & OF_DELETE)
{

View File

@ -73,7 +73,7 @@ static void PROFILE_CopyEntry( char *buffer, const char *value, int len,
if (!handle_env)
{
lstrcpyn( buffer, value, len );
lstrcpyn32A( buffer, value, len );
if (quote && (len >= strlen(value))) buffer[strlen(buffer)-1] = '\0';
return;
}
@ -86,10 +86,10 @@ static void PROFILE_CopyEntry( char *buffer, const char *value, int len,
const char *env_p;
const char *p2 = strchr( p, '}' );
if (!p2) continue; /* ignore it */
lstrcpyn( env_val, p + 2, MIN( sizeof(env_val), (int)(p2-p)-1 ) );
lstrcpyn32A(env_val, p + 2, MIN( sizeof(env_val), (int)(p2-p)-1 ));
if ((env_p = getenv( env_val )) != NULL)
{
lstrcpyn( buffer, env_p, len );
lstrcpyn32A( buffer, env_p, len );
buffer += strlen( buffer );
len -= strlen( buffer );
}
@ -230,7 +230,7 @@ static BOOL PROFILE_DeleteSection( PROFILESECTION **section, const char *name )
{
while (*section)
{
if ((*section)->name && !lstrcmpi( (*section)->name, name ))
if ((*section)->name && !lstrcmpi32A( (*section)->name, name ))
{
PROFILESECTION *to_del = *section;
*section = to_del->next;
@ -254,12 +254,12 @@ static BOOL PROFILE_DeleteKey( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi( (*section)->name, section_name ))
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi( (*key)->name, key_name ))
if (!lstrcmpi32A( (*key)->name, key_name ))
{
PROFILEKEY *to_del = *key;
*key = to_del->next;
@ -288,12 +288,12 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section,
{
while (*section)
{
if ((*section)->name && !lstrcmpi( (*section)->name, section_name ))
if ((*section)->name && !lstrcmpi32A( (*section)->name, section_name ))
{
PROFILEKEY **key = &(*section)->key;
while (*key)
{
if (!lstrcmpi( (*key)->name, key_name )) return *key;
if (!lstrcmpi32A( (*key)->name, key_name )) return *key;
key = &(*key)->next;
}
if (!create) return NULL;
@ -446,7 +446,7 @@ static INT PROFILE_GetSection( PROFILESECTION *section,
PROFILEKEY *key;
while (section)
{
if (section->name && !lstrcmpi( section->name, section_name ))
if (section->name && !lstrcmpi32A( section->name, section_name ))
{
INT oldlen = len;
for (key = section->key; key; key = key->next)
@ -574,7 +574,7 @@ int PROFILE_LoadWineIni(void)
if ((p = getenv( "HOME" )) != NULL)
{
lstrcpyn( buffer, p, MAX_PATHNAME_LEN - sizeof(PROFILE_WineIniName) );
lstrcpyn32A(buffer, p, MAX_PATHNAME_LEN - sizeof(PROFILE_WineIniName));
strcat( buffer, PROFILE_WineIniName );
if ((f = fopen( buffer, "r" )) != NULL)
{
@ -662,7 +662,7 @@ INT GetPrivateProfileString( LPCSTR section, LPCSTR entry, LPCSTR def_val,
{
if (PROFILE_Open( filename ))
return PROFILE_GetString( section, entry, def_val, buffer, len );
lstrcpyn( buffer, def_val, len );
lstrcpyn32A( buffer, def_val, len );
return strlen( buffer );
}

View File

@ -15,6 +15,7 @@ DLLS = \
kernel.spec \
kernel32.spec \
keyboard.spec \
lz32.spec \
lzexpand.spec \
mmsystem.spec \
mouse.spec \
@ -37,6 +38,7 @@ DLLS = \
user.spec \
user32.spec \
ver.spec \
version.spec \
w32sys.spec \
win87em.spec \
winsock.spec \

View File

@ -56,7 +56,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
#46 pascal __GP?
47 pascal16 CombineRgn(word word word s_word) CombineRgn
48 pascal16 CreateBitmap(word word word word ptr) CreateBitmap
49 pascal16 CreateBitmapIndirect(ptr) CreateBitmapIndirect
49 pascal16 CreateBitmapIndirect(ptr) CreateBitmapIndirect16
50 pascal16 CreateBrushIndirect(ptr) CreateBrushIndirect
51 pascal16 CreateCompatibleBitmap(word word word) CreateCompatibleBitmap
52 pascal16 CreateCompatibleDC(word) CreateCompatibleDC
@ -89,7 +89,7 @@ heap 65488 # 65536 - 16 (instance data) - 32 (stock objects)
79 pascal GetDCOrg(word) GetDCOrg
80 pascal16 GetDeviceCaps(word s_word) GetDeviceCaps
81 pascal16 GetMapMode(word) GetMapMode
82 pascal16 GetObject(word word ptr) GetObject
82 pascal16 GetObject(word s_word ptr) GetObject16
83 pascal GetPixel(word s_word s_word) GetPixel
84 pascal16 GetPolyFillMode(word) GetPolyFillMode
85 pascal16 GetROP2(word) GetROP2

View File

@ -27,8 +27,8 @@ base 1
0022 stub CopyEnhMetaFileW
0023 stub CopyMetaFileA
0024 stub CopyMetaFileW
0025 stub CreateBitmap
0026 stub CreateBitmapIndirect
0025 stdcall CreateBitmap(long long long long ptr) CreateBitmap
0026 stdcall CreateBitmapIndirect(ptr) CreateBitmapIndirect32
0027 stub CreateBrushIndirect
0028 stub CreateColorSpaceA
0029 stub CreateColorSpaceW
@ -40,7 +40,7 @@ base 1
0035 stub CreateDIBPatternBrushPt
0036 stub CreateDIBSection
0037 stub CreateDIBitmap
0038 stub CreateDiscardableBitmap
0038 stdcall CreateDiscardableBitmap(long long long) CreateDiscardableBitmap
0039 stdcall CreateEllipticRgn(long long long long) CreateEllipticRgn
0040 stdcall CreateEllipticRgnIndirect(ptr) CreateEllipticRgnIndirect32
0041 stub CreateEnhMetaFileA
@ -145,7 +145,7 @@ base 1
0140 stub GdiSetServerAttr
0141 stub GetArcDirection
0142 stub GetAspectRatioFilterEx
0143 stub GetBitmapBits
0143 stdcall GetBitmapBits(long long ptr) GetBitmapBits
0144 stdcall GetBitmapDimensionEx(long ptr) GetBitmapDimensionEx32
0145 stub GetBkColor
0146 stub GetBkMode
@ -206,9 +206,9 @@ base 1
0201 stub GetMiterLimit
0202 stdcall GetNearestColor(long long) GetNearestColor
0203 stub GetNearestPaletteIndex
0204 stdcall GetObjectA(long long ptr) WIN32_GetObject
0204 stdcall GetObjectA(long long ptr) GetObject32A
0205 stub GetObjectType
0206 stub GetObjectW
0206 stdcall GetObjectW(long long ptr) GetObject32W
0207 stub GetOutlineTextMetricsA
0208 stub GetOutlineTextMetricsW
0209 stub GetPaletteEntries
@ -305,7 +305,7 @@ base 1
0300 stub SelectPalette
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stub SetBitmapBits
0303 stdcall SetBitmapBits(long long ptr) SetBitmapBits
0304 stdcall SetBitmapDimensionEx(long long long ptr) SetBitmapDimensionEx32
0305 stdcall SetBkColor(long long) SetBkColor
0306 stub SetBkMode

View File

@ -83,10 +83,10 @@ type win16
84 pascal _llseek(word long word) _llseek
85 pascal16 _lopen(ptr word) _lopen
86 pascal16 _lwrite(word ptr word) _lwrite
87 pascal16 RESERVED5(ptr ptr) lstrcmp
88 pascal lstrcpy(segptr segptr) lstrcpy
89 pascal lstrcat(segptr segptr) lstrcat
90 pascal16 lstrlen(ptr) lstrlen
87 pascal16 RESERVED5(ptr ptr) lstrcmp16
88 pascal lstrcpy(segptr segptr) lstrcpy16
89 pascal lstrcat(segptr segptr) lstrcat16
90 pascal16 lstrlen(ptr) lstrlen16
91 register InitTask() InitTask
92 pascal16 GetTempDrive(byte) GetTempDrive
93 pascal16 GetCodeHandle(segptr) GetCodeHandle
@ -259,8 +259,8 @@ type win16
349 pascal _hread(word segptr long) _hread
350 pascal _hwrite(word ptr long) _hwrite
#351 BUNNY_351
352 stub lstrcatn
353 pascal lstrcpyn(segptr segptr word) WIN16_lstrcpyn
352 pascal lstrcatn(segptr segptr word) lstrcatn16
353 pascal lstrcpyn(segptr segptr word) lstrcpyn16
354 stub GetAppCompatFlags
355 pascal16 GetWinDebugInfo(ptr word) GetWinDebugInfo
356 pascal16 SetWinDebugInfo(ptr) SetWinDebugInfo

View File

@ -145,7 +145,7 @@ base 1
0140 stub FreeConsole
0141 stdcall FreeEnvironmentStringsA(ptr) FreeEnvironmentStringsA
0142 stdcall FreeEnvironmentStringsW(ptr) FreeEnvironmentStringsW
0143 stub FreeLibrary
0143 stdcall FreeLibrary(long) FreeLibrary32
0144 stub FreeLibraryAndExitThread
0145 stdcall FreeResource(long) FreeResource32
0146 stub FreeVirtualBuffer
@ -308,10 +308,9 @@ base 1
0303 stub GetUserDefaultLCID
0304 stub GetUserDefaultLangID
0305 stub GetVDMCurrentDirectories
#Use Win 3.1 GetVersion for now
0306 stdcall GetVersion() GetVersion
0307 stub GetVersionExA
0308 stub GetVersionExW
0306 stdcall GetVersion() GetVersion32
0307 stdcall GetVersionExA(ptr) GetVersionEx32A
0308 stdcall GetVersionExW(ptr) GetVersionEx32W
0309 stub GetVolumeInformationA
0310 stub GetVolumeInformationW
0311 stdcall GetWindowsDirectoryA(ptr long) GetWindowsDirectory
@ -350,9 +349,9 @@ base 1
0344 stdcall HeapWalk(long ptr) HeapWalk
0345 stub InitAtomTable
0346 stdcall InitializeCriticalSection(ptr) InitializeCriticalSection
0347 stub InterlockedDecrement
0348 stub InterlockedExchange
0349 stub InterlockedIncrement
0347 stdcall InterlockedDecrement(ptr) InterlockedDecrement
0348 stdcall InterlockedExchange(ptr) InterlockedExchange
0349 stdcall InterlockedIncrement(ptr) InterlockedIncrement
0350 stub InvalidateConsoleDIBits
0351 stdcall IsBadCodePtr(ptr long) WIN32_IsBadCodePtr
0352 stub IsBadHugeReadPtr
@ -489,7 +488,7 @@ base 1
0483 stub SetEndOfFile
0484 stdcall SetEnvironmentVariableA(ptr ptr) SetEnvironmentVariableA
0485 stub SetEnvironmentVariableW
0486 stub SetErrorMode
0486 stdcall SetErrorMode(long) SetErrorMode
0487 stdcall SetEvent(long) SetEvent
0488 stub SetFileApisToANSI
0489 stub SetFileApisToOEM
@ -601,24 +600,24 @@ base 1
0595 stub _lopen
0596 stub _lread
0597 stub _lwrite
0598 stdcall lstrcat(ptr ptr) strcat
0599 stdcall lstrcatA(ptr ptr) strcat
0600 stub lstrcatW
0601 stdcall lstrcmp(ptr ptr) strcmp
0602 stdcall lstrcmpA(ptr ptr) strcmp
0603 stub lstrcmpW
0604 stub lstrcmpi
0605 stub lstrcmpiA
0606 stub lstrcmpiW
0607 stdcall lstrcpy(ptr ptr) strcpy
0608 stdcall lstrcpyA(ptr ptr) strcpy
0609 stub lstrcpyW
0610 stub lstrcpyn
0611 stub lstrcpynA
0612 stub lstrcpynW
0613 stdcall lstrlen(ptr) strlen
0614 stdcall lstrlenA(ptr) strlen
0615 stub lstrlenW
0598 stdcall lstrcat(ptr ptr) lstrcat32A
0599 stdcall lstrcatA(ptr ptr) lstrcat32A
0600 stdcall lstrcatW(ptr ptr) lstrcat32W
0601 stdcall lstrcmp(ptr ptr) lstrcmp32A
0602 stdcall lstrcmpA(ptr ptr) lstrcmp32A
0603 stdcall lstrcmpW(ptr ptr) lstrcmp32W
0604 stdcall lstrcmpi(ptr ptr) lstrcmpi32A
0605 stdcall lstrcmpiA(ptr ptr) lstrcmpi32A
0606 stdcall lstrcmpiW(ptr ptr) lstrcmpi32W
0607 stdcall lstrcpy(ptr ptr) lstrcpy32A
0608 stdcall lstrcpyA(ptr ptr) lstrcpy32A
0609 stdcall lstrcpyW(ptr ptr) lstrcpy32W
0610 stdcall lstrcpyn(ptr ptr long) lstrcpyn32A
0611 stdcall lstrcpynA(ptr ptr long) lstrcpyn32A
0612 stdcall lstrcpynW(ptr ptr long) lstrcpyn32W
0613 stdcall lstrlen(ptr) lstrlen32A
0614 stdcall lstrlenA(ptr) lstrlen32A
0615 stdcall lstrlenW(ptr) lstrlen32W
#late additions
0616 stub GetPrivateProfileSectionNamesA
0617 stub GetPrivateProfileSectionNamesW

15
if1632/lz32.spec Normal file
View File

@ -0,0 +1,15 @@
name lz32
type win32
0 stdcall LZCopy(word word) LZCopy
1 stdcall LZOpenFileA(ptr ptr word) LZOpenFile32A
2 stdcall LZInit(word) LZInit
3 stdcall LZSeek(word long word) LZSeek
4 stdcall LZRead(word ptr long) LZRead32
5 stdcall LZClose(word) LZClose
6 stdcall LZStart() LZStart
7 stdcall CopyLZFile(word word) CopyLZFile
8 stdcall LZDone() LZDone
9 stdcall GetExpandedNameA(ptr ptr) GetExpandedName32A
10 stdcall LZOpenFileW(ptr ptr word) LZOpenFile32W
11 stdcall GetExpandedNameW(ptr ptr) GetExpandedName32W

View File

@ -2,14 +2,14 @@ name lzexpand
type win16
1 pascal LZCopy(word word) LZCopy
2 pascal16 LZOpenFile(ptr ptr word) LZOpenFile
2 pascal16 LZOpenFile(ptr ptr word) LZOpenFile16
3 pascal16 LZInit(word) LZInit
4 pascal LZSeek(word long word) LZSeek
5 pascal16 LZRead(word segptr word) LZRead
5 pascal16 LZRead(word segptr word) LZRead16
6 pascal16 LZClose(word) LZClose
7 pascal16 LZStart() LZStart
8 pascal CopyLZFile(word word) CopyLZFile
9 pascal16 LZDone() LZDone
10 pascal16 GetExpandedName(ptr ptr) GetExpandedName
10 pascal16 GetExpandedName(ptr ptr) GetExpandedName16
#11 WEP
#12 ___EXPORTEDSTUB

View File

@ -108,7 +108,7 @@ heap 65520
106 pascal16 GetKeyState(word) GetKeyState
107 pascal DefWindowProc(word word word long) DefWindowProc16
108 pascal16 GetMessage(segptr word word word) GetMessage
109 pascal16 PeekMessage(ptr word word word word) PeekMessage
109 pascal16 PeekMessage(ptr word word word word) PeekMessage16
110 pascal16 PostMessage(word word word long) PostMessage
111 pascal SendMessage(word word word long) SendMessage16
112 pascal16 WaitMessage() WaitMessage
@ -184,7 +184,7 @@ heap 65520
182 pascal16 KillSystemTimer(word word) KillSystemTimer
183 pascal16 GetCaretPos(ptr) GetCaretPos16
184 stub QuerySendMessage
185 pascal16 GrayString(word word ptr ptr word word word word word) GrayString
185 pascal16 GrayString(word word segptr segptr s_word s_word s_word s_word s_word) GrayString
186 pascal16 SwapMouseButton(word) SwapMouseButton
187 pascal16 EndMenu() EndMenu
188 pascal16 SetSysModalWindow(word) SetSysModalWindow
@ -372,14 +372,14 @@ heap 65520
416 pascal16 TrackPopupMenu(word word s_word s_word s_word word ptr) TrackPopupMenu16
417 pascal GetMenuCheckMarkDimensions() GetMenuCheckMarkDimensions
418 pascal16 SetMenuItemBitmaps(word word word word word) SetMenuItemBitmaps
420 pascal16 wsprintf() wsprintf
421 pascal16 wvsprintf(ptr ptr ptr) wvsprintf
420 pascal16 wsprintf() WIN16_wsprintf16
421 pascal16 wvsprintf(ptr ptr ptr) wvsprintf16
422 stub DlgDirSelectEx
423 stub DlgDirSelectComboBoxEx
427 pascal16 FindWindowEx(word word segptr ptr) FindWindowEx16
428 stub TileWindows
429 stub CascadeWindows
430 pascal16 lstrcmp(ptr ptr) lstrcmp
430 pascal16 lstrcmp(ptr ptr) lstrcmp16
431 pascal AnsiUpper(segptr) WIN16_AnsiUpper
432 pascal AnsiLower(segptr) WIN16_AnsiLower
433 pascal16 IsCharAlpha(byte) IsCharAlpha
@ -413,7 +413,7 @@ heap 65520
465 pascal16 DragDetect(word long) DragDetect
466 pascal16 DrawFocusRect(word ptr) DrawFocusRect16
470 stub StringFunc
471 pascal16 lstrcmpi(ptr ptr) lstrcmpi
471 pascal16 lstrcmpi(ptr ptr) lstrcmpi16
472 pascal AnsiNext(segptr) AnsiNext
473 pascal AnsiPrev(segptr segptr) AnsiPrev
475 stub SetScrollInfo

View File

@ -208,7 +208,7 @@ base 1
0201 stdcall FlashWindow(long long) FlashWindow
0202 stdcall FrameRect(long ptr long) FrameRect32
0203 stub FreeDDElParam
0204 stub GetActiveWindow
0204 stdcall GetActiveWindow() GetActiveWindow
0205 stub GetAppCompatFlags
0206 stub GetAsyncKeyState
0207 stub GetCapture
@ -419,8 +419,8 @@ base 1
0412 stub OpenWindowStationW
0413 stub PackDDElParam
0414 stub PaintDesktop
0415 stub PeekMessageA
0416 stub PeekMessageW
0415 stdcall PeekMessageA(ptr long long long long) PeekMessage32A
0416 stdcall PeekMessageW(ptr long long long long) PeekMessage32W
0417 stub PlaySoundEvent
0418 stdcall PostMessageA(long long long long) PostMessage
0419 stub PostMessageW
@ -588,10 +588,10 @@ base 1
0581 stdcall WindowFromPoint(long long) WindowFromPoint32
0582 stub keybd_event
0583 stub mouse_event
0584 stdcall wsprintfA() USER32_wsprintfA
0585 stub wsprintfW
0586 stub wvsprintfA
0587 stub wvsprintfW
0584 stdcall wsprintfA() WIN32_wsprintf32A
0585 stdcall wsprintfW() WIN32_wsprintf32W
0586 stdcall wvsprintfA(ptr ptr ptr) wvsprintf32A
0587 stdcall wvsprintfW(ptr ptr ptr) wvsprintf32W
#late additions
0588 stub ChangeDisplaySettingsA
0588 stub ChangeDisplaySettingsW

View File

@ -5,12 +5,12 @@ type win16
2 pascal GetFileResourceSize(ptr segptr segptr ptr) GetFileResourceSize
3 pascal GetFileResource(ptr segptr segptr long long ptr) GetFileResource
6 pascal GetFileVersionInfoSize(ptr ptr) GetFileVersionInfoSize
7 pascal GetFileVersionInfo(ptr long long ptr) GetFileVersionInfo
8 pascal VerFindFile(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile
9 pascal VerInstallFile(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile
10 pascal VerLanguageName(word ptr word) VerLanguageName
11 pascal VerQueryValue(segptr ptr ptr ptr) VerQueryValue
6 pascal GetFileVersionInfoSize(ptr ptr) GetFileVersionInfoSize16
7 pascal GetFileVersionInfo(ptr long long ptr) GetFileVersionInfo16
8 pascal VerFindFile(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile16
9 pascal VerInstallFile(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile16
10 pascal VerLanguageName(word ptr word) VerLanguageName16
11 pascal VerQueryValue(segptr ptr ptr ptr) VerQueryValue16
20 stub GETFILEVERSIONINFORAW
#21 VERFTHK_THUNKDATA16
#22 VERTHKSL_THUNKDATA16

17
if1632/version.spec Normal file
View File

@ -0,0 +1,17 @@
name version
type win32
0 stdcall GetFileVersionInfoA(ptr long long ptr) GetFileVersionInfo32A
1 stdcall GetFileVersionInfoSizeA(ptr ptr) GetFileVersionInfoSize32A
2 stdcall GetFileVersionInfoSizeW(ptr ptr) GetFileVersionInfoSize32W
3 stdcall GetFileVersionInfoW(ptr long long ptr) GetFileVersionInfo32W
#4 stub VerFThk_ThunkData32
5 stdcall VerFindFileA(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile32A
6 stdcall VerFindFileW(word ptr ptr ptr ptr ptr ptr ptr) VerFindFile32W
7 stdcall VerInstallFileA(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile32A
8 stdcall VerInstallFileW(word ptr ptr ptr ptr ptr ptr ptr) VerInstallFile32W
9 stdcall VerLanguageNameA(word ptr word) VerLanguageName32A
10 stdcall VerLanguageNameW(word ptr word) VerLanguageName32W
11 stdcall VerQueryValueA(segptr ptr ptr ptr) VerQueryValue32A
12 stdcall VerQueryValueW(segptr ptr ptr ptr) VerQueryValue32W
#13 stub VerThkSL_ThunkData32

View File

@ -13,7 +13,7 @@
typedef struct
{
GDIOBJHDR header;
BITMAP bitmap;
BITMAP16 bitmap;
Pixmap pixmap;
SIZE16 size; /* For SetBitmapDimension() */
} BITMAPOBJ;
@ -37,7 +37,8 @@ extern GC BITMAP_monoGC, BITMAP_colorGC;
/* objects/bitmap.c */
extern BOOL BITMAP_Init(void);
extern int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer );
extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
extern BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap );
extern HBITMAP BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
BITMAPOBJ * bmp );

View File

@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGBRUSH logbrush WINE_PACKED;
LOGBRUSH16 logbrush WINE_PACKED;
} BRUSHOBJ;
#ifndef WINELIB

View File

@ -20,28 +20,28 @@ int CallTo32_LargeStack( int (*func)(), int nbargs, ... );
/* by the build program to generate the file if1632/callto16.S */
/* func ds parameters */
extern WORD CallTo16_word_ ( FARPROC, WORD );
extern WORD CallTo16_word_ ( FARPROC16, WORD );
#ifndef WINELIB
extern WORD CallTo16_word_ww ( FARPROC, WORD, WORD, WORD );
extern WORD CallTo16_word_wl ( FARPROC, WORD, WORD, LONG );
extern WORD CallTo16_word_ll ( FARPROC, WORD, LONG, LONG );
extern WORD CallTo16_word_www ( FARPROC, WORD, WORD, WORD, WORD );
extern WORD CallTo16_word_wwl ( FARPROC, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_wlw ( FARPROC, WORD, WORD, LONG, WORD );
extern LONG CallTo16_long_wwl ( FARPROC, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_llwl ( FARPROC, WORD, LONG, LONG, WORD, LONG );
extern LONG CallTo16_long_wwwl ( FARPROC, WORD, WORD, WORD, WORD, LONG );
extern WORD CallTo16_word_lwww ( FARPROC, WORD, LONG, WORD, WORD, WORD );
extern WORD CallTo16_word_wwll ( FARPROC, WORD, WORD, WORD, LONG, LONG);
extern WORD CallTo16_word_wllwl( FARPROC, WORD, WORD, LONG, LONG, WORD, LONG );
extern WORD CallTo16_word_wwlll( FARPROC, WORD, WORD, WORD, LONG, LONG, LONG );
extern LONG CallTo16_long_lllllllwlwwwl( FARPROC, WORD, LONG, LONG, LONG,
extern WORD CallTo16_word_ww (FARPROC16, WORD, WORD, WORD);
extern WORD CallTo16_word_wl (FARPROC16, WORD, WORD, LONG);
extern WORD CallTo16_word_ll (FARPROC16, WORD, LONG, LONG);
extern WORD CallTo16_word_www (FARPROC16, WORD, WORD, WORD, WORD);
extern WORD CallTo16_word_wwl (FARPROC16, WORD, WORD, WORD, LONG);
extern WORD CallTo16_word_wlw (FARPROC16, WORD, WORD, LONG, WORD);
extern LONG CallTo16_long_wwl (FARPROC16, WORD, WORD, WORD, LONG);
extern WORD CallTo16_word_llwl (FARPROC16, WORD, LONG, LONG, WORD, LONG);
extern LONG CallTo16_long_wwwl (FARPROC16, WORD, WORD, WORD, WORD, LONG);
extern WORD CallTo16_word_lwww (FARPROC16, WORD, LONG, WORD, WORD, WORD);
extern WORD CallTo16_word_wwll (FARPROC16, WORD, WORD, WORD, LONG, LONG);
extern WORD CallTo16_word_wllwl(FARPROC16, WORD, WORD, LONG, LONG, WORD, LONG);
extern WORD CallTo16_word_wwlll(FARPROC16, WORD, WORD, WORD, LONG, LONG, LONG);
extern LONG CallTo16_long_lllllllwlwwwl( FARPROC16, WORD, LONG, LONG, LONG,
LONG, LONG, LONG, LONG, WORD, LONG,
WORD, WORD, WORD, LONG );
extern WORD CallTo16_regs_( FARPROC func, WORD ds, WORD es, WORD bp, WORD ax,
extern WORD CallTo16_regs_( FARPROC16 func, WORD ds, WORD es, WORD bp, WORD ax,
WORD bx, WORD cx, WORD dx, WORD si, WORD di );
#define CallEnumChildProc( func, hwnd, lParam ) \

View File

@ -1,5 +0,0 @@
/*
* compobj.h - Declarations for COMPOBJ
*/
typedef LPVOID LPUNKNOWN;

View File

@ -6,15 +6,7 @@
#ifndef __WINE_EXCEPT_H
#define __WINE_EXCEPT_H
#include"windows.h"
/*
* general definitions
*/
#ifndef PVOID
#define PVOID void *
#endif
#include"wintypes.h"
/*
* exception codes
@ -162,7 +154,7 @@ typedef struct __EXCEPTION_RECORD
DWORD ExceptionFlags;
struct __EXCEPTION_RECORD *ExceptionRecord;
PVOID ExceptionAddress;
LPVOID ExceptionAddress;
DWORD NumberParameters;
DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
} EXCEPTION_RECORD;
@ -173,7 +165,7 @@ typedef struct __EXCEPTION_RECORD_MIN
DWORD ExceptionFlags;
struct __EXCEPTION_RECORD *ExceptionRecord;
PVOID ExceptionAddress;
LPVOID ExceptionAddress;
DWORD NumberParameters;
DWORD ExceptionInformation[0];
} EXCEPTION_RECORD_MIN;
@ -203,7 +195,7 @@ struct __EXCEPTION_FRAME;
typedef DWORD ( *PEXCEPTION_HANDLER)( PEXCEPTION_RECORD pexcrec,
struct __EXCEPTION_FRAME *pestframe,
PCONTEXT pcontext,
PVOID pdispatcher);
LPVOID pdispatcher);
/*
* function pointer to a UnhandledExceptionFilter();

View File

@ -24,7 +24,7 @@ extern int FILE_MakeDir( LPCSTR path );
extern int FILE_RemoveDir( LPCSTR path );
extern HFILE FILE_Dup( HFILE hFile );
extern HFILE FILE_Dup2( HFILE hFile1, HFILE hFile2 );
extern LONG FILE_Read( HFILE hFile, void *buffer, LONG count );
extern INT32 FILE_Read( HFILE hFile, LPVOID buffer, UINT32 count );
extern INT _lcreat_uniq( LPCSTR path, INT attr );
#endif /* __WINE_FILE_H */

View File

@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGFONT logfont WINE_PACKED;
LOGFONT16 logfont WINE_PACKED;
} FONTOBJ;
/* may be switched... */

View File

@ -158,7 +158,7 @@ typedef struct
typedef struct
{
XFontStruct * fstruct;
TEXTMETRIC metrics;
TEXTMETRIC16 metrics;
} X_PHYSFONT;
/* X physical palette information */
@ -281,9 +281,6 @@ extern BOOL GDI_FreeObject( HANDLE );
extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
extern FARPROC16 GDI_GetDefDCHook(void);
#define UpdateDirtyDC(dc) \
DC_CallHookProc(dc, DCHC_INVALIDVISRGN, 0)
extern Display * display;
extern Screen * screen;
extern Window rootWindow;

View File

@ -17,12 +17,13 @@ typedef struct
} SHMDATA;
extern HGLOBAL16 GLOBAL_CreateBlock( UINT16 flags, const void *ptr, DWORD size,
HGLOBAL16 hOwner, BOOL isCode,
BOOL is32Bit, BOOL isReadOnly,
HGLOBAL16 hOwner, BOOL16 isCode,
BOOL16 is32Bit, BOOL16 isReadOnly,
SHMDATA *shmdata);
extern BOOL GLOBAL_FreeBlock( HGLOBAL16 handle );
extern BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle );
extern HGLOBAL16 GLOBAL_Alloc( WORD flags, DWORD size, HGLOBAL16 hOwner,
BOOL isCode, BOOL is32Bit, BOOL isReadOnly );
BOOL16 isCode, BOOL16 is32Bit,
BOOL16 isReadOnly );
extern WORD GlobalHandleToSel( HGLOBAL16 handle );
#endif /* __WINE_GLOBAL_H */

View File

@ -1,114 +0,0 @@
#ifndef __WINE_KEYBOARD_H
#define __WINE_KEYBOARD_H
struct KeyTableEntry {
int virtualkey;
int ASCII;
int scancode;
char *name;
};
struct KeyTableEntry KeyTable[] = {
{ 0x3, 0x3, 0x0, "" },
{ 0x8, 0x8, 0xe, "Backspace" },
{ 0x9, 0x9, 0xf, "Tab" },
{ 0xc, 0x0, 0x4c, "Num 5" },
{ 0xd, 0xd, 0x1c, "Enter" },
{ 0x10, 0x0, 0x2a, "Shift" },
{ 0x11, 0x0, 0x1d, "Ctrl" },
{ 0x12, 0x0, 0x38, "Alt" },
{ 0x14, 0x0, 0x3a, "Caps Lock" },
{ 0x1b, 0x1b, 0x1, "Esc" },
{ 0x20, 0x20, 0x39, "Space" },
{ 0x21, 0x0, 0x49, "Num 9" },
{ 0x22, 0x0, 0x51, "Num 3" },
{ 0x23, 0x0, 0x4f, "Num 1" },
{ 0x24, 0x0, 0x47, "Num 7" },
{ 0x25, 0x0, 0x4b, "Num 4" },
{ 0x26, 0x0, 0x48, "Num 8" },
{ 0x27, 0x0, 0x4d, "Num 6" },
{ 0x28, 0x0, 0x50, "Num 2" },
{ 0x2d, 0x0, 0x52, "Num 0" },
{ 0x2e, 0x0, 0x53, "Num Del" },
{ 0x30, 0x30, 0xb, "0" },
{ 0x31, 0x31, 0x2, "1" },
{ 0x32, 0x32, 0x3, "2" },
{ 0x33, 0x33, 0x4, "3" },
{ 0x34, 0x34, 0x5, "4" },
{ 0x35, 0x35, 0x6, "5" },
{ 0x36, 0x36, 0x7, "6" },
{ 0x37, 0x37, 0x8, "7" },
{ 0x38, 0x38, 0x9, "8" },
{ 0x39, 0x39, 0xa, "9" },
{ 0x41, 0x41, 0x1e, "A" },
{ 0x42, 0x42, 0x30, "B" },
{ 0x43, 0x43, 0x2e, "C" },
{ 0x44, 0x44, 0x20, "D" },
{ 0x45, 0x45, 0x12, "E" },
{ 0x46, 0x46, 0x21, "F" },
{ 0x47, 0x47, 0x22, "G" },
{ 0x48, 0x48, 0x23, "H" },
{ 0x49, 0x49, 0x17, "I" },
{ 0x4a, 0x4a, 0x24, "J" },
{ 0x4b, 0x4b, 0x25, "K" },
{ 0x4c, 0x4c, 0x26, "L" },
{ 0x4d, 0x4d, 0x32, "M" },
{ 0x4e, 0x4e, 0x31, "N" },
{ 0x4f, 0x4f, 0x18, "O" },
{ 0x50, 0x50, 0x19, "P" },
{ 0x51, 0x51, 0x10, "Q" },
{ 0x52, 0x52, 0x13, "R" },
{ 0x53, 0x53, 0x1f, "S" },
{ 0x54, 0x54, 0x14, "T" },
{ 0x55, 0x55, 0x16, "U" },
{ 0x56, 0x56, 0x2f, "V" },
{ 0x57, 0x57, 0x11, "W" },
{ 0x58, 0x58, 0x2d, "X" },
{ 0x59, 0x59, 0x15, "Y" },
{ 0x5a, 0x5a, 0x2c, "Z" },
{ 0x60, 0x0, 0x52, "Num 0" },
{ 0x61, 0x0, 0x4f, "Num 1" },
{ 0x62, 0x0, 0x50, "Num 2" },
{ 0x63, 0x0, 0x51, "Num 3" },
{ 0x64, 0x0, 0x4b, "Num 4" },
{ 0x65, 0x0, 0x4c, "Num 5" },
{ 0x66, 0x0, 0x4d, "Num 6" },
{ 0x67, 0x0, 0x47, "Num 7" },
{ 0x68, 0x0, 0x48, "Num 8" },
{ 0x69, 0x0, 0x49, "Num 9" },
{ 0x6a, 0x2a, 0x37, "Num *" },
{ 0x6b, 0x2b, 0x4e, "Num +" },
{ 0x6c, 0x0, 0x0, "" },
{ 0x6d, 0x2d, 0x4a, "Num -" },
{ 0x6e, 0x2e, 0x53, "Num Del" },
{ 0x6f, 0x2f, 0x0, "" },
{ 0x70, 0x0, 0x3b, "F1" },
{ 0x71, 0x0, 0x3c, "F2" },
{ 0x72, 0x0, 0x3d, "F3" },
{ 0x73, 0x0, 0x3e, "F4" },
{ 0x74, 0x0, 0x3f, "F5" },
{ 0x75, 0x0, 0x40, "F6" },
{ 0x76, 0x0, 0x41, "F7" },
{ 0x77, 0x0, 0x42, "F8" },
{ 0x78, 0x0, 0x43, "F9" },
{ 0x79, 0x0, 0x44, "F10" },
{ 0x7a, 0x0, 0x57, "F11" },
{ 0x7b, 0x0, 0x58, "F12" },
{ 0x90, 0x0, 0x45, "Pause" },
{ 0x91, 0x0, 0x46, "Scroll Lock" },
{ 0xba, 0x3b, 0x27, ";" },
{ 0xbb, 0x3d, 0xd, "=" },
{ 0xbc, 0x2c, 0x33, "," },
{ 0xbd, 0x2d, 0xc, "-" },
{ 0xbe, 0x2e, 0x34, "." },
{ 0xbf, 0x2f, 0x35, "/" },
{ 0xc0, 0x60, 0x29, "`" },
{ 0xdb, 0x5b, 0x1a, "[" },
{ 0xdc, 0x5c, 0x2b, "\\" },
{ 0xdd, 0x5d, 0x1b, "]" },
{ 0xde, 0x27, 0x28, "\'" },
{ 0xe2, 0x5c, 0x56, "\\" },
};
#define KeyTableSize sizeof(KeyTable) / sizeof(struct KeyTableEntry)
#endif /* __WINE_KEYBOARD_H */

View File

@ -3,7 +3,7 @@
*/
typedef struct tagLISTSTRUCT {
MEASUREITEMSTRUCT mis;
MEASUREITEMSTRUCT16 mis;
UINT itemState;
RECT16 itemRect;
HANDLE hData;

View File

@ -3,17 +3,25 @@
* Copyright 1996 Marcus Meissner
*/
LONG LZCopy(HFILE,HFILE);
HFILE LZOpenFile(LPCSTR,LPOFSTRUCT,UINT);
HFILE LZInit(HFILE);
LONG LZSeek(HFILE,LONG,INT);
INT LZRead(HFILE,SEGPTR,WORD);
void LZClose(HFILE);
INT LZStart(void);
LONG CopyLZFile(HFILE,HFILE);
void LZDone(void);
INT GetExpandedName(LPCSTR,LPSTR);
INT16 LZStart(void);
HFILE LZInit(HFILE);
void LZDone(void);
LONG LZSeek(HFILE,LONG,INT32);
LONG LZCopy(HFILE,HFILE);
void LZClose(HFILE);
LONG CopyLZFile(HFILE,HFILE);
INT16 GetExpandedName16(LPCSTR,LPSTR);
INT32 GetExpandedName32A(LPCSTR,LPSTR);
INT32 GetExpandedName32W(LPCWSTR,LPWSTR);
#define GetExpandedName WINELIB_NAME_AW(GetExpandedName)
HFILE LZOpenFile16(LPCSTR,LPOFSTRUCT,UINT16);
HFILE LZOpenFile32A(LPCSTR,LPOFSTRUCT,UINT32);
HFILE LZOpenFile32W(LPCWSTR,LPOFSTRUCT,UINT32);
#define LZOpenFile WINELIB_NAME_AW(LZOpenFile)
INT16 LZRead16(HFILE,SEGPTR,UINT16);
INT32 LZRead32(HFILE,LPVOID,UINT32);
#define LZRead WINELIB_NAME(LZRead)
#define LZERROR_BADINHANDLE 0xFFFF /* -1 */
#define LZERROR_BADOUTHANDLE 0xFFFE /* -2 */

View File

@ -13,7 +13,7 @@
extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
/* message.c */
extern BOOL MSG_GetHardwareMessage( LPMSG msg );
extern BOOL MSG_GetHardwareMessage( LPMSG16 msg );
extern BOOL MSG_InternalGetMessage( SEGPTR msg, HWND hwnd, HWND hwndOwner,
short code, WORD flags, BOOL sendIdle );

View File

@ -26,10 +26,10 @@ BOOL MF_MetaParam6(DC *dc, short func, short param1, short param2,
BOOL MF_MetaParam8(DC *dc, short func, short param1, short param2,
short param3, short param4, short param5,
short param6, short param7, short param8);
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN *logpen);
BOOL MF_CreateFontIndirect(DC *dc, HFONT hFont, LOGFONT *logfont);
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH16 *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH16 *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen);
BOOL MF_CreateFontIndirect(DC *dc, HFONT hFont, LOGFONT16 *logfont);
BOOL MF_TextOut(DC *dc, short x, short y, LPCSTR str, short count);
BOOL MF_MetaPoly(DC *dc, short func, LPPOINT16 pt, short count);
BOOL MF_BitBlt(DC *dcDest, short xDest, short yDest, short width,

View File

@ -199,7 +199,7 @@ struct resource_nameinfo_s
unsigned short length;
unsigned short flags;
unsigned short id;
HANDLE handle;
HANDLE16 handle;
unsigned short usage;
};

View File

@ -2,6 +2,12 @@
* ole.h - Declarations for OLESVR and OLECLI
*/
#ifndef __WINE_OLE_H
#define __WINE_OLE_H
#include "windows.h"
typedef LPVOID LPUNKNOWN;
typedef LPCSTR OLE_LPCSTR;
/* object types */
@ -160,6 +166,7 @@ typedef struct _OLESERVERDOCVTBL {
OLESTATUS (*Close)(LPOLESERVERDOC);
OLESTATUS (*SetHostNames)(LPOLESERVERDOC,OLE_LPCSTR,OLE_LPCSTR);
OLESTATUS (*SetDocDimensions)(LPOLESERVERDOC,LPRECT16);
#undef GetObject /* FIXME */
OLESTATUS (*GetObject)(LPOLESERVERDOC,OLE_LPCSTR,LPOLEOBJECT*,LPOLECLIENT);
OLESTATUS (*Release)(LPOLESERVERDOC);
OLESTATUS (*SetColorScheme)(LPOLESERVERDOC,LPLOGPALETTE);
@ -251,3 +258,5 @@ OLESTATUS OleRenameClientDoc(LHCLIENTDOC,LPCSTR);
OLESTATUS OleRevokeServerDoc(LHSERVERDOC);
OLESTATUS OleRevokeClientDoc(LHCLIENTDOC);
OLESTATUS OleRevokeServer(LHSERVER);
#endif /* __WINE_OLE_H */

View File

@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGPEN logpen WINE_PACKED;
LOGPEN16 logpen WINE_PACKED;
} PENOBJ;
#ifndef WINELIB

View File

@ -17,7 +17,7 @@
typedef struct tagQMSG
{
DWORD extraInfo; /* Only in 3.1 */
MSG msg;
MSG16 msg;
} QMSG;
@ -84,7 +84,7 @@ extern void QUEUE_DecTimerCount( HQUEUE hQueue );
extern BOOL QUEUE_CreateSysMsgQueue( int size );
extern BOOL QUEUE_DeleteMsgQueue( HQUEUE hQueue );
extern HTASK QUEUE_GetQueueTask( HQUEUE hQueue );
extern BOOL QUEUE_AddMsg( HQUEUE hQueue, MSG * msg, DWORD extraInfo );
extern BOOL QUEUE_AddMsg( HQUEUE hQueue, MSG16 * msg, DWORD extraInfo );
extern int QUEUE_FindMsg( MESSAGEQUEUE * msgQueue, HWND hwnd,
int first, int last );
extern void QUEUE_RemoveMsg( MESSAGEQUEUE * msgQueue, int pos );

View File

@ -7,7 +7,7 @@
#ifndef __WINE_RESOURCE_H
#define __WINE_RESOURCE_H
#include "wintypes.h"
#include "windows.h"
struct resource
{

View File

@ -10,16 +10,10 @@
#include "wintypes.h"
int STRING32_UniLen(LPCWSTR s);
void STRING32_UniToAnsi(LPSTR dest,LPCWSTR src);
void STRING32_AnsiToUni(LPWSTR dest,LPCSTR src);
LPSTR STRING32_DupUniToAnsi(LPCWSTR src);
LPWSTR STRING32_DupAnsiToUni(LPCSTR src);
LPWSTR STRING32_lstrcpyW(LPWSTR dst, LPCWSTR src);
int STRING32_lstrcmpnW(LPCWSTR a,LPCWSTR b,DWORD len);
int STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len);
DWORD STRING32_lstrlenW(LPCWSTR);
LPWSTR STRING32_strdupW(LPCWSTR);
int STRING32_lstrcmpW(LPCWSTR,LPCWSTR);
#endif

View File

@ -35,18 +35,8 @@ typedef struct {
WORD cy WINE_PACKED;
} DLGTEMPLATE32;
typedef struct tagMSG32
{
DWORD hwnd;
DWORD message;
DWORD wParam;
DWORD lParam;
DWORD time;
POINT32 pt;
} MSG32;
void STRUCT32_MSG16to32(MSG *msg16,MSG32 *msg32);
void STRUCT32_MSG32to16(MSG32 *msg32,MSG *msg16);
void STRUCT32_MSG16to32(const MSG16 *msg16,MSG32 *msg32);
void STRUCT32_MSG32to16(const MSG32 *msg32,MSG16 *msg16);
void STRUCT32_CREATESTRUCT32Ato16(const CREATESTRUCT32A*,CREATESTRUCT16*);
void STRUCT32_CREATESTRUCT16to32A(const CREATESTRUCT16*,CREATESTRUCT32A*);

View File

@ -119,7 +119,4 @@ extern HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance,
HANDLE hPrevInstance, HANDLE hEnvironment,
char *cmdLine, WORD cmdShow );
/* TASK_Reschedule() 16-bit entry point */
extern FARPROC RELAY_RescheduleProcAddr;
#endif /* _WINE_TASK_H */

View File

@ -127,6 +127,7 @@ typedef struct tagVS_FIXEDFILEINFO {
DWORD dwFileDateLS;
} VS_FIXEDFILEINFO;
/* following two aren't in version.dll */
DWORD
GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,LPDWORD off);
@ -135,34 +136,60 @@ GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
DWORD off,DWORD reslen,LPVOID data
);
DWORD
GetFileVersionInfoSize(LPCSTR filename,LPDWORD handle);
DWORD GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle);
DWORD GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle);
DWORD GetFileVersionInfoSize32W(LPCWSTR filename,LPDWORD handle);
#define GetFileVersionInfoSize WINELIB_NAME_AW(GetFileVersionInfoSize)
DWORD GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD GetFileVersionInfo32A(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD GetFileVersionInfo32W(LPCWSTR filename,DWORD handle,DWORD datasize,LPVOID data);
#define GetFileVersionInfo WINELIB_NAME_AW(GetFileVersionInfo)
DWORD
GetFileVersionInfo(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
DWORD
VerFindFile(
UINT flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT *curdirlen,LPSTR destdir,UINT*destdirlen
VerFindFile16(
UINT16 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT16 *curdirlen,LPSTR destdir,UINT16 *destdirlen
);
DWORD
VerInstallFile(
UINT flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT*tmpfilelen
VerFindFile32A(
UINT32 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT32 *curdirlen,LPSTR destdir,UINT32 *destdirlen
);
DWORD
VerFindFile32W(
UINT32 flags,LPCWSTR filename,LPCWSTR windir,LPCWSTR appdir,
LPWSTR curdir,UINT32 *curdirlen,LPWSTR destdir,UINT32 *destdirlen
);
#define VerFindFile WINELIB_NAME_AW(VerFindFile)
DWORD
VerLanguageName(UINT lang,LPSTR langname,UINT langnamelen);
VerInstallFile16(
UINT16 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT16 *tmpfilelen
);
DWORD
VerQueryValue(SEGPTR block,LPCSTR subblock,SEGPTR *buffer,UINT *buflen);
VerInstallFile32A(
UINT32 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT32 *tmpfilelen
);
DWORD
VerInstallFile32W(
UINT32 flags,LPCWSTR srcfilename,LPCWSTR destfilename,LPCWSTR srcdir,
LPCWSTR destdir,LPWSTR tmpfile,UINT32 *tmpfilelen
);
#define VerInstallFile WINELIB_NAME_AW(VerInstallFile)
/*
20 GETFILEVERSIONINFORAW
21 VERFTHK_THUNKDATA16
22 VERTHKSL_THUNKDATA16
*/
DWORD VerLanguageName16(UINT16 lang,LPSTR langname,UINT16 langnamelen);
DWORD VerLanguageName32A(UINT32 lang,LPSTR langname,UINT32 langnamelen);
DWORD VerLanguageName32W(UINT32 lang,LPWSTR langname,UINT32 langnamelen);
#define VerLanguageName WINELIB_NAME_AW(VerLanguageName)
DWORD VerQueryValue16(SEGPTR block,LPCSTR subblock,SEGPTR *buffer,UINT16 *buflen);
DWORD VerQueryValue32A(LPVOID block,LPCSTR subblock,LPVOID *buffer,UINT32 *buflen);
DWORD VerQueryValue32W(LPVOID block,LPCWSTR subblock,LPVOID *buffer,UINT32 *buflen);
#define VerQueryValue WINELIB_NAME_AW(VerQueryValue)
/* 20 GETFILEVERSIONINFORAW */
#endif /* __WINE_VER_H */

View File

@ -1,7 +1,7 @@
#ifndef __WINE_WINBASE_H
#define __WINE_WINBASE_H
#include "wintypes.h"
#ifdef UNICODE
#define LoadAccelerators LoadAcceleratorsW
@ -112,7 +112,34 @@ typedef struct {
DWORD Reserved;
}CRITICAL_SECTION;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
} OSVERSIONINFO32A;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
} OSVERSIONINFO32W;
DECL_WINELIB_TYPE_AW(OSVERSIONINFO);
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
/*DWORD WINAPI GetVersion( void );*/
BOOL32 GetVersionEx32A(OSVERSIONINFO32A*);
BOOL32 GetVersionEx32W(OSVERSIONINFO32W*);
#define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
int WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,6 @@
/*
* Shell Library definitions
*/
#include "wintypes.h"
#ifndef __WINE_WINREG_H
#define __WINE_WINREG_H
@ -85,27 +83,6 @@
KEY_READ|KEY_WRITE| \
KEY_CREATE_LINK \
)
/* one value of a key */
typedef struct tagKEYVALUE {
LPWSTR name; /* name of value (UNICODE) or NULL for win31 */
DWORD type; /* type of value */
DWORD len; /* length of data */
DWORD lastmodified; /* time of seconds since 1.1.1970 */
LPBYTE data; /* content, may be strings, binaries, etc. */
} KEYVALUE,*LPKEYVALUE;
/* a registry key */
typedef struct tagKEYSTRUCT {
LPWSTR keyname; /* name of THIS key (UNICODE) */
DWORD flags; /* flags. */
LPWSTR class;
/* values */
DWORD nrofvalues; /* nr of values in THIS key */
LPKEYVALUE values; /* values in THIS key */
/* key management pointers */
struct tagKEYSTRUCT *next; /* next key on same hierarchy */
struct tagKEYSTRUCT *nextsub; /* keys that hang below THIS key */
} KEYSTRUCT, *LPKEYSTRUCT;
void SHELL_Init();
void SHELL_SaveRegistry();

View File

@ -152,16 +152,19 @@ DECLARE_HANDLE(HWND);
/* Callback function pointers types for Win16. */
#ifdef WINELIB
typedef LRESULT (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (*DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
typedef LRESULT (*FARPROC16)();
typedef LRESULT (*WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
#else
/* Function pointers are SEGPTR in Win16 */
typedef SEGPTR DLGPROC16;
typedef SEGPTR FARPROC16;
typedef SEGPTR WNDPROC16;
#endif
/* Callback function pointers types for Win32. */
typedef LRESULT (*DLGPROC32)(HWND32,UINT32,WPARAM32,LPARAM);
typedef LRESULT (*FARPROC32)();
typedef LRESULT (*WNDPROC32)(HWND32,UINT32,WPARAM32,LPARAM);
@ -226,71 +229,6 @@ DECL_WINELIB_TYPE(HWND);
DECL_WINELIB_TYPE(FARPROC);
DECL_WINELIB_TYPE(WNDPROC);
/* Library data types defined as a transition aid for the emulator. */
/* These should _not_ be used in the emulator and will be removed someday. */
#ifndef NO_TRANSITION_TYPES
#ifndef WINELIB
typedef INT16 INT;
typedef UINT16 UINT;
typedef BOOL16 BOOL;
typedef WPARAM16 WPARAM;
typedef HANDLE16 HANDLE;
typedef HANDLE16 HBITMAP;
typedef HANDLE16 HBRUSH;
typedef HANDLE16 HCURSOR;
typedef HANDLE16 HDC;
typedef HANDLE16 HDRVR;
typedef HANDLE16 HFONT;
typedef HANDLE16 HGLOBAL;
typedef HANDLE16 HICON;
typedef HANDLE16 HINSTANCE;
typedef HANDLE16 HMENU;
typedef HANDLE16 HMETAFILE;
typedef HANDLE16 HMIDI;
typedef HANDLE16 HMIDIIN;
typedef HANDLE16 HMIDIOUT;
typedef HANDLE16 HMMIO;
typedef HANDLE16 HMODULE;
typedef HANDLE16 HQUEUE;
typedef HANDLE16 HRGN;
typedef HANDLE16 HRSRC;
typedef HANDLE16 HTASK;
typedef HANDLE16 HWAVE;
typedef HANDLE16 HWAVEIN;
typedef HANDLE16 HWAVEOUT;
typedef HANDLE16 HWND;
typedef FARPROC16 FARPROC;
typedef WNDPROC16 WNDPROC;
#endif /* WINELIB */
/* Callback function pointers types. */
#ifdef WINELIB
typedef LONG (*DRIVERPROC)(DWORD, HDRVR, UINT, LPARAM, LPARAM);
typedef int (*EDITWORDBREAKPROC)(LPSTR lpch, int ichCurrent, int cch,int code);
/*typedef int (*FONTENUMPROC)(const LOGFONT*,const TEXTMETRIC*,DWORD,LPARAM);*/
typedef int (*FONTENUMPROC)(const void*,const void*,DWORD,LPARAM);
typedef int (*GOBJENUMPROC)(LPVOID,LPARAM);
/*typedef int (*MFENUMPROC)(HDC,HANDLETABLE*,METARECORD*,int,LPARAM);*/
typedef int (*MFENUMPROC)(HDC,void*,void*,int,LPARAM);
typedef BOOL (*PROPENUMPROC)(HWND,LPCTSTR,HANDLE);
typedef LRESULT (*WNDENUMPROC)(HWND,LPARAM);
#else
typedef SEGPTR DRIVERPROC;
typedef SEGPTR EDITWORDBREAKPROC;
typedef SEGPTR FONTENUMPROC;
typedef SEGPTR GOBJENUMPROC;
typedef SEGPTR MFENUMPROC;
typedef SEGPTR PROPENUMPROC;
typedef SEGPTR WNDENUMPROC;
#endif
typedef FARPROC DLGPROC;
typedef FARPROC HOOKPROC;
#endif /* NO_TRANSITION_TYPES */
/* Misc. constants. */
#ifdef FALSE

View File

@ -9,8 +9,8 @@ C_SRCS = \
ne_resource.c \
pe_image.c \
pe_resource.c \
signal.c \
resource.c \
signal.c \
task.c
all: $(MODULE).o

View File

@ -100,9 +100,11 @@ extern const DLL_DESCRIPTOR CRTDLL_Descriptor;
extern const DLL_DESCRIPTOR OLE32_Descriptor;
extern const DLL_DESCRIPTOR GDI32_Descriptor;
extern const DLL_DESCRIPTOR KERNEL32_Descriptor;
extern const DLL_DESCRIPTOR LZ32_Descriptor;
extern const DLL_DESCRIPTOR NTDLL_Descriptor;
extern const DLL_DESCRIPTOR SHELL32_Descriptor;
extern const DLL_DESCRIPTOR USER32_Descriptor;
extern const DLL_DESCRIPTOR VERSION_Descriptor;
extern const DLL_DESCRIPTOR WINSPOOL_Descriptor;
extern const DLL_DESCRIPTOR WSOCK32_Descriptor;
@ -147,9 +149,11 @@ static BUILTIN_DLL BuiltinDLLs[] =
{ &OLE32_Descriptor, 0 },
{ &GDI32_Descriptor, 0 },
{ &KERNEL32_Descriptor, DLL_FLAG_ALWAYS_USED },
{ &LZ32_Descriptor, 0 },
{ &NTDLL_Descriptor, 0 },
{ &SHELL32_Descriptor, 0 },
{ &USER32_Descriptor, 0 },
{ &VERSION_Descriptor, 0 },
{ &WINSPOOL_Descriptor, 0 },
{ &WSOCK32_Descriptor, 0 },
/* Last entry */
@ -202,11 +206,11 @@ HMODULE BUILTIN_LoadModule( LPCSTR name, BOOL force )
/* Fix the name in case we have a full path and extension */
if ((p = strrchr( name, '\\' ))) name = p + 1;
lstrcpyn( dllname, name, sizeof(dllname) );
lstrcpyn32A( dllname, name, sizeof(dllname) );
if ((p = strrchr( dllname, '.' ))) *p = '\0';
for (table = BuiltinDLLs; table->descr; table++)
if (!lstrcmpi( table->descr->name, dllname )) break;
if (!lstrcmpi32A( table->descr->name, dllname )) break;
if (!table->descr) return 0;
if ((table->flags & DLL_FLAG_NOT_USED) && !force) return 0;
@ -389,7 +393,7 @@ BOOL BUILTIN_ParseDLLOptions( const char *str )
if (p == str) return FALSE;
for (dll = BuiltinDLLs; dll->descr; dll++)
{
if (!lstrncmpi( str, dll->descr->name, (int)(p - str) ))
if (!lstrncmpi32A( str, dll->descr->name, (int)(p - str) ))
{
if (str[-1] == '-')
{

View File

@ -827,10 +827,10 @@ HMODULE MODULE_FindModule( LPCSTR path )
if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath;
else modulename++;
if (!lstrcmpi( modulename, filename )) return hModule;
if (!lstrcmpi32A( modulename, filename )) return hModule;
name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !lstrncmpi(filename, name_table+1, len))
if ((*name_table == len) && !lstrncmpi32A(filename, name_table+1, len))
return hModule;
hModule = pModule->next;
}
@ -1193,7 +1193,7 @@ int GetModuleFileName( HANDLE hModule, LPSTR lpFileName, short nSize )
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
if (!(pModule = MODULE_GetPtr( hModule ))) return 0;
lstrcpyn( lpFileName, NE_MODULE_NAME(pModule), nSize );
lstrcpyn32A( lpFileName, NE_MODULE_NAME(pModule), nSize );
dprintf_module( stddeb, "GetModuleFilename: %s\n", lpFileName );
return strlen(lpFileName);
}
@ -1221,7 +1221,7 @@ HANDLE LoadLibrary( LPCSTR libname )
if (handle == (HANDLE)2) /* file not found */
{
char buffer[256];
lstrcpyn( buffer, libname, 252 );
lstrcpyn32A( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = LoadModule( buffer, (LPVOID)-1 );
}
@ -1253,8 +1253,13 @@ HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
char *p, *cmdline, filename[256];
static int use_load_module = 1;
if (!(cmdShowHandle = GlobalAlloc16( 0, 2 * sizeof(WORD) ))) return 0;
if (!(cmdLineHandle = GlobalAlloc16( 0, 256 ))) return 0;
if (!(cmdShowHandle = GlobalAlloc16( 0, 2 * sizeof(WORD) )))
return 8; /* Out of memory */
if (!(cmdLineHandle = GlobalAlloc16( 0, 256 )))
{
GlobalFree16( cmdShowHandle );
return 8; /* Out of memory */
}
/* Store nCmdShow */
@ -1265,9 +1270,9 @@ HANDLE WinExec( LPSTR lpCmdLine, WORD nCmdShow )
/* Build the filename and command-line */
cmdline = (char *)GlobalLock16( cmdLineHandle );
lstrcpyn( filename, lpCmdLine, sizeof(filename) - 4 /* for extension */ );
lstrcpyn32A(filename, lpCmdLine, sizeof(filename) - 4 /* for extension */);
for (p = filename; *p && (*p != ' ') && (*p != '\t'); p++);
if (*p) lstrcpyn( cmdline, p + 1, 128 );
if (*p) lstrcpyn32A( cmdline, p + 1, 128 );
else cmdline[0] = '\0';
*p = '\0';

View File

@ -64,8 +64,8 @@ static DWORD NE_FindNameTableId( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (p[1] & 0x8000)
{
if (!HIWORD(typeId)) continue;
if (lstrcmpi( (char *)PTR_SEG_TO_LIN(typeId),
(char *)(p + 3) )) continue;
if (lstrcmpi32A( (char *)PTR_SEG_TO_LIN(typeId),
(char *)(p + 3) )) continue;
}
else if (HIWORD(typeId) || ((typeId & ~0x8000)!= p[1]))
continue;
@ -75,7 +75,7 @@ static DWORD NE_FindNameTableId( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (p[2] & 0x8000)
{
if (!HIWORD(resId)) continue;
if (lstrcmpi( (char *)PTR_SEG_TO_LIN(resId),
if (lstrcmpi32A( (char *)PTR_SEG_TO_LIN(resId),
(char*)(p+3)+strlen((char*)(p+3))+1 )) continue;
}
@ -116,7 +116,7 @@ static HRSRC NE_FindResourceFromType( NE_MODULE *pModule,
{
if (pNameInfo->id & 0x8000) continue;
p = (BYTE *)pModule + pModule->res_table + pNameInfo->id;
if ((*p == len) && !lstrncmpi( p+1, str, len ))
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
return (HRSRC)((int)pNameInfo - (int)pModule);
}
}
@ -163,7 +163,7 @@ HRSRC NE_FindResource( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (!(pTypeInfo->type_id & 0x8000))
{
BYTE *p = (BYTE*)pModule+pModule->res_table+pTypeInfo->type_id;
if ((*p == len) && !lstrncmpi( p+1, str, len ))
if ((*p == len) && !lstrncmpi32A( p+1, str, len ))
{
dprintf_resource( stddeb, " Found type '%s'\n", str );
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);

View File

@ -304,7 +304,7 @@ HANDLE LoadAccelerators(HANDLE instance, SEGPTR lpTableName)
/**********************************************************************
* TranslateAccelerator [USER.178]
*/
int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG msg)
int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG16 msg)
{
ACCELHEADER *lpAccelTbl;
int i;

View File

@ -70,50 +70,54 @@ static void wine_timer(int signal, int code, struct sigcontext *context)
/**********************************************************************
* win_fault
* SIGNAL_trap
*
* SIGTRAP handler.
*/
#ifdef linux
static void SIGNAL_trap(int signal, struct sigcontext_struct context_struct)
{
struct sigcontext_struct *context = &context_struct;
#elif defined(__svr4__) || defined(_SCO_DS)
static void SIGNAL_trap(int signal, void *siginfo, ucontext_t *context)
{
#else
static void SIGNAL_trap(int signal, int code, struct sigcontext *context)
{
#endif
wine_debug( signal, context ); /* Enter our debugger */
}
/**********************************************************************
* SIGNAL_fault
*
* Segfault handler.
*/
#ifdef linux
static void win_fault(int signal, struct sigcontext_struct context_struct)
static void SIGNAL_fault(int signal, struct sigcontext_struct context_struct)
{
struct sigcontext_struct *context = &context_struct;
#elif defined(__svr4__) || defined(_SCO_DS)
static void win_fault(int signal, void *siginfo, ucontext_t *context)
static void SIGNAL_fault(int signal, void *siginfo, ucontext_t *context)
{
#else
static void win_fault(int signal, int code, struct sigcontext *context)
static void SIGNAL_fault(int signal, int code, struct sigcontext *context)
{
#endif
if (signal == SIGTRAP)
if (CS_reg(context) == WINE_CODE_SELECTOR)
{
/* If SIGTRAP not caused by breakpoint or single step
don't jump into the debugger */
if (!(EFL_reg(context) & STEP_FLAG))
{
DBG_ADDR addr;
addr.seg = CS_reg(context);
addr.off = EIP_reg(context) - 1;
if (DEBUG_FindBreakpoint(&addr) == -1) return;
}
fprintf( stderr, "Segmentation fault in Wine program (%x:%lx)."
" Please debug.\n",
CS_reg(context), EIP_reg(context) );
}
else if (signal != SIGHUP)
else
{
if (CS_reg(context) == WINE_CODE_SELECTOR)
{
fprintf(stderr, "Segmentation fault in Wine program (%x:%lx)."
" Please debug.\n",
CS_reg(context), EIP_reg(context) );
}
else
{
if (INSTR_EmulateInstruction( context )) return;
fprintf( stderr, "Segmentation fault in Windows program %x:%lx.\n",
CS_reg(context), EIP_reg(context) );
}
if (INSTR_EmulateInstruction( context )) return;
fprintf( stderr, "Segmentation fault in Windows program %x:%lx.\n",
CS_reg(context), EIP_reg(context) );
}
wine_debug( signal, context ); /* Enter our debugger */
wine_debug( signal, context );
}
@ -201,13 +205,13 @@ void init_wine_signals(void)
#endif /* __svr4__ || _SCO_DS */
SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer );
SIGNAL_SetHandler( SIGSEGV, (void (*)())win_fault );
SIGNAL_SetHandler( SIGILL, (void (*)())win_fault );
SIGNAL_SetHandler( SIGFPE, (void (*)())win_fault );
SIGNAL_SetHandler( SIGTRAP, (void (*)())win_fault ); /* For debugger */
SIGNAL_SetHandler( SIGHUP, (void (*)())win_fault ); /* For forced break */
SIGNAL_SetHandler( SIGSEGV, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGILL, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGFPE, (void (*)())SIGNAL_fault );
SIGNAL_SetHandler( SIGTRAP, (void (*)())SIGNAL_trap ); /* debugger */
SIGNAL_SetHandler( SIGHUP, (void (*)())SIGNAL_trap ); /* forced break */
#ifdef SIGBUS
SIGNAL_SetHandler( SIGBUS, (void (*)())win_fault );
SIGNAL_SetHandler( SIGBUS, (void (*)())SIGNAL_fault );
#endif
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */

View File

@ -127,7 +127,7 @@ static HANDLE TASK_CreateDOSEnvironment(void)
for (e = environ, size = initial_size; *e; e++)
{
if (lstrncmpi(*e, "path=", 5))
if (lstrncmpi32A(*e, "path=", 5))
{
int len = strlen(*e) + 1;
if (size + len >= 32767)
@ -149,7 +149,7 @@ static HANDLE TASK_CreateDOSEnvironment(void)
for (e = environ, size = initial_size; *e; e++)
{
if (lstrncmpi(*e, "path=", 5))
if (lstrncmpi32A(*e, "path=", 5))
{
int len = strlen(*e) + 1;
if (size + len >= 32767) break;
@ -478,7 +478,7 @@ HTASK TASK_CreateTask( HMODULE hModule, HANDLE hInstance, HANDLE hPrevInstance,
memset( pTask->pdb.fileHandles, 0xff, sizeof(pTask->pdb.fileHandles) );
pTask->pdb.environment = hEnvironment;
pTask->pdb.nbFiles = 20;
lstrcpyn( pTask->pdb.cmdLine + 1, cmdLine, 127 );
lstrcpyn32A( pTask->pdb.cmdLine + 1, cmdLine, 127 );
pTask->pdb.cmdLine[0] = strlen( pTask->pdb.cmdLine + 1 );
/* Get the compatibility flags */

View File

@ -7,7 +7,8 @@ C_SRCS = \
heap.c \
ldt.c \
local.c \
selector.c
selector.c \
string.c
all: $(MODULE).o

View File

@ -141,7 +141,7 @@ static ATOM ATOM_AddAtom( WORD selector, LPCSTR str )
{
entryPtr = ATOM_MakePtr( selector, entry );
if ((entryPtr->length == len) &&
(!lstrncmpi( entryPtr->str, str, len )))
(!lstrncmpi32A( entryPtr->str, str, len )))
{
entryPtr->refCount++;
return HANDLETOATOM( entry );
@ -218,7 +218,7 @@ static ATOM ATOM_FindAtom( WORD selector, LPCSTR str )
{
ATOMENTRY * entryPtr = ATOM_MakePtr( selector, entry );
if ((entryPtr->length == len) &&
(!lstrncmpi( entryPtr->str, str, len )))
(!lstrncmpi32A( entryPtr->str, str, len )))
return HANDLETOATOM( entry );
entry = entryPtr->next;
}
@ -294,7 +294,7 @@ ATOM AddAtom( SEGPTR str )
/* If the string is in the same data segment as the atom table, make */
/* a copy of the string to be sure it doesn't move in linear memory. */
char buffer[256];
lstrcpyn( buffer, (char *)PTR_SEG_TO_LIN(str), sizeof(buffer) );
lstrcpyn32A( buffer, (char *)PTR_SEG_TO_LIN(str), sizeof(buffer) );
atom = ATOM_AddAtom( ds, buffer );
}
else atom = ATOM_AddAtom( ds, (LPCSTR)PTR_SEG_TO_LIN(str) );

View File

@ -93,8 +93,8 @@ void debug_handles()
* Create a global heap block for a fixed range of linear memory.
*/
HGLOBAL16 GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
HGLOBAL16 hOwner, BOOL isCode,
BOOL is32Bit, BOOL isReadOnly,
HGLOBAL16 hOwner, BOOL16 isCode,
BOOL16 is32Bit, BOOL16 isReadOnly,
SHMDATA *shmdata )
{
WORD sel, selcount;
@ -156,7 +156,7 @@ HGLOBAL16 GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
* Free a block allocated by GLOBAL_CreateBlock, without touching
* the associated linear memory range.
*/
BOOL GLOBAL_FreeBlock( HGLOBAL16 handle )
BOOL16 GLOBAL_FreeBlock( HGLOBAL16 handle )
{
WORD sel;
@ -174,7 +174,7 @@ BOOL GLOBAL_FreeBlock( HGLOBAL16 handle )
* Implementation of GlobalAlloc16()
*/
HGLOBAL16 GLOBAL_Alloc( UINT16 flags, DWORD size, HGLOBAL16 hOwner,
BOOL isCode, BOOL is32Bit, BOOL isReadOnly )
BOOL16 isCode, BOOL16 is32Bit, BOOL16 isReadOnly )
{
void *ptr;
HGLOBAL16 handle;

View File

@ -1199,7 +1199,7 @@ BOOL HeapWalk( HANDLE32 heap, void *entry )
*/
LPSTR HEAP_strdupA( HANDLE32 heap, DWORD flags, LPCSTR str )
{
INT32 len = lstrlen(str) + 1;
INT32 len = lstrlen32A(str) + 1;
LPSTR p = HeapAlloc( heap, flags, len );
if (p) strcpy( p, str );
return p;

View File

@ -37,8 +37,8 @@ extern int i386_set_ldt(int, union descriptor *, int);
#endif /* ifndef WINELIB */
ldt_copy_entry ldt_copy[LDT_SIZE] = { {0,0}, };
unsigned char ldt_flags_copy[LDT_SIZE] = { 0, };
ldt_copy_entry ldt_copy[LDT_SIZE];
unsigned char ldt_flags_copy[LDT_SIZE];
/***********************************************************************

335
memory/string.c Normal file
View File

@ -0,0 +1,335 @@
/*
* String functions
*
* Copyright 1993 Yngvi Sigurjonsson
* Copyright 1996 Alexandre Julliard
*/
#include <ctype.h>
#include <string.h>
#include "windows.h"
#include "ldt.h"
/***********************************************************************
* hmemcpy (KERNEL.348)
*/
void hmemcpy( LPVOID dst, LPCVOID src, LONG count )
{
memcpy( dst, src, count );
}
/***********************************************************************
* lstrcat16 (KERNEL.89)
*/
SEGPTR lstrcat16( SEGPTR dst, SEGPTR src )
{
lstrcat32A( (LPSTR)PTR_SEG_TO_LIN(dst), (LPCSTR)PTR_SEG_TO_LIN(src) );
return dst;
}
/***********************************************************************
* lstrcat32A (KERNEL32.599)
*/
LPSTR lstrcat32A( LPSTR dst, LPCSTR src )
{
strcat( dst, src );
return dst;
}
/***********************************************************************
* lstrcat32W (KERNEL32.600)
*/
LPWSTR lstrcat32W( LPWSTR dst, LPCWSTR src )
{
register LPWSTR p = dst;
while (*p) p++;
while ((*p++ = *src++));
return dst;
}
/***********************************************************************
* lstrcatn16 (KERNEL.352)
*/
SEGPTR lstrcatn16( SEGPTR dst, SEGPTR src, INT16 n )
{
lstrcatn32A( (LPSTR)PTR_SEG_TO_LIN(dst), (LPCSTR)PTR_SEG_TO_LIN(src), n );
return dst;
}
/***********************************************************************
* lstrcatn32A (Not a Windows API)
*/
LPSTR lstrcatn32A( LPSTR dst, LPCSTR src, INT32 n )
{
register LPSTR p = dst;
while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst;
lstrcpyn32A( p, src, n );
return dst;
}
/***********************************************************************
* lstrcatn32W (Not a Windows API)
*/
LPWSTR lstrcatn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{
register LPWSTR p = dst;
while (*p) p++;
if ((n -= (INT32)(p - dst)) <= 0) return dst;
lstrcpyn32W( p, src, n );
return dst;
}
/***********************************************************************
* lstrcmp16 (USER.430)
*/
INT16 lstrcmp16( LPCSTR str1, LPCSTR str2 )
{
return (INT16)lstrcmp32A( str1, str2 );
}
/***********************************************************************
* lstrcmp32A (KERNEL.602)
*/
INT32 lstrcmp32A( LPCSTR str1, LPCSTR str2 )
{
return (INT32)strcmp( str1, str2 );
}
/***********************************************************************
* lstrcmp32W (KERNEL.603)
*/
INT32 lstrcmp32W( LPCWSTR str1, LPCWSTR str2 )
{
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
return (INT32)(*str1 - *str2);
}
/***********************************************************************
* lstrcmpi16 (USER.471)
*/
INT16 lstrcmpi16( LPCSTR str1, LPCSTR str2 )
{
return (INT16)lstrcmpi32A( str1, str2 );
}
/***********************************************************************
* lstrcmpi32A (KERNEL32.605)
*/
INT32 lstrcmpi32A( LPCSTR str1, LPCSTR str2 )
{
INT32 res;
while (*str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/***********************************************************************
* lstrcmpi32W (KERNEL32.606)
*/
INT32 lstrcmpi32W( LPCWSTR str1, LPCWSTR str2 )
{
INT32 res;
while (*str1)
{
/* FIXME: Unicode */
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/***********************************************************************
* lstrcpy16 (KERNEL.88)
*/
SEGPTR lstrcpy16( SEGPTR dst, SEGPTR src )
{
lstrcpy32A( (LPSTR)PTR_SEG_TO_LIN(dst), (LPCSTR)PTR_SEG_TO_LIN(src) );
return dst;
}
/***********************************************************************
* lstrcpy32A (KERNEL32.608)
*/
LPSTR lstrcpy32A( LPSTR dst, LPCSTR src )
{
strcpy( dst, src );
return dst;
}
/***********************************************************************
* lstrcpy32W (KERNEL32.609)
*/
LPWSTR lstrcpy32W( LPWSTR dst, LPCWSTR src )
{
register LPWSTR p = dst;
while ((*p++ = *src++));
return dst;
}
/***********************************************************************
* lstrcpyn16 (KERNEL.353)
*/
SEGPTR lstrcpyn16( SEGPTR dst, SEGPTR src, INT16 n )
{
lstrcpyn32A( (LPSTR)PTR_SEG_TO_LIN(dst), (LPCSTR)PTR_SEG_TO_LIN(src), n );
return dst;
}
/***********************************************************************
* lstrcpyn32A (KERNEL32.611)
*/
LPSTR lstrcpyn32A( LPSTR dst, LPCSTR src, INT32 n )
{
LPSTR p = dst;
while ((n-- > 1) && *src) *p++ = *src++;
*p = 0;
return dst;
}
/***********************************************************************
* lstrcpyn32W (KERNEL32.612)
*/
LPWSTR lstrcpyn32W( LPWSTR dst, LPCWSTR src, INT32 n )
{
LPWSTR p = dst;
while ((n-- > 1) && *src) *p++ = *src++;
*p = 0;
return dst;
}
/***********************************************************************
* lstrlen16 (KERNEL.90)
*/
INT16 lstrlen16( LPCSTR str )
{
return (INT16)lstrlen32A( str );
}
/***********************************************************************
* lstrlen32A (KERNEL32.614)
*/
INT32 lstrlen32A( LPCSTR str )
{
/* looks weird, but win3.1 KERNEL got a GeneralProtection handler
* in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner
*/
if (!str) return 0;
return (INT32)strlen(str);
}
/***********************************************************************
* lstrlen32W (KERNEL32.615)
*/
INT32 lstrlen32W( LPCWSTR str )
{
INT32 len = 0;
if (!str) return 0;
while (*str++) len++;
return len;
}
/***********************************************************************
* lstrncmp16 (Not a Windows API)
*/
INT16 lstrncmp16( LPCSTR str1, LPCSTR str2, INT16 n )
{
return (INT16)lstrncmp32A( str1, str2, n );
}
/***********************************************************************
* lstrncmp32A (Not a Windows API)
*/
INT32 lstrncmp32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
return (INT32)strncmp( str1, str2, n );
}
/***********************************************************************
* lstrncmp32W (Not a Windows API)
*/
INT32 lstrncmp32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{
if (!n) return 0;
while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
return (INT32)(*str1 - *str2);
}
/***********************************************************************
* lstrncmpi16 (Not a Windows API)
*/
INT16 lstrncmpi16( LPCSTR str1, LPCSTR str2, INT16 n )
{
return (INT16)lstrncmpi32A( str1, str2, n );
}
/***********************************************************************
* lstrncmpi32A (Not a Windows API)
*/
INT32 lstrncmpi32A( LPCSTR str1, LPCSTR str2, INT32 n )
{
INT32 res;
if (!n) return 0;
while ((--n > 0) && *str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/***********************************************************************
* lstrncmpi32W (Not a Windows API)
*/
INT32 lstrncmpi32W( LPCWSTR str1, LPCWSTR str2, INT32 n )
{
INT32 res;
if (!n) return 0;
while ((--n > 0) && *str1)
{
/* FIXME: Unicode */
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}

View File

@ -32,6 +32,7 @@ C_SRCS = \
ver.c \
w32sys.c \
winsocket.c \
wsprintf.c \
xmalloc.c
all: $(MODULE).o

View File

@ -32,8 +32,8 @@ typedef struct tagCLIPFORMAT {
LPSTR Name;
HANDLE hData;
DWORD BufSize;
void *PrevFormat;
void *NextFormat;
struct tagCLIPFORMAT *PrevFormat;
struct tagCLIPFORMAT *NextFormat;
} CLIPFORMAT, *LPCLIPFORMAT;
/* *************************************************************************
@ -50,7 +50,7 @@ static WORD LastRegFormat = CF_REGFORMATBASE;
static Bool wait_for_selection = False;
static Bool wineOwnsSelection = False;
CLIPFORMAT ClipFormats[16] = {
static CLIPFORMAT ClipFormats[16] = {
{ CF_TEXT, 1, 0, "Text", (HANDLE)NULL, 0, NULL, &ClipFormats[1] },
{ CF_BITMAP, 1, 0, "Bitmap", (HANDLE)NULL, 0, &ClipFormats[0], &ClipFormats[2] },
{ CF_METAFILEPICT, 1, 0, "MetaFile Picture", (HANDLE)NULL, 0, &ClipFormats[1], &ClipFormats[3] },
@ -117,12 +117,16 @@ void CLIPBOARD_DeleteRecord(LPCLIPFORMAT lpFormat)
*/
BOOL CLIPBOARD_RequestXSelection()
{
HWND hWnd = hWndClipWindow;
if( !hWnd ) hWnd = GetActiveWindow();
wait_for_selection=True;
dprintf_clipboard(stddeb,"Requesting selection\n");
XConvertSelection(display,XA_PRIMARY,XA_STRING,
XInternAtom(display,"PRIMARY_TEXT",False),
WIN_GetXWindow(hWndClipWindow),CurrentTime);
WIN_GetXWindow(hWnd),CurrentTime);
/* TODO: need time-out for broken clients */
while(wait_for_selection) EVENT_WaitXEvent(-1);

View File

@ -138,7 +138,7 @@ BOOL BuildCommDCB(LPCSTR device, LPDCB lpdcb)
"BuildCommDCB: (%s), ptr %p\n", device, lpdcb);
commerror = 0;
if (!lstrncmpi(device,"COM",3)) {
if (!lstrncmpi32A(device,"COM",3)) {
port = device[3] - '0';
@ -229,7 +229,7 @@ int OpenComm(LPCSTR device, UINT cbInQueue, UINT cbOutQueue)
"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
commerror = 0;
if (!lstrncmpi(device,"COM",3)) {
if (!lstrncmpi32A(device,"COM",3)) {
port = device[3] - '0';
if (port-- == 0) {
@ -258,7 +258,7 @@ int OpenComm(LPCSTR device, UINT cbInQueue, UINT cbOutQueue)
}
}
else
if (!lstrncmpi(device,"LPT",3)) {
if (!lstrncmpi32A(device,"LPT",3)) {
port = device[3] - '0';
if (!ValidLPTPort(port)) {

View File

@ -206,13 +206,13 @@ static LPSTR FILEDLG_GetFileType(LPSTR cfptr, LPSTR fptr, WORD index)
/***********************************************************************
* FILEDLG_WMDrawItem [internal]
*/
static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam,int savedlg)
{
LPDRAWITEMSTRUCT16 lpdis = (LPDRAWITEMSTRUCT16)PTR_SEG_TO_LIN(lParam);
char str[512];
HBRUSH hBrush;
HBITMAP hBitmap, hPrevBitmap;
BITMAP bm;
BITMAP16 bm;
HDC hMemDC;
str[0]=0;
@ -222,6 +222,14 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
FillRect16(lpdis->hDC, &lpdis->rcItem, hBrush);
SendMessage16(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID,
(LPARAM)MAKE_SEGPTR(str));
if (savedlg) /* use _gray_ text in FileSaveDlg */
if (!lpdis->itemState)
SetTextColor(lpdis->hDC,GetSysColor(COLOR_GRAYTEXT) );
else
SetTextColor(lpdis->hDC,GetSysColor(COLOR_WINDOWTEXT) );
/* inversion of gray would be bad readable */
TextOut16(lpdis->hDC, lpdis->rcItem.left, lpdis->rcItem.top,
str, strlen(str));
if (lpdis->itemState != 0) {
@ -238,7 +246,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
(LPARAM)MAKE_SEGPTR(str));
hBitmap = hFolder;
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
GetObject16( hBitmap, sizeof(bm), &bm );
TextOut16(lpdis->hDC, lpdis->rcItem.left + bm.bmWidth,
lpdis->rcItem.top, str, strlen(str));
hMemDC = CreateCompatibleDC(lpdis->hDC);
@ -266,7 +274,7 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
case TYPE_NETWORK:
default: hBitmap = hHDisk; break;
}
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
GetObject16( hBitmap, sizeof(bm), &bm );
TextOut16(lpdis->hDC, lpdis->rcItem.left + bm.bmWidth,
lpdis->rcItem.top, str, strlen(str));
hMemDC = CreateCompatibleDC(lpdis->hDC);
@ -288,11 +296,11 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
*/
static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
BITMAP bm;
LPMEASUREITEMSTRUCT lpmeasure;
BITMAP16 bm;
LPMEASUREITEMSTRUCT16 lpmeasure;
GetObject(hFolder2, sizeof(BITMAP), (LPSTR)&bm);
lpmeasure = (LPMEASUREITEMSTRUCT)PTR_SEG_TO_LIN(lParam);
GetObject16( hFolder2, sizeof(bm), &bm );
lpmeasure = (LPMEASUREITEMSTRUCT16)PTR_SEG_TO_LIN(lParam);
lpmeasure->itemHeight = bm.bmHeight;
return TRUE;
}
@ -512,7 +520,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
if (lRet == LB_ERR) return TRUE;
lpofn->nFilterIndex = lRet + 1;
dprintf_commdlg(stddeb,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
lstrcpyn(tmpstr2,
lstrcpyn32A(tmpstr2,
FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
PTR_SEG_TO_LIN(lpofn->lpstrFilter),
lRet), sizeof(tmpstr2));
@ -526,7 +534,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* strip off the pathname */
*pstr = 0;
SetDlgItemText32A( hWnd, edt1, pstr + 1 );
lstrcpyn(tmpstr2, pstr+1, sizeof(tmpstr2) );
lstrcpyn32A(tmpstr2, pstr+1, sizeof(tmpstr2) );
/* Should we MessageBox() if this fails? */
if (!FILEDLG_ScanDir(hWnd, tmpstr)) return TRUE;
strcpy(tmpstr, tmpstr2);
@ -607,7 +615,7 @@ LRESULT FileOpenDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
case WM_MEASUREITEM:
return FILEDLG_WMMeasureItem(hWnd, wParam, lParam);
case WM_DRAWITEM:
return FILEDLG_WMDrawItem(hWnd, wParam, lParam);
return FILEDLG_WMDrawItem(hWnd, wParam, lParam, FALSE);
case WM_COMMAND:
return FILEDLG_WMCommand(hWnd, wParam, lParam);
#if 0
@ -651,7 +659,7 @@ LRESULT FileSaveDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
return FILEDLG_WMMeasureItem(hWnd, wParam, lParam);
case WM_DRAWITEM:
return FILEDLG_WMDrawItem(hWnd, wParam, lParam);
return FILEDLG_WMDrawItem(hWnd, wParam, lParam, TRUE);
case WM_COMMAND:
return FILEDLG_WMCommand(hWnd, wParam, lParam);
@ -1403,7 +1411,7 @@ static int CC_CheckDigitsInEdit(HWND hwnd,int maxval)
long editpos;
char buffer[30];
GetWindowText32A(hwnd,buffer,sizeof(buffer));
m=lstrlen(buffer);
m=strlen(buffer);
result=0;
for (i=0;i<m;i++)
@ -2228,7 +2236,7 @@ static BOOL CFn_HookCallChk(LPCHOOSEFONT lpcf)
/***********************************************************************
* FontFamilyEnumProc (COMMDLG.19)
*/
int FontFamilyEnumProc(LPLOGFONT lplf ,LPTEXTMETRIC lptm, int nFontType, LPARAM lParam)
int FontFamilyEnumProc(LPLOGFONT16 lplf, LPTEXTMETRIC16 lptm, int nFontType, LPARAM lParam)
{
int i;
WORD w;
@ -2265,7 +2273,7 @@ int FontFamilyEnumProc(LPLOGFONT lplf ,LPTEXTMETRIC lptm, int nFontType, LPARAM
*
* Fill font style information into combobox (without using font.c directly)
*/
static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, LPLOGFONT lplf ,LPTEXTMETRIC lptm)
static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, LPLOGFONT16 lplf ,LPTEXTMETRIC16 lptm)
{
#define FSTYLES 4
struct FONTSTYLE
@ -2304,7 +2312,7 @@ static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, LPLOGFONT lplf ,LPTEXTMETRI
/*************************************************************************
* SetFontSizesToCombo3 [internal]
*/
static int SetFontSizesToCombo3(HWND hwnd, LPLOGFONT lplf, LPCHOOSEFONT lpcf)
static int SetFontSizesToCombo3(HWND hwnd, LPLOGFONT16 lplf, LPCHOOSEFONT lpcf)
{
int sizes[]={8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72,0};
int h,i,j;
@ -2335,7 +2343,7 @@ static int SetFontSizesToCombo3(HWND hwnd, LPLOGFONT lplf, LPCHOOSEFONT lpcf)
/***********************************************************************
* FontStyleEnumProc (COMMDLG.18)
*/
int FontStyleEnumProc(LPLOGFONT lplf ,LPTEXTMETRIC lptm, int nFontType, LPARAM lParam)
int FontStyleEnumProc(LPLOGFONT16 lplf ,LPTEXTMETRIC16 lptm, int nFontType, LPARAM lParam)
{
HWND hcmb2=LOWORD(lParam);
HWND hcmb3=HIWORD(lParam);
@ -2374,7 +2382,7 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam)
int i,j,res,init=0;
long l;
FARPROC enumCallback = MODULE_GetWndProcEntry16("FontFamilyEnumProc");
LPLOGFONT lpxx;
LPLOGFONT16 lpxx;
HCURSOR hcursor=SetCursor(LoadCursor(0,IDC_WAIT));
LPCHOOSEFONT lpcf;
@ -2484,11 +2492,11 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam)
*/
LRESULT CFn_WMMeasureItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
BITMAP bm;
LPMEASUREITEMSTRUCT lpmi=PTR_SEG_TO_LIN((LPMEASUREITEMSTRUCT)lParam);
BITMAP16 bm;
LPMEASUREITEMSTRUCT16 lpmi=PTR_SEG_TO_LIN((LPMEASUREITEMSTRUCT16)lParam);
if (!hBitmapTT)
hBitmapTT = LoadBitmap(0, MAKEINTRESOURCE(OBM_TRTYPE));
GetObject(hBitmapTT, sizeof(BITMAP), (LPSTR)&bm);
GetObject16( hBitmapTT, sizeof(bm), &bm );
lpmi->itemHeight=bm.bmHeight;
/* FIXME: use MAX of bm.bmHeight and tm.tmHeight .*/
return 0;
@ -2502,7 +2510,7 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
{
HBRUSH hBrush;
char buffer[40];
BITMAP bm;
BITMAP16 bm;
COLORREF cr;
RECT16 rect;
#if 0
@ -2531,9 +2539,9 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
case cmb1: /* dprintf_commdlg(stddeb,"WM_Drawitem cmb1\n"); */
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)MAKE_SEGPTR(buffer));
GetObject(hBitmapTT, sizeof(BITMAP), (LPSTR)&bm);
GetObject16( hBitmapTT, sizeof(bm), &bm );
TextOut16(lpdi->hDC, lpdi->rcItem.left + bm.bmWidth + 10,
lpdi->rcItem.top, buffer, lstrlen(buffer));
lpdi->rcItem.top, buffer, lstrlen16(buffer));
#if 0
nFontType = SendMessage16(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
/* FIXME: draw bitmap if truetype usage */
@ -2553,14 +2561,14 @@ LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)MAKE_SEGPTR(buffer));
TextOut16(lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, buffer, lstrlen(buffer));
lpdi->rcItem.top, buffer, lstrlen16(buffer));
break;
case cmb4: /* dprintf_commdlg(stddeb,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
SendMessage16(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)MAKE_SEGPTR(buffer));
TextOut16(lpdi->hDC, lpdi->rcItem.left + 25+5,
lpdi->rcItem.top, buffer, lstrlen(buffer));
lpdi->rcItem.top, buffer, lstrlen16(buffer));
cr = SendMessage16(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
hBrush = CreateSolidBrush(cr);
if (hBrush)
@ -2613,7 +2621,7 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam)
long l;
HDC hdc;
LPCHOOSEFONT lpcf=(LPCHOOSEFONT)GetWindowLong32A(hDlg, DWL_USER);
LPLOGFONT lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
LPLOGFONT16 lpxx=PTR_SEG_TO_LIN(lpcf->lpLogFont);
dprintf_commdlg(stddeb,"FormatCharDlgProc // WM_COMMAND lParam=%08lX\n", lParam);
switch (wParam)

View File

@ -7,8 +7,6 @@
/* At the moment, these are only empty stubs.
*/
#include "windows.h"
#include "compobj.h"
#include "ole.h"
#include "ole2.h"
#include "stddebug.h"

View File

@ -8,11 +8,123 @@ static char Copyright[] = "Copyright Scott A. Laird, Erik Bos 1993, 1994";
#include <string.h>
#include <ctype.h>
#include "windows.h"
#include "keyboard.h"
#include "stddebug.h"
/* #define DEBUG_KEYBOARD */
#include "debug.h"
struct KeyTableEntry {
int virtualkey;
int ASCII;
int scancode;
const char *name;
};
static const struct KeyTableEntry KeyTable[] =
{
{ 0x3, 0x3, 0x0, "" },
{ 0x8, 0x8, 0xe, "Backspace" },
{ 0x9, 0x9, 0xf, "Tab" },
{ 0xc, 0x0, 0x4c, "Num 5" },
{ 0xd, 0xd, 0x1c, "Enter" },
{ 0x10, 0x0, 0x2a, "Shift" },
{ 0x11, 0x0, 0x1d, "Ctrl" },
{ 0x12, 0x0, 0x38, "Alt" },
{ 0x14, 0x0, 0x3a, "Caps Lock" },
{ 0x1b, 0x1b, 0x1, "Esc" },
{ 0x20, 0x20, 0x39, "Space" },
{ 0x21, 0x0, 0x49, "Num 9" },
{ 0x22, 0x0, 0x51, "Num 3" },
{ 0x23, 0x0, 0x4f, "Num 1" },
{ 0x24, 0x0, 0x47, "Num 7" },
{ 0x25, 0x0, 0x4b, "Num 4" },
{ 0x26, 0x0, 0x48, "Num 8" },
{ 0x27, 0x0, 0x4d, "Num 6" },
{ 0x28, 0x0, 0x50, "Num 2" },
{ 0x2d, 0x0, 0x52, "Num 0" },
{ 0x2e, 0x0, 0x53, "Num Del" },
{ 0x30, 0x30, 0xb, "0" },
{ 0x31, 0x31, 0x2, "1" },
{ 0x32, 0x32, 0x3, "2" },
{ 0x33, 0x33, 0x4, "3" },
{ 0x34, 0x34, 0x5, "4" },
{ 0x35, 0x35, 0x6, "5" },
{ 0x36, 0x36, 0x7, "6" },
{ 0x37, 0x37, 0x8, "7" },
{ 0x38, 0x38, 0x9, "8" },
{ 0x39, 0x39, 0xa, "9" },
{ 0x41, 0x41, 0x1e, "A" },
{ 0x42, 0x42, 0x30, "B" },
{ 0x43, 0x43, 0x2e, "C" },
{ 0x44, 0x44, 0x20, "D" },
{ 0x45, 0x45, 0x12, "E" },
{ 0x46, 0x46, 0x21, "F" },
{ 0x47, 0x47, 0x22, "G" },
{ 0x48, 0x48, 0x23, "H" },
{ 0x49, 0x49, 0x17, "I" },
{ 0x4a, 0x4a, 0x24, "J" },
{ 0x4b, 0x4b, 0x25, "K" },
{ 0x4c, 0x4c, 0x26, "L" },
{ 0x4d, 0x4d, 0x32, "M" },
{ 0x4e, 0x4e, 0x31, "N" },
{ 0x4f, 0x4f, 0x18, "O" },
{ 0x50, 0x50, 0x19, "P" },
{ 0x51, 0x51, 0x10, "Q" },
{ 0x52, 0x52, 0x13, "R" },
{ 0x53, 0x53, 0x1f, "S" },
{ 0x54, 0x54, 0x14, "T" },
{ 0x55, 0x55, 0x16, "U" },
{ 0x56, 0x56, 0x2f, "V" },
{ 0x57, 0x57, 0x11, "W" },
{ 0x58, 0x58, 0x2d, "X" },
{ 0x59, 0x59, 0x15, "Y" },
{ 0x5a, 0x5a, 0x2c, "Z" },
{ 0x60, 0x0, 0x52, "Num 0" },
{ 0x61, 0x0, 0x4f, "Num 1" },
{ 0x62, 0x0, 0x50, "Num 2" },
{ 0x63, 0x0, 0x51, "Num 3" },
{ 0x64, 0x0, 0x4b, "Num 4" },
{ 0x65, 0x0, 0x4c, "Num 5" },
{ 0x66, 0x0, 0x4d, "Num 6" },
{ 0x67, 0x0, 0x47, "Num 7" },
{ 0x68, 0x0, 0x48, "Num 8" },
{ 0x69, 0x0, 0x49, "Num 9" },
{ 0x6a, 0x2a, 0x37, "Num *" },
{ 0x6b, 0x2b, 0x4e, "Num +" },
{ 0x6c, 0x0, 0x0, "" },
{ 0x6d, 0x2d, 0x4a, "Num -" },
{ 0x6e, 0x2e, 0x53, "Num Del" },
{ 0x6f, 0x2f, 0x0, "" },
{ 0x70, 0x0, 0x3b, "F1" },
{ 0x71, 0x0, 0x3c, "F2" },
{ 0x72, 0x0, 0x3d, "F3" },
{ 0x73, 0x0, 0x3e, "F4" },
{ 0x74, 0x0, 0x3f, "F5" },
{ 0x75, 0x0, 0x40, "F6" },
{ 0x76, 0x0, 0x41, "F7" },
{ 0x77, 0x0, 0x42, "F8" },
{ 0x78, 0x0, 0x43, "F9" },
{ 0x79, 0x0, 0x44, "F10" },
{ 0x7a, 0x0, 0x57, "F11" },
{ 0x7b, 0x0, 0x58, "F12" },
{ 0x90, 0x0, 0x45, "Pause" },
{ 0x91, 0x0, 0x46, "Scroll Lock" },
{ 0xba, 0x3b, 0x27, ";" },
{ 0xbb, 0x3d, 0xd, "=" },
{ 0xbc, 0x2c, 0x33, "," },
{ 0xbd, 0x2d, 0xc, "-" },
{ 0xbe, 0x2e, 0x34, "." },
{ 0xbf, 0x2f, 0x35, "/" },
{ 0xc0, 0x60, 0x29, "`" },
{ 0xdb, 0x5b, 0x1a, "[" },
{ 0xdc, 0x5c, 0x2b, "\\" },
{ 0xdd, 0x5d, 0x1b, "]" },
{ 0xde, 0x27, 0x28, "\'" },
{ 0xe2, 0x5c, 0x56, "\\" },
};
#define KeyTableSize sizeof(KeyTable) / sizeof(struct KeyTableEntry)
int ToAscii(WORD wVirtKey, WORD wScanCode, LPSTR lpKeyState,
LPVOID lpChar, WORD wFlags)
{
@ -138,7 +250,7 @@ int GetKeyNameText(LONG lParam, LPSTR lpBuffer, int nSize)
for (i = 0 ; i != KeyTableSize ; i++)
if (KeyTable[i].scancode == lParam) {
lstrcpyn(lpBuffer, KeyTable[i].name, nSize);
lstrcpyn32A( lpBuffer, KeyTable[i].name, nSize );
return strlen(lpBuffer);
}

View File

@ -60,86 +60,6 @@ static const BYTE Ansi2Oem[256] =
/* Funny to divide them between user and kernel. */
/* KERNEL.89 */
SEGPTR lstrcat( SEGPTR target, SEGPTR source )
{
strcat( (char *)PTR_SEG_TO_LIN(target), (char *)PTR_SEG_TO_LIN(source) );
return target;
}
/* USER.430 */
INT lstrcmp(LPCSTR str1,LPCSTR str2)
{
return strcmp( str1, str2 );
}
/* USER.471 */
INT lstrcmpi( LPCSTR str1, LPCSTR str2 )
{
INT res;
while (*str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/* Not a Windows API*/
INT lstrncmpi( LPCSTR str1, LPCSTR str2, int n )
{
INT res;
if (!n) return 0;
while ((--n > 0) && *str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/* KERNEL.88 */
SEGPTR lstrcpy( SEGPTR target, SEGPTR source )
{
strcpy( (char *)PTR_SEG_TO_LIN(target), (char *)PTR_SEG_TO_LIN(source) );
return target;
}
/* KERNEL.353 32-bit version*/
LPSTR lstrcpyn( LPSTR dst, LPCSTR src, int n )
{
char *tmp = dst;
while(n-- > 1 && *src)
*tmp++ = *src++;
*tmp = 0;
return dst;
}
/* KERNEL.353 16-bit version*/
SEGPTR WIN16_lstrcpyn( SEGPTR target, SEGPTR source, WORD n )
{
lstrcpyn((char *)PTR_SEG_TO_LIN(target), (char *)PTR_SEG_TO_LIN(source),n);
return target;
}
/* KERNEL.90 */
INT lstrlen(LPCSTR str)
{
/* looks weird, but win3.1 KERNEL got a GeneralProtection handler
* in lstrlen() ... we check only for NULL pointer reference.
* - Marcus Meissner
*/
if (str==NULL) {
fprintf(stddeb,"lstrlen(NULL) caught, returning 0.\n");
return 0;
}
return strlen(str);
}
/* IsCharAlpha USER 433 */
BOOL IsCharAlpha(char ch)
{
@ -335,111 +255,5 @@ void OutputDebugString( LPCSTR str )
module = MODULE_GetModuleName( GetExePtr(GetCurrentTask()) );
fprintf( stderr, "OutputDebugString: %s says '%s'\n",
module ? module : "???", buffer );
}
/***********************************************************************
* wsprintf (USER.420)
*/
#ifndef WINELIB
int wsprintf( LPSTR dummy1, LPSTR dummy2, ... )
{
LPSTR lpOutput, lpFormat;
DWORD *win_stack = (DWORD *)CURRENT_STACK16->args;
lpOutput = (LPSTR) PTR_SEG_TO_LIN(*win_stack);
win_stack++;
lpFormat = (LPSTR) PTR_SEG_TO_LIN(*win_stack);
win_stack++;
return wvsprintf( lpOutput, lpFormat, (LPCSTR)win_stack );
}
#else /* WINELIB */
int wsprintf(LPSTR lpOutput, LPSTR lpFormat, ...)
{
va_list valist;
int ArgCnt;
va_start(valist, lpFormat);
ArgCnt = vsprintf(lpOutput, lpFormat, valist);
va_end(valist);
return ArgCnt;
}
#endif /* WINELIB */
/***********************************************************************
* wvsprintf (USER.421)
*/
int wvsprintf( LPSTR buf, LPCSTR format, LPCSTR args )
{
LPCSTR ptr;
DWORD stack[512], *stack_ptr;
BOOL fLarge;
/* Create the 32-bit stack for libc's vsprintf() */
for (stack_ptr = stack, ptr = format; *ptr; ptr++)
{
if (*ptr != '%' || *++ptr == '%')
continue;
/* skip width/precision */
while (*ptr == '-' || *ptr == '+' || *ptr == '.' ||
*ptr == ' ' || isdigit(*ptr) || *ptr == '#')
ptr++;
/* handle modifier */
fLarge = ((*ptr == 'l') || (*ptr == 'L'));
if (fLarge) ptr++;
switch (*ptr)
{
case 's':
*stack_ptr++ = (DWORD)PTR_SEG_TO_LIN(*(DWORD*)args);
args += sizeof(DWORD);
break;
case 'c':
/* windows' wsprintf() %c ignores 0's, we replace 0 with SPACE to make sure
that the remaining part of the string isn't ignored by the winapp */
*stack_ptr++ = (DWORD)(*(WORD*)args ? *(WORD*)args : ' ');
args += sizeof(WORD);
break;
case 'd':
case 'i':
if (!fLarge)
{
*stack_ptr++ = (DWORD)(INT32)(*(INT16 *)args);
args += sizeof(INT16);
break;
}
/* else fall through */
case 'u':
case 'x':
case 'X':
if (fLarge)
{
*stack_ptr++ = *(DWORD*)args;
args += sizeof(DWORD);
}
else
{
*stack_ptr++ = *(WORD*)args;
args += sizeof(WORD);
}
break;
default:
*stack_ptr++ = 0;
args += sizeof(WORD);
fprintf( stderr, "wsprintf: oops, unknown format %c!\n", *ptr );
break;
}
}
return vsprintf( buf, format, stack );
free( buffer );
}

View File

@ -21,6 +21,12 @@
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "string32.h"
#define strdupW2A(x) STRING32_DupUniToAnsi(x)
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
#define strcpyWA(a,b) STRING32_UniToAnsi(a,b)
#define strcpyAW(a,b) STRING32_AnsiToUni(a,b)
/* The readahead length of the decompressor. Reading single bytes
* using _lread() would be SLOW.
@ -64,7 +70,7 @@ static int nroflzstates=0;
#define GET(lzs,b) _lzget(lzs,&b)
#define GET_FLUSH(lzs) lzs->getcur=lzs->getlen;
int
static int
_lzget(struct lzstate *lzs,BYTE *b) {
if (lzs->getcur<lzs->getlen) {
*b = lzs->get[lzs->getcur++];
@ -113,16 +119,16 @@ read_header(HFILE fd,struct lzfileheader *head) {
return 1;
}
/*
* LZSTART [LZEXPAND.7]
* LZStart [LZEXPAND.7] [LZ32.6]
*/
INT
LZStart(void) {
dprintf_file(stddeb,"LZStart(void)\n");
return 1;
INT16 LZStart(void)
{
dprintf_file(stddeb,"LZStart(void)\n");
return 1;
}
/*
* LZINIT [LZEXPAND.3]
* LZInit [LZEXPAND.3] [LZ32.2]
*
* initializes internal decompression buffers, returns lzfiledescriptor.
* (return value the same as hfSrc, if hfSrc is not compressed)
@ -166,7 +172,7 @@ LZInit(HFILE hfSrc) {
}
/*
* LZDone [LZEXPAND.9]
* LZDone [LZEXPAND.9] [LZ32.8]
*/
void
@ -175,7 +181,7 @@ LZDone(void) {
}
/*
* GetExpandedName [LZEXPAND.10]
* GetExpandedName [LZEXPAND.10]
*
* gets the full filename of the compressed file 'in' by opening it
* and reading the header
@ -185,8 +191,8 @@ LZDone(void) {
* "FILE.BL_" (with lastchar 'a') is being translated to "FILE.BLA"
*/
INT
GetExpandedName(LPCSTR in,LPSTR out) {
INT16
GetExpandedName16(LPCSTR in,LPSTR out) {
struct lzfileheader head;
HFILE fd;
OFSTRUCT ofs;
@ -252,27 +258,58 @@ GetExpandedName(LPCSTR in,LPSTR out) {
return 1;
}
/*
* GetExpandedNameW [LZ32.11]
*/
INT32
GetExpandedName32W(LPCWSTR in,LPWSTR out) {
char *xin,*xout;
INT32 ret;
xout = malloc(lstrlen32W(in)+3);
xin = strdupW2A(in);
ret = GetExpandedName16(xin,xout);
if (ret>0)
strcpyAW(out,xout);
free(xin);
free(xout);
return ret;
}
/*
* GetExpandedNameA [LZ32.9]
*/
INT32
GetExpandedName32A(LPCSTR in,LPSTR out) {
return GetExpandedName16(in,out);
}
/*
* LZRead [LZEXPAND.5]
* LZRead [LZEXPAND.5] [LZ32.4]
* just as normal read, but reads from LZ special fd and uncompresses.
*/
INT
LZRead(HFILE fd,SEGPTR segbuf,WORD toread) {
INT16
LZRead16(HFILE fd,SEGPTR segbuf,UINT16 toread) {
dprintf_file(stddeb,"LZRead16(%d,%08lx,%d)\n",fd,(DWORD)segbuf,toread);
return LZRead32(fd,(LPBYTE)PTR_SEG_TO_LIN(segbuf),toread);
}
INT32
LZRead32(HFILE fd,LPVOID vbuf,UINT32 toread) {
int i,howmuch;
BYTE b;
BYTE *buf;
BYTE b,*buf;
struct lzstate *lzs;
dprintf_file(stddeb,"LZRead(%d,%08lx,%d)\n",fd,(DWORD)segbuf,toread);
buf=(LPBYTE)vbuf;
dprintf_file(stddeb,"LZRead32(%d,%p,%d)\n",fd,buf,toread);
howmuch=toread;
for (i=0;i<nroflzstates;i++)
if (lzstates[i].lzfd==fd)
break;
if (i==nroflzstates)
return _lread(fd,segbuf,toread);
return FILE_Read(fd,buf,toread);
lzs=lzstates+i;
/* The decompressor itself is in a define, cause we need it twice
* in this function. (the decompressed byte will be in b)
*/
@ -339,7 +376,6 @@ LZRead(HFILE fd,SEGPTR segbuf,WORD toread) {
}
}
buf=PTR_SEG_TO_LIN(segbuf);
while (howmuch) {
DECOMPRESS_ONE_BYTE;
lzs->realwanted++;
@ -351,13 +387,13 @@ LZRead(HFILE fd,SEGPTR segbuf,WORD toread) {
}
/*
* LZSeek [LZEXPAND.4]
* LZSeek [LZEXPAND.4] [LZ32.3]
*
* works as the usual _llseek
*/
LONG
LZSeek(HFILE fd,LONG off,INT type) {
LZSeek(HFILE fd,LONG off,INT32 type) {
int i;
struct lzstate *lzs;
LONG lastwanted,newwanted;
@ -392,7 +428,7 @@ LZSeek(HFILE fd,LONG off,INT type) {
}
/*
* LZCopy [LZEXPAND.1]
* LZCopy [LZEXPAND.1] [LZ32.0]
*
* Copies everything from src to dest
* if src is a LZ compressed file, it will be uncompressed.
@ -404,7 +440,7 @@ LZCopy(HFILE src,HFILE dest) {
LONG len;
#define BUFLEN 1000
BYTE buf[BUFLEN];
INT (*xread)(HFILE,SEGPTR,WORD);
INT32 (*xread)(HFILE,LPVOID,UINT32);
dprintf_file(stddeb,"LZCopy(%d,%d)\n",src,dest);
for (i=0;i<nroflzstates;i++)
@ -413,12 +449,12 @@ LZCopy(HFILE src,HFILE dest) {
/* not compressed? just copy */
if (i==nroflzstates)
xread=_lread;
xread=FILE_Read;
else
xread=LZRead;
xread=LZRead32;
len=0;
while (1) {
ret=xread(src,MAKE_SEGPTR(buf),BUFLEN);
ret=xread(src,buf,BUFLEN);
if (ret<=0) {
if (ret==0)
break;
@ -440,7 +476,7 @@ LZCopy(HFILE src,HFILE dest) {
* Opens a file. If not compressed, open it as a normal file.
*/
HFILE
LZOpenFile(LPCSTR fn,LPOFSTRUCT ofs,UINT mode) {
LZOpenFile16(LPCSTR fn,LPOFSTRUCT ofs,UINT16 mode) {
HFILE fd,cfd;
dprintf_file(stddeb,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
@ -456,8 +492,37 @@ LZOpenFile(LPCSTR fn,LPOFSTRUCT ofs,UINT mode) {
return cfd;
}
/*
* LZOpenFileA [LZ32.1]
*/
HFILE
LZOpenFile32A(LPCSTR fn,LPOFSTRUCT ofs,UINT32 mode) {
return LZOpenFile16(fn,ofs,mode);
}
/*
* LZOpenFileW [LZ32.10]
*/
HFILE
LZOpenFile32W(LPCWSTR fn,LPOFSTRUCT ofs,UINT32 mode) {
LPSTR xfn;
LPWSTR yfn;
HFILE ret;
xfn = strdupW2A(fn);
ret = LZOpenFile16(xfn,ofs,mode);
free(xfn);
if (ret!=HFILE_ERROR) {
/* ofs->szPathName is an array with the OFSTRUCT */
yfn = strdupA2W(ofs->szPathName);
memcpy(ofs->szPathName,yfn,lstrlen32W(yfn)*2+2);
free(yfn);
}
return ret;
}
/*
* LZClose [LZEXPAND.6]
* LZClose [LZEXPAND.6] [LZ32.5]
*/
void
LZClose(HFILE fd) {
@ -480,7 +545,7 @@ LZClose(HFILE fd) {
}
/*
* CopyLZFile [LZEXPAND.8]
* CopyLZFile [LZEXPAND.8] [LZ32.7]
*
* Copy src to dest (including uncompressing src).
* NOTE: Yes. This is exactly the same function as LZCopy.

View File

@ -26,6 +26,8 @@
#include "options.h"
#include "desktop.h"
#include "shell.h"
#include "winbase.h"
#include "string32.h"
#define DEBUG_DEFINE_VARIABLES
#include "stddebug.h"
#include "debug.h"
@ -53,7 +55,7 @@ const char people[] = "Wine is available thanks to the work of "
"Jan Willamowius, Carl Williams, Karl Guenter Wuensch, Eric Youngdale, "
"and James Youngman. ";
const char *langNames[] =
const char * langNames[] =
{
"En", /* LANG_En */
"Es", /* LANG_Es */
@ -87,6 +89,9 @@ Window rootWindow;
int screenWidth = 0, screenHeight = 0; /* Desktop window dimensions */
int screenDepth = 0; /* Screen depth to use */
int desktopX = 0, desktopY = 0; /* Desktop window position (if any) */
int getVersion16 = 0;
int getVersion32 = 0;
OSVERSIONINFO32A getVersionEx;
struct options Options =
{ /* default options */
@ -128,7 +133,8 @@ static XrmOptionDescRec optionsTable[] =
{ "-dll", ".dll", XrmoptionSepArg, (caddr_t)NULL },
{ "-allowreadonly", ".allowreadonly", XrmoptionNoArg, (caddr_t)"on" },
{ "-mode", ".mode", XrmoptionSepArg, (caddr_t)NULL },
{ "-managed", ".managed", XrmoptionNoArg, (caddr_t)"off"}
{ "-managed", ".managed", XrmoptionNoArg, (caddr_t)"off"},
{ "-winver", ".winver", XrmoptionSepArg, (caddr_t)NULL }
};
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
@ -153,7 +159,8 @@ static XrmOptionDescRec optionsTable[] =
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
" -name name Set the application name\n" \
" -privatemap Use a private color map\n" \
" -synchronous Turn on synchronous display mode\n"
" -synchronous Turn on synchronous display mode\n" \
" -winver Version to imitate (one of win31,win95,nt351)\n"
@ -237,7 +244,7 @@ BOOL ParseDebugOptions(char *options)
l=strchr(options,',')-options;
else
l=strlen(options);
if (!lstrncmpi(options+1,"all",l-1))
if (!lstrncmpi32A(options+1,"all",l-1))
{
int i;
for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
@ -247,7 +254,7 @@ BOOL ParseDebugOptions(char *options)
{
int i;
for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
if (debug_msg_name && (!lstrncmpi(options+1,debug_msg_name[i],l-1)))
if (debug_msg_name && (!lstrncmpi32A(options+1,debug_msg_name[i],l-1)))
{
debug_msg_enabled[i]=(*options=='+');
break;
@ -279,7 +286,7 @@ static void MAIN_ParseLanguageOption( char *arg )
Options.language = LANG_En; /* First language */
for (p = langNames; *p; p++)
{
if (!lstrcmpi( *p, arg )) return;
if (!lstrcmpi32A( *p, arg )) return;
Options.language++;
}
fprintf( stderr, "Invalid language specified '%s'. Supported languages are: ", arg );
@ -296,8 +303,8 @@ static void MAIN_ParseLanguageOption( char *arg )
*/
static void MAIN_ParseModeOption( char *arg )
{
if (!lstrcmpi("enhanced", arg)) Options.mode = MODE_ENHANCED;
else if (!lstrcmpi("standard", arg)) Options.mode = MODE_STANDARD;
if (!lstrcmpi32A("enhanced", arg)) Options.mode = MODE_ENHANCED;
else if (!lstrcmpi32A("standard", arg)) Options.mode = MODE_STANDARD;
else
{
fprintf(stderr, "Invalid mode '%s' specified.\n", arg);
@ -306,6 +313,47 @@ static void MAIN_ParseModeOption( char *arg )
}
}
/**********************************************************************
* MAIN_ParseVersion
*/
static void MAIN_ParseVersion( char *arg )
{
/* If you add any other options,
verify the values you return on the real thing */
if(strcmp(arg,"win31")==0)
{
getVersion16 = 0x06160A03;
/* FIXME: My Win32s installation failed to execute the
MSVC 4 test program. So check these values */
getVersion32 = 0x80000A03;
getVersionEx.dwMajorVersion=3;
getVersionEx.dwMinorVersion=10;
getVersionEx.dwBuildNumber=0;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32s;
strcpy(getVersionEx.szCSDVersion,"Win32s 1.3");
}
else if(strcmp(arg, "win95")==0)
{
getVersion16 = 0x07005F03;
getVersion32 = 0xC0000004;
getVersionEx.dwMajorVersion=4;
getVersionEx.dwMinorVersion=0;
getVersionEx.dwBuildNumber=0x40003B6;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32_WINDOWS;
strcpy(getVersionEx.szCSDVersion,"");
}
else if(strcmp(arg, "nt351")==0)
{
getVersion16 = 0x05000A03;
getVersion32 = 0x04213303;
getVersionEx.dwMajorVersion=3;
getVersionEx.dwMinorVersion=51;
getVersionEx.dwBuildNumber=0x421;
getVersionEx.dwPlatformId=VER_PLATFORM_WIN32_NT;
strcpy(getVersionEx.szCSDVersion,"Service Pack 2");
}
else fprintf(stderr, "Unknown winver system code - ignored\n");
}
/***********************************************************************
* MAIN_ParseOptions
@ -326,7 +374,7 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
#ifdef WINELIB
/* Need to assemble command line and pass it to WinMain */
#else
if (*argc < 2 || lstrcmpi(argv[1], "-h") == 0)
if (*argc < 2 || lstrcmpi32A(argv[1], "-h") == 0)
MAIN_Usage( argv[0] );
#endif
@ -414,6 +462,9 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
fprintf(stderr,"-dll not supported in libwine\n");
#endif
}
if(MAIN_GetResource( db, ".winver", &value))
MAIN_ParseVersion( (char*)value.addr );
}
@ -593,6 +644,7 @@ int main( int argc, char *argv[] )
return ret_val;
}
/***********************************************************************
* MessageBeep (USER.104)
*/
@ -601,14 +653,77 @@ void MessageBeep(WORD i)
XBell(display, 100);
}
/***********************************************************************
* GetVersion (KERNEL.3)
*/
LONG GetVersion(void)
{
if (getVersion16) return getVersion16;
return MAKELONG( WINVERSION, WINDOSVER );
}
/***********************************************************************
* GetVersion32
*/
LONG GetVersion32(void)
{
if (getVersion32) return getVersion32;
return MAKELONG( 4, DOSVERSION);
}
/***********************************************************************
* GetVersionExA
*/
BOOL32 GetVersionEx32A(OSVERSIONINFO32A *v)
{
if(v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFO32A))
{
fprintf(stddeb,"wrong OSVERSIONINFO size from app");
return FALSE;
}
if(!getVersion32)
{
/* Return something like NT 3.5 */
v->dwMajorVersion = 3;
v->dwMinorVersion = 5;
v->dwBuildNumber = 42;
v->dwPlatformId = VER_PLATFORM_WIN32_NT;
strcpy(v->szCSDVersion, "Wine is not an emulator");
return TRUE;
}
v->dwMajorVersion = getVersionEx.dwMajorVersion;
v->dwMinorVersion = getVersionEx.dwMinorVersion;
v->dwBuildNumber = getVersionEx.dwBuildNumber;
v->dwPlatformId = getVersionEx.dwPlatformId;
strcpy(v->szCSDVersion, getVersionEx.szCSDVersion);
return TRUE;
}
/***********************************************************************
* GetVersionExW
*/
BOOL32 GetVersionEx32W(OSVERSIONINFO32W *v)
{
OSVERSIONINFO32A v1;
if(v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFO32W))
{
fprintf(stddeb,"wrong OSVERSIONINFO size from app");
return FALSE;
}
v1.dwOSVersionInfoSize=sizeof(v1);
GetVersionEx32A(&v1);
v->dwMajorVersion = v1.dwMajorVersion;
v->dwMinorVersion = v1.dwMinorVersion;
v->dwBuildNumber = v1.dwBuildNumber;
v->dwPlatformId = v1.dwPlatformId;
STRING32_AnsiToUni(v->szCSDVersion, v1.szCSDVersion);
return TRUE;
}
/***********************************************************************
* GetWinFlags (KERNEL.132)
*/
@ -984,7 +1099,7 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
case SPI_GETICONTITLELOGFONT:
{
/* FIXME GetProfileString( "?", "?", "?" ) */
LPLOGFONT lpLogFont = (LPLOGFONT)lpvParam;
LPLOGFONT16 lpLogFont = (LPLOGFONT16)lpvParam;
lpLogFont->lfHeight = 10;
lpLogFont->lfWidth = 0;
lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
@ -1014,14 +1129,6 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
return 1;
}
/***********************************************************************
* HMEMCPY (KERNEL.348)
*/
void hmemcpy(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
{
memcpy(hpvDest, hpvSource, cbCopy);
}
/***********************************************************************
* COPY (GDI.250)
*/

View File

@ -665,7 +665,7 @@ LOCVAL(LOCALE_INEGSEPBYSPACE)
}
if(retLen>len)retLen=len;
lstrcpyn(buf,retString,len);
lstrcpyn32A(buf,retString,len);
return retLen;
}
@ -690,8 +690,7 @@ int CompareStringA(DWORD lcid, DWORD fdwStyle,
l2 = (l2==-1)?strlen(s2):l2;
len = l1<l2 ? l1:l2;
ret = (fdwStyle & NORM_IGNORECASE) ?
lstrncmpi(s1,s2,len) :
strncmp(s1,s2,len);
lstrncmpi32A(s1,s2,len) : lstrncmp32A(s1,s2,len);
/* not equal, return 1 or 3 */
if(ret!=0)return ret+2;
/* same len, return 2 */

View File

@ -41,6 +41,31 @@
#define KEY_REGISTRY "Software\\The WINE team\\WINE\\Registry"
#define VAL_SAVEUPDATED "SaveOnlyUpdatedKeys"
/* one value of a key */
typedef struct tagKEYVALUE
{
LPWSTR name; /* name of value (UNICODE) or NULL for win31 */
DWORD type; /* type of value */
DWORD len; /* length of data */
DWORD lastmodified; /* time of seconds since 1.1.1970 */
LPBYTE data; /* content, may be strings, binaries, etc. */
} KEYVALUE,*LPKEYVALUE;
/* a registry key */
typedef struct tagKEYSTRUCT
{
LPWSTR keyname; /* name of THIS key (UNICODE) */
DWORD flags; /* flags. */
LPWSTR class;
/* values */
DWORD nrofvalues; /* nr of values in THIS key */
LPKEYVALUE values; /* values in THIS key */
/* key management pointers */
struct tagKEYSTRUCT *next; /* next key on same hierarchy */
struct tagKEYSTRUCT *nextsub; /* keys that hang below THIS key */
} KEYSTRUCT, *LPKEYSTRUCT;
static KEYSTRUCT *key_classes_root=NULL; /* windows 3.1 global values */
static KEYSTRUCT *key_current_user=NULL; /* user specific values */
static KEYSTRUCT *key_local_machine=NULL;/* machine specific values */
@ -57,10 +82,10 @@ static KEYSTRUCT *key_dyn_data=NULL;
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
#define strdupW2A(x) STRING32_DupUniToAnsi(x)
#define strdupW(x) STRING32_strdupW(x)
#define strcmpW(a,b) STRING32_lstrcmpW(a,b)
#define strcmpW(a,b) lstrcmp32W(a,b)
#define strcmpniW(a,b) STRING32_lstrcmpniW(a,b)
#define strchrW(a,c) STRING32_lstrchrW(a,c)
#define strlenW(a) STRING32_UniLen(a)
#define strlenW(a) lstrlen32W(a)
#define strcpyWA(a,b) STRING32_UniToAnsi(a,b)
static struct openhandle {

View File

@ -573,7 +573,7 @@ LPSTR SHELL_FindString(LPSTR lpEnv, LPCSTR entry)
UINT l = strlen(entry);
for( ; *lpEnv ; lpEnv+=strlen(lpEnv)+1 )
{
if( lstrncmpi(lpEnv, entry, l) ) continue;
if( lstrncmpi32A(lpEnv, entry, l) ) continue;
if( !*(lpEnv+l) )
return (lpEnv + l); /* empty entry */

View File

@ -18,7 +18,7 @@
#define SPY_MAX_MSGNUM WM_USER
#define SPY_INDENT_UNIT 4 /* 4 spaces */
static const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] =
{
"WM_NULL", /* 0x00 */
"WM_CREATE",
@ -411,7 +411,7 @@ static const char *MessageTypeNames[SPY_MAX_MSGNUM + 1] =
};
static BOOL SPY_Exclude[SPY_MAX_MSGNUM+1] = { FALSE, };
static BOOL SPY_Exclude[SPY_MAX_MSGNUM+1];
static int SPY_IndentLevel = 0;
#define SPY_EXCLUDE(msg) \

View File

@ -15,20 +15,23 @@
#include "lzexpand.h"
#include "module.h"
#include "neexe.h"
#include "stackframe.h" /* MAKE_SEGPTR */
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
#include "winreg.h"
#include "string32.h"
#define LZREAD(what) if (sizeof(*what)!=LZRead(lzfd,MAKE_SEGPTR(what),sizeof(*what))) return 0;
#define LZREAD(what) if (sizeof(*what)!=LZRead32(lzfd,what,sizeof(*what))) return 0;
#define strdupW2A(x) STRING32_DupUniToAnsi(x)
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
int
read_ne_header(HFILE lzfd,struct ne_header_s *nehd) {
struct mz_header_s mzh;
LZSeek(lzfd,0,SEEK_SET);
if (sizeof(mzh)!=LZRead(lzfd,MAKE_SEGPTR(&mzh),sizeof(mzh)))
if (sizeof(mzh)!=LZRead32(lzfd,&mzh,sizeof(mzh)))
return 0;
if (mzh.mz_magic!=MZ_SIGNATURE)
return 0;
@ -87,12 +90,12 @@ find_ne_resource(
);
LZREAD(&len);
str=xmalloc(len);
if (len!=LZRead(lzfd,MAKE_SEGPTR(str),len))
if (len!=LZRead32(lzfd,str,len))
return 0;
dprintf_resource(stderr,"read %s to compare it with %s\n",
str,(char*)PTR_SEG_TO_LIN(typeid)
);
if (lstrcmpi(str,(char*)PTR_SEG_TO_LIN(typeid)))
if (lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
skipflag=1;
free(str);
LZSeek(lzfd,whereleft,SEEK_SET);
@ -127,12 +130,12 @@ find_ne_resource(
);
LZREAD(&len);
str=xmalloc(len);
if (len!=LZRead(lzfd,MAKE_SEGPTR(str),len))
if (len!=LZRead32(lzfd,str,len))
return 0;
dprintf_resource(stderr,"read %s to compare it with %s\n",
str,(char*)PTR_SEG_TO_LIN(typeid)
);
if (!lstrcmpi(str,(char*)PTR_SEG_TO_LIN(typeid)))
if (!lstrcmpi32A(str,(char*)PTR_SEG_TO_LIN(typeid)))
skipflag=0;
free(str);
LZSeek(lzfd,whereleft,SEEK_SET);
@ -144,7 +147,7 @@ find_ne_resource(
*off = (int)ni.offset<<shiftcount;
len = ni.length<<shiftcount;
rdata=(WORD*)xmalloc(len);
if (len!=LZRead(lzfd,MAKE_SEGPTR(rdata),len)) {
if (len!=LZRead32(lzfd,rdata,len)) {
free(rdata);
return 0;
}
@ -156,6 +159,7 @@ find_ne_resource(
}
}
/* GetFileResourceSize [VER.2] */
DWORD
GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,LPDWORD off) {
HFILE lzfd;
@ -167,7 +171,7 @@ GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,LPDWORD off) {
fprintf(stderr,"GetFileResourceSize(%s,%lx,%lx,%p)\n",
filename,(LONG)restype,(LONG)resid,off
);
lzfd=LZOpenFile(filename,&ofs,OF_READ);
lzfd=LZOpenFile16(filename,&ofs,OF_READ);
if (lzfd==0)
return 0;
if (!read_ne_header(lzfd,&nehd)) {
@ -183,6 +187,7 @@ GetFileResourceSize(LPCSTR filename,SEGPTR restype,SEGPTR resid,LPDWORD off) {
return reslen;
}
/* GetFileResourceSize [VER.3] */
DWORD
GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
DWORD off,DWORD datalen,LPVOID data
@ -196,7 +201,7 @@ GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
filename,(LONG)restype,(LONG)resid,off,datalen,data
);
lzfd=LZOpenFile(filename,&ofs,OF_READ);
lzfd=LZOpenFile16(filename,&ofs,OF_READ);
if (lzfd==0)
return 0;
if (!off) {
@ -213,19 +218,19 @@ GetFileResource(LPCSTR filename,SEGPTR restype,SEGPTR resid,
LZSeek(lzfd,off,SEEK_SET);
if (reslen>datalen)
reslen=datalen;
LZRead(lzfd,MAKE_SEGPTR(data),reslen);
LZRead32(lzfd,data,reslen);
LZClose(lzfd);
return reslen;
}
/* GetFileVersionInfoSize [VER.6] */
DWORD
GetFileVersionInfoSize(LPCSTR filename,LPDWORD handle) {
GetFileVersionInfoSize16(LPCSTR filename,LPDWORD handle) {
DWORD len,ret;
BYTE buf[72];
VS_FIXEDFILEINFO *vffi;
fprintf(stderr,"GetFileVersionInfoSize(%s,%p)\n",filename,handle);
dprintf_resource(stderr,"GetFileVersionInfoSize16(%s,%p)\n",filename,handle);
len=GetFileResourceSize(filename,VS_FILE_INFO,VS_VERSION_INFO,handle);
if (!len)
return 0;
@ -330,9 +335,29 @@ GetFileVersionInfoSize(LPCSTR filename,LPDWORD handle) {
return len;
}
/* GetFileVersionInfoSize32A [VERSION.1] */
DWORD
GetFileVersionInfoSize32A(LPCSTR filename,LPDWORD handle) {
dprintf_resource(stderr,"GetFileVersionInfoSize32A(%s,%p)\n",filename,handle);
return GetFileVersionInfoSize16(filename,handle);
}
/* GetFileVersionInfoSize32W [VERSION.2] */
DWORD
GetFileVersionInfoSize32W(LPCWSTR filename,LPDWORD handle) {
LPSTR xfn;
DWORD ret;
xfn = strdupW2A(filename);
ret=GetFileVersionInfoSize16(xfn,handle);
free(xfn);
return ret;
}
/* GetFileVersionInfo [VER.7] */
DWORD
GetFileVersionInfo(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data) {
fprintf(stderr,"GetFileVersionInfo(%s,%ld,%ld,%p)\n->",
GetFileVersionInfo16(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data) {
dprintf_resource(stderr,"GetFileVersionInfo16(%s,%ld,%ld,%p)\n->",
filename,handle,datasize,data
);
return GetFileResource(
@ -340,10 +365,29 @@ GetFileVersionInfo(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data) {
);
}
/* GetFileVersionInfoA [VERSION.0] */
DWORD
VerFindFile(
UINT flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT *curdirlen,LPSTR destdir,UINT*destdirlen
GetFileVersionInfo32A(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data) {
return GetFileVersionInfo16(filename,handle,datasize,data);
}
/* GetFileVersionInfoW [VERSION.3] */
DWORD
GetFileVersionInfo32W(LPCWSTR filename,DWORD handle,DWORD datasize,LPVOID data){
DWORD ret;
LPSTR fn;
fn = strdupW2A(filename);
ret = GetFileVersionInfo16(fn,handle,datasize,data);
free(fn);
return ret;
}
/* VerFindFile [VER.8] */
DWORD
VerFindFile16(
UINT16 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT16 *curdirlen,LPSTR destdir,UINT16 *destdirlen
) {
fprintf(stderr,"VerFindFile(%x,%s,%s,%s,%p,%d,%p,%d)\n",
flags,filename,windir,appdir,curdir,*curdirlen,destdir,*destdirlen
@ -355,21 +399,88 @@ VerFindFile(
return 0;
}
/* VerFindFileA [VERSION.5] */
DWORD
VerInstallFile(
UINT flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT*tmpfilelen
VerFindFile32A(
UINT32 flags,LPCSTR filename,LPCSTR windir,LPCSTR appdir,
LPSTR curdir,UINT32 *curdirlen,LPSTR destdir,UINT32 *destdirlen
) {
return VerFindFile16(flags,filename,windir,appdir,curdir,curdirlen,destdir,destdirlen);
}
/* VerFindFileW [VERSION.6] */
DWORD
VerFindFile32W(
UINT32 flags,LPCWSTR filename,LPCWSTR windir,LPCWSTR appdir,
LPWSTR curdir,UINT32 *curdirlen,LPWSTR destdir,UINT32 *destdirlen
) {
LPSTR wfn,wwd,wad,wdd,wcd;
DWORD ret;
wfn = strdupW2A(filename);
wwd = strdupW2A(windir);
wad = strdupW2A(appdir);
wcd = (LPSTR)malloc(*curdirlen);
wdd = (LPSTR)malloc(*destdirlen);
ret=VerFindFile16(flags,wfn,wwd,wad,wcd,curdirlen,wdd,destdirlen);
STRING32_AnsiToUni(curdir,wcd);
STRING32_AnsiToUni(destdir,wdd);
*curdirlen = strlen(wcd);
*destdirlen = strlen(wdd);
return ret;
}
/* VerInstallFile [VER.9] */
DWORD
VerInstallFile16(
UINT16 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT16 *tmpfilelen
) {
fprintf(stderr,"VerInstallFile(%x,%s,%s,%s,%s,%p,%d)\n",
flags,srcfilename,destfilename,srcdir,destdir,tmpfile,*tmpfilelen
);
/* FIXME: Implementation still missing .... */
return VIF_SRCOLD;
}
/* VerFindFileA [VERSION.5] */
DWORD
VerInstallFile32A(
UINT32 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT32 *tmpfilelen
) {
return VerInstallFile16(flags,srcfilename,destfilename,srcdir,destdir,tmpfile,tmpfilelen);
}
/* VerFindFileW [VERSION.6] */
DWORD
VerInstallFile32W(
UINT32 flags,LPCWSTR srcfilename,LPCWSTR destfilename,LPCWSTR srcdir,
LPCWSTR destdir,LPWSTR tmpfile,UINT32 *tmpfilelen
) {
LPSTR wsrcf,wsrcd,wdestf,wdestd,wtmpf;
DWORD ret;
wsrcf = strdupW2A(srcfilename);
wsrcd = strdupW2A(srcdir);
wdestf = strdupW2A(destfilename);
wdestd = strdupW2A(destdir);
wtmpf = strdupW2A(tmpfile);
ret=VerInstallFile32A(flags,wsrcf,wdestf,wsrcd,wdestd,wtmpf,tmpfilelen);
free(wsrcf);
free(wsrcd);
free(wdestf);
free(wdestd);
free(wtmpf);
return ret;
}
/* FIXME: This table should, of course, be language dependend */
static struct map_id2str {
static const struct map_id2str {
UINT langid;
char *langname;
const char *langname;
} languages[]={
{0x0401,"Arabisch"},
{0x0402,"Bulgarisch"},
@ -419,12 +530,23 @@ static struct map_id2str {
{0x0000,"Unbekannt"},
};
/* VerLanguageName [VER.10] */
DWORD
VerLanguageName(UINT langid,LPSTR langname,UINT langnamelen) {
VerLanguageName16(UINT16 langid,LPSTR langname,UINT16 langnamelen) {
int i;
char *buf;
fprintf(stderr,"VerLanguageName(%d,%p,%d)\n",langid,langname,langnamelen);
/* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
* from the registry.
*/
buf=(char*)malloc(strlen("\\System\\CurrentControlSet\\control\\Nls\\Locale\\")+9);
sprintf(buf,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",langid);
if (ERROR_SUCCESS==RegQueryValue16(HKEY_LOCAL_MACHINE,buf,langname,(LPDWORD)&langnamelen)) {
langname[langnamelen-1]='\0';
return langnamelen;
}
/* if that fails, use the interal table */
for (i=0;languages[i].langid!=0;i++)
if (langid==languages[i].langid)
break;
@ -433,6 +555,45 @@ VerLanguageName(UINT langid,LPSTR langname,UINT langnamelen) {
return strlen(languages[i].langname);
}
/* VerLanguageNameA [VERSION.9] */
DWORD
VerLanguageName32A(UINT32 langid,LPSTR langname,UINT32 langnamelen) {
return VerLanguageName16(langid,langname,langnamelen);
}
/* VerLanguageNameW [VERSION.10] */
DWORD
VerLanguageName32W(UINT32 langid,LPWSTR langname,UINT32 langnamelen) {
int i;
char *buf;
LPWSTR keyname,result;
/* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
* from the registry.
*/
buf=(char*)malloc(strlen("\\System\\CurrentControlSet\\control\\Nls\\Locale\\")+9);
sprintf(buf,"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",langid);
keyname=strdupA2W(buf);free(buf);
if (ERROR_SUCCESS==RegQueryValue32W(HKEY_LOCAL_MACHINE,keyname,langname,(LPDWORD)&langnamelen)) {
free(keyname);
return langnamelen;
}
free(keyname);
/* if that fails, use the interal table */
for (i=0;languages[i].langid!=0;i++)
if (langid==languages[i].langid)
break;
result=strdupA2W(languages[i].langname);
i=lstrlen32W(result)*sizeof(WCHAR);
if (i>langnamelen)
i=langnamelen;
memcpy(langname,result,i);
langname[langnamelen-1]='\0';
free(result);
return strlen(languages[i].langname); /* same as strlenW(result); */
}
/* FIXME: UNICODE? */
struct db {
WORD nextoff;
WORD datalen;
@ -484,17 +645,18 @@ _find_data(BYTE *block,LPCSTR str) {
}
block=block+((db->nextoff+3)&~3);
}
}
/* VerQueryValue [VER.11] */
/* take care, 'buffer' is NOT a SEGPTR, it just points to one */
DWORD
VerQueryValue(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer,UINT *buflen) {
VerQueryValue16(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer,UINT16 *buflen)
{
BYTE *block=PTR_SEG_TO_LIN(segblock),*b;
struct db *db;
char *s;
fprintf(stderr,"VerQueryValue(%p,%s,%p,%d)\n",
fprintf(stderr,"VerQueryValue16(%p,%s,%p,%d)\n",
block,subblock,buffer,*buflen
);
s=(char*)xmalloc(strlen("VS_VERSION_INFO")+strlen(subblock)+1);
@ -516,8 +678,60 @@ VerQueryValue(SEGPTR segblock,LPCSTR subblock,SEGPTR *buffer,UINT *buflen) {
return 1;
}
/*
20 GETFILEVERSIONINFORAW
21 VERFTHK_THUNKDATA16
22 VERTHKSL_THUNKDATA16
*/
DWORD
VerQueryValue32A(LPVOID vblock,LPCSTR subblock,LPVOID *vbuffer,UINT32 *buflen)
{
BYTE *b,*block=(LPBYTE)vblock,**buffer=(LPBYTE*)vbuffer;
struct db *db;
char *s;
fprintf(stderr,"VerQueryValue32A(%p,%s,%p,%d)\n",
block,subblock,buffer,*buflen
);
s=(char*)xmalloc(strlen("VS_VERSION_INFO")+strlen(subblock)+1);
strcpy(s,"VS_VERSION_INFO");strcat(s,subblock);
b=_find_data(block,s);
if (b==NULL) {
*buflen=0;
return 0;
}
db=(struct db*)b;
*buflen = db->datalen;
/* let b point to data area */
b = b+4+((strlen(db->name)+4)&3);
*buffer = b;
fprintf(stderr," -> %s=%s\n",subblock,b);
return 1;
}
DWORD
VerQueryValue32W(LPVOID vblock,LPCWSTR subblock,LPVOID *vbuffer,UINT32 *buflen)
{
/* FIXME: hmm, we not only need to convert subblock, but also
* the content...or?
* And what about UNICODE version info?
* And the NAMES of the values?
*/
BYTE *b,**buffer=(LPBYTE*)vbuffer,*block=(LPBYTE)vblock;
struct db *db;
char *s,*sb;
sb=strdupW2A(subblock);
s=(char*)xmalloc(strlen("VS_VERSION_INFO")+strlen(sb)+1);
strcpy(s,"VS_VERSION_INFO");strcat(s,sb);
b=_find_data(block,s);
if (b==NULL) {
*buflen=0;
free(sb);
return 0;
}
db=(struct db*)b;
*buflen = db->datalen;
/* let b point to data area */
b = b+4+((strlen(db->name)+4)&3);
*buffer = b;
fprintf(stderr," -> %s=%s\n",sb,b);
free(sb);
return 1;
}
/* 20 GETFILEVERSIONINFORAW */

555
misc/wsprintf.c Normal file
View File

@ -0,0 +1,555 @@
/*
* wsprintf functions
*
* Copyright 1996 Alexandre Julliard
*/
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "windows.h"
#include "ldt.h"
#include "stackframe.h"
#define WPRINTF_LEFTALIGN 0x0001 /* Align output on the left ('-' prefix) */
#define WPRINTF_PREFIX_HEX 0x0002 /* Prefix hex with 0x ('#' prefix) */
#define WPRINTF_ZEROPAD 0x0004 /* Pad with zeros ('0' prefix) */
#define WPRINTF_LONG 0x0008 /* Long arg ('l' prefix) */
#define WPRINTF_SHORT 0x0010 /* Short arg ('h' prefix) */
#define WPRINTF_UPPER_HEX 0x0020 /* Upper-case hex ('X' specifier) */
typedef enum
{
WPR_CHAR,
WPR_WCHAR,
WPR_STRING,
WPR_WSTRING,
WPR_SIGNED,
WPR_UNSIGNED,
WPR_HEXA
} WPRINTF_TYPE;
typedef struct
{
UINT32 flags;
UINT32 width;
UINT32 precision;
WPRINTF_TYPE type;
} WPRINTF_FORMAT;
/***********************************************************************
* WPRINTF_ParseFormatA
*
* Parse a format specification. A format specification has the form:
*
* [-][#][0][width][.precision]type
*
* Return value is the length of the format specification in characters.
*/
static INT32 WPRINTF_ParseFormatA( LPCSTR format, WPRINTF_FORMAT *res )
{
LPCSTR p = format;
res->flags = 0;
res->width = 0;
res->precision = 0;
if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; }
if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; }
if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; }
while ((*p >= '0') && (*p <= '9')) /* width field */
{
res->width = res->width * 10 + *p - '0';
p++;
}
if (*p == '.') /* precision field */
{
p++;
while ((*p >= '0') && (*p <= '9'))
{
res->precision = res->precision * 10 + *p - '0';
p++;
}
}
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
switch(*p)
{
case 'c':
res->type = (res->flags & WPRINTF_LONG) ? WPR_WCHAR : WPR_CHAR;
break;
case 'C':
res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR;
break;
case 'd':
case 'i':
res->type = WPR_SIGNED;
break;
case 's':
res->type = (res->flags & WPRINTF_LONG) ? WPR_WSTRING : WPR_STRING;
break;
case 'S':
res->type = (res->flags & WPRINTF_SHORT) ? WPR_STRING : WPR_WSTRING;
break;
case 'u':
res->type = WPR_UNSIGNED;
break;
case 'X':
res->flags |= WPRINTF_UPPER_HEX;
/* fall through */
case 'x':
res->type = WPR_HEXA;
break;
default:
fprintf( stderr, "wvsprintf32A: unknown format '%c'\n", *p );
break;
}
return (INT32)(p - format) + 1;
}
/***********************************************************************
* WPRINTF_ParseFormatW
*
* Parse a format specification. A format specification has the form:
*
* [-][#][0][width][.precision]type
*
* Return value is the length of the format specification in characters.
*/
static INT32 WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res )
{
LPCWSTR p = format;
res->flags = 0;
res->width = 0;
res->precision = 0;
if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; }
if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; }
if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; }
while ((*p >= '0') && (*p <= '9')) /* width field */
{
res->width = res->width * 10 + *p - '0';
p++;
}
if (*p == '.') /* precision field */
{
p++;
while ((*p >= '0') && (*p <= '9'))
{
res->precision = res->precision * 10 + *p - '0';
p++;
}
}
if (*p == 'l') { res->flags |= WPRINTF_LONG; p++; }
else if (*p == 'h') { res->flags |= WPRINTF_SHORT; p++; }
switch((CHAR)*p)
{
case 'c':
res->type = (res->flags & WPRINTF_SHORT) ? WPR_CHAR : WPR_WCHAR;
break;
case 'C':
res->type = (res->flags & WPRINTF_LONG) ? WPR_WCHAR : WPR_CHAR;
break;
case 'd':
case 'i':
res->type = WPR_SIGNED;
break;
case 's':
res->type = (res->flags & WPRINTF_SHORT) ? WPR_STRING : WPR_WSTRING;
break;
case 'S':
res->type = (res->flags & WPRINTF_LONG) ? WPR_WSTRING : WPR_STRING;
break;
case 'u':
res->type = WPR_UNSIGNED;
break;
case 'X':
res->flags |= WPRINTF_UPPER_HEX;
/* fall through */
case 'x':
res->type = WPR_HEXA;
break;
default:
fprintf( stderr, "wvsprintf32W: unknown format '%c'\n", (CHAR)*p );
break;
}
return (INT32)(p - format) + 1;
}
/***********************************************************************
* WPRINTF_GetLen
*/
static UINT32 WPRINTF_GetLen( WPRINTF_FORMAT *format, LPCVOID arg,
LPSTR number, UINT32 maxlen )
{
UINT32 len;
if (format->flags & WPRINTF_LEFTALIGN) format->flags &= ~WPRINTF_ZEROPAD;
if (format->width > maxlen) format->width = maxlen;
switch(format->type)
{
case WPR_CHAR:
case WPR_WCHAR:
return (format->precision = 1);
case WPR_STRING:
for (len = 0; !format->precision || (len < format->precision); len++)
if (!*(*(LPCSTR *)arg + len)) break;
if (len > maxlen) len = maxlen;
return (format->precision = len);
case WPR_WSTRING:
for (len = 0; !format->precision || (len < format->precision); len++)
if (!*(*(LPCWSTR *)arg + len)) break;
if (len > maxlen) len = maxlen;
return (format->precision = len);
case WPR_SIGNED:
len = sprintf( number, "%d", *(INT32 *)arg );
break;
case WPR_UNSIGNED:
len = sprintf( number, "%u", *(UINT32 *)arg );
break;
case WPR_HEXA:
len = sprintf( number,
(format->flags & WPRINTF_UPPER_HEX) ? "%X" : "%x",
*(UINT32 *)arg );
if (format->flags & WPRINTF_PREFIX_HEX) len += 2;
break;
default:
return 0;
}
if (len > maxlen) len = maxlen;
if (format->precision < len) format->precision = len;
if (format->precision > maxlen) format->precision = maxlen;
if ((format->flags & WPRINTF_ZEROPAD) && (format->width > format->precision))
format->precision = format->width;
return len;
}
/***********************************************************************
* wvsnprintf16 (Not a Windows API)
*/
INT16 wvsnprintf16( LPSTR buffer, UINT16 maxlen, LPCSTR spec, LPCVOID args )
{
WPRINTF_FORMAT format;
LPSTR p = buffer;
UINT32 i, len;
CHAR number[20];
DWORD cur_arg;
while (*spec && (maxlen > 1))
{
if (*spec != '%') { *p++ = *spec++; maxlen--; continue; }
spec++;
if (*spec == '%') { *p++ = *spec++; maxlen--; continue; }
spec += WPRINTF_ParseFormatA( spec, &format );
switch(format.type)
{
case WPR_CHAR:
cur_arg = (DWORD)*(CHAR *)args;
args = (CHAR *)args + 1;
break;
case WPR_STRING:
cur_arg = (DWORD)PTR_SEG_TO_LIN( *(SEGPTR *)args );
args = (SEGPTR *)args + 1;
break;
case WPR_HEXA:
case WPR_SIGNED:
case WPR_UNSIGNED:
if (format.flags & WPRINTF_LONG)
{
cur_arg = (DWORD)*(UINT32 *)args;
args = (UINT32 *)args + 1;
}
else
{
cur_arg = (DWORD)*(UINT16 *)args;
args = (UINT16 *)args + 1;
}
break;
case WPR_WCHAR:
case WPR_WSTRING:
fprintf( stderr, "Unicode not supported in wsprintf16\n" );
continue;
}
len = WPRINTF_GetLen( &format, &cur_arg, number, maxlen - 1 );
if (!(format.flags & WPRINTF_LEFTALIGN))
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
switch(format.type)
{
case WPR_CHAR:
if ((*p = (CHAR)cur_arg)) p++;
else if (format.width > 1) *p++ = ' ';
else len = 0;
break;
case WPR_STRING:
if (len) memcpy( p, (LPCSTR)cur_arg, len );
p += len;
break;
case WPR_HEXA:
if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3))
{
*p++ = '0';
*p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x';
maxlen -= 2;
len -= 2;
format.precision -= 2;
format.width -= 2;
}
/* fall through */
case WPR_SIGNED:
case WPR_UNSIGNED:
for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';
if (len) memcpy( p, number, len );
p += len;
break;
case WPR_WCHAR:
case WPR_WSTRING:
fprintf( stderr, "Unicode not supported in wsprintf16\n" );
break;
}
if (format.flags & WPRINTF_LEFTALIGN)
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
maxlen -= len;
}
*p = 0;
return (maxlen > 1) ? (INT32)(p - buffer) : -1;
}
/***********************************************************************
* wvsnprintf32A (Not a Windows API)
*/
INT32 wvsnprintf32A( LPSTR buffer, UINT32 maxlen, LPCSTR spec, LPCVOID args )
{
WPRINTF_FORMAT format;
LPSTR p = buffer;
UINT32 i, len;
CHAR number[20];
while (*spec && (maxlen > 1))
{
if (*spec != '%') { *p++ = *spec++; maxlen--; continue; }
spec++;
if (*spec == '%') { *p++ = *spec++; maxlen--; continue; }
spec += WPRINTF_ParseFormatA( spec, &format );
len = WPRINTF_GetLen( &format, args, number, maxlen - 1 );
if (!(format.flags & WPRINTF_LEFTALIGN))
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
switch(format.type)
{
case WPR_WCHAR:
if ((*p = (CHAR)*(WCHAR *)args)) p++;
else if (format.width > 1) *p++ = ' ';
else len = 0;
break;
case WPR_CHAR:
if ((*p = *(CHAR *)args)) p++;
else if (format.width > 1) *p++ = ' ';
else len = 0;
break;
case WPR_STRING:
if (len) memcpy( p, *(LPCSTR *)args, len );
p += len;
break;
case WPR_WSTRING:
for (i = 0; i < len; i++) *p++ = (CHAR)*(*(LPCWSTR *)args + i);
break;
case WPR_HEXA:
if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3))
{
*p++ = '0';
*p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x';
maxlen -= 2;
len -= 2;
format.precision -= 2;
format.width -= 2;
}
/* fall through */
case WPR_SIGNED:
case WPR_UNSIGNED:
for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';
if (len) memcpy( p, number, len );
p += len;
break;
}
if (format.flags & WPRINTF_LEFTALIGN)
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
args = (INT32 *)args + 1;
maxlen -= len;
}
*p = 0;
return (maxlen > 1) ? (INT32)(p - buffer) : -1;
}
/***********************************************************************
* wvsnprintf32W (Not a Windows API)
*/
INT32 wvsnprintf32W( LPWSTR buffer, UINT32 maxlen, LPCWSTR spec, LPCVOID args )
{
WPRINTF_FORMAT format;
LPWSTR p = buffer;
UINT32 i, len;
CHAR number[20];
while (*spec && (maxlen > 1))
{
if (*spec != '%') { *p++ = *spec++; maxlen--; continue; }
spec++;
if (*spec == '%') { *p++ = *spec++; maxlen--; continue; }
spec += WPRINTF_ParseFormatW( spec, &format );
len = WPRINTF_GetLen( &format, args, number, maxlen - 1 );
if (!(format.flags & WPRINTF_LEFTALIGN))
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
switch(format.type)
{
case WPR_WCHAR:
if ((*p = *(WCHAR *)args)) p++;
else if (format.width > 1) *p++ = ' ';
else len = 0;
break;
case WPR_CHAR:
if ((*p = (WCHAR)*(CHAR *)args)) p++;
else if (format.width > 1) *p++ = ' ';
else len = 0;
break;
case WPR_STRING:
for (i = 0; i < len; i++) *p++ = (WCHAR)*(*(LPCSTR *)args + i);
break;
case WPR_WSTRING:
if (len) memcpy( p, *(LPCWSTR *)args, len * sizeof(WCHAR) );
p += len;
break;
case WPR_HEXA:
if ((format.flags & WPRINTF_PREFIX_HEX) && (maxlen > 3))
{
*p++ = '0';
*p++ = (format.flags & WPRINTF_UPPER_HEX) ? 'X' : 'x';
maxlen -= 2;
len -= 2;
format.precision -= 2;
format.width -= 2;
}
/* fall through */
case WPR_SIGNED:
case WPR_UNSIGNED:
for (i = len; i < format.precision; i++, maxlen--) *p++ = '0';
for (i = 0; i < len; i++) *p++ = (WCHAR)number[i];
break;
}
if (format.flags & WPRINTF_LEFTALIGN)
for (i = format.precision; i < format.width; i++, maxlen--)
*p++ = ' ';
args = (INT32 *)args + 1;
maxlen -= len;
}
*p = 0;
return (maxlen > 1) ? (INT32)(p - buffer) : -1;
}
/***********************************************************************
* wvsprintf16 (USER.421)
*/
INT16 wvsprintf16( LPSTR buffer, LPCSTR spec, LPCVOID args )
{
return wvsnprintf16( buffer, 0xffff, spec, args );
}
/***********************************************************************
* wvsprintf32A (USER32.586)
*/
INT32 wvsprintf32A( LPSTR buffer, LPCSTR spec, LPCVOID args )
{
return wvsnprintf32A( buffer, 0xffffffff, spec, args );
}
/***********************************************************************
* wvsprintf32W (USER32.587)
*/
INT32 wvsprintf32W( LPWSTR buffer, LPCWSTR spec, LPCVOID args )
{
return wvsnprintf32W( buffer, 0xffffffff, spec, args );
}
/***********************************************************************
* wsprintf16 (USER.420)
*/
/* Winelib version */
INT16 wsprintf16( LPSTR buffer, LPCSTR spec, ... )
{
va_list valist;
INT16 res;
va_start( valist, spec );
/* Note: we call the 32-bit version, because the args are 32-bit */
res = (INT16)wvsprintf32A( buffer, spec, (LPCVOID)valist );
va_end( valist );
return res;
}
/* Emulator version */
#ifndef WINELIB
INT16 WIN16_wsprintf16(void)
{
SEGPTR *win_stack = (DWORD *)CURRENT_STACK16->args;
LPSTR buffer = (LPSTR)PTR_SEG_TO_LIN(win_stack[0]);
LPCSTR spec = (LPCSTR)PTR_SEG_TO_LIN(win_stack[1]);
return wvsprintf16( buffer, spec, &win_stack[2] );
}
#endif /* WINELIB */
/***********************************************************************
* wsprintf32A (USER32.584)
*/
/* Winelib version */
INT32 wsprintf32A( LPSTR buffer, LPCSTR spec, ... )
{
va_list valist;
INT32 res;
va_start( valist, spec );
res = wvsprintf32A( buffer, spec, (LPCVOID)valist );
va_end( valist );
return res;
}
/* Emulator version */
INT32 WIN32_wsprintf32A( int *args )
{
return wvsprintf32A( (LPSTR)args[0], (LPCSTR)args[1], (LPCVOID)&args[2] );
}
/***********************************************************************
* wsprintf32W (USER32.585)
*/
/* Winelib version */
INT32 wsprintf32W( LPWSTR buffer, LPCWSTR spec, ... )
{
va_list valist;
INT32 res;
va_start( valist, spec );
res = wvsprintf32W( buffer, spec, (LPCVOID)valist );
va_end( valist );
return res;
}
/* Emulator version */
INT32 WIN32_wsprintf32W( int *args )
{
return wvsprintf32W( (LPWSTR)args[0], (LPCWSTR)args[1], (LPCVOID)&args[2]);
}

View File

@ -24,7 +24,7 @@ int runtime_cpu (void)
{
char info[5], value[5];
while (fscanf (f, " %4s%*s : %4s%*s", info, value) == 2)
if (!lstrcmpi (info, "cpu"))
if (!lstrcmpi32A(info, "cpu"))
{
if (isdigit (value[0]) && value[1] == '8'
&& value[2] == '6' && value[3] == 0)

View File

@ -631,7 +631,7 @@ static int INT21_GetCurrentDirectory(struct sigcontext_struct *context)
return 0;
}
lstrcpyn( ptr, DRIVE_GetDosCwd(drive), 64 );
lstrcpyn32A( ptr, DRIVE_GetDosCwd(drive), 64 );
if (!ptr[0]) strcpy( ptr, "\\" );
return 1;
}
@ -1358,8 +1358,10 @@ void DOS3Call( struct sigcontext_struct context )
break;
case 0x4b: /* "EXEC" - LOAD AND/OR EXECUTE PROGRAM */
WinExec( PTR_SEG_OFF_TO_LIN( DS_reg(&context), DX_reg(&context) ),
SW_NORMAL );
AX_reg(&context) = WinExec( PTR_SEG_OFF_TO_LIN( DS_reg(&context),
DX_reg(&context) ),
SW_NORMAL );
if (AX_reg(&context) < 32) SET_CFLAG(&context);
break;
case 0x4c: /* "EXIT" - TERMINATE WITH RETURN CODE */
@ -1507,8 +1509,9 @@ void DOS3Call( struct sigcontext_struct context )
}
else
{
lstrcpyn(PTR_SEG_OFF_TO_LIN(ES_reg(&context),DI_reg(&context)),
truename, 128 );
lstrcpyn32A( PTR_SEG_OFF_TO_LIN( ES_reg(&context),
DI_reg(&context) ),
truename, 128 );
AX_reg(&context) = 0;
}
}
@ -1519,6 +1522,7 @@ void DOS3Call( struct sigcontext_struct context )
case 0x64: /* OS/2 DOS BOX */
case 0x65: /* GET EXTENDED COUNTRY INFORMATION */
INT_BARF( &context, 0x21 );
SET_CFLAG(&context);
break;
case 0x66: /* GLOBAL CODE PAGE TABLE */

View File

@ -52,7 +52,7 @@ LONG ANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
/* The reason why I just don't lowercase the keywords array in
* mciSendString is left as an exercise to the reader.
*/
#define STRCMP(x,y) lstrcmpi(x,y)
#define STRCMP(x,y) lstrcmpi32A(x,y)
/* standard functionparameters for all functions */
#define _MCISTR_PROTO_ \
@ -65,7 +65,7 @@ LONG ANIM_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
#define _MCI_STR(s) do {\
dprintf_mci(stddeb,"->returns \"%s\"",s);\
if (lpstrReturnString) {\
lstrcpyn(lpstrReturnString,s,uReturnLength);\
lstrcpyn32A(lpstrReturnString,s,uReturnLength);\
dprintf_mci(stddeb,"-->\"%s\"\n",lpstrReturnString);\
}\
} while(0)

View File

@ -526,7 +526,7 @@ msg# 543 : tmsf
msgptr = "Unknown MCI Error !\n";
break;
}
lstrcpyn(lpstrBuffer, msgptr, uLength);
lstrcpyn32A(lpstrBuffer, msgptr, uLength);
return TRUE;
}
@ -701,7 +701,7 @@ DWORD mciSysInfo(DWORD dwFlags, LPMCI_SYSINFO_PARMS lpParms)
}
}
if (lpParms->dwRetSize < InstalledListLen)
lstrcpyn(lpstrReturn, lpInstallNames, lpParms->dwRetSize - 1);
lstrcpyn32A(lpstrReturn, lpInstallNames, lpParms->dwRetSize - 1);
else
strcpy(lpstrReturn, lpInstallNames);
return 0;
@ -888,7 +888,7 @@ msg# 343 : There are no MIDI devices installed on the system. Use the Drivers op
msgptr = "Unknown MIDI Error !\n";
break;
}
lstrcpyn(lpText, msgptr, uSize);
lstrcpyn32A(lpText, msgptr, uSize);
return TRUE;
}
@ -1341,7 +1341,7 @@ UINT waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize)
msgptr = "Unknown MMSYSTEM Error !\n";
break;
}
lstrcpyn(lpText, msgptr, uSize);
lstrcpyn32A(lpText, msgptr, uSize);
return TRUE;
}

View File

@ -3,6 +3,7 @@
*
* Copyright 1993 Alexandre Julliard
*/
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
@ -12,8 +13,6 @@
#include "dc.h"
#include "bitmap.h"
#include "stddebug.h"
/* #define DEBUG_GDI */
/* #define DEBUG_BITMAP */
#include "debug.h"
/* GCs used for B&W and color bitmap operations */
@ -55,7 +54,7 @@ BOOL BITMAP_Init(void)
*
* Create an XImage pointing to the bitmap data.
*/
static XImage *BITMAP_BmpToImage( BITMAP * bmp, void * bmpData )
static XImage *BITMAP_BmpToImage( BITMAP16 * bmp, LPVOID bmpData )
{
extern void _XInitImageFuncPtrs( XImage* );
XImage * image;
@ -73,12 +72,13 @@ static XImage *BITMAP_BmpToImage( BITMAP * bmp, void * bmpData )
/***********************************************************************
* CreateBitmap (GDI.48)
* CreateBitmap (GDI.48) (GDI32.25)
*/
HBITMAP CreateBitmap( INT width, INT height, UINT planes, UINT bpp, LPVOID bits )
HBITMAP16 CreateBitmap( INT32 width, INT32 height, UINT32 planes,
UINT32 bpp, LPCVOID bits )
{
BITMAPOBJ * bmpObjPtr;
HBITMAP hbitmap;
HBITMAP16 hbitmap;
dprintf_gdi( stddeb, "CreateBitmap: %dx%d, %d colors\n",
width, height, 1 << (planes*bpp) );
@ -97,11 +97,11 @@ HBITMAP CreateBitmap( INT width, INT height, UINT planes, UINT bpp, LPVOID bits
bmpObjPtr->size.cx = 0;
bmpObjPtr->size.cy = 0;
bmpObjPtr->bitmap.bmType = 0;
bmpObjPtr->bitmap.bmWidth = width;
bmpObjPtr->bitmap.bmHeight = height;
bmpObjPtr->bitmap.bmPlanes = planes;
bmpObjPtr->bitmap.bmBitsPixel = bpp;
bmpObjPtr->bitmap.bmWidthBytes = BITMAP_WIDTH_BYTES( width, bpp );
bmpObjPtr->bitmap.bmWidth = (INT16)width;
bmpObjPtr->bitmap.bmHeight = (INT16)height;
bmpObjPtr->bitmap.bmPlanes = (BYTE)planes;
bmpObjPtr->bitmap.bmBitsPixel = (BYTE)bpp;
bmpObjPtr->bitmap.bmWidthBytes = (INT16)BITMAP_WIDTH_BYTES( width, bpp );
bmpObjPtr->bitmap.bmBits = NULL;
/* Create the pixmap */
@ -118,28 +118,27 @@ HBITMAP CreateBitmap( INT width, INT height, UINT planes, UINT bpp, LPVOID bits
/***********************************************************************
* CreateCompatibleBitmap (GDI.51)
* CreateCompatibleBitmap (GDI.51) (GDI32.30)
*/
HBITMAP CreateCompatibleBitmap( HDC hdc, INT width, INT height )
HBITMAP16 CreateCompatibleBitmap( HDC32 hdc, INT32 width, INT32 height )
{
HBITMAP hbmpRet = 0;
DC * dc;
dprintf_gdi(stddeb, "CreateCompatibleBitmap(%04x,%d,%d) = \n",
hdc, width, height );
HBITMAP hbmpRet = 0;
DC *dc;
dprintf_gdi( stddeb, "CreateCompatibleBitmap(%04x,%d,%d) = \n",
hdc, width, height );
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
dprintf_gdi(stddeb,"\t\t%04x\n", hbmpRet);
return hbmpRet;
}
/***********************************************************************
* CreateBitmapIndirect (GDI.49)
* CreateBitmapIndirect16 (GDI.49)
*/
HBITMAP CreateBitmapIndirect( const BITMAP * bmp )
HBITMAP16 CreateBitmapIndirect16( const BITMAP16 * bmp )
{
return CreateBitmap( bmp->bmWidth, bmp->bmHeight, bmp->bmPlanes,
bmp->bmBitsPixel, PTR_SEG_TO_LIN( bmp->bmBits ) );
@ -147,9 +146,19 @@ HBITMAP CreateBitmapIndirect( const BITMAP * bmp )
/***********************************************************************
* GetBitmapBits (GDI.74)
* CreateBitmapIndirect32 (GDI32.26)
*/
LONG GetBitmapBits( HBITMAP hbitmap, LONG count, LPSTR buffer )
HBITMAP32 CreateBitmapIndirect32( const BITMAP32 * bmp )
{
return CreateBitmap( bmp->bmWidth, bmp->bmHeight, bmp->bmPlanes,
bmp->bmBitsPixel, bmp->bmBits );
}
/***********************************************************************
* GetBitmapBits (GDI.74) (GDI32.143)
*/
LONG GetBitmapBits( HBITMAP32 hbitmap, LONG count, LPVOID buffer )
{
BITMAPOBJ * bmp;
LONG height;
@ -182,9 +191,9 @@ LONG GetBitmapBits( HBITMAP hbitmap, LONG count, LPSTR buffer )
/***********************************************************************
* SetBitmapBits (GDI.106)
* SetBitmapBits (GDI.106) (GDI32.303)
*/
LONG SetBitmapBits( HBITMAP hbitmap, LONG count, LPSTR buffer )
LONG SetBitmapBits( HBITMAP32 hbitmap, LONG count, LPCVOID buffer )
{
BITMAPOBJ * bmp;
LONG height;
@ -207,7 +216,7 @@ LONG SetBitmapBits( HBITMAP hbitmap, LONG count, LPSTR buffer )
if (height > bmp->bitmap.bmHeight) height = bmp->bitmap.bmHeight;
if (!height) return 0;
if (!(image = BITMAP_BmpToImage( &bmp->bitmap, buffer ))) return 0;
if (!(image = BITMAP_BmpToImage( &bmp->bitmap, (LPVOID)buffer ))) return 0;
CallTo32_LargeStack( XPutImage, 10,
display, bmp->pixmap, BITMAP_GC(bmp), image, 0, 0,
0, 0, bmp->bitmap.bmWidth, height );
@ -271,16 +280,35 @@ BOOL BITMAP_DeleteObject( HBITMAP hbitmap, BITMAPOBJ * bitmap )
/***********************************************************************
* BITMAP_GetObject
* BITMAP_GetObject16
*/
int BITMAP_GetObject( BITMAPOBJ * bmp, int count, LPSTR buffer )
INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer )
{
if (count > sizeof(BITMAP)) count = sizeof(BITMAP);
if (count > sizeof(bmp->bitmap)) count = sizeof(bmp->bitmap);
memcpy( buffer, &bmp->bitmap, count );
return count;
}
/***********************************************************************
* BITMAP_GetObject32
*/
INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer )
{
BITMAP32 bmp32;
bmp32.bmType = bmp->bitmap.bmType;
bmp32.bmWidth = bmp->bitmap.bmWidth;
bmp32.bmHeight = bmp->bitmap.bmHeight;
bmp32.bmWidthBytes = bmp->bitmap.bmWidthBytes;
bmp32.bmPlanes = bmp->bitmap.bmPlanes;
bmp32.bmBitsPixel = bmp->bitmap.bmBitsPixel;
bmp32.bmBits = NULL;
if (count > sizeof(bmp32)) count = sizeof(bmp32);
memcpy( buffer, &bmp32, count );
return count;
}
/***********************************************************************
* BITMAP_SelectObject
*/
@ -313,9 +341,9 @@ HBITMAP BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
}
/***********************************************************************
* CreateDiscardableBitmap (GDI.156)
* CreateDiscardableBitmap (GDI.156) (GDI32.38)
*/
HBITMAP CreateDiscardableBitmap(HDC hdc, INT width, INT height)
HBITMAP16 CreateDiscardableBitmap( HDC32 hdc, INT32 width, INT32 height )
{
dprintf_bitmap(stddeb,"CreateDiscardableBitmap(%04x, %d, %d); "
"// call CreateCompatibleBitmap() for now!\n",
@ -337,7 +365,7 @@ BOOL16 GetBitmapDimensionEx16( HBITMAP16 hbitmap, LPSIZE16 size )
/***********************************************************************
* GetBitmapDimensionEx32 (GDI.468)
* GetBitmapDimensionEx32 (GDI32.144)
*/
BOOL32 GetBitmapDimensionEx32( HBITMAP32 hbitmap, LPSIZE32 size )
{
@ -376,7 +404,7 @@ BOOL16 SetBitmapDimensionEx16( HBITMAP16 hbitmap, INT16 x, INT16 y,
/***********************************************************************
* SetBitmapDimensionEx32 (GDI.478)
* SetBitmapDimensionEx32 (GDI32.304)
*/
BOOL32 SetBitmapDimensionEx32( HBITMAP32 hbitmap, INT32 x, INT32 y,
LPSIZE32 prevSize )

View File

@ -141,13 +141,13 @@ Pixmap BRUSH_DitherColor( DC *dc, COLORREF color )
/***********************************************************************
* CreateBrushIndirect (GDI.50)
*/
HBRUSH CreateBrushIndirect( const LOGBRUSH * brush )
HBRUSH CreateBrushIndirect( const LOGBRUSH16 * brush )
{
BRUSHOBJ * brushPtr;
HBRUSH hbrush = GDI_AllocObject( sizeof(BRUSHOBJ), BRUSH_MAGIC );
if (!hbrush) return 0;
brushPtr = (BRUSHOBJ *) GDI_HEAP_LIN_ADDR( hbrush );
memcpy( &brushPtr->logbrush, brush, sizeof(LOGBRUSH) );
memcpy( &brushPtr->logbrush, brush, sizeof(*brush) );
return hbrush;
}
@ -157,7 +157,7 @@ HBRUSH CreateBrushIndirect( const LOGBRUSH * brush )
*/
HBRUSH CreateHatchBrush( INT style, COLORREF color )
{
LOGBRUSH logbrush = { BS_HATCHED, color, style };
LOGBRUSH16 logbrush = { BS_HATCHED, color, style };
dprintf_gdi(stddeb, "CreateHatchBrush: %d %06lx\n", style, color );
if ((style < 0) || (style >= NB_HATCH_STYLES)) return 0;
return CreateBrushIndirect( &logbrush );
@ -169,7 +169,7 @@ HBRUSH CreateHatchBrush( INT style, COLORREF color )
*/
HBRUSH CreatePatternBrush( HBITMAP hbitmap )
{
LOGBRUSH logbrush = { BS_PATTERN, 0, 0 };
LOGBRUSH16 logbrush = { BS_PATTERN, 0, 0 };
BITMAPOBJ *bmp, *newbmp;
dprintf_gdi(stddeb, "CreatePatternBrush: %04x\n", hbitmap );
@ -178,7 +178,7 @@ HBRUSH CreatePatternBrush( HBITMAP hbitmap )
if (!(bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
return 0;
logbrush.lbHatch = (INT)CreateBitmapIndirect( &bmp->bitmap );
logbrush.lbHatch = (INT16)CreateBitmapIndirect16( &bmp->bitmap );
newbmp = (BITMAPOBJ *) GDI_GetObjPtr( (HANDLE)logbrush.lbHatch, BITMAP_MAGIC );
if (!newbmp) return 0;
XCopyArea( display, bmp->pixmap, newbmp->pixmap, BITMAP_GC(bmp),
@ -192,7 +192,7 @@ HBRUSH CreatePatternBrush( HBITMAP hbitmap )
*/
HBRUSH CreateDIBPatternBrush( HGLOBAL hbitmap, UINT coloruse )
{
LOGBRUSH logbrush = { BS_DIBPATTERN, coloruse, 0 };
LOGBRUSH16 logbrush = { BS_DIBPATTERN, coloruse, 0 };
BITMAPINFO *info, *newInfo;
int size;
@ -202,8 +202,9 @@ HBRUSH CreateDIBPatternBrush( HGLOBAL hbitmap, UINT coloruse )
if (!(info = (BITMAPINFO *) GlobalLock16( hbitmap ))) return 0;
size = info->bmiHeader.biSizeImage;
if (!size)
if (info->bmiHeader.biCompression)
size = info->bmiHeader.biSizeImage;
else
size = (info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) / 32
* 8 * info->bmiHeader.biHeight;
size += DIB_BitmapInfoSize( info, coloruse );
@ -226,7 +227,7 @@ HBRUSH CreateDIBPatternBrush( HGLOBAL hbitmap, UINT coloruse )
*/
HBRUSH CreateSolidBrush( COLORREF color )
{
LOGBRUSH logbrush = { BS_SOLID, color, 0 };
LOGBRUSH16 logbrush = { BS_SOLID, color, 0 };
dprintf_gdi(stddeb, "CreateSolidBrush: %06lx\n", color );
return CreateBrushIndirect( &logbrush );
}
@ -277,7 +278,7 @@ BOOL BRUSH_DeleteObject( HBRUSH hbrush, BRUSHOBJ * brush )
*/
int BRUSH_GetObject( BRUSHOBJ * brush, int count, LPSTR buffer )
{
if (count > sizeof(LOGBRUSH)) count = sizeof(LOGBRUSH);
if (count > sizeof(brush->logbrush)) count = sizeof(brush->logbrush);
memcpy( buffer, &brush->logbrush, count );
return count;
}

View File

@ -5,12 +5,15 @@
*/
#include <stdio.h>
#include "region.h"
#include "dc.h"
#include "metafile.h"
#include "region.h"
#include "stddebug.h"
/* #define DEBUG_CLIPPING */
#include "debug.h"
#define UpdateDirtyDC(dc) DC_CallHookProc( dc, DCHC_INVALIDVISRGN, 0 )
/***********************************************************************
* CLIPPING_SetDeviceClipping
*

View File

@ -32,7 +32,7 @@ static int COLOR_Graymax = 0;
#define NB_RESERVED_COLORS 20
/* The first and last eight colors are EGA colors */
static PALETTEENTRY COLOR_sysPaletteEntries[NB_RESERVED_COLORS] =
static const PALETTEENTRY COLOR_sysPaletteEntries[NB_RESERVED_COLORS] =
{
/* red green blue flags */
{ 0x00, 0x00, 0x00, 0 },
@ -271,7 +271,7 @@ HPALETTE16 COLOR_Init(void)
BOOL COLOR_IsSolid( COLORREF color )
{
int i;
PALETTEENTRY *pEntry = COLOR_sysPaletteEntries;
const PALETTEENTRY *pEntry = COLOR_sysPaletteEntries;
if (color & 0xff000000) return TRUE;
if (!color || (color == 0xffffff)) return TRUE;

View File

@ -24,7 +24,7 @@
#define FONTCACHE 32 /* dynamic font cache size */
#define MAX_FONTS 256
static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL };
static LPLOGFONT16 lpLogFontList[MAX_FONTS];
static int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz);
@ -146,7 +146,7 @@ static const char *FONT_TranslateName( char *winFaceName )
*
* Find a X font matching the logical font.
*/
static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
static XFontStruct * FONT_MatchFont( LOGFONT16 * font, DC * dc )
{
char pattern[100];
const char *family, *weight, *charset;
@ -276,8 +276,8 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
/***********************************************************************
* FONT_GetMetrics
*/
void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
TEXTMETRIC * metrics )
void FONT_GetMetrics( LOGFONT16 * logfont, XFontStruct * xfont,
TEXTMETRIC16 * metrics )
{
int average, i, count;
unsigned long prop;
@ -357,7 +357,7 @@ BOOL CreateScalableFontResource( UINT fHidden,LPSTR lpszResourceFile,
/***********************************************************************
* CreateFontIndirect (GDI.57)
*/
HFONT CreateFontIndirect( const LOGFONT * font )
HFONT CreateFontIndirect( const LOGFONT16 * font )
{
FONTOBJ * fontPtr;
HFONT hfont;
@ -370,7 +370,7 @@ HFONT CreateFontIndirect( const LOGFONT * font )
hfont = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC );
if (!hfont) return 0;
fontPtr = (FONTOBJ *) GDI_HEAP_LIN_ADDR( hfont );
memcpy( &fontPtr->logfont, font, sizeof(LOGFONT) );
memcpy( &fontPtr->logfont, font, sizeof(LOGFONT16) );
AnsiLower( fontPtr->logfont.lfFaceName );
dprintf_font(stddeb,"CreateFontIndirect(%p (%d,%d)); return %04x\n",
font, font->lfHeight, font->lfWidth, hfont);
@ -386,8 +386,8 @@ HFONT CreateFont( INT height, INT width, INT esc, INT orient, INT weight,
BYTE outpres, BYTE clippres, BYTE quality, BYTE pitch,
LPCSTR name )
{
LOGFONT logfont = { height, width, esc, orient, weight, italic, underline,
strikeout, charset, outpres, clippres, quality, pitch, };
LOGFONT16 logfont = {height, width, esc, orient, weight, italic, underline,
strikeout, charset, outpres, clippres, quality, pitch, };
dprintf_font(stddeb,"CreateFont(%d,%d)\n", height, width);
if (name)
{
@ -404,7 +404,7 @@ HFONT CreateFont( INT height, INT width, INT esc, INT orient, INT weight,
*/
int FONT_GetObject( FONTOBJ * font, int count, LPSTR buffer )
{
if (count > sizeof(LOGFONT)) count = sizeof(LOGFONT);
if (count > sizeof(LOGFONT16)) count = sizeof(LOGFONT16);
memcpy( buffer, &font->logfont, count );
return count;
}
@ -419,7 +419,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
static struct {
HFONT id;
LOGFONT logfont;
LOGFONT16 logfont;
int access;
int used;
X_PHYSFONT cacheFont; } cacheFonts[FONTCACHE], *cacheFontsMin;
@ -462,7 +462,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
/*
* Check if Handle matches the font
*/
if(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT))) {
if(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT16))) {
/* No: remove handle id from dynamic font cache */
cacheFonts[i].access=0;
cacheFonts[i].used=0;
@ -470,7 +470,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
/* may be there is an unused handle which contains the font */
for(i=0; i<FONTCACHE; i++) {
if((cacheFonts[i].used == 0) &&
(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT)))== 0) {
(memcmp(&cacheFonts[i].logfont,&(font->logfont), sizeof(LOGFONT16)))== 0) {
/* got it load from cache and set new handle id */
stockPtr = &cacheFonts[i].cacheFont;
cacheFonts[i].access=1;
@ -564,7 +564,7 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
cacheFontsMin->used=1;
cacheFontsMin->id=hfont;
memcpy( &dc->u.x.font, &(cacheFontsMin->cacheFont), sizeof(cacheFontsMin->cacheFont) );
memcpy(&cacheFontsMin->logfont,&(font->logfont), sizeof(LOGFONT));
memcpy(&cacheFontsMin->logfont,&(font->logfont), sizeof(LOGFONT16));
}
return prevHandle;
@ -635,7 +635,7 @@ INT GetTextFace( HDC hdc, INT count, LPSTR name )
if (!dc) return 0;
if (!(font = (FONTOBJ *) GDI_GetObjPtr( dc->w.hFont, FONT_MAGIC )))
return 0;
lstrcpyn( name, font->logfont.lfFaceName, count );
lstrcpyn32A( name, font->logfont.lfFaceName, count );
return strlen(name);
}
@ -703,7 +703,7 @@ BOOL32 GetTextExtentPoint32W( HDC32 hdc, LPCWSTR str, INT32 count,
/***********************************************************************
* GetTextMetrics (GDI.93)
*/
BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC metrics )
BOOL GetTextMetrics( HDC hdc, LPTEXTMETRIC16 metrics )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
@ -783,7 +783,7 @@ DWORD SetMapperFlags(HDC hDC, DWORD dwFlag)
/***********************************************************************
* GetCharABCWidths (GDI.307)
*/
BOOL GetCharABCWidths(HDC hdc, UINT wFirstChar, UINT wLastChar, LPABC lpABC)
BOOL GetCharABCWidths(HDC hdc, UINT wFirstChar, UINT wLastChar, LPABC16 lpABC)
{
/* No TrueType fonts in Wine so far */
@ -881,7 +881,8 @@ int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz)
static int logfcmp(const void *a,const void *b)
{
return strcmp( (*(LPLOGFONT *)a)->lfFaceName, (*(LPLOGFONT *)b)->lfFaceName );
return strcmp( (*(LPLOGFONT16 *)a)->lfFaceName,
(*(LPLOGFONT16 *)b)->lfFaceName );
}
void InitFontsList(void)
@ -892,7 +893,7 @@ void InitFontsList(void)
char **names;
char slant, spacing;
int i, count;
LPLOGFONT lpNewFont;
LPLOGFONT16 lpNewFont;
weight = "medium";
slant = 'r';
spacing = '*';
@ -904,7 +905,7 @@ void InitFontsList(void)
names = XListFonts( display, pattern, MAX_FONTS, &count );
dprintf_font(stddeb,"InitFontsList // count=%d \n", count);
for (i = 0; i < count; i++) {
lpNewFont = malloc(sizeof(LOGFONT) + LF_FACESIZE);
lpNewFont = malloc(sizeof(LOGFONT16) + LF_FACESIZE);
if (lpNewFont == NULL) {
dprintf_font(stddeb, "InitFontsList // Error alloc new font structure !\n");
break;
@ -969,8 +970,8 @@ INT EnumFonts(HDC hDC, LPCSTR lpFaceName, FONTENUMPROC lpEnumFunc, LPARAM lpData
HANDLE hMet;
HFONT hFont;
HFONT hOldFont;
LPLOGFONT lpLogFont;
LPTEXTMETRIC lptm;
LPLOGFONT16 lpLogFont;
LPTEXTMETRIC16 lptm;
LPSTR lpOldName;
char FaceName[LF_FACESIZE];
int nRet = 0;
@ -979,14 +980,14 @@ INT EnumFonts(HDC hDC, LPCSTR lpFaceName, FONTENUMPROC lpEnumFunc, LPARAM lpData
dprintf_font(stddeb,"EnumFonts(%04x, %p='%s', %08lx, %08lx)\n",
hDC, lpFaceName, lpFaceName, (LONG)lpEnumFunc, lpData);
if (lpEnumFunc == 0) return 0;
hLog = GDI_HEAP_ALLOC( sizeof(LOGFONT) + LF_FACESIZE );
lpLogFont = (LPLOGFONT) GDI_HEAP_LIN_ADDR(hLog);
hLog = GDI_HEAP_ALLOC( sizeof(LOGFONT16) + LF_FACESIZE );
lpLogFont = (LPLOGFONT16) GDI_HEAP_LIN_ADDR(hLog);
if (lpLogFont == NULL) {
fprintf(stderr,"EnumFonts // can't alloc LOGFONT struct !\n");
return 0;
}
hMet = GDI_HEAP_ALLOC( sizeof(TEXTMETRIC) );
lptm = (LPTEXTMETRIC) GDI_HEAP_LIN_ADDR(hMet);
hMet = GDI_HEAP_ALLOC( sizeof(TEXTMETRIC16) );
lptm = (LPTEXTMETRIC16) GDI_HEAP_LIN_ADDR(hMet);
if (lptm == NULL) {
GDI_HEAP_FREE(hLog);
fprintf(stderr, "EnumFonts // can't alloc TEXTMETRIC struct !\n");
@ -1010,7 +1011,7 @@ INT EnumFonts(HDC hDC, LPCSTR lpFaceName, FONTENUMPROC lpEnumFunc, LPARAM lpData
}
dprintf_font(stddeb,"EnumFonts // enum '%s' !\n", lpLogFontList[i]->lfFaceName);
dprintf_font(stddeb,"EnumFonts // %p !\n", lpLogFontList[i]);
memcpy(lpLogFont, lpLogFontList[i], sizeof(LOGFONT) + LF_FACESIZE);
memcpy(lpLogFont, lpLogFontList[i], sizeof(LOGFONT16) + LF_FACESIZE);
hFont = CreateFontIndirect(lpLogFont);
hOldFont = SelectObject(hDC, hFont);
GetTextMetrics(hDC, lptm);
@ -1039,8 +1040,8 @@ INT EnumFontFamilies(HDC hDC, LPCSTR lpszFamily, FONTENUMPROC lpEnumFunc, LPARAM
HANDLE hMet;
HFONT hFont;
HFONT hOldFont;
LPENUMLOGFONT lpEnumLogFont;
LPTEXTMETRIC lptm;
LPENUMLOGFONT16 lpEnumLogFont;
LPTEXTMETRIC16 lptm;
LPSTR lpOldName;
char FaceName[LF_FACESIZE];
int nRet = 0;
@ -1049,14 +1050,14 @@ INT EnumFontFamilies(HDC hDC, LPCSTR lpszFamily, FONTENUMPROC lpEnumFunc, LPARAM
dprintf_font(stddeb,"EnumFontFamilies(%04x, %p, %08lx, %08lx)\n",
hDC, lpszFamily, (DWORD)lpEnumFunc, lpData);
if (lpEnumFunc == 0) return 0;
hLog = GDI_HEAP_ALLOC( sizeof(ENUMLOGFONT) );
lpEnumLogFont = (LPENUMLOGFONT) GDI_HEAP_LIN_ADDR(hLog);
hLog = GDI_HEAP_ALLOC( sizeof(ENUMLOGFONT16) );
lpEnumLogFont = (LPENUMLOGFONT16) GDI_HEAP_LIN_ADDR(hLog);
if (lpEnumLogFont == NULL) {
fprintf(stderr,"EnumFontFamilies // can't alloc LOGFONT struct !\n");
return 0;
}
hMet = GDI_HEAP_ALLOC( sizeof(TEXTMETRIC) );
lptm = (LPTEXTMETRIC) GDI_HEAP_LIN_ADDR(hMet);
hMet = GDI_HEAP_ALLOC( sizeof(TEXTMETRIC16) );
lptm = (LPTEXTMETRIC16) GDI_HEAP_LIN_ADDR(hMet);
if (lptm == NULL) {
GDI_HEAP_FREE(hLog);
fprintf(stderr,"EnumFontFamilies // can't alloc TEXTMETRIC struct !\n");
@ -1077,10 +1078,10 @@ INT EnumFontFamilies(HDC hDC, LPCSTR lpszFamily, FONTENUMPROC lpEnumFunc, LPARAM
} else {
if (strcmp(FaceName, lpLogFontList[i]->lfFaceName) != 0) continue;
}
memcpy(lpEnumLogFont, lpLogFontList[i], sizeof(LOGFONT));
memcpy(lpEnumLogFont, lpLogFontList[i], sizeof(LOGFONT16));
strcpy(lpEnumLogFont->elfFullName,"");
strcpy(lpEnumLogFont->elfStyle,"");
hFont = CreateFontIndirect((LPLOGFONT)lpEnumLogFont);
hFont = CreateFontIndirect((LPLOGFONT16)lpEnumLogFont);
hOldFont = SelectObject(hDC, hFont);
GetTextMetrics(hDC, lptm);
SelectObject(hDC, hOldFont);
@ -1119,7 +1120,7 @@ BOOL GetRasterizerCaps(LPRASTERIZER_STATUS lprs, UINT cbNumBytes)
/*************************************************************************
* GetKerningPairs [GDI.332]
*/
int GetKerningPairs(HDC hDC,int cBufLen,LPKERNINGPAIR lpKerningPairs)
int GetKerningPairs(HDC hDC,int cBufLen,LPKERNINGPAIR16 lpKerningPairs)
{
/* Wine fonts are ugly and don't support kerning :) */
return 0;

View File

@ -299,12 +299,12 @@ HANDLE GetStockObject( int obj )
/***********************************************************************
* GetObject (GDI.82)
* GetObject16 (GDI.82)
*/
int GetObject( HANDLE handle, int count, LPSTR buffer )
INT16 GetObject16( HANDLE16 handle, INT16 count, LPVOID buffer )
{
GDIOBJHDR * ptr = NULL;
dprintf_gdi(stddeb, "GetObject: %04x %d %p\n", handle, count, buffer );
dprintf_gdi(stddeb, "GetObject16: %04x %d %p\n", handle, count, buffer );
if (!count) return 0;
if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
@ -320,7 +320,7 @@ int GetObject( HANDLE handle, int count, LPSTR buffer )
case BRUSH_MAGIC:
return BRUSH_GetObject( (BRUSHOBJ *)ptr, count, buffer );
case BITMAP_MAGIC:
return BITMAP_GetObject( (BITMAPOBJ *)ptr, count, buffer );
return BITMAP_GetObject16( (BITMAPOBJ *)ptr, count, buffer );
case FONT_MAGIC:
return FONT_GetObject( (FONTOBJ *)ptr, count, buffer );
case PALETTE_MAGIC:
@ -330,6 +330,46 @@ int GetObject( HANDLE handle, int count, LPSTR buffer )
}
/***********************************************************************
* GetObject32A (GDI32.204)
*/
INT32 GetObject32A( HANDLE32 handle, INT32 count, LPVOID buffer )
{
GDIOBJHDR * ptr = NULL;
dprintf_gdi(stddeb, "GetObject32A: %08x %d %p\n", handle, count, buffer );
if (!count) return 0;
if ((handle >= FIRST_STOCK_HANDLE) && (handle <= LAST_STOCK_HANDLE))
ptr = StockObjects[handle - FIRST_STOCK_HANDLE];
else
ptr = (GDIOBJHDR *) GDI_HEAP_LIN_ADDR( handle );
if (!ptr) return 0;
switch(ptr->wMagic)
{
case BITMAP_MAGIC:
return BITMAP_GetObject32( (BITMAPOBJ *)ptr, count, buffer );
case PEN_MAGIC:
case BRUSH_MAGIC:
case FONT_MAGIC:
case PALETTE_MAGIC:
fprintf( stderr, "GetObject32: magic %04x not implemented\n",
ptr->wMagic );
break;
}
return 0;
}
/***********************************************************************
* GetObject32W (GDI32.206)
*/
INT32 GetObject32W( HANDLE32 handle, INT32 count, LPVOID buffer )
{
return GetObject32A( handle, count, buffer );
}
/***********************************************************************
* SelectObject (GDI.45)
*/
@ -397,8 +437,8 @@ INT EnumObjects( HDC hdc, INT nObjType, GOBJENUMPROC lpEnumFunc, LPARAM lParam )
};
int i, retval = 0;
LOGPEN *pen;
LOGBRUSH *brush = NULL;
LOGPEN16 *pen;
LOGBRUSH16 *brush = NULL;
dprintf_gdi( stddeb, "EnumObjects: %04x %d %08lx %08lx\n",
hdc, nObjType, (DWORD)lpEnumFunc, lParam );
@ -406,7 +446,7 @@ INT EnumObjects( HDC hdc, INT nObjType, GOBJENUMPROC lpEnumFunc, LPARAM lParam )
{
case OBJ_PEN:
/* Enumerate solid pens */
if (!(pen = SEGPTR_NEW(LOGPEN))) break;
if (!(pen = SEGPTR_NEW(LOGPEN16))) break;
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
{
pen->lopnStyle = PS_SOLID;
@ -424,7 +464,7 @@ INT EnumObjects( HDC hdc, INT nObjType, GOBJENUMPROC lpEnumFunc, LPARAM lParam )
case OBJ_BRUSH:
/* Enumerate solid brushes */
if (!(brush = SEGPTR_NEW(LOGBRUSH))) break;
if (!(brush = SEGPTR_NEW(LOGBRUSH16))) break;
for (i = 0; i < sizeof(solid_colors)/sizeof(solid_colors[0]); i++)
{
brush->lbStyle = BS_SOLID;

View File

@ -563,17 +563,17 @@ void PlayMetaFileRecord(HDC hdc, HANDLETABLE *ht, METARECORD *mr,
case META_CREATEPENINDIRECT:
MF_AddHandle(ht, nHandles,
CreatePenIndirect((LOGPEN *)(&(mr->rdParam))));
CreatePenIndirect((LOGPEN16 *)(&(mr->rdParam))));
break;
case META_CREATEFONTINDIRECT:
MF_AddHandle(ht, nHandles,
CreateFontIndirect((LOGFONT *)(&(mr->rdParam))));
CreateFontIndirect((LOGFONT16 *)(&(mr->rdParam))));
break;
case META_CREATEBRUSHINDIRECT:
MF_AddHandle(ht, nHandles,
CreateBrushIndirect((LOGBRUSH *)(&(mr->rdParam))));
CreateBrushIndirect((LOGBRUSH16 *)(&(mr->rdParam))));
break;
/* W. Magro: Some new metafile operations. Not all debugged. */
@ -930,17 +930,17 @@ BOOL MF_MetaParam8(DC *dc, short func, short param1, short param2,
* MF_CreateBrushIndirect
*/
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH16 *logbrush)
{
int index;
HMETAFILE handle;
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGBRUSH)];
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGBRUSH16)];
METARECORD *mr = (METARECORD *)&buffer;
METAHEADER *mh;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGBRUSH) - 2) / 2;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGBRUSH16) - 2) / 2;
mr->rdFunction = META_CREATEBRUSHINDIRECT;
memcpy(&(mr->rdParam), logbrush, sizeof(LOGBRUSH));
memcpy(&(mr->rdParam), logbrush, sizeof(LOGBRUSH16));
if (!(dc->w.hMetaFile = MF_WriteRecord(dc->w.hMetaFile,
mr, mr->rdSize * 2)))
return FALSE;
@ -968,7 +968,7 @@ BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
* MF_CreatePatternBrush
*/
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH16 *logbrush)
{
DWORD len, bmSize, biSize;
HANDLE hmr;
@ -1009,8 +1009,9 @@ BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
case BS_DIBPATTERN:
info = (BITMAPINFO *)GlobalLock16((HANDLE)logbrush->lbHatch);
bmSize = info->bmiHeader.biSizeImage;
if (!bmSize)
if (info->bmiHeader.biCompression)
bmSize = info->bmiHeader.biSizeImage;
else
bmSize = (info->bmiHeader.biWidth * info->bmiHeader.biBitCount
+ 31) / 32 * 8 * info->bmiHeader.biHeight;
biSize = DIB_BitmapInfoSize(info, LOWORD(logbrush->lbColor));
@ -1058,17 +1059,17 @@ BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush)
* MF_CreatePenIndirect
*/
BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN *logpen)
BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN16 *logpen)
{
int index;
HMETAFILE handle;
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGPEN)];
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGPEN16)];
METARECORD *mr = (METARECORD *)&buffer;
METAHEADER *mh;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGPEN) - 2) / 2;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGPEN16) - 2) / 2;
mr->rdFunction = META_CREATEPENINDIRECT;
memcpy(&(mr->rdParam), logpen, sizeof(LOGPEN));
memcpy(&(mr->rdParam), logpen, sizeof(LOGPEN16));
if (!(dc->w.hMetaFile = MF_WriteRecord(dc->w.hMetaFile, mr,
mr->rdSize * 2)))
return FALSE;
@ -1095,17 +1096,17 @@ BOOL MF_CreatePenIndirect(DC *dc, HPEN16 hPen, LOGPEN *logpen)
* MF_CreateFontIndirect
*/
BOOL MF_CreateFontIndirect(DC *dc, HFONT hFont, LOGFONT *logfont)
BOOL MF_CreateFontIndirect(DC *dc, HFONT hFont, LOGFONT16 *logfont)
{
int index;
HMETAFILE handle;
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGFONT)];
char buffer[sizeof(METARECORD) - 2 + sizeof(LOGFONT16)];
METARECORD *mr = (METARECORD *)&buffer;
METAHEADER *mh;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT) - 2) / 2;
mr->rdSize = (sizeof(METARECORD) + sizeof(LOGFONT16) - 2) / 2;
mr->rdFunction = META_CREATEFONTINDIRECT;
memcpy(&(mr->rdParam), logfont, sizeof(LOGFONT));
memcpy(&(mr->rdParam), logfont, sizeof(LOGFONT16));
if (!(dc->w.hMetaFile = MF_WriteRecord(dc->w.hMetaFile, mr,
mr->rdSize * 2)))
return FALSE;

View File

@ -149,7 +149,7 @@ static const struct
#define OIC_FIRST OIC_SAMPLE /* First OEM icon */
#define OIC_LAST OIC_WINEICON /* Last OEM icon */
static char **OBM_Icons_Data[OIC_LAST-OIC_FIRST+1] =
static char ** const OBM_Icons_Data[OIC_LAST-OIC_FIRST+1] =
{
oic_sample, /* OIC_SAMPLE */
oic_hand, /* OIC_HAND */
@ -216,7 +216,7 @@ static char **OBM_Cursors_Data[NB_CURSORS] =
#endif
};
static HCURSOR OBM_Cursors[NB_CURSORS] = { 0, };
static HCURSOR OBM_Cursors[NB_CURSORS];
/* All the colors used in the xpm files must be included in this */

View File

@ -15,7 +15,7 @@
*/
HPEN16 CreatePen( INT style, INT width, COLORREF color )
{
LOGPEN logpen = { style, { width, 0 }, color };
LOGPEN16 logpen = { style, { width, 0 }, color };
dprintf_gdi(stddeb, "CreatePen: %d %d %06lx\n", style, width, color );
return CreatePenIndirect( &logpen );
}
@ -24,7 +24,7 @@ HPEN16 CreatePen( INT style, INT width, COLORREF color )
/***********************************************************************
* CreatePenIndirect (GDI.62)
*/
HPEN16 CreatePenIndirect( const LOGPEN * pen )
HPEN16 CreatePenIndirect( const LOGPEN16 * pen )
{
PENOBJ * penPtr;
HPEN16 hpen;
@ -33,7 +33,7 @@ HPEN16 CreatePenIndirect( const LOGPEN * pen )
hpen = GDI_AllocObject( sizeof(PENOBJ), PEN_MAGIC );
if (!hpen) return 0;
penPtr = (PENOBJ *) GDI_HEAP_LIN_ADDR( hpen );
memcpy( &penPtr->logpen, pen, sizeof(LOGPEN) );
memcpy( &penPtr->logpen, pen, sizeof(*pen) );
return hpen;
}
@ -43,7 +43,7 @@ HPEN16 CreatePenIndirect( const LOGPEN * pen )
*/
int PEN_GetObject( PENOBJ * pen, int count, LPSTR buffer )
{
if (count > sizeof(LOGPEN)) count = sizeof(LOGPEN);
if (count > sizeof(pen->logpen)) count = sizeof(pen->logpen);
memcpy( buffer, &pen->logpen, count );
return count;
}

View File

@ -194,7 +194,7 @@ INT16 DrawText16( HDC16 hdc, LPCSTR str, INT16 i_count,
int len, lh, count=i_count;
int prefix_x = 0;
int prefix_end = 0;
TEXTMETRIC tm;
TEXTMETRIC16 tm;
int x = rect->left, y = rect->top;
int width = rect->right - rect->left;
int max_width = 0;
@ -581,20 +581,16 @@ BOOL32 TextOut32W( HDC32 hdc, INT32 x, INT32 y, LPCWSTR str, INT32 count )
BOOL GrayString(HDC hdc, HBRUSH hbr, FARPROC gsprc, LPARAM lParam,
INT cch, INT x, INT y, INT cx, INT cy)
{
int s, current_color;
BOOL ret;
COLORREF current_color;
if (gsprc) {
return CallGrayStringProc(gsprc, hdc, lParam,
cch ? cch : lstrlen((LPCSTR) lParam) );
} else {
current_color = GetTextColor(hdc);
SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT) );
s = TextOut16(hdc, x, y, (LPSTR) lParam,
cch ? cch : lstrlen((LPCSTR) lParam) );
SetTextColor(hdc, current_color);
return s;
}
if (!cch) cch = lstrlen16( (LPCSTR)PTR_SEG_TO_LIN(lParam) );
if (gsprc) return CallGrayStringProc( gsprc, hdc, lParam, cch );
current_color = GetTextColor( hdc );
SetTextColor( hdc, GetSysColor(COLOR_GRAYTEXT) );
ret = TextOut16( hdc, x, y, (LPCSTR)PTR_SEG_TO_LIN(lParam), cch );
SetTextColor( hdc, current_color );
return ret;
}
@ -621,7 +617,7 @@ LONG TEXT_TabbedTextOut( HDC hdc, int x, int y, LPSTR lpstr, int count,
}
else
{
TEXTMETRIC tm;
TEXTMETRIC16 tm;
GetTextMetrics( hdc, &tm );
defWidth = 8 * tm.tmAveCharWidth;
}

View File

@ -10,7 +10,6 @@ C_SRCS = \
error.c \
except.c \
file.c \
gdi32.c \
init.c \
memory.c \
newfns.c \

View File

@ -57,7 +57,7 @@ void EXC_Init(void)
*
*/
void EXC_RtlUnwind(PEXCEPTION_FRAME pEndFrame,PVOID unusedEip,
void EXC_RtlUnwind(PEXCEPTION_FRAME pEndFrame,LPVOID unusedEip,
PEXCEPTION_RECORD pRecord, DWORD returnEax,
PCONTEXT pcontext)
{
@ -73,7 +73,7 @@ void EXC_RtlUnwind(PEXCEPTION_FRAME pEndFrame,PVOID unusedEip,
record.ExceptionCode= 0xC0000026; /* invalid disposition */
record.ExceptionFlags= 0;
record.ExceptionRecord= NULL;
record.ExceptionAddress=(PVOID) pcontext->Eip;
record.ExceptionAddress=(LPVOID) pcontext->Eip;
record.NumberParameters= 0;
pRecord=&record;
}
@ -99,7 +99,7 @@ void EXC_RtlUnwind(PEXCEPTION_FRAME pEndFrame,PVOID unusedEip,
retval, (int) dispatch);
if(retval==ExceptionCollidedUnwind)
TebExceptionFrame=(PVOID) dispatch;
TebExceptionFrame=(LPVOID) dispatch;
else if(TebExceptionFrame!=pEndFrame)
TebExceptionFrame=TebExceptionFrame->Prev;
else
@ -130,7 +130,7 @@ VOID EXC_RaiseException(DWORD dwExceptionCode,
record.ExceptionFlags = dwExceptionFlags;
record.ExceptionRecord = NULL;
record.NumberParameters = cArguments;
record.ExceptionAddress = (PVOID) pcontext->Eip;
record.ExceptionAddress = (LPVOID) pcontext->Eip;
for(i=0;i<cArguments;i++)
record.ExceptionInformation[i]=lpArguments[i];

View File

@ -1,74 +0,0 @@
/*
* Win32 GDI functions
*
* Copyright 1996 Thomas Sandford t.d.g.sandford@prds-grn.demon.co.uk
*/
#include <windows.h>
#include <gdi.h>
#include <pen.h>
#include <brush.h>
#include <bitmap.h>
#include <font.h>
#include <palette.h>
#include <debug.h>
int WIN32_GetObject( HANDLE handle, int count, LPVOID buffer )
/* largely a copy of GetObject, but with size mangling capabilities to
convert between win16 and win32 objects. Yeuch! */
{
void *temp = alloca(count);
GDIOBJHDR * ptr = NULL;
dprintf_win32(stddeb, "WIN32_GetObject: %d %d %p\n", handle, count, buffer);
if ((!count) || (temp == NULL))
return 0;
ptr = GDI_GetObjPtr(handle, MAGIC_DONTCARE);
if (!ptr) return 0;
/* FIXME: only bitmaps fixed so far */
switch(ptr->wMagic)
{
case PEN_MAGIC:
return PEN_GetObject( (PENOBJ *)ptr, count, buffer );
case BRUSH_MAGIC:
return BRUSH_GetObject( (BRUSHOBJ *)ptr, count, buffer );
case BITMAP_MAGIC: {
BITMAP *pbm = (BITMAP *)temp;
int *pdest = (int *)buffer;
if (buffer == NULL)
return 28;
BITMAP_GetObject( (BITMAPOBJ *)ptr, count, temp );
if (count > 3)
pdest[0] = pbm->bmType;
if (count > 7)
pdest[1] = pbm->bmWidth;
if (count > 11)
pdest[2] = pbm->bmHeight;
if (count > 15)
pdest[3] = pbm->bmWidthBytes;
if (count > 19)
pdest[4] = pbm->bmPlanes;
if (count > 23)
pdest[5] = pbm->bmBitsPixel;
if (count > 27)
pdest[6] = pbm->bmBits;
return (count > 28) ? 28 : count - (count % 4);
}
case FONT_MAGIC:
return FONT_GetObject( (FONTOBJ *)ptr, count, buffer );
case PALETTE_MAGIC:
return PALETTE_GetObject( (PALETTEOBJ *)ptr, count, buffer );
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show More