diff --git a/SharpPhysFS/Interop.cs b/SharpPhysFS/Interop.cs index 6ddc2b0..c962830 100644 --- a/SharpPhysFS/Interop.cs +++ b/SharpPhysFS/Interop.cs @@ -106,8 +106,6 @@ namespace PhysFS [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate IntPtr FnGetLastError(); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate string FnGetDirSeparator(); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void FnPermitSymbolicLinks(int permit); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int FnSetWriteDir(string s); @@ -116,8 +114,6 @@ namespace PhysFS [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int FnSetSaneConfig(string s1, string s2, string s3, int i1, int i2); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate string FnGetRealDir(string s); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate IntPtr FnEnumerateFiles(string s); [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate long FnGetLastModTime(string s); @@ -144,12 +140,12 @@ namespace PhysFS public static FnSupportedArchiveTypes PHYSFS_supportedArchiveTypes; public static FnFreeList PHYSFS_freeList; public static FnGetLastError PHYSFS_getLastError; - public static FnGetDirSeparator PHYSFS_getDirSeparator; + public static FnGetLastError PHYSFS_getDirSeparator; public static FnPermitSymbolicLinks PHYSFS_permitSymbolicLinks; public static FnSupportedArchiveTypes PHYSFS_getCdRomDirs; - public static FnGetDirSeparator PHYSFS_getBaseDir; - public static FnGetDirSeparator PHYSFS_getUserDir; - public static FnGetDirSeparator PHYSFS_getWriteDir; + public static FnGetLastError PHYSFS_getBaseDir; + public static FnGetLastError PHYSFS_getUserDir; + public static FnGetLastError PHYSFS_getWriteDir; public static FnSetWriteDir PHYSFS_setWriteDir; public static FnAddToSearchPath PHYSFS_addToSearchPath; public static FnSetWriteDir PHYSFS_removeFromSearchPath; @@ -157,7 +153,7 @@ namespace PhysFS public static FnSetSaneConfig PHYSFS_setSaneConfig; public static FnSetWriteDir PHYSFS_mkdir; public static FnSetWriteDir PHYSFS_delete; - public static FnGetRealDir PHYSFS_getRealDir; + public static FnEnumerateFiles PHYSFS_getRealDir; public static FnEnumerateFiles PHYSFS_enumerateFiles; public static FnSetWriteDir PHYSFS_exists; public static FnSetWriteDir PHYSFS_isDirectory; @@ -179,7 +175,7 @@ namespace PhysFS public static FnDeinit PHYSFS_symbolicLinksPermitted; public static FnSetAllocator PHYSFS_setAllocator; public static FnMount PHYSFS_mount; - public static FnGetRealDir PHYSFS_getMountPoint; + public static FnEnumerateFiles PHYSFS_getMountPoint; public static FnGetCdRomDirsCallback PHYSFS_getCdRomDirsCallback; public static FnGetCdRomDirsCallback PHYSFS_getSearchPathCallback; public static FnEnumerateFilesCallback PHYSFS_enumerateFilesCallback; diff --git a/SharpPhysFS/PhysFS.cs b/SharpPhysFS/PhysFS.cs index 48f0f3a..60024eb 100644 --- a/SharpPhysFS/PhysFS.cs +++ b/SharpPhysFS/PhysFS.cs @@ -243,7 +243,7 @@ namespace PhysFS /// Platform-dependent dir separator string public static string GetDirSeparator() { - return Interop.PHYSFS_getDirSeparator(); + return Marshal.PtrToStringAnsi(Interop.PHYSFS_getDirSeparator()); } /// @@ -367,7 +367,7 @@ namespace PhysFS /// public static string GetBaseDir() { - return Interop.PHYSFS_getBaseDir(); + return Marshal.PtrToStringAnsi(Interop.PHYSFS_getBaseDir()); } /// @@ -385,7 +385,7 @@ namespace PhysFS /// String of user dir in platform-dependent notation. public static string GetUserDir() { - return Interop.PHYSFS_getUserDir(); + return Marshal.PtrToStringAnsi(Interop.PHYSFS_getUserDir()); } /// @@ -397,7 +397,7 @@ namespace PhysFS /// String of write dir in platform-dependent notation, OR null IF NO WRITE PATH IS CURRENTLY SET public static string GetWriteDir() { - return Interop.PHYSFS_getWriteDir(); + return Marshal.PtrToStringAnsi(Interop.PHYSFS_getWriteDir()); } /// @@ -589,7 +589,7 @@ namespace PhysFS /// String of element of search path containing the the file in question. null if not found. public static string GetRealDir(string filename) { - return Interop.PHYSFS_getRealDir(filename); + return Marshal.PtrToStringAnsi(Interop.PHYSFS_getRealDir(filename)); } /// @@ -692,7 +692,7 @@ namespace PhysFS /// String of mount point if added to path public static string GetMountPoint(string dir) { - var s = Interop.PHYSFS_getMountPoint(dir); + var s = Marshal.PtrToStringAnsi(Interop.PHYSFS_getMountPoint(dir)); if(s == null) { throw new PhysFSException();