* Changed projects to v1.0.3

* Fixed DllImport attributes to match native methods
* Added Crypt32 and Mpr projects
pull/10/head
David Hall 2017-12-06 08:54:01 -07:00
parent 2a36c89781
commit 9c39eec5f9
47 changed files with 463 additions and 79 deletions

View File

@ -4,7 +4,7 @@
<Description>This library includes shared methods, structures and constants for use throughout the Vanara assemblies. Think of it as windows.h with some useful extensions.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>Vanara.Core</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.Core</AssemblyName>
<PackageId>Vanara.Core</PackageId>
@ -22,7 +22,7 @@
<Company>GitHub Community</Company>
<Product>Vanara</Product>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from AclUI.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.AclUI</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -129,7 +129,7 @@ namespace Vanara.PInvoke
/// </param>
/// <returns>Returns nonzero if successful, or zero otherwise.</returns>
[PInvokeData("Commctrl.h", MSDNShortId = "bb761536")]
[DllImport(Lib.ComCtl32, SetLastError = true)]
[DllImport(Lib.ComCtl32, SetLastError = true, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ImageList_DrawEx(HandleRef himl, int i, SafeDCHandle hdcDst, int x, int y, int dx, int dy,
uint rgbBk, uint rgbFg, IMAGELISTDRAWFLAGS fStyle);
@ -152,7 +152,7 @@ namespace Vanara.PInvoke
/// <param name="iOverlay">The one-based index of the overlay mask.</param>
/// <returns>Returns nonzero if successful, or zero otherwise.</returns>
[PInvokeData("Commctrl.h", MSDNShortId = "bb775227")]
[DllImport(Lib.ComCtl32, SetLastError = true)]
[DllImport(Lib.ComCtl32, SetLastError = true, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ImageList_SetOverlayImage(HandleRef himl, int iImage, int iOverlay);

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from ComCtl32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.ComCtl32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from CredUI.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.CredUI</AssemblyName>
<PackageId>Vanara.PInvoke.CredUI</PackageId>

View File

@ -148,7 +148,7 @@ namespace Vanara.PInvoke
/// <param name="pPackedCredentials">A pointer to an array of bytes that, on output, receives the packed authentication buffer. This parameter can be NULL to receive the required buffer size in the pcbPackedCredentials parameter.</param>
/// <param name="pcbPackedCredentials">A pointer to a DWORD value that specifies the size, in bytes, of the pPackedCredentials buffer. On output, if the buffer is not of sufficient size, specifies the required size, in bytes, of the pPackedCredentials buffer.</param>
/// <returns>TRUE if the function succeeds; otherwise, FALSE. For extended error information, call the GetLastError function.</returns>
[DllImport(Lib.CredUI, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport(Lib.CredUI, CharSet = CharSet.Unicode, EntryPoint = "CredPackAuthenticationBufferW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("wincred.h", MSDNShortId = "aa374802")]
public static extern bool CredPackAuthenticationBuffer(CredPackFlags dwFlags, IntPtr pszUserName, IntPtr pszPassword, IntPtr pPackedCredentials, ref int pcbPackedCredentials);
@ -233,7 +233,7 @@ namespace Vanara.PInvoke
/// <para>This parameter is ignored if the CREDUIWIN_CHECKBOX flag is not set in the dwFlags parameter.</para></param>
/// <param name="dwFlags">A DWORD value that specifies special behavior for this function. This value can be a bitwise-OR combination of any enumerated value.</param>
/// <returns>Status of the operation is returned.</returns>
[DllImport(Lib.CredUI, CharSet = CharSet.Unicode)]
[DllImport(Lib.CredUI, CharSet = CharSet.Auto)]
[PInvokeData("wincred.h", MSDNShortId = "aa375178")]
public static extern int CredUIPromptForWindowsCredentials(ref CREDUI_INFO pUiInfo, int dwAuthError, ref uint pulAuthPackage, IntPtr pvInAuthBuffer, uint ulInAuthBufferSize, out IntPtr ppvOutAuthBuffer, out uint pulOutAuthBufferSize, [MarshalAs(UnmanagedType.Bool)] ref bool pfSave, WindowsCredentialsDialogOptions dwFlags);
@ -263,7 +263,7 @@ namespace Vanara.PInvoke
/// <param name="pcchMaxPassword">A pointer to a DWORD value that specifies the size, in characters, of the pszPassword buffer. On output, if the buffer is not of sufficient size, specifies the required size, in characters, of the pszPassword buffer. The size includes the terminating null character.
/// <para>This string can be a marshaled credential. See Remarks.</para></param>
/// <returns>TRUE if the function succeeds; otherwise, FALSE. For extended error information, call the GetLastError function.The following table shows common values for the GetLastError function.</returns>
[DllImport(Lib.CredUI, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport(Lib.CredUI, CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("wincred.h", MSDNShortId = "aa375185")]
public static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, int cbAuthBuffer, StringBuilder pszUserName, ref int pcchMaxUserName, StringBuilder pszDomainName, ref int pcchMaxDomainame, StringBuilder pszPassword, ref int pcchMaxPassword);
@ -294,7 +294,7 @@ namespace Vanara.PInvoke
/// <param name="pcchMaxPassword">A pointer to a DWORD value that specifies the size, in characters, of the pszPassword buffer. On output, if the buffer is not of sufficient size, specifies the required size, in characters, of the pszPassword buffer. The size includes the terminating null character.
/// <para>This string can be a marshaled credential. See Remarks.</para></param>
/// <returns>TRUE if the function succeeds; otherwise, FALSE. For extended error information, call the GetLastError function.The following table shows common values for the GetLastError function.</returns>
[DllImport(Lib.CredUI, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport(Lib.CredUI, CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("wincred.h", MSDNShortId = "aa375173")]
public static extern bool CredUnPackAuthenticationBuffer(int dwFlags, IntPtr pAuthBuffer, int cbAuthBuffer, IntPtr pszUserName, ref int pcchMaxUserName, IntPtr pszDomainName, ref int pcchMaxDomainame, IntPtr pszPassword, ref int pcchMaxPassword);
@ -302,7 +302,7 @@ namespace Vanara.PInvoke
/// <summary>
/// The CREDUI_INFO structure is used to pass information to the CredUIPromptForCredentials function that creates a dialog box used to obtain credentials information.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
[PInvokeData("wincred.h", MSDNShortId = "aa375183")]
public struct CREDUI_INFO
{
@ -317,12 +317,10 @@ namespace Vanara.PInvoke
/// <summary>
/// Pointer to a string containing a brief message to display in the dialog box. The length of this string should not exceed CREDUI_MAX_MESSAGE_LENGTH.
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public string pszMessageText;
/// <summary>
/// Pointer to a string containing the title for the dialog box. The length of this string should not exceed CREDUI_MAX_CAPTION_LENGTH.
/// </summary>
[MarshalAs(UnmanagedType.LPWStr)]
public string pszCaptionText;
/// <summary>
/// Bitmap to display in the dialog box. If this member is NULL, a default bitmap is used. The bitmap size is limited to 320x60 pixels.

View File

@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Methods, structures and constants imported from Crypt32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Crypt32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
<RootNamespace>Vanara.PInvoke</RootNamespace>
<Authors>David Hall</Authors>
<PackageProjectUrl>https://github.com/dahall/vanara</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dahall/vanara/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/dahall/Vanara/master/docs/icons/Vanara48x48.png</PackageIconUrl>
<RepositoryUrl>https://github.com/dahall/vanara</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>pinvoke vanara net-extensions interop</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<IncludeSource>true</IncludeSource>
<IncludeSymbols>true</IncludeSymbols>
<Company>GitHub Community</Company>
<Product>Vanara</Product>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net20' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Vanara.Core.csproj" />
<ProjectReference Include="..\Shared\Vanara.PInvoke.Shared.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Methods, structures and constants imported from VirtDisk.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.VirtDisk</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
<RootNamespace>Vanara.PInvoke</RootNamespace>
<Authors>David Hall</Authors>
<PackageProjectUrl>https://github.com/dahall/vanara</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dahall/vanara/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/dahall/Vanara/master/docs/icons/Vanara48x48.png</PackageIconUrl>
<RepositoryUrl>https://github.com/dahall/vanara</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>pinvoke vanara net-extensions interop</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<IncludeSource>true</IncludeSource>
<IncludeSymbols>true</IncludeSymbols>
<Company>GitHub Community</Company>
<Product>Vanara</Product>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net20' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Vanara.Core.csproj" />
<ProjectReference Include="..\Shared\Vanara.PInvoke.Shared.csproj" />
</ItemGroup>
</Project>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from DwmApi.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.DwmApi</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from Gdi32.dll</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Gdi32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -332,7 +332,7 @@ namespace Vanara.PInvoke
/// paint it horizontally.
/// </para>
/// </remarks>
[DllImport(Lib.Gdi32, ExactSpelling = true, SetLastError = true)]
[DllImport(Lib.Gdi32, CharSet = CharSet.Auto, SetLastError = true)]
[PInvokeData("Wingdi.h", MSDNShortId = "dd144904")]
public static extern int GetObject(IntPtr hgdiobj, int cbBuffer, IntPtr lpvObject);

View File

@ -691,7 +691,7 @@ namespace Vanara.PInvoke
/// <para>To write to the end of file, specify both the Offset and OffsetHigh members of the OVERLAPPED structure as 0xFFFFFFFF. This is functionally equivalent to previously calling the CreateFile function to open hFile using FILE_APPEND_DATA access.</para>
/// <para>For more information about different combinations of lpOverlapped and FILE_FLAG_OVERLAPPED, see the Remarks section and the Synchronization and File Position section.</para></param>
/// <returns>If the function succeeds, the return value is nonzero (TRUE). If the function fails, or is completing asynchronously, the return value is zero(FALSE). To get extended error information, call the GetLastError function.</returns>
[DllImport(Lib.Kernel32, SetLastError = true), SuppressUnmanagedCodeSecurity]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("FileAPI.h", MSDNShortId = "aa365747")]
public static extern bool WriteFile(SafeFileHandle hFile, IntPtr lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped);
@ -716,7 +716,7 @@ namespace Vanara.PInvoke
/// <para>To write to the end of file, specify both the Offset and OffsetHigh members of the OVERLAPPED structure as 0xFFFFFFFF. This is functionally equivalent to previously calling the CreateFile function to open hFile using FILE_APPEND_DATA access.</para>
/// <para>For more information about different combinations of lpOverlapped and FILE_FLAG_OVERLAPPED, see the Remarks section and the Synchronization and File Position section.</para></param>
/// <returns>If the function succeeds, the return value is nonzero (TRUE). If the function fails, or is completing asynchronously, the return value is zero(FALSE). To get extended error information, call the GetLastError function.</returns>
[DllImport(Lib.Kernel32, SetLastError = true), SuppressUnmanagedCodeSecurity]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("FileAPI.h", MSDNShortId = "aa365747")]
public static extern unsafe bool WriteFile(SafeFileHandle hFile, byte* lpBuffer, uint nNumberOfBytesToWrite, IntPtr lpNumberOfBytesWritten, NativeOverlapped* lpOverlapped);
@ -741,7 +741,7 @@ namespace Vanara.PInvoke
/// <para>To write to the end of file, specify both the Offset and OffsetHigh members of the OVERLAPPED structure as 0xFFFFFFFF. This is functionally equivalent to previously calling the CreateFile function to open hFile using FILE_APPEND_DATA access.</para>
/// <para>For more information about different combinations of lpOverlapped and FILE_FLAG_OVERLAPPED, see the Remarks section and the Synchronization and File Position section.</para></param>
/// <returns>If the function succeeds, the return value is nonzero (TRUE). If the function fails, or is completing asynchronously, the return value is zero(FALSE). To get extended error information, call the GetLastError function.</returns>
[DllImport(Lib.Kernel32, SetLastError = true), SuppressUnmanagedCodeSecurity]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("FileAPI.h", MSDNShortId = "aa365747")]
public static extern bool WriteFile(SafeFileHandle hFile, byte[] lpBuffer, uint nNumberOfBytesToWrite, out uint lpNumberOfBytesWritten, IntPtr lpOverlapped);

View File

@ -4,7 +4,7 @@
<Description> Methods, structures and constants imported from Kernel32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Kernel32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -111,14 +111,14 @@ namespace Vanara.PInvoke
/// <summary>Indicates that the calling application has completed its data recovery.</summary>
/// <param name="bSuccess">Specify TRUE to indicate that the data was successfully recovered; otherwise, FALSE.</param>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373328")]
public static extern void ApplicationRecoveryFinished([MarshalAs(UnmanagedType.Bool)] bool bSuccess);
/// <summary>Indicates that the calling application is continuing to recover data.</summary>
/// <param name="pbCanceled">Indicates whether the user has canceled the recovery process. Set by WER if the user clicks the Cancel button.</param>
/// <returns>This function returns S_OK on success or one of the following error codes.</returns>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373329")]
public static extern HRESULT ApplicationRecoveryInProgress([Out, MarshalAs(UnmanagedType.Bool)] out bool pbCanceled);
@ -149,7 +149,7 @@ namespace Vanara.PInvoke
/// <param name="pdwPingInterval">The recovery ping interval, in 100-nanosecond intervals.</param>
/// <param name="pdwFlags">Reserved for future use.</param>
/// <returns>This function returns S_OK on success.</returns>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373343")]
public static extern HRESULT GetApplicationRecoveryCallback(IntPtr hProcess, out ApplicationRecoveryCallback pRecoveryCallback, out IntPtr ppvParameter, out uint pdwPingInterval, out int pdwFlags);
@ -175,9 +175,9 @@ namespace Vanara.PInvoke
/// A pointer to a variable that receives the flags specified by the application when it called the RegisterApplicationRestart function.
/// </param>
/// <returns>This function returns S_OK on success</returns>
[DllImport(Lib.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373344")]
public static extern HRESULT GetApplicationRestartSettings(IntPtr hProcess, StringBuilder pwzCommandline, ref uint pcchSize, out ApplicationRestartFlags pdwFlags);
public static extern HRESULT GetApplicationRestartSettings(IntPtr hProcess, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwzCommandline, ref uint pcchSize, out ApplicationRestartFlags pdwFlags);
/// <summary>The GetCurrentActCtx function returns the handle to the active activation context of the calling thread.</summary>
/// <param name="handle">Pointer to the returned ACTCTX structure that contains information on the active activation context.</param>
@ -202,7 +202,7 @@ namespace Vanara.PInvoke
/// </param>
/// <param name="dwFlags">Reserved for future use. Set to zero.</param>
/// <returns>This function returns S_OK on success</returns>
[DllImport(Lib.Kernel32, CharSet = CharSet.Unicode)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373345")]
public static extern HRESULT RegisterApplicationRecoveryCallback(ApplicationRecoveryCallback pRecoveryCallback, IntPtr pvParameter, uint dwPingInterval, uint dwFlags);
@ -217,7 +217,7 @@ namespace Vanara.PInvoke
/// </param>
/// <param name="dwFlags">Options</param>
/// <returns>This function returns S_OK on success</returns>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373347")]
public static extern HRESULT RegisterApplicationRestart([MarshalAs(UnmanagedType.BStr)] string pwzCommandline, ApplicationRestartFlags dwFlags);
@ -233,7 +233,7 @@ namespace Vanara.PInvoke
/// <summary>Removes the active instance of an application from the recovery list.</summary>
/// <remarks>You do not need to call this function before exiting. You need to remove the registration only if you choose to not recover data.</remarks>
/// <returns>This function returns S_OK on success</returns>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373348")]
public static extern HRESULT UnregisterApplicationRecoveryCallback();
@ -244,7 +244,7 @@ namespace Vanara.PInvoke
/// function before the application fails abnormally.
/// </remarks>
/// <returns>This function returns S_OK on success</returns>
[DllImport(Lib.Kernel32)]
[DllImport(Lib.Kernel32, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa373349")]
public static extern HRESULT UnregisterApplicationRestart();

View File

@ -125,7 +125,7 @@ namespace Vanara.PInvoke
/// If the function succeeds, the return value is a handle to the data associated with the resource.
/// <para>If the function fails, the return value is NULL. To get extended error information, call GetLastError.</para>
/// </returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[SuppressUnmanagedCodeSecurity]
[PInvokeData("WinBase.h", MSDNShortId = "ms648046")]
public static extern IntPtr LoadResource(SafeLibraryHandle hModule, IntPtr hResInfo);
@ -133,7 +133,7 @@ namespace Vanara.PInvoke
/// <summary>Retrieves a pointer to the specified resource in memory.</summary>
/// <param name="hResData">A handle to the resource to be accessed. The <see cref="LoadResource"/> function returns this handle.</param>
/// <returns>If the loaded resource is available, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.</returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[SuppressUnmanagedCodeSecurity]
[PInvokeData("WinBase.h", MSDNShortId = "ms648047")]
public static extern IntPtr LockResource(IntPtr hResData);
@ -145,7 +145,7 @@ namespace Vanara.PInvoke
/// If the function succeeds, the return value is the number of bytes in the resource. If the function fails, the return value is zero. To get extended
/// error information, call GetLastError.
/// </returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[SuppressUnmanagedCodeSecurity]
[PInvokeData("WinBase.h", MSDNShortId = "ms648048")]
public static extern int SizeofResource(SafeLibraryHandle hModule, IntPtr hResInfo);

View File

@ -153,7 +153,7 @@ namespace Vanara.PInvoke
/// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.To get extended error information, call GetLastError.
/// </returns>
[PInvokeData("FileAPI.h", MSDNShortId = "ms724280")]
[DllImport(Lib.Kernel32, SetLastError = true), SuppressUnmanagedCodeSecurity]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool FileTimeToSystemTime(ref FILETIME lpFileTime, ref SYSTEMTIME lpSystemTime);
@ -448,7 +448,7 @@ namespace Vanara.PInvoke
/// If the function succeeds, the return value is a nonzero value.
/// <para>If the function fails, the return value is zero. To get extended error information, call GetLastError.</para>
/// </returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("WinBase.h", MSDNShortId = "ms683152")]
public static extern bool FreeLibrary(IntPtr hModule);
@ -596,9 +596,9 @@ namespace Vanara.PInvoke
/// If the function succeeds, the return value is the address of the exported function or variable. <br></br><br>If the function fails, the return value
/// is NULL. To get extended error information, call Marshal.GetLastWin32Error.</br>
/// </returns>
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Ansi)]
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms683212")]
public static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, string lpProcName);
public static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
/// <summary>
/// The GlobalLock function locks a global memory object and returns a pointer to the first byte of the object's memory block. GlobalLock function
@ -606,14 +606,14 @@ namespace Vanara.PInvoke
/// </summary>
/// <param name="hMem"></param>
/// <returns></returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[PInvokeData("WinBase.h", MSDNShortId = "aa366584")]
public static extern IntPtr GlobalLock(IntPtr hMem);
/// <summary>The GlobalUnlock function decrements the lock count associated with a memory object.</summary>
/// <param name="hMem"></param>
/// <returns></returns>
[DllImport(Lib.Kernel32, SetLastError = true)]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("WinBase.h", MSDNShortId = "aa366595")]
public static extern bool GlobalUnlock(IntPtr hMem);
@ -828,7 +828,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.Kernel32, SetLastError = true), SuppressUnmanagedCodeSecurity]
[DllImport(Lib.Kernel32, ExactSpelling = true, SetLastError = true), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("Winbase.h", MSDNShortId = "ms724948")]
public static extern bool SystemTimeToFileTime(ref SYSTEMTIME lpSystemTime, ref FILETIME lpFileTime);

View File

@ -0,0 +1,55 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Methods, structures and constants imported from Mpr.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Mpr</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
<RootNamespace>Vanara.PInvoke</RootNamespace>
<Authors>David Hall</Authors>
<PackageProjectUrl>https://github.com/dahall/vanara</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/dahall/vanara/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/dahall/Vanara/master/docs/icons/Vanara48x48.png</PackageIconUrl>
<RepositoryUrl>https://github.com/dahall/vanara</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>pinvoke vanara net-extensions interop</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<IncludeSource>true</IncludeSource>
<IncludeSymbols>true</IncludeSymbols>
<Company>GitHub Community</Company>
<Product>Vanara</Product>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net20' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Vanara.Core.csproj" />
<ProjectReference Include="..\Shared\Vanara.PInvoke.Shared.csproj" />
</ItemGroup>
</Project>

145
PInvoke/Mpr/Winnetwk.cs Normal file
View File

@ -0,0 +1,145 @@
using System;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
/// <summary>Items from the mpr.dll</summary>
public static class Mpr
{
/// <summary>The scope of the enumeration.</summary>
public enum NETRESOURCEScope : uint
{
/// <summary>Enumerate currently connected resources. The dwUsage member cannot be specified.</summary>
RESOURCE_CONNECTED = 0x00000001,
/// <summary>Enumerate all resources on the network. The dwUsage member is specified.</summary>
RESOURCE_GLOBALNET = 0x00000002,
/// <summary>Enumerate remembered (persistent) connections. The dwUsage member cannot be specified.</summary>
RESOURCE_REMEMBERED = 0x00000003,
/// <summary>Enumerate recent connections. The dwUsage member cannot be specified.</summary>
RESOURCE_RECENT = 0x00000004,
/// <summary>?</summary>
RESOURCE_CONTEXT = 0x00000005,
}
/// <summary>The type of resource.</summary>
public enum NETRESOURCEType : uint
{
/// <summary>All resources.</summary>
RESOURCETYPE_ANY = 0x00000000,
/// <summary>Disk resources.</summary>
RESOURCETYPE_DISK = 0x00000001,
/// <summary>Print resources.</summary>
RESOURCETYPE_PRINT = 0x00000002,
/// <summary>Reserved resources.</summary>
RESOURCETYPE_RESERVED = 0x00000008,
/// <summary>Neither a disk or print resource.</summary>
RESOURCETYPE_UNKNOWN = 0xFFFFFFFF,
}
/// <summary>A set of bit flags describing how the resource can be used.</summary>
[Flags]
public enum NETRESOURCEUsage : uint
{
/// <summary>The resource is a connectable resource; the name pointed to by the lpRemoteName member can be passed to the WNetAddConnection function to make a network connection.</summary>
RESOURCEUSAGE_CONNECTABLE = 0x00000001,
/// <summary>The resource is a container resource; the name pointed to by the lpRemoteName member can be passed to the WNetOpenEnum function to enumerate the resources in the container.</summary>
RESOURCEUSAGE_CONTAINER = 0x00000002,
/// <summary>The resource is not a local device.</summary>
RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004,
/// <summary>The resource is a sibling. This value is not used by Windows.</summary>
RESOURCEUSAGE_SIBLING = 0x00000008,
/// <summary>The resource must be attached. This value specifies that a function to enumerate resource this should fail if the caller is not authenticated, even if the network permits enumeration without authentication.</summary>
RESOURCEUSAGE_ATTACHED = 0x00000010,
/// <summary>All valid values.</summary>
RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED),
/// <summary>Reserved</summary>
RESOURCEUSAGE_RESERVED = 0x80000000
}
/// <summary>The display options for the network object in a network browsing user interface.</summary>
public enum NETRESOURCEDisplayType : uint
{
/// <summary>The method used to display the object does not matter.</summary>
RESOURCEDISPLAYTYPE_GENERIC = 0x00000000,
/// <summary>The object should be displayed as a domain.</summary>
RESOURCEDISPLAYTYPE_DOMAIN = 0x00000001,
/// <summary>The object should be displayed as a server.</summary>
RESOURCEDISPLAYTYPE_SERVER = 0x00000002,
/// <summary>The object should be displayed as a share.</summary>
RESOURCEDISPLAYTYPE_SHARE = 0x00000003,
/// <summary>The object should be displayed as a file.</summary>
RESOURCEDISPLAYTYPE_FILE = 0x00000004,
/// <summary>The object should be displayed as a group.</summary>
RESOURCEDISPLAYTYPE_GROUP = 0x00000005,
/// <summary>The object should be displayed as a network.</summary>
RESOURCEDISPLAYTYPE_NETWORK = 0x00000006,
/// <summary>The object should be displayed as a logical root for the entire network.</summary>
RESOURCEDISPLAYTYPE_ROOT = 0x00000007,
/// <summary>The object should be displayed as a administrative share.</summary>
RESOURCEDISPLAYTYPE_SHAREADMIN = 0x00000008,
/// <summary>The object should be displayed as a directory.</summary>
RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009,
/// <summary>The object should be displayed as a tree. This display type was used for a NetWare Directory Service (NDS) tree by the NetWare Workstation service supported on Windows XP and earlier.</summary>
RESOURCEDISPLAYTYPE_TREE = 0x0000000A,
/// <summary>The object should be displayed as a Netware Directory Service container. This display type was used by the NetWare Workstation service supported on Windows XP and earlier.</summary>
RESOURCEDISPLAYTYPE_NDSCONTAINER = 0x0000000B,
}
/// <summary>The NETRESOURCE structure contains information about a network resource.</summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct NETRESOURCE
{
/// <summary>The scope of the enumeration.</summary>
public NETRESOURCEScope dwScope;
/// <summary>The type of resource.</summary>
public NETRESOURCEType dwType;
/// <summary>The display options for the network object in a network browsing user interface.</summary>
public NETRESOURCEDisplayType dwDisplayType;
/// <summary>A set of bit flags describing how the resource can be used. Note that this member can be specified only if the dwScope member is equal to RESOURCE_GLOBALNET.</summary>
public NETRESOURCEUsage dwUsage;
/// <summary>If the dwScope member is equal to RESOURCE_CONNECTED or RESOURCE_REMEMBERED, this member is a pointer to a null-terminated character string that specifies the name of a local device. This member is NULL if the connection does not use a device.</summary>
public StrPtrAuto lpLocalName;
/// <summary>If the entry is a network resource, this member is a pointer to a null-terminated character string that specifies the remote network name.
/// <para>If the entry is a current or persistent connection, lpRemoteName member points to the network name associated with the name pointed to by the lpLocalName member.</para>
/// <para>The string can be MAX_PATH characters in length, and it must follow the network provider's naming conventions.</para></summary>
public StrPtrAuto lpRemoteName;
/// <summary>A pointer to a NULL-terminated string that contains a comment supplied by the network provider.</summary>
public StrPtrAuto lpComment;
/// <summary>A pointer to a NULL-terminated string that contains the name of the provider that owns the resource. This member can be NULL if the provider name is unknown. To retrieve the provider name, you can call the WNetGetProviderName function.</summary>
public StrPtrAuto lpProvider;
}
}
}

View File

@ -282,7 +282,7 @@ namespace Vanara.PInvoke
/// <summary>Frees memory allocated for a credentials structure by the DsMakePasswordCredentials function.</summary>
/// <param name="AuthIdentity">Handle of the credential structure to be freed.</param>
[DllImport(Lib.NTDSApi, CharSet = CharSet.Auto)]
[DllImport(Lib.NTDSApi, ExactSpelling = true)]
[PInvokeData("Ntdsapi.h", MSDNShortId = "ms675979")]
public static extern void DsFreePasswordCredentials(IntPtr AuthIdentity);

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from NTDSApi.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.NTDSApi</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from NetApi32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.NetApi32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants for NetListMgr COM object.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.NetListMgr</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -8,7 +8,7 @@ namespace Vanara.PInvoke
{
/// <summary>Frees the specified storage medium.</summary>
/// <param name="pMedium">Pointer to the storage medium that is to be freed.</param>
[DllImport(Lib.Ole32)]
[DllImport(Lib.Ole32, ExactSpelling = true)]
[PInvokeData("Ole2.h", MSDNShortId = "ms693491")]
public static extern void ReleaseStgMedium([In] ref STGMEDIUM pMedium);

View File

@ -33,7 +33,7 @@ namespace Vanara.PInvoke
/// <item><term>STG_E_INVALID_PARAMETER</term><definition>The variant has an unknown VT type.</definition></item>
/// </list>
/// </returns>
[DllImport(Lib.Ole32)]
[DllImport(Lib.Ole32, ExactSpelling = true)]
[PInvokeData("Propidl.h", MSDNShortId = "aa380192")]
public static extern HRESULT PropVariantCopy([In, Out] PROPVARIANT pDst, [In] PROPVARIANT pSrc);
}

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from Ole32.dll, OleAut32 and PropSys.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Ole</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -12,7 +12,7 @@ namespace Vanara.PInvoke
/// <param name="AceCnt">Number of entries in pInheritArray.</param>
/// <param name="pfnArray">Unused. Set to NULL.</param>
/// <returns>If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, it returns a nonzero error code.</returns>
[DllImport(Lib.AdvApi32)]
[DllImport(Lib.AdvApi32, ExactSpelling = true)]
[PInvokeData("Aclapi.h", MSDNShortId = "aa446630")]
public static extern Win32Error FreeInheritedFromArray(IntPtr pInheritArray, ushort AceCnt, IntPtr pfnArray);

View File

@ -33,7 +33,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("winbase.h", MSDNShortId = "aa375213")]
public static extern bool AllocateAndInitializeSid([In] PSID_IDENTIFIER_AUTHORITY sia,
@ -48,7 +48,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("Winbase.h", MSDNShortId = "aa376404")]
public static extern bool CopySid(int cbDestSid, IntPtr destSid, IntPtr sourceSid);
@ -61,7 +61,7 @@ namespace Vanara.PInvoke
/// <para>If the SID structures are not equal, the return value is zero. To get extended error information, call GetLastError.</para>
/// <para>If either SID structure is not valid, the return value is undefined.</para>
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446622")]
public static extern bool EqualSid(PSID sid1, PSID sid2);
@ -74,7 +74,7 @@ namespace Vanara.PInvoke
/// <para>If the SID structures are not equal, the return value is zero. To get extended error information, call GetLastError.</para>
/// <para>If either SID structure is not valid, the return value is undefined.</para>
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446622")]
public static extern bool EqualSid(IntPtr sid1, IntPtr sid2);
@ -84,7 +84,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the function returns NULL. If the function fails, it returns a pointer to the SID structure represented by the pSid parameter.
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446631")]
public static extern IntPtr FreeSid(IntPtr pSid);
@ -97,7 +97,7 @@ namespace Vanara.PInvoke
/// the SID is valid.
/// </para>
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446642")]
public static extern int GetLengthSid(IntPtr pSid);

View File

@ -245,7 +245,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the function returns nonzero. If the function fails, it returns zero. To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.AdvApi32, CharSet = CharSet.Unicode, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446634")]
public static extern bool GetAce(IntPtr pAcl, int dwAceIndex, out IntPtr pAce);
@ -276,7 +276,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the function returns nonzero. If the function fails, it returns zero. To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446635")]
public static extern bool GetAclInformation(IntPtr pAcl, ref ACL_REVISION_INFORMATION pAclInformation, uint nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass);
@ -306,7 +306,7 @@ namespace Vanara.PInvoke
/// <returns>
/// If the function succeeds, the function returns nonzero. If the function fails, it returns zero. To get extended error information, call GetLastError.
/// </returns>
[DllImport(Lib.AdvApi32, SetLastError = true)]
[DllImport(Lib.AdvApi32, ExactSpelling = true, SetLastError = true)]
[PInvokeData("Winbase.h", MSDNShortId = "aa446635")]
public static extern bool GetAclInformation(IntPtr pAcl, ref ACL_SIZE_INFORMATION pAclInformation, uint nAclInformationLength, ACL_INFORMATION_CLASS dwAclInformationClass);

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from AdvApi32.dll, Authz.dll and Secur32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Security</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Shared methods, structures and constants for use throughout the Vanara.PInvoke assemblies</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard20</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Shared</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -259,14 +259,66 @@ namespace Vanara.PInvoke
SLDF_PERSIST_VOLUME_ID_RELATIVE = 0x08000000,
}
/// <summary>Receives a value that determines what type the item is in <see cref="SHDESCRIPTIONID"/>.</summary>
[PInvokeData("Shlobj_core.h", MSDNShortId = "bb759775")]
public enum SHDID
{
/// <summary>The item is a registered item on the desktop.</summary>
SHDID_ROOT_REGITEM = 1,
/// <summary>The item is a file.</summary>
SHDID_FS_FILE = 2,
/// <summary>The item is a folder.</summary>
SHDID_FS_DIRECTORY = 3,
/// <summary>The item is an unidentified item in the file system.</summary>
SHDID_FS_OTHER = 4,
/// <summary>The item is a 3.5-inch floppy drive.</summary>
SHDID_COMPUTER_DRIVE35 = 5,
/// <summary>The item is a 5.25-inch floppy drive.</summary>
SHDID_COMPUTER_DRIVE525 = 6,
/// <summary>The item is a removable disk.</summary>
SHDID_COMPUTER_REMOVABLE = 7,
/// <summary>The item is a fixed hard disk.</summary>
SHDID_COMPUTER_FIXED = 8,
/// <summary>The item is a drive that is mapped to a network share.</summary>
SHDID_COMPUTER_NETDRIVE = 9,
/// <summary>The item is a CD-ROM drive.</summary>
SHDID_COMPUTER_CDROM = 10,
/// <summary>The item is a RAM disk.</summary>
SHDID_COMPUTER_RAMDISK = 11,
/// <summary>The item is an unidentified system device.</summary>
SHDID_COMPUTER_OTHER = 12,
/// <summary>The item is a network domain.</summary>
SHDID_NET_DOMAIN = 13,
/// <summary>The item is a network server.</summary>
SHDID_NET_SERVER = 14,
/// <summary>The item is a network share.</summary>
SHDID_NET_SHARE = 15,
/// <summary>Not currently used.</summary>
SHDID_NET_RESTOFNET = 16,
/// <summary>The item is an unidentified network resource.</summary>
SHDID_NET_OTHER = 17,
/// <summary>Windows XP and later. Not currently used.</summary>
SHDID_COMPUTER_IMAGING = 18,
/// <summary>Windows XP and later. Not currently used.</summary>
SHDID_COMPUTER_AUDIO = 19,
/// <summary>Windows XP and later. The item is the system shared documents folder.</summary>
SHDID_COMPUTER_SHAREDDOCS = 20,
/// <summary>Windows Vista and later. The item is a mobile device, such as a personal digital assistant (PDA).</summary>
SHDID_MOBILE_DEVICE = 21,
}
[PInvokeData("Shlobj.h", MSDNShortId = "bb762174")]
public enum SHGetDataFormat
{
/// <summary>Format used for file system objects. The pv parameter is the address of a WIN32_FIND_DATA structure.</summary>
[CorrespondingType(typeof(WIN32_FIND_DATA), CorrepsondingAction.Get)]
SHGDFIL_FINDDATA = 1,
/// <summary>Format used for network resources. The pv parameter is the address of a NETRESOURCE structure.</summary>
// TODO: Define NETRESOURCE (https://msdn.microsoft.com/en-us/library/windows/desktop/aa385353(v=vs.85).aspx)
//[CorrespondingType(typeof(NETRESOURCE), CorrepsondingAction.Get)]
SHGDFIL_NETRESOURCE = 2,
/// <summary>Version 4.71. Format used for network resources. The pv parameter is the address of an SHDESCRIPTIONID structure.</summary>
[CorrespondingType(typeof(SHDESCRIPTIONID), CorrepsondingAction.Get)]
SHGDFIL_DESCRIPTIONID = 3
}
@ -400,7 +452,7 @@ namespace Vanara.PInvoke
/// <param name="cb">Size of the buffer at pv, in bytes.</param>
/// <remarks>This function extracts only information that is present in the pointer to an item identifier list (PIDL). Since the content of a PIDL depends on the folder object that created the PIDL, there is no guarantee that all requested information will be available. In addition, the information that is returned reflects the state of the object at the time the PIDL was created. The current state of the object could be different. For example, if you set nFormat to SHGDFIL_FINDDATA, the function might assign meaningful values to only some of the members of the WIN32_FIND_DATA structure. The remaining members will be set to zero. To retrieve complete current information on a file system file or folder, use standard file system functions such as GetFileTime or FindFirstFile.
/// <para>E_INVALIDARG is returned if the psf, pidl, pv, or cb parameter does not match the nFormat parameter, or if nFormat is not one of the specific SHGDFIL_ values shown above.</para></remarks>
[DllImport(Lib.Shell32, CharSet = CharSet.Unicode, ExactSpelling = true)]
[DllImport(Lib.Shell32, CharSet = CharSet.Auto)]
[SecurityCritical, SuppressUnmanagedCodeSecurity]
[PInvokeData("Shlobj.h", MSDNShortId = "bb762174")]
public static extern HRESULT SHGetDataFromIDList([In, MarshalAs(UnmanagedType.Interface)] IShellFolder psf, [In] PIDL pidl, SHGetDataFormat nFormat, [In, Out] IntPtr pv, int cb);
@ -794,6 +846,17 @@ namespace Vanara.PInvoke
public uint uCodePage;
}
/// <summary>Receives item data in response to a call to SHGetDataFromIDList.</summary>
[StructLayout(LayoutKind.Sequential)]
[PInvokeData("Shlobj.h", MSDNShortId = "bb759775")]
public struct SHDESCRIPTIONID
{
/// <summary>Receives a value that determines what type the item is. </summary>
public SHDID dwDescriptionId;
/// <summary>Receives the CLSID of the object to which the item belongs.</summary>
public Guid clsid;
}
/// <summary>
/// CSIDL (constant special item ID list) values provide a unique system-independent way to identify special folders used frequently by applications, but which may not have the same name or location on any given system. For example, the system folder may be "C:\Windows" on one system and "C:\Winnt" on another. These constants are defined in Shlobj.h.
/// </summary>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from Shell32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Shell32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from ShlwApi.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.ShlwApi</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported for Task Scheduler 1.0 and 2.0 COM objects.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.TaskSchd</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from User32.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.User32</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -363,7 +363,7 @@ namespace Vanara.PInvoke
/// </summary>
/// <param name="hIcon">A handle to the icon to be destroyed. The icon must not be in use.</param>
/// <returns>If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended error information, call GetLastError.</returns>
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool DestroyIcon(IntPtr hIcon);
@ -553,7 +553,7 @@ namespace Vanara.PInvoke
/// <param name="cy">The new height of the window, in pixels.</param>
/// <param name="uFlags">The window sizing and positioning flags.</param>
/// <returns>If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended error information, call GetLastError.</returns>
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
[System.Security.SecurityCritical]
public static extern bool SetWindowPos(HandleRef hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, SetWindowPosFlags uFlags);
@ -575,7 +575,7 @@ namespace Vanara.PInvoke
/// The return value is a handle to the window that contains the point. If no window exists at the given point, the return value is NULL. If the point is
/// over a static text control, the return value is a handle to the window under the static text control.
/// </returns>
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
public static extern IntPtr WindowFromPoint(Point Point);
/// <summary>

View File

@ -232,7 +232,7 @@ namespace Vanara.PInvoke
/// <returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
/// <remarks>The hook procedure can be in the state of being called by another thread even after UnhookWindowsHookEx returns. If the hook procedure is not being called concurrently, the hook procedure is removed immediately before UnhookWindowsHookEx returns.</remarks>
[PInvokeData("WinUser.h", MSDNShortId = "ms644993")]
[DllImport(Lib.User32, SetLastError = true, CharSet = CharSet.Auto)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool UnhookWindowsHookEx(IntPtr hhk);

View File

@ -20,10 +20,10 @@ namespace Vanara.PInvoke
MOD_NOREPEAT = 0x4000,
}
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
public static extern int RegisterHotKey(HandleRef hWnd, int id, HotKeyModifiers fsModifiers, uint vk);
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
public static extern int UnregisterHotKey(HandleRef hWnd, int id);
}

View File

@ -70,7 +70,7 @@ namespace Vanara.PInvoke
/// <param name="uFlags">Specifies the type of shutdown.</param>
/// <param name="dwReason">The reason for initiating the shutdown.</param>
/// <returns>If the function succeeds, the return value is nonzero.<br></br><br>If the function fails, the return value is zero. To get extended error information, call Marshal.GetLastWin32Error.</br></returns>
[DllImport(Lib.User32, SetLastError = true)]
[DllImport(Lib.User32, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool ExitWindowsEx(ExitWindowsFlags uFlags, SystemShutDownReason dwReason);

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from UxTheme.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.UxTheme</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from VirtDisk.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.VirtDisk</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Methods, structures and constants imported from WinINet.dll.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.WinINet</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>

View File

@ -1269,7 +1269,7 @@ namespace Vanara.PInvoke
/// <summary>Closes a single Internet handle.</summary>
/// <param name="hInternet">Handle to be closed.</param>
/// <returns>Returns TRUE if the handle is successfully closed, or FALSE otherwise. To get extended error information, call GetLastError.</returns>
[DllImport(Lib.WinInet, CharSet = CharSet.Auto, SetLastError = true)]
[DllImport(Lib.WinInet, ExactSpelling = true, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool InternetCloseHandle(IntPtr hInternet);

View File

@ -4,7 +4,7 @@
<Description>Wrapper classes for security related items in the Vanara PInvoke libraries.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>Vanara.Security</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.Security</AssemblyName>
<PackageId>Vanara.Security</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Wrapper classes for system related items in the Vanara PInvoke libraries.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>Vanara.SystemServices</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Vanara.SystemServices</AssemblyName>
<PackageId>Vanara.SystemServices</PackageId>

View File

@ -4,7 +4,7 @@
<Description>Wrapper classes for user interface related items in the Vanara PInvoke libraries.</Description>
<Copyright>Copyright © 2017</Copyright>
<AssemblyTitle>Vanara.UI</AssemblyTitle>
<VersionPrefix>1.0.2</VersionPrefix>
<VersionPrefix>1.0.3</VersionPrefix>
<TargetFrameworks>net20;net35;net40;net45</TargetFrameworks>
<AssemblyName>Vanara.UI</AssemblyName>
<PackageId>Vanara.UI</PackageId>

View File

@ -67,6 +67,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\Unit
EndProject
Project("{7CF6DF6D-3B04-46F8-A40B-537D21BCA0B4}") = "HelpBuilder", "HelpBuilder\HelpBuilder.shfbproj", "{8A2AE72B-18A3-4944-B15C-06DEC99E52C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.Mpr", "PInvoke\Mpr\Vanara.PInvoke.Mpr.csproj", "{E91C263F-82D9-40A9-99A1-F879CB076BCE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.Crypt32", "PInvoke\Crypt32\Vanara.PInvoke.Crypt32.csproj", "{BD86FD1B-D52E-4B78-89AC-36D89458EBD8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -169,7 +173,14 @@ Global
{3C9E407F-9D0B-4B54-B181-BA5476B8D2DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A2AE72B-18A3-4944-B15C-06DEC99E52C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A2AE72B-18A3-4944-B15C-06DEC99E52C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A2AE72B-18A3-4944-B15C-06DEC99E52C0}.Release|Any CPU.Build.0 = Release|Any CPU
{E91C263F-82D9-40A9-99A1-F879CB076BCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E91C263F-82D9-40A9-99A1-F879CB076BCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E91C263F-82D9-40A9-99A1-F879CB076BCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E91C263F-82D9-40A9-99A1-F879CB076BCE}.Release|Any CPU.Build.0 = Release|Any CPU
{BD86FD1B-D52E-4B78-89AC-36D89458EBD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD86FD1B-D52E-4B78-89AC-36D89458EBD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD86FD1B-D52E-4B78-89AC-36D89458EBD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD86FD1B-D52E-4B78-89AC-36D89458EBD8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -194,6 +205,8 @@ Global
{E8A0C4DF-541C-4435-937B-2865CD61BB17} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{392A14B0-1E10-4E88-9C13-0D965665FFB5} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{BBE4A7D6-0B24-4F58-9726-E05F358C1256} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{E91C263F-82D9-40A9-99A1-F879CB076BCE} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{BD86FD1B-D52E-4B78-89AC-36D89458EBD8} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {543FAC75-2AF1-4EF1-9609-B242B63FEED4}