65 |
|
fsHFSProcStub = 6, |
66 |
|
fsDrvStatus = 12, // Drive Status record |
67 |
|
fsFSD = 42, // File system descriptor |
68 |
< |
fsPB = 238, // IOParam (for mounting) |
68 |
> |
fsPB = 238, // IOParam (for mounting and renaming) |
69 |
|
fsVMI = 288, // VoumeMountInfoHeader (for mounting) |
70 |
|
fsParseRec = 296, // ParsePathRec struct |
71 |
|
fsReturn = 306, // Area for return data of 68k routines |
604 |
|
WriteMacInt16(fs_data + fsFSD + fsdLength, SIZEOF_FSDRec); |
605 |
|
WriteMacInt16(fs_data + fsFSD + fsdVersion, fsdVersion1); |
606 |
|
WriteMacInt16(fs_data + fsFSD + fileSystemFSID, MY_FSID); |
607 |
< |
memcpy(Mac2HostAddr(fs_data + fsFSD + fileSystemName), FS_NAME, 32); |
607 |
> |
Host2Mac_memcpy(fs_data + fsFSD + fileSystemName, FS_NAME, 32); |
608 |
|
WriteMacInt32(fs_data + fsFSD + fileSystemCommProc, fs_data + fsCommProcStub); |
609 |
|
WriteMacInt32(fs_data + fsFSD + fsdHFSCI + compInterfProc, fs_data + fsHFSProcStub); |
610 |
|
WriteMacInt32(fs_data + fsFSD + fsdHFSCI + stackTop, fs_stack + STACK_SIZE); |
658 |
|
|
659 |
|
case ffsGetIconMessage: { // Get disk/drive icon |
660 |
|
if (ReadMacInt8(paramBlock + iconType) == kLargeIcon && ReadMacInt32(paramBlock + requestSize) >= sizeof(ExtFSIcon)) { |
661 |
< |
memcpy(Mac2HostAddr(ReadMacInt32(paramBlock + iconBufferPtr)), ExtFSIcon, sizeof(ExtFSIcon)); |
661 |
> |
Host2Mac_memcpy(ReadMacInt32(paramBlock + iconBufferPtr), ExtFSIcon, sizeof(ExtFSIcon)); |
662 |
|
WriteMacInt32(paramBlock + actualSize, sizeof(ExtFSIcon)); |
663 |
|
return noErr; |
664 |
|
} else |
969 |
|
WriteMacInt32(vcb + vcbClpSiz, 1024); |
970 |
|
WriteMacInt32(vcb + vcbNxtCNID, next_cnid); |
971 |
|
WriteMacInt16(vcb + vcbFreeBks, 0xffff); //!! |
972 |
< |
memcpy(Mac2HostAddr(vcb + vcbVN), VOLUME_NAME, 28); |
972 |
> |
Host2Mac_memcpy(vcb + vcbVN, VOLUME_NAME, 28); |
973 |
|
WriteMacInt16(vcb + vcbFSID, MY_FSID); |
974 |
|
WriteMacInt32(vcb + vcbFilCnt, 1); //!! |
975 |
|
WriteMacInt32(vcb + vcbDirCnt, 1); //!! |
1043 |
|
WriteMacInt32(pb + ioVWrCnt, 0); |
1044 |
|
WriteMacInt32(pb + ioVFilCnt, 1); //!! |
1045 |
|
WriteMacInt32(pb + ioVDirCnt, 1); //!! |
1046 |
< |
memset(Mac2HostAddr(pb + ioVFndrInfo), 0, 32); |
1046 |
> |
Mac_memset(pb + ioVFndrInfo, 0, 32); |
1047 |
|
} |
1048 |
|
return noErr; |
1049 |
|
} |
1073 |
|
uint32 actual = ReadMacInt32(pb + ioReqCount); |
1074 |
|
if (actual > sizeof(vol)) |
1075 |
|
actual = sizeof(vol); |
1076 |
< |
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioBuffer)), vol, actual); |
1076 |
> |
Host2Mac_memcpy(ReadMacInt32(pb + ioBuffer), vol, actual); |
1077 |
|
WriteMacInt32(pb + ioActCount, actual); |
1078 |
|
return noErr; |
1079 |
|
} |
1218 |
|
#endif |
1219 |
|
WriteMacInt32(pb + ioFlMdDat, st.st_mtime + TIME_OFFSET); |
1220 |
|
|
1221 |
< |
memset(Mac2HostAddr(pb + ioFlFndrInfo), 0, SIZEOF_FInfo); |
1221 |
> |
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo); |
1222 |
|
uint32 type, creator; // pb may point to kernel space, but stack is switched |
1223 |
|
get_finder_type(full_path, type, creator); |
1224 |
|
WriteMacInt32(pb + ioFlFndrInfo + fdType, type); |
1237 |
|
|
1238 |
|
if (hfs) { |
1239 |
|
WriteMacInt32(pb + ioFlBkDat, 0); |
1240 |
< |
memset(Mac2HostAddr(pb + ioFlXFndrInfo), 0, SIZEOF_FXInfo); |
1240 |
> |
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo); |
1241 |
|
WriteMacInt32(pb + ioFlParID, fs_item->parent_id); |
1242 |
|
WriteMacInt32(pb + ioFlClpSiz, 0); |
1243 |
|
} |
1355 |
|
WriteMacInt32(pb + ioFlMdDat, mtime); |
1356 |
|
WriteMacInt32(pb + ioFlBkDat, 0); |
1357 |
|
if (S_ISDIR(st.st_mode)) { |
1358 |
< |
memset(Mac2HostAddr(pb + ioDrUsrWds), 0, SIZEOF_DInfo); |
1359 |
< |
memset(Mac2HostAddr(pb + ioDrFndrInfo), 0, SIZEOF_DXInfo); |
1358 |
> |
Mac_memset(pb + ioDrUsrWds, 0, SIZEOF_DInfo); |
1359 |
> |
Mac_memset(pb + ioDrFndrInfo, 0, SIZEOF_DXInfo); |
1360 |
|
uint16 fflags; // pb may point to kernel space, but stack is switched |
1361 |
|
get_finder_flags(full_path, fflags); |
1362 |
|
WriteMacInt16(pb + ioDrUsrWds + frFlags, fflags); |
1382 |
|
} |
1383 |
|
WriteMacInt16(pb + ioDrNmFls, count); |
1384 |
|
} else { |
1385 |
< |
memset(Mac2HostAddr(pb + ioFlFndrInfo), 0, SIZEOF_FInfo); |
1386 |
< |
memset(Mac2HostAddr(pb + ioFlXFndrInfo), 0, SIZEOF_FXInfo); |
1385 |
> |
Mac_memset(pb + ioFlFndrInfo, 0, SIZEOF_FInfo); |
1386 |
> |
Mac_memset(pb + ioFlXFndrInfo, 0, SIZEOF_FXInfo); |
1387 |
|
uint32 type, creator; // pb may point to kernel space, but stack is switched |
1388 |
|
get_finder_type(full_path, type, creator); |
1389 |
|
WriteMacInt32(pb + ioFlFndrInfo + fdType, type); |
1852 |
|
return dupFNErr; |
1853 |
|
|
1854 |
|
// Create file |
1855 |
< |
int fd = creat(full_path, 0664); |
1855 |
> |
int fd = creat(full_path, 0666); |
1856 |
|
if (fd < 0) |
1857 |
|
return errno2oserr(); |
1858 |
|
else { |
1877 |
|
return dupFNErr; |
1878 |
|
|
1879 |
|
// Create directory |
1880 |
< |
if (mkdir(full_path, 0775) < 0) |
1880 |
> |
if (mkdir(full_path, 0777) < 0) |
1881 |
|
return errno2oserr(); |
1882 |
|
else { |
1883 |
|
WriteMacInt32(pb + ioDirID, fs_item->id); |
1926 |
|
strcpy(old_path, full_path); |
1927 |
|
|
1928 |
|
// Find path for new name |
1929 |
< |
uint8 new_pb[SIZEOF_IOParam]; |
1930 |
< |
memcpy(new_pb, Mac2HostAddr(pb), SIZEOF_IOParam); |
1931 |
< |
WriteMacInt32((uint32)new_pb + ioNamePtr, ReadMacInt32(pb + ioMisc)); |
1929 |
> |
Mac2Mac_memcpy(fs_data + fsPB, pb, SIZEOF_IOParam); |
1930 |
> |
WriteMacInt32(fs_data + fsPB + ioNamePtr, ReadMacInt32(pb + ioMisc)); |
1931 |
|
FSItem *new_item; |
1932 |
< |
result = get_item_and_path((uint32)new_pb, dirID, new_item); |
1932 |
> |
result = get_item_and_path(fs_data + fsPB, dirID, new_item); |
1933 |
|
if (result != noErr) |
1934 |
|
return result; |
1935 |
|
|
1966 |
|
strcpy(old_path, full_path); |
1967 |
|
|
1968 |
|
// Find path for new directory |
1969 |
< |
uint8 new_pb[SIZEOF_IOParam]; |
1970 |
< |
memcpy(new_pb, Mac2HostAddr(pb), SIZEOF_IOParam); |
1972 |
< |
WriteMacInt32((uint32)new_pb + ioNamePtr, ReadMacInt32(pb + ioNewName)); |
1969 |
> |
Mac2Host_memcpy(fs_data + fsPB, pb, SIZEOF_IOParam); |
1970 |
> |
WriteMacInt32(fs_data + fsPB + ioNamePtr, ReadMacInt32(pb + ioNewName)); |
1971 |
|
FSItem *new_dir_item; |
1972 |
< |
result = get_item_and_path((uint32)new_pb, ReadMacInt32(pb + ioNewDirID), new_dir_item); |
1972 |
> |
result = get_item_and_path(fs_data + fsPB, ReadMacInt32(pb + ioNewDirID), new_dir_item); |
1973 |
|
if (result != noErr) |
1974 |
|
return result; |
1975 |
|
|
2035 |
|
WriteMacInt32(pb + ioWDProcID, 0); |
2036 |
|
WriteMacInt16(pb + ioWDVRefNum, ReadMacInt16(vcb + vcbVRefNum)); |
2037 |
|
if (ReadMacInt32(pb + ioNamePtr)) |
2038 |
< |
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), Mac2HostAddr(vcb + vcbVN), 28); |
2038 |
> |
Mac2Mac_memcpy(ReadMacInt32(pb + ioNamePtr), vcb + vcbVN, 28); |
2039 |
|
WriteMacInt32(pb + ioWDDirID, ROOT_ID); |
2040 |
|
return noErr; |
2041 |
|
} |
2056 |
|
WriteMacInt16(pb + ioWDProcID, ReadMacInt32(wdcb + wdProcID)); |
2057 |
|
WriteMacInt16(pb + ioWDVRefNum, ReadMacInt16(ReadMacInt32(wdcb + wdVCBPtr) + vcbVRefNum)); |
2058 |
|
if (ReadMacInt32(pb + ioNamePtr)) |
2059 |
< |
memcpy(Mac2HostAddr(ReadMacInt32(pb + ioNamePtr)), Mac2HostAddr(ReadMacInt32(wdcb + wdVCBPtr) + vcbVN), 28); |
2059 |
> |
Mac2Mac_memcpy(ReadMacInt32(pb + ioNamePtr), ReadMacInt32(wdcb + wdVCBPtr) + vcbVN, 28); |
2060 |
|
WriteMacInt32(pb + ioWDDirID, ReadMacInt32(wdcb + wdDirID)); |
2061 |
|
return noErr; |
2062 |
|
} |