Release 970804
Sun Aug 3 14:03:43 1997 Alexandre Julliard <julliard@lrc.epfl.ch>
* [documentation/Makefile.in]
Create links for files included from wine.texinfo.
* [wine.man]
Moved to documentation dir.
* [if1632/builtin.c]
Made SYSTEM.DLL always loaded by default.
* [loader/signal.c] [if1632/signal.c]
Split signal.c in generic/emulator-specific parts.
* [misc/system.c] [if1632/thunk.c]
Implemented system timer functions.
Fixed InquireSystem parameters.
* [msdos/ioports.c]
Defined inb/outb functions to avoid including asm/io.h.
Use the right instruction for word and dword direct access.
* [multimedia/mmsystem.c]
Fixed CallTo16 usage.
Sat Aug 2 13:05:23 1997 Andreas Mohr <100.30936@germany.net>
* [controls/edit.c]
When text is inserted into a newly created editline, the caret
is placed after the text. Should be placed before the text. Fixed.
* [files/file.c]
Removed O_TRUNC flag from OF_WRITE mode in _lopen32().
According to doc _lopen() never truncates files.
* [if1632/user.spec] [misc/comm.c]
Added stub for EnableCommNotification().
* [misc/ver.c]
Fixed problem with VerQueryValue*() running over end of name table
in rare cases.
* [msdos/int21.c]
Enhanced ioctlGetDeviceInfo() to correctly return the current drive.
* [multimedia/joystick.c] [windows/message.c]
Added joystick support !!!
Needs Linux >= 2.1.45 or joystick-0.8.0.tar.gz.
Fri Aug 1 18:02:09 1997 Morten Welinder <terra@diku.dk>
* [if1632/user32.spec]
Define DrawAnimatedRects32.
* [graphics/painting.c]
(DrawAnimatedRects32): Create stub.
* [misc/registry.c]
Cope with NULL class in RegQueryInfoKey32A.
* [if1632/user32.spec]
Add GetMenuItemInfo32[AW].
* [controls/menu.c]
(InsertMenu32A): Upgrade flags to 8 hex-digits.
(MENUEX_ParseResource): First shot at implementation.
(LoadMenuIndirect32A): Handle extended menus.
(GetMenuItemInfo32[AW]): First shot at implementation.
* [include/windows.h]
Define MFT_*, MFS_*, MIIM_* macros. Define MENUITEMINFO[AW]
structures and pointers.
* [Makefile.in]
(etags): Add TAGS as target.
* [if1632/comctl32.spec]
Use Windows 95's ordinals. Add a few missing stubs.
Thu Jul 31 14:01:13 1997 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [objects/color.c]
Fix for 16 color mode of XFree.
* [if1632/kernel32.spec][win32/ordinals.c]
Moved/added some ordinal only exported functions from kernel32.dll
(mostly thunking preparation stuff).
Wed Jul 30 09:16:38 1997 John Harvey <john@division.co.uk>
* [graphics/win16drv/init.c] [include/win16drv.h]
Escape(SETABORTPROC) returns success to keep pbrush.exe happy.
Escape(NEXTBAND) implemented to make HP PCL printer driver work in
word. Stub for PATBLT added to start work on printing more than
text.
Mon Jul 28 13:14:28 1997 Victor Schneider <vischne@ibm.net>
* [libtest/expand.c]
New Winelib test program.
Wed Jul 23 09:37:13 1997 Adrian Harvey <adrian@select.com.au>
* [tools/build.c] [tools/build-spec.txt] [if1632/kernel.spec]
[if1632/user.spec]
Added ability to set filename wine considers the built-in DLLs
to be in to something other than name.DLL with new "file" key
in .spec files.
Made kernel filename KRNL386.EXE (some programs use this name
explicitly - ChemOffice install now starts up).
Made user filename USER.EXE (just to be tidy).
Sun Jul 20 23:51:02 1997 David A. Cuthbert <dacut@henry.ece.cmu.edu>
* [controls/menu.c] [misc/tweak.c] [include/tweak.h]
Fixed MENU_KeyLeft and MENU_KeyRight to handle multiple-column
menus. Misc menu drawing issues for Win95 tweaks fixed. Misc
warnings fixed.
* [loader/module.c]
Spaces are now permitted in file/path names on the command line.
If multiple matches can be made, the preferred match is the
path/file with fewer spaces.
Tue Jul 29 02:21:15 1997 Bruce Milner <Bruce.Milner@genetics.utah.edu>
* [misc/compobj.c]
Added CLSIDFromString and StringFromCLSID.
diff --git a/misc/comm.c b/misc/comm.c
index 36d3f7e..d119200 100644
--- a/misc/comm.c
+++ b/misc/comm.c
@@ -407,7 +407,7 @@
port = device[3] - '0';
if (port-- == 0) {
- fprintf(stderr, "comm: BUG ! COM0 doesn't exists!.\n");
+ fprintf(stderr, "comm: BUG ! COM0 doesn't exist !\n");
commerror = IE_BADID;
}
@@ -738,18 +738,27 @@
unsigned long cnt;
int rc;
- lpStat->status = 0;
+ if (lpStat) {
+ lpStat->status = 0;
- rc = ioctl(fd, TIOCOUTQ, &cnt);
- lpStat->cbOutQue = cnt;
+ rc = ioctl(fd, TIOCOUTQ, &cnt);
+ if (rc) fprintf(stderr, "Error !\n");
+ lpStat->cbOutQue = cnt;
- rc = ioctl(fd, TIOCINQ, &cnt);
- lpStat->cbInQue = cnt;
+ rc = ioctl(fd, TIOCINQ, &cnt);
+ if (rc) fprintf(stderr, "Error !\n");
+ lpStat->cbInQue = cnt;
- dprintf_comm(stddeb,
- "GetCommError: fd %d, error %d, lpStat %d %d %d\n",
- fd, commerror,
- lpStat->status, lpStat->cbInQue, lpStat->cbOutQue);
+ dprintf_comm(stddeb,
+ "GetCommError: fd %d, error %d, lpStat %d %d %d\n",
+ fd, commerror,
+ lpStat->status, lpStat->cbInQue, lpStat->cbOutQue);
+ }
+ else
+ dprintf_comm(stddeb,
+ "GetCommError: fd %d, error %d, lpStat NULL\n",
+ fd, commerror);
+
/*
* [RER] I have no idea what the following is trying to accomplish.
* [RER] It is certainly not what the reference manual suggests.
@@ -1652,7 +1661,7 @@
* GetCommTimeouts (KERNEL32.160)
*/
BOOL32 GetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts) {
- dprintf_comm(stddeb,"GetCommTimeouts(%x,%p), empty stub.\n",
+ fprintf(stderr,"GetCommTimeouts(%x,%p), empty stub.\n",
fd,lptimeouts
);
return TRUE;
@@ -1662,8 +1671,19 @@
* SetCommTimeouts (KERNEL32.453)
*/
BOOL32 SetCommTimeouts(INT32 fd,LPCOMMTIMEOUTS lptimeouts) {
- dprintf_comm(stddeb,"SetCommTimeouts(%x,%p), empty stub.\n",
+ fprintf(stderr,"SetCommTimeouts(%x,%p), empty stub.\n",
fd,lptimeouts
);
return TRUE;
}
+
+/***********************************************************************
+ * EnableCommNotification (USER.246)
+ */
+BOOL16 EnableCommNotification( INT16 fd, HWND16 hwnd, INT16 cbWriteNotify,
+ INT16 cbOutQueue )
+{
+ fprintf(stderr, "EnableCommNotification(%d, %x, %d, %d), empty stub.\n", fd, hwnd, cbWriteNotify, cbOutQueue);
+ return TRUE;
+}
+
diff --git a/misc/compobj.c b/misc/compobj.c
index c7c76a2..45decf8 100644
--- a/misc/compobj.c
+++ b/misc/compobj.c
@@ -7,10 +7,14 @@
/* At the moment, these are only empty stubs.
*/
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "ole.h"
#include "ole2.h"
#include "stddebug.h"
#include "debug.h"
+#include "compobj.h"
DWORD currentMalloc=0;
@@ -66,3 +70,109 @@
dprintf_ole(stdnimp,"CoDisconnectObject:%p %lx\n",lpUnk,reserved);
return OLE_OK;
}
+
+/***********************************************************************
+ * CLSIDFromString [COMPOBJ.20]
+ */
+
+/* Class id: DWORD-WORD-WORD-BYTES[2]-BYTES[6] */
+
+OLESTATUS
+CLSIDFromString(const LPCSTR idstr, CLSID *id)
+{
+ BYTE *s = (BYTE *) idstr;
+ BYTE *p;
+ int i;
+ BYTE table[256];
+
+ dprintf_ole(stddeb,"ClsIDFromString() %s -> %p\n", idstr, id);
+
+ /* quick lookup table */
+ memset(table, 0, 256);
+
+ for (i = 0; i < 10; i++) {
+ table['0' + i] = i;
+ }
+ for (i = 0; i < 6; i++) {
+ table['A' + i] = i+10;
+ table['a' + i] = i+10;
+ }
+
+ /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */
+
+ if (strlen(idstr) != 38)
+ return OLE_ERROR_OBJECT;
+
+ p = (BYTE *) id;
+
+ s++; /* skip leading brace */
+ for (i = 0; i < 4; i++) {
+ p[3 - i] = table[*s]<<4 | table[*(s+1)];
+ s += 2;
+ }
+ p += 4;
+ s++; /* skip - */
+
+ for (i = 0; i < 2; i++) {
+ p[1-i] = table[*s]<<4 | table[*(s+1)];
+ s += 2;
+ }
+ p += 2;
+ s++; /* skip - */
+
+ for (i = 0; i < 2; i++) {
+ p[1-i] = table[*s]<<4 | table[*(s+1)];
+ s += 2;
+ }
+ p += 2;
+ s++; /* skip - */
+
+ /* these are just sequential bytes */
+ for (i = 0; i < 2; i++) {
+ *p++ = table[*s]<<4 | table[*(s+1)];
+ s += 2;
+ }
+ s++; /* skip - */
+
+ for (i = 0; i < 6; i++) {
+ *p++ = table[*s]<<4 | table[*(s+1)];
+ s += 2;
+ }
+
+ return OLE_OK;
+}
+
+/***********************************************************************
+ * CLSIDFromString [COMPOBJ.19]
+ */
+
+OLESTATUS
+StringFromCLSID(const CLSID *id, LPSTR idstr)
+{
+ static const char *hex = "0123456789ABCDEF";
+ char *s;
+ int i;
+
+ sprintf(idstr, "{%08lx-%04x-%04x-%2x%2x-",
+ id->Data1, id->Data2, id->Data3,
+ id->Data4[0], id->Data4[1]);
+ s = &idstr[25];
+
+ /* 6 hex bytes */
+ for (i = 2; i < 8; i++) {
+ *s++ = hex[id->Data4[i]>>4];
+ *s++ = hex[id->Data4[i] & 0xf];
+ }
+
+ *s++ = '}';
+ *s++ = '\0';
+
+ for (i = strlen(idstr)-1; i >= 0; i--) {
+ idstr[i] = toupper(idstr[i]);
+ }
+
+ dprintf_ole(stddeb,"StringFromClsID: %p->%s\n", id, idstr);
+
+ return OLE_OK;
+}
+
diff --git a/misc/registry.c b/misc/registry.c
index 2719bd3..791e5db 100644
--- a/misc/registry.c
+++ b/misc/registry.c
@@ -26,8 +26,6 @@
#include "xmalloc.h"
#include "winreg.h"
-#define MAKE_DWORD(x,y) ((DWORD)MAKELONG(x,y))
-
/* FIXME: following defines should be configured global ... */
/* NOTE: do not append a /. linux' mkdir() WILL FAIL if you do that */
@@ -275,6 +273,7 @@
RegCreateKey16(HKEY_DYN_DATA,"\\PerfStats\\StatData",&xhkey);
RegCloseKey(xhkey);
+ xhkey = 0;
RegCreateKey16(HKEY_LOCAL_MACHINE,"\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor",&hkey);
#ifdef linux
F=fopen("/proc/cpuinfo","r");
@@ -392,7 +391,7 @@
if (escapeeq && *s=='=')
doescape = 1;
if (*s=='\\')
- fputc(*s,F); /* if \\ than put it twice. */
+ fputc(*s,F); /* if \\ then put it twice. */
if (doescape)
fprintf(F,"\\u%04x",*((unsigned short*)s));
else
@@ -3000,7 +2999,7 @@
lpcbSecurityDescriptor,
ft
);
- if (ret==ERROR_SUCCESS)
+ if (ret==ERROR_SUCCESS && lpszClass)
lstrcpyWtoA(lpszClass,lpszClassW);
if (lpcchClass)
*lpcchClass/=2;
diff --git a/misc/system.c b/misc/system.c
index aaeeae5..dee79bd 100644
--- a/misc/system.c
+++ b/misc/system.c
@@ -5,29 +5,187 @@
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/timeb.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
#include "windows.h"
+#include "miscemu.h"
+
+typedef struct
+{
+ FARPROC16 callback; /* NULL if not in use */
+ INT32 rate;
+ INT32 ticks;
+} SYSTEM_TIMER;
+
+#define NB_SYS_TIMERS 8
+#define SYS_TIMER_RATE 54925
+
+static SYSTEM_TIMER SYS_Timers[NB_SYS_TIMERS];
+static int SYS_NbTimers = 0;
+static BOOL32 SYS_TimersDisabled = FALSE;
+
+/***********************************************************************
+ * SYSTEM_TimerTick
+ */
+static void SYSTEM_TimerTick(void)
+{
+ int i;
+
+ for (i = 0; i < NB_SYS_TIMERS; i++)
+ {
+ if (!SYS_Timers[i].callback) continue;
+ if ((SYS_Timers[i].ticks -= SYS_TIMER_RATE) <= 0)
+ {
+ SYS_Timers[i].ticks += SYS_Timers[i].rate;
+ SYS_Timers[i].callback();
+ }
+ }
+}
+
+
+/**********************************************************************
+ * SYSTEM_StartTicks
+ *
+ * Start the system tick timer.
+ */
+static void SYSTEM_StartTicks(void)
+{
+ static BOOL32 handler_installed = FALSE;
+
+ if (!handler_installed)
+ {
+ handler_installed = TRUE;
+ SIGNAL_SetHandler( SIGALRM, SYSTEM_TimerTick, 1 );
+ }
+#ifndef __EMX__ /* FIXME: Time don't work... Use BIOS directly instead */
+ {
+ 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
+}
+
+
+/**********************************************************************
+ * SYSTEM_StopTicks
+ *
+ * Stop the system tick timer.
+ */
+static void SYSTEM_StopTicks(void)
+{
+#ifndef __EMX__ /* FIXME: Time don't work... Use BIOS directly instead */
+ struct itimerval vt_timer;
+
+ vt_timer.it_interval.tv_sec = 0;
+ vt_timer.it_interval.tv_usec = 0;
+ vt_timer.it_value = vt_timer.it_interval;
+ setitimer( ITIMER_REAL, &vt_timer, NULL );
+#endif
+}
/***********************************************************************
* InquireSystem (SYSTEM.1)
- */
-DWORD InquireSystem( WORD code, WORD drive, BOOL16 enable )
+ *
+ * Note: the function always takes 2 WORD arguments, contrary to what
+ * "Undocumented Windows" says.
+ */
+DWORD InquireSystem( WORD code, WORD arg )
{
WORD drivetype;
switch(code)
{
case 0: /* Get timer resolution */
- return 54925;
+ return SYS_TIMER_RATE;
case 1: /* Get drive type */
- drivetype = GetDriveType16( drive );
+ drivetype = GetDriveType16( arg );
return MAKELONG( drivetype, drivetype );
case 2: /* Enable one-drive logic */
- fprintf( stderr, "InquireSystem(2): set single-drive %d not supported\n", enable );
+ fprintf( stderr, "InquireSystem(2): set single-drive %d not supported\n", arg );
return 0;
}
fprintf( stderr, "InquireSystem: unknown code %d\n", code );
return 0;
}
+
+
+/***********************************************************************
+ * CreateSystemTimer (SYSTEM.2)
+ */
+WORD CreateSystemTimer( WORD rate, FARPROC16 callback )
+{
+ int i;
+
+ for (i = 0; i < NB_SYS_TIMERS; i++)
+ if (!SYS_Timers[i].callback) /* Found one */
+ {
+ SYS_Timers[i].rate = (UINT32)rate * 1000;
+ if (SYS_Timers[i].rate < SYS_TIMER_RATE)
+ SYS_Timers[i].rate = SYS_TIMER_RATE;
+ SYS_Timers[i].ticks = SYS_Timers[i].rate;
+ SYS_Timers[i].callback = callback;
+ if ((++SYS_NbTimers == 1) && !SYS_TimersDisabled)
+ SYSTEM_StartTicks();
+ return i + 1; /* 0 means error */
+ }
+ return 0;
+}
+
+
+/***********************************************************************
+ * KillSystemTimer (SYSTEM.3)
+ *
+ * Note: do not confuse this function with USER.182
+ */
+WORD SYSTEM_KillSystemTimer( WORD timer )
+{
+ if (!timer || (timer > NB_SYS_TIMERS)) return timer; /* Error */
+ SYS_Timers[timer-1].callback = NULL;
+ if ((!--SYS_NbTimers) && !SYS_TimersDisabled) SYSTEM_StopTicks();
+ return 0;
+}
+
+
+/***********************************************************************
+ * EnableSystemTimers (SYSTEM.4)
+ */
+void EnableSystemTimers(void)
+{
+ SYS_TimersDisabled = FALSE;
+ if (SYS_NbTimers) SYSTEM_StartTicks();
+}
+
+
+/***********************************************************************
+ * DisableSystemTimers (SYSTEM.5)
+ */
+void DisableSystemTimers(void)
+{
+ SYS_TimersDisabled = TRUE;
+ if (SYS_NbTimers) SYSTEM_StopTicks();
+}
+
+
+/***********************************************************************
+ * SYSTEM_GetTimerProc
+ *
+ * Return the timer proc of a system timer. Used by thunking code.
+ */
+FARPROC16 SYSTEM_GetTimerProc( WORD timer )
+{
+ if (!timer || (timer > NB_SYS_TIMERS)) return NULL;
+ return SYS_Timers[timer-1].callback;
+}
diff --git a/misc/tweak.c b/misc/tweak.c
index a9118d5..e8f0095 100644
--- a/misc/tweak.c
+++ b/misc/tweak.c
@@ -410,16 +410,19 @@
/******************************************************************************
*
- * void TWEAK_DrawMenuSeparator95(
+ * void TWEAK_DrawRevReliefRect95(
* HDC32 hdc, // Device context on which to draw
- * UINT32 xc1, // Left x-coordinate
- * UINT32 yc, // Y-coordinate of the LOWER line
- * UINT32 xc2 ) // Right x-coordinate
+ * RECT32 const *rect ) // Rectangle to use
*
- * Draws the menu separator bar Win 95 style.
+ * Draws the double-bordered Win95-style relief rectangle.
*
* Bugs
- * Same as those for DrawReliefRect95.
+ * There are some checks missing from this function. Perhaps the
+ * SelectObject32 calls should be examined? Hasn't failed on me (yet).
+ *
+ * Should I really be calling X functions directly from here? It is
+ * an optimization, but should I be optimizing alpha code? Probably
+ * not.
*
* Revision history
* 08-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
@@ -427,7 +430,76 @@
*
*****************************************************************************/
-void TWEAK_DrawMenuSeparator95(
+void TWEAK_DrawRevReliefRect95(
+ HDC32 hdc,
+ RECT32 const *rect )
+{
+ DC *dc;
+ HPEN32 prevpen;
+
+ if((dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC))) {
+
+ /* Draw the top/left lines first */
+ prevpen = SelectObject32(hdc, TWEAK_Pen8095);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left, rect->top,
+ rect->right - 1, rect->top);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left, rect->top,
+ rect->left, rect->bottom - 1);
+
+ SelectObject32(hdc, TWEAK_Pen0095);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left + 1,
+ rect->top + 1, rect->right - 2, rect->top + 1);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left + 1,
+ rect->top + 1, rect->left + 1, rect->bottom - 2);
+
+
+ /* Now the bottom/right lines */
+ SelectObject32(hdc, TWEAK_PenFF95);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left,
+ rect->bottom - 1, rect->right - 1, rect->bottom - 1);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->right - 1,
+ rect->top, rect->right - 1, rect->bottom - 1);
+
+ SelectObject32(hdc, TWEAK_PenE095);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->left + 1,
+ rect->bottom - 2, rect->right - 2, rect->bottom - 2);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, rect->right - 2,
+ rect->top + 1, rect->right - 2, rect->bottom - 2);
+
+ SelectObject32(hdc, prevpen);
+ }
+
+ return;
+}
+
+
+
+/******************************************************************************
+ *
+ * void TWEAK_DrawMenuSeparatorHoriz95(
+ * HDC32 hdc, // Device context on which to draw
+ * UINT32 xc1, // Left x-coordinate
+ * UINT32 yc, // Y-coordinate of the LOWER line
+ * UINT32 xc2 ) // Right x-coordinate
+ *
+ * Draws a horizontal menu separator bar Win 95 style.
+ *
+ * Bugs
+ * Same as those for DrawReliefRect95.
+ *
+ * Revision history
+ * 08-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
+ * Original implementation.
+ * 11-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
+ * Changed name from DrawMenuSeparator95
+ *
+ *****************************************************************************/
+
+void TWEAK_DrawMenuSeparatorHoriz95(
HDC32 hdc,
UINT32 xc1,
UINT32 yc,
@@ -454,3 +526,52 @@
return;
}
+
+
+/******************************************************************************
+ *
+ * void TWEAK_DrawMenuSeparatorVert95(
+ * HDC32 hdc, // Device context on which to draw
+ * UINT32 xc, // X-coordinate of the RIGHT line
+ * UINT32 yc1, // top Y-coordinate
+ * UINT32 yc2 ) // bottom Y-coordinate
+ *
+ * Draws a vertical menu separator bar Win 95 style.
+ *
+ * Bugs
+ * Same as those for DrawReliefRect95.
+ *
+ * Revision history
+ * 11-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu)
+ * Original implementation.
+ *
+ *****************************************************************************/
+
+void TWEAK_DrawMenuSeparatorVert95(
+ HDC32 hdc,
+ UINT32 xc,
+ UINT32 yc1,
+ UINT32 yc2 )
+{
+ DC *dc;
+ HPEN32 prevpen;
+
+ if((dc = (DC *)GDI_GetObjPtr(hdc, DC_MAGIC))) {
+
+ /* Draw the top line */
+ prevpen = SelectObject32(hdc, TWEAK_Pen8095);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, xc, yc1, xc,
+ yc2);
+
+ /* And the bottom line */
+ SelectObject32(hdc, TWEAK_PenFF95);
+ DC_SetupGCForPen(dc);
+ XDrawLine(display, dc->u.x.drawable, dc->u.x.gc, xc + 1, yc1, xc + 1,
+ yc2);
+
+ SelectObject32(hdc, prevpen);
+ }
+
+ return;
+}
diff --git a/misc/ver.c b/misc/ver.c
index 51b9089..0a747bf 100644
--- a/misc/ver.c
+++ b/misc/ver.c
@@ -983,15 +983,15 @@
/* in memory structure... */
char name[1]; /* padded to dword alignment */
/* ....
- char data[datalen]; padded to dword alignemnt
+ char data[datalen]; padded to dword alignment
BYTE subdirdata[]; until nextoff
*/
};
static BYTE*
-_find_data(BYTE *block,LPCSTR str) {
+_find_data(BYTE *block,LPCSTR str, WORD buff_remain) {
char *nextslash;
- int substrlen;
+ int substrlen, inc_size;
struct db *db;
while (*str && *str=='\\')
@@ -1013,20 +1013,23 @@
dprintf_ver(stddeb,"db=%p,db->nextoff=%d,db->datalen=%d,db->name=%s,db->data=%s\n",
db,db->nextoff,db->datalen,db->name,(char*)((char*)db+4+((strlen(db->name)+4)&~3))
);
- if (!db->nextoff)
+ if ((!db->nextoff) || (!buff_remain)) /* no more entries ? */
return NULL;
dprintf_ver(stddeb,"comparing with %s\n",db->name);
if (!strncmp(db->name,str,substrlen)) {
- if (nextslash)
- return _find_data(
- block+4+((strlen(db->name)+4)&~3)+((db->datalen+3)&~3)
- ,nextslash
- );
+ if (nextslash) {
+ inc_size = 4+((strlen(db->name)+4)&~3)+((db->datalen+3)&~3);
+
+ return _find_data( block+inc_size ,nextslash,
+ buff_remain - inc_size);
+ }
else
return block;
}
- block=block+((db->nextoff+3)&~3);
+ inc_size=((db->nextoff+3)&~3);
+ block=block+inc_size;
+ buff_remain=buff_remain-inc_size;
}
}
@@ -1044,7 +1047,7 @@
);
s=(char*)xmalloc(strlen("VS_VERSION_INFO\\")+strlen(subblock)+1);
strcpy(s,"VS_VERSION_INFO\\");strcat(s,subblock);
- b=_find_data(block,s);
+ b=_find_data(block, s, *(WORD *)block);
if (b==NULL) {
*buflen=0;
return 0;
@@ -1071,7 +1074,7 @@
);
s=(char*)xmalloc(strlen("VS_VERSION_INFO\\")+strlen(subblock)+1);
strcpy(s,"VS_VERSION_INFO\\");strcat(s,subblock);
- b=_find_data(block,s);
+ b=_find_data(block, s, *(WORD *)block);
if (b==NULL) {
*buflen=0;
return 0;
@@ -1100,7 +1103,7 @@
sb = HEAP_strdupWtoA( GetProcessHeap(), 0, subblock );
s=(char*)xmalloc(strlen("VS_VERSION_INFO\\")+strlen(sb)+1);
strcpy(s,"VS_VERSION_INFO\\");strcat(s,sb);
- b=_find_data(block,s);
+ b=_find_data(block, s, *(WORD *)block);
if (b==NULL) {
*buflen=0;
HeapFree( GetProcessHeap(), 0, sb );
diff --git a/misc/winsock.c b/misc/winsock.c
index e4ecd51..159ed1c 100644
--- a/misc/winsock.c
+++ b/misc/winsock.c
@@ -42,6 +42,7 @@
#include "heap.h"
#include "ldt.h"
#include "winsock.h"
+#include "miscemu.h"
#include "stddebug.h"
#include "debug.h"
@@ -51,8 +52,6 @@
inet_ntoa(((struct sockaddr_in *)a)->sin_addr), \
ntohs(((struct sockaddr_in *)a)->sin_port))
-extern void SIGNAL_MaskAsyncEvents( BOOL32 );
-
#pragma pack(4)
/* ----------------------------------- internal data */
diff --git a/misc/wsprintf.c b/misc/wsprintf.c
index 4ca4828..9cfbc57 100644
--- a/misc/wsprintf.c
+++ b/misc/wsprintf.c
@@ -257,8 +257,15 @@
else cur_arg = (DWORD)PTR_SEG_TO_LIN( *(SEGPTR *)args );
args = (SEGPTR *)args + 1;
break;
- case WPR_HEXA:
case WPR_SIGNED:
+ if (!(format.flags & WPRINTF_LONG))
+ {
+ cur_arg = (DWORD)(INT32)*(INT16 *)args;
+ args = (INT16 *)args + 1;
+ break;
+ }
+ /* fall through */
+ case WPR_HEXA:
case WPR_UNSIGNED:
if (format.flags & WPRINTF_LONG)
{