Commit 0c126c7c authored by Alexandre Julliard's avatar Alexandre Julliard

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.
parent 7e56f684
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 @@ Because of lags created by using mirror, this message may reach you before
the release is available at the ftp sites. The sources will be available
from the following locations:
sunsite.unc.edu:/pub/Linux/ALPHA/wine/Wine-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 @@ and James Youngman.
--
Alexandre Julliard
julliard@sunsite.unc.edu
julliard@lrc.epfl.ch
----------------------------------------------------------------------
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.
......
......@@ -77,7 +77,7 @@ comp.emulators.ms-windows.wine. The Wine FAQ is posted there every
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.
--
......
......@@ -986,7 +986,7 @@ LRESULT ComboLBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/************************************************************************
* 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 @@ BOOL DlgDirSelectComboBox(HWND hDlg, LPSTR lpStr, int nIDLBox)
* DlgDirListComboBox [USER.195]
*/
INT DlgDirListComboBox( HWND hDlg, SEGPTR path, INT idCBox,
INT idStatic, WORD wType )
INT idStatic, UINT wType )
{
INT ret = 0;
......
......@@ -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 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include <unistd.h>
#include "win.h"
#include "desktop.h"
#include "directory.h"
#include "dos_fs.h"
#include "graphics.h"
......@@ -34,7 +33,17 @@ static HBITMAP DESKTOP_LoadBitmap( HDC hdc, const char *filename )
/* 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 )))
......
......@@ -694,6 +694,7 @@ LONG ListBoxDirectory(LPHEADLIST lphl, UINT attrib, LPCSTR filespec)
if ((ret = ListBoxAddString(lphl, temp)) == LB_ERR) break;
}
}
free( path );
return ret;
}
......@@ -1886,7 +1887,7 @@ LRESULT ListBoxWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/**********************************************************************
* 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 @@ BOOL DlgDirSelect( HWND hDlg, LPSTR lpStr, int id )
/**********************************************************************
* 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 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, WORD attrib )
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 @@ INT DlgDirList( HWND hDlg, SEGPTR spec, INT idLBox, INT idStatic, WORD attrib )
SENDMSG( WM_SETTEXT, 0, (LPARAM)MAKE_SEGPTR(temp) );
}
return TRUE;
#undef SENDMSG
}
......@@ -895,27 +895,39 @@ static void MENU_SelectPrevItem( HWND hwndOwner, HMENU hmenu )
*/
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))
{
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')
{
item->item_flags |= MF_HELP;
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 @@ static MENUITEM *MENU_InsertItem( HMENU hMenu, UINT pos, UINT flags )
}
menu->hItems = hNewItems;
menu->nItems++;
memset( &newItems[pos], 0, sizeof(*newItems) );
return &newItems[pos];
}
......@@ -1022,8 +1035,7 @@ static SEGPTR MENU_ParseResource( SEGPTR res, HMENU hMenu )
}
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 @@ BOOL InsertMenu( HMENU hMenu, UINT pos, UINT flags, UINT id, SEGPTR data )
{
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 @@ BOOL InsertMenu( HMENU hMenu, UINT pos, UINT flags, UINT id, SEGPTR data )
if (!(MENU_SetItemData( item, flags, id, data )))
{
item->hText = 0;
RemoveMenu( hMenu, pos, flags );
return FALSE;
}
......@@ -1928,7 +1935,8 @@ BOOL RemoveMenu(HMENU hMenu, UINT nPos, UINT wFlags)
/* 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 DeleteMenu(HMENU hMenu, UINT nPos, UINT wFlags)
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 @@ BOOL ModifyMenu( HMENU hMenu, UINT pos, UINT flags, UINT id, SEGPTR data )
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 @@ DWORD GetMenuCheckMarkDimensions()
* 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 @@ BOOL DestroyMenu(HMENU hMenu)
{
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 );
}
......
......@@ -971,7 +971,7 @@ void ShowScrollBar( HWND hwnd, WORD wBar, BOOL fShow )
/*************************************************************************
* EnableScrollBar (USER.482)
*/
BOOL EnableScrollBar( HWND hwnd, INT nBar, UINT flags )
BOOL EnableScrollBar( HWND hwnd, UINT nBar, UINT flags )
{
SCROLLINFO *infoPtr;
HDC hdc;
......
......@@ -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 @@ BOOL WIDGETS_Init(void)
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);
......
......@@ -733,8 +733,8 @@ static struct inst db_inst_table[256] = {
/*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 },
......
......@@ -164,11 +164,11 @@ int DIR_Init(void)
/* 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 );
......
......@@ -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 @@ const char *DOSFS_IsDevice( const char *name )
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 @@ const char *DOSFS_IsDevice( const char *name )
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 @@ const char * DOSFS_GetUnixFileName( const char * name, int check_last )
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 @@ const char * DOSFS_GetDosTrueName( const char *name, int unix_format )
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 DOSFS_FindNext( const char *path, const char *mask, int drive,
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 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
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 @@ int DOSFS_FindNext( const char *path, const char *mask, int drive,
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,
......
......@@ -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 @@ int DRIVE_Init(void)
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( "" );
......
......@@ -447,21 +447,22 @@ static INT PROFILE_GetSection( PROFILESECTION *section,
{
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;
}
......
......@@ -8,7 +8,8 @@ DLLS16 = commdlg.spec compobj.spec ddeml.spec gdi.spec kernel.spec \
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 @@ clean::
# 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:
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
......@@ -20,7 +20,7 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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
......@@ -78,7 +78,7 @@ id 1
#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 @@ id 1
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
......
......@@ -338,7 +338,7 @@ base 1
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 @@ base 1
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
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
......@@ -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 @@ WIN32_builtin *WIN32_builtin_list;
/* 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 @@ void RELAY32_Unimplemented(char *dll, int item)
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 @@ void *RELAY32_GetEntryPoint(char *dll_name, char *item, int hint)
{
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 @@ __asm__ (
);
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;
}
......@@ -4,84 +4,122 @@ base 1
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
......@@ -70,11 +70,15 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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 @@ base 1
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
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
......@@ -70,4 +70,7 @@ typedef struct
#pragma pack(4)
extern WORD xBaseUnit,yBaseUnit;
int DIALOG_DoDialogBox( HWND hwnd, HWND owner );
#endif /* DIALOG_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 int FILE_RemoveDir( LPCSTR path );
extern HFILE FILE_Dup( HFILE hFile );
extern HFILE FILE_Dup2( HFILE hFile1, HFILE hFile2 );
extern int FILE_OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode );
extern LONG FILE_Read( HFILE hFile, LPSTR buffer, LONG count );
extern INT _lcreat_uniq( LPCSTR path, INT attr );
#endif /* __WINE_FILE_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)
......
......@@ -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 @@ typedef struct {
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 @@ typedef struct {
#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
*/
......
......@@ -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;
......
......@@ -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 @@ typedef struct
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 @@ typedef struct
#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];
......
......@@ -16,7 +16,8 @@ typedef enum
LANG_No, /* Norwegian */
LANG_Fr, /* French */
LANG_Fi, /* Finnish */
LANG_Da /* Danish */
LANG_Da, /* Danish */
LANG_Cz /* Czech */
} WINE_LANGUAGE;
struct options
......
#ifndef __WINE_PE_IMAGE_H
#define __WINE_PE_IMAGE_H
#include <sys/types.h>
#include "windows.h"
struct pe_data {
......@@ -16,6 +17,21 @@ struct pe_data {
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 w_files
struct pe_data *pe;
OFSTRUCT ofs;
unsigned int load_addr;
WIN32_builtin* builtin;
};
......@@ -38,18 +55,4 @@ extern void PE_InitDLL(HMODULE hModule);
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 */
......@@ -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 @@ LRESULT USER32_DefWindowProcA(DWORD hwnd,DWORD msg,DWORD wParam,DWORD lParam);
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
......@@ -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 @@ typedef struct _IMAGE_RESOURCE_DIR_STRING_U {
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 */
......@@ -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
......
......@@ -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
......@@ -22,4 +22,26 @@ typedef struct tagPOINT32
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
......@@ -60,14 +60,15 @@ typedef struct tagWND
} 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)
......
......@@ -34,5 +34,6 @@ extern LONG WINPOS_SendNCCalcSize( HWND hwnd, BOOL calcValidRect,
RECT *oldClientRect, WINDOWPOS *winpos,
RECT *newClientRect );
extern LONG WINPOS_HandleWindowPosChanging( WINDOWPOS *winpos );
extern INT WINPOS_WindowFromPoint( POINT pt, HWND *phwnd );
#endif /* WINPOS_H */
......@@ -39,6 +39,9 @@ typedef void* SEGPTR;
#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 @@ typedef DWORD SEGPTR;
#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 INT HFILE;
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(HDROP);
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 @@ typedef HGLOBAL GLOBALHANDLE;
#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
......
......@@ -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 @@ HGLOBAL GlobalHandle(LPCVOID a)
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;
}
......
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 @@ C_SRCS = \
hello2.c \
hello3.c \
hello3res.c \
hello4.c \
new.c \
rolex.c
all: check_winerc $(PROGRAMS)
......@@ -23,11 +25,17 @@ hello2: hello2.o $(WINELIB)
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)
......
#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;
}
#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);
}
......@@ -76,6 +76,9 @@ int MAIN_Init(void)
/* 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 @@ int MAIN_Init(void)
/* Initialize signal handling */
init_wine_signals();
#endif
/* Initialize communications */
COMM_Init();
#ifndef WINELIB
/* Initialize the DOS memory */
if (!INT21_Init()) return 0;
......
#ifndef WINELIB
/*
* Copyright 1994 Eric Youndale & Erik Bos
* Copyright 1995 Martin von Lwis
*
* based on Eric Youndale's pe-test and:
*
......@@ -118,9 +119,15 @@ DWORD PE_FindExportedFunction(struct w_files* wpnt, char* funcName)
name = (u_char **) (((char *) load_addr) + (int) exports->AddressOfNames);
for(i=0; i<exports->Number_Of_Functions; i++)
{
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 @@ DWORD PE_GetProcAddress(HMODULE hModule, char* function)
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 @@ void fixup_imports(struct w_files* wpnt)
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");
......@@ -201,25 +208,26 @@ void fixup_imports(struct w_files* wpnt)
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 @@ void fixup_imports(struct w_files* wpnt)
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,7 +464,7 @@ static HINSTANCE PE_LoadImage( int fd, struct w_files *wpnt )
if(wpnt->pe->pe_export &&
wpnt->pe->pe_export!=load_addr+dir.Virtual_address)
fprintf(stderr,"wrong export directory??\n");
else
/* always trust the directory */
wpnt->pe->pe_export = load_addr+dir.Virtual_address;
}
......@@ -463,8 +473,7 @@ static HINSTANCE PE_LoadImage( int fd, struct w_files *wpnt )
{
if(wpnt->pe->pe_import &&
wpnt->pe->pe_import!=load_addr+dir.Virtual_address)
fprintf(stderr,"wrong export directory??\n");
else
fprintf(stderr,"wrong import directory??\n");
wpnt->pe->pe_import = load_addr+dir.Virtual_address;
}
......@@ -474,7 +483,6 @@ static HINSTANCE PE_LoadImage( int fd, struct w_files *wpnt )
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;
}
......@@ -483,8 +491,7 @@ static HINSTANCE PE_LoadImage( int fd, struct w_files *wpnt )
{
if(wpnt->pe->pe_reloc &&
wpnt->pe->pe_reloc!=load_addr+dir.Virtual_address)
fprintf(stderr,"wrong export directory??\n");
else
fprintf(stderr,"wrong relocation list??\n");
wpnt->pe->pe_reloc = load_addr+dir.Virtual_address;
}
......@@ -549,6 +556,7 @@ HINSTANCE PE_LoadModule(int fd, OFSTRUCT *ofs, LOADPARAMS* params)
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));
......
......@@ -125,6 +125,7 @@ int LDT_SetEntry( int entry, const ldt_entry *content )
{
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;
......
......@@ -681,6 +681,7 @@ HLOCAL LOCAL_Free( HANDLE ds, HLOCAL handle )
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 {
......
......@@ -308,7 +308,10 @@ WORD SelectorAccessRights( WORD sel, WORD op, WORD val )
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 @@ SEGPTR MAKE_SEGPTR(void * ptr)
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;
......
......@@ -187,7 +187,7 @@ INT CountClipboardFormats()
/**************************************************************************
* EnumClipboardFormats [USER.144]
*/
WORD EnumClipboardFormats(WORD wFormat)
UINT EnumClipboardFormats(UINT wFormat)
{
LPCLIPFORMAT lpFormat = ClipFormats;
dprintf_clipboard(stddeb,"EnumClipboardFormats(%04X) !\n", wFormat);
......
......@@ -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 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
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 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
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,13 +255,13 @@ static LONG FILEDLG_WMDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
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,
......@@ -299,6 +301,7 @@ static LONG FILEDLG_WMMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
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 @@ static LONG FILEDLG_WMInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
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 @@ LRESULT ColorDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
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 @@ LRESULT FindTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
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 @@ LRESULT ReplaceTextDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
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 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
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 @@ LRESULT PrintDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
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 @@ LRESULT PrintSetupDlgProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam)
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 @@ DWORD CommDlgExtendedError(void)
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 @@ short GetFileTitle(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf)
i++;
break;
}
printf("\n---> '%s' ", &lpFile[i]);
dprintf_commdlg(stddeb,"\n---> '%s' ", &lpFile[i]);
len = strlen(lpFile+i)+1;
if (cbBuf < len)
......
......@@ -10,8 +10,8 @@ static char Copyright[] = "Copyright Bob Amstadt, 1994";
#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;
......
......@@ -72,6 +72,8 @@ BOOL WinHelp(HWND hWnd, LPSTR lpHelpFile, WORD wCommand, DWORD dwData)
strcat(str, lpHelpFile);
dprintf_exec(stddeb,"'%s'\n", str);
break;
case HELP_QUIT:
return TRUE;
default:
return FALSE;
}
......
......@@ -55,6 +55,7 @@ static const char *langNames[] =
"Fr", /* LANG_Fr */
"Fi", /* LANG_Fi */
"Da", /* LANG_Da */
"Cz", /* LANG_Cz */
NULL
};
......@@ -132,7 +133,7 @@ static XrmOptionDescRec optionsTable[] =
" -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" \
......
......@@ -30,6 +30,7 @@ DWORD WINAPI GetUserDefaultLCID()
case LANG_Fr:
case LANG_Fi:
case LANG_Da:
case LANG_Cz:
default:
return 0; /* Neutral language */
}
......
......@@ -135,7 +135,7 @@ BOOL UnionRect( LPRECT dest, LPRECT src1, LPRECT src2 )
/***********************************************************************
* 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));
......
......@@ -696,7 +696,8 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
{
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 @@ HICON ExtractAssociatedIcon(HINSTANCE hInst,LPSTR lpIconPath, LPWORD lpiIcon)
*/
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;
}
......
......@@ -64,7 +64,7 @@ NotifyUnregister(HTASK htask)
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;
}
......@@ -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.
......
......@@ -136,7 +136,7 @@ BOOL DOSMEM_Init(void)
*
* Increment the BIOS tick counter.
*/
static void DOSMEM_Alarm(void)
void DOSMEM_Alarm(void)
{
pBiosData->Ticks = INT1A_GetTicksSinceMidnight();
printf( "Ticks = %ld\n", pBiosData->Ticks );
......
......@@ -290,11 +290,23 @@ void INT_Int31Handler( struct sigcontext_struct context )
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 */
......
......@@ -30,6 +30,7 @@ static WORD INSTR_ReplaceSelector( struct sigcontext_struct *context, WORD sel)
{
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 */
......
......@@ -560,7 +560,7 @@ static int INT21_FindFirst(struct sigcontext_struct *context)
return 0;
}
memcpy( dta->mask, mask, sizeof(dta->mask) );
dta->drive = (path[1] == ':') ? toupper(path[0]) - 'A'
dta->drive = (path[0] && (path[1] == ':')) ? toupper(path[0]) - 'A'
: DRIVE_GetCurrentDrive();
dta->count = 0;
dta->search_attr = CL_reg(context);
......@@ -694,86 +694,76 @@ static int INT21_SetDiskSerialNumber(struct sigcontext_struct *context)
}
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 *dta = GetCurrentDTA();
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;
DumpFCB( fcb );
if ((*fcb) == 0xff)
if (*fcb == 0xff)
{
standard_fcb = (struct fcb *)(fcb + 7);
output_fcb = (struct fcb *)(dta + 7);
*dta = 0xff;
attr = fcb[6];
pFCB = (FINDFILE_FCB *)(fcb + 7);
}
else
{
standard_fcb = (struct fcb *)fcb;
output_fcb = (struct fcb *)dta;
attr = 0;
pFCB = (FINDFILE_FCB *)fcb;
}
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();
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;
}
output_fcb->drive = drive;
if (*(fcb) == 0xff)
{
if (*(fcb+6) & FA_LABEL) /* return volume label */
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)
{
*(dta+6) = FA_LABEL;
memset(&output_fcb->name, ' ', 11);
memcpy(output_fcb->name, DRIVE_GetLabel(drive), 11);
AX_reg(context) = 0x00;
return;
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 0
sprintf(path,"%c:*.*",drive+'A');
if ((output_fcb->directory = DOS_opendir(path))==NULL)
if (!pFCB->unixPath) return 0;
if (!(count = DOSFS_FindNext( pFCB->unixPath, pFCB->filename,
DOS_GET_DRIVE( pFCB->drive ), attr,
pFCB->count, &entry )))
{
Error (PathNotFound, EC_MediaError, EL_Disk);
AX_reg(context) = 0xff;
return;
free( pFCB->unixPath );
pFCB->unixPath = NULL;
return 0;
}
#endif
pFCB->count += count;
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 @@ void DOS3Call( struct sigcontext_struct context )
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 @@ void DOS3Call( struct sigcontext_struct context )
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 @@ void DOS3Call( struct sigcontext_struct context )
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 @@ void DOS3Call( struct sigcontext_struct context )
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;
......
......@@ -46,6 +46,8 @@ void INT_Int2fHandler( struct sigcontext_struct context )
{
case 0x10: /* smartdrv */
break; /* not installed */
case 0x11: /* dblspace */
break; /* not installed */
case 0x12: /* realtime compression interface */
break; /* not installed */
default:
......
......@@ -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 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
{
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 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
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 @@ int COLOR_ToPhysical( DC *dc, COLORREF color )
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;
......
......@@ -499,7 +499,8 @@ HICON LoadIcon( HANDLE hInstance, SEGPTR name )
* 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 @@ HCURSOR CreateCursor( HINSTANCE hInstance, INT xHotSpot, INT yHotSpot,
/***********************************************************************
* 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 @@ HICON CreateIcon( HANDLE hInstance, INT nWidth, INT nHeight, BYTE bPlanes,
* 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 @@ BOOL DestroyCursor( HCURSOR hCursor )
/***********************************************************************
* 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;
......
......@@ -158,7 +158,7 @@ void DC_InitDC( HDC hdc )
/***********************************************************************
* 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 @@ BOOL DC_SetupGCForPatBlt( DC * dc, GC gc, BOOL fMapColors )
/***********************************************************************
* 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 @@ BOOL DC_SetupGCForBrush( DC * dc )
/***********************************************************************
* 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 @@ BOOL RestoreDC( HDC hdc, short level )
/***********************************************************************
* 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 @@ HDC CreateDC( LPCSTR driver, LPCSTR device, LPCSTR output, LPCSTR initData )
/***********************************************************************
* 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 );
......
......@@ -123,12 +123,18 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
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';
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)
......@@ -136,7 +142,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
/* 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 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
}
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 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font, DC * dc )
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 @@ BOOL CreateScalableFontResource( UINT fHidden,LPSTR lpszResourceFile,
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 @@ HFONT CreateFont( INT height, INT width, INT esc, INT orient, INT weight,
{
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 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
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 @@ HFONT FONT_SelectObject( DC * dc, HFONT hfont, FONTOBJ * font )
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 @@ BOOL RemoveFontResource( LPSTR str )
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 @@ int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz)
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 @@ void InitFontsList(void)
lpNewFont->lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
break;
case 'm':
case 'c':
lpNewFont->lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
break;
default:
......@@ -734,7 +769,7 @@ void InitFontsList(void)
/*************************************************************************
* 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 EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
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 @@ int EnumFonts(HDC hDC, LPSTR lpFaceName, FARPROC lpEnumFunc, LPSTR lpData)
/*************************************************************************
* 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;
......
......@@ -246,7 +246,7 @@ GDIOBJHDR * GDI_GetObjPtr( HANDLE handle, WORD magic )
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 @@ GDIOBJHDR * GDI_GetObjPtr( HANDLE handle, WORD magic )
/***********************************************************************
* DeleteObject (GDI.69)
*/
BOOL DeleteObject( HANDLE obj )
BOOL DeleteObject( HGDIOBJ obj )
{
/* Check if object is valid */
......@@ -377,7 +377,7 @@ BOOL UnrealizeObject( HANDLE handle )
/***********************************************************************
* 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[] =
......
......@@ -10,6 +10,7 @@ static char Copyright[] = "Copyright David W. Metcalfe, 1994";
#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 @@ HMETAFILE GetMetaFile(LPSTR lpFilename)
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 @@ HMETAFILE GetMetaFile(LPSTR lpFilename)
/******************************************************************
* CreateMetafile GDI.125
*/
HANDLE CreateMetaFile(LPSTR lpFilename)
HANDLE CreateMetaFile(LPCTSTR lpFilename)
{
DC *dc;
HANDLE handle;
......@@ -254,9 +255,9 @@ BOOL PlayMetaFile(HDC hdc, HMETAFILE hmf)
{
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;
}
......
......@@ -323,9 +323,8 @@ static HBITMAP OBM_MakeBitmap( WORD width, WORD height,
*
* 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 @@ static BOOL OBM_CreateBitmaps( char **data, BOOL color, BOOL mask,
}
*hBitmap = OBM_MakeBitmap( attrs.width, attrs.height,
attrs.depth, pixmap );
if (mask) *hBitmapMask = OBM_MakeBitmap( attrs.width, attrs.height,
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 @@ static BOOL OBM_CreateBitmaps( char **data, BOOL color, BOOL mask,
*/
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 @@ HANDLE OBM_LoadCursorIcon( WORD id, BOOL fCursor )
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;
......
......@@ -76,7 +76,7 @@ static WORD PALETTE_GetNearestIndexAndColor(HPALETTE hpalette, COLORREF *color)
/***********************************************************************
* CreatePalette (GDI.360)
*/
HPALETTE CreatePalette( LOGPALETTE * palette )
HPALETTE CreatePalette( const LOGPALETTE* palette )
{
PALETTEOBJ * palettePtr;
HPALETTE hpalette;
......
......@@ -24,7 +24,7 @@ HPEN CreatePen( INT style, INT width, COLORREF color )
/***********************************************************************
* CreatePenIndirect (GDI.62)
*/
HPEN CreatePenIndirect( LOGPEN * pen )
HPEN CreatePenIndirect( const LOGPEN * pen )
{
PENOBJ * penPtr;
HPEN hpen;
......
......@@ -66,7 +66,7 @@ int GetRgnBox( HRGN hrgn, LPRECT rect )
/***********************************************************************
* 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 @@ HRGN CreateRectRgn( short left, short top, short right, short bottom )
/***********************************************************************
* 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 @@ void SetRectRgn( HRGN hrgn, short left, short top, short right, short bottom )
/***********************************************************************
* 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 @@ HRGN CreateEllipticRgnIndirect( LPRECT rect )
/***********************************************************************
* 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 @@ HRGN CreatePolygonRgn( POINT * points, INT count, INT mode )
/***********************************************************************
* CreatePolyPolygonRgn (GDI.451)
*/
HRGN CreatePolyPolygonRgn( POINT * points, INT * count,
HRGN CreatePolyPolygonRgn( const POINT * points, const INT * count,
INT nbpolygons, INT mode )
{
RGNOBJ * obj;
......
......@@ -184,12 +184,12 @@ static const char *TEXT_NextLine( HDC hdc, const char *str, int *count,
/***********************************************************************
* 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;
......
......@@ -32,7 +32,6 @@ as long as you leave the existing copyrights intact.
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).
......@@ -2,7 +2,7 @@ TOPSRC = @top_srcdir@
MODULE = resources
LANGUAGES = En Es De No Fr Fi Da
LANGUAGES = En Es De No Fr Fi Da Cz
SYSRES_SRCS = $(LANGUAGES:%=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 @@ static const struct resource * const * SYSRES_Resources[] =
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 */
};
......
SYSMENU MENU LOADONCALL MOVEABLE DISCARDABLE
{
MENUITEM "&Obnov", 61728
MENUITEM "Pe&su", 61456
MENUITEM "&Zm velikost", 61440
MENUITEM "Mi&nimalizuj", 61472
MENUITEM "Ma&ximalizuj", 61488
MENUITEM SEPARATOR
MENUITEM "&Zavi\tAlt-F4", 61536
MENUITEM SEPARATOR
MENUITEM "&Pepni 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 "&Peruit", 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 "Oteven souboru"
FONT 8, "Helv"
{
LTEXT "&jmno 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 "&Adrese:", -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 zobrazench 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 "Otevt", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Storno", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Npovda", 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 jmnem..."
FONT 8, "Helv"
{
LTEXT "&Jmno 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 "&Adrese:", -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 zobrazench 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 jmnem", 1, 208, 6, 56, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Storno", 2, 208, 24, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Npovda", 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 "Tiskrna:", 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 &vbr", 1057, 16, 60, 60, 12
RADIOBUTTON "Vytiskni &zadan strnky", 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 zpsobu tisku"
FONT 8, "Helv"
{
GROUPBOX "Tiskrna", 1072, 6, 10, 180, 65, BS_GROUPBOX
RADIOBUTTON "&Pedvolen tiskrna", 1056, 16, 20, 80, 12
LTEXT "[none]", 1088, 35, 35, 120, 9
RADIOBUTTON "Specifick &tiskrna", 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 &vku", 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 "Papr", 1074, 120, 85, 180, 50, BS_GROUPBOX
LTEXT "&Formt", 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 "Psmo"
FONT 8, "Helv"
{
LTEXT "Psmo:", 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 "&Zkladn barvy:", 1088, 6, 6, 40, 9
LTEXT "&Barvy na zakzku:", 1089, 6, 126, 40, 9
LTEXT "Barva|Spoj&it", 1090, 100, 146, 40, 9
LTEXT "&Odstn:", 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 "&Pidat barvu", 1024, 120, 182, 100, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "&Vyadit 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 "Hledn"
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 "&Rozliovat mal a velk psmena", 1041, 20, 50, 50, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
GROUPBOX "Smr", 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 "Zavt", 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 "Zmna"
FONT 8, "Helv"
{
LTEXT "&Vyhledat:", 1088, 6, 6, 40, 9
LTEXT "", 1089, 60, 6, 150, 9
LTEXT "&Zamnit 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 "&Rozliovat mal a velk psmena", 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&mnit", 1024, 206, 24, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Zamnit ve v&bru", 1025, 206, 44, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Zavt", 2, 206, 64, 56, 14, WS_GROUP | WS_TABSTOP
}
......@@ -915,12 +915,12 @@ static void BuildSpec32Files( char *specname )
}
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}");
}
......
#!/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 @@ while(<APIW>)
}
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);
......
......@@ -8,6 +8,7 @@ C_SRCS = \
environment.c \
error.c \
file.c \
gdi32.c \
heap.c \
init.c \
memory.c \
......
/*
* 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;
}
......@@ -2,6 +2,7 @@
* Win32 kernel functions
*
* Copyright 1995 Thomas Sandford <t.d.g.sandford@prds-grn.demon.co.uk>
* Copyright 1995 Martin von Lwis
*/
#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 @@ LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, DWORD dwBytes)
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;
}
......@@ -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 @@ virtual_mem_t *mem = 0;
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 @@ int TranslateProtectionFlags(DWORD protection_flags)
}
return prot;
}
......@@ -25,6 +25,10 @@ void PARAM32_POINT32to16(const POINT32* p32,POINT* p16)
BOOL WIN32_MoveToEx(HDC hdc,int x,int y,POINT32* p32)
{
POINT p;
if (p32 == NULL)
return MoveToEx(hdc,x,y,(POINT *)NULL);
else {
PARAM32_POINT32to16(p32,&p);
return MoveToEx(hdc,x,y,&p);
}
}
......@@ -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 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntry(PIMAGE_RESOURCE_DIRECTORY resdirptr,
/**********************************************************************
* 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 @@ HANDLE32 FindResource32( HINSTANCE hModule, LPCTSTR name, LPCTSTR type )
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 @@ BOOL FreeResource32( HANDLE32 handle )
*/
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:
fprintf(stderr,"AccessResource32: not implemented\n");
return 0;
default:
return 0;
}
#else
return LIBRES_AccessResource( hModule, hRsrc );
#endif
}
......@@ -192,25 +186,11 @@ INT AccessResource32( HINSTANCE hModule, HRSRC hRsrc )
*/
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:
fprintf(stderr,"SizeofResource32: not implemented\n");
return 0;
}
#else
return LIBRES_SizeofResource( hModule, hRsrc );
#endif
}
/**********************************************************************
......@@ -218,6 +198,7 @@ DWORD SizeofResource32( HINSTANCE hModule, HRSRC hRsrc )
*/
HANDLE32 WIN32_LoadAcceleratorsW(HINSTANCE instance, LPCWSTR lpTableName)
{
#if 0
HANDLE32 hAccel;
HANDLE32 rsc_mem;
HANDLE32 hRsrc;
......@@ -232,7 +213,8 @@ HANDLE32 WIN32_LoadAcceleratorsW(HINSTANCE instance, LPCWSTR lpTableName)
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 @@ HANDLE32 WIN32_LoadAcceleratorsW(HINSTANCE instance, LPCWSTR lpTableName)
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 @@ WIN32_LoadStringW(HINSTANCE instance, DWORD resource_id, LPWSTR buffer, int bufl
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 @@ WIN32_LoadStringW(HINSTANCE instance, DWORD resource_id, LPWSTR buffer, int bufl
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 @@ HICON LoadIconA32(HINSTANCE hinst, LPCTSTR lpszIcon)
/**********************************************************************
* LoadBitmapW
*/
HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCTSTR name )
HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCWSTR name )
{
HBITMAP hbitmap = 0;
HDC hdc;
......@@ -355,7 +344,8 @@ HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCTSTR name )
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 @@ HBITMAP WIN32_LoadBitmapW( HANDLE instance, LPCTSTR name )
/**********************************************************************
* 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 @@ BYTE* WIN32_ParseMenu(HMENU hMenu,BYTE *it)
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_LoadMenuIndirectW(void *menu)
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 WIN32_LoadMenuA(HANDLE instance,LPCSTR name)
{
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);
......
......@@ -45,14 +45,14 @@ void STRING32_AnsiToUni(LPWSTR dest,LPCSTR src)
*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 @@ WCHAR STRING32_tolowerW(WCHAR c)
return tolower(c);
}
LPWSTR STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len)
int STRING32_lstrcmpniW(LPCWSTR a,LPCWSTR b,DWORD len)
{
while(len--)
{
......
......@@ -84,7 +84,7 @@ static void CARET_HideCaret()
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 @@ static void CARET_Initialize()
{
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 @@ BOOL CreateCaret(HWND hwnd, HBITMAP bitmap, INT width, INT height)
* DestroyCaret (USER.164)
*/
void DestroyCaret()
BOOL DestroyCaret()
{
/* if (!Caret.hwnd) return;
*/
......@@ -177,6 +178,7 @@ void DestroyCaret()
CARET_HideCaret();
Caret.hwnd = 0; /* cursor marked as not existing */
return TRUE;
}
......
......@@ -21,7 +21,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993, 1994";
#include "debug.h"
/* Dialog base units */
static WORD xBaseUnit = 0, yBaseUnit = 0;
WORD xBaseUnit = 0, yBaseUnit = 0;
/***********************************************************************
......@@ -469,7 +469,7 @@ HWND CreateDialogIndirectParam( HINSTANCE hInst, SEGPTR dlgTemplate,
/***********************************************************************
* 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 @@ static int DIALOG_DoDialogBox( HWND hwnd, HWND owner )
/***********************************************************************
* 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 @@ int DialogBox( HINSTANCE hInst, SEGPTR dlgTemplate,
/***********************************************************************
* 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 @@ int DialogBoxParam( HINSTANCE hInst, SEGPTR dlgTemplate,
/***********************************************************************
* 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 @@ int DialogBoxIndirect( HINSTANCE hInst, HANDLE dlgTemplate,
/***********************************************************************
* 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 @@ int DialogBoxIndirectParam( HINSTANCE hInst, HANDLE dlgTemplate,
/***********************************************************************
* 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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment