Changeset 22
- Timestamp:
- Jan 14, 2001, 5:42:22 PM (25 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/helpers/prfh.h
r20 r22 49 49 50 50 PSZ prfhQueryKeysForApp(HINI hIni, 51 PSZ pszApp);51 const char *pcszApp); 52 52 53 53 #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c 54 54 PSZ prfhQueryProfileDataDebug(HINI hIni, 55 PSZ pszApp,56 PSZ pszKey,55 const char *pcszApp, 56 const char *pcszKey, 57 57 PULONG pcbBuf, 58 58 const char *file, … … 62 62 #else 63 63 PSZ prfhQueryProfileData(HINI hIni, 64 PSZ pszApp,65 PSZ pszKey,66 PULONG pcbBuf);64 const char *pcszApp, 65 const char *pcszKey, 66 PULONG pcbBuf); 67 67 #endif 68 68 69 69 CHAR prfhQueryProfileChar(HINI hini, 70 PSZ pszApp,71 PSZ pszKey,70 const char *pcszApp, 71 const char *pcszKey, 72 72 CHAR cDefault); 73 73 74 LONG prfhQueryColor( PSZ pszKeyName, PSZ pszDefault);74 LONG prfhQueryColor(const char *pcszKeyName, const char *pcszDefault); 75 75 76 76 /* … … 105 105 106 106 ULONG prfhCopyKey(HINI hiniSource, 107 PSZ pszSourceApp,108 PSZ pszKey,109 HINI hiniTarget,110 PSZ pszTargetApp);107 const char *pcszSourceApp, 108 const char *pcszKey, 109 HINI hiniTarget, 110 const char *pcszTargetApp); 111 111 112 112 ULONG prfhCopyApp(HINI hiniSource, 113 PSZ pszSourceApp,113 const char *pcszSourceApp, 114 114 HINI hiniTarget, 115 PSZ pszTargetApp,115 const char *pcszTargetApp, 116 116 PSZ pszErrorKey); 117 117 118 118 BOOL prfhSetUserProfile(HAB hab, 119 PSZ pszUserProfile);119 const char *pcszUserProfile); 120 120 121 121 ULONG prfhINIError(ULONG ulOptions, … … 125 125 126 126 ULONG prfhINIError2(ULONG ulOptions, 127 PSZ pszINI,127 const char *pcszINI, 128 128 FILE* fLog, 129 129 PFNWP fncbError, -
trunk/src/helpers/dosh.c
r21 r22 1017 1017 if (pulAttr) 1018 1018 *pulAttr = fs3.attrFile; 1019 else1020 arc = ERROR_INVALID_PARAMETER;1021 1019 } 1022 1020 -
trunk/src/helpers/except.c
r21 r22 228 228 #define INCL_DOSEXCEPTIONS 229 229 #define INCL_DOSPROCESS 230 #define INCL_DOSMISC 230 231 #define INCL_DOSERRORS 231 232 #include <os2.h> … … 456 457 PCONTEXTRECORD pContextRec) // in: excpt info 457 458 { 459 ULONG aulBuf[3]; 460 const char *pcszVersion = "unknown"; 461 458 462 PTIB ptib = NULL; 459 463 PPIB ppib = NULL; … … 463 467 ULONG ulObjNum, 464 468 ulOffset; 465 /* ulCountPages,466 ulFlagsPage; */467 // APIRET arc;468 // PULONG pulStackWord;469 // pulStackBegin;470 469 ULONG ul; 471 470 … … 498 497 DosBeep( 250, 30); 499 498 } 499 500 // generic exception info 501 DosQuerySysInfo(QSV_VERSION_MAJOR, // 11 502 QSV_VERSION_MINOR, // 12 503 &aulBuf, sizeof(aulBuf)); 504 // Warp 3 is reported as 20.30 505 // Warp 4 is reported as 20.40 506 // Aurora is reported as 20.45 507 508 if (aulBuf[0] == 20) 509 { 510 switch (aulBuf[1]) 511 { 512 case 30: pcszVersion = "Warp 3"; break; 513 case 40: pcszVersion = "Warp 4"; break; 514 case 45: pcszVersion = "WSeB kernel"; break; 515 } 516 } 517 fprintf(file, 518 "Running OS/2 version: %u.%u (%s)\n", 519 aulBuf[0], // major 520 aulBuf[1], 521 pcszVersion); 522 500 523 501 524 // generic exception info -
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); -
trunk/src/helpers/prfh2.c
r14 r22 119 119 120 120 ULONG prfhINIError2(ULONG ulOptions, 121 PSZ pszINI,121 const char *pcszINI, 122 122 FILE* fLog, 123 123 PFNWP fncbError, … … 126 126 CHAR szError2[2000]; 127 127 sprintf(szError2, "An error occured copying the profile %s: \n%s", 128 p szINI, pszErrorString);128 pcszINI, pszErrorString); 129 129 return (prfhINIError(ulOptions, fLog, fncbError, szError2)); 130 130 } -
trunk/src/helpers/threads.c
r21 r22 296 296 0, 297 297 NULL); 298 THREADINFO ti = {0}; 299 thrCreate(&ti, 300 pfn, 301 NULL, 302 THRF_PMMSGQUEUE, 303 ulData); 304 ti.hwndNotify = hwndNotify; 305 306 while (WinGetMsg(hab, 307 &qmsg, 0, 0, 0)) 308 { 309 // current message for our object window? 310 if ( (qmsg.hwnd == hwndNotify) 311 && (qmsg.msg == WM_USER) 312 ) 298 if (hwndNotify) 299 { 300 THREADINFO ti = {0}; 301 thrCreate(&ti, 302 pfn, 303 NULL, 304 THRF_PMMSGQUEUE, 305 ulData); 306 ti.hwndNotify = hwndNotify; 307 308 while (WinGetMsg(hab, 309 &qmsg, 0, 0, 0)) 313 310 { 314 fQuit = TRUE; 315 ulrc = (ULONG)qmsg.mp1; 311 // current message for our object window? 312 if ( (qmsg.hwnd == hwndNotify) 313 && (qmsg.msg == WM_USER) 314 ) 315 { 316 fQuit = TRUE; 317 ulrc = (ULONG)qmsg.mp1; 318 } 319 320 WinDispatchMsg(hab, &qmsg); 321 if (fQuit) 322 break; 316 323 } 317 324 318 WinDispatchMsg(hab, &qmsg); 319 if (fQuit) 320 break; 321 } 322 323 // we must wait for the thread to finish, or 324 // otherwise THREADINFO is deleted from the stack 325 // before the thread exits... will crash! 326 thrWait(&ti); 327 328 WinDestroyWindow(hwndNotify); 325 // we must wait for the thread to finish, or 326 // otherwise THREADINFO is deleted from the stack 327 // before the thread exits... will crash! 328 thrWait(&ti); 329 330 WinDestroyWindow(hwndNotify); 331 } 332 329 333 return (ulrc); 330 334 } … … 367 371 if (pti->tid) 368 372 { 369 DosWaitThread(& (pti->tid), DCWW_WAIT);373 DosWaitThread(&pti->tid, DCWW_WAIT); 370 374 pti->tid = NULLHANDLE; 371 375 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.