Release 960218
Sun Feb 18 16:35:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/desktop.c]
Look for the wallpaper file in the Windows directory.
* [controls/menu.c]
Fixed swapped parameters in SetMenuItemBitmaps().
Create a separator in MENU_SetItemData() when the string is NULL.
* [file/dosfs.c]
DOSFS_FindNext: don't return '.' and '..' in a drive root dir.
* [files/file.c]
Added a DOS_FILE structure to store per-file information (not
really used yet).
Fixed _lread and _hread to check the size of the buffer before
calling Unix read() to avoid EFAULT error.
* [misc/exec.c]
Return TRUE in WinHelp() for HELP_QUIT to quiet Notepad on exit.
* [miscemu/instr.c]
Call DOSMEM_Alarm() in INSTR_ReplaceSelector(). This should fix
programs that poll the BIOS counter, provided they reload the
selector on every read.
* [miscemu/int21.c]
Re-implemented FindFirst/FindNext for FCB calls.
* [windows/message.c] [windows/winpos.c]
Merged MSG_GetWindowForEvent() and WINPOS_WindowFromPoint().
* [windows/nonclient.c] [windows/win.c] [include/windows.h]
Added a per-window WIN_MANAGED flag; only windows that have a
dialog frame or a sizing border are managed.
Sat Feb 17 18:25:00 1996 Thomas Sandford <tdgsandf@prds-grn.demon.co.uk>
* [if1632/Makefile.in]
Added -g flag to compilation of .c files generated from *32.spec.
* [if1632/gdi32.spec]
Numerous additional functions implemented.
* if1632/user32.spec]
wsprintfA maps to vsprintf not wsprintf
Numerous additional functions implemented.
* [include/gdi.h] [objects/gdiobj.c]
New #define MAGIC_DONTCARE added. This is used in
GDI_GetObjPtr to enable getting a pointer to a GDI object of
unknow type.
* [win32/gdi32.c]
New file.
* [win32/param32.c]
WIN32_MoveToEx() - handle NULL pointer argument.
* [win32/user32.c]
USER32_InvalidateRect - handle passing of a NULL pointer.
USER32_SetTimer - New function.
* [files/directory.c]
Fixed DIR_Init() (off by one in allocation of space for
environment variables).
* [files/drive.c]
Added <sys/types.h> to #includes (prerequisite for <sys/stat.h>
on FreeBSD).
Fri Feb 16 10:26:56 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de>
* [controls/menu.c]
Memory leak plugged.
* [controls/edit.c]
Erase space with function ExtTextOut(). This eliminates the use of
xmalloc(). Memory leak in EDIT_WriteText plugged.
* [debugger/db_disasm.c]
Operand for scas now is di.
* [files/profile.c]
PROFILE_GetSection was copying too much data.
PROFILE_GetSection now returns the correct value. It was returning
the number of unused instead of used bytes.
* [objects/dc.c]
Corrected two typos in comments.
* [objects/font.c]
FONT_MatchFont didn't return if it couldn't find any font.
* [objects/oembitmap.c]
Free object only if it has been allocated.
* [windows/scroll.c]
Memory leak in ScrollDC plugged.
Tue Feb 13 11:17:00 1996 William Magro <wmagro@tc.cornell.edu>
* [controls/edit.c]
Implemented ES_NOHIDESEL style, shift+click selection,
shift+{arrow,home,end,pgup,pgdn} selection. Optimized
(de)selection drawing. Changed selection drawing to use correct
system colors instead of inverting. Fixed deleting or backspacing
across a '\r\n' end of line pair. Selection now anchors
correctly. Fixed text leaking and extra garbage problem bug
uncovered by change in class style in wine960131.
* [controls/widgets.c]
Class flags now match those of Windows.
Mon Feb 12 21:28:19 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
* [controls/widgets.c]
WIDGETS_Init: RELAY32_GetEntryPoint does not take a string anymore.
* [if1632/Makefile.in][if1632/relay32.c][include/relay32.h]
comctl32.spec ole32.spec winspool.spec: new files.
RELAY32_Init: call initialization of new DLLs.
RELAY32_GetEntryPoint: expects WIN32_builtin* now.
RELAY32_MakeFakeModule: new function.
* [if1632/gdi32.spec][if1632/kernel32.spec][if1632/user32.spec]
Added Win95 functions. Ordinals now differ from both NT and Win95
HeapCreate, CreateDialogIndirectParamA, CreateDialogIndirectParamW,
CreateDialogParamA, CreateDialogParamW, DialogBoxIndirectParamA
DialogBoxIndirectParamW, DialogBoxParamA, DialogBoxParamW:
new relays.
* [if1632/shell32.spec]
shell32.spec: renumbered all functions to take into account ordinals.
These seem to be identical between NT and Win95.
* [include/dialog.h][windows/dialog.c]
xBaseUnit,yBaseUnit,DIALOG_DoDialogBox: made non-static.
* [include/handle32.h]
New handle types VRANGE, HEAP, HEAPITEM.
* [include/pe_image.h][loader/pe_image.c]
struct w_files: new field builtin.
PE_FindExportedFunction: support ordinals.
PE_GetProcAddress: call RELAY32_GetEntryPoint for builtins.
fixup_imports: support ordinals.
PE_LoadImage: prefer directories over segments.
* [include/resource.h][win32/resource.c]
FindResource32: changed parameter from LPCTSTR to LPCWSTR
check LANG_NEUTRAL if LANG_ENGLISH fails.
LoadAcceleratorsW,SizeofResource32,AccessResource32:
disabled because it's broken.
Casted to and from LPWSTR at various places.
* [include/string32.h][win32/string32.c]
Changed prototypes to take const arguments where appropriate.
* [include/struct32.h]
New structures DLGTEMPLATE32, DLGITEMTEMPLATE32.
* [tools/build.c]
BuildSpec32Files: generate Base value into code, generate call to
RELAY32_MakeFakeModule.
* [win32/heap.c]
This is still not finished and needs rework.
HeapAlloc: renamed to SIMPLE_HeapAlloc, implemented HeapAlloc.
HeapCreate: implemented on top of VirtualAlloc, which does not work yet
HeapDestroy, HEAP_GrowHeap, HeapFree: new functions.
* [win32/memory.c]
Support for VRANGE_OBJECT. This is not yet called from any place,
and needs more platform specific support
MEMORY_FindVrange, MEMORY_IsVrangeFree, MEMORY_InsertVrange,
MEMORY_AllocVrange, MEMORY_ReleaseVrange: new functions.
* [win32/user32.c]
WIN32_CreateWindowExA: don't GlobalAlloc for integer class and window
names, as in dialogs.
Implemented dialog functions (see user32.spec).
* [windows/caret.c]
CARET_Initialize: call RELAY32_GetBuiltinDLL.
Mon Feb 12 18:52:40 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
* [controls/edit.c]
Removed commented out #ifdefs for WINELIB.
* [tools/makehtml.pl]
Put in error checking when trying to open a file.
* [libtest/Makefile.in] [libtest/new.c] [libtest/hello4.c]
Added two new targets: hello4 and new.
* [include/windows.h]
Added definition of DEVMODE structure, although it's not yet used.
Modified various API functions from CreateDC() to Escape(), in
order to make them more compliant with the strict API definitions.
* [include/wintypes.h]
Added 'typedef char TCHAR'. It probably should be defined as
'short', but then we would have to support such characters. Also did
'typedef const TCHAR* LPCTSTR' and 'typedef TCHAR* LPTSTR'.
Also defined WNDENUMPROC, FONTENUMPROC, GOBJENUMPROC, PROPENUMPROC
MFENUMPROC, and HGDIOBJ.
Mon Feb 5 16:42:07 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>
* [misc/commdlg.c]
Patched a bug that occurred in the internal COMMDLG module for the
FileOpen(), FileSave() and FileSaveAs() functions. The file-type
combobox is now handled correctly.
Fri Feb 2 22:52:58 1996 Roman Dolejsi <roman@sorry.vse.cz>
* [resources/sysres_Cz.rc]
Added support for Czech [Cz] language.
Thu Feb 1 00:35:04 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
* [objects/font.c]
FONT_matchfont : for fixed-spacing fonts, allow 'c' if 'm' fails;
for variable-spacing fonts : allow '*' if 'p' fails; if asked lfHeight
is -1, assume 0.
CreateFontIndirect : if font parameter is NULL, issue an error message.
CreateFont : null-terminate lfFaceName.
ParseFontParms : debug code turned off : too verbose.
InitFontsList : recognize *-c-* fonts as fixed-spacing fonts.
* [objects/color.c]
ColorToPhysical : admit 0xff...... COLORREF's as 0x00...... ones.
diff --git a/ANNOUNCE b/ANNOUNCE
index 2f3d6e1..f46d240 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,15 +1,14 @@
-This is release 960131 of Wine the MS Windows emulator. This is still a
+This is release 960218 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.
+Patches should be submitted to "julliard@lrc.epfl.ch". Please don't
+forget to include a ChangeLog entry.
-WHAT'S NEW with Wine-960131: (see ChangeLog for details)
- - New format for drives configuration in wine.conf; please
- check your configuration files.
- - Many MDI improvements.
- - Even more Win32 code.
+WHAT'S NEW with Wine-960218: (see ChangeLog for details)
+ - Lots of edit control fixes.
+ - Czech language support.
+ - As usual, more Win32 code.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@@ -18,10 +17,10 @@
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-960131.tar.gz
- tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960131.tar.gz
- ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960131.tar.gz
- aris.com:/pub/linux/ALPHA/Wine/development/Wine-960131.tar.gz
+ sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-960218.tar.gz
+ tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960218.tar.gz
+ ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960218.tar.gz
+ aris.com:/pub/linux/ALPHA/Wine/development/Wine-960218.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.
@@ -49,4 +48,4 @@
--
Alexandre Julliard
-julliard@sunsite.unc.edu
+julliard@lrc.epfl.ch
diff --git a/ChangeLog b/ChangeLog
index e5a42a0..315a1ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,241 @@
----------------------------------------------------------------------
-Wed Jan 31 10:58:00 1996 Alexandre Julliard <julliar@sunsite.unc.edu>
+Sun Feb 18 16:35:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
+
+ * [controls/desktop.c]
+ Look for the wallpaper file in the Windows directory.
+
+ * [controls/menu.c]
+ Fixed swapped parameters in SetMenuItemBitmaps().
+ Create a separator in MENU_SetItemData() when the string is NULL.
+
+ * [file/dosfs.c]
+ DOSFS_FindNext: don't return '.' and '..' in a drive root dir.
+
+ * [files/file.c]
+ Added a DOS_FILE structure to store per-file information (not
+ really used yet).
+ Fixed _lread and _hread to check the size of the buffer before
+ calling Unix read() to avoid EFAULT error.
+
+ * [misc/exec.c]
+ Return TRUE in WinHelp() for HELP_QUIT to quiet Notepad on exit.
+
+ * [miscemu/instr.c]
+ Call DOSMEM_Alarm() in INSTR_ReplaceSelector(). This should fix
+ programs that poll the BIOS counter, provided they reload the
+ selector on every read.
+
+ * [miscemu/int21.c]
+ Re-implemented FindFirst/FindNext for FCB calls.
+
+ * [windows/message.c] [windows/winpos.c]
+ Merged MSG_GetWindowForEvent() and WINPOS_WindowFromPoint().
+
+ * [windows/nonclient.c] [windows/win.c] [include/windows.h]
+ Added a per-window WIN_MANAGED flag; only windows that have a
+ dialog frame or a sizing border are managed.
+
+Sat Feb 17 18:25:00 1996 Thomas Sandford <tdgsandf@prds-grn.demon.co.uk>
+
+ * [if1632/Makefile.in]
+ Added -g flag to compilation of .c files generated from *32.spec.
+
+ * [if1632/gdi32.spec]
+ Numerous additional functions implemented.
+
+ * if1632/user32.spec]
+ wsprintfA maps to vsprintf not wsprintf
+ Numerous additional functions implemented.
+
+ * [include/gdi.h] [objects/gdiobj.c]
+ New #define MAGIC_DONTCARE added. This is used in
+ GDI_GetObjPtr to enable getting a pointer to a GDI object of
+ unknow type.
+
+ * [win32/gdi32.c]
+ New file.
+
+ * [win32/param32.c]
+ WIN32_MoveToEx() - handle NULL pointer argument.
+
+ * [win32/user32.c]
+ USER32_InvalidateRect - handle passing of a NULL pointer.
+ USER32_SetTimer - New function.
+
+ * [files/directory.c]
+ Fixed DIR_Init() (off by one in allocation of space for
+ environment variables).
+
+ * [files/drive.c]
+ Added <sys/types.h> to #includes (prerequisite for <sys/stat.h>
+ on FreeBSD).
+
+Fri Feb 16 10:26:56 1996 Andreas Kirschbaum <ank@rbg.informatik.th-darmstadt.de>
+
+ * [controls/menu.c]
+ Memory leak plugged.
+
+ * [controls/edit.c]
+ Erase space with function ExtTextOut(). This eliminates the use of
+ xmalloc(). Memory leak in EDIT_WriteText plugged.
+
+ * [debugger/db_disasm.c]
+ Operand for scas now is di.
+
+ * [files/profile.c]
+ PROFILE_GetSection was copying too much data.
+ PROFILE_GetSection now returns the correct value. It was returning
+ the number of unused instead of used bytes.
+
+ * [objects/dc.c]
+ Corrected two typos in comments.
+
+ * [objects/font.c]
+ FONT_MatchFont didn't return if it couldn't find any font.
+
+ * [objects/oembitmap.c]
+ Free object only if it has been allocated.
+
+ * [windows/scroll.c]
+ Memory leak in ScrollDC plugged.
+
+Tue Feb 13 11:17:00 1996 William Magro <wmagro@tc.cornell.edu>
+
+ * [controls/edit.c]
+ Implemented ES_NOHIDESEL style, shift+click selection,
+ shift+{arrow,home,end,pgup,pgdn} selection. Optimized
+ (de)selection drawing. Changed selection drawing to use correct
+ system colors instead of inverting. Fixed deleting or backspacing
+ across a '\r\n' end of line pair. Selection now anchors
+ correctly. Fixed text leaking and extra garbage problem bug
+ uncovered by change in class style in wine960131.
+
+ * [controls/widgets.c]
+ Class flags now match those of Windows.
+
+Mon Feb 12 21:28:19 1996 Martin von Loewis <loewis@informatik.hu-berlin.de>
+
+ * [controls/widgets.c]
+ WIDGETS_Init: RELAY32_GetEntryPoint does not take a string anymore.
+
+ * [if1632/Makefile.in][if1632/relay32.c][include/relay32.h]
+ comctl32.spec ole32.spec winspool.spec: new files.
+ RELAY32_Init: call initialization of new DLLs.
+ RELAY32_GetEntryPoint: expects WIN32_builtin* now.
+ RELAY32_MakeFakeModule: new function.
+
+ * [if1632/gdi32.spec][if1632/kernel32.spec][if1632/user32.spec]
+ Added Win95 functions. Ordinals now differ from both NT and Win95
+ HeapCreate, CreateDialogIndirectParamA, CreateDialogIndirectParamW,
+ CreateDialogParamA, CreateDialogParamW, DialogBoxIndirectParamA
+ DialogBoxIndirectParamW, DialogBoxParamA, DialogBoxParamW:
+ new relays.
+
+ * [if1632/shell32.spec]
+ shell32.spec: renumbered all functions to take into account ordinals.
+ These seem to be identical between NT and Win95.
+
+ * [include/dialog.h][windows/dialog.c]
+ xBaseUnit,yBaseUnit,DIALOG_DoDialogBox: made non-static.
+
+ * [include/handle32.h]
+ New handle types VRANGE, HEAP, HEAPITEM.
+
+ * [include/pe_image.h][loader/pe_image.c]
+ struct w_files: new field builtin.
+ PE_FindExportedFunction: support ordinals.
+ PE_GetProcAddress: call RELAY32_GetEntryPoint for builtins.
+ fixup_imports: support ordinals.
+ PE_LoadImage: prefer directories over segments.
+
+ * [include/resource.h][win32/resource.c]
+ FindResource32: changed parameter from LPCTSTR to LPCWSTR
+ check LANG_NEUTRAL if LANG_ENGLISH fails.
+ LoadAcceleratorsW,SizeofResource32,AccessResource32:
+ disabled because it's broken.
+ Casted to and from LPWSTR at various places.
+
+ * [include/string32.h][win32/string32.c]
+ Changed prototypes to take const arguments where appropriate.
+
+ * [include/struct32.h]
+ New structures DLGTEMPLATE32, DLGITEMTEMPLATE32.
+
+ * [tools/build.c]
+ BuildSpec32Files: generate Base value into code, generate call to
+ RELAY32_MakeFakeModule.
+
+ * [win32/heap.c]
+ This is still not finished and needs rework.
+ HeapAlloc: renamed to SIMPLE_HeapAlloc, implemented HeapAlloc.
+ HeapCreate: implemented on top of VirtualAlloc, which does not work yet
+ HeapDestroy, HEAP_GrowHeap, HeapFree: new functions.
+
+ * [win32/memory.c]
+ Support for VRANGE_OBJECT. This is not yet called from any place,
+ and needs more platform specific support
+ MEMORY_FindVrange, MEMORY_IsVrangeFree, MEMORY_InsertVrange,
+ MEMORY_AllocVrange, MEMORY_ReleaseVrange: new functions.
+
+ * [win32/user32.c]
+ WIN32_CreateWindowExA: don't GlobalAlloc for integer class and window
+ names, as in dialogs.
+ Implemented dialog functions (see user32.spec).
+
+ * [windows/caret.c]
+ CARET_Initialize: call RELAY32_GetBuiltinDLL.
+
+Mon Feb 12 18:52:40 1996 Jim Peterson <jspeter@birch.ee.vt.edu>
+
+ * [controls/edit.c]
+ Removed commented out #ifdefs for WINELIB.
+
+ * [tools/makehtml.pl]
+ Put in error checking when trying to open a file.
+
+ * [libtest/Makefile.in] [libtest/new.c] [libtest/hello4.c]
+ Added two new targets: hello4 and new.
+
+ * [include/windows.h]
+ Added definition of DEVMODE structure, although it's not yet used.
+ Modified various API functions from CreateDC() to Escape(), in
+ order to make them more compliant with the strict API definitions.
+
+ * [include/wintypes.h]
+ Added 'typedef char TCHAR'. It probably should be defined as
+ 'short', but then we would have to support such characters. Also did
+ 'typedef const TCHAR* LPCTSTR' and 'typedef TCHAR* LPTSTR'.
+ Also defined WNDENUMPROC, FONTENUMPROC, GOBJENUMPROC, PROPENUMPROC
+ MFENUMPROC, and HGDIOBJ.
+
+Mon Feb 5 16:42:07 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>
+
+ * [misc/commdlg.c]
+ Patched a bug that occurred in the internal COMMDLG module for the
+ FileOpen(), FileSave() and FileSaveAs() functions. The file-type
+ combobox is now handled correctly.
+
+Fri Feb 2 22:52:58 1996 Roman Dolejsi <roman@sorry.vse.cz>
+
+ * [resources/sysres_Cz.rc]
+ Added support for Czech [Cz] language.
+
+Thu Feb 1 00:35:04 1996 Philippe De Muyter <phdm@info.ucl.ac.be>
+
+ * [objects/font.c]
+ FONT_matchfont : for fixed-spacing fonts, allow 'c' if 'm' fails;
+ for variable-spacing fonts : allow '*' if 'p' fails; if asked lfHeight
+ is -1, assume 0.
+ CreateFontIndirect : if font parameter is NULL, issue an error message.
+ CreateFont : null-terminate lfFaceName.
+ ParseFontParms : debug code turned off : too verbose.
+ InitFontsList : recognize *-c-* fonts as fixed-spacing fonts.
+
+ * [objects/color.c]
+ ColorToPhysical : admit 0xff...... COLORREF's as 0x00...... ones.
+
+--------------------------------------------------------------------
+Wed Jan 31 10:58:00 1996 Alexandre Julliard <julliard@sunsite.unc.edu>
* [configure.in]
Added --with-dll option to build libwine.so.
diff --git a/README b/README
index 5454385..135cf3c 100644
--- a/README
+++ b/README
@@ -77,7 +77,7 @@
month.
If you add something, or fix a bug, please send a patch ('diff -u'
-format preferred) to wine-new@amscons.com for inclusion in the next
+format preferred) to julliard@lrc.epfl.ch for inclusion in the next
release.
--
diff --git a/controls/combo.c b/controls/combo.c
index 378115e..6cc8eae 100644
--- a/controls/combo.c
+++ b/controls/combo.c
@@ -986,7 +986,7 @@
/************************************************************************
* DlgDirSelectComboBox [USER.194]
*/
-BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, int nIDLBox)
+BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, INT nIDLBox)
{
fprintf(stdnimp,"DlgDirSelectComboBox("NPFMT", '%s', %d) \n",
hDlg, lpStr, nIDLBox);
@@ -998,7 +998,7 @@
* DlgDirListComboBox [USER.195]
*/
INT DlgDirListComboBox( HWND hDlg, SEGPTR path, INT idCBox,
- INT idStatic, WORD wType )
+ INT idStatic, UINT wType )
{
INT ret = 0;
diff --git a/controls/desktop.c b/controls/desktop.c
index 9f462c6..77faca7 100644
--- a/controls/desktop.c
+++ b/controls/desktop.c
@@ -2,9 +2,7 @@
* Desktop window class.
*
* Copyright 1994 Alexandre Julliard
-
-static char Copyright[] = "Copyright Alexandre Julliard, 1994";
-*/
+ */
#include <fcntl.h>
#include <stdio.h>
@@ -13,6 +11,7 @@
#include <unistd.h>
#include "win.h"
#include "desktop.h"
+#include "directory.h"
#include "dos_fs.h"
#include "graphics.h"
@@ -34,7 +33,17 @@
/* Read all the file into memory */
- if (!(unixFileName = DOSFS_GetUnixFileName( filename, TRUE ))) return 0;
+ if (!(unixFileName = DOSFS_GetUnixFileName( filename, TRUE )))
+ {
+ int len = DIR_GetWindowsUnixDir( NULL, 0 );
+ if (!(buffer = malloc( len + strlen(filename) + 2 ))) return 0;
+ DIR_GetWindowsUnixDir( buffer, len + 1 );
+ strcat( buffer, "/" );
+ strcat( buffer, filename );
+ unixFileName = DOSFS_GetUnixFileName( buffer, TRUE );
+ free( buffer );
+ if (!unixFileName) return 0;
+ }
if ((file = open( unixFileName, O_RDONLY )) == -1) return 0;
size = lseek( file, 0, SEEK_END );
if (!(buffer = (char *)malloc( size )))
diff --git a/controls/edit.c b/controls/edit.c
index c0f7222..73ce404 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -2,9 +2,8 @@
* Edit control
*
* Copyright David W. Metcalfe, 1994
+ * Copyright William Magro, 1995, 1996
*
- * Release 3, July 1994
- * April 1995 bug fixes (William Magro)
*/
#include <stdio.h>
@@ -50,7 +49,6 @@
HANDLE hText; /* handle to text buffer */
INT *CharWidths; /* widths of chars in font */
unsigned int *textptrs; /* list of line offsets */
- char *BlankLine; /* to fill blank lines quickly */
int CurrCol; /* current column */
int CurrLine; /* current line */
int WndCol; /* current window column */
@@ -78,8 +76,8 @@
#define EditBufStartLen(hwnd) (GetWindowLong(hwnd,GWL_STYLE) & ES_MULTILINE \
? EDITLEN : ENTRYLEN)
#define CurrChar (EDIT_TextLine(hwnd, es->CurrLine) + es->CurrCol)
-#define SelMarked(es) ((es)->SelBegLine != 0 || (es)->SelBegCol != 0 || \
- (es)->SelEndLine != 0 || (es)->SelEndCol != 0)
+#define SelMarked(es) (((es)->SelBegCol != (es)->SelEndCol) || \
+ ((es)->SelBegLine != (es)->SelEndLine))
#define ROUNDUP(numer, denom) (((numer) % (denom)) \
? ((((numer) + (denom)) / (denom)) * (denom)) \
: (numer) + (denom))
@@ -459,11 +457,12 @@
HDC hdc;
HANDLE hStr;
char *str, *cp, *cp1;
- int diff=0, num_spaces, tabwidth, scol;
+ int diff=0, tabwidth, scol;
HRGN hrgnClip;
COLORREF oldTextColor, oldBkgdColor;
HFONT oldfont;
EDITSTATE *es = EDIT_GetEditState(hwnd);
+ RECT rc2;
dprintf_edit(stddeb,"EDIT_WriteText lp=%s, off=%d, len=%d, row=%d, col=%d, reverse=%d\n", lp, off, len, row, col, reverse);
@@ -478,6 +477,7 @@
str = (char *)EDIT_HeapLock(hwnd, hStr);
hrgnClip = CreateRectRgnIndirect(rc);
SelectClipRgn(hdc, hrgnClip);
+ DeleteObject(hrgnClip);
if (es->hFont)
oldfont = (HFONT)SelectObject(hdc, (HANDLE)es->hFont);
@@ -495,21 +495,12 @@
{
oldBkgdColor = GetBkColor(hdc);
oldTextColor = GetTextColor(hdc);
- SetBkColor(hdc, oldTextColor);
- SetTextColor(hdc, oldBkgdColor);
+ SetBkColor(hdc, GetSysColor(COLOR_HIGHLIGHT));
+ SetTextColor(hdc, GetSysColor(COLOR_HIGHLIGHTTEXT));
}
else /* -Wall does not see the use of if */
oldTextColor = oldBkgdColor = 0;
- if (strlen(es->BlankLine) < (es->ClientWidth / es->CharWidths[32]) + 2)
- {
- dprintf_edit( stddeb, "EDIT_WriteText: realloc\n" );
- es->BlankLine = xrealloc(es->BlankLine,
- (es->ClientWidth / es->CharWidths[32]) + 2);
- memset(es->BlankLine, ' ', (es->ClientWidth / es->CharWidths[32]) + 2);
- es->BlankLine[(es->ClientWidth / es->CharWidths[32]) + 1] = 0;
- }
-
if ((es->PasswordChar && GetWindowLong( hwnd, GWL_STYLE ) & ES_PASSWORD))
{
int len = strlen(str);
@@ -525,8 +516,8 @@
TextOut(hdc, col - diff, row * es->txtht, str, (int)(cp - str));
scol = EDIT_StrWidth(hwnd, str, (int)(cp - str), 0);
tabwidth = EDIT_CharWidth(hwnd, VK_TAB, scol);
- num_spaces = tabwidth / es->CharWidths[32] + 1;
- TextOut(hdc, scol, row * es->txtht, es->BlankLine, num_spaces);
+ SetRect(&rc2, scol, row * es->txtht, scol+tabwidth, (row + 1) * es->txtht);
+ ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc2, "", 0, NULL);
cp++;
scol += tabwidth;
@@ -535,8 +526,8 @@
TextOut(hdc, scol, row * es->txtht, cp, (int)(cp1 - cp));
scol += EDIT_StrWidth(hwnd, cp, (int)(cp1 - cp), scol);
tabwidth = EDIT_CharWidth(hwnd, VK_TAB, scol);
- num_spaces = tabwidth / es->CharWidths[32] + 1;
- TextOut(hdc, scol, row * es->txtht, es->BlankLine, num_spaces);
+ SetRect(&rc2, scol, row * es->txtht, scol+tabwidth, (row + 1) * es->txtht);
+ ExtTextOut( hdc, 0, 0, ETO_OPAQUE, &rc2, "", 0, NULL );
cp = ++cp1;
scol += tabwidth;
}
@@ -551,13 +542,11 @@
}
/* blank out remainder of line if appropriate */
- if (blank)
+ if (blank && ((rc->right - col) > len))
{
- if ((rc->right - col) > len)
- {
- num_spaces = (rc->right - col - len) / es->CharWidths[32];
- TextOut(hdc, col + len, row * es->txtht, es->BlankLine, num_spaces);
- }
+ SetRect( &rc2, col + len, row * es->txtht,
+ rc->right, (row + 1) * es->txtht );
+ ExtTextOut( hdc, 0, 0, ETO_OPAQUE, &rc2, "", 0, NULL );
}
if (es->hFont)
@@ -643,7 +632,7 @@
}
len = MIN(lnlen, rc.right - rc.left);
- if (SelMarked(es))
+ if (SelMarked(es) && (es->HaveFocus))
{
sbl = es->SelBegLine;
sel = es->SelEndLine;
@@ -1142,11 +1131,21 @@
RECT rc;
EDITSTATE *es = EDIT_GetEditState(hwnd);
char *currchar = CurrChar;
- BOOL repaint = *currchar == '\n';
+ BOOL repaint;
- if (IsMultiLine(hwnd) && *currchar == '\n' && *(currchar + 1) == '\0')
+ if (IsMultiLine(hwnd) && !strncmp(currchar,"\r\n\0",3))
return;
- strcpy(currchar, currchar + 1);
+
+ if(*currchar == '\n') {
+ repaint = TRUE;
+ strcpy(currchar, currchar + 1);
+ } else if (*currchar == '\r') {
+ repaint = TRUE;
+ strcpy(currchar, currchar + 2);
+ } else {
+ repaint = FALSE;
+ strcpy(currchar, currchar + 1);
+ }
NOTIFY_PARENT(hwnd, EN_UPDATE);
if (repaint)
@@ -1304,11 +1303,9 @@
char *text;
dprintf_edit(stddeb,"EDIT_ClearText %d\n",blen);
-/*#ifndef WINELIB*/
es->hText = EDIT_HeapReAlloc(hwnd, es->hText, blen);
text = EDIT_HeapLock(hwnd, es->hText);
memset(text, 0, blen);
-/*#endif*/
es->textlen = 0;
es->wlines = 0;
es->CurrLine = es->CurrCol = 0;
@@ -1316,9 +1313,7 @@
es->wleft = es->wtop = 0;
es->textwidth = 0;
es->TextChanged = FALSE;
-/*#ifndef WINELIB*/
EDIT_ClearTextPointers(hwnd);
-/*#endif*/
}
/*********************************************************************
@@ -1365,6 +1360,29 @@
}
/*********************************************************************
+ * EDIT_UpdateSel
+ *
+ * Redraw the current selection, after losing focus, for example.
+ */
+static void EDIT_UpdateSel(HWND hwnd)
+{
+ EDITSTATE *es = EDIT_GetEditState(hwnd);
+ int y, bbl, bel;
+ RECT rc;
+
+ /* Note which lines need redrawing. */
+ bbl=MIN(es->SelBegLine,es->SelEndLine);
+ bel=MAX(es->SelBegLine,es->SelEndLine);
+
+ /* Redraw the affected lines */
+ GetClientRect(hwnd, &rc);
+ for (y = bbl; y <= bel; y++)
+ {
+ EDIT_WriteTextLine(hwnd, &rc, y);
+ }
+}
+
+/*********************************************************************
* EDIT_ClearSel
*
* Clear the current selection.
@@ -1372,12 +1390,23 @@
static void EDIT_ClearSel(HWND hwnd)
{
EDITSTATE *es = EDIT_GetEditState(hwnd);
+ int y, bbl, bel;
+ RECT rc;
+
+ /* Note which lines need redrawing. */
+ bbl=MIN(es->SelBegLine,es->SelEndLine);
+ bel=MAX(es->SelBegLine,es->SelEndLine);
+ /* Clear the selection */
es->SelBegLine = es->SelBegCol = 0;
es->SelEndLine = es->SelEndCol = 0;
- InvalidateRect(hwnd, NULL, TRUE);
- UpdateWindow(hwnd);
+ /* Redraw the affected lines */
+ GetClientRect(hwnd, &rc);
+ for (y = bbl; y <= bel; y++)
+ {
+ EDIT_WriteTextLine(hwnd, &rc, y);
+ }
}
/*********************************************************************
@@ -1412,33 +1441,52 @@
*/
static void EDIT_DeleteSel(HWND hwnd)
{
- char *bbl, *bel;
+ char *selStart, *selEnd;
+ int bl, el, bc, ec;
int len;
EDITSTATE *es = EDIT_GetEditState(hwnd);
if (SelMarked(es))
{
- bbl = EDIT_TextLine(hwnd, es->SelBegLine) + es->SelBegCol;
- bel = EDIT_TextLine(hwnd, es->SelEndLine) + es->SelEndCol;
- len = (int)(bel - bbl);
- EDIT_SaveDeletedText(hwnd, bbl, len, es->SelBegLine, es->SelBegCol);
+ /* Get the real beginning and ending lines and columns */
+ bl = es->SelBegLine;
+ el = es->SelEndLine;
+ if ( bl > el ) {
+ bl = el;
+ el = es->SelBegLine;
+ bc = es->SelEndCol;
+ ec = es->SelBegCol;
+ } else if ( bl == el ) {
+ bc = MIN(es->SelBegCol,es->SelEndCol);
+ ec = MAX(es->SelBegCol,es->SelEndCol);
+ } else {
+ bc = es->SelBegCol;
+ ec = es->SelEndCol;
+ }
+
+ selStart = EDIT_TextLine(hwnd, bl) + bc;
+ selEnd = EDIT_TextLine(hwnd, el) + ec;
+ len = (int)(selEnd - selStart);
+ EDIT_SaveDeletedText(hwnd, selStart, len, bl, bc);
es->TextChanged = TRUE;
- strcpy(bbl, bel);
+ EDIT_ClearSel(hwnd);
+ strcpy(selStart, selEnd);
- es->CurrLine = es->SelBegLine;
- es->CurrCol = es->SelBegCol;
- es->WndRow = es->SelBegLine - es->wtop;
+ es->CurrLine = bl;
+ es->CurrCol = bc;
+ es->WndRow = bl - es->wtop;
if (es->WndRow < 0)
{
- es->wtop = es->SelBegLine;
+ es->wtop = bl;
es->WndRow = 0;
}
- es->WndCol = EDIT_StrWidth(hwnd, bbl - es->SelBegCol,
- es->SelBegCol, 0) - es->wleft;
+ es->WndCol = EDIT_StrWidth(hwnd, selStart - bc, bc, 0) - es->wleft;
EDIT_BuildTextPointers(hwnd);
es->PaintBkgd = TRUE;
- EDIT_ClearSel(hwnd);
+
+ InvalidateRect(hwnd, NULL, TRUE);
+ UpdateWindow(hwnd);
}
}
@@ -1475,65 +1523,11 @@
*/
static void EDIT_SetAnchor(HWND hwnd, int row, int col)
{
- BOOL sel = FALSE;
EDITSTATE *es = EDIT_GetEditState(hwnd);
- if (SelMarked(es))
- {
- sel = TRUE;
- EDIT_ClearSel(hwnd);
- }
+ if (SelMarked(es)) EDIT_ClearSel(hwnd);
es->SelBegLine = es->SelEndLine = row;
es->SelBegCol = es->SelEndCol = col;
- if (sel)
- {
- InvalidateRect(hwnd, NULL, FALSE);
- UpdateWindow(hwnd);
- }
-}
-
-/*********************************************************************
- * EDIT_WriteSel
- *
- * Display selection by reversing pixels in selected text.
- * If end == -1, selection applies to end of line.
- */
-static void EDIT_WriteSel(HWND hwnd, int y, int start, int end)
-{
- RECT rc, rcInvert;
- int scol, ecol;
- char *cp;
- HDC hdc;
- EDITSTATE *es = EDIT_GetEditState(hwnd);
-
- dprintf_edit(stddeb,"EDIT_WriteSel: y=%d start=%d end=%d\n", y, start,end);
- GetClientRect(hwnd, &rc);
-
- /* make sure y is within the window */
- if (y < es->wtop || y > (es->wtop + es->ClientHeight))
- return;
-
- /* get pointer to text */
- cp = EDIT_TextLine(hwnd, y);
-
- /* get length of line if end == -1 */
- if (end == -1)
- end = EDIT_LineLength(hwnd, y);
-
- scol = EDIT_StrWidth(hwnd, cp, start, 0) - es->wleft;
- if (scol > rc.right) return;
- if (scol < rc.left) scol = rc.left;
- ecol = EDIT_StrWidth(hwnd, cp, end, 0) - es->wleft;
- if (ecol < rc.left) return;
- if (ecol > rc.right) ecol = rc.right;
-
- hdc = GetDC(hwnd);
- rcInvert.left = scol;
- rcInvert.top = (y - es->wtop) * es->txtht;
- rcInvert.right = ecol;
- rcInvert.bottom = (y - es->wtop + 1) * es->txtht;
- InvertRect(hdc, (LPRECT) &rcInvert);
- ReleaseDC(hwnd, hdc);
}
/*********************************************************************
@@ -1543,10 +1537,11 @@
*/
static void EDIT_ExtendSel(HWND hwnd, INT x, INT y)
{
- int bbl, bel, bbc, bec;
+ int bbl, bel, bbc;
char *cp;
int len, line;
EDITSTATE *es = EDIT_GetEditState(hwnd);
+ RECT rc;
dprintf_edit(stddeb,"EDIT_ExtendSel: x=%d, y=%d\n", x, y);
@@ -1580,54 +1575,22 @@
es->SelEndCol = es->CurrCol;
bel = es->SelEndLine;
- bec = es->SelEndCol;
/* return if no new characters to mark */
- if (bbl == bel && bbc == bec)
- return;
+ if (bbl == bel && bbc == es->SelEndCol) return;
/* put lowest marker first */
- if (bbl > bel)
- {
- SWAP_INT(bbl, bel);
- SWAP_INT(bbc, bec);
- }
- if (bbl == bel && bbc > bec)
- SWAP_INT(bbc, bec);
+ if (bbl > bel) SWAP_INT(bbl, bel);
+ /* Update lines on which selection has changed */
+ GetClientRect(hwnd, &rc);
for (y = bbl; y <= bel; y++)
{
- if (y == bbl && y == bel)
- EDIT_WriteSel(hwnd, y, bbc, bec);
- else if (y == bbl)
- EDIT_WriteSel(hwnd, y, bbc, -1);
- else if (y == bel)
- EDIT_WriteSel(hwnd, y, 0, bec);
- else
- EDIT_WriteSel(hwnd, y, 0, -1);
+ EDIT_WriteTextLine(hwnd, &rc, y);
}
}
/*********************************************************************
- * EDIT_StopMarking
- *
- * Stop text marking (selection).
- */
-static void EDIT_StopMarking(HWND hwnd)
-{
- EDITSTATE *es = EDIT_GetEditState(hwnd);
-
- TextMarking = FALSE;
- if (es->SelBegLine > es->SelEndLine)
- {
- SWAP_INT((es->SelBegLine), (es->SelEndLine));
- SWAP_INT((es->SelBegCol), (es->SelEndCol));
- }
- if (es->SelBegLine == es->SelEndLine && es->SelBegCol > es->SelEndCol)
- SWAP_INT((es->SelBegCol), (es->SelEndCol));
-}
-
-/*********************************************************************
* EDIT_InsertText
*
* Insert text at current line and column.
@@ -1804,6 +1767,7 @@
EDIT_BuildTextPointers(hwnd);
EDIT_End(hwnd);
EDIT_Forward(hwnd);
+ EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol);
/* invalidate rest of window */
GetClientRect(hwnd, &rc);
@@ -1829,6 +1793,7 @@
}
es->WndCol += EDIT_CharWidth(hwnd, (BYTE)ch, es->WndCol + es->wleft);
es->CurrCol++;
+ EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol);
EDIT_WriteTextLine(hwnd, NULL, es->wtop + es->WndRow);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
@@ -2222,7 +2187,8 @@
EDITSTATE *es = EDIT_GetEditState(hwnd);
hdc = BeginPaint(hwnd, &ps);
- rc = ps.rcPaint;
+ GetClientRect(hwnd, &rc);
+ IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom);
dprintf_edit(stddeb,"WM_PAINT: rc=(%ld,%ld), (%ld,%ld)\n", (LONG)rc.left,
(LONG)rc.top, (LONG)rc.right, (LONG)rc.bottom);
@@ -2399,12 +2365,6 @@
es->NumTabStops = 0;
es->TabStops = xmalloc( sizeof(short) );
- /* allocate space for a line full of blanks to speed up */
- /* line filling */
- es->BlankLine = xmalloc( (es->ClientWidth / es->CharWidths[32]) + 2);
- memset(es->BlankLine, ' ', (es->ClientWidth / es->CharWidths[32]) + 2);
- es->BlankLine[(es->ClientWidth / es->CharWidths[32]) + 1] = 0;
-
/* set up text cursor for edit class */
{
char editname[] = "EDIT";
@@ -2491,8 +2451,12 @@
BOOL end = FALSE;
EDITSTATE *es = EDIT_GetEditState(hwnd);
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
+ ButtonDown = TRUE;
+
+ if ((wParam & MK_SHIFT)) {
+ EDIT_ExtendSel(hwnd, LOWORD(lParam), HIWORD(lParam));
+ return;
+ }
es->WndRow = HIWORD(lParam) / es->txtht;
dprintf_edit( stddeb, "EDIT_LButtonDown: %04x %08lx, WndRow %d\n", wParam,
@@ -2515,9 +2479,9 @@
es->CurrCol = EDIT_PixelToChar(hwnd, es->CurrLine, &(es->WndCol));
es->WndCol -= es->wleft;
- ButtonDown = TRUE;
ButtonRow = es->CurrLine;
ButtonCol = es->CurrCol;
+ EDIT_SetAnchor(hwnd, ButtonRow, ButtonCol);
}
/*********************************************************************
@@ -2527,13 +2491,11 @@
{
EDITSTATE *es = EDIT_GetEditState(hwnd);
- if (wParam != MK_LBUTTON)
- return;
+ if (!(wParam & MK_LBUTTON)) return;
HideCaret(hwnd);
if (ButtonDown)
{
- EDIT_SetAnchor(hwnd, ButtonRow, ButtonCol);
TextMarking = TRUE;
ButtonDown = FALSE;
}
@@ -2582,6 +2544,7 @@
static void EDIT_WM_KeyDown(HWND hwnd, WORD wParam)
{
EDITSTATE *es = EDIT_GetEditState(hwnd);
+ BOOL motionKey = FALSE;
dprintf_edit(stddeb,"EDIT_WM_KeyDown: key=%x\n", wParam);
@@ -2589,63 +2552,55 @@
switch (wParam)
{
case VK_UP:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
if (IsMultiLine(hwnd))
EDIT_Upward(hwnd);
else
EDIT_Backward(hwnd);
+ motionKey = TRUE;
break;
case VK_DOWN:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
if (IsMultiLine(hwnd))
EDIT_Downward(hwnd);
else
EDIT_Forward(hwnd);
+ motionKey = TRUE;
break;
case VK_RIGHT:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_Forward(hwnd);
+ motionKey = TRUE;
break;
case VK_LEFT:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_Backward(hwnd);
+ motionKey = TRUE;
break;
case VK_HOME:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_Home(hwnd);
+ motionKey = TRUE;
break;
case VK_END:
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_End(hwnd);
+ motionKey = TRUE;
break;
case VK_PRIOR:
if (IsMultiLine(hwnd))
{
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_KeyVScrollPage(hwnd, SB_PAGEUP);
}
+ motionKey = TRUE;
break;
case VK_NEXT:
if (IsMultiLine(hwnd))
{
- if (SelMarked(es))
- EDIT_ClearSel(hwnd);
EDIT_KeyVScrollPage(hwnd, SB_PAGEDOWN);
}
+ motionKey = TRUE;
break;
case VK_BACK:
@@ -2666,8 +2621,26 @@
else
EDIT_DelKey(hwnd);
break;
+
+ case VK_SHIFT:
+ motionKey = TRUE;
+ break;
+
+ default:
+ ShowCaret(hwnd);
+ return;
}
+ /* FIXME: GetKeyState appears to have its bits reversed */
+#if CorrectGetKeyState
+ if(motionKey && (0x80 & GetKeyState(VK_SHIFT))) {
+#else
+ if(motionKey && (0x01 & GetKeyState(VK_SHIFT))) {
+#endif
+ EDIT_ExtendSel(hwnd, es->WndCol, es->WndRow*es->txtht);
+ } else {
+ EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol);
+ }
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
}
@@ -2813,6 +2786,7 @@
case EM_SETHANDLE:
HideCaret(hwnd);
+ EDIT_ClearDeletedText(hwnd);
EDIT_SetHandleMsg(hwnd, wParam);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
@@ -2882,7 +2856,6 @@
free(es->textptrs);
free(es->CharWidths);
free(es->TabStops);
- free(es->BlankLine);
EDIT_HeapFree(hwnd, es->hText);
free( EDIT_GetEditState(hwnd) );
break;
@@ -2919,9 +2892,14 @@
break;
case WM_KILLFOCUS:
+ dprintf_edit(stddeb, "WM_KILLFOCUS\n");
es->HaveFocus = FALSE;
DestroyCaret();
- if (SelMarked(es)) EDIT_ClearSel(hwnd);
+ if (SelMarked(es))
+ if(GetWindowLong(hwnd,GWL_STYLE) & ES_NOHIDESEL)
+ EDIT_UpdateSel(hwnd);
+ else
+ EDIT_ClearSel(hwnd);
NOTIFY_PARENT(hwnd, EN_KILLFOCUS);
break;
@@ -2938,8 +2916,7 @@
if (GetCapture() != hwnd) break;
ReleaseCapture();
ButtonDown = FALSE;
- if (TextMarking)
- EDIT_StopMarking(hwnd);
+ TextMarking = FALSE;
break;
case WM_MOUSEMOVE:
@@ -2964,7 +2941,9 @@
break;
case WM_SETFOCUS:
+ dprintf_edit(stddeb, "WM_SETFOCUS\n");
es->HaveFocus = TRUE;
+ if (SelMarked(es)) EDIT_UpdateSel(hwnd);
CreateCaret(hwnd, 0, 2, es->txtht);
SetCaretPos(es->WndCol, es->WndRow * es->txtht);
ShowCaret(hwnd);
@@ -2985,6 +2964,7 @@
break;
#endif
case WM_SETTEXT:
+ EDIT_ClearDeletedText(hwnd);
EDIT_WM_SetText(hwnd, lParam);
break;
@@ -2997,6 +2977,12 @@
EDIT_WM_VScroll(hwnd, wParam, lParam);
break;
+ case WM_LBUTTONDBLCLK:
+ dprintf_edit(stddeb, "WM_LBUTTONDBLCLK: hwnd=%d, wParam=%x\n",
+ hwnd, wParam);
+ lResult = 0;
+ break;
+
default:
lResult = DefWindowProc(hwnd, uMsg, wParam, lParam);
break;
diff --git a/controls/listbox.c b/controls/listbox.c
index fc9ba60..b9cd547 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -694,6 +694,7 @@
if ((ret = ListBoxAddString(lphl, temp)) == LB_ERR) break;
}
}
+ free( path );
return ret;
}
@@ -1886,7 +1887,7 @@
/**********************************************************************
* DlgDirSelect (USER.99)
*/
-BOOL DlgDirSelect( HWND hDlg, LPSTR lpStr, int id )
+BOOL DlgDirSelect( HWND hDlg, LPSTR lpStr, INT id )
{
char buffer[20];
INT i;
@@ -1920,7 +1921,7 @@
/**********************************************************************
* DlgDirList (USER.100)
*/
-INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, WORD attrib )
+INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, UINT attrib )
{
char *filespec = (char *)PTR_SEG_TO_LIN( spec );
int drive;
@@ -1934,7 +1935,7 @@
hDlg, filespec ? filespec : "NULL",
idLBox, idStatic, attrib );
- if (filespec && (filespec[1] == ':'))
+ if (filespec && filespec[0] && (filespec[1] == ':'))
{
drive = toupper( filespec[0] ) - 'A';
filespec += 2;
@@ -2004,4 +2005,5 @@
SENDMSG( WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(temp) );
}
return TRUE;
+#undef SENDMSG
}
diff --git a/controls/menu.c b/controls/menu.c
index 2398234..b467450 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -895,27 +895,39 @@
*/
static BOOL MENU_SetItemData( MENUITEM *item, UINT flags, UINT id, SEGPTR data)
{
- item->item_flags = flags & ~(MF_HILITE | MF_MOUSESELECT);
- item->item_id = id;
+ HANDLE hPrevText = IS_STRING_ITEM(item->item_flags) ? item->hText : 0;
- SetRectEmpty( &item->rect );
if (IS_STRING_ITEM(flags))
{
- char *str = (char *)PTR_SEG_TO_LIN(data);
- HANDLE hText;
-
- /* Item beginning with a backspace is a help item */
- if (*str == '\b')
- {
- item->item_flags |= MF_HELP;
- str++;
- }
- if (!(hText = USER_HEAP_ALLOC( strlen(str)+1 ))) return FALSE;
- item->hText = hText;
- strcpy( (char *)USER_HEAP_LIN_ADDR( hText ), str );
+ if (!data)
+ {
+ flags |= MF_SEPARATOR;
+ item->hText = 0;
+ }
+ else
+ {
+ char *str = (char *)PTR_SEG_TO_LIN(data);
+ HANDLE hText;
+
+ /* Item beginning with a backspace is a help item */
+ if (*str == '\b')
+ {
+ flags |= MF_HELP;
+ str++;
+ }
+ if (!(hText = USER_HEAP_ALLOC( strlen(str)+1 ))) return FALSE;
+ item->hText = hText;
+ strcpy( (char *)USER_HEAP_LIN_ADDR( hText ), str );
+ }
}
else if (flags & MF_BITMAP) item->hText = (HANDLE)(DWORD)data;
else if (flags & MF_OWNERDRAW) SET_OWNERDRAW_DATA( item, data );
+ else item->hText = 0;
+
+ item->item_flags = flags & ~(MF_HILITE | MF_MOUSESELECT);
+ item->item_id = id;
+ SetRectEmpty( &item->rect );
+ if (hPrevText) USER_HEAP_FREE( hPrevText );
return TRUE;
}
@@ -984,6 +996,7 @@
}
menu->hItems = hNewItems;
menu->nItems++;
+ memset( &newItems[pos], 0, sizeof(*newItems) );
return &newItems[pos];
}
@@ -1022,8 +1035,7 @@
}
else
{
- if (!id && !flags && !*(char *)PTR_SEG_TO_LIN(data))
- flags |= MF_SEPARATOR; /* FIXME: do this in InsertMenu? */
+ if (!*(char *)PTR_SEG_TO_LIN(data)) data = 0;
AppendMenu( hMenu, flags, id, data );
}
} while (!(flags & MF_END));
@@ -1877,13 +1889,9 @@
{
MENUITEM *item;
- if (IS_STRING_ITEM(flags))
- {
+ if (IS_STRING_ITEM(flags) && data)
dprintf_menu( stddeb, "InsertMenu: "NPFMT" %d %04x %04x '%s'\n",
- hMenu, pos, flags, id,
- data ? (char *)PTR_SEG_TO_LIN(data) : "#NULL#" );
- if (!data) return FALSE;
- }
+ hMenu, pos, flags, id, (char *)PTR_SEG_TO_LIN(data) );
else dprintf_menu( stddeb, "InsertMenu: "NPFMT" %d %04x %04x %08lx\n",
hMenu, pos, flags, id, (DWORD)data );
@@ -1891,7 +1899,6 @@
if (!(MENU_SetItemData( item, flags, id, data )))
{
- item->hText = 0;
RemoveMenu( hMenu, pos, flags );
return FALSE;
}
@@ -1928,7 +1935,8 @@
/* Remove item */
- if (IS_STRING_ITEM(lpitem->item_flags)) USER_HEAP_FREE( lpitem->hText );
+ if (IS_STRING_ITEM(lpitem->item_flags) && lpitem->hText)
+ USER_HEAP_FREE(lpitem->hText);
if (--menu->nItems == 0)
{
USER_HEAP_FREE( menu->hItems );
@@ -1969,7 +1977,6 @@
BOOL ModifyMenu( HMENU hMenu, UINT pos, UINT flags, UINT id, SEGPTR data )
{
MENUITEM *item;
- HANDLE hText = 0;
if (IS_STRING_ITEM(flags))
{
@@ -1983,10 +1990,7 @@
hMenu, pos, flags, id, (DWORD)data );
if (!(item = MENU_FindItem( &hMenu, &pos, flags ))) return FALSE;
- if (IS_STRING_ITEM(item->item_flags)) hText = item->hText;
- if (!MENU_SetItemData( item, flags, id, data )) return FALSE;
- if (hText) USER_HEAP_FREE( hText );
- return TRUE;
+ return MENU_SetItemData( item, flags, id, data );
}
@@ -2018,7 +2022,7 @@
* SetMenuItemBitmaps [USER.418]
*/
BOOL SetMenuItemBitmaps(HMENU hMenu, UINT nPos, UINT wFlags,
- HBITMAP hNewCheck, HBITMAP hNewUnCheck)
+ HBITMAP hNewUnCheck, HBITMAP hNewCheck)
{
LPMENUITEM lpitem;
dprintf_menu(stddeb,"SetMenuItemBitmaps ("NPFMT", %04X, %04X, "NPFMT", %08lX) !\n",
@@ -2090,6 +2094,8 @@
{
if (item->item_flags & MF_POPUP)
DestroyMenu( (HMENU)item->item_id );
+ if (IS_STRING_ITEM(item->item_flags) && item->hText)
+ USER_HEAP_FREE(item->hText);
}
USER_HEAP_FREE( lppop->hItems );
}
diff --git a/controls/scroll.c b/controls/scroll.c
index ff63e08..d18c175 100644
--- a/controls/scroll.c
+++ b/controls/scroll.c
@@ -971,7 +971,7 @@
/*************************************************************************
* EnableScrollBar (USER.482)
*/
-BOOL EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
+BOOL EnableScrollBar( HWND hwnd, UINT nBar, UINT flags )
{
SCROLLINFO *infoPtr;
HDC hdc;
diff --git a/controls/widgets.c b/controls/widgets.c
index ccbe8c8..4ae39e3 100644
--- a/controls/widgets.c
+++ b/controls/widgets.c
@@ -19,20 +19,27 @@
static WNDCLASS WIDGETS_BuiltinClasses[] =
{
- { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ButtonWndProc", 0,
- sizeof(BUTTONINFO), 0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
- { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"StaticWndProc", 0,
- sizeof(STATICINFO), 0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
- { CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW | CS_PARENTDC , (WNDPROC)"ScrollBarWndProc", 0,
- sizeof(SCROLLINFO), 0, 0, 0, 0, 0, (SEGPTR)"SCROLLBAR" },
- { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"ListBoxWndProc", 0,
- 8, 0, 0, 0, 0, 0, (SEGPTR)"LISTBOX" },
- { CS_GLOBALCLASS | CS_PARENTDC, (WNDPROC)"ComboBoxWndProc", 0, 8,
+ { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
+ (WNDPROC)"ButtonWndProc", 0, sizeof(BUTTONINFO),
+ 0, 0, 0, 0, 0, (SEGPTR)"BUTTON" },
+ { CS_GLOBALCLASS | CS_PARENTDC,
+ (WNDPROC)"StaticWndProc", 0, sizeof(STATICINFO),
+ 0, 0, 0, 0, 0, (SEGPTR)"STATIC" },
+ { CS_GLOBALCLASS | CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_PARENTDC,
+ (WNDPROC)"ScrollBarWndProc", 0, sizeof(SCROLLINFO),
+ 0, 0, 0, 0, 0, (SEGPTR)"SCROLLBAR" },
+ { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
+ (WNDPROC)"ListBoxWndProc", 0, 8,
+ 0, 0, 0, 0, 0, (SEGPTR)"LISTBOX" },
+ { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
+ (WNDPROC)"ComboBoxWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)"COMBOBOX" },
- { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS | CS_SAVEBITS, (WNDPROC)"ComboLBoxWndProc",
- 0, 8, 0, 0, 0, 0, 0, (SEGPTR)"COMBOLBOX" },
- { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS, (WNDPROC)"EditWndProc",
- 0, sizeof(DWORD), 0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
+ { CS_GLOBALCLASS | CS_DBLCLKS | CS_SAVEBITS,
+ (WNDPROC)"ComboLBoxWndProc", 0, 8,
+ 0, 0, 0, 0, 0, (SEGPTR)"COMBOLBOX" },
+ { CS_GLOBALCLASS | CS_PARENTDC | CS_DBLCLKS,
+ (WNDPROC)"EditWndProc", 0, sizeof(DWORD),
+ 0, 0, 0, 0, 0, (SEGPTR)"EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (WNDPROC)"PopupMenuWndProc", 0, 8,
0, 0, 0, 0, 0, (SEGPTR)POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (WNDPROC)"DesktopWndProc", 0, sizeof(DESKTOPINFO),
@@ -61,11 +68,13 @@
for (i = 0; i < NB_BUILTIN_CLASSES; i++, class++)
{
DWORD WineProc,Win16Proc,Win32Proc;
+ WIN32_builtin *dll;
/* currently, there is no way to get the 'real' pointer at run time */
WineProc=0;
Win16Proc = (DWORD)GetWndProcEntry16( (char *)class->lpfnWndProc );
+ dll = RELAY32_GetBuiltinDLL("WINPROCS32");
Win32Proc = (DWORD)RELAY32_GetEntryPoint(
- "WINPROCS32",(char *)class->lpfnWndProc, 0);
+ dll,(char *)class->lpfnWndProc, 0);
/* Register the alias so we don't pass Win16 pointers to Win32 apps */
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
diff --git a/debugger/db_disasm.c b/debugger/db_disasm.c
index 7ffd2a8..8d38f5a 100644
--- a/debugger/db_disasm.c
+++ b/debugger/db_disasm.c
@@ -733,8 +733,8 @@
/*ab*/ { "stos", FALSE, LONG, op1(DI), 0 },
/*ac*/ { "lods", FALSE, BYTE, op1(SI), 0 },
/*ad*/ { "lods", FALSE, LONG, op1(SI), 0 },
-/*ae*/ { "scas", FALSE, BYTE, op1(SI), 0 },
-/*af*/ { "scas", FALSE, LONG, op1(SI), 0 },
+/*ae*/ { "scas", FALSE, BYTE, op1(DI), 0 },
+/*af*/ { "scas", FALSE, LONG, op1(DI), 0 },
/*b0*/ { "mov", FALSE, BYTE, op2(I, Ri), 0 },
/*b1*/ { "mov", FALSE, BYTE, op2(I, Ri), 0 },
diff --git a/files/directory.c b/files/directory.c
index 5365bd6..85542dd 100644
--- a/files/directory.c
+++ b/files/directory.c
@@ -164,11 +164,11 @@
/* Put the temp and Windows directories into the environment */
- env_p = (char *)xmalloc( strlen(DIR_TempDosDir) + 5 );
+ env_p = (char *)xmalloc( strlen(DIR_TempDosDir) + 6 );
strcpy( env_p, "TEMP=" );
strcpy( env_p + 5, DIR_TempDosDir );
putenv( env_p );
- env_p = (char *)xmalloc( strlen(DIR_WindowsDosDir) + 7 );
+ env_p = (char *)xmalloc( strlen(DIR_WindowsDosDir) + 8 );
strcpy( env_p, "windir=" );
strcpy( env_p + 7, DIR_WindowsDosDir );
putenv( env_p );
diff --git a/files/dos_fs.c b/files/dos_fs.c
index 29131ec..e0172f6 100644
--- a/files/dos_fs.c
+++ b/files/dos_fs.c
@@ -5,6 +5,7 @@
* Copyright 1996 Alexandre Julliard
*/
+#include <sys/types.h>
#include <ctype.h>
#include <dirent.h>
#include <string.h>
@@ -415,7 +416,7 @@
int i;
const char *p;
- if (name[1] == ':') name += 2;
+ if (name[0] && (name[1] == ':')) name += 2;
if ((p = strrchr( name, '/' ))) name = p + 1;
if ((p = strrchr( name, '\\' ))) name = p + 1;
for (i = 0; i < sizeof(DOSFS_Devices)/sizeof(DOSFS_Devices[0]); i++)
@@ -424,7 +425,6 @@
if (!lstrncmpi( dev, name, strlen(dev) ))
{
p = name + strlen( dev );
- if (*p == ':') p++;
if (!*p || (*p == '.')) return DOSFS_Devices[i][1];
}
}
@@ -446,7 +446,7 @@
char *p, *root;
dprintf_dosfs( stddeb, "DOSFS_GetUnixFileName: %s\n", name );
- if (name[1] == ':')
+ if (name[0] && (name[1] == ':'))
{
drive = toupper(name[0]) - 'A';
name += 2;
@@ -549,7 +549,7 @@
char *p;
dprintf_dosfs( stddeb, "DOSFS_GetDosTrueName(%s,%d)\n", name, unix_format);
- if (name[1] == ':')
+ if (name[0] && (name[1] == ':'))
{
drive = toupper(name[0]) - 'A';
name += 2;
@@ -646,6 +646,7 @@
int count = 0;
static char buffer[MAX_PATHNAME_LEN];
static int cur_pos = 0;
+ static int drive_root = 0;
char *p;
const char *hash_name;
@@ -664,12 +665,22 @@
if (dir && !strcmp( buffer, path ) && (cur_pos <= skip)) skip -= cur_pos;
else /* Not in the cache, open it anew */
{
+ const char *drive_path;
dprintf_dosfs( stddeb, "DOSFS_FindNext: cache miss, path=%s skip=%d buf=%s cur=%d\n",
path, skip, buffer, cur_pos );
cur_pos = skip;
if (dir) closedir(dir);
if (!(dir = opendir( path ))) return 0;
+ drive_path = path;
+ drive_root = 0;
+ if (DRIVE_FindDriveRoot( &drive_path ) != -1)
+ {
+ while ((*drive_path == '/') || (*drive_path == '\\')) drive_path++;
+ if (!*drive_path) drive_root = 1;
+ }
+ dprintf_dosfs(stddeb, "DOSFS_FindNext: drive_root = %d\n", drive_root);
lstrcpyn( buffer, path, sizeof(buffer) - 1 );
+
}
strcat( buffer, "/" );
p = buffer + strlen(buffer);
@@ -681,6 +692,10 @@
count++;
hash_name = DOSFS_Hash( dirent->d_name, TRUE );
if (!DOSFS_Match( mask, hash_name )) continue;
+ /* Don't return '.' and '..' in the root of the drive */
+ if (drive_root && (dirent->d_name[0] == '.') &&
+ (!dirent->d_name[1] ||
+ ((dirent->d_name[1] == '.') && !dirent->d_name[2]))) continue;
lstrcpyn( p, dirent->d_name, sizeof(buffer) - (int)(p - buffer) );
if (!FILE_Stat( buffer, &entry->attr, &entry->size,
diff --git a/files/drive.c b/files/drive.c
index 5c72a54..648faf5 100644
--- a/files/drive.c
+++ b/files/drive.c
@@ -7,6 +7,7 @@
#include <string.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <sys/stat.h>
#if defined(__linux__) || defined(sun)
@@ -131,7 +132,7 @@
if (!count)
{
- fprintf( stderr, "Warning: no valid DOS drive found\n" );
+ fprintf( stderr, "Warning: no valid DOS drive found, check your configuration file.\n" );
/* Create a C drive pointing to Unix root dir */
DOSDrives[2].root = xstrdup( "/" );
DOSDrives[2].dos_cwd = xstrdup( "" );
diff --git a/files/file.c b/files/file.c
index 3d00a25..0ba36fd 100644
--- a/files/file.c
+++ b/files/file.c
@@ -26,6 +26,179 @@
#include "stddebug.h"
#include "debug.h"
+#define MAX_OPEN_FILES 64 /* Max. open files for all tasks; must be <255 */
+
+typedef struct
+{
+ int unix_handle;
+ int mode;
+} DOS_FILE;
+
+/* Global files array */
+static DOS_FILE DOSFiles[MAX_OPEN_FILES];
+
+
+/***********************************************************************
+ * FILE_AllocDOSFile
+ *
+ * Allocate a file from the DOS files array.
+ */
+static BYTE FILE_AllocDOSFile( int unix_handle )
+{
+ BYTE i;
+ for (i = 0; i < MAX_OPEN_FILES; i++) if (!DOSFiles[i].mode)
+ {
+ DOSFiles[i].unix_handle = unix_handle;
+ DOSFiles[i].mode = 1;
+ return i;
+ }
+ return 0xff;
+}
+
+
+/***********************************************************************
+ * FILE_FreeDOSFile
+ *
+ * Free a file from the DOS files array.
+ */
+static BOOL FILE_FreeDOSFile( BYTE handle )
+{
+ if (handle >= MAX_OPEN_FILES) return FALSE;
+ if (!DOSFiles[handle].mode) return FALSE;
+ DOSFiles[handle].mode = 0;
+ return TRUE;
+}
+
+
+/***********************************************************************
+ * FILE_GetUnixHandle
+ *
+ * Return the Unix handle for a global DOS file handle.
+ */
+static int FILE_GetUnixHandle( BYTE handle )
+{
+ if (handle >= MAX_OPEN_FILES) return -1;
+ if (!DOSFiles[handle].mode) return -1;
+ return DOSFiles[handle].unix_handle;
+}
+
+
+/***********************************************************************
+ * FILE_AllocTaskHandle
+ *
+ * Allocate a per-task file handle.
+ */
+static HFILE FILE_AllocTaskHandle( int unix_handle )
+{
+ PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
+ BYTE *files, *fp;
+ WORD i;
+
+ if (!pdb)
+ {
+ fprintf(stderr,"FILE_MakeTaskHandle: internal error, no current PDB.\n");
+ exit(1);
+ }
+ files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
+ fp = files + 1; /* Don't use handle 0, as some programs don't like it */
+ for (i = pdb->nbFiles - 1; (i > 0) && (*fp != 0xff); i--, fp++);
+ if (!i || (*fp = FILE_AllocDOSFile( unix_handle )) == 0xff)
+ { /* No more handles or files */
+ DOS_ERROR( ER_TooManyOpenFiles, EC_ProgramError, SA_Abort, EL_Disk );
+ return -1;
+ }
+ dprintf_file(stddeb,
+ "FILE_AllocTaskHandle: returning task handle %d, file %d for unix handle %d file %d of %d \n",
+ (fp - files), *fp, unix_handle, pdb->nbFiles - i, pdb->nbFiles );
+ return (HFILE)(fp - files);
+}
+
+
+/***********************************************************************
+ * FILE_FreeTaskHandle
+ *
+ * Free a per-task file handle.
+ */
+static void FILE_FreeTaskHandle( HFILE handle )
+{
+ PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
+ BYTE *files;
+
+ if (!pdb)
+ {
+ fprintf(stderr,"FILE_FreeTaskHandle: internal error, no current PDB.\n");
+ exit(1);
+ }
+ files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
+ dprintf_file( stddeb,"FILE_FreeTaskHandle: dos=%d file=%d\n",
+ handle, files[handle] );
+ if ((handle < 0) || (handle >= (INT)pdb->nbFiles) ||
+ !FILE_FreeDOSFile( files[handle] ))
+ {
+ fprintf( stderr, "FILE_FreeTaskHandle: invalid file handle %d\n",
+ handle );
+ return;
+ }
+ files[handle] = 0xff;
+}
+
+
+/***********************************************************************
+ * FILE_GetUnixTaskHandle
+ *
+ * Return the Unix file handle associated to a task file handle.
+ */
+int FILE_GetUnixTaskHandle( HFILE handle )
+{
+ PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
+ BYTE *files;
+ int unix_handle;
+
+ if (!pdb)
+ {
+ fprintf(stderr,"FILE_GetUnixHandle: internal error, no current PDB.\n");
+ exit(1);
+ }
+ files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
+ if ((handle < 0) || (handle >= (INT)pdb->nbFiles) ||
+ ((unix_handle = FILE_GetUnixHandle( files[handle] )) == -1))
+ {
+ DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
+ return -1;
+ }
+ return unix_handle;
+}
+
+
+/***********************************************************************
+ * FILE_CloseAllFiles
+ *
+ * Close all open files of a given PDB. Used on task termination.
+ */
+void FILE_CloseAllFiles( HANDLE hPDB )
+{
+ BYTE *files;
+ WORD count;
+ PDB *pdb = (PDB *)GlobalLock( hPDB );
+ int unix_handle;
+
+ if (!pdb) return;
+ files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
+ dprintf_file(stddeb,"FILE_CloseAllFiles: closing %d files\n",pdb->nbFiles);
+ for (count = pdb->nbFiles; count > 0; count--, files++)
+ {
+ if (*files != 0xff)
+ {
+ if ((unix_handle = FILE_GetUnixHandle( *files )) != -1)
+ {
+ close( unix_handle );
+ FILE_FreeDOSFile( *files );
+ }
+ *files = 0xff;
+ }
+ }
+}
+
/***********************************************************************
* FILE_SetDosError
@@ -76,115 +249,6 @@
/***********************************************************************
- * FILE_AllocTaskHandle
- *
- * Allocate a DOS file handle for the current task.
- */
-static HFILE FILE_AllocTaskHandle( int handle )
-{
- PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
- BYTE *files, *fp;
- WORD i;
-
- if (!pdb)
- {
- fprintf(stderr,"FILE_MakeTaskHandle: internal error, no current PDB.\n");
- exit(1);
- }
- fp = files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
- for (i = pdb->nbFiles; (i > 0) && (*fp != 0xff); i--, fp++);
- if (!i || (handle >= 0xff)) /* No more handles */
- {
- DOS_ERROR( ER_TooManyOpenFiles, EC_ProgramError, SA_Abort, EL_Disk );
- return -1;
- }
- *fp = (BYTE)handle;
- dprintf_file(stddeb,
- "FILE_AllocTaskHandle: returning %d for handle %d file %d of %d \n",
- (fp - files),handle,pdb->nbFiles - i, pdb->nbFiles );
- return (HFILE)(fp - files);
-}
-
-
-/***********************************************************************
- * FILE_FreeTaskHandle
- *
- * Free a DOS file handle for the current task.
- */
-static void FILE_FreeTaskHandle( HFILE handle )
-{
- PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
- BYTE *files;
-
- if (!pdb)
- {
- fprintf(stderr,"FILE_FreeTaskHandle: internal error, no current PDB.\n");
- exit(1);
- }
- files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
- dprintf_file( stddeb,"FILE_FreeTaskHandle: dos=%d unix=%d\n",
- handle, files[handle]);
- if ((handle<0) || (handle >= (INT)pdb->nbFiles) || (files[handle] == 0xff))
- {
- fprintf( stderr, "FILE_FreeTaskHandle: invalid file handle %d\n",
- handle );
- return;
- }
- files[handle] = 0xff;
-}
-
-
-/***********************************************************************
- * FILE_GetUnixHandle
- *
- * Return the Unix file handle associated to a DOS file handle.
- */
-int FILE_GetUnixHandle( HFILE handle )
-{
- PDB *pdb = (PDB *)GlobalLock( GetCurrentPDB() );
- BYTE *files;
-
- if (!pdb)
- {
- fprintf(stderr,"FILE_GetUnixHandle: internal error, no current PDB.\n");
- exit(1);
- }
- files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
- if ((handle<0) || (handle >= (INT)pdb->nbFiles) || (files[handle] == 0xff))
- {
- DOS_ERROR( ER_InvalidHandle, EC_ProgramError, SA_Abort, EL_Disk );
- return -1;
- }
- return (int)files[handle];
-}
-
-
-/***********************************************************************
- * FILE_CloseAllFiles
- *
- * Close all open files of a given PDB. Used on task termination.
- */
-void FILE_CloseAllFiles( HANDLE hPDB )
-{
- BYTE *files;
- WORD count;
- PDB *pdb = (PDB *)GlobalLock( hPDB );
-
- if (!pdb) return;
- files = PTR_SEG_TO_LIN( pdb->fileHandlesPtr );
- fprintf(stderr,"FILE_CloseAllFiles: closing %d files\n",pdb->nbFiles);
- for (count = pdb->nbFiles; count > 0; count--, files++)
- {
- if (*files != 0xff)
- {
- close( (int)*files );
- *files = 0xff;
- }
- }
-}
-
-
-/***********************************************************************
* FILE_OpenUnixFile
*/
static int FILE_OpenUnixFile( const char *name, int mode )
@@ -310,7 +374,7 @@
return 0;
}
if (pattr) *pattr = FA_ARCHIVE | (S_ISDIR(st.st_mode) ? FA_DIRECTORY : 0);
- if (psize) *psize = st.st_size;
+ if (psize) *psize = S_ISDIR(st.st_mode) ? 0 : st.st_size;
DOSFS_ToDosDateTime( &st.st_mtime, pdate, ptime );
return 1;
}
@@ -327,14 +391,14 @@
struct stat st;
int handle;
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return 0;
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return 0;
if (fstat( handle, &st ) == -1)
{
FILE_SetDosError();
return 0;
}
if (pattr) *pattr = FA_ARCHIVE | (S_ISDIR(st.st_mode) ? FA_DIRECTORY : 0);
- if (psize) *psize = st.st_size;
+ if (psize) *psize = S_ISDIR(st.st_mode) ? 0 : st.st_size;
DOSFS_ToDosDateTime( &st.st_mtime, pdate, ptime );
return 1;
}
@@ -400,7 +464,7 @@
int handle, newhandle;
HFILE dosHandle;
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return HFILE_ERROR;
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return HFILE_ERROR;
dprintf_file( stddeb, "FILE_Dup for handle %d\n",handle);
if ((newhandle = dup(handle)) == -1)
{
@@ -425,7 +489,7 @@
BYTE *files;
int handle, newhandle;
- if ((handle = FILE_GetUnixHandle( hFile1 )) == -1) return HFILE_ERROR;
+ if ((handle = FILE_GetUnixTaskHandle( hFile1 )) == -1) return HFILE_ERROR;
dprintf_file( stddeb, "FILE_Dup2 for handle %d\n",handle);
if ((hFile2 < 0) || (hFile2 >= (INT)pdb->nbFiles))
{
@@ -640,6 +704,22 @@
/***********************************************************************
+ * FILE_Read
+ */
+LONG FILE_Read( HFILE hFile, LPSTR buffer, LONG count )
+{
+ int handle;
+ LONG result;
+
+ dprintf_file( stddeb, "FILE_Read: %d %p %ld\n", hFile, buffer, count );
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return -1;
+ if (!count) return 0;
+ if ((result = read( handle, buffer, count )) == -1) FILE_SetDosError();
+ return result;
+}
+
+
+/***********************************************************************
* GetTempFileName (KERNEL.97)
*/
INT GetTempFileName( BYTE drive, LPCSTR prefix, UINT unique, LPSTR buffer )
@@ -719,7 +799,7 @@
int handle;
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return HFILE_ERROR;
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return HFILE_ERROR;
dprintf_file( stddeb, "_lclose: doshandle %d unixhandle %d\n", hFile,handle );
if (handle <= 2)
{
@@ -735,7 +815,7 @@
/***********************************************************************
* _lread (KERNEL.82)
*/
-INT _lread( HFILE hFile, LPSTR buffer, WORD count )
+INT _lread( HFILE hFile, SEGPTR buffer, WORD count )
{
return (INT)_hread( hFile, buffer, (LONG)count );
}
@@ -787,7 +867,7 @@
dprintf_file( stddeb, "_llseek: handle %d, offset %ld, origin %d\n",
hFile, lOffset, nOrigin);
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return HFILE_ERROR;
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return HFILE_ERROR;
switch(nOrigin)
{
case 1: origin = SEEK_CUR; break;
@@ -843,17 +923,19 @@
/***********************************************************************
* _hread (KERNEL.349)
*/
-LONG _hread( HFILE hFile, LPSTR buffer, LONG count )
+LONG _hread( HFILE hFile, SEGPTR buffer, LONG count )
{
- int handle;
- LONG result;
+#ifndef WINELIB
+ LONG maxlen;
- dprintf_file( stddeb, "_hread: %d %p %ld\n", hFile, buffer, count );
-
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return -1;
- if (!count) return 0;
- if ((result = read( handle, buffer, count )) == -1) FILE_SetDosError();
- return result;
+ dprintf_file( stddeb, "_hread: %d %08lx %ld\n",
+ hFile, (DWORD)buffer, count );
+
+ /* Some programs pass a count larger than the allocated buffer */
+ maxlen = GetSelectorLimit( SELECTOROF(buffer) ) - OFFSETOF(buffer) + 1;
+ if (count > maxlen) count = maxlen;
+#endif
+ return FILE_Read( hFile, PTR_SEG_TO_LIN(buffer), count );
}
@@ -867,7 +949,7 @@
dprintf_file( stddeb, "_hwrite: %d %p %ld\n", hFile, buffer, count );
- if ((handle = FILE_GetUnixHandle( hFile )) == -1) return HFILE_ERROR;
+ if ((handle = FILE_GetUnixTaskHandle( hFile )) == -1) return HFILE_ERROR;
if (count == 0) /* Expand or truncate at current position */
result = ftruncate( handle, lseek( handle, 0, SEEK_CUR ) );
diff --git a/files/profile.c b/files/profile.c
index 50816e1..61a916a 100644
--- a/files/profile.c
+++ b/files/profile.c
@@ -447,21 +447,22 @@
{
if (section->name && !lstrcmpi( section->name, section_name ))
{
+ INT oldlen = len;
for (key = section->key; key; key = key->next)
{
if (len <= 2) break;
if (IS_ENTRY_COMMENT(key->name)) continue; /* Skip comments */
PROFILE_CopyEntry( buffer, key->name, len - 1, handle_env );
- len -= strlen(buffer) - 1;
+ len -= strlen(buffer) + 1;
buffer += strlen(buffer) + 1;
}
*buffer = '\0';
- return len - 1;
+ return oldlen - len + 1;
}
section = section->next;
}
buffer[0] = buffer[1] = '\0';
- return len - 2;
+ return 2;
}
diff --git a/if1632/Makefile.in b/if1632/Makefile.in
index 8cdd78d..1db5b31 100644
--- a/if1632/Makefile.in
+++ b/if1632/Makefile.in
@@ -8,7 +8,8 @@
shell.spec sound.spec storage.spec stress.spec system.spec \
toolhelp.spec user.spec win87em.spec winprocs.spec winsock.spec
-DLLS32 = advapi32.spec comdlg32.spec gdi32.spec kernel32.spec shell32.spec user32.spec winprocs32.spec
+DLLS32 = advapi32.spec comctl32.spec comdlg32.spec gdi32.spec kernel32.spec \
+ ole32.spec shell32.spec user32.spec winprocs32.spec winspool.spec
SPEC16_FILES = $(DLLS16:.spec=.S)
SPEC32_FILES = $(DLLS32:.spec=.c)
@@ -53,18 +54,18 @@
# 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
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o advapi32.o advapi32.c
comdlg32.o: comdlg32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o comdlg32.o comdlg32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o comdlg32.o comdlg32.c
gdi32.o: gdi32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o gdi32.o gdi32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o gdi32.o gdi32.c
kernel32.o: kernel32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o kernel32.o kernel32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o kernel32.o kernel32.c
shell32.o: shell32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o shell32.o shell32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o shell32.o shell32.c
user32.o: user32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o user32.o user32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o user32.o user32.c
winprocs32.o: winprocs32.c
- $(CC) -c $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o winprocs32.o winprocs32.c
+ $(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o winprocs32.o winprocs32.c
### Dependencies:
diff --git a/if1632/comctl32.spec b/if1632/comctl32.spec
new file mode 100644
index 0000000..5967fef
--- /dev/null
+++ b/if1632/comctl32.spec
@@ -0,0 +1,60 @@
+name comctl32
+base 2
+
+00 stub MenuHelp
+01 stub ShowHideMenuCtl
+02 stub GetEffectiveClientRect
+03 stub DrawStatusTextA
+04 stub CreateStatusWindowA
+05 stub CreateToolbar
+06 stub CreateMappedBitmap
+07 stub CreatePropertySheetPage
+08 stub CreatePropertySheetPageA
+09 stub CreatePropertySheetPageW
+10 stub CreateStatusWindow
+11 stub MakeDragList
+12 stub LBItemFromPt
+13 stub DrawInsert
+14 stub CreateUpDownControl
+15 stub InitCommonControls
+16 stub CreateStatusWindowW
+17 stub CreateToolbarEx
+18 stub DestroyPropertySheetPage
+19 stub DrawStatusText
+20 stub DrawStatusTextW
+21 stub ImageList_Add
+22 stub ImageList_AddIcon
+23 stub ImageList_AddMasked
+24 stub ImageList_BeginDrag
+25 stub ImageList_Create
+26 stub ImageList_Destroy
+27 stub ImageList_DragEnter
+28 stub ImageList_DragLeave
+29 stub ImageList_DragMove
+30 stub ImageList_DragShowNolock
+31 stub ImageList_Draw
+32 stub ImageList_DrawEx
+33 stub ImageList_EndDrag
+34 stub ImageList_GetBkColor
+35 stub ImageList_GetDragImage
+36 stub ImageList_GetIcon
+37 stub ImageList_GetIconSize
+38 stub ImageList_GetImageCount
+39 stub ImageList_GetImageInfo
+40 stub ImageList_GetImageRect
+41 stub ImageList_LoadImage
+42 stub ImageList_LoadImageA
+43 stub ImageList_LoadImageW
+44 stub ImageList_Merge
+45 stub ImageList_Read
+46 stub ImageList_Remove
+47 stub ImageList_Replace
+48 stub ImageList_ReplaceIcon
+49 stub ImageList_SetBkColor
+50 stub ImageList_SetDragCursorImage
+51 stub ImageList_SetIconSize
+52 stub ImageList_SetOverlayImage
+53 stub ImageList_Write
+54 stub PropertySheet
+55 stub PropertySheetA
+56 stub PropertySheetW
diff --git a/if1632/gdi32.spec b/if1632/gdi32.spec
index 43d7586..9899d0e 100644
--- a/if1632/gdi32.spec
+++ b/if1632/gdi32.spec
@@ -20,7 +20,7 @@
0016 stub CloseFigure
0017 stub CloseMetaFile
0018 stub ColorMatchToTarget
-0019 stub CombineRgn
+0019 stdcall CombineRgn(long long long long) CombineRgn
0020 stub CombineTransform
0021 stub CopyEnhMetaFileA
0022 stub CopyEnhMetaFileW
@@ -60,7 +60,7 @@
0056 stub CreatePenIndirect
0057 stub CreatePolyPolygonRgn
0058 stub CreatePolygonRgn
-0059 stub CreateRectRgn
+0059 stdcall CreateRectRgn(long long long long) CreateRectRgn
0060 stub CreateRectRgnIndirect
0061 stub CreateRoundRectRgn
0062 stub CreateScalableFontResourceA
@@ -205,7 +205,7 @@
0201 stub GetMiterLimit
0202 stub GetNearestColor
0203 stub GetNearestPaletteIndex
-0204 stdcall GetObjectA(long long ptr) GetObject
+0204 stdcall GetObjectA(long long ptr) WIN32_GetObject
0205 stub GetObjectType
0206 stub GetObjectW
0207 stub GetOutlineTextMetricsA
@@ -333,7 +333,7 @@
0329 stub SetPixelV
0330 stub SetPolyFillMode
0331 stub SetROP2
-0332 stub SetRectRgn
+0332 stdcall SetRectRgn(long long long long long) SetRectRgn
0333 stub SetRelAbs
0334 stub SetStretchBltMode
0335 stub SetSystemPaletteUse
@@ -351,7 +351,7 @@
0347 stub StartDocA
0348 stub StartDocW
0349 stub StartPage
-0350 stub StretchBlt
+0350 stdcall StretchBlt(long long long long long long long long long long long) StretchBlt
0351 stub StretchDIBits
0352 stub StrokeAndFillPath
0353 stub StrokePath
@@ -363,4 +363,30 @@
0359 stub UpdateColors
0360 stub WidenPath
0361 stub pstackConnect
+#late additions
+0362 stub DeviceCapabilitiesEx
+0363 stub GdiDciBeginAccess
+0364 stub GdiDciCreateOffscreenSurface
+0365 stub GdiDciCreateOverlaySurface
+0366 stub GdiDciCreatePrimarySurface
+0367 stub GdiDciDestroySurface
+0368 stub GdiDciDrawSurface
+0369 stub GdiDciEndAccess
+0370 stub GdiDciEnumSurface
+0371 stub GdiDciInitialize
+0372 stub GdiDciSetClipList
+0373 stub GdiDciSetDestination
+0374 stub GdiDllInitialize
+0375 stub GdiGetLocalBitmap
+0376 stub GdiWinWatchClose
+0377 stub GdiWinWatchDidStatusChange
+0378 stub GdiWinWatchGetClipList
+0379 stub GdiWinWatchOpen
+0380 stub GetGlyphOutlineWow
+0381 stub GetTextCharsetInfo
+0382 stub TranslateCharsetInfo
+0383 stub UpdateICMRegKeyA
+0384 stub UpdateICMRegKeyW
+0385 stub gdiPlaySpoolStream
+
diff --git a/if1632/kernel.spec b/if1632/kernel.spec
index 01fa49f..7d874ed 100644
--- a/if1632/kernel.spec
+++ b/if1632/kernel.spec
@@ -78,7 +78,7 @@
#79 RESERVED3
#80 RESERVED4
81 pascal16 _lclose(word) _lclose
-82 pascal16 _lread(word ptr word) _lread
+82 pascal16 _lread(word segptr word) _lread
83 pascal16 _lcreat(ptr word) _lcreat
84 pascal _llseek(word long word) _llseek
85 pascal16 _lopen(ptr word) _lopen
@@ -256,7 +256,7 @@
346 pascal16 IsBadHugeReadPtr(segptr long) IsBadHugeReadPtr
347 pascal16 IsBadHugeWritePtr(segptr long) IsBadHugeWritePtr
348 pascal16 hmemcpy(ptr ptr long) hmemcpy
-349 pascal _hread(word ptr long) _hread
+349 pascal _hread(word segptr long) _hread
350 pascal _hwrite(word ptr long) _hwrite
#351 BUNNY_351
352 stub lstrcatn
diff --git a/if1632/kernel32.spec b/if1632/kernel32.spec
index a660700..b54f516 100644
--- a/if1632/kernel32.spec
+++ b/if1632/kernel32.spec
@@ -338,7 +338,7 @@
0333 stub GlobalWire
0334 stdcall HeapAlloc(long long long) HeapAlloc
0335 stub HeapCompact
-0336 stub HeapCreate
+0336 stdcall HeapCreate(long long long) HeapCreate
0337 stub HeapDestroy
0338 stub HeapFree
0339 stub HeapLock
@@ -618,3 +618,22 @@
0613 stub lstrlen
0614 stdcall lstrlenA(ptr) strlen
0615 stub lstrlenW
+#late additions
+0616 stub GetPrivateProfileSectionNamesA
+0617 stub GetPrivateProfileSectionNamesW
+0618 stub GetPrivateProfileStructA
+0619 stub GetPrivateProfileStructW
+0620 stub GetProcessVersion
+0621 stub GetSystemPowerStatus
+0622 stub GetSystemTimeAsFileTime
+0623 stub HeapCreateTagsW
+0624 stub HeapExtend
+0625 stub HeapQueryTagW
+0626 stub HeapSummary
+0627 stub HeapUsage
+0628 stub IsDebuggerPresent
+0629 stub PostQueuedCompletionStatus
+0630 stub SetSystemPowerState
+0631 stub WritePrivateProfileStructA
+0632 stub WritePrivateProfileStructW
+0633 stub MakeCriticalSectionGlobal
diff --git a/if1632/ole32.spec b/if1632/ole32.spec
new file mode 100644
index 0000000..f9c6dd2
--- /dev/null
+++ b/if1632/ole32.spec
@@ -0,0 +1,165 @@
+name ole32
+base 1
+
+0 stub BindMoniker
+1 stub CLSIDFromProgID
+2 stub CLSIDFromString
+3 stub CoBuildVersion
+4 stub CoCreateFreeThreadedMarshaler
+5 stub CoCreateGuid
+6 stub CoCreateInstance
+7 stub CoDisconnectObject
+8 stub CoDosDateTimeToFileTime
+9 stub CoFileTimeNow
+10 stub CoFileTimeToDosDateTime
+11 stub CoFreeAllLibraries
+12 stub CoFreeLibrary
+13 stub CoFreeUnusedLibraries
+14 stub CoGetCallerTID
+15 stub CoGetClassObject
+16 stub CoGetCurrentLogicalThreadId
+17 stub CoGetCurrentProcess
+18 stub CoGetInterfaceAndReleaseStream
+19 stub CoGetMalloc
+20 stub CoGetMarshalSizeMax
+21 stub CoGetPSClsid
+22 stub CoGetStandardMarshal
+23 stub CoGetState
+24 stub CoGetTreatAsClass
+25 stub CoInitialize
+26 stub CoInitializeWOW
+27 stub CoIsHandlerConnected
+28 stub CoIsOle1Class
+29 stub CoLoadLibrary
+30 stub CoLockObjectExternal
+31 stub CoMarshalHresult
+32 stub CoMarshalInterThreadInterfaceInStream
+33 stub CoMarshalInterface
+34 stub CoQueryReleaseObject
+35 stub CoRegisterClassObject
+36 stub CoRegisterMallocSpy
+37 stub CoRegisterMessageFilter
+38 stub CoReleaseMarshalData
+39 stub CoRevokeClassObject
+40 stub CoRevokeMallocSpy
+41 stub CoSetState
+42 stub CoTaskMemAlloc
+43 stub CoTaskMemFree
+44 stub CoTaskMemRealloc
+45 stub CoTreatAsClass
+46 stub CoUninitialize
+47 stub CoUnloadingWOW
+48 stub CoUnmarshalHresult
+49 stub CoUnmarshalInterface
+50 stub CreateAntiMoniker
+51 stub CreateBindCtx
+52 stub CreateDataAdviseHolder
+53 stub CreateDataCache
+54 stub CreateFileMoniker
+55 stub CreateGenericComposite
+56 stub CreateILockBytesOnHGlobal
+57 stub CreateItemMoniker
+58 stub CreateOleAdviseHolder
+59 stub CreatePointerMoniker
+60 stub CreateStreamOnHGlobal
+61 stub DllDebugObjectRPCHook
+62 stub DllGetClassObject
+63 stub DllGetClassObjectWOW
+64 stub DoDragDrop
+65 stub EnableHookObject
+66 stub GetClassFile
+67 stub GetConvertStg
+68 stub GetDocumentBitStg
+69 stub GetHGlobalFromILockBytes
+70 stub GetHGlobalFromStream
+71 stub GetHookInterface
+72 stub GetRunningObjectTable
+73 stub IIDFromString
+74 stub IsAccelerator
+75 stub IsEqualGUID
+76 stub IsValidIid
+77 stub IsValidInterface
+78 stub IsValidPtrIn
+79 stub IsValidPtrOut
+80 stub MkParseDisplayName
+81 stub MonikerCommonPrefixWith
+82 stub MonikerRelativePathTo
+83 stub OleBuildVersion
+84 stub OleConvertIStorageToOLESTREAM
+85 stub OleConvertIStorageToOLESTREAMEx
+86 stub OleConvertOLESTREAMToIStorage
+87 stub OleConvertOLESTREAMToIStorageEx
+88 stub OleCreate
+89 stub OleCreateDefaultHandler
+90 stub OleCreateEmbeddingHelper
+91 stub OleCreateFromData
+92 stub OleCreateFromFile
+93 stub OleCreateLink
+94 stub OleCreateLinkFromData
+95 stub OleCreateLinkToFile
+96 stub OleCreateMenuDescriptor
+97 stub OleCreateStaticFromData
+98 stub OleDestroyMenuDescriptor
+99 stub OleDoAutoConvert
+100 stub OleDraw
+101 stub OleDuplicateData
+102 stub OleFlushClipboard
+103 stub OleGetAutoConvert
+104 stub OleGetClipboard
+105 stub OleGetIconOfClass
+106 stub OleGetIconOfFile
+107 stub OleInitialize
+108 stub OleInitializeWOW
+109 stub OleIsCurrentClipboard
+110 stub OleIsRunning
+111 stub OleLoad
+112 stub OleLoadFromStream
+113 stub OleLockRunning
+114 stub OleMetafilePictFromIconAndLabel
+115 stub OleNoteObjectVisible
+116 stub OleQueryCreateFromData
+117 stub OleQueryLinkFromData
+118 stub OleRegEnumFormatEtc
+119 stub OleRegEnumVerbs
+120 stub OleRegGetMiscStatus
+121 stub OleRegGetUserType
+122 stub OleRun
+123 stub OleSave
+124 stub OleSaveToStream
+125 stub OleSetAutoConvert
+126 stub OleSetClipboard
+127 stub OleSetContainedObject
+128 stub OleSetMenuDescriptor
+129 stub OleTranslateAccelerator
+130 stub OleUninitialize
+131 stub OpenOrCreateStream
+132 stub ProgIDFromCLSID
+133 stub ReadClassStg
+134 stub ReadClassStm
+135 stub ReadFmtUserTypeStg
+136 stub ReadOleStg
+137 stub ReadStringStream
+138 stub RegisterDragDrop
+139 stub ReleaseStgMedium
+140 stub RevokeDragDrop
+141 stub SetConvertStg
+142 stub SetDocumentBitStg
+143 stub StgCreateDocfile
+144 stub StgCreateDocfileOnILockBytes
+145 stub StgIsStorageFile
+146 stub StgIsStorageILockBytes
+147 stub StgOpenStorage
+148 stub StgOpenStorageOnILockBytes
+149 stub StgSetTimes
+150 stub StringFromCLSID
+151 stub StringFromGUID2
+152 stub StringFromIID
+153 stub UtConvertDvtd16toDvtd32
+154 stub UtConvertDvtd32toDvtd16
+155 stub UtGetDvtd16Info
+156 stub UtGetDvtd32Info
+157 stub WriteClassStg
+158 stub WriteClassStm
+159 stub WriteFmtUserTypeStg
+160 stub WriteOleStg
+161 stub WriteStringStream
diff --git a/if1632/relay32.c b/if1632/relay32.c
index a380483..54c1898 100644
--- a/if1632/relay32.c
+++ b/if1632/relay32.c
@@ -12,6 +12,8 @@
#include <errno.h>
#include "windows.h"
#include "dlls.h"
+#include "module.h"
+#include "neexe.h"
#include "pe_image.h"
#include "peexe.h"
#include "relay32.h"
@@ -23,24 +25,30 @@
/* Functions are in generated code */
void ADVAPI32_Init();
+void COMCTL32_Init();
void COMDLG32_Init();
+void OLE32_Init();
void GDI32_Init();
void KERNEL32_Init();
void SHELL32_Init();
void USER32_Init();
void WINPROCS32_Init();
+void WINSPOOL_Init();
int RELAY32_Init(void)
{
#ifndef WINELIB
/* Add a call for each DLL */
ADVAPI32_Init();
+ COMCTL32_Init();
COMDLG32_Init();
GDI32_Init();
KERNEL32_Init();
+ OLE32_Init();
SHELL32_Init();
USER32_Init();
WINPROCS32_Init();
+ WINSPOOL_Init();
#endif
/* Why should it fail, anyways? */
return 1;
@@ -72,70 +80,18 @@
exit(1);
}
-void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
+void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
{
- WIN32_builtin *dll;
int i;
- u_short * ordinal;
- u_long * function;
- 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);
- /* FIXME: This should deal with built-in DLLs only. See pe_module on
- loading PE DLLs */
+ item ? item: "(no name)", dll->name, hint);
if(!dll)
return 0;
-#if 0
- if(!dll) {
- if(!wine_files || !wine_files->name ||
- lstrcmpi(dll_name, wine_files->name)) {
- LoadModule(dll_name, (LPVOID) -1);
- if(!wine_files || !wine_files->name ||
- lstrcmpi(dll_name, wine_files->name))
- return 0;
- }
- load_addr = wine_files->load_addr;
- pe_exports = wine_files->pe->pe_export;
- ordinal = (u_short *) (((char *) load_addr) + (int) pe_exports->Address_Of_Name_Ordinals);
- function = (u_long *) (((char *) load_addr) + (int) pe_exports->AddressOfFunctions);
- name = (u_char **) (((char *) load_addr) + (int) pe_exports->AddressOfNames);
- /* import by ordinal */
- if(!item){
- return 0;
- }
- /* hint is correct */
- #if 0
- if(hint && hint<dll->size &&
- dll->functions[hint].name &&
- strcmp(item,dll->functions[hint].name)==0)
- return dll->functions[hint].definition;
- #endif
- /* hint is incorrect, search for name */
- for(i=0;i<pe_exports->Number_Of_Functions;i++)
- if (name[i] && !strcmp(item,name[i]+load_addr))
- return function[i]+(char *)load_addr;
-
- /* function at hint has no name (unimplemented) */
- #if 0
- if(hint && hint<dll->size && !dll->functions[hint].name)
- {
- dll->functions[hint].name=xstrdup(item);
- dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
- dll_name,hint);
- return dll->functions[hint].definition;
- }
- #endif
- printf("Not found\n");
- return 0;
- }
-#endif
/* import by ordinal */
if(!item){
- if(hint && hint<dll->size)return dll->functions[hint].definition;
+ if(hint && hint<dll->size)
+ return dll->functions[hint-dll->base].definition;
return 0;
}
/* hint is correct */
@@ -153,7 +109,7 @@
{
dll->functions[hint].name=xstrdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
- dll_name,hint);
+ dll->name,hint);
return dll->functions[hint].definition;
}
return 0;
@@ -179,3 +135,63 @@
);
return ret;
}
+
+void RELAY32_MakeFakeModule(WIN32_builtin*dll)
+{
+ NE_MODULE *pModule;
+ struct w_files *wpnt;
+ int size;
+ HMODULE hModule;
+ LOADEDFILEINFO *pFileInfo;
+ char *pStr;
+ wpnt=xmalloc(sizeof(struct w_files));
+ wpnt->hinstance=0;
+ wpnt->hModule=0;
+ wpnt->initialised=1;
+ wpnt->mz_header=wpnt->pe=0;
+ size=sizeof(NE_MODULE) +
+ /* loaded file info */
+ sizeof(LOADEDFILEINFO) + strlen(dll->name) +
+ /* name table */
+ 12 +
+ /* several empty tables */
+ 8;
+ hModule = GlobalAlloc( GMEM_MOVEABLE | GMEM_ZEROINIT, size );
+ wpnt->hModule = hModule;
+ FarSetOwner( hModule, hModule );
+ pModule = (NE_MODULE*)GlobalLock(hModule);
+ /* Set all used entries */
+ pModule->magic=PE_SIGNATURE;
+ pModule->count=1;
+ pModule->next=0;
+ pModule->flags=0;
+ pModule->dgroup=0;
+ pModule->ss=0;
+ pModule->cs=0;
+ pModule->heap_size=0;
+ pModule->stack_size=0;
+ pModule->seg_count=0;
+ pModule->modref_count=0;
+ pModule->nrname_size=0;
+ pModule->seg_table=0;
+ pModule->fileinfo=sizeof(NE_MODULE);
+ pModule->os_flags=NE_OSFLAGS_WINDOWS;
+ pModule->expected_version=0x30A;
+ pFileInfo=(LOADEDFILEINFO *)(pModule + 1);
+ pFileInfo->length = sizeof(LOADEDFILEINFO)+strlen(dll->name)-1;
+ strcpy(pFileInfo->filename,dll->name);
+ pStr = ((char*)pFileInfo+pFileInfo->length+1);
+ pModule->name_table=(int)pStr-(int)pModule;
+ *pStr=strlen(dll->name);
+ strcpy(pStr+1,dll->name);
+ pStr += *pStr+1;
+ pModule->res_table=pModule->import_table=pModule->entry_table=
+ (int)pStr-(int)pModule;
+ MODULE_RegisterModule(hModule);
+ wpnt->builtin=dll;
+ wpnt->next=wine_files;
+ wine_files=wpnt;
+}
+
+
+
diff --git a/if1632/shell32.spec b/if1632/shell32.spec
index 1ce2e8a..1e191e2 100644
--- a/if1632/shell32.spec
+++ b/if1632/shell32.spec
@@ -4,84 +4,122 @@
0000 stub CheckEscapesA
0001 stub CheckEscapesW
0002 stub CommandLineToArgvW
-0003 stub DoEnvironmentSubstA
-0004 stub DoEnvironmentSubstW
-0005 stub DragAcceptFiles
-0006 stub DragFinish
-0007 stub DragQueryFileA
-0008 stub DragQueryFileAorW
-0009 stub DragQueryFileW
-0010 stub DragQueryPoint
-0011 stub DuplicateIcon
-0012 stub ExtractAssociatedIconA
-0013 stub ExtractAssociatedIconExA
-0014 stub ExtractAssociatedIconExW
-0015 stub ExtractAssociatedIconW
-0016 stub ExtractIconA
-0017 stub ExtractIconResInfoA
-0018 stub ExtractIconResInfoW
-0019 stub ExtractIconW
-0020 stub ExtractVersionResource16W
-0021 stub FindExeDlgProc
-0022 stub FindExecutableA
-0023 stub FindExecutableW
-0024 stub FreeIconList
-0025 stub InternalExtractIconListA
-0026 stub InternalExtractIconListW
-0027 stub RealShellExecuteA
-0028 stub RealShellExecuteExA
-0029 stub RealShellExecuteExW
-0030 stub RealShellExecuteW
-0031 stub RegenerateUserEnvironment
-0032 stub RegisterShellHook
-0033 stub SheChangeDirA
-0034 stub SheChangeDirExA
-0035 stub SheChangeDirExW
-0036 stub SheChangeDirW
-0037 stub SheConvertPathW
-0038 stub SheFullPathA
-0039 stub SheFullPathW
-0040 stub SheGetCurDrive
-0041 stub SheGetDirA
-0042 stub SheGetDirExW
-0043 stub SheGetDirW
-0044 stub SheGetPathOffsetW
-0045 stub SheRemoveQuotesA
-0046 stub SheRemoveQuotesW
-0047 stub SheSetCurDrive
-0048 stub SheShortenPathA
-0049 stub SheShortenPathW
-0050 stub ShellAboutA
-0051 stub ShellAboutW
-0052 stub ShellExecuteA
-0053 stub ShellExecuteW
-0054 stub ShellHookProc
-0055 stub StrChrA
-0056 stub StrChrIA
-0057 stub StrChrIW
-0058 stub StrChrW
-0059 stub StrCmpNA
-0060 stub StrCmpNIA
-0061 stub StrCmpNIW
-0062 stub StrCmpNW
-0063 stub StrCpyNA
-0064 stub StrCpyNW
-0065 stub StrNCmpA
-0066 stub StrNCmpIA
-0067 stub StrNCmpIW
-0068 stub StrNCmpW
-0069 stub StrNCpyA
-0070 stub StrNCpyW
-0071 stub StrRChrA
-0072 stub StrRChrIA
-0073 stub StrRChrIW
-0074 stub StrRChrW
-0075 stub StrRStrA
-0076 stub StrRStrIA
-0077 stub StrRStrIW
-0078 stub StrRStrW
-0079 stub StrStrA
-0080 stub StrStrIA
-0081 stub StrStrIW
-0082 stub StrStrW
-0083 stub WOWShellExecute
+0003 stub Control_FillCache_RunDLL
+0004 stub Control_RunDLL
+0005 stub DllGetClassObject
+0006 stub DoEnvironmentSubstA
+0007 stub DoEnvironmentSubstW
+0008 stub DragAcceptFiles
+0009 stub DragFinish
+0010 stub DragQueryFile
+0011 stub DragQueryFileA
+0012 stub DragQueryFileAorW
+0013 stub DragQueryFileW
+0014 stub DragQueryPoint
+0015 stub DuplicateIcon
+0016 stub ExtractAssociatedIconA
+0017 stub ExtractAssociatedIconExA
+0018 stub ExtractAssociatedIconExW
+0019 stub ExtractAssociatedIconW
+0020 stub ExtractIconA
+0021 stub ExtractIconEx
+0022 stub ExtractIconExA
+0023 stub ExtractIconExW
+0024 stub ExtractIconResInfoA
+0025 stub ExtractIconResInfoW
+0026 stub ExtractIconW
+0027 stub ExtractVersionResource16W
+0028 stub FindExeDlgProc
+0029 stub FindExecutableA
+0030 stub FindExecutableW
+0031 stub FreeIconList
+0032 stub InternalExtractIconListA
+0033 stub InternalExtractIconListW
+0034 stub OpenAs_RunDLL
+0035 stub PrintersGetCommand_RunDLL
+0036 stub RealShellExecuteA
+0037 stub RealShellExecuteExA
+0038 stub RealShellExecuteExW
+0039 stub RealShellExecuteW
+0040 stub RegenerateUserEnvironment
+0041 stub RegisterShellHook
+0042 stub SHAddToRecentDocs
+0043 stub SHAppBarMessage
+0044 stub SHBrowseForFolder
+0045 stub SHBrowseForFolderA
+0046 stub SHBrowseForFolderW
+0047 stub SHChangeNotify
+0048 stub SHFileOperation
+0049 stub SHFileOperationA
+0050 stub SHFileOperationW
+0051 stub SHFormatDrive
+0052 stub SHFreeNameMappings
+0053 stub SHGetDesktopFolder
+0054 stub SHGetFileInfo
+0055 stub SHGetFileInfoA
+0056 stub SHGetFileInfoW
+0057 stub SHGetInstanceExplorer
+0058 stub SHGetMalloc
+0059 stub SHGetPathFromIDList
+0060 stub SHGetPathFromIDListA
+0061 stub SHGetPathFromIDListW
+0062 stub SHGetSpecialFolderLocation
+0063 stub SHHelpShortcuts_RunDLL
+0064 stub SHLoadInProc
+0065 stub SheChangeDirA
+0066 stub SheChangeDirExA
+0067 stub SheChangeDirExW
+0068 stub SheChangeDirW
+0069 stub SheConvertPathW
+0070 stub SheFullPathA
+0071 stub SheFullPathW
+0072 stub SheGetCurDrive
+0073 stub SheGetDirA
+0074 stub SheGetDirExW
+0075 stub SheGetDirW
+0076 stub SheGetPathOffsetW
+0077 stub SheRemoveQuotesA
+0078 stub SheRemoveQuotesW
+0079 stub SheSetCurDrive
+0080 stub SheShortenPathA
+0081 stub SheShortenPathW
+0082 stub ShellAboutA
+0083 stub ShellAboutW
+0084 stub ShellExecuteA
+0085 stub ShellExecuteEx
+0086 stub ShellExecuteExA
+0087 stub ShellExecuteExW
+0088 stub ShellExecuteW
+0089 stub ShellHookProc
+0090 stub Shell_NotifyIcon
+0091 stub Shell_NotifyIconA
+0092 stub Shell_NotifyIconW
+0093 stub StrChrA
+0094 stub StrChrIA
+0095 stub StrChrIW
+0096 stub StrChrW
+0097 stub StrCmpNA
+0098 stub StrCmpNIA
+0099 stub StrCmpNIW
+0100 stub StrCmpNW
+0101 stub StrCpyNA
+0102 stub StrCpyNW
+0103 stub StrNCmpA
+0104 stub StrNCmpIA
+0105 stub StrNCmpIW
+0106 stub StrNCmpW
+0107 stub StrNCpyA
+0108 stub StrNCpyW
+0109 stub StrRChrA
+0110 stub StrRChrIA
+0111 stub StrRChrIW
+0112 stub StrRChrW
+0113 stub StrRStrA
+0114 stub StrRStrIA
+0115 stub StrRStrIW
+0116 stub StrRStrW
+0117 stub StrStrA
+0118 stub StrStrIA
+0119 stub StrStrIW
+0120 stub StrStrW
+0121 stub WOWShellExecute
diff --git a/if1632/user32.spec b/if1632/user32.spec
index 1a56acc..bb36b0b 100644
--- a/if1632/user32.spec
+++ b/if1632/user32.spec
@@ -70,11 +70,15 @@
0066 stub CreateCursor
0067 stub CreateDesktopA
0068 stub CreateDesktopW
-0069 stub CreateDialogIndirectParamA
+0069 stdcall CreateDialogIndirectParamA(long ptr long ptr long)
+ USER32_CreateDialogIndirectParamA
0070 stub CreateDialogIndirectParamAorW
-0071 stub CreateDialogIndirectParamW
-0072 stub CreateDialogParamA
-0073 stub CreateDialogParamW
+0071 stdcall CreateDialogIndirectParamW(long ptr long ptr long)
+ USER32_CreateDialogIndirectParamW
+0072 stdcall CreateDialogParamA(long ptr long ptr long)
+ USER32_CreateDialogParamA
+0073 stdcall CreateDialogParamW(long ptr long ptr long)
+ USER32_CreateDialogParamW
0074 stub CreateIcon
0075 stub CreateIconFromResource
0076 stub CreateIconFromResourceEx
@@ -137,11 +141,13 @@
0132 stub DestroyIcon
0133 stub DestroyMenu
0134 stub DestroyWindow
-0135 stub DialogBoxIndirectParamA
+0135 stdcall DialogBoxIndirectParamA(long ptr long ptr long)
+ USER32_DialogBoxIndirectParamA
0136 stub DialogBoxIndirectParamAorW
-0137 stub DialogBoxIndirectParamW
-0138 stub DialogBoxParamA
-0139 stub DialogBoxParamW
+0137 stdcall DialogBoxIndirectParamW(long ptr long ptr long)
+ USER32_DialogBoxIndirectParamW
+0138 stdcall DialogBoxParamA(long ptr long ptr long) USER32_DialogBoxParamA
+0139 stdcall DialogBoxParamW(long ptr long ptr long) USER32_DialogBoxParamW
0140 stdcall DispatchMessageA(ptr) USER32_DispatchMessageA
0141 stub DispatchMessageW
0142 stub DlgDirListA
@@ -203,7 +209,7 @@
0198 stub FindWindowExA
0199 stub FindWindowExW
0200 stub FindWindowW
-0201 stub FlashWindow
+0201 stdcall FlashWindow(long long) FlashWindow
0202 stub FrameRect
0203 stub FreeDDElParam
0204 stub GetActiveWindow
@@ -355,7 +361,7 @@
0350 stub IsWindowVisible
0351 stub IsZoomed
0352 stub KillSystemTimer
-0353 stub KillTimer
+0353 stdcall KillTimer(long long) KillTimer
0354 stdcall LoadAcceleratorsA(long ptr) WIN32_LoadAcceleratorsA
0355 stdcall LoadAcceleratorsW(long ptr) WIN32_LoadAcceleratorsW
0356 stdcall LoadBitmapA(long ptr) WIN32_LoadBitmapA
@@ -421,7 +427,7 @@
0415 stub PeekMessageA
0416 stub PeekMessageW
0417 stub PlaySoundEvent
-0418 stub PostMessageA
+0418 stdcall PostMessageA(long long long long) PostMessage
0419 stub PostMessageW
0420 stdcall PostQuitMessage(long) PostQuitMessage
0421 stub PostThreadMessageA
@@ -441,7 +447,7 @@
0435 stub RegisterTasklist
0436 stub RegisterWindowMessageA
0437 stub RegisterWindowMessageW
-0438 stub ReleaseCapture
+0438 stdcall ReleaseCapture() ReleaseCapture
0439 stdcall ReleaseDC(long long) ReleaseDC
0440 stub RemoveMenu
0441 stub RemovePropA
@@ -456,7 +462,7 @@
0450 stub ScrollWindowEx
0451 stub SendDlgItemMessageA
0452 stub SendDlgItemMessageW
-0453 stub SendMessageA
+0453 stdcall SendMessageA(long long long long) SendMessage
0454 stub SendMessageCallbackA
0455 stub SendMessageCallbackW
0456 stub SendMessageTimeoutA
@@ -466,7 +472,7 @@
0460 stub SendNotifyMessageW
0461 stub ServerSetFunctionPointers
0462 stub SetActiveWindow
-0463 stub SetCapture
+0463 stdcall SetCapture(long) SetCapture
0464 stub SetCaretBlinkTime
0465 stub SetCaretPos
0466 stub SetClassLongA
@@ -513,7 +519,7 @@
0507 stub SetSystemMenu
0508 stub SetSystemTimer
0509 stub SetThreadDesktop
-0510 stub SetTimer
+0510 stdcall SetTimer(long long long long) USER32_SetTimer
0511 stub SetUserObjectInformationA
0512 stub SetUserObjectInformationW
0513 stub SetUserObjectSecurity
@@ -587,7 +593,19 @@
0581 stub WindowFromPoint
0582 stub keybd_event
0583 stub mouse_event
-0584 cdecl wsprintfA(ptr ptr ...) wsprintf
+0584 cdecl wsprintfA(ptr ptr ...) vsprintf
0585 stub wsprintfW
0586 stub wvsprintfA
0587 stub wvsprintfW
+#late additions
+0588 stub ChangeDisplaySettingsA
+0588 stub ChangeDisplaySettingsW
+0588 stub EnumDesktopWindows
+0588 stub EnumDisplaySettingsA
+0588 stub EnumDisplaySettingsW
+0588 stub GetWindowRgn
+0588 stub MapVirtualKeyExW
+0588 stub RegisterServicesProcess
+0588 stub SetWindowRgn
+0588 stub ToUnicodeEx
+
diff --git a/if1632/winspool.spec b/if1632/winspool.spec
new file mode 100644
index 0000000..d3ac315
--- /dev/null
+++ b/if1632/winspool.spec
@@ -0,0 +1,126 @@
+name winspool
+base 100
+
+001 stub ADVANCEDSETUPDIALOG
+002 stub AbortPrinter
+003 stub AddFormA
+004 stub AddFormW
+005 stub AddJobA
+006 stub AddJobW
+007 stub AddMonitorA
+008 stub AddMonitorW
+009 stub AddPortA
+010 stub AddPortExA
+011 stub AddPortExW
+012 stub AddPortW
+013 stub AddPrintProcessorA
+014 stub AddPrintProcessorW
+015 stub AddPrintProvidorA
+016 stub AddPrintProvidorW
+017 stub AddPrinterA
+018 stub AddPrinterConnectionA
+019 stub AddPrinterConnectionW
+020 stub AddPrinterDriverA
+021 stub AddPrinterDriverW
+022 stub AddPrinterW
+023 stub AdvancedDocumentPropertiesA
+024 stub AdvancedDocumentPropertiesW
+025 stub AdvancedSetupDialog
+026 stub ClosePrinter
+027 stub ConfigurePortA
+028 stub ConfigurePortW
+029 stub ConnectToPrinterDlg
+030 stub CreatePrinterIC
+031 stub DEVICECAPABILITIES
+032 stub DEVICEMODE
+033 stub DeleteFormA
+034 stub DeleteFormW
+035 stub DeleteMonitorA
+036 stub DeleteMonitorW
+037 stub DeletePortA
+038 stub DeletePortW
+039 stub DeletePrintProcessorA
+040 stub DeletePrintProcessorW
+041 stub DeletePrintProvidorA
+042 stub DeletePrintProvidorW
+043 stub DeletePrinter
+044 stub DeletePrinterConnectionA
+045 stub DeletePrinterConnectionW
+046 stub DeletePrinterDriverA
+047 stub DeletePrinterDriverW
+048 stub DeletePrinterIC
+049 stub DevQueryPrint
+050 stub DeviceCapabilities
+051 stub DeviceCapabilitiesA
+052 stub DeviceCapabilitiesW
+053 stub DeviceMode
+054 stub DocumentEvent
+055 stub DocumentPropertiesA
+056 stub DocumentPropertiesW
+057 stub EXTDEVICEMODE
+058 stub EndDocPrinter
+059 stub EndPagePrinter
+060 stub EnumFormsA
+061 stub EnumFormsW
+062 stub EnumJobsA
+063 stub EnumJobsW
+064 stub EnumMonitorsA
+065 stub EnumMonitorsW
+066 stub EnumPortsA
+067 stub EnumPortsW
+068 stub EnumPrintProcessorDatatypesA
+069 stub EnumPrintProcessorDatatypesW
+070 stub EnumPrintProcessorsA
+071 stub EnumPrintProcessorsW
+072 stub EnumPrinterDriversA
+073 stub EnumPrinterDriversW
+074 stub EnumPrintersA
+075 stub EnumPrintersW
+076 stub ExtDeviceMode
+077 stub FindClosePrinterChangeNotification
+078 stub FindFirstPrinterChangeNotification
+079 stub FindNextPrinterChangeNotification
+080 stub FreePrinterNotifyInfo
+081 stub GetFormA
+082 stub GetFormW
+083 stub GetJobA
+084 stub GetJobW
+085 stub GetPrintProcessorDirectoryA
+086 stub GetPrintProcessorDirectoryW
+087 stub GetPrinterA
+088 stub GetPrinterDataA
+089 stub GetPrinterDataW
+090 stub GetPrinterDriverA
+091 stub GetPrinterDriverDirectoryA
+092 stub GetPrinterDriverDirectoryW
+093 stub GetPrinterDriverW
+094 stub GetPrinterW
+095 stub InitializeDll
+096 stub OpenPrinterA
+097 stub OpenPrinterW
+098 stub PlayGdiScriptOnPrinterIC
+099 stub PrinterMessageBoxA
+100 stub PrinterMessageBoxW
+101 stub PrinterProperties
+102 stub ReadPrinter
+103 stub ResetPrinterA
+104 stub ResetPrinterW
+105 stub ScheduleJob
+106 stub SetAllocFailCount
+107 stub SetFormA
+108 stub SetFormW
+109 stub SetJobA
+110 stub SetJobW
+111 stub SetPrinterA
+112 stub SetPrinterDataA
+113 stub SetPrinterDataW
+114 stub SetPrinterW
+115 stub SpoolerDevQueryPrintW
+116 stub SpoolerInit
+117 stub StartDocDlgA
+118 stub StartDocDlgW
+119 stub StartDocPrinterA
+120 stub StartDocPrinterW
+121 stub StartPagePrinter
+122 stub WaitForPrinterChange
+123 stub WritePrinter
diff --git a/include/debug.h b/include/debug.h
index 82e08eb..1d72191 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -28,6 +28,7 @@
#undef DEBUG_CLIPPING
#undef DEBUG_COMBO
#undef DEBUG_COMM
+#undef DEBUG_COMMDLG
#undef DEBUG_CURSOR
#undef DEBUG_DC
#undef DEBUG_DDE
@@ -106,6 +107,7 @@
#define DEBUG_CLIPPING
#define DEBUG_COMBO
#define DEBUG_COMM
+#define DEBUG_COMMDLG
#define DEBUG_CURSOR
#define DEBUG_DC
#define DEBUG_DDE
@@ -234,6 +236,11 @@
#else
0,
#endif
+#ifdef DEBUG_COMMDLG
+ 1,
+#else
+ 0,
+#endif
#ifdef DEBUG_CURSOR
1,
#else
@@ -713,8 +720,21 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_cursor if(!debug_msg_enabled[12]) ; else fprintf
-#define debugging_cursor debug_msg_enabled[12]
+#define dprintf_commdlg if(!debug_msg_enabled[12]) ; else fprintf
+#define debugging_commdlg debug_msg_enabled[12]
+#else
+#ifdef DEBUG_COMMDLG
+#define dprintf_commdlg fprintf
+#define debugging_commdlg 1
+#else
+#define dprintf_commdlg while(0) fprintf
+#define debugging_commdlg 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_cursor if(!debug_msg_enabled[13]) ; else fprintf
+#define debugging_cursor debug_msg_enabled[13]
#else
#ifdef DEBUG_CURSOR
#define dprintf_cursor fprintf
@@ -726,8 +746,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_dc if(!debug_msg_enabled[13]) ; else fprintf
-#define debugging_dc debug_msg_enabled[13]
+#define dprintf_dc if(!debug_msg_enabled[14]) ; else fprintf
+#define debugging_dc debug_msg_enabled[14]
#else
#ifdef DEBUG_DC
#define dprintf_dc fprintf
@@ -739,8 +759,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_dde if(!debug_msg_enabled[14]) ; else fprintf
-#define debugging_dde debug_msg_enabled[14]
+#define dprintf_dde if(!debug_msg_enabled[15]) ; else fprintf
+#define debugging_dde debug_msg_enabled[15]
#else
#ifdef DEBUG_DDE
#define dprintf_dde fprintf
@@ -752,8 +772,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_dialog if(!debug_msg_enabled[15]) ; else fprintf
-#define debugging_dialog debug_msg_enabled[15]
+#define dprintf_dialog if(!debug_msg_enabled[16]) ; else fprintf
+#define debugging_dialog debug_msg_enabled[16]
#else
#ifdef DEBUG_DIALOG
#define dprintf_dialog fprintf
@@ -765,8 +785,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_dll if(!debug_msg_enabled[16]) ; else fprintf
-#define debugging_dll debug_msg_enabled[16]
+#define dprintf_dll if(!debug_msg_enabled[17]) ; else fprintf
+#define debugging_dll debug_msg_enabled[17]
#else
#ifdef DEBUG_DLL
#define dprintf_dll fprintf
@@ -778,8 +798,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_dosfs if(!debug_msg_enabled[17]) ; else fprintf
-#define debugging_dosfs debug_msg_enabled[17]
+#define dprintf_dosfs if(!debug_msg_enabled[18]) ; else fprintf
+#define debugging_dosfs debug_msg_enabled[18]
#else
#ifdef DEBUG_DOSFS
#define dprintf_dosfs fprintf
@@ -791,8 +811,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_driver if(!debug_msg_enabled[18]) ; else fprintf
-#define debugging_driver debug_msg_enabled[18]
+#define dprintf_driver if(!debug_msg_enabled[19]) ; else fprintf
+#define debugging_driver debug_msg_enabled[19]
#else
#ifdef DEBUG_DRIVER
#define dprintf_driver fprintf
@@ -804,8 +824,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_edit if(!debug_msg_enabled[19]) ; else fprintf
-#define debugging_edit debug_msg_enabled[19]
+#define dprintf_edit if(!debug_msg_enabled[20]) ; else fprintf
+#define debugging_edit debug_msg_enabled[20]
#else
#ifdef DEBUG_EDIT
#define dprintf_edit fprintf
@@ -817,8 +837,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_enum if(!debug_msg_enabled[20]) ; else fprintf
-#define debugging_enum debug_msg_enabled[20]
+#define dprintf_enum if(!debug_msg_enabled[21]) ; else fprintf
+#define debugging_enum debug_msg_enabled[21]
#else
#ifdef DEBUG_ENUM
#define dprintf_enum fprintf
@@ -830,8 +850,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_env if(!debug_msg_enabled[21]) ; else fprintf
-#define debugging_env debug_msg_enabled[21]
+#define dprintf_env if(!debug_msg_enabled[22]) ; else fprintf
+#define debugging_env debug_msg_enabled[22]
#else
#ifdef DEBUG_ENV
#define dprintf_env fprintf
@@ -843,8 +863,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_event if(!debug_msg_enabled[22]) ; else fprintf
-#define debugging_event debug_msg_enabled[22]
+#define dprintf_event if(!debug_msg_enabled[23]) ; else fprintf
+#define debugging_event debug_msg_enabled[23]
#else
#ifdef DEBUG_EVENT
#define dprintf_event fprintf
@@ -856,8 +876,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_exec if(!debug_msg_enabled[23]) ; else fprintf
-#define debugging_exec debug_msg_enabled[23]
+#define dprintf_exec if(!debug_msg_enabled[24]) ; else fprintf
+#define debugging_exec debug_msg_enabled[24]
#else
#ifdef DEBUG_EXEC
#define dprintf_exec fprintf
@@ -869,8 +889,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_file if(!debug_msg_enabled[24]) ; else fprintf
-#define debugging_file debug_msg_enabled[24]
+#define dprintf_file if(!debug_msg_enabled[25]) ; else fprintf
+#define debugging_file debug_msg_enabled[25]
#else
#ifdef DEBUG_FILE
#define dprintf_file fprintf
@@ -882,8 +902,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_fixup if(!debug_msg_enabled[25]) ; else fprintf
-#define debugging_fixup debug_msg_enabled[25]
+#define dprintf_fixup if(!debug_msg_enabled[26]) ; else fprintf
+#define debugging_fixup debug_msg_enabled[26]
#else
#ifdef DEBUG_FIXUP
#define dprintf_fixup fprintf
@@ -895,8 +915,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_font if(!debug_msg_enabled[26]) ; else fprintf
-#define debugging_font debug_msg_enabled[26]
+#define dprintf_font if(!debug_msg_enabled[27]) ; else fprintf
+#define debugging_font debug_msg_enabled[27]
#else
#ifdef DEBUG_FONT
#define dprintf_font fprintf
@@ -908,8 +928,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_gdi if(!debug_msg_enabled[27]) ; else fprintf
-#define debugging_gdi debug_msg_enabled[27]
+#define dprintf_gdi if(!debug_msg_enabled[28]) ; else fprintf
+#define debugging_gdi debug_msg_enabled[28]
#else
#ifdef DEBUG_GDI
#define dprintf_gdi fprintf
@@ -921,8 +941,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_global if(!debug_msg_enabled[28]) ; else fprintf
-#define debugging_global debug_msg_enabled[28]
+#define dprintf_global if(!debug_msg_enabled[29]) ; else fprintf
+#define debugging_global debug_msg_enabled[29]
#else
#ifdef DEBUG_GLOBAL
#define dprintf_global fprintf
@@ -934,8 +954,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_graphics if(!debug_msg_enabled[29]) ; else fprintf
-#define debugging_graphics debug_msg_enabled[29]
+#define dprintf_graphics if(!debug_msg_enabled[30]) ; else fprintf
+#define debugging_graphics debug_msg_enabled[30]
#else
#ifdef DEBUG_GRAPHICS
#define dprintf_graphics fprintf
@@ -947,8 +967,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_hook if(!debug_msg_enabled[30]) ; else fprintf
-#define debugging_hook debug_msg_enabled[30]
+#define dprintf_hook if(!debug_msg_enabled[31]) ; else fprintf
+#define debugging_hook debug_msg_enabled[31]
#else
#ifdef DEBUG_HOOK
#define dprintf_hook fprintf
@@ -960,8 +980,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_icon if(!debug_msg_enabled[31]) ; else fprintf
-#define debugging_icon debug_msg_enabled[31]
+#define dprintf_icon if(!debug_msg_enabled[32]) ; else fprintf
+#define debugging_icon debug_msg_enabled[32]
#else
#ifdef DEBUG_ICON
#define dprintf_icon fprintf
@@ -973,8 +993,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_int if(!debug_msg_enabled[32]) ; else fprintf
-#define debugging_int debug_msg_enabled[32]
+#define dprintf_int if(!debug_msg_enabled[33]) ; else fprintf
+#define debugging_int debug_msg_enabled[33]
#else
#ifdef DEBUG_INT
#define dprintf_int fprintf
@@ -986,8 +1006,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_key if(!debug_msg_enabled[33]) ; else fprintf
-#define debugging_key debug_msg_enabled[33]
+#define dprintf_key if(!debug_msg_enabled[34]) ; else fprintf
+#define debugging_key debug_msg_enabled[34]
#else
#ifdef DEBUG_KEY
#define dprintf_key fprintf
@@ -999,8 +1019,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_keyboard if(!debug_msg_enabled[34]) ; else fprintf
-#define debugging_keyboard debug_msg_enabled[34]
+#define dprintf_keyboard if(!debug_msg_enabled[35]) ; else fprintf
+#define debugging_keyboard debug_msg_enabled[35]
#else
#ifdef DEBUG_KEYBOARD
#define dprintf_keyboard fprintf
@@ -1012,8 +1032,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_ldt if(!debug_msg_enabled[35]) ; else fprintf
-#define debugging_ldt debug_msg_enabled[35]
+#define dprintf_ldt if(!debug_msg_enabled[36]) ; else fprintf
+#define debugging_ldt debug_msg_enabled[36]
#else
#ifdef DEBUG_LDT
#define dprintf_ldt fprintf
@@ -1025,8 +1045,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_listbox if(!debug_msg_enabled[36]) ; else fprintf
-#define debugging_listbox debug_msg_enabled[36]
+#define dprintf_listbox if(!debug_msg_enabled[37]) ; else fprintf
+#define debugging_listbox debug_msg_enabled[37]
#else
#ifdef DEBUG_LISTBOX
#define dprintf_listbox fprintf
@@ -1038,8 +1058,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_local if(!debug_msg_enabled[37]) ; else fprintf
-#define debugging_local debug_msg_enabled[37]
+#define dprintf_local if(!debug_msg_enabled[38]) ; else fprintf
+#define debugging_local debug_msg_enabled[38]
#else
#ifdef DEBUG_LOCAL
#define dprintf_local fprintf
@@ -1051,8 +1071,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mci if(!debug_msg_enabled[38]) ; else fprintf
-#define debugging_mci debug_msg_enabled[38]
+#define dprintf_mci if(!debug_msg_enabled[39]) ; else fprintf
+#define debugging_mci debug_msg_enabled[39]
#else
#ifdef DEBUG_MCI
#define dprintf_mci fprintf
@@ -1064,8 +1084,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mcianim if(!debug_msg_enabled[39]) ; else fprintf
-#define debugging_mcianim debug_msg_enabled[39]
+#define dprintf_mcianim if(!debug_msg_enabled[40]) ; else fprintf
+#define debugging_mcianim debug_msg_enabled[40]
#else
#ifdef DEBUG_MCIANIM
#define dprintf_mcianim fprintf
@@ -1077,8 +1097,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mciwave if(!debug_msg_enabled[40]) ; else fprintf
-#define debugging_mciwave debug_msg_enabled[40]
+#define dprintf_mciwave if(!debug_msg_enabled[41]) ; else fprintf
+#define debugging_mciwave debug_msg_enabled[41]
#else
#ifdef DEBUG_MCIWAVE
#define dprintf_mciwave fprintf
@@ -1090,8 +1110,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mdi if(!debug_msg_enabled[41]) ; else fprintf
-#define debugging_mdi debug_msg_enabled[41]
+#define dprintf_mdi if(!debug_msg_enabled[42]) ; else fprintf
+#define debugging_mdi debug_msg_enabled[42]
#else
#ifdef DEBUG_MDI
#define dprintf_mdi fprintf
@@ -1103,8 +1123,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_menu if(!debug_msg_enabled[42]) ; else fprintf
-#define debugging_menu debug_msg_enabled[42]
+#define dprintf_menu if(!debug_msg_enabled[43]) ; else fprintf
+#define debugging_menu debug_msg_enabled[43]
#else
#ifdef DEBUG_MENU
#define dprintf_menu fprintf
@@ -1116,8 +1136,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_message if(!debug_msg_enabled[43]) ; else fprintf
-#define debugging_message debug_msg_enabled[43]
+#define dprintf_message if(!debug_msg_enabled[44]) ; else fprintf
+#define debugging_message debug_msg_enabled[44]
#else
#ifdef DEBUG_MESSAGE
#define dprintf_message fprintf
@@ -1129,8 +1149,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_metafile if(!debug_msg_enabled[44]) ; else fprintf
-#define debugging_metafile debug_msg_enabled[44]
+#define dprintf_metafile if(!debug_msg_enabled[45]) ; else fprintf
+#define debugging_metafile debug_msg_enabled[45]
#else
#ifdef DEBUG_METAFILE
#define dprintf_metafile fprintf
@@ -1142,8 +1162,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_midi if(!debug_msg_enabled[45]) ; else fprintf
-#define debugging_midi debug_msg_enabled[45]
+#define dprintf_midi if(!debug_msg_enabled[46]) ; else fprintf
+#define debugging_midi debug_msg_enabled[46]
#else
#ifdef DEBUG_MIDI
#define dprintf_midi fprintf
@@ -1155,8 +1175,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mmio if(!debug_msg_enabled[46]) ; else fprintf
-#define debugging_mmio debug_msg_enabled[46]
+#define dprintf_mmio if(!debug_msg_enabled[47]) ; else fprintf
+#define debugging_mmio debug_msg_enabled[47]
#else
#ifdef DEBUG_MMIO
#define dprintf_mmio fprintf
@@ -1168,8 +1188,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mmsys if(!debug_msg_enabled[47]) ; else fprintf
-#define debugging_mmsys debug_msg_enabled[47]
+#define dprintf_mmsys if(!debug_msg_enabled[48]) ; else fprintf
+#define debugging_mmsys debug_msg_enabled[48]
#else
#ifdef DEBUG_MMSYS
#define dprintf_mmsys fprintf
@@ -1181,8 +1201,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_mmtime if(!debug_msg_enabled[48]) ; else fprintf
-#define debugging_mmtime debug_msg_enabled[48]
+#define dprintf_mmtime if(!debug_msg_enabled[49]) ; else fprintf
+#define debugging_mmtime debug_msg_enabled[49]
#else
#ifdef DEBUG_MMTIME
#define dprintf_mmtime fprintf
@@ -1194,8 +1214,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_module if(!debug_msg_enabled[49]) ; else fprintf
-#define debugging_module debug_msg_enabled[49]
+#define dprintf_module if(!debug_msg_enabled[50]) ; else fprintf
+#define debugging_module debug_msg_enabled[50]
#else
#ifdef DEBUG_MODULE
#define dprintf_module fprintf
@@ -1207,8 +1227,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_msg if(!debug_msg_enabled[50]) ; else fprintf
-#define debugging_msg debug_msg_enabled[50]
+#define dprintf_msg if(!debug_msg_enabled[51]) ; else fprintf
+#define debugging_msg debug_msg_enabled[51]
#else
#ifdef DEBUG_MSG
#define dprintf_msg fprintf
@@ -1220,8 +1240,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_nonclient if(!debug_msg_enabled[51]) ; else fprintf
-#define debugging_nonclient debug_msg_enabled[51]
+#define dprintf_nonclient if(!debug_msg_enabled[52]) ; else fprintf
+#define debugging_nonclient debug_msg_enabled[52]
#else
#ifdef DEBUG_NONCLIENT
#define dprintf_nonclient fprintf
@@ -1233,8 +1253,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_ole if(!debug_msg_enabled[52]) ; else fprintf
-#define debugging_ole debug_msg_enabled[52]
+#define dprintf_ole if(!debug_msg_enabled[53]) ; else fprintf
+#define debugging_ole debug_msg_enabled[53]
#else
#ifdef DEBUG_OLE
#define dprintf_ole fprintf
@@ -1246,8 +1266,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_palette if(!debug_msg_enabled[53]) ; else fprintf
-#define debugging_palette debug_msg_enabled[53]
+#define dprintf_palette if(!debug_msg_enabled[54]) ; else fprintf
+#define debugging_palette debug_msg_enabled[54]
#else
#ifdef DEBUG_PALETTE
#define dprintf_palette fprintf
@@ -1259,8 +1279,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_profile if(!debug_msg_enabled[54]) ; else fprintf
-#define debugging_profile debug_msg_enabled[54]
+#define dprintf_profile if(!debug_msg_enabled[55]) ; else fprintf
+#define debugging_profile debug_msg_enabled[55]
#else
#ifdef DEBUG_PROFILE
#define dprintf_profile fprintf
@@ -1272,8 +1292,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_prop if(!debug_msg_enabled[55]) ; else fprintf
-#define debugging_prop debug_msg_enabled[55]
+#define dprintf_prop if(!debug_msg_enabled[56]) ; else fprintf
+#define debugging_prop debug_msg_enabled[56]
#else
#ifdef DEBUG_PROP
#define dprintf_prop fprintf
@@ -1285,8 +1305,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_reg if(!debug_msg_enabled[56]) ; else fprintf
-#define debugging_reg debug_msg_enabled[56]
+#define dprintf_reg if(!debug_msg_enabled[57]) ; else fprintf
+#define debugging_reg debug_msg_enabled[57]
#else
#ifdef DEBUG_REG
#define dprintf_reg fprintf
@@ -1298,8 +1318,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_region if(!debug_msg_enabled[57]) ; else fprintf
-#define debugging_region debug_msg_enabled[57]
+#define dprintf_region if(!debug_msg_enabled[58]) ; else fprintf
+#define debugging_region debug_msg_enabled[58]
#else
#ifdef DEBUG_REGION
#define dprintf_region fprintf
@@ -1311,8 +1331,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_relay if(!debug_msg_enabled[58]) ; else fprintf
-#define debugging_relay debug_msg_enabled[58]
+#define dprintf_relay if(!debug_msg_enabled[59]) ; else fprintf
+#define debugging_relay debug_msg_enabled[59]
#else
#ifdef DEBUG_RELAY
#define dprintf_relay fprintf
@@ -1324,8 +1344,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_resource if(!debug_msg_enabled[59]) ; else fprintf
-#define debugging_resource debug_msg_enabled[59]
+#define dprintf_resource if(!debug_msg_enabled[60]) ; else fprintf
+#define debugging_resource debug_msg_enabled[60]
#else
#ifdef DEBUG_RESOURCE
#define dprintf_resource fprintf
@@ -1337,8 +1357,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_scroll if(!debug_msg_enabled[60]) ; else fprintf
-#define debugging_scroll debug_msg_enabled[60]
+#define dprintf_scroll if(!debug_msg_enabled[61]) ; else fprintf
+#define debugging_scroll debug_msg_enabled[61]
#else
#ifdef DEBUG_SCROLL
#define dprintf_scroll fprintf
@@ -1350,8 +1370,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_selector if(!debug_msg_enabled[61]) ; else fprintf
-#define debugging_selector debug_msg_enabled[61]
+#define dprintf_selector if(!debug_msg_enabled[62]) ; else fprintf
+#define debugging_selector debug_msg_enabled[62]
#else
#ifdef DEBUG_SELECTOR
#define dprintf_selector fprintf
@@ -1363,8 +1383,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_sem if(!debug_msg_enabled[62]) ; else fprintf
-#define debugging_sem debug_msg_enabled[62]
+#define dprintf_sem if(!debug_msg_enabled[63]) ; else fprintf
+#define debugging_sem debug_msg_enabled[63]
#else
#ifdef DEBUG_SEM
#define dprintf_sem fprintf
@@ -1376,8 +1396,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_shm if(!debug_msg_enabled[63]) ; else fprintf
-#define debugging_shm debug_msg_enabled[63]
+#define dprintf_shm if(!debug_msg_enabled[64]) ; else fprintf
+#define debugging_shm debug_msg_enabled[64]
#else
#ifdef DEBUG_SHM
#define dprintf_shm fprintf
@@ -1389,8 +1409,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_stress if(!debug_msg_enabled[64]) ; else fprintf
-#define debugging_stress debug_msg_enabled[64]
+#define dprintf_stress if(!debug_msg_enabled[65]) ; else fprintf
+#define debugging_stress debug_msg_enabled[65]
#else
#ifdef DEBUG_STRESS
#define dprintf_stress fprintf
@@ -1402,8 +1422,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_syscolor if(!debug_msg_enabled[65]) ; else fprintf
-#define debugging_syscolor debug_msg_enabled[65]
+#define dprintf_syscolor if(!debug_msg_enabled[66]) ; else fprintf
+#define debugging_syscolor debug_msg_enabled[66]
#else
#ifdef DEBUG_SYSCOLOR
#define dprintf_syscolor fprintf
@@ -1415,8 +1435,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_task if(!debug_msg_enabled[66]) ; else fprintf
-#define debugging_task debug_msg_enabled[66]
+#define dprintf_task if(!debug_msg_enabled[67]) ; else fprintf
+#define debugging_task debug_msg_enabled[67]
#else
#ifdef DEBUG_TASK
#define dprintf_task fprintf
@@ -1428,8 +1448,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_text if(!debug_msg_enabled[67]) ; else fprintf
-#define debugging_text debug_msg_enabled[67]
+#define dprintf_text if(!debug_msg_enabled[68]) ; else fprintf
+#define debugging_text debug_msg_enabled[68]
#else
#ifdef DEBUG_TEXT
#define dprintf_text fprintf
@@ -1441,8 +1461,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_timer if(!debug_msg_enabled[68]) ; else fprintf
-#define debugging_timer debug_msg_enabled[68]
+#define dprintf_timer if(!debug_msg_enabled[69]) ; else fprintf
+#define debugging_timer debug_msg_enabled[69]
#else
#ifdef DEBUG_TIMER
#define dprintf_timer fprintf
@@ -1454,8 +1474,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_toolhelp if(!debug_msg_enabled[69]) ; else fprintf
-#define debugging_toolhelp debug_msg_enabled[69]
+#define dprintf_toolhelp if(!debug_msg_enabled[70]) ; else fprintf
+#define debugging_toolhelp debug_msg_enabled[70]
#else
#ifdef DEBUG_TOOLHELP
#define dprintf_toolhelp fprintf
@@ -1467,8 +1487,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_utility if(!debug_msg_enabled[70]) ; else fprintf
-#define debugging_utility debug_msg_enabled[70]
+#define dprintf_utility if(!debug_msg_enabled[71]) ; else fprintf
+#define debugging_utility debug_msg_enabled[71]
#else
#ifdef DEBUG_UTILITY
#define dprintf_utility fprintf
@@ -1480,8 +1500,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_vxd if(!debug_msg_enabled[71]) ; else fprintf
-#define debugging_vxd debug_msg_enabled[71]
+#define dprintf_vxd if(!debug_msg_enabled[72]) ; else fprintf
+#define debugging_vxd debug_msg_enabled[72]
#else
#ifdef DEBUG_VXD
#define dprintf_vxd fprintf
@@ -1493,8 +1513,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_win if(!debug_msg_enabled[72]) ; else fprintf
-#define debugging_win debug_msg_enabled[72]
+#define dprintf_win if(!debug_msg_enabled[73]) ; else fprintf
+#define debugging_win debug_msg_enabled[73]
#else
#ifdef DEBUG_WIN
#define dprintf_win fprintf
@@ -1506,8 +1526,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_win32 if(!debug_msg_enabled[73]) ; else fprintf
-#define debugging_win32 debug_msg_enabled[73]
+#define dprintf_win32 if(!debug_msg_enabled[74]) ; else fprintf
+#define debugging_win32 debug_msg_enabled[74]
#else
#ifdef DEBUG_WIN32
#define dprintf_win32 fprintf
@@ -1519,8 +1539,8 @@
#endif
#ifdef DEBUG_RUNTIME
-#define dprintf_winsock if(!debug_msg_enabled[74]) ; else fprintf
-#define debugging_winsock debug_msg_enabled[74]
+#define dprintf_winsock if(!debug_msg_enabled[75]) ; else fprintf
+#define debugging_winsock debug_msg_enabled[75]
#else
#ifdef DEBUG_WINSOCK
#define dprintf_winsock fprintf
@@ -1547,6 +1567,7 @@
"clipping",
"combo",
"comm",
+ "commdlg",
"cursor",
"dc",
"dde",
diff --git a/include/dialog.h b/include/dialog.h
index 772074e..2eb2d8f 100644
--- a/include/dialog.h
+++ b/include/dialog.h
@@ -70,4 +70,7 @@
#pragma pack(4)
+extern WORD xBaseUnit,yBaseUnit;
+int DIALOG_DoDialogBox( HWND hwnd, HWND owner );
+
#endif /* DIALOG_H */
diff --git a/include/file.h b/include/file.h
index 1c585a4..9a4e0e4 100644
--- a/include/file.h
+++ b/include/file.h
@@ -10,7 +10,7 @@
#include "windows.h"
extern void FILE_SetDosError(void);
-extern int FILE_GetUnixHandle( HFILE handle );
+extern int FILE_GetUnixTaskHandle( 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 );
@@ -24,6 +24,7 @@
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 LONG FILE_Read( HFILE hFile, LPSTR buffer, LONG count );
extern INT _lcreat_uniq( LPCSTR path, INT attr );
#endif /* __WINE_FILE_H */
diff --git a/include/gdi.h b/include/gdi.h
index a8f1899..16a631c 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -26,6 +26,7 @@
#define META_DC_MAGIC 0x4f4f
#define METAFILE_MAGIC 0x4f50
#define METAFILE_DC_MAGIC 0x4f51
+#define MAGIC_DONTCARE 0xffff
#ifndef WINELIB
#pragma pack(1)
diff --git a/include/handle32.h b/include/handle32.h
index e6d07a7..08ab132 100644
--- a/include/handle32.h
+++ b/include/handle32.h
@@ -2,6 +2,7 @@
#define __WINE_HANDLE32_H
#include <malloc.h>
+#include "wintypes.h"
/* The _*_OBJECT structures contain information needed about each
* particular type of handle. This information is a combination of
@@ -61,6 +62,31 @@
KERNEL_OBJECT common;
} REGKEY_OBJECT;
+typedef struct _VRANGE_OBJECT{
+ KERNEL_OBJECT common;
+ DWORD start;
+ DWORD size;
+ struct _VRANGE_OBJECT *next;
+} VRANGE_OBJECT;
+
+struct _HEAPITEM_OBJECT;
+typedef struct{
+ KERNEL_OBJECT common;
+ LPVOID start;
+ DWORD size;
+ DWORD maximum;
+ DWORD flags;
+ struct _HEAPITEM_OBJECT *first,*last;
+} HEAP_OBJECT;
+
+typedef struct _HEAPITEM_OBJECT{
+ KERNEL_OBJECT common;
+ HEAP_OBJECT *heap;
+ DWORD size; /* size including header */
+ struct _HEAPITEM_OBJECT *next,*prev;
+} HEAPITEM_OBJECT;
+
+
/* Object number definitions. These numbers are used to
* validate the kernel object by comparison against the
* object's 'magic' value.
@@ -73,6 +99,9 @@
#define KERNEL_OBJECT_EVENT (KERNEL_OBJECT_UNUSED + 5)
#define KERNEL_OBJECT_REGKEY (KERNEL_OBJECT_UNUSED + 6)
#define KERNEL_OBJECT_FILEMAP (KERNEL_OBJECT_UNUSED + 7)
+#define KERNEL_OBJECT_VRANGE (KERNEL_OBJECT_UNUSED + 8)
+#define KERNEL_OBJECT_HEAP (KERNEL_OBJECT_UNUSED + 9)
+#define KERNEL_OBJECT_HEAPITEM (KERNEL_OBJECT_UNUSED + 10)
/* Define the invalid handle value
*/
diff --git a/include/miscemu.h b/include/miscemu.h
index 33d7648..af6b061 100644
--- a/include/miscemu.h
+++ b/include/miscemu.h
@@ -12,6 +12,7 @@
/* miscemu/dosmem.c */
extern BOOL DOSMEM_Init(void);
+extern void DOSMEM_Alarm(void);
extern void DOSMEM_FillBiosSegment(void);
extern HANDLE DOSMEM_BiosSeg;
diff --git a/include/msdos.h b/include/msdos.h
index e399be1..094c680 100644
--- a/include/msdos.h
+++ b/include/msdos.h
@@ -5,21 +5,6 @@
#include <windows.h>
#include "comm.h"
-#define WINE_PATH_LENGTH 256
-struct dosdirent {
- int inuse;
- DIR *ds;
- char unixpath[WINE_PATH_LENGTH];
- char filename[WINE_PATH_LENGTH];
- char filemask[13];
- char attribute;
- char search_attribute;
- long filesize;
- long filetime;
- short entnum; /* Directory entry number */
- struct dosdirent *next;
-};
-
struct fcb {
BYTE drive;
char name[8];
@@ -48,6 +33,26 @@
char filename[13]; /* 1e file name + extension */
} FINDFILE_DTA;
+/* FCB layout for FindFirstFCB/FindNextFCB */
+typedef struct
+{
+ BYTE drive; /* 00 drive letter */
+ char filename[11]; /* 01 filename 8+3 format */
+ int count; /* 0c entry count (was: reserved) */
+ char *unixPath; /* 10 unix path (was: reserved) */
+} FINDFILE_FCB;
+
+/* DOS directory entry for FindFirstFCB/FindNextFCB */
+typedef struct
+{
+ char filename[11]; /* 00 filename 8+3 format */
+ BYTE fileattr; /* 0b file attributes */
+ BYTE reserved[10]; /* 0c reserved */
+ WORD filetime; /* 16 file time */
+ WORD filedate; /* 18 file date */
+ WORD cluster; /* 1a file first cluster */
+ DWORD filesize; /* 1c file size */
+} DOS_DIRENTRY_LAYOUT;
#define DOSVERSION 0x1606 /* Major version in low byte: DOS 6.22 */
#define WINDOSVER 0x0616 /* Windows reports the DOS version reversed */
@@ -55,8 +60,6 @@
#define MAX_DOS_DRIVES 26
-extern WORD ExtendedError;
-extern BYTE ErrorClass, Action, ErrorLocus;
extern struct DosDeviceStruct COM[MAX_PORTS];
extern struct DosDeviceStruct LPT[MAX_PORTS];
diff --git a/include/options.h b/include/options.h
index 684aa6b..a646908 100644
--- a/include/options.h
+++ b/include/options.h
@@ -16,7 +16,8 @@
LANG_No, /* Norwegian */
LANG_Fr, /* French */
LANG_Fi, /* Finnish */
- LANG_Da /* Danish */
+ LANG_Da, /* Danish */
+ LANG_Cz /* Czech */
} WINE_LANGUAGE;
struct options
diff --git a/include/pe_image.h b/include/pe_image.h
index 220f5b2..944d2ff 100644
--- a/include/pe_image.h
+++ b/include/pe_image.h
@@ -1,6 +1,7 @@
#ifndef __WINE_PE_IMAGE_H
#define __WINE_PE_IMAGE_H
+#include <sys/types.h>
#include "windows.h"
struct pe_data {
@@ -16,6 +17,21 @@
int resource_offset; /* offset to resource typedirectory in file */
};
+typedef struct _WIN32_function{
+ char *name;
+ void *definition;
+} WIN32_function;
+
+typedef struct _WIN32_builtin{
+ char *name;
+ WIN32_function *functions;
+ int size;
+ int base;
+ struct _WIN32_builtin *next;
+} WIN32_builtin;
+
+extern WIN32_builtin *WIN32_builtin_list;
+
struct w_files
{
struct w_files * next;
@@ -29,6 +45,7 @@
struct pe_data *pe;
OFSTRUCT ofs;
unsigned int load_addr;
+ WIN32_builtin* builtin;
};
@@ -38,18 +55,4 @@
extern void my_wcstombs(char * result, u_short * source, int len);
extern struct w_files *wine_files;
-typedef struct _WIN32_function{
- char *name;
- void *definition;
-} WIN32_function;
-
-typedef struct _WIN32_builtin{
- char *name;
- WIN32_function *functions;
- int size;
- struct _WIN32_builtin *next;
-} WIN32_builtin;
-
-extern WIN32_builtin *WIN32_builtin_list;
-
#endif /* __WINE_PE_IMAGE_H */
diff --git a/include/relay32.h b/include/relay32.h
index 2736089..0fd7680 100644
--- a/include/relay32.h
+++ b/include/relay32.h
@@ -4,8 +4,13 @@
* Copyright 1995 Martin von Loewis
*/
+#ifndef _RELAY32_H
+#define _RELAY32_H
+#include "pe_image.h"
+
void RELAY32_Unimplemented(char *dll, int item);
-void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint);
+WIN32_builtin *RELAY32_GetBuiltinDLL(char *name);
+void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint);
LONG RELAY32_CallWindowProc(WNDPROC,int,int,int,int);
void RELAY32_DebugEnter(char *dll,char *name);
@@ -58,3 +63,5 @@
BOOL USER32_GetMessageA(struct WIN32_MSG* lpmsg,DWORD hwnd,DWORD min,DWORD max);
HDC USER32_BeginPaint(DWORD hwnd,struct WIN32_PAINTSTRUCT *lpps);
BOOL USER32_EndPaint(DWORD hwnd,struct WIN32_PAINTSTRUCT *lpps);
+#endif
+
diff --git a/include/resource32.h b/include/resource32.h
index bcddc21..c47d50e 100644
--- a/include/resource32.h
+++ b/include/resource32.h
@@ -10,7 +10,7 @@
#include <stddef.h>
-HANDLE32 FindResource32( HINSTANCE hModule, LPCTSTR name, LPCTSTR type );
+HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type );
HANDLE32 LoadResource32( HINSTANCE hModule, HANDLE32 hRsrc );
LPVOID LockResource32( HANDLE32 handle );
BOOL FreeResource32( HANDLE32 handle );
@@ -45,4 +45,9 @@
WCHAR NameString[1];
} IMAGE_RESOURCE_DIR_STRING_U, *PIMAGE_RESOURCE_DIR_STRING_U;
+HMENU WIN32_LoadMenuIndirectW(void *menu);
+HMENU WIN32_LoadMenuW(HANDLE instance, LPCWSTR name);
+HMENU WIN32_LoadMenuIndirectA(void *menu);
+HMENU WIN32_LoadMenuA(HANDLE instance,LPCSTR name);
+
#endif /* __WINE_RESOURCE32_H */
diff --git a/include/stddebug.h b/include/stddebug.h
index 54cc9d2..452812a 100644
--- a/include/stddebug.h
+++ b/include/stddebug.h
@@ -88,6 +88,7 @@
#undef DEBUG_CLIPPING
#undef DEBUG_COMBO
#undef DEBUG_COMM
+#undef DEBUG_COMMDLG
#undef DEBUG_CURSOR
#undef DEBUG_DC
#undef DEBUG_DDE
@@ -166,6 +167,7 @@
#define DEBUG_CLIPPING
#define DEBUG_COMBO
#define DEBUG_COMM
+#define DEBUG_COMMDLG
#define DEBUG_CURSOR
#define DEBUG_DC
#define DEBUG_DDE
diff --git a/include/string32.h b/include/string32.h
index b598c0e..a50bb01 100644
--- a/include/string32.h
+++ b/include/string32.h
@@ -13,8 +13,10 @@
int STRING32_UniLen(LPWSTR s);
void STRING32_UniToAnsi(LPSTR dest,LPCWSTR src);
void STRING32_AnsiToUni(LPWSTR dest,LPCSTR src);
-LPSTR STRING32_DupUniToAnsi(LPWSTR src);
-LPWSTR STRING32_DupAnsiToUni(LPSTR src);
-LPWSTR STRING32_lstrcmpnW(LPCWSTR a,LPCWSTR b,DWORD len);
+LPSTR STRING32_DupUniToAnsi(LPCWSTR src);
+LPWSTR STRING32_DupAnsiToUni(LPCSTR src);
+int STRING32_lstrcmpnW(LPCWSTR a,LPCWSTR b,DWORD len);
+int STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len);
+DWORD STRING32_lstrlenW(LPCWSTR);
#endif
diff --git a/include/struct32.h b/include/struct32.h
index f9394cd..a7d4dfa 100644
--- a/include/struct32.h
+++ b/include/struct32.h
@@ -22,4 +22,26 @@
void PARAM32_POINT32to16(const POINT32*,POINT*);
void PARAM32_POINT16to32(const POINT*,POINT32*);
+typedef struct {
+ DWORD style;
+ DWORD dwExtendedStyle;
+ WORD noOfItems;
+ short x;
+ short y;
+ WORD cx;
+ WORD cy;
+} DLGTEMPLATE32;
+
+typedef struct {
+ DWORD style;
+ DWORD dwExtendedStyle;
+ short x;
+ short y;
+ short cx;
+ short cy;
+ WORD id;
+} DLGITEMTEMPLATE32;
+
+#define CW_USEDEFAULT32 0x80000000
+
#endif
diff --git a/include/win.h b/include/win.h
index f5f7ba1..37184a7 100644
--- a/include/win.h
+++ b/include/win.h
@@ -60,14 +60,15 @@
} WND;
/* WND flags values */
-#define WIN_NEEDS_BEGINPAINT 0x01 /* WM_PAINT sent to window */
-#define WIN_NEEDS_ERASEBKGND 0x02 /* WM_ERASEBKGND must be sent to window*/
-#define WIN_NEEDS_NCPAINT 0x04 /* WM_NCPAINT must be sent to window */
-#define WIN_RESTORE_MAX 0x08 /* Maximize when restoring */
-#define WIN_INTERNAL_PAINT 0x10 /* Internal WM_PAINT message pending */
-#define WIN_NO_REDRAW 0x20 /* WM_SETREDRAW called for this window */
-#define WIN_GOT_SIZEMSG 0x40 /* WM_SIZE has been sent to the window */
-#define WIN_NCACTIVATED 0x80 /* last WM_NCACTIVATE was positive */
+#define WIN_NEEDS_BEGINPAINT 0x0001 /* WM_PAINT sent to window */
+#define WIN_NEEDS_ERASEBKGND 0x0002 /* WM_ERASEBKGND must be sent to window*/
+#define WIN_NEEDS_NCPAINT 0x0004 /* WM_NCPAINT must be sent to window */
+#define WIN_RESTORE_MAX 0x0008 /* Maximize when restoring */
+#define WIN_INTERNAL_PAINT 0x0010 /* Internal WM_PAINT message pending */
+#define WIN_NO_REDRAW 0x0020 /* WM_SETREDRAW called for this window */
+#define WIN_GOT_SIZEMSG 0x0040 /* WM_SIZE has been sent to the window */
+#define WIN_NCACTIVATED 0x0080 /* last WM_NCACTIVATE was positive */
+#define WIN_MANAGED 0x0100 /* Window managed by the X wm */
#define WIN_CLASS_INFO(wndPtr) (CLASS_FindClassPtr((wndPtr)->hClass)->wc)
#define WIN_CLASS_STYLE(wndPtr) (WIN_CLASS_INFO(wndPtr).style)
diff --git a/include/windows.h b/include/windows.h
index 0e2ce32..22a0cd2 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -10,23 +10,14 @@
#endif
#ifdef WINELIB32
-typedef struct { LONG x,y; } POINT;
typedef struct { SHORT x,y; } POINTS;
-typedef struct { LONG cx,cy; } SIZE, *LPSIZE;
-typedef struct { LONG left, top, right, bottom; } RECT;
#define MAKEPOINTS(l) (*((POINTS *)&(l)))
#else
-typedef struct { INT x,y; } POINT;
-typedef struct { INT cx,cy; } SIZE, *LPSIZE;
-typedef struct { INT left, top, right, bottom; } RECT;
#define MAKEPOINT(l) (*((POINT *)&(l)))
#endif
-typedef POINT *PPOINT;
-typedef POINT *NPPOINT;
-typedef POINT *LPPOINT;
-typedef RECT *LPRECT;
-typedef RECT *NPRECT;
-typedef RECT *PRECT;
+typedef struct { INT cx,cy; } SIZE, *LPSIZE;
+typedef struct { INT x,y; } POINT, *PPOINT, *NPPOINT, *LPPOINT;
+typedef struct { INT left, top, right, bottom; } RECT, *LPRECT;
#ifdef WINELIB32
#define MAKEWPARAM(low, high) ((LONG)(((WORD)(low)) | \
@@ -1751,32 +1742,33 @@
#define TPM_CENTERALIGN 0x0004
#define TPM_RIGHTALIGN 0x0008
-#define MF_INSERT 0
-#define MF_CHANGE 0x0080
-#define MF_APPEND 0x0100
-#define MF_DELETE 0x0200
-#define MF_REMOVE 0x1000
-#define MF_BYCOMMAND 0
-#define MF_BYPOSITION 0x0400
-#define MF_SEPARATOR 0x0800
-#define MF_ENABLED 0
-#define MF_GRAYED 0x0001
-#define MF_DISABLED 0x0002
-#define MF_UNCHECKED 0
-#define MF_CHECKED 0x0008
+#define MF_INSERT 0x0000
+#define MF_CHANGE 0x0080
+#define MF_APPEND 0x0100
+#define MF_DELETE 0x0200
+#define MF_REMOVE 0x1000
+#define MF_END 0x0080
+
+#define MF_ENABLED 0x0000
+#define MF_GRAYED 0x0001
+#define MF_DISABLED 0x0002
+#define MF_STRING 0x0000
+#define MF_BITMAP 0x0004
+#define MF_UNCHECKED 0x0000
+#define MF_CHECKED 0x0008
+#define MF_POPUP 0x0010
+#define MF_MENUBARBREAK 0x0020
+#define MF_MENUBREAK 0x0040
+#define MF_UNHILITE 0x0000
+#define MF_HILITE 0x0080
+#define MF_OWNERDRAW 0x0100
#define MF_USECHECKBITMAPS 0x0200
-#define MF_STRING 0
-#define MF_BITMAP 0x0004
-#define MF_OWNERDRAW 0x0100
-#define MF_POPUP 0x0010
-#define MF_MENUBARBREAK 0x0020
-#define MF_MENUBREAK 0x0040
-#define MF_UNHILITE 0
-#define MF_HILITE 0x0080
-#define MF_SYSMENU 0x2000
-#define MF_HELP 0x4000
-#define MF_MOUSESELECT 0x8000
-#define MF_END 0x0080
+#define MF_BYCOMMAND 0x0000
+#define MF_BYPOSITION 0x0400
+#define MF_SEPARATOR 0x0800
+#define MF_SYSMENU 0x2000
+#define MF_HELP 0x4000
+#define MF_MOUSESELECT 0x8000
#ifndef NOWINOFFSETS
#define GCW_HBRBACKGROUND (-10)
@@ -2566,6 +2558,35 @@
#define HELP_MULTIKEY 0x0201
#define HELP_SETWINPOS 0x0203
+typedef struct {
+ TCHAR dmDeviceName[32];
+ WORD dmSpecVersion;
+ WORD dmDriverVersion;
+ WORD dmSize;
+ WORD dmDriverExtra;
+ DWORD dmFields;
+ short dmOrientation;
+ short dmPaperSize;
+ short dmPaperLength;
+ short dmPaperWidth;
+ short dmScale;
+ short dmCopies;
+ short dmDefaultSource;
+ short dmPrintQuality;
+ short dmColor;
+ short dmDuplex;
+ short dmYResolution;
+ short dmTTOption;
+ short dmCollate;
+ TCHAR dmFormName[32];
+ WORD dmUnusedPadding;
+ WORD dmBitsPerPel;
+ DWORD dmPelsWidth;
+ DWORD dmPelsHeight;
+ DWORD dmDisplayFlags;
+ DWORD dmDisplayFrequency;
+} DEVMODE;
+
#ifndef WINELIB
#pragma pack(4)
#endif
@@ -2638,95 +2659,95 @@
BOOL CreateCaret(HWND,HBITMAP,INT,INT);
HBITMAP CreateCompatibleBitmap(HDC,INT,INT);
HDC CreateCompatibleDC(HDC);
-HCURSOR CreateCursor(HANDLE,INT,INT,INT,INT,LPVOID,LPVOID);
-HANDLE CreateCursorIconIndirect(HANDLE,CURSORICONINFO*,LPSTR,LPSTR);
-HDC CreateDC(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
+HCURSOR CreateCursor(HANDLE,INT,INT,INT,INT,const BYTE*,const BYTE*);
+HANDLE CreateCursorIconIndirect(HANDLE,CURSORICONINFO*,const BYTE*,const BYTE*);
+HDC CreateDC(LPCTSTR,LPCTSTR,LPCTSTR,const DEVMODE*);
HBRUSH CreateDIBPatternBrush(HGLOBAL,UINT);
HBITMAP CreateDIBitmap(HDC,BITMAPINFOHEADER*,DWORD,LPVOID,BITMAPINFO*,UINT);
-HWND CreateDialog(HANDLE,SEGPTR,HWND,DLGPROC);
-HWND CreateDialogIndirect(HANDLE,SEGPTR,HWND,DLGPROC);
-HWND CreateDialogIndirectParam(HANDLE,SEGPTR,HWND,DLGPROC,LPARAM);
-HWND CreateDialogParam(HANDLE,SEGPTR,HWND,DLGPROC,LPARAM);
+HWND CreateDialog(HINSTANCE,SEGPTR,HWND,DLGPROC);
+HWND CreateDialogIndirect(HINSTANCE,SEGPTR,HWND,DLGPROC);
+HWND CreateDialogIndirectParam(HINSTANCE,SEGPTR,HWND,DLGPROC,LPARAM);
+HWND CreateDialogParam(HINSTANCE,SEGPTR,HWND,DLGPROC,LPARAM);
HBITMAP CreateDiscardableBitmap(HDC,INT,INT);
HRGN CreateEllipticRgn(INT,INT,INT,INT);
HRGN CreateEllipticRgnIndirect(LPRECT);
HFONT CreateFont(INT,INT,INT,INT,INT,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,LPCSTR);
HFONT CreateFontIndirect(const LOGFONT*);
HBRUSH CreateHatchBrush(INT,COLORREF);
-HDC CreateIC(LPSTR,LPSTR,LPSTR,LPSTR);
-HICON CreateIcon(HANDLE,INT,INT,BYTE,BYTE,LPSTR,LPSTR);
+HDC CreateIC(LPCTSTR,LPCTSTR,LPCTSTR,const DEVMODE*);
+HICON CreateIcon(HINSTANCE,INT,INT,BYTE,BYTE,const BYTE*,const BYTE*);
HMENU CreateMenu(void);
-HANDLE CreateMetaFile(LPSTR);
-HPALETTE CreatePalette(LPLOGPALETTE);
+HDC CreateMetaFile(LPCTSTR);
+HPALETTE CreatePalette(const LOGPALETTE*);
HBRUSH CreatePatternBrush(HBITMAP);
HPEN CreatePen(INT,INT,COLORREF);
-HPEN CreatePenIndirect(LOGPEN*);
-HRGN CreatePolyPolygonRgn(LPPOINT,LPINT,INT,INT);
-HRGN CreatePolygonRgn(LPPOINT,INT,INT);
+HPEN CreatePenIndirect(const LOGPEN*);
+HRGN CreatePolyPolygonRgn(const POINT*,const INT*,INT,INT);
+HRGN CreatePolygonRgn(const POINT*,INT,INT);
HMENU CreatePopupMenu(void);
-HRGN CreateRectRgn(short,short,short,short);
-HRGN CreateRectRgnIndirect(LPRECT);
-HRGN CreateRoundRectRgn(short,short,short,short,short,short);
-HBRUSH CreateSolidBrush(DWORD);
+HRGN CreateRectRgn(INT,INT,INT,INT);
+HRGN CreateRectRgnIndirect(const RECT*);
+HRGN CreateRoundRectRgn(INT,INT,INT,INT,INT,INT);
+HBRUSH CreateSolidBrush(COLORREF);
HWND CreateWindow(SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
HWND CreateWindowEx(DWORD,SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
-BOOL DPtoLP(HDC,LPPOINT,int);
+BOOL DPtoLP(HDC,LPPOINT,INT);
void DebugBreak(void);
-LONG DefDlgProc(HWND,UINT,WPARAM,LPARAM);
-LONG DefFrameProc(HWND,HWND,UINT,WPARAM,LPARAM);
+LRESULT DefDlgProc(HWND,UINT,WPARAM,LPARAM);
+LRESULT DefFrameProc(HWND,HWND,UINT,WPARAM,LPARAM);
DWORD DefHookProc(short,WORD,DWORD,HHOOK*);
-LONG DefMDIChildProc(HWND,UINT,WPARAM,LPARAM);
+LRESULT DefMDIChildProc(HWND,UINT,WPARAM,LPARAM);
LRESULT DefWindowProc(HWND,UINT,WPARAM,LPARAM);
-HDWP DeferWindowPos(HDWP,HWND,HWND,INT,INT,INT,INT,WORD);
+HDWP DeferWindowPos(HDWP,HWND,HWND,INT,INT,INT,INT,UINT);
ATOM DeleteAtom(ATOM);
BOOL DeleteDC(HDC);
BOOL DeleteMenu(HMENU,UINT,UINT);
BOOL DeleteMetaFile(HMETAFILE);
-BOOL DeleteObject(HANDLE);
-void DestroyCaret(void);
+BOOL DeleteObject(HGDIOBJ);
+BOOL DestroyCaret(void);
BOOL DestroyCursor(HCURSOR);
BOOL DestroyIcon(HICON);
BOOL DestroyMenu(HMENU);
BOOL DestroyWindow(HWND);
-int DialogBox(HINSTANCE,SEGPTR,HWND,WNDPROC);
-int DialogBoxIndirect(HANDLE,HANDLE,HWND,WNDPROC);
-int DialogBoxIndirectParam(HANDLE,HANDLE,HWND,WNDPROC,LONG);
-int DialogBoxParam(HANDLE,SEGPTR,HWND,WNDPROC,LONG);
+INT DialogBox(HINSTANCE,SEGPTR,HWND,DLGPROC);
+INT DialogBoxIndirect(HINSTANCE,HANDLE,HWND,DLGPROC);
+INT DialogBoxIndirectParam(HINSTANCE,HANDLE,HWND,DLGPROC,LONG);
+INT DialogBoxParam(HINSTANCE,SEGPTR,HWND,DLGPROC,LONG);
HANDLE DirectResAlloc(HANDLE,WORD,WORD);
void DirectedYield(HTASK);
-LONG DispatchMessage(LPMSG);
-INT DlgDirList(HWND,SEGPTR,INT,INT,WORD);
-INT DlgDirListComboBox(HWND,SEGPTR,INT,INT,WORD);
-BOOL DlgDirSelect(HWND,LPSTR,int);
-BOOL DlgDirSelectComboBox(HWND,LPSTR,int);
+LONG DispatchMessage(const MSG*);
+INT DlgDirList(HWND,SEGPTR,INT,INT,UINT);
+INT DlgDirListComboBox(HWND,SEGPTR,INT,INT,UINT);
+BOOL DlgDirSelect(HWND,LPSTR,INT);
+BOOL DlgDirSelectComboBox(HWND,LPSTR,INT);
BOOL DragDetect(HWND,POINT);
DWORD DragObject(HWND, HWND, WORD, HANDLE, WORD, HCURSOR);
-void DrawFocusRect(HDC,LPRECT);
-BOOL DrawIcon(HDC,short,short,HICON);
+void DrawFocusRect(HDC,const RECT*);
+BOOL DrawIcon(HDC,INT,INT,HICON);
void DrawMenuBar(HWND);
-int DrawText(HDC,LPCSTR,int,LPRECT,WORD);
+INT DrawText(HDC,LPCTSTR,INT,LPRECT,UINT);
DWORD DumpIcon(SEGPTR,WORD*,SEGPTR*,SEGPTR*);
BOOL Ellipse(HDC,INT,INT,INT,INT);
BOOL EmptyClipboard(void);
BOOL EnableHardwareInput(BOOL);
BOOL EnableMenuItem(HMENU,UINT,UINT);
-BOOL EnableScrollBar(HWND,INT,UINT);
+BOOL EnableScrollBar(HWND,UINT,UINT);
BOOL EnableWindow(HWND,BOOL);
BOOL EndDeferWindowPos(HDWP);
-void EndDialog(HWND,short);
-void EndPaint(HWND,LPPAINTSTRUCT);
-BOOL EnumChildWindows(HWND,FARPROC,LONG);
-WORD EnumClipboardFormats(WORD);
-int EnumFontFamilies(HDC,LPSTR,FONTENUMPROC,LPARAM);
-int EnumFonts(HDC,LPSTR,FARPROC,LPSTR);
-BOOL EnumMetaFile(HDC,LOCALHANDLE,FARPROC,BYTE*);
-int EnumObjects(HDC,int,FARPROC,LPARAM);
-int EnumProps(HWND,FARPROC);
-BOOL EnumTaskWindows(HANDLE,FARPROC,LONG);
-BOOL EnumWindows(FARPROC,LONG);
-BOOL EqualRect(LPRECT,LPRECT);
+BOOL EndDialog(HWND,INT);
+BOOL EndPaint(HWND,const PAINTSTRUCT*);
+BOOL EnumChildWindows(HWND,WNDENUMPROC,LPARAM);
+UINT EnumClipboardFormats(UINT);
+INT EnumFontFamilies(HDC,LPCTSTR,FONTENUMPROC,LPARAM);
+INT EnumFonts(HDC,LPCTSTR,FONTENUMPROC,LPARAM);
+BOOL EnumMetaFile(HDC,HMETAFILE,MFENUMPROC,LPARAM);
+INT EnumObjects(HDC,INT,GOBJENUMPROC,LPARAM);
+INT EnumProps(HWND,PROPENUMPROC);
+BOOL EnumTaskWindows(HTASK,WNDENUMPROC,LPARAM);
+BOOL EnumWindows(WNDENUMPROC,LPARAM);
+BOOL EqualRect(const RECT*,const RECT*);
BOOL EqualRgn(HRGN,HRGN);
-int Escape(HDC,int,int,LPSTR,LPSTR);
+INT Escape(HDC,INT,INT,LPCSTR,LPVOID);
LONG EscapeCommFunction(int,int);
int ExcludeClipRect(HDC,short,short,short,short);
int ExcludeUpdateRgn(HDC,HWND);
@@ -3269,13 +3290,13 @@
BOOL WritePrivateProfileString(LPCSTR,LPCSTR,LPCSTR,LPCSTR);
BOOL WriteProfileString(LPCSTR,LPCSTR,LPCSTR);
void Yield(void);
-LONG _hread(HFILE,LPSTR,LONG);
+LONG _hread(HFILE,SEGPTR,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 _lread(HFILE,SEGPTR,WORD);
INT _lwrite(HFILE,LPCSTR,WORD);
void hmemcpy(LPVOID,LPCVOID,LONG);
SEGPTR lstrcat(SEGPTR,SEGPTR);
diff --git a/include/winpos.h b/include/winpos.h
index 8660036..33ee4bb 100644
--- a/include/winpos.h
+++ b/include/winpos.h
@@ -34,5 +34,6 @@
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos );
+extern INT WINPOS_WindowFromPoint( POINT pt, HWND *phwnd );
#endif /* WINPOS_H */
diff --git a/include/wintypes.h b/include/wintypes.h
index 30da778..77b33fe 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -39,6 +39,9 @@
#define UIFMT "%u"
#define NPFMT "%p"
#define SPFMT "%p"
+
+/* Should probably eventually be unsigned short, but not now */
+typedef char TCHAR;
#else
typedef short INT;
typedef unsigned short UINT;
@@ -49,6 +52,9 @@
#define UIFMT "%hu"
#define NPFMT "%04x"
#define SPFMT "%08lx"
+
+/* TCHAR is just char in Win16 */
+typedef char TCHAR;
#endif
typedef LONG LPARAM;
typedef LONG LRESULT;
@@ -56,7 +62,8 @@
typedef DWORD HHOOK;
typedef char *LPSTR;
typedef const char *LPCSTR;
-typedef LPCSTR LPCTSTR;
+typedef TCHAR *LPTSTR;
+typedef const TCHAR *LPCTSTR;
typedef WCHAR *LPWSTR;
typedef const WCHAR *LPCWSTR;
typedef char *NPSTR;
@@ -81,6 +88,7 @@
DECLARE_HANDLE(HDRVR);
DECLARE_HANDLE(HDWP);
DECLARE_HANDLE(HFONT);
+DECLARE_HANDLE(HGDIOBJ);
DECLARE_HANDLE(HGLOBAL);
DECLARE_HANDLE(HICON);
DECLARE_HANDLE(HINSTANCE);
@@ -107,12 +115,23 @@
#ifdef WINELIB
typedef long (*FARPROC)();
typedef LRESULT (*WNDPROC)(HWND,UINT,WPARAM,LPARAM);
+typedef LRESULT (*WNDENUMPROC)(HWND,LPARAM);
+/*typedef int (*FONTENUMPROC)(const LOGFONT*,const TEXTMETRIC*,DWORD,LPARAM);*/
+typedef int (*FONTENUMPROC)(const void*,const void*,DWORD,LPARAM);
+typedef int (*GOBJENUMPROC)(LPVOID,LPARAM);
+typedef BOOL (*PROPENUMPROC)(HWND,LPCTSTR,HANDLE);
+/*typedef int (*MFENUMPROC)(HDC,HANDLETABLE*,METARECORD*,int,LPARAM);*/
+typedef int (*MFENUMPROC)(HDC,void*,void*,int,LPARAM);
#else
typedef SEGPTR FARPROC;
typedef SEGPTR WNDPROC;
+typedef SEGPTR WNDENUMPROC;
+typedef SEGPTR FONTENUMPROC;
+typedef SEGPTR GOBJENUMPROC;
+typedef SEGPTR PROPENUMPROC;
+typedef SEGPTR MFENUMPROC;
#endif
typedef FARPROC DLGPROC;
-typedef FARPROC FONTENUMPROC;
typedef FARPROC HOOKPROC;
#define TRUE 1
diff --git a/library/miscstubs.c b/library/miscstubs.c
index c1cb479..1354de1 100644
--- a/library/miscstubs.c
+++ b/library/miscstubs.c
@@ -10,6 +10,7 @@
#include "dde_mem.h"
#include "windows.h"
#include "global.h"
+#include "relay32.h"
#include "debug.h"
#include "xmalloc.h"
@@ -128,7 +129,12 @@
return 0;
}
-void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
+WIN32_builtin *RELAY32_GetBuiltinDLL(char *name)
+{
+ return NULL;
+}
+
+void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
{
return NULL;
}
diff --git a/libtest/Makefile.in b/libtest/Makefile.in
index 23e4a66..437a6dd 100644
--- a/libtest/Makefile.in
+++ b/libtest/Makefile.in
@@ -1,6 +1,6 @@
TOPSRC = @top_srcdir@
MODULE = none
-PROGRAMS = hello hello2 hello3 rolex
+PROGRAMS = hello hello2 hello3 hello4 new rolex
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LDLIBS)
C_SRCS = \
@@ -8,6 +8,8 @@
hello2.c \
hello3.c \
hello3res.c \
+ hello4.c \
+ new.c \
rolex.c
all: check_winerc $(PROGRAMS)
@@ -23,11 +25,17 @@
hello3: hello3res.o hello3.o $(WINELIB)
$(CC) -o hello3 hello3.o hello3res.o $(LDOPTIONS) $(ALL_LIBS)
+hello4: hello4.o $(WINELIB)
+ $(CC) -o hello4 hello4.o $(LDOPTIONS) $(ALL_LIBS)
+
+new: new.o $(WINELIB)
+ $(CC) -o new new.o $(LDOPTIONS) $(ALL_LIBS)
+
rolex: rolex.o $(WINELIB)
$(CC) -o rolex rolex.o $(LDOPTIONS) $(ALL_LIBS)
clean::
- $(RM) hello hello2 hello3 hello3res.c hello3res.h rolex
+ $(RM) hello hello2 hello3 hello3res.c hello3res.h hello4 new rolex
hello3res.c hello3res.h: $(WINERC)
diff --git a/libtest/hello4.c b/libtest/hello4.c
new file mode 100644
index 0000000..9e8f800
--- /dev/null
+++ b/libtest/hello4.c
@@ -0,0 +1,121 @@
+#include <stdio.h>
+#include <windows.h>
+
+void Write (HDC dc, int x, int y, char *s)
+{
+ TextOut (dc, x, y, s, strlen (s));
+}
+
+LRESULT WndProc (HWND wnd, UINT msg, WPARAM w, LPARAM l)
+{
+ static short xChar, yChar;
+ HDC dc;
+ PAINTSTRUCT ps;
+ TEXTMETRIC tm;
+
+ switch (msg){
+ case WM_CREATE:
+ dc = GetDC (wnd);
+ GetTextMetrics (dc, &tm);
+ xChar = tm.tmAveCharWidth;
+ yChar = tm.tmHeight;
+ ReleaseDC (wnd, dc);
+ break;
+
+ case WM_PAINT:
+ dc = BeginPaint (wnd, &ps);
+ Write (dc, xChar, yChar, "Hola");
+ EndPaint (wnd, &ps);
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage (0);
+ break;
+
+ default:
+ return DefWindowProc (wnd, msg, w, l);
+ }
+ return 0l;
+}
+
+LRESULT WndProc2 (HWND wnd, UINT msg, WPARAM w, LPARAM l)
+{
+ static short xChar, yChar;
+ char buf[128];
+ HDC dc;
+ PAINTSTRUCT ps;
+ TEXTMETRIC tm;
+
+ switch (msg){
+ case WM_CREATE:
+ dc = GetDC (wnd);
+ GetTextMetrics (dc, &tm);
+ xChar = tm.tmAveCharWidth;
+ yChar = tm.tmHeight;
+ ReleaseDC (wnd, dc);
+ break;
+
+ case WM_PAINT:
+ dc = BeginPaint (wnd, &ps);
+ sprintf(buf,"ps.rcPaint = {left = %d, top = %d, right = %d, bottom = %d}",
+ ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right,ps.rcPaint.bottom);
+ Write (dc, xChar, yChar, buf);
+ EndPaint (wnd, &ps);
+ break;
+
+ case WM_DESTROY:
+ PostQuitMessage (0);
+ break;
+
+ default:
+ return DefWindowProc (wnd, msg, w, l);
+ }
+ return 0l;
+}
+
+int PASCAL WinMain (HANDLE inst, HANDLE prev, LPSTR cmdline, int show)
+{
+ HWND wnd,wnd2;
+ MSG msg;
+ WNDCLASS class;
+
+ if (!prev){
+ class.style = CS_HREDRAW | CS_VREDRAW;
+ class.lpfnWndProc = WndProc;
+ class.cbClsExtra = 0;
+ class.cbWndExtra = 0;
+ class.hInstance = inst;
+ class.hIcon = LoadIcon (0, IDI_APPLICATION);
+ class.hCursor = LoadCursor (0, IDC_ARROW);
+ class.hbrBackground = GetStockObject (WHITE_BRUSH);
+ class.lpszMenuName = NULL;
+ class.lpszClassName = (SEGPTR)"class";
+ if (!RegisterClass (&class))
+ return FALSE;
+ }
+
+ wnd = CreateWindow ("class", "Test app", WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,
+ 0, inst, 0);
+
+ if (!prev){
+ class.lpfnWndProc = WndProc2;
+ class.lpszClassName = (SEGPTR)"class2";
+ if (!RegisterClass (&class))
+ return FALSE;
+ }
+
+ wnd2= CreateWindow ("class2","Test app", WS_BORDER | WS_CHILD,
+ 50, 50, 350, 50, wnd, 0, inst, 0);
+
+ ShowWindow (wnd, show);
+ UpdateWindow (wnd);
+ ShowWindow (wnd2, show);
+ UpdateWindow (wnd2);
+
+ while (GetMessage (&msg, 0, 0, 0)){
+ TranslateMessage (&msg);
+ DispatchMessage (&msg);
+ }
+ return 0;
+}
diff --git a/libtest/new.c b/libtest/new.c
new file mode 100644
index 0000000..8dfabce
--- /dev/null
+++ b/libtest/new.c
@@ -0,0 +1,153 @@
+#include <windows.h>
+
+HANDLE ghInstance;
+
+
+long FAR PASCAL WndProc (HWND, WORD, WPARAM, LPARAM);
+long FAR PASCAL ChildProc(HWND, WORD, WPARAM, LPARAM);
+
+int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
+ LPSTR lpszCmdParam, int nCmdShow)
+ {
+ static char szAppName[] = "ClassLook" ;
+ HWND hwnd ;
+ MSG msg ;
+ WNDCLASS wndclass ;
+
+ ghInstance = hInstance;
+ if (!hPrevInstance)
+ {
+ wndclass.style = CS_HREDRAW | CS_VREDRAW ;
+ wndclass.lpfnWndProc = WndProc ;
+ wndclass.cbClsExtra = 0 ;
+ wndclass.cbWndExtra = 0 ;
+ wndclass.hInstance = hInstance ;
+ wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
+ wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
+ wndclass.hbrBackground = GetStockObject (WHITE_BRUSH) ;
+ wndclass.lpszMenuName = NULL ;
+ wndclass.lpszClassName = szAppName ;
+
+ RegisterClass (&wndclass) ;
+ }
+
+ hwnd = CreateWindow (szAppName, /* window class name */
+ "ClassLook", /* window caption */
+ WS_OVERLAPPEDWINDOW, /* window style */
+ CW_USEDEFAULT, /* initial x position */
+ CW_USEDEFAULT, /* initial y position */
+ 600, /* initial x size */
+ 400, /* initial y size */
+ NULL, /* parent window handle */
+ NULL, /* window menu handle */
+ hInstance, /* program instance handle */
+ NULL) ; /* creation parameters */
+
+ ShowWindow (hwnd, nCmdShow) ;
+ UpdateWindow (hwnd) ;
+
+ while (GetMessage (&msg, NULL, 0, 0))
+ {
+ TranslateMessage (&msg) ;
+ DispatchMessage (&msg) ;
+ }
+ return msg.wParam ;
+ }
+
+long FAR PASCAL WndProc (HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
+ {
+ HDC hdc ;
+ PAINTSTRUCT ps ;
+ RECT rect ;
+ WNDCLASS wndclass ;
+
+ static HWND hChild;
+
+ switch (message)
+ {
+ case WM_CREATE :
+ wndclass.style = CS_PARENTDC | CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = ChildProc ;
+ wndclass.cbClsExtra = 0 ;
+ wndclass.cbWndExtra = 0 ;
+ wndclass.hInstance = ghInstance ;
+ wndclass.hIcon = NULL ;
+ wndclass.hCursor = LoadCursor (NULL, IDC_CROSS) ;
+ wndclass.hbrBackground = GetStockObject (LTGRAY_BRUSH) ;
+ wndclass.lpszMenuName = NULL ;
+ wndclass.lpszClassName = "SecondClass" ;
+
+ RegisterClass (&wndclass);
+
+ hChild = CreateWindow("SecondClass","Child Window",
+ WS_CHILD | WS_VISIBLE | WS_BORDER,
+ 10, 10, 580, 380, hwnd, NULL, ghInstance, NULL);
+ ShowWindow(hChild, SW_SHOW);
+ case WM_PAINT :
+ hdc = BeginPaint (hwnd, &ps) ;
+
+ GetClientRect (hwnd, &rect) ;
+
+ DrawText (hdc, "Hello, Windows!", -1, &rect,
+ DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
+
+ EndPaint (hwnd, &ps);
+ return 0 ;
+
+ case WM_DESTROY :
+ PostQuitMessage (0) ;
+ return 0 ;
+ }
+ return DefWindowProc (hwnd, message, wParam, lParam) ;
+ }
+
+long FAR PASCAL ChildProc(HWND hwnd, WORD message, WPARAM wParam, LPARAM lParam)
+{
+ HDC hDC;
+ PAINTSTRUCT ps;
+ WNDCLASS wndClass;
+ char* classes[]={"EDIT","BUTTON","LISTBOX","STATIC","SCROLLBAR","COMBOBOX","COMBOLBOX", NULL};
+ char** curr;
+ char buf[256];
+ RECT rect ;
+ int i;
+
+ switch (message) {
+ case WM_PAINT:
+ curr = classes;
+ i=0;
+ hDC = BeginPaint(hwnd, &ps);
+ SelectObject(hDC,GetStockObject(ANSI_FIXED_FONT));
+ while (*curr) {
+ wsprintf(buf,"%12s:",*curr);
+ GetClassInfo(NULL, *curr, &wndClass);
+ if(wndClass.style&CS_VREDRAW) lstrcat(buf," | CS_VREDRAW");
+ if(wndClass.style&CS_HREDRAW) lstrcat(buf," | CS_HREDRAW" );
+ if(wndClass.style&CS_KEYCVTWINDOW) lstrcat(buf," | CS_KEYCVTWINDOW" );
+ if(wndClass.style&CS_DBLCLKS) lstrcat(buf," | CS_DBLCLKS" );
+ if(wndClass.style&CS_OWNDC) lstrcat(buf," | CS_OWNDC" );
+ if(wndClass.style&CS_CLASSDC) lstrcat(buf," | CS_CLASSDC" );
+ if(wndClass.style&CS_PARENTDC) lstrcat(buf," | CS_PARENTDC" );
+ if(wndClass.style&CS_NOKEYCVT) lstrcat(buf," | CS_NOKEYCVT" );
+ if(wndClass.style&CS_NOCLOSE) lstrcat(buf," | CS_NOCLOSE" );
+ if(wndClass.style&CS_SAVEBITS) lstrcat(buf," | CS_SAVEBITS" );
+ if(wndClass.style&CS_GLOBALCLASS) lstrcat(buf," | CS_GLOBALCLASS");
+ GetClientRect (hwnd, &rect) ;
+ TextOut (hDC, 5,20+i,buf,lstrlen(buf)) ;
+ i += 15;
+ curr++;
+ }
+/* EndPaint(hwnd, &ps);
+ break;
+ hDC = BeginPaint(hwnd, &ps);
+*/
+ MoveTo(hDC, 0, 0);
+ LineTo(hDC, 500, 500);
+ EndPaint(hwnd, &ps);
+ break;
+ default:
+ return DefWindowProc (hwnd, message, wParam, lParam) ;
+ }
+ return (0L);
+}
+
diff --git a/loader/main.c b/loader/main.c
index e1bcee8..25c0990 100644
--- a/loader/main.c
+++ b/loader/main.c
@@ -76,6 +76,9 @@
/* Initialize tasks */
if (!TASK_Init()) return 0;
+ /* Initialize communications */
+ COMM_Init();
+
#ifndef WINELIB
/* Initialize interrupt vectors */
if (!INT_Init()) return 0;
@@ -85,12 +88,7 @@
/* Initialize signal handling */
init_wine_signals();
-#endif
- /* Initialize communications */
- COMM_Init();
-
-#ifndef WINELIB
/* Initialize the DOS memory */
if (!INT21_Init()) return 0;
diff --git a/loader/pe_image.c b/loader/pe_image.c
index 3d749c1..5abdeae 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -1,6 +1,7 @@
#ifndef WINELIB
/*
* Copyright 1994 Eric Youndale & Erik Bos
+ * Copyright 1995 Martin von Löwis
*
* based on Eric Youndale's pe-test and:
*
@@ -118,9 +119,15 @@
name = (u_char **) (((char *) load_addr) + (int) exports->AddressOfNames);
for(i=0; i<exports->Number_Of_Functions; i++)
{
- ename = (char *) (((char *) load_addr) + (int) *name);
- if(strcmp(ename,funcName)==0)
- return load_addr+*function;
+ if(HIWORD(funcName))
+ {
+ ename = (char *) (((char *) load_addr) + (int) *name);
+ if(strcmp(ename,funcName)==0)
+ return load_addr+*function;
+ }else{
+ if(funcName == (int)*ordinal + exports->Base)
+ return load_addr+*function;
+ }
function++;
ordinal++;
name++;
@@ -134,6 +141,13 @@
for(wpnt=wine_files;wpnt;wpnt=wpnt->next)
if(wpnt->hModule==hModule) break;
if(!wpnt)return 0;
+ if(wpnt->builtin)
+ {
+ if(HIWORD(function))
+ return RELAY32_GetEntryPoint(wpnt->builtin,function,0);
+ else
+ return RELAY32_GetEntryPoint(wpnt->builtin,0,(int)function);
+ }
return PE_FindExportedFunction(wpnt,function);
}
@@ -179,16 +193,9 @@
char * Module;
struct pe_import_name * pe_name;
unsigned int * import_list, *thunk_list;
-#if 0
- char * c;
-#endif
Module = ((char *) load_addr) + pe_imp->ModuleName;
dprintf_win32(stddeb, "%s\n", Module);
-#if 0
- c = strchr(Module, '.');
- if (c) *c = 0;
-#endif
if(pe_imp->Import_List != 0) { /* original microsoft style */
dprintf_win32(stddeb, "Microsoft style imports used\n");
@@ -198,28 +205,29 @@
(((unsigned int) load_addr) + pe_imp->Thunk_List);
- while(*import_list)
+ while(*import_list)
{
pe_name = (struct pe_import_name *) ((int) load_addr + *import_list);
- if((unsigned)pe_name & 0x80000000)
+ if((unsigned)*import_list & 0x80000000)
{
- fprintf(stderr,"Import by ordinal not supported\n");
- exit(0);
- }
+ int ordinal=*import_list & (0x80000000-1);
+ dprintf_win32(stddeb,"--- Ordinal %s,%d\n", Module, ordinal);
+ *thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
+ ordinal);
+ }else{ /* import by name */
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
- /* FIXME: Both calls should be unified into GetProcAddress */
- *thunk_list=(unsigned int)RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
- if(*thunk_list == 0)
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
#else
fprintf(stderr,"JBP: Call to RELAY32_GetEntryPoint being ignored.\n");
#endif
+ }
if(!*thunk_list)
{
- fprintf(stderr,"No implementation for %s.%d\n",Module, pe_name->Hint);
+ fprintf(stderr,"No implementation for %s.%d(%s)\n",Module,
+ pe_name->Hint, pe_name->Name);
fixup_failed=1;
}
@@ -239,8 +247,10 @@
dprintf_win32(stddeb, "--- %s %s.%d\n", pe_name->Name, Module, pe_name->Hint);
#ifndef WINELIB /* FIXME: JBP: Should this happen in libwine.a? */
/* FIXME: Both calls should be unified into GetProcAddress */
+#if 0
*thunk_list=(unsigned int)RELAY32_GetEntryPoint(Module,pe_name->Name,pe_name->Hint);
if(*thunk_list == 0)
+#endif
*thunk_list = WIN32_GetProcAddress(MODULE_FindModule(Module),
pe_name->Name);
#else
@@ -454,8 +464,8 @@
if(wpnt->pe->pe_export &&
wpnt->pe->pe_export!=load_addr+dir.Virtual_address)
fprintf(stderr,"wrong export directory??\n");
- else
- wpnt->pe->pe_export = load_addr+dir.Virtual_address;
+ /* always trust the directory */
+ wpnt->pe->pe_export = load_addr+dir.Virtual_address;
}
dir=wpnt->pe->pe_header->opt_coff.DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY];
@@ -463,9 +473,8 @@
{
if(wpnt->pe->pe_import &&
wpnt->pe->pe_import!=load_addr+dir.Virtual_address)
- fprintf(stderr,"wrong export directory??\n");
- else
- wpnt->pe->pe_import = load_addr+dir.Virtual_address;
+ fprintf(stderr,"wrong import directory??\n");
+ wpnt->pe->pe_import = load_addr+dir.Virtual_address;
}
dir=wpnt->pe->pe_header->opt_coff.DataDirectory[IMAGE_FILE_RESOURCE_DIRECTORY];
@@ -474,8 +483,7 @@
if(wpnt->pe->pe_resource &&
wpnt->pe->pe_resource!=load_addr+dir.Virtual_address)
fprintf(stderr,"wrong resource directory??\n");
- else
- wpnt->pe->pe_resource = load_addr+dir.Virtual_address;
+ wpnt->pe->pe_resource = load_addr+dir.Virtual_address;
}
dir=wpnt->pe->pe_header->opt_coff.DataDirectory[IMAGE_FILE_BASE_RELOCATION_TABLE];
@@ -483,9 +491,8 @@
{
if(wpnt->pe->pe_reloc &&
wpnt->pe->pe_reloc!=load_addr+dir.Virtual_address)
- fprintf(stderr,"wrong export directory??\n");
- else
- wpnt->pe->pe_reloc = load_addr+dir.Virtual_address;
+ fprintf(stderr,"wrong relocation list??\n");
+ wpnt->pe->pe_reloc = load_addr+dir.Virtual_address;
}
if(wpnt->pe->pe_header->opt_coff.DataDirectory
@@ -549,6 +556,7 @@
wpnt->hinstance=0;
wpnt->hModule=0;
wpnt->initialised=0;
+ wpnt->builtin=0;
lseek(fd,0,SEEK_SET);
wpnt->mz_header=xmalloc(sizeof(struct mz_header_s));
read(fd,wpnt->mz_header,sizeof(struct mz_header_s));
diff --git a/memory/ldt.c b/memory/ldt.c
index bc1c96f..86ab2ef 100644
--- a/memory/ldt.c
+++ b/memory/ldt.c
@@ -125,6 +125,7 @@
{
struct modify_ldt_ldt_s ldt_info;
+ /* Clear all unused bits (like seg_not_present) */
memset( &ldt_info, 0, sizeof(ldt_info) );
ldt_info.entry_number = entry;
ldt_info.base_addr = content->base;
diff --git a/memory/local.c b/memory/local.c
index d1235a3..e113496 100644
--- a/memory/local.c
+++ b/memory/local.c
@@ -681,6 +681,7 @@
dprintf_local( stddeb, "LocalFree: %04x ds=%04x\n", handle, ds );
+ if (!handle) { fprintf( stderr, "LOCAL_Free: handle is 0.\n" ); return 0; }
if (HANDLE_FIXED( handle )) {
arena = ARENA_HEADER( handle );
} else {
diff --git a/memory/selector.c b/memory/selector.c
index bbf2e44..20c7bd1 100644
--- a/memory/selector.c
+++ b/memory/selector.c
@@ -308,7 +308,10 @@
LDT_GetEntry( SELECTOR_TO_ENTRY(sel), &entry );
if (op == 0) /* get */
{
- return 1 /* accessed */ |
+ return 0x01 | /* accessed */
+ 0x10 | /* not system */
+ 0x60 | /* DPL 3 */
+ 0x80 | /* present */
((entry.read_only == 0) << 1) |
(entry.type << 2) |
(entry.seg_32bit << 14) |
@@ -453,7 +456,7 @@
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, "Invalid pointer %p 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;
diff --git a/misc/clipboard.c b/misc/clipboard.c
index 41bab82..847e891 100644
--- a/misc/clipboard.c
+++ b/misc/clipboard.c
@@ -187,7 +187,7 @@
/**************************************************************************
* EnumClipboardFormats [USER.144]
*/
-WORD EnumClipboardFormats(WORD wFormat)
+UINT EnumClipboardFormats(UINT wFormat)
{
LPCLIPFORMAT lpFormat = ClipFormats;
dprintf_clipboard(stddeb,"EnumClipboardFormats(%04X) !\n", wFormat);
diff --git a/misc/commdlg.c b/misc/commdlg.c
index 8991597..90c3705 100644
--- a/misc/commdlg.c
+++ b/misc/commdlg.c
@@ -17,6 +17,8 @@
#include "dos_fs.h"
#include "drive.h"
#include "stackframe.h"
+#include "stddebug.h"
+#include "debug.h"
static DWORD CommDlgLastError = 0;
@@ -90,7 +92,7 @@
else SYSRES_FreeResource( hDlgTmpl );
}
- printf("GetOpenFileName // return lpstrFile='%s' !\n",
+ dprintf_commdlg(stddeb,"GetOpenFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@@ -131,7 +133,7 @@
else SYSRES_FreeResource( hDlgTmpl );
}
- printf( "GetSaveFileName // return lpstrFile='%s' !\n",
+ dprintf_commdlg(stddeb, "GetSaveFileName // return lpstrFile='%s' !\n",
(LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrFile));
return bRet;
}
@@ -253,14 +255,14 @@
FillRect(lpdis->hDC, &lpdis->rcItem, hBrush);
SendMessage(lpdis->hwndItem, CB_GETLBTEXT, lpdis->itemID,
(LPARAM)MAKE_SEGPTR(str));
- switch(str[2]) {
- case 'a': case 'b':
- hBitmap = hFloppy;
- break;
- default:
- hBitmap = hHDisk;
- break;
- }
+ switch(DRIVE_GetType( str[2] - 'a' ))
+ {
+ case TYPE_FLOPPY: hBitmap = hFloppy; break;
+ case TYPE_CDROM: hBitmap = hCDRom; break;
+ case TYPE_HD:
+ case TYPE_NETWORK:
+ default: hBitmap = hHDisk; break;
+ }
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
TextOut(lpdis->hDC, lpdis->rcItem.left + bm.bmWidth,
lpdis->rcItem.top, str, strlen(str));
@@ -299,6 +301,7 @@
static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
int n;
+ int i;
LPOPENFILENAME lpofn;
char tmpstr[512];
LPSTR pstr;
@@ -308,16 +311,17 @@
if (lpofn->lpstrCustomFilter)
{
pstr = (LPSTR)PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter);
- printf("lpstrCustomFilter = %p\n", pstr);
+ dprintf_commdlg(stddeb,"lpstrCustomFilter = %p\n", pstr);
while(*pstr)
{
n = strlen(pstr);
strncpy(tmpstr, pstr, 511); tmpstr[511]=0;
- printf("lpstrCustomFilter // add tmpstr='%s' ", tmpstr);
- SendDlgItemMessage(hWnd, cmb1, CB_ADDSTRING, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
+ dprintf_commdlg(stddeb,"lpstrCustomFilter // add tmpstr='%s' ", tmpstr);
+ i = SendDlgItemMessage(hWnd, cmb1, CB_ADDSTRING, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
pstr += n + 1;
n = strlen(pstr);
- printf("associated to '%s'\n", pstr);
+ dprintf_commdlg(stddeb,"associated to '%s'\n", pstr);
+ SendDlgItemMessage(hWnd, cmb1, CB_SETITEMDATA, i, (LPARAM)pstr);
pstr += n + 1;
}
}
@@ -327,11 +331,12 @@
{
n = strlen(pstr);
strncpy(tmpstr, pstr, 511); tmpstr[511]=0;
- printf("lpstrFilter // add tmpstr='%s' ", tmpstr);
- SendDlgItemMessage(hWnd, cmb1, CB_ADDSTRING, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
+ dprintf_commdlg(stddeb,"lpstrFilter // add tmpstr='%s' ", tmpstr);
+ i = SendDlgItemMessage(hWnd, cmb1, CB_ADDSTRING, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
pstr += n + 1;
n = strlen(pstr);
- printf("associated to '%s'\n", pstr);
+ dprintf_commdlg(stddeb,"associated to '%s'\n", pstr);
+ SendDlgItemMessage(hWnd, cmb1, CB_SETITEMDATA, i, (LPARAM)pstr);
pstr += n + 1;
}
/* set default filter */
@@ -341,7 +346,7 @@
strncpy(tmpstr, FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
PTR_SEG_TO_LIN(lpofn->lpstrFilter), lpofn->nFilterIndex - 1),511);
tmpstr[511]=0;
- printf("nFilterIndex = %ld // SetText of edt1 to '%s'\n",
+ dprintf_commdlg(stddeb,"nFilterIndex = %ld // SetText of edt1 to '%s'\n",
lpofn->nFilterIndex, tmpstr);
SendDlgItemMessage(hWnd, edt1, WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(tmpstr));
/* get drive list */
@@ -437,9 +442,8 @@
lRet = SendDlgItemMessage(hWnd, cmb1, CB_GETCURSEL, 0, 0);
if (lRet == LB_ERR)
return TRUE;
- pstr = FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
- PTR_SEG_TO_LIN(lpofn->lpstrFilter),
- lRet);
+ pstr = (LPSTR)SendDlgItemMessage(hWnd, cmb1, CB_GETITEMDATA, lRet, 0);
+ dprintf_commdlg(stddeb,"Selected filter : %s\n", pstr);
strncpy(tmpstr2, pstr, 511); tmpstr2[511]=0;
SendDlgItemMessage(hWnd, edt1, WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(tmpstr2));
FILEDLG_ScanDir(hWnd, tmpstr);
@@ -467,7 +471,7 @@
strcpy(tmpstr2, tmpstr);
*tmpstr=0;
}
- printf("commdlg: %s, %s\n", tmpstr, tmpstr2);
+ dprintf_commdlg(stddeb,"commdlg: %s, %s\n", tmpstr, tmpstr2);
SendDlgItemMessage(hWnd, edt1, WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(tmpstr2));
FILEDLG_ScanDir(hWnd, tmpstr);
return TRUE;
@@ -480,7 +484,7 @@
lRet = SendDlgItemMessage(hWnd, cmb1, CB_GETCURSEL, 0, 0);
if (lRet == LB_ERR) return TRUE;
lpofn->nFilterIndex = lRet + 1;
- printf("commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
+ dprintf_commdlg(stddeb,"commdlg: lpofn->nFilterIndex=%ld\n", lpofn->nFilterIndex);
strncpy(tmpstr2,
FILEDLG_GetFileType(PTR_SEG_TO_LIN(lpofn->lpstrCustomFilter),
PTR_SEG_TO_LIN(lpofn->lpstrFilter),
@@ -528,7 +532,7 @@
lRet = SendDlgItemMessage(hWnd, lst1, LB_GETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, lst1, LB_GETTEXT, lRet,
(LPARAM)MAKE_SEGPTR(tmpstr));
- printf("strcpy'ing '%s'\n",tmpstr); fflush(stdout);
+ dprintf_commdlg(stddeb,"strcpy'ing '%s'\n",tmpstr); fflush(stdout);
strcpy(PTR_SEG_TO_LIN(lpofn->lpstrFileTitle), tmpstr);
}
EndDialog(hWnd, TRUE);
@@ -639,7 +643,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- printf("ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_commdlg(stddeb,"ColorDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -702,7 +706,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- printf("FindTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_commdlg(stddeb,"FindTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -729,7 +733,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- printf("ReplaceTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_commdlg(stddeb,"ReplaceTextDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -756,7 +760,7 @@
HANDLE hInst, hDlgTmpl;
BOOL bRet;
- printf("PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
+ dprintf_commdlg(stddeb,"PrintDlg(%p) // Flags=%08lX\n", lpPrint, lpPrint->Flags );
if (lpPrint->Flags & PD_RETURNDEFAULT)
/* FIXME: should fill lpPrint->hDevMode and lpPrint->hDevNames here */
@@ -786,7 +790,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- printf("PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_commdlg(stddeb,"PrintDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -813,7 +817,7 @@
switch (wMsg)
{
case WM_INITDIALOG:
- printf("PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
+ dprintf_commdlg(stddeb,"PrintSetupDlgProc // WM_INITDIALOG lParam=%08lX\n", lParam);
ShowWindow(hWnd, SW_SHOWNORMAL);
return (TRUE);
case WM_COMMAND:
@@ -846,7 +850,7 @@
short GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
{
int i, len;
- printf("GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
+ dprintf_commdlg(stddeb,"GetFileTitle(%p %p %d); \n", lpFile, lpTitle, cbBuf);
if (lpFile == NULL || lpTitle == NULL)
return -1;
len = strlen(lpFile);
@@ -863,7 +867,7 @@
i++;
break;
}
- printf("\n---> '%s' ", &lpFile[i]);
+ dprintf_commdlg(stddeb,"\n---> '%s' ", &lpFile[i]);
len = strlen(lpFile+i)+1;
if (cbBuf < len)
diff --git a/misc/escape.c b/misc/escape.c
index b848f3a..f86def0 100644
--- a/misc/escape.c
+++ b/misc/escape.c
@@ -10,8 +10,8 @@
#include <stdio.h>
#include "windows.h"
-int Escape(HDC hdc, int nEscape, int cbInput,
- LPSTR lpszInData, LPSTR lpvOutData)
+INT Escape(HDC hdc, INT nEscape, INT cbInput,
+ LPCSTR lpszInData, LPVOID lpvOutData)
{
fprintf(stderr, "Escape(nEscape = %04x)\n", nEscape);
return 0;
diff --git a/misc/exec.c b/misc/exec.c
index 5c49487..6cc85b3 100644
--- a/misc/exec.c
+++ b/misc/exec.c
@@ -72,6 +72,8 @@
strcat(str, lpHelpFile);
dprintf_exec(stddeb,"'%s'\n", str);
break;
+ case HELP_QUIT:
+ return TRUE;
default:
return FALSE;
}
diff --git a/misc/main.c b/misc/main.c
index b445865..762274e 100644
--- a/misc/main.c
+++ b/misc/main.c
@@ -55,6 +55,7 @@
"Fr", /* LANG_Fr */
"Fi", /* LANG_Fi */
"Da", /* LANG_Da */
+ "Cz", /* LANG_Cz */
NULL
};
@@ -132,7 +133,7 @@
" -iconic Start as an icon\n" \
" -ipc Enable IPC facilities\n" \
" -debug Enter debugger before starting application\n" \
- " -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da)\n" \
+ " -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz)\n" \
" -managed Allow the window manager to manage created windows\n" \
" -name name Set the application name\n" \
" -privatemap Use a private color map\n" \
diff --git a/misc/ole2nls.c b/misc/ole2nls.c
index 8100e5e..500a3f2 100644
--- a/misc/ole2nls.c
+++ b/misc/ole2nls.c
@@ -30,6 +30,7 @@
case LANG_Fr:
case LANG_Fi:
case LANG_Da:
+ case LANG_Cz:
default:
return 0; /* Neutral language */
}
diff --git a/misc/rect.c b/misc/rect.c
index 0ae8b0c..3d2bc8c 100644
--- a/misc/rect.c
+++ b/misc/rect.c
@@ -135,7 +135,7 @@
/***********************************************************************
* EqualRect (USER.244)
*/
-BOOL EqualRect( LPRECT rect1, LPRECT rect2 )
+BOOL EqualRect( const RECT* rect1, const RECT* rect2 )
{
return ((rect1->left == rect2->left) && (rect1->right == rect2->right) &&
(rect1->top == rect2->top) && (rect1->bottom == rect2->bottom));
diff --git a/misc/shell.c b/misc/shell.c
index 802ee7b..8e4b9f7 100644
--- a/misc/shell.c
+++ b/misc/shell.c
@@ -696,7 +696,8 @@
{
WineProc=(DWORD)AboutDlgProc;
Win16Proc=(DWORD)GetWndProcEntry16("AboutDlgProc");
- Win32Proc=(DWORD)RELAY32_GetEntryPoint("WINPROCS32","AboutDlgProc",0);
+ Win32Proc=(DWORD)RELAY32_GetEntryPoint(RELAY32_GetBuiltinDLL("WINPROCS32"),
+ "AboutDlgProc",0);
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
initialized=1;
}
@@ -752,7 +753,7 @@
*/
DWORD DoEnvironmentSubst(LPSTR str,WORD len)
{
- dprintf_reg(stdnimp, "DoEnvironmentSubst(%s,%x): Empyt Stub !!!\n",str,len);
+ dprintf_reg(stdnimp, "DoEnvironmentSubst(%s,%x): Empty Stub !!!\n",str,len);
return 0;
}
diff --git a/misc/toolhelp.c b/misc/toolhelp.c
index ccde79a..cd34e20 100644
--- a/misc/toolhelp.c
+++ b/misc/toolhelp.c
@@ -64,7 +64,7 @@
if (i==-1)
return FALSE;
memcpy(notifys+i,notifys+(i+1),sizeof(struct notify)*(nrofnotifys-i-1));
- notifys=(struct notify*)realloc(notifys,(nrofnotifys-1)*sizeof(struct notify));
+ notifys=(struct notify*)xrealloc(notifys,(nrofnotifys-1)*sizeof(struct notify));
nrofnotifys--;
return TRUE;
}
diff --git a/misc/xmalloc.c b/misc/xmalloc.c
index 58b9681..d79bd20 100644
--- a/misc/xmalloc.c
+++ b/misc/xmalloc.c
@@ -5,8 +5,8 @@
the return value yourself, for instance because you don't have a good
way to handle a zero return value.
- Typically, Wine's own memory requests should be handles by this function,
- while the client's should use malloc directly (and Wine should return an
+ Typically, Wine's own memory requests should be handled by this function,
+ while the clients should use malloc directly (and Wine should return an
error to the client if allocation fails).
Copyright 1995 by Morten Welinder.
diff --git a/miscemu/dosmem.c b/miscemu/dosmem.c
index 4568eb8..92b0cdc 100644
--- a/miscemu/dosmem.c
+++ b/miscemu/dosmem.c
@@ -136,7 +136,7 @@
*
* Increment the BIOS tick counter.
*/
-static void DOSMEM_Alarm(void)
+void DOSMEM_Alarm(void)
{
pBiosData->Ticks = INT1A_GetTicksSinceMidnight();
printf( "Ticks = %ld\n", pBiosData->Ticks );
diff --git a/miscemu/dpmi.c b/miscemu/dpmi.c
index 2b3c0f8..2f9319d 100644
--- a/miscemu/dpmi.c
+++ b/miscemu/dpmi.c
@@ -290,11 +290,23 @@
case 0x0601: /* Unlock linear region */
break; /* Just ignore it */
+ case 0x0602: /* Unlock real-mode region */
+ break; /* Just ignore it */
+
+ case 0x0603: /* Lock real-mode region */
+ break; /* Just ignore it */
+
case 0x0604: /* Get page size */
BX_reg(&context) = 0;
CX_reg(&context) = 4096;
break;
+ case 0x0702: /* Mark page as demand-paging candidate */
+ break; /* Just ignore it */
+
+ case 0x0703: /* Discard page contents */
+ break; /* Just ignore it */
+
default:
INT_BARF( &context, 0x31 );
AX_reg(&context) = 0x8001; /* unsupported function */
diff --git a/miscemu/instr.c b/miscemu/instr.c
index 14ac461..1e54951 100644
--- a/miscemu/instr.c
+++ b/miscemu/instr.c
@@ -30,6 +30,7 @@
{
fprintf( stderr, "Direct access to segment 0x40 (cs:ip=%04x:%04lx).\n",
CS_reg(context), EIP_reg(context) );
+ DOSMEM_Alarm(); /* Increment BIOS clock */
return DOSMEM_BiosSeg;
}
return 0; /* Can't replace selector */
diff --git a/miscemu/int21.c b/miscemu/int21.c
index a7d9ec0..f406ef7 100644
--- a/miscemu/int21.c
+++ b/miscemu/int21.c
@@ -560,8 +560,8 @@
return 0;
}
memcpy( dta->mask, mask, sizeof(dta->mask) );
- dta->drive = (path[1] == ':') ? toupper(path[0]) - 'A'
- : DRIVE_GetCurrentDrive();
+ dta->drive = (path[0] && (path[1] == ':')) ? toupper(path[0]) - 'A'
+ : DRIVE_GetCurrentDrive();
dta->count = 0;
dta->search_attr = CL_reg(context);
return 1;
@@ -694,86 +694,76 @@
}
-static void DumpFCB(BYTE *fcb)
-{
- int x, y;
-
- fcb -= 7;
-
- for (y = 0; y !=2 ; y++) {
- for (x = 0; x!=15;x++)
- dprintf_int(stddeb, "%02x ", *fcb++);
- dprintf_int(stddeb,"\n");
- }
-}
-
/* microsoft's programmers should be shot for using CP/M style int21
calls in Windows for Workgroup's winfile.exe */
-static void FindFirstFCB(struct sigcontext_struct *context)
+static int INT21_FindFirstFCB( struct sigcontext_struct *context )
{
- BYTE *fcb = PTR_SEG_OFF_TO_LIN(DS_reg(context), DX_reg(context));
- struct fcb *standard_fcb;
- struct fcb *output_fcb;
- int drive;
- char path[12];
+ BYTE *fcb = (BYTE *)PTR_SEG_OFF_TO_LIN(DS_reg(context), DX_reg(context));
+ FINDFILE_FCB *pFCB;
+ BYTE attr;
+ char buffer[] = "A:.";
+ const char *unixPath;
- BYTE *dta = GetCurrentDTA();
+ if (*fcb == 0xff)
+ {
+ attr = fcb[6];
+ pFCB = (FINDFILE_FCB *)(fcb + 7);
+ }
+ else
+ {
+ attr = 0;
+ pFCB = (FINDFILE_FCB *)fcb;
+ }
- DumpFCB( fcb );
-
- if ((*fcb) == 0xff)
- {
- standard_fcb = (struct fcb *)(fcb + 7);
- output_fcb = (struct fcb *)(dta + 7);
- *dta = 0xff;
- }
- else
- {
- standard_fcb = (struct fcb *)fcb;
- output_fcb = (struct fcb *)dta;
- }
+ buffer[0] += DOS_GET_DRIVE( pFCB->drive );
+ pFCB->unixPath = NULL;
+ if (!(unixPath = DOSFS_GetUnixFileName( buffer, TRUE ))) return 0;
+ pFCB->unixPath = xstrdup( unixPath );
+ pFCB->count = 0;
+ return 1;
+}
- if (standard_fcb->drive)
- {
- drive = standard_fcb->drive - 1;
- if (!DRIVE_IsValid(drive))
- {
- DOS_ERROR(ER_InvalidDrive, EC_MediaError, SA_Abort, EL_Disk);
- AX_reg(context) = 0xff;
- return;
- }
- }
- else
- drive = DRIVE_GetCurrentDrive();
- output_fcb->drive = drive;
+static int INT21_FindNextFCB( struct sigcontext_struct *context )
+{
+ BYTE *fcb = (BYTE *)PTR_SEG_OFF_TO_LIN(DS_reg(context), DX_reg(context));
+ FINDFILE_FCB *pFCB;
+ DOS_DIRENTRY_LAYOUT *pResult = (DOS_DIRENTRY_LAYOUT *)GetCurrentDTA();
+ DOS_DIRENT entry;
+ BYTE attr;
+ int count;
- if (*(fcb) == 0xff)
- {
- if (*(fcb+6) & FA_LABEL) /* return volume label */
- {
- *(dta+6) = FA_LABEL;
- memset(&output_fcb->name, ' ', 11);
- memcpy(output_fcb->name, DRIVE_GetLabel(drive), 11);
- AX_reg(context) = 0x00;
- return;
- }
- }
+ if (*fcb == 0xff)
+ {
+ attr = fcb[6];
+ pFCB = (FINDFILE_FCB *)(fcb + 7);
+ }
+ else
+ {
+ attr = 0;
+ pFCB = (FINDFILE_FCB *)fcb;
+ }
- strncpy(output_fcb->name, standard_fcb->name, 11);
- if (*fcb == 0xff)
- *(dta+6) = ( *(fcb+6) & (!FA_DIRECTORY));
+ if (!pFCB->unixPath) return 0;
+ if (!(count = DOSFS_FindNext( pFCB->unixPath, pFCB->filename,
+ DOS_GET_DRIVE( pFCB->drive ), attr,
+ pFCB->count, &entry )))
+ {
+ free( pFCB->unixPath );
+ pFCB->unixPath = NULL;
+ return 0;
+ }
+ pFCB->count += count;
-#if 0
- sprintf(path,"%c:*.*",drive+'A');
- if ((output_fcb->directory = DOS_opendir(path))==NULL)
- {
- Error (PathNotFound, EC_MediaError, EL_Disk);
- AX_reg(context) = 0xff;
- return;
- }
-#endif
+ memcpy( pResult->filename, entry.name, sizeof(pResult->filename) );
+ pResult->fileattr = entry.attr;
+ memset( pResult->reserved, 0, sizeof(pResult->reserved) );
+ pResult->filetime = entry.time;
+ pResult->filedate = entry.date;
+ pResult->cluster = 0; /* what else? */
+ pResult->filesize = entry.size;
+ return 1;
}
@@ -975,7 +965,6 @@
case 0x0c: /* FLUSH BUFFER AND READ STANDARD INPUT */
case 0x0f: /* OPEN FILE USING FCB */
case 0x10: /* CLOSE FILE USING FCB */
- case 0x12: /* FIND NEXT MATCHING FILE USING FCB */
case 0x14: /* SEQUENTIAL READ FROM FCB FILE */
case 0x15: /* SEQUENTIAL WRITE TO FCB FILE */
case 0x16: /* CREATE OR TRUNCATE FILE USING FCB */
@@ -1017,7 +1006,15 @@
break;
case 0x11: /* FIND FIRST MATCHING FILE USING FCB */
- FindFirstFCB(&context);
+ if (!INT21_FindFirstFCB(&context))
+ {
+ AL_reg(&context) = 0xff;
+ break;
+ }
+ /* else fall through */
+
+ case 0x12: /* FIND NEXT MATCHING FILE USING FCB */
+ AL_reg(&context) = INT21_FindNextFCB(&context) ? 0x00 : 0xff;
break;
case 0x13: /* DELETE FILE USING FCB */
@@ -1200,8 +1197,8 @@
case 0x3f: /* "READ" - READ FROM FILE OR DEVICE */
{
LONG result = _hread( BX_reg(&context),
- PTR_SEG_OFF_TO_LIN( DS_reg(&context),
- DX_reg(&context) ),
+ (SEGPTR)MAKELONG( DX_reg(&context),
+ DS_reg(&context) ),
CX_reg(&context) );
if (result == -1)
{
@@ -1569,7 +1566,7 @@
case 0x68: /* "FFLUSH" - COMMIT FILE */
case 0x6a: /* COMMIT FILE */
- if (fsync( FILE_GetUnixHandle( BX_reg(&context) )) == -1)
+ if (fsync( FILE_GetUnixTaskHandle( BX_reg(&context) )) == -1)
{
FILE_SetDosError();
AX_reg(&context) = DOS_ExtendedError;
diff --git a/miscemu/int2f.c b/miscemu/int2f.c
index e8d0948..f3fd665 100644
--- a/miscemu/int2f.c
+++ b/miscemu/int2f.c
@@ -46,6 +46,8 @@
{
case 0x10: /* smartdrv */
break; /* not installed */
+ case 0x11: /* dblspace */
+ break; /* not installed */
case 0x12: /* realtime compression interface */
break; /* not installed */
default:
diff --git a/objects/color.c b/objects/color.c
index 03cefa9..9d78e54 100644
--- a/objects/color.c
+++ b/objects/color.c
@@ -12,6 +12,8 @@
#include "gdi.h"
#include "color.h"
#include "palette.h"
+#include "stddebug.h"
+#include "debug.h"
#include "xmalloc.h"
Colormap COLOR_WinColormap = 0;
@@ -301,8 +303,18 @@
{
WORD index = 0;
WORD *mapping;
+ unsigned char spec_type;
- if (dc && (dc->w.bitsPerPixel == 1) && ((color >> 24) == 0))
+ spec_type = color >> 24;
+ if (spec_type == 0xff)
+ {
+ spec_type = 0; /* 'write' seems to need that for 'Page 1' text */
+ color &= 0xffffff;
+ }
+ if (spec_type > 2)
+ fprintf(stderr, "COLOR_ToPhysical : color >> 24 not in {-1,0,1,2} : %08lx\n",
+ color);
+ if (dc && (dc->w.bitsPerPixel == 1) && (spec_type == 0))
{
/* monochrome */
if (((color >> 16) & 0xff) +
@@ -320,7 +332,7 @@
unsigned idx;
PALETTEOBJ * palPtr;
- switch(color >> 24)
+ switch(spec_type)
{
case 0: /* RGB */
case 2: /* PALETTERGB -- needs some work, but why bother; we've got a REALLY LARGE number of colors...? */
@@ -362,8 +374,9 @@
return (red << COLOR_Redshift) | (green << COLOR_Greenshift) | (blue << COLOR_Blueshift);
}
}
- else switch(color >> 24)
+ else switch(spec_type)
{
+ default:
case 0: /* RGB */
index = GetNearestPaletteIndex( STOCK_DEFAULT_PALETTE, color );
break;
diff --git a/objects/cursoricon.c b/objects/cursoricon.c
index 7525855..763f53c 100644
--- a/objects/cursoricon.c
+++ b/objects/cursoricon.c
@@ -499,7 +499,8 @@
* CreateCursor (USER.406)
*/
HCURSOR CreateCursor( HINSTANCE hInstance, INT xHotSpot, INT yHotSpot,
- INT nWidth, INT nHeight, LPVOID lpANDbits, LPVOID lpXORbits)
+ INT nWidth, INT nHeight,
+ const BYTE *lpANDbits, const BYTE *lpXORbits )
{
CURSORICONINFO info = { { xHotSpot, yHotSpot }, nWidth, nHeight, 0, 1, 1 };
@@ -512,8 +513,8 @@
/***********************************************************************
* CreateIcon (USER.407)
*/
-HICON CreateIcon( HANDLE hInstance, INT nWidth, INT nHeight, BYTE bPlanes,
- BYTE bBitsPixel, LPSTR lpANDbits, LPSTR lpXORbits)
+HICON CreateIcon( HINSTANCE hInstance, INT nWidth, INT nHeight, BYTE bPlanes,
+ BYTE bBitsPixel, const BYTE* lpANDbits, const BYTE* lpXORbits)
{
CURSORICONINFO info = { { 0, 0 }, nWidth, nHeight, 0, bPlanes, bBitsPixel };
@@ -527,7 +528,7 @@
* CreateCursorIconIndirect (USER.408)
*/
HANDLE CreateCursorIconIndirect( HANDLE hInstance, CURSORICONINFO *info,
- LPSTR lpANDbits, LPSTR lpXORbits )
+ const BYTE *lpANDbits, const BYTE *lpXORbits )
{
HANDLE handle;
char *ptr;
@@ -611,7 +612,7 @@
/***********************************************************************
* DrawIcon (USER.84)
*/
-BOOL DrawIcon( HDC hdc, short x, short y, HICON hIcon )
+BOOL DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
{
CURSORICONINFO *ptr;
HDC hMemDC;
diff --git a/objects/dc.c b/objects/dc.c
index 27c1303..029534c 100644
--- a/objects/dc.c
+++ b/objects/dc.c
@@ -158,7 +158,7 @@
/***********************************************************************
- * DC_SetupDCForPatBlt
+ * DC_SetupGCForPatBlt
*
* Setup the GC for a PatBlt operation using current brush.
* If fMapColors is TRUE, X pixels are mapped to Windows colors.
@@ -239,7 +239,7 @@
/***********************************************************************
- * DC_SetupDCForBrush
+ * DC_SetupGCForBrush
*
* Setup dc->u.x.gc for drawing operations using current brush.
* Return FALSE if brush is BS_NULL, TRUE otherwise.
@@ -251,7 +251,7 @@
/***********************************************************************
- * DC_SetupDCForPen
+ * DC_SetupGCForPen
*
* Setup dc->u.x.gc for drawing operations using current pen.
* Return FALSE if pen is PS_NULL, TRUE otherwise.
@@ -450,7 +450,7 @@
/***********************************************************************
* CreateDC (GDI.53)
*/
-HDC CreateDC( LPCSTR driver, LPCSTR device, LPCSTR output, LPCSTR initData )
+HDC CreateDC( LPCTSTR driver, LPCTSTR device, LPCTSTR output, const DEVMODE* initData )
{
DC * dc;
HANDLE handle;
@@ -494,7 +494,7 @@
/***********************************************************************
* CreateIC (GDI.153)
*/
-HDC CreateIC( LPSTR driver, LPSTR device, LPSTR output, LPSTR initData )
+HDC CreateIC( LPCTSTR driver, LPCTSTR device, LPCTSTR output, const DEVMODE* initData )
{
/* Nothing special yet for ICs */
return CreateDC( driver, device, output, initData );
diff --git a/objects/font.c b/objects/font.c
index 95c8332..c05ba02 100644
--- a/objects/font.c
+++ b/objects/font.c
@@ -123,20 +123,26 @@
char pattern[100];
const char *family, *weight, *charset;
char **names;
- char slant, spacing;
+ char slant, oldspacing, spacing;
int width, height, oldheight, count;
XFontStruct * fontStruct;
+ dprintf_font(stddeb,
+ "FONT_MatchFont(H,W = %d,%d; Weight = %d; Italic = %d; FaceName = '%s'\n",
+ font->lfHeight, font->lfWidth, font->lfWeight, font->lfItalic, font->lfFaceName);
weight = (font->lfWeight > 550) ? "bold" : "medium";
slant = font->lfItalic ? 'i' : 'r';
- height = font->lfHeight * dc->w.VportExtX / dc->w.WndExtX;
+ if (font->lfHeight == -1)
+ height = 0;
+ else
+ height = font->lfHeight * dc->w.VportExtX / dc->w.WndExtX;
if (height == 0) height = 120; /* Default height = 12 */
else if (height < 0)
{
/* If height is negative, it means the height of the characters */
/* *without* the internal leading. So we adjust it a bit to */
/* compensate. 5/4 seems to give good results for small fonts. */
- height = 10 * (-height * 5 / 4);
+ height = 10 * (-height * 8 / 7);
}
else height *= 10;
width = 10 * (font->lfWidth * dc->w.VportExtY / dc->w.WndExtY);
@@ -172,6 +178,7 @@
}
oldheight = height;
+ oldspacing = spacing;
while (TRUE) {
/* Width==0 seems not to be a valid wildcard on SGI's, using * instead */
if ( width == 0 )
@@ -183,22 +190,30 @@
dprintf_font(stddeb, "FONT_MatchFont: '%s'\n", pattern );
names = XListFonts( display, pattern, 1, &count );
if (count > 0) break;
+ if (spacing == 'm') /* try 'c' if no 'm' found */ {
+ spacing = 'c';
+ continue;
+ } else if (spacing == 'p') /* try '*' if no 'p' found */ {
+ spacing = '*';
+ continue;
+ }
+ spacing = oldspacing;
height -= 10;
if (height < 10) {
- dprintf_font(stddeb,"*** No match for %s\n", pattern );
- if(slant == 'i') {
+ if (slant == 'i') {
/* try oblique if no italic font */
slant = 'o';
height = oldheight;
continue;
}
- if (spacing == 'm') {
+ if (spacing == 'm' && strcmp(family, "*-*") != 0) {
/* If a fixed spacing font could not be found, ignore
* the family */
family = "*-*";
height = oldheight;
continue;
}
+ fprintf(stderr, "FONT_MatchFont(%s) : returning NULL\n", pattern);
return NULL;
}
}
@@ -296,12 +311,20 @@
HFONT CreateFontIndirect( const LOGFONT * font )
{
FONTOBJ * fontPtr;
- HFONT hfont = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC );
+ HFONT hfont;
+
+ if (!font)
+ {
+ fprintf(stderr, "CreateFontIndirect : font is NULL : returning NULL\n");
+ return 0;
+ }
+ hfont = GDI_AllocObject( sizeof(FONTOBJ), FONT_MAGIC );
if (!hfont) return 0;
fontPtr = (FONTOBJ *) GDI_HEAP_LIN_ADDR( hfont );
memcpy( &fontPtr->logfont, font, sizeof(LOGFONT) );
AnsiLower( fontPtr->logfont.lfFaceName );
- dprintf_font(stddeb,"CreateFontIndirect(%p); return "NPFMT"\n",font,hfont);
+ dprintf_font(stddeb,"CreateFontIndirect(%p (%d,%d)); return "NPFMT"\n",
+ font, font->lfHeight, font->lfWidth, hfont);
return hfont;
}
@@ -316,7 +339,12 @@
{
LOGFONT logfont = { height, width, esc, orient, weight, italic, underline,
strikeout, charset, outpres, clippres, quality, pitch, };
- if (name) strncpy( logfont.lfFaceName, name, LF_FACESIZE );
+ dprintf_font(stddeb,"CreateFont(%d,%d)\n", height, width);
+ if (name)
+ {
+ strncpy( logfont.lfFaceName, name, LF_FACESIZE - 1 );
+ logfont.lfFaceName[LF_FACESIZE - 1] = '\0';
+ }
else logfont.lfFaceName[0] = '\0';
return CreateFontIndirect( &logfont );
}
@@ -344,8 +372,9 @@
XFontStruct * fontStruct;
dprintf_font(stddeb,"FONT_SelectObject(%p, "NPFMT", %p)\n",
dc, hfont, font);
- /* Load font if necessary */
+#if 0 /* From the code in SelectObject, this can not happen */
+ /* Load font if necessary */
if (!font)
{
HFONT hnewfont;
@@ -355,6 +384,7 @@
DEFAULT_QUALITY, FF_DONTCARE, "*" );
font = (FONTOBJ *) GDI_HEAP_LIN_ADDR( hnewfont );
}
+#endif
if (dc->header.wMagic == METAFILE_DC_MAGIC)
if (MF_CreateFontIndirect(dc, hfont, &(font->logfont)))
@@ -627,8 +657,10 @@
int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz)
{
int i;
+#if 0
dprintf_font(stddeb,"ParseFontParms('%s', %d, %p, %d);\n",
lpFont, wParmsNo, lpRetStr, wMaxSiz);
+#endif
if (lpFont == NULL) return 0;
if (lpRetStr == NULL) return 0;
for (i = 0; (*lpFont != '\0' && i != wParmsNo); ) {
@@ -641,7 +673,9 @@
for (i = 0; (*lpFont != '\0' && *lpFont != '-' && i < wMaxSiz); i++)
*(lpRetStr + i) = *lpFont++;
*(lpRetStr + i) = '\0';
+#if 0
dprintf_font(stddeb,"ParseFontParms // '%s'\n", lpRetStr);
+#endif
return i;
}
else
@@ -714,6 +748,7 @@
lpNewFont->lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
break;
case 'm':
+ case 'c':
lpNewFont->lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
break;
default:
@@ -734,7 +769,7 @@
/*************************************************************************
* EnumFonts [GDI.70]
*/
-int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
+INT EnumFonts(HDC hDC, LPCTSTR lpFaceName, FONTENUMPROC lpEnumFunc, LPARAM lpData)
{
HANDLE hLog;
HANDLE hMet;
@@ -747,7 +782,7 @@
int nRet = 0;
int i;
- dprintf_font(stddeb,"EnumFonts("NPFMT", %p='%s', %08lx, %p)\n",
+ dprintf_font(stddeb,"EnumFonts("NPFMT", %p='%s', %08lx, %08lx)\n",
hDC, lpFaceName, lpFaceName, (LONG)lpEnumFunc, lpData);
if (lpEnumFunc == 0) return 0;
hLog = GDI_HEAP_ALLOC( sizeof(LOGFONT) + LF_FACESIZE );
@@ -804,7 +839,7 @@
/*************************************************************************
* EnumFontFamilies [GDI.330]
*/
-int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FONTENUMPROC lpEnumFunc, LPARAM lpData)
+INT EnumFontFamilies(HDC hDC, LPCTSTR lpszFamily, FONTENUMPROC lpEnumFunc, LPARAM lpData)
{
HANDLE hLog;
HANDLE hMet;
diff --git a/objects/gdiobj.c b/objects/gdiobj.c
index 12cacd3..d840c1e 100644
--- a/objects/gdiobj.c
+++ b/objects/gdiobj.c
@@ -246,7 +246,7 @@
else
ptr = (GDIOBJHDR *) GDI_HEAP_LIN_ADDR( handle );
if (!ptr) return NULL;
- if (ptr->wMagic != magic) return NULL;
+ if ((magic != MAGIC_DONTCARE) && (ptr->wMagic != magic)) return NULL;
return ptr;
}
@@ -254,7 +254,7 @@
/***********************************************************************
* DeleteObject (GDI.69)
*/
-BOOL DeleteObject( HANDLE obj )
+BOOL DeleteObject( HGDIOBJ obj )
{
/* Check if object is valid */
@@ -377,7 +377,7 @@
/***********************************************************************
* EnumObjects (GDI.71)
*/
-int EnumObjects( HDC hdc, int nObjType, FARPROC lpEnumFunc, LPARAM lParam )
+INT EnumObjects( HDC hdc, INT nObjType, GOBJENUMPROC lpEnumFunc, LPARAM lParam )
{
/* Solid colors to enumerate */
static const COLORREF solid_colors[] =
diff --git a/objects/metafile.c b/objects/metafile.c
index ab0b7df..20d2235 100644
--- a/objects/metafile.c
+++ b/objects/metafile.c
@@ -10,6 +10,7 @@
#include <fcntl.h>
#include "gdi.h"
#include "bitmap.h"
+#include "file.h"
#include "metafile.h"
#include "stddebug.h"
/* #define DEBUG_METAFILE */
@@ -55,7 +56,7 @@
GlobalFree(hmf);
return 0;
}
- if (_lread(mf->hFile, (char *)mh, MFHEADERSIZE) == HFILE_ERROR) {
+ if (FILE_Read(mf->hFile, (char *)mh, MFHEADERSIZE) == HFILE_ERROR) {
GlobalFree(mf->hMetaHdr);
GlobalFree(hmf);
return 0;
@@ -77,7 +78,7 @@
/******************************************************************
* CreateMetafile GDI.125
*/
-HANDLE CreateMetaFile(LPSTR lpFilename)
+HANDLE CreateMetaFile(LPCTSTR lpFilename)
{
DC *dc;
HANDLE handle;
@@ -254,9 +255,9 @@
{
if (mh->mtType == 1) /* disk based metafile */
{
- _lread(mf->hFile, buffer, sizeof(METARECORD));
+ FILE_Read(mf->hFile, buffer, sizeof(METARECORD));
mr = (METARECORD *)buffer;
- _lread(mf->hFile, (char *)(mr->rdParam + 1), (mr->rdSize * 2) -
+ FILE_Read(mf->hFile, (char *)(mr->rdParam + 1), (mr->rdSize * 2) -
sizeof(METARECORD));
mf->MetaOffset += mr->rdSize * 2;
}
diff --git a/objects/oembitmap.c b/objects/oembitmap.c
index facd5b4..0b2d9a5 100644
--- a/objects/oembitmap.c
+++ b/objects/oembitmap.c
@@ -323,9 +323,8 @@
*
* Create the 2 bitmaps from XPM data.
*/
-static BOOL OBM_CreateBitmaps( char **data, BOOL color, BOOL mask,
- HBITMAP *hBitmap, HBITMAP *hBitmapMask,
- POINT *hotspot )
+static BOOL OBM_CreateBitmaps( char **data, BOOL color, HBITMAP *hBitmap,
+ HBITMAP *hBitmapMask, POINT *hotspot )
{
Pixmap pixmap, pixmask;
XpmAttributes attrs;
@@ -348,14 +347,14 @@
}
*hBitmap = OBM_MakeBitmap( attrs.width, attrs.height,
attrs.depth, pixmap );
- if (mask) *hBitmapMask = OBM_MakeBitmap( attrs.width, attrs.height,
- 1, pixmask );
+ if (hBitmapMask) *hBitmapMask = OBM_MakeBitmap( attrs.width, attrs.height,
+ 1, pixmask );
if (!*hBitmap)
{
if (pixmap) XFreePixmap( display, pixmap );
if (pixmask) XFreePixmap( display, pixmask );
if (*hBitmap) GDI_FreeObject( *hBitmap );
- if (*hBitmapMask) GDI_FreeObject( *hBitmapMask );
+ if (hBitmapMask && *hBitmapMask) GDI_FreeObject( *hBitmapMask );
return FALSE;
}
else return TRUE;
@@ -367,17 +366,17 @@
*/
HBITMAP OBM_LoadBitmap( WORD id )
{
- HBITMAP hbitmap, hbitmask;
+ HBITMAP hbitmap;
if ((id < OBM_FIRST) || (id > OBM_LAST)) return 0;
id -= OBM_FIRST;
if (!OBM_InitColorSymbols()) return 0;
- if (!CallTo32_LargeStack( (int(*)())OBM_CreateBitmaps, 6,
+ if (!CallTo32_LargeStack( (int(*)())OBM_CreateBitmaps, 5,
OBM_Pixmaps_Data[id].data,
OBM_Pixmaps_Data[id].color,
- FALSE, &hbitmap, &hbitmask, NULL, NULL ))
+ &hbitmap, NULL, NULL ))
{
fprintf( stderr, "Error creating OEM bitmap %d\n", OBM_FIRST+id );
return 0;
@@ -417,9 +416,9 @@
if (!OBM_InitColorSymbols()) return 0;
- if (!CallTo32_LargeStack( (int(*)())OBM_CreateBitmaps, 6,
+ if (!CallTo32_LargeStack( (int(*)())OBM_CreateBitmaps, 5,
fCursor ? OBM_Cursors_Data[id] : OBM_Icons_Data[id],
- !fCursor, TRUE, &hXorBits, &hAndBits, &hotspot ))
+ !fCursor, &hXorBits, &hAndBits, &hotspot ))
{
fprintf( stderr, "Error creating OEM cursor/icon %d\n", id );
return 0;
diff --git a/objects/palette.c b/objects/palette.c
index 1945bdf..a637d5a 100644
--- a/objects/palette.c
+++ b/objects/palette.c
@@ -76,7 +76,7 @@
/***********************************************************************
* CreatePalette (GDI.360)
*/
-HPALETTE CreatePalette( LOGPALETTE * palette )
+HPALETTE CreatePalette( const LOGPALETTE* palette )
{
PALETTEOBJ * palettePtr;
HPALETTE hpalette;
diff --git a/objects/pen.c b/objects/pen.c
index 13c2f80..bc5a986 100644
--- a/objects/pen.c
+++ b/objects/pen.c
@@ -24,7 +24,7 @@
/***********************************************************************
* CreatePenIndirect (GDI.62)
*/
-HPEN CreatePenIndirect( LOGPEN * pen )
+HPEN CreatePenIndirect( const LOGPEN * pen )
{
PENOBJ * penPtr;
HPEN hpen;
diff --git a/objects/region.c b/objects/region.c
index 13b3799..1874a91 100644
--- a/objects/region.c
+++ b/objects/region.c
@@ -66,7 +66,7 @@
/***********************************************************************
* CreateRectRgn (GDI.64)
*/
-HRGN CreateRectRgn( short left, short top, short right, short bottom )
+HRGN CreateRectRgn( INT left, INT top, INT right, INT bottom )
{
HRGN hrgn;
RGNOBJ *obj;
@@ -93,7 +93,7 @@
/***********************************************************************
* CreateRectRgnIndirect (GDI.65)
*/
-HRGN CreateRectRgnIndirect( LPRECT rect )
+HRGN CreateRectRgnIndirect( const RECT* rect )
{
return CreateRectRgn( rect->left, rect->top, rect->right, rect->bottom );
}
@@ -124,8 +124,8 @@
/***********************************************************************
* CreateRoundRectRgn (GDI.444)
*/
-HRGN CreateRoundRectRgn( short left, short top, short right, short bottom,
- short ellipse_width, short ellipse_height )
+HRGN CreateRoundRectRgn( INT left, INT top, INT right, INT bottom,
+ INT ellipse_width, INT ellipse_height )
{
RGNOBJ * obj;
HRGN hrgn;
@@ -240,7 +240,7 @@
/***********************************************************************
* CreatePolygonRgn (GDI.63)
*/
-HRGN CreatePolygonRgn( POINT * points, INT count, INT mode )
+HRGN CreatePolygonRgn( const POINT * points, INT count, INT mode )
{
return CreatePolyPolygonRgn( points, &count, 1, mode );
}
@@ -249,7 +249,7 @@
/***********************************************************************
* CreatePolyPolygonRgn (GDI.451)
*/
-HRGN CreatePolyPolygonRgn( POINT * points, INT * count,
+HRGN CreatePolyPolygonRgn( const POINT * points, const INT * count,
INT nbpolygons, INT mode )
{
RGNOBJ * obj;
diff --git a/objects/text.c b/objects/text.c
index 6b4f8e6..ad96f0e 100644
--- a/objects/text.c
+++ b/objects/text.c
@@ -184,12 +184,12 @@
/***********************************************************************
* DrawText (USER.85)
*/
-int DrawText( HDC hdc, LPCSTR str, int count, LPRECT rect, WORD flags )
+INT DrawText( HDC hdc, LPCTSTR str, INT i_count, LPRECT rect, UINT flags )
{
SIZE size;
const char *strPtr;
static char line[1024];
- int len, lh;
+ int len, lh, count=i_count;
int prefix_x = 0;
int prefix_end = 0;
TEXTMETRIC tm;
diff --git a/rc/README b/rc/README
index d436c18..949335c 100644
--- a/rc/README
+++ b/rc/README
@@ -32,7 +32,6 @@
Bug Reports and Fixes
If you find a bug in winerc, you can report it to me,
-martin@cs.csufresno.edu (Martin von Loewis)
-or to comp.emulators.ms-windows.wine. If you can fix the bug, send the
-diffs & ChangeLog to wine-new@amscons.com (Bob Amstadt), or send it to
-me, and I will collect the fixes and forward them to wine-news.
+martin@cs.csufresno.edu (Martin von Loewis) or to
+comp.emulators.ms-windows.wine. If you can fix the bug, send the diffs
+and ChangeLog entry to julliard@lrc.epfl.ch (Alexandre Julliard).
diff --git a/resources/Makefile.in b/resources/Makefile.in
index 3ccf2b0..3bcc5ef 100644
--- a/resources/Makefile.in
+++ b/resources/Makefile.in
@@ -2,7 +2,7 @@
MODULE = resources
-LANGUAGES = En Es De No Fr Fi Da
+LANGUAGES = En Es De No Fr Fi Da Cz
SYSRES_SRCS = $(LANGUAGES:%=sysres_%.c)
diff --git a/resources/sysres.c b/resources/sysres.c
index 04a6d52..4dac4bf 100644
--- a/resources/sysres.c
+++ b/resources/sysres.c
@@ -16,6 +16,7 @@
#include "sysres_Fr.h"
#include "sysres_Fi.h"
#include "sysres_Da.h"
+#include "sysres_Cz.h"
static const struct resource * const * SYSRES_Resources[] =
@@ -26,7 +27,8 @@
sysres_No_Table, /* LANG_No */
sysres_Fr_Table, /* LANG_Fr */
sysres_Fi_Table, /* LANG_Fi */
- sysres_Da_Table /* LANG_Da */
+ sysres_Da_Table, /* LANG_Da */
+ sysres_Cz_Table /* LANG_Cz */
};
diff --git a/resources/sysres_Cz.rc b/resources/sysres_Cz.rc
new file mode 100644
index 0000000..9dc052f
--- /dev/null
+++ b/resources/sysres_Cz.rc
@@ -0,0 +1,200 @@
+SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
+{
+ MENUITEM "&Obnov", 61728
+ MENUITEM "Pøe&suò", 61456
+ MENUITEM "&Zmìò velikost", 61440
+ MENUITEM "Mi&nimalizuj", 61472
+ MENUITEM "Ma&ximalizuj", 61488
+ MENUITEM SEPARATOR
+ MENUITEM "&Zavøi\tAlt-F4", 61536
+ MENUITEM SEPARATOR
+ MENUITEM "&Pøepni do jiné úlohy...\tCtrl-Esc", 61744
+ MENUITEM SEPARATOR
+ MENUITEM "&O programu WINE", 61761
+}
+
+MSGBOX DIALOG 100, 80, 216, 168
+STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+BEGIN
+ ICON "", 1088, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE
+ LTEXT "", 100, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP
+ PUSHBUTTON "&Ok", 1, 16, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Storno", 2, 64, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Pøerušit", 3, 112, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Zkusit znovu", 4, 160, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Ignorovat", 5, 208, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Ano", 6, 256, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+ PUSHBUTTON "&Ne", 7, 304, 56, 40, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP
+END
+
+SHELL_ABOUT_MSGBOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 50, 44, 223, 200
+STYLE DS_LOCALEDIT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "O aplikaci %s"
+FONT 10, "System"
+{
+ DEFPUSHBUTTON "OK", 1, 91, 180, 40, 14
+ CONTROL "", -1, "STATIC", SS_BLACKFRAME | WS_CHILD | WS_VISIBLE | WS_DISABLED, 4, 35, 215, 140
+ LTEXT "Text", 100, 11, 40, 200, 130, SS_NOPREFIX | WS_GROUP
+ ICON "", 1088, 195, 10, 18, 20
+}
+
+
+OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Otevøenà souboru"
+FONT 8, "Helv"
+{
+ LTEXT "&jméno souboru:", 1090, 6, 6, 76, 9
+ EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP
+ LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP
+ LTEXT "&Adresáøe:", -1, 110, 6, 92, 9
+ LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP
+ LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP
+ LTEXT "&Typ zobrazených souborù:", 1089, 6, 104, 90, 9
+ COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Diskové jednotky:", 1091, 110, 104, 92, 9
+ COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OtevøÃt", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Nápovìda", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP
+ CHECKBOX "&Pouze pro ètenÃ", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+}
+
+
+SAVE_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ulož pod jménem..."
+FONT 8, "Helv"
+{
+ LTEXT "&Jméno souboru:", 1090, 6, 6, 76, 9
+ EDITTEXT 1152, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP
+ LISTBOX 1120, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP
+ LTEXT "&Adresáøe:", -1, 110, 6, 92, 9
+ LTEXT "", 1088, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP
+ LISTBOX 1121, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP
+ LTEXT "&Typ zobrazených souborù:", 1089, 6, 104, 90, 9
+ COMBOBOX 1136, 6, 114, 90, 36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ LTEXT "&Diskové jednotky:", 1091, 110, 104, 92, 9
+ COMBOBOX 1137, 110, 114, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "Ulož pod jménem", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Nápovìda", 1038, 208, 46, 56, 14, WS_GROUP | WS_TABSTOP
+ CHECKBOX "&Pouze pro ètenÃ", 1040, 208, 68, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+}
+
+
+PRINT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Tisk"
+FONT 8, "Helv"
+{
+ LTEXT "Tiskárna:", 1088, 6, 6, 40, 9
+ LTEXT "", 1089, 60, 6, 150, 9
+ GROUPBOX "Rozsah tisku", 1072, 6, 30, 160, 65, BS_GROUPBOX
+ RADIOBUTTON "Vytiskni vš&e", 1056, 16, 45, 60, 12
+ RADIOBUTTON "Vytiskni &výbìr", 1057, 16, 60, 60, 12
+ RADIOBUTTON "Vytiskni &zadané stránky", 1058, 16, 75, 60, 12
+ DEFPUSHBUTTON "Tiskni", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Nastavit...", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP
+ LTEXT "&Od:", 1090, 60, 80, 30, 9
+ LTEXT "&Do:", 1091, 120, 80, 30, 9
+ LTEXT "Kvalita &tisku:", 1092, 6, 100, 76, 9
+ COMBOBOX 1136, 80, 100, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ CHECKBOX "Tisk do so&uboru", 1040, 20, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ CHECKBOX "Kondenzované", 1041, 160, 100, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+}
+
+
+PRINT_SETUP DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Nastavenà zpùsobu tisku"
+FONT 8, "Helv"
+{
+ GROUPBOX "Tiskárna", 1072, 6, 10, 180, 65, BS_GROUPBOX
+ RADIOBUTTON "&Pøedvolená tiskárna", 1056, 16, 20, 80, 12
+ LTEXT "[none]", 1088, 35, 35, 120, 9
+ RADIOBUTTON "Specifická &tiskárna", 1057, 16, 50, 80, 12
+ COMBOBOX 1136, 35, 65, 149, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Dalšà volby...", 1024, 206, 46, 56, 14, WS_GROUP | WS_TABSTOP
+ GROUPBOX "Orientace", 1073, 6, 85, 100, 50, BS_GROUPBOX
+ RADIOBUTTON "Na &výšku", 1058, 50, 100, 40, 12
+ RADIOBUTTON "Na šÃø&ku", 1059, 50, 115, 40, 12
+ ICON "LANDSCAP", 1097, 10, 95, 32, 32
+ ICON "PORTRAIT", 1098, 10, 95, 32, 32
+ GROUPBOX "PapÃr", 1074, 120, 85, 180, 50, BS_GROUPBOX
+ LTEXT "&Formát", 1089, 130, 95, 30, 9
+ LTEXT "&Odkud", 1090, 130, 110, 30, 9
+ COMBOBOX 1137, 155, 95, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX 1138, 155, 110, 92, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP
+}
+
+
+CHOOSE_FONT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 134
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "PÃsmo"
+FONT 8, "Helv"
+{
+ LTEXT "PÃsmo:", 1088, 6, 6, 40, 9
+ LTEXT "", 1089, 60, 6, 150, 9
+ DEFPUSHBUTTON "Ok", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
+}
+
+
+CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Barvy"
+FONT 8, "Helv"
+{
+ LTEXT "&Základnà barvy:", 1088, 6, 6, 40, 9
+ LTEXT "&Barvy na zakázku:", 1089, 6, 126, 40, 9
+ LTEXT "Barva|Spoj&itá", 1090, 100, 146, 40, 9
+ LTEXT "&OdstÃn:", 1091, 150, 126, 40, 9
+ LTEXT "&Sytost:", 1092, 150, 146, 40, 9
+ LTEXT "&Jas:", 1093, 150, 166, 40, 9
+ LTEXT "Èe&rvená:", 1094, 150, 126, 40, 9
+ LTEXT "&Zelená:", 1095, 150, 146, 40, 9
+ LTEXT "&Modrá:", 1096, 150, 166, 40, 9
+ DEFPUSHBUTTON "Ok", 1, 6, 182, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Pøidat barvu", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "&Vyøadit barvu", 1025, 6, 164, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Storno", 2, 76, 182, 56, 14, WS_GROUP | WS_TABSTOP
+}
+
+
+FIND_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 84
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "HledánÃ"
+FONT 8, "Helv"
+{
+ LTEXT "&Vyhledat:", 1088, 6, 6, 40, 9
+ LTEXT "", 1089, 60, 6, 150, 9
+ CHECKBOX "Pouze &celá slova", 1040, 20, 30, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ CHECKBOX "&Rozlišovat malá a velká pÃsmena", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ GROUPBOX "Smìr", 1072, 90, 40, 80, 40, BS_GROUPBOX
+ RADIOBUTTON "&Nahoru", 1056, 100, 50, 50, 12
+ RADIOBUTTON "&Dolu", 1057, 150, 50, 50, 12
+ DEFPUSHBUTTON "Vyhledat d&alšÃ", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "ZavøÃt", 2, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
+}
+
+
+REPLACE_TEXT DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 114
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Zámìna"
+FONT 8, "Helv"
+{
+ LTEXT "&Vyhledat:", 1088, 6, 6, 40, 9
+ LTEXT "", 1089, 60, 6, 150, 9
+ LTEXT "&Zamìnit za:", 1090, 6, 26, 40, 9
+ LTEXT "", 1091, 60, 26, 150, 9
+ CHECKBOX "Pouze &celá slova", 1040, 20, 40, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ CHECKBOX "&Rozlišovat malá a velká pÃsmena", 1041, 20, 60, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
+ DEFPUSHBUTTON "Vyhledat d&alšÃ", 1, 206, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Za&mìnit", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "Zamìnit ve vý&bìru", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP
+ PUSHBUTTON "ZavøÃt", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP
+}
diff --git a/documentation/apiw.index b/tools/apiw.index
similarity index 100%
rename from documentation/apiw.index
rename to tools/apiw.index
diff --git a/tools/build.c b/tools/build.c
index e9667ad..13d2913 100644
--- a/tools/build.c
+++ b/tools/build.c
@@ -915,12 +915,12 @@
}
printf("};\n\n");
- printf( "static WIN32_builtin dll={\"%s\",functions,%d,0};\n",
- UpperDLLName, Limit+1);
+ printf( "static WIN32_builtin dll={\"%s\",functions,%d,%d,0};\n",
+ UpperDLLName, Limit+1, Base);
printf( "void %s_Init(void)\n{\n",UpperDLLName);
printf( "\tdll.next=WIN32_builtin_list;\n");
- printf( "\tWIN32_builtin_list=&dll;\n}");
+ printf( "\tWIN32_builtin_list=&dll;\n\tRELAY32_MakeFakeModule(&dll);\n}");
}
diff --git a/tools/makehtml.pl b/tools/makehtml.pl
index cfd8408..e51cf47 100644
--- a/tools/makehtml.pl
+++ b/tools/makehtml.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-open(APIW,"./apiw.index");
+open(APIW,"./apiw.index") or die "Can't find ./apiw.index";
while(<APIW>)
{
($func,$link)=split /:/;
@@ -9,13 +9,13 @@
}
close(APIW);
-open(WINDOWS,"../include/windows.h");
+open(WINDOWS,"../include/windows.h") or die "Can't find ../include/windows.h";
while(<WINDOWS>) { add_func($_) if /AccessResource/../wvsprintf/; }
close(WINDOWS);
-open(TOOLHELP,"../include/toolhelp.h");
+open(TOOLHELP,"../include/toolhelp.h") or die "Can't find ../include/toolhelp.h";
while(<TOOLHELP>) { add_func($_) if /GlobalInfo/../MemoryWrite/; }
close(TOOLHELP);
-open(COMMDLG,"../include/commdlg.h");
+open(COMMDLG,"../include/commdlg.h") or die "Can't find ../include/commdlg.h";
while(<COMMDLG>) { add_func($_) if /ChooseColor/../ReplaceText/; }
close(COMMDLG);
diff --git a/win32/Makefile.in b/win32/Makefile.in
index 2300885..b7ea362 100644
--- a/win32/Makefile.in
+++ b/win32/Makefile.in
@@ -8,6 +8,7 @@
environment.c \
error.c \
file.c \
+ gdi32.c \
heap.c \
init.c \
memory.c \
diff --git a/win32/gdi32.c b/win32/gdi32.c
new file mode 100644
index 0000000..782c0b3
--- /dev/null
+++ b/win32/gdi32.c
@@ -0,0 +1,74 @@
+
+/*
+ * Win32 GDI functions
+ *
+ * Copyright 1996 Thomas Sandford t.d.g.sandford@prds-grn.demon.co.uk
+ */
+
+#include <windows.h>
+#include <gdi.h>
+#include <pen.h>
+#include <brush.h>
+#include <bitmap.h>
+#include <font.h>
+#include <palette.h>
+#include <debug.h>
+
+int WIN32_GetObject( HANDLE handle, int count, LPVOID buffer )
+
+/* largely a copy of GetObject, but with size mangling capabilities to
+convert between win16 and win32 objects. Yeuch! */
+
+{
+ void *temp = alloca(count);
+ GDIOBJHDR * ptr = NULL;
+
+ dprintf_win32(stddeb, "WIN32_GetObject: %d %d %p\n", handle, count, buffer);
+
+ if ((!count) || (temp == NULL))
+ return 0;
+
+ ptr = GDI_GetObjPtr(handle, MAGIC_DONTCARE);
+ if (!ptr) return 0;
+
+ /* FIXME: only bitmaps fixed so far */
+
+ switch(ptr->wMagic)
+ {
+ case PEN_MAGIC:
+ return PEN_GetObject( (PENOBJ *)ptr, count, buffer );
+ case BRUSH_MAGIC:
+ return BRUSH_GetObject( (BRUSHOBJ *)ptr, count, buffer );
+ case BITMAP_MAGIC: {
+ BITMAP *pbm = (BITMAP *)temp;
+ int *pdest = (int *)buffer;
+
+ if (buffer == NULL)
+ return 28;
+
+ BITMAP_GetObject( (BITMAPOBJ *)ptr, count, temp );
+ if (count > 3)
+ pdest[0] = pbm->bmType;
+ if (count > 7)
+ pdest[1] = pbm->bmWidth;
+ if (count > 11)
+ pdest[2] = pbm->bmHeight;
+ if (count > 15)
+ pdest[3] = pbm->bmWidthBytes;
+ if (count > 19)
+ pdest[4] = pbm->bmPlanes;
+ if (count > 23)
+ pdest[5] = pbm->bmBitsPixel;
+ if (count > 27)
+ pdest[6] = pbm->bmBits;
+
+ return (count > 28) ? 28 : count - (count % 4);
+ }
+ case FONT_MAGIC:
+ return FONT_GetObject( (FONTOBJ *)ptr, count, buffer );
+ case PALETTE_MAGIC:
+ return PALETTE_GetObject( (PALETTEOBJ *)ptr, count, buffer );
+ }
+ return 0;
+}
+
diff --git a/win32/heap.c b/win32/heap.c
index 7a4468f..33e9dbb 100644
--- a/win32/heap.c
+++ b/win32/heap.c
@@ -2,6 +2,7 @@
* Win32 kernel functions
*
* Copyright 1995 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
+ * Copyright 1995 Martin von Löwis
*/
#include <stdio.h>
@@ -13,6 +14,7 @@
#include "windows.h"
#include "winerror.h"
#include "kernel32.h"
+#include "handle32.h"
#include "winbase.h"
#include "stddebug.h"
#include "debug.h"
@@ -21,12 +23,11 @@
/* FIXME: these functions do *not* implement the win32 API properly. They
are here merely as "get you going" aids */
-
/***********************************************************************
* HeapAlloc (KERNEL32.222)
*
*/
-LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes)
+LPVOID SIMPLE_HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes)
{
void *result;
@@ -36,3 +37,155 @@
memset(result, 0, dwBytes);
return result;
}
+
+HANDLE32 HeapCreate(DWORD flOptions, DWORD dwInitialSize, DWORD dwMaximumSize)
+{
+ LPVOID start;
+ HEAP_OBJECT *ret;
+ HEAPITEM_OBJECT *item;
+ if(dwInitialSize<4096)
+ return 0;
+ start = VirtualAlloc(0,dwMaximumSize, MEM_RESERVE, PAGE_READWRITE);
+ if(!start)
+ return 0;
+ if(!VirtualAlloc(start,dwInitialSize, MEM_COMMIT, PAGE_READWRITE))
+ {
+ VirtualFree(start,dwMaximumSize,MEM_RELEASE);
+ return 0;
+ }
+ ret=CreateKernelObject(sizeof(HEAP_OBJECT));
+ ret->common.magic=KERNEL_OBJECT_HEAP;
+ ret->start=start;
+ ret->size=dwInitialSize;
+ ret->maximum=dwMaximumSize;
+ ret->flags=flOptions;
+ item=start;
+ item->common.magic=KERNEL_OBJECT_HEAPITEM;
+ item->next=item->prev=0;
+ item->heap=ret;
+
+ ret->first=ret->last=item;
+
+ return (HANDLE32)ret;
+}
+
+BOOL HeapDestroy(HEAP_OBJECT *h)
+{
+ /* FIXME: last error */
+ if(h->common.magic!=KERNEL_OBJECT_HEAP)
+ return 0;
+ h->common.magic=0;
+ VirtualFree(h->start,h->size,MEM_RELEASE);
+ ReleaseKernelObject(h);
+ return 1;
+}
+
+
+static BOOL HEAP_GrowHeap(HEAP_OBJECT *h,DWORD size)
+{
+ HEAPITEM_OBJECT *last;
+ /* FIXME: last error */
+ if(size > h->maximum-h->size)
+ return 0;
+ if(!VirtualAlloc(h->start+h->size,size,MEM_COMMIT,PAGE_READWRITE))
+ return 0;
+ /* FIXME: consolidate with previous item */
+ last=h->start+size;
+ h->size+=size;
+ h->last->next=last;
+ last->prev=h->last;
+ last->next=0;
+ h->last=last;
+ last->common.magic=KERNEL_OBJECT_HEAPITEM;
+ last->heap=h;
+ return 1;
+}
+
+
+LPVOID HeapAlloc(HEAP_OBJECT *h,DWORD dwFlags,DWORD dwBytes)
+{
+ HEAPITEM_OBJECT *it,*next,*prev;
+ /* FIXME: last error */
+ if(!h)
+ return SIMPLE_HeapAlloc(h,dwFlags,dwBytes);
+ if(h->common.magic!=KERNEL_OBJECT_HEAP)
+ return 0;
+ /* align to DWORD */
+ dwBytes = (dwBytes + 3) & ~3;
+ for(it=h->first;it;it=it->next)
+ {
+ if(it->size>dwBytes+sizeof(HEAPITEM_OBJECT))
+ break;
+ }
+ if(!it)
+ {
+ if(!HEAP_GrowHeap(h,dwBytes))
+ return 0;
+ it=h->last;
+ }
+ next = it->next;
+ prev = it->prev;
+ if(it->size > dwBytes+2*sizeof(HEAPITEM_OBJECT))
+ { /* split item */
+ HEAPITEM_OBJECT *next=(HEAPITEM_OBJECT*)((char*)(it+1)+dwBytes);
+ next->common.magic=KERNEL_OBJECT_HEAPITEM;
+ next->size=it->size-sizeof(HEAPITEM_OBJECT)-dwBytes;
+ next->next = it->next;
+ }
+ if(next)
+ next->prev=prev;
+ else
+ h->last=prev;
+ if(prev)
+ prev->next=next;
+ else
+ h->first=next;
+ /* Allocated item is denoted by self-referencing */
+ it->next=it->prev=it;
+ return (LPVOID)(it+1);
+}
+
+BOOL HeapFree(HEAP_OBJECT *h,DWORD dwFlags,LPVOID lpMem)
+{
+ HEAPITEM_OBJECT *item,*prev,*next;
+ item = (HEAPITEM_OBJECT*)lpMem - 1;
+ if(item->common.magic != KERNEL_OBJECT_HEAP)
+ return 0;
+ for(next=item;(caddr_t)next<(caddr_t)h->start+h->size;
+ next=(HEAPITEM_OBJECT*)((char*)next+next->size))
+ if(next!=next->next)
+ break;
+ if((caddr_t)next>=(caddr_t)h->start+h->size)
+ next=0;
+ if(next)
+ prev=next->prev;
+ else
+ prev=h->last;
+ /* consolidate with previous */
+ if(prev && (char*)prev+prev->size==(char*)item)
+ {
+ prev->size+=item->size;
+ item=prev;
+ prev=item->prev;
+ }
+ /* consolidate with next */
+ if(next && (char*)item+item->size==(char*)next)
+ {
+ item->size+=next->size;
+ next=next->next;
+ }
+ if(prev)
+ {
+ item->prev=prev;
+ prev->next=item;
+ } else
+ h->first=item;
+ if(next)
+ {
+ item->next=next;
+ next->prev=item;
+ }else
+ h->last=item;
+ return 1;
+}
+
diff --git a/win32/memory.c b/win32/memory.c
index bd55c2b..0227222 100644
--- a/win32/memory.c
+++ b/win32/memory.c
@@ -10,10 +10,13 @@
#include <sys/time.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <string.h>
+#include <stdlib.h>
#include "windows.h"
#include "winerror.h"
#include "kernel32.h"
#include "winbase.h"
+#include "handle32.h"
#include "stddebug.h"
#include "debug.h"
@@ -33,6 +36,131 @@
int mem_count = 0;
int mem_used = 0;
+/*******************************************************************
+ * VRANGE
+ * A VRANGE denotes a contiguous part of the address space. It is used
+ * for house keeping, and will be obtained by higher-level memory allocation
+ * functions (VirtualAlloc, MapViewOfFile)
+ * There can be at most one VRANGE object covering any address at any time.
+ * Currently, all VRANGE objects are stored in a sorted list. Wine does not
+ * attempt to give a complete list of in-use address ranges, only those
+ * allocated via Win32.
+ * An exception is IsVrangeFree, which should test the OS specific
+ * mappings, too. As a default, an range not known to be allocated is
+ * considered free.
+ *******************************************************************/
+
+VRANGE_OBJECT *MEMORY_ranges=0;
+
+VRANGE_OBJECT *MEMORY_FindVrange(DWORD start)
+{
+ VRANGE_OBJECT *range;
+ for(range=MEMORY_ranges;range && range->start<start;range=range->next)
+ {
+ if(range->start<start && start<range->start+range->size)
+ return range;
+ }
+ return 0;
+}
+
+static int MEMORY_IsVrangeFree(DWORD start,DWORD size)
+{
+ DWORD end;
+ VRANGE_OBJECT *range;
+ if(!size)
+ return 1;
+ /* First, check our lists*/
+ end=start+size;
+ for(range=MEMORY_ranges;range && range->start<start;range=range->next)
+ {
+ if((range->start<start && start<range->start+range->size) ||
+ (range->start<end && end<range->start+range->size))
+ return 0;
+ }
+ /* Now, check the maps that are not under our control */
+#ifdef linux
+ {
+ FILE *f=fopen("/proc/self/maps","r");
+ char line[80];
+ int found=0;
+ while(1)
+ {
+ char *it;
+ int lower,upper;
+ if(!fgets(line,sizeof(line),f))
+ break;
+ it=line;
+ lower=strtoul(it,&it,16);
+ if(*it++!='-')
+ fprintf(stderr,"Format of /proc/self/maps changed\n");
+ upper=strtoul(it,&it,16);
+ if((lower<start && start<upper) || (lower<start+size && start+size<upper))
+ {
+ found=1;
+ break;
+ }
+ }
+ fclose(f);
+ return !found;
+ }
+#else
+ {
+ static int warned=0;
+ if(!warned)
+ {
+ fprintf("Don't know how to perform MEMORY_IsVrangeFree on "
+ "this system.\n Please fix\n");
+ warned=0;
+ }
+ return 1;
+ }
+#endif
+}
+
+/* FIXME: might need to consolidate ranges */
+void MEMORY_InsertVrange(VRANGE_OBJECT *r)
+{
+ VRANGE_OBJECT *it,*last;
+ if(!MEMORY_ranges || r->start<MEMORY_ranges->start)
+ {
+ r->next=MEMORY_ranges;
+ MEMORY_ranges=r;
+ }
+ for(it=MEMORY_ranges,last=0;it && it->start<r->start;it=it->next)
+ last=it;
+ r->next=last->next;
+ last->next=r;
+}
+
+
+VRANGE_OBJECT *MEMORY_AllocVrange(int start,int size)
+{
+ VRANGE_OBJECT *ret=CreateKernelObject(sizeof(VRANGE_OBJECT));
+ ret->common.magic=KERNEL_OBJECT_VRANGE;
+ MEMORY_InsertVrange(ret);
+ return ret;
+}
+
+void MEMORY_ReleaseVrange(VRANGE_OBJECT *r)
+{
+ VRANGE_OBJECT *it;
+ if(MEMORY_ranges==r)
+ {
+ MEMORY_ranges=r->next;
+ ReleaseKernelObject(r);
+ return;
+ }
+ for(it=MEMORY_ranges;it;it=it->next)
+ if(it->next==r)break;
+ if(!it)
+ {
+ fprintf(stderr,"VRANGE not found\n");
+ return;
+ }
+ it->next=r->next;
+ ReleaseKernelObject(r);
+}
+
/***********************************************************************
* VirtualAlloc (KERNEL32.548)
*/
@@ -167,3 +295,4 @@
}
return prot;
}
+
diff --git a/win32/param32.c b/win32/param32.c
index d2c10f2..1219725 100644
--- a/win32/param32.c
+++ b/win32/param32.c
@@ -25,6 +25,10 @@
BOOL WIN32_MoveToEx(HDC hdc,int x,int y,POINT32* p32)
{
POINT p;
- PARAM32_POINT32to16(p32,&p);
- return MoveToEx(hdc,x,y,&p);
+ if (p32 == NULL)
+ return MoveToEx(hdc,x,y,(POINT *)NULL);
+ else {
+ PARAM32_POINT32to16(p32,&p);
+ return MoveToEx(hdc,x,y,&p);
+ }
}
diff --git a/win32/resource.c b/win32/resource.c
index 2e2dd75..b2f055b 100644
--- a/win32/resource.c
+++ b/win32/resource.c
@@ -29,11 +29,15 @@
int language = 0x0409;
+#if 0
#define PrintId(name) \
if (HIWORD((DWORD)name)) \
dprintf_resource( stddeb, "'%s'", name); \
else \
dprintf_resource( stddeb, "#%04x", LOWORD(name));
+#else
+#define PrintId(name)
+#endif
/**********************************************************************
* GetResDirEntry
@@ -85,12 +89,13 @@
/**********************************************************************
* FindResource (KERNEL.60)
*/
-HANDLE32 FindResource32( HINSTANCE hModule, LPCTSTR name, LPCTSTR type )
+HANDLE32 FindResource32( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
{
#ifndef WINELIB
struct w_files *wptr = wine_files;
PIMAGE_RESOURCE_DIRECTORY resdirptr;
DWORD root;
+ HANDLE32 result;
#if 0
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
@@ -110,7 +115,10 @@
return 0;
if ((resdirptr = GetResDirEntry(resdirptr, name, root)) == NULL)
return 0;
- return (HANDLE32) GetResDirEntry(resdirptr, (LPCSTR)language, root);
+ result = GetResDirEntry(resdirptr, (LPCWSTR)language, root);
+ /* Try LANG_NEUTRAL, too */
+ if(!result)
+ return GetResDirEntry(resdirptr, (LPCWSTR)0, root);
#else
return LIBRES_FindResource( hModule, name, type );
#endif
@@ -164,26 +172,12 @@
*/
INT AccessResource32( HINSTANCE hModule, HRSRC hRsrc )
{
- WORD *pModule;
-
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "AccessResource: module="NPFMT" res="NPFMT"\n",
hModule, hRsrc );
if (!hRsrc) return 0;
- if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
-#ifndef WINELIB
- switch(*pModule)
- {
- case NE_SIGNATURE:
- return NE_AccessResource( hModule, hRsrc );
- case PE_SIGNATURE:
- return 0;
- default:
- return 0;
- }
-#else
- return LIBRES_AccessResource( hModule, hRsrc );
-#endif
+ fprintf(stderr,"AccessResource32: not implemented\n");
+ return 0;
}
@@ -192,25 +186,11 @@
*/
DWORD SizeofResource32( HINSTANCE hModule, HRSRC hRsrc )
{
- WORD *pModule;
-
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "SizeofResource: module="NPFMT" res="NPFMT"\n",
hModule, hRsrc );
- if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
-#ifndef WINELIB
- switch(*pModule)
- {
- case NE_SIGNATURE:
- return NE_SizeofResource( hModule, hRsrc );
- case PE_SIGNATURE:
- return 0;
- default:
- return 0;
- }
-#else
- return LIBRES_SizeofResource( hModule, hRsrc );
-#endif
+ fprintf(stderr,"SizeofResource32: not implemented\n");
+ return 0;
}
/**********************************************************************
@@ -218,6 +198,7 @@
*/
HANDLE32 WIN32_LoadAcceleratorsW(HINSTANCE instance, LPCWSTR lpTableName)
{
+#if 0
HANDLE32 hAccel;
HANDLE32 rsc_mem;
HANDLE32 hRsrc;
@@ -232,7 +213,8 @@
dprintf_accel( stddeb, "LoadAccelerators: "NPFMT" %04x\n",
instance, LOWORD(lpTableName) );
- if (!(hRsrc = FindResource32( instance, lpTableName, RT_ACCELERATOR )))
+ if (!(hRsrc = FindResource32( instance, lpTableName,
+ (LPCWSTR)RT_ACCELERATOR )))
return 0;
if (!(rsc_mem = LoadResource32( instance, hRsrc ))) return 0;
@@ -258,6 +240,10 @@
GlobalUnlock(hAccel);
FreeResource( rsc_mem );
return hAccel;
+#else
+ fprintf(stderr,"LoadAcceleratorsW: not implemented\n");
+ return 0;
+#endif
}
HANDLE32 WIN32_LoadAcceleratorsA(HINSTANCE instance, LPCSTR lpTableName)
@@ -280,9 +266,10 @@
int i;
dprintf_resource(stddeb, "LoadString: instance = "NPFMT", id = %04x, buffer = %08x, "
- "length = %d\n", instance, resource_id, (int) buffer, buflen);
+ "length = %d\n", instance, (int)resource_id, (int) buffer, buflen);
- hrsrc = FindResource32( instance, (resource_id>>4)+1, RT_STRING );
+ hrsrc = FindResource32( instance, (LPCWSTR)((resource_id>>4)+1),
+ (LPCWSTR)RT_STRING );
if (!hrsrc) return 0;
hmem = LoadResource32( instance, hrsrc );
if (!hmem) return 0;
@@ -305,8 +292,10 @@
buffer[0] = (WCHAR) 0;
return 0;
}
+#if 0
fprintf(stderr,"LoadString // I dont know why , but caller give buflen=%d *p=%d !\n", buflen, *p);
fprintf(stderr,"LoadString // and try to obtain string '%s'\n", p + 1);
+#endif
}
dprintf_resource(stddeb,"LoadString // '%s' copied !\n", buffer);
return i;
@@ -341,7 +330,7 @@
/**********************************************************************
* LoadBitmapW
*/
-HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCTSTR name )
+HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCWSTR name )
{
HBITMAP hbitmap = 0;
HDC hdc;
@@ -355,7 +344,8 @@
return OBM_LoadBitmap( LOWORD((int)name) );
}
- if (!(hRsrc = FindResource32( instance, name, RT_BITMAP ))) return 0;
+ if (!(hRsrc = FindResource32( instance, name,
+ (LPWSTR)RT_BITMAP ))) return 0;
if (!(handle = LoadResource32( instance, hRsrc ))) return 0;
info = (BITMAPINFO *)LockResource32( handle );
@@ -371,11 +361,11 @@
/**********************************************************************
* LoadBitmapA
*/
-HBITMAP WIN32_LoadBitmapA( HANDLE instance, LPCTSTR name )
+HBITMAP WIN32_LoadBitmapA( HANDLE instance, LPCSTR name )
{
HBITMAP res;
if(!HIWORD(name))
- res = WIN32_LoadBitmapW(instance,name);
+ res = WIN32_LoadBitmapW(instance,(LPWSTR)name);
else{
LPWSTR uni=STRING32_DupAnsiToUni(name);
res=WIN32_LoadBitmapW(instance,uni);
@@ -403,15 +393,15 @@
if(flags & MF_POPUP)
{
wMenuID = CreatePopupMenu();
- len = STRING32_lstrlenW(it);
- utext = it;
+ len = STRING32_lstrlenW((LPWSTR)it);
+ utext = (WCHAR*)it;
it += sizeof(WCHAR)*(len+1);
it = WIN32_ParseMenu(wMenuID,it);
} else {
wMenuID=*(WORD*)it;
it+=sizeof(WORD);
- utext = it;
- len = STRING32_lstrlenW(it);
+ utext = (LPWSTR)it;
+ len = STRING32_lstrlenW((LPWSTR)it);
it += sizeof(WCHAR)*(len+1);
if(!wMenuID && !*utext)
flags |= MF_SEPARATOR;
@@ -444,7 +434,7 @@
HMENU WIN32_LoadMenuW(HANDLE instance, LPCWSTR name)
{
HANDLE32 hrsrc;
- hrsrc=FindResource32(instance,name,RT_MENU);
+ hrsrc=FindResource32(instance,name,(LPWSTR)RT_MENU);
if(!hrsrc)return 0;
return WIN32_LoadMenuIndirectW(LoadResource32(instance, hrsrc));
}
@@ -465,7 +455,7 @@
{
HMENU res;
if(!HIWORD(name))
- res = WIN32_LoadMenuW(instance,name);
+ res = WIN32_LoadMenuW(instance,(LPWSTR)name);
else{
LPWSTR uni=STRING32_DupAnsiToUni(name);
res=WIN32_LoadMenuW(instance,uni);
diff --git a/win32/string32.c b/win32/string32.c
index e9af8cb..1ae569b 100644
--- a/win32/string32.c
+++ b/win32/string32.c
@@ -45,14 +45,14 @@
*dest = *src;
}
-LPSTR STRING32_DupUniToAnsi(LPWSTR src)
+LPSTR STRING32_DupUniToAnsi(LPCWSTR src)
{
LPSTR dest=xmalloc(STRING32_UniLen(src)+1);
STRING32_UniToAnsi(dest,src);
return dest;
}
-LPWSTR STRING32_DupAnsiToUni(LPSTR src)
+LPWSTR STRING32_DupAnsiToUni(LPCSTR src)
{
LPWSTR dest=xmalloc(2*strlen(src)+2);
STRING32_AnsiToUni(dest,src);
@@ -75,7 +75,7 @@
return tolower(c);
}
-LPWSTR STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len)
+int STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len)
{
while(len--)
{
diff --git a/win32/user32.c b/win32/user32.c
index d3b2a4c..c195056 100644
--- a/win32/user32.c
+++ b/win32/user32.c
@@ -8,13 +8,21 @@
stubs. 'Real' implementations go into context specific files */
#include <unistd.h>
+#include <stdio.h>
#include "windows.h"
#include "winerror.h"
#include "relay32.h"
#include "alias.h"
#include "stackframe.h"
#include "xmalloc.h"
+#include "handle32.h"
#include "struct32.h"
+#include "resource32.h"
+#include "string32.h"
+#include "dialog.h"
+#include "win.h"
+#include "debug.h"
+#include "stddebug.h"
/* Structure copy functions */
static void MSG16to32(MSG *msg16,struct WIN32_MSG *msg32)
@@ -182,47 +190,77 @@
DWORD instance,DWORD param)
{
DWORD retval;
- HANDLE classh, titleh;
- SEGPTR classsegp, titlesegp;
+ HANDLE classh=0, titleh=0;
+ SEGPTR classsegp=0, titlesegp=0;
char *classbuf, *titlebuf;
+ int usec,uset;
/*Have to translate CW_USEDEFAULT */
- if(x==0x80000000)x=CW_USEDEFAULT;
- if(y==0x80000000)y=CW_USEDEFAULT;
- if(width==0x80000000)width=CW_USEDEFAULT;
- if(height==0x80000000)height=CW_USEDEFAULT;
+ if(x==CW_USEDEFAULT32)x=CW_USEDEFAULT;
+ if(y==CW_USEDEFAULT32)y=CW_USEDEFAULT;
+ if(width==CW_USEDEFAULT32)width=CW_USEDEFAULT;
+ if(height==CW_USEDEFAULT32)height=CW_USEDEFAULT;
/* FIXME: There has to be a better way of doing this - but neither
malloc nor alloca will work */
+ usec = HIWORD(class);
+ uset = HIWORD(title);
- 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 );
- strcpy( titlebuf, title );
+ if(usec){
+ classh = GlobalAlloc(0, strlen(class)+1);
+ classsegp = WIN16_GlobalLock(classh);
+ classbuf = PTR_SEG_TO_LIN(classsegp);
+ strcpy( classbuf, class );
+ }
+ if(uset){
+ titleh = GlobalAlloc(0, strlen(title)+1);
+ titlesegp = WIN16_GlobalLock(titleh);
+ titlebuf = PTR_SEG_TO_LIN(titlesegp);
+ strcpy( titlebuf, title );
+ }
- retval = (DWORD) CreateWindowEx(flags,classsegp,
- titlesegp,style,x,y,width,height,
+ retval = (DWORD) CreateWindowEx(flags,(usec ? classsegp : (SEGPTR)class),
+ (uset ? titlesegp : (SEGPTR)title),style,x,y,width,height,
(HWND)parent,(HMENU)menu,(HINSTANCE)instance,
- (LPVOID)param);
- GlobalFree(classh);
- GlobalFree(titleh);
+ (DWORD)param);
+ if(usec)GlobalFree(classh);
+ if(uset)GlobalFree(titleh);
return retval;
}
+DWORD USER32_CreateWindowExW(long flags,LPCWSTR class,LPCWSTR title,
+ long style,int x,int y,int width,int height,DWORD parent,DWORD menu,
+ DWORD instance,DWORD param)
+{
+ HWND hwnd;
+ LPSTR c,t;
+ int usec,uset;
+ usec=HIWORD(class);
+ uset=HIWORD(title);
+ c = usec ? STRING32_DupUniToAnsi(class) : (LPSTR)class;
+ t = uset ? STRING32_DupUniToAnsi(title) : (LPSTR)title;
+ hwnd=USER32_CreateWindowExA(flags,c,t,style,x,y,width,height,parent,menu,
+ instance,param);
+ if(usec)free(c);
+ if(uset)free(t);
+ return hwnd;
+}
+
/***********************************************************************
* InvalidateRect (USER32.327)
*/
BOOL USER32_InvalidateRect(HWND hWnd,const RECT32 *lpRect,BOOL bErase)
{
RECT r;
- USER32_RECT32to16(lpRect,&r);
- InvalidateRect(hWnd,&r,bErase);
- /* FIXME: Return value */
- return 0;
+
+ if (lpRect == NULL)
+ InvalidateRect(hWnd, (RECT *)NULL, bErase);
+ else {
+ USER32_RECT32to16(lpRect,&r);
+ InvalidateRect(hWnd,&r,bErase);
+ }
+ /* FIXME: Return meaningful value */
+ return TRUE;
}
/***********************************************************************
@@ -247,3 +285,284 @@
return 0;
}
+UINT USER32_SetTimer(HWND hwnd, UINT id, UINT timeout, void *proc)
+
+{
+ dprintf_win32(stddeb, "USER32_SetTimer: %d %d %d %08lx\n", hwnd, id, timeout,
+(LONG)proc );
+ return SetTimer( hwnd, id, timeout, MAKE_SEGPTR(proc));
+}
+
+/* WARNING: It has not been verified that the signature or semantics
+ of the corresponding NT function is the same */
+
+HWND USER32_CreateDialogIndirectParamAorW(HINSTANCE hInst,LPVOID templ,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam,int A)
+{
+ DLGTEMPLATE32 *dlgTempl=templ;
+ DLGITEMTEMPLATE32 *dlgitem;
+ WORD *ptr;
+ DWORD MenuName=0;
+ DWORD ClassName=0;
+ DWORD szFontName=0;
+ WORD wPointSize;
+ HFONT hFont=0;
+ HMENU hMenu=0;
+ DWORD exStyle;
+ DWORD szCaption;
+ RECT rect;
+ DIALOGINFO *dlgInfo;
+ WND *wndPtr;
+ WORD xUnit = xBaseUnit;
+ WORD yUnit = yBaseUnit;
+ int i;
+ DWORD ClassId;
+ DWORD Text;
+ HWND hwnd,hwndCtrl;
+ HWND hwndDefButton=0;
+ WCHAR buffer[200];
+
+ /* parse the dialog template header*/
+ exStyle = dlgTempl->dwExtendedStyle;
+ ptr = (WORD*)(dlgTempl+1);
+ switch(*ptr){
+ case 0: MenuName=0;ptr++;break;
+ case 0xFFFF: MenuName=*(ptr+1);ptr+=2;break;
+ default: MenuName = (DWORD)ptr;
+ ptr += STRING32_lstrlenW(ptr)+1;
+ }
+ switch(*ptr){
+ case 0: ClassName = DIALOG_CLASS_ATOM;ptr++;break;
+ case 0xFFFF: ClassName = *(ptr+1);ptr+=2;break;
+ default: ClassName = (DWORD)ptr;
+ ptr += STRING32_lstrlenW(ptr)+1;
+ }
+ szCaption=(DWORD)ptr;
+ ptr+=STRING32_lstrlenW(ptr)+1;
+ if(dlgTempl->style & DS_SETFONT)
+ {
+ wPointSize = *ptr;
+ ptr++;
+ szFontName = (DWORD)ptr;
+ ptr+=STRING32_lstrlenW(ptr)+1;
+ }
+
+ if(MenuName) hMenu=WIN32_LoadMenuW(hInst,(LPWSTR)MenuName);
+ if(dlgTempl->style & DS_SETFONT)
+ {
+ fprintf(stderr,"Win32: dialog fonts not supported yet\n");
+ }
+
+ /* Create dialog main window */
+ rect.left = rect.top = 0;
+ rect.right = dlgTempl->cx * xUnit / 4;
+ rect.bottom = dlgTempl->cy * yUnit / 8;
+
+ /* FIXME: proper modalframe handling ??*/
+ if (dlgTempl->style & DS_MODALFRAME) exStyle |= WS_EX_DLGMODALFRAME;
+
+ /* FIXME: AdjustWindowRectEx */
+
+ rect.right -= rect.left;
+ rect.bottom -= rect.top;
+
+ if(dlgTempl->x == CW_USEDEFAULT)
+ rect.left = rect.top = CW_USEDEFAULT;
+ else{
+ rect.left += dlgTempl->x * xUnit / 4;
+ rect.top += dlgTempl->y * yUnit / 8;
+ if (!(dlgTempl->style & DS_ABSALIGN))
+ ClientToScreen(hWndParent, (POINT *)&rect );
+ }
+
+ /* FIXME: Here is the place to consider A */
+ hwnd = USER32_CreateWindowExW(exStyle, (LPWSTR)ClassName, (LPWSTR)szCaption,
+ dlgTempl->style & ~WS_VISIBLE,
+ rect.left, rect.top, rect.right, rect.bottom,
+ hWndParent, hMenu, hInst, 0);
+
+ if(!hwnd)
+ {
+ if(hFont)DeleteObject(hFont);
+ if(hMenu)DeleteObject(hMenu);
+ return 0;
+ }
+
+ wndPtr = WIN_FindWndPtr(hwnd);
+
+ /* FIXME: should purge junk from system menu, but windows/dialog.c
+ says this does not belong here */
+
+ /* Create control windows */
+ dprintf_dialog(stddeb, " BEGIN\n" );
+ dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
+ dlgInfo->msgResult = 0; /* This is used to store the default button id */
+ dlgInfo->hDialogHeap = 0;
+
+ for (i = 0; i < dlgTempl->noOfItems; i++)
+ {
+ if((int)ptr&3)
+ {
+ fprintf(stddeb,"DWORD aligning\n");
+ ptr++;
+ }
+ dlgitem = (DLGITEMTEMPLATE32*)ptr;
+ ptr = (WORD*)(dlgitem+1);
+ if(*ptr == 0xFFFF) {
+ /* FIXME: ignore HIBYTE? */
+ ClassId = *(ptr+1);
+ ptr+=2;
+ }else{
+ ClassId = (DWORD)ptr;
+ ptr += STRING32_lstrlenW(ptr)+1;
+ }
+ if(*ptr == 0xFFFF) {
+ Text = *(ptr+1);
+ ptr+=2;
+ }else{
+ Text = (DWORD)ptr;
+ ptr += STRING32_lstrlenW(ptr)+1;
+ }
+ if(!HIWORD(ClassId))
+ {
+ switch(LOWORD(ClassId))
+ {
+ case 0x80: STRING32_AnsiToUni(buffer,"BUTTON" ); break;
+ case 0x81: STRING32_AnsiToUni( buffer, "EDIT" ); break;
+ case 0x82: STRING32_AnsiToUni( buffer, "STATIC" ); break;
+ case 0x83: STRING32_AnsiToUni( buffer, "LISTBOX" ); break;
+ case 0x84: STRING32_AnsiToUni( buffer, "SCROLLBAR" ); break;
+ case 0x85: STRING32_AnsiToUni( buffer, "COMBOBOX" ); break;
+ default: buffer[0] = '\0'; break;
+ }
+ ClassId = (DWORD)buffer;
+ }
+ /*FIXME: debugging output*/
+ /*FIXME: local edit ?*/
+ exStyle = dlgitem->dwExtendedStyle|WS_EX_NOPARENTNOTIFY;
+ if(*ptr)
+ {
+ fprintf(stderr,"having data\n");
+ }
+ ptr++;
+ hwndCtrl = USER32_CreateWindowExW(WS_EX_NOPARENTNOTIFY,
+ (LPWSTR)ClassId, (LPWSTR)Text,
+ dlgitem->style | WS_CHILD,
+ dlgitem->x * xUnit / 4,
+ dlgitem->y * yUnit / 8,
+ dlgitem->cx * xUnit / 4,
+ dlgitem->cy * yUnit / 8,
+ hwnd, (HMENU)((DWORD)dlgitem->id),
+ hInst, (SEGPTR)0 );
+ SetWindowPos( hwndCtrl, HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
+ /* Send initialisation messages to the control */
+ if (hFont) SendMessage( hwndCtrl, WM_SETFONT, (WPARAM)hFont, 0 );
+ if (SendMessage( hwndCtrl, WM_GETDLGCODE, 0, 0 ) & DLGC_DEFPUSHBUTTON)
+ {
+ /* If there's already a default push-button, set it back */
+ /* to normal and use this one instead. */
+ if (hwndDefButton)
+ SendMessage( hwndDefButton, BM_SETSTYLE, BS_PUSHBUTTON, FALSE);
+ hwndDefButton = hwndCtrl;
+ dlgInfo->msgResult = GetWindowWord( hwndCtrl, GWW_ID );
+ }
+ }
+ dprintf_dialog(stddeb, " END\n" );
+
+ /* Initialise dialog extra data */
+ ALIAS_RegisterAlias(0,0,lpDialogFunc);
+ dlgInfo->dlgProc = lpDialogFunc;
+ dlgInfo->hUserFont = hFont;
+ dlgInfo->hMenu = hMenu;
+ dlgInfo->xBaseUnit = xUnit;
+ dlgInfo->yBaseUnit = yUnit;
+ dlgInfo->hwndFocus = DIALOG_GetFirstTabItem( hwnd );
+
+ /* Send initialisation messages and set focus */
+ if (dlgInfo->hUserFont)
+ SendMessage( hwnd, WM_SETFONT, (WPARAM)dlgInfo->hUserFont, 0 );
+ if (SendMessage( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, dwInitParam ))
+ SetFocus( dlgInfo->hwndFocus );
+ if (dlgTempl->style & WS_VISIBLE) ShowWindow(hwnd, SW_SHOW);
+ return hwnd;
+}
+
+HWND USER32_CreateDialogIndirectParamW(HINSTANCE hInst,LPVOID dlgTempl,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ return USER32_CreateDialogIndirectParamAorW(hInst,dlgTempl,hWndParent,
+ lpDialogFunc,dwInitParam,0);
+}
+
+HWND USER32_CreateDialogIndirectParamA(HINSTANCE hInst,LPVOID dlgTempl,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ return USER32_CreateDialogIndirectParamAorW(hInst,dlgTempl,hWndParent,
+ lpDialogFunc,dwInitParam,1);
+}
+
+HWND USER32_CreateDialogParamW(HINSTANCE hInst,LPCWSTR lpszName,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HANDLE32 hrsrc;
+ hrsrc=FindResource32(hInst,lpszName,(LPWSTR)RT_DIALOG);
+ if(!hrsrc)return 0;
+ return USER32_CreateDialogIndirectParamW(hInst,
+ LoadResource32(hInst, hrsrc),hWndParent,lpDialogFunc,dwInitParam);
+}
+
+HWND USER32_CreateDialogParamA(HINSTANCE hInst,LPCSTR lpszName,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HWND res;
+ if(!HIWORD(lpszName))
+ res = USER32_CreateDialogParamW(hInst,(LPCWSTR)lpszName,hWndParent,
+ lpDialogFunc,dwInitParam);
+ else{
+ LPWSTR uni=STRING32_DupAnsiToUni(lpszName);
+ res=USER32_CreateDialogParamW(hInst,uni,hWndParent,
+ lpDialogFunc,dwInitParam);
+ }
+ return res;
+}
+
+int USER32_DialogBoxIndirectParamW(HINSTANCE hInstance,LPVOID dlgTempl,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HWND hwnd;
+ hwnd = USER32_CreateDialogIndirectParamW(hInstance,dlgTempl,
+ hWndParent,lpDialogFunc,dwInitParam);
+ if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
+ return -1;
+}
+
+int USER32_DialogBoxIndirectParamA(HINSTANCE hInstance,LPVOID dlgTempl,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HWND hwnd;
+ hwnd = USER32_CreateDialogIndirectParamA(hInstance,dlgTempl,
+ hWndParent,lpDialogFunc,dwInitParam);
+ if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
+ return -1;
+}
+
+int USER32_DialogBoxParamW(HINSTANCE hInstance,LPCWSTR lpszName,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HWND hwnd;
+ hwnd = USER32_CreateDialogParamW(hInstance,lpszName,
+ hWndParent,lpDialogFunc,dwInitParam);
+ if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
+ return -1;
+}
+
+int USER32_DialogBoxParamA(HINSTANCE hInstance,LPCSTR lpszName,
+ HWND hWndParent,DLGPROC lpDialogFunc,LPARAM dwInitParam)
+{
+ HWND hwnd;
+ hwnd = USER32_CreateDialogParamA(hInstance,lpszName,
+ hWndParent,lpDialogFunc,dwInitParam);
+ if(hwnd)return DIALOG_DoDialogBox(hwnd,hWndParent);
+ return -1;
+}
diff --git a/windows/caret.c b/windows/caret.c
index 983cdee..12e9e00 100644
--- a/windows/caret.c
+++ b/windows/caret.c
@@ -84,7 +84,7 @@
else
hBrush = CreatePatternBrush(Caret.bitmap);
SelectObject(hdc, (HANDLE)hBrush);
- SetROP2(hdc, R2_XORPEN);
+ SetROP2(hdc, R2_NOTXORPEN);
rgn = CreateRectRgn(Caret.x, Caret.y,
Caret.x + Caret.width,
Caret.y + Caret.height);
@@ -105,7 +105,8 @@
{
WineProc=(DWORD)CARET_Callback;
Win16Proc=(DWORD)GetWndProcEntry16("CARET_Callback");
- Win32Proc=(DWORD)RELAY32_GetEntryPoint("WINPROCS32","CARET_Callback",0);
+ Win32Proc=(DWORD)RELAY32_GetEntryPoint(
+ RELAY32_GetBuiltinDLL("WINPROCS32"),"CARET_Callback",0);
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
initialized=1;
}
@@ -165,7 +166,7 @@
* DestroyCaret (USER.164)
*/
-void DestroyCaret()
+BOOL DestroyCaret()
{
/* if (!Caret.hwnd) return;
*/
@@ -177,6 +178,7 @@
CARET_HideCaret();
Caret.hwnd = 0; /* cursor marked as not existing */
+ return TRUE;
}
diff --git a/windows/dialog.c b/windows/dialog.c
index 8a982b4..90bb72a 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -21,7 +21,7 @@
#include "debug.h"
/* Dialog base units */
-static WORD xBaseUnit = 0, yBaseUnit = 0;
+WORD xBaseUnit = 0, yBaseUnit = 0;
/***********************************************************************
@@ -469,7 +469,7 @@
/***********************************************************************
* DIALOG_DoDialogBox
*/
-static int DIALOG_DoDialogBox( HWND hwnd, HWND owner )
+int DIALOG_DoDialogBox( HWND hwnd, HWND owner )
{
WND * wndPtr;
DIALOGINFO * dlgInfo;
@@ -508,8 +508,8 @@
/***********************************************************************
* DialogBox (USER.87)
*/
-int DialogBox( HINSTANCE hInst, SEGPTR dlgTemplate,
- HWND owner, WNDPROC dlgProc )
+INT DialogBox( HINSTANCE hInst, SEGPTR dlgTemplate,
+ HWND owner, DLGPROC dlgProc )
{
return DialogBoxParam( hInst, dlgTemplate, owner, dlgProc, 0 );
}
@@ -518,8 +518,8 @@
/***********************************************************************
* DialogBoxParam (USER.239)
*/
-int DialogBoxParam( HINSTANCE hInst, SEGPTR dlgTemplate,
- HWND owner, WNDPROC dlgProc, LPARAM param )
+INT DialogBoxParam( HINSTANCE hInst, SEGPTR dlgTemplate,
+ HWND owner, DLGPROC dlgProc, LPARAM param )
{
HWND hwnd;
@@ -534,8 +534,8 @@
/***********************************************************************
* DialogBoxIndirect (USER.218)
*/
-int DialogBoxIndirect( HINSTANCE hInst, HANDLE dlgTemplate,
- HWND owner, WNDPROC dlgProc )
+INT DialogBoxIndirect( HINSTANCE hInst, HANDLE dlgTemplate,
+ HWND owner, DLGPROC dlgProc )
{
return DialogBoxIndirectParam( hInst, dlgTemplate, owner, dlgProc, 0 );
}
@@ -544,8 +544,8 @@
/***********************************************************************
* DialogBoxIndirectParam (USER.240)
*/
-int DialogBoxIndirectParam( HINSTANCE hInst, HANDLE dlgTemplate,
- HWND owner, WNDPROC dlgProc, LPARAM param )
+INT DialogBoxIndirectParam( HINSTANCE hInst, HANDLE dlgTemplate,
+ HWND owner, DLGPROC dlgProc, LPARAM param )
{
HWND hwnd;
SEGPTR ptr;
@@ -561,13 +561,14 @@
/***********************************************************************
* EndDialog (USER.88)
*/
-void EndDialog( HWND hwnd, short retval )
+BOOL EndDialog( HWND hwnd, INT retval )
{
WND * wndPtr = WIN_FindWndPtr( hwnd );
DIALOGINFO * dlgInfo = (DIALOGINFO *)wndPtr->wExtra;
dlgInfo->msgResult = retval;
dlgInfo->fEnd = TRUE;
dprintf_dialog(stddeb, "EndDialog: "NPFMT" %d\n", hwnd, retval );
+ return TRUE;
}
diff --git a/windows/graphics.c b/windows/graphics.c
index 517d74b..741b49f 100644
--- a/windows/graphics.c
+++ b/windows/graphics.c
@@ -642,7 +642,7 @@
/***********************************************************************
* DrawFocusRect (USER.466)
*/
-void DrawFocusRect( HDC hdc, LPRECT rc )
+void DrawFocusRect( HDC hdc, const RECT* rc )
{
HPEN hOldPen;
int oldDrawMode, oldBkMode;
diff --git a/windows/mapping.c b/windows/mapping.c
index 5e66819..8c9f121 100644
--- a/windows/mapping.c
+++ b/windows/mapping.c
@@ -38,7 +38,7 @@
/***********************************************************************
* DPtoLP (GDI.67)
*/
-BOOL DPtoLP( HDC hdc, LPPOINT points, int count )
+BOOL DPtoLP( HDC hdc, LPPOINT points, INT count )
{
POINT * pt;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
diff --git a/windows/mdi.c b/windows/mdi.c
index 38e0944..7ed6727 100644
--- a/windows/mdi.c
+++ b/windows/mdi.c
@@ -1138,11 +1138,7 @@
* DefMDIChildProc (USER.447)
*
*/
-#ifdef WINELIB32
-LONG DefMDIChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-#else
-LONG DefMDIChildProc(HWND hwnd, WORD message, WORD wParam, LONG lParam)
-#endif
+LRESULT DefMDIChildProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
MDICLIENTINFO *ci;
WND *clientWnd;
diff --git a/windows/message.c b/windows/message.c
index a197f37..cd733d3 100644
--- a/windows/message.c
+++ b/windows/message.c
@@ -210,88 +210,6 @@
}
/***********************************************************************
- * MSG_GetWindowForEvent
- *
- * Find the window and hittest for a mouse event.
- */
-static INT MSG_GetWindowForEvent( POINT pt, HWND *phwnd )
-{
- WND *wndPtr;
- HWND hwnd;
- INT hittest = HTERROR;
- INT x, y;
-
- *phwnd = hwnd = GetDesktopWindow();
- x = pt.x;
- y = pt.y;
- while (hwnd)
- {
- /* If point is in window, and window is visible, and it */
- /* is enabled (or it's a top-level window), then explore */
- /* its children. Otherwise, go to the next window. */
-
- wndPtr = WIN_FindWndPtr( hwnd );
- if ((wndPtr->dwStyle & WS_VISIBLE) &&
- (!(wndPtr->dwStyle & WS_DISABLED) ||
- !(wndPtr->dwStyle & WS_CHILD)) &&
- (x >= wndPtr->rectWindow.left) &&
- (x < wndPtr->rectWindow.right) &&
- (y >= wndPtr->rectWindow.top) &&
- (y < wndPtr->rectWindow.bottom))
- {
- *phwnd = hwnd;
- x -= wndPtr->rectClient.left;
- y -= wndPtr->rectClient.top;
- /* If window is minimized or disabled, ignore its children */
- if ((wndPtr->dwStyle & WS_MINIMIZE) ||
- (wndPtr->dwStyle & WS_DISABLED)) break;
- hwnd = wndPtr->hwndChild;
- }
- else hwnd = wndPtr->hwndNext;
- }
-
- /* Make point relative to parent again */
-
- wndPtr = WIN_FindWndPtr( *phwnd );
- x += wndPtr->rectClient.left;
- y += wndPtr->rectClient.top;
-
- /* Send the WM_NCHITTEST message */
-
- while (*phwnd)
- {
- wndPtr = WIN_FindWndPtr( *phwnd );
- if (wndPtr->dwStyle & WS_DISABLED) hittest = HTERROR;
- else hittest = (INT)SendMessage( *phwnd, WM_NCHITTEST, 0,
- MAKELONG( pt.x, pt.y ) );
- if (hittest != HTTRANSPARENT) break; /* Found the window */
- hwnd = wndPtr->hwndNext;
- while (hwnd)
- {
- WND *nextPtr = WIN_FindWndPtr( hwnd );
- if ((nextPtr->dwStyle & WS_VISIBLE) &&
- (x >= nextPtr->rectWindow.left) &&
- (x < nextPtr->rectWindow.right) &&
- (y >= nextPtr->rectWindow.top) &&
- (y < nextPtr->rectWindow.bottom)) break;
- hwnd = nextPtr->hwndNext;
- }
- if (hwnd) *phwnd = hwnd; /* Found a suitable sibling */
- else /* Go back to the parent */
- {
- if (!(*phwnd = wndPtr->hwndParent)) break;
- wndPtr = WIN_FindWndPtr( *phwnd );
- x += wndPtr->rectClient.left;
- y += wndPtr->rectClient.top;
- }
- }
-
- if (!*phwnd) *phwnd = GetDesktopWindow();
- return hittest;
-}
-
-
-/***********************************************************************
* MSG_TranslateMouseMsg
*
* Translate an mouse hardware event into a real mouse message.
@@ -333,7 +251,7 @@
msg->message, (LPARAM)MAKE_SEGPTR(&hook));
}
- if ((hittest = MSG_GetWindowForEvent( msg->pt, &msg->hwnd )) != HTERROR)
+ if ((hittest = WINPOS_WindowFromPoint( msg->pt, &msg->hwnd )) != HTERROR)
{
/* Send the WM_PARENTNOTIFY message */
@@ -1171,7 +1089,7 @@
/***********************************************************************
* DispatchMessage (USER.114)
*/
-LONG DispatchMessage( LPMSG msg )
+LONG DispatchMessage( const MSG* msg )
{
WND * wndPtr;
LONG retval;
diff --git a/windows/msgbox.c b/windows/msgbox.c
index 59f61cc..33ebe2c 100644
--- a/windows/msgbox.c
+++ b/windows/msgbox.c
@@ -195,7 +195,8 @@
{
WineProc=(DWORD)SystemMessageBoxProc;
Win16Proc=(DWORD)GetWndProcEntry16("SystemMessageBoxProc");
- Win32Proc=(DWORD)RELAY32_GetEntryPoint("WINPROCS32","SystemMessageBoxProc",0);
+ Win32Proc=(DWORD)RELAY32_GetEntryPoint(RELAY32_GetBuiltinDLL("WINPROCS32"),
+ "SystemMessageBoxProc",0);
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
initialized=1;
}
diff --git a/windows/nonclient.c b/windows/nonclient.c
index e19ccf6..976cfb6 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -37,17 +37,12 @@
#define SC_ABOUTWINE (SC_SCREENSAVE+1)
/* Some useful macros */
-#define IS_MANAGED(style) \
- (Options.managed && !((style) & WS_CHILD))
-
#define HAS_DLGFRAME(style,exStyle) \
- (!(IS_MANAGED(style)) && \
- (((exStyle) & WS_EX_DLGMODALFRAME) || \
- (((style) & WS_DLGFRAME) && !((style) & WS_BORDER))))
+ (((exStyle) & WS_EX_DLGMODALFRAME) || \
+ (((style) & WS_DLGFRAME) && !((style) & WS_BORDER)))
#define HAS_THICKFRAME(style) \
- (!(IS_MANAGED(style)) && \
- ((style) & WS_THICKFRAME) && \
+ (((style) & WS_THICKFRAME) && \
!(((style) & (WS_DLGFRAME|WS_BORDER)) == WS_DLGFRAME))
#define HAS_MENU(w) (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0))
@@ -70,19 +65,24 @@
static void NC_AdjustRect( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle )
{
if (style & WS_ICONIC) return; /* Nothing to change for an icon */
- if (IS_MANAGED(style)) return;
- if (HAS_DLGFRAME( style, exStyle ))
- InflateRect( rect, SYSMETRICS_CXDLGFRAME, SYSMETRICS_CYDLGFRAME );
- else
- {
- if (HAS_THICKFRAME(style))
- InflateRect( rect, SYSMETRICS_CXFRAME, SYSMETRICS_CYFRAME );
- if (style & WS_BORDER)
- InflateRect( rect, SYSMETRICS_CXBORDER, SYSMETRICS_CYBORDER );
- }
- if ((style & WS_CAPTION) == WS_CAPTION)
- rect->top -= SYSMETRICS_CYCAPTION - SYSMETRICS_CYBORDER;
+ /* Decide if the window will be managed (see CreateWindowEx) */
+ if (!(Options.managed && ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
+ (exStyle & WS_EX_DLGMODALFRAME))))
+ {
+ if (HAS_DLGFRAME( style, exStyle ))
+ InflateRect( rect, SYSMETRICS_CXDLGFRAME, SYSMETRICS_CYDLGFRAME );
+ else
+ {
+ if (HAS_THICKFRAME(style))
+ InflateRect( rect, SYSMETRICS_CXFRAME, SYSMETRICS_CYFRAME );
+ if (style & WS_BORDER)
+ InflateRect( rect, SYSMETRICS_CXBORDER, SYSMETRICS_CYBORDER );
+ }
+
+ if ((style & WS_CAPTION) == WS_CAPTION)
+ rect->top -= SYSMETRICS_CYCAPTION - SYSMETRICS_CYBORDER;
+ }
if (menu) rect->top -= SYSMETRICS_CYMENU + SYSMETRICS_CYBORDER;
if (style & WS_VSCROLL) rect->right += SYSMETRICS_CXVSCROLL;
@@ -140,8 +140,7 @@
MinMax.ptMaxTrackSize.x = SYSMETRICS_CXSCREEN;
MinMax.ptMaxTrackSize.y = SYSMETRICS_CYSCREEN;
- if (IS_MANAGED(wndPtr->dwStyle))
- xinc = yinc = 0;
+ if (wndPtr->flags & WIN_MANAGED) xinc = yinc = 0;
else if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
{
xinc = SYSMETRICS_CXDLGFRAME;
@@ -240,7 +239,7 @@
rect->bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
if (wndPtr->dwStyle & WS_ICONIC) return; /* No border to remove */
- if (IS_MANAGED(wndPtr->dwStyle)) return;
+ if (wndPtr->flags & WIN_MANAGED) return;
/* Remove frame from rectangle */
if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
@@ -275,86 +274,79 @@
GetWindowRect( hwnd, &rect );
if (!PtInRect( &rect, pt )) return HTNOWHERE;
- /*
- * if this is a iconic window, we don't care were the hit
- * occured, only that it did occur, just return HTCAPTION
- * so the caller knows the icon did get hit
- */
- if (IsIconic(hwnd))
- {
- return HTCAPTION; /* change this to something meaningful? */
- }
+ if (wndPtr->dwStyle & WS_MINIMIZE) return HTCAPTION;
- /* Check borders */
- if (HAS_THICKFRAME( wndPtr->dwStyle ))
+ if (!(wndPtr->flags & WIN_MANAGED))
{
- InflateRect( &rect, -SYSMETRICS_CXFRAME, -SYSMETRICS_CYFRAME );
- if (wndPtr->dwStyle & WS_BORDER)
- InflateRect( &rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER );
- if (!PtInRect( &rect, pt ))
- {
- /* Check top sizing border */
- if (pt.y < rect.top)
- {
- if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT;
- if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT;
- return HTTOP;
- }
- /* Check bottom sizing border */
- if (pt.y >= rect.bottom)
- {
- if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT;
- if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT;
- return HTBOTTOM;
- }
- /* Check left sizing border */
- if (pt.x < rect.left)
- {
- if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT;
- if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
- return HTLEFT;
- }
- /* Check right sizing border */
- if (pt.x >= rect.right)
- {
- if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT;
- if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT;
- return HTRIGHT;
- }
- }
- }
- else /* No thick frame */
- {
- if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
- InflateRect(&rect, -SYSMETRICS_CXDLGFRAME, -SYSMETRICS_CYDLGFRAME);
- else if (!(IS_MANAGED(wndPtr->dwStyle)) &&
- (wndPtr->dwStyle & WS_BORDER))
- InflateRect(&rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
- if (!PtInRect( &rect, pt )) return HTBORDER;
- }
+ /* Check borders */
+ if (HAS_THICKFRAME( wndPtr->dwStyle ))
+ {
+ InflateRect( &rect, -SYSMETRICS_CXFRAME, -SYSMETRICS_CYFRAME );
+ if (wndPtr->dwStyle & WS_BORDER)
+ InflateRect(&rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
+ if (!PtInRect( &rect, pt ))
+ {
+ /* Check top sizing border */
+ if (pt.y < rect.top)
+ {
+ if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT;
+ if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT;
+ return HTTOP;
+ }
+ /* Check bottom sizing border */
+ if (pt.y >= rect.bottom)
+ {
+ if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT;
+ if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT;
+ return HTBOTTOM;
+ }
+ /* Check left sizing border */
+ if (pt.x < rect.left)
+ {
+ if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT;
+ if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
+ return HTLEFT;
+ }
+ /* Check right sizing border */
+ if (pt.x >= rect.right)
+ {
+ if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT;
+ if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT;
+ return HTRIGHT;
+ }
+ }
+ }
+ else /* No thick frame */
+ {
+ if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
+ InflateRect(&rect, -SYSMETRICS_CXDLGFRAME, -SYSMETRICS_CYDLGFRAME);
+ else if (wndPtr->dwStyle & WS_BORDER)
+ InflateRect(&rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
+ if (!PtInRect( &rect, pt )) return HTBORDER;
+ }
- /* Check caption */
+ /* Check caption */
- if (!(IS_MANAGED(wndPtr->dwStyle)) &&
- ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION))
- {
- rect.top += SYSMETRICS_CYCAPTION - 1;
- if (!PtInRect( &rect, pt ))
- {
- /* Check system menu */
- if (wndPtr->dwStyle & WS_SYSMENU)
- rect.left += SYSMETRICS_CXSIZE;
- if (pt.x <= rect.left) return HTSYSMENU;
- /* Check maximize box */
- if (wndPtr->dwStyle & WS_MAXIMIZEBOX)
- rect.right -= SYSMETRICS_CXSIZE + 1;
- if (pt.x >= rect.right) return HTMAXBUTTON;
- /* Check minimize box */
- if (wndPtr->dwStyle & WS_MINIMIZEBOX)
- rect.right -= SYSMETRICS_CXSIZE + 1;
- if (pt.x >= rect.right) return HTMINBUTTON;
- return HTCAPTION;
- }
+ if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION)
+ {
+ rect.top += SYSMETRICS_CYCAPTION - 1;
+ if (!PtInRect( &rect, pt ))
+ {
+ /* Check system menu */
+ if (wndPtr->dwStyle & WS_SYSMENU)
+ rect.left += SYSMETRICS_CXSIZE;
+ if (pt.x <= rect.left) return HTSYSMENU;
+ /* Check maximize box */
+ if (wndPtr->dwStyle & WS_MAXIMIZEBOX)
+ rect.right -= SYSMETRICS_CXSIZE + 1;
+ if (pt.x >= rect.right) return HTMAXBUTTON;
+ /* Check minimize box */
+ if (wndPtr->dwStyle & WS_MINIMIZEBOX)
+ rect.right -= SYSMETRICS_CXSIZE + 1;
+ if (pt.x >= rect.right) return HTMINBUTTON;
+ return HTCAPTION;
+ }
+ }
}
/* Check client area */
@@ -673,31 +665,31 @@
SelectObject( hdc, sysColorObjects.hpenWindowFrame );
- if (((wndPtr->dwStyle & WS_BORDER) || (wndPtr->dwStyle & WS_DLGFRAME) ||
- (wndPtr->dwExStyle & WS_EX_DLGMODALFRAME)) &&
- !(IS_MANAGED(wndPtr->dwStyle)))
+ if (!(wndPtr->flags & WIN_MANAGED))
{
- MoveTo( hdc, 0, 0 );
- LineTo( hdc, rect.right-1, 0 );
- LineTo( hdc, rect.right-1, rect.bottom-1 );
- LineTo( hdc, 0, rect.bottom-1 );
- LineTo( hdc, 0, 0 );
- InflateRect( &rect, -1, -1 );
- }
+ if ((wndPtr->dwStyle & WS_BORDER) || (wndPtr->dwStyle & WS_DLGFRAME) ||
+ (wndPtr->dwExStyle & WS_EX_DLGMODALFRAME))
+ {
+ MoveTo( hdc, 0, 0 );
+ LineTo( hdc, rect.right-1, 0 );
+ LineTo( hdc, rect.right-1, rect.bottom-1 );
+ LineTo( hdc, 0, rect.bottom-1 );
+ LineTo( hdc, 0, 0 );
+ InflateRect( &rect, -1, -1 );
+ }
- if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
- NC_DrawFrame( hdc, &rect, TRUE, active );
- else if ((wndPtr->dwStyle & WS_THICKFRAME) &&
- !(IS_MANAGED(wndPtr->dwStyle)))
- NC_DrawFrame(hdc, &rect, FALSE, active );
+ if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
+ NC_DrawFrame( hdc, &rect, TRUE, active );
+ else if (wndPtr->dwStyle & WS_THICKFRAME)
+ NC_DrawFrame(hdc, &rect, FALSE, active );
- if (((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION) &&
- !(IS_MANAGED(wndPtr->dwStyle)))
- {
- RECT r = rect;
- r.bottom = rect.top + SYSMETRICS_CYSIZE;
- rect.top += SYSMETRICS_CYSIZE + SYSMETRICS_CYBORDER;
- NC_DrawCaption( hdc, &r, hwnd, wndPtr->dwStyle, active );
+ if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION)
+ {
+ RECT r = rect;
+ r.bottom = rect.top + SYSMETRICS_CYSIZE;
+ rect.top += SYSMETRICS_CYSIZE + SYSMETRICS_CYBORDER;
+ NC_DrawCaption( hdc, &r, hwnd, wndPtr->dwStyle, active );
+ }
}
if (HAS_MENU(wndPtr))
@@ -913,7 +905,8 @@
POINT minTrack, maxTrack, capturePoint = pt;
WND * wndPtr = WIN_FindWndPtr( hwnd );
- if (IsZoomed(hwnd) || !IsWindowVisible(hwnd)) return;
+ if (IsZoomed(hwnd) || !IsWindowVisible(hwnd) ||
+ (wndPtr->flags & WIN_MANAGED)) return;
hittest = wParam & 0x0f;
thickframe = HAS_THICKFRAME( wndPtr->dwStyle );
diff --git a/windows/painting.c b/windows/painting.c
index 014426d..18d6e3c 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -68,9 +68,10 @@
/***********************************************************************
* EndPaint (USER.40)
*/
-void EndPaint( HWND hwnd, LPPAINTSTRUCT lps )
+BOOL EndPaint( HWND hwnd, const PAINTSTRUCT* lps )
{
ReleaseDC( hwnd, lps->hdc );
+ return TRUE;
}
diff --git a/windows/property.c b/windows/property.c
index 92d1748..ef6a323 100644
--- a/windows/property.c
+++ b/windows/property.c
@@ -113,7 +113,7 @@
/***********************************************************************
* EnumProps (USER.27)
*/
-int EnumProps( HWND hwnd, FARPROC func )
+INT EnumProps( HWND hwnd, PROPENUMPROC func )
{
int ret = -1;
HANDLE hProp;
diff --git a/windows/scroll.c b/windows/scroll.c
index 9c5ad2b..d69f5b7 100644
--- a/windows/scroll.c
+++ b/windows/scroll.c
@@ -268,6 +268,8 @@
hrgn2 = CreateRectRgn(0, 0, 0, 0);
RgnType = CombineRgn(hrgnUpdate, hrgn1, hrgn2, RGN_OR);
+ DeleteObject(hrgn1);
+ DeleteObject(hrgn2);
}
if (rcUpdate) GetRgnBox( hrgnUpdate, rcUpdate );
diff --git a/windows/win.c b/windows/win.c
index d9aaa3a..456b762 100644
--- a/windows/win.c
+++ b/windows/win.c
@@ -444,14 +444,18 @@
if (!(style & WS_CHILD) && (rootWindow == DefaultRootWindow(display)))
{
- if(Options.managed && className != POPUPMENU_CLASS_ATOM) {
+ if (Options.managed && ((style & (WS_DLGFRAME | WS_THICKFRAME)) ||
+ (exStyle & WS_EX_DLGMODALFRAME)))
+ {
win_attr.event_mask = ExposureMask | KeyPressMask |
KeyReleaseMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask |
FocusChangeMask | StructureNotifyMask;
win_attr.override_redirect = FALSE;
+ wndPtr->flags |= WIN_MANAGED;
}
- else {
+ else
+ {
win_attr.event_mask = ExposureMask | KeyPressMask |
KeyReleaseMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask |
@@ -1079,7 +1083,7 @@
/*******************************************************************
* EnumWindows (USER.54)
*/
-BOOL EnumWindows( FARPROC lpEnumFunc, LPARAM lParam )
+BOOL EnumWindows( WNDENUMPROC lpEnumFunc, LPARAM lParam )
{
HWND hwnd;
WND *wndPtr;
@@ -1125,7 +1129,7 @@
/**********************************************************************
* EnumTaskWindows (USER.225)
*/
-BOOL EnumTaskWindows( HTASK hTask, FARPROC lpEnumFunc, LONG lParam )
+BOOL EnumTaskWindows( HTASK hTask, WNDENUMPROC lpEnumFunc, LPARAM lParam )
{
HWND hwnd;
WND *wndPtr;
@@ -1200,7 +1204,7 @@
*
* o calls WIN_EnumChildWin to do a recursive decent of child windows
*/
-BOOL EnumChildWindows(HWND hwnd, FARPROC wndenumprc, LPARAM lParam)
+BOOL EnumChildWindows(HWND hwnd, WNDENUMPROC wndenumprc, LPARAM lParam)
{
WND *wndPtr;
diff --git a/windows/winpos.c b/windows/winpos.c
index 04dcb66..683bde0 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -167,73 +167,83 @@
}
-/*******************************************************************
- * WINPOS_WindowFromPoint
+/***********************************************************************
+ * WINPOS_WindowFromPoint
*
- * The Right Thing
+ * Find the window and hittest for a given point.
*/
-HWND WINPOS_WindowFromPoint( HWND hScope, POINT pt, WORD* lpht )
+INT WINPOS_WindowFromPoint( POINT pt, HWND *phwnd )
{
- WORD wRet;
- WND* wndPtr = WIN_FindWndPtr( hScope );
+ WND *wndPtr;
+ HWND hwnd;
+ INT hittest = HTERROR;
+ INT x, y;
- if( !wndPtr || !(wndPtr->dwStyle & WS_VISIBLE) ) return 0;
+ *phwnd = 0;
+ x = pt.x;
+ y = pt.y;
+ hwnd = GetWindow( GetDesktopWindow(), GW_CHILD );
+ for (;;)
+ {
+ while (hwnd)
+ {
+ /* If point is in window, and window is visible, and it */
+ /* is enabled (or it's a top-level window), then explore */
+ /* its children. Otherwise, go to the next window. */
- if ((pt.x < wndPtr->rectWindow.left) ||
- (pt.x >= wndPtr->rectWindow.right) ||
- (pt.y < wndPtr->rectWindow.top) ||
- (pt.y >= wndPtr->rectWindow.bottom)) return 0;
+ wndPtr = WIN_FindWndPtr( hwnd );
+ if ((wndPtr->dwStyle & WS_VISIBLE) &&
+ (!(wndPtr->dwStyle & WS_DISABLED) ||
+ ((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) &&
+ (x >= wndPtr->rectWindow.left) &&
+ (x < wndPtr->rectWindow.right) &&
+ (y >= wndPtr->rectWindow.top) &&
+ (y < wndPtr->rectWindow.bottom))
+ {
+ *phwnd = hwnd; /* Got a suitable window */
- /* pt is inside hScope window */
+ /* If window is minimized or disabled, return at once */
+ if (wndPtr->dwStyle & WS_MINIMIZE) return HTCAPTION;
+ if (wndPtr->dwStyle & WS_DISABLED) return HTERROR;
- if( wndPtr->dwStyle & WS_DISABLED )
- if( wndPtr->dwStyle & (WS_POPUP | WS_CHILD) == WS_CHILD )
- return 0;
- else
- {
- if( lpht ) *lpht = HTERROR;
- return hScope;
- }
+ /* If point is not in client area, ignore the children */
+ if ((x < wndPtr->rectClient.left) ||
+ (x >= wndPtr->rectClient.right) ||
+ (y < wndPtr->rectClient.top) ||
+ (y >= wndPtr->rectClient.bottom)) break;
- if( wndPtr->dwStyle & WS_MINIMIZE )
- {
- if( lpht ) *lpht = HTCAPTION;
- return hScope;
- }
+ x -= wndPtr->rectClient.left;
+ y -= wndPtr->rectClient.top;
+ hwnd = wndPtr->hwndChild;
+ }
+ else hwnd = wndPtr->hwndNext;
+ }
- if( PtInRect(&wndPtr->rectClient, pt))
- {
- /* look among children */
- HWND hwnd = wndPtr->hwndChild;
- WND* wndChild = WIN_FindWndPtr(hwnd);
- POINT ptChild = { pt.x - wndPtr->rectClient.left,
- pt.y - wndPtr->rectClient.top };
+ /* If nothing found, return the desktop window */
+ if (!*phwnd)
+ {
+ *phwnd = GetDesktopWindow();
+ return HTCLIENT;
+ }
+ wndPtr = WIN_FindWndPtr( *phwnd );
- while( wndChild )
- {
- if( (hwnd = WINPOS_WindowFromPoint(hwnd, ptChild, lpht)) )
- return hwnd;
+ /* Send the WM_NCHITTEST message (only if to the same task) */
+ if (wndPtr->hmemTaskQ != GetTaskQueue(0)) return HTCLIENT;
+ hittest = (INT)SendMessage( *phwnd, WM_NCHITTEST, 0,
+ MAKELONG( pt.x, pt.y ) );
+ if (hittest != HTTRANSPARENT) return hittest; /* Found the window */
- hwnd = wndChild->hwndNext;
- wndChild = WIN_FindWndPtr( hwnd );
- }
- }
+ /* If no children found in last search, make point relative to parent*/
+ if (!hwnd)
+ {
+ x += wndPtr->rectClient.left;
+ y += wndPtr->rectClient.top;
+ }
- /* don't do intertask sendmessage */
- if( wndPtr->hmemTaskQ == GetTaskQueue(0) )
- {
- if( wndPtr->dwStyle & WS_CHILD )
- MapWindowPoints( hScope, GetDesktopWindow(), &pt, 1);
-
- wRet = SendMessage( hScope, WM_NCHITTEST, 0, MAKELONG( pt.x, pt.y ));
- if( wRet == (WORD)HTTRANSPARENT )
- return 0;
- }
- else
- wRet = HTCLIENT;
-
- if( lpht ) *lpht = wRet;
- return hScope;
+ /* Restart the search from the next sibling */
+ hwnd = wndPtr->hwndNext;
+ *phwnd = wndPtr->hwndParent;
+ }
}
@@ -242,7 +252,9 @@
*/
HWND WindowFromPoint( POINT pt )
{
- return WINPOS_WindowFromPoint( GetDesktopWindow(), pt , NULL );
+ HWND hwnd;
+ WINPOS_WindowFromPoint( pt, &hwnd );
+ return hwnd;
}
@@ -705,7 +717,7 @@
RedrawIconTitle(hwndPrevActive);
}
*/
- if (!(wndPtr->dwStyle & WS_CHILD) )
+ if (!(wndPtr->dwStyle & WS_CHILD))
{
/* check Z-order and bring hWnd to the top */
wndTemp = WIN_FindWndPtr( GetDesktopWindow() );
@@ -1099,9 +1111,9 @@
result = WINPOS_SendNCCalcSize( winpos.hwnd, TRUE, &newWindowRect,
&wndPtr->rectWindow, &wndPtr->rectClient,
&winpos, &newClientRect );
- /* .... Should handle result here */
+ /* FIXME: Should handle result here */
- /* Perform the moving and resizing */
+ /* Perform the moving and resizing */
if (wndPtr->window)
{
@@ -1249,7 +1261,7 @@
* DeferWindowPos (USER.260)
*/
HDWP DeferWindowPos( HDWP hdwp, HWND hwnd, HWND hwndAfter, INT x, INT y,
- INT cx, INT cy, WORD flags )
+ INT cx, INT cy, UINT flags )
{
DWP *pDWP;
int i;
diff --git a/wine.man b/wine.man
index 11a4ad8..6ac8629 100644
--- a/wine.man
+++ b/wine.man
@@ -74,7 +74,7 @@
.I -language xx
Set the language to
.I xx
-(one of En, Es, De, No, Fr, Fi, Da)
+(one of En, Es, De, No, Fr, Fi, Da Cz)
.TP
.I -managed
Create each top-level window as a properly managed X window