Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
894eedf5
Commit
894eedf5
authored
Oct 28, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 28, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move driver message mapping out of 32 bit code.
parent
01878bbf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
122 deletions
+118
-122
driver.c
dlls/winmm/driver.c
+0
-122
mmsystem.c
dlls/winmm/mmsystem.c
+114
-0
winemm.h
dlls/winmm/winemm.h
+4
-0
No files found.
dlls/winmm/driver.c
View file @
894eedf5
...
@@ -72,128 +72,6 @@ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr)
...
@@ -72,128 +72,6 @@ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr)
}
}
/**************************************************************************
/**************************************************************************
* DRIVER_MapMsg32To16 [internal]
*
* Map a 32 bit driver message to a 16 bit driver message.
* 1 : ok, some memory allocated, need to call DRIVER_UnMapMsg32To16
* 0 : ok, no memory allocated
* -1 : ko, unknown message
* -2 : ko, memory problem
*/
static
int
DRIVER_MapMsg32To16
(
WORD
wMsg
,
DWORD
*
lParam1
,
DWORD
*
lParam2
)
{
int
ret
=
-
1
;
switch
(
wMsg
)
{
case
DRV_LOAD
:
case
DRV_ENABLE
:
case
DRV_DISABLE
:
case
DRV_FREE
:
case
DRV_QUERYCONFIGURE
:
case
DRV_REMOVE
:
case
DRV_EXITSESSION
:
case
DRV_EXITAPPLICATION
:
case
DRV_POWER
:
case
DRV_CLOSE
:
/* should be 0/0 */
case
DRV_OPEN
:
/* pass through */
/* lParam1 and lParam2 are not used */
ret
=
0
;
break
;
break
;
case
DRV_CONFIGURE
:
case
DRV_INSTALL
:
/* lParam1 is a handle to a window (conf) or to a driver (inst) or not used,
* lParam2 is a pointer to DRVCONFIGINFO
*/
if
(
*
lParam2
)
{
LPDRVCONFIGINFO16
dci16
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dci16
)
);
LPDRVCONFIGINFO
dci32
=
(
LPDRVCONFIGINFO
)(
*
lParam2
);
if
(
dci16
)
{
LPSTR
str1
;
dci16
->
dwDCISize
=
sizeof
(
DRVCONFIGINFO16
);
if
((
str1
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
dci32
->
lpszDCISectionName
))
!=
NULL
)
{
dci16
->
lpszDCISectionName
=
MapLS
(
str1
);
}
else
{
return
-
2
;
}
if
((
str1
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
dci32
->
lpszDCIAliasName
))
!=
NULL
)
{
dci16
->
lpszDCIAliasName
=
MapLS
(
str1
);
}
else
{
return
-
2
;
}
}
else
{
return
-
2
;
}
*
lParam2
=
MapLS
(
dci16
);
ret
=
1
;
}
else
{
ret
=
0
;
}
break
;
default:
if
(
!
((
wMsg
>=
0x800
&&
wMsg
<
0x900
)
||
(
wMsg
>=
0x4000
&&
wMsg
<
0x4100
)))
{
FIXME
(
"Unknown message 0x%04x
\n
"
,
wMsg
);
}
ret
=
0
;
}
return
ret
;
}
/**************************************************************************
* DRIVER_UnMapMsg32To16 [internal]
*
* UnMap a 32 bit driver message to a 16 bit driver message.
* 0 : ok
* -1 : ko
* -2 : ko, memory problem
*/
static
int
DRIVER_UnMapMsg32To16
(
WORD
wMsg
,
DWORD
lParam1
,
DWORD
lParam2
)
{
int
ret
=
-
1
;
switch
(
wMsg
)
{
case
DRV_LOAD
:
case
DRV_ENABLE
:
case
DRV_DISABLE
:
case
DRV_FREE
:
case
DRV_QUERYCONFIGURE
:
case
DRV_REMOVE
:
case
DRV_EXITSESSION
:
case
DRV_EXITAPPLICATION
:
case
DRV_POWER
:
case
DRV_OPEN
:
case
DRV_CLOSE
:
/* lParam1 and lParam2 are not used */
break
;
case
DRV_CONFIGURE
:
case
DRV_INSTALL
:
/* lParam1 is a handle to a window (or not used), lParam2 is a pointer to DRVCONFIGINFO, lParam2 */
if
(
lParam2
)
{
LPDRVCONFIGINFO16
dci16
=
MapSL
(
lParam2
);
HeapFree
(
GetProcessHeap
(),
0
,
MapSL
(
dci16
->
lpszDCISectionName
)
);
HeapFree
(
GetProcessHeap
(),
0
,
MapSL
(
dci16
->
lpszDCIAliasName
)
);
UnMapLS
(
lParam2
);
UnMapLS
(
dci16
->
lpszDCISectionName
);
UnMapLS
(
dci16
->
lpszDCIAliasName
);
HeapFree
(
GetProcessHeap
(),
0
,
dci16
);
}
ret
=
0
;
break
;
default:
if
(
!
((
wMsg
>=
0x800
&&
wMsg
<
0x900
)
||
(
wMsg
>=
0x4000
&&
wMsg
<
0x4100
)))
{
FIXME
(
"Unknown message 0x%04x
\n
"
,
wMsg
);
}
ret
=
0
;
}
return
ret
;
}
/**************************************************************************
* DRIVER_SendMessage [internal]
* DRIVER_SendMessage [internal]
*/
*/
static
LRESULT
inline
DRIVER_SendMessage
(
LPWINE_DRIVER
lpDrv
,
UINT
msg
,
static
LRESULT
inline
DRIVER_SendMessage
(
LPWINE_DRIVER
lpDrv
,
UINT
msg
,
...
...
dlls/winmm/mmsystem.c
View file @
894eedf5
...
@@ -2173,6 +2173,120 @@ void WINAPI WMMMidiRunOnce16(void)
...
@@ -2173,6 +2173,120 @@ void WINAPI WMMMidiRunOnce16(void)
*/
*/
/**************************************************************************
/**************************************************************************
* DRIVER_MapMsg32To16 [internal]
*
* Map a 32 bit driver message to a 16 bit driver message.
*/
WINMM_MapType
DRIVER_MapMsg32To16
(
WORD
wMsg
,
DWORD
*
lParam1
,
DWORD
*
lParam2
)
{
WINMM_MapType
ret
=
WINMM_MAP_MSGERROR
;
switch
(
wMsg
)
{
case
DRV_LOAD
:
case
DRV_ENABLE
:
case
DRV_DISABLE
:
case
DRV_FREE
:
case
DRV_QUERYCONFIGURE
:
case
DRV_REMOVE
:
case
DRV_EXITSESSION
:
case
DRV_EXITAPPLICATION
:
case
DRV_POWER
:
case
DRV_CLOSE
:
/* should be 0/0 */
case
DRV_OPEN
:
/* pass through */
/* lParam1 and lParam2 are not used */
ret
=
WINMM_MAP_OK
;
break
;
case
DRV_CONFIGURE
:
case
DRV_INSTALL
:
/* lParam1 is a handle to a window (conf) or to a driver (inst) or not used,
* lParam2 is a pointer to DRVCONFIGINFO
*/
if
(
*
lParam2
)
{
LPDRVCONFIGINFO16
dci16
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dci16
)
);
LPDRVCONFIGINFO
dci32
=
(
LPDRVCONFIGINFO
)(
*
lParam2
);
if
(
dci16
)
{
LPSTR
str1
;
dci16
->
dwDCISize
=
sizeof
(
DRVCONFIGINFO16
);
if
((
str1
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
dci32
->
lpszDCISectionName
))
!=
NULL
)
{
dci16
->
lpszDCISectionName
=
MapLS
(
str1
);
}
else
{
return
WINMM_MAP_NOMEM
;
}
if
((
str1
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
dci32
->
lpszDCIAliasName
))
!=
NULL
)
{
dci16
->
lpszDCIAliasName
=
MapLS
(
str1
);
}
else
{
return
WINMM_MAP_NOMEM
;
}
}
else
{
return
WINMM_MAP_NOMEM
;
}
*
lParam2
=
MapLS
(
dci16
);
ret
=
WINMM_MAP_OKMEM
;
}
else
{
ret
=
WINMM_MAP_OK
;
}
break
;
default:
if
(
!
((
wMsg
>=
0x800
&&
wMsg
<
0x900
)
||
(
wMsg
>=
0x4000
&&
wMsg
<
0x4100
)))
{
FIXME
(
"Unknown message 0x%04x
\n
"
,
wMsg
);
}
ret
=
WINMM_MAP_OK
;
}
return
ret
;
}
/**************************************************************************
* DRIVER_UnMapMsg32To16 [internal]
*
* UnMap a 32 bit driver message to a 16 bit driver message.
*/
WINMM_MapType
DRIVER_UnMapMsg32To16
(
WORD
wMsg
,
DWORD
lParam1
,
DWORD
lParam2
)
{
WINMM_MapType
ret
=
WINMM_MAP_MSGERROR
;
switch
(
wMsg
)
{
case
DRV_LOAD
:
case
DRV_ENABLE
:
case
DRV_DISABLE
:
case
DRV_FREE
:
case
DRV_QUERYCONFIGURE
:
case
DRV_REMOVE
:
case
DRV_EXITSESSION
:
case
DRV_EXITAPPLICATION
:
case
DRV_POWER
:
case
DRV_OPEN
:
case
DRV_CLOSE
:
/* lParam1 and lParam2 are not used */
break
;
case
DRV_CONFIGURE
:
case
DRV_INSTALL
:
/* lParam1 is a handle to a window (or not used), lParam2 is a pointer to DRVCONFIGINFO, lParam2 */
if
(
lParam2
)
{
LPDRVCONFIGINFO16
dci16
=
MapSL
(
lParam2
);
HeapFree
(
GetProcessHeap
(),
0
,
MapSL
(
dci16
->
lpszDCISectionName
)
);
HeapFree
(
GetProcessHeap
(),
0
,
MapSL
(
dci16
->
lpszDCIAliasName
)
);
UnMapLS
(
lParam2
);
UnMapLS
(
dci16
->
lpszDCISectionName
);
UnMapLS
(
dci16
->
lpszDCIAliasName
);
HeapFree
(
GetProcessHeap
(),
0
,
dci16
);
}
ret
=
WINMM_MAP_OK
;
break
;
default:
if
(
!
((
wMsg
>=
0x800
&&
wMsg
<
0x900
)
||
(
wMsg
>=
0x4000
&&
wMsg
<
0x4100
)))
{
FIXME
(
"Unknown message 0x%04x
\n
"
,
wMsg
);
}
ret
=
WINMM_MAP_OK
;
}
return
ret
;
}
/**************************************************************************
* DrvOpen [MMSYSTEM.1100]
* DrvOpen [MMSYSTEM.1100]
*/
*/
HDRVR16
WINAPI
DrvOpen16
(
LPSTR
lpDriverName
,
LPSTR
lpSectionName
,
LPARAM
lParam
)
HDRVR16
WINAPI
DrvOpen16
(
LPSTR
lpDriverName
,
LPSTR
lpSectionName
,
LPARAM
lParam
)
...
...
dlls/winmm/winemm.h
View file @
894eedf5
...
@@ -265,6 +265,10 @@ BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODU
...
@@ -265,6 +265,10 @@ BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODU
void
TIME_MMTimeStart
(
void
);
void
TIME_MMTimeStart
(
void
);
void
TIME_MMTimeStop
(
void
);
void
TIME_MMTimeStop
(
void
);
/* temporary defines */
WINMM_MapType
DRIVER_MapMsg32To16
(
WORD
wMsg
,
DWORD
*
lParam1
,
DWORD
*
lParam2
);
WINMM_MapType
DRIVER_UnMapMsg32To16
(
WORD
wMsg
,
DWORD
lParam1
,
DWORD
lParam2
);
/* Global variables */
/* Global variables */
extern
LPWINE_MM_IDATA
WINMM_IData
;
extern
LPWINE_MM_IDATA
WINMM_IData
;
...
...
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