Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
64c1f477
Commit
64c1f477
authored
Aug 23, 2011
by
Lucas Fialho Zawacki
Committed by
Alexandre Julliard
Aug 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Proper conversion of username parameters for Set and BuildActionMap.
parent
7e3d51b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
6 deletions
+66
-6
joystick.c
dlls/dinput/joystick.c
+22
-2
keyboard.c
dlls/dinput/keyboard.c
+22
-2
mouse.c
dlls/dinput/mouse.c
+22
-2
No files found.
dlls/dinput/joystick.c
View file @
64c1f477
...
@@ -486,14 +486,24 @@ HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
...
@@ -486,14 +486,24 @@ HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
JoystickWGenericImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
JoystickWGenericImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
@@ -518,13 +528,23 @@ HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
...
@@ -518,13 +528,23 @@ HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
JoystickGenericImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
JoystickWGenericImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
JoystickWGenericImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
...
dlls/dinput/keyboard.c
View file @
64c1f477
...
@@ -542,14 +542,24 @@ static HRESULT WINAPI SysKeyboardAImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A ifac
...
@@ -542,14 +542,24 @@ static HRESULT WINAPI SysKeyboardAImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A ifac
SysKeyboardImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
SysKeyboardImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
SysKeyboardWImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
SysKeyboardWImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
@@ -572,13 +582,23 @@ static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
...
@@ -572,13 +582,23 @@ static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
SysKeyboardImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
SysKeyboardImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
SysKeyboardWImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
SysKeyboardWImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
...
dlls/dinput/mouse.c
View file @
64c1f477
...
@@ -791,14 +791,24 @@ static HRESULT WINAPI SysMouseAImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
...
@@ -791,14 +791,24 @@ static HRESULT WINAPI SysMouseAImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
SysMouseWImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
SysMouseWImpl_BuildActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
_copy_diactionformatWtoA
(
lpdiaf
,
&
diafW
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
@@ -821,13 +831,23 @@ static HRESULT WINAPI SysMouseAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
...
@@ -821,13 +831,23 @@ static HRESULT WINAPI SysMouseAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
SysMouseImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
DIACTIONFORMATW
diafW
;
DIACTIONFORMATW
diafW
;
HRESULT
hr
;
HRESULT
hr
;
WCHAR
*
lpszUserNameW
=
NULL
;
int
username_size
;
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
diafW
.
rgoAction
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DIACTIONW
)
*
lpdiaf
->
dwNumActions
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
_copy_diactionformatAtoW
(
&
diafW
,
lpdiaf
);
hr
=
SysMouseWImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
NULL
,
dwFlags
);
if
(
lpszUserName
!=
NULL
)
{
username_size
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
NULL
,
0
);
lpszUserNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
username_size
);
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUserName
,
-
1
,
lpszUserNameW
,
username_size
);
}
hr
=
SysMouseWImpl_SetActionMap
(
&
This
->
base
.
IDirectInputDevice8W_iface
,
&
diafW
,
lpszUserNameW
,
dwFlags
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
diafW
.
rgoAction
);
HeapFree
(
GetProcessHeap
(),
0
,
lpszUserNameW
);
return
hr
;
return
hr
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment