Changeset 912 for trunk/dll/inis.c
- Timestamp:
- Jan 9, 2008, 7:27:26 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/inis.c
r907 r912 5 5 6 6 Copyright (c) 1993-98 M. Kimes 7 Copyright (c) 2004, 200 7Steven H. Levine7 Copyright (c) 2004, 2008 Steven H. Levine 8 8 9 9 01 Aug 04 SHL Rework lstrip/rstrip usage … … 21 21 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 22 22 16 Nov 07 SHL Ensure fixup buffer sufficiently large 23 09 Jan 08 SHL Avoid closing INI more times than opened 24 09 Jan 08 SHL Add some missing error reporting 25 09 Jan 08 SHL Standardize PrfOpenProfile return checks 23 26 24 27 ***********************************************************************/ … … 95 98 HAB hab2; 96 99 HMQ hmq2; 97 HINI hini1 = (HINI) 0, hini2 = (HINI) 0; 100 HINI hini1 = NULLHANDLE; 101 HINI hini2 = NULLHANDLE; 98 102 PRFPROFILE cprfp; 99 103 CHAR userini[CCHMAXPATH], sysini[CCHMAXPATH]; … … 122 126 hini2 = HINI_SYSTEMPROFILE; 123 127 } 124 if ( !hini1)128 if (hini1 == NULLHANDLE) { 125 129 hini1 = PrfOpenProfile(hab2, inirec->filename1); 126 if (!hini2) { 130 if (hini1 == NULLHANDLE) { 131 Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 132 "PrfOpenProfile failed for %s", inirec->filename1); 133 } 134 } 135 if (hini2 == NULLHANDLE) { 127 136 if (!stricmp(inirec->filename1, inirec->filename2)) 128 137 hini2 = hini1; 129 else 138 else { 130 139 hini2 = PrfOpenProfile(hab2, inirec->filename2); 140 if (hini2 == NULLHANDLE) { 141 Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 142 "PrfOpenProfile failed for %s", inirec->filename2); 143 } 144 } 131 145 } 132 146 if (hini1 && hini2 && (*inirec->app2 || hini1 != hini2)) { … … 243 257 if (hini1) 244 258 PrfCloseProfile(hini1); 245 if (hini2 )259 if (hini2 && hini2 != hini1) 246 260 PrfCloseProfile(hini2); 247 261 WinDestroyMsgQueue(hmq2); … … 290 304 HAB hab2; 291 305 HMQ hmq2; 292 HINI orig = (HINI) 0, new; 306 HINI orig = NULLHANDLE; 307 HINI new; 293 308 PVOID pDataA, pDataK, pData; 294 309 PBYTE pCurrentA, pCurrentK; … … 316 331 orig = HINI_SYSTEMPROFILE; 317 332 } 318 if ( !orig)333 if (orig == NULLHANDLE) 319 334 orig = PrfOpenProfile(hab2, prfp->pszUserName); 320 if (orig) { 335 if (orig == NULLHANDLE) { 336 Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 337 "PrfOpenProfile failed for %s", prfp->pszUserName); 338 } 339 else { 321 340 new = PrfOpenProfile(hab2, prfp->pszSysName); 322 if (new) { 341 if (new == NULLHANDLE) { 342 Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 343 "PrfOpenProfile failed for %s", prfp->pszSysName); 344 } 345 else { 323 346 if (PrfQueryProfileSize(orig, NULL, NULL, (PULONG) & ulSize) 324 347 && ulSize) { … … 921 944 WinQueryDlgItemText(hwnd, INIR_SYSTEMPROFILE, CCHMAXPATH, sysini); 922 945 testini = PrfOpenProfile(WinQueryAnchorBlock(hwnd), userini); 923 if ( !testini) {946 if (testini == NULLHANDLE) { 924 947 saymsg(MB_CANCEL, 925 948 hwnd, … … 930 953 PrfCloseProfile(testini); 931 954 testini = PrfOpenProfile(WinQueryAnchorBlock(hwnd), sysini); 932 if ( !testini) {955 if (testini == NULLHANDLE) { 933 956 saymsg(MB_CANCEL, 934 957 hwnd, … … 1054 1077 MakeFullName(sysini); 1055 1078 testini = PrfOpenProfile(WinQueryAnchorBlock(hwnd), userini); 1056 if ( !testini) {1079 if (testini == NULLHANDLE) { 1057 1080 saymsg(MB_CANCEL, 1058 1081 hwnd, … … 1063 1086 PrfCloseProfile(testini); 1064 1087 testini = PrfOpenProfile(WinQueryAnchorBlock(hwnd), sysini); 1065 if ( !testini) {1088 if (testini == NULLHANDLE) { 1066 1089 saymsg(MB_CANCEL, 1067 1090 hwnd, … … 1430 1453 return (HWND) 0; 1431 1454 hINI = PrfOpenProfile(useHab, filename); 1432 if ( !hINI) {1455 if (hINI == NULLHANDLE) { 1433 1456 free(filename); 1434 1457 return (HWND) 0; … … 1979 2002 else 1980 2003 inidata->hini = HINI_USERPROFILE; 1981 if (!inidata->hini) { 2004 if (inidata->hini == NULLHANDLE) { 2005 Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__, 2006 "PrfOpenProfile failed for %s", inidata->ininame); 1982 2007 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 1983 2008 break; … … 2515 2540 !DosQueryPathInfo(filename, FIL_STANDARD, &fsa, sizeof(fsa))) { 2516 2541 hINI = PrfOpenProfile(WinQueryAnchorBlock(hwnd), filename); 2517 if ( !hINI) {2542 if (hINI == NULLHANDLE) { 2518 2543 Win_Error(hwnd, hwnd, __FILE__, __LINE__, 2519 2544 GetPString(IDS_INICANTOPENINITEXT), filename);
Note:
See TracChangeset
for help on using the changeset viewer.