mirror of
https://github.com/wismna/ModernKeePassLib.git
synced 2025-10-03 15:40:20 -04:00
Update to version 2.42.1
Some changes Removed FutureAccesList code as it works only with UWP
This commit is contained in:
@@ -39,6 +39,9 @@ namespace ModernKeePassLib.Native
|
||||
internal const uint FILE_SUPPORTS_TRANSACTIONS = 0x00200000;
|
||||
internal const int MAX_TRANSACTION_DESCRIPTION_LENGTH = 64;
|
||||
|
||||
internal static readonly Guid FOLDERID_SkyDrive = new Guid(
|
||||
"A52BBA46-E9E1-435F-B3D9-28DAA648C0F6");
|
||||
|
||||
// internal const uint TF_SFT_SHOWNORMAL = 0x00000001;
|
||||
// internal const uint TF_SFT_HIDDEN = 0x00000008;
|
||||
|
||||
@@ -179,6 +182,10 @@ namespace ModernKeePassLib.Native
|
||||
string lpNewFileName, IntPtr lpProgressRoutine, IntPtr lpData,
|
||||
UInt32 dwFlags, IntPtr hTransaction);
|
||||
|
||||
[DllImport("Shell32.dll")]
|
||||
private static extern int SHGetKnownFolderPath(ref Guid rfid, uint dwFlags,
|
||||
IntPtr hToken, out IntPtr ppszPath);
|
||||
|
||||
#if (!KeePassLibSD && !KeePassUAP)
|
||||
[DllImport("ShlWApi.dll", CharSet = CharSet.Auto)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
@@ -256,5 +263,29 @@ namespace ModernKeePassLib.Native
|
||||
return strRtDir;
|
||||
#endif
|
||||
}
|
||||
|
||||
internal static string GetKnownFolderPath(Guid g)
|
||||
{
|
||||
if(Marshal.SystemDefaultCharSize != 2) { Debug.Assert(false); return string.Empty; }
|
||||
|
||||
IntPtr pszPath = IntPtr.Zero;
|
||||
try
|
||||
{
|
||||
if(SHGetKnownFolderPath(ref g, 0, IntPtr.Zero, out pszPath) == 0)
|
||||
{
|
||||
if(pszPath != IntPtr.Zero)
|
||||
return Marshal.PtrToStringUni(pszPath);
|
||||
else { Debug.Assert(false); }
|
||||
}
|
||||
}
|
||||
catch(Exception) { Debug.Assert(false); }
|
||||
finally
|
||||
{
|
||||
try { if(pszPath != IntPtr.Zero) Marshal.FreeCoTaskMem(pszPath); }
|
||||
catch(Exception) { Debug.Assert(false); }
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user