Release 940722

Mon Jul 18 23:55:13 MET DST 1994

	* [if1632/call.S]
	CallTo16(): added `mov %eax,%edx' just before lcall,
	to make sure that DX contain the DLL's hinstance when
	initialised.

	CallTo32_16() added, equal to CallTo32() except for
	one thing: it saves DX and 

	* [tools/build.c]
	Added some code to support 16 and 32 bit return values.

	* [1632/{kernel,user}.spec]
	Changed most of the `pascal' style to pascal_16 when
	function returned a 16bit value.

Tue Jul 19 18:40:25 1994  Alexandre Julliard  (julliard@lamisun.epfl.ch)

	* [controls/menu.c]
	Reorganized sizing and drawing code to implement multi-line menus.
	Implemented MENUBREAK style.
	Use system colors to draw menus.

	* [objects/color.c]
	Bug fix in COLOR_IsSolid().

	* [objects/font.c]
	Bug fix in FONT_GetMetrics(): calculate average character width
	only on existing chars (dialogs look much better).

	* [objects/text.c]
	Bug fix in DrawText(): use text color to underline mnemonic.

	* [windows/nonclient.c]
	Changed WM_NCHITTEST handling to cope with multi-line menu bars.

	* [windows/syscolor.c]
	Added system objects for menu colors.

Mon Jul 18 19:32:08 PDT 1994  Andrew Lagodzinski  (andrew@netcom.com)

        * [controls/menu.c]
        Fixed bug in SelectPrevItem that caused seperators to not be
	skipped when using the up arrow key.
This commit is contained in:
Alexandre Julliard 1994-07-23 07:57:48 +00:00
parent 2d159fb707
commit f720725904
19 changed files with 1087 additions and 774 deletions

View File

@ -1,3 +1,50 @@
----------------------------------------------------------------------
Mon Jul 18 23:55:13 MET DST 1994
* [if1632/call.S]
CallTo16(): added `mov %eax,%edx' just before lcall,
to make sure that DX contain the DLL's hinstance when
initialised.
CallTo32_16() added, equal to CallTo32() except for
one thing: it saves DX and
* [tools/build.c]
Added some code to support 16 and 32 bit return values.
* [1632/{kernel,user}.spec]
Changed most of the `pascal' style to pascal_16 when
function returned a 16bit value.
Tue Jul 19 18:40:25 1994 Alexandre Julliard (julliard@lamisun.epfl.ch)
* [controls/menu.c]
Reorganized sizing and drawing code to implement multi-line menus.
Implemented MENUBREAK style.
Use system colors to draw menus.
* [objects/color.c]
Bug fix in COLOR_IsSolid().
* [objects/font.c]
Bug fix in FONT_GetMetrics(): calculate average character width
only on existing chars (dialogs look much better).
* [objects/text.c]
Bug fix in DrawText(): use text color to underline mnemonic.
* [windows/nonclient.c]
Changed WM_NCHITTEST handling to cope with multi-line menu bars.
* [windows/syscolor.c]
Added system objects for menu colors.
Mon Jul 18 19:32:08 PDT 1994 Andrew Lagodzinski (andrew@netcom.com)
* [controls/menu.c]
Fixed bug in SelectPrevItem that caused seperators to not be
skipped when using the up arrow key.
---------------------------------------------------------------------- ----------------------------------------------------------------------
Thu Jul 14 17:50:45 1994 Bob Amstadt (bob@pooh) Thu Jul 14 17:50:45 1994 Bob Amstadt (bob@pooh)

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@ static WNDCLASS WIDGETS_BuiltinClasses[] =
{ CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 4, { CS_GLOBALCLASS, (LONG(*)())EditWndProc, 0, 4,
0, 0, 0, 0, NULL, "EDIT" }, 0, 0, 0, 0, NULL, "EDIT" },
{ CS_GLOBALCLASS | CS_SAVEBITS, (LONG(*)())PopupMenuWndProc, 0, 8, { CS_GLOBALCLASS | CS_SAVEBITS, (LONG(*)())PopupMenuWndProc, 0, 8,
0, 0, 0, 0, NULL, "POPUPMENU" }, 0, 0, 0, 0, NULL, POPUPMENU_CLASS_NAME },
{ CS_GLOBALCLASS, (LONG(*)())DesktopWndProc, 0, sizeof(DESKTOPINFO), { CS_GLOBALCLASS, (LONG(*)())DesktopWndProc, 0, sizeof(DESKTOPINFO),
0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME }, 0, 0, 0, 0, NULL, DESKTOP_CLASS_NAME },
{ CS_GLOBALCLASS, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA, { CS_GLOBALCLASS, (LONG(*)())DefDlgProc, 0, DLGWINDOWEXTRA,

View File

@ -190,6 +190,7 @@ _CallTo16:
* Call entry point * Call entry point
*/ */
movw %ax,%ds movw %ax,%ds
movw %ax,%di
.byte 0x66 .byte 0x66
lcall %fs:(%edx) lcall %fs:(%edx)
@ -284,11 +285,16 @@ _CallTo32:
/* /*
* Call entry point * Call entry point
*/ */
pushl %edx
pushw _IF1632_Saved16_ss pushw _IF1632_Saved16_ss
pushw _IF1632_Saved16_esp pushw _IF1632_Saved16_esp
pushl %eax pushl %eax
call _DLLRelay call _DLLRelay
popl %edx
popl %edx
popl %edx
/* /*
* Restore registers, but do not destroy return value. * Restore registers, but do not destroy return value.
*/ */
@ -327,6 +333,7 @@ noargs:
/* /*
* Last, but not least we need to move the high word from eax to dx * Last, but not least we need to move the high word from eax to dx
*/ */
pushl %eax pushl %eax
popw %dx popw %dx
popw %dx popw %dx
@ -334,6 +341,99 @@ noargs:
.byte 0x66 .byte 0x66
lret lret
/**********************************************************************
* CallTo32_16()
*
* This function is same one as CallTo32() except that the high
* word of EAX won't be moved to DX.
*/
.align 4
.globl _CallTo32_16
_CallTo32_16:
pushl %ebp
movl %esp,%ebp
/*
* Save registers. 286 mode does not have fs or gs.
*/
pushw %ds
pushw %es
/*
* Restore segment registers.
*/
pushl %eax
movw $UDATASEL,%ax
movw %ax,%ds
movw %ax,%es
popl %eax
/*
* Save old stack save variables, save stack registers, reload
* stack registers.
*/
pushl _IF1632_Saved16_esp
pushl _IF1632_Saved16_ebp
pushw _IF1632_Saved16_ss
movw %ss,_IF1632_Saved16_ss
movl %esp,_IF1632_Saved16_esp
movl %ebp,_IF1632_Saved16_ebp
movw _IF1632_Saved32_ss,%ss
movl _IF1632_Saved32_esp,%esp
movl _IF1632_Saved32_ebp,%ebp
/*
* Call entry point
*/
pushl %edx
pushw _IF1632_Saved16_ss
pushw _IF1632_Saved16_esp
pushl %eax
call _DLLRelay
popl %edx
popl %edx
popl %edx
/*
* Restore registers, but do not destroy return value.
*/
movw _IF1632_Saved16_ss,%ss
movl _IF1632_Saved16_esp,%esp
movl _IF1632_Saved16_ebp,%ebp
popw _IF1632_Saved16_ss
popl _IF1632_Saved16_ebp
popl _IF1632_Saved16_esp
popw %es
popw %ds
.align 2,0x90
leave
/*
* Now we need to ditch the parameter bytes that were left on the
* stack. We do this by effectively popping the number of bytes,
* and the return address, removing the parameters and then putting
* the return address back on the stack.
* Normally this field is filled in by the relevant function in
* the emulation library, since it should know how many bytes to
* expect.
*/
popw %gs:nbytes
cmpw $0,%gs:nbytes
je noargs2
popw %gs:offset
popw %gs:selector
addw %gs:nbytes,%esp
pushw %gs:selector
pushw %gs:offset
noargs2:
.byte 0x66
lret
/********************************************************************** /**********************************************************************
* ReturnFromRegisterFunc() * ReturnFromRegisterFunc()
*/ */

View File

@ -7,26 +7,26 @@ length 415
#1 FATALEXIT #1 FATALEXIT
#2 EXITKERNEL #2 EXITKERNEL
3 pascal GetVersion() GetVersion() 3 pascal GetVersion() GetVersion()
4 pascal LocalInit(word word word) WIN16_LocalInit(1 2 3) 4 pascal16 LocalInit(word word word) WIN16_LocalInit(1 2 3)
5 pascal LocalAlloc(word word) WIN16_LocalAlloc(1 2) 5 pascal16 LocalAlloc(word word) WIN16_LocalAlloc(1 2)
6 pascal LocalReAlloc(word word word) WIN16_LocalReAlloc(1 2 3) 6 pascal16 LocalReAlloc(word word word) WIN16_LocalReAlloc(1 2 3)
7 pascal LocalFree(word) WIN16_LocalFree(1) 7 pascal16 LocalFree(word) WIN16_LocalFree(1)
8 pascal LocalLock(word) WIN16_LocalLock(1) 8 pascal LocalLock(word) WIN16_LocalLock(1)
9 pascal LocalUnlock(word) WIN16_LocalUnlock(1) 9 pascal16 LocalUnlock(word) WIN16_LocalUnlock(1)
10 pascal LocalSize(word) WIN16_LocalSize(1) 10 pascal LocalSize(word) WIN16_LocalSize(1)
11 pascal LocalHandle(word) ReturnArg(1) 11 pascal16 LocalHandle(word) ReturnArg(1)
12 pascal LocalFlags(word) WIN16_LocalFlags(1) 12 pascal16 LocalFlags(word) WIN16_LocalFlags(1)
13 pascal LocalCompact(word) WIN16_LocalCompact(1) 13 pascal16 LocalCompact(word) WIN16_LocalCompact(1)
14 return LocalNotify 4 0 14 return LocalNotify 4 0
15 pascal GlobalAlloc(word long) WIN16_GlobalAlloc(1 2) 15 pascal16 GlobalAlloc(word long) WIN16_GlobalAlloc(1 2)
16 pascal GlobalReAlloc(word long word) GlobalReAlloc(1 2 3) 16 pascal16 GlobalReAlloc(word long word) GlobalReAlloc(1 2 3)
17 pascal GlobalFree(word) GlobalFree(1) 17 pascal16 GlobalFree(word) GlobalFree(1)
18 pascal GlobalLock(word) GlobalLock(1) 18 pascal GlobalLock(word) GlobalLock(1)
19 pascal GlobalUnlock(word) GlobalUnlock(1) 19 pascal16 GlobalUnlock(word) GlobalUnlock(1)
20 pascal GlobalSize(word) GlobalSize(1) 20 pascal GlobalSize(word) GlobalSize(1)
21 pascal GlobalHandle(word) GlobalHandle(1) 21 pascal GlobalHandle(word) GlobalHandle(1)
22 pascal GlobalFlags(word) GlobalFlags(1) 22 pascal16 GlobalFlags(word) GlobalFlags(1)
23 pascal LockSegment(s_word) KERNEL_LockSegment(1) 23 pascal16 LockSegment(s_word) KERNEL_LockSegment(1)
24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1) 24 pascal UnlockSegment(s_word) KERNEL_UnlockSegment(1)
25 pascal GlobalCompact(long) GlobalCompact(1) 25 pascal GlobalCompact(long) GlobalCompact(1)
#26 GLOBALFREEALL #26 GLOBALFREEALL
@ -38,66 +38,66 @@ length 415
#33 LOCKCURRENTTASK #33 LOCKCURRENTTASK
34 pascal SetTaskQueue(word word) SetTaskQueue(1 2) 34 pascal SetTaskQueue(word word) SetTaskQueue(1 2)
35 pascal GetTaskQueue(word) GetTaskQueue(1) 35 pascal GetTaskQueue(word) GetTaskQueue(1)
36 pascal GetCurrentTask() GetCurrentTask() 36 pascal16 GetCurrentTask() GetCurrentTask()
37 pascal GetCurrentPDB() GetCurrentPDB() 37 pascal16 GetCurrentPDB() GetCurrentPDB()
#38 SETTASKSIGNALPROC #38 SETTASKSIGNALPROC
#41 ENABLEDOS #41 ENABLEDOS
#42 DISABLEDOS #42 DISABLEDOS
45 pascal LoadModule(ptr ptr) LoadModule(1 2) 45 pascal16 LoadModule(ptr ptr) LoadModule(1 2)
46 pascal FreeModule(word) FreeLibrary(1) 46 pascal16 FreeModule(word) FreeLibrary(1)
47 pascal GetModuleHandle(ptr) GetModuleHandle(1) 47 pascal16 GetModuleHandle(ptr) GetModuleHandle(1)
48 pascal GetModuleUsage(word) GetModuleUsage(1) 48 pascal16 GetModuleUsage(word) GetModuleUsage(1)
49 pascal GetModuleFileName(word ptr s_word) GetModuleFileName(1 2 3) 49 pascal16 GetModuleFileName(word ptr s_word) GetModuleFileName(1 2 3)
50 pascal GetProcAddress(word ptr) GetProcAddress(1 2) 50 pascal GetProcAddress(word ptr) GetProcAddress(1 2)
51 pascal MakeProcInstance(ptr word) CALLBACK_MakeProcInstance(1 2) 51 pascal MakeProcInstance(ptr word) CALLBACK_MakeProcInstance(1 2)
52 pascal FreeProcInstance(ptr) FreeProcInstance(1) 52 pascal FreeProcInstance(ptr) FreeProcInstance(1)
#53 CALLPROCINSTANCE #53 CALLPROCINSTANCE
#54 GETINSTANCEDATA #54 pascal16 GETINSTANCEDATA
55 pascal Catch(ptr) Catch (1) 55 pascal16 Catch(ptr) Catch (1)
56 pascal Throw(ptr word) Throw(1 2) 56 pascal Throw(ptr word) Throw(1 2)
57 pascal GetProfileInt(ptr ptr word) GetProfileInt(1 2 3) 57 pascal16 GetProfileInt(ptr ptr word) GetProfileInt(1 2 3)
58 pascal GetProfileString(ptr ptr ptr ptr word) GetProfileString(1 2 3 4 5) 58 pascal16 GetProfileString(ptr ptr ptr ptr word) GetProfileString(1 2 3 4 5)
59 pascal WriteProfileString(ptr ptr ptr) WriteProfileString(1 2 3) 59 pascal16 WriteProfileString(ptr ptr ptr) WriteProfileString(1 2 3)
60 pascal FindResource(word ptr ptr) FindResource(1 2 3) 60 pascal16 FindResource(word ptr ptr) FindResource(1 2 3)
61 pascal LoadResource(word word) LoadResource(1 2) 61 pascal16 LoadResource(word word) LoadResource(1 2)
62 pascal LockResource(word) LockResource(1) 62 pascal LockResource(word) LockResource(1)
63 pascal FreeResource(word) FreeResource(1) 63 pascal16 FreeResource(word) FreeResource(1)
64 pascal AccessResource(word word) AccessResource(1 2) 64 pascal16 AccessResource(word word) AccessResource(1 2)
65 pascal SizeofResource(word word) SizeofResource(1 2) 65 pascal SizeofResource(word word) SizeofResource(1 2)
66 pascal AllocResource(word word long) AllocResource(1 2 3) 66 pascal16 AllocResource(word word long) AllocResource(1 2 3)
#67 SETRESOURCEHANDLER #67 SETRESOURCEHANDLER
68 pascal InitAtomTable(word) InitAtomTable(1) 68 pascal16 InitAtomTable(word) InitAtomTable(1)
69 pascal FindAtom(ptr) FindAtom(1) 69 pascal16 FindAtom(ptr) FindAtom(1)
70 pascal AddAtom(ptr) AddAtom(1) 70 pascal16 AddAtom(ptr) AddAtom(1)
71 pascal DeleteAtom(word) DeleteAtom(1) 71 pascal16 DeleteAtom(word) DeleteAtom(1)
72 pascal GetAtomName(word ptr word) GetAtomName(1 2 3) 72 pascal16 GetAtomName(word ptr word) GetAtomName(1 2 3)
73 pascal GetAtomHandle(word) GetAtomHandle(1) 73 pascal16 GetAtomHandle(word) GetAtomHandle(1)
74 pascal OpenFile(ptr ptr word) OpenFile(1 2 3) 74 pascal16 OpenFile(ptr ptr word) OpenFile(1 2 3)
#75 OPENPATHNAME #75 OPENPATHNAME
#76 DELETEPATHNAME #76 DELETEPATHNAME
#77 RESERVED1 #77 RESERVED1
#78 RESERVED2 #78 RESERVED2
#79 RESERVED3 #79 RESERVED3
#80 RESERVED4 #80 RESERVED4
81 pascal _lclose(word) _lclose(1) 81 pascal16 _lclose(word) _lclose(1)
82 pascal _lread(word ptr word) _lread(1 2 3) 82 pascal16 _lread(word ptr word) _lread(1 2 3)
83 pascal _lcreat(ptr word) _lcreat(1 2) 83 pascal16 _lcreat(ptr word) _lcreat(1 2)
84 pascal _llseek(word long word) _llseek(1 2 3) 84 pascal _llseek(word long word) _llseek(1 2 3)
85 pascal _lopen(ptr word) _lopen(1 2) 85 pascal16 _lopen(ptr word) _lopen(1 2)
86 pascal _lwrite(word ptr word) _lwrite(1 2 3) 86 pascal16 _lwrite(word ptr word) _lwrite(1 2 3)
#87 RESERVED5 #87 RESERVED5
88 pascal lstrcpy(ptr ptr) lstrcpy(1 2) 88 pascal lstrcpy(ptr ptr) lstrcpy(1 2)
89 pascal lstrcat(ptr ptr) lstrcat(1 2) 89 pascal lstrcat(ptr ptr) lstrcat(1 2)
90 pascal lstrlen(ptr) lstrlen(1) 90 pascal16 lstrlen(ptr) lstrlen(1)
91 register InitTask(word word word word word 91 register InitTask(word word word word word
word word word word word) word word word word word)
KERNEL_InitTask() KERNEL_InitTask()
92 pascal GetTempDrive(byte) GetTempDrive(1) 92 pascal16 GetTempDrive(byte) GetTempDrive(1)
#93 GETCODEHANDLE #93 pascal16 GETCODEHANDLE
#94 DEFINEHANDLETABLE #94 DEFINEHANDLETABLE
95 pascal LoadLibrary(ptr) LoadLibrary(1) 95 pascal16 LoadLibrary(ptr) LoadLibrary(1)
96 pascal FreeLibrary(word) FreeLibrary(1) 96 pascal16 FreeLibrary(word) FreeLibrary(1)
97 pascal GetTempFileName(byte ptr word ptr) GetTempFileName(1 2 3 4) 97 pascal16 GetTempFileName(byte ptr word ptr) GetTempFileName(1 2 3 4)
#98 GETLASTDISKCHANGE #98 GETLASTDISKCHANGE
#99 GETLPERRMODE #99 GETLPERRMODE
#100 VALIDATECODESEGMENTS #100 VALIDATECODESEGMENTS
@ -114,9 +114,9 @@ length 415
#109 SWITCHSTACKBACK #109 SWITCHSTACKBACK
#110 PATCHCODEHANDLE #110 PATCHCODEHANDLE
111 pascal GlobalWire(word) GlobalLock(1) 111 pascal GlobalWire(word) GlobalLock(1)
112 pascal GlobalUnWire(word) GlobalUnlock(1) 112 pascal16 GlobalUnWire(word) GlobalUnlock(1)
#113 __AHSHIFT 113 equate __AHSHIFT 3
#114 __AHINCR 114 equate __AHINCR 8
115 pascal OutputDebugString(ptr) OutputDebugString(1) 115 pascal OutputDebugString(ptr) OutputDebugString(1)
#116 INITLIB #116 INITLIB
117 return OldYield 0 0 117 return OldYield 0 0
@ -129,19 +129,19 @@ length 415
#124 ENABLEKERNEL #124 ENABLEKERNEL
#125 DISABLEKERNEL #125 DISABLEKERNEL
#126 MEMORYFREED #126 MEMORYFREED
127 pascal GetPrivateProfileInt(ptr ptr s_word ptr) 127 pascal16 GetPrivateProfileInt(ptr ptr s_word ptr)
GetPrivateProfileInt(1 2 3 4) GetPrivateProfileInt(1 2 3 4)
128 pascal GetPrivateProfileString(ptr ptr ptr ptr s_word ptr) 128 pascal16 GetPrivateProfileString(ptr ptr ptr ptr s_word ptr)
GetPrivateProfileString(1 2 3 4 5 6) GetPrivateProfileString(1 2 3 4 5 6)
129 pascal WritePrivateProfileString(ptr ptr ptr ptr) 129 pascal16 WritePrivateProfileString(ptr ptr ptr ptr)
WritePrivateProfileString(1 2 3 4) WritePrivateProfileString(1 2 3 4)
#130 FILECBR #130 FILECBR
131 pascal GetDOSEnvironment() GetDOSEnvironment() 131 pascal GetDOSEnvironment() GetDOSEnvironment()
132 pascal GetWinFlags() GetWinFlags() 132 pascal GetWinFlags() GetWinFlags()
#133 GETEXEPTR #133 GETEXEPTR
134 pascal GetWindowsDirectory(ptr word) GetWindowsDirectory(1 2) 134 pascal16 GetWindowsDirectory(ptr word) GetWindowsDirectory(1 2)
135 pascal GetSystemDirectory(ptr word) GetSystemDirectory(1 2) 135 pascal16 GetSystemDirectory(ptr word) GetSystemDirectory(1 2)
136 pascal GetDriveType(byte) GetDriveType(1) 136 pascal16 GetDriveType(byte) GetDriveType(1)
137 pascal FatalAppExit(word ptr) FatalAppExit(1 2) 137 pascal FatalAppExit(word ptr) FatalAppExit(1 2)
#138 GETHEAPSPACES - This is not correct but may fake out most apps #138 GETHEAPSPACES - This is not correct but may fake out most apps
138 return GetHeapSpaces 2 0x80004000 138 return GetHeapSpaces 2 0x80004000
@ -150,7 +150,7 @@ length 415
#141 INITTASK1 #141 INITTASK1
150 return DirectedYield 2 0 150 return DirectedYield 2 0
#151 WINOLDAPCALL #151 WINOLDAPCALL
152 pascal GetNumTasks() GetNumTasks() 152 pascal16 GetNumTasks() GetNumTasks()
154 return GlobalNotify 4 0 154 return GlobalNotify 4 0
#155 GETTASKDS #155 GETTASKDS
#156 LIMITEMSPAGES #156 LIMITEMSPAGES
@ -160,10 +160,10 @@ length 415
#160 EMSCOPY #160 EMSCOPY
#161 LOCALCOUNTFREE #161 LOCALCOUNTFREE
#162 LOCALHEAPSIZE #162 LOCALHEAPSIZE
163 pascal GlobalLRUOldest(word) ReturnArg(1) 163 pascal16 GlobalLRUOldest(word) ReturnArg(1)
164 pascal GlobalLRUNewest(word) ReturnArg(1) 164 pascal16 GlobalLRUNewest(word) ReturnArg(1)
#165 A20PROC #165 A20PROC
166 pascal WinExec(ptr word) WinExec(1 2) 166 pascal16 WinExec(ptr word) WinExec(1 2)
#167 GETEXPWINVER #167 GETEXPWINVER
#168 DIRECTRESALLOC #168 DIRECTRESALLOC
169 pascal GetFreeSpace(word) GetFreeSpace(1) 169 pascal GetFreeSpace(word) GetFreeSpace(1)
@ -172,9 +172,9 @@ length 415
#172 ALLOCALIAS #172 ALLOCALIAS
#173 __ROMBIOS #173 __ROMBIOS
#174 __A000H #174 __A000H
175 pascal AllocSelector(word) AllocSelector(1) 175 pascal16 AllocSelector(word) AllocSelector(1)
176 pascal FreeSelector(word) FreeSelector(1) 176 pascal16 FreeSelector(word) FreeSelector(1)
177 pascal PrestoChangoSelector(word word) PrestoChangoSelector(1 2) 177 pascal16 PrestoChangoSelector(word word) PrestoChangoSelector(1 2)
178 equate __WINFLAGS 0x413 178 equate __WINFLAGS 0x413
#179 __D000H #179 __D000H
#180 LONGPTRADD #180 LONGPTRADD
@ -183,10 +183,10 @@ length 415
#183 __0000H #183 __0000H
184 return GlobalDOSAlloc 4 0 184 return GlobalDOSAlloc 4 0
185 return GlobalDOSFree 2 0 185 return GlobalDOSFree 2 0
186 pascal GetSelectorBase(word) GetSelectorBase(1) 186 pascal16 GetSelectorBase(word) GetSelectorBase(1)
187 pascal SetSelectorBase(word long) SetSelectorBase(1 2) 187 pascal16 SetSelectorBase(word long) SetSelectorBase(1 2)
188 pascal GetSelectorLimit(word) GetSelectorLimit(1) 188 pascal GetSelectorLimit(word) GetSelectorLimit(1)
189 pascal SetSelectorLimit(word long) SetSelectorLimit(1 2) 189 pascal16 SetSelectorLimit(word long) SetSelectorLimit(1 2)
#190 __E000H #190 __E000H
191 pascal GlobalPageLock(word) GlobalLock(1) 191 pascal GlobalPageLock(word) GlobalLock(1)
192 pascal GlobalPageUnlock(word) GlobalUnlock(1) 192 pascal GlobalPageUnlock(word) GlobalUnlock(1)
@ -196,7 +196,7 @@ length 415
#196 SELECTORACCESSRIGHTS #196 SELECTORACCESSRIGHTS
197 pascal GlobalFix(word) GlobalLock(1) 197 pascal GlobalFix(word) GlobalLock(1)
198 pascal GlobalUnfix(word) GlobalUnlock(1) 198 pascal GlobalUnfix(word) GlobalUnlock(1)
199 pascal SetHandleCount(word) SetHandleCount(1) 199 pascal16 SetHandleCount(word) SetHandleCount(1)
#200 VALIDATEFREESPACES #200 VALIDATEFREESPACES
#201 REPLACEINST #201 REPLACEINST
#202 REGISTERPTRACE #202 REGISTERPTRACE
@ -236,8 +236,8 @@ length 415
#346 ISBADHUGEREADPTR #346 ISBADHUGEREADPTR
#347 ISBADHUGEWRITEPTR #347 ISBADHUGEWRITEPTR
348 pascal hmemcpy(ptr ptr long) hmemcpy(1 2 3) 348 pascal hmemcpy(ptr ptr long) hmemcpy(1 2 3)
349 pascal _hread(word ptr long) _hread(1 2 3) 349 pascal16 _hread(word ptr long) _hread(1 2 3)
350 pascal _hwrite(word ptr long) _hwrite(1 2 3) 350 pascal16 _hwrite(word ptr long) _hwrite(1 2 3)
#351 BUNNY_351 #351 BUNNY_351
353 pascal lstrcpyn(ptr ptr word) lstrcpyn(1 2 3) 353 pascal lstrcpyn(ptr ptr word) lstrcpyn(1 2 3)
#354 GETAPPCOMPATFLAGS #354 GETAPPCOMPATFLAGS

View File

@ -178,7 +178,7 @@ length 540
173 pascal LoadCursor(word ptr) LoadCursor(1 2) 173 pascal LoadCursor(word ptr) LoadCursor(1 2)
174 pascal LoadIcon(word ptr) LoadIcon(1 2) 174 pascal LoadIcon(word ptr) LoadIcon(1 2)
175 pascal LoadBitmap(word ptr) LoadBitmap(1 2) 175 pascal LoadBitmap(word ptr) LoadBitmap(1 2)
176 pascal LoadString(word word ptr s_word) LoadString(1 2 3 4) 176 pascal16 LoadString(word word ptr s_word) LoadString(1 2 3 4)
177 pascal LoadAccelerators(word ptr) LoadAccelerators(1 2) 177 pascal LoadAccelerators(word ptr) LoadAccelerators(1 2)
178 pascal TranslateAccelerator(word word ptr) TranslateAccelerator(1 2 3) 178 pascal TranslateAccelerator(word word ptr) TranslateAccelerator(1 2 3)
179 pascal GetSystemMetrics(word) GetSystemMetrics(1) 179 pascal GetSystemMetrics(word) GetSystemMetrics(1)
@ -228,9 +228,9 @@ length 540
220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1) 220 pascal LoadMenuIndirect(ptr) LoadMenuIndirect(1)
221 pascal ScrollDC(word s_word s_word ptr ptr word ptr) 221 pascal ScrollDC(word s_word s_word ptr ptr word ptr)
ScrollDC(1 2 3 4 5 6 7) ScrollDC(1 2 3 4 5 6 7)
222 pascal GetKeyboardState(ptr) GetKeyboardState(1) 222 pascal16 GetKeyboardState(ptr) GetKeyboardState(1)
#223 SETKEYBOARDSTATE #223 SETKEYBOARDSTATE
224 pascal GetWindowTask(word) GetWindowTask(1) 224 pascal16 GetWindowTask(word) GetWindowTask(1)
225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3) 225 pascal EnumTaskWindows(word ptr long) EnumTaskWindows(1 2 3)
#226 LOCKINPUT #226 LOCKINPUT
227 pascal GetNextDlgGroupItem(word word word) GetNextDlgGroupItem(1 2 3) 227 pascal GetNextDlgGroupItem(word word word) GetNextDlgGroupItem(1 2 3)
@ -294,7 +294,7 @@ length 540
281 pascal GetSysColorBrush(word) GetSysColorBrush(1) 281 pascal GetSysColorBrush(word) GetSysColorBrush(1)
282 pascal SelectPalette(word word word) SelectPalette(1 2 3) 282 pascal SelectPalette(word word word) SelectPalette(1 2 3)
283 pascal RealizePalette(word) RealizePalette(1) 283 pascal RealizePalette(word) RealizePalette(1)
284 pascal GetFreeSystemResources(word) GetFreeSystemResources(1) 284 pascal16 GetFreeSystemResources(word) GetFreeSystemResources(1)
#285 BEAR285 #285 BEAR285
286 pascal GetDesktopWindow() GetDesktopWindow() 286 pascal GetDesktopWindow() GetDesktopWindow()
#287 GETLASTACTIVEPOPUP #287 GETLASTACTIVEPOPUP
@ -366,15 +366,15 @@ length 540
421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3) 421 pascal wvsprintf(ptr ptr ptr) wvsprintf(1 2 3)
#422 DLGDIRSELECTEX #422 DLGDIRSELECTEX
#423 DLGDIRSELECTCOMBOBOXEX #423 DLGDIRSELECTCOMBOBOXEX
430 pascal lstrcmp(ptr ptr) lstrcmp(1 2) 430 pascal16 lstrcmp(ptr ptr) lstrcmp(1 2)
431 pascal AnsiUpper(ptr) AnsiUpper(1) 431 pascal AnsiUpper(ptr) AnsiUpper(1)
432 pascal AnsiLower(ptr) AnsiLower(1) 432 pascal AnsiLower(ptr) AnsiLower(1)
433 pascal IsCharAlpha(byte) IsCharAlpha(1) 433 pascal16 IsCharAlpha(byte) IsCharAlpha(1)
434 pascal IsCharAlphanumeric(byte) IsCharAlphanumeric(1) 434 pascal16 IsCharAlphanumeric(byte) IsCharAlphanumeric(1)
435 pascal IsCharUpper(byte) IsCharUpper(1) 435 pascal16 IsCharUpper(byte) IsCharUpper(1)
436 pascal IsCharLower(byte) IsCharLower(1) 436 pascal16 IsCharLower(byte) IsCharLower(1)
437 pascal AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2) 437 pascal16 AnsiUpperBuff(ptr word) AnsiUpperBuff(1 2)
438 pascal AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2) 438 pascal16 AnsiLowerBuff(ptr word) AnsiLowerBuff(1 2)
445 pascal DefFrameProc(word word word word long) DefFrameProc(1 2 3 4 5) 445 pascal DefFrameProc(word word word word long) DefFrameProc(1 2 3 4 5)
447 pascal DefMDIChildProc(word word word long) DefMDIChildProc(1 2 3 4) 447 pascal DefMDIChildProc(word word word long) DefMDIChildProc(1 2 3 4)
451 pascal TranslateMDISysAccel(word ptr) TranslateMDISysAccel(1 2) 451 pascal TranslateMDISysAccel(word ptr) TranslateMDISysAccel(1 2)
@ -395,7 +395,7 @@ length 540
#465 DRAGDETECT #465 DRAGDETECT
466 pascal DrawFocusRect(word ptr) DrawFocusRect(1 2) 466 pascal DrawFocusRect(word ptr) DrawFocusRect(1 2)
#470 STRINGFUNC #470 STRINGFUNC
471 pascal lstrcmpi(ptr ptr) lstrcmpi(1 2) 471 pascal16 lstrcmpi(ptr ptr) lstrcmpi(1 2)
472 pascal AnsiNext(ptr) AnsiNext(1 ) 472 pascal AnsiNext(ptr) AnsiNext(1 )
473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2) 473 pascal AnsiPrev(ptr ptr) AnsiPrev(1 2)
#480 GETUSERLOCALOBJTYPE #480 GETUSERLOCALOBJTYPE
@ -415,13 +415,13 @@ length 540
#509 WNETUNWATCHQUEUE #509 WNETUNWATCHQUEUE
#510 WNETLOCKQUEUEDATA #510 WNETLOCKQUEUEDATA
#511 WNETUNLOCKQUEUEDATA #511 WNETUNLOCKQUEUEDATA
512 pascal WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3) 512 pascal16 WNetGetConnection(ptr ptr ptr) WNetGetConnection(1 2 3)
513 pascal WNetGetCaps(word) WNetGetCaps(1) 513 pascal WNetGetCaps(word) WNetGetCaps(1)
#514 WNETDEVICEMODE #514 WNETDEVICEMODE
#515 WNETBROWSEDIALOG #515 WNETBROWSEDIALOG
516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3) 516 pascal WNetGetUser(ptr ptr ptr) WNetGetUser(1 2 3)
517 pascal WNetAddConnection(ptr ptr ptr) WNetAddConnection(1 2 3) 517 pascal16 WNetAddConnection(ptr ptr ptr) WNetAddConnection(1 2 3)
518 pascal WNetCancelConnection(ptr word) WNetCancelConnection(1 2) 518 pascal16 WNetCancelConnection(ptr word) WNetCancelConnection(1 2)
#519 WNETGETERROR #519 WNETGETERROR
#520 WNETGETERRORTEXT #520 WNETGETERRORTEXT
#521 WNETENABLE #521 WNETENABLE

View File

@ -15,7 +15,7 @@ struct SysColorObjects
/* COLOR_BACKGROUND */ /* COLOR_BACKGROUND */
HBRUSH hbrushActiveCaption; /* COLOR_ACTIVECAPTION */ HBRUSH hbrushActiveCaption; /* COLOR_ACTIVECAPTION */
HBRUSH hbrushInactiveCaption; /* COLOR_INACTIVECAPTION */ HBRUSH hbrushInactiveCaption; /* COLOR_INACTIVECAPTION */
/* COLOR_MENU */ HBRUSH hbrushMenu; /* COLOR_MENU */
HBRUSH hbrushWindow; /* COLOR_WINDOW */ HBRUSH hbrushWindow; /* COLOR_WINDOW */
HPEN hpenWindowFrame; /* COLOR_WINDOWFRAME */ HPEN hpenWindowFrame; /* COLOR_WINDOWFRAME */
/* COLOR_MENUTEXT */ /* COLOR_MENUTEXT */
@ -24,7 +24,7 @@ struct SysColorObjects
HBRUSH hbrushActiveBorder; /* COLOR_ACTIVEBORDER */ HBRUSH hbrushActiveBorder; /* COLOR_ACTIVEBORDER */
HBRUSH hbrushInactiveBorder; /* COLOR_INACTIVEBORDER */ HBRUSH hbrushInactiveBorder; /* COLOR_INACTIVEBORDER */
/* COLOR_APPWORKSPACE */ /* COLOR_APPWORKSPACE */
/* COLOR_HIGHLIGHT */ HBRUSH hbrushHighlight; /* COLOR_HIGHLIGHT */
/* COLOR_HIGHLIGHTTEXT */ /* COLOR_HIGHLIGHTTEXT */
HBRUSH hbrushBtnFace; /* COLOR_BTNFACE */ HBRUSH hbrushBtnFace; /* COLOR_BTNFACE */
HBRUSH hbrushBtnShadow; /* COLOR_BTNSHADOW */ HBRUSH hbrushBtnShadow; /* COLOR_BTNSHADOW */

View File

@ -7,6 +7,7 @@
#if defined(__NetBSD__) || defined(__FreeBSD__) #if defined(__NetBSD__) || defined(__FreeBSD__)
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/param.h>
#else #else
#include <syscall.h> #include <syscall.h>
#endif #endif
@ -20,13 +21,14 @@
#include "prototypes.h" #include "prototypes.h"
#include "win.h" #include "win.h"
#if !defined(BSD4_4) || defined(linux)
char * cstack[4096]; char * cstack[4096];
#endif
struct sigaction segv_act; struct sigaction segv_act;
#ifdef linux #ifdef linux
extern void ___sig_restore(); extern void ___sig_restore();
extern void ___masksig_restore(); extern void ___masksig_restore();
#endif
/* Similar to the sigaction function in libc, except it leaves alone the /* Similar to the sigaction function in libc, except it leaves alone the
restorer field */ restorer field */
@ -41,6 +43,7 @@ wine_sigaction(int sig,struct sigaction * new, struct sigaction * old)
errno = -sig; errno = -sig;
return -1; return -1;
} }
#endif
int do_int(int intnum, struct sigcontext_struct *scp) int do_int(int intnum, struct sigcontext_struct *scp)
{ {
@ -111,7 +114,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
#endif #endif
#if defined(__NetBSD__) || defined(__FreeBSD__) #if defined(__NetBSD__) || defined(__FreeBSD__)
/* set_es(0x27); set_ds(0x27); */ /* set_es(0x27); set_ds(0x27); */
if(signal != SIGBUS) if(signal != SIGBUS && signal != SIGSEGV && signal != SIGTRAP)
exit(1); exit(1);
if(scp->sc_cs == 0x1f) if(scp->sc_cs == 0x1f)
{ {
@ -181,7 +184,7 @@ static void win_fault(int signal, int code, struct sigcontext *scp)
XUngrabServer(display); XUngrabServer(display);
XFlush(display); XFlush(display);
fprintf(stderr,"In win_fault %x:%x\n", scp->sc_cs, scp->sc_eip); fprintf(stderr,"In win_fault %x:%x\n", scp->sc_cs, scp->sc_eip);
#ifdef linux #if defined(linux) || defined(__NetBSD__)
wine_debug(signal, scp); /* Enter our debugger */ wine_debug(signal, scp); /* Enter our debugger */
#else #else
fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp); fprintf(stderr,"Stack: %x:%x\n", scp->sc_ss, scp->sc_esp);
@ -213,8 +216,23 @@ int init_wine_signals(void)
wine_sigaction(SIGTRAP, &segv_act, NULL); /* For breakpoints */ wine_sigaction(SIGTRAP, &segv_act, NULL); /* For breakpoints */
#endif #endif
#if defined(__NetBSD__) || defined(__FreeBSD__) #if defined(__NetBSD__) || defined(__FreeBSD__)
struct sigstack ss;
sigset_t sig_mask; sigset_t sig_mask;
#ifdef BSD4_4
struct sigaltstack ss;
if ((ss.ss_base = malloc(MINSIGSTKSZ)) == NULL) {
fprintf(stderr, "Unable to allocate signal stack (%d bytes)\n",
MINSIGSTKSZ);
exit(1);
}
ss.ss_size = MINSIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) < 0) {
perror("sigstack");
exit(1);
}
#else
struct sigstack ss;
ss.ss_sp = (char *) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3); ss.ss_sp = (char *) (((unsigned int)(cstack) + sizeof(cstack) - 4) & ~3);
ss.ss_onstack = 0; ss.ss_onstack = 0;
@ -222,12 +240,27 @@ int init_wine_signals(void)
perror("sigstack"); perror("sigstack");
exit(1); exit(1);
} }
#endif
sigemptyset(&sig_mask); sigemptyset(&sig_mask);
segv_act.sa_handler = (__sighandler_t) win_fault; segv_act.sa_handler = (void (*)) win_fault;
segv_act.sa_flags = SA_ONSTACK; segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask; segv_act.sa_mask = sig_mask;
if (sigaction(SIGBUS, &segv_act, NULL) < 0) { if (sigaction(SIGBUS, &segv_act, NULL) < 0) {
perror("sigaction"); perror("sigaction: SIGBUS");
exit(1);
}
segv_act.sa_handler = (void (*)) win_fault;
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGSEGV, &segv_act, NULL) < 0) {
perror("sigaction: SIGSEGV");
exit(1);
}
segv_act.sa_handler = (void (*)) win_fault; /* For breakpoints */
segv_act.sa_flags = SA_ONSTACK;
segv_act.sa_mask = sig_mask;
if (sigaction(SIGTRAP, &segv_act, NULL) < 0) {
perror("sigaction: SIGTRAP");
exit(1); exit(1);
} }
#endif #endif

View File

@ -16,8 +16,11 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef linux
#include <linux/soundcard.h> #include <linux/soundcard.h>
#endif
#ifdef linux
#define SOUND_DEV "/dev/dsp" #define SOUND_DEV "/dev/dsp"
#ifdef SOUND_VERSION #ifdef SOUND_VERSION
@ -66,6 +69,7 @@ typedef struct {
static LINUX_WAVEOUT WOutDev[MAX_WAVOUTDRV]; static LINUX_WAVEOUT WOutDev[MAX_WAVOUTDRV];
static LINUX_WAVEIN WInDev[MAX_WAVOUTDRV]; static LINUX_WAVEIN WInDev[MAX_WAVOUTDRV];
static LINUX_MCIWAVE MCIWavDev[MAX_MCIWAVDRV]; static LINUX_MCIWAVE MCIWavDev[MAX_MCIWAVDRV];
#endif
DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms); DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms);
DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms); DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms);
@ -93,6 +97,7 @@ DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize);
DWORD WAVE_NotifyClient(UINT wDevID, WORD wMsg, DWORD WAVE_NotifyClient(UINT wDevID, WORD wMsg,
DWORD dwParam1, DWORD dwParam2) DWORD dwParam1, DWORD dwParam2)
{ {
#ifdef linux
if (WInDev[wDevID].wFlags != DCB_NULL && !DriverCallback( if (WInDev[wDevID].wFlags != DCB_NULL && !DriverCallback(
WInDev[wDevID].waveDesc.dwCallBack, WInDev[wDevID].wFlags, WInDev[wDevID].waveDesc.dwCallBack, WInDev[wDevID].wFlags,
WInDev[wDevID].waveDesc.hWave, wMsg, WInDev[wDevID].waveDesc.hWave, wMsg,
@ -100,6 +105,9 @@ DWORD WAVE_NotifyClient(UINT wDevID, WORD wMsg,
printf("WAVE_NotifyClient // can't notify client !\n"); printf("WAVE_NotifyClient // can't notify client !\n");
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
} }
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -109,6 +117,7 @@ DWORD WAVE_NotifyClient(UINT wDevID, WORD wMsg,
LRESULT WAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, LRESULT WAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2) DWORD dwParam1, DWORD dwParam2)
{ {
#ifdef linux
switch(wMsg) { switch(wMsg) {
case DRV_LOAD: case DRV_LOAD:
return (LRESULT)1L; return (LRESULT)1L;
@ -159,12 +168,16 @@ LRESULT WAVE_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
default: default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
} }
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
* WAVE_mciOpen */ * WAVE_mciOpen */
DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms) DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms)
{ {
#ifdef linux
int hFile; int hFile;
UINT wDevID; UINT wDevID;
OFSTRUCT OFstruct; OFSTRUCT OFstruct;
@ -223,6 +236,9 @@ DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms)
dwRet = wodMessage(0, WODM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL); dwRet = wodMessage(0, WODM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL);
dwRet = widMessage(0, WIDM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL); dwRet = widMessage(0, WIDM_OPEN, 0, (DWORD)&WaveDesc, CALLBACK_NULL);
return 0; return 0;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -230,6 +246,7 @@ DWORD WAVE_mciOpen(DWORD dwFlags, LPMCI_WAVE_OPEN_PARMS lpParms)
*/ */
DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
DWORD dwRet; DWORD dwRet;
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms); printf("WAVE_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms);
@ -246,6 +263,9 @@ DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL; if (dwRet != MMSYSERR_NOERROR) return MCIERR_INTERNAL;
} }
return 0; return 0;
#else
return 0;
#endif
} }
@ -254,6 +274,7 @@ DWORD WAVE_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{ {
#ifdef linux
int count; int count;
int start, end; int start, end;
LPWAVEHDR lpWaveHdr; LPWAVEHDR lpWaveHdr;
@ -323,6 +344,9 @@ DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -331,6 +355,7 @@ DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
*/ */
DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms) DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
{ {
#ifdef linux
int count; int count;
int start, end; int start, end;
LPWAVEHDR lpWaveHdr; LPWAVEHDR lpWaveHdr;
@ -382,6 +407,9 @@ DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -390,11 +418,15 @@ DWORD WAVE_mciRecord(UINT wDevID, DWORD dwFlags, LPMCI_RECORD_PARMS lpParms)
*/ */
DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
if (lpParms == NULL) return MCIERR_INTERNAL; if (lpParms == NULL) return MCIERR_INTERNAL;
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
@ -403,11 +435,15 @@ DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD WAVE_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD WAVE_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
if (lpParms == NULL) return MCIERR_INTERNAL; if (lpParms == NULL) return MCIERR_INTERNAL;
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
@ -416,11 +452,15 @@ DWORD WAVE_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD WAVE_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD WAVE_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
if (lpParms == NULL) return MCIERR_INTERNAL; if (lpParms == NULL) return MCIERR_INTERNAL;
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
@ -429,6 +469,7 @@ DWORD WAVE_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -502,6 +543,9 @@ DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
printf("WAVE_mciSet // MCI_WAVE_SET_SAMPLESPERSEC !\n"); printf("WAVE_mciSet // MCI_WAVE_SET_SAMPLESPERSEC !\n");
} }
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
@ -510,6 +554,7 @@ DWORD WAVE_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
*/ */
DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("WAVE_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -601,6 +646,9 @@ DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); MCIWavDev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
/************************************************************************** /**************************************************************************
@ -609,6 +657,7 @@ DWORD WAVE_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags, DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms) LPMCI_GETDEVCAPS_PARMS lpParms)
{ {
#ifdef linux
printf("WAVE_mciGetDevCaps(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciGetDevCaps(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL; if (lpParms == NULL) return MCIERR_INTERNAL;
if (dwFlags & MCI_GETDEVCAPS_ITEM) { if (dwFlags & MCI_GETDEVCAPS_ITEM) {
@ -651,6 +700,9 @@ DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
} }
} }
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
/************************************************************************** /**************************************************************************
@ -658,6 +710,7 @@ DWORD WAVE_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
*/ */
DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms) DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
{ {
#ifdef linux
printf("WAVE_mciInfo(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("WAVE_mciInfo(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
if (lpParms == NULL) return MCIERR_INTERNAL; if (lpParms == NULL) return MCIERR_INTERNAL;
lpParms->lpstrReturn = NULL; lpParms->lpstrReturn = NULL;
@ -682,6 +735,9 @@ DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
else else
lpParms->dwRetSize = 0; lpParms->dwRetSize = 0;
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
@ -693,6 +749,7 @@ DWORD WAVE_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
*/ */
DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS lpCaps, DWORD dwSize) DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS lpCaps, DWORD dwSize)
{ {
#ifdef linux
int audio; int audio;
int smplrate; int smplrate;
int samplesize = 16; int samplesize = 16;
@ -739,6 +796,9 @@ DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS lpCaps, DWORD dwSize)
close(audio); close(audio);
printf("wodGetDevCaps // dwFormats = %08X\n", lpCaps->dwFormats); printf("wodGetDevCaps // dwFormats = %08X\n", lpCaps->dwFormats);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -747,6 +807,7 @@ DWORD wodGetDevCaps(WORD wDevID, LPWAVEOUTCAPS lpCaps, DWORD dwSize)
*/ */
DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
{ {
#ifdef linux
int audio; int audio;
int abuf_size; int abuf_size;
int smplrate; int smplrate;
@ -826,6 +887,9 @@ DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -833,6 +897,7 @@ DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
*/ */
DWORD wodClose(WORD wDevID) DWORD wodClose(WORD wDevID)
{ {
#ifdef linux
printf("wodClose(%u);\n", wDevID); printf("wodClose(%u);\n", wDevID);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodClose' // can't close !\n"); printf("Linux 'wodClose' // can't close !\n");
@ -846,6 +911,9 @@ DWORD wodClose(WORD wDevID)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -853,6 +921,7 @@ DWORD wodClose(WORD wDevID)
*/ */
DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
printf("wodWrite(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("wodWrite(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodWrite' // can't play !\n"); printf("Linux 'wodWrite' // can't play !\n");
@ -875,6 +944,9 @@ DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -882,6 +954,7 @@ DWORD wodWrite(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
printf("wodPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("wodPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodPrepare' // can't prepare !\n"); printf("Linux 'wodPrepare' // can't prepare !\n");
@ -897,6 +970,9 @@ DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
lpWaveHdr->dwFlags |= WHDR_PREPARED; lpWaveHdr->dwFlags |= WHDR_PREPARED;
lpWaveHdr->dwFlags &= ~WHDR_DONE; lpWaveHdr->dwFlags &= ~WHDR_DONE;
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -904,12 +980,16 @@ DWORD wodPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
printf("wodUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("wodUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodUnprepare' // can't unprepare !\n"); printf("Linux 'wodUnprepare' // can't unprepare !\n");
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -917,12 +997,16 @@ DWORD wodUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD wodRestart(WORD wDevID) DWORD wodRestart(WORD wDevID)
{ {
#ifdef linux
printf("wodRestart(%u);\n", wDevID); printf("wodRestart(%u);\n", wDevID);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodRestart' // can't restart !\n"); printf("Linux 'wodRestart' // can't restart !\n");
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -930,12 +1014,16 @@ DWORD wodRestart(WORD wDevID)
*/ */
DWORD wodReset(WORD wDevID) DWORD wodReset(WORD wDevID)
{ {
#ifdef linux
printf("wodReset(%u);\n", wDevID); printf("wodReset(%u);\n", wDevID);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
printf("Linux 'wodReset' // can't reset !\n"); printf("Linux 'wodReset' // can't reset !\n");
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -944,6 +1032,7 @@ DWORD wodReset(WORD wDevID)
*/ */
DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) DWORD wodGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize)
{ {
#ifdef linux
int time; int time;
printf("wodGetPosition(%u, %08X, %u);\n", wDevID, lpTime, uSize); printf("wodGetPosition(%u, %08X, %u);\n", wDevID, lpTime, uSize);
if (WOutDev[wDevID].unixdev == 0) { if (WOutDev[wDevID].unixdev == 0) {
@ -988,6 +1077,9 @@ TryAGAIN:
goto TryAGAIN; goto TryAGAIN;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -995,6 +1087,7 @@ TryAGAIN:
*/ */
DWORD wodSetVolume(WORD wDevID, DWORD dwParam) DWORD wodSetVolume(WORD wDevID, DWORD dwParam)
{ {
#ifdef linux
int mixer; int mixer;
int volume = 50; int volume = 50;
printf("wodSetVolume(%u, %08X);\n", wDevID, dwParam); printf("wodSetVolume(%u, %08X);\n", wDevID, dwParam);
@ -1012,6 +1105,9 @@ DWORD wodSetVolume(WORD wDevID, DWORD dwParam)
} }
close(mixer); close(mixer);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -1072,6 +1168,7 @@ DWORD wodMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
*/ */
DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS lpCaps, DWORD dwSize) DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS lpCaps, DWORD dwSize)
{ {
#ifdef linux
int audio; int audio;
int smplrate; int smplrate;
int samplesize = 16; int samplesize = 16;
@ -1117,6 +1214,9 @@ DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS lpCaps, DWORD dwSize)
close(audio); close(audio);
printf("widGetDevCaps // dwFormats = %08X\n", lpCaps->dwFormats); printf("widGetDevCaps // dwFormats = %08X\n", lpCaps->dwFormats);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -1125,6 +1225,7 @@ DWORD widGetDevCaps(WORD wDevID, LPWAVEINCAPS lpCaps, DWORD dwSize)
*/ */
DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags) DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
{ {
#ifdef linux
int audio; int audio;
int abuf_size; int abuf_size;
int smplrate; int smplrate;
@ -1209,6 +1310,9 @@ DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1216,6 +1320,7 @@ DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
*/ */
DWORD widClose(WORD wDevID) DWORD widClose(WORD wDevID)
{ {
#ifdef linux
printf("widClose(%u);\n", wDevID); printf("widClose(%u);\n", wDevID);
if (WInDev[wDevID].unixdev == 0) { if (WInDev[wDevID].unixdev == 0) {
printf("Linux 'widClose' // can't close !\n"); printf("Linux 'widClose' // can't close !\n");
@ -1229,6 +1334,9 @@ DWORD widClose(WORD wDevID)
return MMSYSERR_INVALPARAM; return MMSYSERR_INVALPARAM;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1236,6 +1344,7 @@ DWORD widClose(WORD wDevID)
*/ */
DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
int count = 1; int count = 1;
LPWAVEHDR lpWIHdr; LPWAVEHDR lpWIHdr;
printf("widAddBuffer(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("widAddBuffer(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
@ -1270,6 +1379,9 @@ DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
} }
printf("widAddBuffer // buffer added ! (now %u in queue)\n", count); printf("widAddBuffer // buffer added ! (now %u in queue)\n", count);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1277,6 +1389,7 @@ DWORD widAddBuffer(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
printf("widPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("widPrepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (WInDev[wDevID].unixdev == 0) { if (WInDev[wDevID].unixdev == 0) {
printf("Linux 'widPrepare' // can't prepare !\n"); printf("Linux 'widPrepare' // can't prepare !\n");
@ -1295,6 +1408,9 @@ DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
lpWaveHdr->dwBytesRecorded = 0; lpWaveHdr->dwBytesRecorded = 0;
printf("Linux 'widPrepare' // header prepared !\n"); printf("Linux 'widPrepare' // header prepared !\n");
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1302,6 +1418,7 @@ DWORD widPrepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize) DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
{ {
#ifdef linux
printf("widUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize); printf("widUnprepare(%u, %08X, %08X);\n", wDevID, lpWaveHdr, dwSize);
if (WInDev[wDevID].unixdev == 0) { if (WInDev[wDevID].unixdev == 0) {
printf("Linux 'widUnprepare' // can't unprepare !\n"); printf("Linux 'widUnprepare' // can't unprepare !\n");
@ -1313,6 +1430,9 @@ DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
WInDev[wDevID].lpQueueHdr = NULL; WInDev[wDevID].lpQueueHdr = NULL;
printf("Linux 'widUnprepare' // all headers unprepared !\n"); printf("Linux 'widUnprepare' // all headers unprepared !\n");
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1320,6 +1440,7 @@ DWORD widUnprepare(WORD wDevID, LPWAVEHDR lpWaveHdr, DWORD dwSize)
*/ */
DWORD widStart(WORD wDevID) DWORD widStart(WORD wDevID)
{ {
#ifdef linux
int count = 1; int count = 1;
LPWAVEHDR lpWIHdr; LPWAVEHDR lpWIHdr;
printf("widStart(%u);\n", wDevID); printf("widStart(%u);\n", wDevID);
@ -1355,6 +1476,9 @@ DWORD widStart(WORD wDevID)
printf("widStart // end of recording !\n"); printf("widStart // end of recording !\n");
fflush(stdout); fflush(stdout);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1362,12 +1486,16 @@ DWORD widStart(WORD wDevID)
*/ */
DWORD widStop(WORD wDevID) DWORD widStop(WORD wDevID)
{ {
#ifdef linux
printf("widStop(%u);\n", wDevID); printf("widStop(%u);\n", wDevID);
if (WInDev[wDevID].unixdev == 0) { if (WInDev[wDevID].unixdev == 0) {
printf("Linux 'widStop' // can't stop !\n"); printf("Linux 'widStop' // can't stop !\n");
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1375,12 +1503,16 @@ DWORD widStop(WORD wDevID)
*/ */
DWORD widReset(WORD wDevID) DWORD widReset(WORD wDevID)
{ {
#ifdef linux
printf("widReset(%u);\n", wDevID); printf("widReset(%u);\n", wDevID);
if (WInDev[wDevID].unixdev == 0) { if (WInDev[wDevID].unixdev == 0) {
printf("Linux 'widReset' // can't reset !\n"); printf("Linux 'widReset' // can't reset !\n");
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1388,6 +1520,7 @@ DWORD widReset(WORD wDevID)
*/ */
DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize) DWORD widGetPosition(WORD wDevID, LPMMTIME lpTime, DWORD uSize)
{ {
#ifdef linux
int time; int time;
#ifdef DEBUG_MCIWAVE #ifdef DEBUG_MCIWAVE
printf("widGetPosition(%u, %08X, %u);\n", wDevID, lpTime, uSize); printf("widGetPosition(%u, %08X, %u);\n", wDevID, lpTime, uSize);
@ -1446,6 +1579,9 @@ TryAGAIN:
goto TryAGAIN; goto TryAGAIN;
} }
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -1506,5 +1642,4 @@ DWORD modMessage(WORD wDevID, WORD wMsg, DWORD dwUser,
return MMSYSERR_NOTENABLED; return MMSYSERR_NOTENABLED;
} }
#endif /* !WINELIB */ #endif /* !WINELIB */

View File

@ -18,8 +18,10 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef linux
#include <linux/soundcard.h> #include <linux/soundcard.h>
#include <linux/cdrom.h> #include <linux/cdrom.h>
#endif
#define SOUND_DEV "/dev/dsp" #define SOUND_DEV "/dev/dsp"
#define CDAUDIO_DEV "/dev/sbpcd" #define CDAUDIO_DEV "/dev/sbpcd"
@ -37,6 +39,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#define CDFRAMES_PERMIN 4500 #define CDFRAMES_PERMIN 4500
#define SECONDS_PERMIN 60 #define SECONDS_PERMIN 60
#ifdef linux
typedef struct { typedef struct {
int nUseCount; /* Incremented for each shared open */ int nUseCount; /* Incremented for each shared open */
BOOL fShareable; /* TRUE if first open was shareable */ BOOL fShareable; /* TRUE if first open was shareable */
@ -57,6 +60,7 @@ typedef struct {
} LINUX_CDAUDIO; } LINUX_CDAUDIO;
static LINUX_CDAUDIO CDADev[MAX_CDAUDIODRV]; static LINUX_CDAUDIO CDADev[MAX_CDAUDIODRV];
#endif
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID); UINT CDAUDIO_GetNumberOfTracks(UINT wDevID);
BOOL CDAUDIO_GetTracksInfo(UINT wDevID); BOOL CDAUDIO_GetTracksInfo(UINT wDevID);
@ -72,6 +76,7 @@ DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame);
*/ */
DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms) DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
{ {
#ifdef linux
UINT wDevID; UINT wDevID;
int cdrom; int cdrom;
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
@ -121,6 +126,9 @@ DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -128,12 +136,14 @@ DWORD CDAUDIO_mciOpen(DWORD dwFlags, LPMCI_OPEN_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms) DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms); printf("CDAUDIO_mciClose(%u, %08X, %08X);\n", wDevID, dwParam, lpParms);
#endif #endif
if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen); if (CDADev[wDevID].lpdwTrackLen != NULL) free(CDADev[wDevID].lpdwTrackLen);
if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos); if (CDADev[wDevID].lpdwTrackPos != NULL) free(CDADev[wDevID].lpdwTrackPos);
close(CDADev[wDevID].unixdev); close(CDADev[wDevID].unixdev);
#endif
} }
/************************************************************************** /**************************************************************************
@ -142,6 +152,7 @@ DWORD CDAUDIO_mciClose(UINT wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags, DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
LPMCI_GETDEVCAPS_PARMS lpParms) LPMCI_GETDEVCAPS_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciGetDevCaps(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciGetDevCaps(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -183,6 +194,9 @@ DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
} }
printf("CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08X);\n", lpParms->dwReturn); printf("CDAUDIO_mciGetDevCaps // lpParms->dwReturn=%08X);\n", lpParms->dwReturn);
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
/************************************************************************** /**************************************************************************
@ -190,6 +204,7 @@ DWORD CDAUDIO_mciGetDevCaps(UINT wDevID, DWORD dwFlags,
*/ */
DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms) DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciInfo(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciInfo(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -207,6 +222,9 @@ DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
else else
lpParms->dwRetSize = 0; lpParms->dwRetSize = 0;
return 0; return 0;
#else
return MCIERR_INTERNAL;
#endif
} }
/************************************************************************** /**************************************************************************
@ -214,6 +232,7 @@ DWORD CDAUDIO_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_INFO_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms) DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciStatus(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -315,6 +334,9 @@ DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
} }
printf("CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n"); printf("CDAUDIO_mciStatus // not MCI_STATUS_ITEM !\n");
return 0; return 0;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -324,6 +346,7 @@ DWORD CDAUDIO_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame) DWORD CDAUDIO_CalcTime(UINT wDevID, DWORD dwFormatType, DWORD dwFrame)
{ {
DWORD dwTime = 0; DWORD dwTime = 0;
#ifdef linux
UINT wTrack; UINT wTrack;
UINT wMinutes; UINT wMinutes;
UINT wSeconds; UINT wSeconds;
@ -372,6 +395,7 @@ TryAGAIN:
dwFormatType = MCI_FORMAT_TMSF; dwFormatType = MCI_FORMAT_TMSF;
goto TryAGAIN; goto TryAGAIN;
} }
#endif
return dwTime; return dwTime;
} }
@ -382,6 +406,7 @@ TryAGAIN:
DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime) DWORD CDAUDIO_CalcFrame(UINT wDevID, DWORD dwFormatType, DWORD dwTime)
{ {
DWORD dwFrame = 0; DWORD dwFrame = 0;
#ifdef linux
UINT wTrack; UINT wTrack;
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_CalcFrame(%u, %08X, %lu);\n", wDevID, dwFormatType, dwTime); printf("CDAUDIO_CalcFrame(%u, %08X, %lu);\n", wDevID, dwFormatType, dwTime);
@ -423,6 +448,7 @@ TryAGAIN:
dwFormatType = MCI_FORMAT_TMSF; dwFormatType = MCI_FORMAT_TMSF;
goto TryAGAIN; goto TryAGAIN;
} }
#endif
return dwFrame; return dwFrame;
} }
@ -432,6 +458,7 @@ TryAGAIN:
*/ */
UINT CDAUDIO_GetNumberOfTracks(UINT wDevID) UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
{ {
#ifdef linux
struct cdrom_tochdr hdr; struct cdrom_tochdr hdr;
if (CDADev[wDevID].nTracks == 0) { if (CDADev[wDevID].nTracks == 0) {
if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCHDR, &hdr)) { if (ioctl(CDADev[wDevID].unixdev, CDROMREADTOCHDR, &hdr)) {
@ -441,6 +468,9 @@ UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
CDADev[wDevID].nTracks = hdr.cdth_trk1; CDADev[wDevID].nTracks = hdr.cdth_trk1;
} }
return CDADev[wDevID].nTracks; return CDADev[wDevID].nTracks;
#else
return (WORD)-1;
#endif
} }
/************************************************************************** /**************************************************************************
@ -448,6 +478,7 @@ UINT CDAUDIO_GetNumberOfTracks(UINT wDevID)
*/ */
BOOL CDAUDIO_GetTracksInfo(UINT wDevID) BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
{ {
#ifdef linux
int i, length; int i, length;
int start, last_start; int start, last_start;
int total_length = 0; int total_length = 0;
@ -503,6 +534,9 @@ BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
CDADev[wDevID].dwTotalLen = total_length; CDADev[wDevID].dwTotalLen = total_length;
printf("CDAUDIO_GetTracksInfo // total_len=%u\n", total_length); printf("CDAUDIO_GetTracksInfo // total_len=%u\n", total_length);
return TRUE; return TRUE;
#else
return FALSE;
#endif
} }
@ -511,6 +545,7 @@ BOOL CDAUDIO_GetTracksInfo(UINT wDevID)
*/ */
BOOL CDAUDIO_GetCDStatus(UINT wDevID) BOOL CDAUDIO_GetCDStatus(UINT wDevID)
{ {
#ifdef linux
int oldmode = CDADev[wDevID].mode; int oldmode = CDADev[wDevID].mode;
CDADev[wDevID].sc.cdsc_format = CDROM_MSF; CDADev[wDevID].sc.cdsc_format = CDROM_MSF;
if (ioctl(CDADev[wDevID].unixdev, CDROMSUBCHNL, &CDADev[wDevID].sc)) { if (ioctl(CDADev[wDevID].unixdev, CDROMSUBCHNL, &CDADev[wDevID].sc)) {
@ -565,6 +600,9 @@ BOOL CDAUDIO_GetCDStatus(UINT wDevID)
} }
} }
return TRUE; return TRUE;
#else
return FALSE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -572,6 +610,7 @@ BOOL CDAUDIO_GetCDStatus(UINT wDevID)
*/ */
DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms) DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
{ {
#ifdef linux
int start, end; int start, end;
struct cdrom_msf msf; struct cdrom_msf msf;
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
@ -625,6 +664,9 @@ DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -632,6 +674,7 @@ DWORD CDAUDIO_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciStop(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -644,6 +687,9 @@ DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -651,6 +697,7 @@ DWORD CDAUDIO_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciPause(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -663,6 +710,9 @@ DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -670,6 +720,7 @@ DWORD CDAUDIO_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms) DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciResume(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -682,6 +733,9 @@ DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
/************************************************************************** /**************************************************************************
@ -689,6 +743,7 @@ DWORD CDAUDIO_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms) DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
{ {
#ifdef linux
DWORD dwRet; DWORD dwRet;
MCI_PLAY_PARMS PlayParms; MCI_PLAY_PARMS PlayParms;
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
@ -717,6 +772,9 @@ DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return dwRet; return dwRet;
#else
return MCIERR_HARDWARE;
#endif
} }
@ -725,6 +783,7 @@ DWORD CDAUDIO_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
*/ */
DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms) DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
{ {
#ifdef linux
#ifdef DEBUG_CDAUDIO #ifdef DEBUG_CDAUDIO
printf("CDAUDIO_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms); printf("CDAUDIO_mciSet(%u, %08X, %08X);\n", wDevID, dwFlags, lpParms);
#endif #endif
@ -775,6 +834,9 @@ DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL); CDADev[wDevID].wNotifyDeviceID, MCI_NOTIFY_SUCCESSFUL);
} }
return 0; return 0;
#else
return MCIERR_HARDWARE;
#endif
} }
@ -784,6 +846,7 @@ DWORD CDAUDIO_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg, LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
DWORD dwParam1, DWORD dwParam2) DWORD dwParam1, DWORD dwParam2)
{ {
#ifdef linux
switch(wMsg) { switch(wMsg) {
case DRV_LOAD: case DRV_LOAD:
return (LRESULT)1L; return (LRESULT)1L;
@ -852,6 +915,9 @@ LRESULT CDAUDIO_DriverProc(DWORD dwDevID, HDRVR hDriv, WORD wMsg,
default: default:
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2); return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
} }
#else
return MCIERR_HARDWARE;
#endif
} }

View File

@ -14,7 +14,9 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
#include <fcntl.h> #include <fcntl.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef linux
#include <linux/soundcard.h> #include <linux/soundcard.h>
#endif
#define SOUND_DEV "/dev/dsp" #define SOUND_DEV "/dev/dsp"
#define MIXER_DEV "/dev/mixer" #define MIXER_DEV "/dev/mixer"
@ -34,6 +36,7 @@ static char Copyright[] = "Copyright Martin Ayotte, 1994";
*/ */
DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize) DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
{ {
#ifdef linux
int mixer; int mixer;
int volume; int volume;
printf("AUX_GetDevCaps(%u, %08X, %u);\n", wDevID, lpCaps, dwSize); printf("AUX_GetDevCaps(%u, %08X, %u);\n", wDevID, lpCaps, dwSize);
@ -48,6 +51,9 @@ DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
} }
close(mixer); close(mixer);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
@ -56,6 +62,7 @@ DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPS lpCaps, DWORD dwSize)
*/ */
DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam) DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
{ {
#ifdef linux
int mixer; int mixer;
int volume; int volume;
printf("AUX_GetVolume(%u, %08X);\n", wDevID, dwParam); printf("AUX_GetVolume(%u, %08X);\n", wDevID, dwParam);
@ -69,6 +76,9 @@ DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
} }
close(mixer); close(mixer);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }
/************************************************************************** /**************************************************************************
@ -76,6 +86,7 @@ DWORD AUX_GetVolume(WORD wDevID, DWORD dwParam)
*/ */
DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam) DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
{ {
#ifdef linux
int mixer; int mixer;
int volume = 50; int volume = 50;
printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam); printf("AUX_SetVolume(%u, %08X);\n", wDevID, dwParam);
@ -89,6 +100,9 @@ DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
} }
close(mixer); close(mixer);
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;
#else
return MMSYSERR_NOTENABLED;
#endif
} }

View File

@ -233,7 +233,7 @@ WORD COLOR_ToPhysical( DC *dc, COLORREF color )
WORD *mapping; WORD *mapping;
if (!dc->u.x.pal.hMapping) return 0; if (!dc->u.x.pal.hMapping) return 0;
switch(color & 0xff000000) switch(color >> 24)
{ {
case 0: /* RGB */ case 0: /* RGB */
index = GetNearestPaletteIndex( STOCK_DEFAULT_PALETTE, color ); index = GetNearestPaletteIndex( STOCK_DEFAULT_PALETTE, color );

View File

@ -16,6 +16,34 @@ static char Copyright[] = "Copyright Alexandre Julliard, 1993";
#define MAX_FONTS 256 #define MAX_FONTS 256
static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL }; static LPLOGFONT lpLogFontList[MAX_FONTS] = { NULL };
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
/*
* CI_GET_CHAR_INFO - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
* return min_bounds). If none of these hold true, try again with the default
* char.
*/
#define CI_GET_CHAR_INFO(fs,col,def,cs) \
{ \
cs = def; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
if (CI_NONEXISTCHAR(cs)) cs = def; \
} \
} \
}
#define CI_GET_DEFAULT_INFO(fs,cs) \
CI_GET_CHAR_INFO(fs, fs->default_char, NULL, cs)
/*********************************************************************** /***********************************************************************
* FONT_MatchFont * FONT_MatchFont
* *
@ -86,7 +114,7 @@ static XFontStruct * FONT_MatchFont( LOGFONT * font )
void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont, void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
TEXTMETRIC * metrics ) TEXTMETRIC * metrics )
{ {
int average, i; int average, i, count;
unsigned long prop; unsigned long prop;
metrics->tmAscent = xfont->ascent; metrics->tmAscent = xfont->ascent;
@ -116,13 +144,17 @@ void FONT_GetMetrics( LOGFONT * logfont, XFontStruct * xfont,
else else
{ {
XCharStruct * charPtr = xfont->per_char; XCharStruct * charPtr = xfont->per_char;
average = 0; average = count = 0;
for (i = metrics->tmFirstChar; i <= metrics->tmLastChar; i++) for (i = metrics->tmFirstChar; i <= metrics->tmLastChar; i++)
{ {
average += charPtr->width; if (!CI_NONEXISTCHAR( charPtr ))
{
average += charPtr->width;
count++;
}
charPtr++; charPtr++;
} }
average /= metrics->tmLastChar - metrics->tmFirstChar + 1; if (count) average = (average + count/2) / count;
} }
metrics->tmAveCharWidth = average; metrics->tmAveCharWidth = average;
} }
@ -373,33 +405,6 @@ DWORD SetMapperFlags(HDC hDC, DWORD dwFlag)
/***********************************************************************/ /***********************************************************************/
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
/*
* CI_GET_CHAR_INFO - return the charinfo struct for the indicated 8bit
* character. If the character is in the column and exists, then return the
* appropriate metrics (note that fonts with common per-character metrics will
* return min_bounds). If none of these hold true, try again with the default
* char.
*/
#define CI_GET_CHAR_INFO(fs,col,def,cs) \
{ \
cs = def; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
if (CI_NONEXISTCHAR(cs)) cs = def; \
} \
} \
}
#define CI_GET_DEFAULT_INFO(fs,cs) \
CI_GET_CHAR_INFO(fs, fs->default_char, NULL, cs)
/*********************************************************************** /***********************************************************************
* GetCharWidth (GDI.350) * GetCharWidth (GDI.350)

View File

@ -235,8 +235,12 @@ int DrawText( HDC hdc, LPSTR str, int count, LPRECT rect, WORD flags )
if (!TextOut(hdc, x, y, line, len)) return 0; if (!TextOut(hdc, x, y, line, len)) return 0;
if (prefix_offset != -1) if (prefix_offset != -1)
{ {
HPEN hpen = CreatePen( PS_SOLID, 1, GetTextColor(hdc) );
HPEN oldPen = SelectObject( hdc, hpen );
MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 ); MoveTo(hdc, x + prefix_x, y + tm.tmAscent + 1 );
LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 ); LineTo(hdc, x + prefix_end, y + tm.tmAscent + 1 );
SelectObject( hdc, oldPen );
DeleteObject( hpen );
} }
if (strPtr) if (strPtr)

View File

@ -20,9 +20,10 @@ static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
#define VARTYPE_LONG 2 #define VARTYPE_LONG 2
#define VARTYPE_FARPTR 3 #define VARTYPE_FARPTR 3
#define FUNCTYPE_PASCAL 16 #define FUNCTYPE_PASCAL_16 15
#define FUNCTYPE_C 17 #define FUNCTYPE_PASCAL 16
#define FUNCTYPE_REG 19 #define FUNCTYPE_C 17
#define FUNCTYPE_REG 19
#define EQUATETYPE_ABS 18 #define EQUATETYPE_ABS 18
#define TYPE_RETURN 20 #define TYPE_RETURN 20
@ -372,7 +373,8 @@ ParseExportFunction(int ordinal, int type)
} }
fdp->n_args_16 = i; fdp->n_args_16 = i;
if (type == FUNCTYPE_PASCAL || type == FUNCTYPE_REG) if (type == FUNCTYPE_PASCAL_16 || type == FUNCTYPE_PASCAL ||
type == FUNCTYPE_REG )
{ {
current_offset = 0; current_offset = 0;
for (i--; i >= 0; i--) for (i--; i >= 0; i--)
@ -521,6 +523,8 @@ ParseOrdinal(int ordinal)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL); return ParseExportFunction(ordinal, FUNCTYPE_PASCAL);
else if (stricmp(token, "pascal") == 0) else if (stricmp(token, "pascal") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL); return ParseExportFunction(ordinal, FUNCTYPE_PASCAL);
else if (stricmp(token, "pascal16") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_PASCAL_16);
else if (stricmp(token, "register") == 0) else if (stricmp(token, "register") == 0)
return ParseExportFunction(ordinal, FUNCTYPE_REG); return ParseExportFunction(ordinal, FUNCTYPE_REG);
else if (stricmp(token, "equate") == 0) else if (stricmp(token, "equate") == 0)
@ -755,6 +759,13 @@ main(int argc, char **argv)
fprintf(fp, "\torl\t$0x%08x,%%eax\n", DLLId << 16); fprintf(fp, "\torl\t$0x%08x,%%eax\n", DLLId << 16);
fprintf(fp, "\tjmp\t_CallTo32\n\n"); fprintf(fp, "\tjmp\t_CallTo32\n\n");
fprintf(fp, "\t.globl _%s_Dispatch_16\n", UpperDLLName);
fprintf(fp, "_%s_Dispatch_16:\n", UpperDLLName);
fprintf(fp, "\tandl\t$0x0000ffff,%%esp\n");
fprintf(fp, "\tandl\t$0x0000ffff,%%ebp\n");
fprintf(fp, "\torl\t$0x%08x,%%eax\n", DLLId << 16);
fprintf(fp, "\tjmp\t_CallTo32_16\n\n");
odp = OrdinalDefinitions; odp = OrdinalDefinitions;
for (i = 0; i <= Limit; i++, odp++) for (i = 0; i <= Limit; i++, odp++)
{ {
@ -829,6 +840,13 @@ main(int argc, char **argv)
fprintf(fp, "\tjmp\t_%s_Dispatch\n\n", UpperDLLName); fprintf(fp, "\tjmp\t_%s_Dispatch\n\n", UpperDLLName);
break; break;
case FUNCTYPE_PASCAL_16:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
fprintf(fp, "\tmovl\t$%d,%%eax\n", i);
fprintf(fp, "\tpushw\t$%d\n", fdp->arg_16_size);
fprintf(fp, "\tjmp\t_%s_Dispatch_16\n\n", UpperDLLName);
break;
case FUNCTYPE_C: case FUNCTYPE_C:
default: default:
fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i); fprintf(fp, "_%s_Ordinal_%d:\n", UpperDLLName, i);
@ -862,8 +880,8 @@ main(int argc, char **argv)
for (i = 0; i <= Limit; i++, odp++) for (i = 0; i <= Limit; i++, odp++)
{ {
if (odp->valid && if (odp->valid &&
(odp->type == FUNCTYPE_PASCAL || odp->type == FUNCTYPE_C || (odp->type == FUNCTYPE_PASCAL || odp->type == FUNCTYPE_PASCAL_16 ||
odp->type == FUNCTYPE_REG)) odp->type == FUNCTYPE_REG || odp->type == FUNCTYPE_C ))
{ {
fdp = odp->additional_data; fdp = odp->additional_data;
fprintf(fp, "extern int %s();\n", fdp->internal_name); fprintf(fp, "extern int %s();\n", fdp->internal_name);
@ -884,6 +902,7 @@ main(int argc, char **argv)
switch (odp->type) switch (odp->type)
{ {
case FUNCTYPE_PASCAL: case FUNCTYPE_PASCAL:
case FUNCTYPE_PASCAL_16:
case FUNCTYPE_REG: case FUNCTYPE_REG:
fprintf(fp, " { 0x%x, %s_Ordinal_%d, ", UTEXTSEL, UpperDLLName, i); fprintf(fp, " { 0x%x, %s_Ordinal_%d, ", UTEXTSEL, UpperDLLName, i);
fprintf(fp, "\042%s\042, ", odp->export_name); fprintf(fp, "\042%s\042, ", odp->export_name);

View File

@ -27,7 +27,8 @@ static HBITMAP hbitmapRestoreD = 0;
extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos, extern void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
POINT *minTrack, POINT *maxTrack ); /* winpos.c */ POINT *minTrack, POINT *maxTrack ); /* winpos.c */
extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */ extern void CURSOR_SetWinCursor( HWND hwnd, HCURSOR hcursor ); /* cursor.c */
extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth ); /* menu.c */ extern WORD MENU_GetMenuBarHeight( HWND hwnd, WORD menubarWidth,
int orgX, int orgY ); /* menu.c */
/* Some useful macros */ /* Some useful macros */
@ -127,7 +128,8 @@ LONG NC_HandleNCCalcSize( HWND hwnd, NCCALCSIZE_PARAMS *params )
if (HAS_MENU(wndPtr)) if (HAS_MENU(wndPtr))
{ {
params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd, params->rgrc[0].top += MENU_GetMenuBarHeight( hwnd,
params->rgrc[0].right - params->rgrc[0].left ); params->rgrc[0].right - params->rgrc[0].left,
-tmpRect.left, -tmpRect.top ) + 1;
} }
return 0; return 0;
} }
@ -178,43 +180,61 @@ static LONG NC_InternalNCHitTest( HWND hwnd, POINT pt )
GetWindowRect( hwnd, &rect ); GetWindowRect( hwnd, &rect );
if (!PtInRect( &rect, pt )) return HTNOWHERE; if (!PtInRect( &rect, pt )) return HTNOWHERE;
ScreenToClient( hwnd, &pt );
GetClientRect( hwnd, &rect );
if (PtInRect( &rect, pt )) return HTCLIENT;
/* Check vertical scroll bar */ /* Check borders */
if (wndPtr->dwStyle & WS_VSCROLL)
{
rect.right += SYSMETRICS_CXVSCROLL;
if (PtInRect( &rect, pt )) return HTVSCROLL;
}
/* Check horizontal scroll bar */ if (HAS_THICKFRAME( wndPtr->dwStyle ))
if (wndPtr->dwStyle & WS_HSCROLL)
{ {
rect.bottom += SYSMETRICS_CYHSCROLL; InflateRect( &rect, -SYSMETRICS_CXFRAME, -SYSMETRICS_CYFRAME );
if (PtInRect( &rect, pt )) if (wndPtr->dwStyle & WS_BORDER)
InflateRect( &rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER );
if (!PtInRect( &rect, pt ))
{ {
/* Check size box */ /* Check top sizing border */
if ((wndPtr->dwStyle & WS_VSCROLL) && if (pt.y < rect.top)
(pt.x >= rect.right - SYSMETRICS_CXVSCROLL)) return HTSIZE; {
return HTHSCROLL; if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT;
return HTTOP;
}
/* Check bottom sizing border */
if (pt.y >= rect.bottom)
{
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT;
return HTBOTTOM;
}
/* Check left sizing border */
if (pt.x < rect.left)
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
return HTLEFT;
}
/* Check right sizing border */
if (pt.x >= rect.right)
{
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT;
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT;
return HTRIGHT;
}
} }
} }
else /* No thick frame */
/* Check menu */
if (HAS_MENU(wndPtr))
{ {
rect.top -= SYSMETRICS_CYMENU + 1; if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
if (PtInRect( &rect, pt )) return HTMENU; InflateRect(&rect, -SYSMETRICS_CXDLGFRAME, -SYSMETRICS_CYDLGFRAME);
else if (wndPtr->dwStyle & WS_BORDER)
InflateRect(&rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
if (!PtInRect( &rect, pt )) return HTBORDER;
} }
/* Check caption */ /* Check caption */
if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION) if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION)
{ {
rect.top -= SYSMETRICS_CYCAPTION - 1; rect.top += SYSMETRICS_CYCAPTION - 1;
if (PtInRect( &rect, pt )) if (!PtInRect( &rect, pt ))
{ {
/* Check system menu */ /* Check system menu */
if ((wndPtr->dwStyle & WS_SYSMENU) && (pt.x <= SYSMETRICS_CXSIZE)) if ((wndPtr->dwStyle & WS_SYSMENU) && (pt.x <= SYSMETRICS_CXSIZE))
@ -230,40 +250,42 @@ static LONG NC_InternalNCHitTest( HWND hwnd, POINT pt )
return HTCAPTION; return HTCAPTION;
} }
} }
/* Check non-sizing border */
if (!HAS_THICKFRAME( wndPtr->dwStyle )) return HTBORDER;
/* Check top sizing border */ /* Check client area */
if (pt.y < rect.top)
ScreenToClient( hwnd, &pt );
GetClientRect( hwnd, &rect );
if (PtInRect( &rect, pt )) return HTCLIENT;
/* Check vertical scroll bar */
if (wndPtr->dwStyle & WS_VSCROLL)
{ {
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTTOPLEFT; rect.right += SYSMETRICS_CXVSCROLL;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTTOPRIGHT; if (PtInRect( &rect, pt )) return HTVSCROLL;
return HTTOP;
} }
/* Check bottom sizing border */ /* Check horizontal scroll bar */
if (pt.y >= rect.bottom)
if (wndPtr->dwStyle & WS_HSCROLL)
{ {
if (pt.x < rect.left+SYSMETRICS_CXSIZE) return HTBOTTOMLEFT; rect.bottom += SYSMETRICS_CYHSCROLL;
if (pt.x >= rect.right-SYSMETRICS_CXSIZE) return HTBOTTOMRIGHT; if (PtInRect( &rect, pt ))
return HTBOTTOM; {
} /* Check size box */
if ((wndPtr->dwStyle & WS_VSCROLL) &&
/* Check left sizing border */ (pt.x >= rect.right - SYSMETRICS_CXVSCROLL))
if (pt.x < rect.left) return HTSIZE;
{ return HTHSCROLL;
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPLEFT; }
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMLEFT;
return HTLEFT;
} }
/* Check right sizing border */ /* Check menu bar */
if (pt.x >= rect.right)
if (HAS_MENU(wndPtr))
{ {
if (pt.y < rect.top+SYSMETRICS_CYSIZE) return HTTOPRIGHT; if ((pt.y < 0) && (pt.x >= 0) && (pt.x < rect.right))
if (pt.y >= rect.bottom-SYSMETRICS_CYSIZE) return HTBOTTOMRIGHT; return HTMENU;
return HTRIGHT;
} }
/* Should never get here */ /* Should never get here */
@ -537,9 +559,9 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
#ifdef DEBUG_NONCLIENT #ifdef DEBUG_NONCLIENT
printf( "NC_DoNCPaint: %d %d\n", hwnd, hrgn ); printf( "NC_DoNCPaint: %d %d\n", hwnd, hrgn );
#endif #endif
if (!IsWindowVisible(hwnd)) return;
if (!wndPtr || !hrgn) return; if (!wndPtr || !hrgn) return;
if (!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME))) if ((!(wndPtr->dwStyle & (WS_BORDER | WS_DLGFRAME | WS_THICKFRAME))) ||
(!(wndPtr->dwStyle & WS_VISIBLE)))
return; /* Nothing to do! */ return; /* Nothing to do! */
if (hrgn == 1) hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW ); if (hrgn == 1) hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW );
@ -594,27 +616,15 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
NC_DrawCaption( hdc, &r, hwnd, wndPtr->dwStyle, active ); NC_DrawCaption( hdc, &r, hwnd, wndPtr->dwStyle, active );
} }
if (wndPtr->wIDmenu != 0 && if (HAS_MENU(wndPtr))
(wndPtr->dwStyle & WS_CHILD) != WS_CHILD) { {
LPPOPUPMENU lpMenu = (LPPOPUPMENU) GlobalLock(wndPtr->wIDmenu); LPPOPUPMENU lpMenu = (LPPOPUPMENU) GlobalLock( wndPtr->wIDmenu );
if (lpMenu != NULL) { RECT r = rect;
int oldHeight; r.bottom = rect.top + lpMenu->Height;
CopyRect(&rect2, &rect); rect.top += lpMenu->Height;
/* Default MenuBar height */ StdDrawMenuBar( hdc, &r, lpMenu, suppress_menupaint );
if (lpMenu->Height == 0) lpMenu->Height = SYSMETRICS_CYMENU + 1; GlobalUnlock( wndPtr->wIDmenu );
oldHeight = lpMenu->Height; }
rect2.bottom = rect2.top + oldHeight;
StdDrawMenuBar(hdc, &rect2, lpMenu, suppress_menupaint);
if (oldHeight != lpMenu->Height) {
printf("NC_DoNCPaint // menubar changed oldHeight=%d != lpMenu->Height=%d\n",
oldHeight, lpMenu->Height);
/* Reduce ClientRect according to MenuBar height */
wndPtr->rectClient.top -= oldHeight;
wndPtr->rectClient.top += lpMenu->Height;
}
GlobalUnlock(wndPtr->wIDmenu);
}
}
if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) { if (wndPtr->dwStyle & (WS_VSCROLL | WS_HSCROLL)) {
if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->VScroll != NULL) && if ((wndPtr->dwStyle & WS_VSCROLL) && (wndPtr->VScroll != NULL) &&
@ -624,9 +634,6 @@ void NC_DoNCPaint( HWND hwnd, HRGN hrgn, BOOL active, BOOL suppress_menupaint )
bottom -= SYSMETRICS_CYHSCROLL; bottom -= SYSMETRICS_CYHSCROLL;
SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL, SetRect(&rect2, rect.right - SYSMETRICS_CXVSCROLL,
rect.top, rect.right, bottom); rect.top, rect.right, bottom);
if (wndPtr->dwStyle & WS_CAPTION) rect.top += SYSMETRICS_CYSIZE;
if (wndPtr->wIDmenu != 0 && (wndPtr->dwStyle & WS_CHILD) != WS_CHILD)
rect2.top += SYSMETRICS_CYMENU + 1;
StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, (LPHEADSCROLL)wndPtr->VScroll); StdDrawScrollBar(hwnd, hdc, SB_VERT, &rect2, (LPHEADSCROLL)wndPtr->VScroll);
} }
if ((wndPtr->dwStyle & WS_HSCROLL) && wndPtr->HScroll != NULL && if ((wndPtr->dwStyle & WS_HSCROLL) && wndPtr->HScroll != NULL &&

View File

@ -45,6 +45,8 @@ static char * DefSysColors[] =
static COLORREF SysColors[NUM_SYS_COLORS]; static COLORREF SysColors[NUM_SYS_COLORS];
#define MAKE_SOLID(color) \
(PALETTEINDEX(GetNearestPaletteIndex(STOCK_DEFAULT_PALETTE,(color))))
/************************************************************************* /*************************************************************************
* SYSCOLOR_SetColor * SYSCOLOR_SetColor
@ -69,6 +71,8 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
sysColorObjects.hbrushInactiveCaption = CreateSolidBrush( color ); sysColorObjects.hbrushInactiveCaption = CreateSolidBrush( color );
break; break;
case COLOR_MENU: case COLOR_MENU:
DeleteObject( sysColorObjects.hbrushMenu );
sysColorObjects.hbrushMenu = CreateSolidBrush( MAKE_SOLID(color) );
break; break;
case COLOR_WINDOW: case COLOR_WINDOW:
DeleteObject( sysColorObjects.hbrushWindow ); DeleteObject( sysColorObjects.hbrushWindow );
@ -95,7 +99,11 @@ static void SYSCOLOR_SetColor( int index, COLORREF color )
sysColorObjects.hbrushInactiveBorder = CreateSolidBrush( color ); sysColorObjects.hbrushInactiveBorder = CreateSolidBrush( color );
break; break;
case COLOR_APPWORKSPACE: case COLOR_APPWORKSPACE:
break;
case COLOR_HIGHLIGHT: case COLOR_HIGHLIGHT:
DeleteObject( sysColorObjects.hbrushHighlight );
sysColorObjects.hbrushHighlight = CreateSolidBrush( MAKE_SOLID(color));
break;
case COLOR_HIGHLIGHTTEXT: case COLOR_HIGHLIGHTTEXT:
break; break;
case COLOR_BTNFACE: case COLOR_BTNFACE:

View File

@ -260,8 +260,11 @@ HWND CreateWindowEx( DWORD exStyle, LPSTR className, LPSTR windowName,
#endif #endif
/* 'soundrec.exe' has negative position ! /* 'soundrec.exe' has negative position !
Why ? For now, here a patch : */ Why ? For now, here a patch : */
if (x < 0) x = 0; if (!strcmp(className, "SoundRec"))
if (y < 0) y = 0; {
if (x < 0) x = 0;
if (y < 0) y = 0;
}
if (x == CW_USEDEFAULT) x = y = 0; if (x == CW_USEDEFAULT) x = y = 0;
if (width == CW_USEDEFAULT) if (width == CW_USEDEFAULT)
{ {

View File

@ -647,16 +647,21 @@ static BOOL WINPOS_InternalSetWindowPos( WINDOWPOS *winpos )
/* Send WM_NCPAINT message if needed */ /* Send WM_NCPAINT message if needed */
if ((flags & (SWP_FRAMECHANGED | SWP_SHOWWINDOW)) || if (flags & SWP_SHOWWINDOW)
(!(flags & SWP_NOSIZE)) || (!(flags & SWP_NOMOVE)) || {
(!(flags & SWP_NOACTIVATE)) || (!(flags & SWP_NOZORDER))) /* Repaint the window frame and background */
SendMessage( winpos->hwnd, WM_NCPAINT, 1, 0L ); RedrawWindow( winpos->hwnd, NULL, 0,
#if 0 RDW_INVALIDATE | RDW_FRAME | RDW_ERASENOW );
if ((flags & (SWP_FRAMECHANGED | SWP_SHOWWINDOW)) && }
(!(flags & SWP_NOREDRAW)) && else
(wndPtr->dwStyle & WS_VISIBLE)) {
InvalidateRect(winpos->hwnd, NULL, TRUE); if ((flags & SWP_FRAMECHANGED) ||
#endif (!(flags & SWP_NOSIZE)) ||
(!(flags & SWP_NOMOVE)) ||
(!(flags & SWP_NOACTIVATE)) ||
(!(flags & SWP_NOZORDER)))
SendMessage( winpos->hwnd, WM_NCPAINT, 1, 0L );
}
/* And last, send the WM_WINDOWPOSCHANGED message */ /* And last, send the WM_WINDOWPOSCHANGED message */