BREAKING CHANGE: Removed ResourceId and ResourceIdUni as they pose a major risk for memory leaks. Updated dependent structures PROPSHEETPAGE and TASKDIALOGCONFIG with IntPtr and supporting properties.

pull/10/head
David Hall 2018-08-18 19:33:00 -06:00
parent db679de068
commit 733e30b868
17 changed files with 784 additions and 570 deletions

View File

@ -1,6 +1,8 @@
using System;
using System.Runtime.InteropServices;
using Vanara.Extensions;
using Vanara.InteropServices;
using static Vanara.PInvoke.Macros;
using static Vanara.PInvoke.User32_Gdi;
// ReSharper disable FieldCanBeMadeReadOnly.Global
@ -39,7 +41,7 @@ namespace Vanara.PInvoke
/// <returns>The return value depends on the value of the uMsg parameter.</returns>
[PInvokeData("Commctrl.h", MSDNShortId = "bb760813")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
public delegate uint PropSheetPageProc(IntPtr hwnd, PropSheetPageCallbackAction uMsg, ref PROPSHEETPAGE ppsp);
public delegate uint PropSheetPageProc(IntPtr hwnd, PropSheetPageCallbackAction uMsg, PROPSHEETPAGE ppsp);
/// <summary>
/// An application-defined callback function that the system calls when the property sheet is being created and initialized.
@ -216,7 +218,7 @@ namespace Vanara.PInvoke
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb760807(v=vs.85).aspx
[DllImport(Lib.ComCtl32, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("Prsht.h", MSDNShortId = "bb760807")]
public static extern SafePropertySheetPagehandle CreatePropertySheetPage(ref PROPSHEETPAGE lppsp);
public static extern SafePropertySheetPagehandle CreatePropertySheetPage(PROPSHEETPAGE lppsp);
/// <summary>Destroys a property sheet page. An application must call this function for pages that have not been passed to the <c>PropertySheet</c> function.</summary><param name="hPSPage"><para>Type: <c>HPROPSHEETPAGE</c></para><para>Handle to the property sheet page to delete.</para></param><returns><para>Type: <c><c>BOOL</c></c></para><para>Returns nonzero if successful, or zero otherwise.</para></returns>
// BOOL DestroyPropertySheetPage( HPROPSHEETPAGE hPSPage);
@ -234,6 +236,7 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.SysInt)]
public static extern int PropertySheet(ref PROPSHEETHEADER psh);
// TODO: Convert resource id fields to managed properties.
/// <summary>Defines the frame and pages of a property sheet.</summary>
[PInvokeData("Commctrl.h", MSDNShortId = "bb774546")]
[StructLayout(LayoutKind.Sequential)]
@ -327,10 +330,10 @@ namespace Vanara.PInvoke
/// <summary>Defines a page in a property sheet.</summary>
[PInvokeData("Commctrl.h", MSDNShortId = "bb774548")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct PROPSHEETPAGE
public class PROPSHEETPAGE : IDisposable
{
/// <summary>Size, in bytes, of this structure.</summary>
public int dwSize;
public uint dwSize;
/// <summary>Flags that indicate which options to use when creating the property sheet page.</summary>
public PropSheetFlags dwFlags;
/// <summary>
@ -343,7 +346,7 @@ namespace Vanara.PInvoke
/// that specifies the name of the template. If the PSP_DLGINDIRECT flag in the dwFlags member is set, pszTemplate is ignored. This member is
/// declared as a union with pResource.
/// </summary>
public ResourceId pszTemplate;
private IntPtr _pszTemplate;
/// <summary>
/// Handle to the icon to use as the icon in the tab of the page. If the dwFlags member does not include PSP_USEHICON, this member is ignored. This
/// member is declared as a union with pszIcon.
@ -354,14 +357,13 @@ namespace Vanara.PInvoke
/// is declared as a union with hIcon.
/// </para>
/// </summary>
public ResourceId hIcon;
private IntPtr _hIcon;
/// <summary>
/// Title of the property sheet dialog box. This title overrides the title specified in the dialog box template. This member can specify either the
/// identifier of a string resource or the address of a string that specifies the title. To use this member, you must set the PSP_USETITLE flag in
/// the dwFlags member.
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszTitle;
private IntPtr _pszTitle;
/// <summary>
/// Pointer to the dialog box procedure for the page. Because the pages are created as modeless dialog boxes, the dialog box procedure must not call
/// the EndDialog function.
@ -377,9 +379,9 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function that is called when the page is created and when it is about to be destroyed. For more
/// information about the callback function, see PropSheetPageProc. To use this member, you must set the PSP_USECALLBACK flag in the dwFlags member.
/// </summary>
public PropSheetPageProc pfnCallback;
private PropSheetPageProc _pfnCallback;
/// <summary>Pointer to the reference count value. To use this member, you must set the PSP_USEREFPARENT flag in the dwFlags member.</summary>
public IntPtr pcRefParent;
private IntPtr _pcRefParent;
/// <summary>
/// Version 5.80 or later. Title of the header area. To use this member under the Wizard97-style wizard, you must also do the following:
/// <list type="bullet">
@ -394,8 +396,7 @@ namespace Vanara.PInvoke
/// </item>
/// </list>
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszHeaderTitle;
private IntPtr _pszHeaderTitle;
/// <summary>
/// Version 5.80 or later. Subtitle of the header area. To use this member, you must do the following:
/// <list type="bullet">
@ -411,13 +412,188 @@ namespace Vanara.PInvoke
/// </list>
/// <note>This member is ignored when using the Aero-style wizard (PSH_AEROWIZARD).</note>
/// </summary>
[MarshalAs(UnmanagedType.LPTStr)]
public string pszHeaderSubTitle;
private IntPtr _pszHeaderSubTitle;
/// <summary>
/// Version 6.0 or later. An activation context handle. Set this member to the handle that is returned when you create the activation context with
/// CreateActCtx. The system will activate this context before creating the dialog box. You do not need to use this member if you use a global manifest.
/// </summary>
public IntPtr hActCtx;
/// <summary>Initializes a new instance of the <see cref="PROPSHEETPAGE"/> class and sets the value of <see cref="dwSize"/>.</summary>
public PROPSHEETPAGE()
{
dwSize = (uint)Marshal.SizeOf(this);
}
/// <summary>
/// Dialog box template to use to create the page. This member can specify either the resource identifier of the template or the address of a string
/// that specifies the name of the template. If the PSP_DLGINDIRECT flag in the dwFlags member is set, pszTemplate is ignored.
/// </summary>
public SafeResourceId pszTemplate
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_DLGINDIRECT) ? SafeResourceId.Null : new SafeResourceId(_pszTemplate);
set
{
if (!dwFlags.IsFlagSet(PropSheetFlags.PSP_DLGINDIRECT)) FreeResource(ref _pszTemplate);
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_DLGINDIRECT, false);
_pszTemplate = value.GetClonedHandle();
}
}
/// <summary>
/// A pointer to a dialog box template in memory. The PropertySheet function assumes that the template is in writeable memory; a
/// read-only template will cause an exception on some versions of Windows. If dwFlags does not include the PSP_DLGINDIRECT
/// value, this member is ignored.
/// </summary>
public IntPtr pResource
{
get => _pszTemplate;
set
{
if (!dwFlags.IsFlagSet(PropSheetFlags.PSP_DLGINDIRECT)) FreeResource(ref _pszTemplate);
_pszTemplate = value;
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_DLGINDIRECT, true);
}
}
/// <summary>
/// A handle to the icon to use as the small icon in the tab for the page. If dwFlags does not include the PSP_USEHICON value, this member is ignored.
/// </summary>
public IntPtr hIcon
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_USEHICON) ? _hIcon : IntPtr.Zero;
set
{
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USEICONID)) FreeResource(ref _pszTemplate);
_hIcon = value;
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USEICONID, false) | PropSheetFlags.PSP_USEHICON;
}
}
/// <summary>
/// Icon resource to use as the small icon in the tab for the page. This member can specify either the identifier of the icon
/// resource or the pointer to the string that specifies the name of the icon resource. If dwFlags does not include the
/// PSP_USEICONID value, this member is ignored.
/// </summary>
public SafeResourceId pszIcon
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_USEICONID) ? new SafeResourceId(_hIcon) : SafeResourceId.Null;
set
{
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USEICONID)) FreeResource(ref _hIcon);
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USEHICON, false) | PropSheetFlags.PSP_USEICONID;
_hIcon = value.GetClonedHandle();
}
}
/// <summary>
/// Title of the property sheet dialog box. This title overrides the title specified in the dialog box template. This member can
/// specify either the identifier of a string resource or the pointer to a string that specifies the title. If dwFlags does not
/// include the PSP_USETITLE value, this member is ignored.
/// </summary>
public SafeResourceId pszTitle
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_USETITLE) ? new SafeResourceId(_pszTitle) : SafeResourceId.Null;
set
{
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USETITLE)) FreeResource(ref _pszTitle);
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USETITLE, !value.IsInvalid);
_pszTitle = value.GetClonedHandle();
}
}
/// <summary>
/// Version 5.80 or later. Title of the header area. To use this member under the Wizard97-style wizard, you must also do the following:
/// <list type="bullet">
/// <item>
/// <term>Set the PSP_USEHEADERTITLE flag in the dwFlags member.</term>
/// </item>
/// <item>
/// <term>Set the PSH_WIZARD97 flag in the dwFlags member of the page's PROPSHEETHEADER structure.</term>
/// </item>
/// <item>
/// <term>Make sure that the PSP_HIDEHEADER flag in the dwFlags member is not set.</term>
/// </item>
/// </list>
/// </summary>
public SafeResourceId pszHeaderTitle
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_USEHEADERTITLE) ? new SafeResourceId(_pszHeaderTitle) : SafeResourceId.Null;
set
{
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USEHEADERTITLE)) FreeResource(ref _pszHeaderTitle);
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USEHEADERTITLE, !value.IsInvalid);
_pszHeaderTitle = value.GetClonedHandle();
}
}
/// <summary>
/// Version 5.80 or later. Subtitle of the header area. To use this member, you must do the following:
/// <list type="bullet">
/// <item>
/// <term>Set the PSP_USEHEADERSUBTITLE flag in the dwFlags member.</term>
/// </item>
/// <item>
/// <term>Set the PSH_WIZARD97 flag in the dwFlags member of the page's PROPSHEETHEADER structure.</term>
/// </item>
/// <item>
/// <term>Make sure that the PSP_HIDEHEADER flag in the dwFlags member is not set.</term>
/// </item>
/// </list>
/// <note>This member is ignored when using the Aero-style wizard (PSH_AEROWIZARD).</note>
/// </summary>
public SafeResourceId pszHeaderSubTitle
{
get => dwFlags.IsFlagSet(PropSheetFlags.PSP_USEHEADERSUBTITLE) ? new SafeResourceId(_pszHeaderSubTitle) : SafeResourceId.Null;
set
{
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USEHEADERSUBTITLE)) FreeResource(ref _pszHeaderSubTitle);
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USEHEADERSUBTITLE, !value.IsInvalid);
_pszHeaderSubTitle = value.GetClonedHandle();
}
}
/// <summary>
/// Pointer to an application-defined callback function that is called when the page is created and when it is about to be destroyed. For more
/// information about the callback function, see PropSheetPageProc. To use this member, you must set the PSP_USECALLBACK flag in the dwFlags member.
/// </summary>
public PropSheetPageProc pfnCallback
{
get => _pfnCallback;
set
{
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USECALLBACK, value != null);
_pfnCallback = value;
}
}
/// <summary>Pointer to the reference count value. To use this member, you must set the PSP_USEREFPARENT flag in the dwFlags member.</summary>
public IntPtr pcRefParent
{
get => _pcRefParent;
set
{
dwFlags = dwFlags.SetFlags(PropSheetFlags.PSP_USEREFPARENT, value != IntPtr.Zero);
_pcRefParent = value;
}
}
/// <inheritdoc/>
void IDisposable.Dispose()
{
if (!dwFlags.IsFlagSet(PropSheetFlags.PSP_DLGINDIRECT)) FreeResource(ref _pszTemplate);
if (dwFlags.IsFlagSet(PropSheetFlags.PSP_USEICONID)) FreeResource(ref _hIcon);
FreeResource(ref _pszTitle);
FreeResource(ref _pszHeaderTitle);
FreeResource(ref _pszHeaderSubTitle);
}
private static void FreeResource(ref IntPtr ptr)
{
if (IS_INTRESOURCE(ptr) || ptr == IntPtr.Zero) return;
StringHelper.FreeString(ptr);
ptr = IntPtr.Zero;
}
}
/// <summary>Safe handle for property sheet pages.</summary>

View File

@ -1,7 +1,9 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using Vanara.Extensions;
using static Vanara.PInvoke.Kernel32;
using static Vanara.PInvoke.Macros;
using static Vanara.PInvoke.User32_Gdi;
// ReSharper disable InconsistentNaming
@ -19,6 +21,7 @@ namespace Vanara.PInvoke
/// <param name="refData">The reference data that was set to TaskDialog.CallbackData.</param>
/// <returns>A HRESULT value. The return value is specific to the message being processed.</returns>
[PInvokeData("Commctrl.h", MSDNShortId = "bb760542")]
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate HRESULT TaskDialogCallbackProc([In] IntPtr hwnd, [In] TaskDialogNotification msg, [In] IntPtr wParam, [In] IntPtr lParam, [In] IntPtr refData);
/// <summary>Specifies the push buttons displayed in the task dialog. If no common buttons are specified and no custom buttons are specified using the cButtons and pButtons members, the task dialog will contain the OK button by default. This parameter may be a combination of flags</summary>
@ -317,7 +320,7 @@ namespace Vanara.PInvoke
/// </returns>
[PInvokeData("Commctrl.h", MSDNShortId = "bb760544")]
[DllImport(Lib.ComCtl32, CharSet = CharSet.Unicode, ExactSpelling = true)]
public static extern HRESULT TaskDialogIndirect(ref TASKDIALOGCONFIG pTaskConfig, out int pnButton, out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);
public static extern HRESULT TaskDialogIndirect(TASKDIALOGCONFIG pTaskConfig, out int pnButton, out int pnRadioButton, [MarshalAs(UnmanagedType.Bool)] out bool pfVerificationFlagChecked);
/// <summary>
/// The TASKDIALOG_BUTTON structure contains information used to display a button in a task dialog. The TASKDIALOGCONFIG structure uses this structure.
@ -329,99 +332,283 @@ namespace Vanara.PInvoke
/// <summary>Indicates the value to be returned when this button is selected.</summary>
public int nButtonID;
/// <summary>Pointer that references the string to be used to label the button. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. When using Command Links, you delineate the command from the note by placing a new line character in the string.</summary>
public ResourceIdUni pszButtonText;
public IntPtr pszButtonText;
}
/// <summary>The TASKDIALOGCONFIG structure contains information used to display a task dialog. The TaskDialogIndirect function uses this structure.</summary>
[PInvokeData("Commctrl.h", MSDNShortId = "bb787473")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 1)]
public struct TASKDIALOGCONFIG
/// <summary>
/// The <c>TASKDIALOGCONFIG</c> structure contains information used to display a task dialog. The TaskDialogIndirect function uses
/// this structure.
/// </summary>
// https://docs.microsoft.com/en-us/windows/desktop/api/commctrl/ns-commctrl-_taskdialogconfig
[PInvokeData("commctrl.h", MSDNShortId = "bb787473")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public class TASKDIALOGCONFIG : IDisposable
{
/// <summary>Specifies the structure size, in bytes.</summary>
public uint cbSize;
/// <summary>Handle to the parent window. This member can be NULL.</summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
public IntPtr hwndParent;
/// <summary>Handle to the module that contains the icon resource identified by the pszMainIcon or pszFooterIcon members, and the string resources identified by the pszWindowTitle, pszMainInstruction, pszContent, pszVerificationText, pszExpandedInformation, pszExpandedControlText, pszCollapsedControlText or pszFooter members.</summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
/// <summary>
/// Handle to the module that contains the icon resource identified by the pszMainIcon or pszFooterIcon members, and the string
/// resources identified by the pszWindowTitle, pszMainInstruction, pszContent, pszVerificationText, pszExpandedInformation,
/// pszExpandedControlText, pszCollapsedControlText or pszFooter members.
/// </summary>
public IntPtr hInstance;
/// <summary>Specifies the behavior of the task dialog. This parameter can be a combination of flags.</summary>
public TASKDIALOG_FLAGS dwFlags;
/// <summary>Specifies the push buttons displayed in the task dialog. If no common buttons are specified and no custom buttons are specified using the cButtons and pButtons members, the task dialog will contain the OK button by default. This parameter may be a combination of flags.</summary>
/// <summary>
/// Specifies the push buttons displayed in the task dialog. If no common buttons are specified and no custom buttons are
/// specified using the cButtons and pButtons members, the task dialog will contain the OK button by default. This parameter may
/// be a combination of flags.
/// </summary>
public TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons;
/// <summary>Pointer that references the string to be used for the task dialog title. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If this parameter is NULL, the filename of the executable program is used.</summary>
public ResourceIdUni pszWindowTitle;
/// <summary>A handle to an Icon that is to be displayed in the task dialog. This member is ignored unless the TDF_USE_HICON_MAIN flag is specified. If this member is NULL and the TDF_USE_HICON_MAIN is specified, no icon will be displayed.
/// <para><c>OR</c></para>
/// <para>Pointer that references the icon to be displayed in the task dialog. This parameter is ignored if the USE_HICON_MAIN flag is specified. Otherwise, if this parameter is NULL or the hInstance parameter is NULL, no icon will be displayed. This parameter must be an integer resource identifier passed to the MAKEINTRESOURCE macro.</para>
/// <summary>
/// Pointer that references the string to be used for the task dialog title. This parameter can be either a null-terminated
/// string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If this parameter is NULL, the filename of the
/// executable program is used.
/// </summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
public ResourceIdUni mainIcon;
public IntPtr pszWindowTitle;
/// <summary>Pointer that references the string to be used for the main instruction. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro.</summary>
public ResourceIdUni pszMainInstruction;
/// <summary>
/// A handle to an Icon that is to be displayed in the task dialog. This member is ignored unless the TDF_USE_HICON_MAIN flag is
/// specified. If this member is NULL and the TDF_USE_HICON_MAIN is specified, no icon will be displayed.
/// <para><c>OR</c></para>
/// <para>
/// Pointer that references the icon to be displayed in the task dialog. This parameter is ignored if the USE_HICON_MAIN flag is
/// specified. Otherwise, if this parameter is NULL or the hInstance parameter is NULL, no icon will be displayed. This parameter
/// must be an integer resource identifier passed to the MAKEINTRESOURCE macro.
/// </para>
/// </summary>
public IntPtr mainIcon;
/// <summary>Pointer that references the string to be used for the dialog's primary content. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If the ENABLE_HYPERLINKS flag is specified for the dwFlags member, then this string may contain hyperlinks in the form: <A HREF="executablestring">Hyperlink Text</A>. WARNING: Enabling hyperlinks when using content from an unsafe source may cause security vulnerabilities.</summary>
public ResourceIdUni pszContent;
/// <summary>
/// Pointer that references the string to be used for the main instruction. This parameter can be either a null-terminated string
/// or an integer resource identifier passed to the MAKEINTRESOURCE macro.
/// </summary>
public IntPtr pszMainInstruction;
/// <summary>The number of entries in the pButtons array that is used to create buttons or command links in the task dialog. If this member is zero and no common buttons have been specified using the dwCommonButtons member, then the task dialog will have a single OK button displayed.</summary>
/// <summary>
/// Pointer that references the string to be used for the dialog's primary content. This parameter can be either a
/// null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If the ENABLE_HYPERLINKS flag
/// is specified for the dwFlags member, then this string may contain hyperlinks in the form: <A
/// HREF="executablestring">Hyperlink Text</A>. WARNING: Enabling hyperlinks when using content from an unsafe source may cause
/// security vulnerabilities.
/// </summary>
public IntPtr pszContent;
/// <summary>
/// The number of entries in the pButtons array that is used to create buttons or command links in the task dialog. If this
/// member is zero and no common buttons have been specified using the dwCommonButtons member, then the task dialog will have a
/// single OK button displayed.
/// </summary>
public uint cButtons;
/// <summary>Pointer to an array of TASKDIALOG_BUTTON structures containing the definition of the custom buttons that are to be displayed in the task dialog. This array must contain at least the number of entries that are specified by the cButtons member.</summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
/// <summary>
/// Pointer to an array of TASKDIALOG_BUTTON structures containing the definition of the custom buttons that are to be displayed
/// in the task dialog. This array must contain at least the number of entries that are specified by the cButtons member.
/// </summary>
public IntPtr pButtons;
/// <summary>The default button for the task dialog. This may be any of the values specified in nButtonID members of one of the TASKDIALOG_BUTTON structures in the pButtons array, or one of the IDs corresponding to the buttons specified in the dwCommonButtons member. If this member is zero or its value does not correspond to any button ID in the dialog, then the first button in the dialog will be the default.</summary>
/// <summary>
/// The default button for the task dialog. This may be any of the values specified in nButtonID members of one of the
/// TASKDIALOG_BUTTON structures in the pButtons array, or one of the IDs corresponding to the buttons specified in the
/// dwCommonButtons member. If this member is zero or its value does not correspond to any button ID in the dialog, then the
/// first button in the dialog will be the default.
/// </summary>
public int nDefaultButton;
/// <summary>The number of entries in the pRadioButtons array that is used to create radio buttons in the task dialog.</summary>
public uint cRadioButtons;
/// <summary>Pointer to an array of TASKDIALOG_BUTTON structures containing the definition of the radio buttons that are to be displayed in the task dialog. This array must contain at least the number of entries that are specified by the cRadioButtons member. This parameter can be NULL.</summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
/// <summary>
/// Pointer to an array of TASKDIALOG_BUTTON structures containing the definition of the radio buttons that are to be displayed
/// in the task dialog. This array must contain at least the number of entries that are specified by the cRadioButtons member.
/// This parameter can be NULL.
/// </summary>
public IntPtr pRadioButtons;
/// <summary>The button ID of the radio button that is selected by default. If this value does not correspond to a button ID, the first button in the array is selected by default.</summary>
/// <summary>
/// The button ID of the radio button that is selected by default. If this value does not correspond to a button ID, the first
/// button in the array is selected by default.
/// </summary>
public int nDefaultRadioButton;
/// <summary>Pointer that references the string to be used to label the verification checkbox. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If this parameter is NULL, the verification checkbox is not displayed in the task dialog. If the pfVerificationFlagChecked parameter of TaskDialogIndirect is NULL, the checkbox is not enabled.</summary>
public ResourceIdUni pszVerificationText;
/// <summary>Pointer that references the string to be used for displaying additional information. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. The additional information is displayed either immediately below the content or below the footer text depending on whether the TDF_EXPAND_FOOTER_AREA flag is specified. If the TDF_ENABLE_HYPERLINKS flag is specified for the dwFlags member, then this string may contain hyperlinks in the form: <A HREF="executablestring">Hyperlink Text</A>. WARNING: Enabling hyperlinks when using content from an unsafe source may cause security vulnerabilities.</summary>
public ResourceIdUni pszExpandedInformation;
/// <summary>Pointer that references the string to be used to label the button for collapsing the expandable information. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. This member is ignored when the pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified, then the pszCollapsedControlText value will be used for this member as well.</summary>
public ResourceIdUni pszExpandedControlText;
/// <summary>Pointer that references the string to be used to label the button for expanding the expandable information. This parameter can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. This member is ignored when the pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified, then the pszCollapsedControlText value will be used for this member as well.</summary>
public ResourceIdUni pszCollapsedControlText;
/// <summary>A handle to an Icon that is to be displayed in the footer of the task dialog. This member is ignored unless the TDF_USE_HICON_FOOTER flag is specified and the pszFooterIcon is not. If this member is NULL and the TDF_USE_HICON_FOOTER is specified, no icon is displayed.
/// <para><c>OR</c></para>
/// <para>Pointer that references the icon to be displayed in the footer area of the task dialog. This parameter is ignored if the TDF_USE_HICON_FOOTER flag is specified, or if pszFooter is NULL. Otherwise, if this parameter is NULL or the hInstance parameter is NULL, no icon is displayed. This parameter must be an integer resource identifier passed to the MAKEINTRESOURCE macro or one of the predefined values listed for pszMainIcon.</para>
/// <summary>
/// Pointer that references the string to be used to label the verification checkbox. This parameter can be either a
/// null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. If this parameter is NULL, the
/// verification checkbox is not displayed in the task dialog. If the pfVerificationFlagChecked parameter of TaskDialogIndirect
/// is NULL, the checkbox is not enabled.
/// </summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
public ResourceIdUni footerIcon;
public IntPtr pszVerificationText;
/// <summary>Pointer that references the icon to be displayed in the footer area of the task dialog. This parameter is ignored if the TDF_USE_HICON_FOOTER flag is specified, or if pszFooter is NULL. Otherwise, if this parameter is NULL or the hInstance parameter is NULL, no icon is displayed. This parameter must be an integer resource identifier passed to the MAKEINTRESOURCE macro or one of the predefined values listed for pszMainIcon.</summary>
[MarshalAs(UnmanagedType.LPWStr)]
public ResourceIdUni pszFooter;
/// <summary>
/// Pointer that references the string to be used for displaying additional information. This parameter can be either a
/// null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. The additional information is
/// displayed either immediately below the content or below the footer text depending on whether the TDF_EXPAND_FOOTER_AREA flag
/// is specified. If the TDF_ENABLE_HYPERLINKS flag is specified for the dwFlags member, then this string may contain hyperlinks
/// in the form: <A HREF="executablestring">Hyperlink Text</A>. WARNING: Enabling hyperlinks when using content from an unsafe
/// source may cause security vulnerabilities.
/// </summary>
public IntPtr pszExpandedInformation;
/// <summary>
/// Pointer that references the string to be used to label the button for collapsing the expandable information. This parameter
/// can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. This member is
/// ignored when the pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified,
/// then the pszCollapsedControlText value will be used for this member as well.
/// </summary>
public IntPtr pszExpandedControlText;
/// <summary>
/// Pointer that references the string to be used to label the button for expanding the expandable information. This parameter
/// can be either a null-terminated string or an integer resource identifier passed to the MAKEINTRESOURCE macro. This member is
/// ignored when the pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified,
/// then the pszCollapsedControlText value will be used for this member as well.
/// </summary>
public IntPtr pszCollapsedControlText;
/// <summary>
/// A handle to an Icon that is to be displayed in the footer of the task dialog. This member is ignored unless the
/// TDF_USE_HICON_FOOTER flag is specified and the pszFooterIcon is not. If this member is NULL and the TDF_USE_HICON_FOOTER is
/// specified, no icon is displayed.
/// <para><c>OR</c></para>
/// <para>
/// Pointer that references the icon to be displayed in the footer area of the task dialog. This parameter is ignored if the
/// TDF_USE_HICON_FOOTER flag is specified, or if pszFooter is NULL. Otherwise, if this parameter is NULL or the hInstance
/// parameter is NULL, no icon is displayed. This parameter must be an integer resource identifier passed to the MAKEINTRESOURCE
/// macro or one of the predefined values listed for pszMainIcon.
/// </para>
/// </summary>
public IntPtr footerIcon;
/// <summary>
/// Pointer to the string to be used in the footer area of the task dialog. This parameter can be either a null-terminated string
/// or an integer resource identifier passed to the MAKEINTRESOURCE macro. If the TDF_ENABLE_HYPERLINKS flag is specified for the
/// dwFlags member, then this string may contain hyperlinks in this form.
/// <para>&lt;A HREF="executablestring"&gt;Hyperlink Text&lt;/A&gt;</para>
/// <note type="warning">Enabling hyperlinks when using content from an unsafe source may cause security vulnerabilities.</note>
/// </summary>
public IntPtr pszFooter;
/// <summary>Pointer to an application-defined callback function. For more information see TaskDialogCallbackProc.</summary>
[MarshalAs(UnmanagedType.FunctionPtr)]
public TaskDialogCallbackProc pfCallbackProc;
/// <summary>A pointer to application-defined reference data. This value is defined by the caller.</summary>
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
public IntPtr lpCallbackData;
/// <summary>The width of the task dialog's client area, in dialog units. If 0, the task dialog manager will calculate the ideal width.</summary>
/// <summary>
/// The width of the task dialog's client area, in dialog units. If 0, the task dialog manager will calculate the ideal width.
/// </summary>
public uint cxWidth;
/// <summary>
/// The string to be used for the task dialog title. If this parameter is NULL, the filename of the executable program is used.
/// </summary>
public string WindowTitle
{
get => SafeResourceId.GetString(pszWindowTitle, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszWindowTitle, out var _, value, CharSet.Unicode);
}
/// <summary>The string to be used for the main instruction.</summary>
public string MainInstruction
{
get => SafeResourceId.GetString(pszMainInstruction, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszMainInstruction, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used for the dialog's primary content. If the ENABLE_HYPERLINKS flag is specified for the dwFlags member,
/// then this string may contain hyperlinks in the form: &lt;A HREF="executablestring"&gt;Hyperlink Text&lt;/A&gt;. WARNING:
/// Enabling hyperlinks when using content from an unsafe source may cause security vulnerabilities.
/// </summary>
public string Content
{
get => SafeResourceId.GetString(pszContent, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszContent, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used to label the verification checkbox. If this parameter is NULL, the verification checkbox is not
/// displayed in the task dialog. If the pfVerificationFlagChecked parameter of TaskDialogIndirect is NULL, the checkbox is not enabled.
/// </summary>
public string VerificationText
{
get => SafeResourceId.GetString(pszVerificationText, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszVerificationText, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used for displaying additional information. The additional information is displayed either immediately below
/// the content or below the footer text depending on whether the TDF_EXPAND_FOOTER_AREA flag is specified. If the
/// TDF_ENABLE_HYPERLINKS flag is specified for the dwFlags member, then this string may contain hyperlinks in the form: &lt;A
/// HREF="executablestring"&gt;Hyperlink Text&lt;/A&gt;. WARNING: Enabling hyperlinks when using content from an unsafe source
/// may cause security vulnerabilities.
/// </summary>
public string ExpandedInformation
{
get => SafeResourceId.GetString(pszExpandedInformation, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszExpandedInformation, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used to label the button for collapsing the expandable information. This member is ignored when the
/// pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified, then the
/// pszCollapsedControlText value will be used for this member as well.
/// </summary>
public string ExpandedControlText
{
get => SafeResourceId.GetString(pszExpandedControlText, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszExpandedControlText, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used to label the button for expanding the expandable information. This member is ignored when the
/// pszExpandedInformation member is NULL. If this member is NULL and the pszCollapsedControlText is specified, then the
/// pszCollapsedControlText value will be used for this member as well.
/// </summary>
public string CollapsedControlText
{
get => SafeResourceId.GetString(pszCollapsedControlText, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszCollapsedControlText, out var _, value, CharSet.Unicode);
}
/// <summary>
/// The string to be used in the footer area of the task dialog. If the TDF_ENABLE_HYPERLINKS flag is specified for the dwFlags
/// member, then this string may contain hyperlinks in this form.
/// <para>&lt;A HREF="executablestring"&gt;Hyperlink Text&lt;/A&gt;</para>
/// <note type="warning">Enabling hyperlinks when using content from an unsafe source may cause security vulnerabilities.</note>
/// </summary>
public string Footer
{
get => SafeResourceId.GetString(pszFooter, CharSet.Unicode);
set => StringHelper.RefreshString(ref pszFooter, out var _, value, CharSet.Unicode);
}
/// <inheritdoc/>
void IDisposable.Dispose()
{
FreeResource(ref pszWindowTitle);
FreeResource(ref pszMainInstruction);
FreeResource(ref pszContent);
FreeResource(ref pszVerificationText);
FreeResource(ref pszExpandedInformation);
FreeResource(ref pszExpandedControlText);
FreeResource(ref pszCollapsedControlText);
FreeResource(ref pszFooter);
}
private static void FreeResource(ref IntPtr ptr)
{
StringHelper.FreeString(ptr, CharSet.Unicode);
ptr = IntPtr.Zero;
}
}
}
}

View File

@ -1,5 +1,5 @@
## Correlation report for advapi32.dll, secur32.dll, authz.dll
### Methods (11% complete)
### Methods (20% complete)
Native Method | Native DLL | Header | Managed Method
--- | --- | --- | ---
[AbortSystemShutdown](http://msdn2.microsoft.com/en-us/library/aa376630) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.AbortSystemShutdown
@ -31,7 +31,7 @@ Native Method | Native DLL | Header | Managed Method
[AdjustTokenGroups](https://www.google.com/search?num=5&q=AdjustTokenGroups+site%3Amicrosoft.com) | advapi32.dll | |
[AdjustTokenPrivileges](http://msdn2.microsoft.com/en-us/library/aa375202) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.AdjustTokenPrivileges
[AllocateAndInitializeSid](http://msdn2.microsoft.com/en-us/library/aa375213) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.AllocateAndInitializeSid
[AllocateLocallyUniqueId](https://www.google.com/search?num=5&q=AllocateLocallyUniqueId+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.AllocateLocallyUniqueId
[AllocateLocallyUniqueId](http://msdn2.microsoft.com/en-us/library/aa375260) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.AllocateLocallyUniqueId
[ApplyControlToken](https://www.google.com/search?num=5&q=ApplyControlToken+site%3Amicrosoft.com) | secur32.dll | |
[AreAllAccessesGranted](https://www.google.com/search?num=5&q=AreAllAccessesGranted+site%3Amicrosoft.com) | advapi32.dll | |
[AreAnyAccessesGranted](https://www.google.com/search?num=5&q=AreAnyAccessesGranted+site%3Amicrosoft.com) | advapi32.dll | |
@ -53,18 +53,18 @@ Native Method | Native DLL | Header | Managed Method
[AuditSetPerUserPolicy](https://www.google.com/search?num=5&q=AuditSetPerUserPolicy+site%3Amicrosoft.com) | advapi32.dll | |
[AuditSetSecurity](https://www.google.com/search?num=5&q=AuditSetSecurity+site%3Amicrosoft.com) | advapi32.dll | |
[AuditSetSystemPolicy](https://www.google.com/search?num=5&q=AuditSetSystemPolicy+site%3Amicrosoft.com) | advapi32.dll | |
[AuthzAccessCheck](https://www.google.com/search?num=5&q=AuthzAccessCheck+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzAccessCheck
[AuthzAccessCheck](http://msdn2.microsoft.com/en-us/library/633c2a73-169c-4e0c-abb6-96c360bd63cf) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzAccessCheck
[AuthzAddSidsToContext](https://www.google.com/search?num=5&q=AuthzAddSidsToContext+site%3Amicrosoft.com) | authz.dll | |
[AuthzCachedAccessCheck](https://www.google.com/search?num=5&q=AuthzCachedAccessCheck+site%3Amicrosoft.com) | authz.dll | |
[AuthzComputeEffectivePermission](https://www.google.com/search?num=5&q=AuthzComputeEffectivePermission+site%3Amicrosoft.com) | authz.dll | |
[AuthzEnumerateSecurityEventSources](https://www.google.com/search?num=5&q=AuthzEnumerateSecurityEventSources+site%3Amicrosoft.com) | authz.dll | |
[AuthzEvaluateSacl](https://www.google.com/search?num=5&q=AuthzEvaluateSacl+site%3Amicrosoft.com) | authz.dll | |
[AuthzFreeAuditEvent](https://www.google.com/search?num=5&q=AuthzFreeAuditEvent+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzFreeAuditEvent
[AuthzFreeAuditEvent](http://msdn2.microsoft.com/en-us/library/e2980ef7-45dd-47c7-ba4d-f36b52bbd7dc) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzFreeAuditEvent
[AuthzFreeCentralAccessPolicyCache](https://www.google.com/search?num=5&q=AuthzFreeCentralAccessPolicyCache+site%3Amicrosoft.com) | authz.dll | |
[AuthzFreeContext](https://www.google.com/search?num=5&q=AuthzFreeContext+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzFreeContext
[AuthzFreeHandle](https://www.google.com/search?num=5&q=AuthzFreeHandle+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzFreeHandle
[AuthzFreeResourceManager](https://www.google.com/search?num=5&q=AuthzFreeResourceManager+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzFreeResourceManager
[AuthzGetInformationFromContext](https://www.google.com/search?num=5&q=AuthzGetInformationFromContext+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzGetInformationFromContext
[AuthzFreeContext](http://msdn2.microsoft.com/en-us/library/cad9fff0-9aa6-4cb2-a34f-94cf72f66bca) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzFreeContext
[AuthzFreeHandle](http://msdn2.microsoft.com/en-us/library/8d2e2ae9-b515-4a02-b366-5b107b4f7ffa) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzFreeHandle
[AuthzFreeResourceManager](http://msdn2.microsoft.com/en-us/library/8b716368-8d81-4c62-9086-0976b39bbcf8) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzFreeResourceManager
[AuthzGetInformationFromContext](http://msdn2.microsoft.com/en-us/library/c365029a-3ff3-49c1-9dfc-b52948e466f3) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzGetInformationFromContext
[AuthziAccessCheckEx](https://www.google.com/search?num=5&q=AuthziAccessCheckEx+site%3Amicrosoft.com) | authz.dll | |
[AuthziAllocateAuditParams](https://www.google.com/search?num=5&q=AuthziAllocateAuditParams+site%3Amicrosoft.com) | authz.dll | |
[AuthziCheckContextMembership](https://www.google.com/search?num=5&q=AuthziCheckContextMembership+site%3Amicrosoft.com) | authz.dll | |
@ -85,11 +85,11 @@ Native Method | Native DLL | Header | Managed Method
[AuthziModifyAuditEventType](https://www.google.com/search?num=5&q=AuthziModifyAuditEventType+site%3Amicrosoft.com) | authz.dll | |
[AuthziModifyAuditQueue](https://www.google.com/search?num=5&q=AuthziModifyAuditQueue+site%3Amicrosoft.com) | authz.dll | |
[AuthziModifySecurityAttributes](https://www.google.com/search?num=5&q=AuthziModifySecurityAttributes+site%3Amicrosoft.com) | authz.dll | |
[AuthzInitializeCompoundContext](https://www.google.com/search?num=5&q=AuthzInitializeCompoundContext+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzInitializeCompoundContext
[AuthzInitializeCompoundContext](http://msdn2.microsoft.com/en-us/library/2EC9EE76-9A92-40DF-9884-547D96FF3E09) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzInitializeCompoundContext
[AuthzInitializeContextFromAuthzContext](https://www.google.com/search?num=5&q=AuthzInitializeContextFromAuthzContext+site%3Amicrosoft.com) | authz.dll | |
[AuthzInitializeContextFromSid](https://www.google.com/search?num=5&q=AuthzInitializeContextFromSid+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzInitializeContextFromSid
[AuthzInitializeContextFromToken](https://www.google.com/search?num=5&q=AuthzInitializeContextFromToken+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzInitializeContextFromToken
[AuthzInitializeObjectAccessAuditEvent](https://www.google.com/search?num=5&q=AuthzInitializeObjectAccessAuditEvent+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzInitializeObjectAccessAuditEvent
[AuthzInitializeContextFromSid](http://msdn2.microsoft.com/en-us/library/402a8641-5644-45c1-80e9-c60321c1ac38) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzInitializeContextFromSid
[AuthzInitializeContextFromToken](http://msdn2.microsoft.com/en-us/library/75a7fb3f-6b3a-42ca-b467-f57baf6c60c6) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzInitializeContextFromToken
[AuthzInitializeObjectAccessAuditEvent](http://msdn2.microsoft.com/en-us/library/cf79a92f-31e0-47cf-8990-4dbd46056a90) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzInitializeObjectAccessAuditEvent
[AuthzInitializeObjectAccessAuditEvent2](https://www.google.com/search?num=5&q=AuthzInitializeObjectAccessAuditEvent2+site%3Amicrosoft.com) | authz.dll | |
[AuthzInitializeRemoteAccessCheck](https://www.google.com/search?num=5&q=AuthzInitializeRemoteAccessCheck+site%3Amicrosoft.com) | authz.dll | |
[AuthzInitializeRemoteResourceManager](https://www.google.com/search?num=5&q=AuthzInitializeRemoteResourceManager+site%3Amicrosoft.com) | authz.dll | |
@ -98,9 +98,9 @@ Native Method | Native DLL | Header | Managed Method
[AuthzInstallSecurityEventSource](https://www.google.com/search?num=5&q=AuthzInstallSecurityEventSource+site%3Amicrosoft.com) | authz.dll | |
[AuthziQuerySecurityAttributes](https://www.google.com/search?num=5&q=AuthziQuerySecurityAttributes+site%3Amicrosoft.com) | authz.dll | |
[AuthziSourceAudit](https://www.google.com/search?num=5&q=AuthziSourceAudit+site%3Amicrosoft.com) | authz.dll | |
[AuthzModifyClaims](https://www.google.com/search?num=5&q=AuthzModifyClaims+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzModifyClaims
[AuthzModifySecurityAttributes](https://www.google.com/search?num=5&q=AuthzModifySecurityAttributes+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzModifySecurityAttributes
[AuthzModifySids](https://www.google.com/search?num=5&q=AuthzModifySids+site%3Amicrosoft.com) | authz.dll | | Vanara.PInvoke.Authz.AuthzModifySids
[AuthzModifyClaims](http://msdn2.microsoft.com/en-us/library/A93CD1DD-4E87-4C6A-928A-F90AD7F1085E) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzModifyClaims
[AuthzModifySecurityAttributes](http://msdn2.microsoft.com/en-us/library/d84873e2-ecfe-45cf-9048-7ed173117efa) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzModifySecurityAttributes
[AuthzModifySids](http://msdn2.microsoft.com/en-us/library/740569A5-6159-409B-B8CB-B3A8BAE4F398) | authz.dll | authz.h | Vanara.PInvoke.Authz.AuthzModifySids
[AuthzOpenObjectAudit](https://www.google.com/search?num=5&q=AuthzOpenObjectAudit+site%3Amicrosoft.com) | authz.dll | |
[AuthzRegisterCapChangeNotification](https://www.google.com/search?num=5&q=AuthzRegisterCapChangeNotification+site%3Amicrosoft.com) | authz.dll | |
[AuthzRegisterSecurityEventSource](https://www.google.com/search?num=5&q=AuthzRegisterSecurityEventSource+site%3Amicrosoft.com) | authz.dll | |
@ -178,69 +178,21 @@ Native Method | Native DLL | Header | Managed Method
[CreateService](https://www.google.com/search?num=5&q=CreateServiceA+site%3Amicrosoft.com) | advapi32.dll | |
[CreateTraceInstanceId](https://www.google.com/search?num=5&q=CreateTraceInstanceId+site%3Amicrosoft.com) | advapi32.dll | |
[CreateWellKnownSid](https://www.google.com/search?num=5&q=CreateWellKnownSid+site%3Amicrosoft.com) | advapi32.dll | |
[CredBackupCredentials](https://www.google.com/search?num=5&q=CredBackupCredentials+site%3Amicrosoft.com) | advapi32.dll | |
[CredDelete](https://www.google.com/search?num=5&q=CredDeleteA+site%3Amicrosoft.com) | advapi32.dll | |
[CredEncryptAndMarshalBinaryBlob](https://www.google.com/search?num=5&q=CredEncryptAndMarshalBinaryBlob+site%3Amicrosoft.com) | advapi32.dll | |
[CredEnumerate](https://www.google.com/search?num=5&q=CredEnumerateA+site%3Amicrosoft.com) | advapi32.dll | |
[CredFindBestCredential](https://www.google.com/search?num=5&q=CredFindBestCredentialA+site%3Amicrosoft.com) | advapi32.dll | |
[CredFree](https://www.google.com/search?num=5&q=CredFree+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.CredFree
[CredGetSessionTypes](https://www.google.com/search?num=5&q=CredGetSessionTypes+site%3Amicrosoft.com) | advapi32.dll | |
[CredGetTargetInfo](https://www.google.com/search?num=5&q=CredGetTargetInfoA+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.CredGetTargetInfo
[CredIsMarshaledCredential](https://www.google.com/search?num=5&q=CredIsMarshaledCredentialA+site%3Amicrosoft.com) | advapi32.dll | |
[CredIsProtected](https://www.google.com/search?num=5&q=CredIsProtectedA+site%3Amicrosoft.com) | advapi32.dll | |
[CredMarshalCredential](https://www.google.com/search?num=5&q=CredMarshalCredentialA+site%3Amicrosoft.com) | advapi32.dll | |
[CredMarshalTargetInfo](https://www.google.com/search?num=5&q=CredMarshalTargetInfo+site%3Amicrosoft.com) | secur32.dll | |
[CredpConvertCredential](https://www.google.com/search?num=5&q=CredpConvertCredential+site%3Amicrosoft.com) | advapi32.dll | |
[CredpConvertOneCredentialSize](https://www.google.com/search?num=5&q=CredpConvertOneCredentialSize+site%3Amicrosoft.com) | advapi32.dll | |
[CredpConvertTargetInfo](https://www.google.com/search?num=5&q=CredpConvertTargetInfo+site%3Amicrosoft.com) | advapi32.dll | |
[CredpDecodeCredential](https://www.google.com/search?num=5&q=CredpDecodeCredential+site%3Amicrosoft.com) | advapi32.dll | |
[CredpEncodeCredential](https://www.google.com/search?num=5&q=CredpEncodeCredential+site%3Amicrosoft.com) | advapi32.dll | |
[CredpEncodeSecret](https://www.google.com/search?num=5&q=CredpEncodeSecret+site%3Amicrosoft.com) | advapi32.dll | |
[CredProfileLoaded](https://www.google.com/search?num=5&q=CredProfileLoaded+site%3Amicrosoft.com) | advapi32.dll | |
[CredProfileLoadedEx](https://www.google.com/search?num=5&q=CredProfileLoadedEx+site%3Amicrosoft.com) | advapi32.dll | |
[CredProfileUnloaded](https://www.google.com/search?num=5&q=CredProfileUnloaded+site%3Amicrosoft.com) | advapi32.dll | |
[CredProtect](https://www.google.com/search?num=5&q=CredProtectA+site%3Amicrosoft.com) | advapi32.dll | |
[CredRead](https://www.google.com/search?num=5&q=CredReadA+site%3Amicrosoft.com) | advapi32.dll | |
[CredReadByTokenHandle](https://www.google.com/search?num=5&q=CredReadByTokenHandle+site%3Amicrosoft.com) | advapi32.dll | |
[CredReadDomainCredentials](https://www.google.com/search?num=5&q=CredReadDomainCredentialsA+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.CredReadDomainCredentials
[CredRename](https://www.google.com/search?num=5&q=CredRenameA+site%3Amicrosoft.com) | advapi32.dll | |
[CredRestoreCredentials](https://www.google.com/search?num=5&q=CredRestoreCredentials+site%3Amicrosoft.com) | advapi32.dll | |
[CredUnmarshalCredential](https://www.google.com/search?num=5&q=CredUnmarshalCredentialA+site%3Amicrosoft.com) | advapi32.dll | |
[CredUnmarshalTargetInfo](https://www.google.com/search?num=5&q=CredUnmarshalTargetInfo+site%3Amicrosoft.com) | secur32.dll | |
[CredUnprotect](https://www.google.com/search?num=5&q=CredUnprotectA+site%3Amicrosoft.com) | advapi32.dll | |
[CredWrite](https://www.google.com/search?num=5&q=CredWriteA+site%3Amicrosoft.com) | advapi32.dll | |
[CredWriteDomainCredentials](https://www.google.com/search?num=5&q=CredWriteDomainCredentialsA+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.CredWriteDomainCredentials
[CryptAcquireContext](https://www.google.com/search?num=5&q=CryptAcquireContextA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptContextAddRef](https://www.google.com/search?num=5&q=CryptContextAddRef+site%3Amicrosoft.com) | advapi32.dll | |
[CryptCreateHash](https://www.google.com/search?num=5&q=CryptCreateHash+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDecrypt](https://www.google.com/search?num=5&q=CryptDecrypt+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDeriveKey](https://www.google.com/search?num=5&q=CryptDeriveKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDestroyHash](https://www.google.com/search?num=5&q=CryptDestroyHash+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDestroyKey](https://www.google.com/search?num=5&q=CryptDestroyKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDuplicateHash](https://www.google.com/search?num=5&q=CryptDuplicateHash+site%3Amicrosoft.com) | advapi32.dll | |
[CryptDuplicateKey](https://www.google.com/search?num=5&q=CryptDuplicateKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptEncrypt](https://www.google.com/search?num=5&q=CryptEncrypt+site%3Amicrosoft.com) | advapi32.dll | |
[CryptEnumProviders](https://www.google.com/search?num=5&q=CryptEnumProvidersA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptEnumProviderTypes](https://www.google.com/search?num=5&q=CryptEnumProviderTypesA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptExportKey](https://www.google.com/search?num=5&q=CryptExportKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGenKey](https://www.google.com/search?num=5&q=CryptGenKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGenRandom](https://www.google.com/search?num=5&q=CryptGenRandom+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGetDefaultProvider](https://www.google.com/search?num=5&q=CryptGetDefaultProviderA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGetHashParam](https://www.google.com/search?num=5&q=CryptGetHashParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGetKeyParam](https://www.google.com/search?num=5&q=CryptGetKeyParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGetProvParam](https://www.google.com/search?num=5&q=CryptGetProvParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptGetUserKey](https://www.google.com/search?num=5&q=CryptGetUserKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptHashData](https://www.google.com/search?num=5&q=CryptHashData+site%3Amicrosoft.com) | advapi32.dll | |
[CryptHashSessionKey](https://www.google.com/search?num=5&q=CryptHashSessionKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptImportKey](https://www.google.com/search?num=5&q=CryptImportKey+site%3Amicrosoft.com) | advapi32.dll | |
[CryptReleaseContext](https://www.google.com/search?num=5&q=CryptReleaseContext+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSetHashParam](https://www.google.com/search?num=5&q=CryptSetHashParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSetKeyParam](https://www.google.com/search?num=5&q=CryptSetKeyParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSetProvider](https://www.google.com/search?num=5&q=CryptSetProviderA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSetProviderEx](https://www.google.com/search?num=5&q=CryptSetProviderExA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSetProvParam](https://www.google.com/search?num=5&q=CryptSetProvParam+site%3Amicrosoft.com) | advapi32.dll | |
[CryptSignHash](https://www.google.com/search?num=5&q=CryptSignHashA+site%3Amicrosoft.com) | advapi32.dll | |
[CryptVerifySignature](https://www.google.com/search?num=5&q=CryptVerifySignatureA+site%3Amicrosoft.com) | advapi32.dll | |
[CredDelete](http://msdn2.microsoft.com/en-us/library/154af9c8-18fd-412d-899d-7c6d2138380d) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredDelete
[CredEnumerate](http://msdn2.microsoft.com/en-us/library/ef0b7620-7b00-45f1-af16-141d2e940783) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredEnumerate
[CredFindBestCredential](http://msdn2.microsoft.com/en-us/library/b39e3167-dd63-4b81-b850-f3117be348a5) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredFindBestCredential
[CredFree](http://msdn2.microsoft.com/en-us/library/bc33ab1b-dd3f-4e1b-96d2-e32ceff89ada) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredFree
[CredGetSessionTypes](http://msdn2.microsoft.com/en-us/library/70f8d5e0-235b-4330-8add-566b41c91c17) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredGetSessionTypes
[CredGetTargetInfo](http://msdn2.microsoft.com/en-us/library/14dca0af-72d7-4ca8-84bb-c7040c5b5fb9) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredGetTargetInfo
[CredIsMarshaledCredential](http://msdn2.microsoft.com/en-us/library/fc902c0c-41e0-4178-8ca0-227a1d218388) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredIsMarshaledCredential
[CredIsProtected](http://msdn2.microsoft.com/en-us/library/3c38ecf5-1288-4a50-ad17-595e9ff4aaca) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredIsProtected
[CredProtect](http://msdn2.microsoft.com/en-us/library/1e299dfb-2ffe-463c-9e2c-b7774a2216e3) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredProtect
[CredRead](http://msdn2.microsoft.com/en-us/library/3222de7b-5290-4e82-a382-b2db6afc78cc) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredRead
[CredReadDomainCredentials](http://msdn2.microsoft.com/en-us/library/b62cb9c9-2a64-4ef4-97f0-e1ea85976d3e) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredReadDomainCredentials
[CredRename](http://msdn2.microsoft.com/en-us/library/e598f2ae-f975-4dd2-bf0b-e2fd96d4c940) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredRename
[CredUnprotect](http://msdn2.microsoft.com/en-us/library/7a22fb2b-edfc-45f2-b2d2-729f3761584d) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredUnprotect
[CredWrite](http://msdn2.microsoft.com/en-us/library/9a590347-d610-4916-bf63-60fbec173ac2) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredWrite
[CredWriteDomainCredentials](http://msdn2.microsoft.com/en-us/library/6b54c14f-a736-4fb0-b4e4-97765a792a5e) | advapi32.dll | wincred.h | Vanara.PInvoke.AdvApi32.CredWriteDomainCredentials
[CveEventWrite](https://www.google.com/search?num=5&q=CveEventWrite+site%3Amicrosoft.com) | advapi32.dll | |
[DecryptFile](https://www.google.com/search?num=5&q=DecryptFileA+site%3Amicrosoft.com) | advapi32.dll | |
[DecryptMessage](https://www.google.com/search?num=5&q=DecryptMessage+site%3Amicrosoft.com) | secur32.dll | |
@ -251,8 +203,8 @@ Native Method | Native DLL | Header | Managed Method
[DeregisterEventSource](https://www.google.com/search?num=5&q=DeregisterEventSource+site%3Amicrosoft.com) | advapi32.dll | |
[DestroyPrivateObjectSecurity](https://www.google.com/search?num=5&q=DestroyPrivateObjectSecurity+site%3Amicrosoft.com) | advapi32.dll | |
[DuplicateEncryptionInfoFile](https://www.google.com/search?num=5&q=DuplicateEncryptionInfoFile+site%3Amicrosoft.com) | advapi32.dll | |
[DuplicateToken](https://www.google.com/search?num=5&q=DuplicateToken+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.DuplicateToken
[DuplicateTokenEx](https://www.google.com/search?num=5&q=DuplicateTokenEx+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.DuplicateTokenEx
[DuplicateToken](http://msdn2.microsoft.com/en-us/library/aa446616) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.DuplicateToken
[DuplicateTokenEx](http://msdn2.microsoft.com/en-us/library/aa446617) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.DuplicateTokenEx
[EnableTrace](https://www.google.com/search?num=5&q=EnableTrace+site%3Amicrosoft.com) | advapi32.dll | |
[EnableTraceEx](https://www.google.com/search?num=5&q=EnableTraceEx+site%3Amicrosoft.com) | advapi32.dll | |
[EnableTraceEx2](https://www.google.com/search?num=5&q=EnableTraceEx2+site%3Amicrosoft.com) | advapi32.dll | |
@ -376,7 +328,7 @@ Native Method | Native DLL | Header | Managed Method
[InitializeSecurityDescriptor](https://www.google.com/search?num=5&q=InitializeSecurityDescriptor+site%3Amicrosoft.com) | advapi32.dll | |
[InitializeSid](https://www.google.com/search?num=5&q=InitializeSid+site%3Amicrosoft.com) | advapi32.dll | |
[InitiateShutdown](http://msdn2.microsoft.com/en-us/library/aa376872) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.InitiateShutdown
[InitiateSystemShutdown](https://www.google.com/search?num=5&q=InitiateSystemShutdownA+site%3Amicrosoft.com) | advapi32.dll | |
[InitiateSystemShutdown](http://msdn2.microsoft.com/en-us/library/cad54fea-7f59-438c-83ac-f0160d81496b) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.InitiateSystemShutdown
[InitiateSystemShutdownEx](http://msdn2.microsoft.com/en-us/library/aa376874) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.InitiateSystemShutdownEx
[InitSecurityInterface](https://www.google.com/search?num=5&q=InitSecurityInterfaceA+site%3Amicrosoft.com) | secur32.dll | |
[InstallApplication](https://www.google.com/search?num=5&q=InstallApplication+site%3Amicrosoft.com) | advapi32.dll | |
@ -395,25 +347,25 @@ Native Method | Native DLL | Header | Managed Method
[LookupAccountName](http://msdn2.microsoft.com/en-us/library/aa379159) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.LookupAccountName
[LookupAccountSid](http://msdn2.microsoft.com/en-us/library/aa379166) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.LookupAccountSid
[LookupPrivilegeDisplayName](https://www.google.com/search?num=5&q=LookupPrivilegeDisplayNameA+site%3Amicrosoft.com) | advapi32.dll | |
[LookupPrivilegeName](https://www.google.com/search?num=5&q=LookupPrivilegeNameA+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LookupPrivilegeName
[LookupPrivilegeValue](https://www.google.com/search?num=5&q=LookupPrivilegeValueA+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LookupPrivilegeValue
[LookupPrivilegeName](http://msdn2.microsoft.com/en-us/library/580fb58f-1470-4389-9f07-8f37403e2bdf) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.LookupPrivilegeName
[LookupPrivilegeValue](http://msdn2.microsoft.com/en-us/library/334b8ba8-101d-43a1-a8bf-1c7e0448c272) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.LookupPrivilegeValue
[LookupSecurityDescriptorParts](https://www.google.com/search?num=5&q=LookupSecurityDescriptorPartsA+site%3Amicrosoft.com) | advapi32.dll | |
[LsaAddAccountRights](http://msdn2.microsoft.com/en-us/library/ms721786) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaAddAccountRights
[LsaAddPrivilegesToAccount](https://www.google.com/search?num=5&q=LsaAddPrivilegesToAccount+site%3Amicrosoft.com) | advapi32.dll | |
[LsaCallAuthenticationPackage](https://www.google.com/search?num=5&q=LsaCallAuthenticationPackage+site%3Amicrosoft.com) | secur32.dll | |
[LsaClearAuditLog](https://www.google.com/search?num=5&q=LsaClearAuditLog+site%3Amicrosoft.com) | advapi32.dll | |
[LsaClose](https://www.google.com/search?num=5&q=LsaClose+site%3Amicrosoft.com) | advapi32.dll | |
[LsaConnectUntrusted](http://msdn2.microsoft.com/en-us/library/aa378265) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.NetSecApi.LsaConnectUntrusted
[LsaConnectUntrusted](http://msdn2.microsoft.com/en-us/library/aa378265) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.Secur32.LsaConnectUntrusted
[LsaCreateAccount](https://www.google.com/search?num=5&q=LsaCreateAccount+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaCreateAccount
[LsaCreateSecret](https://www.google.com/search?num=5&q=LsaCreateSecret+site%3Amicrosoft.com) | advapi32.dll | |
[LsaCreateTrustedDomain](https://www.google.com/search?num=5&q=LsaCreateTrustedDomain+site%3Amicrosoft.com) | advapi32.dll | |
[LsaCreateTrustedDomainEx](https://www.google.com/search?num=5&q=LsaCreateTrustedDomainEx+site%3Amicrosoft.com) | advapi32.dll | |
[LsaDelete](https://www.google.com/search?num=5&q=LsaDelete+site%3Amicrosoft.com) | advapi32.dll | |
[LsaDeleteTrustedDomain](https://www.google.com/search?num=5&q=LsaDeleteTrustedDomain+site%3Amicrosoft.com) | advapi32.dll | |
[LsaDeregisterLogonProcess](http://msdn2.microsoft.com/en-us/library/aa378269) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.NetSecApi.LsaDeregisterLogonProcess
[LsaEnumerateAccountRights](https://www.google.com/search?num=5&q=LsaEnumerateAccountRights+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaEnumerateAccountRights
[LsaDeregisterLogonProcess](http://msdn2.microsoft.com/en-us/library/aa378269) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.Secur32.LsaDeregisterLogonProcess
[LsaEnumerateAccountRights](http://msdn2.microsoft.com/en-us/library/3f4a4a9a-66ca-410a-8bdc-c390e8b966e3) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaEnumerateAccountRights
[LsaEnumerateAccounts](https://www.google.com/search?num=5&q=LsaEnumerateAccounts+site%3Amicrosoft.com) | advapi32.dll | |
[LsaEnumerateAccountsWithUserRight](https://www.google.com/search?num=5&q=LsaEnumerateAccountsWithUserRight+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaEnumerateAccountsWithUserRight
[LsaEnumerateAccountsWithUserRight](http://msdn2.microsoft.com/en-us/library/97e7180e-4edb-4edd-915e-0477e7e7a9ff) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaEnumerateAccountsWithUserRight
[LsaEnumerateLogonSessions](https://www.google.com/search?num=5&q=LsaEnumerateLogonSessions+site%3Amicrosoft.com) | secur32.dll | |
[LsaEnumeratePrivileges](https://www.google.com/search?num=5&q=LsaEnumeratePrivileges+site%3Amicrosoft.com) | advapi32.dll | |
[LsaEnumeratePrivilegesOfAccount](https://www.google.com/search?num=5&q=LsaEnumeratePrivilegesOfAccount+site%3Amicrosoft.com) | advapi32.dll | |
@ -432,18 +384,18 @@ Native Method | Native DLL | Header | Managed Method
[LsaICLookupSids](https://www.google.com/search?num=5&q=LsaICLookupSids+site%3Amicrosoft.com) | advapi32.dll | |
[LsaICLookupSidsWithCreds](https://www.google.com/search?num=5&q=LsaICLookupSidsWithCreds+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLogonUser](https://www.google.com/search?num=5&q=LsaLogonUser+site%3Amicrosoft.com) | secur32.dll | |
[LsaLookupAuthenticationPackage](http://msdn2.microsoft.com/en-us/library/aa378297) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.NetSecApi.LsaLookupAuthenticationPackage
[LsaLookupAuthenticationPackage](http://msdn2.microsoft.com/en-us/library/aa378297) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.Secur32.LsaLookupAuthenticationPackage
[LsaLookupNames](https://www.google.com/search?num=5&q=LsaLookupNames+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLookupNames2](https://www.google.com/search?num=5&q=LsaLookupNames2+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaLookupNames2
[LsaLookupNames2](http://msdn2.microsoft.com/en-us/library/fe219070-6a00-4b8c-b2e4-2ad290a1cb9c) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaLookupNames2
[LsaLookupPrivilegeDisplayName](https://www.google.com/search?num=5&q=LsaLookupPrivilegeDisplayName+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLookupPrivilegeName](https://www.google.com/search?num=5&q=LsaLookupPrivilegeName+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLookupPrivilegeValue](https://www.google.com/search?num=5&q=LsaLookupPrivilegeValue+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLookupSids](https://www.google.com/search?num=5&q=LsaLookupSids+site%3Amicrosoft.com) | advapi32.dll | |
[LsaLookupSids2](https://www.google.com/search?num=5&q=LsaLookupSids2+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaLookupSids2
[LsaLookupSids2](http://msdn2.microsoft.com/en-us/library/6B30D1FF-35DC-44E8-A765-36A5761EC0CE) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaLookupSids2
[LsaManageSidNameMapping](https://www.google.com/search?num=5&q=LsaManageSidNameMapping+site%3Amicrosoft.com) | advapi32.dll | |
[LsaNtStatusToWinError](https://www.google.com/search?num=5&q=LsaNtStatusToWinError+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaNtStatusToWinError
[LsaNtStatusToWinError](http://msdn2.microsoft.com/en-us/library/fa91794c-c502-4b36-84cc-a8d77c8e9d9f) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaNtStatusToWinError
[LsaOpenAccount](https://www.google.com/search?num=5&q=LsaOpenAccount+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaOpenAccount
[LsaOpenPolicy](https://www.google.com/search?num=5&q=LsaOpenPolicy+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaOpenPolicy
[LsaOpenPolicy](http://msdn2.microsoft.com/en-us/library/361bc962-1e97-4606-a835-cbce37692c55) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaOpenPolicy
[LsaOpenPolicySce](https://www.google.com/search?num=5&q=LsaOpenPolicySce+site%3Amicrosoft.com) | advapi32.dll | |
[LsaOpenSecret](https://www.google.com/search?num=5&q=LsaOpenSecret+site%3Amicrosoft.com) | advapi32.dll | |
[LsaOpenTrustedDomain](https://www.google.com/search?num=5&q=LsaOpenTrustedDomain+site%3Amicrosoft.com) | advapi32.dll | |
@ -457,9 +409,9 @@ Native Method | Native DLL | Header | Managed Method
[LsaQuerySecurityObject](https://www.google.com/search?num=5&q=LsaQuerySecurityObject+site%3Amicrosoft.com) | advapi32.dll | |
[LsaQueryTrustedDomainInfo](https://www.google.com/search?num=5&q=LsaQueryTrustedDomainInfo+site%3Amicrosoft.com) | advapi32.dll | |
[LsaQueryTrustedDomainInfoByName](https://www.google.com/search?num=5&q=LsaQueryTrustedDomainInfoByName+site%3Amicrosoft.com) | advapi32.dll | |
[LsaRegisterLogonProcess](http://msdn2.microsoft.com/en-us/library/aa378318) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.NetSecApi.LsaRegisterLogonProcess
[LsaRegisterLogonProcess](http://msdn2.microsoft.com/en-us/library/aa378318) | secur32.dll | Ntsecapi.h | Vanara.PInvoke.Secur32.LsaRegisterLogonProcess
[LsaRegisterPolicyChangeNotification](https://www.google.com/search?num=5&q=LsaRegisterPolicyChangeNotification+site%3Amicrosoft.com) | secur32.dll | |
[LsaRemoveAccountRights](https://www.google.com/search?num=5&q=LsaRemoveAccountRights+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.LsaRemoveAccountRights
[LsaRemoveAccountRights](http://msdn2.microsoft.com/en-us/library/ad250a01-7a24-4fae-975c-aa3e65731c82) | advapi32.dll | ntsecapi.h | Vanara.PInvoke.AdvApi32.LsaRemoveAccountRights
[LsaRemovePrivilegesFromAccount](https://www.google.com/search?num=5&q=LsaRemovePrivilegesFromAccount+site%3Amicrosoft.com) | advapi32.dll | |
[LsaRetrievePrivateData](https://www.google.com/search?num=5&q=LsaRetrievePrivateData+site%3Amicrosoft.com) | advapi32.dll | |
[LsaSetCAPs](https://www.google.com/search?num=5&q=LsaSetCAPs+site%3Amicrosoft.com) | advapi32.dll | |
@ -504,7 +456,7 @@ Native Method | Native DLL | Header | Managed Method
[OpenProcessToken](http://msdn2.microsoft.com/en-us/library/aa379295) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.OpenProcessToken
[OpenSCManager](https://www.google.com/search?num=5&q=OpenSCManagerA+site%3Amicrosoft.com) | advapi32.dll | |
[OpenService](https://www.google.com/search?num=5&q=OpenServiceA+site%3Amicrosoft.com) | advapi32.dll | |
[OpenThreadToken](https://www.google.com/search?num=5&q=OpenThreadToken+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.OpenThreadToken
[OpenThreadToken](http://msdn2.microsoft.com/en-us/library/aa379296) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.OpenThreadToken
[OpenThreadWaitChainSession](https://www.google.com/search?num=5&q=OpenThreadWaitChainSession+site%3Amicrosoft.com) | advapi32.dll | |
[OpenTrace](https://www.google.com/search?num=5&q=OpenTraceA+site%3Amicrosoft.com) | advapi32.dll | |
[OperationEnd](https://www.google.com/search?num=5&q=OperationEnd+site%3Amicrosoft.com) | advapi32.dll | |
@ -565,63 +517,56 @@ Native Method | Native DLL | Header | Managed Method
[ReadEventLog](https://www.google.com/search?num=5&q=ReadEventLogA+site%3Amicrosoft.com) | advapi32.dll | |
[RefreshClaimDictionary](https://www.google.com/search?num=5&q=RefreshClaimDictionary+site%3Amicrosoft.com) | authz.dll | |
[RegCloseKey](http://msdn2.microsoft.com/en-us/library/ms724837) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegCloseKey
[RegConnectRegistry](https://www.google.com/search?num=5&q=RegConnectRegistryA+site%3Amicrosoft.com) | advapi32.dll | |
[RegConnectRegistryEx](https://www.google.com/search?num=5&q=RegConnectRegistryExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegCopyTree](https://www.google.com/search?num=5&q=RegCopyTreeA+site%3Amicrosoft.com) | advapi32.dll | |
[RegCreateKey](https://www.google.com/search?num=5&q=RegCreateKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegCreateKeyEx](https://www.google.com/search?num=5&q=RegCreateKeyExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegCreateKeyTransacted](https://www.google.com/search?num=5&q=RegCreateKeyTransactedA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteKey](https://www.google.com/search?num=5&q=RegDeleteKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteKeyEx](https://www.google.com/search?num=5&q=RegDeleteKeyExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteKeyTransacted](https://www.google.com/search?num=5&q=RegDeleteKeyTransactedA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteKeyValue](https://www.google.com/search?num=5&q=RegDeleteKeyValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteTree](https://www.google.com/search?num=5&q=RegDeleteTreeA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDeleteValue](https://www.google.com/search?num=5&q=RegDeleteValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegDisablePredefinedCache](https://www.google.com/search?num=5&q=RegDisablePredefinedCache+site%3Amicrosoft.com) | advapi32.dll | |
[RegDisablePredefinedCacheEx](https://www.google.com/search?num=5&q=RegDisablePredefinedCacheEx+site%3Amicrosoft.com) | advapi32.dll | |
[RegDisableReflectionKey](https://www.google.com/search?num=5&q=RegDisableReflectionKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegEnableReflectionKey](https://www.google.com/search?num=5&q=RegEnableReflectionKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegEnumKey](https://www.google.com/search?num=5&q=RegEnumKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegEnumKeyEx](https://www.google.com/search?num=5&q=RegEnumKeyExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegEnumValue](https://www.google.com/search?num=5&q=RegEnumValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegFlushKey](https://www.google.com/search?num=5&q=RegFlushKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegGetKeySecurity](https://www.google.com/search?num=5&q=RegGetKeySecurity+site%3Amicrosoft.com) | advapi32.dll | |
[RegGetValue](https://www.google.com/search?num=5&q=RegGetValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegisterEventSource](https://www.google.com/search?num=5&q=RegisterEventSourceA+site%3Amicrosoft.com) | advapi32.dll | |
[RegisterIdleTask](https://www.google.com/search?num=5&q=RegisterIdleTask+site%3Amicrosoft.com) | advapi32.dll | |
[RegisterServiceCtrlHandler](https://www.google.com/search?num=5&q=RegisterServiceCtrlHandlerA+site%3Amicrosoft.com) | advapi32.dll | |
[RegisterServiceCtrlHandlerEx](https://www.google.com/search?num=5&q=RegisterServiceCtrlHandlerExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegConnectRegistry](http://msdn2.microsoft.com/en-us/library/d7fb41cc-4855-4ad7-879c-b1ac85ac5803) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegConnectRegistry
[RegCopyTree](http://msdn2.microsoft.com/en-us/library/d16f2b47-e537-42b0-90b3-9f9a00e61e76) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegCopyTree
[RegCreateKey](http://msdn2.microsoft.com/en-us/library/cb4d30f4-e288-41e8-86e0-807c313db53d) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegCreateKey
[RegCreateKeyEx](http://msdn2.microsoft.com/en-us/library/e9ffad7f-c0b6-44ce-bf22-fbe45ca98bf4) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegCreateKeyEx
[RegCreateKeyTransacted](http://msdn2.microsoft.com/en-us/library/f18e5ff9-41c3-4c26-8d01-a8ec69bcdef2) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegCreateKeyTransacted
[RegDeleteKey](http://msdn2.microsoft.com/en-us/library/a2310ca0-1b9f-48d1-a3b5-ea3a528bfaba) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteKey
[RegDeleteKeyEx](http://msdn2.microsoft.com/en-us/library/41fde6a5-647c-4293-92b8-74be54fa4136) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteKeyEx
[RegDeleteKeyTransacted](http://msdn2.microsoft.com/en-us/library/4c67e08b-4338-4441-8300-6b6ed31d4b21) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteKeyTransacted
[RegDeleteKeyValue](http://msdn2.microsoft.com/en-us/library/a4a082c2-8cf3-41eb-87c0-a6c453821f8b) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteKeyValue
[RegDeleteTree](http://msdn2.microsoft.com/en-us/library/984813a9-e191-498f-8288-b8a4c567112b) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteTree
[RegDeleteValue](http://msdn2.microsoft.com/en-us/library/4393b4ef-cd10-40d4-bb12-2d84e7cb7d3c) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDeleteValue
[RegDisablePredefinedCache](http://msdn2.microsoft.com/en-us/library/837584b3-5f61-4535-9e66-56f50ab3fa46) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDisablePredefinedCache
[RegDisablePredefinedCacheEx](http://msdn2.microsoft.com/en-us/library/a56cf7d9-0ac4-4719-af41-3c0cdcef6faf) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDisablePredefinedCacheEx
[RegDisableReflectionKey](http://msdn2.microsoft.com/en-us/library/294a1d28-d09f-44a3-8bc0-6fae50c3a8f8) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegDisableReflectionKey
[RegEnableReflectionKey](http://msdn2.microsoft.com/en-us/library/6dfbc3d8-cd71-4ee9-a10b-955c26a6894c) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegEnableReflectionKey
[RegEnumKey](http://msdn2.microsoft.com/en-us/library/18a05c60-6c6d-438f-9003-f07d688d86a3) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegEnumKey
[RegEnumKeyEx](http://msdn2.microsoft.com/en-us/library/647d34cc-01ba-4389-be29-b099ed198e7c) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegEnumKeyEx
[RegEnumValue](http://msdn2.microsoft.com/en-us/library/7014ff96-c655-486f-af32-180b87281b06) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegEnumValue
[RegFlushKey](http://msdn2.microsoft.com/en-us/library/ae1160be-1da7-4621-a0fc-727aa229ec06) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegFlushKey
[RegGetKeySecurity](http://msdn2.microsoft.com/en-us/library/26bd8f89-9241-4c13-a214-c2b276d68c92) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegGetKeySecurity
[RegGetValue](http://msdn2.microsoft.com/en-us/library/1c06facb-6735-4b3f-b77d-f162e3faaada) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegGetValue
[RegisterEventSource](http://msdn2.microsoft.com/en-us/library/53706f83-6bc9-45d6-981c-bd0680d7bc08) | advapi32.dll | winbase.h | Vanara.PInvoke.AdvApi32.RegisterEventSource
[RegisterServiceCtrlHandler](http://msdn2.microsoft.com/en-us/library/31ec28fe-8774-48fc-91ba-6fa43108e2cc) | advapi32.dll | winsvc.h | Vanara.PInvoke.AdvApi32.RegisterServiceCtrlHandler
[RegisterServiceCtrlHandlerEx](http://msdn2.microsoft.com/en-us/library/23eea346-9899-4214-88f4-9b7eb7ce1332) | advapi32.dll | winsvc.h | Vanara.PInvoke.AdvApi32.RegisterServiceCtrlHandlerEx
[RegisterTraceGuids](https://www.google.com/search?num=5&q=RegisterTraceGuidsA+site%3Amicrosoft.com) | advapi32.dll | |
[RegisterWaitChainCOMCallback](https://www.google.com/search?num=5&q=RegisterWaitChainCOMCallback+site%3Amicrosoft.com) | advapi32.dll | |
[RegLoadAppKey](https://www.google.com/search?num=5&q=RegLoadAppKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegLoadKey](https://www.google.com/search?num=5&q=RegLoadKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegLoadMUIString](https://www.google.com/search?num=5&q=RegLoadMUIStringA+site%3Amicrosoft.com) | advapi32.dll | |
[RegLoadAppKey](http://msdn2.microsoft.com/en-us/library/88eb79c1-9ea0-436e-ad2e-9ce05b8dcb2c) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegLoadAppKey
[RegLoadKey](http://msdn2.microsoft.com/en-us/library/536395aa-03ba-430d-a66d-fcabdc9dfe22) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegLoadKey
[RegLoadMUIString](http://msdn2.microsoft.com/en-us/library/76ffc77f-a1bc-4e01-858f-4a76563a2bbc) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegLoadMUIString
[RegNotifyChangeKeyValue](http://msdn2.microsoft.com/en-us/library/ms724892) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegNotifyChangeKeyValue
[RegOpenCurrentUser](https://www.google.com/search?num=5&q=RegOpenCurrentUser+site%3Amicrosoft.com) | advapi32.dll | |
[RegOpenKey](https://www.google.com/search?num=5&q=RegOpenKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegOpenCurrentUser](http://msdn2.microsoft.com/en-us/library/10a8cbfb-52dc-436a-827e-78f12eb62af0) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOpenCurrentUser
[RegOpenKey](http://msdn2.microsoft.com/en-us/library/bad0a0f8-1889-4eff-98be-084c95d69f3b) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOpenKey
[RegOpenKeyEx](http://msdn2.microsoft.com/en-us/library/ms724897) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOpenKeyEx
[RegOpenKeyTransacted](https://www.google.com/search?num=5&q=RegOpenKeyTransactedA+site%3Amicrosoft.com) | advapi32.dll | |
[RegOpenUserClassesRoot](https://www.google.com/search?num=5&q=RegOpenUserClassesRoot+site%3Amicrosoft.com) | advapi32.dll | |
[RegOverridePredefKey](https://www.google.com/search?num=5&q=RegOverridePredefKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegQueryInfoKey](https://www.google.com/search?num=5&q=RegQueryInfoKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegQueryMultipleValues](https://www.google.com/search?num=5&q=RegQueryMultipleValuesA+site%3Amicrosoft.com) | advapi32.dll | |
[RegQueryReflectionKey](https://www.google.com/search?num=5&q=RegQueryReflectionKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegQueryValue](https://www.google.com/search?num=5&q=RegQueryValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegQueryValueEx](https://www.google.com/search?num=5&q=RegQueryValueExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegRenameKey](https://www.google.com/search?num=5&q=RegRenameKey+site%3Amicrosoft.com) | advapi32.dll | |
[RegReplaceKey](https://www.google.com/search?num=5&q=RegReplaceKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegRestoreKey](https://www.google.com/search?num=5&q=RegRestoreKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegSaveKey](https://www.google.com/search?num=5&q=RegSaveKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RegSaveKeyEx](https://www.google.com/search?num=5&q=RegSaveKeyExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegSetKeySecurity](https://www.google.com/search?num=5&q=RegSetKeySecurity+site%3Amicrosoft.com) | advapi32.dll | |
[RegSetKeyValue](https://www.google.com/search?num=5&q=RegSetKeyValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegSetValue](https://www.google.com/search?num=5&q=RegSetValueA+site%3Amicrosoft.com) | advapi32.dll | |
[RegSetValueEx](https://www.google.com/search?num=5&q=RegSetValueExA+site%3Amicrosoft.com) | advapi32.dll | |
[RegUnLoadKey](https://www.google.com/search?num=5&q=RegUnLoadKeyA+site%3Amicrosoft.com) | advapi32.dll | |
[RemoteRegEnumKeyWrapper](https://www.google.com/search?num=5&q=RemoteRegEnumKeyWrapper+site%3Amicrosoft.com) | advapi32.dll | |
[RemoteRegEnumValueWrapper](https://www.google.com/search?num=5&q=RemoteRegEnumValueWrapper+site%3Amicrosoft.com) | advapi32.dll | |
[RemoteRegQueryInfoKeyWrapper](https://www.google.com/search?num=5&q=RemoteRegQueryInfoKeyWrapper+site%3Amicrosoft.com) | advapi32.dll | |
[RemoteRegQueryValueWrapper](https://www.google.com/search?num=5&q=RemoteRegQueryValueWrapper+site%3Amicrosoft.com) | advapi32.dll | |
[RegOpenKeyTransacted](http://msdn2.microsoft.com/en-us/library/11663ed2-d17c-4f08-be7b-9b591271fbcd) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOpenKeyTransacted
[RegOpenUserClassesRoot](http://msdn2.microsoft.com/en-us/library/bd068826-cf88-4fc7-a7d6-96cc03e923c7) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOpenUserClassesRoot
[RegOverridePredefKey](http://msdn2.microsoft.com/en-us/library/ad58b7ff-cd61-4719-9028-b470ae7e9bb0) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegOverridePredefKey
[RegQueryInfoKey](http://msdn2.microsoft.com/en-us/library/25eb2cd2-9fdd-4d6f-8071-daab56f9aae1) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegQueryInfoKey
[RegQueryMultipleValues](http://msdn2.microsoft.com/en-us/library/e718534a-6e68-40f5-9cdd-170ce9b5e6e5) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegQueryMultipleValues
[RegQueryReflectionKey](http://msdn2.microsoft.com/en-us/library/d7516eab-dbcf-4ece-931e-d7bb2a983503) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegQueryReflectionKey
[RegQueryValue](http://msdn2.microsoft.com/en-us/library/18f27717-3bd9-45ac-a1ea-61abc1753a52) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegQueryValue
[RegQueryValueEx](http://msdn2.microsoft.com/en-us/library/202d253a-10ff-40e7-8eec-a49717443b81) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegQueryValueEx
[RegReplaceKey](http://msdn2.microsoft.com/en-us/library/f968fa71-edc8-4f49-b9fa-1e89224df33b) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegReplaceKey
[RegRestoreKey](http://msdn2.microsoft.com/en-us/library/6267383d-427a-4ae8-b9cc-9c1861d3b7bb) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegRestoreKey
[RegSaveKey](http://msdn2.microsoft.com/en-us/library/da80f40d-0099-4748-94ca-5d3b001e633e) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSaveKey
[RegSaveKeyEx](http://msdn2.microsoft.com/en-us/library/f93b4162-cac4-42f7-bfd4-9e23fff80a03) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSaveKeyEx
[RegSetKeySecurity](http://msdn2.microsoft.com/en-us/library/08bf8fc1-6a08-490e-b589-730211774257) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSetKeySecurity
[RegSetKeyValue](http://msdn2.microsoft.com/en-us/library/e27d2dd6-b139-4ac1-8dd8-527022333364) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSetKeyValue
[RegSetValue](http://msdn2.microsoft.com/en-us/library/f99774d4-575b-43a3-8887-e15acb0477fd) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSetValue
[RegSetValueEx](http://msdn2.microsoft.com/en-us/library/29b0e27c-4999-4e92-bd8b-bba74920bccc) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegSetValueEx
[RegUnLoadKey](http://msdn2.microsoft.com/en-us/library/73b4b6a9-4acb-4247-bd7f-82024ba3e14a) | advapi32.dll | winreg.h | Vanara.PInvoke.AdvApi32.RegUnLoadKey
[RemoveTraceCallback](https://www.google.com/search?num=5&q=RemoveTraceCallback+site%3Amicrosoft.com) | advapi32.dll | |
[RemoveUsersFromEncryptedFile](https://www.google.com/search?num=5&q=RemoveUsersFromEncryptedFile+site%3Amicrosoft.com) | advapi32.dll | |
[ReportEvent](https://www.google.com/search?num=5&q=ReportEventA+site%3Amicrosoft.com) | advapi32.dll | |
@ -685,7 +630,7 @@ Native Method | Native DLL | Header | Managed Method
[SetServiceBits](https://www.google.com/search?num=5&q=SetServiceBits+site%3Amicrosoft.com) | advapi32.dll | |
[SetServiceObjectSecurity](https://www.google.com/search?num=5&q=SetServiceObjectSecurity+site%3Amicrosoft.com) | advapi32.dll | |
[SetServiceStatus](https://www.google.com/search?num=5&q=SetServiceStatus+site%3Amicrosoft.com) | advapi32.dll | |
[SetThreadToken](https://www.google.com/search?num=5&q=SetThreadToken+site%3Amicrosoft.com) | advapi32.dll | | Vanara.PInvoke.AdvApi32.SetThreadToken
[SetThreadToken](http://msdn2.microsoft.com/en-us/library/aa379590) | advapi32.dll | Winbase.h | Vanara.PInvoke.AdvApi32.SetThreadToken
[SetTokenInformation](https://www.google.com/search?num=5&q=SetTokenInformation+site%3Amicrosoft.com) | advapi32.dll | |
[SetTraceCallback](https://www.google.com/search?num=5&q=SetTraceCallback+site%3Amicrosoft.com) | advapi32.dll | |
[SetUserFileEncryptionKey](https://www.google.com/search?num=5&q=SetUserFileEncryptionKey+site%3Amicrosoft.com) | advapi32.dll | |
@ -756,30 +701,32 @@ Native Structure | Header | Managed Structure
[ACL](http://msdn2.microsoft.com/en-us/library/aa374931) | Winnt.h | Vanara.PInvoke.AdvApi32+ACL
[ACL_REVISION_INFORMATION](http://msdn2.microsoft.com/en-us/library/aa374942) | Winnt.h | Vanara.PInvoke.AdvApi32+ACL_REVISION_INFORMATION
[ACL_SIZE_INFORMATION](http://msdn2.microsoft.com/en-us/library/aa374945) | Winnt.h | Vanara.PInvoke.AdvApi32+ACL_SIZE_INFORMATION
[AUTHZ_ACCESS_REPLY](https://www.google.com/search?num=5&q=AUTHZ_ACCESS_REPLY+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_ACCESS_REPLY
[AUTHZ_ACCESS_REQUEST](https://www.google.com/search?num=5&q=AUTHZ_ACCESS_REQUEST+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_ACCESS_REQUEST
[AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE](https://www.google.com/search?num=5&q=AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE
[AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE](https://www.google.com/search?num=5&q=AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE
[AUTHZ_SECURITY_ATTRIBUTE_V1](https://www.google.com/search?num=5&q=AUTHZ_SECURITY_ATTRIBUTE_V1+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_V1
[AUTHZ_SECURITY_ATTRIBUTE_V1_Union](https://www.google.com/search?num=5&q=AUTHZ_SECURITY_ATTRIBUTE_V1_Union+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_V1_Union
[AUTHZ_ACCESS_REPLY](http://msdn2.microsoft.com/en-us/library/7162bf80-3730-46d7-a603-2a55b969c9ba) | authz.h | Vanara.PInvoke.Authz+AUTHZ_ACCESS_REPLY
[AUTHZ_ACCESS_REQUEST](http://msdn2.microsoft.com/en-us/library/3748075c-b31a-4669-b8a6-1a540449d8fa) | authz.h | Vanara.PInvoke.Authz+AUTHZ_ACCESS_REQUEST
[AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE](http://msdn2.microsoft.com/en-us/library/05b4bf7d-a0d9-473c-b215-9cf566b2a996) | authz.h | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE
[AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE](http://msdn2.microsoft.com/en-us/library/aebe20d5-280f-45d3-a11d-279a08a1a165) | authz.h | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE
[AUTHZ_SECURITY_ATTRIBUTE_V1](http://msdn2.microsoft.com/en-us/library/0c4778bb-1b5d-4422-b066-d2a6aaa1f351) | authz.h | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_V1
[AUTHZ_SECURITY_ATTRIBUTE_V1_Union](https://www.google.com/search?num=5&q=AUTHZ_SECURITY_ATTRIBUTE_V1_Union+site%3Amicrosoft.com) | | Vanara.PInvoke.Authz+AUTHZ_SECURITY_ATTRIBUTE_V1+AUTHZ_SECURITY_ATTRIBUTE_V1_Union
[BINARY_BLOB_CREDENTIAL_INFO](http://msdn2.microsoft.com/en-us/library/20a1d54b-04a7-4b0a-88e4-1970d1f71502) | wincred.h | Vanara.PInvoke.AdvApi32+BINARY_BLOB_CREDENTIAL_INFO
[CERT_CREDENTIAL_INFO](http://msdn2.microsoft.com/en-us/library/acaa94c3-0562-420a-95c7-44a71374d5ea) | wincred.h | Vanara.PInvoke.AdvApi32+CERT_CREDENTIAL_INFO
[CLAIM_SECURITY_ATTRIBUTE_INFORMATION_V1](http://msdn2.microsoft.com/en-us/library/hh448481) | Winnt.h | Vanara.PInvoke.AdvApi32+CLAIM_SECURITY_ATTRIBUTE_INFORMATION_V1
[CLAIM_SECURITY_ATTRIBUTES_INFORMATION](http://msdn2.microsoft.com/en-us/library/hh448481) | Winnt.h | Vanara.PInvoke.AdvApi32+CLAIM_SECURITY_ATTRIBUTES_INFORMATION
[CREDENTIAL](https://www.google.com/search?num=5&q=CREDENTIAL+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+CREDENTIAL
[CREDENTIAL_TARGET_INFORMATION](https://www.google.com/search?num=5&q=CREDENTIAL_TARGET_INFORMATION+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+CREDENTIAL_TARGET_INFORMATION
[CREDENTIAL](https://www.google.com/search?num=5&q=CREDENTIAL+site%3Amicrosoft.com) | wincred.h | Vanara.PInvoke.AdvApi32+CREDENTIAL
[CREDENTIAL_TARGET_INFORMATION](http://msdn2.microsoft.com/en-us/library/92180f2c-ef7c-4481-9b6f-19234c114afb) | wincred.h | Vanara.PInvoke.AdvApi32+CREDENTIAL_TARGET_INFORMATION
[GENERIC_MAPPING](http://msdn2.microsoft.com/en-us/library/aa446633) | Winnt.h | Vanara.PInvoke.AdvApi32+GENERIC_MAPPING
[INHERITED_FROM](http://msdn2.microsoft.com/en-us/library/aa378845) | AccCtrl.h | Vanara.PInvoke.AdvApi32+INHERITED_FROM
[LSA_ENUMERATION_INFORMATION](https://www.google.com/search?num=5&q=LSA_ENUMERATION_INFORMATION+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_ENUMERATION_INFORMATION
[LSA_OBJECT_ATTRIBUTES](https://www.google.com/search?num=5&q=LSA_OBJECT_ATTRIBUTES+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_OBJECT_ATTRIBUTES
[LSA_REFERENCED_DOMAIN_LIST](https://www.google.com/search?num=5&q=LSA_REFERENCED_DOMAIN_LIST+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_REFERENCED_DOMAIN_LIST
[LSA_ENUMERATION_INFORMATION](http://msdn2.microsoft.com/en-us/library/7577548f-3ceb-43a5-b447-6f66a09963fe) | ntsecapi.h | Vanara.PInvoke.AdvApi32+LSA_ENUMERATION_INFORMATION
[LSA_OBJECT_ATTRIBUTES](http://msdn2.microsoft.com/en-us/library/ad05cb52-8e58-46a9-b3e8-0c9c2a24a997) | lsalookup.h | Vanara.PInvoke.AdvApi32+LSA_OBJECT_ATTRIBUTES
[LSA_REFERENCED_DOMAIN_LIST](http://msdn2.microsoft.com/en-us/library/ms721834) | Ntsecapi.h | Vanara.PInvoke.AdvApi32+LSA_REFERENCED_DOMAIN_LIST
[LSA_STRING](http://msdn2.microsoft.com/en-us/library/aa378522) | LsaLookup.h | Vanara.PInvoke.AdvApi32+LSA_STRING
[LSA_TRANSLATED_NAME](https://www.google.com/search?num=5&q=LSA_TRANSLATED_NAME+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_TRANSLATED_NAME
[LSA_TRANSLATED_SID2](https://www.google.com/search?num=5&q=LSA_TRANSLATED_SID2+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_TRANSLATED_SID2
[LSA_TRUST_INFORMATION](https://www.google.com/search?num=5&q=LSA_TRUST_INFORMATION+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LSA_TRUST_INFORMATION
[LSA_TRANSLATED_NAME](http://msdn2.microsoft.com/en-us/library/edea8317-5cdf-4d1e-9e6d-fcf17b91adb7) | lsalookup.h | Vanara.PInvoke.AdvApi32+LSA_TRANSLATED_NAME
[LSA_TRANSLATED_SID2](http://msdn2.microsoft.com/en-us/library/792de958-8e24-46d8-b484-159435bc96e3) | lsalookup.h | Vanara.PInvoke.AdvApi32+LSA_TRANSLATED_SID2
[LSA_TRUST_INFORMATION](http://msdn2.microsoft.com/en-us/library/2b5e6f79-b97a-4018-a45a-37c300c3dc0d) | lsalookup.h | Vanara.PInvoke.AdvApi32+LSA_TRUST_INFORMATION
[LSA_UNICODE_STRING](http://msdn2.microsoft.com/en-us/library/ms721841) | Ntsecapi.h | Vanara.PInvoke.AdvApi32+LSA_UNICODE_STRING
[LUID](https://www.google.com/search?num=5&q=LUID+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LUID
[LUID_AND_ATTRIBUTES](https://www.google.com/search?num=5&q=LUID_AND_ATTRIBUTES+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+LUID_AND_ATTRIBUTES
[PRIVILEGE_SET](https://www.google.com/search?num=5&q=PRIVILEGE_SET+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+PRIVILEGE_SET
[PSID_IDENTIFIER_AUTHORITY](http://msdn2.microsoft.com/en-us/library/aa379598) | Winnt.h | Vanara.PInvoke.AdvApi32+PSID_IDENTIFIER_AUTHORITY
[PSID_IDENTIFIER_AUTHORITY](http://msdn2.microsoft.com/en-us/library/450a6d2d-d2e4-4098-90af-a8024ddcfcb5) | winnt.h | Vanara.PInvoke.AdvApi32+PSID_IDENTIFIER_AUTHORITY
[PTOKEN_PRIVILEGES](https://www.google.com/search?num=5&q=PTOKEN_PRIVILEGES+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+PTOKEN_PRIVILEGES
[QUERY_SERVICE_CONFIG](http://msdn2.microsoft.com/en-us/library/ms684950) | Winsvc.h | Vanara.PInvoke.AdvApi32+QUERY_SERVICE_CONFIG
[QUOTA_LIMITS](http://msdn2.microsoft.com/en-us/library/aa379363) | Winnt.h | Vanara.PInvoke.AdvApi32+QUOTA_LIMITS
@ -803,3 +750,5 @@ Native Structure | Header | Managed Structure
[TOKEN_STATISTICS](http://msdn2.microsoft.com/en-us/library/aa379632) | WinNT.h | Vanara.PInvoke.AdvApi32+TOKEN_STATISTICS
[TOKEN_USER](https://www.google.com/search?num=5&q=TOKEN_USER+site%3Amicrosoft.com) | | Vanara.PInvoke.AdvApi32+TOKEN_USER
[TRUSTEE](http://msdn2.microsoft.com/en-us/library/aa379636) | AccCtrl.h | Vanara.PInvoke.AdvApi32+TRUSTEE
[USERNAME_TARGET_CREDENTIAL_INFO](http://msdn2.microsoft.com/en-us/library/1cb56a85-fafd-4471-b0e9-660ac0dc0219) | wincred.h | Vanara.PInvoke.AdvApi32+USERNAME_TARGET_CREDENTIAL_INFO
[VALENT](http://msdn2.microsoft.com/en-us/library/7881eea8-e4e3-48cf-ba8f-b5c23910ae7d) | winreg.h | Vanara.PInvoke.AdvApi32+VALENT

View File

@ -25,10 +25,10 @@
<PackageReleaseNotes>Currently implements:
Functions
AbortSystemShutdownA, AbortSystemShutdownW, AdjustTokenPrivileges, AllocateAndInitializeSid, AllocateLocallyUniqueId, AuthzAccessCheck, AuthzFreeAuditEvent, AuthzFreeContext, AuthzFreeHandle, AuthzFreeResourceManager, AuthzGetInformationFromContext, AuthzInitializeCompoundContext, AuthzInitializeContextFromSid, AuthzInitializeContextFromToken, AuthzInitializeObjectAccessAuditEvent, AuthzInitializeResourceManager, AuthzModifyClaims, AuthzModifySecurityAttributes, AuthzModifySids, ChangeServiceConfig2A, ChangeServiceConfig2W, ChangeServiceConfigA, ChangeServiceConfigW, ConvertSecurityDescriptorToStringSecurityDescriptorA, ConvertSecurityDescriptorToStringSecurityDescriptorW, ConvertSidToStringSidA, ConvertSidToStringSidW, ConvertStringSecurityDescriptorToSecurityDescriptorA, ConvertStringSecurityDescriptorToSecurityDescriptorW, ConvertStringSidToSidA, ConvertStringSidToSidW, CopySid, CredFree, CredGetTargetInfoA, CredGetTargetInfoW, CredReadDomainCredentialsA, CredReadDomainCredentialsW, CredWriteDomainCredentialsA, CredWriteDomainCredentialsW, DuplicateToken, DuplicateTokenEx, EqualSid, FreeInheritedFromArray, FreeSid, GetAce, GetAclInformation, GetEffectiveRightsFromAclA, GetEffectiveRightsFromAclW, GetInheritanceSourceA, GetInheritanceSourceW, GetLengthSid, GetNamedSecurityInfoA, GetNamedSecurityInfoW, GetPrivateObjectSecurity, GetSecurityDescriptorDacl, GetSecurityDescriptorOwner, GetSidSubAuthority, GetTokenInformation, ImpersonateNamedPipeClient, InitiateShutdownA, InitiateShutdownW, InitiateSystemShutdownExA, InitiateSystemShutdownExW, IsValidSid, LogonUserA, LogonUserExA, LogonUserExW, LogonUserW, LookupAccountNameA, LookupAccountNameW, LookupAccountSidA, LookupAccountSidW, LookupPrivilegeNameA, LookupPrivilegeNameW, LookupPrivilegeValueA, LookupPrivilegeValueW, LsaAddAccountRights, LsaConnectUntrusted, LsaCreateAccount, LsaDeregisterLogonProcess, LsaEnumerateAccountRights, LsaEnumerateAccountsWithUserRight, LsaGetAppliedCAPIDs, LsaGetSystemAccessAccount, LsaLookupAuthenticationPackage, LsaLookupNames2, LsaLookupSids2, LsaNtStatusToWinError, LsaOpenAccount, LsaOpenPolicy, LsaRegisterLogonProcess, LsaRemoveAccountRights, LsaSetSystemAccessAccount, MapGenericMask, OpenProcessToken, OpenThreadToken, PrivilegeCheck, QueryServiceConfig2A, QueryServiceConfig2W, QueryServiceConfigA, QueryServiceConfigW, RegCloseKey, RegNotifyChangeKeyValue, RegOpenKeyExA, RegOpenKeyExW, RevertToSelf, SetNamedSecurityInfoA, SetNamedSecurityInfoW, SetThreadToken
AbortSystemShutdownA, AbortSystemShutdownW, AdjustTokenPrivileges, AllocateAndInitializeSid, AllocateLocallyUniqueId, AuthzAccessCheck, AuthzFreeAuditEvent, AuthzFreeContext, AuthzFreeHandle, AuthzFreeResourceManager, AuthzGetInformationFromContext, AuthzInitializeCompoundContext, AuthzInitializeContextFromSid, AuthzInitializeContextFromToken, AuthzInitializeObjectAccessAuditEvent, AuthzInitializeResourceManager, AuthzModifyClaims, AuthzModifySecurityAttributes, AuthzModifySids, ChangeServiceConfig2A, ChangeServiceConfig2W, ChangeServiceConfigA, ChangeServiceConfigW, ConvertSecurityDescriptorToStringSecurityDescriptorA, ConvertSecurityDescriptorToStringSecurityDescriptorW, ConvertSidToStringSidA, ConvertSidToStringSidW, ConvertStringSecurityDescriptorToSecurityDescriptorA, ConvertStringSecurityDescriptorToSecurityDescriptorW, ConvertStringSidToSidA, ConvertStringSidToSidW, CopySid, CredDeleteA, CredDeleteW, CredEnumerateA, CredEnumerateW, CredFindBestCredentialA, CredFindBestCredentialW, CredFree, CredGetSessionTypes, CredGetTargetInfoA, CredGetTargetInfoW, CredIsMarshaledCredentialA, CredIsMarshaledCredentialW, CredIsProtectedA, CredIsProtectedW, CredMarshalCredentialA, CredMarshalCredentialW, CredProtectA, CredProtectW, CredReadA, CredReadDomainCredentialsA, CredReadDomainCredentialsW, CredReadW, CredRenameA, CredRenameW, CredUnmarshalCredentialA, CredUnmarshalCredentialW, CredUnprotectA, CredUnprotectW, CredWriteA, CredWriteDomainCredentialsA, CredWriteDomainCredentialsW, CredWriteW, DuplicateToken, DuplicateTokenEx, EqualSid, FreeInheritedFromArray, FreeSid, GetAce, GetAclInformation, GetEffectiveRightsFromAclA, GetEffectiveRightsFromAclW, GetInheritanceSourceA, GetInheritanceSourceW, GetLengthSid, GetNamedSecurityInfoA, GetNamedSecurityInfoW, GetPrivateObjectSecurity, GetSecurityDescriptorDacl, GetSecurityDescriptorOwner, GetSidSubAuthority, GetTokenInformation, ImpersonateNamedPipeClient, InitiateShutdownA, InitiateShutdownW, InitiateSystemShutdownA, InitiateSystemShutdownExA, InitiateSystemShutdownExW, InitiateSystemShutdownW, IsValidSid, LogonUserA, LogonUserExA, LogonUserExW, LogonUserW, LookupAccountNameA, LookupAccountNameW, LookupAccountSidA, LookupAccountSidW, LookupPrivilegeNameA, LookupPrivilegeNameW, LookupPrivilegeValueA, LookupPrivilegeValueW, LsaAddAccountRights, LsaConnectUntrusted, LsaCreateAccount, LsaDeregisterLogonProcess, LsaEnumerateAccountRights, LsaEnumerateAccountsWithUserRight, LsaGetAppliedCAPIDs, LsaGetSystemAccessAccount, LsaLookupAuthenticationPackage, LsaLookupNames2, LsaLookupSids2, LsaNtStatusToWinError, LsaOpenAccount, LsaOpenPolicy, LsaRegisterLogonProcess, LsaRemoveAccountRights, LsaSetSystemAccessAccount, MapGenericMask, OpenProcessToken, OpenThreadToken, PrivilegeCheck, QueryServiceConfig2A, QueryServiceConfig2W, QueryServiceConfigA, QueryServiceConfigW, RegCloseKey, RegConnectRegistryA, RegConnectRegistryW, RegCopyTreeA, RegCopyTreeW, RegCreateKeyA, RegCreateKeyExA, RegCreateKeyExW, RegCreateKeyTransactedA, RegCreateKeyTransactedW, RegCreateKeyW, RegDeleteKeyA, RegDeleteKeyExA, RegDeleteKeyExW, RegDeleteKeyTransactedA, RegDeleteKeyTransactedW, RegDeleteKeyValueA, RegDeleteKeyValueW, RegDeleteKeyW, RegDeleteTreeA, RegDeleteTreeW, RegDeleteValueA, RegDeleteValueW, RegDisablePredefinedCache, RegDisablePredefinedCacheEx, RegDisableReflectionKey, RegEnableReflectionKey, RegEnumKeyA, RegEnumKeyExA, RegEnumKeyExW, RegEnumKeyW, RegEnumValueA, RegEnumValueW, RegFlushKey, RegGetKeySecurity, RegGetValueA, RegGetValueW, RegisterEventSourceA, RegisterEventSourceW, RegisterServiceCtrlHandlerA, RegisterServiceCtrlHandlerExA, RegisterServiceCtrlHandlerExW, RegisterServiceCtrlHandlerW, RegLoadAppKeyA, RegLoadAppKeyW, RegLoadKeyA, RegLoadKeyW, RegLoadMUIStringA, RegLoadMUIStringW, RegNotifyChangeKeyValue, RegOpenCurrentUser, RegOpenKeyA, RegOpenKeyExA, RegOpenKeyExW, RegOpenKeyTransactedA, RegOpenKeyTransactedW, RegOpenKeyW, RegOpenUserClassesRoot, RegOverridePredefKey, RegQueryInfoKeyA, RegQueryInfoKeyW, RegQueryMultipleValuesA, RegQueryMultipleValuesW, RegQueryReflectionKey, RegQueryValueA, RegQueryValueExA, RegQueryValueExW, RegQueryValueW, RegReplaceKeyA, RegReplaceKeyW, RegRestoreKeyA, RegRestoreKeyW, RegSaveKeyA, RegSaveKeyExA, RegSaveKeyExW, RegSaveKeyW, RegSetKeySecurity, RegSetKeyValueA, RegSetKeyValueW, RegSetValueA, RegSetValueExA, RegSetValueExW, RegSetValueW, RegUnLoadKeyA, RegUnLoadKeyW, RevertToSelf, SetNamedSecurityInfoA, SetNamedSecurityInfoW, SetThreadToken
Structures
INHERITED_FROM, TRUSTEE, LSA_OBJECT_ATTRIBUTES, LSA_STRING, LSA_TRANSLATED_NAME, LSA_TRANSLATED_SID2, LSA_ENUMERATION_INFORMATION, LSA_REFERENCED_DOMAIN_LIST, LSA_TRUST_INFORMATION, LSA_UNICODE_STRING, CREDENTIAL, CREDENTIAL_TARGET_INFORMATION, ACCESS_ALLOWED_ACE, ACE_HEADER, ACL, ACL_REVISION_INFORMATION, ACL_SIZE_INFORMATION, CLAIM_SECURITY_ATTRIBUTE_INFORMATION_V1, CLAIM_SECURITY_ATTRIBUTES_INFORMATION, GENERIC_MAPPING, LUID, LUID_AND_ATTRIBUTES, QUOTA_LIMITS, SECURITY_DESCRIPTOR, SID_AND_ATTRIBUTES, SID_IDENTIFIER_AUTHORITY, TOKEN_ACCESS_INFORMATION, TOKEN_APPCONTAINER_INFORMATION, TOKEN_DEFAULT_DACL, TOKEN_ELEVATION, TOKEN_GROUPS, TOKEN_GROUPS_AND_PRIVILEGES, TOKEN_MANDATORY_POLICY, TOKEN_MANDATORY_LABEL, TOKEN_LINKED_TOKEN, TOKEN_ORIGIN, TOKEN_OWNER, TOKEN_PRIMARY_GROUP, TOKEN_SOURCE, TOKEN_STATISTICS, TOKEN_USER, PRIVILEGE_SET, PSID_IDENTIFIER_AUTHORITY, PTOKEN_PRIVILEGES, QUERY_SERVICE_CONFIG, SERVICE_DESCRIPTION, AUTHZ_ACCESS_REPLY, AUTHZ_ACCESS_REQUEST, AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE, AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE, AUTHZ_SECURITY_ATTRIBUTE_V1, AUTHZ_SECURITY_ATTRIBUTE_V1_Union
INHERITED_FROM, TRUSTEE, LSA_OBJECT_ATTRIBUTES, LSA_STRING, LSA_TRANSLATED_NAME, LSA_TRANSLATED_SID2, LSA_ENUMERATION_INFORMATION, LSA_REFERENCED_DOMAIN_LIST, LSA_TRUST_INFORMATION, LSA_UNICODE_STRING, BINARY_BLOB_CREDENTIAL_INFO, CERT_CREDENTIAL_INFO, CREDENTIAL, CREDENTIAL_TARGET_INFORMATION, USERNAME_TARGET_CREDENTIAL_INFO, ACCESS_ALLOWED_ACE, ACE_HEADER, ACL, ACL_REVISION_INFORMATION, ACL_SIZE_INFORMATION, CLAIM_SECURITY_ATTRIBUTE_INFORMATION_V1, CLAIM_SECURITY_ATTRIBUTES_INFORMATION, GENERIC_MAPPING, LUID, LUID_AND_ATTRIBUTES, QUOTA_LIMITS, SECURITY_DESCRIPTOR, SID_AND_ATTRIBUTES, SID_IDENTIFIER_AUTHORITY, TOKEN_ACCESS_INFORMATION, TOKEN_APPCONTAINER_INFORMATION, TOKEN_DEFAULT_DACL, TOKEN_ELEVATION, TOKEN_GROUPS, TOKEN_GROUPS_AND_PRIVILEGES, TOKEN_MANDATORY_POLICY, TOKEN_MANDATORY_LABEL, TOKEN_LINKED_TOKEN, TOKEN_ORIGIN, TOKEN_OWNER, TOKEN_PRIMARY_GROUP, TOKEN_SOURCE, TOKEN_STATISTICS, TOKEN_USER, PRIVILEGE_SET, PSID_IDENTIFIER_AUTHORITY, PTOKEN_PRIVILEGES, VALENT, QUERY_SERVICE_CONFIG, SERVICE_DESCRIPTION, AUTHZ_ACCESS_REQUEST, AUTHZ_SECURITY_ATTRIBUTE_FQBN_VALUE, AUTHZ_SECURITY_ATTRIBUTE_OCTET_STRING_VALUE, AUTHZ_SECURITY_ATTRIBUTE_V1, AUTHZ_ACCESS_REPLY, AUTHZ_SECURITY_ATTRIBUTE_V1_Union
</PackageReleaseNotes>
</PropertyGroup>

View File

@ -1,5 +1,6 @@
using System;
using System.Runtime.InteropServices;
using Vanara.Extensions;
using Vanara.InteropServices;
using static Vanara.PInvoke.Macros;
@ -77,16 +78,16 @@ namespace Vanara.PInvoke
RT_VXD = 20,
}
/* ===================================================================================
* Removing struct based ResourceId as they can cause resource leaks with improper
* use. Opted for using IntPtr in structs and SafeResourceId in functions.
* ===================================================================================
*
/// <summary>Helper structure to use for a pointer that can morph into a string, pointer or integer.</summary>
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct ResourceId : IEquatable<string>, IEquatable<IntPtr>, IEquatable<int>, IEquatable<ResourceId>
{
/// <summary>The name</summary>
[FieldOffset(0)]
public string name;
/// <summary>The PTR</summary>
[FieldOffset(0)]
public IntPtr ptr;
/// <summary>Gets or sets an integer identifier.</summary>
@ -117,7 +118,7 @@ namespace Vanara.PInvoke
/// <summary>Performs an implicit conversion from <see cref="string"/> to <see cref="ResourceId"/>.</summary>
/// <param name="resName">Name of the resource.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator ResourceId(string resName) => new ResourceId { name = resName };
public static implicit operator ResourceId(string resName) => new ResourceId { ptr = StringHelper.AllocString(resName) };
/// <summary>Performs an implicit conversion from <see cref="int"/> to <see cref="ResourceId"/>.</summary>
/// <param name="resId">The resource identifier.</param>
@ -199,15 +200,10 @@ namespace Vanara.PInvoke
}
/// <summary>Helper structure to use for a pointer that can morph into a string, pointer or integer.</summary>
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ResourceIdUni : IEquatable<string>, IEquatable<IntPtr>, IEquatable<int>, IEquatable<ResourceIdUni>
{
/// <summary>The name</summary>
[FieldOffset(0)]
public string name;
/// <summary>The PTR</summary>
[FieldOffset(0)]
public IntPtr ptr;
/// <summary>Gets or sets an integer identifier.</summary>
@ -238,7 +234,7 @@ namespace Vanara.PInvoke
/// <summary>Performs an implicit conversion from <see cref="string"/> to <see cref="ResourceIdUni"/>.</summary>
/// <param name="resName">Name of the resource.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator ResourceIdUni(string resName) => new ResourceIdUni { name = resName };
public static implicit operator ResourceIdUni(string resName) => new ResourceIdUni { ptr = StringHelper.AllocString(resName, CharSet.Unicode) };
/// <summary>Performs an implicit conversion from <see cref="int"/> to <see cref="ResourceIdUni"/>.</summary>
/// <param name="resId">The resource identifier.</param>
@ -319,21 +315,27 @@ namespace Vanara.PInvoke
bool IEquatable<ResourceIdUni>.Equals(ResourceIdUni other) => string.Equals(other.ToString(), ToString());
}
*/
/// <summary>Represents a system resource name that can identify as a string, integer, or pointer.</summary>
/// <seealso cref="SafeHandle"/>
public sealed class SafeResourceId : GenericSafeHandle, IEquatable<string>, IEquatable<int>, IEquatable<SafeResourceId>, IEquatable<IntPtr>
public class SafeResourceId : GenericSafeHandle, IEquatable<string>, IEquatable<int>, IEquatable<SafeResourceId>, IEquatable<IntPtr>
{
/// <summary>Represent a NULL value.</summary>
public static readonly SafeResourceId Null = new SafeResourceId();
/// <summary>Initializes a new instance of the <see cref="SafeResourceId"/> class.</summary>
/// <param name="resName">Name of the resource.</param>
public SafeResourceId(string resName) : base(CloseHandle)
public SafeResourceId(string resName, CharSet charSet = CharSet.Auto)
{
if (string.IsNullOrEmpty(resName)) throw new ArgumentNullException(nameof(resName));
SetHandle(Marshal.StringToCoTaskMemUni(resName));
CharSet = charSet;
SetHandle(StringHelper.AllocString(resName, charSet));
}
/// <summary>Initializes a new instance of the <see cref="SafeResourceId"/> class.</summary>
/// <param name="resId">The resource identifier.</param>
public SafeResourceId(int resId) : base(CloseHandle)
public SafeResourceId(int resId)
{
if (resId > ushort.MaxValue || resId <= 0) throw new ArgumentOutOfRangeException(nameof(resId));
SetHandle((IntPtr)(ushort)resId);
@ -347,26 +349,51 @@ namespace Vanara.PInvoke
/// <summary>Initializes a new instance of the <see cref="SafeResourceId"/> class.</summary>
/// <param name="ptr">The PTR.</param>
public SafeResourceId(IntPtr ptr) : base(CloseHandle)
public SafeResourceId(IntPtr ptr)
{
if (IS_INTRESOURCE(ptr))
SetHandle(ptr);
else
{
var s = (string)Marshal.PtrToStringUni(ptr)?.Clone();
var s = StringHelper.GetString(ptr, CharSet);
if (s != null)
SetHandle(Marshal.StringToCoTaskMemUni(s));
SetHandle(StringHelper.AllocString(s, CharSet));
}
}
/// <summary>When overridden in a derived class, gets a value indicating whether the handle value is invalid.</summary>
/// <summary>Initializes a new instance of the <see cref="SafeResourceId"/> class.</summary>
protected SafeResourceId() { }
/// <summary>Gets or sets the character set to use on resource strings.</summary>
/// <value>The character set.</value>
public virtual CharSet CharSet { get; set; } = CharSet.Auto;
/// <summary>Gets or sets an integer identifier.</summary>
/// <value>The identifier.</value>
public int id
{
get => IsIntResource ? (ushort)handle.ToInt32() : 0;
set
{
if (value > ushort.MaxValue || value <= 0) throw new ArgumentOutOfRangeException(nameof(id));
SetHandle((IntPtr)(ushort)value);
}
}
/// <inheritdoc/>
public override bool IsInvalid => handle == IntPtr.Zero;
/// <summary>Gets a value indicating whether this instance is an integer-based resource.</summary>
/// <value><c>true</c> if this instance is an integer-based resource; otherwise, <c>false</c>.</value>
public bool IsIntResource => IS_INTRESOURCE(handle);
/// <inheritdoc/>
protected override Func<IntPtr, bool> CloseMethod => h => { if (h != IntPtr.Zero && !IS_INTRESOURCE(h)) StringHelper.FreeString(h); return true; };
/// <summary>Performs an implicit conversion from <see cref="SafeResourceId"/> to <see cref="System.Int32"/>.</summary>
/// <param name="r">The r.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator int(SafeResourceId r)
=> IS_INTRESOURCE(r.handle) ? (ushort)r.handle.ToInt32() : 0;
public static implicit operator int(SafeResourceId r) => r.IsIntResource ? (ushort)r.handle.ToInt32() : 0;
/// <summary>Performs an implicit conversion from <see cref="SafeResourceId"/> to <see cref="IntPtr"/>.</summary>
/// <param name="r">The r.</param>
@ -411,46 +438,61 @@ namespace Vanara.PInvoke
case string s:
return Equals(s);
case int i:
return Equals(i);
case IntPtr p:
return Equals(p);
case SafeResourceId r:
return Equals(r);
default:
if (!obj.GetType().IsPrimitive) return false;
try { return Equals(Convert.ToInt32(obj)); } catch { return false; }
}
}
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(string other) => string.Equals(ToString(), other);
/// <summary>
/// Gets a cloned handle that also, if a string resource, copies the string to a new handle which must be released using StringHelper.FreeString.
/// </summary>
/// <returns>A copy of the handle. Warning: This method can cause memory leaks if this is a string resource which is not freed.</returns>
public IntPtr GetClonedHandle()
{
if (IsIntResource || IsIntResource) return handle;
return StringHelper.AllocString(StringHelper.GetString(handle, CharSet), CharSet);
}
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(int other) => other == handle.ToInt32();
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(SafeResourceId other)
=> IS_INTRESOURCE(handle) && other != null ? handle == other.handle : Equals(other?.ToString());
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
public bool Equals(IntPtr other) => new SafeResourceId(other).Equals(this);
/// <summary>Returns a hash code for this instance.</summary>
/// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
/// <summary>Returns a <see cref="string"/> that represents this instance.</summary>
/// <returns>A <see cref="string"/> that represents this instance.</returns>
public override string ToString()
=> IS_INTRESOURCE(handle) ? $"#{handle.ToInt32()}" : Marshal.PtrToStringUni(handle);
/// <inheritdoc/>
public override string ToString() => GetString(handle, CharSet);
private static bool CloseHandle(IntPtr handle)
{
if (handle != IntPtr.Zero && !IS_INTRESOURCE(handle)) Marshal.FreeCoTaskMem(handle);
return true;
}
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
bool IEquatable<string>.Equals(string other) => string.Equals(ToString(), other);
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
bool IEquatable<int>.Equals(int other) => other == handle.ToInt32();
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
bool IEquatable<SafeResourceId>.Equals(SafeResourceId other) => string.Equals(other.ToString(), ToString());
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns>
bool IEquatable<IntPtr>.Equals(IntPtr other) => new SafeResourceId(other).Equals(this);
/// <summary>Gets the string representation of a resource identifier.</summary>
/// <param name="ptr">The resource identifier.</param>
/// <param name="charSet">The character set.</param>
/// <returns>The string representation.</returns>
public static string GetString(IntPtr ptr, CharSet charSet = CharSet.Auto) => IS_INTRESOURCE(ptr) ? $"#{ptr.ToInt32()}" : StringHelper.GetString(ptr, charSet);
}
}

View File

@ -51,7 +51,8 @@ NetApi32.dll | [Vanara.PInvoke.NetApi32](https://github.com/dahall/Vanara/blob/m
NetListMgr.dll | [Vanara.PInvoke.NetListMgr](https://github.com/dahall/Vanara/blob/master/PInvoke/NetListMgr/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-100%25-green.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.NetListMgr.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.NetListMgr)
NTDSApi.dll | [Vanara.PInvoke.NTDSApi](https://github.com/dahall/Vanara/blob/master/PInvoke/NTDSApi/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-8%25-red.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.NTDSApi.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.NTDSApi)
Ole32.dll, OleAut32 and PropSys.dll | [Vanara.PInvoke.Ole](https://github.com/dahall/Vanara/blob/master/PInvoke/Ole/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-7%25-red.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.Ole.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.Ole)
AdvApi32.dll, Authz.dll and Secur32.dll | [Vanara.PInvoke.Security](https://github.com/dahall/Vanara/blob/master/PInvoke/Security/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-11%25-red.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.Security.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.Security)
PathCch.dll | [Vanara.PInvoke.PathCch](https://github.com/dahall/Vanara/blob/master/PInvoke/PathCch/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-100%25-green.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.PathCch.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.PathCch)
AdvApi32.dll, Authz.dll and Secur32.dll | [Vanara.PInvoke.Security](https://github.com/dahall/Vanara/blob/master/PInvoke/Security/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-20%25-yellow.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.Security.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.Security)
Shell32.dll | [Vanara.PInvoke.Shell32](https://github.com/dahall/Vanara/blob/master/PInvoke/Shell32/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-100%25-green.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.Shell32.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.Shell32)
ShlwApi.dll | [Vanara.PInvoke.ShlwApi](https://github.com/dahall/Vanara/blob/master/PInvoke/ShlwApi/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-100%25-green.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.ShlwApi.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.ShlwApi)
TaskSchd.dll | [Vanara.PInvoke.TaskSchd](https://github.com/dahall/Vanara/blob/master/PInvoke/TaskSchd/CorrelationReport.md)<br>![Coverage](https://img.shields.io/badge/coverage-100%25-green.svg) | [![NuGet Package](https://img.shields.io/nuget/v/Vanara.PInvoke.TaskSchd.svg?style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.TaskSchd)

View File

@ -64,6 +64,7 @@ BackgroundCopyACLFlags, BackgroundCopyCost, BackgroundCopyErrorContext, Backgrou
<ProjectReference Include="..\PInvoke\BITS\Vanara.PInvoke.BITS.csproj" />
<ProjectReference Include="..\PInvoke\Kernel32\Vanara.PInvoke.Kernel32.csproj" />
<ProjectReference Include="..\PInvoke\NetListMgr\Vanara.PInvoke.NetListMgr.csproj" />
<ProjectReference Include="..\PInvoke\ShlwApi\Vanara.PInvoke.ShlwApi.csproj" />
<ProjectReference Include="..\PInvoke\User32\Vanara.PInvoke.User32.csproj" />
<ProjectReference Include="..\PInvoke\VirtDisk\Vanara.PInvoke.VirtDisk.csproj" />
<ProjectReference Include="..\Security\Vanara.Security.csproj" />

View File

@ -365,7 +365,7 @@ namespace Vanara.PInvoke.Tests
{
using (var hlib = new SafeLibraryHandle("ole32.dll", LoadLibraryExFlags.LOAD_LIBRARY_AS_DATAFILE))
{
var hres = FindResource(hlib, new SafeResourceId(4), new SafeResourceId(ResourceType.RT_CURSOR));
var hres = FindResource(hlib, 4, ResourceType.RT_CURSOR);
Assert.That(hres, Is.Not.EqualTo(IntPtr.Zero));
var sz = SizeofResource(hlib, hres);
Assert.That(sz, Is.GreaterThan(0));

View File

@ -0,0 +1,20 @@
using NUnit.Framework;
using Vanara.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Vanara.Windows.Forms.Tests
{
[TestFixture()]
public class AccessControlEditorTests
{
[Test()]
public void AccessControlEditorTest()
{
}
}
}

View File

@ -0,0 +1,45 @@
using NUnit.Framework;
using System.Windows.Forms;
namespace Vanara.Windows.Forms.Tests
{
[TestFixture()]
public class TaskDialogTests
{
[Test()]
public void TaskDialogTest()
{
var td = new TaskDialog
{
ButtonDisplay = TaskDialogButtonDisplay.CommandLink,
Content = "Content text, Content text, Content text, Content text, Content text, Content text, Content text, Content text, Content text, Content text, Content text, Content text",
MainInstruction = "Main Instruction",
WindowTitle = "Title"
};
td.Buttons.Add(new TaskDialogButton("Try this"));
td.Buttons.Add(new TaskDialogButton("Try that"));
td.ShowDialog();
Assert.That(MessageBox.Show("Confirm UI strings and command link buttons", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes);
td.Reset();
Assert.That(td.MainInstruction, Is.Null);
Assert.That(td.Buttons.Count, Is.Zero);
td.RadioButtons.Add(new TaskDialogRadioButton("Radio 1", 20));
td.RadioButtons.Add(new TaskDialogRadioButton("Radio 2", 21) { Enabled = false });
td.DefaultRadioButton = 20;
td.MainInstruction = "Radio Instruction";
td.CommonButtons = TaskDialogCommonButtons.Ok | TaskDialogCommonButtons.Cancel;
td.ShowDialog();
Assert.That(td.Result.SelectedRadioButton, Is.EqualTo(20));
Assert.That(MessageBox.Show("Confirm new dlg and radio buttons.", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes);
}
[Test()]
public void ShowTest1()
{
var i = TaskDialog.Show("Main instruct", "Caption", new[] { "Test1", "Test2" }, TaskDialogIcon.Shield);
Assert.That(i, Is.InRange(101, 102));
}
}
}

View File

@ -110,10 +110,12 @@
<Compile Include="System\RegTests.cs" />
<Compile Include="System\NetworkListTests.cs" />
<Compile Include="System\VirtualDiskTests.cs" />
<Compile Include="UI\Controls\NetworkConnectionDialogTests.cs" />
<Compile Include="UI\Dialogs\AccessControlEditorTests.cs" />
<Compile Include="UI\Dialogs\TaskDialogTests.cs" />
<Compile Include="UI\Dialogs\NetworkConnectionDialogTests.cs" />
<Compile Include="UI\VisualThemeTests.cs" />
<Compile Include="UI\Controls\ImageListTests.cs" />
<Compile Include="UI\Controls\CredentialsDialogTests.cs" />
<Compile Include="UI\Extensions\ImageListTests.cs" />
<Compile Include="UI\Dialogs\CredentialsDialogTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />

View File

@ -11,13 +11,18 @@ namespace Vanara.Windows.Forms
private ActCtxSafeHandle hActCtx;
private IntPtr localCookie;
public ActivationContext(string source = null)
public ActivationContext(string source = null, string assemblyDirectory = null)
{
if (source == null)
GetCurrentActCtx(out hActCtx);
else
{
var actctx = new ACTCTX(source);
if (assemblyDirectory != null)
{
actctx.lpAssemblyDirectory = assemblyDirectory;
actctx.dwFlags |= ActCtxFlags.ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
}
Create(ref actctx);
}
Activate();

View File

@ -25,6 +25,7 @@ using System.Drawing;
using System.Drawing.Design;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Vanara.Extensions;
@ -196,7 +197,8 @@ namespace Vanara.Windows.Forms
[Category("Behavior"), Description("Dialog can be closed by keys with no Cancel button.")]
public bool AllowDialogCancellation
{
get => flags[TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION]; set => flags[TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION] = value;
get => flags[TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION];
set => flags[TASKDIALOG_FLAGS.TDF_ALLOW_DIALOG_CANCELLATION] = value;
}
/// <summary>Gets or sets the placement of buttons added to the <see cref="Buttons"/> collection.</summary>
@ -248,7 +250,8 @@ namespace Vanara.Windows.Forms
[Category("Behavior"), Description("Callback timer should be called every 200 ms.")]
public bool CallbackTimer
{
get => flags[TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER]; set => flags[TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER] = value;
get => flags[TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER];
set => flags[TASKDIALOG_FLAGS.TDF_CALLBACK_TIMER] = value;
}
/// <summary>Indicates that the TaskDialog can be minimized. Works only if there if parent window is null. Will enable cancellation also.</summary>
@ -256,7 +259,8 @@ namespace Vanara.Windows.Forms
[Category("Behavior"), Description("TaskDialog can be minimized.")]
public bool CanBeMinimized
{
get => flags[TASKDIALOG_FLAGS.TDF_CAN_BE_MINIMIZED]; set => flags[TASKDIALOG_FLAGS.TDF_CAN_BE_MINIMIZED] = value;
get => flags[TASKDIALOG_FLAGS.TDF_CAN_BE_MINIMIZED];
set => flags[TASKDIALOG_FLAGS.TDF_CAN_BE_MINIMIZED] = value;
}
/// <summary>
@ -287,7 +291,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("Optional text for the primary content area.")]
public string Content
{
get => content; set
get => content;
set
{
if (content == value) return;
content = value;
@ -304,7 +309,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public Icon CustomFooterIcon
{
get => customFooterIcon; set
get => customFooterIcon;
set
{
if (customFooterIcon == value) return;
customFooterIcon = value;
@ -321,7 +327,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public Icon CustomMainIcon
{
get => customMainIcon; set
get => customMainIcon;
set
{
if (customMainIcon == value) return;
customMainIcon = value;
@ -359,7 +366,8 @@ namespace Vanara.Windows.Forms
[Category("Behavior"), Description("")]
public bool EnableHyperlinks
{
get => flags[TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS]; set => flags[TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS] = value;
get => flags[TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS];
set => flags[TASKDIALOG_FLAGS.TDF_ENABLE_HYPERLINKS] = value;
}
/// <summary>
@ -370,7 +378,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public bool ExpandedByDefault
{
get => flags[TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT]; set => flags[TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT] = value;
get => flags[TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT];
set => flags[TASKDIALOG_FLAGS.TDF_EXPANDED_BY_DEFAULT] = value;
}
/// <summary>
@ -393,7 +402,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public string ExpandedInformation
{
get => expandedInformation; set
get => expandedInformation;
set
{
if (expandedInformation == value) return;
expandedInformation = value;
@ -411,7 +421,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public bool ExpandFooterArea
{
get => flags[TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA]; set => flags[TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA] = value;
get => flags[TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA];
set => flags[TASKDIALOG_FLAGS.TDF_EXPAND_FOOTER_AREA] = value;
}
/// <summary>
@ -424,7 +435,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public string Footer
{
get => footer; set
get => footer;
set
{
if (footer == value) return;
footer = value;
@ -441,7 +453,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public TaskDialogIcon FooterIcon
{
get => footerIcon; set
get => footerIcon;
set
{
if (footerIcon == value) return;
footerIcon = value;
@ -468,7 +481,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public TaskDialogIcon MainIcon
{
get => mainIcon; set
get => mainIcon;
set
{
if (mainIcon != value)
{
@ -491,7 +505,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public string MainInstruction
{
get => mainInstruction; set
get => mainInstruction;
set
{
if (mainInstruction != value)
{
@ -508,7 +523,8 @@ namespace Vanara.Windows.Forms
[Category("Behavior"), Description("")]
public bool NoDefaultRadioButton
{
get => flags[TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON]; set => flags[TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON] = value;
get => flags[TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON];
set => flags[TASKDIALOG_FLAGS.TDF_NO_DEFAULT_RADIO_BUTTON] = value;
}
/// <summary>
@ -519,7 +535,8 @@ namespace Vanara.Windows.Forms
[Category("Window Style"), Description("")]
public bool PositionRelativeToWindow
{
get => flags[TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW]; set => flags[TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW] = value;
get => flags[TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW];
set => flags[TASKDIALOG_FLAGS.TDF_POSITION_RELATIVE_TO_WINDOW] = value;
}
/// <summary>
@ -546,7 +563,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public bool RightToLeftLayout
{
get => flags[TASKDIALOG_FLAGS.TDF_RTL_LAYOUT]; set => flags[TASKDIALOG_FLAGS.TDF_RTL_LAYOUT] = value;
get => flags[TASKDIALOG_FLAGS.TDF_RTL_LAYOUT];
set => flags[TASKDIALOG_FLAGS.TDF_RTL_LAYOUT] = value;
}
/// <summary>
@ -556,7 +574,8 @@ namespace Vanara.Windows.Forms
[Category("Layout"), Description("")]
public bool SizeToContent
{
get => flags[TASKDIALOG_FLAGS.TDF_SIZE_TO_CONTENT]; set => flags[TASKDIALOG_FLAGS.TDF_SIZE_TO_CONTENT] = value;
get => flags[TASKDIALOG_FLAGS.TDF_SIZE_TO_CONTENT];
set => flags[TASKDIALOG_FLAGS.TDF_SIZE_TO_CONTENT] = value;
}
/// <summary>Gets or sets a value indicating whether the form should be displayed as a topmost form.</summary>
@ -564,7 +583,8 @@ namespace Vanara.Windows.Forms
[Category("Window Style"), Description("")]
public bool TopMost
{
get => !flags[TASKDIALOG_FLAGS.TDF_NO_SET_FOREGROUND]; set => flags[TASKDIALOG_FLAGS.TDF_NO_SET_FOREGROUND] = !value;
get => !flags[TASKDIALOG_FLAGS.TDF_NO_SET_FOREGROUND];
set => flags[TASKDIALOG_FLAGS.TDF_NO_SET_FOREGROUND] = !value;
}
/// <summary>
@ -575,7 +595,8 @@ namespace Vanara.Windows.Forms
[Category("Appearance"), Description("")]
public bool VerificationFlagChecked
{
get => flags[TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED]; set => flags[TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED] = value;
get => flags[TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED];
set => flags[TASKDIALOG_FLAGS.TDF_VERIFICATION_FLAG_CHECKED] = value;
}
/// <summary>
@ -608,7 +629,8 @@ namespace Vanara.Windows.Forms
[DefaultValue(false)]
internal bool ShowProgressBar
{
get => flags[TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR]; set => flags[TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR] = value;
get => flags[TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR];
set => flags[TASKDIALOG_FLAGS.TDF_SHOW_PROGRESS_BAR] = value;
}
/// <summary>
@ -621,7 +643,8 @@ namespace Vanara.Windows.Forms
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
internal bool UseCommandLinks
{
get => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS]; set => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS] = value;
get => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS];
set => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS] = value;
}
/// <summary>
@ -633,7 +656,8 @@ namespace Vanara.Windows.Forms
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
internal bool UseCommandLinksNoIcon
{
get => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS_NO_ICON]; set => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS_NO_ICON] = value;
get => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS_NO_ICON];
set => flags[TASKDIALOG_FLAGS.TDF_USE_COMMAND_LINKS_NO_ICON] = value;
}
/// <summary>Gets or sets a value indicating whether this instance can raise events.</summary>
@ -1097,7 +1121,7 @@ namespace Vanara.Windows.Forms
if (!string.IsNullOrEmpty(WindowTitle))
config.pszWindowTitle = WindowTitle;
config.WindowTitle = WindowTitle;
if (CustomMainIcon != null)
{
@ -1108,10 +1132,10 @@ namespace Vanara.Windows.Forms
config.mainIcon = (IntPtr)MainIcon;
if (!string.IsNullOrEmpty(MainInstruction))
config.pszMainInstruction = MainInstruction;
config.MainInstruction = MainInstruction;
if (!string.IsNullOrEmpty(Content))
config.pszContent = Content;
config.Content = Content;
foreach (var b in Buttons) b.parent = this;
config.pButtons = (IntPtr)Buttons;
@ -1124,16 +1148,16 @@ namespace Vanara.Windows.Forms
config.nDefaultRadioButton = DefaultRadioButton;
if (!string.IsNullOrEmpty(VerificationText))
config.pszVerificationText = VerificationText;
config.VerificationText = VerificationText;
if (!string.IsNullOrEmpty(ExpandedInformation))
config.pszExpandedInformation = ExpandedInformation;
config.ExpandedInformation = ExpandedInformation;
if (!string.IsNullOrEmpty(ExpandedControlText))
config.pszExpandedControlText = ExpandedControlText;
config.ExpandedControlText = ExpandedControlText;
if (!string.IsNullOrEmpty(CollapsedControlText))
config.pszCollapsedControlText = CollapsedControlText;
config.CollapsedControlText = CollapsedControlText;
config.footerIcon = (IntPtr)FooterIcon;
if (CustomFooterIcon != null)
@ -1145,18 +1169,21 @@ namespace Vanara.Windows.Forms
config.footerIcon = (IntPtr)FooterIcon;
if (!string.IsNullOrEmpty(Footer))
config.pszFooter = Footer;
config.Footer = Footer;
config.pfCallbackProc = PrivateCallback;
config.cxWidth = (uint)Width;
// The call all this mucking about is here for.
TaskDialogResult res;
TaskDialogIndirect(ref config, out res.dialogResult, out res.selectedRadioButton, out res.verificationFlagChecked);
Result = res;
using (new ComCtl32v6Context())
{
TaskDialogResult res;
TaskDialogIndirect(config, out res.dialogResult, out res.selectedRadioButton, out res.verificationFlagChecked).ThrowIfFailed();
Result = res;
}
return res;
return Result;
}
//private bool ShouldSerializeProgressBar() { return ProgressBar != TaskDialogProgressBar.Default; }
@ -1304,7 +1331,7 @@ namespace Vanara.Windows.Forms
{
private const int hashSeed = 17;
private IntPtr ptr = IntPtr.Zero;
private int ptrHash = hashSeed, ptrCount;
private int ptrHash = hashSeed;
/// <summary>Initializes a new instance of the <see cref="TaskDialogButtonCollection{T}"/> class.</summary>
internal TaskDialogButtonCollection() { }
@ -1329,17 +1356,8 @@ namespace Vanara.Windows.Forms
{
// Clean up old array
((IDisposable)c).Dispose();
// Build new
if (c.Count > 0)
{
var elementSize = Marshal.SizeOf(typeof(TaskDialogButtonBase.TASKDIALOG_BUTTON));
c.ptrCount = c.Count;
c.ptr = Marshal.AllocHGlobal(elementSize*c.ptrCount);
for (var i = 0; i < c.ptrCount; i++)
Marshal.StructureToPtr(c[i].nativeButton, c.ptr.Offset(i*elementSize), false);
}
c.ptr = c.Select(b => b.nativeButton).MarshalToPtr(Marshal.AllocHGlobal, out var _);
// Set hash to new value
c.ptrHash = h;
}
@ -1360,13 +1378,9 @@ namespace Vanara.Windows.Forms
if (ptr == IntPtr.Zero) return;
lock (this)
{
var elementSize = Marshal.SizeOf(typeof(TaskDialogButtonBase.TASKDIALOG_BUTTON));
for (var i = 0; i < ptrCount; i++)
Marshal.DestroyStructure(ptr.Offset(i*elementSize), typeof(TaskDialogButtonBase.TASKDIALOG_BUTTON));
Marshal.FreeHGlobal(ptr);
ptr = IntPtr.Zero;
ptrHash = hashSeed;
ptrCount = 0;
}
}
}

View File

@ -1,228 +0,0 @@
using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Threading;
using static Vanara.PInvoke.AdvApi32;
using static Vanara.PInvoke.Kernel32;
namespace Vanara.Extensions
{
public static partial class ControlExtension
{
[DefaultEvent(nameof(SubkeyChanged))]
public class RegistryWatcher : Component, ISupportInitialize
{
private int currentSession;
private bool enableEvents;
private bool includeSubKeys;
private bool initializing;
private RegistryKey key;
private Thread thread;
private readonly object threadLock = new object();
private ISynchronizeInvoke synchObj;
private readonly ManualResetEvent breakEvent = new ManualResetEvent(false);
private const RegNotifyChangeFilter stdEvents = RegNotifyChangeFilter.REG_NOTIFY_CHANGE_ATTRIBUTES |
RegNotifyChangeFilter.REG_NOTIFY_CHANGE_LAST_SET |
RegNotifyChangeFilter.REG_NOTIFY_CHANGE_NAME |
RegNotifyChangeFilter.REG_NOTIFY_CHANGE_SECURITY;
public RegistryWatcher()
{
}
public RegistryWatcher(RegistryKey registryKey, bool includeSubKeys) : this()
{
key = registryKey;
IncludeSubKeys = includeSubKeys;
}
public event EventHandler<RegistryEventArgs> SubkeyChanged;
public event EventHandler<RegistryEventArgs> ValueChanged;
public bool EnableRaisingEvents
{
get { return enableEvents; }
set { enableEvents = value; }
}
public bool IncludeSubKeys
{
get { return includeSubKeys; }
set
{
if (includeSubKeys == value) return;
includeSubKeys = value;
Restart();
}
}
public RegistryKey RegistryKey
{
get { return key; }
set
{
if (!RegistryKey.Equals(key, value))
{
key = value;
Restart();
}
}
}
public override ISite Site
{
get { return base.Site; }
set
{
base.Site = value;
if (value != null && value.DesignMode) EnableRaisingEvents = true;
}
}
public ISynchronizeInvoke SynchronizingObject
{
get
{
if (synchObj == null && DesignMode)
{
var service = (IDesignerHost)GetService(typeof(IDesignerHost));
var root = service?.RootComponent as ISynchronizeInvoke;
if (root != null)
synchObj = root;
}
return synchObj;
}
set { synchObj = value; }
}
private bool IsSuspended => initializing || DesignMode;
public void BeginInit()
{
var enabled = enableEvents;
StopRaisingEvents();
enableEvents = enabled;
initializing = true;
}
public void EndInit()
{
initializing = false;
if (key != null && enableEvents)
StartRaisingEvents();
}
protected override void Dispose(bool disposing)
{
try
{
if (disposing)
{
StopRaisingEvents();
}
else
{
key = null;
}
}
finally
{
base.Dispose(disposing);
}
}
protected void OnSubkeyChanged(RegistryEventArgs e)
{
SubkeyChanged?.Invoke(this, e);
}
protected void OnValueChanged(RegistryEventArgs e)
{
ValueChanged?.Invoke(this, e);
}
private void Monitor()
{
if (enableEvents && key != null)
{
//hEvent = CreateEvent(null, true, false, null);
//if (0 != RegNotifyChangeKeyValue(key.Handle, includeSubKeys, stdEvents, hEvent, true))
// throw new Win32Exception();
lock (threadLock)
{
if (thread == null)
{
breakEvent.Reset();
thread = new Thread(new ThreadStart(ThreadTarget)) { IsBackground = true };
thread.Start();
}
}
}
}
private void ThreadTarget()
{
try
{
var autoEvent = new AutoResetEvent(false);
var waitHandles = new WaitHandle[] { autoEvent, breakEvent };
while (!breakEvent.WaitOne(0, true))
{
#pragma warning disable 618
var result = RegNotifyChangeKeyValue(key.Handle, includeSubKeys, stdEvents, autoEvent.Handle, true);
#pragma warning restore 618
if (result != 0)
throw new Win32Exception(result);
if (WaitHandle.WaitAny(waitHandles) == 0)
{
OnRegChanged();
}
}
}
finally
{
}
}
private void Restart()
{
if (IsSuspended || !enableEvents) return;
StopRaisingEvents();
StartRaisingEvents();
}
private void StartRaisingEvents()
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
throw new PlatformNotSupportedException();
if (IsSuspended)
{
enableEvents = true;
}
else
{
Monitor();
}
}
private void StopRaisingEvents()
{
if (IsSuspended)
enableEvents = false;
else if (key != null)
{
stopListening = true;
key = null;
Interlocked.Increment(ref currentSession);
enableEvents = false;
}
}
public class RegistryEventArgs : EventArgs { }
}
}
}