Changeset 6649 for trunk/src/setupapi/infparse.c
- Timestamp:
- Sep 5, 2001, 3:39:12 PM (24 years ago)
- 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 $ */ 1 2 /* 2 3 * SetupX .inf file parsing functions … … 29 30 30 31 if (!lphInf) 31 32 return IP_ERROR; 32 33 33 34 /* 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; 36 37 37 38 if (hFile != HFILE_ERROR) 38 39 { 39 40 41 42 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, 43 44 strlen(lpInfFileName)+1); 44 45 strcpy( InfList[InfNumEntries].lpInfFileName, lpInfFileName ); 45 46 *lphInf = InfList[InfNumEntries].hInf; 46 47 48 47 InfNumEntries++; 48 TRACE("ret handle %d.\n", *lphInf); 49 return OK; 49 50 } 50 51 *lphInf = 0xffff; … … 57 58 58 59 for (n=0; n < InfNumEntries; n++) 59 60 61 62 63 60 if (InfList[n].hInf == hInf) 61 { 62 *ret = n; 63 return TRUE; 64 } 64 65 return FALSE; 65 66 } 66 67 67 68 68 69 LPCSTR IP_GetFileName(HINF16 hInf) … … 71 72 if (IP_FindInf(hInf, &n)) 72 73 { 73 74 return InfList[n].lpInfFileName; 74 75 } 75 76 return NULL; … … 84 85 if (IP_FindInf(hInf, &n)) 85 86 { 86 87 88 89 90 91 92 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; 93 94 } 94 95 return res; … … 96 97 97 98 /*********************************************************************** 98 * 99 * IpOpen16 99 100 * 100 101 */ … … 106 107 107 108 /*********************************************************************** 108 * 109 * IpClose16 109 110 */ 110 111 RETERR16 WINAPI IpClose16(HINF16 hInf) … … 114 115 115 116 /*********************************************************************** 116 * 117 * IpGetProfileString16 117 118 */ 118 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 119 RETERR16 WINAPI IpGetProfileString16(HINF16 hInf, LPCSTR section, LPCSTR entry, LPSTR buffer, WORD buflen) 119 120 { 120 121 TRACE("'%s': section '%s' entry '%s'\n", IP_GetFileName(hInf), section, entry);
Note:
See TracChangeset
for help on using the changeset viewer.