]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/hfs/hfs_endian.c
xnu-517.tar.gz
[apple/xnu.git] / bsd / hfs / hfs_endian.c
index 47bb66a7f90d34d17011552e690ccf31522a7f63..c46c2295bcef358ac92ea68935569d8a3486c1bd 100644 (file)
@@ -358,10 +358,32 @@ hfs_swap_HFSPlusBTInternalNode (
             if (unswap) srcPtr[0] = SWAP_BE16 (srcPtr[0]);
         }
         
+    } else if (fileID > kHFSFirstUserCatalogNodeID) {
+               HotFileKey *srcKey;
+               UInt32 *srcRec;
+        
+               for (i = 0; i < srcDesc->numRecords; i++) {
+                       srcKey = (HotFileKey *)((char *)src->buffer + srcOffs[i]);
+
+                       if (!unswap)
+                               srcKey->keyLength = SWAP_BE16 (srcKey->keyLength);
+                       srcRec = (u_int32_t *)((char *)srcKey + srcKey->keyLength + 2);
+                       if (unswap)
+                               srcKey->keyLength = SWAP_BE16 (srcKey->keyLength);
+
+                       /* Don't swap srcKey->forkType */
+                       /* Don't swap srcKey->pad */
+
+                       srcKey->temperature = SWAP_BE32 (srcKey->temperature);
+                       srcKey->fileID = SWAP_BE32 (srcKey->fileID);
+             
+                       *((UInt32 *)srcRec) = SWAP_BE32 (*((UInt32 *)srcRec));
+               }
     } else {
         panic ("%s unrecognized B-Tree type", "hfs_swap_BTNode:");
     }
 
+
     return (0);
 }