Ignore:
Timestamp:
Sep 15, 2001, 11:47:44 AM (24 years ago)
Author:
sandervl
Message:

restored old version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/msacm32/internal.c

    r6648 r6712  
    11/* -*- tab-width: 8; c-basic-offset: 4 -*- */
    2 /* $Id: internal.c,v 1.2 2001-09-05 13:11:26 bird Exp $ */
     2
    33/*
    44 *      MSACM32 library
    55 *
    66 *      Copyright 1998  Patrik Stridvall
    7  *        1999  Eric Pouech
     7 *                1999  Eric Pouech
    88 */
    99
     
    3434
    3535/***********************************************************************
    36  *           MSACM_RegisterDriver()
     36 *           MSACM_RegisterDriver() 
    3737 */
    3838PWINE_ACMDRIVERID MSACM_RegisterDriver(LPSTR pszDriverAlias, LPSTR pszFileName,
    39                        HINSTANCE hinstModule)
    40 {
     39                                       HINSTANCE hinstModule)
     40{ 
    4141    PWINE_ACMDRIVERID padid;
    4242
     
    6464    padid->pPrevACMDriverID = MSACM_pLastACMDriverID;
    6565    if (MSACM_pLastACMDriverID)
    66     MSACM_pLastACMDriverID->pNextACMDriverID = padid;
     66        MSACM_pLastACMDriverID->pNextACMDriverID = padid;
    6767    MSACM_pLastACMDriverID = padid;
    6868    if (!MSACM_pFirstACMDriverID)
    69     MSACM_pFirstACMDriverID = padid;
    70 
     69        MSACM_pFirstACMDriverID = padid;
     70   
    7171    return padid;
    7272}
    7373
    7474/***********************************************************************
    75  *           MSACM_RegisterAllDrivers()
     75 *           MSACM_RegisterAllDrivers() 
    7676 */
    7777void MSACM_RegisterAllDrivers(void)
     
    8080    DWORD dwBufferLength;
    8181
    82     /* FIXME
     82    /* FIXME 
    8383     *  What if the user edits system.ini while the program is running?
    8484     *  Does Windows handle that?
    8585     */
    8686    if (MSACM_pFirstACMDriverID)
    87     return;
    88 
     87        return;
     88   
    8989    /* FIXME: Do not work! How do I determine the section length? */
    9090    dwBufferLength = 1024;
    91 /* EPP  GetPrivateProfileSectionA("drivers32", NULL, 0, "system.ini"); */
    92 
     91/* EPP  GetPrivateProfileSectionA("drivers32", NULL, 0, "system.ini"); */
     92   
    9393    pszBuffer = (LPSTR) HeapAlloc(MSACM_hHeap, 0, dwBufferLength);
    9494    if (GetPrivateProfileSectionA("drivers32", pszBuffer, dwBufferLength, "system.ini")) {
    95     char* s = pszBuffer;
    96     while (*s) {
    97         if (!strncasecmp("MSACM.", s, 6)) {
    98         char *s2 = s;
    99         while (*s2 != '\0' && *s2 != '=') s2++;
    100         if (*s2) {
    101             *s2 = '\0';
    102             MSACM_RegisterDriver(s, s2 + 1, 0);
    103             *s2 = '=';
    104         }
    105         }
    106         s += strlen(s) + 1; /* Either next char or \0 */
     95        char* s = pszBuffer;
     96        while (*s) {
     97            if (!strncasecmp("MSACM.", s, 6)) {
     98                char *s2 = s;
     99                while (*s2 != '\0' && *s2 != '=') s2++;
     100                if (*s2) {
     101                    *s2 = '\0';
     102                    MSACM_RegisterDriver(s, s2 + 1, 0);
     103                    *s2 = '=';
     104                }
     105            } 
     106            s += strlen(s) + 1; /* Either next char or \0 */
     107        }
    107108    }
    108     }
    109 
     109   
    110110    HeapFree(MSACM_hHeap, 0, pszBuffer);
    111111
     
    119119{
    120120    PWINE_ACMDRIVERID pNextACMDriverID;
    121 
     121   
    122122    while (p->pACMDriverList)
    123     acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
    124 
     123        acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
     124   
    125125    if (p->pszDriverAlias)
    126     HeapFree(MSACM_hHeap, 0, p->pszDriverAlias);
     126        HeapFree(MSACM_hHeap, 0, p->pszDriverAlias);
    127127    if (p->pszFileName)
    128     HeapFree(MSACM_hHeap, 0, p->pszFileName);
    129 
     128        HeapFree(MSACM_hHeap, 0, p->pszFileName);
     129   
    130130    if (p == MSACM_pFirstACMDriverID)
    131     MSACM_pFirstACMDriverID = p->pNextACMDriverID;
     131        MSACM_pFirstACMDriverID = p->pNextACMDriverID;
    132132    if (p == MSACM_pLastACMDriverID)
    133     MSACM_pLastACMDriverID = p->pPrevACMDriverID;
     133        MSACM_pLastACMDriverID = p->pPrevACMDriverID;
    134134
    135135    if (p->pPrevACMDriverID)
    136     p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID;
     136        p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID;
    137137    if (p->pNextACMDriverID)
    138     p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID;
    139 
     138        p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID;
     139   
    140140    pNextACMDriverID = p->pNextACMDriverID;
    141 
     141   
    142142    HeapFree(MSACM_hHeap, 0, p);
    143 
     143   
    144144    return pNextACMDriverID;
    145145}
     
    162162PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj, DWORD type)
    163163{
    164     PWINE_ACMOBJ    pao = (PWINE_ACMOBJ)hObj;
     164    PWINE_ACMOBJ        pao = (PWINE_ACMOBJ)hObj;
    165165
    166166    if (pao == NULL || IsBadReadPtr(pao, sizeof(WINE_ACMOBJ)) ||
    167     ((type != WINE_ACMOBJ_DONTCARE) && (type != pao->dwType)))
    168     return NULL;
     167        ((type != WINE_ACMOBJ_DONTCARE) && (type != pao->dwType)))
     168        return NULL;
    169169    return pao;
    170170}
    171171
    172172/***********************************************************************
    173  *           MSACM_GetDriverID()
     173 *           MSACM_GetDriverID() 
    174174 */
    175175PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
     
    191191MMRESULT MSACM_Message(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
    192192{
    193     PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
     193    PWINE_ACMDRIVER     pad = MSACM_GetDriver(had);
    194194
    195195    return pad ? SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2) : MMSYSERR_INVALHANDLE;
Note: See TracChangeset for help on using the changeset viewer.