Changeset 194 for trunk/src/helpers/prfh.c
- Timestamp:
- Jul 28, 2002, 11:48:47 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/prfh.c
r167 r194 189 189 */ 190 190 191 PSZ (prfhQueryProfileData)(HINI hIni, // in: INI handle (can be HINI_USER or HINI_SYSTEM)192 const char *pcszApp, 193 const char *pcszKey, 194 PULONG pcbBuf) // out: size of the returned buffer; ptr can be NULL191 PSZ (prfhQueryProfileData)(HINI hIni, // in: INI handle (can be HINI_USER or HINI_SYSTEM) 192 const char *pcszApp, // in: application to query 193 const char *pcszKey, // in: key to query 194 PULONG pcbBuf) // out: size of the returned buffer; ptr can be NULL 195 195 { 196 196 PSZ pData = NULL; 197 ULONG ulSizeOfData = 0;197 ULONG ulSizeOfData; 198 198 199 199 // get size of data for pszApp/pszKey 200 if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData)) 201 { 202 if (ulSizeOfData) 203 { 204 pData = (PSZ)malloc(ulSizeOfData); 205 if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData)) 206 { 207 free(pData); 208 pData = NULL; 209 } 200 if ( (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData)) 201 && (ulSizeOfData) 202 && (pData = (PSZ)malloc(ulSizeOfData)) 203 ) 204 { 205 if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData)) 206 { 207 free(pData); 208 pData = NULL; 210 209 } 211 210 }
Note:
See TracChangeset
for help on using the changeset viewer.