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/setupapi/infparse.c

    r6649 r6712  
    1 /* $Id: infparse.c,v 1.2 2001-09-05 13:38:23 bird Exp $ */
    21/*
    32 * SetupX .inf file parsing functions
     
    3029
    3130    if (!lphInf)
    32     return IP_ERROR;
     31        return IP_ERROR;
    3332
    3433    /* this could be improved by checking for already freed handles */
    35     if (IP_curr_handle == 0xffff)
    36     return ERR_IP_OUT_OF_HANDLES;
     34    if (IP_curr_handle == 0xffff) 
     35        return ERR_IP_OUT_OF_HANDLES;
    3736
    3837    if (hFile != HFILE_ERROR)
    3938    {
    40     InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries+1);
    41     InfList[InfNumEntries].hInf = IP_curr_handle++;
    42     InfList[InfNumEntries].hInfFile = hFile;
    43     InfList[InfNumEntries].lpInfFileName = HeapAlloc( GetProcessHeap(), 0,
     39        InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries+1);
     40        InfList[InfNumEntries].hInf = IP_curr_handle++;
     41        InfList[InfNumEntries].hInfFile = hFile;
     42        InfList[InfNumEntries].lpInfFileName = HeapAlloc( GetProcessHeap(), 0,
    4443                                                          strlen(lpInfFileName)+1);
    4544        strcpy( InfList[InfNumEntries].lpInfFileName, lpInfFileName );
    4645        *lphInf = InfList[InfNumEntries].hInf;
    47     InfNumEntries++;
    48     TRACE("ret handle %d.\n", *lphInf);
    49     return OK;
     46        InfNumEntries++;
     47        TRACE("ret handle %d.\n", *lphInf);
     48        return OK;
    5049    }
    5150    *lphInf = 0xffff;
     
    5857
    5958    for (n=0; n < InfNumEntries; n++)
    60     if (InfList[n].hInf == hInf)
    61     {
    62         *ret = n;
    63         return TRUE;
    64     }
     59        if (InfList[n].hInf == hInf)
     60        {
     61            *ret = n;
     62            return TRUE;
     63        }
    6564    return FALSE;
    6665}
    67 
     66       
    6867
    6968LPCSTR IP_GetFileName(HINF16 hInf)
     
    7271    if (IP_FindInf(hInf, &n))
    7372    {
    74     return InfList[n].lpInfFileName;
     73        return InfList[n].lpInfFileName;
    7574    }
    7675    return NULL;
     
    8584    if (IP_FindInf(hInf, &n))
    8685    {
    87     _lclose(InfList[n].hInfFile);
    88     HeapFree(GetProcessHeap(), 0, InfList[n].lpInfFileName);
    89     for (i=n; i < InfNumEntries-1; i++)
    90         InfList[i] = InfList[i+1];
    91     InfNumEntries--;
    92     InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries);
    93     res = OK;
     86        _lclose(InfList[n].hInfFile);
     87        HeapFree(GetProcessHeap(), 0, InfList[n].lpInfFileName);
     88        for (i=n; i < InfNumEntries-1; i++)
     89            InfList[i] = InfList[i+1];
     90        InfNumEntries--;
     91        InfList = HeapReAlloc(GetProcessHeap(), 0, InfList, InfNumEntries);
     92        res = OK;
    9493    }
    9594    return res;
     
    9796
    9897/***********************************************************************
    99  *      IpOpen16
     98 *              IpOpen16
    10099 *
    101100 */
     
    107106
    108107/***********************************************************************
    109  *      IpClose16
     108 *              IpClose16
    110109 */
    111110RETERR16 WINAPI IpClose16(HINF16 hInf)
     
    115114
    116115/***********************************************************************
    117  *      IpGetProfileString16
     116 *              IpGetProfileString16
    118117 */
    119 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen)
     118RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 
    120119{
    121120    TRACE("'%s': section '%s' entry '%s'\n", IP_GetFileName(hInf), section, entry);
Note: See TracChangeset for help on using the changeset viewer.