Release 940524
Mon May 23 15:07:36 1994 Bob Amstadt (bob@pooh)
* [loader/selector.c]
Allocate heap and stack segments as 64k.
Sat May 21 01:15:49 1994 Rick Sladkey (jrs@world.std.com)
* [loader/selector.c]
Correct typos where memcpy is used instead of memset.
* [loader/resource.c]
Allow for legitimate cases where biSizeImage is 0 in LoadIcon
by calculating the value when the bitmap is not compressed.
* [miscemu/int21.c]
Fix NULL dereference caused by superfluous DOS_closedir in FindNext.
* [loader/resource.c]
New function type_match to handle string resource types as
well as IDs. In addition, compare only low 4 bits of type_id
when both numbers are IDs so that 0x0002 matches 0x8002.
In FindResourceByNumber and FindResourceByName use type_match
instead of comparing numbers. In FindResource handle the
"#number" syntax and empty strings in both the resource and
type names.
Mon May 23 00:48:25 1994 Rick Sladkey (jrs@world.std.com)
* [windows/dialog.c]
Fix inadvertent printing of string IDs as strings.
May 23, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/menu.c]
New functions GetMenuItemCount(), GetMenuItemID().
GetMenuString() & HiliteMenuItem().
Bug fix in CheckMenuItem().
Function SetMenu() now make client area recalc if menu removed.
* [windows/winpos.c]
Bug fix in SetWindowPos(), no more XMapping or XConfiguring of
windows with initial width or height equal zero.
* [objects/gdiobj.c]
New function EnumObjects(), using new lpPenBrushList buildup
from calls to new function GDI_AppendToPenBrushList().
('pbrush.exe' don't show its face yet ! ... :-( )
New EMPTY STUB for function SetObjectOwner(),
('mplayer.exe' call it via GetProcAddress() ...)
* [objects/font.c]
New internal functions ParseFontParms() & InitFontsList().
EnumFonts() & EnumFontFamilies() enumerates fonts (no more dummies).
FONT_MatchFont now make retries to find closest-smallest font.
('charmap.exe' can now show the differents fonts available)
* [windows/nonclient.c]
Use small dos OBM_OLD_CLOSE button for MDI windows.
* [windows/graphics.c] [objects/bitmap.c]
Start to remove obsolete globals such XT_screen ...
* [loader/library.c]
Make function GetProcAddress() working also with builtin DLLs.
Tue May 24 20:18:02 1994 Erik Bos (erik@hacktic.nl)
* [if1632/system.spec] [if1632/toolhelp.spec]
system.dll & toolhelp.dll added.
* [loader/library.c]
Modified GetModuleFileName() to return the full
filename.
Added a check to LoadLibrary() to prevent loading
built in dlls. (eg. user.exe)
Added a check to FreeLibrary() to prevent built-in
dlls from being freed.
Modified GetProcAddress() to support builtin dlls.
* [loader/signal.c] [miscemu/int2f.c]
Added => pifedit runs.
* [misc/dos_fs.c]
Added a NULL-ptr check to DOS_closedir().
diff --git a/objects/bitmap.c b/objects/bitmap.c
index 6c21e0c..38fabec 100644
--- a/objects/bitmap.c
+++ b/objects/bitmap.c
@@ -61,7 +61,7 @@
extern void _XInitImageFuncPtrs( XImage* );
XImage * image;
- image = XCreateImage( XT_display, DefaultVisualOfScreen(XT_screen),
+ image = XCreateImage( XT_display, DefaultVisualOfScreen(screen),
bmp->bmBitsPixel, ZPixmap, 0, bmpData,
bmp->bmWidth, bmp->bmHeight, 16, bmp->bmWidthBytes );
if (!image) return 0;
diff --git a/objects/font.c b/objects/font.c
index 2ff21c5..6129981 100644
--- a/objects/font.c
+++ b/objects/font.c
@@ -13,6 +13,8 @@
#include "user.h"
#include "gdi.h"
+#define MAX_FONTS 256
+static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL };
/***********************************************************************
* FONT_MatchFont
@@ -45,34 +47,35 @@
case FF_DECORATIVE: family = "*"; break;
default: family = "*"; break;
}
+ AnsiLower(family);
- /* Width==0 seems not to be a valid wildcard on SGI's, using * instead */
- if ( width == 0 )
- sprintf( pattern, "-*-%s-%s-%c-normal--*-%d-*-*-%c-*-%s",
- family, weight, slant, height, spacing, charset
- );
- else
- sprintf( pattern, "-*-%s-%s-%c-normal--*-%d-*-*-%c-%d-%s",
- family, weight, slant, height, spacing, width, charset
- );
-
+ while (TRUE) {
+ /* Width==0 seems not to be a valid wildcard on SGI's, using * instead */
+ if ( width == 0 )
+ sprintf( pattern, "-*-%s-%s-%c-normal--*-%d-*-*-%c-*-%s",
+ family, weight, slant, height, spacing, charset);
+ else
+ sprintf( pattern, "-*-%s-%s-%c-normal--*-%d-*-*-%c-%d-%s",
+ family, weight, slant, height, spacing, width, charset);
#ifdef DEBUG_FONT
- printf( "FONT_MatchFont: '%s'\n", pattern );
+ printf( "FONT_MatchFont: '%s'\n", pattern );
#endif
- names = XListFonts( XT_display, pattern, 1, &count );
- if (!count)
- {
+ names = XListFonts( XT_display, pattern, 1, &count );
+ if (count > 0) break;
+ height -= 10;
+ if (height < 10) {
#ifdef DEBUG_FONT
- printf( " No matching font found\n" );
+ printf( " No matching font found\n" );
#endif
- return NULL;
- }
+ return NULL;
+ }
+ }
#ifdef DEBUG_FONT
- printf( " Found '%s'\n", *names );
+ printf( " Found '%s'\n", *names );
#endif
- fontStruct = XLoadQueryFont( XT_display, *names );
- XFreeFontNames( names );
- return fontStruct;
+ fontStruct = XLoadQueryFont( XT_display, *names );
+ XFreeFontNames( names );
+ return fontStruct;
}
@@ -134,6 +137,9 @@
if (!hfont) return 0;
fontPtr = (FONTOBJ *) GDI_HEAP_ADDR( hfont );
memcpy( &fontPtr->logfont, font, sizeof(LOGFONT) );
+#ifdef DEBUG_FONT
+ printf("CreateFontIndirect(%08X); return %04X !\n", font, hfont);
+#endif
return hfont;
}
@@ -173,7 +179,9 @@
X_PHYSFONT * stockPtr;
HFONT prevHandle = dc->w.hFont;
XFontStruct * fontStruct;
-
+#ifdef DEBUG_FONT
+ printf("FONT_SelectObject(%04X, %04X, %08X); !\n", dc, hfont, font);
+#endif
/* Load font if necessary */
if (!font)
@@ -422,6 +430,117 @@
return TRUE;
}
+/*************************************************************************
+ * ParseFontParms [internal]
+ */
+int ParseFontParms(LPSTR lpFont, WORD wParmsNo, LPSTR lpRetStr, WORD wMaxSiz)
+{
+ int i, j;
+#ifdef DEBUG_FONT
+ printf("ParseFontParms('%s', %d, %08X, %d);\n",
+ lpFont, wParmsNo, lpRetStr, wMaxSiz);
+#endif
+ if (lpFont == NULL) return 0;
+ if (lpRetStr == NULL) return 0;
+ for (i = 0; (*lpFont != '\0' && i != wParmsNo); ) {
+ if (*lpFont == '-') i++;
+ lpFont++;
+ }
+ if (i == wParmsNo) {
+ if (*lpFont == '-') lpFont++;
+ wMaxSiz--;
+ for (i = 0; (*lpFont != '\0' && *lpFont != '-' && i < wMaxSiz); i++)
+ *(lpRetStr + i) = *lpFont++;
+ *(lpRetStr + i) = '\0';
+#ifdef DEBUG_FONT
+ printf("ParseFontParms // '%s'\n", lpRetStr);
+#endif
+ return i;
+ }
+ else
+ lpRetStr[0] = '\0';
+ return 0;
+}
+
+
+/*************************************************************************
+ * InitFontsList [internal]
+ */
+void InitFontsList()
+{
+ char str[32];
+ char pattern[100];
+ char *family, *weight, *charset;
+ char **names;
+ char slant, spacing;
+ int i, width, count;
+ LPLOGFONT lpNewFont;
+ weight = "medium";
+ slant = 'r';
+ spacing = '*';
+ charset = "*";
+ family = "*";
+ printf("InitFontsList !\n");
+ sprintf( pattern, "-*-%s-%s-%c-normal--*-*-*-*-%c-*-%s",
+ family, weight, slant, spacing, charset);
+ names = XListFonts( XT_display, pattern, MAX_FONTS, &count );
+#ifdef DEBUG_FONT
+ printf("InitFontsList // count=%d \n", count);
+#endif
+ for (i = 0; i < count; i++) {
+ lpNewFont = malloc(sizeof(LOGFONT) + LF_FACESIZE);
+ if (lpNewFont == NULL) {
+ printf("InitFontsList // Error alloc new font structure !\n");
+ break;
+ }
+#ifdef DEBUG_FONT
+ printf("InitFontsList // names[%d]='%s' \n", i, names[i]);
+#endif
+ ParseFontParms(names[i], 2, str, sizeof(str));
+ if (strcmp(str, "fixed") == 0) strcat(str, "sys");
+ AnsiUpper(str);
+ strcpy(lpNewFont->lfFaceName, str);
+ ParseFontParms(names[i], 7, str, sizeof(str));
+ lpNewFont->lfHeight = atoi(str) / 10;
+ ParseFontParms(names[i], 12, str, sizeof(str));
+ lpNewFont->lfWidth = atoi(str) / 10;
+ lpNewFont->lfEscapement = 0;
+ lpNewFont->lfOrientation = 0;
+ lpNewFont->lfWeight = FW_REGULAR;
+ lpNewFont->lfItalic = 0;
+ lpNewFont->lfUnderline = 0;
+ lpNewFont->lfStrikeOut = 0;
+ ParseFontParms(names[i], 13, str, sizeof(str));
+ if (strcmp(str, "iso8859") == 0)
+ lpNewFont->lfCharSet = ANSI_CHARSET;
+ else
+ lpNewFont->lfCharSet = OEM_CHARSET;
+ lpNewFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
+ lpNewFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lpNewFont->lfQuality = DEFAULT_QUALITY;
+ ParseFontParms(names[i], 11, str, sizeof(str));
+ switch(str[0]) {
+ case 'p':
+ lpNewFont->lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
+ break;
+ case 'm':
+ lpNewFont->lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
+ break;
+ default:
+ lpNewFont->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+ break;
+ }
+#ifdef DEBUG_FONT
+ printf("InitFontsList // lpNewFont->lfHeight=%d \n", lpNewFont->lfHeight);
+ printf("InitFontsList // lpNewFont->lfWidth=%d \n", lpNewFont->lfWidth);
+ printf("InitFontsList // lfFaceName='%s' \n", lpNewFont->lfFaceName);
+#endif
+ lpLogFontList[i] = lpNewFont;
+ lpLogFontList[i+1] = NULL;
+ }
+ XFreeFontNames(names);
+}
+
/*************************************************************************
* EnumFonts [GDI.70]
@@ -430,11 +549,16 @@
{
HANDLE hLog;
HANDLE hMet;
+ HFONT hFont;
+ HFONT hOldFont;
LPLOGFONT lpLogFont;
LPTEXTMETRIC lptm;
+ LPSTR lpFaceList[MAX_FONTS];
+ char FaceName[LF_FACESIZE];
int nRet;
- printf("EnumFonts(%04X, %08X, %08X, %08X)\n",
- hDC, lpFaceName, lpEnumFunc, lpData);
+ int j, i = 0;
+ printf("EnumFonts(%04X, %08X='%s', %08X, %08X)\n",
+ hDC, lpFaceName, lpFaceName, lpEnumFunc, lpData);
if (lpEnumFunc == NULL) return 0;
hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGFONT) + LF_FACESIZE);
lpLogFont = (LPLOGFONT) USER_HEAP_ADDR(hLog);
@@ -449,41 +573,49 @@
printf("EnumFonts // can't alloc TEXTMETRIC struct !\n");
return 0;
}
+ if (lpFaceName != NULL) {
+ strcpy(FaceName, lpFaceName);
+ AnsiUpper(FaceName);
+ }
+ if (lpLogFontList[0] == NULL) InitFontsList();
+ memset(lpFaceList, 0, MAX_FONTS * sizeof(LPSTR));
while (TRUE) {
- printf("EnumFonts // !\n");
- lpLogFont->lfHeight = 18;
- lpLogFont->lfWidth = 12;
- lpLogFont->lfEscapement = 0;
- lpLogFont->lfOrientation = 0;
- lpLogFont->lfWeight = FW_REGULAR;
- lpLogFont->lfItalic = 0;
- lpLogFont->lfUnderline = 0;
- lpLogFont->lfStrikeOut = 0;
- lpLogFont->lfCharSet = ANSI_CHARSET;
- lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
- lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lpLogFont->lfQuality = DEFAULT_QUALITY;
- lpLogFont->lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
- strcpy(lpLogFont->lfFaceName, "Courier");
- printf("lpLogFont=%08X lptm=%08X\n", lpLogFont, lptm);
+ if (lpLogFontList[i] == NULL) break;
+ if (lpFaceName == NULL) {
+ for (j = 0; j < MAX_FONTS; j++) {
+ if (lpFaceList[j] == NULL) break;
+ if (strcmp(lpFaceList[j], lpLogFontList[i]->lfFaceName) == 0) {
+ i++; j = 0;
+ }
+ }
+ if (lpLogFontList[i] == NULL) break;
+ lpFaceList[j] = lpLogFontList[i]->lfFaceName;
+ printf("EnumFonts // enum all 'lpFaceName' '%s' !\n", lpFaceList[j]);
+ }
+ else {
+ while(lpLogFontList[i] != NULL) {
+ if (strcmp(FaceName, lpLogFontList[i]->lfFaceName) == 0) break;
+ i++;
+ }
+ if (lpLogFontList[i] == NULL) break;
+ }
+ memcpy(lpLogFont, lpLogFontList[i++], sizeof(LOGFONT) + LF_FACESIZE);
+ hFont = CreateFontIndirect(lpLogFont);
+ hOldFont = SelectObject(hDC, hFont);
+ GetTextMetrics(hDC, lptm);
+ SelectObject(hDC, hOldFont);
+ DeleteObject(hFont);
+ printf("EnumFonts // i=%d lpLogFont=%08X lptm=%08X\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLogFont,
2, (int)lptm, 0, (int)0, 2, (int)lpData);
#endif
- if (nRet == 0) break;
- lpLogFont->lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
- strcpy(lpLogFont->lfFaceName, "Helvetica");
- printf("lpLogFont=%08X lptm=%08X\n", lpLogFont, lptm);
-#ifdef WINELIB
- nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
-#else
- nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLogFont,
- 2, (int)lptm, 0, (int)0, 2, (int)lpData);
-#endif
- if (nRet == 0) break;
- else break;
+ if (nRet == 0) {
+ printf("EnumFonts // EnumEnd requested by application !\n");
+ break;
+ }
}
USER_HEAP_FREE(hMet);
USER_HEAP_FREE(hLog);
@@ -498,9 +630,14 @@
{
HANDLE hLog;
HANDLE hMet;
+ HFONT hFont;
+ HFONT hOldFont;
LPLOGFONT lpLogFont;
LPTEXTMETRIC lptm;
+ LPSTR lpFaceList[MAX_FONTS];
+ char FaceName[LF_FACESIZE];
int nRet;
+ int j, i = 0;
printf("EnumFontFamilies(%04X, %08X, %08X, %08X)\n",
hDC, lpszFamily, lpEnumFunc, lpData);
if (lpEnumFunc == NULL) return 0;
@@ -517,43 +654,49 @@
printf("EnumFontFamilies // can't alloc TEXTMETRIC struct !\n");
return 0;
}
+ if (lpszFamily != NULL) {
+ strcpy(FaceName, lpszFamily);
+ AnsiUpper(FaceName);
+ }
+ if (lpLogFontList[0] == NULL) InitFontsList();
+ memset(lpFaceList, 0, MAX_FONTS * sizeof(LPSTR));
while (TRUE) {
- printf("EnumFontFamilies // !\n");
- lpLogFont->lfHeight = 12;
- lpLogFont->lfWidth = 8;
- lpLogFont->lfEscapement = 0;
- lpLogFont->lfOrientation = 0;
- lpLogFont->lfWeight = FW_REGULAR;
- lpLogFont->lfItalic = 0;
- lpLogFont->lfUnderline = 0;
- lpLogFont->lfStrikeOut = 0;
- lpLogFont->lfCharSet = ANSI_CHARSET;
- lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
- lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lpLogFont->lfQuality = DEFAULT_QUALITY;
- lpLogFont->lfPitchAndFamily = FIXED_PITCH | FF_MODERN;
- strcpy(lpLogFont->lfFaceName, "Courier");
-/* lpLogFont->lfFullName[LF_FACESIZE] = 12;
- lpLogFont->lfStyle[LF_FACESIZE] = 12; */
- printf("lpLogFont=%08X lptm=%08X\n", lpLogFont, lptm);
+ if (lpLogFontList[i] == NULL) break;
+ if (lpszFamily == NULL) {
+ for (j = 0; j < MAX_FONTS; j++) {
+ if (lpFaceList[j] == NULL) break;
+ if (strcmp(lpFaceList[j], lpLogFontList[i]->lfFaceName) == 0) {
+ i++; j = 0;
+ }
+ }
+ if (lpLogFontList[i] == NULL) break;
+ lpFaceList[j] = lpLogFontList[i]->lfFaceName;
+ printf("EnumFontFamilies // enum all 'lpszFamily' '%s' !\n", lpFaceList[j]);
+ }
+ else {
+ while(lpLogFontList[i] != NULL) {
+ if (strcmp(FaceName, lpLogFontList[i]->lfFaceName) == 0) break;
+ i++;
+ }
+ if (lpLogFontList[i] == NULL) break;
+ }
+ memcpy(lpLogFont, lpLogFontList[i++], sizeof(LOGFONT) + LF_FACESIZE);
+ hFont = CreateFontIndirect(lpLogFont);
+ hOldFont = SelectObject(hDC, hFont);
+ GetTextMetrics(hDC, lptm);
+ SelectObject(hDC, hOldFont);
+ DeleteObject(hFont);
+ printf("EnumFontFamilies // i=%d lpLogFont=%08X lptm=%08X\n", i, lpLogFont, lptm);
#ifdef WINELIB
nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
#else
nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLogFont,
2, (int)lptm, 0, (int)0, 2, (int)lpData);
#endif
- if (nRet == 0) break;
- lpLogFont->lfPitchAndFamily = VARIABLE_PITCH | FF_SWISS;
- strcpy(lpLogFont->lfFaceName, "Helvetica");
- printf("lpLogFont=%08X lptm=%08X\n", lpLogFont, lptm);
-#ifdef WINELIB
- nRet = (*lpEnumFunc)(lpLogFont, lptm, 0, lpData);
-#else
- nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLogFont,
- 2, (int)lptm, 0, (int)0, 2, (int)lpData);
-#endif
- if (nRet == 0) break;
- else break;
+ if (nRet == 0) {
+ printf("EnumFontFamilies // EnumEnd requested by application !\n");
+ break;
+ }
}
USER_HEAP_FREE(hMet);
USER_HEAP_FREE(hLog);
diff --git a/objects/gdiobj.c b/objects/gdiobj.c
index 6243fd2..9248c32 100644
--- a/objects/gdiobj.c
+++ b/objects/gdiobj.c
@@ -8,11 +8,19 @@
#include <stdlib.h>
#include <stdio.h>
+#include "user.h"
#include "gdi.h"
#include "prototypes.h"
MDESC *GDI_Heap = NULL;
+/* Object types for EnumObjects() */
+#define OBJ_PEN 1
+#define OBJ_BRUSH 2
+
+#define MAX_OBJ 1024
+HANDLE *lpPenBrushList = NULL;
+
extern HPALETTE COLOR_Init(); /* color.c */
/***********************************************************************
@@ -178,6 +186,36 @@
/***********************************************************************
+ * GDI_AppendToPenBrushList
+ */
+BOOL GDI_AppendToPenBrushList(HANDLE hNewObj)
+{
+ HANDLE *lphObj;
+ int i = 1;
+ if (hNewObj == 0) return FALSE;
+ if (lpPenBrushList == NULL) {
+ lpPenBrushList = malloc(MAX_OBJ * sizeof(HANDLE));
+ lpPenBrushList[0] = 0;
+#ifdef DEBUG_GDI
+ printf("GDI_AppendToPenBrushList() lpPenBrushList allocated !\n");
+#endif
+ }
+ for (lphObj = lpPenBrushList; i < MAX_OBJ; i++) {
+ if (*lphObj == 0) {
+ *lphObj = hNewObj;
+ *(lphObj + 1) = 0;
+#ifdef DEBUG_GDI
+ printf("GDI_AppendToPenBrushList(%04X) appended (count=%d)\n", hNewObj, i);
+#endif
+ return TRUE;
+ }
+ lphObj++;
+ }
+ return FALSE;
+}
+
+
+/***********************************************************************
* GDI_FindPrevObject
*
* Return the GDI object whose hNext field points to obj.
@@ -212,6 +250,9 @@
obj->hNext = 0;
obj->wMagic = magic;
obj->dwCount = ++count;
+ if (magic == PEN_MAGIC || magic == BRUSH_MAGIC) {
+ GDI_AppendToPenBrushList(handle);
+ }
return handle;
}
@@ -389,3 +430,136 @@
#endif
return TRUE;
}
+
+
+/***********************************************************************
+ * EnumObjects (GDI.71)
+ */
+int EnumObjects(HDC hDC, int nObjType, FARPROC lpEnumFunc, LPSTR lpData)
+{
+ HANDLE handle;
+ DC *dc;
+ HANDLE *lphObj;
+ GDIOBJHDR *header;
+ WORD wMagic;
+ LPSTR lpLog; /* Point to a LOGBRUSH or LOGPEN struct */
+ HANDLE hLog;
+ int i, nRet;
+ if (lpEnumFunc == NULL) {
+ printf("EnumObjects // Bad EnumProc callback address !\n");
+ return 0;
+ }
+ switch (nObjType) {
+ case OBJ_PEN:
+ wMagic = PEN_MAGIC;
+ printf("EnumObjects(%04X, OBJ_PEN, %08X, %08X);\n",
+ hDC, lpEnumFunc, lpData);
+ hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGPEN));
+ lpLog = (LPSTR) USER_HEAP_ADDR(hLog);
+ if (lpLog == NULL) {
+ printf("EnumObjects // Unable to alloc LOGPEN struct !\n");
+ return 0;
+ }
+ break;
+ case OBJ_BRUSH:
+ wMagic = BRUSH_MAGIC;
+ printf("EnumObjects(%04X, OBJ_BRUSH, %08X, %08X);\n",
+ hDC, lpEnumFunc, lpData);
+ hLog = USER_HEAP_ALLOC(GMEM_MOVEABLE, sizeof(LOGBRUSH));
+ lpLog = (LPSTR) USER_HEAP_ADDR(hLog);
+ if (lpLog == NULL) {
+ printf("EnumObjects // Unable to alloc LOGBRUSH struct !\n");
+ return 0;
+ }
+ break;
+ default:
+ printf("EnumObjects(%04X, %04X, %08X, %08X); // Unknown OBJ type !\n",
+ hDC, nObjType, lpEnumFunc, lpData);
+ return 0;
+ }
+ printf("EnumObjects // Stock Objects first !\n");
+ for (i = 0; i < NB_STOCK_OBJECTS; i++) {
+ header = StockObjects[i];
+ if (header->wMagic == wMagic) {
+ PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), (LPLOGPEN)lpLog);
+ BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH), (LPLOGBRUSH)lpLog);
+ printf("EnumObjects // StockObj lpLog=%08X lpData=%08X\n", lpLog, lpData);
+ if (header->wMagic == BRUSH_MAGIC) {
+ printf("EnumObjects // StockBrush lbStyle=%04X\n", ((LPLOGBRUSH)lpLog)->lbStyle);
+ printf("EnumObjects // StockBrush lbColor=%08X\n", ((LPLOGBRUSH)lpLog)->lbColor);
+ printf("EnumObjects // StockBrush lbHatch=%04X\n", ((LPLOGBRUSH)lpLog)->lbHatch);
+ }
+ if (header->wMagic == PEN_MAGIC) {
+ printf("EnumObjects // StockPen lopnStyle=%04X\n", ((LPLOGPEN)lpLog)->lopnStyle);
+ printf("EnumObjects // StockPen lopnWidth=%08X\n", ((LPLOGPEN)lpLog)->lopnWidth);
+ printf("EnumObjects // StockPen lopnColor=%08X\n", ((LPLOGPEN)lpLog)->lopnColor);
+ }
+ nRet = 1;
+/*
+#ifdef WINELIB
+ nRet = (*lpEnumFunc)(lpLog, lpData);
+#else
+ nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLog, 2, (int)lpData);
+#endif
+*/
+ printf("EnumObjects // after CallBack16 !\n");
+ if (nRet == 0) {
+ USER_HEAP_FREE(hLog);
+ printf("EnumObjects // EnumEnd requested by application !\n");
+ return 0;
+ }
+ }
+ }
+ if (lpPenBrushList == NULL) return 0;
+ printf("EnumObjects // Now DC owned objects %08X !\n", header);
+ for (lphObj = lpPenBrushList; *lphObj != 0; ) {
+#ifdef DEBUG_GDI
+ printf("EnumObjects // *lphObj=%04X\n", *lphObj);
+#endif
+ header = (GDIOBJHDR *) GDI_HEAP_ADDR(*lphObj++);
+ if (header->wMagic == wMagic) {
+#ifdef DEBUG_GDI
+ printf("EnumObjects // DC_Obj lpLog=%08X lpData=%08X\n", lpLog, lpData);
+#endif
+ if (header->wMagic == BRUSH_MAGIC) {
+ BRUSH_GetObject( (BRUSHOBJ *)header, sizeof(LOGBRUSH), (LPLOGBRUSH)lpLog);
+ printf("EnumObjects // DC_Brush lbStyle=%04X\n", ((LPLOGBRUSH)lpLog)->lbStyle);
+ printf("EnumObjects // DC_Brush lbColor=%08X\n", ((LPLOGBRUSH)lpLog)->lbColor);
+ printf("EnumObjects // DC_Brush lbHatch=%04X\n", ((LPLOGBRUSH)lpLog)->lbHatch);
+ }
+ if (header->wMagic == PEN_MAGIC) {
+ PEN_GetObject( (PENOBJ *)header, sizeof(LOGPEN), (LPLOGPEN)lpLog);
+ printf("EnumObjects // DC_Pen lopnStyle=%04X\n", ((LPLOGPEN)lpLog)->lopnStyle);
+ printf("EnumObjects // DC_Pen lopnWidth=%08X\n", ((LPLOGPEN)lpLog)->lopnWidth);
+ printf("EnumObjects // DC_Pen lopnColor=%08X\n", ((LPLOGPEN)lpLog)->lopnColor);
+ }
+/*
+#ifdef WINELIB
+ nRet = (*lpEnumFunc)(lpLog, lpData);
+#else
+ nRet = CallBack16(lpEnumFunc, 4, 2, (int)lpLog, 2, (int)lpData);
+#endif
+*/
+ nRet = 1;
+ printf("EnumObjects // after CallBack16 !\n");
+ if (nRet == 0) {
+ USER_HEAP_FREE(hLog);
+ printf("EnumObjects // EnumEnd requested by application !\n");
+ return 0;
+ }
+ }
+ }
+ USER_HEAP_FREE(hLog);
+ printf("EnumObjects // End of enumeration !\n");
+ return 0;
+}
+
+/***********************************************************************
+ * SetObjectOwner (GDI.461)
+ */
+int SetObjectOwner(HANDLE hObj)
+{
+ printf("EMPTY STUB !!! SetObjectOwner() (I don't know its prototype !\n");
+ return 0;
+}
+
diff --git a/objects/text.c b/objects/text.c
index 0d9690b..e7d3cdb 100644
--- a/objects/text.c
+++ b/objects/text.c
@@ -418,7 +418,7 @@
BOOL ExtTextOut(HDC hDC, short x, short y, WORD wOptions, LPRECT lprect,
LPSTR str, WORD count, LPINT lpDx)
{
- printf("EMPTY STUB !!! ExtTextOut(); ! (call TextOut() for new)\n");
+ printf("EMPTY STUB !!! ExtTextOut(); ! call TextOut() for now !\n");
TextOut(hDC, x, y, str, count);
return FALSE;
}