Commit 1f57929b authored by Alexandre Julliard's avatar Alexandre Julliard

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().
parent 73450d65
----------------------------------------------------------------------
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 16, 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().
----------------------------------------------------------------------
Tue May 17 23:03:16 1994 Bob Amstadt (bob@pooh)
* [windows/dce.c]
......
All code unless stated otherwise is covered by the GNU Pubic License.
You may without charge, royalty or other payment, copy and
distribute copies of this work and derivative works of this work
in source or binary form provided that: (1)
you appropriately publish on each copy an appropriate copyright
notice; (2) faithfully reproduce all prior copyright notices
included in the original work (you may also add your own
copyright notice); and (3) agree to indemnify and hold all prior
authors, copyright holders and licensors of the work harmless
from and against all damages arising from use of the work.
You may distribute sources of derivative works of the work
provided that (1) (a) all source files of the original work that
have been modified, (b) all source files of the derivative work
that contain any party of the original work, and (c) all source
files of the derivative work that are necessary to compile, link
and run the derivative work without unresolved external calls and
with the same functionality of the original work ("Necessary
Sources") carry a prominent notice explaining the nature and date
of the modification and/or creation. You are encouraged to make
the Necessary Sources available under this license in order to
further the development and acceptance of the work.
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING
BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS
OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR
LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Copyright Robert J. Amstadt, 1993. All code is provided without
warranty. All code is covered by the license contained in the file
LICENSE unless explicitly stated in the individual source file.
0. LICENSE
You may without charge, royalty or other payment, copy and
distribute copies of this work and derivative works of this work
in source or binary form provided that: (1)
you appropriately publish on each copy an appropriate copyright
notice; (2) faithfully reproduce all prior copyright notices
included in the original work (you may also add your own
copyright notice); and (3) agree to indemnify and hold all prior
authors, copyright holders and licensors of the work harmless
from and against all damages arising from use of the work.
You may distribute sources of derivative works of the work
provided that (1) (a) all source files of the original work that
have been modified, (b) all source files of the derivative work
that contain any party of the original work, and (c) all source
files of the derivative work that are necessary to compile, link
and run the derivative work without unresolved external calls and
with the same functionality of the original work ("Necessary
Sources") carry a prominent notice explaining the nature and date
of the modification and/or creation. You are encouraged to make
the Necessary Sources available under this license in order to
further the development and acceptance of the work.
EXCEPT AS OTHERWISE RESTRICTED BY LAW, THIS WORK IS PROVIDED
WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OF ANY KIND, INCLUDING
BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY OR TITLE. EXCEPT AS
OTHERWISE PROVIDED BY LAW, NO AUTHOR, COPYRIGHT HOLDER OR
LICENSOR SHALL BE LIABLE TO YOU FOR DAMAGES OF ANY KIND, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
1. COMPILATION:
......@@ -171,6 +197,11 @@ bob@amscons.com
7. WHAT'S NEW
WHAT'S NEW with Wine-940524: (see ChangeLog for details)
- New menu functions
- EnumObjects()
- and many many bug fixes!
WHAT'S NEW with Wine-940518: (see ChangeLog for details)
- debugger improvements
- bug fixes to get some dialog boxes working.
......
......@@ -9,7 +9,7 @@ SRCS = \
menu.c \
scroll.c \
static.c \
edit.o \
edit.c \
desktop.c \
widgets.c
......
......@@ -263,7 +263,9 @@ LONG ComboBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
if (lphc == NULL) return 0;
return(SendMessage(lphc->hWndLBox, LB_ADDSTRING, wParam, lParam));
case CB_GETLBTEXT:
#ifdef DEBUG_COMBO
printf("CB_GETLBTEXT #%u !\n", wParam);
#endif
lphc = ComboGetStorageHeader(hwnd);
if (lphc == NULL) return 0;
return(SendMessage(lphc->hWndLBox, LB_GETTEXT, wParam, lParam));
......
......@@ -309,7 +309,6 @@ LONG EditWndProc(HWND hwnd, WORD uMsg, WORD wParam, LONG lParam)
break;
case WM_KEYDOWN:
printf("EDIT WM_KEYDOWN w=%04X !\n", wParam);
EDIT_KeyDownMsg(hwnd, wParam);
break;
......
......@@ -16,6 +16,8 @@ DLLOBJS = \
dll_shell.o \
dll_sound.o \
dll_stress.o \
dll_system.o \
dll_toolhelp.o \
dll_unixlib.o \
dll_user.o \
dll_win87em.o \
......@@ -39,6 +41,8 @@ MakeDllFromSpec(shell,$(TOP)/$(MODULE))
MakeDllFromSpec(mmsystem,$(TOP)/$(MODULE))
MakeDllFromSpec(sound,$(TOP)/$(MODULE))
MakeDllFromSpec(stress,$(TOP)/$(MODULE))
MakeDllFromSpec(system,$(TOP)/$(MODULE))
MakeDllFromSpec(toolhelp,$(TOP)/$(MODULE))
MakeDllFromSpec(unixlib,$(TOP)/$(MODULE))
MakeDllFromSpec(user,$(TOP)/$(MODULE))
MakeDllFromSpec(win87em,$(TOP)/$(MODULE))
......
......@@ -85,7 +85,7 @@ length 490
68 pascal DeleteDC(word) DeleteDC(1)
69 pascal DeleteObject(word) DeleteObject(1)
70 pascal EnumFonts(word ptr ptr ptr) EnumFonts(1 2 3 4)
#71 pascal EnumObjects
71 pascal EnumObjects(word word ptr ptr) EnumObjects(1 2 3 4)
72 pascal EqualRgn(word word) EqualRgn(1 2)
73 pascal ExcludeVisRect(word s_word s_word s_word s_word)
ExcludeVisRect(1 2 3 4 5)
......@@ -136,8 +136,8 @@ length 490
129 pascal SaveVisRgn(word) SaveVisRgn(1)
130 pascal RestoreVisRgn(word) RestoreVisRgn(1)
131 pascal InquireVisRgn(word) InquireVisRgn(1)
#132 pascal SetEnvironment
#133 pascal GetEnvironment
132 pascal SetEnvironment(ptr ptr word) SetEnvironment(1 2 3)
133 pascal GetEnvironment(ptr ptr word) GetEnvironment(1 2 3)
134 pascal GetRgnBox(word ptr) GetRgnBox(1 2)
#135 pascal ScanLr
#136 pascal RemoveFontResource
......@@ -276,7 +276,7 @@ length 490
CreatePolyPolygonRgn(1 2 3 4)
#452 pascal GDISEEGDIDO
#460 pascal GDITASKTERMINATION
#461 pascal SETOBJECTOWNER
461 pascal SetObjectOwner(word) SetObjectOwner(1)
#462 pascal ISGDIOBJECT
#463 pascal MAKEOBJECTPRIVATE
#464 pascal FIXUPBOGUSPUBLISHERMETAFILE
......
......@@ -67,8 +67,33 @@ length 706
509 pascal WAVEINSTART(word) waveInStart(1)
510 pascal WAVEINSTOP(word) waveInStop(1)
511 pascal WAVEINRESET(word) waveInReset(1)
512 pascal WAVEINGETPOSITION(word ptr word) waveInGetPosition(1 2 3)
513 pascal WAVEINGETID(word ptr) waveInGetID(1 2)
701 pascal MCISENDCOMMAND(word word long long) mciSendCommand(1 2 3 4)
702 pascal MCISENDSTRING(ptr ptr word word) mciSendString(1 2 3 4)
703 pascal MCIGETDEVICEID(ptr) mciSendCommand(1)
706 pascal MCIGETERRORSTRING(long ptr word) mciGetErrorString(1 2 3)
#1100 pascal DRVOPEN
#1101 pascal DRVCLOSE
#1102 pascal DRVSENDMESSAGE
#1103 pascal DRVGETMODULEHANDLE
#1104 pascal DRVDEFDRIVERPROC
#1210 pascal MMIOOPEN
#1211 pascal MMIOCLOSE
#1212 pascal MMIOREAD
#1213 pascal MMIOWRITE
#1214 pascal MMIOSEEK
#1215 pascal MMIOGETINFO
#1216 pascal MMIOSETINFO
#1217 pascal MMIOSETBUFFER
#1218 pascal MMIOFLUSH
#1219 pascal MMIOADVANCE
#1220 pascal MMIOSTRINGTOFOURCC
#1221 pascal MMIOINSTALLIOPROC
#1222 pascal MMIOSENDMESSAGE
#1223 pascal MMIODESCEND
#1224 pascal MMIOASCEND
#1225 pascal MMIOCREATECHUNK
#1226 pascal MMIORENAME
......@@ -24,8 +24,6 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#define DEBUG_RELAY /* */
#define N_BUILTINS 11
struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS] =
{
{ "KERNEL", KERNEL_table, 410, 1 },
......@@ -39,7 +37,10 @@ struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS] =
{ "WINSOCK", WINSOCK_table, 155, 9 },
{ "STRESS", STRESS_table, 15, 10},
{ "MMSYSTEM",MMSYSTEM_table,1023,11},
{ "SYSTEM", SYSTEM_table, 20 ,12},
{ "TOOLHELP",TOOLHELP_table, 83, 13},
};
/* don't forget to increase N_BUILTINS in dll.h if you add a dll */
unsigned short *Stack16Frame;
......@@ -220,7 +221,7 @@ FindDLLTable(char *dll_name)
int i;
for (i = 0; i < N_BUILTINS; i++)
if (strcmp(dll_builtin_table[i].dll_name, dll_name) == 0)
if (strcasecmp(dll_builtin_table[i].dll_name, dll_name) == 0)
return dll_builtin_table[i].dll_table;
return NULL;
......
......@@ -163,8 +163,8 @@ length 540
158 pascal SetMenu(word word) SetMenu(1 2)
159 pascal GetSubMenu(word word) GetSubMenu(1 2)
160 pascal DrawMenuBar(word) DrawMenuBar(1)
#161 GETMENUSTRING
#162 HILITEMENUITEM
161 pascal GetMenuString(word word ptr s_word word) GetMenuString(1 2 3 4 5)
162 pascal HiliteMenuItem(word word word word) HiliteMenuItem(1 2 3 4)
163 pascal CreateCaret(word word word word) CreateCaret(1 2 3 4)
164 pascal DestroyCaret() DestroyCaret()
165 pascal SetCaretPos(word word) SetCaretPos(1 2)
......@@ -272,8 +272,8 @@ length 540
#260 DEFERWINDOWPOS
#261 ENDDEFERWINDOWPOS
262 pascal GetWindow(word word) GetWindow(1 2)
#263 GETMENUITEMCOUNT
#264 GETMENUITEMID
263 pascal GetMenuItemCount(word) GetMenuItemCount(1)
264 pascal GetMenuItemID(word word) GetMenuItemID(1 2)
#265 SHOWOWNEDPOPUPS
266 pascal SetMessageQueue(word) SetMessageQueue(1)
267 pascal ShowScrollBar(word word word) ShowScrollBar(1 2 3)
......
......@@ -65,5 +65,9 @@ extern struct dll_table_entry_s SOUND_table[];
extern struct dll_table_entry_s KEYBOARD_table[];
extern struct dll_table_entry_s WINSOCK_table[];
extern struct dll_table_entry_s STRESS_table[];
extern struct dll_table_entry_s SYSTEM_table[];
extern struct dll_table_entry_s TOOLHELP_table[];
#define N_BUILTINS 13
#endif /* DLLS_H */
......@@ -301,8 +301,6 @@ extern BOOL GDI_FreeObject( HANDLE );
extern GDIOBJHDR * GDI_GetObjPtr( HANDLE, WORD );
extern Display * XT_display; /* Will be removed */
extern Screen * XT_screen; /* Will be removed */
extern Display * display;
extern Screen * screen;
extern Window rootWindow;
......
......@@ -2975,7 +2975,7 @@ Fe(int,DlgDirListComboBox,HWND,a,LPSTR,b,int,c,int,d,WORD,e)
Fe(int,Escape,HDC,a,int,b,int,c,LPSTR,d,LPSTR,e)
Fe(int,ExcludeClipRect,HDC,a,short,b,short,c,short,d,short,e)
Fe(int,ExcludeVisRect,HDC,a,short,b,short,c,short,d,short,e)
Fe(int,GetMenuString,HMENU,a,WORD,b,LPSTR,c,int,d,WORD,e)
Fe(int,GetMenuString,HMENU,a,WORD,b,LPSTR,c,short,d,WORD,e)
Fe(int,GetProfileString,LPSTR,a,LPSTR,b,LPSTR,c,LPSTR,d,int,e)
Fe(int,IntersectClipRect,HDC,a,short,b,short,c,short,d,short,e)
Fe(int,IntersectVisRect,HDC,a,short,b,short,c,short,d,short,e)
......
......@@ -35,9 +35,9 @@ typedef MODULEENTRY *LPMODULEENTRY;
static LPMODULEENTRY lpModList = NULL;
extern struct w_files * wine_files;
#define N_BUILTINS 11
extern struct dll_name_table_entry_s dll_builtin_table[N_BUILTINS];
extern struct dll_name_table_entry_s dll_builtin_table[];
#define IS_BUILTIN_DLL(handle) ((handle >> 16) == 0xff)
/**********************************************************************
* GetModuleHandle [KERNEL.47]
......@@ -50,7 +50,7 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
printf("GetModuleHandle // searching in loaded modules\n");
while (w) {
/* printf("GetModuleHandle // '%s' \n", w->name); */
if (strcmp(w->name, lpModuleName) == 0) {
if (strcasecmp(w->name, lpModuleName) == 0) {
printf("GetModuleHandle('%s') return %04X \n",
lpModuleName, w->hinstance);
return w->hinstance;
......@@ -60,7 +60,7 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
printf("GetModuleHandle // searching in builtin libraries\n");
for (i = 0; i < N_BUILTINS; i++) {
if (dll_builtin_table[i].dll_name == NULL) break;
if (strcmp(dll_builtin_table[i].dll_name, lpModuleName) == 0) {
if (strcasecmp(dll_builtin_table[i].dll_name, lpModuleName) == 0) {
printf("GetModuleHandle('%s') return %04X \n",
lpModuleName, 0xFF00 + i);
return (0xFF00 + i);
......@@ -91,16 +91,29 @@ int GetModuleFileName(HANDLE hModule, LPSTR lpFileName, short nSize)
{
struct w_files *w;
LPSTR str;
char windir[256], temp[256];
printf("GetModuleFileName(%04X, %08X, %d);\n", hModule, lpFileName, nSize);
if (lpFileName == NULL) return 0;
if (nSize < 1) return 0;
w = GetFileInfo(hModule);
if (w == NULL) return 0;
str = w->filename;
if (str[0] == '/') str++;
/* built-in dll ? */
if (IS_BUILTIN_DLL(hModule)) {
GetWindowsDirectory(windir, sizeof(windir));
sprintf(temp, "%s\\%s.DLL", windir, dll_builtin_table[hModule & 0x00ff].dll_name);
ToDos(temp);
strncpy(lpFileName, temp, nSize);
printf("GetModuleFileName copied '%s' (internal dll) return %d \n", lpFileName, nSize);
return strlen(lpFileName);
}
/* check loaded dlls */
if ((w = GetFileInfo(hModule)) == NULL)
return 0;
str = GetDosFileName(w->filename);
if (nSize > strlen(str)) nSize = strlen(str) + 1;
strncpy(lpFileName, str, nSize);
ToDos(lpFileName);
printf("GetModuleFileName copied '%s' return %d \n", lpFileName, nSize);
return nSize - 1;
}
......@@ -114,14 +127,31 @@ HANDLE LoadLibrary(LPSTR libname)
HANDLE hModule;
LPMODULEENTRY lpMod = lpModList;
LPMODULEENTRY lpNewMod;
int i;
char temp[64];
if (FindDLLTable(libname))
printf("LoadLibrary '%s'\n", libname);
/* extract dllname */
strcpy(temp, libname);
if (strchr(temp, '\\') || strchr(temp, '/'))
for (i = strlen(temp) - 1; i ; i--)
if (temp[i] == '\\' || temp[i] == '/') {
strcpy(temp, temp + i + 1);
break;
}
for (i = strlen(temp) - 1; i ; i--)
if (temp[i] == '.') {
temp[i] = 0;
break;
}
if (FindDLLTable(temp))
{
printf("Library was a builtin - returning 0x23\n");
return WINE_CODE_SELECTOR;
printf("Library was a builtin - \n");
return GetModuleHandle(temp);
}
printf("LoadLibrary '%s'\n", libname);
if (lpMod != NULL)
{
while (TRUE)
......@@ -176,7 +206,13 @@ HANDLE LoadLibrary(LPSTR libname)
void FreeLibrary(HANDLE hLib)
{
LPMODULEENTRY lpMod = lpModList;
printf("FreeLibrary(%04X);\n", hLib);
/* built-in dll ? */
if (IS_BUILTIN_DLL(hLib))
return;
while (lpMod != NULL) {
if (lpMod->hInst == hLib) {
if (lpMod->Count == 1) {
......@@ -201,31 +237,49 @@ void FreeLibrary(HANDLE hLib)
*/
FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
{
WORD wOrdin;
int sel, addr, ret;
int i, sel, addr, ret;
register struct w_files *w = wine_files;
int ordinal, len;
char * cpnt;
char C[128];
HTASK hTask;
LPTASKENTRY lpTask;
if (hModule >= 0xF000) {
if ((int) proc_name & 0xffff0000) {
/* built-in dll ? */
if (IS_BUILTIN_DLL(hModule))
{
if ((int) proc_name & 0xffff0000)
{
printf("GetProcAddress: builtin %#04X, '%s'\n",
hModule, proc_name);
/* wOrdin = FindOrdinalFromName(struct dll_table_entry_s *dll_table, proc_name); */
if (GetEntryDLLName(dll_builtin_table[hModule - 0xFF00].dll_name,
proc_name, &sel, &addr))
{
printf("Address not found !\n");
}
else {
}
else
{
printf("GetProcAddress: builtin %#04X, %d\n",
hModule, (int)proc_name);
if (GetEntryDLLOrdinal(dll_builtin_table[hModule-0xFF00].dll_name,
(int)proc_name & 0x0000FFFF, &sel, &addr))
{
printf("Address not found !\n");
}
return NULL;
}
if (hModule == 0) {
ret = MAKELONG(addr, sel);
printf("GetProcAddress // ret=%08X sel=%04X addr=%04X\n",
ret, sel, addr);
return (FARPROC)ret;
}
if (hModule == 0)
{
hTask = GetCurrentTask();
printf("GetProcAddress // GetCurrentTask()=%04X\n", hTask);
lpTask = (LPTASKENTRY) GlobalLock(hTask);
if (lpTask == NULL) {
if (lpTask == NULL)
{
printf("GetProcAddress: can't find current module handle !\n");
return NULL;
}
......@@ -234,14 +288,18 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
lpTask->hModule, lpTask->hInst);
GlobalUnlock(hTask);
}
while (w && w->hinstance != hModule) w = w->next;
if (w == NULL) return NULL;
while (w && w->hinstance != hModule)
w = w->next;
if (w == NULL)
return NULL;
printf("GetProcAddress // Module Found ! w->filename='%s'\n", w->filename);
if ((int)proc_name & 0xFFFF0000) {
if ((int)proc_name & 0xFFFF0000)
{
AnsiUpper(proc_name);
printf("GetProcAddress: %04X, '%s'\n", hModule, proc_name);
cpnt = w->nrname_table;
while(TRUE) {
while(TRUE)
{
if (((int) cpnt) - ((int)w->nrname_table) >
w->ne_header->nrname_tab_length) return NULL;
len = *cpnt++;
......@@ -251,23 +309,27 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
printf("pointing Function '%s' ordinal=%d !\n",
C, *((unsigned short *)(cpnt + len)));
#endif
if (strncmp(cpnt, proc_name, len) == 0) {
if (strncmp(cpnt, proc_name, len) == 0)
{
ordinal = *((unsigned short *)(cpnt + len));
break;
}
cpnt += len + 2;
};
if (ordinal == 0) {
if (ordinal == 0)
{
printf("GetProcAddress // function '%s' not found !\n", proc_name);
return NULL;
}
}
else {
else
{
printf("GetProcAddress: %#04x, %d\n", hModule, (int) proc_name);
ordinal = (int)proc_name;
}
ret = GetEntryPointFromOrdinal(w, ordinal);
if (ret == -1) {
if (ret == -1)
{
printf("GetProcAddress // Function #%d not found !\n", ordinal);
return NULL;
}
......
......@@ -248,6 +248,43 @@ load_typeinfo (int fd, struct resource_typeinfo_s *typeinfo)
return read (fd, typeinfo, sizeof (*typeinfo)) == sizeof (*typeinfo);
}
#endif
int
type_match(int type_id1, int type_id2, int fd, off_t off)
{
off_t old_pos;
unsigned char c;
size_t nbytes;
char name[256];
if (type_id1 == -1)
return 1;
if ((type_id1 & 0xffff0000) == 0) {
if ((type_id2 & 0x8000) == 0)
return 0;
return (type_id1 & 0x000f) == (type_id2 & 0x000f);
}
if ((type_id2 & 0x8000) != 0)
return 0;
#ifdef DEBUG_RESOURCE
printf("type_compare: type_id2=%04X !\n", type_id2);
#endif
old_pos = lseek(fd, 0, SEEK_CUR);
lseek(fd, off + type_id2, SEEK_SET);
read(fd, &c, 1);
nbytes = CONV_CHAR_TO_LONG (c);
#ifdef DEBUG_RESOURCE
printf("type_compare: namesize=%d\n", nbytes);
#endif
read(fd, name, nbytes);
lseek(fd, old_pos, SEEK_SET);
name[nbytes] = '\0';
#ifdef DEBUG_RESOURCE
printf("type_compare: name=`%s'\n", name);
#endif
return strcasecmp((char *) type_id1, name) == 0;
}
/**********************************************************************
* FindResourceByNumber
*/
......@@ -281,8 +318,7 @@ FindResourceByNumber(struct resource_nameinfo_s *result_p,
/*
* Find resource.
*/
typeinfo.type_id = 0xffff;
while (typeinfo.type_id != 0) {
for (;;) {
if (!load_typeinfo (ResourceFd, &typeinfo)){
printf("FindResourceByNumber (%X) bad typeinfo size !\n", resource_id);
return -1;
......@@ -292,7 +328,8 @@ FindResourceByNumber(struct resource_nameinfo_s *result_p,
typeinfo.type_id, typeinfo.count, type_id);
#endif
if (typeinfo.type_id == 0) break;
if (typeinfo.type_id == type_id || type_id == -1) {
if (type_match(type_id, typeinfo.type_id, ResourceFd, rtoff)) {
for (i = 0; i < typeinfo.count; i++) {
#ifndef WINELIB
if (read(ResourceFd, &nameinfo, sizeof(nameinfo)) !=
......@@ -306,7 +343,7 @@ FindResourceByNumber(struct resource_nameinfo_s *result_p,
}
#ifdef DEBUG_RESOURCE
printf("FindResource: search type=%X id=%X // type=%X id=%X\n",
type_id, resource_id, typeinfo.type_id, nameinfo.id);
type_id, resource_id, typeinfo.type_id, type_id2);
#endif
if (nameinfo.id == resource_id) {
memcpy(result_p, &nameinfo, sizeof(nameinfo));
......@@ -377,8 +414,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
/*
* Find resource.
*/
typeinfo.type_id = 0xffff;
while (typeinfo.type_id != 0)
for (;;)
{
if (!load_typeinfo (ResourceFd, &typeinfo))
{
......@@ -390,7 +426,7 @@ FindResourceByName(struct resource_nameinfo_s *result_p,
typeinfo.type_id, typeinfo.count, type_id);
#endif
if (typeinfo.type_id == 0) break;
if (typeinfo.type_id == type_id || type_id == -1)
if (type_match(type_id, typeinfo.type_id, ResourceFd, rtoff))
{
for (i = 0; i < typeinfo.count; i++)
{
......@@ -529,6 +565,16 @@ HICON LoadIcon(HANDLE instance, LPSTR icon_name)
rgbq[1].rgbGreen = 0x00;
rgbq[1].rgbRed = 0x00;
rgbq[1].rgbReserved = 0x00;
if (bih->biSizeImage == 0) {
if (bih->biCompression != BI_RGB) {
printf("Unknown size for compressed Icon bitmap.\n");
GlobalFree(rsc_mem);
ReleaseDC(GetDesktopWindow(), hdc);
return 0;
}
bih->biSizeImage = (bih->biWidth * bih->biHeight * bih->biBitCount
+ 7) / 8;
}
lpico->hBitMask = CreateDIBitmap(hdc, bih, CBM_INIT,
(LPSTR)lp + bih->biSizeImage - sizeof(BITMAPINFOHEADER) / 2 - 4,
(BITMAPINFO *)bih, DIB_RGB_COLORS );
......@@ -667,6 +713,7 @@ HANDLE FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name)
{
RESOURCE *r;
HANDLE rh;
int type;
if (instance == 0)
return 0;
......@@ -688,15 +735,39 @@ HANDLE FindResource(HANDLE instance, LPSTR resource_name, LPSTR type_name)
r->info_mem = rh;
r->rsc_mem = 0;
if (((int) type_name & 0xffff0000) == 0)
{
type = (int) type_name;
}
else if (type_name[0] == '\0')
{
type = -1;
}
else if (type_name[0] == '#')
{
type = atoi(type_name + 1);
}
else
{
type = (int) type_name;
}
if (((int) resource_name & 0xffff0000) == 0)
{
r->size_shift = FindResourceByNumber(&r->nameinfo, (int)type_name,
r->size_shift = FindResourceByNumber(&r->nameinfo, type,
(int) resource_name | 0x8000);
}
else if (resource_name[0] == '\0')
{
r->size_shift = FindResourceByNumber(&r->nameinfo, type, -1);
}
else if (resource_name[0] == '#')
{
r->size_shift = FindResourceByNumber(&r->nameinfo, type,
atoi(resource_name + 1));
}
else
{
r->size_shift = FindResourceByName(&r->nameinfo, (int)type_name,
resource_name);
r->size_shift = FindResourceByName(&r->nameinfo, type, resource_name);
}
if (r->size_shift == -1)
......@@ -906,7 +977,7 @@ LoadString(HANDLE instance, WORD resource_id, LPSTR buffer, int buflen)
GlobalFree(hmem);
#ifdef DEBUG_RESOURCE
printf(" '%s'\n", buffer);
printf("LoadString // '%s' copied !\n", buffer);
#endif
return i;
}
......
......@@ -417,7 +417,7 @@ WORD FreeSelector(WORD sel)
if (s->shm_key == 0)
{
munmap(s->base_addr, ((s->length + PAGE_SIZE) & ~(PAGE_SIZE - 1)));
memcpy(s, 0, sizeof(*s));
memset(s, 0, sizeof(*s));
SelectorMap[sel_idx] = 0;
}
else
......@@ -432,7 +432,7 @@ WORD FreeSelector(WORD sel)
if (alias_count == 1)
shmctl(s->shm_key, IPC_RMID, NULL);
memcpy(s, 0, sizeof(*s));
memset(s, 0, sizeof(*s));
SelectorMap[sel_idx] = 0;
}
......@@ -457,7 +457,7 @@ WORD FreeSelector(WORD sel)
{
s = &Segments[sel_idx];
munmap(s->base_addr, ((s->length + PAGE_SIZE) & ~(PAGE_SIZE - 1)));
memcpy(s, 0, sizeof(*s));
memset(s, 0, sizeof(*s));
SelectorMap[sel >> 3] = 0;
}
#endif /* HAVE_IPC */
......@@ -847,15 +847,10 @@ CreateSelectors(struct w_files * wpnt)
* First we need to check for local heap. Second we nee to see if
* this is also the stack segment.
*/
if (i + 1 == ne_header->auto_data_seg)
if (i + 1 == ne_header->auto_data_seg || i + 1 == ne_header->ss)
{
s->length += ne_header->local_heap_length;
if (i + 1 == ne_header->ss)
{
s->length += ne_header->stack_length;
ne_header->sp = s->length;
}
s->length = 0x10000;
ne_header->sp = s->length - 2;
}
/*
......
......@@ -132,6 +132,11 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
goto oops;
break;
case 0x2f:
if (!do_int2f(scp))
goto oops;
break;
default:
fprintf(stderr,"Unexpected Windows interrupt %x\n", *instr);
goto oops;
......
......@@ -790,5 +790,6 @@ DWORD GetFreeSpace(UINT wFlags)
if (free_map[i] == 1)
total_free++;
printf("GetFreeSpace // return %ld !\n", total_free << 16);
return total_free << 16;
}
......@@ -171,7 +171,7 @@ HCURSOR LoadCursor(HANDLE instance, LPSTR cursor_name)
ReleaseDC(GetDesktopWindow(), hdc);
return 0;
}
(char *)lp += 2;
lp++;
for (j = 0; j < 16; j++)
printf("%04X ", *(lp + j));
/*
......
......@@ -273,7 +273,7 @@ void ToDos(char *s)
*s++ = toupper(*p);
else {
*s++ = '\\';
if (*s == '/' || *s == '\\')
if (*(p+1) == '/' || *(p+1) == '\\')
p++;
}
}
......@@ -390,6 +390,26 @@ char *GetUnixFileName(char *dosfilename)
return(temp);
}
char *GetDosFileName(char *unixfilename)
{
int i;
char temp[256];
/* /dos/windows/system.ini => c:\windows\system.ini */
for (i = 0 ; i != MAX_DOS_DRIVES; i++) {
if (DosDrives[i].rootdir != NULL) {
if (strncmp(DosDrives[i].rootdir, unixfilename, strlen(DosDrives[i].rootdir)) == 0) {
sprintf(temp, "%c:\\%s", 'A' + i, unixfilename + strlen(DosDrives[i].rootdir) + 1);
ToDos(temp);
return temp;
}
}
}
strcpy(temp, unixfilename);
ToDos(temp);
return(temp);
}
char *DOS_GetCurrentDir(int drive)
{
/* should return 'WINDOWS\SYSTEM' */
......@@ -734,11 +754,7 @@ struct dosdirent *DOS_readdir(struct dosdirent *de)
do {
if ((d = readdir(de->ds)) == NULL)
{
closedir(de->ds);
de->inuse = 0;
return de;
}
return NULL;
strcpy(de->filename, d->d_name);
if (d->d_reclen > 12)
......@@ -765,7 +781,7 @@ struct dosdirent *DOS_readdir(struct dosdirent *de)
void DOS_closedir(struct dosdirent *de)
{
if (de->inuse)
if (de && de->inuse)
{
closedir(de->ds);
de->inuse = 0;
......
......@@ -58,19 +58,25 @@ INT lstrlen(LPCSTR str)
return strlen(str);
}
/* AnsiUpper USER.431 */
char FAR* AnsiUpper(char FAR* strOrChar)
{
/* I am not sure if the locale stuff works with toupper, but then again
I am not sure if the Linux libc locale stuffs works at all */
if((int)strOrChar<256)
/* if((int)strOrChar<256)
return (char FAR*) toupper((int)strOrChar);
else {
int i;
for(i=0;(i<65536)&&strOrChar[i];i++)
for(i=0;(i<65536) && strOrChar[i];i++)
strOrChar[i]=toupper(strOrChar[i]);
return strOrChar;
}
} */
int i;
for (i = 0; (i < 65536 && strOrChar[i]);i++)
strOrChar[i] = (strOrChar[i] >= 'a' && strOrChar[i] <= 'z') ?
strOrChar[i] - ('a' - 'A') : strOrChar[i];
return strOrChar;
}
/* AnsiLower USER.432 */
......@@ -78,14 +84,18 @@ char FAR* AnsiLower(char FAR* strOrChar)
{
/* I am not sure if the locale stuff works with tolower, but then again
I am not sure if the Linux libc locale stuffs works at all */
if((int)strOrChar<256)
/* if((int)strOrChar<256)
return (char FAR*)tolower((int)strOrChar);
else {
int i;
for(i=0;(i<65536)&&strOrChar[i];i++)
strOrChar[i]=tolower(strOrChar[i]);
return strOrChar;
}
}*/
int i;
for (i = 0; (i < 65536 && strOrChar[i]);i++)
strOrChar[i] = (strOrChar[i] >= 'A' && strOrChar[i] <= 'Z') ?
strOrChar[i] + ('a' - 'A') : strOrChar[i];
}
/* AnsiUpperBuff USER.437 */
......
......@@ -20,8 +20,9 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#define WINE_CLASS "Wine" /* Class name for resources */
LPSTR lpEnvList;
Display * XT_display; /* To be removed */
Screen * XT_screen; /* To be removed */
Display *display;
Screen *screen;
......@@ -298,7 +299,6 @@ int main( int argc, char *argv[] )
screenWidth = WidthOfScreen( screen );
screenHeight = HeightOfScreen( screen );
XT_display = display;
XT_screen = screen;
if (screenDepth) /* -depth option specified */
{
depth_list = XListDepths(display,DefaultScreen(display),&depth_count);
......@@ -360,6 +360,26 @@ LONG GetWinFlags(void)
}
/***********************************************************************
* SetEnvironment (GDI.132)
*/
int SetEnvironment(LPSTR lpPortName, LPSTR lpEnviron, WORD nCount)
{
printf("EMPTY STUB ! // SetEnvironnement('%s', '%s', %d) !\n",
lpPortName, lpEnviron, nCount);
return 0;
}
/***********************************************************************
* GetEnvironment (GDI.134)
*/
int GetEnvironment(LPSTR lpPortName, LPSTR lpEnviron, WORD nMaxSiz)
{
printf("EMPTY STUB ! // GetEnvironnement('%s', '%s', %d) !\n",
lpPortName, lpEnviron, nMaxSiz);
return 0;
}
/***********************************************************************
* GetTimerResolution (USER.14)
*/
LONG GetTimerResolution(void)
......
......@@ -58,13 +58,15 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
if (wndPtr == NULL) {
hInst = hSysRes;
#ifdef DEBUG_MSGBOX
printf("MessageBox(NULL, '%s', '%s', %04X)\n", str, title, type);
printf("MessageBox(NULL, %08X='%s', %08X='%s', %04X)\n",
str, str, title, title, type);
#endif
}
else {
hInst = wndPtr->hInstance;
#ifdef DEBUG_MSGBOX
printf("MessageBox(%04X, '%s', '%s', %04X)\n", hWnd, str, title, type);
printf("MessageBox(%04X, %08X='%s', %08X='%s', %04X)\n",
hWnd, str, str, title, title, type);
#endif
}
lpmb = (LPMSGBOX) malloc(sizeof(MSGBOX));
......@@ -379,7 +381,7 @@ BOOL FAR PASCAL AboutWine_Proc(HWND hDlg, WORD msg, WORD wParam, LONG lParam)
strcpy(str, "WINELOGO");
hBitMap = LoadBitmap((HINSTANCE)NULL, (LPSTR)str);
strcpy(str, "PROPOSED_LICENSE");
strcpy(str, "LICENSE");
printf("str = '%s'\n", str);
hFile = OpenFile((LPSTR)str, &ofstruct, OF_READ);
ptr = (LPSTR)malloc(2048);
......
......@@ -43,11 +43,15 @@ HANDLE RemoveProp(HWND hWnd, LPSTR lpStr)
return FALSE;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp == NULL) return 0;
if (lpProp == NULL) {
printf("Property List Empty !\n");
return 0;
}
while (TRUE) {
if ((((DWORD)lpStr & 0xFFFF0000) == 0L &&
lpProp->Atom == LOWORD((DWORD)lpStr)) ||
(((DWORD)lpStr & 0xFFFF0000) != 0L &&
lpProp->PropName != NULL &&
strcmp(lpProp->PropName, lpStr) == 0)) {
printf("RemoveProp // Property found ! hData=%04X\n", lpProp->hData);
hOldData = lpProp->hData;
......@@ -90,11 +94,15 @@ HANDLE GetProp(HWND hWnd, LPSTR lpStr)
return 0;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp == NULL) return 0;
if (lpProp == NULL) {
printf("Property List Empty !\n");
return 0;
}
while (TRUE) {
if ((((DWORD)lpStr & 0xFFFF0000) == 0L &&
lpProp->Atom == LOWORD((DWORD)lpStr)) ||
(((DWORD)lpStr & 0xFFFF0000) != 0L &&
lpProp->PropName != NULL &&
strcmp(lpProp->PropName, lpStr) == 0)) {
printf("GetProp // Property found ! hData=%04X\n", lpProp->hData);
GlobalUnlock(wndPtr->hProp);
......@@ -136,6 +144,7 @@ BOOL SetProp(HWND hWnd, LPSTR lpStr, HANDLE hData)
if ((((DWORD)lpStr & 0xFFFF0000) == 0L &&
lpProp->Atom == LOWORD((DWORD)lpStr)) ||
(((DWORD)lpStr & 0xFFFF0000) != 0L &&
lpProp->PropName != NULL &&
strcmp(lpProp->PropName, lpStr) == 0)) {
#ifdef DEBUG_PROP
printf("SetProp // change already exinsting property !\n");
......@@ -177,7 +186,7 @@ BOOL SetProp(HWND hWnd, LPSTR lpStr, HANDLE hData)
}
else {
lpNewProp->Atom = 0;
lpNewProp->PropName = malloc(strlen(lpStr));
lpNewProp->PropName = malloc(strlen(lpStr) + 1);
if (lpNewProp->PropName == NULL) {
printf("SetProp // Can't allocate memory for Property Name !\n");
GlobalUnlock(wndPtr->hProp);
......@@ -207,7 +216,10 @@ int EnumProps(HWND hWnd, FARPROC lpEnumFunc)
return 0;
}
lpProp = (LPPROPENTRY) GlobalLock(wndPtr->hProp);
if (lpProp == NULL) return 0;
if (lpProp == NULL) {
printf("Property List Empty !\n");
return 0;
}
if (lpEnumFunc != NULL) return 0;
while (TRUE) {
printf("EnumProps // lpProp->Atom=%04X !\n", lpProp->Atom);
......
......@@ -9,6 +9,7 @@ SRCS = \
int21.c \
int25.c \
int26.c \
int2f.c \
ioports.c \
kernel.c
......
static char RCSId[] = "$Id: heap.c,v 1.3 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include <stdlib.h>
#include <stdio.h>
#include "prototypes.h"
......@@ -19,9 +16,9 @@ int
WIN87_fpmath()
{
printf( "_fpmath: (%x:%x %x %x)\n",_CONTEXT->sc_cs, _CONTEXT->sc_eip,
_CONTEXT->sc_es, _BX);
_CONTEXT->sc_es, _BX & 0xffff);
switch(_BX )
switch(_BX & 0xffff)
{
case 11:
return 1;
......
......@@ -709,7 +709,6 @@ static void FindNext(struct sigcontext_struct *context)
do {
if ((dp = DOS_readdir(dp)) == NULL) {
DOS_closedir(dp);
Error(NoMoreFiles, EC_MediaError , EL_Disk);
EAX = (EAX & 0xffffff00L) | NoMoreFiles;
SetCflag;
......@@ -1026,7 +1025,6 @@ static void DeleteFileFCB(struct sigcontext_struct *context)
fprintf(stderr, "int21: delete file %s\n", temp);
/* unlink(GetUnixFileName(temp)); */
}
DOS_closedir(dp);
EAX = (EAX & 0xffffff00L);
}
......@@ -1072,7 +1070,6 @@ static void RenameFileFCB(struct sigcontext_struct *context)
strcpy(newnameptr, fcb + 1);
fprintf(stderr, "int21: renamefile %s -> %s\n", oldname, newname);
}
DOS_closedir(dp);
EAX = (EAX & 0xffffff00L);
}
......
......@@ -61,7 +61,7 @@ static XImage *BITMAP_BmpToImage( BITMAP * bmp, void * bmpData )
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;
......
......@@ -8,11 +8,19 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#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 @@ BOOL GDI_Init()
/***********************************************************************
* 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 @@ HANDLE GDI_AllocObject( WORD size, WORD magic )
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 @@ BOOL UnrealizeObject( HANDLE handle )
#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;
}
......@@ -418,7 +418,7 @@ BOOL GrayString(HDC hdc, HBRUSH hbr, FARPROC gsprc, LPARAM lParam,
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;
}
......
......@@ -156,7 +156,7 @@ HWND CreateDialogParam( HINSTANCE hInst, LPCSTR dlgTemplate,
LPCSTR data;
#ifdef DEBUG_DIALOG
printf( "CreateDialogParam: %d,'%s',%d,%p,%d\n",
printf( "CreateDialogParam: %d,'%x',%d,%p,%d\n",
hInst, dlgTemplate, owner, dlgProc, param );
#endif
......@@ -381,7 +381,7 @@ int DialogBoxParam( HINSTANCE hInst, LPCSTR dlgTemplate,
HWND hwnd;
#ifdef DEBUG_DIALOG
printf( "DialogBoxParam: %d,'%s',%d,%p,%d\n",
printf( "DialogBoxParam: %d,'%x',%d,%p,%d\n",
hInst, dlgTemplate, owner, dlgProc, param );
#endif
hwnd = CreateDialogParam( hInst, dlgTemplate, owner, dlgProc, param );
......@@ -451,6 +451,7 @@ BOOL IsDialogMessage( HWND hwndDlg, LPMSG msg )
int dlgCode = SendMessage( msg->hwnd, WM_GETDLGCODE, 0, 0 );
/* Process key message */
/* .... */
SendMessage( msg->hwnd, msg->message, msg->wParam, msg->lParam );
}
return TRUE;
}
......
......@@ -35,7 +35,7 @@ BOOL LineTo( HDC hdc, short x, short y )
}
if (DC_SetupGCForPen( dc ))
XDrawLine(XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawLine(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + XLPTODP( dc, dc->w.CursPosX ),
dc->w.DCOrgY + YLPTODP( dc, dc->w.CursPosY ),
dc->w.DCOrgX + XLPTODP( dc, x ),
......@@ -145,7 +145,7 @@ BOOL GRAPH_DrawArc( HDC hdc, int left, int top, int right, int bottom,
diff_angle = end_angle - start_angle;
if (diff_angle < 0.0) diff_angle += 2*PI;
XDrawArc( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1,
(int)(start_angle * 180 * 64 / PI),
......@@ -162,7 +162,7 @@ BOOL GRAPH_DrawArc( HDC hdc, int left, int top, int right, int bottom,
points[1].x = dc->w.DCOrgX + xcenter;
points[1].y = dc->w.DCOrgY + ycenter;
}
XDrawLines( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
points, lines+1, CoordModeOrigin );
return TRUE;
}
......@@ -222,11 +222,11 @@ BOOL Ellipse( HDC hdc, int left, int top, int right, int bottom )
if ((left == right) || (top == bottom)) return FALSE;
if (DC_SetupGCForBrush( dc ))
XFillArc( XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillArc( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
if (DC_SetupGCForPen( dc ))
XDrawArc( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1, 0, 360*64 );
return TRUE;
......@@ -253,11 +253,11 @@ BOOL Rectangle( HDC hdc, int left, int top, int right, int bottom )
bottom = YLPTODP( dc, bottom );
if (DC_SetupGCForBrush( dc ))
XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
if (DC_SetupGCForPen( dc ))
XDrawRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
return TRUE;
......@@ -289,41 +289,41 @@ BOOL RoundRect( HDC hDC, short left, short top, short right, short bottom,
x2 = XLPTODP(dc, right - ell_width);
y2 = YLPTODP(dc, bottom - ell_height);
if (DC_SetupGCForBrush(dc)) {
XFillArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x1, dc->w.DCOrgY + y1,
ell_width, ell_height, 90 * 64, 90 * 64);
XFillArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x1, dc->w.DCOrgY + y2,
ell_width, ell_height, 180 * 64, 90 * 64);
XFillArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x2, dc->w.DCOrgY + y2,
ell_width, ell_height, 270 * 64, 90 * 64);
XFillArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x2, dc->w.DCOrgY + y1,
ell_width, ell_height, 0, 90 * 64);
ell_width /= 2; ell_height /= 2;
XFillRectangle(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillRectangle(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left + ell_width, dc->w.DCOrgY + top,
right - left - 2 * ell_width, bottom - top);
XFillRectangle(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillRectangle(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top + ell_height,
ell_width, bottom - top - 2 * ell_height);
XFillRectangle(XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillRectangle(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + right - ell_width, dc->w.DCOrgY + top + ell_height,
ell_width, bottom - top - 2 * ell_height);
ell_width *= 2; ell_height *= 2;
}
if (DC_SetupGCForPen(dc)) {
XDrawArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x1, dc->w.DCOrgY + y1,
ell_width, ell_height, 90 * 64, 90 * 64);
XDrawArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x1, dc->w.DCOrgY + y2,
ell_width, ell_height, 180 * 64, 90 * 64);
XDrawArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x2, dc->w.DCOrgY + y2,
ell_width, ell_height, 270 * 64, 90 * 64);
XDrawArc(XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawArc(display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + x2, dc->w.DCOrgY + y1,
ell_width, ell_height, 0, 90 * 64);
}
......@@ -423,9 +423,9 @@ COLORREF SetPixel( HDC hdc, short x, short y, COLORREF color )
pixel = COLOR_ToPhysical( dc, color );
GetPaletteEntries( dc->w.hPalette, pixel, 1, &entry );
XSetForeground( XT_display, dc->u.x.gc, pixel );
XSetFunction( XT_display, dc->u.x.gc, GXcopy );
XDrawPoint( XT_display, dc->u.x.drawable, dc->u.x.gc, x, y );
XSetForeground( display, dc->u.x.gc, pixel );
XSetFunction( display, dc->u.x.gc, GXcopy );
XDrawPoint( display, dc->u.x.drawable, dc->u.x.gc, x, y );
return RGB( entry.peRed, entry.peGreen, entry.peBlue );
}
......@@ -450,13 +450,13 @@ COLORREF GetPixel( HDC hdc, short x, short y )
{
XWindowAttributes win_attr;
if (!XGetWindowAttributes( XT_display, dc->u.x.drawable, &win_attr ))
if (!XGetWindowAttributes( display, dc->u.x.drawable, &win_attr ))
return 0;
if (win_attr.map_state != IsViewable) return 0;
if ((x >= win_attr.width) || (y >= win_attr.height)) return 0;
}
image = XGetImage( XT_display, dc->u.x.drawable, x, y,
image = XGetImage( display, dc->u.x.drawable, x, y,
1, 1, AllPlanes, ZPixmap );
GetPaletteEntries( dc->w.hPalette, XGetPixel( image, 0, 0 ), 1, &entry );
XDestroyImage( image );
......@@ -494,7 +494,7 @@ BOOL PaintRgn( HDC hdc, HRGN hrgn )
GetClipBox( hdc, &box );
if (DC_SetupGCForBrush( dc ))
XFillRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + box.left, dc->w.DCOrgY + box.top,
box.right-box.left, box.bottom-box.top );
......@@ -541,7 +541,7 @@ void DrawFocusRect( HDC hdc, LPRECT rc )
oldBkMode = SetBkMode(hdc, TRANSPARENT);
if (DC_SetupGCForPen( dc ))
XDrawRectangle( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawRectangle( display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + left, dc->w.DCOrgY + top,
right-left-1, bottom-top-1 );
......@@ -601,12 +601,12 @@ BOOL Polyline (HDC hdc, LPPOINT pt, int count)
if (DC_SetupGCForPen( dc ))
{
for (i = 0; i < count-1; i ++)
XDrawLine (XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawLine (display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + XLPTODP(dc, pt [i].x),
dc->w.DCOrgY + YLPTODP(dc, pt [i].y),
dc->w.DCOrgX + XLPTODP(dc, pt [i+1].x),
dc->w.DCOrgY + YLPTODP(dc, pt [i+1].y));
XDrawLine (XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawLine (display, dc->u.x.drawable, dc->u.x.gc,
dc->w.DCOrgX + XLPTODP(dc, pt [count-1].x),
dc->w.DCOrgY + YLPTODP(dc, pt [count-1].y),
dc->w.DCOrgX + XLPTODP(dc, pt [0].x),
......@@ -644,12 +644,12 @@ BOOL Polygon (HDC hdc, LPPOINT pt, int count)
}
points [count] = points [0];
XFillPolygon( XT_display, dc->u.x.drawable, dc->u.x.gc,
XFillPolygon( display, dc->u.x.drawable, dc->u.x.gc,
points, count, Complex, CoordModeOrigin);
if (DC_SetupGCForPen ( dc ))
{
XDrawLines( XT_display, dc->u.x.drawable, dc->u.x.gc,
XDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
points, count, CoordModeOrigin );
}
}
......
......@@ -16,6 +16,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1994";
#include "syscolor.h"
static HBITMAP hbitmapClose = 0;
static HBITMAP hbitmapMDIClose = 0;
static HBITMAP hbitmapMinimize = 0;
static HBITMAP hbitmapMinimizeD = 0;
static HBITMAP hbitmapMaximize = 0;
......@@ -287,10 +288,14 @@ LONG NC_HandleNCHitTest( HWND hwnd, POINT pt )
static void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down )
{
RECT rect;
WND *wndPtr = WIN_FindWndPtr( hwnd );
HDC hdcMem = CreateCompatibleDC( hdc );
if (hdcMem)
{
NC_GetInsideRect( hwnd, &rect );
if (wndPtr->dwStyle & WS_CHILD)
SelectObject( hdcMem, hbitmapMDIClose );
else
SelectObject( hdcMem, hbitmapClose );
BitBlt( hdc, rect.left, rect.top, SYSMETRICS_CXSIZE,
SYSMETRICS_CYSIZE, hdcMem, 1, 1, down ? NOTSRCCOPY : SRCCOPY );
......@@ -457,6 +462,8 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
{
if (!(hbitmapClose = LoadBitmap( 0, MAKEINTRESOURCE(OBM_CLOSE) )))
return;
if (!(hbitmapMDIClose = LoadBitmap( 0, MAKEINTRESOURCE(OBM_OLD_CLOSE) )))
return;
hbitmapMinimize = LoadBitmap( 0, MAKEINTRESOURCE(OBM_REDUCE) );
hbitmapMinimizeD = LoadBitmap( 0, MAKEINTRESOURCE(OBM_REDUCED) );
hbitmapMaximize = LoadBitmap( 0, MAKEINTRESOURCE(OBM_ZOOM) );
......
......@@ -285,113 +285,72 @@ char *UTILITY_convertArgs(char *format, char *winarg)
#ifndef WINELIB
INT windows_wsprintf(BYTE *win_stack)
{
LPSTR lpOutput, lpFormat;
BYTE *new_stack, *stack_ptr, *ptr;
int stacklength, result;
LPSTR lpOutput, lpFormat, ptr;
BYTE new_stack[1024], *stack_ptr;
lpOutput = (LPSTR) *(DWORD*)win_stack;
win_stack += 4;
lpFormat = (LPSTR) *(DWORD*)win_stack;
win_stack += 4;
/* determine # of bytes pushed on 16-bit stack by checking printf's
format string */
ptr = lpFormat;
stacklength = 0;
do {
if (*ptr++ != '%')
continue;
/* skip width/precision */
while ( *ptr == '-' || *ptr == '+' || *ptr == '.' ||
*ptr == ' ' || isdigit(*ptr))
ptr++;
switch(*ptr++) {
case 'l': ptr++; /* skip next type character */
stacklength += 4;
continue;
case 's':
stacklength += 4;
continue;
case 'c':
case 'd':
case 'i':
case 'u':
case 'x':
case 'X':
stacklength += 2;
continue;
default:
fprintf(stderr, "wsprintf: oops, unknown formattype `%c' used!\n", *ptr);
}
} while (*ptr);
/* create 32-bit stack for libc's vsprintf() */
new_stack = malloc(2 * stacklength);
stack_ptr = new_stack + 2 * stacklength;
win_stack += stacklength;
ptr = lpFormat;
do {
if (*ptr++ != '%')
for (ptr = lpFormat, stack_ptr = new_stack; *ptr; ptr++) {
if (*ptr != '%' || *++ptr == '%')
continue;
/* skip width/precision */
while ( *ptr == '-' || *ptr == '+' || *ptr == '.' ||
while (*ptr == '-' || *ptr == '+' || *ptr == '.' ||
*ptr == ' ' || isdigit(*ptr))
ptr++;
switch(*ptr++) {
switch (*ptr++) {
case 's':
stack_ptr -= 4;
win_stack -= 4;
*(DWORD*)stack_ptr = *(DWORD*)win_stack;
continue;
stack_ptr += 4;
win_stack += 4;
break;
case 'l':
stack_ptr -= 4;
win_stack -= 4;
*(DWORD*)stack_ptr = *(DWORD*)win_stack;
stack_ptr += 4;
win_stack += 4;
ptr++; /* skip next type character */
continue;
break;
case 'c':
stack_ptr -= 4;
win_stack -= 2;
/* windows' wsprintf() %c ignores 0's, we replace 0 with 1 to make sure
/* windows' wsprintf() %c ignores 0's, we replace 0 with SPACE to make sure
that the remaining part of the string isn't ignored by the winapp */
if (*(WORD*)win_stack)
*(DWORD*)stack_ptr = *(WORD*)win_stack;
else
*(DWORD*)stack_ptr = 1;
continue;
*(DWORD*)stack_ptr = ' ';
stack_ptr += 4;
win_stack += 2;
break;
case 'd':
case 'i':
stack_ptr -= 4;
win_stack -= 2;
*(int*)stack_ptr = *(INT*)win_stack;
continue;
stack_ptr += 4;
win_stack += 2;
break;
case 'u':
case 'x':
case 'X':
stack_ptr -= 4;
win_stack -= 2;
*(DWORD*)stack_ptr = *(WORD*)win_stack;
continue;
stack_ptr += 4;
win_stack += 2;
break;
default:
stack_ptr -= 4;
win_stack -= 4;
*(DWORD*)stack_ptr = 0;
stack_ptr += 4;
win_stack += 4;
fprintf(stderr, "wsprintf: oops, unknown formattype %c used!\n", *ptr);
break;
}
}
} while (*ptr);
result = vsprintf(lpOutput, lpFormat, stack_ptr);
free(new_stack);
return result;
return vsprintf(lpOutput, lpFormat, new_stack);
}
#endif
......
......@@ -444,6 +444,9 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
WIN_SendParentNotify( hwnd, WM_CREATE, MAKELONG( hwnd, wndPtr->wIDmenu ) );
if (style & WS_VISIBLE) ShowWindow( hwnd, SW_SHOW );
#ifdef DEBUG_WIN
printf( "CreateWindowEx: return %04X \n", hwnd);
#endif
return hwnd;
}
......
......@@ -230,7 +230,7 @@ BOOL ShowWindow( HWND hwnd, int cmd )
int swpflags = 0;
#ifdef DEBUG_WIN
printf("ShowWindow: hwnd=%d, cmd=%d\n", hwnd, cmd);
printf("ShowWindow: hwnd=%04X, cmd=%d\n", hwnd, cmd);
#endif
if (!wndPtr) return FALSE;
......@@ -456,7 +456,7 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, short x, short y,
int changeMask = 0;
#ifdef DEBUG_WIN
printf( "SetWindowPos: %d %d %d,%d %dx%d 0x%x\n",
printf( "SetWindowPos: %04X %d %d,%d %dx%d 0x%x\n",
hwnd, hwndInsertAfter, x, y, cx, cy, flags );
#endif
......@@ -592,10 +592,14 @@ BOOL SetWindowPos( HWND hwnd, HWND hwndInsertAfter, short x, short y,
}
changeMask |= CWStackMode;
}
if ((newWindowRect.right - newWindowRect.left) != 0 &&
(newWindowRect.bottom - newWindowRect.top) != 0)
if (changeMask) XConfigureWindow( display, wndPtr->window,
changeMask, &winChanges );
if (winPos->flags & SWP_SHOWWINDOW)
if ((newWindowRect.right - newWindowRect.left) != 0 &&
(newWindowRect.bottom - newWindowRect.top) != 0 &&
(winPos->flags & SWP_SHOWWINDOW))
{
wndPtr->dwStyle |= WS_VISIBLE;
XMapWindow( display, wndPtr->window );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment