2 * reactos emulation layer betwin wine and windows api for directx
4 * Copyright 2004 Magnus Olsen
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * need to rewrite almost everthing so it get all info from the hardware instead
25 * put it in own library that call dxroslayer.a
30 #include "wine/port.h"
35 #include <sys/types.h>
36 #include <sys/fcntl.h>
44 #define NONAMELESSSTRUCT
45 #define NONAMELESSUNION
56 #include "wine/windef16.h"
57 #include "wine/winbase16.h"
58 #include "wine/debug.h"
61 #include "dxros_layer.h"
64 WINE_DEFAULT_DEBUG_CHANNEL(dsound
);
66 DWORD
dxrosdrv_drv_querydsounddescss(int type
, HWAVEOUT hwo_out
,HWAVEIN hwo_in
, PDSDRIVERDESC pDESC
)
76 memset(pDESC
,0,sizeof(DSDRIVERDESC
));
77 memset((char *)pDESC
->szDrvname
,0,255);
78 if (type
==0) memset(&ac_play
,0,sizeof(WAVEOUTCAPSA
));
79 else memset(&ac_rec
,0,sizeof(WAVEINCAPSA
));
83 msg
= waveOutGetDevCapsA((UINT
)hwo_out
,&ac_play
,sizeof(WAVEOUTCAPSA
));
84 if (ac_play
.szPname
==NULL
) return MMSYSERR_NOTSUPPORTED
;
88 msg
= waveInGetDevCapsA((UINT
)hwo_in
,&ac_rec
,sizeof(WAVEINCAPSA
));
89 if (ac_rec
.szPname
==NULL
) return MMSYSERR_NOTSUPPORTED
;
92 if (msg
!=MMSYSERR_NOERROR
) return msg
;
97 //pDESC->wReserved = NULL;
101 pDESC
->ulDeviceNum
= (ULONG
)hwo_out
;
102 memcpy((char *)pDESC
->szDesc
,ac_play
.szPname
,strlen(ac_play
.szPname
));
105 pDESC
->ulDeviceNum
= (ULONG
)hwo_in
;
106 memcpy((char *)pDESC
->szDesc
,ac_rec
.szPname
,strlen(ac_rec
.szPname
));
111 pDESC->dwFlags |= DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT |
112 DSDDESC_USESYSTEMMEMORY | DSDDESC_DONTNEEDPRIMARYLOCK |
113 DSDDESC_DONTNEEDSECONDARYLOCK;
114 //pDesc->dnDevNode = WOutDev[This->wDevID].waveDesc.dnDevNode;
116 pDESC->wReserved = 0;
117 pDESC->dwHeapType = DSDHEAP_NOHEAP;
118 pDESC->pvDirectDrawHeap = NULL;
119 pDESC->dwMemStartAddress = 0;
120 pDESC->dwMemEndAddress = 0;
121 pDESC->dwMemAllocExtra = 0;
122 pDESC->pvReserved1 = NULL;
123 pDESC->pvReserved2 = NULL;
127 pDESC
->pvReserved1
= NULL
;
128 pDESC
->pvReserved2
= NULL
;
130 // we need to fill it right so we do not need ddraw.dll
131 pDESC
->pvDirectDrawHeap
= NULL
; // wine dsound does not use ddraw.dll
134 // need to write dective for it
135 pDESC
->dwHeapType
= DSDHEAP_NOHEAP
;
137 // have take the value from wine audio drv
138 pDESC
->dwFlags
= DSDDESC_DOMMSYSTEMOPEN
|
139 DSDDESC_DOMMSYSTEMSETFORMAT
|
140 DSDDESC_USESYSTEMMEMORY
|
141 DSDDESC_DONTNEEDPRIMARYLOCK
|
142 DSDDESC_DONTNEEDSECONDARYLOCK
;
145 //WAVEOPENDESC->DevNode need to fig. how to get it from mmdrv
146 pDESC
->dnDevNode
= 0; // wine dsound are using this value
148 // need to fill the rest also
150 // must contain the audio drv name
151 // but how to get it ?
152 //memcpy((char *)pDESC->szDrvname,(char *)&"kx.sys",6);
156 pDESC
->dwMemStartAddress
= 0;
157 pDESC
->dwMemAllocExtra
= 0;
161 return MMSYSERR_NOERROR
;