From ac5d1a856cde5eca8e6aca5e38d243a66e3e877a Mon Sep 17 00:00:00 2001 From: David Hall Date: Fri, 29 Sep 2023 20:32:28 -0600 Subject: [PATCH] Added nullability to DavClnt --- PInvoke/DavClnt/DavClnt.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PInvoke/DavClnt/DavClnt.cs b/PInvoke/DavClnt/DavClnt.cs index f9fc0993..cc101e4e 100644 --- a/PInvoke/DavClnt/DavClnt.cs +++ b/PInvoke/DavClnt/DavClnt.cs @@ -192,7 +192,7 @@ public static partial class DavClnt // *ConnectionHandle, LPCWSTR RemoteName, LPCWSTR UserName, LPCWSTR Password, PBYTE ClientCert, DWORD CertSize ); [DllImport(Lib_DavClnt, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("davclnt.h", MSDNShortId = "d69cba04-503c-4d21-b762-3094c0921e28")] - public static extern Win32Error DavAddConnection(out SafeDavConnectionHandle ConnectionHandle, string RemoteName, string UserName, string Password, IntPtr ClientCert, uint CertSize); + public static extern Win32Error DavAddConnection(out SafeDavConnectionHandle ConnectionHandle, string RemoteName, string? UserName, string? Password, IntPtr ClientCert, uint CertSize); /// Closes all connections to a WebDAV server or a remote file or directory on a WebDAV server. /// @@ -460,7 +460,7 @@ public static partial class DavClnt // DavGetTheLockOwnerOfTheFile( LPCWSTR FileName, PWSTR LockOwnerName, PULONG LockOwnerNameLengthInBytes ); [DllImport(Lib_DavClnt, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("davclnt.h", MSDNShortId = "94a4607c-2770-4656-8710-987d6b951e0e")] - public static extern Win32Error DavGetTheLockOwnerOfTheFile(string FileName, StringBuilder LockOwnerName, ref uint LockOwnerNameLengthInBytes); + public static extern Win32Error DavGetTheLockOwnerOfTheFile(string FileName, StringBuilder? LockOwnerName, ref uint LockOwnerNameLengthInBytes); /// Converts the specified HTTP path to an equivalent UNC path. /// @@ -643,6 +643,7 @@ public static partial class DavClnt public uint ulUserNameLength; /// A pointer to a string that contains the password. This string is allocated by DavAuthCallback. + [MarshalAs(UnmanagedType.LPWStr)] public string pszPassword; /// The length, in WCHAR, of the password, not including the terminating NULL character.