Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
December 2002
- 132 participants
- 1012 messages
Re: RtlUnicodeStringToInteger prototype (resending)
by Duane Clark
Dan Kegel wrote:
> I sent this to wine-patches on the 25th, but it never appeared in the archive;
> is that list moderated?
Only for unsubscribed email adresses, or postings over a 200KB size
limit. And I did not see your patches among those being held.
Dec. 27, 2002
Re: Standard way of printing RECT in trace statements?
by Dan Kegel
Dimitrie O. Paun wrote:
> On December 26, 2002 12:14 am, Dan Kegel wrote:
>
>>Example use:
>> TRACE("Combo client " _RECT_FMT ", setting Edit to " _RECT_FMT "\n",
>> _RECT_ARG(rect), x, y, x + w, y + h);
>
>
> Oh no! It's not too pretty, isn't it? :)
No, it's pretty ugly :-)
>>Although this doesn't hide things as well as the inline function,
>>it might have some advantage in size and runtime, since it does
>>more of its work at compile time.
>
>
> I'll bet you a dollar in small change you can not measure a 1% speed
> difference. This code executes in trace mode only, where you don't
> care about the speed anyhow. Also, the since difference must be minute
> anyhow since the macro approach actually enlarges the strings where
> it's used.
I thought everyone always left NO_TRACE_MSGS undefined,
so the rect2a function you favor gets called unconditionally,
and its output filtered out. The macro doesn't enlarge the
strings over current practice; it merely codifies existing usage.
There would be no net change in string size or code size
with the macro approach.
Alternately, we could skip the macros, and just standardize
the format strings. Would that be more acceptable?
- Dan
--
Dan Kegel
Linux User #78045
http://www.kegel.com
Dec. 27, 2002
RtlUnicodeStringToInteger prototype (resending)
by Dan Kegel
I sent this to wine-patches on the 25th, but it never appeared in the archive;
is that list moderated?
- Dan
Changelog:
* dlls/ntdll/{,tests/}rtlstr.c - fix prototype for RtlUnicodeToInteger
Dan Kegel
License: LGPL
Index: dlls/ntdll/rtlstr.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/rtlstr.c,v
retrieving revision 1.25
diff -u -r1.25 rtlstr.c
--- dlls/ntdll/rtlstr.c 12 Nov 2002 02:17:34 -0000 1.25
+++ dlls/ntdll/rtlstr.c 25 Dec 2002 18:52:54 -0000
@@ -843,17 +843,17 @@
*/
NTSTATUS WINAPI RtlUnicodeStringToInteger(
const UNICODE_STRING *str,
- int base,
- int * pdest)
+ ULONG base,
+ PULONG pdest)
{
LPWSTR lpwstr = str->Buffer;
WCHAR wchCurrent = 0;
int CharsParsed = 0;
- int RunningTotal = 0;
+ ULONG RunningTotal = 0;
char bMinus = 0;
/* no checking done on UNICODE_STRING and int* in native DLL either */
- TRACE("(%p, %d, %p)", str, base, pdest);
+ TRACE("(%p, %lu, %p)", str, base, pdest);
switch (base)
{
@@ -895,8 +895,7 @@
wchCurrent = '0' + 10 + wchCurrent - 'A';
if ((wchCurrent - '0') >= base || wchCurrent < '0')
{
- *pdest = bMinus ? -RunningTotal: RunningTotal;
- return STATUS_SUCCESS;
+ break;
}
/*
* increase significance of previous digits each time
@@ -905,6 +904,6 @@
RunningTotal = wchCurrent - '0' + RunningTotal * base;
}
- *pdest = bMinus ? -RunningTotal : RunningTotal;
+ *pdest = bMinus ? ((~RunningTotal)+1UL) : RunningTotal;
return STATUS_SUCCESS;
}
Index: dlls/ntdll/tests/rtlstr.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/rtlstr.c,v
retrieving revision 1.2
diff -u -r1.2 rtlstr.c
--- dlls/ntdll/tests/rtlstr.c 19 Dec 2002 21:15:41 -0000 1.2
+++ dlls/ntdll/tests/rtlstr.c 25 Dec 2002 18:52:54 -0000
@@ -66,7 +66,7 @@
/* more function pointers here */
/*static DWORD (WINAPI *pRtlIsTextUnicode)(LPVOID, DWORD, DWORD *);*/
-static NTSTATUS (WINAPI *pRtlUnicodeStringToInteger)(const UNICODE_STRING *, int, int *);
+static NTSTATUS (WINAPI *pRtlUnicodeStringToInteger)(const UNICODE_STRING *, ULONG, PULONG);
static void InitFunctionPtrs()
{
@@ -123,7 +123,7 @@
static void test_RtlUnicodeStringToInteger(void)
{
- int dest = 0;
+ ULONG dest = 0;
int i;
DWORD result;
@@ -131,6 +131,7 @@
static const WCHAR stringwithint[][12] = {
{'1','0','1','1','1','0','1','1','0','0',0},
{'1','2','3','4','5','6','7',0},
+ {'-','2','1','4','7','4','8','3','6','4','7',0},
{'2','1','4','7','4','8','3','6','4','8',0},
{'-','2','1','4','7','4','8','3','6','4','8',0},
{'-','2','1','4',0},
@@ -141,11 +142,12 @@
{'0','x','1','2','3','4','5',0},
{'1','x','3','4',0}
};
- static const int expectedresults[] = {
+ static const ULONG expectedresults[] = {
1011101100,
1234567,
- 2147483648,
- 2147483648,
+ -2147483647,
+ 2147483648UL,
+ 2147483648UL, /* 2 ^ 31 === - (2 ^ 31) */
-214,
214,
214,
@@ -155,34 +157,37 @@
1
};
/* these are for stringwithint[0]: */
- static const int expectedresultsbase[] = {
+ static const ULONG expectedresultsbase[] = {
748, /* base 2 */
136610368, /* base 8 */
1011101100, /* base 10 */
286265600, /* base 16 */
};
-
- for (i = 0; i < sizeof(expectedresults) / sizeof(int); i++)
+
+ /* check assumption made in -0 test case */
+ ok((2147483648UL == ((~2147483648UL) + 1UL)), "LONG is not 32 bits?");
+
+ for (i = 0; i < sizeof(expectedresults) / sizeof(expectedresults[0]); i++)
{
dest = 0xdeadbeef;
pRtlInitUnicodeString(&uni, stringwithint[i]);
result = pRtlUnicodeStringToInteger(&uni, 0, &dest);
ok(result == 0, "call failed: RtlUnicodeStringToInteger(\"%S\", %d, [out])", uni.Buffer, 0);
- ok(dest == expectedresults[i], "didn't return expected value (test %d): expected: %d, got: %d}",
i, expectedresults[i], dest);
+ ok(dest == expectedresults[i], "didn't return expected value (test %d): expected: %lu, got:
%lu}", i, expectedresults[i], dest);
}
pRtlInitUnicodeString(&uni, stringwithint[0]);
result = pRtlUnicodeStringToInteger(&uni, 2, &dest);
ok(result == 0, "call failed: RtlUnicodeStringToInteger(\"%S\", %d, [out])", uni.Buffer, 2);
- ok(dest == expectedresultsbase[0], "didn't return expected value: \"%S\"; expected: %d, got: %d}",
uni.Buffer, expectedresultsbase[0], dest);
+ ok(dest == expectedresultsbase[0], "didn't return expected value: \"%S\"; expected: %lu, got:
%ld}", uni.Buffer, expectedresultsbase[0], dest);
result = pRtlUnicodeStringToInteger(&uni, 8, &dest);
ok(result == 0, "call failed: RtlUnicodeStringToInteger(\"%S\", %d, [out])", uni.Buffer, 8);
- ok(dest == expectedresultsbase[1], "didn't return expected value: \"%S\"; expected: %d, got: %d}",
uni.Buffer, expectedresultsbase[1], dest);
+ ok(dest == expectedresultsbase[1], "didn't return expected value: \"%S\"; expected: %lu, got:
%ld}", uni.Buffer, expectedresultsbase[1], dest);
result = pRtlUnicodeStringToInteger(&uni, 10, &dest);
ok(result == 0, "call failed: RtlUnicodeStringToInteger(\"%S\", %d, [out])", uni.Buffer, 10);
- ok(dest == expectedresultsbase[2], "didn't return expected value: \"%S\"; expected: %d, got: %d}",
uni.Buffer, expectedresultsbase[2], dest);
+ ok(dest == expectedresultsbase[2], "didn't return expected value: \"%S\"; expected: %lu, got:
%ld}", uni.Buffer, expectedresultsbase[2], dest);
result = pRtlUnicodeStringToInteger(&uni, 16, &dest);
ok(result == 0, "call failed: RtlUnicodeStringToInteger(\"%S\", %d, [out])", uni.Buffer, 16);
- ok(dest == expectedresultsbase[3], "didn't return expected value: \"%S\"; expected: %d, got: %d}",
uni.Buffer, expectedresultsbase[3], dest);
+ ok(dest == expectedresultsbase[3], "didn't return expected value: \"%S\"; expected: %lu, got:
%ld}", uni.Buffer, expectedresultsbase[3], dest);
}
START_TEST(rtlstr)
Dec. 27, 2002
Re: Wine: several warnings in dlls/ntdll/tests/rtlstr.c
by Dan Kegel
Gerald Pfeifer wrote:
> Using GCC 2.95.3 on FreeBSD 4.7 (which has a couple of tests not
> usually supported by GCC 2.95) I get a couple of warnings due to
> recent changes/additions in Wine; these warnings seem to indicate
> real problems:
I brought those up recently; Francois Gouget suggests fixing the wcscmp
warning by switching to strcmpW
http://www.winehq.com/hypermail/wine-devel/2002/12/0892.html
I fixed the decimal constant warnings in a patch I sent a couple
days ago... but my mail system seems to have dropped it, so I'll
resend it.
The format warnings are worrisome.
>
> rtlstr.c: In function `test_RtlInitUnicodeString':
> rtlstr.c:110: warning: implicit declaration of function `wcscmp'
> rtlstr.c: In function `test_RtlUnicodeStringToInteger':
> rtlstr.c:147: warning: decimal constant is so large that it is unsigned
> rtlstr.c:148: warning: decimal constant is so large that it is unsigned
> rtlstr.c:170: warning: int format, different type arg (arg 3)
> rtlstr.c:175: warning: int format, different type arg (arg 3)
> rtlstr.c:176: warning: int format, different type arg (arg 3)
> rtlstr.c:178: warning: int format, different type arg (arg 3)
> rtlstr.c:179: warning: int format, different type arg (arg 3)
> rtlstr.c:181: warning: int format, different type arg (arg 3)
> rtlstr.c:182: warning: int format, different type arg (arg 3)
> rtlstr.c:184: warning: int format, different type arg (arg 3)
> rtlstr.c:185: warning: int format, different type arg (arg 3)
>
> Robert, perhaps you could have a look at these?
>
> Gerald
--
Dan Kegel
Linux User #78045
http://www.kegel.com
Dec. 27, 2002
Wine Contrib 0.6
by Dimitrie O. Paun
Folks,
A new version of Wine-Contrib is available at:
http://www.dssd.ca/wine/Wine-Contrib-0.6.html
courtesy of Tom & Tony.
--
Dimi.
Dec. 27, 2002
Re: Standard way of printing RECT in trace statements?
by Dimitrie O. Paun
On December 26, 2002 12:14 am, Dan Kegel wrote:
> Example use:
> TRACE("Combo client " _RECT_FMT ", setting Edit to " _RECT_FMT "\n",
> _RECT_ARG(rect), x, y, x + w, y + h);
Oh no! It's not too pretty, isn't it? :)
> Although this doesn't hide things as well as the inline function,
> it might have some advantage in size and runtime, since it does
> more of its work at compile time.
I'll bet you a dollar in small change you can not measure a 1% speed
difference. This code executes in trace mode only, where you don't
care about the speed anyhow. Also, the since difference must be minute
anyhow since the macro approach actually enlarges the strings where
it's used. Not to speak of the aesthetic side of things... :)
--
Dimi.
Dec. 27, 2002
Re: Listview scroll patch
by Dimitrie O. Paun
On December 27, 2002 01:18 am, Chris Morgan wrote:
> +/* Return the corresponding text for a given scroll value */
> +static inline LPSTR debugscrollcode(int nScrollCode)
> +{
> + switch(nScrollCode)
> + {
> + case SB_LINELEFT: return "SB_LINELEFT";
> + case SB_LINERIGHT: return "SB_LINERIGHT";
> + case SB_PAGELEFT: return "SB_PAGELEFT";
> + case SB_PAGERIGHT: return "SB_PAGERIGHT";
> + case SB_THUMBPOSITION: return "SB_THUMBPOSITION";
> + case SB_THUMBTRACK: return "SB_THUMBTRACK";
> + case SB_ENDSCROLL: return "SB_ENDSCROLL";
> + case SB_INTERNAL: return "SB_INTERNAL";
> + default: return "unknown";
> + }
> +}
Sorry to be a nag, but please use 4-space indents, like most of the
code in there. 2-space indented code is old, and it's a mark for me
to look over it, all new code should be 4-space indented.
--
Dimi.
Dec. 27, 2002
Re: Do not free the header while unmapping the xxxx_UNPREPARE messages
by Eric Pouech
> It seems to me that it's an unnecessary complexity to introduce extra parameter
> for unmapping function exclusively for xxxx_UNPREPARE messages. Could you please
> show what you have in mind for the single mapping/unmapping function pair?
yes, we need to add the result of the call to the unmapping function
something like this would do
A+
--
Eric Pouech
cvs diff: Diffing .
Index: lolvldrv.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/lolvldrv.c,v
retrieving revision 1.41
diff -u -r1.41 lolvldrv.c
--- lolvldrv.c 23 Dec 2002 02:05:30 -0000 1.41
+++ lolvldrv.c 27 Dec 2002 15:53:41 -0000
@@ -39,9 +39,9 @@
LPSTR typestr; /* name (for debugging) */
BOOL bSupportMapper; /* if type is allowed to support mapper */
MMDRV_MAPFUNC Map16To32A; /* those are function pointers to handle */
- MMDRV_MAPFUNC UnMap16To32A; /* the parameter conversion (16 vs 32 bit) */
+ MMDRV_UNMAPFUNC UnMap16To32A; /* the parameter conversion (16 vs 32 bit) */
MMDRV_MAPFUNC Map32ATo16; /* when hi-func (in mmsystem or winmm) and */
- MMDRV_MAPFUNC UnMap32ATo16; /* low-func (in .drv) do not match */
+ MMDRV_UNMAPFUNC UnMap32ATo16; /* low-func (in .drv) do not match */
LPDRVCALLBACK Callback; /* handles callback for a specified type */
/* those attributes reflect the loaded/current situation for the type */
UINT wMaxId; /* number of loaded devices (sum across all loaded drivers */
@@ -74,8 +74,8 @@
*
*/
void MMDRV_InstallMap(unsigned int drv,
- MMDRV_MAPFUNC mp1632, MMDRV_MAPFUNC um1632,
- MMDRV_MAPFUNC mp3216, MMDRV_MAPFUNC um3216,
+ MMDRV_MAPFUNC mp1632, MMDRV_UNMAPFUNC um1632,
+ MMDRV_MAPFUNC mp3216, MMDRV_UNMAPFUNC um3216,
LPDRVCALLBACK cb)
{
assert(drv < MMDRV_MAX);
@@ -234,7 +234,7 @@
dwParam1, dwParam2);
TRACE("=> %lu\n", ret);
if (map == WINMM_MAP_OKMEM)
- llType->UnMap16To32A(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2);
+ llType->UnMap16To32A(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2, ret);
break;
default:
FIXME("NIY\n");
@@ -264,7 +264,7 @@
dwParam1, dwParam2);
TRACE("=> %lu\n", ret);
if (map == WINMM_MAP_OKMEM)
- llType->UnMap32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2);
+ llType->UnMap32ATo16(wMsg, &mld->dwDriverInstance, &dwParam1, &dwParam2, ret);
break;
default:
FIXME("NIY\n");
Index: message16.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/message16.c,v
retrieving revision 1.6
diff -u -r1.6 message16.c
--- message16.c 23 Dec 2002 02:05:30 -0000 1.6
+++ message16.c 27 Dec 2002 15:57:26 -0000
@@ -70,7 +70,7 @@
/**************************************************************************
* MMDRV_Aux_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_Aux_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_Aux_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
return WINMM_MAP_MSGERROR;
}
@@ -86,7 +86,7 @@
/**************************************************************************
* MMDRV_Aux_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_Aux_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_Aux_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
#if 0
case AUXDM_GETDEVCAPS:
@@ -126,7 +126,7 @@
/**************************************************************************
* MMDRV_Mixer_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_Mixer_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_Mixer_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
#if 0
MIXERCAPSA micA;
@@ -156,7 +156,7 @@
/**************************************************************************
* MMDRV_Mixer_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_Mixer_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_Mixer_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
return WINMM_MAP_MSGERROR;
}
@@ -187,7 +187,7 @@
/**************************************************************************
* MMDRV_MidiIn_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_MidiIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_MidiIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
return WINMM_MAP_MSGERROR;
}
@@ -203,7 +203,7 @@
/**************************************************************************
* MMDRV_MidiIn_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_MidiIn_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_MidiIn_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
return WINMM_MAP_MSGERROR;
}
@@ -360,7 +360,7 @@
/**************************************************************************
* MMDRV_MidiOut_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_MidiOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_MidiOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret = WINMM_MAP_MSGERROR;
@@ -411,7 +411,7 @@
if (mh16->reserved >= sizeof(MIDIHDR))
mh16->dwOffset = mh32->dwOffset;
- if (wMsg == MODM_UNPREPARE) {
+ if (wMsg == MODM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree(GetProcessHeap(), 0, (LPSTR)mh32 - sizeof(LPMIDIHDR));
mh16->lpNext = 0;
}
@@ -571,7 +571,7 @@
/**************************************************************************
* MMDRV_MidiOut_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_MidiOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_MidiOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret = WINMM_MAP_MSGERROR;
@@ -617,7 +617,7 @@
mh32->dwUser = mh16->dwUser;
mh32->dwFlags = mh16->dwFlags;
- if (wMsg == MODM_UNPREPARE) {
+ if (wMsg == MODM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree( GetProcessHeap(), 0, ptr );
mh32->lpNext = 0;
}
@@ -805,7 +805,7 @@
/**************************************************************************
* MMDRV_WaveIn_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_WaveIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_WaveIn_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret = WINMM_MAP_MSGERROR;
@@ -860,7 +860,7 @@
wh16->dwFlags = wh32->dwFlags;
wh16->dwLoops = wh32->dwLoops;
- if (wMsg == WIDM_UNPREPARE) {
+ if (wMsg == WIDM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree(GetProcessHeap(), 0, (LPSTR)wh32 - sizeof(LPWAVEHDR));
wh16->lpNext = 0;
}
@@ -1047,7 +1047,7 @@
/**************************************************************************
* MMDRV_WaveIn_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_WaveIn_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_WaveIn_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret = WINMM_MAP_MSGERROR;
@@ -1089,7 +1089,7 @@
wh32->dwLoops = wh16->dwLoops;
UnMapLS( *lpParam1 );
- if (wMsg == WIDM_UNPREPARE) {
+ if (wMsg == WIDM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree( GetProcessHeap(), 0, ptr );
wh32->lpNext = 0;
}
@@ -1303,7 +1303,7 @@
/**************************************************************************
* MMDRV_WaveOut_UnMap16To32A [internal]
*/
-static WINMM_MapType MMDRV_WaveOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_WaveOut_UnMap16To32A(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret = WINMM_MAP_MSGERROR;
@@ -1369,7 +1369,7 @@
wh16->dwFlags = wh32->dwFlags;
wh16->dwLoops = wh32->dwLoops;
- if (wMsg == WODM_UNPREPARE) {
+ if (wMsg == WODM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree(GetProcessHeap(), 0, (LPSTR)wh32 - sizeof(LPWAVEHDR));
wh16->lpNext = 0;
}
@@ -1575,7 +1575,7 @@
/**************************************************************************
* MMDRV_WaveOut_UnMap32ATo16 [internal]
*/
-static WINMM_MapType MMDRV_WaveOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2)
+static WINMM_MapType MMDRV_WaveOut_UnMap32ATo16(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT fn_ret)
{
WINMM_MapType ret;
@@ -1659,7 +1659,7 @@
wh32->dwLoops = wh16->dwLoops;
UnMapLS( *lpParam1 );
- if (wMsg == WODM_UNPREPARE) {
+ if (wMsg == WODM_UNPREPARE && fn_ret == MMSYSERR_NOERROR) {
HeapFree( GetProcessHeap(), 0, ptr );
wh32->lpNext = 0;
}
Index: winemm.h
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/winmm/winemm.h,v
retrieving revision 1.42
diff -u -r1.42 winemm.h
--- winemm.h 11 Nov 2002 19:53:01 -0000 1.42
+++ winemm.h 27 Dec 2002 15:57:36 -0000
@@ -225,6 +225,7 @@
typedef LONG (*MCIPROC16)(DWORD, HDRVR16, WORD, DWORD, DWORD);
typedef LONG (*MCIPROC)(DWORD, HDRVR, DWORD, DWORD, DWORD);
typedef WINMM_MapType (*MMDRV_MAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2);
+typedef WINMM_MapType (*MMDRV_UNMAPFUNC)(UINT wMsg, LPDWORD lpdwUser, LPDWORD lpParam1, LPDWORD lpParam2, MMRESULT ret);
LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr);
BOOL DRIVER_GetLibName(LPCSTR keyName, LPCSTR sectName, LPSTR buf, int sz);
@@ -244,8 +245,8 @@
DWORD MMDRV_Message(LPWINE_MLD mld, WORD wMsg, DWORD dwParam1, DWORD dwParam2, BOOL bFrom32);
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD dwParam1, DWORD dwParam2);
BOOL MMDRV_Is32(unsigned int);
-void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_MAPFUNC,
- MMDRV_MAPFUNC, MMDRV_MAPFUNC, LPDRVCALLBACK);
+void MMDRV_InstallMap(unsigned int, MMDRV_MAPFUNC, MMDRV_UNMAPFUNC,
+ MMDRV_MAPFUNC, MMDRV_UNMAPFUNC, LPDRVCALLBACK);
BOOL MCI_Init(void);
WINE_MCIDRIVER* MCI_GetDriver(UINT16 uDevID);
Dec. 27, 2002
Re: d3d three more renderstates for n2002
by Lionel Ulmer
> with one of the last patches from the cvs the game Nascar 2002 now recognizes
> the d3d rasterizer in the config tool. The patch below adds three more
> handlers for the D3DRENDERSTATE. As d3d seems to me pretty undocumented i can
> only try to find things out using goolgle and see the example code there - a
> link to doku would be really appreciated.
For the documentation, do a Google search on the .CHM files from the various
DirectX SDKs (as the relevant documentations are not to be found anymore on
MSDN's site, only DX8 / 9 is still there).
I have them all but think it's not very legal to redistribute them. I could
though give you the file names so you can Google them :-)
> Only the D3DRENDERSTATE_CLIPPING stuff seems pretty obvious. I dont have a
> clue what the EXTEND stuff does and can also only guess what the EDGEANTIALIAS
> does. I also was not able to test it in the game - the d3d stuff seem to lack
> a lot of functions this game relies on - i will try to add further functions
> step by step.
Well, I really wonder what 'the lot of functions' are that is lacking... Do
you have a tree with all the patches recently sent applied to or a plain CVS
tree ? From my experience, the only stuff missing is the
SetTextureStageState stuff. I doubt that other 'important' features are
still missing.
> The d3d7 code looks pretty bound to mesa - i dont use mesa, so i can not say
> if this works or not with mesa - only with the opengl provided by nvidia and
> what the manpages say.
Well, the Mesa name in the Wine source tree is historic (at the time these
files were created, the only OpenGL code for Linux was Mesa and it was using
the OSMesa extension to run). And as it's a pain to rename files in CVS, it
was never done.
The day we will move the files around to a d3dgl.dll library to ease
packaging, the files will be renamed.
> + case D3DRENDERSTATE_CLIPPING:
> + /* enables/disables clipping; get the maximal amount of
> + * possible clippling planes in this opengl implementation and
> + * enable/disable em all */
> + {
> + GLint i, maxclipplanes;
> + glGetIntegerv(GL_MAX_CLIP_PLANES,&maxclipplanes);
> + for (i=0; i<maxclipplanes; i++) {
> + if (dwRenderState) {
> + glEnable(GL_CLIP_PLANE0+i);
> + } else {
> + glDisable(GL_CLIP_PLANE0+i);
> + }
> + }
> + }
> + break;
Well, did you add also the code creating these clipping planes ? Otherwise,
it's not such a good idea to enable them :-)
I will have to reboot in Windows (or pester Endy to give me his CHM file
viewer :-) ) to tell exactly what that should do and how these clipping
planes are created.
> +
> + case D3DRENDERSTATE_EXTENTS:
> + /* boolean
> + * dont have a clue what this does */
> + FIXME("What is D3DRENDERSTATE_EXTENTS supposed to do?\n");
> + break;
Why not keep the standard 'not supported' instead of adding a case ?
> +
> + case D3DRENDERSTATE_EDGEANTIALIAS:
> + /* in opengl the antialiasing of points, lines and polygons can
> + * be set separate - assuming this only actives it for polygons */
> + if (dwRenderState) {
> + glEnable(GL_POLYGON_SMOOTH);
> + } else {
> + glDisable(GL_POLYGON_SMOOTH);
> + }
> + break;
> +
This looks fine... Except that I have no real idea after reading the OpenGL
man page exactly what GL_POLYGON_SMOOTH does :-)
And I think you could enable it for lines too (but well, I do not know any
game using lines though).
Anyway, welcome on board :-)
Lionel
PS: I updated the d3d_status.html page.
--
Lionel Ulmer - http://www.bbrox.org/
Dec. 27, 2002
d3d three more renderstates for n2002
by Christoph Frick
Hi!
with one of the last patches from the cvs the game Nascar 2002 now recognizes
the d3d rasterizer in the config tool. The patch below adds three more
handlers for the D3DRENDERSTATE. As d3d seems to me pretty undocumented i can
only try to find things out using goolgle and see the example code there - a
link to doku would be really appreciated.
Only the D3DRENDERSTATE_CLIPPING stuff seems pretty obvious. I dont have a
clue what the EXTEND stuff does and can also only guess what the EDGEANTIALIAS
does. I also was not able to test it in the game - the d3d stuff seem to lack
a lot of functions this game relies on - i will try to add further functions
step by step.
The d3d7 code looks pretty bound to mesa - i dont use mesa, so i can not say
if this works or not with mesa - only with the opengl provided by nvidia and
what the manpages say.
RFC and CU!
Index: dlls/ddraw/mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/mesa.c,v
retrieving revision 1.20
diff -u -r1.20 mesa.c
--- dlls/ddraw/mesa.c 24 Dec 2002 01:03:04 -0000 1.20
+++ dlls/ddraw/mesa.c 27 Dec 2002 11:43:32 -0000
@@ -345,6 +345,39 @@
glDisable(GL_LIGHTING);
break;
+ case D3DRENDERSTATE_CLIPPING:
+ /* enables/disables clipping; get the maximal amount of
+ * possible clippling planes in this opengl implementation and
+ * enable/disable em all */
+ {
+ GLint i, maxclipplanes;
+ glGetIntegerv(GL_MAX_CLIP_PLANES,&maxclipplanes);
+ for (i=0; i<maxclipplanes; i++) {
+ if (dwRenderState) {
+ glEnable(GL_CLIP_PLANE0+i);
+ } else {
+ glDisable(GL_CLIP_PLANE0+i);
+ }
+ }
+ }
+ break;
+
+ case D3DRENDERSTATE_EXTENTS:
+ /* boolean
+ * dont have a clue what this does */
+ FIXME("What is D3DRENDERSTATE_EXTENTS supposed to do?\n");
+ break;
+
+ case D3DRENDERSTATE_EDGEANTIALIAS:
+ /* in opengl the antialiasing of points, lines and polygons can
+ * be set separate - assuming this only actives it for polygons */
+ if (dwRenderState) {
+ glEnable(GL_POLYGON_SMOOTH);
+ } else {
+ glDisable(GL_POLYGON_SMOOTH);
+ }
+ break;
+
default:
ERR("Unhandled dwRenderStateType %s (%08x) !\n", _get_renderstate(dwRenderStateType), dwRender
StateType);
}
Dec. 27, 2002