Release 960712
Fri Jul 12 17:43:05 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/scroll.c]
Use Win32 heap functions to allocate scroll-bar info structure.
* [debugger/dbg.y] [debugger/registers.c]
Added support for FS and GS segment registers.
Check that segment registers value are OK before returning from
the signal handler.
* [tools/build.c] [if1632/relay.c] [loader/builtin.c]
Changed relay debugging for Win32 function: the relay code now
passes the entry point address instead of the function name.
* [tools/build.c] [miscemu/*.c]
Added support for data entry points in Win32 DLLs.
Added 'cdecl' function type for Win32.
For 'register' function, the relay code now passes a pointer to
the SIGCONTEXT structure.
* [include/registers.h] [include/wine.h]
Moved SIGCONTEXT structure definition in registers.h.
* [loader/pe_image.c]
Don't die at once if some Win32 entry points cannot be found, but
set them to NULL, just like we do for Win16. This allows some
programs to go further before crashing.
* [loader/task.c] [loader/main.c]
Moved global initializations from InitTask() to MAIN_Init(), as
they no longer need a task context with the new SEGPTR heap functions.
* [memory/string.c]
Added lstrcpynAtoW and lstrcpynWtoA; not real API functions, but
very convenient.
* [windows/graphics.c]
Partially implemented DrawEdge().
* [windows/timer.c] [windows/caret.c]
Implemented Win32 timer handling. Updated caret management to use
Win32 timers (avoids having to use a Win16 callback).
* [windows/win.c]
Prevent programs from setting some style bits with
SetWindowLong(). This should fix some BadMatch crashes.
Link new windows at the end of the linked list.
* [windows/winpos.c]
Don't try to activate a child window in ShowWindow().
* [windows/winproc.c]
Added a 32->32 thunk to support Ansi-Unicode translation.
Wed Jul 10 22:11:12 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [files/directory.c]
Additional (undocumented) return value for GetTempDrive() added.
* [files/dos_fs.c] [files/file.c] [include/windows.h]
GetTempFileName32* added.
GetShortPathName* added.
* [memory/string.c]
Win16 lstrcpy() can get NULL ptrs as argument and survive.
* [misc/lzexpand.c]
LZOpenFile(): also try opening with compressed filename if normal
open fails.
* [misc/ole2nls.c] [misc/lstr.c] [include/windows.h]
Char* added.
CompareString* added.
Sun Jul 7 01:22:14 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [objects/font.c] [if1632/gdi32.spec]
CreateFontIndirect32A and CreateFontIndirect32W added.
* [misc/ole2nls.c]
GetUserDefaultLCID return values updated for new languages.
Finnish support added for GetLocaleInfoA.
* [object/palette] [gdi32.spec]
RealizePalette32 and SelectPalette32 added.
Sat Jul 6 17:27:30 1996 Ronan Waide <root@waider.ie>
* [misc/shell.c]
Fixup for SHELL_FindExecutable so that File->Run from progman
works once more. Still needs some more fixups - grep for FIXME in
this file.
diff --git a/misc/commdlg.c b/misc/commdlg.c
index dc5a829..3745eaf 100644
--- a/misc/commdlg.c
+++ b/misc/commdlg.c
@@ -85,8 +85,8 @@
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
- MODULE_GetWndProcEntry16("FileOpenDlgProc"),
- (DWORD)lpofn );
+ (DLGPROC16)MODULE_GetWndProcEntry16("FileOpenDlgProc"),
+ (DWORD)lpofn );
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
{
@@ -127,8 +127,8 @@
hInst = WIN_GetWindowInstance( lpofn->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpofn->hwndOwner,
- MODULE_GetWndProcEntry16("FileSaveDlgProc"),
- (DWORD)lpofn);
+ (DLGPROC16)MODULE_GetWndProcEntry16("FileSaveDlgProc"),
+ (DWORD)lpofn);
if (!(lpofn->Flags & OFN_ENABLETEMPLATEHANDLE))
{
if (lpofn->Flags & OFN_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@@ -705,8 +705,8 @@
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
- MODULE_GetWndProcEntry16("FindTextDlgProc"),
- (DWORD)lpFind );
+ (DLGPROC16)MODULE_GetWndProcEntry16("FindTextDlgProc"),
+ (DWORD)lpFind );
GlobalUnlock16( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
@@ -734,8 +734,8 @@
hInst = WIN_GetWindowInstance( lpFind->hwndOwner );
if (!(ptr = GlobalLock16( hDlgTmpl ))) return -1;
bRet = CreateDialogIndirectParam16( hInst, ptr, lpFind->hwndOwner,
- MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
- (DWORD)lpFind );
+ (DLGPROC16)MODULE_GetWndProcEntry16("ReplaceTextDlgProc"),
+ (DWORD)lpFind );
GlobalUnlock16( hDlgTmpl );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
@@ -980,10 +980,10 @@
hInst = WIN_GetWindowInstance( lpPrint->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpPrint->hwndOwner,
- (lpPrint->Flags & PD_PRINTSETUP) ?
- MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
- MODULE_GetWndProcEntry16("PrintDlgProc"),
- (DWORD)lpPrint );
+ (DLGPROC16)((lpPrint->Flags & PD_PRINTSETUP) ?
+ MODULE_GetWndProcEntry16("PrintSetupDlgProc") :
+ MODULE_GetWndProcEntry16("PrintDlgProc")),
+ (DWORD)lpPrint );
SYSRES_FreeResource( hDlgTmpl );
return bRet;
}
@@ -1117,8 +1117,8 @@
}
hInst = WIN_GetWindowInstance( lpChCol->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChCol->hwndOwner,
- MODULE_GetWndProcEntry16("ColorDlgProc"),
- (DWORD)lpChCol );
+ (DLGPROC16)MODULE_GetWndProcEntry16("ColorDlgProc"),
+ (DWORD)lpChCol );
if (!(lpChCol->Flags & CC_ENABLETEMPLATEHANDLE))
{
if (lpChCol->Flags & CC_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@@ -1903,7 +1903,7 @@
for (i=0x2bf;i<0x2c5;i++)
SendMessage16(GetDlgItem(hDlg,i),EM_LIMITTEXT,3,0); /* max 3 digits: xyz */
if (CC_HookCallChk(lpp->lpcc))
- res=CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
+ res=CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,WM_INITDIALOG,wParam,lParam);
return res;
}
@@ -2013,7 +2013,7 @@
if (lpp->lpcc->hwndOwner)
SendMessage16(lpp->lpcc->hwndOwner,i,0,(LPARAM)lpp->lpcc);
if (CC_HookCallChk(lpp->lpcc))
- CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,
+ CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,
WM_COMMAND,psh15,(LPARAM)lpp->lpcc);
break;
@@ -2123,7 +2123,7 @@
return FALSE;
res=0;
if (CC_HookCallChk(lpp->lpcc))
- res=CallWindowProc16((FARPROC)lpp->lpcc->lpfnHook,hDlg,message,wParam,lParam);
+ res=CallWindowProc16(lpp->lpcc->lpfnHook,hDlg,message,wParam,lParam);
if (res)
return res;
}
@@ -2198,8 +2198,8 @@
}
hInst = WIN_GetWindowInstance( lpChFont->hwndOwner );
bRet = DialogBoxIndirectParam16( hInst, hDlgTmpl, lpChFont->hwndOwner,
- MODULE_GetWndProcEntry16("FormatCharDlgProc"),
- (DWORD)lpChFont );
+ (DLGPROC16)MODULE_GetWndProcEntry16("FormatCharDlgProc"),
+ (DWORD)lpChFont );
if (!(lpChFont->Flags & CF_ENABLETEMPLATEHANDLE))
{
if (lpChFont->Flags & CF_ENABLETEMPLATE) FreeResource( hDlgTmpl );
@@ -2290,7 +2290,7 @@
{
lplf->lfItalic=fontstyles[i].italic;
lplf->lfWeight=fontstyles[i].weight;
- hf=CreateFontIndirect(lplf);
+ hf=CreateFontIndirect16(lplf);
hf=SelectObject(hdc,hf);
GetTextMetrics16(hdc,lptm);
hf=SelectObject(hdc,hf);
@@ -2698,7 +2698,7 @@
lpxx->lfQuality=DEFAULT_QUALITY;
lpcf->iPointSize= -10*lpxx->lfHeight;
- hFont=CreateFontIndirect(lpxx);
+ hFont=CreateFontIndirect16(lpxx);
if (hFont)
SendDlgItemMessage16(hDlg,stc6,WM_SETFONT,hFont,TRUE);
/* FIXME: Delete old font ...? */
diff --git a/misc/lstr.c b/misc/lstr.c
index e01fb7f..2c811e3 100644
--- a/misc/lstr.c
+++ b/misc/lstr.c
@@ -2,6 +2,7 @@
* String functions
*
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
+ * Copyright 1996 Marcus Meissner
*/
#include <stdio.h>
@@ -17,6 +18,7 @@
#include "stddebug.h"
#include "debug.h"
#include "xmalloc.h"
+#include "string32.h"
#define ToUpper(c) toupper(c)
#define ToLower(c) tolower(c)
@@ -61,25 +63,25 @@
/* Funny to divide them between user and kernel. */
/* IsCharAlpha USER 433 */
-BOOL IsCharAlpha(char ch)
+BOOL16 IsCharAlpha16(CHAR ch)
{
return isalpha(ch); /* This is probably not right for NLS */
}
/* IsCharAlphanumeric USER 434 */
-BOOL IsCharAlphanumeric(char ch)
+BOOL16 IsCharAlphanumeric16(CHAR ch)
{
- return (ch < '0') ? 0 : (ch <= '9');
+ return isalnum(ch);
}
/* IsCharUpper USER 435 */
-BOOL IsCharUpper(char ch)
+BOOL16 IsCharUpper16(CHAR ch)
{
return isupper(ch);
}
/* IsCharLower USER 436 */
-BOOL IsCharLower(char ch)
+BOOL16 IsCharLower16(CHAR ch)
{
return islower(ch);
}
@@ -203,7 +205,7 @@
/* AnsiToOem Keyboard.5 */
-INT AnsiToOem(LPSTR lpAnsiStr, LPSTR lpOemStr)
+INT AnsiToOem(LPCSTR lpAnsiStr, LPSTR lpOemStr)
{
dprintf_keyboard(stddeb, "AnsiToOem: %s\n", lpAnsiStr);
while(*lpAnsiStr){
@@ -214,7 +216,7 @@
}
/* OemToAnsi Keyboard.6 */
-BOOL OemToAnsi(LPSTR lpOemStr, LPSTR lpAnsiStr)
+BOOL OemToAnsi(LPCSTR lpOemStr, LPSTR lpAnsiStr)
{
dprintf_keyboard(stddeb, "OemToAnsi: %s\n", lpOemStr);
while(*lpOemStr){
@@ -233,7 +235,7 @@
}
/* OemToAnsi Keyboard.135 */
-void OemToAnsiBuff(LPSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
+void OemToAnsiBuff(LPCSTR lpOemStr, LPSTR lpAnsiStr, INT nLength)
{
int i;
for(i=0;i<nLength;i++)
@@ -257,3 +259,375 @@
module ? module : "???", buffer );
free( buffer );
}
+
+/***********************************************************************
+ * CharNextA (USER32.28)
+ */
+LPSTR CharNext32A(LPCSTR x)
+{
+ if (*x) return (LPSTR)(x+1);
+ else return (LPSTR)x;
+}
+
+/***********************************************************************
+ * CharNextExA (USER32.29)
+ */
+LPSTR CharNextEx32A(WORD codepage,LPCSTR x,DWORD flags)
+{
+ /* FIXME: add DBCS / codepage stuff */
+ if (*x) return (LPSTR)(x+1);
+ else return (LPSTR)x;
+}
+
+/***********************************************************************
+ * CharNextExW (USER32.30)
+ */
+LPWSTR CharNextEx32W(WORD codepage,LPCWSTR x,DWORD flags)
+{
+ /* FIXME: add DBCS / codepage stuff */
+ if (*x) return (LPWSTR)(x+1);
+ else return (LPWSTR)x;
+}
+
+/***********************************************************************
+ * CharNextW (USER32.31)
+ */
+LPWSTR CharNext32W(LPCWSTR x)
+{
+ if (*x) return (LPWSTR)(x+1);
+ else return (LPWSTR)x;
+}
+
+/***********************************************************************
+ * CharPrevA (USER32.32)
+ */
+LPSTR CharPrev32A(LPCSTR start,LPCSTR x)
+{
+ if (x>start) return (LPSTR)(x-1);
+ else return (LPSTR)x;
+}
+
+/***********************************************************************
+ * CharPrevExA (USER32.33)
+ */
+LPSTR CharPrevEx32A(WORD codepage,LPCSTR start,LPCSTR x,DWORD flags)
+{
+ /* FIXME: add DBCS / codepage stuff */
+ if (x>start) return (LPSTR)(x-1);
+ else return (LPSTR)x;
+}
+
+/***********************************************************************
+ * CharPrevExW (USER32.34)
+ */
+LPWSTR CharPrevEx32W(WORD codepage,LPCWSTR start,LPCWSTR x,DWORD flags)
+{
+ /* FIXME: add DBCS / codepage stuff */
+ if (x>start) return (LPWSTR)(x-1);
+ else return (LPWSTR)x;
+}
+
+/***********************************************************************
+ * CharPrevW (USER32.35)
+ */
+LPWSTR CharPrev32W(LPCWSTR start,LPCWSTR x)
+{
+ if (x>start) return (LPWSTR)(x-1);
+ else return (LPWSTR)x;
+}
+
+/***********************************************************************
+ * CharLowerA (USER32.24)
+ * FIXME: handle current locale
+ */
+LPSTR CharLower32A(LPSTR x)
+{
+ LPSTR s;
+
+ if (HIWORD(x))
+ {
+ s=x;
+ while (*s)
+ {
+ *s=tolower(*s);
+ s++;
+ }
+ return x;
+ }
+ else return (LPSTR)tolower(LOWORD(x));
+}
+
+/***********************************************************************
+ * CharLowerBuffA (USER32.25)
+ * FIXME: handle current locale
+ */
+DWORD CharLowerBuff32A(LPSTR x,DWORD buflen)
+{
+ DWORD done=0;
+
+ while (*x && (buflen--))
+ {
+ *x=tolower(*x);
+ x++;
+ done++;
+ }
+ return done;
+}
+
+/***********************************************************************
+ * CharLowerBuffW (USER32.26)
+ * FIXME: handle current locale
+ */
+DWORD CharLowerBuff32W(LPWSTR x,DWORD buflen)
+{
+ DWORD done=0;
+
+ while (*x && (buflen--))
+ {
+ *x=tolower(*x);
+ x++;
+ done++;
+ }
+ return done;
+}
+
+/***********************************************************************
+ * CharLowerW (USER32.27)
+ * FIXME: handle current locale
+ */
+LPWSTR CharLower32W(LPWSTR x)
+{
+ if (HIWORD(x))
+ {
+ LPWSTR s = x;
+ while (*s)
+ {
+ *s=tolower(*s);
+ s++;
+ }
+ return x;
+ }
+ else return (LPWSTR)tolower(LOWORD(x));
+}
+
+/***********************************************************************
+ * CharUpperA (USER32.40)
+ * FIXME: handle current locale
+ */
+LPSTR CharUpper32A(LPSTR x)
+{
+ if (HIWORD(x))
+ {
+ LPSTR s = x;
+ while (*s)
+ {
+ *s=toupper(*s);
+ s++;
+ }
+ return x;
+ }
+ else return (LPSTR)toupper(LOWORD(x));
+}
+
+/***********************************************************************
+ * CharUpperBuffA (USER32.41)
+ * FIXME: handle current locale
+ */
+DWORD CharUpperBuff32A(LPSTR x,DWORD buflen)
+{
+ DWORD done=0;
+
+ while (*x && (buflen--))
+ {
+ *x=toupper(*x);
+ x++;
+ done++;
+ }
+ return done;
+}
+
+/***********************************************************************
+ * CharUpperBuffW (USER32.42)
+ * FIXME: handle current locale
+ */
+DWORD CharUpperBuff32W(LPWSTR x,DWORD buflen)
+{
+ DWORD done=0;
+
+ while (*x && (buflen--))
+ {
+ *x=toupper(*x);
+ x++;
+ done++;
+ }
+ return done;
+}
+
+/***********************************************************************
+ * CharUpperW (USER32.43)
+ * FIXME: handle current locale
+ */
+LPWSTR CharUpper32W(LPWSTR x)
+{
+ if (HIWORD(x))
+ {
+ LPWSTR s = x;
+ while (*s)
+ {
+ *s=toupper(*s);
+ s++;
+ }
+ return x;
+ }
+ else return (LPWSTR)toupper(LOWORD(x));
+}
+
+/***********************************************************************
+ * IsCharAlphaA (USER32.330)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharAlpha32A(CHAR x)
+{
+ return isalpha(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaNumericA (USER32.331)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharAlphaNumeric32A(CHAR x)
+{
+ return isalnum(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaNumericW (USER32.332)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharAlphaNumeric32W(WCHAR x)
+{
+ return isalnum(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaW (USER32.333)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharAlpha32W(WCHAR x)
+{
+ return isalpha(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaW (USER32.334)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharLower32A(CHAR x)
+{
+ return islower(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaW (USER32.335)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharLower32W(WCHAR x)
+{
+ return islower(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaW (USER32.336)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharUpper32A(CHAR x)
+{
+ return isupper(x);
+}
+
+/***********************************************************************
+ * IsCharAlphaW (USER32.337)
+ * FIXME: handle current locale
+ */
+BOOL32 IsCharUpper32W(WCHAR x)
+{
+ return isupper(x);
+}
+
+/***********************************************************************
+ * CharToOemA (USER32.36)
+ */
+BOOL32 CharToOem32A(LPSTR s,LPSTR d)
+{
+ AnsiToOem(s,d);
+ return TRUE;
+}
+
+/***********************************************************************
+ * CharToOemBuffA (USER32.37)
+ */
+BOOL32 CharToOemBuff32A(LPSTR s,LPSTR d,DWORD len)
+{
+ AnsiToOemBuff(s,d,len);
+ return TRUE;
+}
+
+/***********************************************************************
+ * CharToOemBuffW (USER32.38)
+ */
+BOOL32 CharToOemBuff32W(LPCWSTR s,LPSTR d,DWORD len)
+{
+ LPSTR x=STRING32_DupUniToAnsi(s);
+ AnsiToOemBuff(x,d,len);
+ return TRUE;
+}
+
+/***********************************************************************
+ * CharToOemW (USER32.39)
+ */
+BOOL32 CharToOem32W(LPCWSTR s,LPSTR d)
+{
+ LPSTR x=STRING32_DupUniToAnsi(s);
+ AnsiToOem(x,d);
+ return TRUE;
+}
+
+/***********************************************************************
+ * OemToCharA (USER32.401)
+ */
+BOOL32 OemToChar32A(LPSTR s,LPSTR d)
+{
+ OemToAnsi(s,d);
+ return TRUE;
+}
+
+/***********************************************************************
+ * OemToCharBuffA (USER32.402)
+ */
+BOOL32 OemToCharBuff32A(LPSTR s,LPSTR d,DWORD len)
+{
+ OemToAnsiBuff(s,d,len);
+ return TRUE;
+}
+
+/***********************************************************************
+ * OemToCharBuffW (USER32.403)
+ */
+BOOL32 OemToCharBuff32W(LPCSTR s,LPWSTR d,DWORD len)
+{
+ LPSTR x=(char*)xmalloc(strlen(s));
+ OemToAnsiBuff((LPSTR)s,x,len);
+ STRING32_AnsiToUni(d,x);
+ return TRUE;
+}
+
+/***********************************************************************
+ * OemToCharW (USER32.404)
+ */
+BOOL32 OemToChar32W(LPCSTR s,LPWSTR d)
+{
+ LPSTR x=(char*)xmalloc(strlen(s));
+ OemToAnsi((LPSTR)s,x);
+ STRING32_AnsiToUni(d,x);
+ return TRUE;
+}
diff --git a/misc/lzexpand.c b/misc/lzexpand.c
index 7726d96..45b3655 100644
--- a/misc/lzexpand.c
+++ b/misc/lzexpand.c
@@ -25,7 +25,6 @@
#define strdupW2A(x) STRING32_DupUniToAnsi(x)
#define strdupA2W(x) STRING32_DupAnsiToUni(x)
-#define strcpyWA(a,b) STRING32_UniToAnsi(a,b)
#define strcpyAW(a,b) STRING32_AnsiToUni(a,b)
/* The readahead length of the decompressor. Reading single bytes
@@ -470,6 +469,23 @@
#undef BUFLEN
}
+/* reverses GetExpandedPathname */
+static LPSTR LZEXPAND_MangleName( LPCSTR fn )
+{
+ char *p;
+ char *mfn = (char *)xmalloc( strlen(fn) + 3 ); /* "._" and \0 */
+ strcpy( mfn, fn );
+ if (!(p = strrchr( mfn, '\\' ))) p = mfn;
+ if ((p = strchr( p, '.' )))
+ {
+ p++;
+ if (strlen(p) < 3) strcat( p, "_" ); /* append '_' */
+ else p[strlen(p)-1] = '_'; /* replace last character */
+ }
+ else strcat( mfn, "._" ); /* append "._" */
+ return mfn;
+}
+
/*
* LZOpenFile [LZEXPAND.2]
* Opens a file. If not compressed, open it as a normal file.
@@ -481,6 +497,12 @@
dprintf_file(stddeb,"LZOpenFile(%s,%p,%d)\n",fn,ofs,mode);
/* 0x70 represents all OF_SHARE_* flags, ignore them for the check */
fd=OpenFile(fn,ofs,mode);
+ if (fd==HFILE_ERROR)
+ {
+ LPSTR mfn = LZEXPAND_MangleName(fn);
+ fd = OpenFile(mfn,ofs,mode);
+ free( mfn );
+ }
if ((mode&~0x70)!=OF_READ)
return fd;
if (fd==HFILE_ERROR)
diff --git a/misc/main.c b/misc/main.c
index 2e01aa0..34dbccc 100644
--- a/misc/main.c
+++ b/misc/main.c
@@ -17,7 +17,6 @@
#include <X11/Xresource.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
-#include "wine.h"
#include "message.h"
#include "module.h"
#include "msdos.h"
@@ -25,6 +24,7 @@
#include "winsock.h"
#include "options.h"
#include "desktop.h"
+#include "registers.h"
#include "shell.h"
#include "winbase.h"
#include "string32.h"
@@ -1021,9 +1021,6 @@
XKeyboardControl keyboard_value;
- fprintf(stderr, "SystemParametersInfo: action %d, param %x, flag %x\n",
- uAction, uParam, fuWinIni);
-
switch (uAction) {
case SPI_GETBEEP:
XGetKeyboardControl(display, &keyboard_state);
diff --git a/misc/ole2disp.c b/misc/ole2disp.c
index e738adc..69a08bf 100644
--- a/misc/ole2disp.c
+++ b/misc/ole2disp.c
@@ -6,8 +6,7 @@
#include "windows.h"
#include "ole2.h"
-#include "global.h"
-#include "local.h"
+#include "heap.h"
#include "ldt.h"
#include "stddebug.h"
#include "debug.h"
@@ -17,39 +16,21 @@
as ISO-8859 */
typedef DWORD BSTR;
-HGLOBAL BSTRheapsel=0;
-#define BSTR_HEAP_SIZE 65536
static BSTR BSTR_AllocBytes(int n)
{
- HLOCAL16 mem;
- if(!BSTRheapsel)
- {
- BSTRheapsel=GlobalAlloc16(GMEM_FIXED,BSTR_HEAP_SIZE);
- LocalInit(BSTRheapsel,0,BSTR_HEAP_SIZE-1);
- }
- if(!BSTRheapsel)
- return 0;
- mem=LOCAL_Alloc(BSTRheapsel,LMEM_FIXED,n);
-#ifdef WINELIB32
- return (BSTR)mem;
-#else
- return mem ? MAKELONG(mem,BSTRheapsel) : 0;
-#endif
+ void *ptr = SEGPTR_ALLOC(n);
+ return SEGPTR_GET(ptr);
}
static void BSTR_Free(BSTR in)
{
-#ifdef WINELIB32
- LOCAL_Free(BSTRheapsel, (HANDLE)in);
-#else
- LOCAL_Free(BSTRheapsel, LOWORD(in));
-#endif
+ SEGPTR_FREE( PTR_SEG_TO_LIN(in) );
}
static void* BSTR_GetAddr(BSTR in)
{
- return in ? PTR_SEG_TO_LIN(in) : 0;
+ return in ? PTR_SEG_TO_LIN(in) : 0;
}
/***********************************************************************
diff --git a/misc/ole2nls.c b/misc/ole2nls.c
index 110fa55..5a59bc32 100644
--- a/misc/ole2nls.c
+++ b/misc/ole2nls.c
@@ -24,16 +24,16 @@
switch(Options.language)
{
case LANG_En: return 0x09;
- case LANG_Es: return 0x07; /* Just a Guess :-) */
+ case LANG_Es: return 0x0a;
case LANG_De: return 0x07;
case LANG_No: return 0x14;
- case LANG_Fr:
- case LANG_Fi:
- case LANG_Da:
- case LANG_Cz:
- case LANG_Eo:
- case LANG_It:
- case LANG_Ko:
+ case LANG_Fr: return 0x0c;
+ case LANG_Fi: return 0x0b;
+ case LANG_Da: return 0x06;
+ case LANG_Cz: return 0x05;
+ case LANG_Eo: return 0x25; /* not official */
+ case LANG_It: return 0x10;
+ case LANG_Ko: return 0x12;
default:
return 0; /* Neutral language */
}
@@ -525,7 +525,130 @@
/* LOCVAL(LOCALE_INEGSYMPRECEDES) */
/* LOCVAL(LOCALE_INEGSEPBYSPACE) */
break; /* LANG(Eo) */
-
+
+ case LANG_Fi:
+LOCVAL(LOCALE_ILANGUAGE,"11")
+LOCVAL(LOCALE_SLANGUAGE,"Suomi")
+LOCVAL(LOCALE_SENGLANGUAGE,"Finnish")
+LOCVAL(LOCALE_SABBREVLANGNAME,"fin")
+LOCVAL(LOCALE_SNATIVELANGNAME,"suomi")
+LOCVAL(LOCALE_ICOUNTRY,"49")
+LOCVAL(LOCALE_SCOUNTRY,"Suomi")
+LOCVAL(LOCALE_SENGCOUNTRY,"Finland")
+LOCVAL(LOCALE_SABBREVCTRYNAME,"Fin")
+LOCVAL(LOCALE_SNATIVECTRYNAME,"Suomi")
+LOCVAL(LOCALE_IDEFAULTLANGUAGE,"11")
+LOCVAL(LOCALE_IDEFAULTCOUNTRY,"358")
+/*
+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,"mk")
+/*
+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,"maanantai")
+LOCVAL(LOCALE_SDAYNAME2,"tiistai")
+LOCVAL(LOCALE_SDAYNAME3,"keskiviikko")
+LOCVAL(LOCALE_SDAYNAME4,"torstai")
+LOCVAL(LOCALE_SDAYNAME5,"perjantai")
+LOCVAL(LOCALE_SDAYNAME6,"lauantai")
+LOCVAL(LOCALE_SDAYNAME7,"sunnuntai")
+LOCVAL(LOCALE_SABBREVDAYNAME1,"Ma")
+LOCVAL(LOCALE_SABBREVDAYNAME2,"Ti")
+LOCVAL(LOCALE_SABBREVDAYNAME3,"Ke")
+LOCVAL(LOCALE_SABBREVDAYNAME4,"To")
+LOCVAL(LOCALE_SABBREVDAYNAME5,"Pe")
+LOCVAL(LOCALE_SABBREVDAYNAME6,"La")
+LOCVAL(LOCALE_SABBREVDAYNAME7,"Su")
+LOCVAL(LOCALE_SMONTHNAME1,"tammikuu")
+LOCVAL(LOCALE_SMONTHNAME2,"helmikuu")
+LOCVAL(LOCALE_SMONTHNAME3,"maaliskuu")
+LOCVAL(LOCALE_SMONTHNAME4,"huhtikuu")
+LOCVAL(LOCALE_SMONTHNAME5,"toukokuu")
+LOCVAL(LOCALE_SMONTHNAME6,"kesäkuu")
+LOCVAL(LOCALE_SMONTHNAME7,"heinäkuu")
+LOCVAL(LOCALE_SMONTHNAME8,"elokuu")
+LOCVAL(LOCALE_SMONTHNAME9,"syyskuu")
+LOCVAL(LOCALE_SMONTHNAME10,"lokakuu")
+LOCVAL(LOCALE_SMONTHNAME11,"marraskuu")
+LOCVAL(LOCALE_SMONTHNAME12,"joulukuu")
+LOCVAL(LOCALE_SMONTHNAME13,"")
+LOCVAL(LOCALE_SABBREVMONTHNAME1,"tammi")
+LOCVAL(LOCALE_SABBREVMONTHNAME2,"helmi")
+LOCVAL(LOCALE_SABBREVMONTHNAME3,"maalis")
+LOCVAL(LOCALE_SABBREVMONTHNAME4,"huhti")
+LOCVAL(LOCALE_SABBREVMONTHNAME5,"touko")
+LOCVAL(LOCALE_SABBREVMONTHNAME6,"kesä")
+LOCVAL(LOCALE_SABBREVMONTHNAME7,"heinä")
+LOCVAL(LOCALE_SABBREVMONTHNAME8,"elo")
+LOCVAL(LOCALE_SABBREVMONTHNAME9,"syys")
+LOCVAL(LOCALE_SABBREVMONTHNAME10,"loka")
+LOCVAL(LOCALE_SABBREVMONTHNAME11,"marras")
+LOCVAL(LOCALE_SABBREVMONTHNAME12,"joulu")
+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(Fi) */
+
case LANG_It:
LOCVAL(LOCALE_ILANGUAGE,"9")
LOCVAL(LOCALE_SLANGUAGE,"Italiano")
@@ -671,11 +794,21 @@
/***********************************************************************
- * CompareStringA (OLE2NLS.8)
- * This implementation ignores the locale, and trusts in libc
+ * CompareString16 (OLE2NLS.8)
*/
-int CompareStringA(DWORD lcid, DWORD fdwStyle,
- char *s1, int l1, char *s2,int l2)
+UINT16 CompareString16(DWORD lcid,DWORD fdwStyle,
+ LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2)
+{
+ return (UINT16)CompareString32A(lcid,fdwStyle,s1,l1,s2,l2);
+}
+
+/***********************************************************************
+ * CompareString32A (KERNEL32.29)
+ * This implementation ignores the locale
+ * FIXME
+ */
+UINT32 CompareString32A(DWORD lcid, DWORD fdwStyle,
+ LPCSTR s1, DWORD l1, LPCSTR s2,DWORD l2)
{
int len,ret;
if(fdwStyle & NORM_IGNORENONSPACE)
@@ -700,6 +833,35 @@
}
/***********************************************************************
+ * CompareString32W (KERNEL32.30)
+ * This implementation ignores the locale
+ * FIXME
+ */
+UINT32 CompareString32W(DWORD lcid, DWORD fdwStyle,
+ LPCWSTR s1, DWORD l1, LPCWSTR s2,DWORD l2)
+{
+ int len,ret;
+ if(fdwStyle & NORM_IGNORENONSPACE)
+ fprintf(stdnimp,"CompareStringW:IGNORENONSPACE not supprted\n");
+ if(fdwStyle & NORM_IGNORESYMBOLS)
+ fprintf(stdnimp,"CompareStringW:IGNORESYMBOLS not supported\n");
+
+ /* Is strcmp defaulting to string sort or to word sort?? */
+ /* FIXME: Handle NORM_STRINGSORT */
+ l1 = (l1==-1)?lstrlen32W(s1):l1;
+ l2 = (l2==-1)?lstrlen32W(s2):l2;
+ len = l1<l2 ? l1:l2;
+ ret = (fdwStyle & NORM_IGNORECASE) ?
+ lstrncmpi32W(s1,s2,len) : lstrncmp32W(s1,s2,len);
+ /* not equal, return 1 or 3 */
+ if(ret!=0) return ret+2;
+ /* same len, return 2 */
+ if(l1==l2) return 2;
+ /* the longer one is lexically greater */
+ return (l1<l2)? 1 : 3;
+}
+
+/***********************************************************************
* SetLocalInfoA (KERNEL32.499)
*/
BOOL SetLocaleInfoA(DWORD lcid, DWORD lctype, LPCSTR data) {
diff --git a/misc/port.c b/misc/port.c
index 165a6df..ef3b3d7 100644
--- a/misc/port.c
+++ b/misc/port.c
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <sys/time.h>
#ifndef HAVE_USLEEP
@@ -9,7 +10,7 @@
delay.tv_sec = 0;
delay.tv_usec = useconds;
- (void) select (0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &delay);
+ select( 0, 0, 0, 0, &delay );
return 0;
}
diff --git a/misc/shell.c b/misc/shell.c
index a8eb3f9..1025acb 100644
--- a/misc/shell.c
+++ b/misc/shell.c
@@ -140,7 +140,9 @@
}
/* First thing we need is the file's extension */
- extension = strchr( lpFile, '.' ); /* Assumes first "." is the one... */
+ extension = strrchr( lpFile, '.' ); /* Assume last "." is the one; */
+ /* File->Run in progman uses */
+ /* .\FILE.EXE :( */
if ((extension == NULL) || (extension == &lpFile[strlen(lpFile)]))
{
return 31; /* no association */
@@ -179,7 +181,10 @@
dprintf_exec(stddeb, "SHELL_FindExecutable: found %s\n",
lpResult);
return 33; /* Greater than 32 to indicate success FIXME */
- /* what are the correct values here? */
+ /* According to the docs, I should be returning */
+ /* a handle for the executable. Does this mean */
+ /* I'm supposed to open the executable file or */
+ /* something? More RTFM, I guess... */
}
tok=strtok(NULL, " \t");
}
@@ -320,11 +325,7 @@
switch(msg) {
case WM_INITDIALOG:
-#ifdef WINELIB32
SendDlgItemMessage32A(hWnd,stc1,STM_SETICON,lParam,0);
-#else
- SendDlgItemMessage16(hWnd,stc1,STM_SETICON,LOWORD(lParam),0);
-#endif
GetWindowText32A(hWnd, Template, sizeof(Template));
sprintf(AppTitle, Template, AppName);
SetWindowText32A(hWnd, AppTitle);
diff --git a/misc/spy.c b/misc/spy.c
index 8425ad9..1681c9e 100644
--- a/misc/spy.c
+++ b/misc/spy.c
@@ -461,7 +461,7 @@
case SPY_SENDMESSAGE32:
{
char taskName[30];
- HTASK hTask = GetWindowTask(hWnd);
+ HTASK hTask = GetWindowTask16(hWnd);
if (hTask == GetCurrentTask()) strcpy( taskName, "self" );
else if (!hTask) strcpy( taskName, "Wine" );
else sprintf( taskName, "task %04x %s",
diff --git a/misc/user.c b/misc/user.c
index 8976d77..eadf06b 100644
--- a/misc/user.c
+++ b/misc/user.c
@@ -19,7 +19,6 @@
WORD USER_HeapSel = 0;
-#ifndef WINELIB
extern HTASK TASK_GetNextTask(HTASK);
extern void QUEUE_SetDoomedQueue(HQUEUE);
@@ -62,7 +61,7 @@
/***********************************************************************
* SystemHeapInfo (TOOLHELP.71)
*/
-BOOL SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
+BOOL16 SystemHeapInfo( SYSHEAPINFO *pHeapInfo )
{
pHeapInfo->wUserFreePercent = GetFreeSystemResources( GFSR_USERRESOURCES );
pHeapInfo->wGDIFreePercent = GetFreeSystemResources( GFSR_GDIRESOURCES );
@@ -71,7 +70,6 @@
return TRUE;
}
-#endif /* WINELIB */
/***********************************************************************
* TimerCount (TOOLHELP.80)