Commit 36ca1368 authored by Alexandre Julliard's avatar Alexandre Julliard

Release 940602

Sat May 28 12:03:23 1994 Bob Amstadt (bob@pooh) * miscemu/int21.c (OpenExistingFile): OpenExistingFile needed to return handle in AX register instead of the BX register. * miscemu/int21.c (ioctlGetDeviceInfo): Added a little code to give a fake result for normal files. Wed May 25 21:55:38 1994 Bob Amstadt (bob@pooh) * [memory/global.c] return value from GlobalSize was completely wrong. * [miscemu/int21.h] fixed bug in FindFirst. Directory pointer (dp) was not placed in dta correctly. * [tools/build.c] fixed creation of pop.h to guarantee that flags are restored correctly. * [misc/comm.c] changed all occurance of strncmp() to strncasecmp(). BuildCommDCB() should not require that OpenComm() be called first. * [loader/selector.c] Heap initialized to size of full segment less stack size and automatic data size. Sat May 28 09:14:33 1994 Rick Sladkey (jrs@world.std.com) * [controls/listbox.c] Correct typos in ListBoxResetContent where lpls variable is used where lsls2 variable is meant. Don't call USER_HEAP_FREE twice on the same handle if hData and hMem are the same. * [debugger/opcodes/i386-dis.c] Add new name array names_rmw for table driven decoding of the 16-bit mod/rm field. Omit large case statement in OP_E and replace with array reference to match existing coding style. Add new static variable machine with value 286 or 386 to correctly decode mod/rm field in either 16 or 32 bit modes. Set it in print_insn_i{2,3}86. In OP_E use it to decide how to decode mod/rm. While the code was correct for 16 bit code, it was improperly decoding mod/rm fields on word prefixed 32 bit instructions. * [debugger/debug.l] Recognize new token ABORT. Recognize single letters 'p' and 'q' as tokens. * [debugger/dbg.y] Add new token ABORT. Allow print command to be invoked by 'p' and quit command by 'q', ala GDB. Change lots of '};' to just '}'. Add static dummy_regs to wine_debug so that wine_debug(0, NULL) doesn't core dump with qmagic. * [debugger/info.c] Correct syntax of break command in helptext and omit former comment about probable bugginess of the disassembly since it is now correct. Change fprintf of first backtrace stack frame to match that of the second and subsequent frames. * [loader/selector.c] Change construction of command line in CreatePSP from creating a string that looks like "arg1 arg2 \r" to "arg1 arg2". A DOS PSP command line looks like " arg1 arg2\r" with the length not including the trailing "\r" but that is not how Windows does it. * [loader/library.c] Change uses of %s to print strings in GetModuleHandle to %x so that string IDs don't cause a core dump with qmagic. Handle converting a string id to a literal module handle. For example, GetModuleHandle((LPSTR) 0x57) now returns 0x57 if it is a real module handle. * [misc/message.c] In MessageBox, translate a NULL title argument to the string "Error". * [misc/profile.c] In GetSetProfile translate a NULL Default argument to "". Any caller whose Default argument is NULL is buggy, but CHARMAP does it anyway. * [objects/font.c] Add NULL pointer checks in EnumFontFamilies to prevent core dumps. Sat May 28 20:01:51 1994 Jon Tombs (jon@gtex02.us.es) * New options/resourses nosaveunders and nobackingstore. By default backingstore and saveunders are now enabled, these use more memory but avoids those slow (sometimes multiple) redraws caused be exposure events. May 30, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte) * [misc/driver.c] New file Skeleton for 'Installable Wine Drivers' functions. :-) * [misc/audio.c] New file Skeleton for basic 'Audio Driver' functions. * [misc/network.c] New file Stubs for few networking functions. * [misc/mmsystem.c] More coding ... a dust in a galaxy ... * [misc/shell.c] Some coding for 'RegXXX' functions ... a dust in the wind ... * [misc/profile.c] Bug fix in GetSetProfile(), bad enumeration if KeyName == NULL. * [objects/gdi.c] New function CreateDiscardableBitmap(), it just calling CreateCompatibleBitmap() for now. It's get 'clock.exe' running ! :-) * [controls/listbox.c] * [controls/combo.c] New font member assigned to SYSTEM_FONT as default. Added processing for WM_SETFONT message; Tue May 31 20:34:25 EDT 1994 John Richardson <jrichard@cs.uml.edu> * [windows/event.c] Added AsyncMouseButtonsStates array for GetAsyncKeyState. * [windows/keyboard.c] Implemented beginning of GetAsyncKeyState. Wed May 25 23:35:03 1994 David Metcalfe <david@prism.demon.co.uk> * [objects/metafile.c] [include/metafile.h] [windows/mapping.c] [objects/clipping.c] [objects/bitblt.c] [windows/dc.c] Further metafile support.
parent 1f57929b
----------------------------------------------------------------------
Sat May 28 12:03:23 1994 Bob Amstadt (bob@pooh)
* miscemu/int21.c (OpenExistingFile):
OpenExistingFile needed to return handle in AX register instead
of the BX register.
* miscemu/int21.c (ioctlGetDeviceInfo):
Added a little code to give a fake result for normal files.
Wed May 25 21:55:38 1994 Bob Amstadt (bob@pooh)
* [memory/global.c]
return value from GlobalSize was completely wrong.
* [miscemu/int21.h]
fixed bug in FindFirst. Directory pointer (dp) was not placed in
dta correctly.
* [tools/build.c]
fixed creation of pop.h to guarantee that flags are restored correctly.
* [misc/comm.c]
changed all occurance of strncmp() to strncasecmp().
BuildCommDCB() should not require that OpenComm() be called first.
* [loader/selector.c]
Heap initialized to size of full segment less stack size and
automatic data size.
Sat May 28 09:14:33 1994 Rick Sladkey (jrs@world.std.com)
* [controls/listbox.c]
Correct typos in ListBoxResetContent where lpls variable is
used where lsls2 variable is meant. Don't call USER_HEAP_FREE
twice on the same handle if hData and hMem are the same.
* [debugger/opcodes/i386-dis.c]
Add new name array names_rmw for table driven decoding of the
16-bit mod/rm field. Omit large case statement in OP_E and
replace with array reference to match existing coding style.
Add new static variable machine with value 286 or 386 to
correctly decode mod/rm field in either 16 or 32 bit modes.
Set it in print_insn_i{2,3}86. In OP_E use it to decide how
to decode mod/rm. While the code was correct for 16 bit code,
it was improperly decoding mod/rm fields on word prefixed
32 bit instructions.
* [debugger/debug.l]
Recognize new token ABORT. Recognize single letters 'p'
and 'q' as tokens.
* [debugger/dbg.y]
Add new token ABORT. Allow print command to be invoked by
'p' and quit command by 'q', ala GDB. Change lots of '};'
to just '}'. Add static dummy_regs to wine_debug so that
wine_debug(0, NULL) doesn't core dump with qmagic.
* [debugger/info.c]
Correct syntax of break command in helptext and omit former
comment about probable bugginess of the disassembly since it
is now correct. Change fprintf of first backtrace stack
frame to match that of the second and subsequent frames.
* [loader/selector.c]
Change construction of command line in CreatePSP from creating
a string that looks like "arg1 arg2 \r" to "arg1 arg2". A DOS
PSP command line looks like " arg1 arg2\r" with the length not
including the trailing "\r" but that is not how Windows does it.
* [loader/library.c]
Change uses of %s to print strings in GetModuleHandle to %x so
that string IDs don't cause a core dump with qmagic. Handle
converting a string id to a literal module handle. For
example, GetModuleHandle((LPSTR) 0x57) now returns 0x57 if
it is a real module handle.
* [misc/message.c]
In MessageBox, translate a NULL title argument to the string "Error".
* [misc/profile.c]
In GetSetProfile translate a NULL Default argument to "". Any
caller whose Default argument is NULL is buggy, but CHARMAP does it
anyway.
* [objects/font.c]
Add NULL pointer checks in EnumFontFamilies to prevent core dumps.
Sat May 28 20:01:51 1994 Jon Tombs (jon@gtex02.us.es)
* New options/resourses nosaveunders and nobackingstore. By
default backingstore and saveunders are now enabled, these use
more memory but avoids those slow (sometimes multiple) redraws
caused be exposure events.
May 30, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [misc/driver.c] New file
Skeleton for 'Installable Wine Drivers' functions. :-)
* [misc/audio.c] New file
Skeleton for basic 'Audio Driver' functions.
* [misc/network.c] New file
Stubs for few networking functions.
* [misc/mmsystem.c]
More coding ... a dust in a galaxy ...
* [misc/shell.c]
Some coding for 'RegXXX' functions ... a dust in the wind ...
* [misc/profile.c]
Bug fix in GetSetProfile(), bad enumeration if KeyName == NULL.
* [objects/gdi.c]
New function CreateDiscardableBitmap(), it just calling
CreateCompatibleBitmap() for now. It's get 'clock.exe' running ! :-)
* [controls/listbox.c]
* [controls/combo.c]
New font member assigned to SYSTEM_FONT as default.
Added processing for WM_SETFONT message;
Tue May 31 20:34:25 EDT 1994 John Richardson <jrichard@cs.uml.edu>
* [windows/event.c]
Added AsyncMouseButtonsStates array for GetAsyncKeyState.
* [windows/keyboard.c]
Implemented beginning of GetAsyncKeyState.
Wed May 25 23:35:03 1994 David Metcalfe <david@prism.demon.co.uk>
* [objects/metafile.c] [include/metafile.h]
[windows/mapping.c] [objects/clipping.c] [objects/bitblt.c]
[windows/dc.c]
Further metafile support.
----------------------------------------------------------------------
Mon May 23 15:07:36 1994 Bob Amstadt (bob@pooh)
* [loader/selector.c]
......@@ -30,7 +167,7 @@ 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)
May 23, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/menu.c]
New functions GetMenuItemCount(), GetMenuItemID().
......
......@@ -197,6 +197,17 @@ bob@amscons.com
7. WHAT'S NEW
WHAT'S NEW with Wine-940602: (see ChangeLog for details)
- CLOCK.EXE runs.
- ABORT command added to debugger.
- Windows environment is now imported from the UNIX environment.
- Use of save unders and backing store are now the default. Resource
and command line options have been added to disable these things.
- Assorted new driver functions
- GetAsyncKeyState()
- More metafile support
- and many many bug fixes!
WHAT'S NEW with Wine-940524: (see ChangeLog for details)
- New menu functions
- EnumObjects()
......
......@@ -673,7 +673,7 @@ void EDIT_WriteTextLine(HWND hwnd, RECT *rect, int y)
int col, off = 0;
int sbl, sel, sbc, sec;
RECT rc;
div_t num;
BOOL trunc = FALSE;
WND *wndPtr = WIN_FindWndPtr(hwnd);
EDITSTATE *es = (EDITSTATE *)EDIT_HEAP_ADDR((HANDLE)(*(wndPtr->wExtra)));
......
......@@ -78,6 +78,7 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
lphl->hWndLogicParent = (HWND)HIWORD(createStruct->lpCreateParams);
else
lphl->hWndLogicParent = GetParent(hwnd);
lphl->hFont = GetStockObject(SYSTEM_FONT);
lphl->ColumnsWidth = wndPtr->rectClient.right - wndPtr->rectClient.left;
if (wndPtr->dwStyle & WS_VSCROLL) {
SetScrollRange(hwnd, SB_VERT, 1, lphl->ItemsCount, TRUE);
......@@ -330,6 +331,14 @@ LONG ListBoxWndProc( HWND hwnd, WORD message, WORD wParam, LONG lParam )
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
break;
case WM_SETFONT:
lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr);
if (lphl == NULL) return 0;
if (wParam == 0)
lphl->hFont = GetStockObject(SYSTEM_FONT);
else
lphl->hFont = wParam;
if (wParam == 0) break;
case WM_PAINT:
wndPtr = WIN_FindWndPtr(hwnd);
if ((wndPtr->dwStyle & LBS_OWNERDRAWFIXED) == LBS_OWNERDRAWFIXED) {
......@@ -514,6 +523,7 @@ void StdDrawListBox(HWND hwnd)
}
lphl = ListBoxGetWindowAndStorage(hwnd, &wndPtr);
if (lphl == NULL) goto EndOfPaint;
SelectObject(hdc, lphl->hFont);
hBrush = SendMessage(lphl->hWndLogicParent, WM_CTLCOLOR, (WORD)hdc,
MAKELONG(hwnd, CTLCOLOR_LISTBOX));
if (hBrush == (HBRUSH)NULL) hBrush = GetStockObject(WHITE_BRUSH);
......@@ -986,8 +996,9 @@ int ListBoxResetContent(HWND hwnd)
#ifdef DEBUG_LISTBOX
printf("ResetContent #%u\n", i);
#endif
if (lpls2->hData != 0) USER_HEAP_FREE(lpls->hData);
if (lpls2->hMem != 0) USER_HEAP_FREE(lpls->hMem);
if (lpls2->hData != 0 && lpls2->hData != lpls2->hMem)
USER_HEAP_FREE(lpls2->hData);
if (lpls2->hMem != 0) USER_HEAP_FREE(lpls2->hMem);
}
if (lpls == NULL) break;
}
......@@ -1093,6 +1104,7 @@ int ListBoxGetSel(HWND hwnd, WORD wIndex)
int ListBoxDirectory(HWND hwnd, UINT attrib, LPSTR filespec)
{
struct dosdirent *dp;
struct dosdirent *newdp;
struct stat st;
int x, wRet;
char temp[256];
......@@ -1100,9 +1112,8 @@ int ListBoxDirectory(HWND hwnd, UINT attrib, LPSTR filespec)
fprintf(stderr,"ListBoxDirectory: %s, %4x\n",filespec,attrib);
#endif
if ((dp = (struct dosdirent *)DOS_opendir(filespec)) ==NULL) return 0;
while (1) {
dp = (struct dosdirent *)DOS_readdir(dp);
if (!dp->inuse) break;
while (dp = (struct dosdirent *)DOS_readdir(dp)) {
if (!dp->inuse) break;
#ifdef DEBUG_LISTBOX
printf("ListBoxDirectory %08X '%s' !\n", dp->filename, dp->filename);
#endif
......
......@@ -43,6 +43,7 @@ void mode_command(int);
%token NO_SYMBOL
%token SYMBOLFILE
%token DEFINE
%token ABORT
%%
......@@ -52,17 +53,20 @@ void mode_command(int);
line: '\n'
| infocmd '\n'
| error '\n' { yyerrok; }
| QUIT '\n' { exit(0); };
| HELP '\n' { dbg_help(); };
| CONT '\n' { return; };
| SYMBOLFILE IDENTIFIER '\n' { read_symboltable($2); };
| DEFINE IDENTIFIER expr '\n' { add_hash($2, $3); };
| MODE NUM { mode_command($2); };
| ENABLE NUM { enable_break($2); };
| DISABLE NUM { disable_break($2); };
| BREAK '*' expr { add_break($3); };
| QUIT '\n' { exit(0); }
| 'q' '\n' { exit(0); }
| HELP '\n' { dbg_help(); }
| CONT '\n' { return; }
| 'c' '\n' { return; }
| ABORT '\n' { kill(getpid(), SIGABRT); }
| SYMBOLFILE IDENTIFIER '\n' { read_symboltable($2); }
| DEFINE IDENTIFIER expr '\n' { add_hash($2, $3); }
| MODE NUM { mode_command($2); }
| ENABLE NUM { enable_break($2); }
| DISABLE NUM { disable_break($2); }
| BREAK '*' expr { add_break($3); }
| x_command
| BACKTRACE '\n' { dbg_bt(); };
| BACKTRACE '\n' { dbg_bt(); }
| print_command
| deposit_command
......@@ -73,12 +77,18 @@ deposit_command:
x_command:
'x' expr '\n' { examine_memory($2, 1, 'x'); };
| 'x' '/' fmt expr '\n' { examine_memory($4, 1, $3); };
| 'x' '/' NUM fmt expr '\n' { examine_memory($5, $3, $4); };
'x' expr '\n' { examine_memory($2, 1, 'x'); }
| 'x' '/' fmt expr '\n' { examine_memory($4, 1, $3); }
| 'x' '/' NUM fmt expr '\n' { examine_memory($5, $3, $4); }
print:
'p'
| print
print_command:
PRINT expr '\n' { examine_memory(((unsigned int) &$2 ), 1, 'x'); };
print expr '\n' { examine_memory(((unsigned int) &$2 ), 1, 'x'); }
| print '/' fmt expr '\n' { examine_memory((unsigned int) &$4, 1, $3); }
| print '/' NUM fmt expr '\n' { examine_memory((unsigned int) &$5, $3, $4); }
fmt: 'x' { $$ = 'x'; }
| 'd' { $$ = 'd'; }
......@@ -92,20 +102,20 @@ x_command:
if($$ == 0xffffffff) {
fprintf(stderr,"Symbol %s not found\n", $1);
YYERROR;
};
};
}
}
expr: NUM { $$ = $1; }
| REG { if(regval) $$ = regval[$1]; else application_not_running();}
| symbol { $$ = *((unsigned int *) $1); }
| expr '+' NUM { $$ = $1 + $3; }
| expr '-' NUM { $$ = $1 - $3; };
| '(' expr ')' { $$ = $2; };
| '*' expr { $$ = *((unsigned int *) $2); };
| expr '-' NUM { $$ = $1 - $3; }
| '(' expr ')' { $$ = $2; }
| '*' expr { $$ = *((unsigned int *) $2); }
infocmd: INFO REGS { info_reg(); }
| INFO STACK { info_stack(); };
| INFO BREAK { info_break(); };
| INFO STACK { info_stack(); }
| INFO BREAK { info_break(); }
%%
......@@ -141,8 +151,10 @@ wine_debug(int signal, int * regs)
#ifdef YYDEBUG
yydebug = 0;
#endif
static int dummy_regs[32];
yyin = stdin;
regval = regs;
regval = regs ? regs : dummy_regs;
#ifdef linux
if((SC_CS & 7) != 7) {
......@@ -151,7 +163,7 @@ wine_debug(int signal, int * regs)
} else {
dbg_mask = 0xffff;
dbg_mode = 16;
};
}
#endif
#ifdef __NetBSD__
if(SC_CS == 0x1f) {
......@@ -160,7 +172,7 @@ wine_debug(int signal, int * regs)
} else {
dbg_mask = 0xffff;
dbg_mode = 16;
};
}
#endif
fprintf(stderr,"In %d bit mode.\n", dbg_mode);
......@@ -170,7 +182,7 @@ wine_debug(int signal, int * regs)
if(!loaded_symbols){
loaded_symbols++;
load_entrypoints();
};
}
#endif
/* Remove the breakpoints from memory... */
......@@ -187,7 +199,7 @@ wine_debug(int signal, int * regs)
}
/* Show where we crashed */
if(regval)
if(regs)
examine_memory(SC_EIP(dbg_mask), 1, 'i');
issue_prompt();
......
......@@ -98,6 +98,7 @@ cont|con|co { return CONT; }
symbolfile|symbolfil|symbolfi|symbolf|symbol|symbo|symb { return SYMBOLFILE; }
define|defin|defi|def|de { return DEFINE; }
abort|abor|abo { return ABORT; }
print|prin|pri|pr { return PRINT; }
mode { return MODE; }
......@@ -106,13 +107,15 @@ regs|reg|re { return REGS; }
stack|stac|sta|st { return STACK; }
x { return 'x'; }
p { return 'p'; }
x { return 'x'; }
d { return 'd'; }
i { return 'i'; }
w { return 'w'; }
b { return 'b'; }
s { return 's'; }
c { return 'c'; }
q { return 'q'; }
{IDENTIFIER} {yylval = (int) make_symbol(yytext);
return IDENTIFIER;
......
......@@ -222,7 +222,7 @@ char * helptext[] = {
"of the commands that gdb would accept. The commands currently",
"are:\n",
" info [reg,stack,break]",
" break <addr>",
" break *<addr>",
" enable bpnum",
" disable bpnum",
" help",
......@@ -246,10 +246,6 @@ char * helptext[] = {
" symbolfile command. Symbols can also be defined individually with",
" the define command.",
"",
"The disassembly code seems to work most of the time, but it does get",
"a little confused at times. The 16 bit mode probably has not been used",
"much so there are probably bugs.",
"",
NULL};
void dbg_help(){
......@@ -286,7 +282,7 @@ void dbg_bt(){
}
fprintf(stderr,"Backtrace:\n");
fprintf(stderr,"%d: %4.4x:%4.4x\n", frameno++, SC_CS, SC_EIP(dbg_mask));
fprintf(stderr,"%d %4.4x:%4.4x\n", frameno++, SC_CS, SC_EIP(dbg_mask));
cs = SC_CS;
frame = (struct frame *) ((SC_EBP(dbg_mask) & ~1) | (SC_SS << 16));
......
......@@ -703,6 +703,9 @@ static char *names8[] = {
static char *names_seg[] = {
"%es","%cs","%ss","%ds","%fs","%gs","%?","%?",
};
static char *names_rmw[] = {
"%bx,%si","%bx,%di","%bp,%si","%bp,%di","%si","%di","%bp","%bx",
};
struct dis386 grps[][8] = {
/* GRP1b */
......@@ -950,8 +953,9 @@ ckprefix ()
}
}
static int machine;
static int dflag;
static int aflag;
static int aflag;
static char op1out[100], op2out[100], op3out[100];
static int op_address[3], op_ad, op_index[3];
......@@ -1140,6 +1144,7 @@ print_insn_i286 (pc, info)
bfd_vma pc;
disassemble_info *info;
{
machine = 286;
dflag = 0;
aflag = 0;
return print_insn_i286_or_i386 (pc, info);
......@@ -1150,6 +1155,7 @@ print_insn_i386 (pc, info)
bfd_vma pc;
disassemble_info *info;
{
machine = 386;
dflag = 1;
aflag = 1;
return print_insn_i286_or_i386 (pc, info, 36);
......@@ -1555,7 +1561,7 @@ OP_E (bytemode)
append_prefix ();
if (bytemode == w_mode || (bytemode == v_mode && !dflag))
if (machine == 286)
{
if (mod == 0 && rm == 6)
{
......@@ -1579,33 +1585,8 @@ OP_E (bytemode)
oappend (scratchbuf);
}
switch (rm)
{
case 0:
oappend ("(%bx,%si)");
break;
case 1:
oappend ("(%bx,%di)");
break;
case 2:
oappend ("(%bp,%si)");
break;
case 3:
oappend ("(%bp,%di)");
break;
case 4:
oappend ("(%si)");
break;
case 5:
oappend ("(%di)");
break;
case 6:
oappend ("(%bp)");
break;
case 7:
oappend ("(%bx)");
break;
}
sprintf (scratchbuf, "(%s)", names_rmw[rm]);
oappend (scratchbuf);
return 0;
}
......
......@@ -155,7 +155,7 @@ LONG CallWindowProc( FARPROC func, HWND hwnd, WORD message,
user_tab = FindDLLTable("USER");
/* DefWindowProc */
if (user_tab[104].address == address)
if (user_tab[107].address == address)
return DefWindowProc(hwnd, message, wParam, lParam);
/* DefDlgProc */
......
......@@ -127,7 +127,7 @@ length 490
117 pascal SetDCOrg(word s_word s_word) SetDCOrg(1 2 3)
#121 pascal Death
#122 pascal ReSurRection
#123 pascal PlayMetaFile
123 pascal PlayMetaFile(word word) PlayMetaFile(1 2)
#124 pascal GetMetaFile
125 pascal CreateMetaFile(ptr) CreateMetaFile(1)
126 pascal CloseMetaFile(word) CloseMetaFile(1)
......@@ -148,7 +148,8 @@ length 490
153 pascal CreateIC(ptr ptr ptr ptr) CreateIC(1 2 3 4)
154 pascal GetNearestColor(word long) GetNearestColor(1 2)
#155 pascal QueryAbort
#156 pascal CreateDiscardableBitmap
156 pascal CreateDiscardableBitmap(word word word)
CreateDiscardableBitmap(1 2 3)
#159 pascal GetMetaFileBits
#160 pascal SetMetaFileBits
161 pascal PtInRegion(word s_word s_word) PtInRegion(1 2 3)
......@@ -159,6 +160,7 @@ length 490
172 pascal SetRectRgn(word s_word s_word s_word s_word) SetRectRgn(1 2 3 4 5)
173 pascal GetClipRgn(word) GetClipRgn(1)
#175 pascal EnumMetaFile
176 pascal PlayMetaFileRecord(word ptr ptr word) PlayMetaFileRecord(1 2 3 4)
179 pascal GetDCState(word) GetDCState(1)
180 pascal SetDCState(word word) SetDCState(1 2)
181 pascal RectInRegionOld(word ptr) RectInRegion(1 2)
......
......@@ -18,7 +18,7 @@ length 415
12 pascal LocalFlags(word) WIN16_LocalFlags(1)
13 pascal LocalCompact(word) WIN16_LocalCompact(1)
14 return LocalNotify 4 0
15 pascal GlobalAlloc(word long) GlobalAlloc(1 2)
15 pascal GlobalAlloc(word long) WIN16_GlobalAlloc(1 2)
16 pascal GlobalReAlloc(word long word) GlobalReAlloc(1 2 3)
17 pascal GlobalFree(word) GlobalFree(1)
18 pascal GlobalLock(word) GlobalLock(1)
......@@ -203,7 +203,7 @@ length 415
#204 SWAPRECORDING
#205 CVWBREAK
#206 ALLOCSELECTORARRAY
#207 ISDBCSLEADBYTE
207 return IsDBCSLeadByte 2 0
#310 LOCALHANDLEDELTA
#311 GETSETKERNELDOSPROC
#314 DEBUGDEFINESEGMENT
......
......@@ -12,5 +12,7 @@
popl %ecx
popl %eax
add $16,%esp
popfl
popl %gs:return_value
add $20,%esp
pushl %gs:return_value
popfl
......@@ -258,7 +258,7 @@ length 540
#246 EXITWINDOWSEXEC
247 pascal GetCursor() GetCursor()
248 pascal GetOpenClipboardWindow() GetOpenClipboardWindow()
#249 GETASYNCKEYSTATE
249 pascal GetAsyncKeyState(word) GetAsyncKeyState(1)
#250 GETMENUSTATE
#251 SENDDRIVERMESSAGE
#252 OPENDRIVER
......@@ -413,13 +413,13 @@ length 540
#509 WNETUNWATCHQUEUE
#510 WNETLOCKQUEUEDATA
#511 WNETUNLOCKQUEUEDATA
#512 WNETGETCONNECTION
512 pascal WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
#513 WNETGETCAPS
#514 WNETDEVICEMODE
#515 WNETBROWSEDIALOG
#516 WNETGETUSER
#517 WNETADDCONNECTION
#518 WNETCANCELCONNECTION
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3)
517 pascal WNetAddConnection(ptr ptr ptr) WNetAddConnection(1 2 3)
518 pascal WNetCancelConnection(ptr word) WNetCancelConnection(1 2)
#519 WNETGETERROR
#520 WNETGETERRORTEXT
#521 WNETENABLE
......
......@@ -26,6 +26,7 @@ typedef struct tagHEADLIST {
void *lpFirst;
DWORD dwStyle;
HWND hWndLogicParent;
HFONT hFont;
} HEADLIST;
typedef HEADLIST FAR* LPHEADLIST;
......
......@@ -19,13 +19,16 @@ typedef struct tagMETAFILE
char Filename[80]; /* metafile name, if disk based */
int hFile; /* MSDOS file handle for metafile */
HANDLE hMetaHdr; /* handle of metafile header */
int MetaOffset; /* offset of current record in metafile */
int MetaOffset; /* offset of current record in metafile */
HANDLE hBuffer; /* handle of buffer for disk based metafiles */
} METAFILE;
typedef METAFILE *LPMETAFILE;
BOOL MF_WriteRecord(HMETAFILE hmf, METARECORD *mr, WORD rlen);
int MF_AddHandle(HANDLETABLE *ht, WORD htlen, HANDLE hobj);
int MF_AddHandleInternal(HANDLE hobj);
BOOL MF_MetaParam0(DC *dc, short func);
BOOL MF_MetaParam1(DC *dc, short func, short param1);
BOOL MF_MetaParam2(DC *dc, short func, short param1, short param2);
BOOL MF_MetaParam4(DC *dc, short func, short param1, short param2,
......@@ -35,9 +38,9 @@ BOOL MF_MetaParam6(DC *dc, short func, short param1, short param2,
BOOL MF_MetaParam8(DC *dc, short func, short param1, short param2,
short param3, short param4, short param5,
short param6, short param7, short param8);
BOOL MF_CreateBrushIndirect(DC *dc, LOGBRUSH *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, LOGBRUSH *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, LOGPEN *logpen);
BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePatternBrush(DC *dc, HBRUSH hBrush, LOGBRUSH *logbrush);
BOOL MF_CreatePenIndirect(DC *dc, HPEN hPen, LOGPEN *logpen);
BOOL MF_TextOut(DC *dc, short x, short y, LPSTR str, short count);
BOOL MF_MetaPoly(DC *dc, short func, LPPOINT pt, short count);
......
......@@ -251,7 +251,7 @@ UINT WINAPI waveOutSetVolume(UINT uDeviceID, DWORD dwVolume);
UINT WINAPI waveOutGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
UINT WINAPI waveGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
UINT WINAPI waveOutOpen(HWAVEOUT FAR* lphWaveOut, UINT uDeviceID,
const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
UINT WINAPI waveOutClose(HWAVEOUT hWaveOut);
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut,
WAVEHDR FAR* lpWaveOutHdr, UINT uSize);
......@@ -278,7 +278,7 @@ UINT WINAPI waveInGetDevCaps(UINT uDeviceID, WAVEINCAPS FAR* lpCaps,
UINT uSize);
UINT WINAPI waveInGetErrorText(UINT uError, LPSTR lpText, UINT uSize);
UINT WINAPI waveInOpen(HWAVEIN FAR* lphWaveIn, UINT uDeviceID,
const WAVEFORMAT FAR* lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
const LPWAVEFORMAT lpFormat, DWORD dwCallback, DWORD dwInstance, DWORD dwFlags);
UINT WINAPI waveInClose(HWAVEIN hWaveIn);
UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn,
WAVEHDR FAR* lpWaveInHdr, UINT uSize);
......@@ -1385,6 +1385,32 @@ typedef struct {
typedef MCI_OVLY_LOAD_PARMS FAR * LPMCI_OVLY_LOAD_PARMS;
/**************************************************************
* Linux MMSYSTEM Internals & Sample Audio Drivers
*/
typedef struct {
DWORD dwCallback;
DWORD dwInstance;
HMIDIOUT hMidi;
DWORD dwFlags;
} PORTALLOC;
typedef PORTALLOC FAR *LPPORTALLOC;
BOOL DriverCallback(DWORD dwCallBack, UINT uFlags, HANDLE hDev,
WORD wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2);
DWORD auxMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2);
DWORD midMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2);
DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2);
DWORD widMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2);
DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
DWORD dwParam1, DWORD dwParam2);
#endif /* MMSYSTEM_H */
......@@ -14,6 +14,8 @@ struct options
char * programName; /* To use when loading resources */
int usePrivateMap;
int synchronous;
int nobackingstore;
int nosaveunders;
short cmdShow;
int relay_debug;
int debug;
......
......@@ -82,7 +82,7 @@ extern void load_ne_header (int, struct ne_header_s *);
extern char *GetFilenameFromInstance(unsigned short instance);
extern struct w_files *GetFileInfo(unsigned short instance);
extern HINSTANCE LoadImage(char *modulename, int filetype);
extern HINSTANCE LoadImage(char *modulename, int filetype, int change_dir);
extern int _WinMain(int argc, char **argv);
extern void InitializeLoadedDLLs();
extern int FixupSegment(struct w_files * wpnt, int segment_num);
......
......@@ -46,11 +46,18 @@ HANDLE GetModuleHandle(LPSTR lpModuleName)
{
register struct w_files *w = wine_files;
int i;
printf("GetModuleHandle('%s');\n", lpModuleName);
printf("GetModuleHandle('%x');\n", lpModuleName);
printf("GetModuleHandle // searching in loaded modules\n");
while (w) {
/* printf("GetModuleHandle // '%s' \n", w->name); */
if (strcasecmp(w->name, lpModuleName) == 0) {
/* printf("GetModuleHandle // '%x' \n", w->name); */
if (((int) lpModuleName & 0xffff0000) == 0) {
if (w->hinstance == (int) lpModuleName) {
printf("GetModuleHandle('%x') return %04X \n",
lpModuleName, w->hinstance);
return w->hinstance;
}
}
else if (strcasecmp(w->name, lpModuleName) == 0) {
printf("GetModuleHandle('%s') return %04X \n",
lpModuleName, w->hinstance);
return w->hinstance;
......@@ -60,13 +67,20 @@ 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 (strcasecmp(dll_builtin_table[i].dll_name, lpModuleName) == 0) {
printf("GetModuleHandle('%s') return %04X \n",
if (((int) lpModuleName & 0xffff0000) == 0) {
if (0xFF00 + i == (int) lpModuleName) {
printf("GetModuleHandle('%s') return %04X \n",
lpModuleName, w->hinstance);
return 0xFF + i;
}
}
else if (strcasecmp(dll_builtin_table[i].dll_name, lpModuleName) == 0) {
printf("GetModuleHandle('%x') return %04X \n",
lpModuleName, 0xFF00 + i);
return (0xFF00 + i);
}
}
printf("GetModuleHandle('%s') not found !\n", lpModuleName);
printf("GetModuleHandle('%x') not found !\n", lpModuleName);
return 0;
}
......@@ -192,7 +206,7 @@ HANDLE LoadLibrary(LPSTR libname)
lpNewMod->FileName = (LPSTR) malloc(strlen(libname));
if (lpNewMod->FileName != NULL)
strcpy(lpNewMod->FileName, libname);
lpNewMod->hInst = LoadImage(libname, DLL);
lpNewMod->hInst = LoadImage(libname, DLL, 0);
lpNewMod->Count = 1;
printf("LoadLibrary returned Library hInst=%04X\n", lpNewMod->hInst);
GlobalUnlock(hModule);
......@@ -315,7 +329,7 @@ FARPROC GetProcAddress(HANDLE hModule, char *proc_name)
break;
}
cpnt += len + 2;
};
}
if (ordinal == 0)
{
printf("GetProcAddress // function '%s' not found !\n", proc_name);
......
......@@ -60,9 +60,12 @@ SEGDESC Segments[MAX_SELECTORS];
extern void KERNEL_Ordinal_102();
extern void UNIXLIB_Ordinal_0();
extern char *WIN_ProgramName;
extern char WindowsPath[256];
extern char **Argv;
extern int Argc;
extern char **environ;
/**********************************************************************
* FindUnusedSelectors
......@@ -709,7 +712,9 @@ LPSTR GetDOSEnvironment(void)
static SEGDESC *
CreateEnvironment(void)
{
char **e;
char *p;
unsigned short *w;
SEGDESC * s;
s = CreateNewSegments(0, 0, PAGE_SIZE, 1);
......@@ -717,15 +722,36 @@ CreateEnvironment(void)
return NULL;
/*
* Fill environment with meaningless babble.
* Fill environment with Windows path, the Unix environment,
* and program name.
*/
p = (char *) s->base_addr;
strcpy(p, "PATH=C:\\WINDOWS");
strcpy(p, "PATH=");
strcat(p, WindowsPath);
p += strlen(p) + 1;
for (e = environ; *e; e++)
{
if (strncasecmp(*e, "path", 4))
{
strcpy(p, *e);
p += strlen(p) + 1;
}
}
*p++ = '\0';
*p++ = 11;
*p++ = 0;
strcpy(p, "C:\\TEST.EXE");
w = (unsigned short *) p;
*w = strlen(WIN_ProgramName);
strcpy(p + 2, WIN_ProgramName);
/*
* Display environment
*/
fprintf(stderr, "Environment at %08.8x\n", s->base_addr);
for (p = s->base_addr; *p; p += strlen(p) + 1)
fprintf(stderr, " %s\n", p);
p += 3;
fprintf(stderr, " Program: %s\n", p);
return s;
}
......@@ -769,12 +795,13 @@ CreatePSP(void)
strlen(Argv[i]) > 124)
break;
if (i != 1)
*p1++ = ' ';
for (p2 = Argv[i]; *p2 != '\0'; )
*p1++ = *p2++;
*p1++ = ' ';
}
*p1++ = '\r';
*p1 = '\0';
psp->pspCommandTailCount = strlen(psp->pspCommandTail);
......@@ -903,7 +930,8 @@ CreateSelectors(struct w_files * wpnt)
Segments[s->selector >> 3].owner = auto_data_sel;
if (s->selector == auto_data_sel)
HEAP_LocalInit(auto_data_sel, s->base_addr + saved_old_length,
ne_header->local_heap_length);
0x10000 - 2 - saved_old_length
- ne_header->stack_length);
}
if(!EnvironmentSelector) {
......
......@@ -34,6 +34,8 @@ extern void CallTo32();
char * GetModuleName(struct w_files * wpnt, int index, char *buffer);
extern unsigned char ran_out;
extern char WindowsPath[256];
char *WIN_ProgramName;
unsigned short WIN_StackSize;
unsigned short WIN_HeapSize;
......@@ -124,24 +126,46 @@ void load_ne_header (int fd, struct ne_header_s *ne_header)
* LoadImage
* Load one NE format executable into memory
*/
HINSTANCE LoadImage(char *modulename, int filetype)
HINSTANCE LoadImage(char *modulename, int filetype, int change_dir)
{
unsigned int read_size;
int i;
struct w_files * wpnt, *wpnt1;
unsigned int status;
char buffer[256];
char *fullname;
/*
* search file
*/
if (FindFile(buffer, sizeof(buffer), modulename, (filetype == EXE ?
EXE_Extensions : DLL_Extensions), WindowsPath) ==NULL)
fullname = FindFile(buffer, sizeof(buffer), modulename,
(filetype == EXE ? EXE_Extensions : DLL_Extensions),
WindowsPath);
if (fullname == NULL)
{
fprintf(stderr, "LoadImage: I can't find %s.dll | %s.exe !\n",modulename, modulename);
fprintf(stderr, "LoadImage: I can't find %s.dll | %s.exe !\n",
modulename, modulename);
return (HINSTANCE) NULL;
}
fprintf(stderr,"LoadImage: loading %s (%s)\n", modulename, buffer);
fullname = GetDosFileName(fullname);
WIN_ProgramName = strdup(fullname);
fprintf(stderr,"LoadImage: loading %s (%s)\n [%s]\n",
modulename, buffer, WIN_ProgramName);
if (change_dir && fullname)
{
char dirname[256];
char *p;
strcpy(dirname, fullname);
p = strrchr(dirname, '\\');
*p = '\0';
DOS_SetDefaultDrive(dirname[0] - 'A');
DOS_ChangeDir(dirname[0] - 'A', dirname + 2);
}
/* First allocate a spot to store the info we collect, and add it to
* our linked list.
......@@ -257,7 +281,7 @@ HINSTANCE LoadImage(char *modulename, int filetype)
if(FindDLLTable(buff)) continue; /* This module already loaded */
#endif
LoadImage(buff, DLL);
LoadImage(buff, DLL, 0);
/*
fprintf(stderr,"Unable to load:%s\n", buff);
*/
......@@ -297,7 +321,7 @@ _WinMain(int argc, char **argv)
strcat(WinePath, p);
}
if ((hInstMain = LoadImage(Argv[0], EXE)) == (HINSTANCE) NULL ) {
if ((hInstMain = LoadImage(Argv[0], EXE, 1)) == (HINSTANCE) NULL ) {
fprintf(stderr, "wine: can't find %s!.\n", Argv[0]);
exit(1);
}
......
static char RCSId[] = "$Id: global.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
/* #define DEBUG_HEAP /* */
#define GLOBAL_SOURCE
#include <stdio.h>
......@@ -406,21 +407,23 @@ GlobalFlags(unsigned int block)
unsigned int
GlobalSize(unsigned int block)
{
GDESC *g;
if (block == 0)
GDESC *g = GlobalGetGDesc(block);
if (g == NULL)
return 0;
/*
* Find GDESC for this block.
*/
for (g = GlobalList; g != NULL; g = g->next)
if (g->sequence == 0)
{
if (g->handle == block)
return g->length;
MDESC *m = (MDESC *) g->addr - 1;
return m->length;
}
return 0;
else if (g->sequence >= 1)
{
return g->length * 0x10000;
}
return g->length;
}
/**********************************************************************
......
......@@ -9,7 +9,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#include "heap.h"
#include "regfunc.h"
/* #define DEBUG_HEAP */
/* #define DEBUG_HEAP /* */
LHEAP *LocalHeaps = NULL;
......
......@@ -3,11 +3,13 @@
MODULE = misc
SRCS = \
audio.c \
atom.c \
clipboard.c \
comm.c \
cursor.c \
dos_fs.c \
driver.c \
exec.c \
file.c \
keyboard.c \
......@@ -15,6 +17,7 @@ SRCS = \
main.c \
message.c \
mmsystem.c \
network.c \
profile.c \
property.c \
rect.c \
......
......@@ -19,7 +19,7 @@
#include "wine.h"
#include "windows.h"
#define DEBUG_COMM
/* #define DEBUG_COMM /* */
#define MAX_PORTS 16
......@@ -155,7 +155,7 @@ fprintf(stderr,"BuildCommDCB: (%s), ptr %d\n", device, (long) lpdcb);
#endif
commerror = 0;
if (!strncmp(device,"COM",3)) {
if (!strncasecmp(device,"COM",3)) {
port = device[3] - '0';
......@@ -170,8 +170,7 @@ fprintf(stderr,"BuildCommDCB: (%s), ptr %d\n", device, (long) lpdcb);
}
if (!COM[port].fd) {
commerror = IE_NOPEN;
return -1;
OpenComm(device, 0, 0);
}
lpdcb->Id = COM[port].fd;
......@@ -246,7 +245,7 @@ fprintf(stderr,"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
commerror = 0;
if (!strncmp(device,"COM",3)) {
if (!strncasecmp(device,"COM",3)) {
port = device[3] - '0';
if (port-- == 0) {
......@@ -259,8 +258,7 @@ fprintf(stderr,"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
return -1;
}
if (COM[port].fd) {
commerror = IE_OPEN;
return -1;
return COM[port].fd;
}
fd = open(COM[port].devicename, O_RDWR | O_NONBLOCK, 0);
......@@ -273,7 +271,7 @@ fprintf(stderr,"OpenComm: %s, %d, %d\n", device, cbInQueue, cbOutQueue);
}
}
else
if (!strncmp(device,"LPT",3)) {
if (!strncasecmp(device,"LPT",3)) {
port = device[3] - '0';
if (!ValidLPTPort(port)) {
......
......@@ -28,7 +28,7 @@
#include "prototypes.h"
#include "autoconf.h"
/* #define DEBUG */
/* #define DEBUG /* */
#define WINE_INI_USER "~/.winerc"
#define MAX_OPEN_DIRS 16
......@@ -363,7 +363,7 @@ char *GetUnixFileName(char *dosfilename)
{
/* a:\windows\system.ini => /dos/windows/system.ini */
char temp[256];
static char temp[256];
int drive;
if (dosfilename[1] == ':')
......@@ -393,7 +393,7 @@ char *GetUnixFileName(char *dosfilename)
char *GetDosFileName(char *unixfilename)
{
int i;
char temp[256];
static char temp[256];
/* /dos/windows/system.ini => c:\windows\system.ini */
for (i = 0 ; i != MAX_DOS_DRIVES; i++) {
......
......@@ -45,7 +45,7 @@ extern int CallToInit16(unsigned long csip, unsigned long sssp,
unsigned short ds);
HANDLE CreateNewTask(HINSTANCE hInst);
#ifndef WINELIB
void InitializeLoadedNewDLLs(HINSTANCE hInst)
{
struct w_files * w;
......@@ -127,7 +127,12 @@ void StartNewTask(HINSTANCE hInst)
}
#else
void StartNewTask (HINSTANCE hInst)
{
printf ("Not yet implemented\n");
}
#endif
/**********************************************************************
* LoadModule [KERNEL.45]
......@@ -172,7 +177,7 @@ WORD WinExec(LPSTR lpCmdLine, WORD nCmdShow)
printf("Can't 'fork' process !\n");
break;
case 0:
if ((hInst = LoadImage(ArgV[0], EXE)) == (HINSTANCE) NULL ) {
if ((hInst = LoadImage(ArgV[0], EXE, 1)) == (HINSTANCE) NULL ) {
fprintf(stderr, "wine: can't find %s!.\n", ArgV[0]);
printf("Child process died !\n");
exit(1);
......
......@@ -17,8 +17,6 @@
*
************************************************************************/
/* #define DEBUG_FILE */
#include <stdio.h>
#include <fcntl.h>
#include <limits.h>
......@@ -27,7 +25,7 @@
#include <windows.h>
#include "prototypes.h"
/* #define DEBUG_FILE */
/* #define DEBUG_FILE /* */
char WindowsDirectory[256], SystemDirectory[256], TempDirectory[256];
......@@ -87,10 +85,12 @@ INT _lwrite (INT hFile, LPSTR lpBuffer, INT wBytes)
{
int result;
#if 0
#ifdef DEBUG_FILE
fprintf(stderr, "_lwrite: handle %d, buffer = %ld, length = %d\n",
hFile, (int) lpBuffer, wBytes);
#endif
#endif
result = write (hFile, lpBuffer, wBytes);
if (result == -1)
......@@ -121,38 +121,61 @@ INT _lclose (INT hFile)
**************************************************************************/
INT OpenFile (LPSTR lpFileName, LPOFSTRUCT ofs, WORD wStyle)
{
int base,flags;
int handle;
int base, flags;
int handle;
#ifdef DEBUG_FILE
fprintf(stderr,"Openfile(%s,<struct>,%d) ",lpFileName,wStyle);
fprintf(stderr,"Openfile(%s,<struct>,%d) ",lpFileName,wStyle);
#endif
base=wStyle&0xF;
flags=wStyle&0xFFF0;
base = wStyle & 0xF;
flags = wStyle & 0xFFF0;
flags&=0xFF0F; /* strip SHARE bits for now */
flags&=0xD7FF; /* strip PROMPT & CANCEL bits for now */
flags&=0x7FFF; /* strip REOPEN bit for now */
flags&=0xFBFF; /* strib VERIFY bit for now */
flags &= 0xFF0F; /* strip SHARE bits for now */
flags &= 0xD7FF; /* strip PROMPT & CANCEL bits for now */
flags &= 0x7FFF; /* strip REOPEN bit for now */
flags &= 0xFBFF; /* strib VERIFY bit for now */
if(flags&OF_CREATE) { base |=O_CREAT; flags &=0xEFFF; }
if (flags & OF_CREATE)
{
base |= O_CREAT;
flags &= 0xEFFF;
}
#ifdef DEBUG_FILE
fprintf(stderr,"now %d,%d\n",base,flags);
fprintf(stderr,"now %d,%d\n",base,flags);
#endif
if (flags & OF_EXIST) {
printf("OpenFile // OF_EXIST '%s' !\n", lpFileName);
handle = _lopen (lpFileName, wStyle);
close(handle);
return handle;
}
if (flags & OF_DELETE) {
printf("OpenFile // OF_DELETE '%s' !\n", lpFileName);
return unlink(lpFileName);
}
else {
return _lopen (lpFileName, wStyle);
}
if (flags & OF_EXIST)
{
printf("OpenFile // OF_EXIST '%s' !\n", lpFileName);
handle = _lopen (lpFileName, wStyle);
close(handle);
return handle;
}
if (flags & OF_DELETE)
{
printf("OpenFile // OF_DELETE '%s' !\n", lpFileName);
return unlink(lpFileName);
}
else
{
int handle;
char *UnixFileName;
if ((UnixFileName = GetUnixFileName(lpFileName)) == NULL)
return HFILE_ERROR;
handle = open(UnixFileName, base, 0666);
#ifdef DEBUG_FILE
fprintf(stderr, "OpenFile: returning %04.4x\n", handle);
#endif
if (handle == -1)
return HFILE_ERROR;
else
return handle;
}
}
/**************************************************************************
......
......@@ -40,6 +40,8 @@ struct options Options =
NULL, /* programName */
FALSE, /* usePrivateMap */
FALSE, /* synchronous */
FALSE, /* no backing store */
FALSE, /* no save unders */
SW_SHOWNORMAL, /* cmdShow */
FALSE
};
......@@ -47,16 +49,18 @@ struct options Options =
static XrmOptionDescRec optionsTable[] =
{
{ "-desktop", ".desktop", XrmoptionSepArg, (caddr_t)NULL },
{ "-depth", ".depth", XrmoptionSepArg, (caddr_t)NULL },
{ "-display", ".display", XrmoptionSepArg, (caddr_t)NULL },
{ "-iconic", ".iconic", XrmoptionNoArg, (caddr_t)"on" },
{ "-name", ".name", XrmoptionSepArg, (caddr_t)NULL },
{ "-privatemap", ".privatemap", XrmoptionNoArg, (caddr_t)"on" },
{ "-synchronous", ".synchronous", XrmoptionNoArg, (caddr_t)"on" },
{ "-spy", ".spy", XrmoptionSepArg, (caddr_t)NULL },
{ "-debug", ".debug", XrmoptionNoArg, (caddr_t)"on" },
{ "-relaydbg", ".relaydbg", XrmoptionNoArg, (caddr_t)"on" }
{ "-desktop", ".desktop", XrmoptionSepArg, (caddr_t)NULL },
{ "-depth", ".depth", XrmoptionSepArg, (caddr_t)NULL },
{ "-display", ".display", XrmoptionSepArg, (caddr_t)NULL },
{ "-iconic", ".iconic", XrmoptionNoArg, (caddr_t)"on" },
{ "-name", ".name", XrmoptionSepArg, (caddr_t)NULL },
{ "-privatemap", ".privatemap", XrmoptionNoArg, (caddr_t)"on" },
{ "-synchronous", ".synchronous", XrmoptionNoArg, (caddr_t)"on" },
{ "-nobackingstore",".nobackingstore", XrmoptionNoArg, (caddr_t)"on" },
{ "-nosaveunders", ".nosaveunders", XrmoptionNoArg, (caddr_t)"on" },
{ "-spy", ".spy", XrmoptionSepArg, (caddr_t)NULL },
{ "-debug", ".debug", XrmoptionNoArg, (caddr_t)"on" },
{ "-relaydbg", ".relaydbg", XrmoptionNoArg, (caddr_t)"on" }
};
#define NB_OPTIONS (sizeof(optionsTable) / sizeof(optionsTable[0]))
......@@ -73,6 +77,8 @@ static XrmOptionDescRec optionsTable[] =
" -name name Set the application name\n" \
" -privatemap Use a private color map\n" \
" -synchronous Turn on synchronous display mode\n" \
" -nobackingstore Turn off backing store\n" \
" -nosaveunders Turn off saveunders\n" \
" -spy file Turn on message spying to the specified file\n" \
" -relaydbg Display call relay information\n"
......@@ -177,6 +183,10 @@ static void MAIN_ParseOptions( int *argc, char *argv[] )
Options.usePrivateMap = TRUE;
if (MAIN_GetResource( db, ".synchronous", &value ))
Options.synchronous = TRUE;
if (MAIN_GetResource( db, ".nosaveunders", &value ))
Options.nosaveunders = TRUE;
if (MAIN_GetResource( db, ".nobackingstore", &value ))
Options.nobackingstore = TRUE;
if (MAIN_GetResource( db, ".relaydbg", &value ))
Options.relay_debug = TRUE;
if (MAIN_GetResource( db, ".debug", &value ))
......@@ -217,10 +227,21 @@ static void MAIN_CreateDesktop( int argc, char *argv[] )
StructureNotifyMask;
win_attr.cursor = XCreateFontCursor( display, XC_top_left_arrow );
if (Options.nobackingstore)
win_attr.backing_store = NotUseful;
else
win_attr.backing_store = Always;
if (Options.nosaveunders)
win_attr.save_under = FALSE;
else
win_attr.save_under = TRUE;
rootWindow = XCreateWindow( display, DefaultRootWindow(display),
desktopX, desktopY, width, height, 0,
CopyFromParent, InputOutput, CopyFromParent,
CWEventMask | CWCursor, &win_attr );
CWEventMask | CWCursor | CWSaveUnder |
CWBackingStore, &win_attr );
/* Set window manager properties */
......@@ -324,14 +345,12 @@ int main( int argc, char *argv[] )
#ifndef sunos
atexit(called_at_exit);
#else
on_exit (called_at_exit, 0);
#endif
ret_val = _WinMain( argc, argv );
#ifdef sunos
called_at_exit();
#endif
return ret_val;
}
......
......@@ -54,6 +54,9 @@ int MessageBox(HWND hWnd, LPSTR str, LPSTR title, WORD type)
DWORD dwStyle;
HINSTANCE hInst;
int nRet;
if (title == NULL)
title = "Error";
wndPtr = WIN_FindWndPtr(hWnd);
if (wndPtr == NULL) {
hInst = hSysRes;
......
......@@ -220,6 +220,10 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
TSecHeader *section;
TKeys *key;
/* Supposedly Default should NEVER be NULL. But sometimes it is. */
if (Default == NULL)
Default = "";
if (!(section = is_loaded (FileName))){
New = (TProfile *) xmalloc (sizeof (TProfile));
New->link = Base;
......@@ -237,16 +241,31 @@ static short GetSetProfile (int set, LPSTR AppName, LPSTR KeyName,
/* If no key value given, then list all the keys */
if ((!KeyName) && (!set)){
char *p = ReturnedString;
int left = Size - 1;
int left = Size - 2;
int slen;
#ifdef DEBUG_PROFILE
printf("GetSetProfile // KeyName == NULL, Enumeration !\n");
#endif
for (key = section->Keys; key; key = key->link){
strncpy (p, key->KeyName, left);
slen = strlen (key->KeyName) + 1;
left -= slen+1;
if (left < 1) {
printf("GetSetProfile // No more storage for enum !\n");
return (Size - 2);
}
slen = min(strlen(key->KeyName) + 1, left);
#ifdef DEBUG_PROFILE
printf("GetSetProfile // strncpy(%08X, %08X, %d);\n",
ReturnedString, key->Value, slen);
#endif
strncpy (p, key->KeyName, slen);
#ifdef DEBUG_PROFILE
printf("GetSetProfile // enum '%s' !\n", p);
#endif
left -= slen;
p += slen;
}
return left;
*p = '\0';
printf("GetSetProfile // normal end of enum !\n");
return (Size - 2 - left);
}
for (key = section->Keys; key; key = key->link){
if (strcasecmp (key->KeyName, KeyName))
......@@ -291,7 +310,11 @@ short GetPrivateProfileString (LPSTR AppName, LPSTR KeyName,
short Size, LPSTR FileName)
{
int v;
#ifdef DEBUG_PROFILE
printf("GetPrivateProfileString ('%s', '%s', '%s', %08X, %d, %s\n",
AppName, KeyName, Default, ReturnedString, Size, FileName);
#endif
v = GetSetProfile (0,AppName,KeyName,Default,ReturnedString,Size,FileName);
if (AppName)
return strlen (ReturnedString);
......
......@@ -878,7 +878,9 @@ INT WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData)
return WSASYSNOTREADY;
heap = (struct WinSockHeap *) GlobalLock(HeapHandle);
#ifndef WINELIB
HEAP_Init(&MyHeap, heap, sizeof(struct WinSockHeap));
#endif
bcopy(&Winsock_data, lpWSAData, sizeof(Winsock_data));
/* ipc stuff */
......
......@@ -15,6 +15,8 @@
#include "msdos.h"
#include "options.h"
/* #define DEBUG_FIND /* */
static char Copyright[] = "copyright Erik Bos, 1993";
WORD ExtendedError, CodePage = 437;
......@@ -366,20 +368,34 @@ static void SetFileAttributes(struct sigcontext_struct *context)
static void ioctlGetDeviceInfo(struct sigcontext_struct *context)
{
WORD handle = EBX & 0xffff;
switch (handle) {
case 0:
case 1:
case 2:
EDX = (EDX & 0xffff0000) | 0x80d3;
break;
default:
Barf(context);
EDX = (EDX & 0xffff0000) | 0x50;
WORD handle = EBX & 0xffff;
switch (handle)
{
case 0:
case 1:
case 2:
EDX = (EDX & 0xffff0000) | 0x80d3;
break;
default:
{
struct stat sbuf;
if (fstat(handle, &sbuf) < 0)
{
Barf(context);
EDX = (EDX & 0xffff0000) | 0x50;
SetCflag;
return;
}
/* This isn't the right answer, but should be close enough. */
EDX = (EDX & 0xffff0000) | 0x0943;
}
ResetCflag;
}
ResetCflag;
}
static void ioctlGenericBlkDevReq(struct sigcontext_struct *context)
......@@ -542,8 +558,7 @@ static void OpenExistingFile(struct sigcontext_struct *context)
return;
}
Error (0,0,0);
EBX = (EBX & 0xffff0000L) | handle;
EAX = (EAX & 0xffffff00L) | NoError;
EAX = (EAX & 0xffff0000L) | handle;
ResetCflag;
}
......@@ -705,13 +720,20 @@ static void FindNext(struct sigcontext_struct *context)
{
struct dosdirent *dp;
dp = (struct dosdirent *)(dta + 0x0d);
#ifdef DEBUG_FIND
fprintf(stderr, "FindNext: ");
#endif
dp = *(struct dosdirent **)(dta + 0x0d);
do {
if ((dp = DOS_readdir(dp)) == NULL) {
Error(NoMoreFiles, EC_MediaError , EL_Disk);
EAX = (EAX & 0xffffff00L) | NoMoreFiles;
SetCflag;
#ifdef DEBUG_FIND
fprintf(stderr, "\n");
#endif
return;
}
} while (*(dta + 0x0c) != dp->attribute);
......@@ -723,6 +745,12 @@ static void FindNext(struct sigcontext_struct *context)
EAX = (EAX & 0xffffff00L);
ResetCflag;
#ifdef DEBUG_FIND
fprintf(stderr,
"DTA: drive %c, template %11.11s, size %d, name %-13.13s\n",
dta[0] + 'A', &dta[1], *(LONG *)(&dta[0x1a]), &dta[0x1e]);
#endif
return;
}
......@@ -764,13 +792,8 @@ static void FindFirst(struct sigcontext_struct *context)
SetCflag;
return;
}
/* strncpy(dta + 1, AsciizToFCB(dp->filemask), 11); */
/* *((BYTE *) ((void*)dta + 0x0d)) = (BYTE *) dp; */
*((struct dosdirent *)(dta + 0x0d))
=
*dp;
memcpy(dta + 0x0d, &dp, sizeof(dp));
FindNext(context);
}
......
......@@ -12,6 +12,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <X11/Intrinsic.h>
#include "gdi.h"
#include "metafile.h"
extern const int DC_XROPfunction[];
......@@ -28,7 +29,15 @@ BOOL PatBlt( HDC hdc, short left, short top,
int x1, x2, y1, y2;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return FALSE;
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam6(dc, META_PATBLT, left, top, width, height,
HIWORD(rop), LOWORD(rop));
return TRUE;
}
#ifdef DEBUG_GDI
printf( "PatBlt: %d %d,%d %dx%d %06x\n",
hdc, left, top, width, height, rop );
......
......@@ -251,6 +251,16 @@ HBITMAP BITMAP_SelectObject( HDC hdc, DC * dc, HBITMAP hbitmap,
return prevHandle;
}
/***********************************************************************
* CreateDiscardableBitmap (GDI.156)
*/
HBITMAP CreateDiscardableBitmap(HDC hdc, short width, short height)
{
printf("CreateDiscardableBitmap(%04X, %d, %d); "
"// call CreateCompatibleBitmap() for now!\n",
hdc, width, height);
return CreateCompatibleBitmap(hdc, width, height);
}
/***********************************************************************
* GetBitmapDimensionEx (GDI.468)
......
......@@ -237,13 +237,13 @@ HBRUSH BRUSH_SelectObject( HDC hdc, DC * dc, HBRUSH hbrush, BRUSHOBJ * brush )
case BS_SOLID:
case BS_HATCHED:
case BS_HOLLOW:
if (!MF_CreateBrushIndirect(dc, &(brush->logbrush)))
if (!MF_CreateBrushIndirect(dc, hbrush, &(brush->logbrush)))
return 0;
break;
case BS_PATTERN:
case BS_DIBPATTERN:
if (!MF_CreatePatternBrush(dc, &(brush->logbrush)))
if (!MF_CreatePatternBrush(dc, hbrush, &(brush->logbrush)))
return 0;
break;
}
......
......@@ -8,6 +8,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdio.h>
#include "gdi.h"
#include "metafile.h"
/***********************************************************************
......@@ -131,7 +132,14 @@ int SelectVisRgn( HDC hdc, HRGN hrgn )
int OffsetClipRgn( HDC hdc, short x, short y )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return ERROR;
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return ERROR;
MF_MetaParam2(dc, META_OFFSETCLIPRGN, x, y);
return NULLREGION; /* ?? */
}
#ifdef DEBUG_CLIPPING
printf( "OffsetClipRgn: %d %d,%d\n", hdc, x, y );
#endif
......@@ -219,7 +227,14 @@ int ExcludeClipRect( HDC hdc, short left, short top,
short right, short bottom )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return ERROR;
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return ERROR;
MF_MetaParam4(dc, META_EXCLUDECLIPRECT, left, top, right, bottom);
return NULLREGION; /* ?? */
}
#ifdef DEBUG_CLIPPING
printf( "ExcludeClipRect: %d %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
......@@ -236,7 +251,14 @@ int IntersectClipRect( HDC hdc, short left, short top,
short right, short bottom )
{
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc) return ERROR;
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return ERROR;
MF_MetaParam4(dc, META_INTERSECTCLIPRECT, left, top, right, bottom);
return NULLREGION; /* ?? */
}
#ifdef DEBUG_CLIPPING
printf( "IntersectClipRect: %d %dx%d,%dx%d\n",
hdc, left, top, right, bottom );
......
......@@ -663,8 +663,10 @@ int EnumFontFamilies(HDC hDC, LPSTR lpszFamily, FARPROC lpEnumFunc, LPSTR lpData
while (TRUE) {
if (lpLogFontList[i] == NULL) break;
if (lpszFamily == NULL) {
if (lpLogFontList[i] == NULL) break;
for (j = 0; j < MAX_FONTS; j++) {
if (lpFaceList[j] == NULL) break;
if (lpLogFontList[i] == NULL) break;
if (strcmp(lpFaceList[j], lpLogFontList[i]->lfFaceName) == 0) {
i++; j = 0;
}
......
......@@ -64,7 +64,7 @@ HPEN PEN_SelectObject( DC * dc, HPEN hpen, PENOBJ * pen )
HPEN prevHandle = dc->w.hPen;
if (dc->header.wMagic == METAFILE_DC_MAGIC)
return MF_CreatePenIndirect(dc, &(pen->logpen));
return MF_CreatePenIndirect(dc, hpen, &(pen->logpen));
dc->w.hPen = hpen;
......
......@@ -18,6 +18,16 @@ CallLineDDAProc (FARPROC back, int x, int y, long lParam)
(*back)(x, y, lParam);
}
DWORD CallHookProc (HOOKPROC func, short code, WPARAM wParam, LPARAM lParam)
{
(*func)(code, wParam, lParam);
}
BOOL CallGrayStringProc (FARPROC func, HDC hdc, LPARAM lParam, INT cch)
{
return (*func) (hdc, lParam, cch);
}
/*
* Header loading routines for WineLib.
*/
......
......@@ -50,7 +50,7 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#define POP_0 "\tadd\t$4,%%esp\n"
#define POP_SS "\tpopw\t%%ss\n\tadd\t$2,%%esp\n"
#define POP_ESP "\tpopl\t%%esp\n"
#define POP_EFL "\tpopfl\n"
#define POP_EFL "\tpopl\t%%gs:return_value\n"
#define POP_CS "\tpopw\t%%cs\n\tadd\t$2,%%esp\n"
#define POP_EIP "\tpopl\t$0\n"
#define POP_DS "\tpopw\t%%ds\n\tadd\t$2,%%esp\n"
......@@ -728,6 +728,8 @@ main(int argc, char **argv)
if (add_count > 0)
fprintf(fp, "\tadd\t$%d,%%esp\n", add_count);
fprintf(fp, "\tpushl\t%%gs:return_value\n\tpopfl\n");
fclose(fp);
exit(0);
......
......@@ -293,7 +293,14 @@ int SaveDC( HDC hdc )
HDC hdcs;
DC * dc, * dcs;
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return 0;
MF_MetaParam0(dc, META_SAVEDC);
return 1; /* ?? */
}
if (!(hdcs = GetDCState( hdc ))) return 0;
dcs = (DC *) GDI_HEAP_ADDR( hdcs );
dcs->header.hNext = dc->header.hNext;
......@@ -315,7 +322,15 @@ BOOL RestoreDC( HDC hdc, short level )
#ifdef DEBUG_DC
printf( "RestoreDC: %d %d\n", hdc, level );
#endif
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return FALSE;
dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
if (level != -1) return FALSE;
MF_MetaParam1(dc, META_RESTOREDC, level);
return TRUE;
}
if (level == -1) level = dc->saveLevel;
if ((level < 1) || (level > (short)dc->saveLevel)) return FALSE;
......
......@@ -4,7 +4,7 @@
* Copyright 1993 Alexandre Julliard
*/
#define DEBUG_DIALOG /* */
/* #define DEBUG_DIALOG /* */
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
......
......@@ -34,6 +34,7 @@ static XContext winContext = 0;
/* State variables */
BOOL MouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
BOOL AsyncMouseButtonsStates[NB_BUTTONS] = { FALSE, FALSE, FALSE };
static WORD ALTKeyState;
static HWND captureWnd = 0;
Window winHasCursor = 0;
......@@ -381,6 +382,7 @@ static void EVENT_ButtonPress( XButtonEvent *event )
if (buttonNum >= NB_BUTTONS) return;
MouseButtonsStates[buttonNum] = TRUE;
AsyncMouseButtonsStates[buttonNum] = TRUE;
winHasCursor = event->window;
hardware_event( messages[buttonNum],
EVENT_XStateToKeyState( event->state ), 0L,
......
......@@ -7,8 +7,10 @@
static char Copyright[] = "Copyright Bob Amstadt, 1993";
#include "win.h"
#include "windows.h"
extern BOOL MouseButtonsStates[3];
extern BOOL AsyncMouseButtonsStates[3];
/**********************************************************************
* GetKeyState (USER.106)
......@@ -26,3 +28,48 @@ int GetKeyState(int keycode)
return 0;
}
}
/**********************************************************************
*
* GetAsyncKeyState (USER.249)
*
* Determine if a key is or was pressed. retval has high-order
* byte set to 1 if currently pressed, low-order byte 1 if key has
* been pressed.
*
* This uses the variable AsyncMouseButtonsStates (set in event.c)
* which have the mouse button number set to true if the mouse had been
* depressed since the last call to GetAsyncKeyState.
*
* There should also be some keyboard stuff here... it isn't here
* yet.
*/
int GetAsyncKeyState(int nKey)
{
short retval;
switch (nKey) {
case VK_LBUTTON:
retval = AsyncMouseButtonsStates[0] |
(MouseButtonsStates[0] << 8);
break;
case VK_MBUTTON:
retval = AsyncMouseButtonsStates[1] |
(MouseButtonsStates[1] << 8);
break;
case VK_RBUTTON:
retval = AsyncMouseButtonsStates[2] |
MouseButtonsStates[2] << 8;
break;
default:
retval = 0;
break;
}
bzero(AsyncMouseButtonsStates, 3); /* all states to false */
return retval;
}
......@@ -163,7 +163,23 @@ WORD SetMapMode( HDC hdc, WORD mode )
DWORD SetViewportExt( HDC hdc, short x, short y )
{
SIZE size;
if (!SetViewportExtEx( hdc, x, y, &size )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_SETVIEWPORTEXT, x, y);
return 0;
}
size.cx = dc->w.VportExtX;
size.cy = dc->w.VportExtY;
if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
return size.cx | (size.cy << 16);
if (!x || !y) return 0;
dc->w.VportExtX = x;
dc->w.VportExtY = y;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
return size.cx | (size.cy << 16);
}
......@@ -196,7 +212,19 @@ BOOL SetViewportExtEx( HDC hdc, short x, short y, LPSIZE size )
DWORD SetViewportOrg( HDC hdc, short x, short y )
{
POINT pt;
if (!SetViewportOrgEx( hdc, x, y, &pt )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_SETVIEWPORTORG, x, y);
return 0;
}
pt.x = dc->w.VportOrgX;
pt.y = dc->w.VportOrgY;
dc->w.VportOrgX = x;
dc->w.VportOrgY = y;
return pt.x | (pt.y << 16);
}
......@@ -225,7 +253,23 @@ BOOL SetViewportOrgEx( HDC hdc, short x, short y, LPPOINT pt )
DWORD SetWindowExt( HDC hdc, short x, short y )
{
SIZE size;
if (!SetWindowExtEx( hdc, x, y, &size )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_SETWINDOWEXT, x, y);
return 0;
}
size.cx = dc->w.WndExtX;
size.cy = dc->w.WndExtY;
if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
return size.cx | (size.cy << 16);
if (!x || !y) return 0;
dc->w.WndExtX = x;
dc->w.WndExtY = y;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
return size.cx | (size.cy << 16);
}
......@@ -258,7 +302,19 @@ BOOL SetWindowExtEx( HDC hdc, short x, short y, LPSIZE size )
DWORD SetWindowOrg( HDC hdc, short x, short y )
{
POINT pt;
if (!SetWindowOrgEx( hdc, x, y, &pt )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_SETWINDOWORG, x, y);
return 0;
}
pt.x = dc->w.WndOrgX;
pt.y = dc->w.WndOrgY;
dc->w.WndOrgX = x;
dc->w.WndOrgY = y;
return pt.x | (pt.y << 16);
}
......@@ -287,7 +343,19 @@ BOOL SetWindowOrgEx( HDC hdc, short x, short y, LPPOINT pt )
DWORD OffsetViewportOrg( HDC hdc, short x, short y )
{
POINT pt;
if (!OffsetViewportOrgEx( hdc, x, y, &pt )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_OFFSETVIEWPORTORG, x, y);
return 0;
}
pt.x = dc->w.VportOrgX;
pt.y = dc->w.VportOrgY;
dc->w.VportOrgX += x;
dc->w.VportOrgY += y;
return pt.x | (pt.y << 16);
}
......@@ -316,7 +384,19 @@ BOOL OffsetViewportOrgEx( HDC hdc, short x, short y, LPPOINT pt )
DWORD OffsetWindowOrg( HDC hdc, short x, short y )
{
POINT pt;
if (!OffsetWindowOrgEx( hdc, x, y, &pt )) return 0;
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam2(dc, META_OFFSETWINDOWORG, x, y);
return 0;
}
pt.x = dc->w.WndOrgX;
pt.y = dc->w.WndOrgY;
dc->w.WndOrgX += x;
dc->w.WndOrgY += y;
return pt.x | (pt.y << 16);
}
......@@ -346,8 +426,25 @@ DWORD ScaleViewportExt( HDC hdc, short xNum, short xDenom,
short yNum, short yDenom )
{
SIZE size;
if (!ScaleViewportExtEx( hdc, xNum, xDenom, yNum, yDenom, &size ))
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam4(dc, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom);
return 0;
}
size.cx = dc->w.VportExtX;
size.cy = dc->w.VportExtY;
if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
return size.cx | (size.cy << 16);
if (!xNum || !xDenom || !xNum || !yDenom) return 0;
dc->w.VportExtX = (dc->w.VportExtX * xNum) / xDenom;
dc->w.VportExtY = (dc->w.VportExtY * yNum) / yDenom;
if (dc->w.VportExtX == 0) dc->w.VportExtX = 1;
if (dc->w.VportExtY == 0) dc->w.VportExtY = 1;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
return size.cx | (size.cy << 16);
}
......@@ -384,8 +481,25 @@ DWORD ScaleWindowExt( HDC hdc, short xNum, short xDenom,
short yNum, short yDenom )
{
SIZE size;
if (!ScaleWindowExtEx( hdc, xNum, xDenom, yNum, yDenom, &size ))
DC * dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC );
if (!dc)
{
dc = (DC *)GDI_GetObjPtr(hdc, METAFILE_DC_MAGIC);
if (!dc) return FALSE;
MF_MetaParam4(dc, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom);
return 0;
}
size.cx = dc->w.WndExtX;
size.cy = dc->w.WndExtY;
if ((dc->w.MapMode != MM_ISOTROPIC) && (dc->w.MapMode != MM_ANISOTROPIC))
return size.cx | (size.cy << 16);
if (!xNum || !xDenom || !xNum || !yDenom) return FALSE;
dc->w.WndExtX = (dc->w.WndExtX * xNum) / xDenom;
dc->w.WndExtY = (dc->w.WndExtY * yNum) / yDenom;
if (dc->w.WndExtX == 0) dc->w.WndExtX = 1;
if (dc->w.WndExtY == 0) dc->w.WndExtY = 1;
if (dc->w.MapMode == MM_ISOTROPIC) MAPPING_FixIsotropic( dc );
return size.cx | (size.cy << 16);
}
......
......@@ -10,6 +10,7 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#include <stdio.h>
#include <string.h>
#include "options.h"
#include "class.h"
#include "win.h"
#include "user.h"
......@@ -370,12 +371,23 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
/* Only select focus events on top-level override-redirect windows */
if (win_attr.override_redirect) win_attr.event_mask |= FocusChangeMask;
}
if (Options.nobackingstore)
win_attr.backing_store = NotUseful;
else
win_attr.backing_store = Always;
if (Options.nosaveunders)
win_attr.save_under = FALSE;
else
win_attr.save_under = TRUE;
wndPtr->window = XCreateWindow( display, parentPtr->window,
x + parentPtr->rectClient.left - parentPtr->rectWindow.left,
y + parentPtr->rectClient.top - parentPtr->rectWindow.top,
width, height, 0,
CopyFromParent, InputOutput, CopyFromParent,
CWEventMask | CWOverrideRedirect | CWColormap, &win_attr );
CWEventMask | CWOverrideRedirect | CWColormap |
CWSaveUnder | CWBackingStore, &win_attr );
XStoreName( display, wndPtr->window, windowName );
/* Send the WM_CREATE message */
......
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