Changeset 140 for trunk/src/helpers/wphandle.c
- Timestamp:
- Feb 9, 2002, 6:48:12 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/wphandle.c
r129 r140 260 260 /* 261 261 *@@ wphRebuildNodeHashTable: 262 * builds all the complex cache trees in the 263 * given handles buffer. 264 * 265 * If (fQuitOnErrors == TRUE), we'll fail as 266 * soon as an invalid handle is found. Otherwise 267 * we will try to continue if the error is not fatal. 262 268 * 263 269 * Returns: … … 269 275 * -- ERROR_WPH_CORRUPT_HANDLES_DATA 270 276 * 277 * -- ERROR_WPH_DRIV_TREEINSERT_FAILED: duplicate DRIV node 278 * (non-fatal) 279 * 271 280 *@@added V0.9.16 (2001-10-02) [umoeller] 272 */ 273 274 APIRET wphRebuildNodeHashTable(HHANDLES hHandles) 281 *@@changted V0.9.17 (2002-02-05) [umoeller]: added fQuitOnErrors 282 */ 283 284 APIRET wphRebuildNodeHashTable(HHANDLES hHandles, 285 BOOL fQuitOnErrors) 275 286 { 276 287 APIRET arc = NO_ERROR; … … 322 333 (TREE*)pLastDriveTreeNode, 323 334 treeCompareStrings)) 324 arc = ERROR_WPH_DRIV_TREEINSERT_FAILED; 335 if (fQuitOnErrors) 336 arc = ERROR_WPH_DRIV_TREEINSERT_FAILED; 325 337 } 326 338 … … 355 367 PNODETREENODE pParent; 356 368 if (!(pParent = pHandlesBuf->NodeHashTable[pNode->usParentHandle])) 369 { 357 370 // this parent handle is invalid: 358 arc = ERROR_WPH_INVALID_PARENT_HANDLE; 371 if (fQuitOnErrors) 372 arc = ERROR_WPH_INVALID_PARENT_HANDLE; 373 } 359 374 else 360 375 { … … 372 387 } 373 388 else 374 arc = ERROR_WPH_NODE_BEFORE_DRIV; 375 376 if (!arc) 389 if (fQuitOnErrors) 390 arc = ERROR_WPH_NODE_BEFORE_DRIV; 391 392 if (ppTree && pcChildren) 377 393 if (!treeInsert(ppTree, 378 394 pcChildren, 379 395 (TREE*)pNew, 380 396 treeCompareStrings)) 397 { 381 398 // store PNODE in hash table 382 399 pHandlesBuf->NodeHashTable[pNode->usHandle] = pNew; 400 // do not free 401 pNew = NULL; 402 } 383 403 else 384 404 ; … … 387 407 // arc = ERROR_WPH_NODE_TREEINSERT_FAILED; 388 408 389 if ( arc)409 if (pNew) 390 410 free(pNew); 391 411 … … 641 661 // rebuild cache 642 662 if (!pHandlesBuf->fCacheValid) 643 arc = wphRebuildNodeHashTable(hHandles); 663 arc = wphRebuildNodeHashTable(hHandles, 664 TRUE); // fail on errors 644 665 645 666 if (!arc) … … 922 943 { 923 944 if (!pHandlesBuf->fCacheValid) 924 arc = wphRebuildNodeHashTable(hHandles); 945 arc = wphRebuildNodeHashTable(hHandles, 946 TRUE); // fail on errors 925 947 926 948 if (!arc)
Note:
See TracChangeset
for help on using the changeset viewer.