Commit d90840e1 authored by Alexandre Julliard's avatar Alexandre Julliard

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).
parent 1e9ac798
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.
......
----------------------------------------------------------------------
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>
* [controls/button.c] [controls/listbox.c]
......
......@@ -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;
......
......@@ -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 );
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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 )
{
......
......@@ -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",
......
......@@ -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 );
}
......@@ -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;
......
......@@ -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 */
}
......
......@@ -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)
{
......
......@@ -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 );
}
......
......@@ -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 \
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
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
......@@ -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 );
......
......@@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGBRUSH logbrush WINE_PACKED;
LOGBRUSH16 logbrush WINE_PACKED;
} BRUSHOBJ;
#ifndef WINELIB
......
......@@ -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 ) \
......
/*
* compobj.h - Declarations for COMPOBJ
*/
typedef LPVOID LPUNKNOWN;
......@@ -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();
......
......@@ -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 */
......@@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGFONT logfont WINE_PACKED;
LOGFONT16 logfont WINE_PACKED;
} FONTOBJ;
/* may be switched... */
......
......@@ -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;
......
......@@ -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 */
#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 */
......@@ -3,7 +3,7 @@
*/
typedef struct tagLISTSTRUCT {
MEASUREITEMSTRUCT mis;
MEASUREITEMSTRUCT16 mis;
UINT itemState;
RECT16 itemRect;
HANDLE hData;
......
......@@ -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 */
......
......@@ -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 );
......
......@@ -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,
......
......@@ -199,7 +199,7 @@ struct resource_nameinfo_s
unsigned short length;
unsigned short flags;
unsigned short id;
HANDLE handle;
HANDLE16 handle;
unsigned short usage;
};
......
......@@ -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 */
......@@ -17,7 +17,7 @@
typedef struct
{
GDIOBJHDR header;
LOGPEN logpen WINE_PACKED;
LOGPEN16 logpen WINE_PACKED;
} PENOBJ;
#ifndef WINELIB
......
......@@ -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 );
......
......@@ -7,7 +7,7 @@
#ifndef __WINE_RESOURCE_H
#define __WINE_RESOURCE_H
#include "wintypes.h"
#include "windows.h"
struct resource
{
......
......@@ -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
......@@ -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*);
......
......@@ -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 */
......@@ -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
GetFileVersionInfo(LPCSTR filename,DWORD handle,DWORD datasize,LPVOID data);
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
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
VerLanguageName(UINT lang,LPSTR langname,UINT langnamelen);
VerFindFile32W(
UINT32 flags,LPCWSTR filename,LPCWSTR windir,LPCWSTR appdir,
LPWSTR curdir,UINT32 *curdirlen,LPWSTR destdir,UINT32 *destdirlen
);
#define VerFindFile WINELIB_NAME_AW(VerFindFile)
DWORD
VerQueryValue(SEGPTR block,LPCSTR subblock,SEGPTR *buffer,UINT *buflen);
VerInstallFile16(
UINT16 flags,LPCSTR srcfilename,LPCSTR destfilename,LPCSTR srcdir,
LPCSTR destdir,LPSTR tmpfile,UINT16 *tmpfilelen
);
DWORD
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)
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
21 VERFTHK_THUNKDATA16
22 VERTHKSL_THUNKDATA16
*/
/* 20 GETFILEVERSIONINFORAW */
#endif /* __WINE_VER_H */
#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);
......
/*
* 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();
......
......@@ -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
......
......@@ -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
......
......@@ -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] == '-')
{
......
......@@ -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';
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -7,7 +7,8 @@ C_SRCS = \
heap.c \
ldt.c \
local.c \
selector.c
selector.c \
string.c
all: $(MODULE).o
......
......@@ -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) );
......
......@@ -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;
......
......@@ -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;
......
......@@ -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];
/***********************************************************************
......
/*
* 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);
}
......@@ -32,6 +32,7 @@ C_SRCS = \
ver.c \
w32sys.c \
winsocket.c \
wsprintf.c \
xmalloc.c
all: $(MODULE).o
......
......@@ -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);
......
......@@ -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)) {
......
......@@ -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)
......
......@@ -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"
......
......@@ -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);
}
......
......@@ -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 );
}
......@@ -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.
......
......@@ -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;
......@@ -1015,14 +1130,6 @@ BOOL SystemParametersInfo (UINT uAction, UINT uParam, LPVOID lpvParam, UINT fuWi
}
/***********************************************************************
* HMEMCPY (KERNEL.348)
*/
void hmemcpy(LPVOID hpvDest, LPCVOID hpvSource, LONG cbCopy)
{
memcpy(hpvDest, hpvSource, cbCopy);
}
/***********************************************************************
* COPY (GDI.250)
*/
void Copy(LPVOID lpSource, LPVOID lpDest, WORD nBytes)
......
......@@ -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 */
......
......@@ -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 {
......
......@@ -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 */
......
......@@ -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) \
......
This diff is collapsed. Click to expand it.
......@@ -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)
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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,17 +280,36 @@ 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
*/
HBITMAP BITMAP_SelectObject( DC * dc, HBITMAP hbitmap,
......@@ -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 )
......
......@@ -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;
}
......
......@@ -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
*
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment