- // Make sure this is a valid node
- if ( CheckNode( scanState->btcb, scanState->currentNodePtr ) != noErr )
- {
+ /* Fake a BlockDescriptor */
+ block.blockHeader = NULL; /* No buffer cache buffer */
+ block.buffer = scanState->currentNodePtr;
+ block.blockNum = scanState->nodeNum;
+ block.blockSize = scanState->btcb->nodeSize;
+ block.blockReadFromDisk = 1;
+ block.isModified = 0;
+
+ fref = scanState->btcb->fileRefNum;
+
+ /* This node was read from disk, so it must be swapped/checked. */
+ err = hfs_swap_BTNode(&block, fref, kSwapBTNodeBigToHost);
+ if ( err != noErr ) {
+ printf("FindNextLeafNode: Error from hfs_swap_BTNode (node %u)\n", scanState->nodeNum);