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