Commit 4f8c37b4 authored by Alexandre Julliard's avatar Alexandre Julliard

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.
parent d7d4fdf8
This is release 951226 of Wine the MS Windows emulator. This is still a
This is release 960114 of Wine the MS Windows emulator. This is still a
developer's only release. There are many bugs and many unimplemented API
features. Most applications still do not work.
Patches should be submitted to "wine-new@amscons.com". Please don't forget
to include a ChangeLog entry. I'll make a new release every other week.
WHAT'S NEW with Wine-951226: (see ChangeLog for details)
- Many more Winelib fixes.
- Language is now a run-time option.
WHAT'S NEW with Wine-960114: (see ChangeLog for details)
- Complete rewrite of the file handling; still has a few bugs.
- Tons of new Win32 code.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
......@@ -16,10 +16,10 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-951226.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-951226.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-951226.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-951226.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-960114.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960114.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960114.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960114.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
......
----------------------------------------------------------------------
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.
* [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.
----------------------------------------------------------------------
Sat Dec 23 18:15:59 1995 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in] [Makefile.in] [tools/install-sh]
......
......@@ -49,6 +49,7 @@ MAIN_TARGET = @MAIN_TARGET@
COMMONSUBDIRS = \
rc \
controls \
files \
ipc \
loader \
misc \
......@@ -72,6 +73,7 @@ ALLSUBDIRS = $(COMMONSUBDIRS) $(EMUSUBDIRS) $(LIBSUBDIRS) libtest
COMMONOBJS = \
controls/controls.o \
files/files.o \
ipc/ipc.o \
loader/loader.o \
misc/misc.o \
......
......@@ -685,7 +685,6 @@ else
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
test "x${GCC}" = "xyes" && CFLAGS="$CFLAGS -Wall -fno-strength-reduce"
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
......@@ -701,7 +700,7 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 705 "configure"
#line 704 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
......@@ -715,7 +714,7 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 719 "configure"
#line 718 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
......@@ -821,7 +820,7 @@ test -z "$x_direct_test_library" && x_direct_test_library=Xt
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
cat > conftest.$ac_ext <<EOF
#line 825 "configure"
#line 824 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
......@@ -884,7 +883,7 @@ rm -f conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 888 "configure"
#line 887 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1003,7 +1002,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1007 "configure"
#line 1006 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1047,7 +1046,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1051 "configure"
#line 1050 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1082,7 +1081,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1086 "configure"
#line 1085 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1122,7 +1121,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1126 "configure"
#line 1125 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1161,7 +1160,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1165 "configure"
#line 1164 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1266,7 +1265,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1270 "configure"
#line 1269 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1389,7 +1388,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li386 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1393 "configure"
#line 1392 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1417,14 +1416,80 @@ fi
for ac_func in tcgetattr
if test "x${GCC}" = "xyes"
then
CFLAGS="$CFLAGS -Wall"
# If we cannot run a trivial program, we must be cross compiling.
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
#line 1432 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_cross=no
else
ac_cv_c_cross=yes
fi
fi
rm -fr conftest*
fi
echo "$ac_t""$ac_cv_c_cross" 1>&6
cross_compiling=$ac_cv_c_cross
echo $ac_n "checking "for gcc strength-reduce bug"""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_c_gcc_strength_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_gcc_strength_bug="yes"
else
cat > conftest.$ac_ext <<EOF
#line 1457 "configure"
#include "confdefs.h"
int main(void) {
static int Array3;
unsigned int B = 3;
int i;
for(i=0; i<B; i++) Arrayi = i - 3;
exit( Array1 != -2 );
}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_gcc_strength_bug="no"
else
ac_cv_c_gcc_strength_bug="yes"
fi
fi
rm -fr conftest*
fi
echo "$ac_t""$ac_cv_c_gcc_strength_bug" 1>&6
if test "$ac_cv_c_gcc_strength_bug" = "yes"
then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
fi
for ac_func in tcgetattr usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1428 "configure"
#line 1493 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
......@@ -1476,7 +1541,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1480 "configure"
#line 1545 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
......@@ -1509,7 +1574,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1513 "configure"
#line 1578 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
......@@ -1564,7 +1629,7 @@ if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1568 "configure"
#line 1633 "configure"
#include "confdefs.h"
int main() { return 0; }
......@@ -1633,38 +1698,12 @@ EOF
fi
# If we cannot run a trivial program, we must be cross compiling.
echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_cross=yes
else
cat > conftest.$ac_ext <<EOF
#line 1646 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
eval $ac_link
if test -s conftest && (./conftest; exit) 2>/dev/null; then
ac_cv_c_cross=no
else
ac_cv_c_cross=yes
fi
fi
rm -fr conftest*
fi
echo "$ac_t""$ac_cv_c_cross" 1>&6
cross_compiling=$ac_cv_c_cross
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1668 "configure"
#line 1707 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
......@@ -1686,7 +1725,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1690 "configure"
#line 1729 "configure"
#include "confdefs.h"
#include <string.h>
EOF
......@@ -1704,7 +1743,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1708 "configure"
#line 1747 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
......@@ -1725,7 +1764,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1729 "configure"
#line 1768 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
......@@ -1760,7 +1799,7 @@ if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1764 "configure"
#line 1803 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
......@@ -1896,6 +1935,7 @@ Makefile
controls/Makefile
debugger/Makefile
debugger/readline/Makefile
files/Makefile
if1632/Makefile
ipc/Makefile
library/Makefile
......@@ -1967,6 +2007,7 @@ Makefile
controls/Makefile
debugger/Makefile
debugger/readline/Makefile
files/Makefile
if1632/Makefile
ipc/Makefile
library/Makefile
......
......@@ -29,8 +29,6 @@ dnl **** Check for some programs and libraries ****
AC_PROG_MAKE_SET
AC_PROG_CC
dnl Add some options for gcc
test "x${GCC}" = "xyes" && CFLAGS="$CFLAGS -Wall -fno-strength-reduce"
AC_PROG_CPP
AC_PATH_XTRA
AC_PROG_YACC
......@@ -40,9 +38,33 @@ AC_PROG_INSTALL
dnl Check for -li386 for NetBSD
AC_CHECK_LIB(i386,i386_set_ldt,LDLIBS="$LDLIBS -li386")
dnl **** Check for gcc strength-reduce bug ****
if test "x${GCC}" = "xyes"
then
CFLAGS="$CFLAGS -Wall"
AC_C_CROSS
AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
AC_TRY_RUN([
int main(void) {
static int Array[3];
unsigned int B = 3;
int i;
for(i=0; i<B; i++) Array[i] = i - 3;
exit( Array[1] != -2 );
}],
ac_cv_c_gcc_strength_bug="no",
ac_cv_c_gcc_strength_bug="yes",
ac_cv_c_gcc_strength_bug="yes") )
if test "$ac_cv_c_gcc_strength_bug" = "yes"
then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
fi
dnl **** Check for functions and header files ****
AC_CHECK_FUNCS(tcgetattr)
AC_CHECK_FUNCS(tcgetattr usleep)
AC_CHECK_HEADERS(stdlib.h)
AC_HEADER_STAT()
AC_C_CONST()
......@@ -59,6 +81,7 @@ Makefile
controls/Makefile
debugger/Makefile
debugger/readline/Makefile
files/Makefile
if1632/Makefile
ipc/Makefile
library/Makefile
......
......@@ -20,6 +20,7 @@
#include "graphics.h"
#include "listbox.h"
#include "dos_fs.h"
#include "drive.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
......@@ -996,48 +997,28 @@ BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, int nIDLBox)
/************************************************************************
* DlgDirListComboBox [USER.195]
*/
int DlgDirListComboBox(HWND hDlg, SEGPTR PathSpec,
int nIDLBox, int nIDStat, WORD wType)
INT DlgDirListComboBox( HWND hDlg, SEGPTR path, INT idCBox,
INT idStatic, WORD wType )
{
HWND hWnd;
int ret;
LPSTR lpPathSpec = PTR_SEG_TO_LIN(PathSpec);
dprintf_combo(stddeb,"DlgDirListComboBox("NPFMT", '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
if (nIDLBox) {
LPHEADLIST lphl;
LPHEADCOMBO lphc;
hWnd = GetDlgItem(hDlg, nIDLBox);
lphl = ComboGetListHeader(hWnd);
lphc = ComboGetStorageHeader(hWnd);
ListBoxResetContent(lphl);
ret = ListBoxDirectory(lphl, wType, lpPathSpec);
ComboUpdateWindow(hWnd, lphl, lphc, TRUE);
} else {
ret = 0;
}
if (nIDStat) {
int drive;
HANDLE hTemp;
char *temp;
drive = DOS_GetDefaultDrive();
hTemp = USER_HEAP_ALLOC( 256 );
temp = (char *) USER_HEAP_LIN_ADDR( hTemp );
strcpy( temp+3, DOS_GetCurrentDir(drive) );
if( temp[3] == '\\' ) {
temp[1] = 'A'+drive;
temp[2] = ':';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
(LPARAM)(USER_HEAP_SEG_ADDR(hTemp) + 1) );
} else {
temp[0] = 'A'+drive;
temp[1] = ':';
temp[2] = '\\';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
(LPARAM)USER_HEAP_SEG_ADDR(hTemp) );
}
USER_HEAP_FREE( hTemp );
}
return ret;
INT ret = 0;
dprintf_combo( stddeb,"DlgDirListComboBox("NPFMT",%08lx,%d,%d,%04X) \n",
hDlg, (DWORD)path, idCBox, idStatic, wType );
if (idCBox)
{
SendDlgItemMessage( hDlg, idCBox, CB_RESETCONTENT, 0, 0 );
ret = (SendDlgItemMessage( hDlg, idCBox, CB_DIR, wType, path ) >= 0);
}
if (idStatic)
{
char temp[256];
int drive = DRIVE_GetCurrentDrive();
strcpy( temp, "A:\\" );
temp[0] += drive;
lstrcpyn( temp+3, DRIVE_GetDosCwd(drive), 253 );
SendDlgItemMessage( hDlg, idStatic, WM_SETTEXT,
0, (LPARAM)MAKE_SEGPTR(temp) );
}
return ret;
}
......@@ -22,18 +22,19 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
*
* Load a bitmap from a file. Used by SetDeskWallPaper().
*/
static HBITMAP DESKTOP_LoadBitmap( HDC hdc, char *filename )
static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
{
BITMAPFILEHEADER *fileHeader;
BITMAPINFO *bitmapInfo;
HBITMAP hbitmap;
char *unixFileName, *buffer;
char *buffer;
const char *unixFileName;
int file;
long size;
/* Read all the file into memory */
if (!(unixFileName = DOS_GetUnixFileName( filename ))) return 0;
if (!(unixFileName = DOSFS_GetUnixFileName( filename, TRUE ))) return 0;
if ((file = open( unixFileName, O_RDONLY )) == -1) return 0;
size = lseek( file, 0, SEEK_END );
if (!(buffer = (char *)malloc( size )))
......@@ -159,7 +160,7 @@ BOOL SetDeskPattern(void)
/***********************************************************************
* SetDeskWallPaper (USER.285)
*/
BOOL SetDeskWallPaper( LPSTR filename )
BOOL SetDeskWallPaper( LPCSTR filename )
{
HBITMAP hbitmap;
HDC hdc;
......
......@@ -24,6 +24,8 @@
#include "msdos.h"
#include "listbox.h"
#include "dos_fs.h"
#include "drive.h"
#include "stackframe.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
......@@ -633,65 +635,79 @@ int ListBoxGetSel(LPHEADLIST lphl, WORD wIndex)
int ListBoxDirectory(LPHEADLIST lphl, UINT attrib, LPSTR filespec)
{
struct dosdirent *dp, *dp_old;
char temp[256];
int drive;
LPSTR tstr;
const char *pathPtr, *maskPtr;
char mask[12], path[MAX_PATHNAME_LEN];
int skip, count;
DOS_DIRENT entry;
char temp[256];
int drive;
LPSTR tstr;
dprintf_listbox(stddeb,"ListBoxDirectory: %s, %4x\n",filespec,attrib);
if (strchr(filespec, '\\') || strchr(filespec, ':')) {
drive = DOS_GetDefaultDrive();
if (filespec[1] == ':') {
drive = toupper(filespec[0]) - 'A';
filespec += 2;
}
else drive = DRIVE_GetCurrentDrive();
strcpy(temp,filespec);
tstr = strrchr(temp, '\\');
if (tstr != NULL) {
*(tstr+1) = 0;
filespec += tstr - temp + 1;
if (!DOS_ChangeDir( drive, temp )) return 0;
if (!DRIVE_Chdir( drive, temp )) return 0;
}
DOS_SetDefaultDrive( drive );
DRIVE_SetCurrentDrive( drive );
dprintf_listbox(stddeb,"Changing directory to %c:%s, filemask is %s\n",
drive+'A', temp, filespec);
}
if ((dp = (struct dosdirent *)DOS_opendir(filespec)) ==NULL) return 0;
dp_old = dp;
while ((dp = (struct dosdirent *)DOS_readdir(dp))) {
if (!dp->inuse) break;
dprintf_listbox(stddeb, "ListBoxDirectory %p '%s' !\n", dp->filename,
dp->filename);
if (dp->attribute & FA_DIREC) {
if (attrib & DDL_DIRECTORY && strcmp(dp->filename, ".") != 0) {
sprintf(temp, "[%s]", dp->filename);
if (ListBoxAddString(lphl, temp) == LB_ERR) break;
}
}
else {
if (attrib & DDL_EXCLUSIVE) {
if (attrib & (DDL_READWRITE | DDL_READONLY | DDL_HIDDEN | DDL_SYSTEM)) {
if (ListBoxAddString(lphl, dp->filename) == LB_ERR) break;
}
} else {
if (ListBoxAddString(lphl, dp->filename) == LB_ERR) break;
}
if (!(maskPtr = DOSFS_ToDosFCBFormat( filespec ))) return 0;
strcpy( mask, maskPtr );
if (!(pathPtr = DOSFS_GetUnixFileName( ".", TRUE ))) return 0;
lstrcpyn( path, pathPtr, sizeof(path) );
skip = 0;
drive = DRIVE_GetCurrentDrive();
while ((count = DOSFS_FindNext( path, mask, drive,
attrib, skip, &entry )) > 0)
{
skip += count;
if (entry.attr & FA_DIRECTORY)
{
if ((attrib & DDL_DIRECTORY) && strcmp(entry.name, "."))
{
sprintf(temp, "[%s]", entry.name);
if (ListBoxAddString(lphl, temp) == LB_ERR) break;
}
}
else /* not a directory */
{
if (!(attrib & DDL_EXCLUSIVE) ||
((attrib & (FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCHIVE)) ==
(entry.attr & (FA_RDONLY|FA_HIDDEN|FA_SYSTEM|FA_ARCHIVE))))
{
if (ListBoxAddString(lphl, entry.name) == LB_ERR) break;
}
}
}
}
DOS_closedir(dp_old);
if (attrib & DDL_DRIVES) {
int x;
for (x = 0; x != MAX_DOS_DRIVES ; x++) {
if (DOS_ValidDrive(x)) {
sprintf(temp, "[-%c-]", 'a'+x);
if (ListBoxInsertString(lphl, (UINT)-1, temp) == LB_ERR) break;
}
if (attrib & DDL_DRIVES)
{
int x;
for (x = 0; x < MAX_DOS_DRIVES; x++)
{
if (DRIVE_IsValid(x))
{
sprintf(temp, "[-%c-]", 'a'+x);
if (ListBoxInsertString(lphl, (UINT)-1, temp) == LB_ERR) break;
}
}
}
}
return 1;
return 1;
}
/* ------------------------- dimensions ------------------------- */
......@@ -1923,45 +1939,26 @@ BOOL DlgDirSelect(HWND hDlg, LPSTR lpStr, int nIDLBox)
/************************************************************************
* DlgDirList [USER.100]
*/
int DlgDirList(HWND hDlg, LPSTR lpPathSpec,
int nIDLBox, int nIDStat, WORD wType)
INT DlgDirList( HWND hDlg, SEGPTR path, INT idLBox, INT idStatic, WORD wType )
{
HWND hWnd;
int ret;
INT ret = 0;
dprintf_listbox(stddeb,"DlgDirList("NPFMT", '%s', %d, %d, %04X) \n",
hDlg, lpPathSpec, nIDLBox, nIDStat, wType);
if (nIDLBox) {
LPHEADLIST lphl;
hWnd = GetDlgItem(hDlg, nIDLBox);
lphl = ListBoxGetStorageHeader(hWnd);
ListBoxResetContent(lphl);
ret = ListBoxDirectory(lphl, wType, lpPathSpec);
ListBoxUpdateWindow(hWnd, lphl, TRUE);
} else {
ret = 0;
}
if (nIDStat) {
int drive;
HANDLE hTemp;
char *temp;
drive = DOS_GetDefaultDrive();
hTemp = USER_HEAP_ALLOC( 256 );
temp = (char *) USER_HEAP_LIN_ADDR( hTemp );
strcpy( temp+3, DOS_GetCurrentDir(drive) );
if( temp[3] == '\\' ) {
temp[1] = 'A'+drive;
temp[2] = ':';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
(LPARAM)(USER_HEAP_SEG_ADDR(hTemp) + 1) );
} else {
temp[0] = 'A'+drive;
temp[1] = ':';
temp[2] = '\\';
SendDlgItemMessage( hDlg, nIDStat, WM_SETTEXT, 0,
(LPARAM)USER_HEAP_SEG_ADDR(hTemp) );
}
USER_HEAP_FREE( hTemp );
}
return ret;
dprintf_listbox( stddeb, "DlgDirList("NPFMT", %08lx, %d, %d, %04X) \n",
hDlg, (DWORD)path, idLBox, idStatic, wType );
if (idLBox)
{
SendDlgItemMessage( hDlg, idLBox, LB_RESETCONTENT, 0, 0 );
ret = (SendDlgItemMessage( hDlg, idLBox, LB_DIR, wType, path ) >= 0);
}
if (idStatic)
{
char temp[256];
int drive = DRIVE_GetCurrentDrive();
strcpy( temp, "A:\\" );
temp[0] += drive;
lstrcpyn( temp+3, DRIVE_GetDosCwd(drive), 253 );
SendDlgItemMessage( hDlg, idStatic, WM_SETTEXT,
0, (LPARAM)MAKE_SEGPTR(temp) );
}
return ret;
}
......@@ -57,7 +57,6 @@ extern void NC_DrawSysButton(HWND hwnd, HDC hdc, BOOL down); /* nonclient.c */
static HBITMAP hStdCheck = 0;
static HBITMAP hStdMnArrow = 0;
HMENU CopySysMenu();
WORD * ParseMenuResource(WORD *first_item, int level, HMENU hMenu);
......@@ -102,6 +101,30 @@ static BOOL MENU_HasSysMenu( POPUPMENU *menu )
}
/**********************************************************************
* MENU_CopySysMenu
*/
static HMENU MENU_CopySysMenu(void)
{
HMENU hMenu;
HGLOBAL handle;
POPUPMENU *menu;
if (!(handle = SYSRES_LoadResource( SYSRES_MENU_SYSMENU ))) return 0;
hMenu = LoadMenuIndirect( GlobalLock( handle ) );
SYSRES_FreeResource( handle );
if (!hMenu)
{
dprintf_menu(stddeb,"No SYSMENU\n");
return 0;
}
menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hMenu);
menu->wFlags |= MF_SYSMENU | MF_POPUP;
dprintf_menu(stddeb,"CopySysMenu hMenu="NPFMT" !\n", hMenu);
return hMenu;
}
/***********************************************************************
* MENU_IsInSysMenu
*
......@@ -1549,8 +1572,10 @@ BOOL ChangeMenu(HMENU hMenu, UINT nPos, LPSTR lpNewItem,
return AppendMenu(hMenu, wFlags & ~MF_APPEND, wItemID, lpNewItem);
}
if (wFlags & MF_DELETE) {
return DeleteMenu(hMenu, wFlags & MF_BYPOSITION ? nPos : wItemID,
wFlags & ~MF_DELETE);
/* FIXME: Word passes the item id in nPos and 0 or 0xffff as id */
/* for MF_DELETE. We should check the parameters for all others */
/* MF_* actions also (anybody got a doc on ChangeMenu?). */
return DeleteMenu(hMenu, nPos, wFlags & ~MF_DELETE);
}
if (wFlags & MF_CHANGE) {
return ModifyMenu(hMenu, nPos, wFlags & ~MF_CHANGE, wItemID, lpNewItem);
......@@ -2015,8 +2040,8 @@ HMENU GetSystemMenu(HWND hWnd, BOOL bRevert)
if (!wndPtr) return 0;
if (!bRevert) return wndPtr->hSysMenu;
DestroyMenu(wndPtr->hSysMenu);
wndPtr->hSysMenu = CopySysMenu();
if (wndPtr->hSysMenu) DestroyMenu(wndPtr->hSysMenu);
wndPtr->hSysMenu = MENU_CopySysMenu();
return wndPtr->hSysMenu;
}
......@@ -2181,30 +2206,6 @@ HMENU LoadMenuIndirect(LPSTR menu_template)
/**********************************************************************
* CopySysMenu (Internal)
*/
HMENU CopySysMenu()
{
HMENU hMenu;
HGLOBAL handle;
LPPOPUPMENU menu;
if (!(handle = SYSRES_LoadResource( SYSRES_MENU_SYSMENU ))) return 0;
hMenu = LoadMenuIndirect( GlobalLock( handle ) );
SYSRES_FreeResource( handle );
if(!hMenu)
{
dprintf_menu(stddeb,"No SYSMENU\n");
return 0;
}
menu = (POPUPMENU*) USER_HEAP_LIN_ADDR(hMenu);
menu->wFlags |= MF_SYSMENU|MF_POPUP;
dprintf_menu(stddeb,"CopySysMenu hMenu="NPFMT" !\n", hMenu);
return hMenu;
}
/**********************************************************************
* ParseMenuResource (from Resource or Template)
*/
WORD * ParseMenuResource(WORD *first_item, int level, HMENU hMenu)
......
......@@ -770,7 +770,7 @@ LONG ScrollBarWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
if (lpCreat->style & SBS_SIZEBOX)
{
fprintf( stdnimp, "Unimplemented style SBS_SIZEBOX.\n" );
return -1;
return 0; /* FIXME */
}
if (lpCreat->style & SBS_VERT)
......
......@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include "debugger.h"
#include "xmalloc.h"
#include "y.tab.h"
#ifdef USE_READLINE
......@@ -202,7 +203,7 @@ static char *local_symbols[10];
static int next_symbol;
char * make_symbol(char * symbol){
return local_symbols[next_symbol++] = strdup(symbol);
return local_symbols[next_symbol++] = xstrdup(symbol);
}
void
......
......@@ -51,7 +51,7 @@ void DEBUG_AddSymbol( const char * name, const DBG_ADDR *addr )
new = (struct name_hash *) xmalloc(sizeof(struct name_hash));
new->addr = *addr;
new->name = strdup(name);
new->name = xstrdup(name);
new->next = NULL;
hash = name_hash(name);
......
......@@ -66,6 +66,10 @@ void DEBUG_BackTrace(void)
if (SS_reg(DEBUG_context) == WINE_DATA_SELECTOR) /* 32-bit mode */
{
addr.seg = 0;
fprintf(stderr,"%d ",frameno++);
addr.off = EIP_reg(DEBUG_context);
DEBUG_PrintAddress( &addr, 32 );
fprintf( stderr, "\n" );
addr.off = EBP_reg(DEBUG_context);
for (;;)
{
......@@ -87,7 +91,12 @@ void DEBUG_BackTrace(void)
fprintf( stderr, "Not implemented: 32-bit backtrace on a different stack segment.\n" );
return;
}
addr.seg = SS_reg(DEBUG_context);
fprintf( stderr,"%d ", frameno++ );
addr.seg = cs;
addr.off = IP_reg(DEBUG_context);
DEBUG_PrintAddress( &addr, 16 );
fprintf( stderr, "\n" );
addr.seg = ss;
addr.off = BP_reg(DEBUG_context) & ~1;
for (;;)
{
......
This file documents the necessary procedure for adding a new language
to the list of languages that Wine can display system menus and forms
in.
To add a new language you need to be able to translate the relatively
few texts, of course. You will need very little knowledge of
programming, so you have almost no excuses for not adding your language,
right? We should easily be able to support 20 languages within a few
months, get going! Apart from re-compilation it'll take you about an
hour.
To add a new language to the list of languages that Wine can handle
you must...
1. Edit resources/Makefile.in variable "LANGUAGES" to include a new
abbreviation for the language.
2. Edit ./wine.man (search for -language) to show the new language
abbreviation.
3. Edit misc/main.c variable "langNames" to contain the new language
abbreviation. Also edit macro "USAGE" to show the new abbreviation.
4. Edit include/options.h enum "WINE_LANGUAGE" to have a member called
LANG_XX where XX is the new abbreviation.
5. Edit misc/ole2nls.c function "GetUserDefaultLCID" to contain an
extra case for your language. The correct return values seem to
be a mystery, but don't worry.
6. Edit resources/sysrec.c to include "sysres_XX.h" where XX is the
abbreviation for your language. (That file will be produced auto-
matically.) Edit variable "SYSRES_Resources" to contain an entry
for your language.
7. Create a new file, resources/sysres_XX.rc, where XX is the
abbreviation that you chose. Your best bet is to copy one of the
other *.rc files and start translating. [Warning: the author of
this file does not know the details of the structure of these
files. There seems to be no need to, however.]
In menus, the character "&" means that the next character will
be highlighted and that pressing that letter will select the item.
You should place these "&"s suitably for your language, not just
copy the positions from (say) English. In particular, items within
one menu should have different highlighted letters.
8. Edit misc/ole2nls.c function "GetLocaleInfoA" to contain a case for
your language.
9. Re-configure, re-make dependencies, and re-make Wine.
10. Check your new menus and forms; when they're ok, submit patches
for inclusion in the next Wine release, see file ./ANNOUNCE for
details about where to submit.
January 1996
Morten Welinder
[I hope I got all the places where changes are needed. If you see any
place missing from the above list, submit a patch to this file please.
Also note that re-organization of the source code might change the list
of places.]
TOPSRC = @top_srcdir@
MODULE = files
C_SRCS = \
directory.c \
dos_fs.c \
drive.c \
file.c
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
/*
* DOS directories functions
*
* Copyright 1995 Alexandre Julliard
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "windows.h"
#include "dos_fs.h"
#include "drive.h"
#include "file.h"
#include "msdos.h"
#include "xmalloc.h"
#include "stddebug.h"
#include "debug.h"
#define MAX_PATH_ELEMENTS 20
static char *DIR_WindowsDosDir;
static char *DIR_WindowsUnixDir;
static char *DIR_SystemDosDir;
static char *DIR_SystemUnixDir;
static char *DIR_TempDosDir;
static char *DIR_TempUnixDir;
static char *DIR_DosPath[MAX_PATH_ELEMENTS]; /* Path in DOS format */
static char *DIR_UnixPath[MAX_PATH_ELEMENTS]; /* Path in Unix format */
static int DIR_PathElements = 0;
/***********************************************************************
* DIR_GetPath
*
* Get a path name from the wine.ini file and make sure it is valid.
*/
static int DIR_GetPath( const char *keyname, const char *defval,
char **dos_path, char **unix_path )
{
char path[MAX_PATHNAME_LEN];
const char *dos_name ,*unix_name;
BYTE attr;
GetPrivateProfileString( "wine", keyname, defval,
path, sizeof(path), WineIniFileName() );
if (!(unix_name = DOSFS_GetUnixFileName( path, TRUE )) ||
!FILE_Stat( unix_name, &attr, NULL, NULL, NULL ) ||
!(attr & FA_DIRECTORY))
{
fprintf(stderr, "Invalid path '%s' for %s directory\n", path, keyname);
return 0;
}
if (!(dos_name = DOSFS_GetDosTrueName( unix_name, TRUE )))
{
fprintf( stderr, "Could not get DOS name for %s directory '%s'\n",
keyname, unix_name );
return 0;
}
*unix_path = xstrdup( unix_name );
*dos_path = xstrdup( dos_name );
return 1;
}
/***********************************************************************
* DIR_ParseWindowsPath
*/
void DIR_ParseWindowsPath( char *path )
{
char *p;
const char *dos_name ,*unix_name;
BYTE attr;
int i;
for ( ; path && *path; path = p)
{
p = strchr( path, ';' );
if (p) while (*p == ';') *p++ = '\0';
if (DIR_PathElements >= MAX_PATH_ELEMENTS)
{
fprintf( stderr, "Warning: path has more than %d elements.\n",
MAX_PATH_ELEMENTS );
break;
}
if (!(unix_name = DOSFS_GetUnixFileName( path, TRUE )) ||
!FILE_Stat( unix_name, &attr, NULL, NULL, NULL ) ||
!(attr & FA_DIRECTORY))
{
fprintf(stderr,"Warning: invalid dir '%s' in path, deleting it.\n",
path );
continue;
}
if (!(dos_name = DOSFS_GetDosTrueName( unix_name, TRUE )))
{
fprintf( stderr, "Warning: could not get DOS name for '%s' in path, deleting it.\n",
unix_name );
continue;
}
DIR_UnixPath[DIR_PathElements] = xstrdup( unix_name );
DIR_DosPath[DIR_PathElements] = xstrdup( dos_name );
DIR_PathElements++;
}
if (debugging_dosfs)
for (i = 0; i < DIR_PathElements; i++)
{
dprintf_dosfs( stddeb, "Path[%d]: %s = %s\n",
i, DIR_DosPath[i], DIR_UnixPath[i] );
}
}
/***********************************************************************
* DIR_Init
*/
int DIR_Init(void)
{
char path[MAX_PATHNAME_LEN];
int drive;
const char *cwd;
if (!getcwd( path, MAX_PATHNAME_LEN ))
{
perror( "Could not get current directory" );
return 0;
}
cwd = path;
if ((drive = DRIVE_FindDriveRoot( &cwd )) == -1)
{
fprintf( stderr, "Warning: could not find DOS drive for cwd %s; starting in windows directory.\n",
cwd );
}
else
{
cwd = DOSFS_GetDosTrueName( path, TRUE );
DRIVE_SetCurrentDrive( drive );
DRIVE_Chdir( drive, cwd + 2 );
}
if (!(DIR_GetPath( "windows", "c:\\windows",
&DIR_WindowsDosDir, &DIR_WindowsUnixDir ))) return 0;
if (!(DIR_GetPath( "system", "c:\\windows\\system",
&DIR_SystemDosDir, &DIR_SystemUnixDir ))) return 0;
if (!(DIR_GetPath( "temp", "c:\\windows",
&DIR_TempDosDir, &DIR_TempUnixDir ))) return 0;
if (drive == -1)
{
drive = DIR_WindowsDosDir[0] - 'A';
DRIVE_SetCurrentDrive( drive );
DRIVE_Chdir( drive, DIR_WindowsDosDir + 2 );
}
GetPrivateProfileString( "wine", "path", "c:\\windows;c:\\windows\\system",
path, sizeof(path), WineIniFileName() );
DIR_ParseWindowsPath( path );
dprintf_dosfs( stddeb, "WindowsDir = %s\nSystemDir = %s\n",
DIR_WindowsDosDir, DIR_SystemDosDir );
dprintf_dosfs( stddeb, "TempDir = %s\nCwd = %c:\\%s\n",
DIR_TempDosDir, 'A' + drive, DRIVE_GetDosCwd( drive ) );
return 1;
}
/***********************************************************************
* DIR_GetTempDosDir
*/
UINT DIR_GetTempDosDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_TempDosDir, count );
return strlen( DIR_TempDosDir );
}
/***********************************************************************
* DIR_GetTempUnixDir
*/
UINT DIR_GetTempUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_TempUnixDir, count );
return strlen( DIR_TempUnixDir );
}
/***********************************************************************
* DIR_GetWindowsUnixDir
*/
UINT DIR_GetWindowsUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_WindowsUnixDir, count );
return strlen( DIR_WindowsUnixDir );
}
/***********************************************************************
* DIR_GetSystemUnixDir
*/
UINT DIR_GetSystemUnixDir( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_SystemUnixDir, count );
return strlen( DIR_SystemUnixDir );
}
/***********************************************************************
* DIR_GetDosPath
*/
UINT DIR_GetDosPath( int element, LPSTR path, UINT count )
{
if ((element < 0) || (element >= DIR_PathElements)) return 0;
if (path) lstrcpyn( path, DIR_DosPath[element], count );
return strlen( DIR_DosPath[element] );
}
/***********************************************************************
* GetTempDrive (KERNEL.92)
*/
BYTE GetTempDrive( BYTE ignored )
{
return DIR_TempDosDir[0];
}
/***********************************************************************
* GetWindowsDirectory (KERNEL.134)
*/
UINT GetWindowsDirectory( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_WindowsDosDir, count );
return strlen( DIR_WindowsDosDir );
}
/***********************************************************************
* GetSystemDirectory (KERNEL.135)
*/
UINT GetSystemDirectory( LPSTR path, UINT count )
{
if (path) lstrcpyn( path, DIR_SystemDosDir, count );
return strlen( DIR_SystemDosDir );
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -51,4 +51,20 @@ call32.S: $(SPEC16_FILES)
clean::
rm -f $(SPEC16_FILES) $(SPEC32_FILES) call32.S call16.S
# Kludge: don't use optimisation flags to compile these files
advapi32.o: advapi32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o advapi32.o advapi32.c
comdlg32.o: comdlg32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o comdlg32.o comdlg32.c
gdi32.o: gdi32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o gdi32.o gdi32.c
kernel32.o: kernel32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o kernel32.o kernel32.c
shell32.o: shell32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o shell32.o shell32.c
user32.o: user32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o user32.o user32.c
winprocs32.o: winprocs32.c
$(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o winprocs32.o winprocs32.c
### Dependencies:
......@@ -37,10 +37,12 @@ LONG CallWindowProc( WNDPROC func, HWND hwnd, WORD message,
(hwnd,message,wParam,lParam);
if(!a->win32)
fprintf(stderr,"Where is the Win32 callback?\n");
return RELAY32_CallWindowProc(a->win32,hwnd,message,wParam,lParam);
if (UsesLParamPtr(message))
return RELAY32_CallWindowProc(a->win32,hwnd,message,wParam,lParam ? PTR_SEG_TO_LIN(lParam): 0);
else
return RELAY32_CallWindowProc(a->win32,hwnd,message,wParam,lParam);
}
/**********************************************************************
* Catch (KERNEL.55)
*/
......
......@@ -232,7 +232,7 @@ id 3
346 pascal16 SetTextAlign(word word) SetTextAlign
348 pascal16 Chord(word s_word s_word s_word s_word s_word s_word
s_word s_word) Chord
349 pascal SetMapperFlags(word word) SetMapperFlags
349 pascal SetMapperFlags(word long) SetMapperFlags
350 pascal16 GetCharWidth(word word word ptr) GetCharWidth
351 pascal16 ExtTextOut(word s_word s_word word ptr ptr s_word ptr) ExtTextOut
352 stub GetPhysicalFontHandle
......
......@@ -11,7 +11,7 @@ base 1
0007 stub Arc
0008 stub ArcTo
0009 stub BeginPath
0010 stub BitBlt
0010 stdcall BitBlt(long long long long long long long long long) BitBlt
0011 stub CancelDC
0012 stub CheckColorsInGamut
0013 stub ChoosePixelFormat
......@@ -31,8 +31,8 @@ base 1
0027 stub CreateBrushIndirect
0028 stub CreateColorSpaceA
0029 stub CreateColorSpaceW
0030 stub CreateCompatibleBitmap
0031 stub CreateCompatibleDC
0030 stdcall CreateCompatibleBitmap(long long long) CreateCompatibleBitmap
0031 stdcall CreateCompatibleDC(long) CreateCompatibleDC
0032 stub CreateDCA
0033 stub CreateDCW
0034 stub CreateDIBPatternBrush
......@@ -50,13 +50,13 @@ base 1
0046 stub CreateFontW
0047 stub CreateHalftonePalette
0048 stub CreateHatchBrush
0049 stub CreateICA
0049 stdcall CreateICA(ptr ptr ptr ptr) CreateIC
0050 stub CreateICW
0051 stub CreateMetaFileA
0052 stub CreateMetaFileW
0053 stub CreatePalette
0054 stub CreatePatternBrush
0055 stub CreatePen
0055 stdcall CreatePen(long long long) CreatePen
0056 stub CreatePenIndirect
0057 stub CreatePolyPolygonRgn
0058 stub CreatePolygonRgn
......@@ -65,10 +65,10 @@ base 1
0061 stub CreateRoundRectRgn
0062 stub CreateScalableFontResourceA
0063 stub CreateScalableFontResourceW
0064 stub CreateSolidBrush
0064 stdcall CreateSolidBrush(long) CreateSolidBrush
0065 stub DPtoLP
0066 stub DeleteColorSpace
0067 stub DeleteDC
0067 stdcall DeleteDC(long) DeleteDC
0068 stub DeleteEnhMetaFile
0069 stub DeleteMetaFile
0070 stub DeleteObject
......@@ -172,7 +172,7 @@ base 1
0168 stub GetDCOrgEx
0169 stub GetDIBColorTable
0170 stub GetDIBits
0171 stub GetDeviceCaps
0171 stdcall GetDeviceCaps(long long) GetDeviceCaps
0172 stub GetDeviceGammaRamp
0173 stub GetETM
0174 stub GetEnhMetaFileA
......@@ -205,7 +205,7 @@ base 1
0201 stub GetMiterLimit
0202 stub GetNearestColor
0203 stub GetNearestPaletteIndex
0204 stub GetObjectA
0204 stdcall GetObjectA(long long ptr) GetObject
0205 stub GetObjectType
0206 stub GetObjectW
0207 stub GetOutlineTextMetricsA
......@@ -233,7 +233,7 @@ base 1
0229 stub GetTextExtentExPointW
0230 stub GetTextExtentPoint32A
0231 stub GetTextExtentPoint32W
0232 stub GetTextExtentPointA
0232 stdcall GetTextExtentPointA(long ptr long ptr) GetTextExtentPoint
0233 stub GetTextExtentPointW
0234 stub GetTextFaceA
0235 stub GetTextFaceW
......@@ -250,18 +250,18 @@ base 1
0246 stub InvertRgn
0247 stub LPtoDP
0248 stub LineDDA
0249 stub LineTo
0249 stdcall LineTo(long long long) LineTo
0250 stub LoadImageColorMatcherA
0251 stub LoadImageColorMatcherW
0252 stub MaskBlt
0253 stub ModifyWorldTransform
0254 stub MoveToEx
0254 stdcall MoveToEx(long long long ptr) MoveToEx
0255 stub OffsetClipRgn
0256 stub OffsetRgn
0257 stub OffsetViewportOrgEx
0258 stub OffsetWindowOrgEx
0259 stub PaintRgn
0260 stub PatBlt
0260 stdcall PatBlt(long long long long long long) PatBlt
0261 stub PathToRegion
0262 stub Pie
0263 stub PlayEnhMetaFile
......@@ -300,13 +300,13 @@ base 1
0296 stub SelectClipPath
0297 stub SelectClipRgn
0298 stub SelectFontLocal
0299 stub SelectObject
0299 stdcall SelectObject(long long) SelectObject
0300 stub SelectPalette
0301 stub SetAbortProc
0302 stub SetArcDirection
0303 stub SetBitmapBits
0304 stub SetBitmapDimensionEx
0305 stub SetBkColor
0305 stdcall SetBkColor(long long) SetBkColor
0306 stub SetBkMode
0307 stub SetBoundsRect
0308 stub SetBrushOrgEx
......@@ -339,7 +339,7 @@ base 1
0335 stub SetSystemPaletteUse
0336 stub SetTextAlign
0337 stub SetTextCharacterExtra
0338 stub SetTextColor
0338 stdcall SetTextColor(long long) SetTextColor
0339 stub SetTextJustification
0340 stub SetViewportExtEx
0341 stub SetViewportOrgEx
......
......@@ -80,7 +80,7 @@ id 1
81 pascal16 _lclose(word) _lclose
82 pascal16 _lread(word ptr word) _lread
83 pascal16 _lcreat(ptr word) _lcreat
84 pascal _llseek(word long word) _llseek
84 pascal _llseek(word long word) _llseek
85 pascal16 _lopen(ptr word) _lopen
86 pascal16 _lwrite(word ptr word) _lwrite
87 pascal16 RESERVED5(ptr ptr) lstrcmp
......@@ -103,7 +103,7 @@ id 1
104 stub GetCodeInfo
105 stub GetExeVersion
106 pascal SetSwapAreaSize(word) SetSwapAreaSize
107 pascal SetErrorMode(word) SetErrorMode
107 pascal16 SetErrorMode(word) SetErrorMode
108 stub SwitchStackTo
109 stub SwitchStackBack
110 pascal16 PatchCodeHandle(word) PatchCodeHandle
......@@ -205,15 +205,15 @@ id 1
205 stub CVWBreak
206 pascal16 AllocSelectorArray(word) AllocSelectorArray
207 return IsDBCSLeadByte 2 0
216 stub RegEnumKey
217 stub RegOpenKey
218 stub RegCreateKey
216 pascal RegEnumKey(long long ptr long) RegEnumKey
217 pascal RegOpenKey(long ptr ptr) RegOpenKey
218 pascal RegCreateKey(long ptr ptr) RegCreateKey
219 stub RegDeleteValue
220 stub RegCloseKey
221 stub RegSetValue
220 pascal RegCloseKey(long) RegCloseKey
221 pascal RegSetValue(long ptr long ptr long) RegSetValue
222 stub RegDeleteValue
223 stub RegEnumValue
224 stub RegQueryValue
224 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue
225 stub RegQueryValueEx
226 stub RegSetValueEx
227 stub RegFlushKey
......@@ -255,9 +255,9 @@ id 1
345 stub IsSharedSelector
346 pascal16 IsBadHugeReadPtr(segptr long) IsBadHugeReadPtr
347 pascal16 IsBadHugeWritePtr(segptr long) IsBadHugeWritePtr
348 pascal hmemcpy(ptr ptr long) hmemcpy
349 pascal _hread(word ptr long) _hread
350 pascal _hwrite(word ptr long) _hwrite
348 pascal16 hmemcpy(ptr ptr long) hmemcpy
349 pascal _hread(word ptr long) _hread
350 pascal _hwrite(word ptr long) _hwrite
#351 BUNNY_351
352 stub lstrcatn
353 pascal lstrcpyn(segptr segptr word) WIN16_lstrcpyn
......
......@@ -129,7 +129,7 @@ base 1
0125 stub FindNextChangeNotification
0126 stub FindNextFileA
0127 stub FindNextFileW
0128 stub FindResourceA
0128 stdcall FindResourceA(long ptr ptr) FindResource32
0129 stub FindResourceExA
0130 stub FindResourceExW
0131 stub FindResourceW
......@@ -146,7 +146,7 @@ base 1
0142 stub FreeEnvironmentStringsW
0143 stub FreeLibrary
0144 stub FreeLibraryAndExitThread
0145 stub FreeResource
0145 stdcall FreeResource(long) FreeResource32
0146 stub FreeVirtualBuffer
0147 stub GenerateConsoleCtrlEvent
0148 stdcall GetACP() GetACP
......@@ -252,13 +252,13 @@ base 1
0248 stdcall GetOEMCP() GetOEMCP
0249 stub GetOverlappedResult
0250 stub GetPriorityClass
0251 stub GetPrivateProfileIntA
0251 stdcall GetPrivateProfileIntA(ptr ptr long ptr) GetPrivateProfileInt
0252 stub GetPrivateProfileIntW
0253 stub GetPrivateProfileSectionA
0254 stub GetPrivateProfileSectionW
0255 stub GetPrivateProfileStringA
0256 stub GetPrivateProfileStringW
0257 stub GetProcAddress
0257 stdcall GetProcAddress(long long) WIN32_GetProcAddress
0258 stub GetProcessAffinityMask
0259 return GetProcessHeap 0 0
0260 stub GetProcessHeaps
......@@ -336,7 +336,7 @@ base 1
0331 stub GlobalUnfix
0332 stub GlobalUnlock
0333 stub GlobalWire
0334 stub HeapAlloc
0334 stdcall HeapAlloc(long long long) HeapAlloc
0335 stub HeapCompact
0336 stub HeapCreate
0337 stub HeapDestroy
......@@ -367,12 +367,12 @@ base 1
0362 stub LCMapStringA
0363 stub LCMapStringW
0364 stub LeaveCriticalSection
0365 stub LoadLibraryA
0365 stdcall LoadLibraryA(long) LoadLibraryA
0366 stub LoadLibraryExA
0367 stub LoadLibraryExW
0368 stub LoadLibraryW
0369 stub LoadModule
0370 stub LoadResource
0370 stdcall LoadResource(long long) LoadResource32
0371 stdcall LocalAlloc(long long) GlobalAlloc32
0372 stub LocalCompact
0373 stub LocalFileTimeToFileTime
......@@ -420,7 +420,7 @@ base 1
0415 stub QueryPerformanceCounter
0416 stub QueryPerformanceFrequency
0417 stub QueryWin31IniFilesMappedToRegistry
0418 stub RaiseException
0418 stdcall RaiseException(long long long ptr) RaiseException
0419 stub ReadConsoleA
0420 stub ReadConsoleInputA
0421 stub ReadConsoleInputW
......@@ -496,7 +496,7 @@ base 1
0491 stub SetFileAttributesW
0492 stdcall SetFilePointer(long long ptr long) SetFilePointer
0493 stub SetFileTime
0494 stub SetHandleCount
0494 stdcall SetHandleCount(long) W32_SetHandleCount
0495 stub SetHandleInformation
0496 stub SetLastConsoleEventActive
0497 stdcall SetLastError(long) SetLastError
......
......@@ -15,8 +15,8 @@
#include "pe_image.h"
#include "peexe.h"
#include "relay32.h"
#include "xmalloc.h"
#include "stddebug.h"
/* #define DEBUG_RELAY */
#include "debug.h"
WIN32_builtin *WIN32_builtin_list;
......@@ -54,7 +54,7 @@ WIN32_builtin *RELAY32_GetBuiltinDLL(char *name)
len = (cp=strchr(name,'.')) ? (cp-name) : strlen(name);
for(it=WIN32_builtin_list;it;it=it->next)
if(strncasecmp(name,it->name,len)==0)
if(lstrncmpi(name,it->name,len)==0)
return it;
return NULL;
}
......@@ -78,19 +78,22 @@ void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
int i;
u_short * ordinal;
u_long * function;
u_char ** name, *ename;
u_char ** name;
struct PE_Export_Directory * pe_exports;
unsigned int load_addr;
dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
item ? item: "(no name)", dll_name, hint);
dll=RELAY32_GetBuiltinDLL(dll_name);
/* This should deal with built-in DLLs only. See pe_module on loading
PE DLLs */
#if 0
if(!dll) {
if(!wine_files || !wine_files->name ||
strcasecmp(dll_name, wine_files->name)) {
lstrcmpi(dll_name, wine_files->name)) {
LoadModule(dll_name, (LPVOID) -1);
if(!wine_files || !wine_files->name ||
strcasecmp(dll_name, wine_files->name))
lstrcmpi(dll_name, wine_files->name))
return 0;
}
load_addr = wine_files->load_addr;
......@@ -118,7 +121,7 @@ void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
#if 0
if(hint && hint<dll->size && !dll->functions[hint].name)
{
dll->functions[hint].name=strdup(item);
dll->functions[hint].name=xstrdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
dll_name,hint);
return dll->functions[hint].definition;
......@@ -127,6 +130,7 @@ void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
printf("Not found\n");
return 0;
}
#endif
/* import by ordinal */
if(!item){
if(hint && hint<dll->size)return dll->functions[hint].definition;
......@@ -145,12 +149,11 @@ void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
/* function at hint has no name (unimplemented) */
if(hint && hint<dll->size && !dll->functions[hint].name)
{
dll->functions[hint].name=strdup(item);
dll->functions[hint].name=xstrdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
dll_name,hint);
return dll->functions[hint].definition;
}
printf("Not found\n");
return 0;
}
......
......@@ -31,7 +31,7 @@ id 12
77 stub TERMINATEAPP
78 pascal MemoryRead(word long ptr long) MemoryRead
79 pascal MemoryWrite(word long ptr long) MemoryWrite
80 stub TIMERCOUNT
80 pascal16 TimerCount(ptr) TimerCount
81 stub TASKSETCSIP
82 stub TASKGETCSIP
83 stub TASKSWITCH
......@@ -46,7 +46,7 @@ base 1
0042 stub CharUpperBuffW
0043 stub CharUpperW
0044 stub CheckDlgButton
0045 stub CheckMenuItem
0045 stdcall CheckMenuItem(long long long) CheckMenuItem
0046 stub CheckMenuRadioItem
0047 stub CheckRadioButton
0048 stub ChildWindowFromPoint
......@@ -162,10 +162,10 @@ base 1
0157 stub DrawFrameControl
0158 stub DrawIcon
0159 stub DrawIconEx
0160 stub DrawMenuBar
0160 stdcall DrawMenuBar(long) DrawMenuBar
0161 stub DrawStateA
0162 stub DrawStateW
0163 stub DrawTextA
0163 stdcall DrawTextA(long ptr long ptr long) DrawText
0164 stub DrawTextExA
0165 stub DrawTextExW
0166 stub DrawTextW
......@@ -221,7 +221,7 @@ base 1
0216 stub GetClassNameA
0217 stub GetClassNameW
0218 stub GetClassWord
0219 stub GetClientRect
0219 stdcall GetClientRect(long long) GetClientRect
0220 stub GetClipCursor
0221 stub GetClipboardData
0222 stub GetClipboardFormatNameA
......@@ -231,7 +231,7 @@ base 1
0226 stub GetCursor
0227 stub GetCursorInfo
0228 stub GetCursorPos
0229 stub GetDC
0229 stdcall GetDC(long) GetDC
0230 stub GetDCEx
0231 stub GetDesktopWindow
0232 stub GetDialogBaseUnits
......@@ -258,7 +258,7 @@ base 1
0253 stub GetKeyboardState
0254 stub GetKeyboardType
0255 stub GetLastActivePopup
0256 stub GetMenu
0256 stdcall GetMenu(long) GetMenu
0257 stub GetMenuCheckMarkDimensions
0258 stub GetMenuContextHelpId
0259 stub GetMenuDefaultItem
......@@ -293,7 +293,7 @@ base 1
0288 stdcall GetSysColor(long) GetSysColor
0289 stub GetSysColorBrush
0290 stub GetSystemMenu
0291 stub GetSystemMetrics
0291 stdcall GetSystemMetrics(long) GetSystemMetrics
0292 stub GetTabbedTextExtentA
0293 stub GetTabbedTextExtentW
0294 stub GetThreadDesktop
......@@ -305,7 +305,7 @@ base 1
0300 stub GetUserObjectSecurity
0301 stub GetWindow
0302 stub GetWindowContextHelpId
0303 stub GetWindowDC
0303 stdcall GetWindowDC(long) GetWindowDC
0304 stub GetWindowLongA
0305 stub GetWindowLongW
0306 stub GetWindowPlacement
......@@ -346,7 +346,7 @@ base 1
0341 stub IsDialogMessageA
0342 stub IsDialogMessageW
0343 stub IsDlgButtonChecked
0344 stub IsIconic
0344 stdcall IsIconic(long) IsIconic
0345 stub IsMenu
0346 stub IsRectEmpty
0347 stub IsWindow
......@@ -356,16 +356,17 @@ base 1
0351 stub IsZoomed
0352 stub KillSystemTimer
0353 stub KillTimer
0354 stdcall LoadAcceleratorsA(long ptr) LoadAccelerators
0354 stdcall LoadAcceleratorsA(long ptr) LoadAccelerators32
0355 stub LoadAcceleratorsW
0356 stdcall LoadBitmapA(long ptr) LoadBitmap
0356 stdcall LoadBitmapA(long ptr) LoadBitmapA32
0357 stdcall LoadBitmapW(long ptr) LoadBitmapW32
0357 stub LoadBitmapW
0358 stdcall LoadCursorA(long ptr) LoadCursor
0359 stub LoadCursorFromFileA
0360 stub LoadCursorFromFileW
0361 stub LoadCursorW
0362 stdcall LoadIconA(long ptr) LoadIcon
0363 stub LoadIconW
0362 stdcall LoadIconA(long ptr) LoadIconA32
0363 stdcall LoadIconW(long ptr) LoadIconW32
0364 stub LoadImageA
0365 stub LoadImageW
0366 stub LoadKeyboardLayoutA
......@@ -376,8 +377,8 @@ base 1
0371 stub LoadMenuIndirectW
0372 stub LoadMenuW
0373 stub LoadRemoteFonts
0374 stdcall LoadStringA(long long ptr long) LoadString
0375 stub LoadStringW
0374 stdcall LoadStringA(long long ptr long) LoadStringA32
0375 stdcall LoadStringW(long long ptr long) LoadString32
0376 stub LockWindowStation
0377 stub LockWindowUpdate
0378 stub LookupIconIdFromDirectory
......@@ -422,7 +423,7 @@ base 1
0417 stub PlaySoundEvent
0418 stub PostMessageA
0419 stub PostMessageW
0420 stub PostQuitMessage
0420 stdcall PostQuitMessage(long) PostQuitMessage
0421 stub PostThreadMessageA
0422 stub PostThreadMessageW
0423 stub PtInRect
......@@ -441,7 +442,7 @@ base 1
0436 stub RegisterWindowMessageA
0437 stub RegisterWindowMessageW
0438 stub ReleaseCapture
0439 stub ReleaseDC
0439 stdcall ReleaseDC(long long) ReleaseDC
0440 stub RemoveMenu
0441 stub RemovePropA
0442 stub RemovePropW
......@@ -531,7 +532,7 @@ base 1
0526 stub SetWindowsHookExW
0527 stub SetWindowsHookW
0528 stub ShowCaret
0529 stub ShowCursor
0529 stdcall ShowCursor(long) ShowCursor
0530 stub ShowOwnedPopups
0531 stub ShowScrollBar
0532 stub ShowStartGlass
......@@ -553,11 +554,11 @@ base 1
0548 stub TrackPopupMenu
0549 stub TrackPopupMenuEx
0550 stub TranslateAccelerator
0551 stub TranslateAcceleratorA
0551 stdcall TranslateAcceleratorA(long long ptr) TranslateAccelerator
0552 stub TranslateAcceleratorW
0553 stub TranslateCharsetInfo
0554 stub TranslateMDISysAccel
0555 stub TranslateMessage
0555 stdcall TranslateMessage(ptr) USER32_TranslateMessage
0556 stub UnhookWindowsHook
0557 stub UnhookWindowsHookEx
0558 stub UnionRect
......
name winprocs32
1 stdcall ButtonWndProc(long long long long) ButtonWndProc
2 stdcall StaticWndProc(long long long long) StaticWndProc
3 stdcall ScrollBarWndProc(long long long long) ScrollBarWndProc
4 stdcall ListBoxWndProc(long long long long) ListBoxWndProc
5 stdcall ComboBoxWndProc(long long long long) ComboBoxWndProc
6 stdcall EditWndProc(long long long long) EditWndProc
7 stdcall PopupMenuWndProc(long long long long) PopupMenuWndProc
8 stdcall DesktopWndProc(long long long long) DesktopWndProc
9 stdcall DefDlgProc(long long long long) DefDlgProc
10 stdcall MDIClientWndProc(long long long long) MDIClientWndProc
11 stdcall DefWindowProc(long long long long) DefWindowProc
12 stdcall DefMDIChildProc(long long long long) DefMDIChildProc
13 stdcall SystemMessageBoxProc(long long long long) SystemMessageBoxProc
14 stdcall FileOpenDlgProc(long long long long) FileOpenDlgProc
15 stdcall FileSaveDlgProc(long long long long) FileSaveDlgProc
16 stdcall ColorDlgProc(long long long long) ColorDlgProc
17 stdcall FindTextDlgProc(long long long long) FindTextDlgProc
18 stdcall ReplaceTextDlgProc(long long long long) ReplaceTextDlgProc
19 stdcall PrintSetupDlgProc(long long long long) PrintSetupDlgProc
20 stdcall PrintDlgProc(long long long long) PrintDlgProc
21 stdcall AboutDlgProc(long long long long) AboutDlgProc
22 stdcall ComboLBoxWndProc(long long long long) ComboLBoxWndProc
1 stdcall ButtonWndProc(long long long long) ButtonWndProc32
2 stdcall StaticWndProc(long long long long) StaticWndProc32
3 stdcall ScrollBarWndProc(long long long long) ScrollBarWndProc32
4 stdcall ListBoxWndProc(long long long long) ListBoxWndProc32
5 stdcall ComboBoxWndProc(long long long long) ComboBoxWndProc32
6 stdcall EditWndProc(long long long long) EditWndProc32
7 stdcall PopupMenuWndProc(long long long long) PopupMenuWndProc32
8 stdcall DesktopWndProc(long long long long) DesktopWndProc32
9 stdcall DefDlgProc(long long long long) DefDlgProc32
10 stdcall MDIClientWndProc(long long long long) MDIClientWndProc32
11 stdcall DefWindowProc(long long long long) DefWindowProc32
12 stdcall DefMDIChildProc(long long long long) DefMDIChildProc32
13 stdcall SystemMessageBoxProc(long long long long) SystemMessageBoxProc32
14 stdcall FileOpenDlgProc(long long long long) FileOpenDlgProc32
15 stdcall FileSaveDlgProc(long long long long) FileSaveDlgProc32
16 stdcall ColorDlgProc(long long long long) ColorDlgProc32
17 stdcall FindTextDlgProc(long long long long) FindTextDlgProc32
18 stdcall ReplaceTextDlgProc(long long long long) ReplaceTextDlgProc32
19 stdcall PrintSetupDlgProc(long long long long) PrintSetupDlgProc32
20 stdcall PrintDlgProc(long long long long) PrintDlgProc32
21 stdcall AboutDlgProc(long long long long) AboutDlgProc32
22 stdcall ComboLBoxWndProc(long long long long) ComboLBoxWndProc32
23 stdcall CARET_Callback(long long long long) CARET_Callback
......@@ -6,8 +6,8 @@
#if defined (mc68000) || defined (sparc)
#define CONV_LONG(a) (((a)&0xFF) << 24) | (((a) & 0xFF00) << 8) | (((unsigned long)(a) & 0xFF0000) >> 8) | ((unsigned long)((a)&0xFF000000) >> 24)
#define CONV_SHORT(a) (((a) & 0xFF) << 8) | (((unsigned long)(a) & 0xFF00) >> 8)
#define CONV_LONG(a) (((int)(a)&0xFF) << 24) | (((int)(a) & 0xFF00) << 8) | (((unsigned long)(a) & 0xFF0000) >> 8) | (((unsigned long)(a)&0xFF000000) >> 24)
#define CONV_SHORT(a) (((int)(a) & 0xFF) << 8) | (((unsigned long)(a) & 0xFF00) >> 8)
#define CONV_CHAR_TO_LONG(x) ((unsigned long)(x) >> 24)
#define CONV_SHORT_TO_LONG(x) ((unsigned long)(x) >> 16)
......
/*
* DOS directory handling declarations
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_DIRECTORY_H
#define __WINE_DIRECTORY_H
extern int DIR_Init(void);
extern UINT DIR_GetWindowsUnixDir( LPSTR path, UINT count );
extern UINT DIR_GetSystemUnixDir( LPSTR path, UINT count );
extern UINT DIR_GetTempUnixDir( LPSTR path, UINT count );
extern UINT DIR_GetTempDosDir( LPSTR path, UINT count );
extern UINT DIR_GetDosPath( int element, LPSTR path, UINT count );
extern UINT DIR_GetUnixPath( int element, LPSTR path, UINT count );
#endif /* __WINE_DIRECTORY_H */
/*
* DOS file system declarations
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_DOS_FS_H
#define __WINE_DOS_FS_H
#include <wintypes.h>
extern void DOS_InitFS(void);
extern WORD DOS_GetEquipment(void);
extern int DOS_ValidDrive(int drive);
extern int DOS_GetDefaultDrive(void);
extern void DOS_SetDefaultDrive(int drive);
extern void ToUnix(char *s);
extern void ToDos(char *s);
extern int DOS_DisableDrive(int drive);
extern int DOS_EnableDrive(int drive);
extern char *DOS_GetUnixFileName(const char *dosfilename);
extern char *DOS_GetDosFileName(char *unixfilename);
extern char *DOS_GetCurrentDir(int drive);
extern int DOS_ChangeDir(int drive, char *dirname);
extern int DOS_MakeDir(int drive, char *dirname);
extern int DOS_GetSerialNumber(int drive, unsigned long *serialnumber);
extern int DOS_SetSerialNumber(int drive, unsigned long serialnumber);
extern char *DOS_GetVolumeLabel(int drive);
extern int DOS_SetVolumeLabel(int drive, char *label);
#include <time.h>
#include "wintypes.h"
#define MAX_FILENAME_LEN 256
#define MAX_PATHNAME_LEN 1024
typedef struct
{
char name[12]; /* File name in FCB format */
char unixname[MAX_FILENAME_LEN]; /* Unix file name */
DWORD size; /* File size in bytes */
WORD date; /* File date in DOS format */
WORD time; /* File time in DOS format */
BYTE attr; /* File DOS attributes */
} DOS_DIRENT;
#define IS_END_OF_NAME(ch) (!(ch) || ((ch) == '/') || ((ch) == '\\'))
extern void DOSFS_ToDosDateTime( time_t *unixtime, WORD *pDate, WORD *pTime );
extern const char *DOSFS_ToDosFCBFormat( const char *name );
extern const char *DOSFS_ToDosDTAFormat( const char *name );
extern const char *DOSFS_IsDevice( const char *name );
extern const char * DOSFS_GetUnixFileName( const char * name, int check_last );
extern const char * DOSFS_GetDosTrueName( const char *name, int unix_format );
extern int DOSFS_GetDosFileName( const char *name, char *buffer, int len );
extern int DOSFS_FindNext( const char *path, const char *mask, int drive,
BYTE attr, int skip, DOS_DIRENT *entry );
extern int DOS_GetFreeSpace(int drive, long *size, long *available);
extern char *DOS_FindFile(char *buffer, int buflen, const char *rootname, char **extensions, char *path);
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
extern struct dosdirent *DOS_opendir(char *dosdirname);
extern struct dosdirent *DOS_readdir(struct dosdirent *de);
extern void DOS_closedir(struct dosdirent *de);
extern char *DOS_GetRedirectedDir(int drive);
extern void errno_to_doserr(void);
extern int DOS_Error(int extended, int class, int locus);
extern char WindowsPath[256];
#endif /* __WINE_DOS_FS_H */
/*
* DOS drive handling declarations
*
* Copyright 1995 Alexandre Julliard
*/
#ifndef __WINE_DRIVE_H
#define __WINE_DRIVE_H
#include "wintypes.h"
#define MAX_DOS_DRIVES 26
extern int DRIVE_Init(void);
extern int DRIVE_IsValid( int drive );
extern int DRIVE_GetCurrentDrive(void);
extern int DRIVE_SetCurrentDrive( int drive );
extern int DRIVE_FindDriveRoot( const char **path );
extern const char * DRIVE_GetRoot( int drive );
extern const char * DRIVE_GetDosCwd( int drive );
extern const char * DRIVE_GetUnixCwd( int drive );
extern const char * DRIVE_GetLabel( int drive );
extern DWORD DRIVE_GetSerialNumber( int drive );
extern int DRIVE_SetSerialNumber( int drive, DWORD serial );
extern int DRIVE_Chdir( int drive, const char *path );
extern int DRIVE_Disable( int drive );
extern int DRIVE_Enable( int drive );
#endif /* __WINE_DRIVE_H */
/*
* File handling declarations
*
* Copyright 1996 Alexandre Julliard
*/
#ifndef __WINE_FILE_H
#define __WINE_FILE_H
#include "windows.h"
extern void FILE_SetDosError(void);
extern int FILE_GetUnixHandle( HFILE handle );
extern void FILE_CloseAllFiles( HANDLE hPDB );
extern int FILE_Open( LPCSTR path, int mode );
extern int FILE_Create( LPCSTR path, int mode, int unique );
extern int FILE_Stat( LPCSTR unixName, BYTE *pattr, DWORD *psize,
WORD *pdate, WORD *ptime );
extern int FILE_Fstat( HFILE hFile, BYTE *pattr, DWORD *psize,
WORD *pdate, WORD *ptime );
extern int FILE_Unlink( LPCSTR path );
extern int FILE_MakeDir( LPCSTR path );
extern int FILE_RemoveDir( LPCSTR path );
extern HFILE FILE_Dup( HFILE hFile );
extern HFILE FILE_Dup2( HFILE hFile1, HFILE hFile2 );
extern int FILE_OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode );
extern INT _lcreat_uniq( LPCSTR path, INT attr );
#endif /* __WINE_FILE_H */
......@@ -14,6 +14,7 @@ DWORD ErrnoToLastError(int errno_num);
/* Linux's wchar_t is unsigned long but Win32 wants unsigned short
*/
typedef unsigned short WCHAR;
typedef WCHAR *LPTSTR;
/* Code page information.
*/
......
......@@ -15,8 +15,6 @@ extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt ); /* menu.c */
extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam ); /* menu.c */
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
HWND hwnd, BOOL suppress_draw ); /* menu.c */
extern HMENU CopySysMenu(); /* menu.c */
extern LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam );
typedef struct tagMENUITEM
......
......@@ -63,6 +63,8 @@ typedef struct tagMESSAGEQUEUE
#pragma pack(4)
#endif
extern DWORD MSG_WineStartTicks; /* Ticks at Wine startup */
extern void MSG_IncPaintCount( HANDLE hQueue );
extern void MSG_DecPaintCount( HANDLE hQueue );
extern void MSG_IncTimerCount( HANDLE hQueue );
......
......@@ -112,6 +112,7 @@ typedef struct
extern BOOL MODULE_Init(void);
extern int MODULE_OpenFile( HMODULE hModule );
extern LPSTR MODULE_GetModuleName( HMODULE hModule );
extern void MODULE_RegisterModule( HMODULE hModule );
extern WORD MODULE_GetOrdinal( HMODULE hModule, char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
......
......@@ -32,6 +32,22 @@ struct fcb {
BYTE dummy2[9];
};
/* DTA layout for FindFirst/FindNext */
typedef struct
{
BYTE drive; /* 00 drive letter */
char mask[11]; /* 01 search template */
BYTE search_attr; /* 0c search attributes */
WORD count WINE_PACKED; /* 0d entry count within directory */
WORD cluster WINE_PACKED; /* 0f cluster of parent directory */
char *unixPath WINE_PACKED; /* 11 unix path (was: reserved) */
BYTE fileattr; /* 15 file attributes */
WORD filetime; /* 16 file time */
WORD filedate; /* 18 file date */
DWORD filesize WINE_PACKED; /* 1a file size */
char filename[13]; /* 1e file name + extension */
} FINDFILE_DTA;
#define DOSVERSION 0x1606 /* Major version in low byte: DOS 6.22 */
#define WINDOSVER 0x0616 /* Windows reports the DOS version reversed */
......@@ -48,89 +64,94 @@ extern struct DosDeviceStruct LPT[MAX_PORTS];
*((BYTE*)((a)+1)) = ((b)>>8) & 0xff;\
} while(0)
#define setdword(a,b) do { *(BYTE*)(a) = (b) & 0xff; \
*((BYTE*)(a)+1) = ((b)>>8) & 0xff; \
*((BYTE*)(a)+2) = ((b)>>16) & 0xff; \
*((BYTE*)(a)+3) = ((b)>>24) & 0xff; \
} while(0)
#define getword(a) ( (WORD)*(BYTE*)(a) + \
((WORD)*((BYTE*)(a) + 1) << 8))
#define getdword(a) ( (DWORD)*(BYTE*)(a) + \
(DWORD)(*((BYTE*)(a) + 1) << 8) + \
(DWORD)(*((BYTE*)(a) + 2) << 16) + \
(DWORD)(*((BYTE*)(a) + 3) << 24))
/* dos file attributes */
#define FA_NORMAL 0x00 /* Normal file, no attributes */
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
#define FA_ARCH 0x20 /* Archive */
/* extended error codes */
#define NoError 0x00
#define InvalidFunction 0x01
#define FileNotFound 0x02
#define PathNotFound 0x03
#define AccessDenied 0x05
#define InvalidHandle 0x06
#define MCBDestroyed 0x07
#define OutOfMemory 0x08
#define MCBInvalid 0x09
#define DataInvalid 0x0d
#define InvalidDrive 0x0f
#define CanNotRemoveCwd 0x10
#define NotSameDevice 0x11
#define NoMoreFiles 0x12
#define WriteProtected 0x13
#define UnknownUnit 0x14
#define DriveNotReady 0x15
#define UnknownCommand 0x16
#define CRCError 0x17
#define BadRqLength 0x18
#define SeekError 0x19
#define UnknownMedia 0x1a
#define SectorNotFound 0x1b
#define OutOfPaper 0x1c
#define WriteFault 0x1d
#define ReadFault 0x1e
#define GeneralFailure 0x1f
#define ShareViolation 0x20
#define LockViolation 0x21
#define DiskFull 0x27
#define NoNetwork 0x49
#define FileExists 0x50
#define CanNotMakeDir 0x52
#define FA_NORMAL 0x00 /* Normal file, no attributes */
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIRECTORY 0x10 /* Directory */
#define FA_ARCHIVE 0x20 /* Archive */
#define FA_UNUSED 0x40 /* Unused */
extern WORD DOS_ExtendedError;
extern BYTE DOS_ErrorClass, DOS_ErrorAction, DOS_ErrorLocus;
#define DOS_ERROR(err,class,action,locus) \
( DOS_ErrorClass = (class), DOS_ErrorAction = (action), \
DOS_ErrorLocus = (locus), DOS_ExtendedError = (err) )
/* Error codes */
#define ER_NoError 0x00
#define ER_InvalidFunction 0x01
#define ER_FileNotFound 0x02
#define ER_PathNotFound 0x03
#define ER_TooManyOpenFiles 0x04
#define ER_AccessDenied 0x05
#define ER_InvalidHandle 0x06
#define ER_MCBDestroyed 0x07
#define ER_OutOfMemory 0x08
#define ER_MCBInvalid 0x09
#define ER_EnvironInvalid 0x0a
#define ER_FormatInvalid 0x0b
#define ER_AccessCodeInvalid 0x0c
#define ER_DataInvalid 0x0d
#define ER_InvalidDrive 0x0f
#define ER_CanNotRemoveCwd 0x10
#define ER_NotSameDevice 0x11
#define ER_NoMoreFiles 0x12
#define ER_WriteProtected 0x13
#define ER_UnknownUnit 0x14
#define ER_DriveNotReady 0x15
#define ER_UnknownCommand 0x16
#define ER_CRCError 0x17
#define ER_BadRqLength 0x18
#define ER_SeekError 0x19
#define ER_UnknownMedia 0x1a
#define ER_SectorNotFound 0x1b
#define ER_OutOfPaper 0x1c
#define ER_WriteFault 0x1d
#define ER_ReadFault 0x1e
#define ER_GeneralFailure 0x1f
#define ER_ShareViolation 0x20
#define ER_LockViolation 0x21
#define ER_DiskFull 0x27
#define ER_NoNetwork 0x49
#define ER_FileExists 0x50
#define ER_CanNotMakeDir 0x52
/* Error classes */
#define EC_Temporary 0x02
#define EC_AccessDenied 0x03
#define EC_AppError 0x04
#define EC_SystemFailure 0x06
#define EC_NotFound 0x08
#define EC_MediaError 0x0b
#define EC_Exists 0x0c
#define EC_Unknown 0x0d
#define EC_OutOfResource 0x01
#define EC_Temporary 0x02
#define EC_AccessDenied 0x03
#define EC_InternalError 0x04
#define EC_HardwareFailure 0x05
#define EC_SystemFailure 0x06
#define EC_ProgramError 0x07
#define EC_NotFound 0x08
#define EC_MediaError 0x0b
#define EC_Exists 0x0c
#define EC_Unknown 0x0d
/* Suggested actions */
#define SA_Retry 0x01
#define SA_Abort 0x04
#define SA_Ignore 0x06
#define SA_Ask4Retry 0x07
#define SA_Retry 0x01
#define SA_DelayedRetry 0x02
#define SA_Abort 0x04
#define SA_Ignore 0x06
#define SA_Ask4Retry 0x07
/* Error locus */
#define EL_Unknown 0x01
#define EL_Disk 0x02
#define EL_Network 0x03
#define EL_Memory 0x05
#define EL_Unknown 0x01
#define EL_Disk 0x02
#define EL_Network 0x03
#define EL_Serial 0x04
#define EL_Memory 0x05
#endif /* __MSDOS_H */
......@@ -9,6 +9,10 @@ struct pe_data {
struct PE_Import_Directory *pe_import;
struct PE_Export_Directory *pe_export;
struct PE_Resource_Directory *pe_resource;
struct PE_Reloc_Block *pe_reloc;
int base_addr;
int load_addr;
int vma_size;
int resource_offset; /* offset to resource typedirectory in file */
};
......@@ -18,7 +22,6 @@ struct w_files
char * name; /* Name, as it appears in the windows binaries */
char * filename; /* Actual name of the unix file that satisfies this */
int type; /* DLL or EXE */
int fd;
HINSTANCE hinstance;
HMODULE hModule;
int initialised;
......@@ -31,8 +34,7 @@ struct w_files
extern int PE_unloadImage(struct w_files *wpnt);
extern int PE_StartProgram(struct w_files *wpnt);
extern void PE_InitDLL(struct w_files *wpnt);
extern HINSTANCE PE_LoadImage(struct w_files *wpnt);
extern void PE_InitDLL(HMODULE hModule);
extern void my_wcstombs(char * result, u_short * source, int len);
extern struct w_files *wine_files;
......
......@@ -167,7 +167,7 @@ struct PE_Export_Directory
u_long * AddressOfFunctions;
u_long * AddressOfNames;
u_short * Address_Of_Name_Ordinals;
u_char ModuleName[1];
/* u_char ModuleName[1]; */
};
/*
......@@ -213,4 +213,18 @@ struct PE_Resource_Leaf_Entry
#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
struct PE_Reloc_Block
{
u_long PageRVA;
u_long BlockSize;
short Relocations[1];
};
#define IMAGE_REL_BASED_ABSOLUTE 0
#define IMAGE_REL_BASED_HIGH 1
#define IMAGE_REL_BASED_LOW 2
#define IMAGE_REL_BASED_HIGHLOW 3
#define IMAGE_REL_BASED_HIGHADJ 4
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
#endif /* __WINE_PEEXE_H */
......@@ -106,10 +106,18 @@
#define EIP_reg(context) ((context)->uc_mcontext.gregs[EIP])
#ifdef R_ESP
#define ESP_reg(context) ((context)->uc_mcontext.gregs[R_ESP])
#else
#define ESP_reg(context) ((context)->uc_mcontext.gregs[ESP])
#endif
#define IP_reg(context) (*(WORD*)(&(context)->uc_mcontext.gregs[EIP]))
#ifdef R_ESP
#define SP_reg(context) (*(WORD*)(&(context)->uc_mcontext.gregs[R_ESP]))
#else
#define SP_reg(context) (*(WORD*)(&(context)->uc_mcontext.gregs[ESP]))
#endif
#define SET_CFLAG(context) (EFL_reg(context) |= 0x0001)
#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
......
/*
* Win32 functions, structures, and types related to resources
*
* Copyright 1995 Thomas Sandford
*
*/
#ifndef __WINE_RESOURCE32_H
#define __WINE_RESOURCE32_H
#include <stddef.h>
HANDLE32 FindResource32( HINSTANCE hModule, LPCTSTR name, LPCTSTR type );
HANDLE32 LoadResource32( HINSTANCE hModule, HANDLE32 hRsrc );
LPVOID LockResource32( HANDLE32 handle );
BOOL FreeResource32( HANDLE32 handle );
INT AccessResource32( HINSTANCE hModule, HRSRC hRsrc );
DWORD SizeofResource32( HINSTANCE hModule, HRSRC hRsrc );
int LoadString32(HINSTANCE instance, DWORD resource_id, LPTSTR buffer, int buflen);
typedef struct _IMAGE_RESOURCE_DIRECTORY {
DWORD Characteristics;
DWORD TimeDateStamp;
WORD MajorVersion;
WORD MinorVersion;
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY;
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
DWORD Name;
DWORD OffsetToData;
} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;
typedef struct _IMAGE_RESOURCE_DATA_ENTRY {
DWORD OffsetToData;
DWORD Size;
DWORD CodePage;
DWORD Reserved;
} IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY;
typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
WORD Length;
WCHAR NameString[1];
} IMAGE_RESOURCE_DIR_STRING_U, *PIMAGE_RESOURCE_DIR_STRING_U;
#endif /* __WINE_RESOURCE32_H */
......@@ -66,9 +66,12 @@ extern DWORD IF1632_Original32_esp;
/* Make a segmented pointer from a pointer to a variable located */
/* on the 32-bit stack for the current task. */
#if 0
#define MAKE_SEGPTR(ptr) \
((SEGPTR)IF1632_Stack32_base + \
((DWORD)(ptr) - (DWORD)PTR_SEG_TO_LIN(IF1632_Stack32_base)))
#endif
SEGPTR MAKE_SEGPTR(void *ptr);
#else
#define CURRENT_STACK16 error.error
#define CURRENT_DS 0
......
......@@ -21,20 +21,23 @@ extern void TASK_KillCurrentTask( int exitCode );
typedef struct
{
WORD int20; /* int 20h instruction */
WORD nextParagraph; /* Segment of next paragraph */
WORD int20; /* 00 int 20h instruction */
WORD nextParagraph; /* 02 Segment of next paragraph */
BYTE reserved1;
BYTE dispatcher[5]; /* Long call to DOS */
SEGPTR savedint22; /* Saved int 22h handler */
SEGPTR savedint23; /* Saved int 23h handler */
SEGPTR savedint24; /* Saved int 24h handler */
WORD parentPSP; /* Selector of parent PSP */
BYTE fileHandles[20]; /* Open file handles */
HANDLE environment; /* Selector of environment */
WORD reserved2[23];
BYTE fcb1[16]; /* First FCB */
BYTE fcb2[20]; /* Second FCB */
BYTE cmdLine[128]; /* Command-line (first byte is length) */
BYTE dispatcher[5]; /* 05 Long call to DOS */
SEGPTR savedint22 WINE_PACKED; /* 0a Saved int 22h handler */
SEGPTR savedint23 WINE_PACKED; /* 0e Saved int 23h handler */
SEGPTR savedint24 WINE_PACKED; /* 12 Saved int 24h handler */
WORD parentPSP; /* 16 Selector of parent PSP */
BYTE fileHandles[20]; /* 18 Open file handles */
HANDLE environment; /* 2c Selector of environment */
WORD reserved2[2];
WORD nbFiles; /* 32 Number of file handles */
SEGPTR fileHandlesPtr; /* 34 Pointer to file handle table */
WORD reserved3[18];
BYTE fcb1[16]; /* 5c First FCB */
BYTE fcb2[20]; /* 6c Second FCB */
BYTE cmdLine[128]; /* 80 Command-line (first byte is len) */
} PDB;
......@@ -66,7 +69,7 @@ typedef struct
DWORD esp; /* 32-bit stack pointer */
WORD ctrlword8087; /* 80x87 control word */
WORD flags; /* Task flags */
WORD error_flags; /* Error handling flags */
UINT error_mode; /* Error mode (see SetErrorMode) */
WORD version; /* Expected Windows version */
HANDLE hInstance; /* Instance handle for this task */
HMODULE hModule; /* Module handle */
......
......@@ -232,6 +232,15 @@ typedef struct
BOOL MemManInfo(LPMEMMANINFO lpEnhMode);
BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo );
/* timer info */
typedef struct tagTIMERINFO {
DWORD dwSize;
DWORD dwmsSinceStart;
DWORD dwmsThisVM;
} TIMERINFO;
BOOL TimerInfo( TIMERINFO *pTimerInfo );
/* Window classes */
......
......@@ -765,6 +765,9 @@ typedef struct tagLOGPEN
#define WINDING 2
/* Background modes */
#ifdef TRANSPARENT /*Apparently some broken svr4 includes define TRANSPARENT*/
#undef TRANSPARENT
#endif
#define TRANSPARENT 1
#define OPAQUE 2
......@@ -1034,37 +1037,42 @@ typedef KANJISTRUCT *LPKANJISTRUCT;
typedef KANJISTRUCT *NPKANJISTRUCT;
typedef KANJISTRUCT *PKANJISTRUCT;
typedef struct {
BYTE cBytes, fFixedDisk;
WORD nErrCode;
BYTE reserved[4], szPathName[128];
typedef struct
{
BYTE cBytes;
BYTE fFixedDisk;
WORD nErrCode;
BYTE reserved[4];
BYTE szPathName[128];
} OFSTRUCT;
typedef OFSTRUCT *POFSTRUCT;
typedef OFSTRUCT *NPOFSTRUCT;
typedef OFSTRUCT *LPOFSTRUCT;
#define OF_READ 0x0000
#define OF_WRITE 0x0001
#define OF_READWRITE 0x0002
#define OF_CANCEL 0x0800
#define OF_CREATE 0x1000
#define OF_DELETE 0x0200
#define OF_EXIST 0x4000
#define OF_PARSE 0x0100
#define OF_PROMPT 0x2000
#define OF_REOPEN 0x8000
#define OF_SHARE_COMPAT 0x0000
#define OF_SHARE_DENY_NONE 0x0040
#define OF_SHARE_DENY_READ 0x0030
#define OF_SHARE_DENY_WRITE 0x0020
#define OF_SHARE_EXCLUSIVE 0x0010
#define OF_VERIFY 0x0400
#define DRIVE_CANNOTDETERMINE 0
#define DRIVE_DOESNOTEXIST 1
#define DRIVE_REMOVABLE 2
#define DRIVE_FIXED 3
#define DRIVE_REMOTE 4
#define OF_READ 0x0000
#define OF_WRITE 0x0001
#define OF_READWRITE 0x0002
#define OF_SHARE_COMPAT 0x0000
#define OF_SHARE_EXCLUSIVE 0x0010
#define OF_SHARE_DENY_WRITE 0x0020
#define OF_SHARE_DENY_READ 0x0030
#define OF_SHARE_DENY_NONE 0x0040
#define OF_PARSE 0x0100
#define OF_DELETE 0x0200
#define OF_VERIFY 0x0400 /* Used with OF_REOPEN */
#define OF_SEARCH 0x0400 /* Used without OF_REOPEN */
#define OF_CANCEL 0x0800
#define OF_CREATE 0x1000
#define OF_PROMPT 0x2000
#define OF_EXIST 0x4000
#define OF_REOPEN 0x8000
/* GetTempFileName() Flags */
#define TF_FORCEDRIVE 0x80
#define DRIVE_CANNOTDETERMINE 0
#define DRIVE_DOESNOTEXIST 1
#define DRIVE_REMOVABLE 2
#define DRIVE_FIXED 3
#define DRIVE_REMOTE 4
#define HFILE_ERROR -1
......@@ -1687,6 +1695,8 @@ typedef struct tagDRAGINFO {
#define SW_SHOWMINNOACTIVE 7
#define SW_SHOWNA 8
#define SW_RESTORE 9
#define SW_SHOWDEFAULT 10
#define SW_MAX 10
/* WM_SIZE message wParam values */
#define SIZE_RESTORED 0
......@@ -2648,8 +2658,8 @@ int DialogBoxParam(HANDLE,SEGPTR,HWND,WNDPROC,LONG);
HANDLE DirectResAlloc(HANDLE,WORD,WORD);
void DirectedYield(HTASK);
LONG DispatchMessage(LPMSG);
int DlgDirList(HWND,LPSTR,int,int,WORD);
int DlgDirListComboBox(HWND,SEGPTR,int,int,WORD);
INT DlgDirList(HWND,SEGPTR,INT,INT,WORD);
INT DlgDirListComboBox(HWND,SEGPTR,INT,INT,WORD);
BOOL DlgDirSelect(HWND,LPSTR,int);
BOOL DlgDirSelectComboBox(HWND,LPSTR,int);
BOOL DragDetect(HWND,POINT);
......@@ -2808,11 +2818,11 @@ HWND GetParent(HWND);
DWORD GetPixel(HDC,short,short);
WORD GetPolyFillMode(HDC);
int GetPriorityClipboardFormat(WORD*,short);
WORD GetPrivateProfileInt(LPSTR,LPSTR,short,LPSTR);
short GetPrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR,short,LPSTR);
WORD GetPrivateProfileInt(LPCSTR,LPCSTR,short,LPCSTR);
short GetPrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,short,LPCSTR);
FARPROC GetProcAddress(HANDLE,SEGPTR);
WORD GetProfileInt(LPSTR,LPSTR,int);
int GetProfileString(LPSTR,LPSTR,LPSTR,LPSTR,int);
WORD GetProfileInt(LPCSTR,LPCSTR,int);
int GetProfileString(LPCSTR,LPCSTR,LPCSTR,LPSTR,int);
HANDLE GetProp(HWND,SEGPTR);
WORD GetROP2(HDC);
WORD GetRelAbs(HDC);
......@@ -2933,6 +2943,7 @@ BOOL IsDialogMessage(HWND,LPMSG);
WORD IsDlgButtonChecked(HWND,WORD);
BOOL IsIconic(HWND);
BOOL IsRectEmpty(LPRECT);
HTASK IsTaskLocked(void);
BOOL IsTwoByteCharPrefix(char);
BOOL IsWindow(HWND);
BOOL IsWindowEnabled(HWND);
......@@ -2996,7 +3007,7 @@ DWORD OffsetWindowOrg(HDC,short,short);
BOOL OffsetWindowOrgEx(HDC,short,short,LPPOINT);
BOOL OpenClipboard(HWND);
int OpenComm(LPSTR,UINT,UINT);
INT OpenFile(LPCSTR,LPOFSTRUCT,UINT);
HFILE OpenFile(LPCSTR,OFSTRUCT*,UINT);
BOOL OpenIcon(HWND);
int OpenSound(void);
void OutputDebugString(LPSTR);
......@@ -3088,12 +3099,12 @@ void SetDCState(HDC,HDC);
int SetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
int SetDIBitsToDevice(HDC,short,short,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
BOOL SetDeskPattern(void);
BOOL SetDeskWallPaper(LPSTR);
BOOL SetDeskWallPaper(LPCSTR);
void SetDlgItemInt(HWND,WORD,WORD,BOOL);
void SetDlgItemText(HWND,WORD,SEGPTR);
void SetDoubleClickTime(WORD);
int SetEnvironment(LPSTR,LPSTR,WORD);
BOOL SetErrorMode(WORD);
UINT SetErrorMode(UINT);
HWND SetFocus(HWND);
WORD SetHandleCount(WORD);
void SetInternalWindowPos(HWND,WORD,LPRECT,LPPOINT);
......@@ -3206,19 +3217,20 @@ int WriteComm(int,LPSTR,int);
BOOL WritePrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR);
BOOL WriteProfileString(LPSTR,LPSTR,LPSTR);
void Yield(void);
LONG _hread(INT,LPSTR,LONG);
LONG _hwrite(INT,LPCSTR,LONG);
INT _lclose(INT);
INT _lcreat(LPSTR,INT);
LONG _llseek(INT,LONG,INT);
INT _lopen(LPSTR,INT);
INT _lread(INT,LPSTR,WORD);
INT _lwrite(INT,LPCSTR,WORD);
LONG _hread(HFILE,LPSTR,LONG);
LONG _hwrite(HFILE,LPCSTR,LONG);
HFILE _lclose(HFILE);
HFILE _lcreat(LPCSTR,INT);
LONG _llseek(HFILE,LONG,INT);
HFILE _lopen(LPCSTR,INT);
INT _lread(HFILE,LPSTR,WORD);
INT _lwrite(HFILE,LPCSTR,WORD);
SEGPTR lstrcat(SEGPTR,SEGPTR);
INT lstrcmp(LPCSTR,LPCSTR);
INT lstrcmpi(LPCSTR,LPCSTR);
INT lstrncmpi(LPCSTR,LPCSTR,int);
SEGPTR lstrcpy(SEGPTR,SEGPTR);
char * lstrcpyn(char *,char *,int);
char * lstrcpyn(char *,const char *,int);
INT lstrlen(LPCSTR);
int wvsprintf(LPSTR,LPSTR,LPSTR);
......
#ifndef WINE_H
#define WINE_H
#ifndef __WINE_WINE_H
#define __WINE_WINE_H
extern char *WineIniFileName(void);
extern char *WinIniFileName(void);
#define WINE_INI WineIniFileName()
#define WIN_INI WinIniFileName()
#ifdef i386
extern int runtime_cpu (void);
......@@ -13,6 +11,7 @@ extern int runtime_cpu (void);
static inline int runtime_cpu(void) { return 3; }
#endif
#ifndef WINELIB
#if defined ( linux)
struct sigcontext_struct
......@@ -66,4 +65,6 @@ struct sigcontext_struct
#define WINE_CODE_SELECTOR 0x1f
#endif
#endif /* WINE_H */
#endif /* WINELIB */
#endif /* __WINE_WINE_H */
......@@ -7,6 +7,7 @@
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/time.h>
#include <fcntl.h>
......@@ -26,12 +27,14 @@ extern int PASCAL FAR __WSAFDIsSet(SOCKET, fd_set FAR *);
/*
* Internet address (old style... should be updated)
*/
#ifdef WS_USE_OLD_STYLE
#define s_addr S_un.S_addr /* can be used for most tcp & ip code */
#define s_host S_un.S_un_b.s_b2 /* host on imp */
#define s_net S_un.S_un_b.s_b1 /* network */
#define s_imp S_un.S_un_w.s_w2 /* imp */
#define s_impno S_un.S_un_b.s_b4 /* imp # */
#define s_lh S_un.S_un_b.s_b3 /* logical host */
#endif
#define WSADESCRIPTION_LEN 256
#define WSASYS_STATUS_LEN 128
......@@ -62,23 +65,6 @@ typedef WSADATA FAR *LPWSADATA;
#define SO_DONTLINGER (u_int)(~SO_LINGER)
#endif
#ifndef _SYS_SOCKET_H_
#ifndef _sys_socket_h
#ifndef _NET_TRANSPORT_SOCKET_H
#ifndef _NET_SOCKET_H
/*
* Structure used by kernel to pass protocol
* information in raw sockets.
*/
struct sockproto {
u_short sp_family; /* address family */
u_short sp_protocol; /* protocol */
};
#endif
#endif
#endif
#endif
/*
* Maximum queue length specifiable by listen.
*/
......
......@@ -48,6 +48,7 @@ typedef DWORD SEGPTR;
#endif
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef INT HFILE;
typedef DWORD HHOOK;
typedef char *LPSTR;
typedef const char *LPCSTR;
......@@ -90,6 +91,8 @@ DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HWND);
DECLARE_HANDLE(LOCALHANDLE);
typedef HGLOBAL GLOBALHANDLE;
#ifdef WINELIB
typedef long (*FARPROC)();
typedef LRESULT (*WNDPROC)(HWND,UINT,WPARAM,LPARAM);
......
#ifndef __WINE_XMALLOC_H
#define __WINE_XMALLOC_H
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#else
......@@ -6,3 +9,6 @@
void *xmalloc (size_t);
void *xrealloc (void *, size_t);
char *xstrdup( const char * );
#endif /* __WINE_XMALLOC_H */
......@@ -66,7 +66,7 @@ static int FindHash(LPCSTR str) /* ignore str case */
deleted=hash1;
break;
default : /* non empty atom entry */
if ( strcasecmp( OFS2AtomStr(atom_ofs) , str) == 0)
if (lstrcmpi( OFS2AtomStr(atom_ofs) , str) == 0)
return hash1; /* found string in atom table */
}
hash2%= DDE_ATOMS-1 ; /* hash2=0..(DDE_ATOMS-2) */
......@@ -92,7 +92,7 @@ static int FindHash(LPCSTR str) /* ignore str case */
deleted= i;
break;
default : /* nonempty atom entry */
if ( strcasecmp( OFS2AtomStr(atom_ofs) , str) == 0)
if (lstrcmpi( OFS2AtomStr(atom_ofs) , str) == 0)
return i; /* found string in atom table */
}
}
......
......@@ -80,7 +80,7 @@ static ATOM ATOM_AddAtom( ATOMtoHANDLEtable** tableptr, SEGPTR name )
FirstUnusedIndex=Index;
}
else if ((table->a2h[i].length == len) &&
(!strncasecmp( table->a2h[i].str, str, len )))
(!lstrncmpi( table->a2h[i].str, str, len )))
{
table->a2h[i].refCount++;
return Index;
......@@ -176,7 +176,7 @@ static ATOM ATOM_FindAtom( ATOMtoHANDLEtable** tableptr, SEGPTR name )
{
if ((table->a2h[i].refCount != 0) &&
(table->a2h[i].length == len) &&
(!strncasecmp( table->a2h[i].str, str, len )))
(!lstrncmpi( table->a2h[i].str, str, len )))
return Index;
}
table=table->next;
......
......@@ -101,7 +101,6 @@ LPVOID LIBRES_LockResource( HGLOBAL handle )
*/
BOOL LIBRES_FreeResource( HGLOBAL handle )
{
WINELIB_UNIMP("LIBRES_FreeResource()");
return 0; /* Obsolete in Win32 */
}
......
......@@ -45,7 +45,7 @@ WORD CallTo16_word_ ( FARPROC func, WORD arg ) { return func(arg); }
void GlobalFreeAll(HANDLE owner)
{
fprintf(stderr,"JBP: GlobalFreeAll() ignored.\n");
WINELIB_UNIMP("GlobalFreeAll()");
}
SEGPTR WIN16_GlobalLock(HGLOBAL h)
......@@ -65,7 +65,7 @@ WORD LOCAL_Size( WORD ds, HLOCAL handle )
void FarSetOwner(HANDLE a, WORD b)
{
fprintf(stderr,"JBP: FarSetOwner() ignored.\n");
WINELIB_UNIMP("FarSetOwner()");
}
#define GLOBAL_MAX_ALLOC_SIZE 0x00ff0000 /* Largest allocation is 16M - 64K */
......@@ -114,13 +114,11 @@ HGLOBAL GLOBAL_CreateBlock( WORD flags, const void *ptr, DWORD size,
BOOL is32Bit, BOOL isReadOnly,
SHMDATA *shmdata)
{
/* fprintf(stderr,"JBP: GLOBAL_CreateBlock() faked.\n");*/
return (HGLOBAL)ptr;
}
BOOL GLOBAL_FreeBlock( HGLOBAL handle )
{
/* fprintf(stderr,"JBP: GLOBAL_FreeBlock() ignored.\n");*/
return 1;
}
......@@ -132,10 +130,10 @@ HGLOBAL GlobalHandle(LPCVOID a)
void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
{
/* fprintf(stderr,"JBP: RELAY32_GetEntryPoint() ignored.\n");*/
return NULL;
}
extern LRESULT ACTIVATEAPP_callback(HWND,UINT,WPARAM,LPARAM);
extern LRESULT AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT ButtonWndProc(HWND,UINT,WPARAM,LPARAM);
extern LRESULT CARET_Callback(HWND,UINT,WPARAM,LPARAM);
......@@ -172,6 +170,7 @@ LRESULT ErrorProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
WNDPROC GetWndProcEntry16( char *name )
{
#define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return proc
MAP_STR_TO_PROC("ActivateAppProc",ACTIVATEAPP_callback);
MAP_STR_TO_PROC("AboutDlgProc",AboutDlgProc);
MAP_STR_TO_PROC("ButtonWndProc",ButtonWndProc);
MAP_STR_TO_PROC("CARET_Callback",CARET_Callback);
......@@ -194,5 +193,6 @@ WNDPROC GetWndProcEntry16( char *name )
MAP_STR_TO_PROC("StaticWndProc",StaticWndProc);
MAP_STR_TO_PROC("SystemMessageBoxProc",SystemMessageBoxProc);
MAP_STR_TO_PROC("TASK_Reschedule",TASK_Reschedule);
fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
return ErrorProc;
}
Windows clock application for WINE (by Jim Peterson)
This is a translation of a Turbo Pascal OWL application I made once,
so it's a little flaky (tons of globals, functions that could have
been in-lined, etc.). The file rolex.exe is a Win32 application
compiled using this source code and Borland C++ 4.0.
To try it out, type 'make rolex' or 'wine ./rolex.exe' (which fails).
/*********************************************************************
* *
* rolex.c: Windows clock application for WINE (by Jim Peterson) *
* *
* This is a translation of a Turbo Pascal OWL application I made *
* once, so it's a little flaky (tons of globals, functions that *
* could have been in-lined, etc.). The source code should easily *
* compile with a standard Win32 C compiler. *
* *
* To try it out, type 'make rolex'. *
* *
*********************************************************************/
#include <math.h>
#include <string.h>
#include "windows.h"
......
......@@ -20,12 +20,13 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "kernel32.h"
#include "atom.h"
#include "dialog.h"
#include "directory.h"
#include "drive.h"
#include "message.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "gdi.h"
#include "debugger.h"
#include "dos_fs.h"
#include "dlls.h"
#include "miscemu.h"
#include "neexe.h"
......@@ -63,8 +64,11 @@ int MAIN_Init(void)
/* Create built-in modules */
if (!MODULE_Init()) return 0;
/* Initialize the DOS file system */
DOS_InitFS();
/* Initialise DOS drives */
if (!DRIVE_Init()) return 0;
/* Initialise DOS directories */
if (!DIR_Init()) return 0;
/* Initialize tasks */
if (!TASK_Init()) return 0;
......
......@@ -13,6 +13,7 @@
#include "windows.h"
#include "dlls.h"
#include "dos_fs.h"
#include "file.h"
#include "global.h"
#include "ldt.h"
#include "module.h"
......@@ -56,7 +57,7 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
if ((p = strrchr( dllname, '.' ))) *p = '\0';
for (i = 0, table = dll_builtin_table; i < N_BUILTINS; i++, table++)
if (!strcasecmp( table->name, dllname )) break;
if (!lstrcmpi( table->name, dllname )) break;
if (i >= N_BUILTINS) return 0;
if (!table->used && !force) return 0;
......@@ -110,9 +111,6 @@ BOOL MODULE_Init(void)
!MODULE_LoadBuiltin( "GDI", TRUE ) ||
!MODULE_LoadBuiltin( "USER", TRUE ) ||
!MODULE_LoadBuiltin( "WINPROCS", TRUE )) return FALSE;
#else
fprintf(stderr, "JBP: MODULE_Init() ignored.\n");
#endif
/* Initialize KERNEL.178 (__WINFLAGS) with the correct flags value */
......@@ -260,6 +258,7 @@ int MODULE_OpenFile( HMODULE hModule )
{
NE_MODULE *pModule;
char *name;
const char *unixName;
static int cachedfd = -1;
......@@ -271,19 +270,21 @@ int MODULE_OpenFile( HMODULE hModule )
close( cachedfd );
hCachedModule = hModule;
name = ((LOADEDFILEINFO*)((char*)pModule + pModule->fileinfo))->filename;
if ((cachedfd = open( DOS_GetUnixFileName( name ), O_RDONLY )) == -1)
if (!(unixName = DOSFS_GetUnixFileName( name, TRUE )) ||
(cachedfd = open( unixName, O_RDONLY )) == -1)
fprintf( stderr, "MODULE_OpenFile: can't open file '%s' for module "NPFMT"\n",
name, hModule );
dprintf_module( stddeb, "MODULE_OpenFile: opened '%s' -> %d\n",
name, cachedfd );
return cachedfd;
}
/***********************************************************************
* MODULE_Ne2MemFlags
*
* This function translates NE segment flags to GlobalAlloc flags
*/
/* This function translates NE segment flags to GlobalAlloc flags */
static WORD MODULE_Ne2MemFlags(WORD flags)
{
WORD memflags = 0;
......@@ -813,6 +814,17 @@ LPSTR MODULE_GetModuleName( HMODULE hModule )
/**********************************************************************
* MODULE_RegisterModule
*/
void MODULE_RegisterModule( HMODULE hModule )
{
NE_MODULE *pModule;
pModule = (NE_MODULE *)GlobalLock( hModule );
pModule->next = hFirstModule;
hFirstModule = hModule;
}
/**********************************************************************
* MODULE_FindModule
*
* Find a module from a path name.
......@@ -837,10 +849,10 @@ HMODULE MODULE_FindModule( LPCSTR path )
if (!(modulename = strrchr( modulepath, '\\' )))
modulename = modulepath;
else modulename++;
if (!strcasecmp( modulename, filename )) return hModule;
if (!lstrcmpi( modulename, filename )) return hModule;
name_table = (BYTE *)pModule + pModule->name_table;
if ((*name_table == len) && !strncasecmp(filename, name_table+1, len))
if ((*name_table == len) && !lstrncmpi(filename, name_table+1, len))
return hModule;
hModule = pModule->next;
}
......@@ -928,8 +940,7 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* Try to load the built-in first if not disabled */
if ((hModule = MODULE_LoadBuiltin( name, FALSE ))) return hModule;
if (strchr( name, '/' )) name = DOS_GetDosFileName( name );
if ((fd = OpenFile( name, &ofs, OF_READ )) == -1)
if ((fd = FILE_OpenFile( name, &ofs, OF_READ )) == -1)
{
/* Now try the built-in even if disabled */
if ((hModule = MODULE_LoadBuiltin( name, TRUE )))
......@@ -942,11 +953,11 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* Create the module structure */
if ((hModule = MODULE_LoadExeHeader( fd, &ofs )) < 32)
hModule = MODULE_LoadExeHeader( fd, &ofs );
if (hModule == 21) hModule = PE_LoadModule( fd, &ofs, paramBlock );
close( fd );
if (hModule < 32)
{
if(hModule == 21)
return PE_LoadModule(fd,&ofs,paramBlock);
close( fd );
fprintf( stderr, "LoadModule: can't load '%s', error=%d\n",
name, hModule );
return hModule;
......@@ -1214,7 +1225,7 @@ HANDLE LoadLibrary( LPCSTR libname )
if (handle == (HANDLE)2) /* file not found */
{
char buffer[256];
strcpy( buffer, libname );
lstrcpyn( buffer, libname, 252 );
strcat( buffer, ".dll" );
handle = LoadModule( buffer, (LPVOID)-1 );
}
......
......@@ -508,6 +508,11 @@ void NE_InitializeDLLs( HMODULE hModule )
HMODULE *pDLL;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (pModule->magic == PE_SIGNATURE)
{
PE_InitializeDLLs(hModule);
return;
}
if (pModule->dlls_to_init)
{
HANDLE to_init = pModule->dlls_to_init;
......
......@@ -67,8 +67,8 @@ static DWORD NE_FindNameTableId( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (p[1] & 0x8000)
{
if (!HIWORD(typeId)) continue;
if (strcasecmp( (char *)PTR_SEG_TO_LIN(typeId),
(char *)(p + 3) )) continue;
if (lstrcmpi( (char *)PTR_SEG_TO_LIN(typeId),
(char *)(p + 3) )) continue;
}
else if (HIWORD(typeId) || ((typeId & ~0x8000)!= p[1]))
continue;
......@@ -78,7 +78,7 @@ static DWORD NE_FindNameTableId( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (p[2] & 0x8000)
{
if (!HIWORD(resId)) continue;
if (strcasecmp( (char *)PTR_SEG_TO_LIN(resId),
if (lstrcmpi( (char *)PTR_SEG_TO_LIN(resId),
(char*)(p+3)+strlen((char*)(p+3))+1 )) continue;
}
......@@ -119,7 +119,7 @@ static HRSRC NE_FindResourceFromType( NE_MODULE *pModule,
{
if (pNameInfo->id & 0x8000) continue;
p = (BYTE *)pModule + pModule->res_table + pNameInfo->id;
if ((*p == len) && !strncasecmp( p+1, str, len ))
if ((*p == len) && !lstrncmpi( p+1, str, len ))
return (HRSRC)((int)pNameInfo - (int)pModule);
}
}
......@@ -167,7 +167,7 @@ HRSRC NE_FindResource( HMODULE hModule, SEGPTR typeId, SEGPTR resId )
if (!(pTypeInfo->type_id & 0x8000))
{
BYTE *p = (BYTE*)pModule+pModule->res_table+pTypeInfo->type_id;
if ((*p == len) && !strncasecmp( p+1, str, len ))
if ((*p == len) && !lstrncmpi( p+1, str, len ))
{
dprintf_resource( stddeb, " Found type '%s'\n", str );
hRsrc = NE_FindResourceFromType(pModule, pTypeInfo, resId);
......@@ -240,20 +240,21 @@ int NE_AccessResource( HMODULE hModule, HRSRC hRsrc )
{
NE_MODULE *pModule;
NE_NAMEINFO *pNameInfo=NULL;
WORD sizeShift;
char *name;
int fd;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (!pModule || !pModule->res_table) return 0;
if (!pModule || !pModule->res_table) return -1;
#ifndef WINELIB
pNameInfo = (NE_NAMEINFO*)((char*)pModule + hRsrc);
#endif
name = ((LOADEDFILEINFO*)((char*)pModule + pModule->fileinfo))->filename;
fd = open( DOS_GetUnixFileName(name), O_RDONLY );
sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
lseek( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
if ((fd = _lopen( name, OF_READ )) != -1)
{
WORD sizeShift = *(WORD *)((char *)pModule + pModule->res_table);
_llseek( fd, (int)pNameInfo->offset << sizeShift, SEEK_SET );
}
return fd;
}
......
......@@ -72,7 +72,7 @@ find_resource(char *root, struct PE_Resource_Directory *resource,
memset(res_name, 0, sizeof(res_name));
my_wcstombs(res_name, name->NameString, name->Length);
dprintf_resource(stddeb, "\tPE_findresource: name %s\n", res_name);
if (strcasecmp(res_name, resource_name) == 0)
if (lstrcmpi(res_name, resource_name) == 0)
return find_lang(root, (struct PE_Resource_Directory *) (root + (type_dir->OffsetToData & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY)), r);
type_dir++;
}
......@@ -107,7 +107,7 @@ find_type(struct PE_Resource_Directory *resource, LPSTR resource_name,
my_wcstombs(res_name, name->NameString, name->Length);
dprintf_resource(stddeb, "PE_findtype: type %s\n",
res_name);
if (strcasecmp(res_name, type_name) == 0)
if (lstrcmpi(res_name, type_name) == 0)
return find_resource(root, (struct PE_Resource_Directory *) (root + (type_dir->OffsetToData & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY)), resource_name, r);
type_dir++;
}
......
......@@ -146,7 +146,7 @@ static ATOM ATOM_AddAtom( WORD selector, SEGPTR name )
{
entryPtr = ATOM_MakePtr( selector, entry );
if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, str, len )))
(!lstrncmpi( entryPtr->str, str, len )))
{
entryPtr->refCount++;
return HANDLETOATOM( entry );
......@@ -227,7 +227,7 @@ static ATOM ATOM_FindAtom( WORD selector, SEGPTR name )
{
ATOMENTRY * entryPtr = ATOM_MakePtr( selector, entry );
if ((entryPtr->length == len) &&
(!strncasecmp( entryPtr->str, str, len )))
(!lstrncmpi( entryPtr->str, str, len )))
return HANDLETOATOM( entry );
entry = entryPtr->next;
}
......
......@@ -6,6 +6,7 @@
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "windows.h"
......@@ -755,7 +756,48 @@ BOOL GlobalEntryModule( GLOBALENTRY *pGlobal, HMODULE hModule, WORD wSeg )
*/
BOOL MemManInfo( MEMMANINFO *pInfo )
{
#ifdef linux
/* FIXME: does not take into account the dwSize member
* could be corrupting memory therefore
*/
/* shamefully stolen from free */
DWORD availmem = 0;
DWORD totalmem = 0;
FILE *meminfo;
char buf[80];
int col[5];
int n;
if ((meminfo = fopen("/proc/meminfo", "r")) < 0) {
perror("wine: open");
exit(1);
}
fgets(buf, 80, meminfo); /* read first line */
while ( fgets(buf, 80, meminfo) ) {
n = sscanf( buf, "%*s %d %d %d %d %d", &col[0], &col[1], &col[2], &col[3], &col[4]);
if ( n < 1 ) continue; /* escape the loop at the top */
totalmem += col[0];
availmem += col[2] + col[4];
}
fprintf(stderr,"MemManInfo called with dwSize = %ld\n",pInfo->dwSize);
pInfo->wPageSize = getpagesize();
pInfo->dwLargestFreeBlock = availmem;
pInfo->dwTotalLinearSpace = totalmem / pInfo->wPageSize;
pInfo->dwMaxPagesAvailable = pInfo->dwLargestFreeBlock / pInfo->wPageSize;
pInfo->dwMaxPagesLockable = pInfo->dwMaxPagesLockable;
/* FIXME: the next three are not quite correct */
pInfo->dwTotalUnlockedPages = pInfo->dwMaxPagesAvailable;
pInfo->dwFreePages = pInfo->dwMaxPagesAvailable;
pInfo->dwTotalPages = pInfo->dwMaxPagesAvailable;
/* FIXME: the three above are not quite correct */
pInfo->dwFreeLinearSpace = pInfo->dwMaxPagesAvailable;
pInfo->dwSwapFilePages = 0L;
return TRUE;
#else
return TRUE;
#endif
}
/***********************************************************************
......
......@@ -7,11 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef __svr4__
#include <string.h>
#else
#include <strings.h>
#endif
#include <errno.h>
#include "ldt.h"
#include "stddebug.h"
......
......@@ -442,3 +442,37 @@ DWORD MemoryWrite( WORD sel, DWORD offset, void *buffer, DWORD count )
memcpy( ((char *)GET_SEL_BASE(sel)) + offset, buffer, count );
return count;
}
#ifndef WINELIB
SEGPTR MAKE_SEGPTR(void * ptr)
{
SEGPTR result;
int entry;
if (!ptr)
return ptr;
if (!((unsigned)ptr & 0xffff0000)) {
fprintf(stderr, "Invalid pointer %08x has been passed to MAKE_SEGPTR. This was\n", ptr);
fprintf(stderr, "probably caused by an unnecessary call to PTR_SEG_TO_LIN.\n");
fprintf(stderr, "Forcing call to debugger\n");
ptr = *(void **)0;
}
result = (SEGPTR) (IF1632_Stack32_base) +
((DWORD)(ptr) - (DWORD) PTR_SEG_TO_LIN(IF1632_Stack32_base));
if (PTR_SEG_TO_LIN(result) == ptr)
return result;
for (entry = 0; entry < LDT_SIZE; entry++) {
if (ldt_copy[entry].base &&
(ldt_copy[entry].limit < 0x10000) &&
((unsigned) ptr >= ldt_copy[entry].base) &&
((unsigned) ptr < (ldt_copy[entry].base + ldt_copy[entry].limit))) {
return ((ENTRY_TO_SELECTOR(entry) << 16) |
((unsigned) ptr - ldt_copy[entry].base));
}
}
entry = SELECTOR_AllocBlock((void *)((unsigned)ptr & 0xffff0000), 0x10000, SEGMENT_DATA, 0, 0);
return ((entry << 16) | ((unsigned) ptr & 0xffff));
}
#endif
......@@ -10,7 +10,6 @@ C_SRCS = \
driver.c \
exec.c \
escape.c \
file.c \
keyboard.c \
lstr.c \
main.c \
......@@ -20,6 +19,7 @@ C_SRCS = \
ole2nls.c \
olecli.c \
olesvr.c \
port.c \
profile.c \
rect.c \
shell.c \
......
......@@ -136,7 +136,7 @@ int BuildCommDCB(LPSTR device, DCB FAR *lpdcb)
"BuildCommDCB: (%s), ptr %p\n", device, lpdcb);
commerror = 0;
if (!strncasecmp(device,"COM",3)) {
if (!lstrncmpi(device,"COM",3)) {
port = device[3] - '0';
......@@ -227,7 +227,7 @@ int OpenComm(LPSTR device, UINT cbInQueue, UINT cbOutQueue)
"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
commerror = 0;
if (!strncasecmp(device,"COM",3)) {
if (!lstrncmpi(device,"COM",3)) {
port = device[3] - '0';
if (port-- == 0) {
......@@ -256,7 +256,7 @@ int OpenComm(LPSTR device, UINT cbInQueue, UINT cbOutQueue)
}
}
else
if (!strncasecmp(device,"LPT",3)) {
if (!lstrncmpi(device,"LPT",3)) {
port = device[3] - '0';
if (!ValidLPTPort(port)) {
......
......@@ -15,6 +15,7 @@
#include "selectors.h"
#include "resource.h"
#include "dos_fs.h"
#include "drive.h"
#include "stackframe.h"
static DWORD CommDlgLastError = 0;
......@@ -164,9 +165,9 @@ static BOOL FILEDLG_ScanDir(HWND hWnd, LPSTR newPath)
strncpy(str,newPath,511); str[511]=0;
SendDlgItemMessage(hWnd, edt1, WM_GETTEXT, 511, (LPARAM)MAKE_SEGPTR(str2));
strncat(str,str2,511-strlen(str)); str[511]=0;
if (!DlgDirList(hWnd, str, lst1, 0, 0x0000)) return FALSE;
DlgDirList(hWnd, "*.*", lst2, stc1, 0x8010);
if (!DlgDirList(hWnd, MAKE_SEGPTR(str), lst1, 0, 0x0000)) return FALSE;
strcpy( str, "*.*" );
DlgDirList(hWnd, MAKE_SEGPTR(str), lst2, stc1, 0x8010);
return TRUE;
}
......@@ -360,7 +361,7 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
if (!FILEDLG_ScanDir(hWnd, tmpstr))
fprintf(stderr, "FileDlg: couldn't read initial directory %s!\n", tmpstr);
/* select current drive in combo 2 */
n = DOS_GetDefaultDrive();
n = DRIVE_GetCurrentDrive();
SendDlgItemMessage(hWnd, cmb2, CB_SETCURSEL, n, 0);
if (!(lpofn->Flags & OFN_SHOWHELP))
ShowWindow(GetDlgItem(hWnd, pshHelp), SW_HIDE);
......@@ -378,13 +379,23 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
LPOPENFILENAME lpofn;
char tmpstr[512], tmpstr2[512];
LPSTR pstr, pstr2;
UINT control,notification;
/* Notifications are packaged differently in Win32 */
#ifdef WINELIB32
control = LOWORD(wParam);
notification = HIWORD(wParam);
#else
control = wParam;
notification = HIWORD(lParam);
#endif
lpofn = (LPOPENFILENAME)GetWindowLong(hWnd, DWL_USER);
switch (wParam)
switch (control)
{
case lst1: /* file list */
FILEDLG_StripEditControl(hWnd);
if (HIWORD(lParam) == LBN_DBLCLK)
if (notification == LBN_DBLCLK)
goto almost_ok;
lRet = SendDlgItemMessage(hWnd, lst1, LB_GETCURSEL, 0, 0);
if (lRet == LB_ERR) return TRUE;
......@@ -394,7 +405,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
return TRUE;
case lst2: /* directory list */
FILEDLG_StripEditControl(hWnd);
if (HIWORD(lParam) == LBN_DBLCLK)
if (notification == LBN_DBLCLK)
{
lRet = SendDlgItemMessage(hWnd, lst2, LB_GETCURSEL, 0, 0);
if (lRet == LB_ERR) return TRUE;
......@@ -410,7 +421,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
}
return TRUE;
case cmb1: /* file type drop list */
if (HIWORD(lParam) == CBN_SELCHANGE)
if (notification == CBN_SELCHANGE)
{
*tmpstr = 0;
goto reset_scan;
......@@ -494,12 +505,11 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
SendDlgItemMessage(hWnd, edt1, WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
ShowWindow(hWnd, SW_HIDE);
{
int drive;
drive = DOS_GetDefaultDrive();
int drive = DRIVE_GetCurrentDrive();
tmpstr2[0] = 'A'+ drive;
tmpstr2[1] = ':';
tmpstr2[2] = '\\';
strncpy(tmpstr2 + 3, DOS_GetCurrentDir(drive), 507); tmpstr2[510]=0;
strncpy(tmpstr2 + 3, DRIVE_GetDosCwd(drive), 507); tmpstr2[510]=0;
if (strlen(tmpstr2) > 3)
strcat(tmpstr2, "\\");
strncat(tmpstr2, tmpstr, 511-strlen(tmpstr2)); tmpstr2[511]=0;
......
......@@ -66,17 +66,36 @@ SEGPTR lstrcat( SEGPTR target, SEGPTR source )
/* USER.430 */
INT lstrcmp(LPCSTR str1,LPCSTR str2)
{
return strcmp(str1,str2);
return strcmp( str1, str2 );
}
/* USER.471 */
INT lstrcmpi(LPCSTR str1,LPCSTR str2)
INT lstrcmpi( LPCSTR str1, LPCSTR str2 )
{
int i;
i=0;
while((toupper(str1[i])==toupper(str2[i]))&&(str1[i]!=0))
i++;
return toupper(str1[i])-toupper(str2[i]);
INT res;
while (*str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/* Not a Windows API*/
INT lstrncmpi( LPCSTR str1, LPCSTR str2, int n )
{
INT res;
if (!n) return 0;
while ((--n > 0) && *str1)
{
if ((res = toupper(*str1) - toupper(*str2)) != 0) return res;
str1++;
str2++;
}
return toupper(*str1) - toupper(*str2);
}
/* KERNEL.88 */
......@@ -87,13 +106,13 @@ SEGPTR lstrcpy( SEGPTR target, SEGPTR source )
}
/* KERNEL.353 32-bit version*/
char *lstrcpyn(char *dst, char *src, int n)
char *lstrcpyn( char *dst, const char *src, int n )
{
char *tmp = dst;
while(n-- > 1 && *src)
*dst++ = *src++;
*dst = 0;
return tmp;
*tmp++ = *src++;
*tmp = 0;
return dst;
}
/* KERNEL.353 16-bit version*/
......
......@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <locale.h>
#ifdef MALLOC_DEBUGGING
......@@ -17,9 +18,9 @@
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include "wine.h"
#include "message.h"
#include "msdos.h"
#include "windows.h"
#include "miscemu.h"
#include "winsock.h"
#include "options.h"
#include "desktop.h"
......@@ -226,7 +227,7 @@ BOOL ParseDebugOptions(char *options)
l=strchr(options,',')-options;
else
l=strlen(options);
if (!strncasecmp(options+1,"all",l-1))
if (!lstrncmpi(options+1,"all",l-1))
{
int i;
for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
......@@ -236,7 +237,7 @@ BOOL ParseDebugOptions(char *options)
{
int i;
for (i=0;i<sizeof(debug_msg_enabled)/sizeof(short);i++)
if (debug_msg_name && (!strncasecmp(options+1,debug_msg_name[i],l-1)))
if (debug_msg_name && (!lstrncmpi(options+1,debug_msg_name[i],l-1)))
{
debug_msg_enabled[i]=(*options=='+');
break;
......@@ -275,7 +276,7 @@ static BOOL MAIN_ParseDLLOptions(char *options)
l=strchr(options,',')-options;
else l=strlen(options);
for (i=0;i<N_BUILTINS;i++)
if (!strncasecmp(options+1,dll_builtin_table[i].name,l-1))
if (!lstrncmpi(options+1,dll_builtin_table[i].name,l-1))
{
dll_builtin_table[i].used = (*options=='+');
break;
......@@ -306,7 +307,7 @@ static void MAIN_ParseLanguageOption( char *arg )
Options.language = LANG_En; /* First language */
for (p = langNames; *p; p++)
{
if (!strcasecmp( *p, arg )) return;
if (!lstrcmpi( *p, arg )) return;
Options.language++;
}
fprintf( stderr, "Invalid language specified '%s'. Supported languages are: ", arg );
......@@ -335,7 +336,7 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
#ifdef WINELIB
/* Need to assemble command line and pass it to WinMain */
#else
if (*argc < 2 || strcasecmp(argv[1], "-h") == 0)
if (*argc < 2 || lstrcmpi(argv[1], "-h") == 0)
MAIN_Usage( argv[0] );
#endif
......@@ -550,6 +551,7 @@ int main( int argc, char *argv[] )
int ret_val;
int depth_count, i;
int *depth_list;
struct timeval tv;
extern int _WinMain(int argc, char **argv);
......@@ -557,6 +559,8 @@ int main( int argc, char *argv[] )
setbuf(stderr,NULL);
setlocale(LC_CTYPE,"");
gettimeofday( &tv, NULL);
MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
XrmInitialize();
......@@ -603,11 +607,7 @@ int main( int argc, char *argv[] )
else rootWindow = DefaultRootWindow( display );
MAIN_SaveSetup();
#ifndef sparc
atexit(called_at_exit);
#else
on_exit (called_at_exit, 0);
#endif
ret_val = _WinMain( argc, argv );
......
......@@ -3,12 +3,10 @@
*/
#include <ctype.h>
#include "stdio.h"
#include "windows.h"
#include "user.h"
#include <stdio.h>
#include "msdos.h"
#include "dos_fs.h"
#include "windows.h"
#include "drive.h"
#define WN_SUCCESS 0x0000
#define WN_NOT_SUPPORTED 0x0001
......@@ -158,29 +156,28 @@ int WNetUnlockQueueData(LPSTR szQueue)
int WNetGetConnection(LPSTR lpLocalName,
LPSTR lpRemoteName, UINT FAR *cbRemoteName)
{
int drive, rc;
const char *path;
if(lpLocalName[1] == ':')
if (lpLocalName[1] == ':')
{
drive = toupper(lpLocalName[0]) - 'A';
if(!DOS_ValidDrive(drive))
rc = WN_NOT_CONNECTED;
else
int drive = toupper(lpLocalName[0]) - 'A';
switch(GetDriveType(drive))
{
if(strlen(DOS_GetRedirectedDir(drive)) + 1 > *cbRemoteName)
rc = WN_MORE_DATA;
else
{
strcpy(lpRemoteName, DOS_GetRedirectedDir(drive));
*cbRemoteName = strlen(lpRemoteName) + 1;
rc = WN_SUCCESS;
}
case DRIVE_CANNOTDETERMINE:
case DRIVE_DOESNOTEXIST:
return WN_BAD_LOCALNAME;
case DRIVE_REMOVABLE:
case DRIVE_FIXED:
return WN_NOT_CONNECTED;
case DRIVE_REMOTE:
path = DRIVE_GetDosCwd(drive);
if (strlen(path) + 1 > *cbRemoteName) return WN_MORE_DATA;
strcpy( lpRemoteName, path );
*cbRemoteName = strlen(lpRemoteName) + 1;
return WN_SUCCESS;
}
}
else
rc = WN_BAD_LOCALNAME;
return rc;
return WN_BAD_LOCALNAME;
}
/**************************************************************************
......
......@@ -460,7 +460,7 @@ int CompareStringA(DWORD lcid, DWORD fdwStyle,
l2 = (l2==-1)?strlen(s2):l2;
len = l1<l2 ? l1:l2;
ret = (fdwStyle & NORM_IGNORECASE) ?
strncasecmp(s1,s2,len) :
lstrncmpi(s1,s2,len) :
strncmp(s1,s2,len);
/* not equal, return 1 or 3 */
if(ret!=0)return ret+2;
......
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#ifndef HAVE_USLEEP
unsigned int usleep (unsigned int useconds)
{
struct timeval delay;
delay.tv_sec = 0;
delay.tv_usec = useconds;
(void) select (0, (fd_set *) NULL, (fd_set *) NULL, (fd_set *) NULL,
&delay);
return 0;
}
#endif /* HAVE_USLEEP */
......@@ -58,7 +58,7 @@ static TSecHeader *is_loaded (char *FileName)
TProfile *p = Base;
while (p){
if (!strcasecmp (FileName, p->FileName)){
if (!lstrcmpi( FileName, p->FileName)){
Current = p;
return p->Section;
}
......@@ -67,6 +67,26 @@ static TSecHeader *is_loaded (char *FileName)
return 0;
}
#define WIN_INI WinIniFileName()
static char *WinIniFileName(void)
{
static char *name = NULL;
int len;
const char *unixName;
if (name) return name;
len = GetWindowsDirectory( NULL, 0 ) + 9;
name = xmalloc( len );
GetWindowsDirectory( name, len );
strcat( name, "/win.ini" );
if (!(unixName = DOSFS_GetUnixFileName( name, TRUE ))) return NULL;
free( name );
name = strdup( unixName );
return name;
}
static char *GetIniFileName(char *name, char *dir)
{
char temp[256];
......@@ -81,7 +101,7 @@ static char *GetIniFileName(char *name, char *dir)
}
else
strcpy(temp, name);
return DOS_GetUnixFileName(temp);
return DOSFS_GetUnixFileName(temp,TRUE);
}
static TSecHeader *load (char *filename, char **pfullname)
......@@ -103,26 +123,27 @@ static TSecHeader *load (char *filename, char **pfullname)
/* First try it as is */
file = GetIniFileName(filename, "");
f = fopen(file, "r");
if (f == NULL) {
if (!file || !(f = fopen(file, "r")))
{
if ((purefilename = strrchr( filename, '\\' )))
purefilename++;
else if ((purefilename = strrchr( filename, '/' )))
purefilename++;
else
purefilename = filename;
ToUnix(purefilename);
/* Now try the Windows directory */
GetWindowsDirectory(path, sizeof(path));
file = GetIniFileName(purefilename, path);
dprintf_profile(stddeb,"Trying to load in windows directory file %s\n",
file);
f = fopen(file, "r");
if (f == NULL) { /* Try the path of the current executable */
if ((file = GetIniFileName(purefilename, path)))
{
dprintf_profile(stddeb,"Trying to load in windows directory file %s\n",
file);
f = fopen(file, "r");
}
else f = NULL;
if (f == NULL)
{ /* Try the path of the current executable */
if (GetCurrentTask())
{
......@@ -131,30 +152,34 @@ static TSecHeader *load (char *filename, char **pfullname)
if ((p = strrchr( path, '\\' )))
{
p[0] = '\0'; /* Remove trailing slash */
file = GetIniFileName(purefilename, path);
dprintf_profile(stddeb,
"Trying to load in current directory%s\n",
file);
f = fopen(file, "r");
if ((file = GetIniFileName(purefilename, path)))
{
dprintf_profile(stddeb,
"Trying to load in current directory%s\n",
file);
f = fopen(file, "r");
}
}
}
}
if (f == NULL) { /* And now in $HOME/.wine */
strcpy(file,getenv("HOME"));
strcat(file, "/.wine/");
strcat(file, purefilename);
dprintf_profile(stddeb,"Trying to load in user-directory %s\n", file);
strcpy(path,getenv("HOME"));
strcat(path, "/.wine/");
strcat(path, purefilename);
dprintf_profile(stddeb,"Trying to load in user-directory %s\n", path);
file = path;
f = fopen(file, "r");
}
if (f == NULL) {
/* FIXED: we ought to create it now (in which directory?) */
/* lets do it in ~/.wine */
strcpy(file,getenv("HOME"));
strcat(file, "/.wine/");
strcat(file, purefilename);
dprintf_profile(stddeb,"Creating %s\n", file);
strcpy(path,getenv("HOME"));
strcat(path, "/.wine/");
strcat(path, purefilename);
dprintf_profile(stddeb,"Creating %s\n", path);
file = path;
f = fopen(file, "w+");
if (f == NULL) {
fprintf(stderr, "profile.c: load() can't find file %s\n", filename);
......@@ -163,7 +188,7 @@ static TSecHeader *load (char *filename, char **pfullname)
}
}
*pfullname = strdup(file);
*pfullname = xstrdup(file);
dprintf_profile(stddeb,"Loading %s\n", file);
firstbrace = TRUE;
......@@ -205,7 +230,7 @@ static TSecHeader *load (char *filename, char **pfullname)
*lastnonspc = 0;
if (!strlen(CharBuffer))
fprintf(stderr, "warning: empty section name in ini file\n");
SecHeader->AppName = strdup (CharBuffer);
SecHeader->AppName = xstrdup (CharBuffer);
dprintf_profile(stddeb,"%s: section %s\n", file, CharBuffer);
firstbrace = FALSE;
} else if (SecHeader) {
......@@ -232,7 +257,7 @@ static TSecHeader *load (char *filename, char **pfullname)
fprintf(stderr, "warning: empty key name in ini file\n");
SecHeader->Keys = (TKeys *) xmalloc (sizeof (TKeys));
SecHeader->Keys->link = temp;
SecHeader->Keys->KeyName = strdup (CharBuffer);
SecHeader->Keys->KeyName = xstrdup (CharBuffer);
dprintf_profile(stddeb,"%s: key %s\n", file, CharBuffer);
......@@ -251,7 +276,7 @@ static TSecHeader *load (char *filename, char **pfullname)
}
} while(bufsize < STRSIZE-1);
*lastnonspc = 0;
SecHeader->Keys->Value = strdup (CharBuffer);
SecHeader->Keys->Value = xstrdup (CharBuffer);
dprintf_profile (stddeb, "[%s] (%s)=%s\n", SecHeader->AppName,
SecHeader->Keys->KeyName, SecHeader->Keys->Value);
if (c == ';') {
......@@ -275,8 +300,8 @@ static void new_key (TSecHeader *section, char *KeyName, char *Value)
TKeys *key;
key = (TKeys *) xmalloc (sizeof (TKeys));
key->KeyName = strdup (KeyName);
key->Value = strdup (Value);
key->KeyName = xstrdup (KeyName);
key->Value = xstrdup (Value);
key->link = section->Keys;
section->Keys = key;
}
......@@ -297,7 +322,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
if (!(section = is_loaded (FileName))){
New = (TProfile *) xmalloc (sizeof (TProfile));
New->link = Base;
New->FileName = strdup (FileName);
New->FileName = xstrdup (FileName);
New->Section = load (FileName, &New->FullName);
New->changed = FALSE;
Base = New;
......@@ -307,7 +332,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
/* Start search */
for (; section; section = section->link){
if (strcasecmp (section->AppName, AppName))
if (lstrcmpi(section->AppName, AppName))
continue;
/* If no key value given, then list all the keys */
......@@ -333,11 +358,11 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
}
for (key = section->Keys; key; key = key->link){
int slen;
if (strcasecmp (key->KeyName, KeyName))
if (lstrcmpi(key->KeyName, KeyName))
continue;
if (set){
free (key->Value);
key->Value = strdup (Default ? Default : "");
key->Value = xstrdup (Default ? Default : "");
Current->changed=TRUE;
return 1;
}
......@@ -362,7 +387,7 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
/* Non existent section */
if (set){
section = (TSecHeader *) xmalloc (sizeof (TSecHeader));
section->AppName = strdup (AppName);
section->AppName = xstrdup (AppName);
section->Keys = 0;
new_key (section, KeyName, Default);
section->link = Current->Section;
......@@ -376,9 +401,9 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
return 1;
}
short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName,
LPSTR Default, LPSTR ReturnedString,
short Size, LPSTR FileName)
short GetPrivateProfileString (LPCSTR AppName, LPCSTR KeyName,
LPCSTR Default, LPSTR ReturnedString,
short Size, LPCSTR FileName)
{
int v;
......@@ -391,15 +416,15 @@ short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName,
return Size - v;
}
int GetProfileString (LPSTR AppName, LPSTR KeyName, LPSTR Default,
int GetProfileString (LPCSTR AppName, LPCSTR KeyName, LPCSTR Default,
LPSTR ReturnedString, int Size)
{
return GetPrivateProfileString (AppName, KeyName, Default,
ReturnedString, Size, WIN_INI);
ReturnedString, Size, WIN_INI );
}
WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default,
LPSTR File)
WORD GetPrivateProfileInt (LPCSTR AppName, LPCSTR KeyName, short Default,
LPCSTR File)
{
static char IntBuf[10];
static char buf[10];
......@@ -408,14 +433,14 @@ WORD GetPrivateProfileInt (LPSTR AppName, LPSTR KeyName, short Default,
/* Check the exact semantic with the SDK */
GetPrivateProfileString (AppName, KeyName, buf, IntBuf, 10, File);
if (!strcasecmp (IntBuf, "true"))
if (!lstrcmpi(IntBuf, "true"))
return 1;
if (!strcasecmp (IntBuf, "yes"))
if (!lstrcmpi(IntBuf, "yes"))
return 1;
return strtoul( IntBuf, NULL, 0 );
}
WORD GetProfileInt (LPSTR AppName, LPSTR KeyName, int Default)
WORD GetProfileInt (LPCSTR AppName, LPCSTR KeyName, int Default)
{
return GetPrivateProfileInt (AppName, KeyName, Default, WIN_INI);
}
......
......@@ -150,11 +150,11 @@ _LoadLevel(FILE *f,LPKEYSTRUCT lpKey,int tabsexp,char *buf)
if (NULL!=(t=strchr(s,'='))) {
*t='\0';t++;
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = strdup(s);
lpNewKey->lpValue = strdup(t);
lpNewKey->lpSubKey = xstrdup(s);
lpNewKey->lpValue = xstrdup(t);
} else {
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = strdup(s);
lpNewKey->lpSubKey = xstrdup(s);
}
_LoadLevel(f,lpNewKey,tabsexp+1,buf);
}
......@@ -175,11 +175,11 @@ _LoadLevel(FILE *f,LPKEYSTRUCT lpKey,int tabsexp,char *buf)
if (NULL!=(t=strchr(s,'='))) {
*t='\0';t++;
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = strdup(s);
lpNewKey->lpValue = strdup(t);
lpNewKey->lpSubKey = xstrdup(s);
lpNewKey->lpValue = xstrdup(t);
} else {
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = strdup(s);
lpNewKey->lpSubKey = xstrdup(s);
}
lpKey=lpNewKey;
}
......@@ -280,6 +280,7 @@ LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, HKEY FAR *lphKey)
lpKey = lphTopKey; break;
case HKEY_CLASSES_ROOT: /* == 1 */
case 0x80000000:
case 0x80000001:
lpKey = lphRootKey; break;
default:
dprintf_reg(stddeb,"RegCreateKey // specific key = %08lX !\n", (DWORD)hKey);
......
......@@ -539,7 +539,7 @@ void SpyInit(void)
if(MessageTypeNames[i])
if(strstr(lpstrBuffer,MessageTypeNames[i])) SpyFilters[i] = TRUE;
GetPrivateProfileString("spy", "Include", "",lpstrBuffer ,511 , WINE_INI);
GetPrivateProfileString("spy", "Include", "INCLUDEALL",lpstrBuffer ,511 , WINE_INI);
dprintf_message(stddeb,"SpyInit: Include=%s\n",lpstrBuffer);
if( *lpstrBuffer != 0 )
if(strstr(lpstrBuffer,"INCLUDEALL"))
......
......@@ -74,6 +74,26 @@ BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
/***********************************************************************
* TimerCount (TOOLHELP.80)
*/
BOOL TimerCount( TIMERINFO *pTimerInfo )
{
/* FIXME
* In standard mode, dwmsSinceStart = dwmsThisVM
*
* I tested this, under Windows in enhanced mode, and
* if you never switch VM (ie start/stop DOS) these
* values should be the same as well.
*
* Also, Wine should adjust for the hardware timer
* to reduce the amount of error to ~1ms.
* I can't be bothered, can you?
*/
pTimerInfo->dwmsSinceStart = pTimerInfo->dwmsThisVM = GetTickCount();
return TRUE;
}
/***********************************************************************
* USER_HeapInit
*/
BOOL USER_HeapInit(void)
......
......@@ -13,6 +13,7 @@
#include "relay32.h"
#include "alias.h"
#include "stackframe.h"
#include "xmalloc.h"
/* Structure copy functions */
static void MSG16to32(MSG *msg16,struct WIN32_MSG *msg32)
......@@ -43,7 +44,11 @@ static void MSG32to16(struct WIN32_MSG *msg32,MSG *msg16)
ATOM USER32_RegisterClassA(WNDCLASSA* wndclass)
{
WNDCLASS copy;
char *s1,*s2;
HANDLE classh = 0, menuh = 0;
SEGPTR classsegp, menusegp;
char *classbuf, *menubuf;
ATOM retval;
copy.style=wndclass->style;
ALIAS_RegisterAlias(0,0,(DWORD)wndclass->lpfnWndProc);
copy.lpfnWndProc=wndclass->lpfnWndProc;
......@@ -53,29 +58,31 @@ ATOM USER32_RegisterClassA(WNDCLASSA* wndclass)
copy.hIcon=(HICON)wndclass->hIcon;
copy.hCursor=(HCURSOR)wndclass->hCursor;
copy.hbrBackground=(HBRUSH)wndclass->hbrBackground;
/* FIXME: There has to be a better way of doing this - but neither
malloc nor alloca will work */
if(wndclass->lpszMenuName)
{
s1=alloca(strlen(wndclass->lpszMenuName)+1);
strcpy(s1,wndclass->lpszMenuName);
copy.lpszMenuName=MAKE_SEGPTR(s1);
menuh = GlobalAlloc(0, strlen(wndclass->lpszMenuName)+1);
menusegp = WIN16_GlobalLock(menuh);
menubuf = PTR_SEG_TO_LIN(menusegp);
strcpy( menubuf, wndclass->lpszMenuName);
copy.lpszMenuName=menusegp;
}else
copy.lpszMenuName=0;
if(wndclass->lpszClassName)
{
s2=alloca(strlen(wndclass->lpszClassName)+1);
strcpy(s2,wndclass->lpszClassName);
copy.lpszClassName=MAKE_SEGPTR(s2);
classh = GlobalAlloc(0, strlen(wndclass->lpszClassName)+1);
classsegp = WIN16_GlobalLock(classh);
classbuf = PTR_SEG_TO_LIN(classsegp);
strcpy( classbuf, wndclass->lpszClassName);
copy.lpszClassName=classsegp;
}
return RegisterClass(&copy);
}
/***********************************************************************
* DefWindowProcA (USER32.125)
*/
LRESULT USER32_DefWindowProcA(DWORD hwnd,DWORD msg,DWORD wParam,DWORD lParam)
{
/* some messages certainly need special casing. We come to that later */
return DefWindowProc((HWND)hwnd,msg,wParam,lParam);
retval = RegisterClass(&copy);
GlobalFree(menuh);
GlobalFree(classh);
return retval;
}
/***********************************************************************
......@@ -141,22 +148,50 @@ LONG USER32_DispatchMessageA(struct WIN32_MSG* lpmsg)
}
/***********************************************************************
* TranslateMessage (USER32.555)
*/
BOOL USER32_TranslateMessage(struct WIN32_MSG* lpmsg)
{
MSG msg;
MSG32to16(lpmsg,&msg);
return TranslateMessage(&msg);
}
/***********************************************************************
* CreateWindowExA (USER32.82)
*/
DWORD USER32_CreateWindowExA(long flags,char* class,char *title,
long style,int x,int y,int width,int height,DWORD parent,DWORD menu,
DWORD instance,DWORD param)
{
DWORD retval;
HANDLE classh, titleh;
SEGPTR classsegp, titlesegp;
char *classbuf, *titlebuf;
/*Have to translate CW_USEDEFAULT */
if(x==0x80000000)x=CW_USEDEFAULT;
if(y==0x80000000)y=CW_USEDEFAULT;
if(width==0x80000000)width=CW_USEDEFAULT;
classbuf = alloca( strlen(class)+1 );
if(height==0x80000000)height=CW_USEDEFAULT;
/* FIXME: There has to be a better way of doing this - but neither
malloc nor alloca will work */
classh = GlobalAlloc(0, strlen(class)+1);
titleh = GlobalAlloc(0, strlen(title)+1);
classsegp = WIN16_GlobalLock(classh);
titlesegp = WIN16_GlobalLock(titleh);
classbuf = PTR_SEG_TO_LIN(classsegp);
titlebuf = PTR_SEG_TO_LIN(titlesegp);
strcpy( classbuf, class );
titlebuf = alloca( strlen(title)+1 );
strcpy( titlebuf, title );
return (DWORD) CreateWindowEx(flags,MAKE_SEGPTR(classbuf),
MAKE_SEGPTR(titlebuf),style,x,y,width,height,
retval = (DWORD) CreateWindowEx(flags,classsegp,
titlesegp,style,x,y,width,height,
(HWND)parent,(HMENU)menu,(HINSTANCE)instance,
(LPVOID)param);
GlobalFree(classh);
GlobalFree(titleh);
return retval;
}
......@@ -23,7 +23,7 @@
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
#undef TRANSPARENT
#include "winsock.h"
#include "toolhelp.h"
#include "stddebug.h"
......@@ -35,9 +35,7 @@ static key_t wine_key = 0;
static FARPROC BlockFunction;
static fd_set fd_in_use;
#ifdef __FreeBSD__
extern int h_errno;
#endif /* __FreeBSD__ */
struct ipc_packet {
long mtype;
......@@ -660,11 +658,10 @@ SOCKET WINSOCK_socket(INT af, INT type, INT protocol)
}
if (sock > 0xffff) {
/* we set the value of wsa_errno directly, because
* only support socket numbers up to 0xffff. The
* value return indicates there are no descriptors available
/* we only support socket numbers up to 0xffff. The return
* value indicates there are no more descriptors available
*/
wsa_errno = WSAEMFILE;
WSASetLastError(WSAEMFILE);
return INVALID_SOCKET;
}
......@@ -846,7 +843,7 @@ static void recv_message(int sig)
if (!message_is_valid) {
if (msgrcv(wine_key, (struct msgbuf*)&(message),
IPC_PACKET_SIZE, MTYPE, IPC_NOWAIT) == -1) {
perror("wine: msgrcv");
perror("wine: winsock: msgrcv");
break;
}
}
......@@ -877,7 +874,7 @@ static void send_message( HWND hWnd, u_int wMsg, HANDLE handle, long lParam)
if (msgsnd(wine_key, (struct msgbuf*)&(message),
IPC_PACKET_SIZE, 0/*IPC_NOWAIT*/) == -1)
perror("wine: msgsnd");
perror("wine: winsock: msgsnd");
kill(getppid(), SIGUSR1);
}
......@@ -1046,42 +1043,44 @@ HANDLE WSAAsyncGetServByPort(HWND hWnd, u_int wMsg, INT port, const char
INT WSAAsyncSelect(SOCKET s, HWND hWnd, u_int wMsg, long lEvent)
{
long event;
fd_set read_fds, write_fds, except_fds;
dprintf_winsock(stddeb, "WSA_AsyncSelect: socket %d, HWND "NPFMT", wMsg %d, event %ld\n", s, hWnd, wMsg, lEvent);
/* remove outstanding asyncselect() processes */
/* kill */
if (wMsg == 0 && lEvent == 0)
return 0;
if (fork()) {
return 0;
} else {
while (1) {
FD_ZERO(&read_fds);
FD_ZERO(&write_fds);
FD_ZERO(&except_fds);
if (lEvent & FD_READ)
FD_SET(s, &read_fds);
if (lEvent & FD_WRITE)
FD_SET(s, &write_fds);
fcntl(s, F_SETFL, O_NONBLOCK);
select(s + 1, &read_fds, &write_fds, &except_fds, NULL);
event = 0;
if (FD_ISSET(s, &read_fds))
event |= FD_READ;
if (FD_ISSET(s, &write_fds))
event |= FD_WRITE;
/* FIXME: the first time through we get a winsock error of 2, why? */
send_message(hWnd, wMsg, (HANDLE)s, (wsaerrno() << 16) | event);
}
}
long event;
fd_set read_fds, write_fds, except_fds;
int errors = 0;
dprintf_winsock(stddeb, "WSA_AsyncSelect: socket %d, HWND "NPFMT", wMsg %d, event %ld\n", s, hWnd, wMsg, lEvent);
/* remove outstanding asyncselect() processes */
/* kill */
if (wMsg == 0 && lEvent == 0)
return 0;
if (fork()) {
return 0;
} else {
while (1) {
FD_ZERO(&read_fds);
FD_ZERO(&write_fds);
FD_ZERO(&except_fds);
if (lEvent & FD_READ)
FD_SET(s, &read_fds);
if (lEvent & FD_WRITE)
FD_SET(s, &write_fds);
fcntl(s, F_SETFL, O_NONBLOCK);
if (select(s + 1, &read_fds, &write_fds, &except_fds, NULL)<0) {
errors = wsaerrno();
}
event = 0;
if (FD_ISSET(s, &read_fds))
event |= FD_READ;
if (FD_ISSET(s, &write_fds))
event |= FD_WRITE;
send_message(hWnd, wMsg, s, WSAMAKESELECTREPLY(event,errors));
}
}
}
INT WSAFDIsSet(INT fd, fd_set *set)
......@@ -1183,7 +1182,7 @@ INT WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
/* ipc stuff */
if ((wine_key = msgget(IPC_PRIVATE, 0600)) == -1)
perror("wine: msgget");
perror("wine: winsock: msgget");
signal(SIGUSR1, recv_message);
......@@ -1201,7 +1200,7 @@ INT WSACleanup(void)
if (wine_key)
if (msgctl(wine_key, IPC_RMID, NULL) == -1)
perror("wine: shmctl");
perror("wine: winsock: shmctl");
for (fd = 0; fd != FD_SETSIZE; fd++)
if (FD_ISSET(fd, &fd_in_use))
......
......@@ -14,6 +14,7 @@
*/
#include <stdio.h>
#include <string.h>
#include "xmalloc.h"
void *
......@@ -42,3 +43,15 @@ xrealloc (void *ptr, size_t size)
}
return res;
}
char *xstrdup( const char *str )
{
char *res = strdup( str );
if (!res)
{
fprintf (stderr, "Virtual memory exhausted.\n");
exit (1);
}
return res;
}
......@@ -23,7 +23,7 @@ int runtime_cpu (void)
{
char info[5], value[5];
while (fscanf (f, " %4s%*s : %4s%*s", info, value) == 2)
if (!strcasecmp (info, "cpu"))
if (!lstrcmpi (info, "cpu"))
{
if (isdigit (value[0]) && value[1] == '8'
&& value[2] == '6' && value[3] == 0)
......
......@@ -5,6 +5,7 @@
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include "windows.h"
......@@ -240,6 +241,11 @@ void INT_Int31Handler( struct sigcontext_struct context )
case 0x0601: /* Unlock linear region */
break; /* Just ignore it */
case 0x0604: /* Get page size */
BX_reg(&context) = 0;
CX_reg(&context) = 4096;
break;
default:
INT_BARF( &context, 0x31 );
AX_reg(&context) = 0x8001; /* unsupported function */
......
......@@ -426,8 +426,7 @@ BOOL INSTR_EmulateInstruction( struct sigcontext_struct *context )
(long_addr ? ECX_reg(context) : CX_reg(context)) : 1;
int opsize = (typ & 1) ? (long_op ? 4 : 2) : 1;
int step = (EFL_reg(context) & 0x400) ? -opsize : +opsize;
int seg = outp ? (segprefix >= 0 ? segprefix : DS_reg(context))
: ES_reg(context); /* FIXME: is this right? */
int seg = outp ? DS_reg(context) : ES_reg(context); /* FIXME: is this right? */
if (outp)
/* FIXME: Check segment readable. */
......
......@@ -6,7 +6,7 @@
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "dos_fs.h"
#include "drive.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"
......@@ -21,7 +21,7 @@ void INT_Int25Handler( struct sigcontext_struct context )
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(&context), BX_reg(&context) );
DWORD begin, length;
if (!DOS_ValidDrive(AL_reg(&context)))
if (!DRIVE_IsValid(AL_reg(&context)))
{
SET_CFLAG(&context);
AX_reg(&context) = 0x0101; /* unknown unit */
......@@ -30,9 +30,9 @@ void INT_Int25Handler( struct sigcontext_struct context )
if (CX_reg(&context) == 0xffff)
{
begin = getdword(dataptr);
length = getword(&dataptr[4]);
dataptr = (BYTE *) PTR_SEG_TO_LIN(getdword(&dataptr[6]));
begin = *(DWORD *)dataptr;
length = *(WORD *)(dataptr + 4);
dataptr = (BYTE *)PTR_SEG_TO_LIN( *(SEGPTR *)(dataptr + 6) );
}
else
{
......
......@@ -5,7 +5,7 @@
#include "ldt.h"
#include "wine.h"
#include "miscemu.h"
#include "dos_fs.h"
#include "drive.h"
#include "stddebug.h"
/* #define DEBUG_INT */
#include "debug.h"
......@@ -20,7 +20,7 @@ void INT_Int26Handler( struct sigcontext_struct context )
BYTE *dataptr = PTR_SEG_OFF_TO_LIN( DS_reg(&context), BX_reg(&context) );
DWORD begin, length;
if (!DOS_ValidDrive(AL_reg(&context)))
if (!DRIVE_IsValid(AL_reg(&context)))
{
SET_CFLAG(&context);
AX_reg(&context) = 0x0101; /* unknown unit */
......@@ -29,9 +29,9 @@ void INT_Int26Handler( struct sigcontext_struct context )
if (CX_reg(&context) == 0xffff)
{
begin = getdword(dataptr);
length = getword(&dataptr[4]);
dataptr = (BYTE *) PTR_SEG_TO_LIN(getdword(&dataptr[6]));
begin = *(DWORD *)dataptr;
length = *(WORD *)(dataptr + 4);
dataptr = (BYTE *)PTR_SEG_TO_LIN( *(SEGPTR *)(dataptr + 6) );
}
else
{
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment