Ignore:
Timestamp:
Sep 5, 2001, 3:39:12 PM (24 years ago)
Author:
bird
Message:

Added $Id:$ keyword.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/setupapi/infparse.c

    r4989 r6649  
     1/* $Id: infparse.c,v 1.2 2001-09-05 13:38:23 bird Exp $ */
    12/*
    23 * SetupX .inf file parsing functions
     
    2930
    3031    if (!lphInf)
    31         return IP_ERROR;
     32    return IP_ERROR;
    3233
    3334    /* this could be improved by checking for already freed handles */
    34     if (IP_curr_handle == 0xffff) 
    35         return ERR_IP_OUT_OF_HANDLES;
     35    if (IP_curr_handle == 0xffff)
     36    return ERR_IP_OUT_OF_HANDLES;
    3637
    3738    if (hFile != HFILE_ERROR)
    3839    {
    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,
     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,
    4344                                                          strlen(lpInfFileName)+1);
    4445        strcpy( InfList[InfNumEntries].lpInfFileName, lpInfFileName );
    4546        *lphInf = InfList[InfNumEntries].hInf;
    46         InfNumEntries++;
    47         TRACE("ret handle %d.\n", *lphInf);
    48         return OK;
     47    InfNumEntries++;
     48    TRACE("ret handle %d.\n", *lphInf);
     49    return OK;
    4950    }
    5051    *lphInf = 0xffff;
     
    5758
    5859    for (n=0; n < InfNumEntries; n++)
    59         if (InfList[n].hInf == hInf)
    60         {
    61             *ret = n;
    62             return TRUE;
    63         }
     60    if (InfList[n].hInf == hInf)
     61    {
     62        *ret = n;
     63        return TRUE;
     64    }
    6465    return FALSE;
    6566}
    66        
     67
    6768
    6869LPCSTR IP_GetFileName(HINF16 hInf)
     
    7172    if (IP_FindInf(hInf, &n))
    7273    {
    73         return InfList[n].lpInfFileName;
     74    return InfList[n].lpInfFileName;
    7475    }
    7576    return NULL;
     
    8485    if (IP_FindInf(hInf, &n))
    8586    {
    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;
     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;
    9394    }
    9495    return res;
     
    9697
    9798/***********************************************************************
    98  *              IpOpen16
     99 *      IpOpen16
    99100 *
    100101 */
     
    106107
    107108/***********************************************************************
    108  *              IpClose16
     109 *      IpClose16
    109110 */
    110111RETERR16 WINAPI IpClose16(HINF16 hInf)
     
    114115
    115116/***********************************************************************
    116  *              IpGetProfileString16
     117 *      IpGetProfileString16
    117118 */
    118 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 
     119RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen)
    119120{
    120121    TRACE("'%s': section '%s' entry '%s'\n", IP_GetFileName(hInf), section, entry);
Note: See TracChangeset for help on using the changeset viewer.