home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 20.4 KB | 861 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFileSy.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef SLFILESY_H
- #include "SLFileSy.h"
- #endif
-
- #ifndef FWFILESP_H
- #include "FWFileSp.h"
- #endif
-
- #ifndef FWPRIDEB_H
- #include "FWPriDeb.h"
- #endif
-
- #ifndef FWEXCDEF_H
- #include "FWExcDef.h"
- #endif
-
- #ifndef FWSTRS_H
- #include "FWStrs.h"
- #endif
-
- #ifndef FWBNDSTR_H
- #include "FWBndStr.h"
- #endif
-
- #ifndef SLFILPAR_H
- #include "SLFilPar.h"
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__SCRIPT__)
- #include <Script.h>
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__FILES__)
- #include <Files.h>
- #endif
-
- #if defined(FW_BUILD_MAC) && !defined(__ERRORS__)
- #include <Errors.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(FWMEMMGR_H)
- #include "FWMemMgr.h"
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(__DIRECT_H)
- #include <direct.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(__DOS_H)
- #include <dos.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(__IO_H)
- #include <io.h>
- #endif
-
- #if defined(FW_BUILD_WIN) && !defined(__CTYPE_H)
- #include <ctype.h>
- #endif
-
- #ifdef FW_BUILD_WIN16
- extern "C" void FAR PASCAL DOS3Call(); // We don't do "int 21h" under Windows
- #endif
-
-
-
- //========================================================================================
- // Constants
- //========================================================================================
- #ifdef FW_BUILD_MAC
- #define FW_kMacVolumeIsSharedBitMask 0x00000200
- #endif
-
-
-
-
- //========================================================================================
- // Runtime type information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment FileSystem
- #endif
-
- #ifdef FW_BUILD_WIN16
- static FW_PlatformError privWinPrimitiveSetCurrentDir(const FW_Char* dirName, short driveNumber);
- static FW_PlatformError privWinPrimitiveDeleteDir(const FW_Char* dirName);
- static FW_PlatformError privWinPrimitiveCreateDir(const FW_Char* dirName);
- #endif
-
-
-
-
- //========================================================================================
- // FW_PrivFileSystem_
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_CreateFile
- //
- // Create the file specified by fileSpec.
- // On the Macintosh, the file is created as a TeachText text file by default. The user
- // can always change the file type using the FW_CAccessFileInfo helper class.
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_CreateFile(Environment* ev,
- FW_OFileSpecification* fileSpec,
- FW_Boolean overWriteExisting)
- {
- FW_SOM_TRY
- {
- FW_PlatformError theError = FW_xNoError;
-
- #ifdef FW_BUILD_WIN
- FW_CString fileName;
-
- fileSpec->GetFullPath(ev, fileName);
-
- char szFileName[_MAX_PATH];
- fileName.ExportCString(szFileName);
- #endif
-
- #ifdef FW_BUILD_WIN16
- FW_PlatformFileHandle fileHandle;
- OFSTRUCT Buffer;
-
- if (!overWriteExisting)
- {
- fileHandle = ::OpenFile(szFileName, &Buffer, OF_EXIST);
-
- if (fileHandle != FW_kInvalidAccessHandle)
- FW_Failure(FW_xFileExists);
- }
-
- fileHandle = ::OpenFile((LPCSTR)fileName, &Buffer, OF_CREATE);
- if (fileHandle == FW_kInvalidAccessHandle)
- theError = Buffer.nErrCode;
- else
- ::_lclose(fileHandle);
- #endif
-
- #ifdef FW_BUILD_WIN32
- FW_PlatformFileHandle fileHandle;
- long createMode = (overWriteExisting ? TRUNCATE_EXISTING | CREATE_NEW : CREATE_NEW);
-
- fileHandle = ::CreateFile(szFileName,
- GENERIC_READ | GENERIC_WRITE,
- 0,
- NULL,
- createMode,
- FILE_ATTRIBUTE_NORMAL,
- (HANDLE)NULL);
-
- if (fileHandle == FW_kInvalidAccessHandle)
- theError = ::GetLastError();
- #endif
-
- #ifdef FW_BUILD_MAC
- short fileHandle;
- FSSpec theMacSpec;
- OSType aFileType;
- OSType aCreatorType;
-
- fileSpec->MacGetFSSpec(ev, &theMacSpec);
- fileSpec->MacGetTypeAndCreator(ev, &aFileType, &aCreatorType);
-
- theError = ::FSpCreate(&theMacSpec, aCreatorType, aFileType, smSystemScript);
-
- if (overWriteExisting && (theError == FW_xFileExists))
- {
- theError = ::FSpOpenDF(&theMacSpec, FW_kReadWrite, &fileHandle);
- if (theError == FW_xNoError)
- {
- // Truncate the file. If an error occurs record it for throwing and close the file.
- theError = ::SetEOF(fileHandle, 0);
- if (theError == FW_xNoError)
- theError = ::FSClose(fileHandle);
- else
- ::FSClose(fileHandle);
- }
- }
- #endif
-
- FW_FailOnError(theError);
- }
- FW_SOM_CATCH
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_DeleteFile
- //
- // Delete the file specified by fileSpec. If the file does not exist, throw a
- // FW_XFileNotFound error containing a copy of the fileSpec.
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_DeleteFile(Environment* ev, FW_OFileSpecification* fileSpec)
- {
- FW_SOM_TRY
- {
- FW_PlatformError theError = FW_xNoError;
-
- #ifdef FW_BUILD_WIN
- FW_CString fileName;
-
- fileSpec->GetFullPath(ev, fileName);
-
- char szFileName[_MAX_PATH];
- fileName.ExportCString(szFileName);
- #endif
-
- #ifdef FW_BUILD_WIN16
- OFSTRUCT Buffer;
- if (::OpenFile(szFileName, &Buffer, OF_DELETE) == FW_kInvalidAccessHandle)
- theError = Buffer.nErrCode;
- #endif
-
- #ifdef FW_BUILD_WIN32
- if(!::DeleteFile(szFileName))
- theError = ::GetLastError();
- #endif
-
- #ifdef FW_BUILD_MAC
- FSSpec theMacSpec;
-
- fileSpec->MacGetFSSpec(ev, &theMacSpec);
- theError = ::FSpDelete(&theMacSpec);
- #endif
-
- FW_FailOnError(theError);
- }
- FW_SOM_CATCH
- }
-
-
- #ifdef FW_BUILD_WIN16
- //----------------------------------------------------------------------------------------
- // privWinPrimitiveCreateDir
- //----------------------------------------------------------------------------------------
- FW_PlatformError
- privWinPrimitiveCreateDir(const FW_Char* dirName)
- {
- FW_PlatformError theError = FW_xNoError;
-
- __asm {
- push ds
- lds dx, [dirName]
- mov ah, 39h
- }
-
- DOS3Call();
-
- __asm {
- pop ds
- jc _error
- xor ax, ax
- }
-
- _error:
-
- __asm {
- mov theError, ax
- }
-
- return (theError);
- }
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_CreateDirectory
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_CreateDirectory(Environment* ev, FW_ODirectorySpecification* directory)
- {
- FW_SOM_TRY
- {
- FW_PlatformError theError = FW_xNoError;
-
- #ifdef FW_BUILD_WIN
- FW_CString directoryName;
-
- // Get full path name and remove trailing delimiter.
- // This should always work since the directory can never be just the root path.
- directory->GetFullPath(ev, directoryName);
- if (directoryName.GetByteLength() > 0)
- directoryName.Truncate(directoryName.GetByteLength() - 1);
-
- char szDirectoryName[_MAX_PATH];
- directoryName.ExportCString(szDirectoryName);
- #endif
-
- #ifdef FW_BUILD_WIN16
- theError = privWinPrimitiveCreateDir(szDirectoryName);
- #endif
-
- #ifdef FW_BUILD_WIN32
- if(!::CreateDirectory(szDirectoryName, NULL))
- theError = ::GetLastError();
- #endif
-
- #ifdef FW_BUILD_MAC
- long directoryID;
- FSSpec macSpec;
-
- ((FW_ODirectorySpecification*)directory)->MacGetFSSpec(ev, &macSpec);
-
- theError = ::FSpDirCreate(&macSpec, smSystemScript, &directoryID);
- #endif
-
- FW_FailOnError(theError);
- }
- FW_SOM_CATCH
- }
-
-
- #ifdef FW_BUILD_WIN16
- //----------------------------------------------------------------------------------------
- // privWinPrimitiveDeleteDir
- //----------------------------------------------------------------------------------------
- FW_PlatformError
- privWinPrimitiveDeleteDir(const FW_Char* dirName)
- {
- FW_PlatformError theError = FW_xNoError;
-
- __asm {
- push ds
- lds dx, [dirName]
- mov ah, 3Ah
- }
-
- DOS3Call();
-
- __asm {
- pop ds
- jc _error
- xor ax, ax
- }
-
- _error:
-
- __asm {
- mov theError, ax
- }
-
- return(theError);
- }
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_DeleteDirectory
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_DeleteDirectory(Environment* ev, FW_ODirectorySpecification* directory)
- {
- FW_SOM_TRY
- {
- FW_PDirectorySpecification defaultDirectory;
-
- // if the directory we want to delete is the current directory, then we shouldn't
- // delete it.
- if (defaultDirectory == directory)
- FW_Failure(FW_xCantDeleteWorkingDirectory);
-
-
- FW_PlatformError theError = FW_xNoError;
- #ifdef FW_BUILD_WIN
- FW_CString directoryName;
-
- // Get full path name and remove trailing delimiter.
- // This should always work since the directory can never be just the root path.
- directory->GetFullPath(ev, directoryName);
- if (directoryName.GetByteLength() > 0)
- directoryName.Truncate(directoryName.GetByteLength()-1);
-
- char szDirectoryName[_MAX_PATH];
- directoryName.ExportCString(szDirectoryName);
- #endif
-
- #ifdef FW_BUILD_WIN16
- theError = privWinPrimitiveDeleteDir(szDirectoryName);
- #endif
-
- #ifdef FW_BUILD_WIN32
- if(!::RemoveDirectory(szDirectoryName))
- theError = ::GetLastError();
- #endif
-
- #ifdef FW_BUILD_MAC
- FSSpec macSpec;
- ((FW_ODirectorySpecification*)directory)->MacGetFSSpec(ev, &macSpec);
-
- theError = ::FSpDelete(&macSpec);
- #endif
-
- FW_FailOnError(theError);
- }
- FW_SOM_CATCH
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_GetCurrentDirectory
- //
- // Returns the current working directory in directory.
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_GetCurrentDirectory(Environment* ev, FW_ODirectorySpecification* directory)
- {
- FW_SOM_TRY
- {
- FW_PlatformError theError = FW_xNoError;
-
- #ifdef FW_BUILD_WIN
- FW_CString directoryName;
-
- theError = FW_PrivFileSystemParser_PrivGetWorkingDirectory(directoryName);
- FW_FailOnError(theError);
- directory->AssignFileName(ev, directoryName);
- #endif
-
-
- #ifdef FW_BUILD_MAC
- FSSpec directoryName;
-
- // Workaround for MPW Shell 3.3 bug when passing 0, 0, NULL to FSMakeFSSpec.
- Str32 nullName = "\p";
- theError = ::FSMakeFSSpec(0, 0, nullName, &directoryName);
- FW_FailOnError(theError);
- directory->AssignFileSpec(ev, &directoryName);
- #endif
- }
- FW_SOM_CATCH
- }
-
-
- #ifdef FW_BUILD_WIN16
- //----------------------------------------------------------------------------------------
- // privWinPrimitiveSetCurrentDir
- //
- // driveNumber should be a number from 0 to 25 where drive A=0, B=1, C=2, etc.
- //----------------------------------------------------------------------------------------
- FW_PlatformError
- privWinPrimitiveSetCurrentDir(const FW_Char* dirName, short driveNumber)
- {
- FW_PlatformError theError = FW_xNoError;
-
- __asm {
- mov dx, driveNumber
- mov ah, 0Eh
- }
-
- DOS3Call();
-
- // Now, set the directory.
- __asm {
- push ds
- lds dx, [dirName]
- mov ah, 3Bh
- }
-
- DOS3Call();
-
- __asm {
- pop ds
- jc _error
- xor ax, ax
- }
-
- _error:
-
- __asm {
- mov theError, ax
- }
-
- return (theError);
- }
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_SetCurrentDirectory
- //
- // Sets the default working directory for the application. This also sets the directory
- // that appears in the standard file package when an SFP dialog is displayed.
- //----------------------------------------------------------------------------------------
-
- void SL_API
- FW_PrivFileSystem_SetCurrentDirectory(Environment* ev, FW_ODirectorySpecification* directory)
- {
- FW_SOM_TRY
- {
- FW_PlatformError theError = FW_xNoError;
-
- if (!FW_PrivFileSystem_IsValidDirectory(ev, directory))
- FW_Failure(FW_xInvalidDirectory);
-
- #ifdef FW_BUILD_WIN
- FW_CString directoryName;
-
- // Get the pathname without the trailing delimiter character.
- directory->GetFullPath(ev, directoryName);
- if (directoryName.GetByteLength() > 0)
- directoryName.Truncate(directoryName.GetByteLength() - 1);
-
- char szDirectoryName[_MAX_PATH];
- directoryName.ExportCString(szDirectoryName);
- #endif
-
- #ifdef FW_BUILD_WIN16
- // Set drive first
- short driveNumber = directory.WinGetDrive() - (FW_Char)('a');
- theError = privWinPrimitiveSetCurrentDir(szDirectoryName, driveNumber);
- #endif
-
- #ifdef FW_BUILD_WIN32
- if(!::SetCurrentDirectory(szDirectoryName))
- theError = ::GetLastError();
- #endif
-
- #ifdef FW_BUILD_MAC
- FSSpec macSpec;
-
- ((FW_ODirectorySpecification*)directory)->MacGetFSSpec(ev, &macSpec);
- theError = ::HSetVol(macSpec.name, macSpec.vRefNum, macSpec.parID);
- #endif
-
- FW_FailOnError(theError);
- }
- FW_SOM_CATCH
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_IsValidDirectory
- //
- // Given a fully qualified or partial pathname specified in directoryName, IsValidDirectory
- // will return TRUE if the directory exists. If the directory or drive doesn't exist,
- // IsValidDirectory will return FALSE.
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API
- FW_PrivFileSystem_IsValidDirectory(Environment* ev, FW_ODirectorySpecification* directory)
- {
- FW_Boolean result = FALSE;
-
- FW_SOM_TRY
- {
- #ifdef FW_BUILD_WIN
- FW_TRY
- {
- FW_CString pathName;
-
- directory->GetFullPath(ev, pathName);
- if (pathName.GetByteLength() > 0)
- pathName.Truncate(pathName.GetByteLength() - 1);
-
- result = FW_PrivFileSystem_WinPathExists(ev, pathName);
- }
- FW_CATCH_BEGIN
- FW_CATCH_NO_INSTANCE(FW_XException)
- {
- result = FALSE;
- }
- FW_CATCH_EVERYTHING()
- {
- FW_THROW_SAME();
- }
- FW_CATCH_END
- #endif
-
-
- #ifdef FW_BUILD_MAC
- FSSpec theSpec;
- OSErr theError = FW_xNoError;
-
- ((FW_ODirectorySpecification*)directory)->MacGetFSSpec(ev, &theSpec);
-
- // Try and make an FSSpec out of the directory. If any error is returned, the
- // directory cannot exist.
- theError = ::FSMakeFSSpec(theSpec.vRefNum,
- theSpec.parID,
- (StringPtr)&(theSpec.name),
- &theSpec);
- if (theError == FW_xNoError)
- result = TRUE;
- #endif
- }
- FW_SOM_CATCH
-
- return (result);
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_IsValidDrive
- //
- // Given a drive name specified in driveName, IsValidDrive will return TRUE if the drive
- // letter is used. For removeable media drives, there may not be anything in the drive,
- // but the drive could still be valid.
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API
- FW_PrivFileSystem_IsValidDrive(Environment* ev, FW_HString driveNameRep)
- {
- FW_Boolean result = FALSE;
-
- FW_SOM_TRY
- {
- FW_CString driveName(driveNameRep);
- #ifdef FW_BUILD_WIN
- FW_TRY
- {
- if (driveName.GetByteLength() != 0)
- {
- int driveType = 0;
- FW_CString32 strTemp(driveName);
-
- if (FW_PrivFileSystemParser_WinGetDrivePath(driveName, strTemp))
- {
- strTemp.ToLower();
- if ((strTemp.GetByteLength() > 1) && (strTemp[(FW_CharacterPosition)1] == FW_kDriveDelimiter))
- {
-
- #ifdef FW_BUILD_WIN16
- FW_Char dwDriveID = strTemp[0];
- driveType = ::GetDriveType((int)dwDriveID - (int)('a'));
- #endif
-
-
- #ifdef FW_BUILD_WIN32
- strTemp += FW_kPathDelimiter;
- char szTemp[_MAX_PATH];
- strTemp.ExportCString(szTemp);
- driveType = ::GetDriveType(szTemp);
- #endif
-
- // A result of 0 or 1 indicates the drive didn't exist. Otherwise
- // the return result is the type of the drive.
- if (driveType > 1)
- result = TRUE;
- }
- }
- }
- }
- FW_CATCH_BEGIN
- FW_CATCH_NO_INSTANCE(FW_XException)
- {
- result = FALSE;
- }
- FW_CATCH_EVERYTHING()
- {
- FW_THROW_SAME();
- }
- FW_CATCH_END
-
- #endif
-
- #ifdef FW_BUILD_MAC
- short defaultVolumeRefNum = 0;
-
- FW_CString32 newDriveName = driveName;
- Str32 macDriveString;
-
- FW_CharacterPosition pathSeparator = 0;
- OSErr theError = FW_xNoError;
-
- // The last character in the string should be a Mac path separator.
- if (newDriveName.FindCharacter(FW_kPathDelimiter, pathSeparator))
- newDriveName.Truncate(pathSeparator + 1);
- else
- newDriveName += FW_kPathDelimiter;
-
- newDriveName.ExportPascal((FW_PascalChar*)&macDriveString);
-
- // Save the default volume and then attempt to set the default volume to
- // driveName. Any errors indicates that the drive doesn't exist.
- theError = ::GetVol(NULL, &defaultVolumeRefNum);
- if (theError == FW_xNoError)
- {
- // Use a non-negative, non-zero number for an invalid drive.
- theError = ::SetVol(macDriveString, 1);
-
- // Restore the default volume.
- ::SetVol(NULL, defaultVolumeRefNum);
-
- if (theError == FW_xNoError)
- result = TRUE;
- }
- #endif
- }
- FW_SOM_CATCH
-
- return (result);
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_IsValidFile
- //
- // Return TRUE if the file exists.
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API
- FW_PrivFileSystem_IsValidFile(Environment* ev, FW_OFileSpecification* theFile)
- {
- FW_Boolean result = FALSE;
-
- FW_SOM_TRY
- {
- #ifdef FW_BUILD_WIN
- FW_CString fileName;
- FW_TRY
- {
- theFile->GetFullPath(ev, fileName);
-
- char szFileName[_MAX_PATH];
- fileName.ExportCString(szFileName);
-
- #ifdef FW_BUILD_WIN16
- FW_PlatformFileHandle fileHandle;
- OFSTRUCT Buffer;
-
- fileHandle = ::OpenFile(szFileName, &Buffer, OF_EXIST);
- if (fileHandle != FW_kInvalidAccessHandle)
- result = TRUE;
- #endif
-
- #ifdef FW_BUILD_WIN32
- long fileAttributes = 0;
-
- fileAttributes = ::GetFileAttributes(szFileName);
- if (fileAttributes != (-1))
- if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- result = TRUE;
- #endif
-
- }
- FW_CATCH_BEGIN
- FW_CATCH_EVERYTHING()
- {
- result = FALSE;
- }
- FW_CATCH_END
- #endif
-
- #ifdef FW_BUILD_MAC
- FSSpec macSpec;
- OSErr theError;
-
- theFile->MacGetFSSpec(ev, &macSpec);
- theError = ::FSMakeFSSpec(macSpec.vRefNum, macSpec.parID, macSpec.name, &macSpec);
- if (theError == noErr)
- result = TRUE;
- #endif
- }
- FW_SOM_CATCH
-
- return (result);
- }
-
-
- #ifdef FW_BUILD_WIN
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_WinPathExists
- //
- // Return TRUE if the directory exists.
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API
- FW_PrivFileSystem_WinPathExists(Environment* ev, FW_HString pathNameRep)
- {
- FW_Boolean result = FALSE;
-
- FW_SOM_TRY
- {
- FW_CString pathName(pathNameRep);
-
- #ifdef FW_BUILD_WIN16
- FW_CString saveDirectory;
-
- FW_PrivFileSystemParser_PrivGetWorkingDirectory(saveDirectory);
- const FW_Char* namePtr = (const FW_Char*)pathName;
- short validDir = ::chdir((FW_Char*)namePtr);
- if (validDir == 0)
- result = TRUE;
-
- // Restore original directory.
- namePtr = (const FW_Char*)saveDirectory;
- ::chdir((FW_Char*)namePtr);
- #endif
-
- #ifdef FW_BUILD_WIN32
- long fileAttributes = 0;
-
- char szFileName[_MAX_PATH];
- pathName.ExportCString(szFileName);
-
- fileAttributes = ::GetFileAttributes(szFileName);
- if (fileAttributes != (-1))
- if (fileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- result = TRUE;
- #endif
- }
- FW_SOM_CATCH
-
- return (result);
- }
- #endif
-
-
- #ifdef FW_BUILD_MAC
- //----------------------------------------------------------------------------------------
- // FW_PrivFileSystem_MacIsVolumeShared
- //
- // Return TRUE if the volume specified by volumeRefNum is currently a shared volume.
- //----------------------------------------------------------------------------------------
-
- FW_Boolean SL_API
- FW_PrivFileSystem_MacIsVolumeShared(Environment* ev, short volumeRefNum)
- {
- // No try block necessary - Do not throw
- FW_UNUSED(ev);
- FW_Boolean result = FALSE;
- HParamBlockRec paramBlock;
- GetVolParmsInfoBuffer volInfoBuffer;
- FW_PlatformError theError = FW_xNoError;
-
- paramBlock.ioParam.ioNamePtr = NULL;
- paramBlock.ioParam.ioVRefNum = volumeRefNum;
- paramBlock.ioParam.ioBuffer = (Ptr)&volInfoBuffer;
- paramBlock.ioParam.ioReqCount = sizeof(volInfoBuffer);
-
- theError = PBHGetVolParmsSync(¶mBlock);
- if (theError == FW_xNoError)
- {
- if (volInfoBuffer.vMAttrib & FW_kMacVolumeIsSharedBitMask)
- result = TRUE;
- }
-
- return (result);
- }
- #endif
-