Changeset 22 for trunk/src/helpers/prfh.c
- Timestamp:
- Jan 14, 2001, 5:42:22 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/prfh.c
r14 r22 88 88 89 89 PSZ prfhQueryKeysForApp(HINI hIni, // in: INI handle (can be HINI_USER or HINI_SYSTEM) 90 PSZ pszApp) // in: application to query list for (or NULL for applications list)90 const char *pcszApp) // in: application to query list for (or NULL for applications list) 91 91 { 92 92 PSZ pKeys = NULL; … … 94 94 95 95 // get size of keys list for pszApp 96 if (PrfQueryProfileSize(hIni, pszApp, NULL, &ulSizeOfKeysList))96 if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, NULL, &ulSizeOfKeysList)) 97 97 { 98 98 pKeys = (PSZ)malloc(ulSizeOfKeysList); 99 if (!PrfQueryProfileData(hIni, pszApp, NULL, pKeys, &ulSizeOfKeysList))99 if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, NULL, pKeys, &ulSizeOfKeysList)) 100 100 { 101 101 free(pKeys); … … 118 118 119 119 PSZ prfhQueryProfileDataDebug(HINI hIni, // in: INI handle (can be HINI_USER or HINI_SYSTEM) 120 PSZ pszApp, // in: application to query121 PSZ pszKey, // in: key to query120 const char *pcszApp, // in: application to query 121 const char *pcszKey, // in: key to query 122 122 PULONG pcbBuf, // out: size of the returned buffer 123 123 const char *file, … … 129 129 130 130 // get size of data for pszApp/pszKey 131 if (PrfQueryProfileSize(hIni, pszApp, pszKey, &ulSizeOfData))131 if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData)) 132 132 { 133 133 if (ulSizeOfData) 134 134 { 135 135 pData = (PSZ)memdMalloc(ulSizeOfData, file, line, function); 136 if (!PrfQueryProfileData(hIni, pszApp, pszKey, pData, &ulSizeOfData))136 if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData)) 137 137 { 138 138 free(pData); … … 169 169 170 170 PSZ prfhQueryProfileData(HINI hIni, // in: INI handle (can be HINI_USER or HINI_SYSTEM) 171 PSZ pszApp, // in: application to query172 PSZ pszKey, // in: key to query171 const char *pcszApp, // in: application to query 172 const char *pcszKey, // in: key to query 173 173 PULONG pcbBuf) // out: size of the returned buffer; ptr can be NULL 174 174 { … … 177 177 178 178 // get size of data for pszApp/pszKey 179 if (PrfQueryProfileSize(hIni, pszApp, pszKey, &ulSizeOfData))179 if (PrfQueryProfileSize(hIni, (PSZ)pcszApp, (PSZ)pcszKey, &ulSizeOfData)) 180 180 { 181 181 if (ulSizeOfData) 182 182 { 183 183 pData = (PSZ)malloc(ulSizeOfData); 184 if (!PrfQueryProfileData(hIni, pszApp, pszKey, pData, &ulSizeOfData))184 if (!PrfQueryProfileData(hIni, (PSZ)pcszApp, (PSZ)pcszKey, pData, &ulSizeOfData)) 185 185 { 186 186 free(pData); … … 208 208 209 209 CHAR prfhQueryProfileChar(HINI hini, // in: INI handle (can be HINI_USER or HINI_SYSTEM) 210 PSZ pszApp, // in: application to query211 PSZ pszKey, // in: key to query210 const char *pcszApp, // in: application to query 211 const char *pcszKey, // in: key to query 212 212 CHAR cDefault) // in: default to return if not found 213 213 { … … 217 217 szDefault[0] = cDefault; 218 218 szDefault[1] = 0; 219 PrfQueryProfileString(HINI_USER, pszApp, pszKey,219 PrfQueryProfileString(HINI_USER, (PSZ)pcszApp, (PSZ)pcszKey, 220 220 szDefault, 221 221 szTemp, sizeof(szTemp)-1); … … 263 263 */ 264 264 265 LONG prfhQueryColor(PSZ pszKeyName, PSZ pszDefault) 265 LONG prfhQueryColor(const char *pcszKeyName, 266 const char *pcszDefault) 266 267 { 267 268 CHAR szColor[30]; … … 270 271 HINI_USER, 271 272 "PM_Colors", 272 pszKeyName,273 pszDefault,273 (PSZ)pcszKeyName, 274 (PSZ)pcszDefault, 274 275 szColor, 275 276 sizeof(szColor)-1); … … 303 304 304 305 ULONG prfhCopyKey(HINI hiniSource, // in: source profile (can be HINI_USER or HINI_SYSTEM) 305 PSZ pszSourceApp, // in: source application306 PSZ pszKey, // in: source/target key306 const char *pcszSourceApp, // in: source application 307 const char *pcszKey, // in: source/target key 307 308 HINI hiniTarget, // in: target profile (can be HINI_USER or HINI_SYSTEM) 308 PSZ pszTargetApp) // in: target app309 const char *pcszTargetApp) // in: target app 309 310 { 310 311 ULONG ulSizeOfData = 0, 311 312 ulrc = 0; // return: no error 312 313 313 if (PrfQueryProfileSize(hiniSource, pszSourceApp, pszKey, &ulSizeOfData))314 if (PrfQueryProfileSize(hiniSource, (PSZ)pcszSourceApp, (PSZ)pcszKey, &ulSizeOfData)) 314 315 { 315 316 PSZ pData = 0; … … 332 333 { 333 334 if (PrfQueryProfileData(hiniSource, 334 pszSourceApp,335 pszKey,335 (PSZ)pcszSourceApp, 336 (PSZ)pcszKey, 336 337 pData, 337 338 &ulSizeOfData)) 338 339 { 339 340 if (!PrfWriteProfileData(hiniTarget, 340 pszTargetApp,341 pszKey,341 (PSZ)pcszTargetApp, 342 (PSZ)pcszKey, 342 343 pData, 343 344 ulSizeOfData)) … … 401 402 402 403 ULONG prfhCopyApp(HINI hiniSource, // in: source profile (can be HINI_USER or HINI_SYSTEM) 403 PSZ pszSourceApp, // in: source application404 const char *pcszSourceApp, // in: source application 404 405 HINI hiniTarget, // in: target profile (can be HINI_USER or HINI_SYSTEM) 405 PSZ pszTargetApp, // in: name of pszSourceApp in hiniTarget406 const char *pcszTargetApp, // in: name of pszSourceApp in hiniTarget 406 407 PSZ pszErrorKey) // out: failing key in case of error; ptr can be NULL 407 408 { … … 412 413 *pszErrorKey = 0; 413 414 414 pszKeysList = prfhQueryKeysForApp(hiniSource, pszSourceApp);415 pszKeysList = prfhQueryKeysForApp(hiniSource, (PSZ)pcszSourceApp); 415 416 if (pszKeysList) 416 417 { … … 421 422 // copy this key 422 423 ulrc = prfhCopyKey(hiniSource, 423 p szSourceApp,424 pcszSourceApp, 424 425 pKey2, 425 426 hiniTarget, 426 p szTargetApp);427 pcszTargetApp); 427 428 if (ulrc) 428 429 { … … 453 454 454 455 BOOL prfhSetUserProfile(HAB hab, 455 PSZ pszUserProfile) // in: new user profile (.INI)456 const char *pcszUserProfile) // in: new user profile (.INI) 456 457 { 457 458 BOOL brc = FALSE; … … 475 476 // change INIs 476 477 free(Profiles.pszUserName); 477 Profiles.pszUserName = pszUserProfile;478 Profiles.cchUserName = strlen(p szUserProfile) + 1;478 Profiles.pszUserName = (PSZ)pcszUserProfile; 479 Profiles.cchUserName = strlen(pcszUserProfile) + 1; 479 480 brc = PrfReset(hab, &Profiles); 480 481 free(Profiles.pszSysName);
Note:
See TracChangeset
for help on using the changeset viewer.