#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
using System;
using System.Runtime.InteropServices;
namespace Framework.Storage {
/// Wrappers for unsafe calls to native methods
public static class UnsafeNativeMethods {
/// ID for the 'Saved Games' folder introduced with Windows Vista
public static readonly Guid FOLDERID_SavedGames = new Guid(
"4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4"
);
///
/// Retrieves the full path of a known folder identified by the folder's KNOWNFOLDERID.
///
/// KNOWNFOLDERID that identifies the folder
/// Special retrieval options, can be 0
///
/// Access token of the user or null to retrieve the folder location for the current user
///
///
/// Receives the address of the folder path and needs to be freed by
/// the caller via CoTaskMemFree()
///
/// A HResult (negative indicates an error)
[DllImport("shell32")]
public static extern int SHGetKnownFolderPath(
[MarshalAs(UnmanagedType.LPStruct)] Guid knownFolderId,
uint flags,
IntPtr tokenHandle,
out IntPtr folderPathPointer // API uses CoTaskMemAlloc
);
}
} // namespace Framework.Storage
#endif // UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN