[wdmaudiodev] Re: sample User mode installable multimedia driver

  • From: uwekirst <u.kirst@xxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Wed, 18 Mar 2009 10:04:32 +0100


The sample code is within the NT ddk.
There are some os changes since NT. One of them is WAVEOUTCAPS2W.
My driver is base on the ntddk. It works fine under Vista 32.
Please also look at my code below.
Hope it helps,
/Uwe

DWORD APIENTRY wodMessage(DWORD id, DWORD msg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
{
   PWAVEALLOC pOutClient;
   MMRESULT mRet;

   switch (msg) {
       case WODM_GETNUMDEVS:
           D2(("WODM_GETNUMDEVS_HDSPFIRE"));
if ((dwParam1 == 0) && (dwParam2 == 0)) {
               if (Wavecaps.outNumDevs == 0) {
                   Wrap_waveGetDevCaps(&Wavecaps, WaveOutDevice);
               }
               dprintf1(("GetNumDevs %d", Wavecaps.outNumDevs));
               if (Wavecaps.outNumDevs > MAX_NUM_DEVS) {
                   Wavecaps.outNumDevs = 0;
               }
               dprintf1(("GetNumDevs %d", Wavecaps.outNumDevs));
               return Wavecaps.outNumDevs;
           } else {
dprintf1(("dwParam1 = 0x%x, dwParam2 = 0x%x", dwParam1, dwParam2));
               return 0;
           }

       case WODM_GETDEVCAPS:
           D2(("WODM_GETDEVCAPS_HDSPFIRE"));
           dprintf1(("dwParam1, dwParam2: %d, %d", dwParam1, dwParam2));
if ((id < MAX_NUM_DEVS) && (dwParam2 <= sizeof(WAVEOUTCAPS2W)) && (dwParam2 > 0)) { //if (dwParam2 <= sizeof(WAVEOUTCAPSW)) { memcpy((LPBYTE)dwParam1, (LPBYTE)(&Wavecaps.outcaps[id]), dwParam2);
               //} else {
// memcpy((LPBYTE)dwParam1, (LPBYTE)(&Wavecaps.outcaps[id]), sizeof(WAVEOUTCAPSW));
               //}
               return MMSYSERR_NOERROR;
           } else {
               dprintf1(("Device Number: %d", id));
               dprintf1(("dwParam1:      %d", dwParam1));
               dprintf1(("dwParam2:      %d", dwParam2));
               dprintf1(("Caps size:     %d", sizeof(WAVEOUTCAPSW)));
               return MMSYSERR_ERROR;
}


Vipin Kumar schrieb:
Hi,
i am trying to write a user mode installable multimedia driver ( basically i want to implement the wodMessage ).please visit http://msdn.microsoft.com/en-us/library/ms713504(VS.85).aspx <http://msdn.microsoft.com/en-us/library/ms713504%28VS.85%29.aspx>

i can see my device in the list, however, when someone tries to open the device, i receive a callback argument with value 0, which is not valid

so no one is able to open the device( AFAIK the device will open only when the callback is sent, but since it's a value of zero, it's of no use )

can someone help me out here.

i am also trying to search a sample but in vain. Can someone please point me out to the sample or what am i doing wrong or how should i do it.

waiting for your help
--
--
Thanks & Regards
=================
Vipin.


******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/

Other related posts: