Release 960331

Sun Mar 31 13:54:46 1996  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [tools/build.c]
	Changed BuildSpec32Files() to generate assembly instead of C code.
	Unified -spec16 and -spec32 options; DLL type is now determined by
	the 'type' declaration in the .spec file.
	New -stdcall option to build all stdcall assembly relays.

	* [if1632/relay.c] [if1632/relay32.c] [include/dlls.h]
	Started to unify 16- and 32-bit builtin DLLs.

	* [loader/module.c]
	Added MODULE_GetWndProcEntry32() to mirror MODULE_GetWndProcEntry16().

	* [loader/pe_image.c] [loader/resource.c]
	All modules now have a NE signature, and can be distinguished by
	the NE_FFLAGS_WIN32 flag.

	* [windows/alias.c]
	Aliases for built-in window procedures are now all created at
	startup in ALIAS_Init().

Fri Mar 29 14:56:39 1996  Greg Kreider <kreider@natlab.research.philips.com>

	* [controls/combo.c]
	Limit rectangle to clear to size of item when painting combo, not
 	default.  Only draw items in list when there is enough room for them.

	* [controls/listbox.c]
	Get the measure of every item that's added and store in the item's
 	data structure.  Scroll listbox if mouse near edge of box.  Only
 	draw items in list when there is enough room.

Fri Mar 29 12:00:00 1996  Alex Korobka <alex@phm30.pharm.sunysb.edu>

	* [windows/defwnd.c] [windows/dialog.c] [windows/mdi.c]
	  [windows/nonclient.c] [controls/menu.c] 
	Various changes for better keyboard handling. 

	* [windows/event.c] [windows/message.c] [misc/keyboard.c]
	Proper keyboard message ordering, working GetKeyState() (finally!), 
	improvements in ToAscii().

	* [windows/win.c] [windows/message.c]
	Small improvements in WIN_FindWinToRepaint.

	* [windows/win.c] [windows/painting.c] [windows/nonclient.c]
	Put update region in WM_NCPAINT wParam.

	* [loader/task.c]
	Kill task timers when task is deleted, switch timers to the
	new queue in SetTaskQueue().

	* [loader/signal.c] [miscemu/dosmem.c]
	Added SIGALRM signal handler to increment BIOS clock. 

	* [windows/win.c] [windows/winpos.c] [windows/mdi.c]
	Fixed ChildWindowFromPoint(), WM_PARENTNOTIFY and its handling by
	MDI client.

	* [windows/winpos.c]
	Improvements in handling of owned popups. "Floating" toolboxes 
	work better now. 

Thu Mar 28 12:38:29 1996  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [misc/registry.c]
	New file, registry rewrite including win32 extensions
	- Unicode
	- multiple valus per key
	- different datatypes for values
	- multiple rootkeys
	- saving and loading in different registries.

	* [include/winreg.h]
	New file, definitions and structs for registry.

	* [include/winerror.h]
	Some new error defines added... there are more, someone please
 	check a (real-)windows winerror.h.
	
	* [if1632/shell.spec] [if1632/advapi32.spec] [if1632/kernel.spec]
	Registry specs added.

	* [if1632/relay.c]
	Switch internal SHELL.DLL to default 'used'.

	* [win32/string32.c] [include/string32.h]
	Some new functions added.
	char should be unsigned char when converting to 16bit ints.

	* [misc/shell.c] [include/shell.h] [win32/advapi.c]
	Removed old registry functions.

Tue Mar 26 15:01:46 1996  Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>

	* [include/bitmaps/ocr_ibeam]
	Fixed the position of the hotspot.

	* [objects/text.c]
	Fixed a few bugs in TEXT_TabbedTextOut().

	* [windows/event.c]
	Fixed the order of the bits in the KeyStateTable.
	0x80 is the up/down-bit.  0x01 is the toggle bit.

	* [loader/resource.c] [windows/mdi.c] [controls/edit.c]
	Fixed the calls to GetKeyState().

Tue Mar 26 08:43:15 1996  Robert Pouliot <krynos@qbc.clic.net>

	* [resources/sysres_Fr.rc] [resources/TODO]
	Updated FIND_TEXT and REPLACE_TEXT to work like the English version.

Mon Mar 25 17:38:59 1996  Tristan Tarrant <tst@dcs.ed.ac.uk>

	* [resources/sysres_it.rc]
	Added support for Italian [It] language.
This commit is contained in:
Alexandre Julliard 1996-03-31 16:40:13 +00:00
parent 59730ae1c6
commit c981d0bf88
130 changed files with 4585 additions and 1902 deletions

View File

@ -1,12 +1,14 @@
This is release 960324 of Wine the MS Windows emulator. This is still a
This is release 960331 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 "julliard@lrc.epfl.ch". Please don't
forget to include a ChangeLog entry.
WHAT'S NEW with Wine-960324: (see ChangeLog for details)
- Many Win32 and Winelib improvements.
WHAT'S NEW with Wine-960331: (see ChangeLog for details)
- Many improvements to keyboard handling.
- New registry code with Win32 support.
- Support for Italian language.
- Lots of bug fixes.
See the README file in the distribution for installation instructions.
@ -15,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/development/Wine-960324.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960324.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960324.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960324.tar.gz
sunsite.unc.edu:/pub/Linux/ALPHA/wine/development/Wine-960331.tar.gz
tsx-11.mit.edu:/pub/linux/ALPHA/Wine/development/Wine-960331.tar.gz
ftp.infomagic.com:/pub/mirrors/linux/wine/development/Wine-960331.tar.gz
aris.com:/pub/linux/ALPHA/Wine/development/Wine-960331.tar.gz
It should also be available from any site that mirrors tsx-11 or sunsite.

120
ChangeLog
View File

@ -1,3 +1,123 @@
----------------------------------------------------------------------
Sun Mar 31 13:54:46 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [tools/build.c]
Changed BuildSpec32Files() to generate assembly instead of C code.
Unified -spec16 and -spec32 options; DLL type is now determined by
the 'type' declaration in the .spec file.
New -stdcall option to build all stdcall assembly relays.
* [if1632/relay.c] [if1632/relay32.c] [include/dlls.h]
Started to unify 16- and 32-bit builtin DLLs.
* [loader/module.c]
Added MODULE_GetWndProcEntry32() to mirror MODULE_GetWndProcEntry16().
* [loader/pe_image.c] [loader/resource.c]
All modules now have a NE signature, and can be distinguished by
the NE_FFLAGS_WIN32 flag.
* [windows/alias.c]
Aliases for built-in window procedures are now all created at
startup in ALIAS_Init().
Fri Mar 29 14:56:39 1996 Greg Kreider <kreider@natlab.research.philips.com>
* [controls/combo.c]
Limit rectangle to clear to size of item when painting combo, not
default. Only draw items in list when there is enough room for them.
* [controls/listbox.c]
Get the measure of every item that's added and store in the item's
data structure. Scroll listbox if mouse near edge of box. Only
draw items in list when there is enough room.
Fri Mar 29 12:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/defwnd.c] [windows/dialog.c] [windows/mdi.c]
[windows/nonclient.c] [controls/menu.c]
Various changes for better keyboard handling.
* [windows/event.c] [windows/message.c] [misc/keyboard.c]
Proper keyboard message ordering, working GetKeyState() (finally!),
improvements in ToAscii().
* [windows/win.c] [windows/message.c]
Small improvements in WIN_FindWinToRepaint.
* [windows/win.c] [windows/painting.c] [windows/nonclient.c]
Put update region in WM_NCPAINT wParam.
* [loader/task.c]
Kill task timers when task is deleted, switch timers to the
new queue in SetTaskQueue().
* [loader/signal.c] [miscemu/dosmem.c]
Added SIGALRM signal handler to increment BIOS clock.
* [windows/win.c] [windows/winpos.c] [windows/mdi.c]
Fixed ChildWindowFromPoint(), WM_PARENTNOTIFY and its handling by
MDI client.
* [windows/winpos.c]
Improvements in handling of owned popups. "Floating" toolboxes
work better now.
Thu Mar 28 12:38:29 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
New file, registry rewrite including win32 extensions
- Unicode
- multiple valus per key
- different datatypes for values
- multiple rootkeys
- saving and loading in different registries.
* [include/winreg.h]
New file, definitions and structs for registry.
* [include/winerror.h]
Some new error defines added... there are more, someone please
check a (real-)windows winerror.h.
* [if1632/shell.spec] [if1632/advapi32.spec] [if1632/kernel.spec]
Registry specs added.
* [if1632/relay.c]
Switch internal SHELL.DLL to default 'used'.
* [win32/string32.c] [include/string32.h]
Some new functions added.
char should be unsigned char when converting to 16bit ints.
* [misc/shell.c] [include/shell.h] [win32/advapi.c]
Removed old registry functions.
Tue Mar 26 15:01:46 1996 Frans van Dorsselaer <dorssel@rulhm1.leidenuniv.nl>
* [include/bitmaps/ocr_ibeam]
Fixed the position of the hotspot.
* [objects/text.c]
Fixed a few bugs in TEXT_TabbedTextOut().
* [windows/event.c]
Fixed the order of the bits in the KeyStateTable.
0x80 is the up/down-bit. 0x01 is the toggle bit.
* [loader/resource.c] [windows/mdi.c] [controls/edit.c]
Fixed the calls to GetKeyState().
Tue Mar 26 08:43:15 1996 Robert Pouliot <krynos@qbc.clic.net>
* [resources/sysres_Fr.rc] [resources/TODO]
Updated FIND_TEXT and REPLACE_TEXT to work like the English version.
Mon Mar 25 17:38:59 1996 Tristan Tarrant <tst@dcs.ed.ac.uk>
* [resources/sysres_it.rc]
Added support for Italian [It] language.
----------------------------------------------------------------------
Sun Mar 24 13:13:11 1996 Alexandre Julliard <julliard@lrc.epfl.ch>

View File

@ -16,7 +16,7 @@ YACC = @YACC@
LEX = @LEX@
LEXLIB = @LEXLIB@
DIVINCL = -I$(TOPSRC)/include
ALLCFLAGS = $(CFLAGS) $(DEFS) $(X_CFLAGS) $(DIVINCL) $(EXTRA_DEFS)
ALLCFLAGS = $(CFLAGS) $(DEFS) $(DIVINCL) $(X_CFLAGS) $(EXTRA_DEFS)
LDCOMBINE = ld -r
RM = rm -f
BUILD = $(TOPSRC)/tools/build

View File

@ -235,21 +235,17 @@ static LRESULT CBPaint(HWND hwnd, WPARAM wParam, LPARAM lParam)
GetClientRect(hwnd, &rect);
rect.right -= (lphc->RectButton.right - lphc->RectButton.left);
FillRect(hdc, &rect, hBrush);
lpls = ListBoxGetItem(lphl,lphl->ItemFocused);
if (lpls != NULL) {
height = lpls->mis.itemHeight;
rect.bottom = rect.top + height;
if (lphl->OwnerDrawn) {
FillRect(hdc, &rect, hBrush);
ListBoxDrawItem (hwnd, lphl, hdc, lpls, &rect, ODA_DRAWENTIRE, 0);
} else {
ListBoxDrawItem (hwnd, lphl, hdc, lpls, &rect, ODA_DRAWENTIRE, 0);
}
if (GetFocus() == hwnd)
ListBoxDrawItem (hwnd,lphl, hdc, lpls, &rect, ODA_FOCUS, ODS_FOCUS);
}
else FillRect(hdc, &rect, hBrush);
SelectObject(hdc,hOldFont);
EndPaint(hwnd, &ps);
return 0;
@ -774,8 +770,9 @@ static LRESULT CBLPaint( HWND hwnd, WPARAM wParam, LPARAM lParam )
if (i >= lphl->FirstVisible) {
height = lpls->mis.itemHeight;
/* must have enough room to draw entire item */
if (top > (rect.bottom-height+1)) break;
if (top > rect.bottom) break;
lpls->itemRect.top = top;
lpls->itemRect.bottom = top + height;
lpls->itemRect.left = rect.left;

View File

@ -2798,12 +2798,7 @@ static void EDIT_WM_KeyDown(HWND hwnd, WPARAM wParam)
return;
}
/* FIXME: GetKeyState appears to have its bits reversed */
#if CorrectGetKeyState
if(motionKey && (0x80 & GetKeyState(VK_SHIFT))) {
#else
if(motionKey && (0x01 & GetKeyState(VK_SHIFT))) {
#endif
EDIT_ExtendSel(hwnd, es->WndCol, es->WndRow*es->txtht);
} else {
EDIT_SetAnchor(hwnd, es->CurrLine, es->CurrCol);

View File

@ -63,6 +63,9 @@
#define LIST_HEAP_SIZE 0x10000
#define LBMM_EDGE 4 /* distance inside box which is same as moving mouse
outside box, to trigger scrolling of LB */
static void ListBoxInitialize(LPHEADLIST lphl)
{
lphl->lpFirst = NULL;
@ -326,7 +329,7 @@ void ListBoxAskMeasure(LPHEADLIST lphl, LPLISTSTRUCT lpls)
if (lphl->dwStyle & LBS_OWNERDRAWFIXED) {
lphl->StdItemHeight = lpmeasure->itemHeight;
lphl->needMeasure = FALSE;
lpls->mis.itemHeight = lpmeasure->itemHeight;
}
USER_HEAP_FREE(hTemp);
@ -1036,7 +1039,7 @@ static LONG LBMouseMove(HWND hwnd, WORD wParam, LONG lParam)
dprintf_listbox(stddeb,"LBMouseMove %d %d\n",SLOWORD(lParam),SHIWORD(lParam));
if ((wParam & MK_LBUTTON) != 0) {
y = SHIWORD(lParam);
if (y < 0) {
if (y < LBMM_EDGE) {
if (lphl->FirstVisible > 0) {
lphl->FirstVisible--;
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
@ -1045,7 +1048,7 @@ static LONG LBMouseMove(HWND hwnd, WORD wParam, LONG lParam)
}
}
GetClientRect(hwnd, &rect);
if (y >= rect.bottom) {
if (y >= (rect.bottom-LBMM_EDGE)) {
if (lphl->FirstVisible < ListMaxFirstVisible(lphl)) {
lphl->FirstVisible++;
SetScrollPos(hwnd, SB_VERT, lphl->FirstVisible, TRUE);
@ -1053,7 +1056,7 @@ static LONG LBMouseMove(HWND hwnd, WORD wParam, LONG lParam)
return 0;
}
}
if ((y > 0) && (y < (rect.bottom - 4))) {
if ((y > 0) && (y < (rect.bottom - LBMM_EDGE))) {
if ((y < rectsel.top) || (y > rectsel.bottom)) {
iRet = ListBoxFindMouse(lphl, LOWORD(lParam), HIWORD(lParam));
if (iRet == lphl->ItemFocused || iRet == -1) {
@ -1281,7 +1284,7 @@ static LONG LBSetFont(HWND hwnd, WPARAM wParam, LPARAM lParam)
TEXTMETRIC tm;
GetTextMetrics( hdc, &tm );
lphl->StdItemHeight = tm.tmHeight;
dprintf_listbox(stddeb,"LBSetFont: new font %d with height %d",
dprintf_listbox(stddeb,"LBSetFont: new font %d with height %d\n",
lphl->hFont, lphl->StdItemHeight);
ReleaseDC( 0, hdc );
}
@ -1345,7 +1348,7 @@ static LONG LBPaint(HWND hwnd, WORD wParam, LONG lParam)
if (i >= lphl->FirstVisible) {
height = lpls->mis.itemHeight;
if (top > rect.bottom) {
if (top > (rect.bottom-height+1)) {
if (lphl->dwStyle & LBS_MULTICOLUMN) {
lphl->ItemsPerColumn = MAX(lphl->ItemsPerColumn, ipc);
ipc = 0;

View File

@ -18,11 +18,11 @@
#include "windows.h"
#include "syscolor.h"
#include "sysmetrics.h"
#include "win.h"
#include "menu.h"
#include "module.h"
#include "neexe.h"
#include "user.h"
#include "win.h"
#include "message.h"
#include "graphics.h"
#include "resource.h"
@ -239,6 +239,9 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu, UINT key )
int i;
LONG menuchar;
if (!IsMenu( hmenu )) hmenu = GetSystemMenu( hwndOwner, FALSE);
if (!hmenu) return -1;
menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hmenu );
lpitem = (MENUITEM *) USER_HEAP_LIN_ADDR( menu->hItems );
key = toupper(key);
@ -1624,19 +1627,63 @@ void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt )
*
* Menu-bar tracking upon a keyboard event. Called from NC_HandleSysCommand().
*/
void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam )
void MENU_TrackKbdMenuBar( WND* wndPtr, UINT wParam, INT vkey)
{
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr->wIDmenu) return;
UINT uItem = NO_SELECTED_ITEM;
HMENU hTrackMenu;
/* find window that has a menu
*/
if( !(wndPtr->dwStyle & WS_CHILD) )
{
wndPtr = WIN_FindWndPtr( GetActiveWindow() );
if( !wndPtr ) return;
}
else
while( wndPtr->dwStyle & WS_CHILD &&
!(wndPtr->dwStyle & WS_SYSMENU) )
if( !(wndPtr = wndPtr->parent) ) return;
if( wndPtr->dwStyle & WS_CHILD || !wndPtr->wIDmenu )
if( !(wndPtr->dwStyle & WS_SYSMENU) )
return;
hTrackMenu = ( IsMenu( wndPtr->wIDmenu ) )? wndPtr->wIDmenu:
wndPtr->hSysMenu;
HideCaret(0);
SendMessage( hwnd, WM_ENTERMENULOOP, 0, 0 );
SendMessage( hwnd, WM_INITMENU, wndPtr->wIDmenu, 0 );
/* Select first selectable item */
MENU_SelectItem( hwnd, (HMENU)wndPtr->wIDmenu, NO_SELECTED_ITEM );
MENU_SelectNextItem( hwnd, (HMENU)wndPtr->wIDmenu );
MENU_TrackMenu( (HMENU)wndPtr->wIDmenu, TPM_LEFTALIGN | TPM_LEFTBUTTON,
0, 0, hwnd, NULL );
SendMessage( hwnd, WM_EXITMENULOOP, 0, 0 );
SendMessage( wndPtr->hwndSelf, WM_ENTERMENULOOP, 0, 0 );
SendMessage( wndPtr->hwndSelf, WM_INITMENU, wndPtr->wIDmenu, 0 );
/* find suitable menu entry
*/
if( vkey == VK_SPACE )
uItem = SYSMENU_SELECTED;
else if( vkey )
{
uItem = MENU_FindItemByKey( wndPtr->hwndSelf, wndPtr->wIDmenu, vkey );
if( uItem >= 0xFFFE )
{
if( uItem == 0xFFFF )
MessageBeep(0);
SendMessage( wndPtr->hwndSelf, WM_EXITMENULOOP, 0, 0 );
ShowCaret(0);
return;
}
}
MENU_SelectItem( wndPtr->hwndSelf, hTrackMenu, uItem );
if( uItem == NO_SELECTED_ITEM )
MENU_SelectNextItem( wndPtr->hwndSelf, hTrackMenu );
else
PostMessage( wndPtr->hwndSelf, WM_KEYDOWN, VK_DOWN, 0L );
MENU_TrackMenu( hTrackMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON,
0, 0, wndPtr->hwndSelf, NULL );
SendMessage( wndPtr->hwndSelf, WM_EXITMENULOOP, 0, 0 );
ShowCaret(0);
}
@ -2266,13 +2313,12 @@ HMENU LoadMenu( HINSTANCE instance, SEGPTR name )
if (!name) return 0;
if (!(hRsrc = FindResource( instance, name, RT_MENU ))) {
/* check for Win32 module */
instance = GetExePtr( instance );
if(((NE_MODULE*)GlobalLock(instance))->magic == PE_SIGNATURE)
if(((NE_MODULE*)GlobalLock(instance))->flags & NE_FFLAGS_WIN32)
return WIN32_LoadMenuA(instance,PTR_SEG_TO_LIN(name));
return 0;
}
if (!(hRsrc = FindResource( instance, name, RT_MENU ))) return 0;
if (!(handle = LoadResource( instance, hRsrc ))) return 0;
hMenu = LoadMenuIndirect( WIN16_LockResource(handle) );
FreeResource( handle );

View File

@ -12,10 +12,8 @@
#include "mdi.h"
#include "gdi.h"
#include "user.h"
#include "selectors.h"
#include "module.h"
#include "stackframe.h"
#include "alias.h"
#include "relay32.h"
static WNDCLASS WIDGETS_BuiltinClasses[] =
{
@ -67,21 +65,10 @@ 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(
dll,(char *)class->lpfnWndProc, 0);
/* Register the alias so we don't pass Win16 pointers to Win32 apps */
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
strcpy( name, (char *)class->lpszClassName );
class->lpszClassName = MAKE_SEGPTR(name);
class->hCursor = LoadCursor( 0, IDC_ARROW );
class->lpfnWndProc = GetWndProcEntry16( (char *)class->lpfnWndProc );
class->lpfnWndProc = MODULE_GetWndProcEntry16( (char *)class->lpfnWndProc );
if (!RegisterClass( class )) return FALSE;
}
return TRUE;

View File

@ -2,12 +2,17 @@ TOPSRC = @top_srcdir@
MODULE = if1632
DLLS16 = \
DLLS = \
advapi32.spec \
comctl32.spec \
comdlg32.spec \
commdlg.spec \
compobj.spec \
ddeml.spec \
gdi.spec \
gdi32.spec \
kernel.spec \
kernel32.spec \
keyboard.spec \
lzexpand.spec \
mmsystem.spec \
@ -17,51 +22,49 @@ DLLS16 = \
ole2disp.spec \
ole2nls.spec \
ole2prox.spec \
ole32.spec \
olecli.spec \
olesvr.spec \
shell.spec \
shell32.spec \
sound.spec \
storage.spec \
stress.spec \
system.spec \
toolhelp.spec \
user.spec \
user32.spec \
win87em.spec \
winprocs.spec \
winsock.spec
winprocs32.spec \
winsock.spec \
winspool.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)
SPEC_FILES = $(DLLS:.spec=.S)
C_SRCS = \
$(SPEC32_FILES) \
callback.c \
dummy.c \
relay.c \
relay32.c
ASM_SRCS = \
$(SPEC16_FILES) \
$(SPEC_FILES) \
call16.S \
call32.S \
except.S
except.S \
stdcall.S
.SUFFIXES: .spec
.spec.S:
$(BUILD) -spec16 $< > $*.S
.spec.c:
$(BUILD) -spec32 $< > $*.c
$(BUILD) -spec $< > $*.S
all: checkbuild $(MODULE).o
@MAKE_RULES@
$(SPEC16_FILES) $(SPEC32_FILES): $(BUILD)
$(SPEC_FILES): $(BUILD)
$(BUILD) checkbuild:
cd $(TOPSRC)/tools; $(SUBMAKE) build
@ -69,26 +72,13 @@ $(BUILD) checkbuild:
call16.S: $(TOPSRC)/include/callback.h $(BUILD)
$(BUILD) -call16 `cat $(TOPSRC)/include/callback.h | grep "extern.*CallTo16_" | sed 's/.*CallTo16_\(.*\)(.*/\1/' | sort | uniq` > call16.S
call32.S: $(SPEC16_FILES)
$(BUILD) -call32 `cat $(SPEC16_FILES) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
call32.S: $(SPEC_FILES)
$(BUILD) -call32 `cat $(SPEC_FILES) | grep CallTo32_ | sed 's/.*CallTo32_\(.*\)/\1/' | sort | uniq` > call32.S
stdcall.S: $(SPEC_FILES)
$(BUILD) -stdcall `cat $(SPEC_FILES) | grep Stdcall_ | sed 's/.*Stdcall_\([0-9]*\)/\1/' | sort | uniq` > stdcall.S
clean::
rm -f $(SPEC16_FILES) $(SPEC32_FILES) call32.S call16.S
# Kludge: don't use optimisation flags to compile these files
advapi32.o: advapi32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o advapi32.o advapi32.c
comdlg32.o: comdlg32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o comdlg32.o comdlg32.c
gdi32.o: gdi32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o gdi32.o gdi32.c
kernel32.o: kernel32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o kernel32.o kernel32.c
shell32.o: shell32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o shell32.o shell32.c
user32.o: user32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o user32.o user32.c
winprocs32.o: winprocs32.c
$(CC) -c -g $(DEFS) $(DIVINCL) $(EXTRA_DEFS) -o winprocs32.o winprocs32.c
rm -f $(SPEC_FILES) call32.S call16.S stdcall.S
### Dependencies:

View File

@ -1,4 +1,5 @@
name advapi32
type win32
base 1
0000 stub AbortSystemShutdownA
@ -130,37 +131,37 @@ base 1
0126 stdcall RegCloseKey(long) RegCloseKey
0127 stub RegConnectRegistryA
0128 stub RegConnectRegistryW
0129 stub RegCreateKeyA
0130 stdcall RegCreateKeyExA(long ptr long ptr long long ptr ptr ptr) RegCreateKeyEx
0131 stub RegCreateKeyExW
0132 stub RegCreateKeyW
0133 stub RegDeleteKeyA
0134 stub RegDeleteKeyW
0135 stub RegDeleteValueA
0136 stub RegDeleteValueW
0137 stub RegEnumKeyA
0138 stub RegEnumKeyExA
0139 stub RegEnumKeyExW
0140 stub RegEnumKeyW
0141 stub RegEnumValueA
0142 stub RegEnumValueW
0143 stub RegFlushKey
0129 stdcall RegCreateKeyA(long ptr ptr) RegCreateKeyA
0130 stdcall RegCreateKeyExA(long ptr long ptr long long ptr ptr ptr) RegCreateKeyExA
0131 stdcall RegCreateKeyExW(long ptr long ptr long long ptr ptr ptr) RegCreateKeyExW
0132 stdcall RegCreateKeyW(long ptr ptr) RegCreateKeyW
0133 stdcall RegDeleteKeyA(long ptr) RegDeleteKeyA
0134 stdcall RegDeleteKeyW(long ptr) RegDeleteKeyW
0135 stdcall RegDeleteValueA(long ptr) RegDeleteValueA
0136 stdcall RegDeleteValueW(long ptr) RegDeleteValueW
0137 stdcall RegEnumKeyA(long long ptr long) RegEnumKeyA
0138 stdcall RegEnumKeyExA(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyExA
0139 stdcall RegEnumKeyExW(long long ptr ptr ptr ptr ptr ptr) RegEnumKeyExW
0140 stdcall RegEnumKeyW(long long ptr long) RegEnumKeyW
0141 stdcall RegEnumValueA(long long ptr ptr ptr ptr ptr ptr) RegEnumValueA
0142 stdcall RegEnumValueW(long long ptr ptr ptr ptr ptr ptr) RegEnumValueW
0143 stdcall RegFlushKey(long) RegFlushKey
0144 stub RegGetKeySecurity
0145 stub RegLoadKeyA
0146 stub RegLoadKeyW
0147 stub RegNotifyChangeKeyValue
0148 stub RegOpenKeyA
0149 stub RegOpenKeyExA
0150 stub RegOpenKeyExW
0151 stub RegOpenKeyW
0152 stub RegQueryInfoKeyA
0153 stub RegQueryInfoKeyW
0148 stdcall RegOpenKeyA(long ptr ptr) RegOpenKeyA
0149 stdcall RegOpenKeyExA(long ptr long long ptr) RegOpenKeyExA
0150 stdcall RegOpenKeyExW(long ptr long long ptr) RegOpenKeyExW
0151 stdcall RegOpenKeyW(long ptr ptr) RegOpenKeyW
0152 stdcall RegQueryInfoKeyA(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKeyA
0153 stdcall RegQueryInfoKeyW(long ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) RegQueryInfoKeyW
0154 stub RegQueryMultipleValuesA
0155 stub RegQueryMultipleValuesW
0156 stub RegQueryValueA
0157 stdcall RegQueryValueExA(long ptr long long ptr ptr) RegQueryValueEx
0158 stub RegQueryValueExW
0159 stub RegQueryValueW
0156 stdcall RegQueryValueA(long ptr ptr ptr) RegQueryValueA
0157 stdcall RegQueryValueExA(long ptr ptr ptr ptr ptr) RegQueryValueExA
0158 stdcall RegQueryValueExW(long ptr ptr ptr ptr ptr) RegQueryValueExW
0159 stdcall RegQueryValueW(long ptr ptr ptr) RegQueryValueW
0160 stub RegRemapPreDefKey
0161 stub RegReplaceKeyA
0162 stub RegReplaceKeyW
@ -169,10 +170,10 @@ base 1
0165 stub RegSaveKeyA
0166 stub RegSaveKeyW
0167 stub RegSetKeySecurity
0168 stub RegSetValueA
0169 stdcall RegSetValueExA(long ptr long long ptr long) RegSetValueEx
0170 stub RegSetValueExW
0171 stub RegSetValueW
0168 stdcall RegSetValueA(long ptr long ptr long) RegSetValueA
0169 stdcall RegSetValueExA(long ptr long long ptr long) RegSetValueExA
0170 stdcall RegSetValueExW(long ptr long long ptr long) RegSetValueExW
0171 stdcall RegSetValueW(long ptr long ptr long) RegSetValueW
0172 stub RegUnLoadKeyA
0173 stub RegUnLoadKeyW
0174 stub RegisterEventSourceA

View File

@ -1,4 +1,5 @@
name comctl32
type win32
base 2
00 stub MenuHelp

View File

@ -1,4 +1,5 @@
name comdlg32
type win32
base 1
0000 stub ArrowBtnWndProc

View File

@ -1,4 +1,5 @@
name commdlg
type win16
id 14
1 pascal16 GetOpenFileName(ptr) GetOpenFileName

View File

@ -1,4 +1,5 @@
name compobj
type win16
id 22
1 pascal CoBuildVersion() CoBuildVersion

View File

@ -1,4 +1,5 @@
name ddeml
type win16
id 25
2 stub DdeInitialize #(ptr segptr long long) DdeInitialize

View File

@ -1,4 +1,5 @@
name gdi
type win16
id 3
1 pascal SetBkColor(word long) SetBkColor

View File

@ -1,4 +1,5 @@
name gdi32
type win32
base 1
0000 stub AbortDoc

View File

@ -1,4 +1,5 @@
name kernel
type win16
id 1
1 stub FatalExit
@ -208,15 +209,15 @@ id 1
216 pascal RegEnumKey(long long ptr long) RegEnumKey
217 pascal RegOpenKey(long ptr ptr) RegOpenKey
218 pascal RegCreateKey(long ptr ptr) RegCreateKey
219 stub RegDeleteValue
219 pascal RegDeleteKey(long ptr) RegDeleteKey
220 pascal RegCloseKey(long) RegCloseKey
221 pascal RegSetValue(long ptr long ptr long) RegSetValue
222 stub RegDeleteValue
223 stub RegEnumValue
222 pascal RegDeleteValue(long ptr) RegDeleteValue
223 pascal RegEnumValue(long long ptr ptr ptr ptr ptr ptr) RegEnumValue
224 pascal RegQueryValue(long ptr ptr ptr) RegQueryValue
225 stub RegQueryValueEx
226 stub RegSetValueEx
227 stub RegFlushKey
225 pascal RegQueryValueEx(long ptr ptr ptr ptr ptr) RegQueryValueEx
226 pascal RegSetValueEx(long ptr long long ptr long) RegSetValueEx
227 pascal RegFlushKey(long) RegFlushKey
#228 K228
#229 K229
230 stub GlobalSmartPageLock

View File

@ -1,4 +1,5 @@
name kernel32
type win32
base 1
0000 stub AddAtomA

View File

@ -1,4 +1,5 @@
name keyboard
type win16
id 7
#1 pascal Inquire

View File

@ -1,4 +1,5 @@
name lzexpand
type win16
id 26
1 pascal LZCopy(word word) LZCopy

View File

@ -1,4 +1,5 @@
name mmsystem
type win16
id 10
#1 pascal MMSYSTEM_WEP(word word word ptr) MMSYSTEM_WEP

View File

@ -1,4 +1,5 @@
name mouse
type win16
id 13
1 stub INQUIRE

View File

@ -1,4 +1,5 @@
name OLE2
type win16
id 15
1 pascal OleBuildVersion() OleBuildVersion

View File

@ -1,4 +1,5 @@
name ole2conv
type win16
id 16
1 stub GETFILTERINFO

View File

@ -1,4 +1,5 @@
name ole2disp
type win16
id 17
1 stub DLLGETCLASSOBJECT

View File

@ -1,4 +1,5 @@
name ole2nls
type win16
id 18
1 pascal GetUserDefaultLCID() GetUserDefaultLCID

View File

@ -1,4 +1,5 @@
name ole2prox
type win16
id 19
1 stub DLLGETCLASSOBJECT

View File

@ -1,4 +1,5 @@
name ole32
type win32
base 1
0 stub BindMoniker

View File

@ -1,4 +1,5 @@
name olecli
type win16
id 20
#1 WEP

View File

@ -1,4 +1,5 @@
name olesvr
type win16
id 21
#1 WEP

View File

@ -19,45 +19,41 @@
dprintf_relay
#endif
#define DLL_ENTRY(name) \
#define DLL_ENTRY(name,flags) \
{ #name, name##_Code_Start, name##_Data_Start, \
name##_Module_Start, name##_Module_End, TRUE, 0 }
#define DLL_ENTRY_NOTUSED(name) \
{ #name, name##_Code_Start, name##_Data_Start, \
name##_Module_Start, name##_Module_End, FALSE, 0 }
name##_Module_Start, name##_Module_End, (flags) }
struct dll_table_s dll_builtin_table[N_BUILTINS] =
BUILTIN_DLL dll_builtin_table[] =
{
DLL_ENTRY(KERNEL),
DLL_ENTRY(USER),
DLL_ENTRY(GDI),
DLL_ENTRY_NOTUSED(WIN87EM),
DLL_ENTRY_NOTUSED(SHELL),
DLL_ENTRY(SOUND),
DLL_ENTRY(KEYBOARD),
DLL_ENTRY(WINSOCK),
DLL_ENTRY(STRESS),
DLL_ENTRY(MMSYSTEM),
DLL_ENTRY(SYSTEM),
DLL_ENTRY(TOOLHELP),
DLL_ENTRY(MOUSE),
DLL_ENTRY_NOTUSED(COMMDLG),
DLL_ENTRY_NOTUSED(OLE2),
DLL_ENTRY_NOTUSED(OLE2CONV),
DLL_ENTRY_NOTUSED(OLE2DISP),
DLL_ENTRY_NOTUSED(OLE2NLS),
DLL_ENTRY_NOTUSED(OLE2PROX),
DLL_ENTRY_NOTUSED(OLECLI),
DLL_ENTRY_NOTUSED(OLESVR),
DLL_ENTRY_NOTUSED(COMPOBJ),
DLL_ENTRY_NOTUSED(STORAGE),
DLL_ENTRY(WINPROCS),
DLL_ENTRY_NOTUSED(DDEML),
DLL_ENTRY(LZEXPAND)
DLL_ENTRY( KERNEL, 0),
DLL_ENTRY( USER, 0),
DLL_ENTRY( GDI, 0),
DLL_ENTRY( WIN87EM, DLL_FLAG_NOT_USED),
DLL_ENTRY( SHELL, 0),
DLL_ENTRY( SOUND, 0),
DLL_ENTRY( KEYBOARD, 0),
DLL_ENTRY( WINSOCK, 0),
DLL_ENTRY( STRESS, 0),
DLL_ENTRY( MMSYSTEM, 0),
DLL_ENTRY( SYSTEM, 0),
DLL_ENTRY( TOOLHELP, 0),
DLL_ENTRY( MOUSE, 0),
DLL_ENTRY( COMMDLG, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2CONV, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2DISP, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2NLS, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLE2PROX, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLECLI, DLL_FLAG_NOT_USED),
DLL_ENTRY( OLESVR, DLL_FLAG_NOT_USED),
DLL_ENTRY( COMPOBJ, DLL_FLAG_NOT_USED),
DLL_ENTRY( STORAGE, DLL_FLAG_NOT_USED),
DLL_ENTRY( WINPROCS, 0),
DLL_ENTRY( DDEML, DLL_FLAG_NOT_USED),
DLL_ENTRY( LZEXPAND, 0),
{ NULL, } /* Last entry */
};
/* don't forget to increase N_BUILTINS in dlls.h if you add a dll */
/* Saved 16-bit stack */
WORD IF1632_Saved16_ss = 0;
WORD IF1632_Saved16_sp = 0;
@ -112,8 +108,8 @@ void RELAY_DebugCall32( int func_type, char *args,
frame = CURRENT_STACK16;
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Call %s.%d: %*.*s(",
table->name, frame->ordinal_number, *name, *name, name + 1 );
printf( "Call %s.%d: %.*s(",
table->name, frame->ordinal_number, *name, name + 1 );
args16 = (char *)frame->args;
for (i = 0; i < strlen(args); i++)
@ -184,8 +180,8 @@ void RELAY_DebugReturn( int func_type, int ret_val, int args32 )
frame = CURRENT_STACK16;
table = &dll_builtin_table[frame->dll_id-1];
name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
printf( "Ret %s.%d: %*.*s() ",
table->name, frame->ordinal_number, *name, *name, name + 1 );
printf( "Ret %s.%d: %.*s() ",
table->name, frame->ordinal_number, *name, name + 1 );
switch(func_type)
{
case 0: /* long */
@ -212,19 +208,34 @@ void RELAY_DebugReturn( int func_type, int ret_val, int args32 )
/***********************************************************************
* RELAY_Unimplemented
* RELAY_Unimplemented16
*
* This function is called for unimplemented entry points (declared
* This function is called for unimplemented 16-bit entry points (declared
* as 'stub' in the spec file).
*/
void RELAY_Unimplemented(void)
void RELAY_Unimplemented16(void)
{
STACK16FRAME *frame = CURRENT_STACK16;
struct dll_table_s *table = &dll_builtin_table[frame->dll_id-1];
char *name = MODULE_GetEntryPointName( table->hModule, frame->ordinal_number );
fprintf( stderr, "No handler for routine %s.%d (%*.*s)\n",
table->name, frame->ordinal_number, *name, *name, name + 1 );
fprintf( stderr, "No handler for routine %s.%d (%.*s)\n",
table->name, frame->ordinal_number, *name, name + 1 );
exit(1);
}
/***********************************************************************
* RELAY_Unimplemented32
*
* This function is called for unimplemented 32-bit entry points (declared
* as 'stub' in the spec file).
* (The args are the same than for RELAY_DebugStdcall).
*/
void RELAY_Unimplemented32( int nb_args, void *entry_point,
const char *func_name )
{
fprintf( stderr, "No handler for Win32 routine %s\n", func_name );
exit(1);
}
@ -250,3 +261,33 @@ void RELAY_DebugCall16( int* stack, int nbargs )
while (nbargs--) printf( ",0x%04x", *stack++ );
printf( ")\n" );
}
/***********************************************************************
* RELAY_DebugStdcall
*/
void RELAY_DebugStdcall( int nb_args, void *entry_point, const char *func_name,
int ebp, int ret_addr, int arg1 )
{
int *parg;
if (!debugging_relay) return;
printf( "Call %s(", func_name );
for (parg = &arg1; nb_args; parg++, nb_args--)
{
printf( "%08x", *parg );
if (nb_args > 1) printf( "," );
}
printf( ") ret=%08x\n", ret_addr );
}
/***********************************************************************
* RELAY_DebugStdcallRet
*/
void RELAY_DebugStdcallRet( int ret_val, void *entry_point,
const char *func_name, int ebp, int ret_addr )
{
if (!debugging_relay) return;
printf( "Ret %s() retval=0x%08x ret=%08x\n",
func_name, ret_val, ret_addr );
}

View File

@ -24,35 +24,35 @@
#include "stddebug.h"
#include "debug.h"
WIN32_builtin *WIN32_builtin_list;
#define DLL_ENTRY(name) \
{ #name, (WIN32_function *)name##_Module_Start, \
(WIN32_function *)name##_Module_End, (int *)name##_Data_Start, NULL }
/* 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();
static WIN32_builtin WIN32_builtin_list[] =
{
DLL_ENTRY(ADVAPI32),
DLL_ENTRY(COMCTL32),
DLL_ENTRY(COMDLG32),
DLL_ENTRY(OLE32),
DLL_ENTRY(GDI32),
DLL_ENTRY(KERNEL32),
DLL_ENTRY(SHELL32),
DLL_ENTRY(USER32),
DLL_ENTRY(WINPROCS32),
DLL_ENTRY(WINSPOOL)
};
#define NB_DLLS (sizeof(WIN32_builtin_list)/sizeof(WIN32_builtin_list[0]))
static void RELAY32_MakeFakeModule(WIN32_builtin*dll);
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
int i;
for (i = 0; i < NB_DLLS; i++)
RELAY32_MakeFakeModule( &WIN32_builtin_list[i] );
/* Why should it fail, anyways? */
return 1;
}
@ -62,11 +62,11 @@ WIN32_builtin *RELAY32_GetBuiltinDLL(char *name)
WIN32_builtin *it;
size_t len;
char *cp;
int i;
len = (cp=strchr(name,'.')) ? (cp-name) : strlen(name);
for(it=WIN32_builtin_list;it;it=it->next)
if(lstrncmpi(name,it->name,len)==0)
return it;
for(i = NB_DLLS, it = WIN32_builtin_list; (i > 0); i--, it++)
if (!lstrncmpi(name,it->name,len)) return it;
return NULL;
}
@ -85,30 +85,32 @@ void RELAY32_Unimplemented(char *dll, int item)
void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
{
int i;
int i, size;
dprintf_module(stddeb, "Looking for %s in %s, hint %x\n",
item ? item: "(no name)", dll->name, hint);
if(!dll)
return 0;
size = (int)(dll->last_func - dll->functions);
/* import by ordinal */
if(!item){
if(hint && hint<dll->size)
return dll->functions[hint-dll->base].definition;
if(hint && hint < size)
return dll->functions[hint - *dll->base].definition;
return 0;
}
/* hint is correct */
if(hint && hint<dll->size &&
if(hint && hint < size &&
dll->functions[hint].name &&
strcmp(item,dll->functions[hint].name)==0)
return dll->functions[hint].definition;
/* hint is incorrect, search for name */
for(i=0;i<dll->size;i++)
for(i=0;i < size;i++)
if (dll->functions[i].name && !strcmp(item,dll->functions[i].name))
return dll->functions[i].definition;
/* function at hint has no name (unimplemented) */
if(hint && hint<dll->size && !dll->functions[hint].name)
if(hint && hint < size && !dll->functions[hint].name)
{
dll->functions[hint].name=xstrdup(item);
dprintf_module(stddeb, "Returning unimplemented function %s.%d\n",
@ -118,11 +120,6 @@ void *RELAY32_GetEntryPoint(WIN32_builtin *dll, char *item, int hint)
return 0;
}
void RELAY32_DebugEnter(char *dll,char *name)
{
dprintf_relay(stddeb, "Entering %s.%s\n",dll,name);
}
LONG RELAY32_CallWindowProc( WNDPROC func, int hwnd, int message,
int wParam, int lParam )
{
@ -201,7 +198,7 @@ LONG RELAY32_CallWindowProcConvStruct( WNDPROC func, int hwnd, int message,
return RELAY32_CallWindowProc(func,hwnd,message,wParam,(int)lParam);
}
void RELAY32_MakeFakeModule(WIN32_builtin*dll)
static void RELAY32_MakeFakeModule(WIN32_builtin*dll)
{
NE_MODULE *pModule;
struct w_files *wpnt;
@ -227,10 +224,10 @@ void RELAY32_MakeFakeModule(WIN32_builtin*dll)
FarSetOwner( hModule, hModule );
pModule = (NE_MODULE*)GlobalLock(hModule);
/* Set all used entries */
pModule->magic=PE_SIGNATURE;
pModule->magic=NE_SIGNATURE;
pModule->count=1;
pModule->next=0;
pModule->flags=0;
pModule->flags=NE_FFLAGS_WIN32;
pModule->dgroup=0;
pModule->ss=0;
pModule->cs=0;

View File

@ -1,11 +1,7 @@
name shell
type win16
id 5
#
# WARNING ! These functions are not documented, so I didn't look for
# proper parameters. It's just to have stub for PROGMAN.EXE ...
#
1 pascal RegOpenKey(long ptr ptr) RegOpenKey
2 pascal RegCreateKey(long ptr ptr) RegCreateKey
3 pascal RegCloseKey(long) RegCloseKey
@ -31,12 +27,5 @@ id 5
# 8 7 0000 WEP exported, shared data
#100 4 0550 HERETHARBETYGARS exported, shared data
# 38 5 0000 FINDENVIRONMENTSTRING exported, shared data
# 37 5 00ae DOENVIRONMENTSUBST exported, shared data
# 20 4 110a SHELLEXECUTE exported, shared data
#101 8 010e FINDEXEDLGPROC exported, shared data
# 39 10 026e INTERNALEXTRACTICON exported, shared data
# 32 9 0829 WCI exported, shared data
# 36 10 08dc EXTRACTASSOCIATEDICON exported, shared data

View File

@ -1,4 +1,5 @@
name shell32
type win32
base 1
0000 stub CheckEscapesA

View File

@ -1,4 +1,5 @@
name sound
type win16
id 6
1 pascal16 OpenSound() OpenSound

View File

@ -1,4 +1,5 @@
name storage
type win16
id 23
1 stub StgCreateDocFile

View File

@ -1,6 +1,7 @@
# summary: resource modification dll
#
name stress
type win16
id 9
2 pascal allocmem(long) AllocMem

View File

@ -1,4 +1,5 @@
name system
type win16
id 11
1 stub InquireSystem

View File

@ -1,4 +1,5 @@
name toolhelp
type win16
id 12
50 pascal16 GlobalHandleToSel(word) GlobalHandleToSel

View File

@ -1,4 +1,5 @@
name user
type win16
id 2
1 pascal16 MessageBox(word ptr ptr word) MessageBox

View File

@ -1,4 +1,5 @@
name user32
type win32
base 1
0000 stub ActivateKeyboardLayout
@ -592,7 +593,7 @@ base 1
0581 stub WindowFromPoint
0582 stub keybd_event
0583 stub mouse_event
0584 cdecl wsprintfA(ptr ptr ...) vsprintf
0584 stdcall wsprintfA() USER32_wsprintfA
0585 stub wsprintfW
0586 stub wvsprintfA
0587 stub wvsprintfW

View File

@ -1,4 +1,5 @@
name win87em
type win16
id 4
1 register _fpMath() WIN87_fpmath

View File

@ -1,4 +1,5 @@
name winprocs
type win16
id 24
1 pascal ButtonWndProc(word word word long) ButtonWndProc

View File

@ -1,4 +1,5 @@
name winprocs32
type win32
1 stdcall ButtonWndProc(long long long long) ButtonWndProc32
2 stdcall StaticWndProc(long long long long) StaticWndProc32

View File

@ -4,6 +4,7 @@
# Summary: Module definition file for Windows Sockets DLL.
#
name winsock
type win16
id 8
1 pascal16 accept(word ptr ptr) WINSOCK_accept

View File

@ -1,4 +1,5 @@
name winspool
type win32
base 100
001 stub ADVANCEDSETUPDIALOG

View File

@ -2,30 +2,7 @@
#define __WINE_ADVAPI32_H
#include "shell.h"
#include "kernel32.h"
#define REGSAM long
BOOL WINAPI GetUserNameA (char * lpBuffer, DWORD *nSize);
WINAPI LONG RegCreateKeyEx(HKEY key,
const char *subkey,
long dontuse,
const char *keyclass,
DWORD options,
REGSAM sam,
SECURITY_ATTRIBUTES *atts,
HKEY *res,
DWORD *disp);
WINAPI LONG RegSetValueExA (HKEY key,
const char *name,
DWORD dontuse,
DWORD type,
const void* data,
DWORD len
);
WINAPI LONG RegQueryValueExA(HKEY key,
const char *subkey,
DWORD dontuse,
DWORD *type,
void *ptr,
DWORD *len);
BOOL WINAPI GetUserNameA (char * lpBuffer, DWORD *nSize);
#endif /* __WINE_ADVAPI32_H */

View File

@ -5,7 +5,13 @@
*
*/
typedef struct _FUNCTIONALIAS{
#ifndef __WINE_ALIAS_H
#define __WINE_ALIAS_H
#include "wintypes.h"
typedef struct
{
DWORD wine;
DWORD win16;
DWORD win32;
@ -18,6 +24,8 @@ typedef struct _ALIASHASH{
int recno;
} ALIASHASH;
void ALIAS_RegisterAlias(DWORD,DWORD,DWORD);
FUNCTIONALIAS* ALIAS_LookupAlias(DWORD);
extern BOOL ALIAS_Init(void);
extern void ALIAS_RegisterAlias( DWORD Wine, DWORD Win16Proc, DWORD Win32Proc);
extern FUNCTIONALIAS* ALIAS_LookupAlias(DWORD);
#endif /* __WINE_ALIAS_H */

View File

@ -1,6 +1,6 @@
/* XPM */
static char * ocr_ibeam[] = {
"32 32 2 1 3 8",
"32 32 2 1 0 8",
" s black c black",
". s None c None",
" . .........................",

View File

@ -1,34 +1,35 @@
/* $Id: dlls.h,v 1.2 1993/07/04 04:04:21 root Exp root $
*/
/*
* Copyright Robert J. Amstadt, 1993
*/
#ifndef DLLS_H
#define DLLS_H
#ifndef __WINE_DLLS_H
#define __WINE_DLLS_H
#include "wintypes.h"
#define MAX_NAME_LENGTH 64
struct dll_table_s
typedef struct dll_table_s
{
char *name; /* DLL name */
BYTE * code_start; /* 32-bit address of DLL code */
BYTE * data_start; /* 32-bit address of DLL data */
const BYTE *code_start; /* 32-bit address of DLL code */
const BYTE *data_start; /* 32-bit address of DLL data */
BYTE *module_start; /* 32-bit address of the module data */
BYTE *module_end;
BOOL used; /* use MS provided if FALSE */
int flags; /* flags (see below) */
HMODULE hModule; /* module created for this DLL */
};
} BUILTIN_DLL;
/* DLL flags */
#define DLL_FLAG_NOT_USED 1 /* Use original Windows DLL if possible */
#define DLL_FLAG_WIN32 2 /* DLL is a Win32 DLL */
#define DECLARE_DLL(name) \
extern BYTE name##_Code_Start[]; \
extern BYTE name##_Data_Start[]; \
extern const BYTE name##_Code_Start[]; \
extern const BYTE name##_Data_Start[]; \
extern BYTE name##_Module_Start[]; \
extern BYTE name##_Module_End[];
/* 16-bit DLLs */
DECLARE_DLL(KERNEL)
DECLARE_DLL(USER)
DECLARE_DLL(GDI)
@ -56,8 +57,19 @@ DECLARE_DLL(WINPROCS)
DECLARE_DLL(DDEML)
DECLARE_DLL(LZEXPAND)
#define N_BUILTINS 26
/* 32-bit DLLs */
extern struct dll_table_s dll_builtin_table[];
DECLARE_DLL(ADVAPI32)
DECLARE_DLL(COMCTL32)
DECLARE_DLL(COMDLG32)
DECLARE_DLL(OLE32)
DECLARE_DLL(GDI32)
DECLARE_DLL(KERNEL32)
DECLARE_DLL(SHELL32)
DECLARE_DLL(USER32)
DECLARE_DLL(WINPROCS32)
DECLARE_DLL(WINSPOOL)
#endif /* DLLS_H */
extern BUILTIN_DLL dll_builtin_table[];
#endif /* __WINE_DLLS_H */

View File

@ -92,20 +92,6 @@ typedef struct {
#define STD_OUTPUT_HANDLE ((DWORD) -11)
#define STD_ERROR_HANDLE ((DWORD) -12)
/* The security attributes structure
*/
typedef struct {
DWORD nLength;
void *lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef struct
{
int dwLowDateTime;
int dwHighDateTime;
} FILETIME;
typedef struct
{
int dwFileAttributes;

View File

@ -12,7 +12,7 @@ extern BOOL MENU_Init(void);
extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
int orgX, int orgY ); /* menu.c */
extern void MENU_TrackMouseMenuBar( HWND hwnd, POINT pt ); /* menu.c */
extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam ); /* menu.c */
extern void MENU_TrackKbdMenuBar( WND*, UINT wParam, INT vkey); /* menu.c */
extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
HWND hwnd, BOOL suppress_draw ); /* menu.c */
extern LRESULT PopupMenuWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam );

View File

@ -12,7 +12,7 @@
/* miscemu/dosmem.c */
extern BOOL DOSMEM_Init(void);
extern void DOSMEM_Alarm(void);
extern void DOSMEM_Tick(void);
extern void DOSMEM_FillBiosSegment(void);
extern HANDLE DOSMEM_BiosSeg;

View File

@ -105,10 +105,12 @@ extern BOOL MODULE_Init(void);
extern int MODULE_OpenFile( HMODULE hModule );
extern LPSTR MODULE_GetModuleName( HMODULE hModule );
extern void MODULE_RegisterModule( HMODULE hModule );
extern WORD MODULE_GetOrdinal( HMODULE hModule, char *name );
extern WORD MODULE_GetOrdinal( HMODULE hModule, const char *name );
extern SEGPTR MODULE_GetEntryPoint( HMODULE hModule, WORD ordinal );
extern BOOL MODULE_SetEntryPoint( HMODULE hModule, WORD ordinal, WORD offset );
extern LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal );
extern FARPROC MODULE_GetWndProcEntry16( const char *name );
extern FARPROC MODULE_GetWndProcEntry32( const char *name );
extern BOOL NE_LoadSegment( HMODULE hModule, WORD segnum );
extern void NE_FixupPrologs( HMODULE hModule );

View File

@ -26,38 +26,38 @@ struct mz_header_s
*/
struct ne_header_s
{
WORD ne_magic; /* NE signature 'NE' */
BYTE linker_version; /* Linker version number */
BYTE linker_revision; /* Linker revision number */
WORD entry_tab_offset; /* Offset to entry table relative to NE */
WORD entry_tab_length; /* Length of entry table in bytes */
DWORD reserved1; /* Reserved by Microsoft */
WORD format_flags; /* Flags about segments in this file */
WORD auto_data_seg; /* Automatic data segment number */
WORD local_heap_length; /* Initial size of local heap */
WORD stack_length; /* Initial size of stack */
WORD ip; /* Initial IP */
WORD cs; /* Initial CS */
WORD sp; /* Initial SP */
WORD ss; /* Initial SS */
WORD n_segment_tab; /* # of entries in segment table */
WORD n_mod_ref_tab; /* # of entries in module reference tab.*/
WORD nrname_tab_length; /* Length of nonresident-name table */
WORD segment_tab_offset; /* Offset to segment table */
WORD resource_tab_offset;/* Offset to resource table */
WORD rname_tab_offset; /* Offset to resident-name table */
WORD moduleref_tab_offset;/* Offset to module reference table */
WORD iname_tab_offset; /* Offset to imported name table */
DWORD nrname_tab_offset; /* Offset to nonresident-name table */
WORD n_mov_entry_points; /* # of movable entry points */
WORD align_shift_count; /* Logical sector alignment shift count */
WORD n_resource_seg; /* # of resource segments */
BYTE operating_system; /* Flags indicating target OS */
BYTE additional_flags; /* Additional information flags */
WORD fastload_offset; /* Offset to fast load area */
WORD fastload_length; /* Length of fast load area */
WORD reserved2; /* Reserved by Microsoft */
WORD expect_version; /* Expected Windows version number */
WORD ne_magic; /* 00 NE signature 'NE' */
BYTE linker_version; /* 02 Linker version number */
BYTE linker_revision; /* 03 Linker revision number */
WORD entry_tab_offset; /* 04 Offset to entry table relative to NE */
WORD entry_tab_length; /* 06 Length of entry table in bytes */
DWORD reserved1; /* 08 Reserved by Microsoft */
WORD format_flags; /* 0c Flags about segments in this file */
WORD auto_data_seg; /* 0e Automatic data segment number */
WORD local_heap_length; /* 10 Initial size of local heap */
WORD stack_length; /* 12 Initial size of stack */
WORD ip; /* 14 Initial IP */
WORD cs; /* 16 Initial CS */
WORD sp; /* 18 Initial SP */
WORD ss; /* 1a Initial SS */
WORD n_segment_tab; /* 1c # of entries in segment table */
WORD n_mod_ref_tab; /* 1e # of entries in module reference tab. */
WORD nrname_tab_length; /* 20 Length of nonresident-name table */
WORD segment_tab_offset; /* 22 Offset to segment table */
WORD resource_tab_offset; /* 24 Offset to resource table */
WORD rname_tab_offset; /* 26 Offset to resident-name table */
WORD moduleref_tab_offset; /* 28 Offset to module reference table */
WORD iname_tab_offset; /* 2a Offset to imported name table */
DWORD nrname_tab_offset; /* 2c Offset to nonresident-name table */
WORD n_mov_entry_points; /* 30 # of movable entry points */
WORD align_shift_count; /* 32 Logical sector alignment shift count */
WORD n_resource_seg; /* 34 # of resource segments */
BYTE operating_system; /* 36 Flags indicating target OS */
BYTE additional_flags; /* 37 Additional information flags */
WORD fastload_offset; /* 38 Offset to fast load area */
WORD fastload_length; /* 3a Length of fast load area */
WORD reserved2; /* 3c Reserved by Microsoft */
WORD expect_version; /* 3e Expected Windows version number */
};
#define NE_SIGNATURE ('N' | ('E' << 8))
@ -68,9 +68,11 @@ struct ne_header_s
*/
#define NE_FFLAGS_SINGLEDATA 0x0001
#define NE_FFLAGS_MULTIPLEDATA 0x0002
#define NE_FFLAGS_BUILTIN 0x0010 /* Wine built-in module */
#define NE_FFLAGS_WIN32 0x0010
#define NE_FFLAGS_BUILTIN 0x0020 /* Wine built-in module */
#define NE_FFLAGS_SELFLOAD 0x0800
#define NE_FFLAGS_LINKERROR 0x2000
#define NE_FFLAGS_CALLWEP 0x4000
#define NE_FFLAGS_LIBMODULE 0x8000
/*

View File

@ -12,8 +12,8 @@
extern void NC_GetInsideRect( HWND hwnd, RECT *rect );
extern void NC_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack );
extern void NC_DoNCPaint( HWND hwnd, BOOL active, BOOL suppress_menupaint );
extern LONG NC_HandleNCPaint( HWND hwnd );
extern void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint );
extern LONG NC_HandleNCPaint( HWND hwnd , HRGN clip);
extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam );
extern LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params );
extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt );

View File

@ -18,7 +18,8 @@ typedef enum
LANG_Fi, /* Finnish */
LANG_Da, /* Danish */
LANG_Cz, /* Czech */
LANG_Eo /* Esperanto */
LANG_Eo, /* Esperanto */
LANG_It /* Italian */
} WINE_LANGUAGE;
/* Supported modes */

View File

@ -25,13 +25,11 @@ typedef struct _WIN32_function{
typedef struct _WIN32_builtin{
char *name;
WIN32_function *functions;
int size;
int base;
WIN32_function *last_func;
const int *base;
struct _WIN32_builtin *next;
} WIN32_builtin;
extern WIN32_builtin *WIN32_builtin_list;
struct w_files
{
struct w_files * next;

View File

@ -17,8 +17,4 @@ extern WORD SELECTOR_ReallocBlock( WORD sel, const void *base, DWORD size,
enum seg_type type, BOOL is32bit,
BOOL readonly );
extern void CreateSelectors(void);
extern WNDPROC GetWndProcEntry16( char *name );
#endif /* __WINE_SELECTORS_H */

View File

@ -7,11 +7,12 @@
#define __WINE_SHELL_H
#include "windows.h"
#include "winreg.h"
extern INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon);
extern void SHELL_LoadRegistry();
extern void SHELL_SaveRegistry();
extern BOOL SHELL_Init();
extern void SHELL_Init();
#define SHELL_ERROR_SUCCESS 0L
#define SHELL_ERROR_BADDB 1L
@ -23,20 +24,6 @@ extern BOOL SHELL_Init();
#define SHELL_ERROR_INVALID_PARAMETER 7L
#define SHELL_ERROR_ACCESS_DENIED 8L
#define REG_SZ 1 /* string type */
#define HKEY_CLASSES_ROOT 1
typedef struct tagKEYSTRUCT {
HKEY hKey;
LPSTR lpSubKey;
DWORD dwType;
LPSTR lpValue;
struct tagKEYSTRUCT *lpPrevKey;
struct tagKEYSTRUCT *lpNextKey;
struct tagKEYSTRUCT *lpSubLvl;
} KEYSTRUCT, *LPKEYSTRUCT;
typedef struct { /* structure for dropped files */
WORD wSize;
POINT ptMousePos;

View File

@ -10,7 +10,7 @@
#include "wintypes.h"
int STRING32_UniLen(LPWSTR s);
int STRING32_UniLen(LPCWSTR s);
void STRING32_UniToAnsi(LPSTR dest,LPCWSTR src);
void STRING32_AnsiToUni(LPWSTR dest,LPCSTR src);
LPSTR STRING32_DupUniToAnsi(LPCWSTR src);
@ -18,5 +18,7 @@ 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);
LPWSTR STRING32_strdupW(LPCWSTR);
int STRING32_lstrcmpW(LPCWSTR,LPCWSTR);
#endif

View File

@ -82,7 +82,7 @@ extern void WIN_WalkWindows( HWND hwnd, int indent );
extern Window WIN_GetXWindow( HWND hwnd );
extern BOOL WIN_UnlinkWindow( HWND hwnd );
extern BOOL WIN_LinkWindow( HWND hwnd, HWND hwndInsertAfter );
extern HWND WIN_FindWinToRepaint( HWND hwnd );
extern HWND WIN_FindWinToRepaint( HWND hwnd, HQUEUE hQueue );
extern void WIN_SendParentNotify( HWND hwnd, WORD event,
WORD idChild, LONG lValue );
extern BOOL WIN_CreateDesktopWindow(void);

View File

@ -1088,6 +1088,20 @@ typedef OFSTRUCT *LPOFSTRUCT;
#define DDL_DRIVES 0x4000
#define DDL_EXCLUSIVE 0x8000
/* The security attributes structure
*/
typedef struct {
DWORD nLength;
void *lpSecurityDescriptor;
BOOL bInheritHandle;
} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
typedef struct
{
int dwLowDateTime;
int dwHighDateTime;
} FILETIME;
/* comm */
#define CBR_110 0xFF10
@ -2885,7 +2899,7 @@ WORD GetInternalWindowPos(HWND,LPRECT,LPPOINT);
int GetKBCodePage(void);
int GetKerningPairs(HDC,int,LPKERNINGPAIR);
int GetKeyNameText(LONG,LPSTR,int);
int GetKeyState(int);
INT GetKeyState(INT);
void GetKeyboardState(BYTE*);
int GetKeyboardType(int);
HWND GetLastActivePopup(HWND);
@ -3143,13 +3157,55 @@ BOOL RectInRegion(HRGN,LPRECT);
BOOL RectVisible(HDC,LPRECT);
BOOL Rectangle(HDC,INT,INT,INT,INT);
BOOL RedrawWindow(HWND,LPRECT,HRGN,UINT);
LONG RegCloseKey(HKEY);
LONG RegCreateKey(HKEY,LPCSTR,LPHKEY);
LONG RegDeleteKey(HKEY,LPCSTR);
LONG RegEnumKey(HKEY,DWORD,LPSTR,DWORD);
LONG RegOpenKey(HKEY,LPCSTR,LPHKEY);
LONG RegQueryValue(HKEY,LPCSTR,LPSTR,LPLONG);
LONG RegSetValue(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
DWORD RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,LPHKEY);
DWORD RegOpenKeyW(HKEY,LPCWSTR,LPHKEY);
DWORD RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,LPHKEY);
DWORD RegOpenKeyA(HKEY,LPCSTR,LPHKEY);
DWORD RegOpenKey(HKEY,LPCSTR,LPHKEY);
DWORD RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,
LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
DWORD RegCreateKeyW(HKEY,LPCWSTR,LPHKEY);
DWORD RegCreateKeyExA(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,
LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
DWORD RegCreateKeyA(HKEY,LPCSTR,LPHKEY);
DWORD RegCreateKey(HKEY,LPCSTR,LPHKEY);
DWORD RegQueryValueExW(HKEY,LPWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
DWORD RegQueryValueW(HKEY,LPWSTR,LPWSTR,LPDWORD);
DWORD RegQueryValueExA(HKEY,LPSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
DWORD RegQueryValueEx(HKEY,LPSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
DWORD RegQueryValueA(HKEY,LPSTR,LPSTR,LPDWORD);
DWORD RegQueryValue(HKEY,LPSTR,LPSTR,LPDWORD);
DWORD RegSetValueExW(HKEY,LPWSTR,DWORD,DWORD,LPBYTE,DWORD);
DWORD RegSetValueExA(HKEY,LPSTR,DWORD,DWORD,LPBYTE,DWORD);
DWORD RegSetValueEx(HKEY,LPSTR,DWORD,DWORD,LPBYTE,DWORD);
DWORD RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD);
DWORD RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
DWORD RegSetValue(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
DWORD RegEnumKeyExW(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR,LPDWORD,
FILETIME*);
DWORD RegEnumKeyW(HKEY,DWORD,LPWSTR,DWORD);
DWORD RegEnumKeyExA(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPSTR,LPDWORD,
FILETIME*);
DWORD RegEnumKeyA(HKEY,DWORD,LPSTR,DWORD);
DWORD RegEnumKey(HKEY,DWORD,LPSTR,DWORD);
DWORD RegEnumValueW(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,
LPDWORD);
DWORD RegEnumValueA(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,
LPDWORD);
DWORD RegEnumValue(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,
LPDWORD);
DWORD RegCloseKey(HKEY);
DWORD RegDeleteKeyW(HKEY,LPWSTR);
DWORD RegDeleteKeyA(HKEY,LPCSTR);
DWORD RegDeleteKey(HKEY,LPCSTR);
DWORD RegDeleteValueW(HKEY,LPWSTR);
DWORD RegDeleteValueA(HKEY,LPSTR);
DWORD RegDeleteValue(HKEY,LPSTR);
DWORD RegFlushKey(HKEY);
DWORD RegQueryInfoKeyW(HKEY,LPWSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,FILETIME*);
DWORD RegQueryInfoKeyA(HKEY,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,FILETIME*);
ATOM RegisterClass(LPWNDCLASS);
WORD RegisterClipboardFormat(LPCSTR);
WORD RegisterWindowMessage(SEGPTR);

View File

@ -7,6 +7,7 @@ extern int WIN32_LastError;
*/
#define ERROR_UNKNOWN 99999
#define ERROR_SUCCESS 0
#define ERROR_FILE_NOT_FOUND 2
#define ERROR_TOO_MANY_OPEN_FILES 4
#define ERROR_ACCESS_DENIED 5
@ -22,6 +23,8 @@ extern int WIN32_LastError;
#define ERROR_DIR_NOT_EMPTY 145
#define ERROR_BUSY 170
#define ERROR_FILENAME_EXCED_RANGE 206
#define ERROR_MORE_DATA 234
#define ERROR_NO_MORE_ITEMS 259
#define ERROR_IO_DEVICE 1117
#define ERROR_POSSIBLE_DEADLOCK 1131
#define ERROR_BAD_DEVICE 1200

111
include/winreg.h Normal file
View File

@ -0,0 +1,111 @@
/*
* Shell Library definitions
*/
#include "wintypes.h"
#ifndef __WINE_WINREG_H
#define __WINE_WINREG_H
#include "windows.h"
/* FIXME: should be in security.h or whereever */
#ifndef READ_CONTROL
#define READ_CONTROL 0x00020000
#endif
#ifndef STANDARD_RIGHTS_READ
#define STANDARD_RIGHTS_READ READ_CONTROL
#endif
#ifndef STANDARD_RIGHTS_WRITE
#define STANDARD_RIGHTS_WRITE READ_CONTROL /* FIXME: hmm? */
#endif
#ifndef STANDARD_RIGHTS_ALL
#define STANDARD_RIGHTS_ALL 0x001f0000
#endif
/* ... */
#define SHELL_ERROR_SUCCESS 0L
#define SHELL_ERROR_BADDB 1L
#define SHELL_ERROR_BADKEY 2L
#define SHELL_ERROR_CANTOPEN 3L
#define SHELL_ERROR_CANTREAD 4L
#define SHELL_ERROR_CANTWRITE 5L
#define SHELL_ERROR_OUTOFMEMORY 6L
#define SHELL_ERROR_INVALID_PARAMETER 7L
#define SHELL_ERROR_ACCESS_DENIED 8L
#define REG_NONE 0 /* no type */
#define REG_SZ 1 /* string type (ASCII) */
#define REG_EXPAND_SZ 2 /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
#define REG_BINARY 3 /* binary format, callerspecific */
/* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
#define REG_DWORD 4 /* DWORD in little endian format */
#define REG_DWORD_LITTLE_ENDIAN 4 /* DWORD in little endian format */
#define REG_DWORD_BIG_ENDIAN 5 /* DWORD in big endian format */
#define REG_LINK 6 /* symbolic link (UNICODE) */
#define REG_MULTI_SZ 7 /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
#define REG_RESOURCE_LIST 8 /* resource list? huh? */
#define REG_FULL_RESOURCE_DESCRIPTOR 9 /* full resource descriptor? huh? */
#define HKEY_CLASSES_ROOT 0x80000000
#define HKEY_CURRENT_USER 0x80000001
#define HKEY_LOCAL_MACHINE 0x80000002
#define HKEY_USERS 0x80000003
#define HKEY_PERFORMANCE_DATA 0x80000004
#define HKEY_CURRENT_CONFIG 0x80000005
#define HKEY_DYN_DATA 0x80000006
#define REG_OPTION_RESERVED 0x00000000
#define REG_OPTION_NON_VOLATILE 0x00000000
#define REG_OPTION_VOLATILE 0x00000001
#define REG_OPTION_CREATE_LINK 0x00000002
#define REG_CREATED_NEW_KEY 0x00000001
#define REG_OPENED_EXISTING_KEY 0x00000002
#define KEY_QUERY_VALUE 0x00000001
#define KEY_SET_VALUE 0x00000002
#define KEY_CREATE_SUB_KEY 0x00000004
#define KEY_ENUMERATE_SUB_KEYS 0x00000008
#define KEY_NOTIFY 0x00000010
#define KEY_CREATE_LINK 0x00000020
#define KEY_READ (STANDARD_RIGHTS_READ| \
KEY_QUERY_VALUE| \
KEY_ENUMERATE_SUB_KEYS|\
KEY_NOTIFY \
)
#define KEY_WRITE (STANDARD_RIGHTS_WRITE| \
KEY_SET_VALUE| \
KEY_CREATE_SUB_KEY \
)
#define KEY_EXECUTE KEY_READ
#define KEY_ALL_ACCESS (STANDARD_RIGHTS_ALL| \
KEY_READ|KEY_WRITE| \
KEY_CREATE_LINK \
)
/* one value of a key */
typedef struct tagKEYVALUE {
LPWSTR name; /* name of value (UNICODE) or NULL for win31 */
DWORD type; /* type of value */
DWORD len; /* length of data */
LPBYTE data; /* content, may be strings, binaries, etc. */
} KEYVALUE,*LPKEYVALUE;
/* a registry key */
typedef struct tagKEYSTRUCT {
LPWSTR keyname; /* name of THIS key (UNICODE) */
DWORD flags; /* flags. */
LPWSTR class;
/* values */
DWORD nrofvalues; /* nr of values in THIS key */
LPKEYVALUE values; /* values in THIS key */
/* key management pointers */
struct tagKEYSTRUCT *next; /* next key on same hierarchy */
struct tagKEYSTRUCT *nextsub; /* keys that hang below THIS key */
} KEYSTRUCT, *LPKEYSTRUCT;
void SHELL_Init();
void SHELL_SaveRegistry();
void SHELL_LoadRegistry();
#endif /* __WINE_WINREG_H */

View File

@ -49,6 +49,7 @@ typedef LONG LRESULT;
typedef INT HFILE;
typedef DWORD HHOOK;
typedef char *LPSTR;
typedef BYTE *LPBYTE;
typedef const char *LPCSTR;
typedef TCHAR *LPTSTR;
typedef const TCHAR *LPCTSTR;
@ -64,6 +65,8 @@ typedef void *LPVOID;
typedef const void *LPCVOID;
typedef WORD CATCHBUF[9];
typedef WORD *LPCATCHBUF;
typedef DWORD ACCESS_MASK;
typedef ACCESS_MASK REGSAM;
#define DECLARE_HANDLE(a) typedef HANDLE a;

View File

@ -169,11 +169,11 @@ LRESULT ErrorProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
}
/***********************************************************************
* GetWndProcEntry16 (not a Windows API function)
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WINPROCS dll.
*/
WNDPROC GetWndProcEntry16( char *name )
WNDPROC MODULE_GetWndProcEntry16( char *name )
{
#define MAP_STR_TO_PROC(str,proc) if(!strcmp(name,str))return proc
MAP_STR_TO_PROC("ActivateAppProc",ACTIVATEAPP_callback);
@ -202,3 +202,13 @@ WNDPROC GetWndProcEntry16( char *name )
fprintf(stderr,"warning: No mapping for %s(), add one in library/miscstubs.c\n",name);
return ErrorProc;
}
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WINPROCS32 dll.
*/
WNDPROC MODULE_GetWndProcEntry32( char *name )
{
return MODULE_GetWndProcEntry16( name );
}

View File

@ -11,11 +11,13 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <string.h>
#include <errno.h>
#include "windows.h"
#include "alias.h"
#include "module.h"
#include "task.h"
#include "selectors.h"
#include "comm.h"
#include "user.h"
#include "win.h"
#include "menu.h"
#include "kernel32.h"
#include "atom.h"
@ -103,6 +105,9 @@ int MAIN_Init(void)
/* GDI initialisation */
if (!GDI_Init()) return 0;
/* Initialise window procedures aliases */
if (!ALIAS_Init()) return 0;
/* Initialize system colors and metrics*/
SYSMETRICS_Init();
SYSCOLOR_Init();

View File

@ -48,20 +48,18 @@ static HMODULE MODULE_LoadBuiltin( LPCSTR name, BOOL force )
NE_MODULE *pModule;
SEGTABLEENTRY *pSegTable;
struct dll_table_s *table;
int i;
char dllname[16], *p;
/* Fix the name in case we have a full path and extension */
if ((p = strrchr( name, '\\' ))) name = p + 1;
strncpy( dllname, name, 15 );
dllname[15] = '\0';
lstrcpyn( dllname, name, sizeof(dllname) );
if ((p = strrchr( dllname, '.' ))) *p = '\0';
for (i = 0, table = dll_builtin_table; i < N_BUILTINS; i++, table++)
for (table = dll_builtin_table; table->name; table++)
if (!lstrcmpi( table->name, dllname )) break;
if (i >= N_BUILTINS) return 0;
if (!table->used && !force) return 0;
if (!table->name) return 0;
if ((table->flags & DLL_FLAG_NOT_USED) && !force) return 0;
hModule = GLOBAL_CreateBlock( GMEM_MOVEABLE, table->module_start,
table->module_end - table->module_start,
@ -486,6 +484,10 @@ HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
}
}
/* Clear internal Wine flags in case they are set in the EXE file */
pModule->flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32);
/* Store the filename information */
pModule->fileinfo = (int)pData - (int)pModule;
@ -601,7 +603,7 @@ HMODULE MODULE_LoadExeHeader( HFILE hFile, OFSTRUCT *ofs )
*
* Lookup the ordinal for a given name.
*/
WORD MODULE_GetOrdinal( HMODULE hModule, char *name )
WORD MODULE_GetOrdinal( HMODULE hModule, const char *name )
{
char buffer[256], *cpnt;
BYTE len;
@ -630,7 +632,6 @@ WORD MODULE_GetOrdinal( HMODULE hModule, char *name )
cpnt += *cpnt + 1 + sizeof(WORD);
while (*cpnt)
{
dprintf_module( stddeb, " Checking '%*.*s'\n", *cpnt, *cpnt, cpnt+1 );
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
dprintf_module( stddeb, " Found: ordinal=%d\n",
@ -649,7 +650,6 @@ WORD MODULE_GetOrdinal( HMODULE hModule, char *name )
cpnt += *cpnt + 1 + sizeof(WORD);
while (*cpnt)
{
dprintf_module( stddeb, " Checking '%*.*s'\n", *cpnt, *cpnt, cpnt+1 );
if (((BYTE)*cpnt == len) && !memcmp( cpnt+1, buffer, len ))
{
dprintf_module( stddeb, " Found: ordinal=%d\n",
@ -793,6 +793,40 @@ LPSTR MODULE_GetEntryPointName( HMODULE hModule, WORD ordinal )
}
/***********************************************************************
* MODULE_GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WINPROCS dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry16( const char *name )
{
WORD ordinal;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WINPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
}
#endif
/***********************************************************************
* MODULE_GetWndProcEntry32 (not a Windows API function)
*
* Return an entry point from the WINPROCS32 dll.
*/
#ifndef WINELIB
WNDPROC MODULE_GetWndProcEntry32( const char *name )
{
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WINPROCS32" );
return PE_GetProcAddress( hModule, name );
}
#endif
/***********************************************************************
* MODULE_GetModuleName
*/
@ -1103,10 +1137,6 @@ HINSTANCE LoadModule( LPCSTR name, LPVOID paramBlock )
/* the module, even if it contains circular DLL references */
pModule->count = 1;
/* Clear built-in flag in case it was set in the EXE file */
pModule->flags &= ~NE_FFLAGS_BUILTIN;
}
else
{
@ -1422,24 +1452,6 @@ WORD GetExpWinVer( HMODULE hModule )
}
/***********************************************************************
* GetWndProcEntry16 (not a Windows API function)
*
* Return an entry point from the WINPROCS dll.
*/
#ifndef WINELIB
WNDPROC GetWndProcEntry16( char *name )
{
WORD ordinal;
static HMODULE hModule = 0;
if (!hModule) hModule = GetModuleHandle( "WINPROCS" );
ordinal = MODULE_GetOrdinal( hModule, name );
return MODULE_GetEntryPoint( hModule, ordinal );
}
#endif
/**********************************************************************
* ModuleFirst (TOOLHELP.59)
*/

View File

@ -510,7 +510,7 @@ void NE_InitializeDLLs( HMODULE hModule )
HMODULE *pDLL;
pModule = (NE_MODULE *)GlobalLock( hModule );
if (pModule->magic == PE_SIGNATURE)
if (pModule->flags & NE_FFLAGS_WIN32)
{
PE_InitializeDLLs(hModule);
return;

View File

@ -29,7 +29,6 @@
#include "task.h"
#include "ldt.h"
#include "registers.h"
#include "selectors.h"
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
@ -581,10 +580,10 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
pModule = (NE_MODULE*)GlobalLock(hModule);
/* Set all used entries */
pModule->magic=PE_SIGNATURE;
pModule->magic=NE_SIGNATURE;
pModule->count=1;
pModule->next=0;
pModule->flags=0;
pModule->flags=NE_FFLAGS_WIN32;
pModule->dgroup=1;
pModule->ss=1;
pModule->cs=2;
@ -610,7 +609,7 @@ HINSTANCE PE_LoadModule( int fd, OFSTRUCT *ofs, LOADPARAMS* params )
pSegment->minsize=0x1000;
pSegment++;
cts=(DWORD)GetWndProcEntry16("Win32CallToStart");
cts=(DWORD)MODULE_GetWndProcEntry16("Win32CallToStart");
#ifdef WINELIB32
pSegment->selector=(void*)cts;
pModule->ip=0;

View File

@ -37,7 +37,7 @@
*/
HRSRC FindResource( HMODULE hModule, SEGPTR name, SEGPTR type )
{
WORD *pModule;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "FindResource: module=%04x type=", hModule );
@ -52,17 +52,14 @@ HRSRC FindResource( HMODULE hModule, SEGPTR name, SEGPTR type )
dprintf_resource( stddeb, " name=" );
PrintId( name );
dprintf_resource( stddeb, "\n" );
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
#ifndef WINELIB
switch(*pModule)
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_FindResource( hModule, type, name );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to FindResource() for Win32 module\n");
return 0;
}
return NE_FindResource( hModule, type, name );
#else
return LIBRES_FindResource( hModule, name, type );
#endif
@ -74,23 +71,20 @@ HRSRC FindResource( HMODULE hModule, SEGPTR name, SEGPTR type )
*/
HGLOBAL LoadResource( HMODULE hModule, HRSRC hRsrc )
{
WORD *pModule;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "LoadResource: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
#ifndef WINELIB
switch(*pModule)
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_LoadResource( hModule, hRsrc );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to LoadResource() for Win32 module\n");
return 0;
}
return NE_LoadResource( hModule, hRsrc );
#else
return LIBRES_LoadResource( hModule, hRsrc );
#endif
@ -105,21 +99,18 @@ SEGPTR WIN16_LockResource( HGLOBAL handle )
{
#ifndef WINELIB
HMODULE hModule;
WORD *pModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return (SEGPTR)0;
hModule = GetExePtr( handle );
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
switch(*pModule)
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_LockResource( hModule, handle );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to LockResource() for Win32 module\n");
return 0;
}
return NE_LockResource( hModule, handle );
#else
return LIBRES_LockResource( handle );
#endif
@ -130,21 +121,18 @@ LPVOID LockResource( HGLOBAL handle )
{
#ifndef WINELIB
HMODULE hModule;
WORD *pModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "LockResource: handle=%04x\n", handle );
if (!handle) return NULL;
hModule = GetExePtr( handle );
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
switch(*pModule)
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to LockResource() for Win32 module\n");
return 0;
}
return (LPSTR)PTR_SEG_TO_LIN( NE_LockResource( hModule, handle ) );
#else
return LIBRES_LockResource( handle );
#endif
@ -158,21 +146,18 @@ BOOL FreeResource( HGLOBAL handle )
{
#ifndef WINELIB
HMODULE hModule;
WORD *pModule;
NE_MODULE *pModule;
dprintf_resource(stddeb, "FreeResource: handle=%04x\n", handle );
if (!handle) return FALSE;
hModule = GetExePtr( handle );
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
switch(*pModule)
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_FreeResource( hModule, handle );
case PE_SIGNATURE:
return FALSE;
default:
return FALSE;
fprintf(stderr,"Don't know how to FreeResource() for Win32 module\n");
return 0;
}
return NE_FreeResource( hModule, handle );
#else
return LIBRES_FreeResource( handle );
#endif
@ -184,23 +169,20 @@ BOOL FreeResource( HGLOBAL handle )
*/
INT AccessResource( HINSTANCE hModule, HRSRC hRsrc )
{
WORD *pModule;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "AccessResource: module=%04x res=%04x\n",
hModule, hRsrc );
if (!hRsrc) return 0;
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
#ifndef WINELIB
switch(*pModule)
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_AccessResource( hModule, hRsrc );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to AccessResource() for Win32 module\n");
return 0;
}
return NE_AccessResource( hModule, hRsrc );
#else
return LIBRES_AccessResource( hModule, hRsrc );
#endif
@ -212,22 +194,19 @@ INT AccessResource( HINSTANCE hModule, HRSRC hRsrc )
*/
DWORD SizeofResource( HMODULE hModule, HRSRC hRsrc )
{
WORD *pModule;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "SizeofResource: module=%04x res=%04x\n",
hModule, hRsrc );
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
#ifndef WINELIB
switch(*pModule)
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_SizeofResource( hModule, hRsrc );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to SizeOfResource() for Win32 module\n");
return 0;
}
return NE_SizeofResource( hModule, hRsrc );
#else
return LIBRES_SizeofResource( hModule, hRsrc );
#endif
@ -239,23 +218,20 @@ DWORD SizeofResource( HMODULE hModule, HRSRC hRsrc )
*/
HGLOBAL AllocResource( HMODULE hModule, HRSRC hRsrc, DWORD size )
{
WORD *pModule;
NE_MODULE *pModule;
hModule = GetExePtr( hModule ); /* In case we were passed an hInstance */
dprintf_resource(stddeb, "AllocResource: module=%04x res=%04x size=%ld\n",
hModule, hRsrc, size );
if (!hRsrc) return 0;
if (!(pModule = (WORD *)GlobalLock( hModule ))) return 0;
if (!(pModule = (NE_MODULE *)GlobalLock( hModule ))) return 0;
#ifndef WINELIB
switch(*pModule)
if (pModule->flags & NE_FFLAGS_WIN32)
{
case NE_SIGNATURE:
return NE_AllocResource( hModule, hRsrc, size );
case PE_SIGNATURE:
return 0;
default:
fprintf(stderr,"Don't know how to AllocResource() for Win32 module\n");
return 0;
}
return NE_AllocResource( hModule, hRsrc, size );
#else
return LIBRES_AllocResource( hModule, hRsrc, size );
#endif
@ -350,9 +326,9 @@ int TranslateAccelerator(HWND hWnd, HANDLE hAccel, LPMSG msg)
(msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)) {
INT mask = 0;
if(GetKeyState(VK_SHIFT) & 0xf) mask |= SHIFT_ACCEL;
if(GetKeyState(VK_CONTROL) & 0xf) mask |= CONTROL_ACCEL;
if(GetKeyState(VK_MENU) & 0xf) mask |= ALT_ACCEL;
if(GetKeyState(VK_SHIFT) & 0x8000) mask |= SHIFT_ACCEL;
if(GetKeyState(VK_CONTROL) & 0x8000) mask |= CONTROL_ACCEL;
if(GetKeyState(VK_MENU) & 0x8000) mask |= ALT_ACCEL;
if(mask == (lpAccelTbl->tbl[i].type &
(SHIFT_ACCEL | CONTROL_ACCEL | ALT_ACCEL))) {
SendMessage(hWnd, WM_COMMAND, lpAccelTbl->tbl[i].wIDval,

View File

@ -7,6 +7,9 @@
#include <time.h>
#include <setjmp.h>
#include <sys/time.h>
#include <sys/timeb.h>
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__svr4__)
#include <sys/syscall.h>
#include <sys/param.h>
@ -43,7 +46,33 @@ wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
#endif
#if defined(linux)
/**********************************************************************
* wine_timer
*
* SIGALRM handler.
*/
#ifdef linux
static void wine_timer(int signal, struct sigcontext_struct context_struct)
{
#elif defined(__svr4__)
static void wine_timer(int signal, void *siginfo, ucontext_t *context)
{
#else
static void wine_timer(int signal, int code, struct sigcontext *context)
{
#endif
/* Should do real-time timers here */
DOSMEM_Tick();
}
/**********************************************************************
* win_fault
*
* Segfault handler.
*/
#ifdef linux
static void win_fault(int signal, struct sigcontext_struct context_struct)
{
struct sigcontext_struct *context = &context_struct;
@ -99,6 +128,7 @@ static void SIGNAL_SetHandler( int sig, void (*func)() )
#ifdef linux
sig_act.sa_handler = func;
sig_act.sa_flags = SA_RESTART;
/* Point to the top of the stack, minus 4 just in case, and make
it aligned */
sig_act.sa_restorer =
@ -131,14 +161,14 @@ static void SIGNAL_SetHandler( int sig, void (*func)() )
}
}
extern void stop_wait(int a);
/**********************************************************************
* init_wine_signals
*/
void init_wine_signals(void)
{
extern void stop_wait(int a);
#if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigaltstack ss;
@ -175,6 +205,7 @@ void init_wine_signals(void)
}
#endif /* __svr4__ */
SIGNAL_SetHandler( SIGALRM, (void (*)())wine_timer );
SIGNAL_SetHandler( SIGSEGV, (void (*)())win_fault );
SIGNAL_SetHandler( SIGILL, (void (*)())win_fault );
SIGNAL_SetHandler( SIGFPE, (void (*)())win_fault );
@ -186,6 +217,24 @@ void init_wine_signals(void)
#ifdef CONFIG_IPC
SIGNAL_SetHandler( SIGUSR2, (void (*)())stop_wait ); /* For IPC */
#endif
SIGNAL_StartBIOSTimer();
}
/**********************************************************************
* SIGNAL_StartTimer
*
* Start the BIOS tick timer.
*/
void SIGNAL_StartBIOSTimer(void)
{
struct itimerval vt_timer;
vt_timer.it_interval.tv_sec = 0;
vt_timer.it_interval.tv_usec = 54929;
vt_timer.it_value = vt_timer.it_interval;
setitimer(ITIMER_REAL, &vt_timer, NULL);
}
#endif /* ifndef WINELIB */

View File

@ -21,7 +21,6 @@
#include "neexe.h"
#include "options.h"
#include "queue.h"
#include "selectors.h"
#include "toolhelp.h"
#include "stddebug.h"
#include "debug.h"
@ -34,6 +33,9 @@
/* Must not be greater than 64k, or MAKE_SEGPTR won't work */
#define STACK32_SIZE 0x10000
extern void TIMER_SwitchQueue(HQUEUE, HQUEUE );
extern void TIMER_NukeTimers(HWND, HQUEUE );
/* ------ Internal variables ------ */
static HTASK hFirstTask = 0;
@ -61,7 +63,7 @@ static HANDLE TASK_CreateDOSEnvironment(void);
*/
BOOL TASK_Init(void)
{
TASK_RescheduleProc = (FARPROC)GetWndProcEntry16( "TASK_Reschedule" );
TASK_RescheduleProc = MODULE_GetWndProcEntry16( "TASK_Reschedule" );
if (!(hDOSEnvironment = TASK_CreateDOSEnvironment()))
fprintf( stderr, "Not enough memory for DOS Environment\n" );
return (hDOSEnvironment != 0);
@ -581,6 +583,10 @@ static void TASK_DeleteTask( HTASK hTask )
FILE_CloseAllFiles( pTask->hPDB );
/* Nuke timers */
TIMER_NukeTimers( 0, pTask->hQueue );
/* Free the message queue */
QUEUE_DeleteMsgQueue( pTask->hQueue );
@ -999,8 +1005,12 @@ HQUEUE SetTaskQueue( HANDLE hTask, HQUEUE hQueue )
if (!hTask) hTask = hCurrentTask;
if (!(pTask = (TDB *)GlobalLock( hTask ))) return 0;
hPrev = pTask->hQueue;
pTask->hQueue = hQueue;
TIMER_SwitchQueue( hPrev, hQueue );
return hPrev;
}
@ -1153,8 +1163,6 @@ HMODULE GetExePtr( HANDLE handle )
if (!(ptr = GlobalLock( handle ))) return 0;
if (((NE_MODULE *)ptr)->magic == NE_SIGNATURE) return handle;
/* Fake modules describing PE modules have a PE signature */
if (((NE_MODULE *)ptr)->magic == PE_SIGNATURE) return handle;
/* Check the owner for module handle */
@ -1165,7 +1173,6 @@ HMODULE GetExePtr( HANDLE handle )
#endif
if (!(ptr = GlobalLock( owner ))) return 0;
if (((NE_MODULE *)ptr)->magic == NE_SIGNATURE) return owner;
if (((NE_MODULE *)ptr)->magic == PE_SIGNATURE) return owner;
/* Search for this handle and its owner inside all tasks */

View File

@ -21,6 +21,7 @@ C_SRCS = \
olesvr.c \
port.c \
rect.c \
registry.c \
shell.c \
sound.c \
spy.c \

View File

@ -12,7 +12,7 @@
#include "message.h"
#include "commdlg.h"
#include "dlgs.h"
#include "selectors.h"
#include "module.h"
#include "resource.h"
#include "dos_fs.h"
#include "drive.h"
@ -83,7 +83,7 @@ BOOL GetOpenFileName(LPOPENFILENAME lpofn)
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam( hInst, hDlgTmpl, lpofn->hwndOwner,
GetWndProcEntry16("FileOpenDlgProc"),
MODULE_GetWndProcEntry16("FileOpenDlgProc"),
(DWORD)lpofn );
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
@ -125,7 +125,7 @@ BOOL GetSaveFileName(LPOPENFILENAME lpofn)
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam( hInst, hDlgTmpl, lpofn->hwndOwner,
GetWndProcEntry16("FileSaveDlgProc"),
MODULE_GetWndProcEntry16("FileSaveDlgProc"),
(DWORD)lpofn);
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
{
@ -686,7 +686,7 @@ BOOL ChooseColor(LPCHOOSECOLOR lpChCol)
hDlgTmpl = SYSRES_LoadResource( SYSRES_DIALOG_CHOOSE_COLOR );
hInst = WIN_GetWindowInstance( lpChCol->hwndOwner );
bRet = DialogBoxIndirectParam( hInst, hDlgTmpl, lpChCol->hwndOwner,
GetWndProcEntry16("ColorDlgProc"),
MODULE_GetWndProcEntry16("ColorDlgProc"),
(DWORD)lpChCol );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
@ -741,7 +741,7 @@ BOOL FindText(LPFINDREPLACE lpFind)
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = (SEGPTR)WIN16_GlobalLock( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam( hInst, ptr, lpFind->hwndOwner,
GetWndProcEntry16("FindTextDlgProc"),
MODULE_GetWndProcEntry16("FindTextDlgProc"),
(DWORD)lpFind );
GlobalUnlock( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
@ -770,7 +770,7 @@ BOOL ReplaceText(LPFINDREPLACE lpFind)
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = (SEGPTR)WIN16_GlobalLock( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam( hInst, ptr, lpFind->hwndOwner,
GetWndProcEntry16("ReplaceTextDlgProc"),
MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
(DWORD)lpFind );
GlobalUnlock( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
@ -1017,8 +1017,8 @@ BOOL PrintDlg(LPPRINTDLG lpPrint)
hInst = WIN_GetWindowInstance( lpPrint->hwndOwner );
bRet = DialogBoxIndirectParam( hInst, hDlgTmpl, lpPrint->hwndOwner,
(lpPrint->Flags & PD_PRINTSETUP) ?
GetWndProcEntry16("PrintSetupDlgProc") :
GetWndProcEntry16("PrintDlgProc"),
MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
MODULE_GetWndProcEntry16("PrintDlgProc"),
(DWORD)lpPrint );
SYSRES_FreeResource( hDlgTmpl );
return bRet;

View File

@ -6,6 +6,7 @@ static char Copyright[] = "Copyright Scott A. Laird, Erik Bos 1993, 1994";
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "windows.h"
#include "keyboard.h"
#include "stddebug.h"
@ -19,14 +20,27 @@ int ToAscii(WORD wVirtKey, WORD wScanCode, LPSTR lpKeyState,
dprintf_keyboard(stddeb,"ToAscii (%d,%d)\n",wVirtKey, wScanCode);
/* FIXME: this is not sufficient but better than returing -1 */
/* FIXME: codepage is broken */
for (i = 0 ; i != KeyTableSize ; i++)
if (KeyTable[i].virtualkey == wVirtKey) {
*(BYTE*)lpChar++ = *KeyTable[i].name;
*(BYTE*)lpChar = 0;
if (KeyTable[i].virtualkey == wVirtKey)
{
dprintf_keyboard(stddeb,"\t\tchar = %s\n", KeyTable[i].name);
if( isprint(KeyTable[i].ASCII) || isspace(KeyTable[i].ASCII) )
{
*(BYTE*)lpChar = KeyTable[i].ASCII;
*(((BYTE*)lpChar) + 1) = 0;
if( isalpha( *(BYTE*)lpChar ) )
if( (lpKeyState[VK_CAPITAL]<0 && !lpKeyState[VK_SHIFT]) ||
(!lpKeyState[VK_CAPITAL] && lpKeyState[VK_SHIFT]<0) )
*(BYTE*)lpChar = toupper( *(BYTE*)lpChar );
else
*(BYTE*)lpChar = tolower( *(BYTE*)lpChar );
return 1;
}
}
*(BYTE*)lpChar = 0;
return 0;

View File

@ -57,6 +57,7 @@ static const char *langNames[] =
"Da", /* LANG_Da */
"Cz", /* LANG_Cz */
"Eo", /* LANG_Eo */
"It", /* LANG_It */
NULL
};
@ -139,7 +140,7 @@ static XrmOptionDescRec optionsTable[] =
" -fixedmap Use a \"standard\" color map\n" \
" -iconic Start as an icon\n" \
" -ipc Enable IPC facilities\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo)\n" \
" -language xx Set the language (one of En,Es,De,No,Fr,Fi,Da,Cz,Eo,It)\n" \
" -managed Allow the window manager to manage created windows\n" \
" -mode mode Start Wine in a particular mode (standard or enhanced)\n" \
" -name name Set the application name\n" \
@ -265,25 +266,25 @@ BOOL ParseDebugOptions(char *options)
*/
static BOOL MAIN_ParseDLLOptions(char *options)
{
int l;
int i;
if (strlen(options)<3)
return FALSE;
int i, l;
BUILTIN_DLL *dll;
if (strlen(options)<3) return FALSE;
do
{
if ((*options!='+')&&(*options!='-'))
return FALSE;
if (strchr(options,','))
l=strchr(options,',')-options;
if ((*options!='+') && (*options!='-')) return FALSE;
if (strchr(options,',')) l=strchr(options,',')-options;
else l=strlen(options);
for (i=0;i<N_BUILTINS;i++)
if (!lstrncmpi(options+1,dll_builtin_table[i].name,l-1))
for (dll = dll_builtin_table; dll->name; dll++)
{
dll_builtin_table[i].used = (*options=='+');
if (!lstrncmpi(options+1,dll->name,l-1))
{
if (*options == '+') dll->flags &= ~DLL_FLAG_NOT_USED;
else dll->flags |= DLL_FLAG_NOT_USED;
break;
}
if (i==N_BUILTINS)
return FALSE;
}
if (!dll->name) return FALSE;
options+=l;
}
while((*options==',')&&(*(++options)));
@ -433,12 +434,12 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
if(MAIN_ParseDLLOptions((char*)value.addr)==FALSE)
{
int i;
BUILTIN_DLL *dll;
fprintf(stderr,"%s: Syntax: -dll +xxx,... or -dll -xxx,...\n",argv[0]);
fprintf(stderr,"Example: -dll -ole2 Do not use emulated OLE2.DLL\n");
fprintf(stderr,"Available DLLs\n");
for(i=0;i<N_BUILTINS;i++)
fprintf(stderr,"%-9s%c",dll_builtin_table[i].name,
(((i+2)%8==0)?'\n':' '));
for (dll = dll_builtin_table; dll->name; dll++)
fprintf(stderr,"%-9s%c",dll->name, (((i+2)%8==0)?'\n':' '));
fprintf(stderr,"\n\n");
exit(1);
}

View File

@ -32,6 +32,7 @@ DWORD WINAPI GetUserDefaultLCID()
case LANG_Da:
case LANG_Cz:
case LANG_Eo:
case LANG_It:
default:
return 0; /* Neutral language */
}
@ -524,6 +525,130 @@ LOCVAL(LOCALE_SABBREVMONTHNAME13,"")
/* LOCVAL(LOCALE_INEGSEPBYSPACE) */
break; /* LANG(Eo) */
case LANG_It:
LOCVAL(LOCALE_ILANGUAGE,"9")
LOCVAL(LOCALE_SLANGUAGE,"Italiano")
LOCVAL(LOCALE_SENGLANGUAGE,"Italian")
LOCVAL(LOCALE_SABBREVLANGNAME,"ita")
LOCVAL(LOCALE_SNATIVELANGNAME,"Italiano")
LOCVAL(LOCALE_ICOUNTRY,"39")
LOCVAL(LOCALE_SCOUNTRY,"Italia")
LOCVAL(LOCALE_SENGCOUNTRY,"Italy")
LOCVAL(LOCALE_SABBREVCTRYNAME,"It")
LOCVAL(LOCALE_SNATIVECTRYNAME,"Italia")
LOCVAL(LOCALE_IDEFAULTLANGUAGE,"9")
LOCVAL(LOCALE_IDEFAULTCOUNTRY,"39")
/* Dunno
LOCVAL(LOCALE_IDEFAULTCODEPAGE)
LOCVAL(LOCALE_IDEFAULTANSICODEPAGE)
*/
LOCVAL(LOCALE_SLIST,";")
LOCVAL(LOCALE_IMEASURE,"0")
LOCVAL(LOCALE_SDECIMAL,",")
LOCVAL(LOCALE_STHOUSAND,".")
/*
LOCVAL(LOCALE_SGROUPING)
*/
LOCVAL(LOCALE_IDIGITS,"2")
LOCVAL(LOCALE_ILZERO,"1")
/*
LOCVAL(LOCALE_INEGNUMBER)
Is this "0123456789" ??
LOCVAL(LOCALE_SNATIVEDIGITS)
*/
LOCVAL(LOCALE_SCURRENCY,"Lit.")
/*
LOCVAL(LOCALE_SINTLSYMBOL)
LOCVAL(LOCALE_SMONDECIMALSEP)
LOCVAL(LOCALE_SMONTHOUSANDSEP)
LOCVAL(LOCALE_SMONGROUPING)
*/
LOCVAL(LOCALE_ICURRDIGITS,"2")
/*
LOCVAL(LOCALE_IINTLCURRDIGITS)
*/
LOCVAL(LOCALE_ICURRENCY,"3")
LOCVAL(LOCALE_INEGCURR,"8")
LOCVAL(LOCALE_SDATE,".")
LOCVAL(LOCALE_STIME,":")
LOCVAL(LOCALE_SSHORTDATE,"dd.MM.yyyy")
LOCVAL(LOCALE_SLONGDATE,"ddd, d. MMMM yyyy")
/*
LOCVAL(LOCALE_STIMEFORMAT)
*/
LOCVAL(LOCALE_IDATE,"1")
/*
LOCVAL(LOCALE_ILDATE)
*/
LOCVAL(LOCALE_ITIME,"1")
/*
LOCVAL(LOCALE_ITIMEMARKPOSN)
LOCVAL(LOCALE_ICENTURY)
*/
LOCVAL(LOCALE_ITLZERO,"1")
/*
LOCVAL(LOCALE_IDAYLZERO)
LOCVAL(LOCALE_IMONLZERO)
LOCVAL(LOCALE_S1159)
LOCVAL(LOCALE_S2359)
LOCVAL(LOCALE_ICALENDARTYPE)
LOCVAL(LOCALE_IOPTIONALCALENDAR)
LOCVAL(LOCALE_IFIRSTDAYOFWEEK)
LOCVAL(LOCALE_IFIRSTWEEKOFYEAR)
*/
LOCVAL(LOCALE_SDAYNAME1,"Lunedi'")
LOCVAL(LOCALE_SDAYNAME2,"Martedi'")
LOCVAL(LOCALE_SDAYNAME3,"Mercoledi'")
LOCVAL(LOCALE_SDAYNAME4,"Giovedi'")
LOCVAL(LOCALE_SDAYNAME5,"Venerdi'")
LOCVAL(LOCALE_SDAYNAME6,"Sabato")
LOCVAL(LOCALE_SDAYNAME7,"Domenica")
LOCVAL(LOCALE_SABBREVDAYNAME1,"Lu")
LOCVAL(LOCALE_SABBREVDAYNAME2,"Ma")
LOCVAL(LOCALE_SABBREVDAYNAME3,"Me")
LOCVAL(LOCALE_SABBREVDAYNAME4,"Gi")
LOCVAL(LOCALE_SABBREVDAYNAME5,"Ve")
LOCVAL(LOCALE_SABBREVDAYNAME6,"Sa")
LOCVAL(LOCALE_SABBREVDAYNAME7,"Do")
LOCVAL(LOCALE_SMONTHNAME1,"Gennaio")
LOCVAL(LOCALE_SMONTHNAME2,"Febbraio")
LOCVAL(LOCALE_SMONTHNAME3,"Marzo")
LOCVAL(LOCALE_SMONTHNAME4,"Aprile")
LOCVAL(LOCALE_SMONTHNAME5,"Maggio")
LOCVAL(LOCALE_SMONTHNAME6,"Giugno")
LOCVAL(LOCALE_SMONTHNAME7,"Luglio")
LOCVAL(LOCALE_SMONTHNAME8,"Agosto")
LOCVAL(LOCALE_SMONTHNAME9,"Settembre")
LOCVAL(LOCALE_SMONTHNAME10,"Ottobre")
LOCVAL(LOCALE_SMONTHNAME11,"Novembre")
LOCVAL(LOCALE_SMONTHNAME12,"Dicembre")
LOCVAL(LOCALE_SMONTHNAME13,"")
LOCVAL(LOCALE_SABBREVMONTHNAME1,"Gen")
LOCVAL(LOCALE_SABBREVMONTHNAME2,"Feb")
LOCVAL(LOCALE_SABBREVMONTHNAME3,"Mar")
LOCVAL(LOCALE_SABBREVMONTHNAME4,"Apr")
LOCVAL(LOCALE_SABBREVMONTHNAME5,"Mag")
LOCVAL(LOCALE_SABBREVMONTHNAME6,"Giu")
LOCVAL(LOCALE_SABBREVMONTHNAME7,"Lug")
LOCVAL(LOCALE_SABBREVMONTHNAME8,"Ago")
LOCVAL(LOCALE_SABBREVMONTHNAME9,"Set")
LOCVAL(LOCALE_SABBREVMONTHNAME10,"Ott")
LOCVAL(LOCALE_SABBREVMONTHNAME11,"Nov")
LOCVAL(LOCALE_SABBREVMONTHNAME12,"Dic")
LOCVAL(LOCALE_SABBREVMONTHNAME13,"")
/*
LOCVAL(LOCALE_SPOSITIVESIGN)
LOCVAL(LOCALE_SNEGATIVESIGN)
LOCVAL(LOCALE_IPOSSIGNPOSN)
LOCVAL(LOCALE_INEGSIGNPOSN)
LOCVAL(LOCALE_IPOSSYMPRECEDES)
LOCVAL(LOCALE_IPOSSEPBYSPACE)
LOCVAL(LOCALE_INEGSYMPRECEDES)
LOCVAL(LOCALE_INEGSEPBYSPACE)
*/
break; /* LANG(It) */
/*Insert other languages here*/
default:

1885
misc/registry.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,8 @@
#include <ctype.h>
#include "windows.h"
#include "shell.h"
#include "module.h"
#include "neexe.h"
#include "selectors.h"
#include "alias.h"
#include "relay32.h"
#include "resource.h"
#include "dlgs.h"
#include "win.h"
@ -19,453 +17,6 @@
#include "debug.h"
#include "xmalloc.h"
LPKEYSTRUCT lphRootKey = NULL,lphTopKey = NULL;
static char RootKeyName[]=".classes", TopKeyName[] = "[top-null]";
/*************************************************************************
* SHELL_Init()
*/
BOOL SHELL_Init()
{
HKEY hNewKey;
hNewKey = GlobalAlloc(GMEM_MOVEABLE,sizeof(KEYSTRUCT));
lphRootKey = (LPKEYSTRUCT) GlobalLock(hNewKey);
if (lphRootKey == NULL) {
printf("SHELL_RegCheckForRoot: Couldn't allocate root key!\n");
return FALSE;
}
lphRootKey->hKey = (HKEY)1;
lphRootKey->lpSubKey = RootKeyName;
lphRootKey->dwType = 0;
lphRootKey->lpValue = NULL;
lphRootKey->lpSubLvl = lphRootKey->lpNextKey = lphRootKey->lpPrevKey = NULL;
hNewKey = GlobalAlloc(GMEM_MOVEABLE,sizeof(KEYSTRUCT));
lphTopKey = (LPKEYSTRUCT) GlobalLock(hNewKey);
if (lphTopKey == NULL) {
printf("SHELL_RegCheckForRoot: Couldn't allocate top key!\n");
return FALSE;
}
lphTopKey->hKey = 0;
lphTopKey->lpSubKey = TopKeyName;
lphTopKey->dwType = 0;
lphTopKey->lpValue = NULL;
lphTopKey->lpSubLvl = lphRootKey;
lphTopKey->lpNextKey = lphTopKey->lpPrevKey = NULL;
dprintf_reg(stddeb,"SHELL_RegCheckForRoot: Root/Top created\n");
return TRUE;
}
/* FIXME: the loading and saving of the registry database is rather messy.
* bad input (while reading) may crash wine.
*/
void
_DumpLevel(FILE *f,LPKEYSTRUCT lpTKey,int tabs)
{
LPKEYSTRUCT lpKey;
lpKey=lpTKey->lpSubLvl;
while (lpKey) {
int i;
for (i=0;i<tabs;i++) fprintf(f,"\t");
/* implement different dwTypes ... */
if (lpKey->lpValue)
fprintf(f,"%s=%s\n",lpKey->lpSubKey,lpKey->lpValue);
else
fprintf(f,"%s\n",lpKey->lpSubKey);
if (lpKey->lpSubLvl)
_DumpLevel(f,lpKey,tabs+1);
lpKey=lpKey->lpNextKey;
}
}
static void
_SaveKey(HKEY hKey,char *where)
{
FILE *f;
LPKEYSTRUCT lpKey;
f=fopen(where,"w");
if (f==NULL) {
perror("registry-fopen");
return;
}
switch ((DWORD)hKey) {
case HKEY_CLASSES_ROOT:
lpKey=lphRootKey;
break;
default:return;
}
_DumpLevel(f,lpKey,0);
fclose(f);
}
void
SHELL_SaveRegistry(void)
{
/* FIXME:
* -implement win95 additional keytypes here
* (HKEY_LOCAL_MACHINE,HKEY_CURRENT_USER or whatever)
* -choose better filename(s)
*/
_SaveKey((HKEY)HKEY_CLASSES_ROOT,"/tmp/winereg");
}
#define BUFSIZE 256
void
_LoadLevel(FILE *f,LPKEYSTRUCT lpKey,int tabsexp,char *buf)
{
int i;
char *s,*t;
HKEY hNewKey;
LPKEYSTRUCT lpNewKey;
while (1) {
if (NULL==fgets(buf,BUFSIZE,f)) {
buf[0]=0;
return;
}
for (i=0;buf[i]=='\t';i++) /*empty*/;
s=buf+i;
if (NULL!=(t=strchr(s,'\n'))) *t='\0';
if (NULL!=(t=strchr(s,'\r'))) *t='\0';
if (i<tabsexp) return;
if (i>tabsexp) {
hNewKey=GlobalAlloc(GMEM_MOVEABLE,sizeof(KEYSTRUCT));
lpNewKey=lpKey->lpSubLvl=(LPKEYSTRUCT)GlobalLock(hNewKey);
lpNewKey->hKey = hNewKey;
lpNewKey->dwType = 0;
lpNewKey->lpSubKey = NULL;
lpNewKey->lpValue = NULL;
lpNewKey->lpSubLvl = NULL;
lpNewKey->lpNextKey = NULL;
lpNewKey->lpPrevKey = NULL;
if (NULL!=(t=strchr(s,'='))) {
*t='\0';t++;
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = xstrdup(s);
lpNewKey->lpValue = xstrdup(t);
} else {
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = xstrdup(s);
}
_LoadLevel(f,lpNewKey,tabsexp+1,buf);
}
for (i=0;buf[i]=='\t';i++) /*empty*/;
s=buf+i;
if (i<tabsexp) return;
if (buf[0]=='\0') break; /* marks end of file */
/* we have a buf now. even when returning from _LoadLevel */
hNewKey = GlobalAlloc(GMEM_MOVEABLE,sizeof(KEYSTRUCT));
lpNewKey = lpKey->lpNextKey=(LPKEYSTRUCT)GlobalLock(hNewKey);
lpNewKey->lpPrevKey = lpKey;
lpNewKey->hKey = hNewKey;
lpNewKey->dwType = 0;
lpNewKey->lpSubKey = NULL;
lpNewKey->lpValue = NULL;
lpNewKey->lpSubLvl = NULL;
lpNewKey->lpNextKey = NULL;
if (NULL!=(t=strchr(s,'='))) {
*t='\0';t++;
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = xstrdup(s);
lpNewKey->lpValue = xstrdup(t);
} else {
lpNewKey->dwType = REG_SZ;
lpNewKey->lpSubKey = xstrdup(s);
}
lpKey=lpNewKey;
}
}
void
_LoadKey(HKEY hKey,char *from)
{
FILE *f;
LPKEYSTRUCT lpKey;
char buf[BUFSIZE]; /* FIXME: long enough? */
f=fopen(from,"r");
if (f==NULL) {
dprintf_reg(stddeb,"fopen-registry-read");
return;
}
switch ((DWORD)hKey) {
case HKEY_CLASSES_ROOT:
lpKey=lphRootKey;
break;
default:return;
}
_LoadLevel(f,lpKey,-1,buf);
}
void
SHELL_LoadRegistry(void)
{
_LoadKey((HKEY)HKEY_CLASSES_ROOT,"/tmp/winereg");
}
/*************************************************************************
* RegOpenKey [SHELL.1]
*/
LONG RegOpenKey(HKEY hKey, LPCSTR lpSubKey, LPHKEY lphKey)
{
LPKEYSTRUCT lpKey,lpNextKey;
LPCSTR ptr;
char str[128];
dprintf_reg(stddeb, "RegOpenKey(%08lX, %p='%s', %p)\n",
(DWORD)hKey, lpSubKey, lpSubKey, lphKey);
if (lphKey == NULL) return SHELL_ERROR_INVALID_PARAMETER;
switch((DWORD)hKey) {
case 0:
lpKey = lphTopKey; break;
case HKEY_CLASSES_ROOT: /* == 1 */
case 0x80000000:
case 0x80000001:
lpKey = lphRootKey; break;
default:
dprintf_reg(stddeb,"RegOpenKey // specific key = %08lX !\n", (DWORD)hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
if (lpSubKey == NULL || !*lpSubKey) {
*lphKey = hKey;
return SHELL_ERROR_SUCCESS;
}
while(*lpSubKey) {
ptr = strchr(lpSubKey,'\\');
if (!ptr) ptr = lpSubKey + strlen(lpSubKey);
strncpy(str,lpSubKey,ptr-lpSubKey);
str[ptr-lpSubKey] = 0;
lpSubKey = ptr;
if (*lpSubKey) lpSubKey++;
lpNextKey = lpKey->lpSubLvl;
while(lpKey != NULL && strcmp(lpKey->lpSubKey, str) != 0) {
lpKey = lpNextKey;
if (lpKey) lpNextKey = lpKey->lpNextKey;
}
if (lpKey == NULL) {
dprintf_reg(stddeb,"RegOpenKey: key %s not found!\n",str);
return SHELL_ERROR_BADKEY;
}
}
*lphKey = lpKey->hKey;
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegCreateKey [SHELL.2]
*/
LONG RegCreateKey(HKEY hKey, LPCSTR lpSubKey, LPHKEY lphKey)
{
HKEY hNewKey;
LPKEYSTRUCT lpNewKey;
LPKEYSTRUCT lpKey;
LPKEYSTRUCT lpPrevKey;
LPCSTR ptr;
char str[128];
dprintf_reg(stddeb, "RegCreateKey(%08lX, '%s', %p)\n", (DWORD)hKey, lpSubKey, lphKey);
if (lphKey == NULL) return SHELL_ERROR_INVALID_PARAMETER;
switch((DWORD)hKey) {
case 0:
lpKey = lphTopKey; break;
case HKEY_CLASSES_ROOT: /* == 1 */
case 0x80000000:
case 0x80000001:
lpKey = lphRootKey; break;
default:
dprintf_reg(stddeb,"RegCreateKey // specific key = %08lX !\n", (DWORD)hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
if (lpSubKey == NULL || !*lpSubKey) {
*lphKey = hKey;
return SHELL_ERROR_SUCCESS;
}
while (*lpSubKey) {
dprintf_reg(stddeb, "RegCreateKey: Looking for subkey %s\n", lpSubKey);
ptr = strchr(lpSubKey,'\\');
if (!ptr) ptr = lpSubKey + strlen(lpSubKey);
strncpy(str,lpSubKey,ptr-lpSubKey);
str[ptr-lpSubKey] = 0;
lpSubKey = ptr;
if (*lpSubKey) lpSubKey++;
lpPrevKey = lpKey;
lpKey = lpKey->lpSubLvl;
while(lpKey != NULL && strcmp(lpKey->lpSubKey, str) != 0) {
lpKey = lpKey->lpNextKey;
}
if (lpKey == NULL) {
hNewKey = GlobalAlloc(GMEM_MOVEABLE, sizeof(KEYSTRUCT));
lpNewKey = (LPKEYSTRUCT) GlobalLock(hNewKey);
if (lpNewKey == NULL) {
printf("RegCreateKey // Can't alloc new key !\n");
return SHELL_ERROR_OUTOFMEMORY;
}
lpNewKey->hKey = hNewKey;
lpNewKey->lpSubKey = malloc(strlen(str) + 1);
if (lpNewKey->lpSubKey == NULL) {
printf("RegCreateKey // Can't alloc key string !\n");
return SHELL_ERROR_OUTOFMEMORY;
}
strcpy(lpNewKey->lpSubKey, str);
lpNewKey->lpNextKey = lpPrevKey->lpSubLvl;
lpNewKey->lpPrevKey = NULL;
lpPrevKey->lpSubLvl = lpNewKey;
lpNewKey->dwType = 0;
lpNewKey->lpValue = NULL;
lpNewKey->lpSubLvl = NULL;
*lphKey = hNewKey;
dprintf_reg(stddeb,"RegCreateKey // successful '%s' key=%08lX !\n", str, (DWORD)hNewKey);
lpKey = lpNewKey;
} else {
*lphKey = lpKey->hKey;
dprintf_reg(stddeb,"RegCreateKey // found '%s', key=%08lX\n", str, (DWORD)*lphKey);
}
}
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegCloseKey [SHELL.3]
*/
LONG RegCloseKey(HKEY hKey)
{
dprintf_reg(stdnimp, "EMPTY STUB !!! RegCloseKey(%08lX);\n", (DWORD)hKey);
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegDeleteKey [SHELL.4]
*/
LONG RegDeleteKey(HKEY hKey, LPCSTR lpSubKey)
{
dprintf_reg(stdnimp, "EMPTY STUB !!! RegDeleteKey(%08lX, '%s');\n",
(DWORD)hKey, lpSubKey);
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegSetValue [SHELL.5]
*/
LONG RegSetValue(HKEY hKey, LPCSTR lpSubKey, DWORD dwType,
LPCSTR lpVal, DWORD dwIgnored)
{
HKEY hRetKey;
LPKEYSTRUCT lpKey;
LONG dwRet;
dprintf_reg(stddeb, "RegSetValue(%08lX, '%s', %08lX, '%s', %08lX);\n",
(DWORD)hKey, lpSubKey, dwType, lpVal, dwIgnored);
/*if (lpSubKey == NULL) return SHELL_ERROR_INVALID_PARAMETER;*/
if (lpVal == NULL) return SHELL_ERROR_INVALID_PARAMETER;
if ((dwRet = RegOpenKey(hKey, lpSubKey, &hRetKey)) != SHELL_ERROR_SUCCESS) {
dprintf_reg(stddeb, "RegSetValue // key not found ... so create it !\n");
if ((dwRet = RegCreateKey(hKey, lpSubKey, &hRetKey)) != SHELL_ERROR_SUCCESS) {
fprintf(stderr, "RegSetValue // key creation error %08lX !\n", dwRet);
return dwRet;
}
}
lpKey = (LPKEYSTRUCT)GlobalLock(hRetKey);
if (lpKey == NULL) return SHELL_ERROR_BADKEY;
if (lpKey->lpValue != NULL) free(lpKey->lpValue);
lpKey->lpValue = xmalloc(strlen(lpVal) + 1);
strcpy(lpKey->lpValue, lpVal);
dprintf_reg(stddeb,"RegSetValue // successful key='%s' val='%s' !\n", lpSubKey, lpKey->lpValue);
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegQueryValue [SHELL.6]
*/
LONG RegQueryValue(HKEY hKey, LPCSTR lpSubKey, LPSTR lpVal, LPLONG lpcb)
{
HKEY hRetKey;
LPKEYSTRUCT lpKey;
LONG dwRet;
int size;
dprintf_reg(stddeb, "RegQueryValue(%08lX, '%s', %p, %p);\n",
(DWORD)hKey, lpSubKey, lpVal, lpcb);
/*if (lpSubKey == NULL) return ERROR_INVALID_PARAMETER;*/
if (lpVal == NULL) return SHELL_ERROR_INVALID_PARAMETER;
if (lpcb == NULL) return SHELL_ERROR_INVALID_PARAMETER;
if (!*lpcb) return SHELL_ERROR_INVALID_PARAMETER;
if ((dwRet = RegOpenKey(hKey, lpSubKey, &hRetKey)) != SHELL_ERROR_SUCCESS) {
fprintf(stderr, "RegQueryValue // key not found !\n");
return dwRet;
}
lpKey = (LPKEYSTRUCT)GlobalLock(hRetKey);
if (lpKey == NULL) return SHELL_ERROR_BADKEY;
if (lpKey->lpValue != NULL) {
if ((size = strlen(lpKey->lpValue)+1) > *lpcb){
strncpy(lpVal,lpKey->lpValue,*lpcb-1);
lpVal[*lpcb-1] = 0;
} else {
strcpy(lpVal,lpKey->lpValue);
*lpcb = size;
}
} else {
*lpVal = 0;
*lpcb = (LONG)1;
}
dprintf_reg(stddeb,"RegQueryValue // return '%s' !\n", lpVal);
return SHELL_ERROR_SUCCESS;
}
/*************************************************************************
* RegEnumKey [SHELL.7]
*/
LONG RegEnumKey(HKEY hKey, DWORD dwSubKey, LPSTR lpBuf, DWORD dwSize)
{
LPKEYSTRUCT lpKey;
LONG len;
dprintf_reg(stddeb, "RegEnumKey(%08lX, %ld)\n", (DWORD)hKey, dwSubKey);
if (lpBuf == NULL) return SHELL_ERROR_INVALID_PARAMETER;
switch((DWORD)hKey) {
case 0:
lpKey = lphTopKey; break;
case HKEY_CLASSES_ROOT: /* == 1 */
case 0x80000000:
case 0x80000001:
lpKey = lphRootKey; break;
default:
dprintf_reg(stddeb,"RegEnumKey // specific key = %08lX !\n", (DWORD)hKey);
lpKey = (LPKEYSTRUCT)GlobalLock(hKey);
}
lpKey = lpKey->lpSubLvl;
while(lpKey != NULL){
if (!dwSubKey){
len = MIN(dwSize-1,strlen(lpKey->lpSubKey));
strncpy(lpBuf,lpKey->lpSubKey,len);
lpBuf[len] = 0;
dprintf_reg(stddeb, "RegEnumKey: found %s\n",lpBuf);
return SHELL_ERROR_SUCCESS;
}
dwSubKey--;
lpKey = lpKey->lpNextKey;
}
dprintf_reg(stddeb, "RegEnumKey: key not found!\n");
return SHELL_ERROR_INVALID_PARAMETER;
}
/*************************************************************************
* DragAcceptFiles [SHELL.9]
*/
@ -681,8 +232,6 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
{
HANDLE handle;
BOOL bRet;
DWORD WineProc,Win16Proc,Win32Proc;
static int initialized=0;
if (szApp) strncpy(AppName, szApp, sizeof(AppName));
else *AppName = 0;
@ -693,22 +242,11 @@ INT ShellAbout(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon)
AppMisc[sizeof(AppMisc)-1]=0;
if (!hIcon) hIcon = LoadIcon(0,MAKEINTRESOURCE(OIC_WINEICON));
if(!initialized)
{
WineProc=(DWORD)AboutDlgProc;
Win16Proc=(DWORD)GetWndProcEntry16("AboutDlgProc");
Win32Proc=(DWORD)RELAY32_GetEntryPoint(RELAY32_GetBuiltinDLL("WINPROCS32"),
"AboutDlgProc",0);
ALIAS_RegisterAlias(WineProc,Win16Proc,Win32Proc);
initialized=1;
}
handle = SYSRES_LoadResource( SYSRES_DIALOG_SHELL_ABOUT_MSGBOX );
if (!handle) return FALSE;
bRet = DialogBoxIndirectParam( WIN_GetWindowInstance( hWnd ),
handle, hWnd,
GetWndProcEntry16("AboutDlgProc"),
MODULE_GetWndProcEntry16("AboutDlgProc"),
(LONG)hIcon );
SYSRES_FreeResource( handle );
return bRet;

View File

@ -35,7 +35,7 @@ void *xmalloc( int size )
void *xrealloc( void *ptr, int size )
{
void *res = realloc (ptr, size);
if (res == NULL)
if ((res == NULL) && size)
{
fprintf (stderr, "Virtual memory exhausted.\n");
exit (1);

View File

@ -132,18 +132,13 @@ BOOL DOSMEM_Init(void)
/***********************************************************************
* DOSMEM_Alarm
* DOSMEM_Tick
*
* Increment the BIOS tick counter.
* Increment the BIOS tick counter. Called by timer signal handler.
*/
void DOSMEM_Alarm(void)
void DOSMEM_Tick(void)
{
pBiosData->Ticks = INT1A_GetTicksSinceMidnight();
printf( "Ticks = %ld\n", pBiosData->Ticks );
/*
signal( SIGALRM, DOSMEM_Alarm );
alarm( 1 );
*/
pBiosData->Ticks++;
}
@ -154,6 +149,8 @@ void DOSMEM_Alarm(void)
*/
void DOSMEM_FillBiosSegment(void)
{
extern void SIGNAL_StartBIOSTimer(void);
pBiosData = (BIOSDATA *)GlobalLock( DOSMEM_BiosSeg );
/* Clear all unused values */
@ -179,8 +176,6 @@ void DOSMEM_FillBiosSegment(void)
pBiosData->KbdBufferStart = 0x1e;
pBiosData->KbdBufferEnd = 0x3e;
/*
signal( SIGALRM, DOSMEM_Alarm );
alarm( 1 );
*/
SIGNAL_StartBIOSTimer();
}

View File

@ -30,7 +30,6 @@ 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 */

View File

@ -13,11 +13,9 @@
#include "win.h"
#include "ldt.h"
#include "callback.h"
#include "module.h"
#include "user.h"
#include "driver.h"
#include "mmsystem.h"
#include "selectors.h"
#include "stddebug.h"
#include "debug.h"
@ -103,7 +101,7 @@ void StartMMTime()
mmSysTimeSMPTE.u.smpte.frame = 0;
mmSysTimeSMPTE.u.smpte.fps = 0;
mmSysTimeSMPTE.u.smpte.dummy = 0;
SetTimer(0, 1, 33, GetWndProcEntry16("MMSysTimeCallback"));
SetTimer(0, 1, 33, MODULE_GetWndProcEntry16("MMSysTimeCallback"));
}
}

View File

@ -94,8 +94,13 @@ static const struct
{ obm_dnarrowd, TRUE }, /* OBM_DNARROWD */
{ obm_uparrowd, TRUE }, /* OBM_UPARROWD */
{ obm_restored, TRUE }, /* OBM_RESTORED */
#ifdef WIN_95_LOOK
{ obm_zoomd_95, TRUE }, /* OBM_ZOOMD */
{ obm_reduced_95, TRUE }, /* OBM_REDUCED */
#else
{ obm_zoomd, TRUE }, /* OBM_ZOOMD */
{ obm_reduced, TRUE }, /* OBM_REDUCED */
#endif
{ obm_restore, TRUE }, /* OBM_RESTORE */
#ifdef WIN_95_LOOK
{ obm_zoom_95, TRUE }, /* OBM_ZOOM */

View File

@ -522,10 +522,15 @@ LONG TEXT_TabbedTextOut( HDC hdc, int x, int y, LPSTR lpstr, int count,
BOOL fDisplayText)
{
WORD defWidth;
DWORD extent;
int i, tabPos = 0;
DWORD extent = 0;
int i, tabPos = x;
int start = x;
if (cTabStops == 1) defWidth = *lpTabPos;
if (cTabStops == 1)
{
defWidth = *lpTabPos;
cTabStops = 0;
}
else
{
TEXTMETRIC tm;
@ -538,17 +543,17 @@ LONG TEXT_TabbedTextOut( HDC hdc, int x, int y, LPSTR lpstr, int count,
for (i = 0; i < count; i++)
if (lpstr[i] == '\t') break;
extent = GetTextExtent( hdc, lpstr, i );
while ((cTabStops > 0) && (nTabOrg + *lpTabPos < x + LOWORD(extent)))
while ((cTabStops > 0) && (nTabOrg + *lpTabPos <= x + LOWORD(extent)))
{
lpTabPos++;
cTabStops--;
}
if (lpstr[i] != '\t')
if (i == count)
tabPos = x + LOWORD(extent);
else if (cTabStops > 0)
tabPos = nTabOrg + *lpTabPos;
else
tabPos = (x + LOWORD(extent) + defWidth - 1) / defWidth * defWidth;
tabPos = nTabOrg + ((x + LOWORD(extent) - nTabOrg) / defWidth + 1) * defWidth;
if (fDisplayText)
{
RECT r;
@ -561,7 +566,7 @@ LONG TEXT_TabbedTextOut( HDC hdc, int x, int y, LPSTR lpstr, int count,
count -= i+1;
lpstr += i+1;
}
return tabPos;
return MAKELONG(tabPos - start, HIWORD(extent));
}

View File

@ -1,3 +1,16 @@
Sun Mar 24 12:28:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [Strings_En.c] [Strings_De.c] (deleted)
Use resources for stringtables.
* [Xx.rc]
Added `WS_TABSTOP'
Wed Mar 20 13:14:58 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [winexec.c] (deleted)
Moved code to loader/modules.c
Fri Mar 15 20:56:31 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [main.c]

View File

@ -4,9 +4,11 @@
* Copyright 1996 Ulrich Schmid
*/
/* Menu */
#define LANGUAGE_ID De
#define LANGUAGE_NUMBER 2
#define LANGUAGE_MENU_ITEM "&Deutsch"
#define MENU_Xx MENU_De
/* Menu */
#define MENU_FILE "&Datei"
#define MENU_FILE_NEW "&Neu..."
@ -48,30 +50,25 @@
#define DIALOG_BROWSE "&Durchsuchen..."
#define DIALOG_HELP "&Hilfe"
#define DIALOG_NEW_Xx DIALOG_NEW_De
#define DIALOG_NEW_CAPTION "Neues Programmobject"
#define DIALOG_NEW_NEW "Neu"
#define DIALOG_NEW_GROUP "Programmgrupp&e"
#define DIALOG_NEW_PROGRAM "&Programm"
#define DIALOG_MOVE_Xx DIALOG_MOVE_De
#define DIALOG_MOVE_CAPTION "Programm verschieben"
#define DIALOG_MOVE_PROGRAM "Verschiebe Programm:"
#define DIALOG_MOVE_FROM_GROUP "Von Programmgruppe:"
#define DIALOG_MOVE_TO_GROUP "&In Gruppe:"
#define DIALOG_COPY_Xx DIALOG_COPY_De
#define DIALOG_COPY_CAPTION "Programm kopieren"
#define DIALOG_COPY_PROGRAM "Kopiere Programm:"
#define DIALOG_COPY_FROM_GROUP DIALOG_MOVE_FROM_GROUP
#define DIALOG_COPY_TO_GROUP DIALOG_MOVE_TO_GROUP
#define DIALOG_GROUP_Xx DIALOG_GROUP_De
#define DIALOG_GROUP_CAPTION "Programmgruppeneigenschaften"
#define DIALOG_GROUP_DESCRIPTION "&Beschreibung:"
#define DIALOG_GROUP_FILE "&Gruppendatei:"
#define DIALOG_PROGRAM_Xx DIALOG_PROGRAM_De
#define DIALOG_PROGRAM_CAPTION "Programmeigenschaften"
#define DIALOG_PROGRAM_DESCRIPTION DIALOG_GROUP_DESCRIPTION
#define DIALOG_PROGRAM_COMMAND_LINE "Befehls&zeile:"
@ -80,14 +77,45 @@
#define DIALOG_PROGRAM_SYMBOL "Als Sy&mbol"
#define DIALOG_PROGRAM_OTHER_SYMBOL "Anderes &Symbol..."
#define DIALOG_SYMBOL_Xx DIALOG_SYMBOL_De
#define DIALOG_SYMBOL_CAPTION "Symbol auswählen"
#define DIALOG_SYMBOL_FILE "Datei&name:"
#define DIALOG_SYMBOL_CURRENT "&Aktuelles Symbol:"
#define DIALOG_EXECUTE_Xx DIALOG_EXECUTE_De
#define DIALOG_EXECUTE_CAPTION "Programm Ausführen"
#define DIALOG_EXECUTE_COMMAND_LINE DIALOG_PROGRAM_COMMAND_LINE
#define DIALOG_EXECUTE_SYMBOL DIALOG_PROGRAM_SYMBOL
/* Strings */
#define STRING_PROGRAM_MANAGER "Programm-Manager"
#define STRING_ERROR "FEHLER"
#define STRING_WARNING "ACHTUNG"
#define STRING_INFO "Information"
#define STRING_DELETE "Löschen"
#define STRING_DELETE_GROUP_s "Lösche Programmgruppe `%s' ?"
#define STRING_DELETE_PROGRAM_s "Lösche Programm `%s' ?"
#define STRING_NOT_IMPLEMENTED "Nicht implementiert"
#define STRING_FILE_READ_ERROR_s "Fehler beim Lesen von `%s'"
#define STRING_FILE_WRITE_ERROR_s "Fehler beim Schreiben von `%s'"
#define STRING_GRPFILE_READ_ERROR_s "\
Die Programmgruppendatei `%s' kann nicht geöffnet werden.\n\
Soll weiterhin versucht werden, diese Datei zu laden?"
#define STRING_OUT_OF_MEMORY "Zu wenig Hauptspeicher"
#define STRING_WINHELP_ERROR "Keine Hilfe verfügbar"
#define STRING_UNKNOWN_FEATURE_s "Unbekannte Eigenschaft in %s"
#define STRING_FILE_NOT_OVERWRITTEN_s "Datei `%s' existiert. Sie wird nicht überschrieben."
#define STRING_SAVE_GROUP_AS_s "\
Die Programmgruppe wird als `%s' gesichert um \
das Überschreiben der Originaldatei zu verhindern."
#define STRING_NO_HOT_KEY "Keine"
#define STRING_ALL_FILES "Alle Dateien (*.*)"
#define STRING_PROGRAMS "Programme"
#define STRING_LIBRARIES_DLL "Bibliotheken (*.dll)"
#define STRING_SYMBOL_FILES "Symboldataeien"
#define STRING_SYMBOLS_ICO "Symbole (*.ico)"
#include "Xx.rc"

View File

@ -4,9 +4,11 @@
* Copyright 1996 Ulrich Schmid
*/
/* Menu */
#define LANGUAGE_ID En
#define LANGUAGE_NUMBER 0
#define LANGUAGE_MENU_ITEM "&English"
#define MENU_Xx MENU_En
/* Menu */
#define MENU_FILE "&File"
#define MENU_FILE_NEW "&New..."
@ -48,30 +50,25 @@
#define DIALOG_BROWSE "&Browse"
#define DIALOG_HELP "&Help"
#define DIALOG_NEW_Xx DIALOG_NEW_En
#define DIALOG_NEW_CAPTION "New Program Object"
#define DIALOG_NEW_NEW "New"
#define DIALOG_NEW_GROUP "Program &group"
#define DIALOG_NEW_PROGRAM "&Program"
#define DIALOG_MOVE_Xx DIALOG_MOVE_En
#define DIALOG_MOVE_CAPTION "Move Program"
#define DIALOG_MOVE_PROGRAM "Move program:"
#define DIALOG_MOVE_FROM_GROUP "From group:"
#define DIALOG_MOVE_TO_GROUP "&To group:"
#define DIALOG_COPY_Xx DIALOG_COPY_En
#define DIALOG_COPY_CAPTION "Copy Program"
#define DIALOG_COPY_PROGRAM "Copy program:"
#define DIALOG_COPY_FROM_GROUP DIALOG_MOVE_FROM_GROUP
#define DIALOG_COPY_TO_GROUP DIALOG_MOVE_TO_GROUP
#define DIALOG_GROUP_Xx DIALOG_GROUP_En
#define DIALOG_GROUP_CAPTION "Program Group Attributes"
#define DIALOG_GROUP_DESCRIPTION "&Description:"
#define DIALOG_GROUP_FILE "&Group file:"
#define DIALOG_PROGRAM_Xx DIALOG_PROGRAM_En
#define DIALOG_PROGRAM_CAPTION "Program Attributes"
#define DIALOG_PROGRAM_DESCRIPTION DIALOG_GROUP_DESCRIPTION
#define DIALOG_PROGRAM_COMMAND_LINE "&Command line:"
@ -80,14 +77,43 @@
#define DIALOG_PROGRAM_SYMBOL "As &Symbol"
#define DIALOG_PROGRAM_OTHER_SYMBOL "&Other Symbol..."
#define DIALOG_SYMBOL_Xx DIALOG_SYMBOL_En
#define DIALOG_SYMBOL_CAPTION "Select Symbol"
#define DIALOG_SYMBOL_FILE "&Filename:"
#define DIALOG_SYMBOL_CURRENT "&Current Symbol:"
#define DIALOG_EXECUTE_Xx DIALOG_EXECUTE_En
#define DIALOG_EXECUTE_CAPTION "Execute Program"
#define DIALOG_EXECUTE_COMMAND_LINE DIALOG_PROGRAM_COMMAND_LINE
#define DIALOG_EXECUTE_SYMBOL DIALOG_PROGRAM_SYMBOL
/* Strings */
#define STRING_PROGRAM_MANAGER "Program Manager"
#define STRING_ERROR "ERROR"
#define STRING_WARNING "WARNING"
#define STRING_INFO "Information"
#define STRING_DELETE "Delete"
#define STRING_DELETE_GROUP_s "Delete group `%s' ?"
#define STRING_DELETE_PROGRAM_s "Delete program `%s' ?"
#define STRING_NOT_IMPLEMENTED "Not implemented"
#define STRING_FILE_READ_ERROR_s "Error reading `%s'"
#define STRING_FILE_WRITE_ERROR_s "Error writeing `%s'"
#define STRING_GRPFILE_READ_ERROR_s "\
The group file `%s' cannot be opened.\n\
Should it be tried further on?"
#define STRING_OUT_OF_MEMORY "Out of memory"
#define STRING_WINHELP_ERROR "Help not available"
#define STRING_UNKNOWN_FEATURE_s "Unknown feature in %s"
#define STRING_FILE_NOT_OVERWRITTEN_s "File `%s' exists. Not overwritten."
#define STRING_SAVE_GROUP_AS_s "Save group as `%s' to prevent overwriting original files"
#define STRING_NO_HOT_KEY "None"
#define STRING_ALL_FILES "All files (*.*)"
#define STRING_PROGRAMS "Programs"
#define STRING_LIBRARIES_DLL "Libraries (*.dll)"
#define STRING_SYMBOL_FILES "Symbol files"
#define STRING_SYMBOLS_ICO "Symbols (*.ico)"
#include "Xx.rc"

View File

@ -18,8 +18,7 @@ STRINGOBJS = \
accel.o \
string.o \
$(LANGUAGES:%=%.o) \
$(LICENSELANG:%=License_%.o) \
$(LANGUAGES:%=Strings_%.o)
$(LICENSELANG:%=License_%.o)
C_SRCS = $(MOSTOBJS:.o=.c) $(STRINGOBJS:.o=.c)

View File

@ -12,5 +12,3 @@ It's possible to use an alternate `progman.ini' file by adding to
`wine.conf' something like:
[progman]
progman.ini=/my/wine/path/progman.ini
It's possible to start both Windows and UNIX programs.

View File

@ -1,34 +0,0 @@
#include <windows.h>
#include "progman.h"
LPCSTR StringTableDe[NUMBER_OF_STRINGS] =
{
"Programm-Manager",
"FEHLER",
"Information",
"Löschen",
"Lösche Programmgruppe `%s' ?",
"Lösche Programm `%s' ?",
"Nicht implementiert",
"Fehler beim Lesen von `%s'",
"Fehler beim Schreiben von `%s'",
"Die Programmgruppendatei `%s' kann nicht geöffnet werden.\n"
"Soll weiterhin versucht werden, diese Datei zu laden?",
"Zu wenig Hauptspeicher",
"Keine Hilfe verfügbar",
"Unbekannte Eigenschaft der `.grp' Datei",
"Datei `%s' existiert. Sie wird nicht überschrieben.",
"Die Programmgruppe wird als `%s' gesichert um das Überschreiben der Originaldatei zu verhindern.",
"Keine",
"Alle Dateien (*.*)\0" "*.*\0"
"Programme\0" "*.exe;*.pif;*.com;*.bat\0",
"Alle Dateien (*.*)\0" "*.*\0"
"Bibliotheken (*.dll)\0" "*.dll\0"
"Programme\0" "*.exe\0"
"Symboldateien\0" "*.ico;*.exe;*.dll\0"
"Symbole (*.ico)\0" "*.ico\0"
};

View File

@ -1,34 +0,0 @@
#include <windows.h>
#include "progman.h"
LPCSTR StringTableEn[NUMBER_OF_STRINGS] =
{
"Program Manager",
"ERROR",
"Information",
"Delete",
"Delete group `%s' ?",
"Delete program `%s' ?",
"Not implemented",
"Error reading `%s'",
"Error writeing `%s'",
"The group file `%s' cannot be opened.\n"
"Should it be tried further on?",
"Out of memory",
"Help not available",
"Unknown feature in `.grp' file",
"File `%s' exists. Not overwritten.",
"Save group as `%s' to prevent overwriting original files",
"None",
"All files (*.*)\0" "*.*\0"
"Programs\0" "*.exe;*.pif;*.com;*.bat\0",
"All files (*.*)\0" "*.*\0"
"Libraries (*.dll)\0" "*.dll\0"
"Programs\0" "*.exe\0"
"Symbol files\0" "*.ico;*.exe;*.dll\0"
"Symbols (*.ico)\0" "*.ico\0"
};

View File

@ -6,9 +6,12 @@
#include "progman.h"
#define CONCAT(a, b) CONCAT1(a, b)
#define CONCAT1(a, b) a##b
/* Menu */
MENU_Xx MENU
CONCAT(MENU_, LANGUAGE_ID) MENU
{
POPUP MENU_FILE {
MENUITEM MENU_FILE_NEW, PM_NEW
@ -33,8 +36,8 @@ MENU_Xx MENU
MENUITEM MENU_WINDOWS_ARRANGE, PM_ARRANGE
}
POPUP MENU_LANGUAGE {
MENUITEM "&English", PM_En
MENUITEM "&Deutsch", PM_De
/* Dummy item, will be removed */
MENUITEM SEPARATOR
}
POPUP MENU_HELP {
MENUITEM MENU_HELP_CONTENTS, PM_CONTENTS
@ -54,7 +57,7 @@ MENU_Xx MENU
/* Dialog `New' */
DIALOG_NEW_Xx DIALOG 0, 0, 170, 65
CONCAT(DIALOG_NEW_, LANGUAGE_ID) DIALOG 0, 0, 170, 65
STYLE DS_MODALFRAME
CAPTION DIALOG_NEW_CAPTION
{
@ -62,14 +65,14 @@ RADIOBUTTON "", PM_NEW_GROUP, 10, 15, 10, 15
LTEXT DIALOG_NEW_GROUP, PM_NEW_GROUP, 20, 18, 80, 15
RADIOBUTTON "", PM_NEW_PROGRAM, 10, 35, 10, 15
LTEXT DIALOG_NEW_PROGRAM, PM_NEW_PROGRAM, 20, 38, 80, 15
DEFPUSHBUTTON DIALOG_OK, IDOK, 105, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 105, 25, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 105, 45, 60, 15
DEFPUSHBUTTON DIALOG_OK, IDOK, 105, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 105, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 105, 45, 60, 15, WS_TABSTOP
}
/* Dialog `Move' */
DIALOG_MOVE_Xx DIALOG 0, 0, 250, 65
CONCAT(DIALOG_MOVE_, LANGUAGE_ID) DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME
CAPTION DIALOG_MOVE_CAPTION
{
@ -78,15 +81,15 @@ LTEXT "", PM_PROGRAM, 95, 5, 90, 15
LTEXT DIALOG_MOVE_FROM_GROUP, IDIGNORE, 5, 13, 90, 15
LTEXT "", PM_FROM_GROUP, 95, 13, 90, 15
LTEXT DIALOG_MOVE_TO_GROUP, PM_TO_GROUP_TXT, 5, 28, 140, 15
COMBOBOX PM_TO_GROUP, 5, 38, 140, 50, CBS_DROPDOWNLIST
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 45, 60, 15
COMBOBOX PM_TO_GROUP, 5, 38, 140, 50, WS_TABSTOP | CBS_DROPDOWNLIST
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 45, 60, 15, WS_TABSTOP
}
/* Dialog `Copy' */
DIALOG_COPY_Xx DIALOG 0, 0, 250, 65
CONCAT(DIALOG_COPY_, LANGUAGE_ID) DIALOG 0, 0, 250, 65
STYLE DS_MODALFRAME
CAPTION DIALOG_COPY_CAPTION
{
@ -95,80 +98,120 @@ LTEXT "", PM_PROGRAM, 95, 5, 90, 15
LTEXT DIALOG_COPY_FROM_GROUP, IDIGNORE, 5, 13, 90, 15
LTEXT "", PM_FROM_GROUP, 95, 13, 90, 15
LTEXT DIALOG_COPY_TO_GROUP, PM_TO_GROUP_TXT, 5, 28, 140, 15
COMBOBOX PM_TO_GROUP, 5, 38, 140, 50, CBS_DROPDOWNLIST
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 45, 60, 15
COMBOBOX PM_TO_GROUP, 5, 38, 140, 50, WS_TABSTOP | CBS_DROPDOWNLIST
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 45, 60, 15, WS_TABSTOP
}
/* Dialog `Group attributes' */
DIALOG_GROUP_Xx DIALOG 0, 0, 230, 65
CONCAT(DIALOG_GROUP_, LANGUAGE_ID) DIALOG 0, 0, 230, 65
STYLE DS_MODALFRAME
CAPTION DIALOG_GROUP_CAPTION
{
LTEXT DIALOG_GROUP_DESCRIPTION, PM_DESCRIPTION_TXT, 05, 18, 50, 10
EDITTEXT PM_DESCRIPTION, 60, 18, 90, 15
EDITTEXT PM_DESCRIPTION, 60, 18, 90, 15, WS_TABSTOP
LTEXT DIALOG_GROUP_FILE, PM_FILE_TXT, 05, 38, 50, 10
EDITTEXT PM_FILE, 60, 38, 90, 15
DEFPUSHBUTTON DIALOG_OK, IDOK, 155, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 155, 25, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 155, 45, 60, 15
EDITTEXT PM_FILE, 60, 38, 90, 15, WS_TABSTOP
DEFPUSHBUTTON DIALOG_OK, IDOK, 155, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 155, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 155, 45, 60, 15, WS_TABSTOP
}
/* Dialog `Program attributes' */
DIALOG_PROGRAM_Xx DIALOG 0, 0, 250, 105
CONCAT(DIALOG_PROGRAM_, LANGUAGE_ID) DIALOG 0, 0, 250, 105
STYLE DS_MODALFRAME
CAPTION DIALOG_PROGRAM_CAPTION
{
LTEXT DIALOG_PROGRAM_DESCRIPTION, PM_DESCRIPTION_TXT, 05, 10, 60, 10
EDITTEXT PM_DESCRIPTION, 80, 10, 90, 15
EDITTEXT PM_DESCRIPTION, 80, 10, 90, 15, WS_TABSTOP
LTEXT DIALOG_PROGRAM_COMMAND_LINE, PM_COMMAND_LINE_TXT, 05, 25, 60, 10
EDITTEXT PM_COMMAND_LINE, 80, 25, 90, 15
EDITTEXT PM_COMMAND_LINE, 80, 25, 90, 15, WS_TABSTOP
LTEXT DIALOG_PROGRAM_DIRECTORY, PM_DIRECTORY_TXT, 05, 40, 60, 10
EDITTEXT PM_DIRECTORY, 80, 40, 90, 15
EDITTEXT PM_DIRECTORY, 80, 40, 90, 15, WS_TABSTOP
LTEXT DIALOG_PROGRAM_HOT_KEY, PM_HOT_KEY_TXT, 05, 55, 60, 10
EDITTEXT PM_HOT_KEY, 80, 55, 90, 15
EDITTEXT PM_HOT_KEY, 80, 55, 90, 15, WS_TABSTOP
ICON "", PM_ICON, 20, 70
CHECKBOX "", PM_SYMBOL, 80, 75, 10, 10
CHECKBOX "", PM_SYMBOL, 80, 75, 10, 10, WS_TABSTOP
LTEXT DIALOG_PROGRAM_SYMBOL, IDIGNORE, 95, 75, 75, 10
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15
PUSHBUTTON DIALOG_BROWSE, PM_BROWSE, 185, 45, 60, 15
PUSHBUTTON DIALOG_PROGRAM_OTHER_SYMBOL, PM_OTHER_SYMBOL, 185, 65, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 85, 60, 15
DEFPUSHBUTTON DIALOG_OK, IDOK, 185, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 185, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_BROWSE, PM_BROWSE, 185, 45, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_PROGRAM_OTHER_SYMBOL, PM_OTHER_SYMBOL, 185, 65, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 185, 85, 60, 15, WS_TABSTOP
}
/* Dialog `Symbol' */
DIALOG_SYMBOL_Xx DIALOG 0, 0, 200, 85
CONCAT(DIALOG_SYMBOL_, LANGUAGE_ID) DIALOG 0, 0, 200, 85
STYLE DS_MODALFRAME
CAPTION DIALOG_SYMBOL_CAPTION
{
LTEXT DIALOG_SYMBOL_FILE, PM_ICON_FILE_TXT, 5, 15, 40, 10
EDITTEXT PM_ICON_FILE, 45, 15, 85, 15
EDITTEXT PM_ICON_FILE, 45, 15, 85, 15, WS_TABSTOP
LTEXT DIALOG_SYMBOL_CURRENT, PM_SYMBOL_LIST_TXT, 5, 30, 125, 10
COMBOBOX PM_SYMBOL_LIST, 5, 40, 125, 50,
CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OWNERDRAWFIXED
DEFPUSHBUTTON DIALOG_OK, IDOK, 135, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 135, 25, 60, 15
PUSHBUTTON DIALOG_BROWSE , PM_BROWSE, 135, 45, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 135, 65, 60, 15
CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_OWNERDRAWFIXED | WS_TABSTOP
DEFPUSHBUTTON DIALOG_OK, IDOK, 135, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 135, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_BROWSE , PM_BROWSE, 135, 45, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 135, 65, 60, 15, WS_TABSTOP
}
/* Dialog `Execute' */
DIALOG_EXECUTE_Xx DIALOG 0, 0, 200, 85
CONCAT(DIALOG_EXECUTE_, LANGUAGE_ID) DIALOG 0, 0, 200, 85
STYLE DS_MODALFRAME
CAPTION DIALOG_EXECUTE_CAPTION
{
LTEXT DIALOG_EXECUTE_COMMAND_LINE, IDIGNORE, 05, 15, 120, 10
EDITTEXT PM_COMMAND, 05, 25, 120, 15
CHECKBOX "", PM_SYMBOL, 05, 45, 10, 10
EDITTEXT PM_COMMAND, 05, 25, 120, 15, WS_TABSTOP
CHECKBOX "", PM_SYMBOL, 05, 45, 10, 10, WS_TABSTOP
LTEXT DIALOG_EXECUTE_SYMBOL, IDIGNORE, 20, 45, 120, 10
DEFPUSHBUTTON DIALOG_OK, IDOK, 135, 5, 60, 15
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 135, 25, 60, 15
PUSHBUTTON DIALOG_BROWSE , PM_BROWSE, 135, 45, 60, 15
PUSHBUTTON DIALOG_HELP, PM_HELP, 135, 65, 60, 15
DEFPUSHBUTTON DIALOG_OK, IDOK, 135, 5, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_CANCEL, IDCANCEL, 135, 25, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_BROWSE , PM_BROWSE, 135, 45, 60, 15, WS_TABSTOP
PUSHBUTTON DIALOG_HELP, PM_HELP, 135, 65, 60, 15, WS_TABSTOP
}
/* Strings */
#define ADDSTRING(str) ADDSTRING1(LANGUAGE_NUMBER, IDS_ ## str) STRING_ ## str
#define ADDSTRING1(langnum, ids) ADDSTRING2(langnum, ids)
#define ADDSTRING2(langnum, ids) 0x ## langnum ## ids
#define STRINGIFY(str) STRINGIFY1(str)
#define STRINGIFY1(str) #str
#define STRING_LANGUAGE_ID STRINGIFY(LANGUAGE_ID)
#define STRING_LANGUAGE_MENU_ITEM LANGUAGE_MENU_ITEM
STRINGTABLE
{
ADDSTRING(LANGUAGE_ID)
ADDSTRING(LANGUAGE_MENU_ITEM)
ADDSTRING(PROGRAM_MANAGER)
ADDSTRING(ERROR)
ADDSTRING(WARNING)
ADDSTRING(INFO)
ADDSTRING(DELETE)
ADDSTRING(DELETE_GROUP_s)
ADDSTRING(DELETE_PROGRAM_s)
ADDSTRING(NOT_IMPLEMENTED)
ADDSTRING(FILE_READ_ERROR_s)
ADDSTRING(FILE_WRITE_ERROR_s)
ADDSTRING(GRPFILE_READ_ERROR_s)
ADDSTRING(OUT_OF_MEMORY)
ADDSTRING(WINHELP_ERROR)
ADDSTRING(UNKNOWN_FEATURE_s)
ADDSTRING(FILE_NOT_OVERWRITTEN_s)
ADDSTRING(SAVE_GROUP_AS_s)
ADDSTRING(NO_HOT_KEY)
ADDSTRING(ALL_FILES)
ADDSTRING(PROGRAMS)
ADDSTRING(LIBRARIES_DLL)
ADDSTRING(SYMBOL_FILES)
ADDSTRING(SYMBOLS_ICO)
}

View File

@ -8,7 +8,8 @@
#include <commdlg.h>
#include "progman.h"
static BOOL DIALOG_Browse(HWND, LPCSTR, LPSTR, INT);
static BOOL DIALOG_BrowsePrograms(HWND, LPSTR, INT);
static BOOL DIALOG_BrowseSymbols(HWND, LPSTR, INT);
static LRESULT DIALOG_NEW_DlgProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT DIALOG_COPY_MOVE_DlgProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT DIALOG_GROUP_DlgProc(HWND, UINT, WPARAM, LPARAM);
@ -157,12 +158,9 @@ static LRESULT DIALOG_COPY_MOVE_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPAR
* DIALOG_Delete
*/
BOOL DIALOG_Delete(LPCSTR lpszFormat_s, LPCSTR lpszName)
BOOL DIALOG_Delete(UINT ids_text_s, LPCSTR lpszName)
{
CHAR msg[1000];
if (sizeof(msg) <= lstrlen(lpszFormat_s) + lstrlen(lpszName)) return FALSE;
wsprintf(msg, (LPSTR)lpszFormat_s, lpszName);
return (IDYES == MessageBox(Globals.hMainWnd, msg, STRING_DELETE,
return (IDYES == MAIN_MessageBoxIDS_s(ids_text_s, lpszName, IDS_DELETE,
MB_YESNO | MB_DEFBUTTON2));
}
@ -284,6 +282,7 @@ BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
static LRESULT DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
CHAR buffer[MAX_STRING_LEN];
switch (msg)
{
case WM_INITDIALOG:
@ -291,7 +290,10 @@ static LRESULT DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
SetDlgItemText(hDlg, PM_COMMAND_LINE, ProgramAttributes.lpszCmdLine);
SetDlgItemText(hDlg, PM_DIRECTORY, ProgramAttributes.lpszWorkDir);
if (!*ProgramAttributes.lpnHotKey)
SetDlgItemText(hDlg, PM_HOT_KEY, (LPSTR)STRING_NO_HOT_KEY);
{
LoadString(Globals.hInstance, IDS_NO_HOT_KEY, buffer, sizeof(buffer));
SetDlgItemText(hDlg, PM_HOT_KEY, buffer);
}
CheckDlgButton(hDlg, PM_SYMBOL,
(*ProgramAttributes.lpnCmdShow == SW_SHOWMINIMIZED));
@ -309,8 +311,7 @@ static LRESULT DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
if (DIALOG_Browse(hDlg, STRING_BROWSE_EXE_FILTER,
filename, sizeof(filename)))
if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_COMMAND_LINE, filename);
return TRUE;
}
@ -432,14 +433,13 @@ static LRESULT DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
if (DIALOG_Browse(hDlg, STRING_BROWSE_ICO_FILTER,
filename, sizeof(filename)))
if (DIALOG_BrowseSymbols(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_ICON_FILE, filename);
return TRUE;
}
case PM_HELP:
MAIN_NotImplementedError();
MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
return TRUE;
case IDOK:
@ -500,14 +500,13 @@ static LRESULT DIALOG_EXECUTE_DlgProc(HWND hDlg, UINT msg,
case PM_BROWSE:
{
CHAR filename[MAX_PATHNAME_LEN];
if (DIALOG_Browse(hDlg, STRING_BROWSE_EXE_FILTER,
filename, sizeof(filename)))
if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
SetDlgItemText(hDlg, PM_COMMAND, filename);
return TRUE;
}
case PM_HELP:
MAIN_NotImplementedError();
MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
return TRUE;
case IDOK:
@ -536,15 +535,16 @@ static LRESULT DIALOG_EXECUTE_DlgProc(HWND hDlg, UINT msg,
* DIALOG_Browse
*/
/* FIXME is this correct ? */
static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpcstrFilter,
static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpszzFilter,
LPSTR lpstrFile, INT nMaxFile)
{
OPENFILENAME openfilename;
/* FIXME is this correct ? */
openfilename.lStructSize = 0;
openfilename.hwndOwner = hDlg;
openfilename.hInstance = Globals.hInstance;
openfilename.lpstrFilter = (LPSTR)lpcstrFilter;
openfilename.lpstrFilter = (LPSTR)lpszzFilter;
openfilename.lpstrCustomFilter = 0;
openfilename.nMaxCustFilter = 0;
openfilename.nFilterIndex = 0;
@ -564,6 +564,55 @@ static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpcstrFilter,
return GetOpenFileName(&openfilename);
}
/***********************************************************************
*
* DIALOG_AddFilterItem
*/
static VOID DIALOG_AddFilterItem(LPSTR *p, UINT ids, LPCSTR filter)
{
LoadString(Globals.hInstance, ids, *p, MAX_STRING_LEN);
*p += strlen(*p) + 1;
lstrcpy(*p, (SEGPTR) filter);
*p += strlen(*p) + 1;
**p = '\0';
}
/***********************************************************************
*
* DIALOG_BrowsePrograms
*/
static BOOL DIALOG_BrowsePrograms(HWND hDlg, LPSTR lpszFile, INT nMaxFile)
{
CHAR szzFilter[2 * MAX_STRING_LEN + 100];
LPSTR p = szzFilter;
DIALOG_AddFilterItem(&p, IDS_PROGRAMS, "*.exe;*.pif;*.com;*.bat");
DIALOG_AddFilterItem(&p, IDS_ALL_FILES, "*.*");
return(DIALOG_Browse(hDlg, szzFilter, lpszFile, nMaxFile));
}
/***********************************************************************
*
* DIALOG_BrowseSymbols
*/
static BOOL DIALOG_BrowseSymbols(HWND hDlg, LPSTR lpszFile, INT nMaxFile)
{
CHAR szzFilter[5 * MAX_STRING_LEN + 100];
LPSTR p = szzFilter;
DIALOG_AddFilterItem(&p, IDS_SYMBOL_FILES, "*.ico;*.exe;*.dll");
DIALOG_AddFilterItem(&p, IDS_PROGRAMS, "*.exe");
DIALOG_AddFilterItem(&p, IDS_LIBRARIES_DLL, "*.dll");
DIALOG_AddFilterItem(&p, IDS_SYMBOLS_ICO, "*.ico");
DIALOG_AddFilterItem(&p, IDS_ALL_FILES, "*.*");
return(DIALOG_Browse(hDlg, szzFilter, lpszFile, nMaxFile));
}
/* Local Variables: */
/* c-file-style: "GNU" */
/* End: */

View File

@ -109,7 +109,7 @@ HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT nCmdShow,
HLOCAL hGrpFile = LocalAlloc(LMEM_FIXED, 1 + lstrlen(lpszGrpFile));
if (!hGroup || !hName || !hGrpFile)
{
MessageBox(Globals.hMainWnd, "out of memory", lpszName, MB_OK);
MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
if (hGroup) LocalFree(hGroup);
if (hName) LocalFree(hName);
if (hGrpFile) LocalFree(hGrpFile);

View File

@ -63,14 +63,15 @@ HLOCAL GRPFILE_ReadGroupFile(LPCSTR lpszPath)
/* Read the whole file into a buffer */
if (!GRPFILE_ReadFileToBuffer(lpszPath, &hBuffer, &size))
{
MAIN_GrpFileReadError(lpszPath);
MAIN_MessageBoxIDS_s(IDS_GRPFILE_READ_ERROR_s, lpszPath, IDS_ERROR, MB_YESNO);
return(0);
}
/* Interpret buffer */
hGroup = GRPFILE_ScanGroup(LocalLock(hBuffer), size,
lpszPath, bFileNameModified);
if (!hGroup) MAIN_GrpFileReadError(lpszPath);
if (!hGroup)
MAIN_MessageBoxIDS_s(IDS_GRPFILE_READ_ERROR_s, lpszPath, IDS_ERROR, MB_YESNO);
LocalFree(hBuffer);
@ -225,8 +226,8 @@ static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
switch (icontype)
{
default:
MessageBox(Globals.hMainWnd, STRING_UNKNOWN_FEATURE_IN_GRPFILE,
lpszGrpFile, MB_OK);
MAIN_MessageBoxIDS_s(IDS_UNKNOWN_FEATURE_s, lpszGrpFile,
IDS_WARNING, MB_OK);
case 0x048c:
iconXORsize = GET_USHORT(program_ptr, 8);
iconANDsize = GET_USHORT(program_ptr, 10) / 8;
@ -305,9 +306,8 @@ static HLOCAL GRPFILE_ScanProgram(LPCSTR buffer, INT size,
nCmdShow = GET_USHORT(ptr, 6);
break;
default:
MessageBox(Globals.hMainWnd,
STRING_UNKNOWN_FEATURE_IN_GRPFILE,
lpszGrpFile, MB_OK);
MAIN_MessageBoxIDS_s(IDS_UNKNOWN_FEATURE_s,
lpszGrpFile, IDS_WARNING, MB_OK);
}
}
if (!skip) break;
@ -344,25 +344,19 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
if (!group->bOverwriteFileOk &&
OpenFile(szPath, &dummy, OF_EXIST) != HFILE_ERROR)
{
CHAR msg[MAX_PATHNAME_LEN + 1000];
/* Original file exists, try `.gr' extension */
GRPFILE_ModifyFileName(szPath, LocalLock(group->hGrpFile),
MAX_PATHNAME_LEN, TRUE);
if (OpenFile(szPath, &dummy, OF_EXIST) != HFILE_ERROR)
{
/* File exists. Do not overwrite */
if (sizeof(msg) <= lstrlen(STRING_FILE_NOT_OVERWRITTEN_s) + lstrlen(szPath))
return FALSE;
wsprintf(msg, (LPSTR)STRING_FILE_NOT_OVERWRITTEN_s, szPath);
MessageBox(Globals.hMainWnd, msg, STRING_ERROR, MB_OK);
MAIN_MessageBoxIDS_s(IDS_FILE_NOT_OVERWRITTEN_s, szPath,
IDS_INFO, MB_OK);
return FALSE;
}
/* Inform about the modified file name */
if (sizeof(msg) <= lstrlen(STRING_SAVE_GROUP_AS_s) + lstrlen(szPath))
return FALSE;
wsprintf(msg, (LPSTR)STRING_SAVE_GROUP_AS_s, szPath);
if (IDCANCEL == MessageBox(Globals.hMainWnd, msg, STRING_INFO,
if (IDCANCEL ==
MAIN_MessageBoxIDS_s(IDS_SAVE_GROUP_AS_s, szPath, IDS_INFO,
MB_OKCANCEL | MB_ICONINFORMATION))
return FALSE;
}
@ -395,7 +389,8 @@ BOOL GRPFILE_WriteGroupFile(HLOCAL hGroup)
}
else ret = FALSE;
if (!ret) MAIN_FileWriteError(szPath);
if (!ret)
MAIN_MessageBoxIDS_s(IDS_FILE_WRITE_ERROR_s, szPath, IDS_ERROR, MB_OK);
return(ret);
}

View File

@ -34,6 +34,13 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
{
MSG msg;
#if defined(WINELIB) && !defined(HAVE_WINE_CONSTRUCTOR)
/* Register resources */
LIBWINE_Register_accel();
LIBWINE_Register_De();
LIBWINE_Register_En();
#endif
#ifndef WINELIB
Globals.lpszIniFile = "progman.ini";
Globals.lpszIcoFile = "progman.ico";
@ -56,27 +63,14 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
#endif
/* Select Language */
Globals.lpszLanguage = "En";
#ifdef WINELIB
if (Options.language == LANG_Cz) Globals.lpszLanguage = "Cz";
if (Options.language == LANG_Da) Globals.lpszLanguage = "Da";
if (Options.language == LANG_De) Globals.lpszLanguage = "De";
if (Options.language == LANG_Es) Globals.lpszLanguage = "Es";
if (Options.language == LANG_Fi) Globals.lpszLanguage = "Fi";
if (Options.language == LANG_Fr) Globals.lpszLanguage = "Fr";
if (Options.language == LANG_No) Globals.lpszLanguage = "No";
#ifndef HAVE_WINE_CONSTRUCTOR
/* Register resources */
LIBWINE_Register_accel();
LIBWINE_Register_De();
LIBWINE_Register_En();
#endif
Globals.lpszLanguage = langNames[Options.language];
#else
Globals.lpszLanguage = "En";
#endif
Globals.hInstance = hInstance;
Globals.hGroups = 0;
/* FIXME should use MDI */
Globals.hActiveGroup = 0;
/* Read Options from `progman.ini' */
@ -108,7 +102,7 @@ int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
Globals.hAccel = LoadAccelerators(Globals.hInstance, STRING_ACCEL);
/* Setup menu, stringtable and resourcenames */
STRING_SelectLanguage(Globals.lpszLanguage);
STRING_SelectLanguageByName(Globals.lpszLanguage);
MAIN_CreateMDIWindow();
@ -146,7 +140,8 @@ static VOID MAIN_CreateGroups()
{
int num, skip, ret;
ret = sscanf(ptr, "%d%n", &num, &skip);
if (ret == 0) MAIN_FileReadError(Globals.lpszIniFile);
if (ret == 0)
MAIN_MessageBoxIDS_s(IDS_FILE_READ_ERROR_s, Globals.lpszIniFile, IDS_ERROR, MB_OK);
if (ret != 1) break;
sprintf(key, "Group%d", num);
@ -259,12 +254,12 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
case PM_DELETE:
if (hActiveProgram)
{
if (DIALOG_Delete(STRING_DELETE_PROGRAM_s, PROGRAM_ProgramName(hActiveProgram)))
if (DIALOG_Delete(IDS_DELETE_PROGRAM_s, PROGRAM_ProgramName(hActiveProgram)))
PROGRAM_DeleteProgram(hActiveProgram, TRUE);
}
else if (hActiveGroup)
{
if (DIALOG_Delete(STRING_DELETE_GROUP_s, GROUP_GroupName(hActiveGroup)))
if (DIALOG_Delete(IDS_DELETE_GROUP_s, GROUP_GroupName(hActiveGroup)))
GROUP_DeleteGroup(hActiveGroup);
}
break;
@ -326,24 +321,15 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
SendMessage(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0);
break;
/* Menu Language */
case PM_Da: STRING_SelectLanguage("Da"); break;
case PM_De: STRING_SelectLanguage("De"); break;
case PM_En: STRING_SelectLanguage("En"); break;
case PM_Es: STRING_SelectLanguage("Es"); break;
case PM_Fi: STRING_SelectLanguage("Fi"); break;
case PM_Fr: STRING_SelectLanguage("Fr"); break;
case PM_No: STRING_SelectLanguage("No"); break;
/* Menu Help */
case PM_CONTENTS:
if (!WinHelp(Globals.hMainWnd, "progman.hlp", HELP_INDEX, 0))
MAIN_WinHelpError();
MAIN_MessageBoxIDS(IDS_WINHELP_ERROR, IDS_ERROR, MB_OK);
break;
case PM_HELPONHELP:
if (!WinHelp(Globals.hMainWnd, "progman.hlp", HELP_HELPONHELP, 0))
MAIN_WinHelpError();
MAIN_MessageBoxIDS(IDS_WINHELP_ERROR, IDS_ERROR, MB_OK);
break;
case PM_TUTORIAL:
@ -368,7 +354,10 @@ static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
#endif
default:
MAIN_NotImplementedError();
if (wParam >= PM_FIRST_LANGUAGE && wParam <= PM_LAST_LANGUAGE)
STRING_SelectLanguageByNumber(wParam - PM_FIRST_LANGUAGE);
else
MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
break;
}
}
@ -462,6 +451,38 @@ static VOID MAIN_CreateMDIWindow()
}
/**********************************************************************/
/***********************************************************************
*
* MAIN_MessageBoxIDS
*/
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
CHAR title[MAX_STRING_LEN];
LoadString(Globals.hInstance, ids_text, text, sizeof(text));
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
return(MessageBox(Globals.hMainWnd, text, title, type));
}
/***********************************************************************
*
* MAIN_MessageBoxIDS_s
*/
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WORD type)
{
CHAR text[MAX_STRING_LEN];
CHAR title[MAX_STRING_LEN];
CHAR newtext[MAX_STRING_LEN + MAX_PATHNAME_LEN];
LoadString(Globals.hInstance, ids_text, text, sizeof(text));
LoadString(Globals.hInstance, ids_title, title, sizeof(title));
wsprintf(newtext, text, str);
return(MessageBox(Globals.hMainWnd, newtext, title, type));
}
/***********************************************************************
*
* MAIN_ReplaceString
@ -477,79 +498,7 @@ VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replace)
LocalFree(*handle);
*handle = newhandle;
}
else MAIN_OutOfMemoryError();
}
/***********************************************************************
*
* MAIN_NotImplementedError
*/
VOID MAIN_NotImplementedError()
{
MessageBox(Globals.hMainWnd,
STRING_NOT_IMPLEMENTED, STRING_ERROR, MB_OK);
}
/***********************************************************************
*
* MAIN_OutOfMemoryError
*/
VOID MAIN_OutOfMemoryError()
{
MessageBox(Globals.hMainWnd,
STRING_OUT_OF_MEMORY, STRING_ERROR, MB_OK);
}
/***********************************************************************
*
* MAIN_WinHelpError
*/
VOID MAIN_WinHelpError()
{
MessageBox(Globals.hMainWnd,
STRING_WINHELP_ERROR, STRING_ERROR, MB_OK);
}
/***********************************************************************
*
* MAIN_FileReadError
*/
VOID MAIN_FileReadError(LPCSTR lpszPath)
{
CHAR msg[MAX_PATHNAME_LEN + 1000];
if (sizeof(msg) <= strlen(STRING_FILE_READ_ERROR_s) + strlen(lpszPath)) return;
wsprintf(msg, (LPSTR)STRING_FILE_READ_ERROR_s, lpszPath);
MessageBox(Globals.hMainWnd, msg, STRING_ERROR, MB_OK);
}
/***********************************************************************
*
* MAIN_FileWriteError
*/
VOID MAIN_FileWriteError(LPCSTR lpszPath)
{
CHAR msg[MAX_PATHNAME_LEN + 1000];
if (sizeof(msg) <= strlen(STRING_FILE_WRITE_ERROR_s) + strlen(lpszPath)) return;
wsprintf(msg, (LPSTR)STRING_FILE_WRITE_ERROR_s, lpszPath);
MessageBox(Globals.hMainWnd, msg, STRING_ERROR, MB_OK);
}
/***********************************************************************
*
* MAIN_GrpFileReadError
*/
VOID MAIN_GrpFileReadError(LPCSTR lpszPath)
{
CHAR msg[MAX_PATHNAME_LEN + 1000];
if (sizeof(msg) <= strlen(STRING_GRPFILE_READ_ERROR_s) + strlen(lpszPath)) return;
wsprintf(msg, (LPSTR)STRING_GRPFILE_READ_ERROR_s, lpszPath);
MessageBox(Globals.hMainWnd, msg, STRING_ERROR, MB_YESNO);
else MAIN_MessageBoxIDS(IDS_OUT_OF_MEMORY, IDS_ERROR, MB_OK);
}
/* Local Variables: */

Some files were not shown because too many files have changed in this diff Show More