Fixed changes from SafeCoTaskMemString to string to include marshaling attribute

pull/180/head
dahall 2020-10-22 14:40:24 -06:00
parent ac66932f43
commit 32d7c6301c
14 changed files with 159 additions and 13 deletions

View File

@ -935,6 +935,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the error text associated with the error. Call the CoTaskMemFree function to free
/// ppErrorDescription when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetErrorDescription([In] uint LanguageId);
/// <summary>Retrieves the description of the context in which the error occurred.</summary>
@ -949,6 +950,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the description of the context in which the error occurred. Call the CoTaskMemFree
/// function to free ppContextDescription when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetErrorContextDescription([In] uint LanguageId);
/// <summary>
@ -959,6 +961,7 @@ namespace Vanara.PInvoke
/// and "file" for the SMB protocol. The ppProtocol parameter is set to NULL if the error is not related to the transfer
/// protocol. Call the CoTaskMemFree function to free ppProtocol when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetProtocol();
}
@ -979,6 +982,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -986,6 +990,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1014,6 +1019,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -1021,6 +1027,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1062,6 +1069,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -1069,6 +1077,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1097,6 +1106,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path of the temporary file. Call the CoTaskMemFree function to free ppFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTemporaryName();
/// <summary>Sets the validation state of this file.</summary>
@ -1130,6 +1140,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -1137,6 +1148,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1165,6 +1177,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path of the temporary file. Call the CoTaskMemFree function to free ppFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTemporaryName();
/// <summary>Sets the validation state of this file.</summary>
@ -1203,6 +1216,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -1210,6 +1224,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1238,6 +1253,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path of the temporary file. Call the CoTaskMemFree function to free ppFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTemporaryName();
/// <summary>Sets the validation state of this file.</summary>
@ -1285,6 +1301,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the remote name of the file to transfer. The name is fully qualified. Call the
/// CoTaskMemFree function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetRemoteName();
/// <summary>Retrieves the local name of the file.</summary>
@ -1292,6 +1309,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the name of the file on the client. The name is fully qualified. Call the CoTaskMemFree
/// function to free ppName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLocalName();
/// <summary>Retrieves information on the progress of the file transfer.</summary>
@ -1320,6 +1338,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path of the temporary file. Call the CoTaskMemFree function to free ppFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTemporaryName();
/// <summary>Sets the validation state of this file.</summary>
@ -1519,6 +1538,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the string version of the SID that identifies the job's owner. Call the CoTaskMemFree
/// function to free ppOwner when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetOwner();
/// <summary>Specifies a display name for the job. Typically, you use the display name to identify the job in a user interface.</summary>
@ -1533,6 +1553,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the display name that identifies the job. More than one job can have the same display
/// name. Call the CoTaskMemFree function to free ppDisplayName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDisplayName();
/// <summary>Provides a description of the job.</summary>
@ -1547,6 +1568,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a short description of the job. Call the CoTaskMemFree function to free ppDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDescription();
/// <summary>
@ -1786,6 +1808,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the string version of the SID that identifies the job's owner. Call the CoTaskMemFree
/// function to free ppOwner when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOwner();
/// <summary>Specifies a display name for the job. Typically, you use the display name to identify the job in a user interface.</summary>
@ -1800,6 +1823,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the display name that identifies the job. More than one job can have the same display
/// name. Call the CoTaskMemFree function to free ppDisplayName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDisplayName();
/// <summary>Provides a description of the job.</summary>
@ -1814,6 +1838,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a short description of the job. Call the CoTaskMemFree function to free ppDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDescription();
/// <summary>
@ -2014,6 +2039,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path to the reply file. Call the CoTaskMemFree function to free pReplyFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetReplyFileName();
/// <summary>Specifies the credentials to use for a proxy or remote server user authentication request.</summary>
@ -2142,6 +2168,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the string version of the SID that identifies the job's owner. Call the CoTaskMemFree
/// function to free ppOwner when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOwner();
/// <summary>Specifies a display name for the job. Typically, you use the display name to identify the job in a user interface.</summary>
@ -2156,6 +2183,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the display name that identifies the job. More than one job can have the same display
/// name. Call the CoTaskMemFree function to free ppDisplayName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDisplayName();
/// <summary>Provides a description of the job.</summary>
@ -2170,6 +2198,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a short description of the job. Call the CoTaskMemFree function to free ppDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDescription();
/// <summary>
@ -2370,6 +2399,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path to the reply file. Call the CoTaskMemFree function to free pReplyFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetReplyFileName();
/// <summary>Specifies the credentials to use for a proxy or remote server user authentication request.</summary>
@ -2530,6 +2560,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the string version of the SID that identifies the job's owner. Call the CoTaskMemFree
/// function to free ppOwner when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOwner();
/// <summary>Specifies a display name for the job. Typically, you use the display name to identify the job in a user interface.</summary>
@ -2544,6 +2575,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the display name that identifies the job. More than one job can have the same display
/// name. Call the CoTaskMemFree function to free ppDisplayName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDisplayName();
/// <summary>Provides a description of the job.</summary>
@ -2558,6 +2590,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a short description of the job. Call the CoTaskMemFree function to free ppDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDescription();
/// <summary>
@ -2758,6 +2791,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path to the reply file. Call the CoTaskMemFree function to free pReplyFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetReplyFileName();
/// <summary>Specifies the credentials to use for a proxy or remote server user authentication request.</summary>
@ -2961,6 +2995,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the string version of the SID that identifies the job's owner. Call the CoTaskMemFree
/// function to free ppOwner when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOwner();
/// <summary>Specifies a display name for the job. Typically, you use the display name to identify the job in a user interface.</summary>
@ -2975,6 +3010,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the display name that identifies the job. More than one job can have the same display
/// name. Call the CoTaskMemFree function to free ppDisplayName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDisplayName();
/// <summary>Provides a description of the job.</summary>
@ -2989,6 +3025,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a short description of the job. Call the CoTaskMemFree function to free ppDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDescription();
/// <summary>
@ -3189,6 +3226,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the full path to the reply file. Call the CoTaskMemFree function to free pReplyFileName
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetReplyFileName();
/// <summary>Specifies the credentials to use for a proxy or remote server user authentication request.</summary>
@ -3437,6 +3475,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the custom headers. Each header is terminated by a carriage return and line feed (CR/LF)
/// character. To free the string when finished, call the CoTaskMemFree function.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCustomHeaders();
/// <summary>
@ -3521,6 +3560,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains a description of the error. Call the CoTaskMemFree function to free ppErrorDescription
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetErrorDescription([In] HRESULT hResult, [In] uint LanguageId);
}
@ -3538,6 +3578,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the server principal name of the peer. The principal name is of the form,
/// server$.domain.suffix. Call the CoTaskMemFree function to free pName when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetPeerName();
/// <summary>Determines whether the peer is authenticated.</summary>
@ -3667,6 +3708,7 @@ namespace Vanara.PInvoke
/// Null-terminated string that contains the origin URL of the cached file. Call the CoTaskMemFree function to free ppOriginUrl
/// when done.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetOriginUrl();
/// <summary>Gets the size of the file.</summary>
@ -3754,6 +3796,7 @@ namespace Vanara.PInvoke
/// Returns the SID that is retrieved from the TokenInformation parameter of the GetTokenInformation function. If no SID is
/// retrieved, this parameter is set to NULL.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetHelperTokenSid();
}

View File

@ -2648,7 +2648,7 @@ namespace Vanara.PInvoke
// DWORD *pCapabilities );
[DllImport(Lib.Ole32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("combaseapi.h", MSDNShortId = "58a2c121-c324-4c33-aaca-490b5a09738c")]
public static extern HRESULT CoQueryClientBlanket(out RPC_C_AUTHN pAuthnSvc, out RPC_C_AUTHZ pAuthzSvc, out string pServerPrincName,
public static extern HRESULT CoQueryClientBlanket(out RPC_C_AUTHN pAuthnSvc, out RPC_C_AUTHZ pAuthzSvc, [MarshalAs(UnmanagedType.LPWStr)] out string pServerPrincName,
out RPC_C_AUTHN_LEVEL pAuthnLevel, out RPC_C_IMP_LEVEL pImpLevel, out RPC_AUTHZ_HANDLE pPrivs, ref EOLE_AUTHENTICATION_CAPABILITIES pCapabilities);
/// <summary>
@ -3945,7 +3945,7 @@ namespace Vanara.PInvoke
// clsid, LPOLESTR *lplpszProgID );
[DllImport(Lib.Ole32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("combaseapi.h", MSDNShortId = "a863cbc2-f8ab-468a-8254-b273077a6a2b")]
public static extern HRESULT ProgIDFromCLSID(in Guid clsid, out string lplpszProgID);
public static extern HRESULT ProgIDFromCLSID(in Guid clsid, [MarshalAs(UnmanagedType.LPWStr)] out string lplpszProgID);
/// <summary>Creates an agile reference for an object specified by the given interface.</summary>
/// <param name="options">The options.</param>

View File

@ -1,4 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Security;
@ -796,6 +798,7 @@ namespace Vanara.PInvoke
/// <returns>
/// When this method returns, contains the address of a pointer to the property's canonical name as a null-terminated Unicode string.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCanonicalName();
/// <summary>Gets the variant type of the property.</summary>
@ -808,12 +811,13 @@ namespace Vanara.PInvoke
/// <summary>Gets the display name of the property as it is shown in any UI.</summary>
/// <param name="pszName">Contains the address of a pointer to the property's name as a null-terminated Unicode string.</param>
[PreserveSig]
HRESULT GetDisplayName(out string pszName);
HRESULT GetDisplayName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
/// <summary>Gets the text used in edit controls hosted in various dialog boxes.</summary>
/// <returns>
/// When this method returns, contains the address of a pointer to a null-terminated Unicode buffer that holds the invitation text.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetEditInvitation();
/// <summary>Gets a set of flags that describe the uses and capabilities of the property.</summary>
@ -870,7 +874,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the address of a pointer to the description string that compares the second property with
/// the first property. The string is null-terminated.
/// </param>
void GetRelativeDescription([In] PROPVARIANT propvar1, [In] PROPVARIANT propvar2, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string ppszDesc1, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string ppszDesc2);
void GetRelativeDescription([In] PROPVARIANT propvar1, [In] PROPVARIANT propvar2, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc1, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc2);
/// <summary>Gets the current sort description flags for the property, which indicate the particular wordings of sort offerings.</summary>
/// <returns>
@ -886,6 +890,7 @@ namespace Vanara.PInvoke
/// <returns>
/// When this method returns, contains the address of a pointer to the sort description as a null-terminated Unicode string.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSortDescriptionLabel([In, MarshalAs(UnmanagedType.Bool)] bool fDescending);
/// <summary>Gets a value that describes how the property values are displayed when multiple items are selected in the UI.</summary>
@ -924,6 +929,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the formatted value as a null-terminated, Unicode string. The calling application must
/// allocate memory for the buffer, and use CoTaskMemFree to release the string specified by pszText when it is no longer needed.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string FormatForDisplay([In] PROPVARIANT propvar, [In] PROPDESC_FORMAT_FLAGS pdfFlags);
/// <summary>Gets a value that indicates whether a property is canonical according to the definition of the property description.</summary>
@ -946,6 +952,7 @@ namespace Vanara.PInvoke
/// <returns>
/// When this method returns, contains the address of a pointer to the property's canonical name as a null-terminated Unicode string.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetCanonicalName();
/// <summary>Gets the variant type of the property.</summary>
@ -958,12 +965,13 @@ namespace Vanara.PInvoke
/// <summary>Gets the display name of the property as it is shown in any UI.</summary>
/// <param name="pszName">Contains the address of a pointer to the property's name as a null-terminated Unicode string.</param>
[PreserveSig]
new HRESULT GetDisplayName(out string pszName);
new HRESULT GetDisplayName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
/// <summary>Gets the text used in edit controls hosted in various dialog boxes.</summary>
/// <returns>
/// When this method returns, contains the address of a pointer to a null-terminated Unicode buffer that holds the invitation text.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetEditInvitation();
/// <summary>Gets a set of flags that describe the uses and capabilities of the property.</summary>
@ -1020,7 +1028,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the address of a pointer to the description string that compares the second property with
/// the first property. The string is null-terminated.
/// </param>
new void GetRelativeDescription([In] PROPVARIANT propvar1, [In] PROPVARIANT propvar2, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string ppszDesc1, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string ppszDesc2);
new void GetRelativeDescription([In] PROPVARIANT propvar1, [In] PROPVARIANT propvar2, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc1, [MarshalAs(UnmanagedType.LPWStr)] out string ppszDesc2);
/// <summary>Gets the current sort description flags for the property, which indicate the particular wordings of sort offerings.</summary>
/// <returns>
@ -1036,6 +1044,7 @@ namespace Vanara.PInvoke
/// <returns>
/// When this method returns, contains the address of a pointer to the sort description as a null-terminated Unicode string.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetSortDescriptionLabel([In, MarshalAs(UnmanagedType.Bool)] bool fDescending);
/// <summary>Gets a value that describes how the property values are displayed when multiple items are selected in the UI.</summary>
@ -1074,6 +1083,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the formatted value as a null-terminated, Unicode string. The calling application must
/// allocate memory for the buffer, and use CoTaskMemFree to release the string specified by pszText when it is no longer needed.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string FormatForDisplay([In] PROPVARIANT propvar, [In] PROPDESC_FORMAT_FLAGS pdfFlags);
/// <summary>Gets a value that indicates whether a property is canonical according to the definition of the property description.</summary>
@ -1090,7 +1100,7 @@ namespace Vanara.PInvoke
/// </param>
/// <returns>If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.</returns>
[PreserveSig]
HRESULT GetImageReferenceForValue([In] PROPVARIANT propvar, out string ppszImageRes);
HRESULT GetImageReferenceForValue([In] PROPVARIANT propvar, [MarshalAs(UnmanagedType.LPWStr)] out string ppszImageRes);
}
/// <summary>Exposes methods that enumerate and retrieve property description list details.</summary>
@ -1909,7 +1919,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/propsys/nf-propsys-ipropertysystem-formatfordisplay HRESULT
// FormatForDisplay( REFPROPERTYKEY key, REFPROPVARIANT propvar, PROPDESC_FORMAT_FLAGS pdff, LPWSTR pszText, DWORD cchText );
void FormatForDisplay(ref PROPERTYKEY key, PROPVARIANT propvar, PROPDESC_FORMAT_FLAGS pdff, System.Text.StringBuilder pszText, uint cchText);
void FormatForDisplay(ref PROPERTYKEY key, PROPVARIANT propvar, PROPDESC_FORMAT_FLAGS pdff, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder pszText, uint cchText);
/// <summary>Gets a string representation of a property value to an allocated memory buffer.</summary>
/// <param name="key">
@ -2160,7 +2170,8 @@ namespace Vanara.PInvoke
{
using var pv = new PROPVARIANT();
ps.GetValue(pkey, pv);
return pv.Value;
var ret = pv.Value;
return ret is IEnumerable<PROPVARIANT> pve ? pve.Select(o => o.Value).ToArray() : ret;
}
/// <summary>Sets a new property value, or replaces or removes an existing value in a property store.</summary>

View File

@ -655,7 +655,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcdigitalsignature-getnamespaces HRESULT GetNamespaces(
// LPWSTR **prefixes, LPWSTR **namespaces, UINT32 *count );
void GetNamespaces(out string prefixes, out string namespaces, out uint count);
void GetNamespaces([MarshalAs(UnmanagedType.LPWStr)] out string prefixes, [MarshalAs(UnmanagedType.LPWStr)] out string namespaces, out uint count);
/// <summary>Gets the value of the <c>Id</c> attribute from the <c>Signature</c> element of the signature markup.</summary>
/// <returns>
@ -672,6 +672,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcdigitalsignature-getsignatureid HRESULT GetSignatureId(
// LPWSTR *signatureId );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSignatureId();
/// <summary>Gets the part name of the part that contains the signature markup.</summary>
@ -722,6 +723,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcdigitalsignature-getsignaturemethod HRESULT
// GetSignatureMethod( LPWSTR *signatureMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSignatureMethod();
/// <summary>Gets the canonicalization method that was applied to the <c>SignedInfo</c> element of the serialized signature.</summary>
@ -815,6 +817,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcdigitalsignature-getsigningtime HRESULT GetSigningTime(
// LPWSTR *signingTime );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSigningTime();
/// <summary>Gets the format of the string returned by the GetSigningTime method.</summary>
@ -2022,6 +2025,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcpart-getcontenttype HRESULT GetContentType( LPWSTR
// *contentType );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentType();
/// <summary>Gets a value that describes the way part content is compressed.</summary>
@ -3262,6 +3266,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcrelationship-getid HRESULT GetId( LPWSTR
// *relationshipIdentifier );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetId();
/// <summary>Gets the relationship type.</summary>
@ -3288,6 +3293,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcrelationship-getrelationshiptype HRESULT
// GetRelationshipType( LPWSTR *relationshipType );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetRelationshipType();
/// <summary>Gets the URI of the relationship source.</summary>
@ -3682,6 +3688,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcrelationshipselector-getselectioncriterion HRESULT
// GetSelectionCriterion( LPWSTR *selectionCriterion );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSelectionCriterion();
}
@ -4614,6 +4621,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturepartreference-getcontenttype HRESULT
// GetContentType( LPWSTR *contentType );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentType();
/// <summary>Gets the digest method to use on part content of the referenced part when the part is signed.</summary>
@ -4625,6 +4633,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturepartreference-getdigestmethod HRESULT
// GetDigestMethod( LPWSTR *digestMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDigestMethod();
/// <summary>Gets the digest value that is calculated for part content of the referenced part when the part is signed.</summary>
@ -4962,6 +4971,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturereference-getid HRESULT GetId( LPWSTR
// *referenceId );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetId();
/// <summary>Gets the URI of the referenced XML element.</summary>
@ -5020,6 +5030,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturereference-gettype HRESULT GetType( LPWSTR
// *type );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetType();
/// <summary>Gets the canonicalization method to use on the referenced XML element, when the element is signed.</summary>
@ -5037,6 +5048,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturereference-getdigestmethod HRESULT
// GetDigestMethod( LPWSTR *digestMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDigestMethod();
/// <summary>Gets the digest value that is calculated for the referenced XML element when the element is signed.</summary>
@ -5392,6 +5404,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsignaturerelationshipreference-getdigestmethod HRESULT
// GetDigestMethod( LPWSTR *digestMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDigestMethod();
/// <summary>Gets the digest value calculated for the selected relationships when they are signed.</summary>
@ -5860,6 +5873,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsigningoptions-getsignatureid HRESULT GetSignatureId(
// LPWSTR *signatureId );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSignatureId();
/// <summary>Sets the value of the <c>Id</c> attribute of the <c>Signature</c> element.</summary>
@ -5912,6 +5926,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsigningoptions-getsignaturemethod HRESULT
// GetSignatureMethod( LPWSTR *signatureMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSignatureMethod();
/// <summary>
@ -5961,6 +5976,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/msopc/nf-msopc-iopcsigningoptions-getdefaultdigestmethod HRESULT
// GetDefaultDigestMethod( LPWSTR *digestMethod );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDefaultDigestMethod();
/// <summary>Sets the default digest method that will be used to compute digest values for objects to be signed.</summary>

View File

@ -64,6 +64,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcategory HRESULT
// GetCategory( LPWSTR *category );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCategory();
/// <summary>Sets the <c>category</c> property.</summary>
@ -85,6 +86,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontentstatus
// HRESULT GetContentStatus( LPWSTR *contentStatus );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentStatus();
/// <summary>Sets the <c>contentStatus</c> property.</summary>
@ -110,6 +112,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcontenttype
// HRESULT GetContentType( LPWSTR *contentType );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetContentType();
/// <summary>Sets the <c>contentType</c> property.</summary>
@ -146,6 +149,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getcreator HRESULT
// GetCreator( LPWSTR *creator );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCreator();
/// <summary>Sets the <c>creator</c> property.</summary>
@ -166,6 +170,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getdescription
// HRESULT GetDescription( LPWSTR *description );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDescription();
/// <summary>Sets the <c>description</c> property.</summary>
@ -186,6 +191,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getidentifier
// HRESULT GetIdentifier( LPWSTR *identifier );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetIdentifier();
/// <summary>Sets the <c>identifier</c> property.</summary>
@ -209,6 +215,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getkeywords HRESULT
// GetKeywords( LPWSTR *keywords );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetKeywords();
/// <summary>Sets the <c>keywords</c> property.</summary>
@ -232,6 +239,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
/// <summary>Sets the <c>language</c> property.</summary>
@ -254,6 +262,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getlastmodifiedby
// HRESULT GetLastModifiedBy( LPWSTR *lastModifiedBy );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLastModifiedBy();
/// <summary>Sets the <c>lastModifiedBy</c> property.</summary>
@ -305,6 +314,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getrevision HRESULT
// GetRevision( LPWSTR *revision );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetRevision();
/// <summary>Sets the <c>revision</c> property.</summary>
@ -321,6 +331,7 @@ namespace Vanara.PInvoke
/// <remarks>The <c>subject</c> property contains the topic of the resource's content.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getsubject HRESULT
// GetSubject( LPWSTR *subject );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetSubject();
/// <summary>Sets the <c>subject</c> property.</summary>
@ -337,6 +348,7 @@ namespace Vanara.PInvoke
/// <remarks>The <c>title</c> property contains the resource's name.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-gettitle HRESULT
// GetTitle( LPWSTR *title );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTitle();
/// <summary>Sets the <c>title</c> property.</summary>
@ -353,6 +365,7 @@ namespace Vanara.PInvoke
/// <remarks>The <c>version</c> property contains the resource's version number.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcoreproperties-getversion HRESULT
// GetVersion( LPWSTR *version );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetVersion();
/// <summary>Sets the <c>version</c> property.</summary>
@ -1286,6 +1299,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
/// <summary>Sets the <c>Language</c> property of the page.</summary>
@ -1308,6 +1322,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-getname HRESULT GetName(
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetName();
/// <summary>Sets the <c>Name</c> property of this page.</summary>
@ -1664,6 +1679,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompage-generateunusedlookupkey
// HRESULT GenerateUnusedLookupKey( XPS_OBJECT_TYPE type, LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GenerateUnusedLookupKey([In] XPS_OBJECT_TYPE type);
/// <summary>Makes a deep copy of the interface.</summary>

View File

@ -224,6 +224,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
@ -413,6 +414,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylookup
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
@ -618,6 +620,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlookup
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
@ -670,6 +673,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getname HRESULT GetName(
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
@ -765,6 +769,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
@ -877,6 +882,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getaccessibilityshortdescription
// HRESULT GetAccessibilityShortDescription( LPWSTR *shortDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityShortDescription();
/// <summary>
@ -909,6 +915,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomcanvas-getaccessibilitylongdescription
// HRESULT GetAccessibilityLongDescription( LPWSTR *longDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityLongDescription();
/// <summary>
@ -1398,7 +1405,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomdictionary-getat HRESULT GetAt(
// UINT32 index, LPWSTR *key, IXpsOMShareable **entry );
IXpsOMShareable GetAt([In] uint index, out string key);
IXpsOMShareable GetAt([In] uint index, [MarshalAs(UnmanagedType.LPWStr)] out string key);
/// <summary>Gets the IXpsOMShareable interface pointer of the entry that contains the specified key.</summary>
/// <param name="key">The entry's key to be found in the dictionary.</param>
@ -2030,6 +2037,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgeometry-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
@ -2782,6 +2790,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
@ -2971,6 +2980,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylookup
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
@ -3176,6 +3186,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlookup
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
@ -3228,6 +3239,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getname HRESULT GetName(
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
@ -3323,6 +3335,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
@ -3342,6 +3355,7 @@ namespace Vanara.PInvoke
/// <returns>The UTF-16 Unicode string of the text to be displayed. If the string is empty, a <c>NULL</c> pointer is returned.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getunicodestring HRESULT
// GetUnicodeString( LPWSTR *unicodeString );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetUnicodeString();
/// <summary>Gets the number of Glyph indices.</summary>
@ -3481,6 +3495,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getdevicefontname HRESULT
// GetDeviceFontName( LPWSTR *deviceFontName );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDeviceFontName();
/// <summary>Gets the style simulations that will be applied when rendering the glyphs.</summary>
@ -3747,6 +3762,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphs-getfillbrushlookup HRESULT
// GetFillBrushLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetFillBrushLookup();
/// <summary>Sets the lookup key name of a shared fill brush.</summary>
@ -3826,6 +3842,7 @@ namespace Vanara.PInvoke
/// <returns>The UTF-16 Unicode string. If the string is empty, a <c>NULL</c> pointer is returned.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-getunicodestring
// HRESULT GetUnicodeString( LPWSTR *unicodeString );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetUnicodeString();
/// <summary>Sets the text in unescaped UTF-16 scalar values.</summary>
@ -4054,6 +4071,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomglyphseditor-getdevicefontname
// HRESULT GetDeviceFontName( LPWSTR *deviceFontName );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDeviceFontName();
/// <summary>Sets the name of the device font.</summary>
@ -4334,6 +4352,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
/// <summary>
@ -4815,6 +4834,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>

View File

@ -352,6 +352,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>
@ -536,6 +537,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomnamecollection-getat HRESULT GetAt(
// UINT32 index, LPWSTR *name );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAt([In] uint index);
}
@ -703,6 +705,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
@ -892,6 +895,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylookup
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
@ -1097,6 +1101,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlookup
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
@ -1149,6 +1154,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getname HRESULT GetName(
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
@ -1244,6 +1250,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
@ -1397,6 +1404,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getgeometrylookup HRESULT
// GetGeometryLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetGeometryLookup();
/// <summary>
@ -1457,6 +1465,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getaccessibilityshortdescription
// HRESULT GetAccessibilityShortDescription( LPWSTR *shortDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityShortDescription();
/// <summary>
@ -1487,6 +1496,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getaccessibilitylongdescription
// HRESULT GetAccessibilityLongDescription( LPWSTR *longDescription );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccessibilityLongDescription();
/// <summary>
@ -1688,6 +1698,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getstrokebrushlookup HRESULT
// GetStrokeBrushLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetStrokeBrushLookup();
/// <summary>
@ -2003,6 +2014,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsompath-getfillbrushlookup HRESULT
// GetFillBrushLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetFillBrushLookup();
/// <summary>Sets the lookup key name of a shared brush in a resource dictionary, to be used as the fill brush.</summary>
@ -2354,6 +2366,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomgradientbrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>
@ -3347,6 +3360,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
/// <summary>
@ -3658,6 +3672,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-gettransformlookup HRESULT
// GetTransformLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTransformLookup();
/// <summary>Sets the lookup key name of a shared matrix transform in a resource dictionary.</summary>
@ -3847,6 +3862,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getclipgeometrylookup
// HRESULT GetClipGeometryLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetClipGeometryLookup();
/// <summary>Sets the lookup key name of a shared clip geometry in a resource dictionary.</summary>
@ -4052,6 +4068,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getopacitymaskbrushlookup
// HRESULT GetOpacityMaskBrushLookup( LPWSTR *key );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetOpacityMaskBrushLookup();
/// <summary>Sets the lookup key name of a shared opacity mask brush in a resource dictionary.</summary>
@ -4104,6 +4121,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getname HRESULT GetName(
// LPWSTR *name );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetName();
/// <summary>Sets the <c>Name</c> property of the visual.</summary>
@ -4199,6 +4217,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisual-getlanguage HRESULT
// GetLanguage( LPWSTR *language );
[MethodImpl(MethodImplOptions.InternalCall)]
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetLanguage();
/// <summary>Sets the <c>Language</c> property of the visual.</summary>
@ -4415,6 +4434,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomtilebrush-gettransformlookup
// HRESULT GetTransformLookup( LPWSTR *key );
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetTransformLookup();
/// <summary>
@ -4705,6 +4725,7 @@ namespace Vanara.PInvoke
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/xpsobjectmodel/nf-xpsobjectmodel-ixpsomvisualbrush-getvisuallookup HRESULT
// GetVisualLookup( LPWSTR *lookup );
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetVisualLookup();
/// <summary>

View File

@ -328,6 +328,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves the text currently entered in the dialog's File name edit box.</summary>
/// <returns>The address of a pointer to a buffer that, when this method returns successfully, receives the text.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetFileName();
/// <summary>Sets the title of the dialog.</summary>
@ -469,6 +470,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves the text currently entered in the dialog's File name edit box.</summary>
/// <returns>The address of a pointer to a buffer that, when this method returns successfully, receives the text.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetFileName();
/// <summary>Sets the title of the dialog.</summary>
@ -904,6 +906,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves the text currently entered in the dialog's File name edit box.</summary>
/// <returns>The address of a pointer to a buffer that, when this method returns successfully, receives the text.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetFileName();
/// <summary>Sets the title of the dialog.</summary>
@ -1277,6 +1280,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves the text currently entered in the dialog's File name edit box.</summary>
/// <returns>The address of a pointer to a buffer that, when this method returns successfully, receives the text.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetFileName();
/// <summary>Sets the title of the dialog.</summary>

View File

@ -1585,6 +1585,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the address of a pointer to a null-terminated buffer that contains the path. The calling
/// application is responsible for calling CoTaskMemFree to free this resource when it is no longer needed.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetPath([In] KNOWN_FOLDER_FLAG dwFlags);
/// <summary>Assigns a new path to a known folder.</summary>
@ -1757,6 +1758,7 @@ namespace Vanara.PInvoke
/// When this method returns, contains the address of a pointer to a null-terminated Unicode string that contains an error
/// message if one was generated. This value can be NULL.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string Redirect(in Guid rfid, [In, Optional] HWND hwnd, [In] KF_REDIRECT_FLAGS flags,
[In, Optional, MarshalAs(UnmanagedType.LPWStr)] string pszTargetPath, [In] uint cFolders, [In] Guid[] pExclusion);
}

View File

@ -465,6 +465,7 @@ namespace Vanara.PInvoke
/// <returns>
/// A value that, when this function returns successfully, receives the address of a pointer to the retrieved display name.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetDisplayName(SIGDN sigdnName);
/// <summary>Gets a requested set of attributes of the IShellItem object.</summary>
@ -521,6 +522,7 @@ namespace Vanara.PInvoke
/// <returns>
/// A value that, when this function returns successfully, receives the address of a pointer to the retrieved display name.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
new string GetDisplayName(SIGDN sigdnName);
/// <summary>Gets a requested set of attributes of the IShellItem object.</summary>
@ -624,6 +626,7 @@ namespace Vanara.PInvoke
/// <summary>Gets the string value of a specified property key.</summary>
/// <param name="key">A reference to a PROPERTYKEY structure.</param>
/// <returns>A pointer to a Unicode string value.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetString(in PROPERTYKEY key);
/// <summary>Gets the UInt32 value of specified property key.</summary>

View File

@ -170,6 +170,7 @@ namespace Vanara.PInvoke
/// A null-terminated Unicode string that describes the location of the default icon. The string is returned as
/// ModuleFileName,ResourceIndex or ModuleFileName,-ResourceID.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetIcon();
/// <summary>Sets the default icon for the library.</summary>

View File

@ -385,6 +385,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the retrieved trigger description. Note that this string must be release
/// by a call to CoTaskMemFree after the string is no longer needed.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTriggerString([In] ushort iTrigger);
/// <summary>Retrieves the work item run times for a specified time period.</summary>
@ -466,6 +467,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves the comment for the work item.</summary>
/// <returns>A pointer to a null-terminated string that contains the retrieved comment for the current work item.</returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetComment();
/// <summary>Sets the name of the work item's creator.</summary>
@ -477,6 +479,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the name of the creator of the current work item. The application that
/// invokes GetCreator is responsible for freeing this string using the CoTaskMemFree function.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetCreator();
/// <summary>This method stores application-defined data associated with the work item.</summary>
@ -554,6 +557,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the account name for the current work item. The empty string, L"", is
/// returned for the local system account. After processing the account name, be sure to call CoTaskMemFree to free the string.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetAccountInformation();
/// <summary>This method assigns a specific application to the current task.</summary>
@ -568,6 +572,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the name of the application the current task is associated with. After
/// processing this name, call CoTaskMemFree to free resources.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetApplicationName();
/// <summary>This method sets the command-line parameters for the task.</summary>
@ -582,6 +587,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the command-line parameters for the task. The method that invokes
/// GetParameters is responsible for freeing this string using the CoTaskMemFree function.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetParameters();
/// <summary>This method sets the working directory for the task.</summary>
@ -600,6 +606,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the task's working directory. The application that invokes
/// GetWorkingDirectory is responsible for freeing this string using the CoTaskMemFree function.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetWorkingDirectory();
/// <summary>This method sets the priority for the task.</summary>
@ -694,6 +701,7 @@ namespace Vanara.PInvoke
/// A pointer to a null-terminated string that contains the name of the target computer for the current task. This string is
/// allocated by the application that invokes GetTargetComputer, and must also be freed using CoTaskMemFree.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTargetComputer();
/// <summary>
@ -783,6 +791,7 @@ namespace Vanara.PInvoke
/// A pointer to a pointer to a null-terminated string that describes the current task trigger. The method that invokes
/// GetTriggerString is responsible for freeing this string using the CoTaskMemFree function.
/// </returns>
[return: MarshalAs(UnmanagedType.LPWStr)]
string GetTriggerString();
/// <summary>The SetTrigger method sets the trigger criteria for a task trigger.</summary>

View File

@ -2736,7 +2736,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.UrlMon, SetLastError = false, ExactSpelling = true)]
[PInvokeData("Urlmon.h")]
public static extern HRESULT FindMimeFromData([In] IBindCtx pBC, [MarshalAs(UnmanagedType.LPWStr)] string pwzUrl, IntPtr pBuffer, uint cbSize,
[MarshalAs(UnmanagedType.LPWStr)] string pwzMimeProposed, FMFD dwMimeFlags, out string ppwzMimeOut, uint dwReserved = 0);
[MarshalAs(UnmanagedType.LPWStr)] string pwzMimeProposed, FMFD dwMimeFlags, [MarshalAs(UnmanagedType.LPWStr)] out string ppwzMimeOut, uint dwReserved = 0);
/// <summary>Gets the <c>CLSID</c> of the object to instantiate for the specified file.</summary>
/// <param name="pBC">

View File

@ -575,7 +575,7 @@ namespace Vanara.PInvoke
// GetAppContainerFolderPath( PCWSTR pszAppContainerSid, PWSTR *ppszPath );
[DllImport(Lib.Userenv, SetLastError = false, ExactSpelling = true)]
[PInvokeData("userenv.h", MSDNShortId = "7D3AB78D-C094-4F89-8032-13F3C137E910")]
public static extern HRESULT GetAppContainerFolderPath([MarshalAs(UnmanagedType.LPWStr)] string pszAppContainerSid, out string ppszPath);
public static extern HRESULT GetAppContainerFolderPath([MarshalAs(UnmanagedType.LPWStr)] string pszAppContainerSid, [MarshalAs(UnmanagedType.LPWStr)] out string ppszPath);
/// <summary>Gets the location of the registry storage associated with an app container.</summary>
/// <param name="desiredAccess">