move more dlls
[reactos.git] / reactos / dll / dsound / dxroslayer / dxroslayer.c
1 /*
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * ReactOS emulation layer betwin wine and windows api for directx
18 * This transform wine specfiy api to native reactos/windows api
19 * wine have done some hack to geting dsound working. But does
20 * hack does not work on windows or reactos. It need to warp thuse
21 * api hack to true native api.
22 *
23 * This layer have some weekness
24 * it does not support hardware accleration of the sound card.
25 * it need complete implant of it here, and we need also wdm
26 * in reactos to complete dsound. for monet it is not posibile
27 * to get all value and fill them. eg the soundcard drv name.
28 *
29 * Wine does get almost everthing from there sound drv, then
30 * pass it thurg winmm, then to dsound. but windows drv does
31 * not pass this info to the winmm. it send it on wdm instead.
32 *
33 * Do rember this dsound is hardcode to software mode only.
34 * the program will not notice it. it will think it is hardware.
35 * for the flag never report back it is in software mode.
36 *
37 *
38 * Copyright 2004 Magnus Olsen
39 *
40 */
41 #include "config.h"
42 #include "wine/port.h"
43
44 #include <assert.h>
45 #include <stdarg.h>
46 #include <stdio.h>
47 #include <sys/types.h>
48 #include <sys/fcntl.h>
49 #ifdef HAVE_UNISTD_H
50 # include <unistd.h>
51 #endif
52 #include <stdlib.h>
53 #include <string.h>
54 #include <math.h>
55
56 #define NONAMELESSSTRUCT
57 #define NONAMELESSUNION
58 #include "windef.h"
59 #include "winbase.h"
60 #include "winreg.h"
61 #include "winuser.h"
62 #include "wingdi.h"
63 #include "winuser.h"
64 #include "winerror.h"
65 #include "mmsystem.h"
66 #include "winternl.h"
67 #include "mmddk.h"
68 #include "wine/windef16.h"
69 #include "wine/winbase16.h"
70 #include "wine/debug.h"
71 #include "dsound.h"
72 #include "dsdriver.h"
73 #include "dxros_layer.h"
74 #include "dsconf.h"
75
76 WINE_DEFAULT_DEBUG_CHANNEL(dsound);
77
78
79 DWORD RosWineWaveOutMessage(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
80 {
81 DWORD msg;
82 switch (uMsg) {
83 case DRV_QUERYDSOUNDDESC:
84 msg = dxrosdrv_drv_querydsounddescss(0, (HWAVEOUT)((ULONG)hwo),(HWAVEIN) 0, (PDSDRIVERDESC) dwParam1);
85 break;
86
87 case DRV_QUERYDSOUNDIFACE:
88 msg = dxrosdrv_drv_querydsoundiface((HWAVEIN)hwo, (PIDSDRIVER)dwParam1);
89 break;
90
91 default :
92 msg = waveOutMessage(hwo, uMsg, dwParam1, dwParam2);
93 break;
94 }
95 return msg;
96 }
97
98 DWORD RosWineWaveInMessage(HWAVEIN hwo, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
99 {
100 DWORD msg;
101 switch (uMsg) {
102 case DRV_QUERYDSOUNDDESC:
103 msg = dxrosdrv_drv_querydsounddescss(1, (HWAVEOUT)((ULONG)0),(HWAVEIN)((ULONG)hwo), (PDSDRIVERDESC) dwParam1);
104 break;
105
106 case DRV_QUERYDSOUNDIFACE:
107 msg = dxrosdrv_drv_querydsoundiface(hwo, (PIDSDRIVER)dwParam1);
108 break;
109
110 default :
111 msg = waveInMessage(hwo, uMsg, dwParam1, dwParam2);
112 break;
113 }
114 return msg;
115 }