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
July 2011
- 69 participants
- 414 messages
Re: [PATCH 2/2] comctl32: Send CBEM_DELETEITEM when CB_RESETCONTENT is received
by Jay Yang
On 07/22/2011 12:19 AM, Nikolay Sivov wrote:
> On 7/22/2011 06:59, Jay Yang wrote:
>> diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
>> index 3402a71..4888519 100644
>> --- a/dlls/comctl32/comboex.c
>> +++ b/dlls/comctl32/comboex.c
>> @@ -1557,6 +1557,11 @@ static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr)
>>
>> item = infoPtr->items;
>> while (item) {
>> + NMCOMBOBOXEXW nmcit;
>> + memset (&nmcit.ceItem, 0, sizeof(nmcit.ceItem));
>> + nmcit.ceItem.mask=~0;
>> + COMBOEX_CopyItem (item,&nmcit.ceItem);
>> + COMBOEX_NotifyItem (infoPtr, CBEN_DELETEITEM,&nmcit);
>> next = item->next;
>> COMBOEX_FreeText (item);
>> Free (item);
> First of all no need for memset probably, and it's common rule I think (well for me at least) to
> avoid unneeded initialization.
At the very least I need to set the pszText field to null because COMBOEX_CopyItem looks at that to
determine whether to copy the array. Mostly I was just following the other examples in the file.
> As we have message to delete a single item, it's probably time to think about factoring out item
> deletion helper (that sends notification too).
>
> Actually it seems strange for me that this control uses list to store item data, cause messages
> are clearly index based. So first thing I'd like to see with that is to change item storage to use
> DPA array as others controls do. But if you don't have time for that now, I could try to do it
> myself.
Yeah, I'm not exactly focused on controls right now, I'm just trying to fix a memory leak that I
found in explorer because it doesn't get the CBEM_DELETEITEM notification, so if you know a more
correct way to do this, by all means do it. On the otherhand, I do sort of want to get some kind of
fix in sometime soon for this because it causes a memory leak in explorer.
--
Jay Yang
July 22, 2011
Re: [PATCH 2/2] comctl32: Send CBEM_DELETEITEM when CB_RESETCONTENT is received
by Nikolay Sivov
On 7/22/2011 06:59, Jay Yang wrote:
> diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
> index 3402a71..4888519 100644
> --- a/dlls/comctl32/comboex.c
> +++ b/dlls/comctl32/comboex.c
> @@ -1557,6 +1557,11 @@ static void COMBOEX_ResetContent (COMBOEX_INFO *infoPtr)
>
> item = infoPtr->items;
> while (item) {
> + NMCOMBOBOXEXW nmcit;
> + memset (&nmcit.ceItem, 0, sizeof(nmcit.ceItem));
> + nmcit.ceItem.mask=~0;
> + COMBOEX_CopyItem (item,&nmcit.ceItem);
> + COMBOEX_NotifyItem (infoPtr, CBEN_DELETEITEM,&nmcit);
> next = item->next;
> COMBOEX_FreeText (item);
> Free (item);
First of all no need for memset probably, and it's common rule I think
(well for me at least) to avoid unneeded initialization.
As we have message to delete a single item, it's probably time to think
about factoring out item deletion helper (that sends notification too).
Actually it seems strange for me that this control uses list to store
item data, cause messages are clearly index based. So first thing I'd
like to see with that is to change item storage to use DPA array as
others controls do. But if you don't have time for that now, I could try
to do it myself.
July 22, 2011
Re: [PATCH 1/2] comctl32: Add tests for CB_RESETCONTENT
by Nikolay Sivov
On 7/22/2011 06:59, Jay Yang wrote:
> Tests that CBEM_DELETEITEM notifications are received when CB_RESETCONTENT is sent to a comboex control.
> ---
> dlls/comctl32/tests/comboex.c | 28 ++++++++++++++++++++++++++++
> 1 files changed, 28 insertions(+), 0 deletions(-)
Better way to test that is to use message sequence test. Look at
listview test to see how WM_NOTIFY/id pairs are logged.
July 22, 2011
Wininet set_cookie must handle not only <name>=<value> but also <name> = <value>
by Bruno Jesus
Hello, while running uTorrent 3 I see the following fixme several times:
fixme:wininet:set_cookie Unknown additional option L"expires =
Sat,23-Jul-2011 02:20:13 GMT"
After searching the source code I realized the expires parameter is
already implemented but wine finds the entry names only if there's no
space between the parameter name and the equal sign, here is a small
piece of wininet.c around line 440 and 470.
...
static const WCHAR szExpires[] = {'e','x','p','i','r','e','s','=',0}
...
else if (strncmpiW(ptr, szExpires, 8) == 0)
...
After searching msdn I found this article with an example that uses spaces:
http://msdn.microsoft.com/en-us/library/aa385326%28v=vs.85%29.aspx
bReturn = InternetSetCookie(TEXT("http://www.adventure_works.com"), NULL,
TEXT("TestData = Test; expires = Sat,01-Jan-2000 00:00:00 GMT"));
Looks like the cookie above is valid. I also found this other article
telling about the data format:
http://msdn.microsoft.com/en-us/library/aa384321%28v=vs.85%29.aspx
After reading parts of the cookies RFC I found this note:
http://www.ietf.org/rfc/rfc2109.txt
...
NOTE: The syntax above allows whitespace between the attribute and
the = sign.
...
The newer version of the cookie rfc has the very same note:
http://www.ietf.org/rfc/rfc2965.txt
Please, don't bother to answer if this was already noted and is to be
fixed. Also sorry for not pointing a solution. I'll study more on this
later but I can say in advance that windows xp sets the cookie
correctly when there is the space. I guess I'll start by adding tests
for this on the file tests/internet.c
Best wishes,
Bruno
--
universe* god::bigbang (void); //and then it all began...
July 22, 2011
Winhelp crash in assertion(0) if .hlp file is not found
by Bruno Jesus
Hello, I've been in the list for a long time as a reader and after
years I finally managed to get a development computer and restarted
playing with current wine git.
There are about 15 bugs on bugzilla but none of them are related to
this. I'm trying the list first before opening a bug. It's quite
simple to reproduce, although I'm not sure if I can attach the hlp
file here since it's from windows. The crash happens because the help
file needs another help file. There is a button on the screen called
Glossary that needs a file called glossary.hlp. If this file does not
exist wine asks me to point it, if I answer No or yes and then cancel
file selection wine crashes on an assert.
The following lines are displayed on the console:
fixme:winhelp:WINHELP_GetWindowInfo Couldn't find window info for glossary
winhelp.c:270: WINHELP_GetWindowInfo: Assertion `0' failed.
wine: Assertion failed at address 0xb78f0424 (thread 003b), starting debugger...
The following lines are from file winhelp.c, around line 270.
...
if (strcmp(name, "main") != 0)
{
WINE_FIXME("Couldn't find window info for %s\n", name);
assert(0);
return NULL;
}
...
The function WINHELP_OpenHelpWindow does not resist
WINHELP_GetWindowInfo returning NULL. That was why the assert(0) was
added inside it to abort the program execution (as far as I see).
There are 3 calls like this (one on winhelp.c and the others on
macro.c):
...
WINHELP_OpenHelpWindow(HLPFILE_PageByHash, hlpfile, lHash,
WINHELP_GetWindowInfo(hlpfile, wndname), show);
...
My approach to fix this is quite simple: instead of splitting the
above lines on different places and add a check for each of them the
easier way is to simply make OpenHelpWindow resist null pointers and
do not open anything because the user was already warned and asked for
the nonexistent file. The proposed solution (if I may call adding one
"if" a solution) is attached. If anyone has the problematic hlp file
that was the cause to add the assert(0) please send me. Looks like the
assert is there since wine 1.0 according to
http://source.winehq.org/source/programs/winhlp32/winhelp.c?v=wine-1.0
Best wishes,
Bruno
--
universe* god::bigbang (void); //and then it all began...
July 22, 2011
Re:
by Lucas Zawacki
Sorry, this is a duplicate for the [3/4] patch, you can disregard it.
2011/7/21 Lucas Fialho Zawacki <lfzawacki(a)gmail.com>:
> ---
> dlls/dinput/joystick.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 59 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
> index b5c028c..2d8a818 100644
> --- a/dlls/dinput/joystick.c
> +++ b/dlls/dinput/joystick.c
> @@ -500,9 +500,67 @@ HRESULT WINAPI JoystickWGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
> LPCWSTR lpszUserName,
> DWORD dwFlags)
> {
> + JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
> + DIDATAFORMAT data_format;
> + DIOBJECTDATAFORMAT *obj_df = NULL;
> + int i, action = 0, num_actions = 0;
> + unsigned int offset = 0;
> +
> FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
>
> - return DI_NOEFFECT;
> + if (This->base.acquired) return DIERR_ACQUIRED;
> +
> + data_format.dwSize = sizeof(data_format);
> + data_format.dwObjSize = sizeof(DIOBJECTDATAFORMAT);
> + data_format.dwFlags = DIDF_RELAXIS;
> + data_format.dwDataSize = lpdiaf->dwDataSize;
> +
> + /* count the actions */
> + for (i=0; i < lpdiaf->dwNumActions; i++)
> + if (IsEqualGUID(&This->base.guid, &lpdiaf->rgoAction[i].guidInstance))
> + num_actions++;
> +
> + if (num_actions == 0) return DI_NOEFFECT;
> +
> + This->base.num_actions = num_actions;
> +
> + /* Construct the dataformat and actionmap */
> + obj_df = HeapAlloc(GetProcessHeap(), 0, sizeof(DIOBJECTDATAFORMAT)*num_actions);
> + data_format.rgodf = (LPDIOBJECTDATAFORMAT)obj_df;
> + data_format.dwNumObjs = num_actions;
> +
> + This->base.action_map = HeapAlloc(GetProcessHeap(), 0, sizeof(ActionMap)*num_actions);
> +
> + for (i = 0; i < lpdiaf->dwNumActions; i++)
> + {
> + if (IsEqualGUID(&This->base.guid, &lpdiaf->rgoAction[i].guidInstance))
> + {
> + LPDIDATAFORMAT df = This->base.data_format.wine_df;
> + DWORD inst = DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwObjID);
> + DWORD type = DIDFT_GETTYPE(lpdiaf->rgoAction[i].dwObjID);
> + LPDIOBJECTDATAFORMAT obj;
> +
> + if (type == DIDFT_PSHBUTTON) type = DIDFT_BUTTON;
> + if (type == DIDFT_RELAXIS) type = DIDFT_AXIS;
> +
> + obj = dataformat_to_odf_by_type(df, inst, type);
> +
> + memcpy(&obj_df[action], obj, df->dwObjSize);
> +
> + This->base.action_map[action].uAppData = lpdiaf->rgoAction[i].uAppData;
> + This->base.action_map[action].offset = offset;
> + obj_df[action].dwOfs = offset;
> + offset += (type & DIDFT_BUTTON) ? 1 : 4;
> +
> + action++;
> + }
> + }
> +
> + IDirectInputDevice8_SetDataFormat(iface, &data_format);
> +
> + HeapFree(GetProcessHeap(), 0, obj_df);
> +
> + return IDirectInputDevice8WImpl_SetActionMap(iface, lpdiaf, lpszUserName, dwFlags);
> }
>
> HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
> --
> 1.7.0.4
>
July 21, 2011
Re: netapi32: add msvcrt to importlibs
by Alexandre Julliard
Louis Lenders <xerox_xerox2000(a)yahoo.co.uk> writes:
> hi, this fixes bug http://bugs.winehq.org/show_bug.cgi?id=27827
>
> Creo Elements expects msvcrt to be loaded, and fails to start.
>
> Dependancywalker on windows shows netapi32 loads the msvcrt. I guess
> when more netapi32 functions will be implemented in future this will
> become a "real" necessary dependency
It won't help if it's not used, and you'd need to use msvcrt headers
too. I don't think it's the right place to fix this.
--
Alexandre Julliard
julliard(a)winehq.org
July 21, 2011
Re: Experimental website for tracking translation issues
by Francois Gouget
On Thu, 21 Jul 2011, Alexandre Julliard wrote:
> Francois Gouget <fgouget(a)free.fr> writes:
>
> > I think we can ignore thin non-breaking spaces like everyone else
> > (Gnomefr for instance). At least for now. However, based on your
> > previous comment and the fines.pdf report, it seems like putting
> > non-breaking spaces everywhere in Wine should be safe enough.
> > Does anyone object?
>
> That's only necessary for messages that get wrapped automatically,
> i.e. in message boxes. In general you don't want it for things that are
> shown on the command line.
It sounds like following these rules will be complex which means they
won't really be followed. Also for places where it makes no difference
I'd prefer to use the typographically correct string.
So my preference would be that we use non-breaking spaces everywhere
except where they break things, and I'm hoping the exception is either
'never' or 'except in command line applications' which would be simple
enough.
Do we actually have evidence that regular (non-thin) non-breaking spaces
break things on the command line? According to the fines.pdf report they
seem to be working everywhere (except in mrxvt which I'll just ignore).
I suspect the author did not test any non-UTF8 locale however...
http://malaria.perso.sfr.fr/fines/fines.pdf
--
Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/
Advice is what we ask for when we already know the answer but wish we didn't
-- Eric Jong
July 21, 2011
Re: GSoC: dinput8 Action Mapping
by Marcus Meissner
On Tue, Jul 19, 2011 at 09:40:37PM -0300, Lucas Zawacki wrote:
> Hey, I've got a couple patches implementing build and setactionmap for
> joysticks and I'd like you guys to give them a look.
The patches look good to my eyes.
This part:
> + if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
still looks strange (as the first genre should be a some kind
of bitmask instead of genre?), but will likely work as-is for now.
> These implementations are very generic and I think I could use them
> for the keyboard and the mouse too. If everything's alright with these
> patches that'll be my next step.
>
> The mapping can be tested this small app I built:
> https://github.com/downloads/lfzawacki/dinput-samples/dolphin.exe
> provided that you have one joystick attached (it will chose the first
> one if there are more).
Works with my Joystick here at least.
Not sure what it should output, A and X button works, the
ranges go to 10/-10 expect for "Down" just going to -5 (might be a issue with the joystick).
Ciao, Marcus
> 2011/7/5 Lucas Zawacki <lfzawacki(a)gmail.com>:
> > Hi guys.
> >
> > Now that all the initial patches are in I have several smaller tasks
> > to work on as listed here
> > http://lfzawacki.heroku.com/wine/published/Road+Map and hopefully
> > they're more straightforward. I've already started working on getting
> > EnumDevicesBySemantics correct with joysticks and the passed flags
> > and, after that, BuildActionMap for the joysticks will follow. Maybe
> > now it's time to discuss how to implement EnumDevicesBySemantics as a
> > crosscall, but I really don't know how to do it (or if it's worth it)
> > and everywhere I look in dinput I see similar cases of this
> > "duplication pattern".
> >
> > Another thing that I've been thinking is that I might as well end up
> > rolling a version of ConfigureDevices
> > (http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.idirectinput8…)
> > because so far I've seen two of the games affected by bug 8754 use it
> > to configure controls. I've not had time to find and test all of them,
> > but if someone on the list knows about other games that use it I'd
> > like to be informed.
> >
> > Last but not least, thanks for Wylda for testing NFSU and keeping bug
> > 8754 informed. I actually can't run the game properly, most likely
> > because of the crappy intel graphics card in my laptop.
> >
> > Anyway, feedback on the tasks is welcome.
> >
> > ---
> > lfz
> >
> From b492c54d5ca7179e0905f63cec183d0920555e1d Mon Sep 17 00:00:00 2001
> From: Lucas Fialho Zawacki <lfzawacki(a)gmail.com>
> Date: Tue, 19 Jul 2011 17:52:12 -0300
> Subject: [PATCH 1/4] dinput: EnumDevicesBySemantics enumerating joysticks with priority flags
>
> Added an utility function that checks the priority of a device for a given mapping. This can be modified later to return priority 2 mappings, if necessary.
> ---
> dlls/dinput/dinput_main.c | 50 ++++++++++++++++++++++++++++++++------------
> 1 files changed, 36 insertions(+), 14 deletions(-)
>
> diff --git a/dlls/dinput/dinput_main.c b/dlls/dinput/dinput_main.c
> index b653307..1d59cdc 100644
> --- a/dlls/dinput/dinput_main.c
> +++ b/dlls/dinput/dinput_main.c
> @@ -317,6 +317,38 @@ void _copy_diactionformatWtoA(LPDIACTIONFORMATA to, LPDIACTIONFORMATW from)
> }
> }
>
> +/* _diactionformat_priorityA
> + *
> + * Given a DIACTIONFORMAT structure and a DI genre, returns the enumeration
> + * priority. Joysticks should pass the game genre, and mouse or keyboard their
> + * respective DI*_MASK
> + */
> +static DWORD _diactionformat_priorityA(LPDIACTIONFORMATA lpdiaf, DWORD genre)
> +{
> + int i;
> + DWORD priorityFlags = 0;
> +
> + /* If there's at least one action for the device it's priority 1 */
> + for(i=0; i < lpdiaf->dwActionSize; i++)
> + if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
> + priorityFlags |= DIEDBS_MAPPEDPRI1;
> +
> + return priorityFlags;
> +}
> +
> +static DWORD _diactionformat_priorityW(LPDIACTIONFORMATW lpdiaf, DWORD genre)
> +{
> + int i;
> + DWORD priorityFlags = 0;
> +
> + /* If there's at least one action for the device it's priority 1 */
> + for(i=0; i < lpdiaf->dwActionSize; i++)
> + if ((lpdiaf->rgoAction[i].dwSemantic & genre) == genre)
> + priorityFlags |= DIEDBS_MAPPEDPRI1;
> +
> + return priorityFlags;
> +}
> +
> /******************************************************************************
> * IDirectInputA_EnumDevices
> */
> @@ -877,7 +909,7 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
> {
> TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
>
> - callbackFlags = 0;
> + callbackFlags = _diactionformat_priorityA(lpdiActionFormat, lpdiActionFormat->dwGenre);
> /* Default behavior is to enumerate attached game controllers */
> enumSuccess = dinput_devices[i]->enum_deviceA(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
> if (enumSuccess)
> @@ -895,16 +927,11 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics(
> /* Enumerate keyboard and mouse */
> for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
> {
> - callbackFlags = 0;
> + callbackFlags = _diactionformat_priorityA(lpdiActionFormat, actionMasks[i]);
>
> IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
> IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
>
> - /* If there's at least one action for the device it's priority 1 */
> - for(j=0; j < lpdiActionFormat->dwActionSize; j++)
> - if ((lpdiActionFormat->rgoAction[j].dwSemantic & actionMasks[i]) == actionMasks[i])
> - callbackFlags |= DIEDBS_MAPPEDPRI1;
> -
> if (lpCallback(&didevi, lpdid, callbackFlags, sizeof(guids)/sizeof(guids[0]) - (i+1), pvRef) == DIENUM_STOP)
> return DI_OK;
> }
> @@ -942,7 +969,7 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
> {
> TRACE(" - checking device %u ('%s')\n", i, dinput_devices[i]->name);
>
> - callbackFlags = 0;
> + callbackFlags = _diactionformat_priorityW(lpdiActionFormat, lpdiActionFormat->dwGenre);
> /* Default behavior is to enumerate attached game controllers */
> enumSuccess = dinput_devices[i]->enum_deviceW(DI8DEVCLASS_GAMECTRL, DIEDFL_ATTACHEDONLY | dwFlags, &didevi, This->dwVersion, j);
> if (enumSuccess)
> @@ -960,16 +987,11 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics(
> /* Enumerate keyboard and mouse */
> for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++)
> {
> - callbackFlags = 0;
> + callbackFlags = _diactionformat_priorityW(lpdiActionFormat, actionMasks[i]);
>
> IDirectInput_CreateDevice(iface, guids[i], &lpdid, NULL);
> IDirectInputDevice_GetDeviceInfo(lpdid, &didevi);
>
> - /* If there's at least one action for the device it's priority 1 */
> - for(j=0; j < lpdiActionFormat->dwActionSize; j++)
> - if ((lpdiActionFormat->rgoAction[j].dwSemantic & actionMasks[i]) == actionMasks[i])
> - callbackFlags |= DIEDBS_MAPPEDPRI1;
> -
> if (lpCallback(&didevi, lpdid, callbackFlags, sizeof(guids)/sizeof(guids[0]) - (i+1), pvRef) == DIENUM_STOP)
> return DI_OK;
> }
> --
> 1.7.0.4
>
> From 2c97c4d622a4731721705b81416191b47b738d71 Mon Sep 17 00:00:00 2001
> From: Lucas Fialho Zawacki <lfzawacki(a)gmail.com>
> Date: Tue, 19 Jul 2011 20:25:48 -0300
> Subject: [PATCH 2/4] dinput: BuildActionMap for all joysticks. For the moment only for buttons and axis.
>
> Added an utility function that finds the Nth dataformat object of a given type.
> ---
> dlls/dinput/device.c | 23 +++++++++++++++++++++++
> dlls/dinput/device_private.h | 1 +
> dlls/dinput/joystick.c | 40 +++++++++++++++++++++++++++++++++++++++-
> 3 files changed, 63 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
> index 22632ea..2bd5d6c 100644
> --- a/dlls/dinput/device.c
> +++ b/dlls/dinput/device.c
> @@ -366,6 +366,29 @@ static inline LPDIOBJECTDATAFORMAT dataformat_to_odf(LPCDIDATAFORMAT df, int idx
> return (LPDIOBJECTDATAFORMAT)((LPBYTE)df->rgodf + idx * df->dwObjSize);
> }
>
> +/* dataformat_to_odf_by_type
> + * Find the Nth object of the selected type in the DataFormat
> + */
> +LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type)
> +{
> + int i, nfound = 0;
> +
> + for (i=0; i < df->dwNumObjs; i++)
> + {
> + LPDIOBJECTDATAFORMAT odf = dataformat_to_odf(df, i);
> +
> + if (odf->dwType & type)
> + {
> + if (n == nfound)
> + return odf;
> +
> + nfound++;
> + }
> + }
> +
> + return NULL;
> +}
> +
> static HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format)
> {
> DataTransform *dt;
> diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h
> index 503698a..6c061b2 100644
> --- a/dlls/dinput/device_private.h
> +++ b/dlls/dinput/device_private.h
> @@ -125,6 +125,7 @@ extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) DECLSPEC_HIDDEN;
> extern const char *_dump_dinput_GUID(const GUID *guid) DECLSPEC_HIDDEN;
>
> extern DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) DECLSPEC_HIDDEN;
> +extern LPDIOBJECTDATAFORMAT dataformat_to_odf_by_type(LPCDIDATAFORMAT df, int n, DWORD type) DECLSPEC_HIDDEN;
>
> /* And the stubs */
> extern HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN;
> diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
> index 68dcc6a..d821748 100644
> --- a/dlls/dinput/joystick.c
> +++ b/dlls/dinput/joystick.c
> @@ -432,9 +432,47 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
> LPCWSTR lpszUserName,
> DWORD dwFlags)
> {
> + JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
> + int i, j, has_actions = 0;
> + DWORD object_types[] = { DIDFT_BUTTON, DIDFT_AXIS };
> + DWORD type_map[] = { DIDFT_PSHBUTTON, DIDFT_RELAXIS };
> +
> FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
>
> - return DI_NOEFFECT;
> + for (i=0; i < lpdiaf->dwNumActions; i++)
> + {
> + DWORD inst = (0x000000ff & (lpdiaf->rgoAction[i].dwSemantic)) - 1;
> + DWORD type = 0x000000ff & (lpdiaf->rgoAction[i].dwSemantic >> 8);
> + DWORD genre = 0xff000000 & lpdiaf->rgoAction[i].dwSemantic;
> +
> + /* Only consider actions of the right genre */
> + if (lpdiaf->dwGenre != genre) continue;
> +
> + for (j=0; j < sizeof(object_types)/sizeof(object_types[0]); j++)
> + {
> + if (type & object_types[j])
> + {
> + /* Assure that the object exists */
> + LPDIOBJECTDATAFORMAT odf = dataformat_to_odf_by_type(This->base.data_format.wine_df, inst, DIDFT_BUTTON);
> +
> + if (odf != NULL)
> + {
> + lpdiaf->rgoAction[i].dwObjID = type_map[j] | (0x0000ff00 & (inst << 8));
> + lpdiaf->rgoAction[i].guidInstance = This->base.guid;
> + lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT;
> +
> + has_actions = 1;
> +
> + /* No need to try other types if the action was already mapped */
> + break;
> + }
> + }
> + }
> + }
> +
> + if (!has_actions) return DI_NOEFFECT;
> +
> + return IDirectInputDevice8WImpl_BuildActionMap(iface, lpdiaf, lpszUserName, dwFlags);
> }
>
> HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
> --
> 1.7.0.4
>
> From a71ddba6092dd7a843c5359b26c4e9254311edfb Mon Sep 17 00:00:00 2001
> From: Lucas Fialho Zawacki <lfzawacki(a)gmail.com>
> Date: Tue, 19 Jul 2011 20:44:36 -0300
> Subject: [PATCH 3/4] dinput: SetActionMap for joysticks.
>
> ---
> dlls/dinput/joystick.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 59 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
> index d821748..c63def9 100644
> --- a/dlls/dinput/joystick.c
> +++ b/dlls/dinput/joystick.c
> @@ -500,9 +500,67 @@ HRESULT WINAPI JoystickWGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
> LPCWSTR lpszUserName,
> DWORD dwFlags)
> {
> + JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface);
> + DIDATAFORMAT data_format;
> + DIOBJECTDATAFORMAT *obj_df = NULL;
> + int i, action = 0, num_actions = 0;
> + unsigned int offset = 0;
> +
> FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
>
> - return DI_NOEFFECT;
> + if (This->base.acquired) return DIERR_ACQUIRED;
> +
> + data_format.dwSize = sizeof(data_format);
> + data_format.dwObjSize = sizeof(DIOBJECTDATAFORMAT);
> + data_format.dwFlags = DIDF_RELAXIS;
> + data_format.dwDataSize = lpdiaf->dwDataSize;
> +
> + /* count the actions */
> + for (i=0; i < lpdiaf->dwNumActions; i++)
> + if (IsEqualGUID(&This->base.guid, &lpdiaf->rgoAction[i].guidInstance))
> + num_actions++;
> +
> + if (num_actions == 0) return DI_NOEFFECT;
> +
> + This->base.num_actions = num_actions;
> +
> + /* Construct the dataformat and actionmap */
> + obj_df = HeapAlloc(GetProcessHeap(), 0, sizeof(DIOBJECTDATAFORMAT)*num_actions);
> + data_format.rgodf = (LPDIOBJECTDATAFORMAT)obj_df;
> + data_format.dwNumObjs = num_actions;
> +
> + This->base.action_map = HeapAlloc(GetProcessHeap(), 0, sizeof(ActionMap)*num_actions);
> +
> + for (i = 0; i < lpdiaf->dwNumActions; i++)
> + {
> + if (IsEqualGUID(&This->base.guid, &lpdiaf->rgoAction[i].guidInstance))
> + {
> + LPDIDATAFORMAT df = This->base.data_format.wine_df;
> + DWORD inst = DIDFT_GETINSTANCE(lpdiaf->rgoAction[i].dwObjID);
> + DWORD type = DIDFT_GETTYPE(lpdiaf->rgoAction[i].dwObjID);
> + LPDIOBJECTDATAFORMAT obj;
> +
> + if (type == DIDFT_PSHBUTTON) type = DIDFT_BUTTON;
> + if (type == DIDFT_RELAXIS) type = DIDFT_AXIS;
> +
> + obj = dataformat_to_odf_by_type(df, inst, type);
> +
> + memcpy(&obj_df[action], obj, df->dwObjSize);
> +
> + This->base.action_map[action].uAppData = lpdiaf->rgoAction[i].uAppData;
> + This->base.action_map[action].offset = offset;
> + obj_df[action].dwOfs = offset;
> + offset += (type & DIDFT_BUTTON) ? 1 : 4;
> +
> + action++;
> + }
> + }
> +
> + IDirectInputDevice8_SetDataFormat(iface, &data_format);
> +
> + HeapFree(GetProcessHeap(), 0, obj_df);
> +
> + return IDirectInputDevice8WImpl_SetActionMap(iface, lpdiaf, lpszUserName, dwFlags);
> }
>
> HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
> --
> 1.7.0.4
>
> From 4f18cfb471707c461135ecfde5f975324b37e696 Mon Sep 17 00:00:00 2001
> From: Lucas Fialho Zawacki <lfzawacki(a)gmail.com>
> Date: Tue, 19 Jul 2011 21:03:16 -0300
> Subject: [PATCH 4/4] dinput: SetActionMap setting the axis range according to the action format
>
> ---
> dlls/dinput/device.c | 8 ++++++++
> dlls/dinput8/tests/device.c | 15 +++++++++++++++
> 2 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c
> index 2bd5d6c..58d4e14 100644
> --- a/dlls/dinput/device.c
> +++ b/dlls/dinput/device.c
> @@ -1483,9 +1483,17 @@ HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
> DWORD dwFlags)
> {
> DIPROPDWORD dp;
> + DIPROPRANGE dpr;
>
> FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
>
> + dpr.diph.dwSize = sizeof(DIPROPRANGE);
> + dpr.lMin = lpdiaf->lAxisMin;
> + dpr.lMax = lpdiaf->lAxisMax;
> + dpr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
> + dpr.diph.dwHow = DIPH_DEVICE;
> + IDirectInputDevice8_SetProperty(iface, DIPROP_RANGE, &dpr.diph);
> +
> if (lpdiaf->dwBufferSize > 0)
> {
> dp.diph.dwSize = sizeof(DIPROPDWORD);
> diff --git a/dlls/dinput8/tests/device.c b/dlls/dinput8/tests/device.c
> index cedad80..31e2e3f 100644
> --- a/dlls/dinput8/tests/device.c
> +++ b/dlls/dinput8/tests/device.c
> @@ -132,6 +132,7 @@ static BOOL CALLBACK enumeration_callback(
> {
> HRESULT hr;
> DIPROPDWORD dp;
> + DIPROPRANGE dpr;
> struct enum_data *data = pvRef;
> if (!data) return DIENUM_CONTINUE;
>
> @@ -179,6 +180,20 @@ static BOOL CALLBACK enumeration_callback(
> ok (SUCCEEDED(hr), "GetProperty failed hr=%08x\n", hr);
> ok (dp.dwData == data->lpdiaf->dwBufferSize, "SetActionMap must set the buffer, buffersize=%d\n", dp.dwData);
>
> + /* Test axis range */
> + memset(&dpr, 0, sizeof(dpr));
> + dpr.diph.dwSize = sizeof(dpr);
> + dpr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
> + dpr.diph.dwHow = DIPH_DEVICE;
> +
> + hr = IDirectInputDevice_GetProperty(lpdid, DIPROP_RANGE, &dpr.diph);
> + /* Only test if device supports the range property */
> + if (SUCCEEDED(hr))
> + {
> + ok (dpr.lMin == data->lpdiaf->lAxisMin, "SetActionMap must set the min axis range expected=%d got=%d\n", data->lpdiaf->lAxisMin, dpr.lMin);
> + ok (dpr.lMax == data->lpdiaf->lAxisMax, "SetActionMap must set the max axis range expected=%d got=%d\n", data->lpdiaf->lAxisMax, dpr.lMax);
> + }
> +
> /* SetActionMap has set the data format so now it should work */
> hr = IDirectInputDevice8_Acquire(lpdid);
> ok (SUCCEEDED(hr), "Acquire failed hr=%08x\n", hr);
> --
> 1.7.0.4
>
>
July 21, 2011
Re: po: French translation tweaks and fixes.
by Jerome Leclanche
> Yeah. Guess we use different denominations in my country.
> Although if I were nitpicking I would use mebioctets or similar ;)
2¢: IMHO, we should use whatever unit is used by Windows native -
assuming they translate it right, of course.
July 20, 2011