1996-07-17 22:02:21 +02:00
|
|
|
/*
|
|
|
|
* Misc. functions for systems that don't have them
|
|
|
|
*
|
|
|
|
* Copyright 1996 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1996-07-17 22:02:21 +02:00
|
|
|
*/
|
|
|
|
|
2001-11-06 21:57:11 +01:00
|
|
|
#include "config.h"
|
2001-05-14 22:09:37 +02:00
|
|
|
#include "wine/port.h"
|
1999-06-26 16:58:24 +02:00
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
#ifdef __BEOS__
|
|
|
|
#include <be/kernel/fs_info.h>
|
|
|
|
#include <be/kernel/OS.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <assert.h>
|
1999-09-04 16:36:02 +02:00
|
|
|
#include <ctype.h>
|
1999-02-20 17:46:39 +01:00
|
|
|
#include <stdio.h>
|
2000-12-19 20:38:48 +01:00
|
|
|
#include <stdlib.h>
|
1999-02-28 13:27:56 +01:00
|
|
|
#include <string.h>
|
2002-08-17 03:22:59 +02:00
|
|
|
#include <time.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
1996-07-12 21:02:39 +02:00
|
|
|
#include <sys/types.h>
|
2002-03-29 19:04:43 +01:00
|
|
|
#ifdef HAVE_SYS_INTTYPES_H
|
|
|
|
# include <sys/inttypes.h>
|
|
|
|
#endif
|
2002-03-11 06:08:38 +01:00
|
|
|
#ifdef HAVE_SYS_TIME_h
|
|
|
|
# include <sys/time.h>
|
|
|
|
#endif
|
1999-01-17 17:55:11 +01:00
|
|
|
#include <sys/stat.h>
|
2002-05-15 01:18:23 +02:00
|
|
|
#ifdef HAVE_SYS_IOCTL_H
|
1999-01-17 17:55:11 +01:00
|
|
|
#include <sys/ioctl.h>
|
2002-05-15 01:18:23 +02:00
|
|
|
#endif
|
1999-01-17 17:55:11 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
2002-05-15 01:18:23 +02:00
|
|
|
#ifdef HAVE_TERMIOS_H
|
1999-01-17 17:55:11 +01:00
|
|
|
#include <termios.h>
|
2002-05-15 01:18:23 +02:00
|
|
|
#endif
|
2000-11-08 05:28:54 +01:00
|
|
|
#ifdef HAVE_SYS_MMAN_H
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#endif
|
1999-01-20 15:18:55 +01:00
|
|
|
#ifdef HAVE_LIBIO_H
|
|
|
|
# include <libio.h>
|
|
|
|
#endif
|
1999-11-13 23:23:35 +01:00
|
|
|
#ifdef HAVE_SYSCALL_H
|
|
|
|
# include <syscall.h>
|
|
|
|
#endif
|
2001-12-14 23:47:45 +01:00
|
|
|
#ifdef HAVE_STDINT_H
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
1999-12-12 00:02:15 +01:00
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* usleep
|
|
|
|
*/
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
#ifndef HAVE_USLEEP
|
2002-05-15 01:18:23 +02:00
|
|
|
int usleep (unsigned int useconds)
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
{
|
1999-11-13 23:23:35 +01:00
|
|
|
#if defined(__EMX__)
|
|
|
|
DosSleep(useconds);
|
|
|
|
return 0;
|
|
|
|
#elif defined(__BEOS__)
|
|
|
|
return snooze(useconds);
|
|
|
|
#elif defined(HAVE_SELECT)
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
struct timeval delay;
|
|
|
|
|
2000-10-31 01:20:51 +01:00
|
|
|
delay.tv_sec = useconds / 1000000;
|
|
|
|
delay.tv_usec = useconds % 1000000;
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
|
1996-07-12 21:02:39 +02:00
|
|
|
select( 0, 0, 0, 0, &delay );
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
return 0;
|
1999-11-13 23:23:35 +01:00
|
|
|
#else /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
#endif /* defined(__EMX__) || defined(__BEOS__) || defined(HAVE_SELECT) */
|
Release 960114
Sun Jan 14 13:45:22 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added check for gcc strength-reduce bug.
* [controls/listbox.c]
Changed ListBoxDirectory() to use the new DOS file functions.
* [controls/menu.c]
Fixed parameters for DeleteMenu() call in ChangeMenu().
* [debugger/stack.c]
Also display current frame in back-trace.
* [files/directory.c] [files/dos_fs.c] [files/drive.c] [files/file.c]
Complete rewrite of the DOS file handling.
Implemented per-task file handles.
Removed default Z: drive; needs to be put explicitely in wine.ini
if desired.
* [loader/module.c]
Fixed file descriptor leak in LoadModule().
* [loader/task.c]
Initialise PDB file handle table in TASK_CreateTask().
Close file handles on task termination.
Implemented SetErrorMode().
* [misc/network.c]
Fixed WNetGetConnection() to use GetDriveType().
* [misc/xmalloc.c]
Added function xstrdup().
* [miscemu/int21.c]
Many changes for new DOS file functions.
* [miscemu/interrupts.c]
Moved DOS_GetEquipment() function into INT_Int11Handler().
* [windows/win.c]
Bug fix: create system menu before sending WM_NCCREATE.
* [*/*.c]
Replaced strcasecmp and strncasecmp by lstrcmpi and lstrncmpi for
better portability.
Sat Jan 13 16:13:02 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [include/wintypes.h]
Added 'typedef HGLOBAL GOBALHANDLE;'. This is not precisely in line
with the true windows 'typedef HANDLE GLOBALHANDLE;', but I believe
it should suffice.
* [include/winsock.h]
Added '#include <arpa/inet.h>' for various declarations. '#ifdef'-ed
out some old style internet address #define's.
* [loader/task.c]
Made MakeProcInstance() return first parameter #ifdef WINELIB32.
Made FreeProcInstance() do nothing #ifdef WINELIB32.
'#ifdef'-ed out TASK_AllocThunk(), as it was unused in WINELIB32.
* [library/miscstubs.c]
Made GetWndProcEntry16() return ACTIVATEAPP_callback() when called
with name="ActivateAppProc". This hardly seems correct, but it's my
best guess as to how the emulator responds.
Sat Jan 6 17:57:45 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [if1632/kernel32.spec][win32/process.c]
WIN32_GetProcAddress, LoadLibraryA: new functions
* [if1632/relay32.c]
RELAY32_GetEntryPoint: Removed code to load PE DLLs
* [include/pe_image.h][include/pe_exe.h]
struct pe_data: new fields base_addr,load_addr,vma_size,pe_reloc
struct PE_Reloc_Block: new structure
* [loader/module.c]
MODULE_RegisterModule: new function
* [loader/pe_image.c]
PE_FindExportedFunction,PE_GetProcAddress: new functions
fixup_imports: expect struct w_files* now, fill dlls_to_init,
load PE DLLs
do_relocations: new functions
calc_vma_size: renamed from dump_table
PE_LoadImage: use malloc to allocate memory for image
PE_InitDLL: expect HMODULE
PE_InitializeDLLs: new function
* [loader/task.c]
NE_InitializeDLLs: branch to PE_InitializeDLLs for PE modules
GetExePtr: Accept PE modules
* [misc/commdlg.c]
FILEDLG_WMCommand: unpack WIN32 WM_COMMAND appropriately for WineLib
Thu Jan 4 11:36:21 1996 Manfred Weichel <Manfred.Weichel@mch.sni.de>
* [misc/port.c]
New file with usleep() function for SVR4.
* [configure.in]
Check for usleep() function.
Tue Jan 02 14:00:00 1996 Anand Kumria <akumria@ozemail.com.au>
* [if1632/toolhelp.spec] [include/toolhelp.h]
[misc/user.c] [windows/message.c]
Implement TOOLHELP.80 TimerCount. Fix GetTickCount.
* [winsocket.c]
Fixed ENOENT error.
* [miscemu/dpmi.c]
Implement DPMI Get Page Size (AX=0604, INT 31)
* [memory/global.c]
Implement TOOLHELP.72 GetMemManInfo.
Mon Jan 2 10:33:00 1996 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* [if1632/callback.c]
CallWindowProc() - When calling RELAY32_CallWindowProc, check
whether lParam should be a SEGPTR, and if so convert it to one.
* [if1632/gdi.spec] [if1632/kernel32.spec] [if1632/user32.spec]
Numerous functions added, mostly calls to original (win16)
functions. Note that some (many) of these are probably not
strictly correct, but with these additions freecell will at least
display its main window though it is garbled.
* [if1632/winprocs.spec]
Completely rewritten - all WndProcs now have win32 versions to
help with the lparam SEGPTR fix in callback.c
* [include/kernel32.h]
LPTCSTR defined.
* [include/peexe.h]
Definition of PE_Export_Directory amended.
* [include/resource32.h]
New file.
* [include/stackframe.h]
Definition of MAKE_SEGPTR macro #ifdef'd out and replaced with
prototype for replacement function in memory/selector.c which
can operate on any given memory address. This is currently
required for win32 support. It is a dreadful cludge, and will
certainly slow down other programs. If you are not interested
in win32 development you may wish to reverse this patch.
* [include/windows.h]
Definition of SW_SHOWDEFAULT added.
* [loader/pe_image.c]
Extensive rewrites of xmmap() fixup_imports().
PE_LoadImage() - initialisation of bss added, extraction of
module name fixed, initialisation of DLL added.
PE_InitDLL() - now does something.
PE_Win32CallToStart() - initialisation of TEB pointed to by
fs added.
PE_InitTEB() created to perform TEB initialisation.
* [memory/selector.c]
New function MAKE_SEGPTR() - see include/stackframe.h above.
* [misc/user32.c]
USER32_RegisterClassA(), CreateWindowExA() memory allocation
method changed. This is probably now unnecessary with the
new MAKE_SEGPTR handling code.
USER32_DefWndProcA() removed to win32/winprocs.c
USER32_TranslateMessage added.
* [tools/build.c]
handling of win32 spec files changed to support gcc2.6.X
this requires optimisations to be disabled.
* [win32/resource.c] [win32/newfns.c] [win32/heap.c] [win32/winprocs.c]
New files.
* [win32/Makefile.in]
New files heap.c, newfns.c, resource.c and winprocs.c added to build.
* [win32/file.c]
New function W32_SetHandleCount.
* [win32/init.c]
WIN32_GetModuleHandle() - now returns handle of running process
if called with NULL.
GetStartupInfoA() - set cbReserved2 to 0.
* [win32/memory.c]
VirtualAlloc() - set mmap() file parameter to -1 instead of 0 to make
it work with FreeBSD. Also check for return value. Removed extra
return.
* [windows/winpos.c]
ShowWindow() - SW_SHOWDEFAULT handling kludged in.
1996-01-14 19:12:01 +01:00
|
|
|
}
|
|
|
|
#endif /* HAVE_USLEEP */
|
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* memmove
|
|
|
|
*/
|
1996-07-17 22:02:21 +02:00
|
|
|
#ifndef HAVE_MEMMOVE
|
2002-10-18 02:27:38 +02:00
|
|
|
void *memmove( void *dest, const void *src, size_t len )
|
1996-07-17 22:02:21 +02:00
|
|
|
{
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
register char *dst = dest;
|
|
|
|
|
1996-07-17 22:02:21 +02:00
|
|
|
/* Use memcpy if not overlapping */
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
if ((dst + len <= (char *)src) || ((char *)src + len <= dst))
|
1996-07-17 22:02:21 +02:00
|
|
|
{
|
|
|
|
memcpy( dst, src, len );
|
|
|
|
}
|
|
|
|
/* Otherwise do it the hard way (FIXME: could do better than this) */
|
2002-08-17 03:22:59 +02:00
|
|
|
else if (dst < (char *)src)
|
1996-07-17 22:02:21 +02:00
|
|
|
{
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
while (len--) *dst++ = *((char *)src)++;
|
1996-07-17 22:02:21 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
dst += len - 1;
|
1996-07-17 22:02:21 +02:00
|
|
|
src = (char *)src + len - 1;
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
while (len--) *dst-- = *((char *)src)--;
|
1996-07-17 22:02:21 +02:00
|
|
|
}
|
Release 960728
Sun Jul 28 17:57:19 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [loader/task.c] [include/task.h]
Implemented SwitchStackTo()/SwitchStackBack().
* [include/wintypes.h] [loader/main.c]
Added __winelib variable to distinguish between emulator and
library at run-time. Later on, this should avoid some
recompilations when building Winelib.
* [windows/property.c]
Implemented Win32 functions for window properties.
Fri Jul 26 18:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [controls/listbox.c]
Implemented LBS_SORT style, WM_COMPAREITEM, and WM_DELETEITEM
messages.
* [controls/menu.c]
Call TranslateMessage() to enable shortcuts (on WM_CHAR).
* [include/cursoricon.h]
Moved #pragma pack(1) back to where it belongs.
* [objects/palette.c]
RealizeDefaultPalette() maps to system colors only.
Do not broadcast palette notifications when in TrueColor.
* [objects/color.c] [include/palette.h]
Miscellaneous optimizations. Had to fix several
"improvements" made to my patch for previous release.
* [objects/dib.c]
Reverse dib bits order for 24-bit SetDIBits().
* [objects/dc.c]
GetDeviceCaps() does not return RC_PALETTE when in TrueColor.
* [windows/scroll.c]
Scroll update region too.
* [windows/message.c]
Include QS_MOUSE into the event mask for nonclient mouse
message filter. Fixes problems with Word 6 freezing when
mouse hits nonclient area.
* [windows/win.c]
Allow top-level windows to be linked as HWND_TOP in CreateWindow().
* [windows/winpos.c] [windows/mdi.c]
Attempt to fix control menu duplication.
Fri Jul 26 09:49:35 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/drive.c]
GetDriveType32A(): return value for CDROM fixed.
* [files/file.c]
SearchPath* added.
* [if1632/gdi32.spec] [objects/brush.c]
SetBrushOrgEx() added.
* [loader/pe_resource.c]
If even loading the default entry fails, we just use the first
entry from the resource directory.
[loader/task.c]
SetSigHandler() stub added, Paradox 4.5 now starts up.
* [misc/comm.c] [include/windows.h] [if1632/kernel32.spec]
COMM functions updated to win32, not complete.
* [misc/lstr.c]
FormatMessageA partially implemented.
* [include/miscemu.h] [memory/selector.c]
[memory/global.c] [miscemu/dosmem.c]
DOS memory handling changed: 1MB preallocated block, real-mode
segment handling possible, SetSelectorBase into lower physical 1MB
possible.
* [miscemu/dpmi.c]
Real-mode segments changed, real-mode int 21,ax=6506 added.
AX=0x0303 added.
* [multimedia/time.c]
Fixed bug in killTimer.
* [objects/bitmap.c]
LoadImageA partially implemented.
Wed Jul 24 18:20:24 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/dde_mem.h][include/dde_proc.h]
[ipc/dde_atom.c][ipc/dde_proc.c][windows/message.c]
[ipc/generic_hash.h][library/miscstubs.c]
Changes for error free compilation using "--with-ipc":
replaced some names with *16-equivalent (e.g. MSG to MSG16),
modified prototype of function DDE_GlobalFree() .
* [objects/palette.c]
Added check for metafile-DC in GDISelectPalette(),
GDIRealizePalette(),RealizeDefaultPalette() and
IsDCCurrentPalette().
Tue Jul 23 22:46:53 1996 Andrew Lewycky <plewycky@oise.utoronto.ca>
* [controls/edit.c]
EDIT_WM_Create: Don't EDIT_EM_ReplaceSel if created with lParam = "",
fixes Winhelp.
* [windows/dialog.c]
DIALOG_CreateIndirect: Initialise dlgProc before creating children.
1996-07-28 20:50:11 +02:00
|
|
|
return dest;
|
1996-07-17 22:02:21 +02:00
|
|
|
}
|
|
|
|
#endif /* HAVE_MEMMOVE */
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 20:17:50 +01:00
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* strerror
|
|
|
|
*/
|
Release 971221
Fri Dec 19 10:50:46 1997 Douglas Ridgway <ridgway@winehq.com>
* [Make.rules.in] [Makefile.in] [documentation/Makefile.in]
[documentation/README.documentation]
First cut at Wine API documentation. No longer install reference
manual by default.
Wed Dec 17 21:32:23 1997 Andreas Mohr <100.30936@germany.net>
* [files/file.c]
Fixed GetTempFileName16() to use current path of requested drive
as needed.
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/dciman32.spec]
[if1632/msvfw32.spec] [if1632/tapi32.spec] [if1632/wow32.spec]
Added misc DLLs needed by various apps.
Wed Dec 17 12:01:50 1997 Morten Eriksen <mortene@sim.no>
* [if1632/gdi32.spec] [include/windows.h] [objects/palette.c]
Inserted empty stub for CreateHalftonePalette.
Tue Dec 16 22:08:06 1997 Huw D M Davies <h.davies1@physics.oxford.ac.uk>
* [windows/mdi.c]
Use VK_TAB instead of VK_SEPARATOR in TranslateMDISysAccel().
* [graphics/metafiledrv/init.c]
DeleteDC() on a MetaDC doesn't do anything - it shouldn't. Therefore
fix cleanup of MetaDCs in CloseMetaFile(); they now actually get
removed from the GDI heap!
* [graphics/x11drv/xfont.c]
Preserve FO_MATCH_XYINDEP flag in XFONT_MatchFIList(). Should reduce
the number of bold-italic matches.
Tue Dec 16 20:11:43 1997 Bertho Stultiens <bertho@panter.soci.aau.dk>
* [graphics/painting.c]
Included an implementation of DrawState
* [if1632/thunk.c]
Changed many fprintfs into dprintf_thunk
* [include/cache.h] [graphics/cache.c]
New files to hold cached handles to regulary used GDI object.
* [include/windows.h]
Added DRAWSTATExx typedefs
Added DSS_DEFAULT define for DrawState
* [objects/text.c]
New implementation of GrayString()
* [controls/uitools.c]
Implemented DrawFrameControl() functions
Changed DrawEdge() behaviour to win95 implementation
Mon Dec 15 23:43:01 1997 Martin Boehme <boehme@informatik.mu-luebeck.de>
* [graphics/path.c] [include/path.h] [graphics/painting.c]
[if1632/gdi32.spec] [include/gdi.h] [include/windows.h]
[objects/dc.c]
Added preliminary support for GDI paths.
* [objects/dc.c]
Added DC_Init_DC_INFO function for initializing WIN_DC_INFO
structure.
* [include/windows.h] [include/gdi.h] [objects/gdiobj.c]
Added DEFAULT_GUI_FONT.
* [include/winerror.h]
Added a few error codes.
* [memory/heap.c]
Changed HeapAlloc to make the correct calls to SetLastError
(now conforms to NT's behaviour).
* [windows/win.c]
Changed WIN_CreateWindowEx to allow child windows with zero
width / height.
Sun Dec 14 12:01:07 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [if1632/*] [relay32/*]
Moved all 32-bit relay stuff to relay32/
* [fi1632/thunk.c] [win32/kernel32.c]
Moved all KERNEL32 ordinal functions to kernel32.c
* [memory/selector.c]
Initialize selectors in AllocSelectorArray.
* [tools/build.c]
Generate C instead of assembly for Win32 relays.
Fixed stack corruption in CallTo16 functions, found by Bertho
Stultiens.
Sun Dec 14 10:55:00 1997 Andreas Mohr <100.30936@germany.net>
* [if1632/Makefile.in] [if1632/builtin.c] [if1632/ole2thk.spec]
Added built-in OLE2THK.DLL.
* [if1632/toolhelp.spec] [include/toolhelp.h] [memory/selector.c]
[misc/toolhelp.c]
Added stubs for StackTraceFirst(), StackTraceCSIPFirst(),
StackTraceNext(), UTSelectorOffsetToLinear()
and UTLinearToSelectorOffset().
Sat Dec 13 17:26:41 1997 Alex Korobka <alex@trantor.pharm.sunysb.edu>
* [misc/winsock.c]
32-bit API fixes for reported problems (thanks to Marcus
and David).
* [graphics/x11drv/xfont.c]
Little tweak in point size calculation.
* [windows/defwnd.c] [windows/dce.c] [windows/winhelp.c]
[windows/winproc.c] [windows/win.c]
Bug fixes.
Sat Dec 13 16:35:14 1997 Kai Morich <kai.morich@rhein-neckar.netsurf.de>
* [files/dos_fs.c]
OpenFile with empty filename and OF_PARSE returns current dir.
* [misc/commdlg.c]
Ignore initial dir if bogus.
* [files/file.c]
Locking an identic region in a file must not be an error.
* [misc/lstr.c]
Use wide char ctype functions.
Fri Dec 12 23:46:22 1997 Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
* [file/drive.c]
First attempt for GetDiskFreeSpaceEx.
Fri Dec 12 23:18:41 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [loader/pe_resource.c]
Fixed wrongly appearing menus problem (only use default lookups in
last resource subtree).
* [multimedia/*.c]
Added win32 support for time* and joy* lowlevel drivers,
(not excessively tested), some misc fixes and cleanups.
* [misc/shellord.c][misc/shell.c][ole/folders.c][ole/ifs.c]
[include/interfaces.h][include/shlobj.h]
Added some more undocumented SHELL32 functions, some shell folder
interface stubs added, SHGetMalloc, SHGetDesktopFolder,
SHGetSpecialFolderLocation, SHGetPathFromIDList stubs added,
IMalloc, IUnknown implemented.
* [windows/msgbox.c]
Implemented MessageBoxIndirect*, some internal changes.
* [if1632/thunk.c]
KERNEL_431 implemented.
* [objects/gdiobj.c]
GetCurrentObject implemented.
Wed Dec 3 01:09:17 1997 Gordon Chaffee <chaffee@apu.cs.berkeley.edu>
* [objects/dib.c]
Fix a couple small DIB problems.
* [controls/edit.c]
Fix a typo.
* [files/dos_fs.c]
Try normal readdir in case fs is specified as vfat but isn't.
* [files/profile.c]
Implementation of WritePrivateProfileSection32A from Uwe Bonnes.
* [misc/printdrv.c]
OpenPrinter32A stub, helps Word97 start.
* [objects/text.c]
Fixup implementation of GetTextCharsetInfo.
* [scheduler/process.c]
Fix environment variable expansion.
* [win32/code_page.c]
Make MultiByteToWideChar and WideCharToMultiByte conform in return
values and error conditions to those in Windows NT 4.0.
* [windows/message.c]
Fix broadcasting problems in Win32. The Win32 docs say to use
HWND_TOPMOST to broadcast to all Win32 Windows.
* [memory/virtual.c] [loader/pe_image.c]
Do not map in VirtualAlloc if address is specified and space is
not available. This is required by Win32.
* [include/pen.h] [include/x11drv.h] [objects/dc.c]
[objects/pen.c] [graphics/x11drv/pen.c]
Support for ExtCreatePen.
Tue Dec 2 20:22:06 1997 Morten Welinder <terra@diku.dk>
* [*/*.c] [*/*.h]
Add lots of prototypes.
* [if1632/kernel32.spec][include/windows.h][include/winnt.h]
[misc/cpu.c]
Define IsProcessorFeaturePresent.
* [misc/crtdll.c]
(CRTDLL__getcwd): Allocate enough memory for the terminating zero.
* [misc/ver.c]
Improve check for null component in _find_data[AW]. Plug leaks
in VerQueryValue*.
* [win32/console.c][if1632/kernel32.spec]
Add stubs for GetConsoleCursorInfo32, SetConsoleCursorInfo32.
* [windows/message.c][if1632/user32.spec][include/windows.h]
Define SendMessageTimeout*.
* [graphics/x11drv/xfont.c]
Change algorithm of __genericCheckSum to be alignment safe.
* [misc/main.c] [misc/winsock.c] [misc/winsock_dns.c]
Include winsock.h early to avoid Solaris problem.
* [include/windows.h]
Undef FSHIFT before we define it.
* [rc/winerc.c]
Include <fcntl.h> instead of <sys/fcntl.h>.
* [files/file.c]
Use strerror in FILE_SetDosError if available.
* [include/config.h.in] [configure.in]
Check for strerror.
* [objects/gdiobj.c]
Make static font structures aligned.
Mon Dec 1 10:10:21 1997 Karl Garrison <karlos@eznet.net>
* [win32/console.c] [if1632/kernel32.spec] [include/windows.h]
Added stub for GetNumberOfConsoleMouseButtons.
Added stub for PeekConsoleInput(A,W).
Fixed parameter list for WriteConsole(A,W).
GetNumberOfConsoleInputEvents now returns 0 events instead of 1
(since low-level console functions are not yet supported).
GetConsoleMode no longer returns ENABLE_WINDOW_INPUT and
ENABLE_MOUSE_INPUT since these are not currently implemented.
1997-12-21 20:17:50 +01:00
|
|
|
#ifndef HAVE_STRERROR
|
|
|
|
const char *strerror( int err )
|
|
|
|
{
|
|
|
|
/* Let's hope we have sys_errlist then */
|
|
|
|
return sys_errlist[err];
|
|
|
|
}
|
|
|
|
#endif /* HAVE_STRERROR */
|
1998-01-18 19:01:49 +01:00
|
|
|
|
2000-11-08 05:28:54 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* getpagesize
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_GETPAGESIZE
|
|
|
|
size_t getpagesize(void)
|
|
|
|
{
|
|
|
|
# ifdef __svr4__
|
|
|
|
return sysconf(_SC_PAGESIZE);
|
2002-05-17 05:31:08 +02:00
|
|
|
# elif defined(__i386__)
|
|
|
|
return 4096;
|
2000-11-08 05:28:54 +01:00
|
|
|
# else
|
|
|
|
# error Cannot get the page size on this platform
|
|
|
|
# endif
|
|
|
|
}
|
|
|
|
#endif /* HAVE_GETPAGESIZE */
|
|
|
|
|
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* clone
|
|
|
|
*/
|
1998-01-18 19:01:49 +01:00
|
|
|
#if !defined(HAVE_CLONE) && defined(__linux__)
|
|
|
|
int clone( int (*fn)(void *), void *stack, int flags, void *arg )
|
|
|
|
{
|
|
|
|
#ifdef __i386__
|
|
|
|
int ret;
|
|
|
|
void **stack_ptr = (void **)stack;
|
|
|
|
*--stack_ptr = arg; /* Push argument on stack */
|
|
|
|
*--stack_ptr = fn; /* Push function pointer (popped into ebx) */
|
|
|
|
__asm__ __volatile__( "pushl %%ebx\n\t"
|
|
|
|
"movl %2,%%ebx\n\t"
|
|
|
|
"int $0x80\n\t"
|
|
|
|
"popl %%ebx\n\t" /* Contains fn in the child */
|
|
|
|
"testl %%eax,%%eax\n\t"
|
|
|
|
"jnz 0f\n\t"
|
2001-02-20 02:59:27 +01:00
|
|
|
"xorl %ebp,%ebp\n\t" /* Terminate the stack frames */
|
1998-01-18 19:01:49 +01:00
|
|
|
"call *%%ebx\n\t" /* Should never return */
|
|
|
|
"xorl %%eax,%%eax\n\t" /* Just in case it does*/
|
|
|
|
"0:"
|
|
|
|
: "=a" (ret)
|
1999-02-21 19:18:42 +01:00
|
|
|
: "0" (SYS_clone), "r" (flags), "c" (stack_ptr) );
|
1998-01-18 19:01:49 +01:00
|
|
|
assert( ret ); /* If ret is 0, we returned from the child function */
|
|
|
|
if (ret > 0) return ret;
|
|
|
|
errno = -ret;
|
|
|
|
return -1;
|
|
|
|
#else
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
#endif /* __i386__ */
|
|
|
|
}
|
|
|
|
#endif /* !HAVE_CLONE && __linux__ */
|
1999-01-17 17:55:11 +01:00
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* strcasecmp
|
|
|
|
*/
|
1999-09-04 16:36:02 +02:00
|
|
|
#ifndef HAVE_STRCASECMP
|
|
|
|
int strcasecmp( const char *str1, const char *str2 )
|
|
|
|
{
|
2000-12-18 04:50:15 +01:00
|
|
|
const unsigned char *ustr1 = (const unsigned char *)str1;
|
|
|
|
const unsigned char *ustr2 = (const unsigned char *)str2;
|
|
|
|
|
|
|
|
while (*ustr1 && toupper(*ustr1) == toupper(*ustr2)) {
|
|
|
|
ustr1++;
|
|
|
|
ustr2++;
|
|
|
|
}
|
|
|
|
return toupper(*ustr1) - toupper(*ustr2);
|
1999-09-04 16:36:02 +02:00
|
|
|
}
|
|
|
|
#endif /* HAVE_STRCASECMP */
|
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* strncasecmp
|
|
|
|
*/
|
1999-09-04 16:36:02 +02:00
|
|
|
#ifndef HAVE_STRNCASECMP
|
|
|
|
int strncasecmp( const char *str1, const char *str2, size_t n )
|
|
|
|
{
|
2000-12-18 04:50:15 +01:00
|
|
|
const unsigned char *ustr1 = (const unsigned char *)str1;
|
|
|
|
const unsigned char *ustr2 = (const unsigned char *)str2;
|
1999-09-04 16:36:02 +02:00
|
|
|
int res;
|
2000-12-18 04:50:15 +01:00
|
|
|
|
1999-09-04 16:36:02 +02:00
|
|
|
if (!n) return 0;
|
2000-12-18 04:50:15 +01:00
|
|
|
while ((--n > 0) && *ustr1) {
|
|
|
|
if ((res = toupper(*ustr1) - toupper(*ustr2))) return res;
|
|
|
|
ustr1++;
|
|
|
|
ustr2++;
|
|
|
|
}
|
|
|
|
return toupper(*ustr1) - toupper(*ustr2);
|
1999-09-04 16:36:02 +02:00
|
|
|
}
|
|
|
|
#endif /* HAVE_STRNCASECMP */
|
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* getsockopt
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_GETSOCKOPT
|
|
|
|
int getsockopt(int socket, int level, int option_name,
|
2000-10-31 01:20:51 +01:00
|
|
|
void *option_value, size_t *option_len)
|
1999-11-13 23:23:35 +01:00
|
|
|
{
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#endif /* !defined(HAVE_GETSOCKOPT) */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* inet_network
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_INET_NETWORK
|
|
|
|
unsigned long inet_network(const char *cp)
|
|
|
|
{
|
|
|
|
errno = ENOSYS;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif /* defined(HAVE_INET_NETWORK) */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* statfs
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_STATFS
|
|
|
|
int statfs(const char *name, struct statfs *info)
|
|
|
|
{
|
|
|
|
#ifdef __BEOS__
|
|
|
|
dev_t mydev;
|
|
|
|
fs_info fsinfo;
|
2000-10-31 01:20:51 +01:00
|
|
|
|
1999-11-13 23:23:35 +01:00
|
|
|
if(!info) {
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((mydev = dev_for_path(name)) < 0) {
|
|
|
|
errno = ENOSYS;
|
2000-10-31 01:20:51 +01:00
|
|
|
return -1;
|
1999-11-13 23:23:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (fs_stat_dev(mydev,&fsinfo) < 0) {
|
|
|
|
errno = ENOSYS;
|
2000-10-31 01:20:51 +01:00
|
|
|
return -1;
|
1999-11-13 23:23:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
info->f_bsize = fsinfo.block_size;
|
|
|
|
info->f_blocks = fsinfo.total_blocks;
|
|
|
|
info->f_bfree = fsinfo.free_blocks;
|
|
|
|
return 0;
|
|
|
|
#else /* defined(__BEOS__) */
|
|
|
|
errno = ENOSYS;
|
|
|
|
return -1;
|
|
|
|
#endif /* defined(__BEOS__) */
|
|
|
|
}
|
|
|
|
#endif /* !defined(HAVE_STATFS) */
|
2000-11-08 05:28:54 +01:00
|
|
|
|
|
|
|
|
2000-11-29 18:48:06 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* lstat
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_LSTAT
|
|
|
|
int lstat(const char *file_name, struct stat *buf)
|
|
|
|
{
|
|
|
|
return stat( file_name, buf );
|
|
|
|
}
|
|
|
|
#endif /* HAVE_LSTAT */
|
|
|
|
|
2002-07-30 01:55:39 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* mkstemp
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_MKSTEMP
|
|
|
|
int mkstemp(char *tmpfn)
|
|
|
|
{
|
|
|
|
int tries;
|
|
|
|
char *xstart;
|
|
|
|
|
|
|
|
xstart = tmpfn+strlen(tmpfn)-1;
|
|
|
|
while ((xstart > tmpfn) && (*xstart == 'X'))
|
|
|
|
xstart--;
|
|
|
|
tries = 10;
|
|
|
|
while (tries--) {
|
|
|
|
char *newfn = mktemp(tmpfn);
|
|
|
|
int fd;
|
|
|
|
if (!newfn) /* something else broke horribly */
|
|
|
|
return -1;
|
|
|
|
fd = open(newfn,O_CREAT|O_RDWR|O_EXCL,0600);
|
|
|
|
if (fd!=-1)
|
|
|
|
return fd;
|
|
|
|
newfn = xstart;
|
|
|
|
/* fill up with X and try again ... */
|
|
|
|
while (*newfn) *newfn++ = 'X';
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
#endif /* HAVE_MKSTEMP */
|
|
|
|
|
2002-01-07 22:00:27 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* pread
|
|
|
|
*
|
|
|
|
* FIXME: this is not thread-safe
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_PREAD
|
|
|
|
ssize_t pread( int fd, void *buf, size_t count, off_t offset )
|
|
|
|
{
|
|
|
|
ssize_t ret;
|
|
|
|
off_t old_pos;
|
|
|
|
|
|
|
|
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
|
|
|
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
|
|
|
if ((ret = read( fd, buf, count )) == -1)
|
|
|
|
{
|
|
|
|
int err = errno; /* save errno */
|
|
|
|
lseek( fd, old_pos, SEEK_SET );
|
|
|
|
errno = err;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif /* HAVE_PREAD */
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* pwrite
|
|
|
|
*
|
|
|
|
* FIXME: this is not thread-safe
|
|
|
|
*/
|
|
|
|
#ifndef HAVE_PWRITE
|
|
|
|
ssize_t pwrite( int fd, const void *buf, size_t count, off_t offset )
|
|
|
|
{
|
|
|
|
ssize_t ret;
|
|
|
|
off_t old_pos;
|
|
|
|
|
|
|
|
if ((old_pos = lseek( fd, 0, SEEK_CUR )) == -1) return -1;
|
|
|
|
if (lseek( fd, offset, SEEK_SET ) == -1) return -1;
|
|
|
|
if ((ret = write( fd, buf, count )) == -1)
|
|
|
|
{
|
|
|
|
int err = errno; /* save errno */
|
|
|
|
lseek( fd, old_pos, SEEK_SET );
|
|
|
|
errno = err;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (lseek( fd, old_pos, SEEK_SET ) == -1) return -1;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#endif /* HAVE_PWRITE */
|
|
|
|
|
|
|
|
|
2001-12-14 23:47:45 +01:00
|
|
|
#if defined(__svr4__) || defined(__NetBSD__)
|
2001-09-07 20:46:14 +02:00
|
|
|
/***********************************************************************
|
2001-12-14 23:47:45 +01:00
|
|
|
* try_mmap_fixed
|
2001-09-07 20:46:14 +02:00
|
|
|
*
|
|
|
|
* The purpose of this routine is to emulate the behaviour of
|
|
|
|
* the Linux mmap() routine if a non-NULL address is passed,
|
|
|
|
* but the MAP_FIXED flag is not set. Linux in this case tries
|
|
|
|
* to place the mapping at the specified address, *unless* the
|
|
|
|
* range is already in use. Solaris, however, completely ignores
|
|
|
|
* the address argument in this case.
|
|
|
|
*
|
|
|
|
* As Wine code occasionally relies on the Linux behaviour, e.g. to
|
|
|
|
* be able to map non-relocateable PE executables to their proper
|
|
|
|
* start addresses, or to map the DOS memory to 0, this routine
|
|
|
|
* emulates the Linux behaviour by checking whether the desired
|
|
|
|
* address range is still available, and placing the mapping there
|
|
|
|
* using MAP_FIXED if so.
|
|
|
|
*/
|
2001-12-14 23:47:45 +01:00
|
|
|
static int try_mmap_fixed (void *addr, size_t len, int prot, int flags,
|
|
|
|
int fildes, off_t off)
|
2001-09-07 20:46:14 +02:00
|
|
|
{
|
|
|
|
char * volatile result = NULL;
|
|
|
|
int pagesize = getpagesize();
|
|
|
|
pid_t pid;
|
|
|
|
|
|
|
|
/* We only try to map to a fixed address if
|
|
|
|
addr is non-NULL and properly aligned,
|
|
|
|
and MAP_FIXED isn't already specified. */
|
|
|
|
|
|
|
|
if ( !addr )
|
2001-11-06 00:52:30 +01:00
|
|
|
return 0;
|
2001-09-07 20:46:14 +02:00
|
|
|
if ( (uintptr_t)addr & (pagesize-1) )
|
2001-11-06 00:52:30 +01:00
|
|
|
return 0;
|
2001-09-07 20:46:14 +02:00
|
|
|
if ( flags & MAP_FIXED )
|
2001-11-06 00:52:30 +01:00
|
|
|
return 0;
|
2001-09-07 20:46:14 +02:00
|
|
|
|
|
|
|
/* We use vfork() to freeze all threads of the
|
|
|
|
current process. This allows us to check without
|
|
|
|
race condition whether the desired memory range is
|
|
|
|
already in use. Note that because vfork() shares
|
|
|
|
the address spaces between parent and child, we
|
|
|
|
can actually perform the mapping in the child. */
|
|
|
|
|
|
|
|
if ( (pid = vfork()) == -1 )
|
|
|
|
{
|
2001-12-14 23:47:45 +01:00
|
|
|
perror("try_mmap_fixed: vfork");
|
2001-09-07 20:46:14 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if ( pid == 0 )
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
char vec;
|
|
|
|
|
|
|
|
/* We call mincore() for every page in the desired range.
|
|
|
|
If any of these calls succeeds, the page is already
|
|
|
|
mapped and we must fail. */
|
|
|
|
for ( i = 0; i < len; i += pagesize )
|
|
|
|
if ( mincore( (caddr_t)addr + i, pagesize, &vec ) != -1 )
|
|
|
|
_exit(1);
|
|
|
|
|
|
|
|
/* Perform the mapping with MAP_FIXED set. This is safe
|
|
|
|
now, as none of the pages is currently in use. */
|
|
|
|
result = mmap( addr, len, prot, flags | MAP_FIXED, fildes, off );
|
|
|
|
if ( result == addr )
|
|
|
|
_exit(0);
|
|
|
|
|
|
|
|
if ( result != (void *) -1 ) /* This should never happen ... */
|
|
|
|
munmap( result, len );
|
|
|
|
|
|
|
|
_exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* vfork() lets the parent continue only after the child
|
|
|
|
has exited. Furthermore, Wine sets SIGCHLD to SIG_IGN,
|
|
|
|
so we don't need to wait for the child. */
|
|
|
|
|
|
|
|
return result == addr;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-11-08 05:28:54 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* wine_anon_mmap
|
|
|
|
*
|
|
|
|
* Portable wrapper for anonymous mmaps
|
|
|
|
*/
|
|
|
|
void *wine_anon_mmap( void *start, size_t size, int prot, int flags )
|
|
|
|
{
|
2002-05-15 01:18:23 +02:00
|
|
|
#ifdef HAVE_MMAP
|
2000-11-08 05:28:54 +01:00
|
|
|
static int fdzero = -1;
|
|
|
|
|
|
|
|
#ifdef MAP_ANON
|
|
|
|
flags |= MAP_ANON;
|
|
|
|
#else
|
|
|
|
if (fdzero == -1)
|
|
|
|
{
|
|
|
|
if ((fdzero = open( "/dev/zero", O_RDONLY )) == -1)
|
|
|
|
{
|
|
|
|
perror( "/dev/zero: open" );
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* MAP_ANON */
|
2000-12-18 04:50:15 +01:00
|
|
|
|
2000-11-08 05:28:54 +01:00
|
|
|
#ifdef MAP_SHARED
|
|
|
|
flags &= ~MAP_SHARED;
|
|
|
|
#endif
|
2000-12-18 04:50:15 +01:00
|
|
|
|
|
|
|
/* Linux EINVAL's on us if we don't pass MAP_PRIVATE to an anon mmap */
|
2000-11-08 05:28:54 +01:00
|
|
|
#ifdef MAP_PRIVATE
|
|
|
|
flags |= MAP_PRIVATE;
|
|
|
|
#endif
|
2000-12-18 04:50:15 +01:00
|
|
|
|
2001-12-14 23:47:45 +01:00
|
|
|
#if defined(__svr4__) || defined(__NetBSD__)
|
|
|
|
if ( try_mmap_fixed( start, size, prot, flags, fdzero, 0 ) )
|
2001-09-07 20:46:14 +02:00
|
|
|
return start;
|
|
|
|
#endif
|
|
|
|
|
2000-11-08 05:28:54 +01:00
|
|
|
return mmap( start, size, prot, flags, fdzero, 0 );
|
2002-05-15 01:18:23 +02:00
|
|
|
#else
|
|
|
|
return (void *)-1;
|
|
|
|
#endif
|
2000-11-08 05:28:54 +01:00
|
|
|
}
|
2000-12-13 22:32:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These functions provide wrappers around dlopen() and associated
|
|
|
|
* functions. They work around a bug in glibc 2.1.x where calling
|
|
|
|
* a dl*() function after a previous dl*() function has failed
|
|
|
|
* without a dlerror() call between the two will cause a crash.
|
|
|
|
* They all take a pointer to a buffer that
|
|
|
|
* will receive the error description (from dlerror()). This
|
|
|
|
* parameter may be NULL if the error description is not required.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* wine_dlopen
|
|
|
|
*/
|
|
|
|
void *wine_dlopen( const char *filename, int flag, char *error, int errorsize )
|
|
|
|
{
|
2001-06-27 23:42:00 +02:00
|
|
|
#ifdef HAVE_DLOPEN
|
2000-12-13 22:32:55 +01:00
|
|
|
void *ret;
|
2002-04-01 23:08:16 +02:00
|
|
|
const char *s;
|
2000-12-13 22:32:55 +01:00
|
|
|
dlerror(); dlerror();
|
|
|
|
ret = dlopen( filename, flag );
|
|
|
|
s = dlerror();
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, s ? s : "", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
dlerror();
|
|
|
|
return ret;
|
|
|
|
#else
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, "dlopen interface not detected by configure", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* wine_dlsym
|
|
|
|
*/
|
|
|
|
void *wine_dlsym( void *handle, const char *symbol, char *error, int errorsize )
|
|
|
|
{
|
2001-06-27 23:42:00 +02:00
|
|
|
#ifdef HAVE_DLOPEN
|
2000-12-13 22:32:55 +01:00
|
|
|
void *ret;
|
2002-04-01 23:08:16 +02:00
|
|
|
const char *s;
|
2000-12-13 22:32:55 +01:00
|
|
|
dlerror(); dlerror();
|
|
|
|
ret = dlsym( handle, symbol );
|
|
|
|
s = dlerror();
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, s ? s : "", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
dlerror();
|
|
|
|
return ret;
|
|
|
|
#else
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, "dlopen interface not detected by configure", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* wine_dlclose
|
|
|
|
*/
|
|
|
|
int wine_dlclose( void *handle, char *error, int errorsize )
|
|
|
|
{
|
2001-06-27 23:42:00 +02:00
|
|
|
#ifdef HAVE_DLOPEN
|
2000-12-13 22:32:55 +01:00
|
|
|
int ret;
|
2002-04-01 23:08:16 +02:00
|
|
|
const char *s;
|
2000-12-13 22:32:55 +01:00
|
|
|
dlerror(); dlerror();
|
|
|
|
ret = dlclose( handle );
|
|
|
|
s = dlerror();
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, s ? s : "", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
dlerror();
|
|
|
|
return ret;
|
|
|
|
#else
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
strncpy( error, "dlopen interface not detected by configure", errorsize );
|
|
|
|
error[errorsize - 1] = '\0';
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
}
|
2000-12-19 05:50:49 +01:00
|
|
|
|
2001-01-13 00:07:11 +01:00
|
|
|
#ifndef HAVE_ECVT
|
|
|
|
/***********************************************************************
|
|
|
|
* ecvt
|
|
|
|
*/
|
|
|
|
char *ecvt (double number, int ndigits, int *decpt, int *sign)
|
|
|
|
{
|
2001-10-02 19:18:09 +02:00
|
|
|
static char buf[40]; /* ought to be enough */
|
2001-01-13 00:07:11 +01:00
|
|
|
char *dec;
|
2002-06-01 01:06:46 +02:00
|
|
|
sprintf(buf, "%.*e", ndigits /* FIXME wrong */, number);
|
2001-01-13 00:07:11 +01:00
|
|
|
*sign = (number < 0);
|
|
|
|
dec = strchr(buf, '.');
|
|
|
|
*decpt = (dec) ? (int)dec - (int)buf : -1;
|
|
|
|
return buf;
|
|
|
|
}
|
2002-12-14 00:30:54 +01:00
|
|
|
#endif /* HAVE_ECVT */
|
2001-01-13 00:07:11 +01:00
|
|
|
|
2002-12-14 00:30:54 +01:00
|
|
|
#ifndef HAVE_FCVT
|
2001-01-13 00:07:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* fcvt
|
|
|
|
*/
|
|
|
|
char *fcvt (double number, int ndigits, int *decpt, int *sign)
|
|
|
|
{
|
2001-10-02 19:18:09 +02:00
|
|
|
static char buf[40]; /* ought to be enough */
|
2001-01-13 00:07:11 +01:00
|
|
|
char *dec;
|
|
|
|
sprintf(buf, "%.*e", ndigits, number);
|
|
|
|
*sign = (number < 0);
|
|
|
|
dec = strchr(buf, '.');
|
|
|
|
*decpt = (dec) ? (int)dec - (int)buf : -1;
|
|
|
|
return buf;
|
|
|
|
}
|
2002-12-14 00:30:54 +01:00
|
|
|
#endif /* HAVE_FCVT */
|
2001-01-13 00:07:11 +01:00
|
|
|
|
2002-12-14 00:30:54 +01:00
|
|
|
#ifndef HAVE_GCVT
|
2001-01-13 00:07:11 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* gcvt
|
|
|
|
*
|
|
|
|
* FIXME: uses both E and F.
|
|
|
|
*/
|
|
|
|
char *gcvt (double number, size_t ndigit, char *buff)
|
|
|
|
{
|
2001-10-02 19:18:09 +02:00
|
|
|
sprintf(buff, "%.*E", (int)ndigit, number);
|
2001-01-13 00:07:11 +01:00
|
|
|
return buff;
|
|
|
|
}
|
2002-12-14 00:30:54 +01:00
|
|
|
#endif /* HAVE_GCVT */
|
2002-04-25 23:40:56 +02:00
|
|
|
|
|
|
|
|
2002-10-18 02:27:38 +02:00
|
|
|
#ifndef wine_memcpy_unaligned
|
|
|
|
/***********************************************************************
|
|
|
|
* wine_memcpy_unaligned
|
|
|
|
*
|
|
|
|
* This is necessary to defeat optimizations of memcpy by gcc.
|
|
|
|
*/
|
|
|
|
void *wine_memcpy_unaligned( void *dst, const void *src, size_t size )
|
|
|
|
{
|
|
|
|
return memcpy( dst, src, size );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2002-11-25 22:12:26 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* pthread functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HAVE_PTHREAD_GETSPECIFIC
|
|
|
|
void pthread_getspecific() { assert(0); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_PTHREAD_KEY_CREATE
|
|
|
|
void pthread_key_create() { assert(0); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_PTHREAD_MUTEX_LOCK
|
|
|
|
void pthread_mutex_lock() { assert(0); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_PTHREAD_MUTEX_UNLOCK
|
|
|
|
void pthread_mutex_unlock() { assert(0); }
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAVE_PTHREAD_SETSPECIFIC
|
|
|
|
void pthread_setspecific() { assert(0); }
|
|
|
|
#endif
|
|
|
|
|
2002-04-25 23:40:56 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* interlocked functions
|
|
|
|
*/
|
|
|
|
#ifdef __i386__
|
|
|
|
|
2002-08-17 03:22:59 +02:00
|
|
|
#ifdef __GNUC__
|
|
|
|
|
2002-04-25 23:40:56 +02:00
|
|
|
__ASM_GLOBAL_FUNC(interlocked_cmpxchg,
|
|
|
|
"movl 12(%esp),%eax\n\t"
|
|
|
|
"movl 8(%esp),%ecx\n\t"
|
|
|
|
"movl 4(%esp),%edx\n\t"
|
|
|
|
"lock; cmpxchgl %ecx,(%edx)\n\t"
|
|
|
|
"ret");
|
|
|
|
__ASM_GLOBAL_FUNC(interlocked_cmpxchg_ptr,
|
|
|
|
"movl 12(%esp),%eax\n\t"
|
|
|
|
"movl 8(%esp),%ecx\n\t"
|
|
|
|
"movl 4(%esp),%edx\n\t"
|
|
|
|
"lock; cmpxchgl %ecx,(%edx)\n\t"
|
|
|
|
"ret");
|
|
|
|
__ASM_GLOBAL_FUNC(interlocked_xchg,
|
|
|
|
"movl 8(%esp),%eax\n\t"
|
|
|
|
"movl 4(%esp),%edx\n\t"
|
|
|
|
"lock; xchgl %eax,(%edx)\n\t"
|
|
|
|
"ret");
|
|
|
|
__ASM_GLOBAL_FUNC(interlocked_xchg_ptr,
|
|
|
|
"movl 8(%esp),%eax\n\t"
|
|
|
|
"movl 4(%esp),%edx\n\t"
|
|
|
|
"lock; xchgl %eax,(%edx)\n\t"
|
|
|
|
"ret");
|
|
|
|
__ASM_GLOBAL_FUNC(interlocked_xchg_add,
|
|
|
|
"movl 8(%esp),%eax\n\t"
|
|
|
|
"movl 4(%esp),%edx\n\t"
|
|
|
|
"lock; xaddl %eax,(%edx)\n\t"
|
|
|
|
"ret");
|
|
|
|
|
2002-08-17 03:22:59 +02:00
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
|
|
|
|
__declspec(naked) long interlocked_cmpxchg( long *dest, long xchg, long compare )
|
|
|
|
{
|
|
|
|
__asm mov eax, 12[esp];
|
|
|
|
__asm mov ecx, 8[esp];
|
|
|
|
__asm mov edx, 4[esp];
|
|
|
|
__asm lock cmpxchg [edx], ecx;
|
|
|
|
__asm ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(naked) void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
|
|
|
|
{
|
|
|
|
__asm mov eax, 12[esp];
|
|
|
|
__asm mov ecx, 8[esp];
|
|
|
|
__asm mov edx, 4[esp];
|
|
|
|
__asm lock cmpxchg [edx], ecx;
|
|
|
|
__asm ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(naked) long interlocked_xchg( long *dest, long val )
|
|
|
|
{
|
|
|
|
__asm mov eax, 8[esp];
|
|
|
|
__asm mov edx, 4[esp];
|
|
|
|
__asm lock xchg [edx], eax;
|
|
|
|
__asm ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(naked) void *interlocked_xchg_ptr( void **dest, void *val )
|
|
|
|
{
|
|
|
|
__asm mov eax, 8[esp];
|
|
|
|
__asm mov edx, 4[esp];
|
|
|
|
__asm lock xchg [edx], eax;
|
|
|
|
__asm ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
__declspec(naked) long interlocked_xchg_add( long *dest, long incr )
|
|
|
|
{
|
|
|
|
__asm mov eax, 8[esp];
|
|
|
|
__asm mov edx, 4[esp];
|
|
|
|
__asm lock xadd [edx], eax;
|
|
|
|
__asm ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
# error You must implement the interlocked* functions for your compiler
|
|
|
|
#endif
|
|
|
|
|
2002-08-07 01:51:25 +02:00
|
|
|
#elif defined(__powerpc__)
|
|
|
|
void* interlocked_cmpxchg_ptr( void **dest, void* xchg, void* compare)
|
|
|
|
{
|
2002-08-20 02:01:15 +02:00
|
|
|
long ret = 0;
|
2002-08-07 01:51:25 +02:00
|
|
|
long scratch;
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"0: lwarx %0,0,%2 ;"
|
|
|
|
" xor. %1,%4,%0;"
|
|
|
|
" bne 1f;"
|
|
|
|
" stwcx. %3,0,%2;"
|
|
|
|
" bne- 0b;"
|
|
|
|
"1: "
|
|
|
|
: "=&r"(ret), "=&r"(scratch)
|
|
|
|
: "r"(dest), "r"(xchg), "r"(compare)
|
2002-08-20 02:01:15 +02:00
|
|
|
: "cr0","memory");
|
2002-08-07 01:51:25 +02:00
|
|
|
return (void*)ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
long interlocked_cmpxchg( long *dest, long xchg, long compare)
|
|
|
|
{
|
2002-08-20 02:01:15 +02:00
|
|
|
long ret = 0;
|
2002-08-07 01:51:25 +02:00
|
|
|
long scratch;
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"0: lwarx %0,0,%2 ;"
|
|
|
|
" xor. %1,%4,%0;"
|
|
|
|
" bne 1f;"
|
|
|
|
" stwcx. %3,0,%2;"
|
|
|
|
" bne- 0b;"
|
|
|
|
"1: "
|
|
|
|
: "=&r"(ret), "=&r"(scratch)
|
|
|
|
: "r"(dest), "r"(xchg), "r"(compare)
|
2002-08-20 02:01:15 +02:00
|
|
|
: "cr0","memory");
|
2002-08-07 01:51:25 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
long interlocked_xchg_add( long *dest, long incr )
|
|
|
|
{
|
2002-08-20 02:01:15 +02:00
|
|
|
long ret = 0;
|
2002-08-07 01:51:25 +02:00
|
|
|
long zero = 0;
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"0: lwarx %0, %3, %1;"
|
|
|
|
" add %0, %2, %0;"
|
|
|
|
" stwcx. %0, %3, %1;"
|
|
|
|
" bne- 0b;"
|
2002-08-20 02:01:15 +02:00
|
|
|
: "=&r" (ret)
|
|
|
|
: "r"(dest), "r"(incr), "r"(zero)
|
2002-08-07 01:51:25 +02:00
|
|
|
: "cr0", "memory"
|
|
|
|
);
|
2002-08-20 02:01:15 +02:00
|
|
|
return ret-incr;
|
2002-08-07 01:51:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
long interlocked_xchg( long* dest, long val )
|
|
|
|
{
|
2002-08-20 02:01:15 +02:00
|
|
|
long ret = 0;
|
2002-08-07 01:51:25 +02:00
|
|
|
__asm__ __volatile__(
|
|
|
|
"0: lwarx %0,0,%1 ;"
|
|
|
|
" stwcx. %2,0,%1;"
|
|
|
|
" bne- 0b;"
|
|
|
|
: "=&r"(ret)
|
|
|
|
: "r"(dest), "r"(val)
|
2002-08-20 02:01:15 +02:00
|
|
|
: "cr0","memory");
|
|
|
|
return ret;
|
2002-08-07 01:51:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void* interlocked_xchg_ptr( void** dest, void* val )
|
|
|
|
{
|
2002-08-20 02:01:15 +02:00
|
|
|
void *ret = NULL;
|
2002-08-07 01:51:25 +02:00
|
|
|
__asm__ __volatile__(
|
|
|
|
"0: lwarx %0,0,%1 ;"
|
|
|
|
" stwcx. %2,0,%1;"
|
|
|
|
" bne- 0b;"
|
|
|
|
: "=&r"(ret)
|
|
|
|
: "r"(dest), "r"(val)
|
2002-08-20 02:01:15 +02:00
|
|
|
: "cr0","memory");
|
|
|
|
return ret;
|
2002-08-07 01:51:25 +02:00
|
|
|
}
|
|
|
|
|
2002-04-25 23:40:56 +02:00
|
|
|
#elif defined(__sparc__) && defined(__sun__)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* As the earlier Sparc processors lack necessary atomic instructions,
|
|
|
|
* I'm simply falling back to the library-provided _lwp_mutex routines
|
2002-06-01 01:06:46 +02:00
|
|
|
* to ensure mutual exclusion in a way appropriate for the current
|
|
|
|
* architecture.
|
2002-04-25 23:40:56 +02:00
|
|
|
*
|
|
|
|
* FIXME: If we have the compare-and-swap instruction (Sparc v9 and above)
|
|
|
|
* we could use this to speed up the Interlocked operations ...
|
|
|
|
*/
|
|
|
|
#include <synch.h>
|
|
|
|
static lwp_mutex_t interlocked_mutex = DEFAULTMUTEX;
|
|
|
|
|
|
|
|
long interlocked_cmpxchg( long *dest, long xchg, long compare )
|
|
|
|
{
|
|
|
|
_lwp_mutex_lock( &interlocked_mutex );
|
|
|
|
if (*dest == compare) *dest = xchg;
|
|
|
|
else compare = *dest;
|
|
|
|
_lwp_mutex_unlock( &interlocked_mutex );
|
|
|
|
return compare;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
|
|
|
|
{
|
|
|
|
_lwp_mutex_lock( &interlocked_mutex );
|
|
|
|
if (*dest == compare) *dest = xchg;
|
|
|
|
else compare = *dest;
|
|
|
|
_lwp_mutex_unlock( &interlocked_mutex );
|
|
|
|
return compare;
|
|
|
|
}
|
|
|
|
|
|
|
|
long interlocked_xchg( long *dest, long val )
|
|
|
|
{
|
|
|
|
long retv;
|
|
|
|
_lwp_mutex_lock( &interlocked_mutex );
|
|
|
|
retv = *dest;
|
|
|
|
*dest = val;
|
|
|
|
_lwp_mutex_unlock( &interlocked_mutex );
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *interlocked_xchg_ptr( void **dest, void *val )
|
|
|
|
{
|
|
|
|
long retv;
|
|
|
|
_lwp_mutex_lock( &interlocked_mutex );
|
|
|
|
retv = *dest;
|
|
|
|
*dest = val;
|
|
|
|
_lwp_mutex_unlock( &interlocked_mutex );
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
long interlocked_xchg_add( long *dest, long incr )
|
|
|
|
{
|
|
|
|
long retv;
|
|
|
|
_lwp_mutex_lock( &interlocked_mutex );
|
|
|
|
retv = *dest;
|
|
|
|
*dest += incr;
|
|
|
|
_lwp_mutex_unlock( &interlocked_mutex );
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# error You must implement the interlocked* functions for your CPU
|
|
|
|
#endif
|