ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

DWORD MMDRV_Open ( LPWINE_MLD  mld,
UINT  wMsg,
DWORD_PTR  dwParam1,
DWORD  dwParam2 
)

Definition at line 195 of file lolvldrv.c.

Referenced by midiInOpen(), midiOutOpen(), midiStreamOpen(), mixerOpen(), MMDRV_Open(), and WAVE_Open().

{
    DWORD       dwRet = MMSYSERR_BADDEVICEID;
    DWORD_PTR       dwInstance;
    WINE_LLTYPE*    llType = &llTypes[mld->type];
    TRACE("(%p, %04x, 0x%08lx, 0x%08x)\n", mld, wMsg, dwParam1, dwFlags);

    mld->dwDriverInstance = (DWORD_PTR)&dwInstance;

    if (mld->uDeviceID == (UINT)-1 || mld->uDeviceID == (UINT16)-1) {
    TRACE("MAPPER mode requested !\n");
    /* check if mapper is supported by type */
    if (llType->bSupportMapper) {
        if (llType->nMapper == -1) {
        /* no driver for mapper has been loaded, try a dumb implementation */
        TRACE("No mapper loaded, doing it by hand\n");
        for (mld->uDeviceID = 0; mld->uDeviceID < llType->wMaxId; mld->uDeviceID++) {
            if ((dwRet = MMDRV_Open(mld, wMsg, dwParam1, dwFlags)) == MMSYSERR_NOERROR) {
            /* to share this function epilog */
            dwInstance = mld->dwDriverInstance;
            break;
            }
        }
        } else {
        mld->uDeviceID = (UINT16)-1;
        mld->mmdIndex = llType->lpMlds[-1].mmdIndex;
        TRACE("Setting mmdIndex to %u\n", mld->mmdIndex);
        dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags);
        }
    }
    } else {
    if (mld->uDeviceID < llType->wMaxId) {
        mld->mmdIndex = llType->lpMlds[mld->uDeviceID].mmdIndex;
        TRACE("Setting mmdIndex to %u\n", mld->mmdIndex);
        dwRet = MMDRV_Message(mld, wMsg, dwParam1, dwFlags);
    }
    }
    if (dwRet == MMSYSERR_NOERROR)
    mld->dwDriverInstance = dwInstance;
    return dwRet;
}

Generated on Thu May 24 2012 05:20:40 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.