diff --git a/PInvoke/Kernel32/AppModel.cs b/PInvoke/Kernel32/AppModel.cs
new file mode 100644
index 00000000..eace5208
--- /dev/null
+++ b/PInvoke/Kernel32/AppModel.cs
@@ -0,0 +1,1756 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ ///
+ /// The AppPolicyCreateFileAccess enumeration indicates whether a process has full or restricted access to the IO devices (file, file
+ /// stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe).
+ ///
+ // typedef enum AppPolicyCreateFileAccess { AppPolicyCreateFileAccess_Full = 0, AppPolicyCreateFileAccess_Limited = 1}
+ // AppPolicyCreateFileAccess; https://msdn.microsoft.com/en-us/library/windows/desktop/mt829654(v=vs.85).aspx
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829654")]
+ public enum AppPolicyCreateFileAccess
+ {
+ ///
+ /// Indicates that the process has full access to the IO devices. This value is expected for a desktop application, or for a
+ /// Desktop Bridge application.
+ ///
+ AppPolicyCreateFileAccess_Full,
+
+ /// Indicates that the process has limited access to the IO devices. This value is expected for a UWP app.
+ AppPolicyCreateFileAccess_Limited,
+ }
+
+ /// The AppPolicyProcessTerminationMethod enumeration indicates the method used to end a process.
+ // typedef enum AppPolicyProcessTerminationMethod { AppPolicyProcessTerminationMethod_ExitProcess = 0,
+ // AppPolicyProcessTerminationMethod_TerminateProcess = 1} AppPolicyProcessTerminationMethod; https://msdn.microsoft.com/en-us/library/windows/desktop/mt829659(v=vs.85).aspx
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829659")]
+ public enum AppPolicyProcessTerminationMethod
+ {
+ ///
+ /// Allows DLLs to execute code at shutdown. This value is expected for a desktop application, or for a Desktop Bridge application.
+ ///
+ AppPolicyProcessTerminationMethod_ExitProcess,
+
+ /// Immediately ends the process. This value is expected for a UWP app.
+ AppPolicyProcessTerminationMethod_TerminateProcess,
+ }
+
+ ///
+ /// The AppPolicyShowDeveloperDiagnostic enumeration indicates the method used for a process to surface developer information, such
+ /// as asserts, to the user.
+ ///
+ // typedef enum AppPolicyShowDeveloperDiagnostic { AppPolicyShowDeveloperDiagnostic_None = 0, AppPolicyShowDeveloperDiagnostic_ShowUI
+ // = 1} AppPolicyShowDeveloperDiagnostic; https://msdn.microsoft.com/en-us/library/windows/desktop/mt829660(v=vs.85).aspx
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829660")]
+ public enum AppPolicyShowDeveloperDiagnostic
+ {
+ /// Indicates that the process does not show developer diagnostics. This value is expected for a UWP app.
+ AppPolicyShowDeveloperDiagnostic_None,
+
+ ///
+ /// Indicates that the process shows developer diagnostics UI. This value is expected for a desktop application, or for a Desktop
+ /// Bridge application.
+ ///
+ AppPolicyShowDeveloperDiagnostic_ShowUI,
+ }
+
+ ///
+ /// The AppPolicyThreadInitializationType enumeration indicates the kind of initialization that should be automatically performed for
+ /// a process when beginthread[ex] creates a thread.
+ ///
+ // typedef enum AppPolicyThreadInitializationType { AppPolicyThreadInitializationType_None = 0,
+ // AppPolicyThreadInitializationType_InitializeWinRT = 1} AppPolicyThreadInitializationType; https://msdn.microsoft.com/en-us/library/windows/desktop/mt829661(v=vs.85).aspx
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829661")]
+ public enum AppPolicyThreadInitializationType
+ {
+ /// Indicates that no initialization should be performed.
+ AppPolicyThreadInitializationType_None,
+
+ /// Indicates that Windows Runtime initialization should be performed.
+ AppPolicyThreadInitializationType_InitializeWinRT,
+ }
+
+ ///
+ /// Specifies the processor architectures supported by a package.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appxpackaging/ne-appxpackaging-appx_package_architecture typedef enum
+ // APPX_PACKAGE_ARCHITECTURE { APPX_PACKAGE_ARCHITECTURE_X86 , APPX_PACKAGE_ARCHITECTURE_ARM , APPX_PACKAGE_ARCHITECTURE_X64 ,
+ // APPX_PACKAGE_ARCHITECTURE_NEUTRAL , APPX_PACKAGE_ARCHITECTURE_ARM64 } ;
+ [PInvokeData("appxpackaging.h", MSDNShortId = "8BC7ABF0-448F-4405-AA82-49C6DB3F230C")]
+ public enum APPX_PACKAGE_ARCHITECTURE
+ {
+ /// The x86 processor architecture.
+ APPX_PACKAGE_ARCHITECTURE_X86 = 0,
+
+ /// The ARM processor architecture.
+ APPX_PACKAGE_ARCHITECTURE_ARM = 5,
+
+ /// The x64 processor architecture.
+ APPX_PACKAGE_ARCHITECTURE_X64 = 9,
+
+ /// Any processor architecture.
+ APPX_PACKAGE_ARCHITECTURE_NEUTRAL = 11,
+
+ /// The 64-bit ARM processor architecture.
+ APPX_PACKAGE_ARCHITECTURE_ARM64 = 12,
+ }
+
+ /// Specifies how packages are to be processed.
+ // https://docs.microsoft.com/en-us/windows/desktop/appxpkg/package-constants
+ [PInvokeData("", MSDNShortId = "72E565C3-6CFD-47E3-8BAC-17D6E86B99DA")]
+ [Flags]
+ public enum PACKAGE_FLAGS : uint
+ {
+ /// The maximum number of apps in a package.
+ PACKAGE_APPLICATIONS_MAX_COUNT = 100,
+
+ /// The minimum number of apps in a package.
+ PACKAGE_APPLICATIONS_MIN_COUNT = 0,
+
+ /// The maximum number of resource packages a package can have.
+ PACKAGE_FAMILY_MAX_RESOURCE_PACKAGES = 512,
+
+ /// The minimum number of resource packages a package can have.
+ PACKAGE_FAMILY_MIN_RESOURCE_PACKAGES = 0,
+
+ ///
+ /// Process all packages in the dependency graph. This is equivalent to PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT. Note:
+ /// PACKAGE_FILTER_ALL_LOADED may be altered or unavailable for releases after Windows 8.1. Instead, use PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT.
+ ///
+ PACKAGE_FILTER_ALL_LOADED = 0x00000000,
+
+ /// Process bundle packages in the package graph.
+ PACKAGE_FILTER_BUNDLE = 0x00000080,
+
+ /// Process the directly dependent packages of the head (first) package in the dependency graph.
+ PACKAGE_FILTER_DIRECT = 0x00000020,
+
+ /// Process the first package in the dependency graph.
+ PACKAGE_FILTER_HEAD = 0x00000010,
+
+ /// Process bundle packages in the package graph.
+ PACKAGE_FILTER_OPTIONAL = 0x00020000,
+
+ /// Process resource packages in the package graph.
+ PACKAGE_FILTER_RESOURCE = 0x00000040,
+
+ /// The maximum size of a package graph.
+ PACKAGE_GRAPH_MAX_SIZE = (1 + PACKAGE_MAX_DEPENDENCIES + PACKAGE_FAMILY_MAX_RESOURCE_PACKAGES),
+
+ /// The minimum size of a package graph.
+ PACKAGE_GRAPH_MIN_SIZE = 1,
+
+ /// Retrieve basic information.
+ PACKAGE_INFORMATION_BASIC = 0x00000000,
+
+ /// Retrieve full information.
+ PACKAGE_INFORMATION_FULL = 0x00000100,
+
+ /// The maximum number of packages a package depends on.
+ PACKAGE_MAX_DEPENDENCIES = 128,
+
+ /// The minimum number of packages a package depends on.
+ PACKAGE_MIN_DEPENDENCIES = 0,
+
+ /// The package is a bundle package.
+ PACKAGE_PROPERTY_BUNDLE = 0x00000004,
+
+ /// The package was registered with the DeploymentOptions enumeration.
+ PACKAGE_PROPERTY_DEVELOPMENT_MODE = 0x00010000,
+
+ /// The package is a framework.
+ PACKAGE_PROPERTY_FRAMEWORK = 0x00000001,
+
+ /// The package is an optional package.
+ PACKAGE_PROPERTY_OPTIONAL = 0x00000008,
+
+ /// The package is a resource package.
+ PACKAGE_PROPERTY_RESOURCE = 0x00000002,
+ }
+
+ ///
+ /// Specifies the origin of a package.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/ne-appmodel-packageorigin typedef enum PackageOrigin {
+ // PackageOrigin_Unknown , PackageOrigin_Unsigned , PackageOrigin_Inbox , PackageOrigin_Store , PackageOrigin_DeveloperUnsigned ,
+ // PackageOrigin_DeveloperSigned , PackageOrigin_LineOfBusiness } ;
+ [PInvokeData("appmodel.h", MSDNShortId = "0CB9CE97-8A54-4BE7-B054-00F29D36CAB2")]
+ public enum PackageOrigin
+ {
+ /// The package's origin is unknown.
+ PackageOrigin_Unknown,
+
+ /// The package originated as unsigned.
+ PackageOrigin_Unsigned,
+
+ /// The package was included inbox.
+ PackageOrigin_Inbox,
+
+ /// The package originated from the Windows Store.
+ PackageOrigin_Store,
+
+ /// The package originated as developer unsigned.
+ PackageOrigin_DeveloperUnsigned,
+
+ /// The package originated as developer signed.
+ PackageOrigin_DeveloperSigned,
+
+ /// The package originated as a line-of-business app.
+ PackageOrigin_LineOfBusiness,
+ }
+
+ ///
+ /// Retrieves a value indicating whether a process has full or restricted access to the IO devices (file, file stream, directory,
+ /// physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe).
+ ///
+ /// A handle that identifies the access token for a process.
+ ///
+ /// A pointer to a variable of the AppPolicyCreateFileAccess enumerated type. When the function returns successfully, the
+ /// variable contains an enumerated constant value indicating whether the process has full or restricted access to the IO devices.
+ ///
+ ///
+ /// If the function succeeds, the function returns ERROR_SUCCESS.
+ ///
+ /// If no known create file access policy was found for the process token, the function raises a STATUS_ASSERTION_FAILURE exception
+ /// and returns ERROR_NOT_FOUND.
+ ///
+ /// If either processToken or policy are null, the function returns ERROR_INVALID_PARAMETER.
+ ///
+ // LONG WINAPI AppPolicyGetCreateFileAccess( _In_ HANDLE processToken, _Out_ AppPolicyCreateFileAccess *policy); https://msdn.microsoft.com/en-us/library/windows/desktop/mt829655(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829655")]
+ public static extern Win32Error AppPolicyGetCreateFileAccess(IntPtr processToken, out AppPolicyCreateFileAccess policy);
+
+ /// Retrieves the method used to end a process.
+ /// A handle that identifies the access token for a process.
+ ///
+ /// A pointer to a variable of the AppPolicyProcessTerminationMethod enumerated type. When the function returns successfully,
+ /// the variable contains a value indicating the method used to end the process.
+ ///
+ ///
+ /// If the function succeeds, the function returns ERROR_SUCCESS.
+ ///
+ /// If no known create file access policy was found for the process token, the function raises a STATUS_ASSERTION_FAILURE exception
+ /// and returns ERROR_NOT_FOUND.
+ ///
+ /// If either processToken or policy are null, the function returns ERROR_INVALID_PARAMETER.
+ ///
+ // LONG WINAPI AppPolicyGetProcessTerminationMethod( _In_ HANDLE processToken, _Out_ AppPolicyProcessTerminationMethod *policy); https://msdn.microsoft.com/en-us/library/windows/desktop/mt829656(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829656")]
+ public static extern Win32Error AppPolicyGetProcessTerminationMethod(IntPtr processToken, out AppPolicyProcessTerminationMethod policy);
+
+ /// Retrieves the method used for a process to surface developer information, such as asserts, to the user.
+ /// A handle that identifies the access token for a process.
+ ///
+ /// A pointer to a variable of the AppPolicyShowDeveloperDiagnostic enumerated type. When the function returns successfully,
+ /// the variable contains a value indicating the method used for the process to surface developer information, such as asserts, to
+ /// the user.
+ ///
+ ///
+ /// If the function succeeds, the function returns ERROR_SUCCESS.
+ ///
+ /// If no known create file access policy was found for the process token, the function raises a STATUS_ASSERTION_FAILURE exception
+ /// and returns ERROR_NOT_FOUND.
+ ///
+ /// If either processToken or policy are null, the function returns ERROR_INVALID_PARAMETER.
+ ///
+ // LONG WINAPI AppPolicyGetShowDeveloperDiagnostic( _In_ HANDLE processToken, _Out_ AppPolicyShowDeveloperDiagnostic *policy); https://msdn.microsoft.com/en-us/library/windows/desktop/mt829657(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829657")]
+ public static extern Win32Error AppPolicyGetShowDeveloperDiagnostic(IntPtr processToken, out AppPolicyShowDeveloperDiagnostic policy);
+
+ ///
+ /// Retrieves the kind of initialization that should be automatically performed for a process when beginthread[ex] creates a thread.
+ ///
+ /// A handle that identifies the access token for a process.
+ ///
+ /// A pointer to a variable of the AppPolicyThreadInitializationType enumerated type. When the function returns successfully,
+ /// the variable contains a value indicating the kind of initialization that should be automatically performed for the process when
+ /// beginthread[ex] creates a thread.
+ ///
+ ///
+ /// If the function succeeds, the function returns ERROR_SUCCESS.
+ ///
+ /// If no known create file access policy was found for the process token, the function raises a STATUS_ASSERTION_FAILURE exception
+ /// and returns ERROR_NOT_FOUND.
+ ///
+ /// If either processToken or policy are null, the function returns ERROR_INVALID_PARAMETER.
+ ///
+ // LONG WINAPI AppPolicyGetThreadInitializationType( _In_ HANDLE processToken, _Out_ AppPolicyThreadInitializationType *policy); https://msdn.microsoft.com/en-us/library/windows/desktop/mt829658(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("AppModel.h", MSDNShortId = "mt829658")]
+ public static extern Win32Error AppPolicyGetThreadInitializationType(IntPtr processToken, out AppPolicyThreadInitializationType policy);
+
+ ///
+ /// Closes a reference to the specified package information.
+ ///
+ ///
+ /// Type: PACKAGE_INFO_REFERENCE
+ /// A reference to package information.
+ ///
+ ///
+ /// Type: LONG
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-closepackageinfo LONG ClosePackageInfo(
+ // PACKAGE_INFO_REFERENCE packageInfoReference );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "BA84FB47-F241-4120-9441-7E1149F68738")]
+ public static extern Win32Error ClosePackageInfo(PACKAGE_INFO_REFERENCE packageInfoReference);
+
+ ///
+ /// Finds the packages with the specified family name for the current user.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: UINT32
+ ///
+ /// The package constants that specify how package information is retrieved. All package constants except
+ /// PACKAGE_FILTER_ALL_LOADED are supported.
+ ///
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that holds the number of package full names that were found.
+ ///
+ /// First you pass NULL to packageFullNames to get the number of package full names that were found. You use this number to
+ /// allocate memory space for packageFullNames. Then you pass the address of this memory space to fill packageFullNames.
+ ///
+ ///
+ ///
+ /// Type: PWSTR*
+ /// A pointer to memory space that receives the strings of package full names that were found.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that holds the number of characters in the string of package full names.
+ ///
+ /// First you pass NULL to buffer to get the number of characters. You use this number to allocate memory space for buffer.
+ /// Then you pass the address of this memory space to fill buffer.
+ ///
+ ///
+ ///
+ /// Type: WCHAR*
+ /// A pointer to memory space that receives the string of characters for all of the package full names.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to memory space that receives the package properties for all of the packages that were found.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// One or more buffer is not large enough to hold the data. The required size is specified by either count or buffer.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-findpackagesbypackagefamily LONG
+ // FindPackagesByPackageFamily( PCWSTR packageFamilyName, UINT32 packageFilters, UINT32 *count, PWSTR *packageFullNames, UINT32
+ // *bufferLength, WCHAR *buffer, UINT32 *packageProperties );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "D52E98BD-726F-4AC0-A034-02896B1D1687")]
+ public static extern Win32Error FindPackagesByPackageFamily(string packageFamilyName, PACKAGE_FLAGS packageFilters, ref uint count, IntPtr packageFullNames, ref uint bufferLength, IntPtr buffer, IntPtr packageProperties);
+
+ ///
+ /// Constructs an application user model ID from the package family name and the package relative application ID (PRAID).
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The package-relative app ID (PRAID).
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// A pointer to a variable that holds the number of characters ( WCHAR s) in the app user model ID string, which includes the null-terminator.
+ ///
+ ///
+ /// First you pass NULL to applicationUserModelId to get the number of characters. You use this number to allocate memory
+ /// space for applicationUserModelId. Then you pass the address of this memory space to fill applicationUserModelId.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// A pointer to memory space that receives the app user model ID string, which includes the null-terminator.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// The packageFamilyName or packageRelativeApplicationId parameter isn't valid.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ ///
+ /// The buffer specified by applicationUserModelId is not large enough to hold the data; the required buffer size, in WCHARs, is
+ /// stored in the variable pointed to by applicationUserModelIdLength.
+ ///
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-formatapplicationusermodelid LONG
+ // FormatApplicationUserModelId( PCWSTR packageFamilyName, PCWSTR packageRelativeApplicationId, UINT32 *applicationUserModelIdLength,
+ // PWSTR applicationUserModelId );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "F48D19C2-6373-41FC-A99D-E3CCB68D6C6C")]
+ public static extern Win32Error FormatApplicationUserModelId(string packageFamilyName, string packageRelativeApplicationId, ref uint applicationUserModelIdLength, StringBuilder applicationUserModelId);
+
+ ///
+ /// Gets the application user model ID for the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. This handle must have the PROCESS_QUERY_LIMITED_INFORMATION access right. For more info, see
+ /// Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// On input, the size of the applicationUserModelId buffer, in wide characters. On success, the size of the buffer used, including
+ /// the null terminator.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the application user model ID.
+ ///
+ ///
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_APPLICATION
+ /// The process has no application identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by applicationUserModelIdLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getapplicationusermodelid LONG
+ // GetApplicationUserModelId( HANDLE hProcess, UINT32 *applicationUserModelIdLength, PWSTR applicationUserModelId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "FE4E0818-F548-494B-B3BD-FB51DC748451")]
+ public static extern Win32Error GetApplicationUserModelId(IntPtr hProcess, ref uint applicationUserModelIdLength, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder applicationUserModelId);
+
+ ///
+ /// Gets the application user model ID for the specified token.
+ ///
+ ///
+ ///
+ /// A token that contains the application identity. This handle must have the PROCESS_QUERY_LIMITED_INFORMATION access right.
+ /// For more info, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// On input, the size of the applicationUserModelId buffer, in wide characters. On success, the size of the buffer used, including
+ /// the null terminator.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the application user model ID.
+ ///
+ ///
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_APPLICATION
+ /// The token has no application identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by applicationUserModelIdLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getapplicationusermodelidfromtoken LONG
+ // GetApplicationUserModelIdFromToken( HANDLE token, UINT32 *applicationUserModelIdLength, PWSTR applicationUserModelId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "80036518-927E-4CD0-B499-8EA472AB7E5A")]
+ public static extern Win32Error GetApplicationUserModelIdFromToken(IntPtr token, ref uint applicationUserModelIdLength, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder applicationUserModelId);
+
+ ///
+ /// Gets the application user model ID for the current process.
+ ///
+ ///
+ ///
+ /// On input, the size of the applicationUserModelId buffer, in wide characters. On success, the size of the buffer used, including
+ /// the null terminator.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the application user model ID.
+ ///
+ ///
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_APPLICATION
+ /// The process has no application identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by applicationUserModelIdLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentapplicationusermodelid LONG
+ // GetCurrentApplicationUserModelId( UINT32 *applicationUserModelIdLength, PWSTR applicationUserModelId );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "562BB225-0922-4FE7-92C0-573A2CCE3195")]
+ public static extern Win32Error GetCurrentApplicationUserModelId(ref uint applicationUserModelIdLength, StringBuilder applicationUserModelId);
+
+ ///
+ /// Gets the package family name for the calling process.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFamilyName buffer, in characters, including the null terminator. On output, the size of the
+ /// package family name returned, in characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFamilyNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentpackagefamilyname LONG
+ // GetCurrentPackageFamilyName( UINT32 *packageFamilyNameLength, PWSTR packageFamilyName );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "39DBFBDD-A1CC-45C3-A5DD-5ED9697F9AFE")]
+ public static extern Win32Error GetCurrentPackageFamilyName(ref uint packageFamilyNameLength, StringBuilder packageFamilyName);
+
+ ///
+ /// Gets the package full name for the calling process.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFullName buffer, in characters. On output, the size of the package full name returned, in
+ /// characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package full name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFullNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentpackagefullname LONG
+ // GetCurrentPackageFullName( UINT32 *packageFullNameLength, PWSTR packageFullName );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "D5B00C53-1FBF-4245-92D1-FA39713A9EE7")]
+ public static extern Win32Error GetCurrentPackageFullName(ref uint packageFullNameLength, StringBuilder packageFullName);
+
+ ///
+ /// Gets the package identifier (ID) for the calling process.
+ ///
+ ///
+ /// Type: UINT32*
+ /// On input, the size of buffer, in bytes. On output, the size of the structure returned, in bytes.
+ ///
+ ///
+ /// Type: BYTE*
+ /// The package ID, represented as a PACKAGE_ID structure.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by bufferLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentpackageid LONG GetCurrentPackageId( UINT32
+ // *bufferLength, BYTE *buffer );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "4CFC707A-2A5A-41FE-BB5F-6FECACC99271")]
+ public static extern Win32Error GetCurrentPackageId(ref uint bufferLength, IntPtr buffer);
+
+ ///
+ /// Gets the package information for the calling process.
+ ///
+ ///
+ /// Type: const UINT32
+ /// The package constants that specify how package information is retrieved. The PACKAGE_FILTER_* flags are supported.
+ ///
+ ///
+ /// Type: UINT32*
+ /// On input, the size of buffer, in bytes. On output, the size of the array of structures returned, in bytes.
+ ///
+ ///
+ /// Type: BYTE*
+ /// The package information, represented as an array of PACKAGE_INFO structures.
+ ///
+ ///
+ /// Type: UINT32*
+ /// The number of structures in the buffer.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by bufferLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentpackageinfo LONG GetCurrentPackageInfo( const
+ // UINT32 flags, UINT32 *bufferLength, BYTE *buffer, UINT32 *count );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "A1887D61-0FAD-4BE8-850F-F104CC074798")]
+ public static extern Win32Error GetCurrentPackageInfo(PACKAGE_FLAGS flags, ref uint bufferLength, IntPtr buffer, out uint count);
+
+ ///
+ /// Gets the package path for the calling process.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the path buffer, in characters. On output, the size of the package path returned, in characters, including
+ /// the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package path.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by pathLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getcurrentpackagepath LONG GetCurrentPackagePath( UINT32
+ // *pathLength, PWSTR path );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "46CE81DF-A9D5-492E-AB5E-4F043DC326E2")]
+ public static extern Win32Error GetCurrentPackagePath(ref uint pathLength, StringBuilder path);
+
+ ///
+ /// Gets the IDs of apps in the specified package.
+ ///
+ ///
+ /// Type: PACKAGE_INFO_REFERENCE
+ /// A reference to package information.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that holds the size of buffer, in bytes.
+ ///
+ /// First you pass NULL to buffer to get the required size of buffer. You use this number to allocate memory space for buffer.
+ /// Then you pass the address of this memory space to fill buffer.
+ ///
+ ///
+ ///
+ /// Type: BYTE*
+ /// A pointer to memory space that receives the app IDs.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that receives the number of app IDs in buffer.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by bufferLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackageapplicationids LONG GetPackageApplicationIds(
+ // PACKAGE_INFO_REFERENCE packageInfoReference, UINT32 *bufferLength, BYTE *buffer, UINT32 *count );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "F08135F9-FF45-4309-84B5-77F4AFD7FC0C")]
+ public static extern Win32Error GetPackageApplicationIds(PACKAGE_INFO_REFERENCE packageInfoReference, ref uint bufferLength, IntPtr buffer, out uint count);
+
+ ///
+ /// Gets the package family name for the specified process.
+ ///
+ ///
+ /// Type: HANDLE
+ ///
+ /// A handle to the process that has the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right.
+ /// For more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFamilyName buffer, in characters. On output, the size of the package family name returned, in
+ /// characters, including the null-terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The process has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFamilyNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagefamilyname LONG GetPackageFamilyName( HANDLE
+ // hProcess, UINT32 *packageFamilyNameLength, PWSTR packageFamilyName );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "AC239898-9924-4193-9072-7A7EEC2D03E9")]
+ public static extern Win32Error GetPackageFamilyName(IntPtr hProcess, ref uint packageFamilyNameLength, StringBuilder packageFamilyName);
+
+ ///
+ /// Gets the package family name for the specified token.
+ ///
+ ///
+ /// Type: HANDLE
+ /// A token that contains the package identity.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFamilyName buffer, in characters. On output, the size of the package family name returned, in
+ /// characters, including the null-terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The token has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFamilyNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagefamilynamefromtoken LONG
+ // GetPackageFamilyNameFromToken( HANDLE token, UINT32 *packageFamilyNameLength, PWSTR packageFamilyName );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "C4FAF5DE-DF1F-4AFA-813B-5D80C786031B")]
+ public static extern Win32Error GetPackageFamilyNameFromToken(IntPtr token, ref uint packageFamilyNameLength, StringBuilder packageFamilyName);
+
+ ///
+ /// Gets the package full name for the specified token.
+ ///
+ ///
+ /// A token that contains the package identity.
+ ///
+ ///
+ ///
+ /// On input, the size of the packageFullName buffer, in characters. On output, the size of the package full name returned, in
+ /// characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// The package full name.
+ ///
+ ///
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// APPMODEL_ERROR_NO_PACKAGE
+ /// The token has no package identity.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFullNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagefullnamefromtoken LONG
+ // GetPackageFullNameFromToken( HANDLE token, UINT32 *packageFullNameLength, PWSTR packageFullName );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "7B0D574E-A2F5-4D08-AEFB-9E040BBC729F")]
+ public static extern Win32Error GetPackageFullNameFromToken(IntPtr token, ref uint packageFullNameLength, StringBuilder packageFullName);
+
+ ///
+ /// Gets the package information for the specified package.
+ ///
+ ///
+ /// Type: PACKAGE_INFO_REFERENCE
+ /// A reference to package information.
+ ///
+ ///
+ /// Type: const UINT32
+ /// The package constants that specify how package information is retrieved.
+ ///
+ ///
+ /// Type: UINT32*
+ /// On input, the size of buffer, in bytes. On output, the size of the package information returned, in bytes.
+ ///
+ ///
+ /// Type: BYTE*
+ /// The package information, represented as an array of PACKAGE_INFO structures.
+ ///
+ ///
+ /// Type: UINT32*
+ /// The number of packages in the buffer.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by bufferLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackageinfo LONG GetPackageInfo(
+ // PACKAGE_INFO_REFERENCE packageInfoReference, const UINT32 flags, UINT32 *bufferLength, BYTE *buffer, UINT32 *count );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "28F45B3B-A61F-44D3-B606-6966AD5866FA")]
+ public static extern Win32Error GetPackageInfo(PACKAGE_INFO_REFERENCE packageInfoReference, uint flags, ref uint bufferLength, IntPtr buffer, out uint count);
+
+ ///
+ /// Gets the path for the specified package.
+ ///
+ ///
+ /// Type: const PACKAGE_ID*
+ /// The package identifier.
+ ///
+ ///
+ /// Type: const UINT32
+ /// Reserved, do not use.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the path buffer, in characters. On output, the size of the package path returned, in characters, including
+ /// the null-terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package path.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer specified by path is not large enough to hold the data. The required size is specified by pathLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagepath LONG GetPackagePath( const PACKAGE_ID
+ // *packageId, const UINT32 reserved, UINT32 *pathLength, PWSTR path );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "BDA0DD87-A36D-486B-BF89-EA5CC105C742")]
+ public static extern int GetPackagePath(ref PACKAGE_ID packageId, uint reserved, ref uint pathLength, StringBuilder path);
+
+ ///
+ /// Gets the path of the specified package.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of the package.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// A pointer to a variable that holds the number of characters ( WCHAR s) in the package path string, which includes the null-terminator.
+ ///
+ ///
+ /// First you pass NULL to path to get the number of characters. You use this number to allocate memory space for path. Then
+ /// you pass the address of this memory space to fill path.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// A pointer to memory space that receives the package path string, which includes the null-terminator.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer specified by path is not large enough to hold the data. The required size is specified by pathLength.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagepathbyfullname LONG GetPackagePathByFullName(
+ // PCWSTR packageFullName, UINT32 *pathLength, PWSTR path );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "9C25708C-1464-4C59-9740-E9F105116385")]
+ public static extern Win32Error GetPackagePathByFullName(string packageFullName, ref uint pathLength, StringBuilder path);
+
+ ///
+ /// Gets the packages with the specified family name for the current user.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that holds the number of package full names.
+ ///
+ /// First you pass NULL to packageFullNames to get the number of package full names. You use this number to allocate memory
+ /// space for packageFullNames. Then you pass the address of this number to fill packageFullNames.
+ ///
+ ///
+ ///
+ /// Type: PWSTR*
+ /// A pointer to the strings of package full names.
+ ///
+ ///
+ /// Type: UINT32*
+ /// A pointer to a variable that holds the number of characters in the string of package full names.
+ ///
+ /// First you pass NULL to buffer to get the number of characters. You use this number to allocate memory space for buffer.
+ /// Then you pass the address of this number to fill buffer.
+ ///
+ ///
+ ///
+ /// Type: WCHAR*
+ /// The string of characters for all of the package full names.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// One or more buffer is not large enough to hold the data. The required size is specified by either count or buffer.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getpackagesbypackagefamily LONG
+ // GetPackagesByPackageFamily( PCWSTR packageFamilyName, UINT32 *count, PWSTR *packageFullNames, UINT32 *bufferLength, WCHAR *buffer );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "C2163203-D654-4491-9090-0CC43F42EC35")]
+ public static extern Win32Error GetPackagesByPackageFamily(string packageFamilyName, ref uint count, [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 1)] string[] packageFullNames, ref uint bufferLength, IntPtr buffer);
+
+ ///
+ /// Gets the origin of the specified package.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of the package.
+ ///
+ ///
+ /// Type: PackageOrigin*
+ ///
+ /// A pointer to a variable that receives a PackageOrigin-typed value that indicates the origin of the package specified by packageFullName.
+ ///
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// The packageFullName parameter isn't valid.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getstagedpackageorigin LONG GetStagedPackageOrigin(
+ // PCWSTR packageFullName, PackageOrigin *origin );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "7A1EE2CA-83CE-4E03-85A5-0061E29EB49B")]
+ public static extern Win32Error GetStagedPackageOrigin(string packageFullName, out PackageOrigin origin);
+
+ ///
+ /// Gets the path of the specified staged package.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of the staged package.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// A pointer to a variable that holds the number of characters ( WCHAR s) in the package path string, which includes the null-terminator.
+ ///
+ ///
+ /// First you pass NULL to path to get the number of characters. You use this number to allocate memory space for path. Then
+ /// you pass the address of this memory space to fill path.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// A pointer to memory space that receives the package path string, which includes the null-terminator.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer specified by path is not large enough to hold the data. The required size is specified by pathLength.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This function succeeds if the package is staged, regardless of the user context or if the package is registered for the current user.
+ ///
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-getstagedpackagepathbyfullname LONG
+ // GetStagedPackagePathByFullName( PCWSTR packageFullName, UINT32 *pathLength, PWSTR path );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "F0A37D77-6262-44B1-BEC5-083E41BDE139")]
+ public static extern Win32Error GetStagedPackagePathByFullName([MarshalAs(UnmanagedType.LPWStr)] string packageFullName, ref uint pathLength, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder path);
+
+ ///
+ /// Opens the package information of the specified package.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of the package.
+ ///
+ ///
+ /// Type: const UINT32
+ /// Reserved; must be 0.
+ ///
+ ///
+ /// Type: PACKAGE_INFO_REFERENCE*
+ /// A reference to package information.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_NOT_FOUND
+ /// The package is not installed for the current user.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-openpackageinfobyfullname LONG
+ // OpenPackageInfoByFullName( PCWSTR packageFullName, const UINT32 reserved, PACKAGE_INFO_REFERENCE *packageInfoReference );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "9ECFC757-1CB3-43A1-BA45-9AF72CAB240E")]
+ public static extern Win32Error OpenPackageInfoByFullName([MarshalAs(UnmanagedType.LPWStr)] string packageFullName, uint reserved, ref PACKAGE_INFO_REFERENCE packageInfoReference);
+
+ ///
+ /// Gets the package family name for the specified package full name.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of a package.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFamilyName buffer, in characters. On output, the size of the package family name returned, in
+ /// characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFamilyNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-packagefamilynamefromfullname LONG
+ // PackageFamilyNameFromFullName( PCWSTR packageFullName, UINT32 *packageFamilyNameLength, PWSTR packageFamilyName );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "98E95CE5-E970-4A19-BAD3-994DAEC4BEA0")]
+ public static extern Win32Error PackageFamilyNameFromFullName(string packageFullName, ref uint packageFamilyNameLength, StringBuilder packageFamilyName);
+
+ ///
+ /// Gets the package family name for the specified package identifier.
+ ///
+ ///
+ /// Type: const PACKAGE_ID*
+ /// The package identifier.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFamilyName buffer, in characters. On output, the size of the package family name returned, in
+ /// characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package family name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFamilyNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-packagefamilynamefromid LONG PackageFamilyNameFromId(
+ // const PACKAGE_ID *packageId, UINT32 *packageFamilyNameLength, PWSTR packageFamilyName );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "198DAB6B-21D2-4ACB-87DF-B3F4EFBEE323")]
+ public static extern Win32Error PackageFamilyNameFromId(ref PACKAGE_ID packageId, ref uint packageFamilyNameLength, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder packageFamilyName);
+
+ ///
+ /// Gets the package full name for the specified package identifier (ID).
+ ///
+ ///
+ /// Type: const PACKAGE_ID*
+ /// The package ID.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageFullName buffer, in characters. On output, the size of the package full name returned, in
+ /// characters, including the null terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package full name.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by packageFullNameLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-packagefullnamefromid LONG PackageFullNameFromId( const
+ // PACKAGE_ID *packageId, UINT32 *packageFullNameLength, PWSTR packageFullName );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "0024AF55-295E-49B1-90C2-9144D336529B")]
+ public static extern Win32Error PackageFullNameFromId(ref PACKAGE_ID packageId, ref uint packageFullNameLength, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder packageFullName);
+
+ ///
+ /// Gets the package identifier (ID) for the specified package full name.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The full name of a package.
+ ///
+ ///
+ /// Type: const UINT32
+ /// The package constants that specify how package information is retrieved. The PACKAGE_INFORMATION_* flags are supported.
+ ///
+ ///
+ /// Type: UINT32*
+ /// On input, the size of buffer, in bytes. On output, the size of the data returned, in bytes.
+ ///
+ ///
+ /// Type: BYTE*
+ /// The package ID, represented as a PACKAGE_ID structure.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// The buffer is not large enough to hold the data. The required size is specified by bufferLength.
+ ///
+ /// -
+ /// ERROR_NOT_FOUND
+ /// The package is not installed for the user.
+ ///
+ ///
+ ///
+ ///
+ /// If flags specifies PACKAGE_INFORMATION_BASIC, the following fields are retrieved:
+ ///
+ /// -
+ /// name
+ ///
+ /// -
+ /// processorArchitecture
+ ///
+ /// -
+ /// publisherId
+ ///
+ /// -
+ /// resourceId
+ ///
+ /// -
+ /// version
+ ///
+ ///
+ /// If flags specifies PACKAGE_INFORMATION_FULL, the following fields are retrieved:
+ ///
+ /// -
+ /// name
+ ///
+ /// -
+ /// processorArchitecture
+ ///
+ /// -
+ /// publisher
+ ///
+ /// -
+ /// publisherId
+ ///
+ /// -
+ /// resourceId
+ ///
+ /// -
+ /// version
+ ///
+ ///
+ ///
+ /// A request for PACKAGE_INFORMATION_FULL succeeds only if the package corresponding to packageFullName is installed for and
+ /// accessible to the current user. If the package full name is syntactically correct but does not correspond to a package that is
+ /// installed for and accessible to the current user, the function returns ERROR_NOT_FOUND.
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-packageidfromfullname LONG PackageIdFromFullName( PCWSTR
+ // packageFullName, const UINT32 flags, UINT32 *bufferLength, BYTE *buffer );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("appmodel.h", MSDNShortId = "EED832F8-E4F7-4A0F-93E2-451F78F67767")]
+ public static extern Win32Error PackageIdFromFullName([MarshalAs(UnmanagedType.LPWStr)] string packageFullName, PACKAGE_FLAGS flags, ref uint bufferLength, IntPtr buffer);
+
+ ///
+ /// Gets the package name and publisher identifier (ID) for the specified package family name.
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The family name of a package.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packageName buffer, in characters. On output, the size of the package name returned, in characters,
+ /// including the null-terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package name.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// On input, the size of the packagePublishId buffer, in characters. On output, the size of the publisher ID returned, in
+ /// characters, including the null-terminator.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// The package publisher ID.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ /// One of the buffers is not large enough to hold the data. The required sizes are specified by packageNameLength and packagePublisherIdLength.
+ ///
+ ///
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-packagenameandpublisheridfromfamilyname LONG
+ // PackageNameAndPublisherIdFromFamilyName( PCWSTR packageFamilyName, UINT32 *packageNameLength, PWSTR packageName, UINT32
+ // *packagePublisherIdLength, PWSTR packagePublisherId );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "4AA5BD75-F865-40D6-9C10-E54C197D47C4")]
+ public static extern Win32Error PackageNameAndPublisherIdFromFamilyName(string packageFamilyName, ref uint packageNameLength, StringBuilder packageName, ref uint packagePublisherIdLength, StringBuilder packagePublisherId);
+
+ ///
+ /// Deconstructs an application user model ID to its package family name and package relative application ID (PRAID).
+ ///
+ ///
+ /// Type: PCWSTR
+ /// The app user model ID.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// A pointer to a variable that holds the number of characters ( WCHAR s) in the package family name string, which includes
+ /// the null-terminator.
+ ///
+ ///
+ /// First you pass NULL to packageFamilyName to get the number of characters. You use this number to allocate memory space for
+ /// packageFamilyName. Then you pass the address of this memory space to fill packageFamilyName.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// A pointer to memory space that receives the package family name string, which includes the null-terminator.
+ ///
+ ///
+ /// Type: UINT32*
+ ///
+ /// A pointer to a variable that holds the number of characters ( WCHAR s) in the package-relative app ID string, which
+ /// includes the null-terminator.
+ ///
+ ///
+ /// First you pass NULL to packageRelativeApplicationId to get the number of characters. You use this number to allocate
+ /// memory space for packageRelativeApplicationId. Then you pass the address of this memory space to fill packageRelativeApplicationId.
+ ///
+ ///
+ ///
+ /// Type: PWSTR
+ /// A pointer to memory space that receives the package-relative app ID (PRAID) string, which includes the null-terminator.
+ ///
+ ///
+ /// Type: LONG
+ ///
+ /// If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// The applicationUserModelId parameter isn't valid.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER
+ ///
+ /// The buffer specified by packageFamilyName or packageRelativeApplicationId is not large enough to hold the data; the required
+ /// buffer size, in WCHARs, is stored in the variable pointed to by packageFamilyNameLength or packageRelativeApplicationIdLength.
+ ///
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/nf-appmodel-parseapplicationusermodelid LONG
+ // ParseApplicationUserModelId( PCWSTR applicationUserModelId, UINT32 *packageFamilyNameLength, PWSTR packageFamilyName, UINT32
+ // *packageRelativeApplicationIdLength, PWSTR packageRelativeApplicationId );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("appmodel.h", MSDNShortId = "03B29E82-611F-47D1-8CB6-047B9BEB4D9E")]
+ public static extern Win32Error ParseApplicationUserModelId(string applicationUserModelId, ref uint packageFamilyNameLength, StringBuilder packageFamilyName, ref uint packageRelativeApplicationIdLength, StringBuilder packageRelativeApplicationId);
+
+ ///
+ /// Represents package identification information, such as name, version, and publisher.
+ ///
+ ///
+ /// For info about string size limits, see Identity constants.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/ns-appmodel-package_id typedef struct PACKAGE_ID { UINT32 reserved;
+ // UINT32 processorArchitecture; PACKAGE_VERSION version; PWSTR name; PWSTR publisher; PWSTR resourceId; PWSTR publisherId; };
+ [PInvokeData("appmodel.h", MSDNShortId = "4B15281A-2227-47B7-A750-0A01DB8543FC")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct PACKAGE_ID
+ {
+ ///
+ /// Type: UINT32
+ /// Reserved; do not use.
+ ///
+ public uint reserved;
+
+ ///
+ /// Type: UINT32
+ ///
+ /// The processor architecture of the package. This member must be one of the values of the APPX_PACKAGE_ARCHITECTURE enumeration.
+ ///
+ ///
+ public APPX_PACKAGE_ARCHITECTURE processorArchitecture;
+
+ ///
+ /// Type: PACKAGE_VERSION
+ /// The version of the package.
+ ///
+ public PACKAGE_VERSION version;
+
+ ///
+ /// Type: PWSTR
+ /// The name of the package.
+ ///
+ public string name;
+
+ ///
+ /// Type: PWSTR
+ /// The publisher of the package. If there is no publisher for the package, this member is NULL.
+ ///
+ public string publisher;
+
+ ///
+ /// Type: PWSTR
+ /// The resource identifier (ID) of the package. If there is no resource ID for the package, this member is NULL.
+ ///
+ public string resourceId;
+
+ ///
+ /// Type: PWSTR
+ /// The publisher identifier (ID) of the package. If there is no publisher ID for the package, this member is NULL.
+ ///
+ public string publisherId;
+ }
+
+ /// A reference to package information.
+ [PInvokeData("appmodel.h")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PACKAGE_INFO_REFERENCE
+ {
+ /// Reserved.
+ public IntPtr reserved;
+ }
+
+ ///
+ /// Represents the package version information.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/appmodel/ns-appmodel-package_version typedef struct PACKAGE_VERSION { union {
+ // UINT64 Version; struct { USHORT Revision; USHORT Build; USHORT Minor; USHORT Major; } DUMMYSTRUCTNAME; } DUMMYUNIONNAME; };
+ [PInvokeData("appmodel.h", MSDNShortId = "8543DF84-A908-4DF5-AEE6-169FECB2AA97")]
+ [StructLayout(LayoutKind.Explicit)]
+ public struct PACKAGE_VERSION
+ {
+ ///
+ /// Type: UINT64
+ /// The full version number of the package represented as a single integral value.
+ ///
+ [FieldOffset(0)]
+ public ulong Version;
+
+ /// Parts of the Version.
+ [FieldOffset(0)]
+ public DUMMYSTRUCTNAME Parts;
+
+ /// Parts of the Version.
+ public struct DUMMYSTRUCTNAME
+ {
+ ///
+ /// Type: USHORT
+ /// The revision version number of the package.
+ ///
+ public ushort Revision;
+
+ ///
+ /// Type: USHORT
+ /// The build version number of the package.
+ ///
+ public ushort Build;
+
+ ///
+ /// Type: USHORT
+ /// The minor version number of the package.
+ ///
+ public ushort Minor;
+
+ ///
+ /// Type: USHORT
+ /// The major version number of the package.
+ ///
+ public ushort Major;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/CorrelationReport.md b/PInvoke/Kernel32/CorrelationReport.md
index 21443653..9c143bbd 100644
--- a/PInvoke/Kernel32/CorrelationReport.md
+++ b/PInvoke/Kernel32/CorrelationReport.md
@@ -1,114 +1,37 @@
## Correlation report for kernel32.dll, kernelbase.dll
-### Methods (49% complete)
+### Methods (99% complete)
Native Method | Native DLL | Header | Managed Method
--- | --- | --- | ---
-[AccessCheck](https://www.google.com/search?num=5&q=AccessCheck+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckAndAuditAlarmW](https://www.google.com/search?num=5&q=AccessCheckAndAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckByType](https://www.google.com/search?num=5&q=AccessCheckByType+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckByTypeAndAuditAlarmW](https://www.google.com/search?num=5&q=AccessCheckByTypeAndAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckByTypeResultList](https://www.google.com/search?num=5&q=AccessCheckByTypeResultList+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckByTypeResultListAndAuditAlarmByHandleW](https://www.google.com/search?num=5&q=AccessCheckByTypeResultListAndAuditAlarmByHandleW+site%3Amicrosoft.com) | kernelbase.dll | |
-[AccessCheckByTypeResultListAndAuditAlarmW](https://www.google.com/search?num=5&q=AccessCheckByTypeResultListAndAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
[AcquireSRWLockExclusive](http://msdn2.microsoft.com/en-us/library/ms681930) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AcquireSRWLockExclusive
[AcquireSRWLockShared](http://msdn2.microsoft.com/en-us/library/ms681934) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AcquireSRWLockShared
-[AcquireStateLock](https://www.google.com/search?num=5&q=AcquireStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
[ActivateActCtx](http://msdn2.microsoft.com/en-us/library/aa374151) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ActivateActCtx
-[ActivateActCtxWorker](https://www.google.com/search?num=5&q=ActivateActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[AddAccessAllowedAce](https://www.google.com/search?num=5&q=AddAccessAllowedAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAccessAllowedAceEx](https://www.google.com/search?num=5&q=AddAccessAllowedAceEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAccessAllowedObjectAce](https://www.google.com/search?num=5&q=AddAccessAllowedObjectAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAccessDeniedAce](https://www.google.com/search?num=5&q=AddAccessDeniedAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAccessDeniedAceEx](https://www.google.com/search?num=5&q=AddAccessDeniedAceEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAccessDeniedObjectAce](https://www.google.com/search?num=5&q=AddAccessDeniedObjectAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAce](https://www.google.com/search?num=5&q=AddAce+site%3Amicrosoft.com) | kernelbase.dll | |
[AddAtom](http://msdn2.microsoft.com/en-us/library/ms649056) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.AddAtom
-[AddAuditAccessAce](https://www.google.com/search?num=5&q=AddAuditAccessAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAuditAccessAceEx](https://www.google.com/search?num=5&q=AddAuditAccessAceEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddAuditAccessObjectAce](https://www.google.com/search?num=5&q=AddAuditAccessObjectAce+site%3Amicrosoft.com) | kernelbase.dll | |
[AddConsoleAlias](https://www.google.com/search?num=5&q=AddConsoleAliasA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.AddConsoleAlias
[AddDllDirectory](http://msdn2.microsoft.com/en-us/library/hh310513) | kernel32.dll | LibLoaderAPI.h | Vanara.PInvoke.Kernel32.AddDllDirectory
-[AddExtensionProgId](https://www.google.com/search?num=5&q=AddExtensionProgId+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddIntegrityLabelToBoundaryDescriptor](https://www.google.com/search?num=5&q=AddIntegrityLabelToBoundaryDescriptor+site%3Amicrosoft.com) | kernel32.dll | |
-[AddLocalAlternateComputerName](https://www.google.com/search?num=5&q=AddLocalAlternateComputerNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[AddMandatoryAce](https://www.google.com/search?num=5&q=AddMandatoryAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[AddPackageToFamilyXref](https://www.google.com/search?num=5&q=AddPackageToFamilyXref+site%3Amicrosoft.com) | kernelbase.dll | |
+[AddIntegrityLabelToBoundaryDescriptor](http://msdn2.microsoft.com/en-us/library/6b56e664-7795-4e30-8bca-1e4df2764606) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.AddIntegrityLabelToBoundaryDescriptor
+[AddLocalAlternateComputerName](http://msdn2.microsoft.com/en-us/library/e4d8355b-0492-4b6f-988f-3887e63a2bba) | kernel32.dll | | Vanara.PInvoke.Kernel32.AddLocalAlternateComputerName
[AddRefActCtx](http://msdn2.microsoft.com/en-us/library/aa374171) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.AddRefActCtx
-[AddRefActCtxWorker](https://www.google.com/search?num=5&q=AddRefActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[AddResourceAttributeAce](https://www.google.com/search?num=5&q=AddResourceAttributeAce+site%3Amicrosoft.com) | kernel32.dll | |
-[AddScopedPolicyIDAce](https://www.google.com/search?num=5&q=AddScopedPolicyIDAce+site%3Amicrosoft.com) | kernel32.dll | |
-[AddSecureMemoryCacheCallback](https://www.google.com/search?num=5&q=AddSecureMemoryCacheCallback+site%3Amicrosoft.com) | kernel32.dll | |
+[AddSecureMemoryCacheCallback](http://msdn2.microsoft.com/en-us/library/6c89d6f3-182e-4b10-931c-8d55d603c9dc) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.AddSecureMemoryCacheCallback
[AddSIDToBoundaryDescriptor](http://msdn2.microsoft.com/en-us/library/ms681937) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AddSIDToBoundaryDescriptor
[AddVectoredContinueHandler](http://msdn2.microsoft.com/en-us/library/ms679273) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AddVectoredContinueHandler
[AddVectoredExceptionHandler](http://msdn2.microsoft.com/en-us/library/ms679274) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AddVectoredExceptionHandler
-[AdjustCalendarDate](https://www.google.com/search?num=5&q=AdjustCalendarDate+site%3Amicrosoft.com) | kernel32.dll | |
-[AdjustTokenGroups](https://www.google.com/search?num=5&q=AdjustTokenGroups+site%3Amicrosoft.com) | kernelbase.dll | |
-[AdjustTokenPrivileges](https://www.google.com/search?num=5&q=AdjustTokenPrivileges+site%3Amicrosoft.com) | kernelbase.dll | |
-[AllocateAndInitializeSid](https://www.google.com/search?num=5&q=AllocateAndInitializeSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[AllocateLocallyUniqueId](https://www.google.com/search?num=5&q=AllocateLocallyUniqueId+site%3Amicrosoft.com) | kernelbase.dll | |
+[AdjustCalendarDate](http://msdn2.microsoft.com/en-us/library/be8d61fd-efa3-4386-969f-30216c282ebc) | kernel32.dll | | Vanara.PInvoke.Kernel32.AdjustCalendarDate
[AllocateUserPhysicalPages](http://msdn2.microsoft.com/en-us/library/aa366528) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AllocateUserPhysicalPages
[AllocateUserPhysicalPagesNuma](http://msdn2.microsoft.com/en-us/library/aa366529) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AllocateUserPhysicalPagesNuma
[AllocConsole](https://www.google.com/search?num=5&q=AllocConsole+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.AllocConsole
-[AppContainerDeriveSidFromMoniker](https://www.google.com/search?num=5&q=AppContainerDeriveSidFromMoniker+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppContainerFreeMemory](https://www.google.com/search?num=5&q=AppContainerFreeMemory+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppContainerLookupDisplayNameMrtReference](https://www.google.com/search?num=5&q=AppContainerLookupDisplayNameMrtReference+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppContainerLookupMoniker](https://www.google.com/search?num=5&q=AppContainerLookupMoniker+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppContainerRegisterSid](https://www.google.com/search?num=5&q=AppContainerRegisterSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppContainerUnregisterSid](https://www.google.com/search?num=5&q=AppContainerUnregisterSid+site%3Amicrosoft.com) | kernelbase.dll | |
[ApplicationRecoveryFinished](http://msdn2.microsoft.com/en-us/library/aa373328) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ApplicationRecoveryFinished
[ApplicationRecoveryInProgress](http://msdn2.microsoft.com/en-us/library/aa373329) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ApplicationRecoveryInProgress
-[ApplicationUserModelIdFromProductId](https://www.google.com/search?num=5&q=ApplicationUserModelIdFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppPolicyGetClrCompat](https://www.google.com/search?num=5&q=AppPolicyGetClrCompat+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetCreateFileAccess](https://www.google.com/search?num=5&q=AppPolicyGetCreateFileAccess+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetLifecycleManagement](https://www.google.com/search?num=5&q=AppPolicyGetLifecycleManagement+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetMediaFoundationCodecLoading](https://www.google.com/search?num=5&q=AppPolicyGetMediaFoundationCodecLoading+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetProcessTerminationMethod](https://www.google.com/search?num=5&q=AppPolicyGetProcessTerminationMethod+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetShowDeveloperDiagnostic](https://www.google.com/search?num=5&q=AppPolicyGetShowDeveloperDiagnostic+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetThreadInitializationType](https://www.google.com/search?num=5&q=AppPolicyGetThreadInitializationType+site%3Amicrosoft.com) | kernel32.dll | |
-[AppPolicyGetWindowingModel](https://www.google.com/search?num=5&q=AppPolicyGetWindowingModel+site%3Amicrosoft.com) | kernel32.dll | |
-[AppXFreeMemory](https://www.google.com/search?num=5&q=AppXFreeMemory+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXGetApplicationData](https://www.google.com/search?num=5&q=AppXGetApplicationData+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXGetDevelopmentMode](https://www.google.com/search?num=5&q=AppXGetDevelopmentMode+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXGetOSMaxVersionTested](https://www.google.com/search?num=5&q=AppXGetOSMaxVersionTested+site%3Amicrosoft.com) | kernel32.dll | |
-[AppXGetOSMinVersion](https://www.google.com/search?num=5&q=AppXGetOSMinVersion+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXGetPackageCapabilities](https://www.google.com/search?num=5&q=AppXGetPackageCapabilities+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXGetPackageSid](https://www.google.com/search?num=5&q=AppXGetPackageSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXLookupDisplayName](https://www.google.com/search?num=5&q=AppXLookupDisplayName+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXLookupMoniker](https://www.google.com/search?num=5&q=AppXLookupMoniker+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXPostSuccessExtension](https://www.google.com/search?num=5&q=AppXPostSuccessExtension+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXPreCreationExtension](https://www.google.com/search?num=5&q=AppXPreCreationExtension+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXReleaseAppXContext](https://www.google.com/search?num=5&q=AppXReleaseAppXContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[AppXUpdatePackageCapabilities](https://www.google.com/search?num=5&q=AppXUpdatePackageCapabilities+site%3Amicrosoft.com) | kernelbase.dll | |
-[AreAllAccessesGranted](https://www.google.com/search?num=5&q=AreAllAccessesGranted+site%3Amicrosoft.com) | kernelbase.dll | |
-[AreAnyAccessesGranted](https://www.google.com/search?num=5&q=AreAnyAccessesGranted+site%3Amicrosoft.com) | kernelbase.dll | |
+[AppPolicyGetCreateFileAccess](http://msdn2.microsoft.com/en-us/library/mt829655) | kernel32.dll | AppModel.h | Vanara.PInvoke.Kernel32.AppPolicyGetCreateFileAccess
+[AppPolicyGetProcessTerminationMethod](http://msdn2.microsoft.com/en-us/library/mt829656) | kernel32.dll | AppModel.h | Vanara.PInvoke.Kernel32.AppPolicyGetProcessTerminationMethod
+[AppPolicyGetShowDeveloperDiagnostic](http://msdn2.microsoft.com/en-us/library/mt829657) | kernel32.dll | AppModel.h | Vanara.PInvoke.Kernel32.AppPolicyGetShowDeveloperDiagnostic
+[AppPolicyGetThreadInitializationType](http://msdn2.microsoft.com/en-us/library/mt829658) | kernel32.dll | AppModel.h | Vanara.PInvoke.Kernel32.AppPolicyGetThreadInitializationType
[AreFileApisANSI](http://msdn2.microsoft.com/en-us/library/aa363781) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AreFileApisANSI
-[AreThereVisibleLogoffScriptsInternal](https://www.google.com/search?num=5&q=AreThereVisibleLogoffScriptsInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[AreThereVisibleShutdownScriptsInternal](https://www.google.com/search?num=5&q=AreThereVisibleShutdownScriptsInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[AssignProcessToJobObject](http://msdn2.microsoft.com/en-us/library/ms681949) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.AssignProcessToJobObject
-[atexit](https://www.google.com/search?num=5&q=atexit+site%3Amicrosoft.com) | kernelbase.dll | |
[AttachConsole](https://www.google.com/search?num=5&q=AttachConsole+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.AttachConsole
[BackupRead](http://msdn2.microsoft.com/en-us/library/aa362509) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.BackupRead
[BackupSeek](http://msdn2.microsoft.com/en-us/library/aa362510) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.BackupSeek
[BackupWrite](http://msdn2.microsoft.com/en-us/library/aa362511) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.BackupWrite
-[BaseCheckAppcompatCache](https://www.google.com/search?num=5&q=BaseCheckAppcompatCache+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseCheckAppcompatCacheEx](https://www.google.com/search?num=5&q=BaseCheckAppcompatCacheEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseCleanupAppcompatCacheSupport](https://www.google.com/search?num=5&q=BaseCleanupAppcompatCacheSupport+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseDllFreeResourceId](https://www.google.com/search?num=5&q=BaseDllFreeResourceId+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseDllMapResourceIdW](https://www.google.com/search?num=5&q=BaseDllMapResourceIdW+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseDumpAppcompatCache](https://www.google.com/search?num=5&q=BaseDumpAppcompatCache+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseFlushAppcompatCache](https://www.google.com/search?num=5&q=BaseFlushAppcompatCache+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseFormatObjectAttributes](https://www.google.com/search?num=5&q=BaseFormatObjectAttributes+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseFreeAppCompatDataForProcess](https://www.google.com/search?num=5&q=BaseFreeAppCompatDataForProcess+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseGetNamedObjectDirectory](https://www.google.com/search?num=5&q=BaseGetNamedObjectDirectory+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseInitAppcompatCacheSupport](https://www.google.com/search?num=5&q=BaseInitAppcompatCacheSupport+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseIsAppcompatInfrastructureDisabled](https://www.google.com/search?num=5&q=BaseIsAppcompatInfrastructureDisabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseMarkFileForDelete](https://www.google.com/search?num=5&q=BaseMarkFileForDelete+site%3Amicrosoft.com) | kernelbase.dll | |
-[BasepAdjustObjectAttributesForPrivateNamespace](https://www.google.com/search?num=5&q=BasepAdjustObjectAttributesForPrivateNamespace+site%3Amicrosoft.com) | kernelbase.dll | |
-[BasepCopyFileCallback](https://www.google.com/search?num=5&q=BasepCopyFileCallback+site%3Amicrosoft.com) | kernelbase.dll | |
-[BasepCopyFileExW](https://www.google.com/search?num=5&q=BasepCopyFileExW+site%3Amicrosoft.com) | kernelbase.dll | |
-[BasepInitAppCompatData](https://www.google.com/search?num=5&q=BasepInitAppCompatData+site%3Amicrosoft.com) | kernel32.dll | |
-[BasepNotifyTrackingService](https://www.google.com/search?num=5&q=BasepNotifyTrackingService+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseReadAppCompatDataForProcess](https://www.google.com/search?num=5&q=BaseReadAppCompatDataForProcess+site%3Amicrosoft.com) | kernelbase.dll | |
-[BaseUpdateAppcompatCache](https://www.google.com/search?num=5&q=BaseUpdateAppcompatCache+site%3Amicrosoft.com) | kernelbase.dll | |
+[BaseFlushAppcompatCache](http://msdn2.microsoft.com/en-us/library/03f47813-87f6-4b71-b453-77a2facab019) | kernelbase.dll | | Vanara.PInvoke.Kernel32.BaseFlushAppcompatCache
[Beep](http://msdn2.microsoft.com/en-us/library/ms679277) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.Beep
[BeginUpdateResource](http://msdn2.microsoft.com/en-us/library/ms648030) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.BeginUpdateResource
[BindIoCompletionCallback](http://msdn2.microsoft.com/en-us/library/aa363484) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.BindIoCompletionCallback
@@ -121,43 +44,15 @@ Native Method | Native DLL | Header | Managed Method
[CancelSynchronousIo](http://msdn2.microsoft.com/en-us/library/aa363794) | kernel32.dll | IoAPI.h | Vanara.PInvoke.Kernel32.CancelSynchronousIo
[CancelThreadpoolIo](http://msdn2.microsoft.com/en-us/library/ms681983) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CancelThreadpoolIo
[CancelWaitableTimer](http://msdn2.microsoft.com/en-us/library/ms681985) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CancelWaitableTimer
-[CeipIsOptedIn](https://www.google.com/search?num=5&q=CeipIsOptedIn+site%3Amicrosoft.com) | kernel32.dll | |
+[CeipIsOptedIn](http://msdn2.microsoft.com/en-us/library/4CDB5B09-B172-4E99-AB46-A08E32346266) | kernel32.dll | windowsceip.h | Vanara.PInvoke.Kernel32.CeipIsOptedIn
[ChangeTimerQueueTimer](http://msdn2.microsoft.com/en-us/library/ms682004) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ChangeTimerQueueTimer
-[CharLower](https://www.google.com/search?num=5&q=CharLowerA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharLowerBuff](https://www.google.com/search?num=5&q=CharLowerBuffA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharNext](https://www.google.com/search?num=5&q=CharNextA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharNextExA](https://www.google.com/search?num=5&q=CharNextExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharPrev](https://www.google.com/search?num=5&q=CharPrevA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharPrevExA](https://www.google.com/search?num=5&q=CharPrevExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharUpper](https://www.google.com/search?num=5&q=CharUpperA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CharUpperBuff](https://www.google.com/search?num=5&q=CharUpperBuffA+site%3Amicrosoft.com) | kernelbase.dll | |
-[CheckAllowDecryptedRemoteDestinationPolicy](https://www.google.com/search?num=5&q=CheckAllowDecryptedRemoteDestinationPolicy+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckElevation](https://www.google.com/search?num=5&q=CheckElevation+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckElevationEnabled](https://www.google.com/search?num=5&q=CheckElevationEnabled+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckForReadOnlyResource](https://www.google.com/search?num=5&q=CheckForReadOnlyResource+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckForReadOnlyResourceFilter](https://www.google.com/search?num=5&q=CheckForReadOnlyResourceFilter+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckGroupPolicyEnabled](https://www.google.com/search?num=5&q=CheckGroupPolicyEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[CheckIfStateChangeNotificationExists](https://www.google.com/search?num=5&q=CheckIfStateChangeNotificationExists+site%3Amicrosoft.com) | kernelbase.dll | |
[CheckNameLegalDOS8Dot3](http://msdn2.microsoft.com/en-us/library/aa363807) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CheckNameLegalDOS8Dot3
[CheckRemoteDebuggerPresent](http://msdn2.microsoft.com/en-us/library/ms679280) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CheckRemoteDebuggerPresent
-[CheckTokenCapability](https://www.google.com/search?num=5&q=CheckTokenCapability+site%3Amicrosoft.com) | kernel32.dll | |
-[CheckTokenMembership](https://www.google.com/search?num=5&q=CheckTokenMembership+site%3Amicrosoft.com) | kernelbase.dll | |
-[CheckTokenMembershipEx](https://www.google.com/search?num=5&q=CheckTokenMembershipEx+site%3Amicrosoft.com) | kernel32.dll | |
-[ChrCmpI](https://www.google.com/search?num=5&q=ChrCmpIA+site%3Amicrosoft.com) | kernelbase.dll | |
[ClearCommBreak](http://msdn2.microsoft.com/en-us/library/aa363179) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ClearCommBreak
[ClearCommError](http://msdn2.microsoft.com/en-us/library/aa363180) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ClearCommError
-[CLOSE_LOCAL_HANDLE_INTERNAL](https://www.google.com/search?num=5&q=CLOSE_LOCAL_HANDLE_INTERNAL+site%3Amicrosoft.com) | kernelbase.dll | |
-[CloseConsoleHandle](https://www.google.com/search?num=5&q=CloseConsoleHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[CloseGlobalizationUserSettingsKey](https://www.google.com/search?num=5&q=CloseGlobalizationUserSettingsKey+site%3Amicrosoft.com) | kernelbase.dll | |
[CloseHandle](http://msdn2.microsoft.com/en-us/library/ms724211) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CloseHandle
-[ClosePackageInfo](https://www.google.com/search?num=5&q=ClosePackageInfo+site%3Amicrosoft.com) | kernel32.dll | |
+[ClosePackageInfo](http://msdn2.microsoft.com/en-us/library/BA84FB47-F241-4120-9441-7E1149F68738) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.ClosePackageInfo
[ClosePrivateNamespace](http://msdn2.microsoft.com/en-us/library/ms682026) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ClosePrivateNamespace
-[CloseProfileUserMapping](https://www.google.com/search?num=5&q=CloseProfileUserMapping+site%3Amicrosoft.com) | kernel32.dll | |
-[CloseState](https://www.google.com/search?num=5&q=CloseState+site%3Amicrosoft.com) | kernel32.dll | |
-[CloseStateAtom](https://www.google.com/search?num=5&q=CloseStateAtom+site%3Amicrosoft.com) | kernelbase.dll | |
-[CloseStateChangeNotification](https://www.google.com/search?num=5&q=CloseStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
-[CloseStateContainer](https://www.google.com/search?num=5&q=CloseStateContainer+site%3Amicrosoft.com) | kernelbase.dll | |
-[CloseStateLock](https://www.google.com/search?num=5&q=CloseStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
[CloseThreadpool](http://msdn2.microsoft.com/en-us/library/ms682030) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpool
[CloseThreadpoolCleanupGroup](http://msdn2.microsoft.com/en-us/library/ms682033) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpoolCleanupGroup
[CloseThreadpoolCleanupGroupMembers](http://msdn2.microsoft.com/en-us/library/ms682036) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpoolCleanupGroupMembers
@@ -165,45 +60,33 @@ Native Method | Native DLL | Header | Managed Method
[CloseThreadpoolTimer](http://msdn2.microsoft.com/en-us/library/ms682040) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpoolTimer
[CloseThreadpoolWait](http://msdn2.microsoft.com/en-us/library/ms682042) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpoolWait
[CloseThreadpoolWork](http://msdn2.microsoft.com/en-us/library/ms682043) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CloseThreadpoolWork
-[CmdBatNotification](https://www.google.com/search?num=5&q=CmdBatNotification+site%3Amicrosoft.com) | kernel32.dll | |
[CommConfigDialog](http://msdn2.microsoft.com/en-us/library/aa363187) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CommConfigDialog
-[CommitStateAtom](https://www.google.com/search?num=5&q=CommitStateAtom+site%3Amicrosoft.com) | kernelbase.dll | |
-[CompareCalendarDates](https://www.google.com/search?num=5&q=CompareCalendarDates+site%3Amicrosoft.com) | kernel32.dll | |
[CompareFileTime](http://msdn2.microsoft.com/en-us/library/ms724214) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.CompareFileTime
[CompareObjectHandles](http://msdn2.microsoft.com/en-us/library/mt438733) | kernelbase.dll | Handleapi.h | Vanara.PInvoke.Kernel32.CompareObjectHandles
[CompareString](http://msdn2.microsoft.com/en-us/library/dd317759) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.CompareString
[CompareStringEx](http://msdn2.microsoft.com/en-us/library/dd317761) | kernel32.dll | Stringapiset.h | Vanara.PInvoke.Kernel32.CompareStringEx
[CompareStringOrdinal](http://msdn2.microsoft.com/en-us/library/dd317762) | kernel32.dll | Stringapiset.h | Vanara.PInvoke.Kernel32.CompareStringOrdinal
[ConnectNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365146) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ConnectNamedPipe
-[ConsoleMenuControl](https://www.google.com/search?num=5&q=ConsoleMenuControl+site%3Amicrosoft.com) | kernel32.dll | |
[ContinueDebugEvent](http://msdn2.microsoft.com/en-us/library/ms679285) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ContinueDebugEvent
[ConvertAuxiliaryCounterToPerformanceCounter](http://msdn2.microsoft.com/en-us/library/mt781214) | kernelbase.dll | Realtimeapiset.h | Vanara.PInvoke.Kernel32.ConvertAuxiliaryCounterToPerformanceCounter
-[ConvertCalDateTimeToSystemTime](https://www.google.com/search?num=5&q=ConvertCalDateTimeToSystemTime+site%3Amicrosoft.com) | kernel32.dll | |
+[ConvertCalDateTimeToSystemTime](http://msdn2.microsoft.com/en-us/library/0c3f602d-62de-4c27-95d9-d35738f3279d) | kernel32.dll | | Vanara.PInvoke.Kernel32.ConvertCalDateTimeToSystemTime
[ConvertDefaultLocale](http://msdn2.microsoft.com/en-us/library/dd317768) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.ConvertDefaultLocale
[ConvertFiberToThread](http://msdn2.microsoft.com/en-us/library/ms682112) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ConvertFiberToThread
-[ConvertNLSDayOfWeekToWin32DayOfWeek](https://www.google.com/search?num=5&q=ConvertNLSDayOfWeekToWin32DayOfWeek+site%3Amicrosoft.com) | kernel32.dll | |
[ConvertPerformanceCounterToAuxiliaryCounter](http://msdn2.microsoft.com/en-us/library/mt781215) | kernelbase.dll | Realtimeapiset.h | Vanara.PInvoke.Kernel32.ConvertPerformanceCounterToAuxiliaryCounter
-[ConvertSystemTimeToCalDateTime](https://www.google.com/search?num=5&q=ConvertSystemTimeToCalDateTime+site%3Amicrosoft.com) | kernel32.dll | |
+[ConvertSystemTimeToCalDateTime](http://msdn2.microsoft.com/en-us/library/d21f75bc-1a93-4cb9-8b9b-6fa0e81886bf) | kernel32.dll | | Vanara.PInvoke.Kernel32.ConvertSystemTimeToCalDateTime
[ConvertThreadToFiber](http://msdn2.microsoft.com/en-us/library/ms682115) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ConvertThreadToFiber
-[ConvertThreadToFiberEx](https://www.google.com/search?num=5&q=ConvertThreadToFiberEx+site%3Amicrosoft.com) | kernel32.dll | |
-[ConvertToAutoInheritPrivateObjectSecurity](https://www.google.com/search?num=5&q=ConvertToAutoInheritPrivateObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
-[CopyContext](https://www.google.com/search?num=5&q=CopyContext+site%3Amicrosoft.com) | kernel32.dll | |
+[ConvertThreadToFiberEx](http://msdn2.microsoft.com/en-us/library/cb0473f8-bc49-44c9-a8b7-6d5b55aa37a5) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.ConvertThreadToFiberEx
+[CopyContext](http://msdn2.microsoft.com/en-us/library/805CD02A-53BC-487C-83F8-FE804368C770) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CopyContext
[CopyFile](http://msdn2.microsoft.com/en-us/library/aa363851) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CopyFile
-[CopyFile2](https://www.google.com/search?num=5&q=CopyFile2+site%3Amicrosoft.com) | kernel32.dll | |
+[CopyFile2](http://msdn2.microsoft.com/en-us/library/aa2df686-4b61-4d90-ba0b-c78c5a0d2d59) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CopyFile2
[CopyFileEx](http://msdn2.microsoft.com/en-us/library/aa363852) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CopyFileEx
-[CopyFileTransacted](https://www.google.com/search?num=5&q=CopyFileTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
-[CopyMemoryNonTemporal](https://www.google.com/search?num=5&q=CopyMemoryNonTemporal+site%3Amicrosoft.com) | kernelbase.dll | |
-[CopySid](https://www.google.com/search?num=5&q=CopySid+site%3Amicrosoft.com) | kernelbase.dll | |
-[CouldMultiUserAppsBehaviorBePossibleForPackage](https://www.google.com/search?num=5&q=CouldMultiUserAppsBehaviorBePossibleForPackage+site%3Amicrosoft.com) | kernelbase.dll | |
+[CopyFileTransacted](http://msdn2.microsoft.com/en-us/library/118392de-166b-413e-99c9-b3deb756de0e) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CopyFileTransacted
[CreateActCtx](http://msdn2.microsoft.com/en-us/library/aa375125) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CreateActCtx
-[CreateActCtxWWorker](https://www.google.com/search?num=5&q=CreateActCtxWWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[CreateAppContainerToken](https://www.google.com/search?num=5&q=CreateAppContainerToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreateAppContainerTokenForUser](https://www.google.com/search?num=5&q=CreateAppContainerTokenForUser+site%3Amicrosoft.com) | kernelbase.dll | |
[CreateBoundaryDescriptor](http://msdn2.microsoft.com/en-us/library/ms682121) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateBoundaryDescriptor
[CreateConsoleScreenBuffer](https://www.google.com/search?num=5&q=CreateConsoleScreenBuffer+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.CreateConsoleScreenBuffer
[CreateDirectory](http://msdn2.microsoft.com/en-us/library/aa363855) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.CreateDirectory
[CreateDirectoryEx](http://msdn2.microsoft.com/en-us/library/aa363856) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateDirectoryEx
-[CreateDirectoryTransacted](https://www.google.com/search?num=5&q=CreateDirectoryTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[CreateDirectoryTransacted](http://msdn2.microsoft.com/en-us/library/75663b30-5bd9-4de7-8e4f-dc58016c2c40) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CreateDirectoryTransacted
[CreateEnclave](http://msdn2.microsoft.com/en-us/library/mt592866) | kernel32.dll | Enclaveapi.h | Vanara.PInvoke.Kernel32.CreateEnclave
[CreateEvent](http://msdn2.microsoft.com/en-us/library/ms682396) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateEvent
[CreateEventEx](http://msdn2.microsoft.com/en-us/library/ms682400) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateEventEx
@@ -214,9 +97,9 @@ Native Method | Native DLL | Header | Managed Method
[CreateFileMapping](http://msdn2.microsoft.com/en-us/library/aa366537) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateFileMapping
[CreateFileMappingFromApp](http://msdn2.microsoft.com/en-us/library/hh994453) | kernel32.dll | MemoryApi.h | Vanara.PInvoke.Kernel32.CreateFileMappingFromApp
[CreateFileMappingNuma](http://msdn2.microsoft.com/en-us/library/aa366539) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateFileMappingNuma
-[CreateFileTransacted](https://www.google.com/search?num=5&q=CreateFileTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[CreateFileTransacted](http://msdn2.microsoft.com/en-us/library/0cbc081d-8787-409b-84bc-a6a28d8f83a0) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CreateFileTransacted
[CreateHardLink](http://msdn2.microsoft.com/en-us/library/aa363860) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateHardLink
-[CreateHardLinkTransacted](https://www.google.com/search?num=5&q=CreateHardLinkTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[CreateHardLinkTransacted](http://msdn2.microsoft.com/en-us/library/27dd5b0a-08ef-4757-8f51-03d9918028c8) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CreateHardLinkTransacted
[CreateIoCompletionPort](http://msdn2.microsoft.com/en-us/library/aa363862) | kernel32.dll | IoAPI.h | Vanara.PInvoke.Kernel32.CreateIoCompletionPort
[CreateJobObject](http://msdn2.microsoft.com/en-us/library/ms682409) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateJobObject
[CreateMailslot](http://msdn2.microsoft.com/en-us/library/aa365147) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CreateMailslot
@@ -226,24 +109,13 @@ Native Method | Native DLL | Header | Managed Method
[CreateNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365150) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CreateNamedPipe
[CreatePipe](http://msdn2.microsoft.com/en-us/library/aa365152) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CreatePipe
[CreatePrivateNamespace](http://msdn2.microsoft.com/en-us/library/ms682419) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreatePrivateNamespace
-[CreatePrivateObjectSecurity](https://www.google.com/search?num=5&q=CreatePrivateObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreatePrivateObjectSecurityEx](https://www.google.com/search?num=5&q=CreatePrivateObjectSecurityEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreatePrivateObjectSecurityWithMultipleInheritance](https://www.google.com/search?num=5&q=CreatePrivateObjectSecurityWithMultipleInheritance+site%3Amicrosoft.com) | kernelbase.dll | |
[CreateProcess](http://msdn2.microsoft.com/en-us/library/ms682425) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateProcess
[CreateProcessAsUser](http://msdn2.microsoft.com/en-us/library/ms682429) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateProcessAsUser
-[CreateProcessInternal](https://www.google.com/search?num=5&q=CreateProcessInternalA+site%3Amicrosoft.com) | kernel32.dll | |
[CreateRemoteThread](http://msdn2.microsoft.com/en-us/library/ms682437) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateRemoteThread
[CreateRemoteThreadEx](http://msdn2.microsoft.com/en-us/library/dd405484) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateRemoteThreadEx
-[CreateRestrictedToken](https://www.google.com/search?num=5&q=CreateRestrictedToken+site%3Amicrosoft.com) | kernelbase.dll | |
[CreateSemaphore](http://msdn2.microsoft.com/en-us/library/ms682438) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateSemaphore
[CreateSemaphoreEx](http://msdn2.microsoft.com/en-us/library/ms682446) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateSemaphoreEx
-[CreateStateAtom](https://www.google.com/search?num=5&q=CreateStateAtom+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreateStateChangeNotification](https://www.google.com/search?num=5&q=CreateStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreateStateContainer](https://www.google.com/search?num=5&q=CreateStateContainer+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreateStateLock](https://www.google.com/search?num=5&q=CreateStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
-[CreateStateSubcontainer](https://www.google.com/search?num=5&q=CreateStateSubcontainer+site%3Amicrosoft.com) | kernelbase.dll | |
[CreateSymbolicLink](http://msdn2.microsoft.com/en-us/library/aa363866) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateSymbolicLink
-[CreateSymbolicLinkTransacted](https://www.google.com/search?num=5&q=CreateSymbolicLinkTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
[CreateTapePartition](http://msdn2.microsoft.com/en-us/library/aa362519) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.CreateTapePartition
[CreateThread](http://msdn2.microsoft.com/en-us/library/ms682453) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateThread
[CreateThreadpool](http://msdn2.microsoft.com/en-us/library/ms682456) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateThreadpool
@@ -254,16 +126,12 @@ Native Method | Native DLL | Header | Managed Method
[CreateThreadpoolWork](http://msdn2.microsoft.com/en-us/library/ms682478) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateThreadpoolWork
[CreateTimerQueue](http://msdn2.microsoft.com/en-us/library/ms682483) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateTimerQueue
[CreateTimerQueueTimer](http://msdn2.microsoft.com/en-us/library/ms682485) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateTimerQueueTimer
-[CreateToolhelp32Snapshot](https://www.google.com/search?num=5&q=CreateToolhelp32Snapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[CreateUmsCompletionList](https://www.google.com/search?num=5&q=CreateUmsCompletionList+site%3Amicrosoft.com) | kernel32.dll | |
-[CreateUmsThreadContext](https://www.google.com/search?num=5&q=CreateUmsThreadContext+site%3Amicrosoft.com) | kernel32.dll | |
+[CreateToolhelp32Snapshot](http://msdn2.microsoft.com/en-us/library/df643c25-7558-424c-b187-b3f86ba51358) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.CreateToolhelp32Snapshot
+[CreateUmsCompletionList](http://msdn2.microsoft.com/en-us/library/6e77b793-a82e-4e23-8c8b-7aff79d69346) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CreateUmsCompletionList
+[CreateUmsThreadContext](http://msdn2.microsoft.com/en-us/library/b27ce81a-8463-46af-8acf-2de091f625df) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.CreateUmsThreadContext
[CreateWaitableTimer](http://msdn2.microsoft.com/en-us/library/ms682492) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateWaitableTimer
[CreateWaitableTimerEx](http://msdn2.microsoft.com/en-us/library/ms682494) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.CreateWaitableTimerEx
-[CreateWellKnownSid](https://www.google.com/search?num=5&q=CreateWellKnownSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[CtrlRoutine](https://www.google.com/search?num=5&q=CtrlRoutine+site%3Amicrosoft.com) | kernel32.dll | |
-[CveEventWrite](https://www.google.com/search?num=5&q=CveEventWrite+site%3Amicrosoft.com) | kernelbase.dll | |
[DeactivateActCtx](http://msdn2.microsoft.com/en-us/library/aa375140) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DeactivateActCtx
-[DeactivateActCtxWorker](https://www.google.com/search?num=5&q=DeactivateActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
[DebugActiveProcess](http://msdn2.microsoft.com/en-us/library/ms679295) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DebugActiveProcess
[DebugActiveProcessStop](http://msdn2.microsoft.com/en-us/library/ms679296) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DebugActiveProcessStop
[DebugBreak](http://msdn2.microsoft.com/en-us/library/ms679297) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DebugBreak
@@ -273,73 +141,52 @@ Native Method | Native DLL | Header | Managed Method
[DecodeRemotePointer](http://msdn2.microsoft.com/en-us/library/dn877133) | kernelbase.dll | UtilApiSet.h | Vanara.PInvoke.Kernel32.DecodeRemotePointer
[DecodeSystemPointer](http://msdn2.microsoft.com/en-us/library/bb432243) | kernel32.dll | UtilApiSet.h | Vanara.PInvoke.Kernel32.DecodeSystemPointer
[DefineDosDevice](http://msdn2.microsoft.com/en-us/library/aa363904) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.DefineDosDevice
-[DelayLoadFailureHook](https://www.google.com/search?num=5&q=DelayLoadFailureHook+site%3Amicrosoft.com) | kernel32.dll | |
-[DelayLoadFailureHookLookup](https://www.google.com/search?num=5&q=DelayLoadFailureHookLookup+site%3Amicrosoft.com) | kernelbase.dll | |
-[DeleteAce](https://www.google.com/search?num=5&q=DeleteAce+site%3Amicrosoft.com) | kernelbase.dll | |
[DeleteAtom](http://msdn2.microsoft.com/en-us/library/ms649057) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DeleteAtom
[DeleteBoundaryDescriptor](http://msdn2.microsoft.com/en-us/library/ms682549) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteBoundaryDescriptor
[DeleteCriticalSection](http://msdn2.microsoft.com/en-us/library/ms682552) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteCriticalSection
[DeleteFiber](http://msdn2.microsoft.com/en-us/library/ms682556) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteFiber
[DeleteFile](http://msdn2.microsoft.com/en-us/library/aa363915) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.DeleteFile
-[DeleteFileTransacted](https://www.google.com/search?num=5&q=DeleteFileTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[DeleteFileTransacted](http://msdn2.microsoft.com/en-us/library/e0a6230b-2da1-4746-95fe-80f7b6bae41f) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.DeleteFileTransacted
[DeleteProcThreadAttributeList](http://msdn2.microsoft.com/en-us/library/ms682559) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteProcThreadAttributeList
-[DeleteStateAtomValue](https://www.google.com/search?num=5&q=DeleteStateAtomValue+site%3Amicrosoft.com) | kernelbase.dll | |
-[DeleteStateContainer](https://www.google.com/search?num=5&q=DeleteStateContainer+site%3Amicrosoft.com) | kernelbase.dll | |
-[DeleteStateContainerValue](https://www.google.com/search?num=5&q=DeleteStateContainerValue+site%3Amicrosoft.com) | kernelbase.dll | |
[DeleteSynchronizationBarrier](http://msdn2.microsoft.com/en-us/library/hh706887) | kernel32.dll | SynchAPI.h | Vanara.PInvoke.Kernel32.DeleteSynchronizationBarrier
[DeleteTimerQueue](http://msdn2.microsoft.com/en-us/library/ms682565) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteTimerQueue
[DeleteTimerQueueEx](http://msdn2.microsoft.com/en-us/library/ms682568) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteTimerQueueEx
[DeleteTimerQueueTimer](http://msdn2.microsoft.com/en-us/library/ms682569) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DeleteTimerQueueTimer
-[DeleteUmsCompletionList](https://www.google.com/search?num=5&q=DeleteUmsCompletionList+site%3Amicrosoft.com) | kernel32.dll | |
-[DeleteUmsThreadContext](https://www.google.com/search?num=5&q=DeleteUmsThreadContext+site%3Amicrosoft.com) | kernel32.dll | |
+[DeleteUmsCompletionList](http://msdn2.microsoft.com/en-us/library/98124359-ddd1-468c-9f99-74dd3f631fa1) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.DeleteUmsCompletionList
+[DeleteUmsThreadContext](http://msdn2.microsoft.com/en-us/library/cdd118fc-f664-44ce-958d-857216ceb9a7) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.DeleteUmsThreadContext
[DeleteVolumeMountPoint](http://msdn2.microsoft.com/en-us/library/aa363927) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.DeleteVolumeMountPoint
-[DequeueUmsCompletionListItems](https://www.google.com/search?num=5&q=DequeueUmsCompletionListItems+site%3Amicrosoft.com) | kernel32.dll | |
-[DeriveCapabilitySidsFromName](https://www.google.com/search?num=5&q=DeriveCapabilitySidsFromName+site%3Amicrosoft.com) | kernelbase.dll | |
-[DestroyPrivateObjectSecurity](https://www.google.com/search?num=5&q=DestroyPrivateObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
+[DequeueUmsCompletionListItems](http://msdn2.microsoft.com/en-us/library/91499eb9-9fc5-4135-95f6-1bced78f1e07) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.DequeueUmsCompletionListItems
[DeviceIoControl](http://msdn2.microsoft.com/en-us/library/aa363216) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DeviceIoControl
-[DisablePredefinedHandleTableInternal](https://www.google.com/search?num=5&q=DisablePredefinedHandleTableInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[DisableThreadLibraryCalls](http://msdn2.microsoft.com/en-us/library/ms682579) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DisableThreadLibraryCalls
-[DisableThreadProfiling](https://www.google.com/search?num=5&q=DisableThreadProfiling+site%3Amicrosoft.com) | kernel32.dll | |
+[DisableThreadProfiling](http://msdn2.microsoft.com/en-us/library/dd796392) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DisableThreadProfiling
[DisassociateCurrentThreadFromCallback](http://msdn2.microsoft.com/en-us/library/ms682581) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DisassociateCurrentThreadFromCallback
[DiscardVirtualMemory](http://msdn2.microsoft.com/en-us/library/dn781432) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.DiscardVirtualMemory
[DisconnectNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365166) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DisconnectNamedPipe
[DnsHostnameToComputerName](http://msdn2.microsoft.com/en-us/library/ms724244) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DnsHostnameToComputerName
[DnsHostnameToComputerNameExW](http://msdn2.microsoft.com/en-us/library/ms724244) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DnsHostnameToComputerNameEx
[DosDateTimeToFileTime](http://msdn2.microsoft.com/en-us/library/ms724247) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DosDateTimeToFileTime
-[DosPathToSessionPath](https://www.google.com/search?num=5&q=DosPathToSessionPathA+site%3Amicrosoft.com) | kernel32.dll | |
-[DuplicateConsoleHandle](https://www.google.com/search?num=5&q=DuplicateConsoleHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[DuplicateEncryptionInfoFileExt](https://www.google.com/search?num=5&q=DuplicateEncryptionInfoFileExt+site%3Amicrosoft.com) | kernel32.dll | |
[DuplicateHandle](http://msdn2.microsoft.com/en-us/library/ms724251) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.DuplicateHandle
-[DuplicateStateContainerHandle](https://www.google.com/search?num=5&q=DuplicateStateContainerHandle+site%3Amicrosoft.com) | kernelbase.dll | |
-[DuplicateToken](https://www.google.com/search?num=5&q=DuplicateToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[DuplicateTokenEx](https://www.google.com/search?num=5&q=DuplicateTokenEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[EmptyWorkingSet](https://www.google.com/search?num=5&q=EmptyWorkingSet+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnableThreadProfiling](https://www.google.com/search?num=5&q=EnableThreadProfiling+site%3Amicrosoft.com) | kernel32.dll | |
+[EmptyWorkingSet](http://msdn2.microsoft.com/en-us/library/76f2252e-7305-46b0-b1af-40ac084e6696) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.EmptyWorkingSet
+[EnableThreadProfiling](http://msdn2.microsoft.com/en-us/library/dd796393) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.EnableThreadProfiling
[EncodePointer](http://msdn2.microsoft.com/en-us/library/bb432254) | kernel32.dll | UtilApiSet.h | Vanara.PInvoke.Kernel32.EncodePointer
[EncodeRemotePointer](http://msdn2.microsoft.com/en-us/library/dn877135) | kernelbase.dll | UtilApiSet.h | Vanara.PInvoke.Kernel32.EncodeRemotePointer
[EncodeSystemPointer](http://msdn2.microsoft.com/en-us/library/bb432255) | kernel32.dll | UtilApiSet.h | Vanara.PInvoke.Kernel32.EncodeSystemPointer
[EndUpdateResource](http://msdn2.microsoft.com/en-us/library/ms648032) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.EndUpdateResource
-[EnterCriticalPolicySectionInternal](https://www.google.com/search?num=5&q=EnterCriticalPolicySectionInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[EnterCriticalSection](http://msdn2.microsoft.com/en-us/library/ms682608) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.EnterCriticalSection
[EnterSynchronizationBarrier](http://msdn2.microsoft.com/en-us/library/hh706889) | kernel32.dll | Synchapi.h | Vanara.PInvoke.Kernel32.EnterSynchronizationBarrier
-[EnterUmsSchedulingMode](https://www.google.com/search?num=5&q=EnterUmsSchedulingMode+site%3Amicrosoft.com) | kernel32.dll | |
+[EnterUmsSchedulingMode](http://msdn2.microsoft.com/en-us/library/792bd7fa-0ae9-4c38-a664-5fb3e3d0c52b) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.EnterUmsSchedulingMode
[EnumCalendarInfo](http://msdn2.microsoft.com/en-us/library/dd317803) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumCalendarInfo
[EnumCalendarInfoEx](http://msdn2.microsoft.com/en-us/library/dd317804) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumCalendarInfoEx
[EnumCalendarInfoExEx](http://msdn2.microsoft.com/en-us/library/dd317805) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumCalendarInfoExEx
[EnumDateFormats](http://msdn2.microsoft.com/en-us/library/dd317810) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumDateFormats
[EnumDateFormatsEx](http://msdn2.microsoft.com/en-us/library/dd317811) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumDateFormatsEx
[EnumDateFormatsExEx](http://msdn2.microsoft.com/en-us/library/dd317812) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumDateFormatsExEx
-[EnumDeviceDrivers](https://www.google.com/search?num=5&q=EnumDeviceDrivers+site%3Amicrosoft.com) | kernelbase.dll | |
+[EnumDeviceDrivers](http://msdn2.microsoft.com/en-us/library/55925741-da23-44b1-93e8-0e9468434a61) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.EnumDeviceDrivers
[EnumDynamicTimeZoneInformation](http://msdn2.microsoft.com/en-us/library/hh706893) | kernelbase.dll | Winbase.h | Vanara.PInvoke.Kernel32.EnumDynamicTimeZoneInformation
-[EnumerateExtensionNames](https://www.google.com/search?num=5&q=EnumerateExtensionNames+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnumerateLocalComputerNames](https://www.google.com/search?num=5&q=EnumerateLocalComputerNamesA+site%3Amicrosoft.com) | kernel32.dll | |
-[EnumerateStateAtomValues](https://www.google.com/search?num=5&q=EnumerateStateAtomValues+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnumerateStateContainerItems](https://www.google.com/search?num=5&q=EnumerateStateContainerItems+site%3Amicrosoft.com) | kernelbase.dll | |
[EnumLanguageGroupLocales](http://msdn2.microsoft.com/en-us/library/dd317819) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumLanguageGroupLocales
-[EnumPageFiles](https://www.google.com/search?num=5&q=EnumPageFilesA+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnumProcesses](https://www.google.com/search?num=5&q=EnumProcesses+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnumProcessModules](https://www.google.com/search?num=5&q=EnumProcessModules+site%3Amicrosoft.com) | kernelbase.dll | |
-[EnumProcessModulesEx](https://www.google.com/search?num=5&q=EnumProcessModulesEx+site%3Amicrosoft.com) | kernelbase.dll | |
+[EnumProcesses](http://msdn2.microsoft.com/en-us/library/0c0445cb-27d2-4857-a4a5-7a4c180b068b) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.EnumProcesses
+[EnumProcessModules](http://msdn2.microsoft.com/en-us/library/b4088506-2f69-4cf0-9bab-3e6a7185f5b2) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.EnumProcessModules
+[EnumProcessModulesEx](http://msdn2.microsoft.com/en-us/library/0f982f32-31f4-47b6-85d2-d6e17aa4eeb9) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.EnumProcessModulesEx
[EnumResourceLanguagesEx](https://www.google.com/search?num=5&q=EnumResourceLanguagesExA+site%3Amicrosoft.com) | kernelbase.dll | Winbase.h | Vanara.PInvoke.Kernel32.EnumResourceLanguagesEx
[EnumResourceLanguagesW](http://msdn2.microsoft.com/en-us/library/ms648035) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.EnumResourceLanguages
[EnumResourceNames](https://www.google.com/search?num=5&q=EnumResourceNamesA+site%3Amicrosoft.com) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.EnumResourceNames
@@ -355,29 +202,12 @@ Native Method | Native DLL | Header | Managed Method
[EnumTimeFormats](http://msdn2.microsoft.com/en-us/library/dd317830) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumTimeFormats
[EnumTimeFormatsEx](http://msdn2.microsoft.com/en-us/library/dd317831) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumTimeFormatsEx
[EnumUILanguages](http://msdn2.microsoft.com/en-us/library/dd317834) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.EnumUILanguages
-[EqualDomainSid](https://www.google.com/search?num=5&q=EqualDomainSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[EqualPrefixSid](https://www.google.com/search?num=5&q=EqualPrefixSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[EqualSid](https://www.google.com/search?num=5&q=EqualSid+site%3Amicrosoft.com) | kernelbase.dll | |
[EraseTape](http://msdn2.microsoft.com/en-us/library/aa362523) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.EraseTape
[EscapeCommFunction](http://msdn2.microsoft.com/en-us/library/aa363254) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.EscapeCommFunction
-[EventActivityIdControl](https://www.google.com/search?num=5&q=EventActivityIdControl+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventEnabled](https://www.google.com/search?num=5&q=EventEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventProviderEnabled](https://www.google.com/search?num=5&q=EventProviderEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventRegister](https://www.google.com/search?num=5&q=EventRegister+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventSetInformation](https://www.google.com/search?num=5&q=EventSetInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventUnregister](https://www.google.com/search?num=5&q=EventUnregister+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventWrite](https://www.google.com/search?num=5&q=EventWrite+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventWriteEx](https://www.google.com/search?num=5&q=EventWriteEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventWriteString](https://www.google.com/search?num=5&q=EventWriteString+site%3Amicrosoft.com) | kernelbase.dll | |
-[EventWriteTransfer](https://www.google.com/search?num=5&q=EventWriteTransfer+site%3Amicrosoft.com) | kernelbase.dll | |
-[ExecuteUmsThread](https://www.google.com/search?num=5&q=ExecuteUmsThread+site%3Amicrosoft.com) | kernel32.dll | |
-[exit](https://www.google.com/search?num=5&q=exit+site%3Amicrosoft.com) | kernelbase.dll | |
+[ExecuteUmsThread](http://msdn2.microsoft.com/en-us/library/e4265351-e8e9-4878-bd42-93258b4cd1a0) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.ExecuteUmsThread
[ExitProcess](http://msdn2.microsoft.com/en-us/library/ms682658) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ExitProcess
[ExitThread](http://msdn2.microsoft.com/en-us/library/ms682659) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ExitThread
-[ExitVDM](https://www.google.com/search?num=5&q=ExitVDM+site%3Amicrosoft.com) | kernel32.dll | |
[ExpandEnvironmentStrings](http://msdn2.microsoft.com/en-us/library/ms724265) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ExpandEnvironmentStrings
-[ExpungeConsoleCommandHistory](https://www.google.com/search?num=5&q=ExpungeConsoleCommandHistoryA+site%3Amicrosoft.com) | kernel32.dll | |
-[ExtensionProgIdExists](https://www.google.com/search?num=5&q=ExtensionProgIdExists+site%3Amicrosoft.com) | kernelbase.dll | |
[FatalAppExit](http://msdn2.microsoft.com/en-us/library/ms679336) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FatalAppExit
[FatalExit](http://msdn2.microsoft.com/en-us/library/ms679337) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FatalExit
[FileTimeToDosDateTime](http://msdn2.microsoft.com/en-us/library/ms724274) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FileTimeToDosDateTime
@@ -386,20 +216,17 @@ Native Method | Native DLL | Header | Managed Method
[FillConsoleOutputAttribute](https://www.google.com/search?num=5&q=FillConsoleOutputAttribute+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.FillConsoleOutputAttribute
[FillConsoleOutputCharacter](https://www.google.com/search?num=5&q=FillConsoleOutputCharacterA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.FillConsoleOutputCharacter
[FindActCtxSectionGuid](http://msdn2.microsoft.com/en-us/library/aa375148) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FindActCtxSectionGuid
-[FindActCtxSectionGuidWorker](https://www.google.com/search?num=5&q=FindActCtxSectionGuidWorker+site%3Amicrosoft.com) | kernel32.dll | |
[FindActCtxSectionString](http://msdn2.microsoft.com/en-us/library/aa375149) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FindActCtxSectionString
-[FindActCtxSectionStringWWorker](https://www.google.com/search?num=5&q=FindActCtxSectionStringWWorker+site%3Amicrosoft.com) | kernel32.dll | |
[FindAtom](http://msdn2.microsoft.com/en-us/library/ms649058) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FindAtom
[FindClose](http://msdn2.microsoft.com/en-us/library/aa364413) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindClose
[FindCloseChangeNotification](http://msdn2.microsoft.com/en-us/library/aa364414) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindCloseChangeNotification
[FindFirstChangeNotification](http://msdn2.microsoft.com/en-us/library/aa364417) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindFirstChangeNotification
[FindFirstFile](http://msdn2.microsoft.com/en-us/library/aa364418) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindFirstFile
[FindFirstFileEx](http://msdn2.microsoft.com/en-us/library/aa364419) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindFirstFileEx
-[FindFirstFileNameTransactedW](https://www.google.com/search?num=5&q=FindFirstFileNameTransactedW+site%3Amicrosoft.com) | kernel32.dll | |
+[FindFirstFileNameTransactedW](http://msdn2.microsoft.com/en-us/library/79c7d32d-3cb7-4e27-9db1-f24282bf606a) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.FindFirstFileNameTransactedW
[FindFirstFileNameW](http://msdn2.microsoft.com/en-us/library/aa364421) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FindFirstFileName
-[FindFirstFileTransacted](https://www.google.com/search?num=5&q=FindFirstFileTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
-[FindFirstFreeAce](https://www.google.com/search?num=5&q=FindFirstFreeAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[FindFirstStreamTransactedW](https://www.google.com/search?num=5&q=FindFirstStreamTransactedW+site%3Amicrosoft.com) | kernel32.dll | |
+[FindFirstFileTransacted](http://msdn2.microsoft.com/en-us/library/d94bf32b-f14b-44b4-824b-ed453d0424ef) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.FindFirstFileTransacted
+[FindFirstStreamTransactedW](http://msdn2.microsoft.com/en-us/library/76c64aa9-0501-457d-b774-c209fbac4ccc) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.FindFirstStreamTransactedW
[FindFirstStreamW](http://msdn2.microsoft.com/en-us/library/aa364424) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FindFirstStream
[FindFirstVolume](http://msdn2.microsoft.com/en-us/library/aa364419) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.FindFirstVolume
[FindFirstVolumeMountPoint](http://msdn2.microsoft.com/en-us/library/aa364426) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FindFirstVolumeMountPoint
@@ -411,7 +238,7 @@ Native Method | Native DLL | Header | Managed Method
[FindNextVolumeMountPoint](http://msdn2.microsoft.com/en-us/library/aa364432) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FindNextVolumeMountPoint
[FindNLSString](http://msdn2.microsoft.com/en-us/library/dd318056) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.FindNLSString
[FindNLSStringEx](http://msdn2.microsoft.com/en-us/library/dd318059) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.FindNLSStringEx
-[FindPackagesByPackageFamily](https://www.google.com/search?num=5&q=FindPackagesByPackageFamily+site%3Amicrosoft.com) | kernel32.dll | |
+[FindPackagesByPackageFamily](http://msdn2.microsoft.com/en-us/library/D52E98BD-726F-4AC0-A034-02896B1D1687) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.FindPackagesByPackageFamily
[FindResource](https://www.google.com/search?num=5&q=FindResourceA+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FindResource
[FindResourceEx](https://www.google.com/search?num=5&q=FindResourceExA+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FindResourceEx
[FindStringOrdinal](http://msdn2.microsoft.com/en-us/library/dd318061) | kernel32.dll | Libloaderapi.h | Vanara.PInvoke.Kernel32.FindStringOrdinal
@@ -427,53 +254,31 @@ Native Method | Native DLL | Header | Managed Method
[FlushProcessWriteBuffers](http://msdn2.microsoft.com/en-us/library/ms683148) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FlushProcessWriteBuffers
[FlushViewOfFile](http://msdn2.microsoft.com/en-us/library/aa366563) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FlushViewOfFile
[FoldString](http://msdn2.microsoft.com/en-us/library/dd318063) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.FoldString
-[ForceSyncFgPolicyInternal](https://www.google.com/search?num=5&q=ForceSyncFgPolicyInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[FormatApplicationUserModelId](https://www.google.com/search?num=5&q=FormatApplicationUserModelId+site%3Amicrosoft.com) | kernel32.dll | |
+[FormatApplicationUserModelId](http://msdn2.microsoft.com/en-us/library/F48D19C2-6373-41FC-A99D-E3CCB68D6C6C) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.FormatApplicationUserModelId
[FormatMessage](http://msdn2.microsoft.com/en-us/library/ms679351) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FormatMessage
[FreeConsole](https://www.google.com/search?num=5&q=FreeConsole+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.FreeConsole
[FreeEnvironmentStrings](http://msdn2.microsoft.com/en-us/library/ms683151) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FreeEnvironmentStrings
-[FreeGPOListInternal](https://www.google.com/search?num=5&q=FreeGPOListInternalA+site%3Amicrosoft.com) | kernelbase.dll | |
[FreeLibrary](http://msdn2.microsoft.com/en-us/library/ms683152) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FreeLibrary
[FreeLibraryAndExitThread](http://msdn2.microsoft.com/en-us/library/ms683153) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FreeLibraryAndExitThread
[FreeLibraryWhenCallbackReturns](http://msdn2.microsoft.com/en-us/library/ms683154) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FreeLibraryWhenCallbackReturns
[FreeMemoryJobObject](http://msdn2.microsoft.com/en-us/library/mt280121) | kernel32.dll | Jobapi2.h | Vanara.PInvoke.Kernel32.FreeMemoryJobObject
[FreeResource](http://msdn2.microsoft.com/en-us/library/ms648044) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.FreeResource
-[FreeSid](https://www.google.com/search?num=5&q=FreeSid+site%3Amicrosoft.com) | kernelbase.dll | |
[FreeUserPhysicalPages](http://msdn2.microsoft.com/en-us/library/aa366566) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.FreeUserPhysicalPages
[GenerateConsoleCtrlEvent](https://www.google.com/search?num=5&q=GenerateConsoleCtrlEvent+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GenerateConsoleCtrlEvent
-[GenerateGPNotificationInternal](https://www.google.com/search?num=5&q=GenerateGPNotificationInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAcceptLanguages](https://www.google.com/search?num=5&q=GetAcceptLanguagesA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAce](https://www.google.com/search?num=5&q=GetAce+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAclInformation](https://www.google.com/search?num=5&q=GetAclInformation+site%3Amicrosoft.com) | kernelbase.dll | |
[GetACP](http://msdn2.microsoft.com/en-us/library/dd318070) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetACP
-[GetActiveProcessorCount](https://www.google.com/search?num=5&q=GetActiveProcessorCount+site%3Amicrosoft.com) | kernel32.dll | |
-[GetActiveProcessorGroupCount](https://www.google.com/search?num=5&q=GetActiveProcessorGroupCount+site%3Amicrosoft.com) | kernel32.dll | |
-[GetAdjustObjectAttributesForPrivateNamespaceRoutine](https://www.google.com/search?num=5&q=GetAdjustObjectAttributesForPrivateNamespaceRoutine+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAlternatePackageRoots](https://www.google.com/search?num=5&q=GetAlternatePackageRoots+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAppContainerAce](https://www.google.com/search?num=5&q=GetAppContainerAce+site%3Amicrosoft.com) | kernel32.dll | |
+[GetActiveProcessorCount](http://msdn2.microsoft.com/en-us/library/f4ebb0a7-1c05-4478-85e3-80e6327ef8a4) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetActiveProcessorCount
+[GetActiveProcessorGroupCount](http://msdn2.microsoft.com/en-us/library/566c6abe-9269-4e0e-9c98-e4607c808452) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetActiveProcessorGroupCount
[GetAppContainerNamedObjectPath](http://msdn2.microsoft.com/en-us/library/hh448493) | kernel32.dll | Securityappcontainer.h | Vanara.PInvoke.Kernel32.GetAppContainerNamedObjectPath
-[GetAppDataFolder](https://www.google.com/search?num=5&q=GetAppDataFolder+site%3Amicrosoft.com) | kernelbase.dll | |
[GetApplicationRecoveryCallback](http://msdn2.microsoft.com/en-us/library/aa373343) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetApplicationRecoveryCallback
-[GetApplicationRecoveryCallbackWorker](https://www.google.com/search?num=5&q=GetApplicationRecoveryCallbackWorker+site%3Amicrosoft.com) | kernel32.dll | |
[GetApplicationRestartSettings](http://msdn2.microsoft.com/en-us/library/aa373344) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetApplicationRestartSettings
-[GetApplicationRestartSettingsWorker](https://www.google.com/search?num=5&q=GetApplicationRestartSettingsWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[GetApplicationUserModelId](https://www.google.com/search?num=5&q=GetApplicationUserModelId+site%3Amicrosoft.com) | kernel32.dll | |
-[GetApplicationUserModelIdFromToken](https://www.google.com/search?num=5&q=GetApplicationUserModelIdFromToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAppliedGPOListInternal](https://www.google.com/search?num=5&q=GetAppliedGPOListInternalA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetAppModelVersion](https://www.google.com/search?num=5&q=GetAppModelVersion+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetApplicationUserModelId](http://msdn2.microsoft.com/en-us/library/FE4E0818-F548-494B-B3BD-FB51DC748451) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetApplicationUserModelId
+[GetApplicationUserModelIdFromToken](http://msdn2.microsoft.com/en-us/library/80036518-927E-4CD0-B499-8EA472AB7E5A) | kernelbase.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetApplicationUserModelIdFromToken
[GetAtomName](http://msdn2.microsoft.com/en-us/library/ms649059) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetAtomName
-[GetBinaryType](https://www.google.com/search?num=5&q=GetBinaryType+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCachedSigningLevel](https://www.google.com/search?num=5&q=GetCachedSigningLevel+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendar](https://www.google.com/search?num=5&q=GetCalendar+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCalendarDateFormat](https://www.google.com/search?num=5&q=GetCalendarDateFormat+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendarDateFormatEx](https://www.google.com/search?num=5&q=GetCalendarDateFormatEx+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendarDaysInMonth](https://www.google.com/search?num=5&q=GetCalendarDaysInMonth+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendarDifferenceInDays](https://www.google.com/search?num=5&q=GetCalendarDifferenceInDays+site%3Amicrosoft.com) | kernel32.dll | |
+[GetBinaryType](https://www.google.com/search?num=5&q=GetBinaryType+site%3Amicrosoft.com) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetBinaryType
+[GetCalendarDateFormatEx](http://msdn2.microsoft.com/en-us/library/eb2622bc-a98d-42bd-ab59-7a849000d79d) | kernel32.dll | | Vanara.PInvoke.Kernel32.GetCalendarDateFormatEx
[GetCalendarInfo](http://msdn2.microsoft.com/en-us/library/dd318072) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCalendarInfo
[GetCalendarInfoEx](http://msdn2.microsoft.com/en-us/library/dd318075) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCalendarInfoEx
-[GetCalendarMonthsInYear](https://www.google.com/search?num=5&q=GetCalendarMonthsInYear+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendarSupportedDateRange](https://www.google.com/search?num=5&q=GetCalendarSupportedDateRange+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCalendarWeekNumber](https://www.google.com/search?num=5&q=GetCalendarWeekNumber+site%3Amicrosoft.com) | kernel32.dll | |
+[GetCalendarSupportedDateRange](http://msdn2.microsoft.com/en-us/library/fe036ac5-77c0-4e83-8d70-db3fa0f7c803) | kernel32.dll | | Vanara.PInvoke.Kernel32.GetCalendarSupportedDateRange
[GetCommandLine](http://msdn2.microsoft.com/en-us/library/ms683156) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCommandLine
[GetCommConfig](http://msdn2.microsoft.com/en-us/library/aa363256) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCommConfig
[GetCommMask](http://msdn2.microsoft.com/en-us/library/aa363257) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCommMask
@@ -481,9 +286,8 @@ Native Method | Native DLL | Header | Managed Method
[GetCommProperties](http://msdn2.microsoft.com/en-us/library/aa363259) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCommProperties
[GetCommState](http://msdn2.microsoft.com/en-us/library/aa363260) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCommState
[GetCommTimeouts](http://msdn2.microsoft.com/en-us/library/aa363261) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCommTimeouts
-[GetComPlusPackageInstallStatus](https://www.google.com/search?num=5&q=GetComPlusPackageInstallStatus+site%3Amicrosoft.com) | kernel32.dll | |
+[GetComPlusPackageInstallStatus](http://msdn2.microsoft.com/en-us/library/c68af270-6a40-4026-9725-5fe657123fd5) | kernel32.dll | | Vanara.PInvoke.Kernel32.GetComPlusPackageInstallStatus
[GetCompressedFileSize](http://msdn2.microsoft.com/en-us/library/aa364930) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCompressedFileSize
-[GetCompressedFileSizeTransacted](https://www.google.com/search?num=5&q=GetCompressedFileSizeTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
[GetComputerName](http://msdn2.microsoft.com/en-us/library/ms724295) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetComputerName
[GetComputerNameEx](http://msdn2.microsoft.com/en-us/library/ms724301) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetComputerNameEx
[GetConsoleAlias](https://www.google.com/search?num=5&q=GetConsoleAliasA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleAlias
@@ -491,22 +295,12 @@ Native Method | Native DLL | Header | Managed Method
[GetConsoleAliasesLength](https://www.google.com/search?num=5&q=GetConsoleAliasesLengthA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleAliasesLength
[GetConsoleAliasExes](https://www.google.com/search?num=5&q=GetConsoleAliasExesA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleAliasExes
[GetConsoleAliasExesLength](https://www.google.com/search?num=5&q=GetConsoleAliasExesLengthA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleAliasExesLength
-[GetConsoleCharType](https://www.google.com/search?num=5&q=GetConsoleCharType+site%3Amicrosoft.com) | kernel32.dll | |
-[GetConsoleCommandHistory](https://www.google.com/search?num=5&q=GetConsoleCommandHistoryA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetConsoleCommandHistoryLength](https://www.google.com/search?num=5&q=GetConsoleCommandHistoryLengthA+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleCP](https://www.google.com/search?num=5&q=GetConsoleCP+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleCP
[GetConsoleCursorInfo](https://www.google.com/search?num=5&q=GetConsoleCursorInfo+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleCursorInfo
-[GetConsoleCursorMode](https://www.google.com/search?num=5&q=GetConsoleCursorMode+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleDisplayMode](https://www.google.com/search?num=5&q=GetConsoleDisplayMode+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleDisplayMode
-[GetConsoleFontInfo](https://www.google.com/search?num=5&q=GetConsoleFontInfo+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleFontSize](https://www.google.com/search?num=5&q=GetConsoleFontSize+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleFontSize
-[GetConsoleHardwareState](https://www.google.com/search?num=5&q=GetConsoleHardwareState+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleHistoryInfo](https://www.google.com/search?num=5&q=GetConsoleHistoryInfo+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleHistoryInfo
-[GetConsoleInputExeName](https://www.google.com/search?num=5&q=GetConsoleInputExeNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetConsoleInputWaitHandle](https://www.google.com/search?num=5&q=GetConsoleInputWaitHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[GetConsoleKeyboardLayoutName](https://www.google.com/search?num=5&q=GetConsoleKeyboardLayoutNameA+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleMode](https://www.google.com/search?num=5&q=GetConsoleMode+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleMode
-[GetConsoleNlsMode](https://www.google.com/search?num=5&q=GetConsoleNlsMode+site%3Amicrosoft.com) | kernel32.dll | |
[GetConsoleOriginalTitle](https://www.google.com/search?num=5&q=GetConsoleOriginalTitleA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleOriginalTitle
[GetConsoleOutputCP](https://www.google.com/search?num=5&q=GetConsoleOutputCP+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleOutputCP
[GetConsoleProcessList](https://www.google.com/search?num=5&q=GetConsoleProcessList+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleProcessList
@@ -515,44 +309,33 @@ Native Method | Native DLL | Header | Managed Method
[GetConsoleSelectionInfo](https://www.google.com/search?num=5&q=GetConsoleSelectionInfo+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleSelectionInfo
[GetConsoleTitle](https://www.google.com/search?num=5&q=GetConsoleTitleA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleTitle
[GetConsoleWindow](https://www.google.com/search?num=5&q=GetConsoleWindow+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetConsoleWindow
-[GetCPFileNameFromRegistry](https://www.google.com/search?num=5&q=GetCPFileNameFromRegistry+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCPHashNode](https://www.google.com/search?num=5&q=GetCPHashNode+site%3Amicrosoft.com) | kernelbase.dll | |
[GetCPInfo](http://msdn2.microsoft.com/en-us/library/dd318078) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCPInfo
[GetCPInfoEx](https://www.google.com/search?num=5&q=GetCPInfoExA+site%3Amicrosoft.com) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCPInfoEx
[GetCurrencyFormat](http://msdn2.microsoft.com/en-us/library/dd318083) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCurrencyFormat
[GetCurrencyFormatEx](http://msdn2.microsoft.com/en-us/library/dd318084) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetCurrencyFormatEx
[GetCurrentActCtx](http://msdn2.microsoft.com/en-us/library/aa375152) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetCurrentActCtx
-[GetCurrentActCtxWorker](https://www.google.com/search?num=5&q=GetCurrentActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentApplicationUserModelId](https://www.google.com/search?num=5&q=GetCurrentApplicationUserModelId+site%3Amicrosoft.com) | kernel32.dll | |
+[GetCurrentApplicationUserModelId](http://msdn2.microsoft.com/en-us/library/562BB225-0922-4FE7-92C0-573A2CCE3195) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentApplicationUserModelId
[GetCurrentConsoleFont](https://www.google.com/search?num=5&q=GetCurrentConsoleFont+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetCurrentConsoleFont
[GetCurrentConsoleFontEx](https://www.google.com/search?num=5&q=GetCurrentConsoleFontEx+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetCurrentConsoleFontEx
[GetCurrentDirectory](http://msdn2.microsoft.com/en-us/library/aa364934) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentDirectory
-[GetCurrentPackageApplicationContext](https://www.google.com/search?num=5&q=GetCurrentPackageApplicationContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCurrentPackageApplicationResourcesContext](https://www.google.com/search?num=5&q=GetCurrentPackageApplicationResourcesContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCurrentPackageContext](https://www.google.com/search?num=5&q=GetCurrentPackageContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCurrentPackageFamilyName](https://www.google.com/search?num=5&q=GetCurrentPackageFamilyName+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentPackageFullName](https://www.google.com/search?num=5&q=GetCurrentPackageFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentPackageId](https://www.google.com/search?num=5&q=GetCurrentPackageId+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentPackageInfo](https://www.google.com/search?num=5&q=GetCurrentPackageInfo+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentPackagePath](https://www.google.com/search?num=5&q=GetCurrentPackagePath+site%3Amicrosoft.com) | kernel32.dll | |
-[GetCurrentPackageResourcesContext](https://www.google.com/search?num=5&q=GetCurrentPackageResourcesContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetCurrentPackageSecurityContext](https://www.google.com/search?num=5&q=GetCurrentPackageSecurityContext+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetCurrentPackageFamilyName](http://msdn2.microsoft.com/en-us/library/39DBFBDD-A1CC-45C3-A5DD-5ED9697F9AFE) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentPackageFamilyName
+[GetCurrentPackageFullName](http://msdn2.microsoft.com/en-us/library/D5B00C53-1FBF-4245-92D1-FA39713A9EE7) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentPackageFullName
+[GetCurrentPackageId](http://msdn2.microsoft.com/en-us/library/4CFC707A-2A5A-41FE-BB5F-6FECACC99271) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentPackageId
+[GetCurrentPackageInfo](http://msdn2.microsoft.com/en-us/library/A1887D61-0FAD-4BE8-850F-F104CC074798) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentPackageInfo
+[GetCurrentPackagePath](http://msdn2.microsoft.com/en-us/library/46CE81DF-A9D5-492E-AB5E-4F043DC326E2) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetCurrentPackagePath
[GetCurrentProcess](http://msdn2.microsoft.com/en-us/library/ms683179) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentProcess
[GetCurrentProcessId](http://msdn2.microsoft.com/en-us/library/ms683180) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentProcessId
-[GetCurrentProcessorNumber](https://www.google.com/search?num=5&q=GetCurrentProcessorNumber+site%3Amicrosoft.com) | kernel32.dll | |
+[GetCurrentProcessorNumber](http://msdn2.microsoft.com/en-us/library/1f2bebc7-a548-409a-ab74-78a4b55c8fa7) | kernel32.dll | processthreadsapi.h | Vanara.PInvoke.Kernel32.GetCurrentProcessorNumber
[GetCurrentProcessorNumberEx](http://msdn2.microsoft.com/en-us/library/dd405487) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentProcessorNumberEx
-[GetCurrentTargetPlatformContext](https://www.google.com/search?num=5&q=GetCurrentTargetPlatformContext+site%3Amicrosoft.com) | kernelbase.dll | |
[GetCurrentThread](http://msdn2.microsoft.com/en-us/library/ms683182) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentThread
[GetCurrentThreadId](http://msdn2.microsoft.com/en-us/library/ms683183) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetCurrentThreadId
[GetCurrentThreadStackLimits](http://msdn2.microsoft.com/en-us/library/hh706789) | kernel32.dll | Processthreadsapi.h | Vanara.PInvoke.Kernel32.GetCurrentThreadStackLimits
-[GetCurrentUmsThread](https://www.google.com/search?num=5&q=GetCurrentUmsThread+site%3Amicrosoft.com) | kernel32.dll | |
+[GetCurrentUmsThread](http://msdn2.microsoft.com/en-us/library/f2e20816-919a-443d-96d3-94e98afc28f2) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetCurrentUmsThread
[GetDateFormat](http://msdn2.microsoft.com/en-us/library/dd318086) | kernel32.dll | Datetimeapi.h | Vanara.PInvoke.Kernel32.GetDateFormat
-[GetDateFormatAWorker](https://www.google.com/search?num=5&q=GetDateFormatAWorker+site%3Amicrosoft.com) | kernel32.dll | |
[GetDateFormatEx](http://msdn2.microsoft.com/en-us/library/dd318088) | kernel32.dll | Datetimeapi.h | Vanara.PInvoke.Kernel32.GetDateFormatEx
-[GetDateFormatWWorker](https://www.google.com/search?num=5&q=GetDateFormatWWorker+site%3Amicrosoft.com) | kernel32.dll | |
[GetDefaultCommConfig](http://msdn2.microsoft.com/en-us/library/aa363262) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetDefaultCommConfig
-[GetDeviceDriverBaseName](https://www.google.com/search?num=5&q=GetDeviceDriverBaseNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetDeviceDriverFileName](https://www.google.com/search?num=5&q=GetDeviceDriverFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetDeviceDriverBaseName](http://msdn2.microsoft.com/en-us/library/a19a927d-4669-4d4c-951e-43f294a8fb40) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetDeviceDriverBaseName
+[GetDeviceDriverFileName](http://msdn2.microsoft.com/en-us/library/6ddbcf7e-e41c-4ea7-b60a-01ed5c98c530) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetDeviceDriverFileName
[GetDevicePowerState](http://msdn2.microsoft.com/en-us/library/aa372690) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetDevicePowerState
[GetDiskFreeSpace](http://msdn2.microsoft.com/en-us/library/aa364935) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetDiskFreeSpace
[GetDiskFreeSpaceEx](http://msdn2.microsoft.com/en-us/library/aa364937) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetDiskFreeSpaceEx
@@ -561,109 +344,77 @@ Native Method | Native DLL | Header | Managed Method
[GetDurationFormat](http://msdn2.microsoft.com/en-us/library/dd318091) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetDurationFormat
[GetDurationFormatEx](http://msdn2.microsoft.com/en-us/library/dd318092) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetDurationFormatEx
[GetDynamicTimeZoneInformation](http://msdn2.microsoft.com/en-us/library/ms724318) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetDynamicTimeZoneInformation
-[GetDynamicTimeZoneInformationEffectiveYears](https://www.google.com/search?num=5&q=GetDynamicTimeZoneInformationEffectiveYears+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetEffectivePackageStatusForUser](https://www.google.com/search?num=5&q=GetEffectivePackageStatusForUser+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetEffectivePackageStatusForUserSid](https://www.google.com/search?num=5&q=GetEffectivePackageStatusForUserSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetEightBitStringToUnicodeSizeRoutine](https://www.google.com/search?num=5&q=GetEightBitStringToUnicodeSizeRoutine+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetEightBitStringToUnicodeStringRoutine](https://www.google.com/search?num=5&q=GetEightBitStringToUnicodeStringRoutine+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetEnabledXStateFeatures](https://www.google.com/search?num=5&q=GetEnabledXStateFeatures+site%3Amicrosoft.com) | kernel32.dll | |
-[GetEncryptedFileVersionExt](https://www.google.com/search?num=5&q=GetEncryptedFileVersionExt+site%3Amicrosoft.com) | kernel32.dll | |
+[GetDynamicTimeZoneInformationEffectiveYears](http://msdn2.microsoft.com/en-us/library/hh706894) | kernelbase.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetDynamicTimeZoneInformationEffectiveYears
+[GetEnabledXStateFeatures](http://msdn2.microsoft.com/en-us/library/E7DE090F-F83E-440D-B2A3-BCF160889F2E) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetEnabledXStateFeatures
[GetEnvironmentStrings](https://www.google.com/search?num=5&q=GetEnvironmentStrings+site%3Amicrosoft.com) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetEnvironmentStrings
[GetEnvironmentVariable](http://msdn2.microsoft.com/en-us/library/ms683188) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetEnvironmentVariable
-[GetEraNameCountedString](https://www.google.com/search?num=5&q=GetEraNameCountedString+site%3Amicrosoft.com) | kernel32.dll | |
[GetErrorMode](http://msdn2.microsoft.com/en-us/library/ms679355) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetErrorMode
[GetExitCodeProcess](http://msdn2.microsoft.com/en-us/library/ms683189) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetExitCodeProcess
[GetExitCodeThread](http://msdn2.microsoft.com/en-us/library/ms683190) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetExitCodeThread
-[GetExpandedName](https://www.google.com/search?num=5&q=GetExpandedNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetExtensionApplicationUserModelId](https://www.google.com/search?num=5&q=GetExtensionApplicationUserModelId+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetExtensionProgIds](https://www.google.com/search?num=5&q=GetExtensionProgIds+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetExtensionProperty](https://www.google.com/search?num=5&q=GetExtensionProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetExtensionProperty2](https://www.google.com/search?num=5&q=GetExtensionProperty2+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetFallbackDisplayName](https://www.google.com/search?num=5&q=GetFallbackDisplayName+site%3Amicrosoft.com) | kernelbase.dll | |
[GetFileAttributes](http://msdn2.microsoft.com/en-us/library/aa364944) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileAttributes
[GetFileAttributesEx](http://msdn2.microsoft.com/en-us/library/aa364946) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileAttributesEx
-[GetFileAttributesTransacted](https://www.google.com/search?num=5&q=GetFileAttributesTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetFileBandwidthReservation](https://www.google.com/search?num=5&q=GetFileBandwidthReservation+site%3Amicrosoft.com) | kernel32.dll | |
+[GetFileAttributesTransacted](http://msdn2.microsoft.com/en-us/library/dd1435da-93e5-440a-913a-9e40e39b4a01) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetFileAttributesTransacted
+[GetFileBandwidthReservation](http://msdn2.microsoft.com/en-us/library/3caf38f6-e853-4057-a192-71cda4443dbd) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetFileBandwidthReservation
[GetFileInformationByHandle](http://msdn2.microsoft.com/en-us/library/aa364952) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileInformationByHandle
-[GetFileInformationByHandleEx](https://www.google.com/search?num=5&q=GetFileInformationByHandleEx+site%3Amicrosoft.com) | kernel32.dll | |
+[GetFileInformationByHandleEx](http://msdn2.microsoft.com/en-us/library/e261ea45-d084-490e-94b4-129bd76f6a04) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetFileInformationByHandleEx
[GetFileMUIInfo](http://msdn2.microsoft.com/en-us/library/dd318095) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetFileMUIInfo
[GetFileMUIPath](http://msdn2.microsoft.com/en-us/library/dd318097) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetFileMUIPath
-[GetFileSecurityW](https://www.google.com/search?num=5&q=GetFileSecurityW+site%3Amicrosoft.com) | kernelbase.dll | |
[GetFileSize](http://msdn2.microsoft.com/en-us/library/aa364955) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileSize
[GetFileSizeEx](http://msdn2.microsoft.com/en-us/library/aa364957) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileSizeEx
[GetFileTime](http://msdn2.microsoft.com/en-us/library/ms724320) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileTime
[GetFileType](http://msdn2.microsoft.com/en-us/library/aa364960) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFileType
-[GetFileVersionInfo](https://www.google.com/search?num=5&q=GetFileVersionInfoA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetFileVersionInfoByHandle](https://www.google.com/search?num=5&q=GetFileVersionInfoByHandle+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetFileVersionInfoEx](https://www.google.com/search?num=5&q=GetFileVersionInfoExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetFileVersionInfoSize](https://www.google.com/search?num=5&q=GetFileVersionInfoSizeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetFileVersionInfoSizeEx](https://www.google.com/search?num=5&q=GetFileVersionInfoSizeExA+site%3Amicrosoft.com) | kernelbase.dll | |
[GetFinalPathNameByHandle](http://msdn2.microsoft.com/en-us/library/aa364962) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFinalPathNameByHandle
[GetFirmwareEnvironmentVariable](http://msdn2.microsoft.com/en-us/library/ms724325) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetFirmwareEnvironmentVariable
-[GetFirmwareEnvironmentVariableEx](https://www.google.com/search?num=5&q=GetFirmwareEnvironmentVariableExA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetFirmwareType](https://www.google.com/search?num=5&q=GetFirmwareType+site%3Amicrosoft.com) | kernel32.dll | |
+[GetFirmwareEnvironmentVariableEx](http://msdn2.microsoft.com/en-us/library/B093BA68-C68B-4ED6-9902-058650A191FD) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetFirmwareEnvironmentVariableEx
[GetFullPathName](http://msdn2.microsoft.com/en-us/library/aa364963) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetFullPathName
-[GetFullPathNameTransacted](https://www.google.com/search?num=5&q=GetFullPathNameTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[GetFullPathNameTransacted](http://msdn2.microsoft.com/en-us/library/63cbcec6-e9f0-4db3-bf2f-03a987000af1) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetFullPathNameTransacted
[GetGeoInfo](http://msdn2.microsoft.com/en-us/library/dd318099) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetGeoInfo
-[GetGPOListInternal](https://www.google.com/search?num=5&q=GetGPOListInternalA+site%3Amicrosoft.com) | kernelbase.dll | |
[GetHandleInformation](http://msdn2.microsoft.com/en-us/library/ms724329) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetHandleInformation
-[GetHivePath](https://www.google.com/search?num=5&q=GetHivePath+site%3Amicrosoft.com) | kernelbase.dll | |
[GetIntegratedDisplaySize](http://msdn2.microsoft.com/en-us/library/dn904185) | kernelbase.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetIntegratedDisplaySize
-[GetIsEdpEnabled](https://www.google.com/search?num=5&q=GetIsEdpEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetKernelObjectSecurity](https://www.google.com/search?num=5&q=GetKernelObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
[GetLargePageMinimum](http://msdn2.microsoft.com/en-us/library/aa366568) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetLargePageMinimum
[GetLargestConsoleWindowSize](https://www.google.com/search?num=5&q=GetLargestConsoleWindowSize+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetLargestConsoleWindowSize
[GetLastError](http://msdn2.microsoft.com/en-us/library/ms679360) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetLastError
-[GetLengthSid](https://www.google.com/search?num=5&q=GetLengthSid+site%3Amicrosoft.com) | kernelbase.dll | |
[GetLocaleInfo](http://msdn2.microsoft.com/en-us/library/dd318101) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetLocaleInfo
[GetLocaleInfoEx](http://msdn2.microsoft.com/en-us/library/dd318103) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetLocaleInfoEx
-[GetLocaleInfoHelper](https://www.google.com/search?num=5&q=GetLocaleInfoHelper+site%3Amicrosoft.com) | kernelbase.dll | |
[GetLocalTime](http://msdn2.microsoft.com/en-us/library/ms724338) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetLocalTime
[GetLogicalDrives](http://msdn2.microsoft.com/en-us/library/aa364972) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetLogicalDrives
[GetLogicalDriveStrings](http://msdn2.microsoft.com/en-us/library/aa364975) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetLogicalDriveStrings
[GetLogicalProcessorInformation](http://msdn2.microsoft.com/en-us/library/ms683194) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetLogicalProcessorInformation
[GetLogicalProcessorInformationEx](http://msdn2.microsoft.com/en-us/library/dd405488) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetLogicalProcessorInformationEx
[GetLongPathName](http://msdn2.microsoft.com/en-us/library/aa364980) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetLongPathName
-[GetLongPathNameTransacted](https://www.google.com/search?num=5&q=GetLongPathNameTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[GetLongPathNameTransacted](http://msdn2.microsoft.com/en-us/library/8523cde9-f0dd-4832-8d9d-9e68bac89344) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetLongPathNameTransacted
[GetMailslotInfo](http://msdn2.microsoft.com/en-us/library/aa365435) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetMailslotInfo
-[GetMappedFileName](https://www.google.com/search?num=5&q=GetMappedFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetMaximumProcessorCount](https://www.google.com/search?num=5&q=GetMaximumProcessorCount+site%3Amicrosoft.com) | kernel32.dll | |
-[GetMaximumProcessorGroupCount](https://www.google.com/search?num=5&q=GetMaximumProcessorGroupCount+site%3Amicrosoft.com) | kernel32.dll | |
+[GetMappedFileName](http://msdn2.microsoft.com/en-us/library/10a2e5ab-f495-486d-8ef7-ef763716afd1) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetMappedFileName
+[GetMaximumProcessorCount](http://msdn2.microsoft.com/en-us/library/71ce4fb4-ef63-4750-a842-bbfb1a5b0543) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetMaximumProcessorCount
+[GetMaximumProcessorGroupCount](http://msdn2.microsoft.com/en-us/library/7762ec89-5892-4af3-9032-bf084aef9075) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetMaximumProcessorGroupCount
[GetMemoryErrorHandlingCapabilities](http://msdn2.microsoft.com/en-us/library/hh691012) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetMemoryErrorHandlingCapabilities
-[GetModuleBaseName](https://www.google.com/search?num=5&q=GetModuleBaseNameA+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetModuleBaseName](http://msdn2.microsoft.com/en-us/library/31a9eb69-95f0-4dd7-8fd5-296f2cff0b8a) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetModuleBaseName
[GetModuleFileName](http://msdn2.microsoft.com/en-us/library/ms683197) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetModuleFileName
-[GetModuleFileNameEx](https://www.google.com/search?num=5&q=GetModuleFileNameExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetModuleHandle](https://www.google.com/search?num=5&q=GetModuleHandleA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetModuleHandleEx](https://www.google.com/search?num=5&q=GetModuleHandleExA+site%3Amicrosoft.com) | kernel32.dll | |
-[GetModuleInformation](https://www.google.com/search?num=5&q=GetModuleInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetNamedLocaleHashNode](https://www.google.com/search?num=5&q=GetNamedLocaleHashNode+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetNamedPipeAttribute](https://www.google.com/search?num=5&q=GetNamedPipeAttribute+site%3Amicrosoft.com) | kernel32.dll | |
+[GetModuleHandle](http://msdn2.microsoft.com/en-us/library/ms683199) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetModuleHandle
+[GetModuleHandleEx](http://msdn2.microsoft.com/en-us/library/ms683200) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetModuleHandleEx
+[GetModuleInformation](http://msdn2.microsoft.com/en-us/library/afb9f4c8-c8ae-4497-96c1-b559cfa2cedf) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetModuleInformation
[GetNamedPipeClientComputerName](http://msdn2.microsoft.com/en-us/library/aa365437) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeClientComputerName
-[GetNamedPipeClientProcessId](https://www.google.com/search?num=5&q=GetNamedPipeClientProcessId+site%3Amicrosoft.com) | kernel32.dll | |
-[GetNamedPipeClientSessionId](https://www.google.com/search?num=5&q=GetNamedPipeClientSessionId+site%3Amicrosoft.com) | kernel32.dll | |
+[GetNamedPipeClientProcessId](http://msdn2.microsoft.com/en-us/library/7001eb89-3d91-44e3-b245-b19e8ab5f9fe) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeClientProcessId
+[GetNamedPipeClientSessionId](http://msdn2.microsoft.com/en-us/library/b3ea0b7f-fead-4369-b87a-2f522a2a1984) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeClientSessionId
[GetNamedPipeHandleState](http://msdn2.microsoft.com/en-us/library/aa365443) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeHandleState
[GetNamedPipeInfo](http://msdn2.microsoft.com/en-us/library/aa365445) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeInfo
-[GetNamedPipeServerProcessId](https://www.google.com/search?num=5&q=GetNamedPipeServerProcessId+site%3Amicrosoft.com) | kernel32.dll | |
-[GetNamedPipeServerSessionId](https://www.google.com/search?num=5&q=GetNamedPipeServerSessionId+site%3Amicrosoft.com) | kernel32.dll | |
+[GetNamedPipeServerProcessId](http://msdn2.microsoft.com/en-us/library/1ee33a66-a71c-4c34-b907-aab7860294c4) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeServerProcessId
+[GetNamedPipeServerSessionId](http://msdn2.microsoft.com/en-us/library/cd628d6d-aa13-4762-893b-42f6cf7a2ba6) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNamedPipeServerSessionId
[GetNativeSystemInfo](http://msdn2.microsoft.com/en-us/library/ms724340) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetNativeSystemInfo
-[GetNextFgPolicyRefreshInfoInternal](https://www.google.com/search?num=5&q=GetNextFgPolicyRefreshInfoInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetNextUmsListItem](https://www.google.com/search?num=5&q=GetNextUmsListItem+site%3Amicrosoft.com) | kernel32.dll | |
-[GetNextVDMCommand](https://www.google.com/search?num=5&q=GetNextVDMCommand+site%3Amicrosoft.com) | kernel32.dll | |
[GetNLSVersion](http://msdn2.microsoft.com/en-us/library/dd318105) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetNLSVersion
[GetNLSVersionEx](http://msdn2.microsoft.com/en-us/library/dd318107) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetNLSVersionEx
[GetNumaAvailableMemoryNode](http://msdn2.microsoft.com/en-us/library/ms683202) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaAvailableMemoryNode
-[GetNumaAvailableMemoryNodeEx](https://www.google.com/search?num=5&q=GetNumaAvailableMemoryNodeEx+site%3Amicrosoft.com) | kernel32.dll | |
+[GetNumaAvailableMemoryNodeEx](http://msdn2.microsoft.com/en-us/library/59382114-f3da-45e0-843e-51c0fd52a164) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNumaAvailableMemoryNodeEx
[GetNumaHighestNodeNumber](http://msdn2.microsoft.com/en-us/library/ms683203) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaHighestNodeNumber
-[GetNumaNodeNumberFromHandle](https://www.google.com/search?num=5&q=GetNumaNodeNumberFromHandle+site%3Amicrosoft.com) | kernel32.dll | |
+[GetNumaNodeNumberFromHandle](http://msdn2.microsoft.com/en-us/library/7622f7c9-2dfc-4ab7-b3e9-48d483c6cc0e) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNumaNodeNumberFromHandle
[GetNumaNodeProcessorMask](http://msdn2.microsoft.com/en-us/library/ms683204) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaNodeProcessorMask
[GetNumaNodeProcessorMaskEx](http://msdn2.microsoft.com/en-us/library/dd405493) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaNodeProcessorMaskEx
[GetNumaProcessorNode](http://msdn2.microsoft.com/en-us/library/ms683205) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaProcessorNode
-[GetNumaProcessorNodeEx](https://www.google.com/search?num=5&q=GetNumaProcessorNodeEx+site%3Amicrosoft.com) | kernel32.dll | |
-[GetNumaProximityNode](https://www.google.com/search?num=5&q=GetNumaProximityNode+site%3Amicrosoft.com) | kernel32.dll | |
+[GetNumaProcessorNodeEx](http://msdn2.microsoft.com/en-us/library/6b843cd8-eeb5-4aa1-aad4-ce98916346b1) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNumaProcessorNodeEx
+[GetNumaProximityNode](http://msdn2.microsoft.com/en-us/library/9a2dbfe3-13e7-442d-a5f6-b2632878f618) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetNumaProximityNode
[GetNumaProximityNodeEx](http://msdn2.microsoft.com/en-us/library/dd405495) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetNumaProximityNodeEx
[GetNumberFormat](http://msdn2.microsoft.com/en-us/library/dd318110) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetNumberFormat
[GetNumberFormatEx](http://msdn2.microsoft.com/en-us/library/dd318113) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetNumberFormatEx
-[GetNumberOfConsoleFonts](https://www.google.com/search?num=5&q=GetNumberOfConsoleFonts+site%3Amicrosoft.com) | kernel32.dll | |
[GetNumberOfConsoleInputEvents](https://www.google.com/search?num=5&q=GetNumberOfConsoleInputEvents+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetNumberOfConsoleInputEvents
[GetNumberOfConsoleMouseButtons](https://www.google.com/search?num=5&q=GetNumberOfConsoleMouseButtons+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.GetNumberOfConsoleMouseButtons
[GetOEMCP](http://msdn2.microsoft.com/en-us/library/dd318114) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetOEMCP
@@ -671,61 +422,35 @@ Native Method | Native DLL | Header | Managed Method
[GetOsSafeBootMode](https://www.google.com/search?num=5&q=GetOsSafeBootMode+site%3Amicrosoft.com) | kernelbase.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetOsSafeBootMode
[GetOverlappedResult](http://msdn2.microsoft.com/en-us/library/ms683209) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetOverlappedResult
[GetOverlappedResultEx](http://msdn2.microsoft.com/en-us/library/hh448542) | kernel32.dll | Ioapiset.h | Vanara.PInvoke.Kernel32.GetOverlappedResultEx
-[GetPackageApplicationContext](https://www.google.com/search?num=5&q=GetPackageApplicationContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageApplicationIds](https://www.google.com/search?num=5&q=GetPackageApplicationIds+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageApplicationProperty](https://www.google.com/search?num=5&q=GetPackageApplicationProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageApplicationPropertyString](https://www.google.com/search?num=5&q=GetPackageApplicationPropertyString+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageApplicationResourcesContext](https://www.google.com/search?num=5&q=GetPackageApplicationResourcesContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageContext](https://www.google.com/search?num=5&q=GetPackageContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageFamilyName](https://www.google.com/search?num=5&q=GetPackageFamilyName+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageFamilyNameFromProgId](https://www.google.com/search?num=5&q=GetPackageFamilyNameFromProgId+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageFamilyNameFromToken](https://www.google.com/search?num=5&q=GetPackageFamilyNameFromToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageFullName](https://www.google.com/search?num=5&q=GetPackageFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageFullNameFromToken](https://www.google.com/search?num=5&q=GetPackageFullNameFromToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageId](https://www.google.com/search?num=5&q=GetPackageId+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageInfo](https://www.google.com/search?num=5&q=GetPackageInfo+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageInstallTime](https://www.google.com/search?num=5&q=GetPackageInstallTime+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageOSMaxVersionTested](https://www.google.com/search?num=5&q=GetPackageOSMaxVersionTested+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackagePath](https://www.google.com/search?num=5&q=GetPackagePath+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackagePathByFullName](https://www.google.com/search?num=5&q=GetPackagePathByFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackagePathOnVolume](https://www.google.com/search?num=5&q=GetPackagePathOnVolume+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageProperty](https://www.google.com/search?num=5&q=GetPackageProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackagePropertyString](https://www.google.com/search?num=5&q=GetPackagePropertyString+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageResourcesContext](https://www.google.com/search?num=5&q=GetPackageResourcesContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageResourcesProperty](https://www.google.com/search?num=5&q=GetPackageResourcesProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackagesByPackageFamily](https://www.google.com/search?num=5&q=GetPackagesByPackageFamily+site%3Amicrosoft.com) | kernel32.dll | |
-[GetPackageSecurityContext](https://www.google.com/search?num=5&q=GetPackageSecurityContext+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageSecurityProperty](https://www.google.com/search?num=5&q=GetPackageSecurityProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageStatus](https://www.google.com/search?num=5&q=GetPackageStatus+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageStatusForUser](https://www.google.com/search?num=5&q=GetPackageStatusForUser+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageStatusForUserSid](https://www.google.com/search?num=5&q=GetPackageStatusForUserSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageTargetPlatformProperty](https://www.google.com/search?num=5&q=GetPackageTargetPlatformProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPackageVolumeSisPath](https://www.google.com/search?num=5&q=GetPackageVolumeSisPath+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPerformanceInfo](https://www.google.com/search?num=5&q=GetPerformanceInfo+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetPackageApplicationIds](http://msdn2.microsoft.com/en-us/library/F08135F9-FF45-4309-84B5-77F4AFD7FC0C) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackageApplicationIds
+[GetPackageFamilyName](http://msdn2.microsoft.com/en-us/library/AC239898-9924-4193-9072-7A7EEC2D03E9) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackageFamilyName
+[GetPackageFamilyNameFromToken](http://msdn2.microsoft.com/en-us/library/C4FAF5DE-DF1F-4AFA-813B-5D80C786031B) | kernelbase.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackageFamilyNameFromToken
+[GetPackageFullNameFromToken](http://msdn2.microsoft.com/en-us/library/7B0D574E-A2F5-4D08-AEFB-9E040BBC729F) | kernelbase.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackageFullNameFromToken
+[GetPackageInfo](http://msdn2.microsoft.com/en-us/library/28F45B3B-A61F-44D3-B606-6966AD5866FA) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackageInfo
+[GetPackagePath](http://msdn2.microsoft.com/en-us/library/BDA0DD87-A36D-486B-BF89-EA5CC105C742) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackagePath
+[GetPackagePathByFullName](http://msdn2.microsoft.com/en-us/library/9C25708C-1464-4C59-9740-E9F105116385) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackagePathByFullName
+[GetPackagesByPackageFamily](http://msdn2.microsoft.com/en-us/library/C2163203-D654-4491-9090-0CC43F42EC35) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetPackagesByPackageFamily
+[GetPerformanceInfo](http://msdn2.microsoft.com/en-us/library/21655278-49da-4e63-a4f9-0ee9f6179f4a) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetPerformanceInfo
[GetPhysicallyInstalledSystemMemory](http://msdn2.microsoft.com/en-us/library/cc300158) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetPhysicallyInstalledSystemMemory
-[GetPreviousFgPolicyRefreshInfoInternal](https://www.google.com/search?num=5&q=GetPreviousFgPolicyRefreshInfoInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[GetPriorityClass](http://msdn2.microsoft.com/en-us/library/ms683211) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetPriorityClass
-[GetPrivateObjectSecurity](https://www.google.com/search?num=5&q=GetPrivateObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
[GetPrivateProfileInt](http://msdn2.microsoft.com/en-us/library/ms724345) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetPrivateProfileInt
[GetPrivateProfileSection](http://msdn2.microsoft.com/en-us/library/ms724348) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetPrivateProfileSection
[GetPrivateProfileSectionNames](http://msdn2.microsoft.com/en-us/library/ms724352) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetPrivateProfileSectionNames
[GetPrivateProfileString](http://msdn2.microsoft.com/en-us/library/ms724353) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetPrivateProfileString
[GetPrivateProfileStruct](http://msdn2.microsoft.com/en-us/library/ms724356) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetPrivateProfileStruct
[GetProcAddress](http://msdn2.microsoft.com/en-us/library/ms683212) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetProcAddress
-[GetProcAddressForCaller](https://www.google.com/search?num=5&q=GetProcAddressForCaller+site%3Amicrosoft.com) | kernelbase.dll | |
[GetProcessAffinityMask](http://msdn2.microsoft.com/en-us/library/ms683213) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessAffinityMask
[GetProcessDefaultCpuSets](http://msdn2.microsoft.com/en-us/library/mt186424) | kernel32.dll | Processthreadapi.h | Vanara.PInvoke.Kernel32.GetProcessDefaultCpuSets
-[GetProcessDEPPolicy](https://www.google.com/search?num=5&q=GetProcessDEPPolicy+site%3Amicrosoft.com) | kernel32.dll | |
+[GetProcessDEPPolicy](http://msdn2.microsoft.com/en-us/library/adf15b9c-24f4-49ea-9283-0db5f3f13e65) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetProcessDEPPolicy
[GetProcessGroupAffinity](http://msdn2.microsoft.com/en-us/library/dd405496) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessGroupAffinity
[GetProcessHandleCount](http://msdn2.microsoft.com/en-us/library/ms683214) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessHandleCount
[GetProcessHeap](http://msdn2.microsoft.com/en-us/library/aa366569) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.GetProcessHeap
[GetProcessHeaps](http://msdn2.microsoft.com/en-us/library/aa366571) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.GetProcessHeaps
[GetProcessId](http://msdn2.microsoft.com/en-us/library/ms683215) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessId
[GetProcessIdOfThread](http://msdn2.microsoft.com/en-us/library/ms683216) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessIdOfThread
-[GetProcessImageFileName](https://www.google.com/search?num=5&q=GetProcessImageFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetProcessImageFileName](http://msdn2.microsoft.com/en-us/library/819fc2f4-0801-417b-9cbb-d7fd2894634e) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetProcessImageFileName
[GetProcessInformation](http://msdn2.microsoft.com/en-us/library/hh448381) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessInformation
[GetProcessIoCounters](http://msdn2.microsoft.com/en-us/library/ms683218) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessIoCounters
-[GetProcessMemoryInfo](https://www.google.com/search?num=5&q=GetProcessMemoryInfo+site%3Amicrosoft.com) | kernelbase.dll | |
[GetProcessMitigationPolicy](http://msdn2.microsoft.com/en-us/library/hh769085) | kernel32.dll | Processthreadsapi.h | Vanara.PInvoke.Kernel32.GetProcessMitigationPolicy
[GetProcessorSystemCycleTime](http://msdn2.microsoft.com/en-us/library/dd405497) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetProcessorSystemCycleTime
[GetProcessPreferredUILanguages](http://msdn2.microsoft.com/en-us/library/dd318115) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetProcessPreferredUILanguages
@@ -739,57 +464,29 @@ Native Method | Native DLL | Header | Managed Method
[GetProfileInt](http://msdn2.microsoft.com/en-us/library/ms724360) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetProfileInt
[GetProfileSection](http://msdn2.microsoft.com/en-us/library/ms724363) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetProfileSection
[GetProfileString](http://msdn2.microsoft.com/en-us/library/ms724366) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetProfileString
-[GetProtocolAumid](https://www.google.com/search?num=5&q=GetProtocolAumid+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetProtocolProperty](https://www.google.com/search?num=5&q=GetProtocolProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPtrCalData](https://www.google.com/search?num=5&q=GetPtrCalData+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPtrCalDataArray](https://www.google.com/search?num=5&q=GetPtrCalDataArray+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPublisherCacheFolder](https://www.google.com/search?num=5&q=GetPublisherCacheFolder+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetPublisherRootFolder](https://www.google.com/search?num=5&q=GetPublisherRootFolder+site%3Amicrosoft.com) | kernelbase.dll | |
[GetQueuedCompletionStatus](http://msdn2.microsoft.com/en-us/library/aa364986) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetQueuedCompletionStatus
[GetQueuedCompletionStatusEx](http://msdn2.microsoft.com/en-us/library/aa364988) | kernel32.dll | IoAPI.h | Vanara.PInvoke.Kernel32.GetQueuedCompletionStatusEx
-[GetRegistryExtensionFlags](https://www.google.com/search?num=5&q=GetRegistryExtensionFlags+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetRoamingLastObservedChangeTime](https://www.google.com/search?num=5&q=GetRoamingLastObservedChangeTime+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSecureSystemAppDataFolder](https://www.google.com/search?num=5&q=GetSecureSystemAppDataFolder+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSerializedAtomBytes](https://www.google.com/search?num=5&q=GetSerializedAtomBytes+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSharedLocalFolder](https://www.google.com/search?num=5&q=GetSharedLocalFolder+site%3Amicrosoft.com) | kernelbase.dll | |
[GetShortPathName](http://msdn2.microsoft.com/en-us/library/aa364989) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetShortPathName
-[GetSidIdentifierAuthority](https://www.google.com/search?num=5&q=GetSidIdentifierAuthority+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSidLengthRequired](https://www.google.com/search?num=5&q=GetSidLengthRequired+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSidSubAuthority](https://www.google.com/search?num=5&q=GetSidSubAuthority+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSidSubAuthorityCount](https://www.google.com/search?num=5&q=GetSidSubAuthorityCount+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStagedPackageOrigin](https://www.google.com/search?num=5&q=GetStagedPackageOrigin+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStagedPackagePathByFullName](https://www.google.com/search?num=5&q=GetStagedPackagePathByFullName+site%3Amicrosoft.com) | kernel32.dll | |
+[GetStagedPackageOrigin](http://msdn2.microsoft.com/en-us/library/7A1EE2CA-83CE-4E03-85A5-0061E29EB49B) | kernelbase.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetStagedPackageOrigin
+[GetStagedPackagePathByFullName](http://msdn2.microsoft.com/en-us/library/F0A37D77-6262-44B1-BEC5-083E41BDE139) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.GetStagedPackagePathByFullName
[GetStartupInfo](http://msdn2.microsoft.com/en-us/library/ms683230) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetStartupInfo
-[GetStateContainerDepth](https://www.google.com/search?num=5&q=GetStateContainerDepth+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStateFolder](https://www.google.com/search?num=5&q=GetStateFolder+site%3Amicrosoft.com) | kernel32.dll | |
-[GetStateRootFolder](https://www.google.com/search?num=5&q=GetStateRootFolder+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStateRootFolderBase](https://www.google.com/search?num=5&q=GetStateRootFolderBase+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStateSettingsFolder](https://www.google.com/search?num=5&q=GetStateSettingsFolder+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetStateVersion](https://www.google.com/search?num=5&q=GetStateVersion+site%3Amicrosoft.com) | kernelbase.dll | |
[GetStdHandle](https://www.google.com/search?num=5&q=GetStdHandle+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetStdHandle
[GetStringScripts](http://msdn2.microsoft.com/en-us/library/dd318116) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetStringScripts
-[GetStringTableEntry](https://www.google.com/search?num=5&q=GetStringTableEntry+site%3Amicrosoft.com) | kernelbase.dll | |
[GetStringType](http://msdn2.microsoft.com/en-us/library/dd318117) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetStringTypeA
[GetStringTypeEx](http://msdn2.microsoft.com/en-us/library/dd318118) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetStringTypeEx
-[GetSystemAppDataFolder](https://www.google.com/search?num=5&q=GetSystemAppDataFolder+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSystemAppDataKey](https://www.google.com/search?num=5&q=GetSystemAppDataKey+site%3Amicrosoft.com) | kernel32.dll | |
[GetSystemCpuSetInformation](http://msdn2.microsoft.com/en-us/library/mt186425) | kernel32.dll | Processthreadapi.h | Vanara.PInvoke.Kernel32.GetSystemCpuSetInformation
[GetSystemDefaultLangID](http://msdn2.microsoft.com/en-us/library/dd318120) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetSystemDefaultLangID
[GetSystemDefaultLCID](http://msdn2.microsoft.com/en-us/library/dd318121) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetSystemDefaultLCID
[GetSystemDefaultLocaleName](http://msdn2.microsoft.com/en-us/library/dd318122) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetSystemDefaultLocaleName
[GetSystemDefaultUILanguage](http://msdn2.microsoft.com/en-us/library/dd318123) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetSystemDefaultUILanguage
-[GetSystemDEPPolicy](https://www.google.com/search?num=5&q=GetSystemDEPPolicy+site%3Amicrosoft.com) | kernel32.dll | |
+[GetSystemDEPPolicy](http://msdn2.microsoft.com/en-us/library/82cb1d4e-c0e5-4601-aa55-9171a106c286) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetSystemDEPPolicy
[GetSystemDirectory](http://msdn2.microsoft.com/en-us/library/ms724373) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemDirectory
[GetSystemFileCacheSize](http://msdn2.microsoft.com/en-us/library/aa965224) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetSystemFileCacheSize
[GetSystemFirmwareTable](http://msdn2.microsoft.com/en-us/library/ms724379) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemFirmwareTable
[GetSystemInfo](http://msdn2.microsoft.com/en-us/library/ms724381) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemInfo
-[GetSystemMetadataPath](https://www.google.com/search?num=5&q=GetSystemMetadataPath+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSystemMetadataPathForPackage](https://www.google.com/search?num=5&q=GetSystemMetadataPathForPackage+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetSystemMetadataPathForPackageFamily](https://www.google.com/search?num=5&q=GetSystemMetadataPathForPackageFamily+site%3Amicrosoft.com) | kernelbase.dll | |
[GetSystemPowerStatus](http://msdn2.microsoft.com/en-us/library/aa372693) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemPowerStatus
[GetSystemPreferredUILanguages](http://msdn2.microsoft.com/en-us/library/dd318124) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetSystemPreferredUILanguages
[GetSystemRegistryQuota](http://msdn2.microsoft.com/en-us/library/ms724387) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemRegistryQuota
-[GetSystemStateRootFolder](https://www.google.com/search?num=5&q=GetSystemStateRootFolder+site%3Amicrosoft.com) | kernelbase.dll | |
[GetSystemTime](http://msdn2.microsoft.com/en-us/library/ms724390) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemTime
[GetSystemTimeAdjustment](http://msdn2.microsoft.com/en-us/library/ms724394) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemTimeAdjustment
[GetSystemTimeAsFileTime](http://msdn2.microsoft.com/en-us/library/ms724397) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetSystemTimeAsFileTime
@@ -801,7 +498,6 @@ Native Method | Native DLL | Header | Managed Method
[GetTapeParameters](http://msdn2.microsoft.com/en-us/library/aa362526) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTapeParameters
[GetTapePosition](http://msdn2.microsoft.com/en-us/library/aa362528) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTapePosition
[GetTapeStatus](http://msdn2.microsoft.com/en-us/library/aa362530) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTapeStatus
-[GetTargetPlatformContext](https://www.google.com/search?num=5&q=GetTargetPlatformContext+site%3Amicrosoft.com) | kernelbase.dll | |
[GetTempFileName](http://msdn2.microsoft.com/en-us/library/aa364991) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetTempFileName
[GetTempPath](http://msdn2.microsoft.com/en-us/library/aa364992) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetTempPath
[GetThreadContext](http://msdn2.microsoft.com/en-us/library/ms679362) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetThreadContext
@@ -823,31 +519,18 @@ Native Method | Native DLL | Header | Managed Method
[GetTickCount](http://msdn2.microsoft.com/en-us/library/ms724408) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTickCount
[GetTickCount64](http://msdn2.microsoft.com/en-us/library/ms724411) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTickCount64
[GetTimeFormat](http://msdn2.microsoft.com/en-us/library/dd318130) | kernel32.dll | Datetimeapi.h | Vanara.PInvoke.Kernel32.GetTimeFormat
-[GetTimeFormatAWorker](https://www.google.com/search?num=5&q=GetTimeFormatAWorker+site%3Amicrosoft.com) | kernel32.dll | |
[GetTimeFormatEx](http://msdn2.microsoft.com/en-us/library/dd318131) | kernel32.dll | Datetimeapi.h | Vanara.PInvoke.Kernel32.GetTimeFormatEx
-[GetTimeFormatWWorker](https://www.google.com/search?num=5&q=GetTimeFormatWWorker+site%3Amicrosoft.com) | kernel32.dll | |
[GetTimeZoneInformation](http://msdn2.microsoft.com/en-us/library/ms724421) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTimeZoneInformation
[GetTimeZoneInformationForYear](http://msdn2.microsoft.com/en-us/library/bb540851) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetTimeZoneInformationForYear
-[GetTokenInformation](https://www.google.com/search?num=5&q=GetTokenInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetTraceEnableFlags](https://www.google.com/search?num=5&q=GetTraceEnableFlags+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetTraceEnableLevel](https://www.google.com/search?num=5&q=GetTraceEnableLevel+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetTraceLoggerHandle](https://www.google.com/search?num=5&q=GetTraceLoggerHandle+site%3Amicrosoft.com) | kernelbase.dll | |
[GetUILanguageInfo](http://msdn2.microsoft.com/en-us/library/dd318133) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUILanguageInfo
-[GetUmsCompletionListEvent](https://www.google.com/search?num=5&q=GetUmsCompletionListEvent+site%3Amicrosoft.com) | kernel32.dll | |
-[GetUmsSystemThreadInformation](https://www.google.com/search?num=5&q=GetUmsSystemThreadInformation+site%3Amicrosoft.com) | kernel32.dll | |
-[GetUnicodeStringToEightBitSizeRoutine](https://www.google.com/search?num=5&q=GetUnicodeStringToEightBitSizeRoutine+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetUnicodeStringToEightBitStringRoutine](https://www.google.com/search?num=5&q=GetUnicodeStringToEightBitStringRoutine+site%3Amicrosoft.com) | kernelbase.dll | |
+[GetUmsCompletionListEvent](http://msdn2.microsoft.com/en-us/library/393f6e0a-fbea-4aa0-9c18-f96da18e61e9) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetUmsCompletionListEvent
+[GetUmsSystemThreadInformation](http://msdn2.microsoft.com/en-us/library/7c8347b6-6546-4ea9-9b2a-11794782f482) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetUmsSystemThreadInformation
[GetUserDefaultLangID](http://msdn2.microsoft.com/en-us/library/dd318134) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserDefaultLangID
[GetUserDefaultLCID](http://msdn2.microsoft.com/en-us/library/dd318135) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserDefaultLCID
[GetUserDefaultLocaleName](http://msdn2.microsoft.com/en-us/library/dd318136) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserDefaultLocaleName
[GetUserDefaultUILanguage](http://msdn2.microsoft.com/en-us/library/dd318137) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserDefaultUILanguage
[GetUserGeoID](http://msdn2.microsoft.com/en-us/library/dd318138) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserGeoID
-[GetUserInfo](https://www.google.com/search?num=5&q=GetUserInfo+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetUserInfoWord](https://www.google.com/search?num=5&q=GetUserInfoWord+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetUserOverrideString](https://www.google.com/search?num=5&q=GetUserOverrideString+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetUserOverrideWord](https://www.google.com/search?num=5&q=GetUserOverrideWord+site%3Amicrosoft.com) | kernelbase.dll | |
[GetUserPreferredUILanguages](http://msdn2.microsoft.com/en-us/library/dd318139) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.GetUserPreferredUILanguages
-[GetVDMCurrentDirectories](https://www.google.com/search?num=5&q=GetVDMCurrentDirectories+site%3Amicrosoft.com) | kernel32.dll | |
[GetVersion](http://msdn2.microsoft.com/en-us/library/ms724439) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetVersion
[GetVersionEx](http://msdn2.microsoft.com/en-us/library/ms724451) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetVersionEx
[GetVolumeInformation](http://msdn2.microsoft.com/en-us/library/aa364993) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetVolumeInformation
@@ -855,12 +538,10 @@ Native Method | Native DLL | Header | Managed Method
[GetVolumeNameForVolumeMountPoint](http://msdn2.microsoft.com/en-us/library/aa364994) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetVolumeNameForVolumeMountPoint
[GetVolumePathName](http://msdn2.microsoft.com/en-us/library/aa364996) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetVolumePathName
[GetVolumePathNamesForVolumeName](http://msdn2.microsoft.com/en-us/library/aa364998) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.GetVolumePathNamesForVolumeName
-[GetWindowsAccountDomainSid](https://www.google.com/search?num=5&q=GetWindowsAccountDomainSid+site%3Amicrosoft.com) | kernelbase.dll | |
[GetWindowsDirectory](http://msdn2.microsoft.com/en-us/library/ms724454) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GetWindowsDirectory
[GetWriteWatch](http://msdn2.microsoft.com/en-us/library/aa366573) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GetWriteWatch
-[GetWsChanges](https://www.google.com/search?num=5&q=GetWsChanges+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetWsChangesEx](https://www.google.com/search?num=5&q=GetWsChangesEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[GetXStateFeaturesMask](https://www.google.com/search?num=5&q=GetXStateFeaturesMask+site%3Amicrosoft.com) | kernel32.dll | |
+[GetWsChanges](http://msdn2.microsoft.com/en-us/library/ace5106c-9c7b-4d5f-a69a-c3a8bff0bb2d) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.GetWsChanges
+[GetXStateFeaturesMask](http://msdn2.microsoft.com/en-us/library/D9A8D0B6-21E3-46B7-AB88-CE2FF4025A17) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.GetXStateFeaturesMask
[GlobalAddAtom](http://msdn2.microsoft.com/en-us/library/ms649060) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GlobalAddAtom
[GlobalAddAtomEx](http://msdn2.microsoft.com/en-us/library/dn764994) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.GlobalAddAtomEx
[GlobalAlloc](http://msdn2.microsoft.com/en-us/library/aa366574) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GlobalAlloc
@@ -876,13 +557,10 @@ Native Method | Native DLL | Header | Managed Method
[GlobalReAlloc](http://msdn2.microsoft.com/en-us/library/aa366590) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GlobalReAlloc
[GlobalSize](http://msdn2.microsoft.com/en-us/library/aa366593) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GlobalSize
[GlobalUnlock](http://msdn2.microsoft.com/en-us/library/aa366595) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.GlobalUnlock
-[GuardCheckLongJumpTarget](https://www.google.com/search?num=5&q=GuardCheckLongJumpTarget+site%3Amicrosoft.com) | kernelbase.dll | |
-[HashData](https://www.google.com/search?num=5&q=HashData+site%3Amicrosoft.com) | kernelbase.dll | |
-[HasPolicyForegroundProcessingCompletedInternal](https://www.google.com/search?num=5&q=HasPolicyForegroundProcessingCompletedInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[Heap32First](https://www.google.com/search?num=5&q=Heap32First+site%3Amicrosoft.com) | kernel32.dll | |
-[Heap32ListFirst](https://www.google.com/search?num=5&q=Heap32ListFirst+site%3Amicrosoft.com) | kernel32.dll | |
-[Heap32ListNext](https://www.google.com/search?num=5&q=Heap32ListNext+site%3Amicrosoft.com) | kernel32.dll | |
-[Heap32Next](https://www.google.com/search?num=5&q=Heap32Next+site%3Amicrosoft.com) | kernel32.dll | |
+[Heap32First](http://msdn2.microsoft.com/en-us/library/79d01e3a-b11b-46b5-99d0-b445000288a7) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Heap32First
+[Heap32ListFirst](http://msdn2.microsoft.com/en-us/library/b9a2992b-0dc1-41c3-aa23-796def674831) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Heap32ListFirst
+[Heap32ListNext](http://msdn2.microsoft.com/en-us/library/bb4d573c-a82f-48ac-be22-440d6a1d0c9c) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Heap32ListNext
+[Heap32Next](http://msdn2.microsoft.com/en-us/library/cc3becd0-edba-47cf-ac2d-26a5d98390e7) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Heap32Next
[HeapAlloc](http://msdn2.microsoft.com/en-us/library/aa366597) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapAlloc
[HeapCompact](http://msdn2.microsoft.com/en-us/library/aa366598) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapCompact
[HeapCreate](http://msdn2.microsoft.com/en-us/library/aa366599) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapCreate
@@ -897,29 +575,18 @@ Native Method | Native DLL | Header | Managed Method
[HeapUnlock](http://msdn2.microsoft.com/en-us/library/aa366707) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapUnlock
[HeapValidate](http://msdn2.microsoft.com/en-us/library/aa366708) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapValidate
[HeapWalk](http://msdn2.microsoft.com/en-us/library/aa366710) | kernel32.dll | HeapApi.h | Vanara.PInvoke.Kernel32.HeapWalk
-[hgets](https://www.google.com/search?num=5&q=hgets+site%3Amicrosoft.com) | kernelbase.dll | |
-[hwprintf](https://www.google.com/search?num=5&q=hwprintf+site%3Amicrosoft.com) | kernelbase.dll | |
[IdnToAscii](http://msdn2.microsoft.com/en-us/library/dd318149) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IdnToAscii
[IdnToNameprepUnicode](http://msdn2.microsoft.com/en-us/library/dd318150) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IdnToNameprepUnicode
[IdnToUnicode](http://msdn2.microsoft.com/en-us/library/dd318151) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IdnToUnicode
-[ImpersonateAnonymousToken](https://www.google.com/search?num=5&q=ImpersonateAnonymousToken+site%3Amicrosoft.com) | kernelbase.dll | |
-[ImpersonateLoggedOnUser](https://www.google.com/search?num=5&q=ImpersonateLoggedOnUser+site%3Amicrosoft.com) | kernelbase.dll | |
-[ImpersonateNamedPipeClient](https://www.google.com/search?num=5&q=ImpersonateNamedPipeClient+site%3Amicrosoft.com) | kernelbase.dll | |
-[ImpersonateSelf](https://www.google.com/search?num=5&q=ImpersonateSelf+site%3Amicrosoft.com) | kernelbase.dll | |
-[IncrementPackageStatusVersion](https://www.google.com/search?num=5&q=IncrementPackageStatusVersion+site%3Amicrosoft.com) | kernelbase.dll | |
[InitAtomTable](http://msdn2.microsoft.com/en-us/library/ms649064) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.InitAtomTable
-[InitializeAcl](https://www.google.com/search?num=5&q=InitializeAcl+site%3Amicrosoft.com) | kernelbase.dll | |
[InitializeConditionVariable](http://msdn2.microsoft.com/en-us/library/ms683469) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeConditionVariable
-[InitializeContext](https://www.google.com/search?num=5&q=InitializeContext+site%3Amicrosoft.com) | kernel32.dll | |
+[InitializeContext](http://msdn2.microsoft.com/en-us/library/909BF5F7-0622-4B22-A2EC-27722389700A) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.InitializeContext
[InitializeCriticalSection](http://msdn2.microsoft.com/en-us/library/ms683472) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeCriticalSection
[InitializeCriticalSectionAndSpinCount](http://msdn2.microsoft.com/en-us/library/ms683476) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeCriticalSectionAndSpinCount
[InitializeCriticalSectionEx](http://msdn2.microsoft.com/en-us/library/ms683477) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeCriticalSectionEx
[InitializeEnclave](http://msdn2.microsoft.com/en-us/library/mt592869) | kernel32.dll | Enclaveapi.h | Vanara.PInvoke.Kernel32.InitializeEnclave
-[InitializeProcessForWsWatch](https://www.google.com/search?num=5&q=InitializeProcessForWsWatch+site%3Amicrosoft.com) | kernelbase.dll | |
[InitializeProcThreadAttributeList](http://msdn2.microsoft.com/en-us/library/ms683481) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeProcThreadAttributeList
-[InitializeSecurityDescriptor](https://www.google.com/search?num=5&q=InitializeSecurityDescriptor+site%3Amicrosoft.com) | kernelbase.dll | |
-[InitializeSid](https://www.google.com/search?num=5&q=InitializeSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[InitializeSListHead](https://www.google.com/search?num=5&q=InitializeSListHead+site%3Amicrosoft.com) | kernel32.dll | |
+[InitializeSListHead](http://msdn2.microsoft.com/en-us/library/4e34f947-1687-4ea9-aaa1-8d8dc11dad70) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.InitializeSListHead
[InitializeSRWLock](http://msdn2.microsoft.com/en-us/library/ms683483) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitializeSRWLock
[InitializeSynchronizationBarrier](http://msdn2.microsoft.com/en-us/library/hh706890) | kernel32.dll | SynchAPI.h | Vanara.PInvoke.Kernel32.InitializeSynchronizationBarrier
[InitOnceBeginInitialize](http://msdn2.microsoft.com/en-us/library/ms683487) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitOnceBeginInitialize
@@ -927,93 +594,47 @@ Native Method | Native DLL | Header | Managed Method
[InitOnceExecuteOnce](http://msdn2.microsoft.com/en-us/library/ms683493) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitOnceExecuteOnce
[InitOnceInitialize](http://msdn2.microsoft.com/en-us/library/ms683495) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InitOnceInitialize
[InstallELAMCertificateInfo](http://msdn2.microsoft.com/en-us/library/dn369255) | kernel32.dll | Windows.h | Vanara.PInvoke.Kernel32.InstallELAMCertificateInfo
-[InterlockedFlushSList](https://www.google.com/search?num=5&q=InterlockedFlushSList+site%3Amicrosoft.com) | kernel32.dll | |
-[InterlockedPopEntrySList](https://www.google.com/search?num=5&q=InterlockedPopEntrySList+site%3Amicrosoft.com) | kernel32.dll | |
-[InterlockedPushEntrySList](https://www.google.com/search?num=5&q=InterlockedPushEntrySList+site%3Amicrosoft.com) | kernel32.dll | |
-[InterlockedPushListSList](https://www.google.com/search?num=5&q=InterlockedPushListSList+site%3Amicrosoft.com) | kernel32.dll | |
-[InterlockedPushListSListEx](https://www.google.com/search?num=5&q=InterlockedPushListSListEx+site%3Amicrosoft.com) | kernel32.dll | |
-[InternetTimeFromSystemTime](https://www.google.com/search?num=5&q=InternetTimeFromSystemTimeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[InternetTimeToSystemTime](https://www.google.com/search?num=5&q=InternetTimeToSystemTimeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[InvalidateAppModelVersionCache](https://www.google.com/search?num=5&q=InvalidateAppModelVersionCache+site%3Amicrosoft.com) | kernelbase.dll | |
-[InvalidateConsoleDIBits](https://www.google.com/search?num=5&q=InvalidateConsoleDIBits+site%3Amicrosoft.com) | kernel32.dll | |
+[InterlockedFlushSList](http://msdn2.microsoft.com/en-us/library/3fde3377-8a98-4976-a350-2c173b209e8c) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.InterlockedFlushSList
+[InterlockedPopEntrySList](http://msdn2.microsoft.com/en-us/library/10760fd4-5973-4ab0-991c-7a5951c798a4) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.InterlockedPopEntrySList
+[InterlockedPushEntrySList](http://msdn2.microsoft.com/en-us/library/60e3b6f7-f556-4699-be90-db7330cfb8ca) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.InterlockedPushEntrySList
+[InterlockedPushListSList](http://msdn2.microsoft.com/en-us/library/hh448545) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.InterlockedPushListSList
+[InterlockedPushListSListEx](http://msdn2.microsoft.com/en-us/library/f4f334c6-fda8-4c5f-9177-b672c8aed6b3) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.InterlockedPushListSListEx
[IsBadCodePtr](http://msdn2.microsoft.com/en-us/library/aa366712) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsBadCodePtr
[IsBadReadPtr](http://msdn2.microsoft.com/en-us/library/aa366713) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsBadReadPtr
[IsBadStringPtr](http://msdn2.microsoft.com/en-us/library/aa366714) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsBadStringPtr
[IsBadWritePtr](http://msdn2.microsoft.com/en-us/library/aa366716) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsBadWritePtr
-[IsCalendarLeapDay](https://www.google.com/search?num=5&q=IsCalendarLeapDay+site%3Amicrosoft.com) | kernel32.dll | |
-[IsCalendarLeapMonth](https://www.google.com/search?num=5&q=IsCalendarLeapMonth+site%3Amicrosoft.com) | kernel32.dll | |
-[IsCalendarLeapYear](https://www.google.com/search?num=5&q=IsCalendarLeapYear+site%3Amicrosoft.com) | kernel32.dll | |
-[IsCharAlpha](https://www.google.com/search?num=5&q=IsCharAlphaA+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharAlphaNumeric](https://www.google.com/search?num=5&q=IsCharAlphaNumericA+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharBlankW](https://www.google.com/search?num=5&q=IsCharBlankW+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharCntrlW](https://www.google.com/search?num=5&q=IsCharCntrlW+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharDigitW](https://www.google.com/search?num=5&q=IsCharDigitW+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharLower](https://www.google.com/search?num=5&q=IsCharLowerA+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharPunctW](https://www.google.com/search?num=5&q=IsCharPunctW+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharSpace](https://www.google.com/search?num=5&q=IsCharSpaceA+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharUpper](https://www.google.com/search?num=5&q=IsCharUpperA+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsCharXDigitW](https://www.google.com/search?num=5&q=IsCharXDigitW+site%3Amicrosoft.com) | kernelbase.dll | |
[IsDBCSLeadByte](http://msdn2.microsoft.com/en-us/library/dd318664) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsDBCSLeadByte
[IsDBCSLeadByteEx](http://msdn2.microsoft.com/en-us/library/dd318667) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsDBCSLeadByteEx
[IsDebuggerPresent](http://msdn2.microsoft.com/en-us/library/ms680345) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsDebuggerPresent
-[IsDeveloperModeEnabled](https://www.google.com/search?num=5&q=IsDeveloperModeEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsDeveloperModePolicyApplied](https://www.google.com/search?num=5&q=IsDeveloperModePolicyApplied+site%3Amicrosoft.com) | kernelbase.dll | |
[IsEnclaveTypeSupported](http://msdn2.microsoft.com/en-us/library/mt592870) | kernel32.dll | Enclaveapi.h | Vanara.PInvoke.Kernel32.IsEnclaveTypeSupported
-[IsGlobalizationUserSettingsKeyRedirected](https://www.google.com/search?num=5&q=IsGlobalizationUserSettingsKeyRedirected+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsInternetESCEnabled](https://www.google.com/search?num=5&q=IsInternetESCEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsNativeVhdBoot](https://www.google.com/search?num=5&q=IsNativeVhdBoot+site%3Amicrosoft.com) | kernel32.dll | |
+[IsNativeVhdBoot](http://msdn2.microsoft.com/en-us/library/8198D4AF-553D-42B3-AF22-EC2C63C0E9AE) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.IsNativeVhdBoot
[IsNLSDefinedString](http://msdn2.microsoft.com/en-us/library/dd318669) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsNLSDefinedString
[IsNormalizedString](http://msdn2.microsoft.com/en-us/library/dd318671) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsNormalizedString
-[IsOnDemandRegistrationSupportedForExtensionCategory](https://www.google.com/search?num=5&q=IsOnDemandRegistrationSupportedForExtensionCategory+site%3Amicrosoft.com) | kernelbase.dll | |
[IsProcessCritical](http://msdn2.microsoft.com/en-us/library/dn386160) | kernel32.dll | Processthreadsapi.h | Vanara.PInvoke.Kernel32.IsProcessCritical
[IsProcessInJob](http://msdn2.microsoft.com/en-us/library/ms684127) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsProcessInJob
[IsProcessorFeaturePresent](http://msdn2.microsoft.com/en-us/library/ms724482) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.IsProcessorFeaturePresent
-[IsSideloadingEnabled](https://www.google.com/search?num=5&q=IsSideloadingEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsSideloadingPolicyApplied](https://www.google.com/search?num=5&q=IsSideloadingPolicyApplied+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsSyncForegroundPolicyRefresh](https://www.google.com/search?num=5&q=IsSyncForegroundPolicyRefresh+site%3Amicrosoft.com) | kernelbase.dll | |
[IsSystemResumeAutomatic](http://msdn2.microsoft.com/en-us/library/aa372708) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.IsSystemResumeAutomatic
[IsThreadAFiber](http://msdn2.microsoft.com/en-us/library/ms684131) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsThreadAFiber
[IsThreadpoolTimerSet](http://msdn2.microsoft.com/en-us/library/ms684133) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsThreadpoolTimerSet
-[IsTimeZoneRedirectionEnabled](https://www.google.com/search?num=5&q=IsTimeZoneRedirectionEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsTokenRestricted](https://www.google.com/search?num=5&q=IsTokenRestricted+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsValidAcl](https://www.google.com/search?num=5&q=IsValidAcl+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsValidCalDateTime](https://www.google.com/search?num=5&q=IsValidCalDateTime+site%3Amicrosoft.com) | kernel32.dll | |
[IsValidCodePage](http://msdn2.microsoft.com/en-us/library/dd318674) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsValidCodePage
[IsValidLanguageGroup](http://msdn2.microsoft.com/en-us/library/dd318677) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsValidLanguageGroup
[IsValidLocale](http://msdn2.microsoft.com/en-us/library/dd318679) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsValidLocale
[IsValidLocaleName](http://msdn2.microsoft.com/en-us/library/dd318681) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsValidLocaleName
[IsValidNLSVersion](http://msdn2.microsoft.com/en-us/library/hh706739) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.IsValidNLSVersion
-[IsValidRelativeSecurityDescriptor](https://www.google.com/search?num=5&q=IsValidRelativeSecurityDescriptor+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsValidSecurityDescriptor](https://www.google.com/search?num=5&q=IsValidSecurityDescriptor+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsValidSid](https://www.google.com/search?num=5&q=IsValidSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[IsWellKnownSid](https://www.google.com/search?num=5&q=IsWellKnownSid+site%3Amicrosoft.com) | kernelbase.dll | |
[IsWow64Process](http://msdn2.microsoft.com/en-us/library/ms684139) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.IsWow64Process
[IsWow64Process2](http://msdn2.microsoft.com/en-us/library/mt804318) | kernelbase.dll | Wow64apiset.h | Vanara.PInvoke.Kernel32.IsWow64Process2
-[K32EnumPageFiles](https://www.google.com/search?num=5&q=K32EnumPageFilesA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetDeviceDriverBaseName](https://www.google.com/search?num=5&q=K32GetDeviceDriverBaseNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetDeviceDriverFileName](https://www.google.com/search?num=5&q=K32GetDeviceDriverFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetMappedFileName](https://www.google.com/search?num=5&q=K32GetMappedFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetModuleBaseName](https://www.google.com/search?num=5&q=K32GetModuleBaseNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetModuleFileNameEx](https://www.google.com/search?num=5&q=K32GetModuleFileNameExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[K32GetProcessImageFileName](https://www.google.com/search?num=5&q=K32GetProcessImageFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[KernelBaseGetGlobalData](https://www.google.com/search?num=5&q=KernelBaseGetGlobalData+site%3Amicrosoft.com) | kernelbase.dll | |
[LCIDToLocaleName](http://msdn2.microsoft.com/en-us/library/dd318698) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.LCIDToLocaleName
[LCMapString](http://msdn2.microsoft.com/en-us/library/dd318700) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.LCMapString
[LCMapStringEx](http://msdn2.microsoft.com/en-us/library/dd318702) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.LCMapStringEx
-[LeaveCriticalPolicySectionInternal](https://www.google.com/search?num=5&q=LeaveCriticalPolicySectionInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[LeaveCriticalSection](http://msdn2.microsoft.com/en-us/library/ms684169) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LeaveCriticalSection
[LeaveCriticalSectionWhenCallbackReturns](http://msdn2.microsoft.com/en-us/library/ms684171) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LeaveCriticalSectionWhenCallbackReturns
-[LoadAppInitDlls](https://www.google.com/search?num=5&q=LoadAppInitDlls+site%3Amicrosoft.com) | kernel32.dll | |
[LoadEnclaveData](http://msdn2.microsoft.com/en-us/library/mt592871) | kernel32.dll | Enclaveapi.h | Vanara.PInvoke.Kernel32.LoadEnclaveData
[LoadLibrary](http://msdn2.microsoft.com/en-us/library/ms684175) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.LoadLibrary
[LoadLibraryEx](http://msdn2.microsoft.com/en-us/library/ms684179) | kernel32.dll | LibLoaderAPI.h | Vanara.PInvoke.Kernel32.LoadLibraryEx
[LoadModule](http://msdn2.microsoft.com/en-us/library/ms684183) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.LoadModule
-[LoadPackagedLibrary](https://www.google.com/search?num=5&q=LoadPackagedLibrary+site%3Amicrosoft.com) | kernel32.dll | |
+[LoadPackagedLibrary](http://msdn2.microsoft.com/en-us/library/4a103753-a2c9-487f-b797-01d5f5d489f3) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.LoadPackagedLibrary
[LoadResource](http://msdn2.microsoft.com/en-us/library/ms648046) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.LoadResource
-[LoadString](https://www.google.com/search?num=5&q=LoadStringA+site%3Amicrosoft.com) | kernelbase.dll | |
-[LoadStringBaseExW](https://www.google.com/search?num=5&q=LoadStringBaseExW+site%3Amicrosoft.com) | kernel32.dll | |
-[LoadStringBaseW](https://www.google.com/search?num=5&q=LoadStringBaseW+site%3Amicrosoft.com) | kernel32.dll | |
-[LoadStringByReference](https://www.google.com/search?num=5&q=LoadStringByReference+site%3Amicrosoft.com) | kernelbase.dll | |
+[LoadStringByReference](http://msdn2.microsoft.com/en-us/library/4E0470ED-512F-4B76-A3E4-31C8B269CD5C) | kernelbase.dll | winnls.h | Vanara.PInvoke.Kernel32.LoadStringByReference
[LocalAlloc](http://msdn2.microsoft.com/en-us/library/aa366723) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LocalAlloc
[LocaleNameToLCID](http://msdn2.microsoft.com/en-us/library/dd318711) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.LocaleNameToLCID
[LocalFileTimeToFileTime](http://msdn2.microsoft.com/en-us/library/ms724490) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.LocalFileTimeToFileTime
@@ -1024,181 +645,81 @@ Native Method | Native DLL | Header | Managed Method
[LocalReAlloc](http://msdn2.microsoft.com/en-us/library/aa366742) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LocalReAlloc
[LocalSize](http://msdn2.microsoft.com/en-us/library/aa366745) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LocalSize
[LocalUnlock](http://msdn2.microsoft.com/en-us/library/aa366747) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.LocalUnlock
-[LocateXStateFeature](https://www.google.com/search?num=5&q=LocateXStateFeature+site%3Amicrosoft.com) | kernel32.dll | |
+[LocateXStateFeature](http://msdn2.microsoft.com/en-us/library/7AAEA13B-E4A4-4410-BFC7-09B81B92FF26) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.LocateXStateFeature
[LockFile](http://msdn2.microsoft.com/en-us/library/aa365202) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.LockFile
[LockFileEx](http://msdn2.microsoft.com/en-us/library/aa365203) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.LockFileEx
[LockResource](http://msdn2.microsoft.com/en-us/library/ms648047) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.LockResource
-[lstrcmp](https://www.google.com/search?num=5&q=lstrcmp+site%3Amicrosoft.com) | kernelbase.dll | |
-[lstrcmpi](https://www.google.com/search?num=5&q=lstrcmpi+site%3Amicrosoft.com) | kernelbase.dll | |
-[lstrcpyn](https://www.google.com/search?num=5&q=lstrcpyn+site%3Amicrosoft.com) | kernelbase.dll | |
+[lstrcmp](https://www.google.com/search?num=5&q=lstrcmp+site%3Amicrosoft.com) | kernelbase.dll | winbase.h | Vanara.PInvoke.Kernel32.lstrcmp
+[lstrcmpi](https://www.google.com/search?num=5&q=lstrcmpi+site%3Amicrosoft.com) | kernelbase.dll | winbase.h | Vanara.PInvoke.Kernel32.lstrcmpi
+[lstrcpyn](https://www.google.com/search?num=5&q=lstrcpyn+site%3Amicrosoft.com) | kernelbase.dll | winbase.h | Vanara.PInvoke.Kernel32.lstrcpyn
[lstrlen](https://www.google.com/search?num=5&q=lstrlen+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.lstrlen
-[MakeAbsoluteSD](https://www.google.com/search?num=5&q=MakeAbsoluteSD+site%3Amicrosoft.com) | kernelbase.dll | |
-[MakeAbsoluteSD2](https://www.google.com/search?num=5&q=MakeAbsoluteSD2+site%3Amicrosoft.com) | kernelbase.dll | |
-[MakeSelfRelativeSD](https://www.google.com/search?num=5&q=MakeSelfRelativeSD+site%3Amicrosoft.com) | kernelbase.dll | |
-[MapGenericMask](https://www.google.com/search?num=5&q=MapGenericMask+site%3Amicrosoft.com) | kernelbase.dll | |
-[MapPredefinedHandleInternal](https://www.google.com/search?num=5&q=MapPredefinedHandleInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[MapUserPhysicalPages](http://msdn2.microsoft.com/en-us/library/aa366753) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MapUserPhysicalPages
[MapUserPhysicalPagesScatter](http://msdn2.microsoft.com/en-us/library/aa366755) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MapUserPhysicalPagesScatter
[MapViewOfFile](http://msdn2.microsoft.com/en-us/library/aa366761) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MapViewOfFile
[MapViewOfFileEx](http://msdn2.microsoft.com/en-us/library/aa366763) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MapViewOfFileEx
-[MapViewOfFileExNuma](https://www.google.com/search?num=5&q=MapViewOfFileExNuma+site%3Amicrosoft.com) | kernel32.dll | |
+[MapViewOfFileExNuma](http://msdn2.microsoft.com/en-us/library/1e28c8db-112d-481d-b470-8ca618e125ce) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.MapViewOfFileExNuma
[MapViewOfFileFromApp](http://msdn2.microsoft.com/en-us/library/hh994454) | kernel32.dll | MemoryApi.h | Vanara.PInvoke.Kernel32.MapViewOfFileFromApp
[MapViewOfFileNuma2](http://msdn2.microsoft.com/en-us/library/mt492558) | kernelbase.dll | WinBase.h | Vanara.PInvoke.Kernel32.MapViewOfFileNuma2
-[Module32First](https://www.google.com/search?num=5&q=Module32First+site%3Amicrosoft.com) | kernel32.dll | |
-[Module32Next](https://www.google.com/search?num=5&q=Module32Next+site%3Amicrosoft.com) | kernel32.dll | |
+[Module32First](http://msdn2.microsoft.com/en-us/library/bb41cab9-13a1-469d-bf76-68c172e982f6) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Module32First
+[Module32Next](https://www.google.com/search?num=5&q=Module32Next+site%3Amicrosoft.com) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Module32Next
[MoveFile](http://msdn2.microsoft.com/en-us/library/aa365239) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MoveFile
[MoveFileEx](http://msdn2.microsoft.com/en-us/library/aa365240) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MoveFileEx
[MoveFileTransacted](https://www.google.com/search?num=5&q=MoveFileTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
[MoveFileWithProgress](http://msdn2.microsoft.com/en-us/library/aa365242) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MoveFileWithProgress
-[MoveFileWithProgressTransactedW](https://www.google.com/search?num=5&q=MoveFileWithProgressTransactedW+site%3Amicrosoft.com) | kernelbase.dll | |
[MulDiv](http://msdn2.microsoft.com/en-us/library/aa383718) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.MulDiv
[MultiByteToWideChar](http://msdn2.microsoft.com/en-us/library/dd319072) | kernel32.dll | Stringapiset.h | Vanara.PInvoke.Kernel32.MultiByteToWideChar
-[NamedPipeEventEnum](https://www.google.com/search?num=5&q=NamedPipeEventEnum+site%3Amicrosoft.com) | kernelbase.dll | |
-[NamedPipeEventSelect](https://www.google.com/search?num=5&q=NamedPipeEventSelect+site%3Amicrosoft.com) | kernelbase.dll | |
[NeedCurrentDirectoryForExePath](http://msdn2.microsoft.com/en-us/library/ms684269) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.NeedCurrentDirectoryForExePath
-[NlsCheckPolicy](https://www.google.com/search?num=5&q=NlsCheckPolicy+site%3Amicrosoft.com) | kernelbase.dll | |
-[NlsEventDataDescCreate](https://www.google.com/search?num=5&q=NlsEventDataDescCreate+site%3Amicrosoft.com) | kernelbase.dll | |
-[NlsGetCacheUpdateCount](https://www.google.com/search?num=5&q=NlsGetCacheUpdateCount+site%3Amicrosoft.com) | kernelbase.dll | |
-[NlsUpdateLocale](https://www.google.com/search?num=5&q=NlsUpdateLocale+site%3Amicrosoft.com) | kernelbase.dll | |
-[NlsUpdateSystemLocale](https://www.google.com/search?num=5&q=NlsUpdateSystemLocale+site%3Amicrosoft.com) | kernelbase.dll | |
-[NlsWriteEtwEvent](https://www.google.com/search?num=5&q=NlsWriteEtwEvent+site%3Amicrosoft.com) | kernelbase.dll | |
[NormalizeString](http://msdn2.microsoft.com/en-us/library/dd319093) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.NormalizeString
-[NotifyMountMgr](https://www.google.com/search?num=5&q=NotifyMountMgr+site%3Amicrosoft.com) | kernel32.dll | |
-[NotifyRedirectedStringChange](https://www.google.com/search?num=5&q=NotifyRedirectedStringChange+site%3Amicrosoft.com) | kernelbase.dll | |
-[ObjectCloseAuditAlarmW](https://www.google.com/search?num=5&q=ObjectCloseAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[ObjectDeleteAuditAlarmW](https://www.google.com/search?num=5&q=ObjectDeleteAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[ObjectOpenAuditAlarmW](https://www.google.com/search?num=5&q=ObjectOpenAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[ObjectPrivilegeAuditAlarmW](https://www.google.com/search?num=5&q=ObjectPrivilegeAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
[OfferVirtualMemory](http://msdn2.microsoft.com/en-us/library/dn781436) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OfferVirtualMemory
-[OOBEComplete](https://www.google.com/search?num=5&q=OOBEComplete+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenConsoleW](https://www.google.com/search?num=5&q=OpenConsoleW+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenConsoleWStub](https://www.google.com/search?num=5&q=OpenConsoleWStub+site%3Amicrosoft.com) | kernel32.dll | |
[OpenEvent](http://msdn2.microsoft.com/en-us/library/ms684305) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenEvent
[OpenFile](http://msdn2.microsoft.com/en-us/library/aa365430) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenFile
-[OpenFileById](https://www.google.com/search?num=5&q=OpenFileById+site%3Amicrosoft.com) | kernel32.dll | |
+[OpenFileById](http://msdn2.microsoft.com/en-us/library/caa757a2-fc3f-4883-8d3e-b98d28f92517) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.OpenFileById
[OpenFileMapping](http://msdn2.microsoft.com/en-us/library/aa366791) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenFileMapping
[OpenFileMappingFromApp](http://msdn2.microsoft.com/en-us/library/mt169844) | kernelbase.dll | MemoryApi.h | Vanara.PInvoke.Kernel32.OpenFileMappingFromApp
-[OpenGlobalizationUserSettingsKey](https://www.google.com/search?num=5&q=OpenGlobalizationUserSettingsKey+site%3Amicrosoft.com) | kernelbase.dll | |
[OpenJobObject](http://msdn2.microsoft.com/en-us/library/ms684312) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenJobObject
[OpenMutex](http://msdn2.microsoft.com/en-us/library/ms684315) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenMutex
-[OpenPackageInfoByFullName](https://www.google.com/search?num=5&q=OpenPackageInfoByFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenPackageInfoByFullNameForUser](https://www.google.com/search?num=5&q=OpenPackageInfoByFullNameForUser+site%3Amicrosoft.com) | kernelbase.dll | |
+[OpenPackageInfoByFullName](http://msdn2.microsoft.com/en-us/library/9ECFC757-1CB3-43A1-BA45-9AF72CAB240E) | kernelbase.dll | appmodel.h | Vanara.PInvoke.Kernel32.OpenPackageInfoByFullName
[OpenPrivateNamespace](http://msdn2.microsoft.com/en-us/library/ms684318) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenPrivateNamespace
[OpenProcess](http://msdn2.microsoft.com/en-us/library/ms684320) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenProcess
-[OpenProcessToken](https://www.google.com/search?num=5&q=OpenProcessToken+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenProfileUserMapping](https://www.google.com/search?num=5&q=OpenProfileUserMapping+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenRegKey](https://www.google.com/search?num=5&q=OpenRegKey+site%3Amicrosoft.com) | kernelbase.dll | |
[OpenSemaphore](http://msdn2.microsoft.com/en-us/library/ms684326) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenSemaphore
-[OpenState](https://www.google.com/search?num=5&q=OpenState+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenStateAtom](https://www.google.com/search?num=5&q=OpenStateAtom+site%3Amicrosoft.com) | kernelbase.dll | |
-[OpenStateExplicit](https://www.google.com/search?num=5&q=OpenStateExplicit+site%3Amicrosoft.com) | kernel32.dll | |
-[OpenStateExplicitForUserSid](https://www.google.com/search?num=5&q=OpenStateExplicitForUserSid+site%3Amicrosoft.com) | kernelbase.dll | |
-[OpenStateExplicitForUserSidString](https://www.google.com/search?num=5&q=OpenStateExplicitForUserSidString+site%3Amicrosoft.com) | kernelbase.dll | |
[OpenThread](http://msdn2.microsoft.com/en-us/library/ms684335) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenThread
-[OpenThreadToken](https://www.google.com/search?num=5&q=OpenThreadToken+site%3Amicrosoft.com) | kernel32.dll | |
[OpenWaitableTimer](http://msdn2.microsoft.com/en-us/library/ms684337) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OpenWaitableTimer
[OutputDebugString](http://msdn2.microsoft.com/en-us/library/aa363362) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.OutputDebugString
-[OverrideRoamingDataModificationTimesInRange](https://www.google.com/search?num=5&q=OverrideRoamingDataModificationTimesInRange+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageFamilyNameFromFullName](https://www.google.com/search?num=5&q=PackageFamilyNameFromFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[PackageFamilyNameFromId](https://www.google.com/search?num=5&q=PackageFamilyNameFromId+site%3Amicrosoft.com) | kernel32.dll | |
-[PackageFamilyNameFromProductId](https://www.google.com/search?num=5&q=PackageFamilyNameFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageFullNameFromId](https://www.google.com/search?num=5&q=PackageFullNameFromId+site%3Amicrosoft.com) | kernel32.dll | |
-[PackageFullNameFromProductId](https://www.google.com/search?num=5&q=PackageFullNameFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageIdFromFullName](https://www.google.com/search?num=5&q=PackageIdFromFullName+site%3Amicrosoft.com) | kernel32.dll | |
-[PackageIdFromProductId](https://www.google.com/search?num=5&q=PackageIdFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageNameAndPublisherIdFromFamilyName](https://www.google.com/search?num=5&q=PackageNameAndPublisherIdFromFamilyName+site%3Amicrosoft.com) | kernel32.dll | |
-[PackageRelativeApplicationIdFromProductId](https://www.google.com/search?num=5&q=PackageRelativeApplicationIdFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageSidFromFamilyName](https://www.google.com/search?num=5&q=PackageSidFromFamilyName+site%3Amicrosoft.com) | kernelbase.dll | |
-[PackageSidFromProductId](https://www.google.com/search?num=5&q=PackageSidFromProductId+site%3Amicrosoft.com) | kernelbase.dll | |
-[ParseApplicationUserModelId](https://www.google.com/search?num=5&q=ParseApplicationUserModelId+site%3Amicrosoft.com) | kernel32.dll | |
-[ParseURL](https://www.google.com/search?num=5&q=ParseURLA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathAddBackslash](https://www.google.com/search?num=5&q=PathAddBackslashA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathAddExtension](https://www.google.com/search?num=5&q=PathAddExtensionA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathAllocCanonicalize](https://www.google.com/search?num=5&q=PathAllocCanonicalize+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathAllocCombine](https://www.google.com/search?num=5&q=PathAllocCombine+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathAppend](https://www.google.com/search?num=5&q=PathAppendA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathCanonicalize](https://www.google.com/search?num=5&q=PathCanonicalizeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathCombine](https://www.google.com/search?num=5&q=PathCombineA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathCommonPrefix](https://www.google.com/search?num=5&q=PathCommonPrefixA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathCreateFromUrl](https://www.google.com/search?num=5&q=PathCreateFromUrlA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathCreateFromUrlAlloc](https://www.google.com/search?num=5&q=PathCreateFromUrlAlloc+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathFileExists](https://www.google.com/search?num=5&q=PathFileExistsA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathFindExtension](https://www.google.com/search?num=5&q=PathFindExtensionA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathFindFileName](https://www.google.com/search?num=5&q=PathFindFileNameA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathFindNextComponent](https://www.google.com/search?num=5&q=PathFindNextComponentA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathGetArgs](https://www.google.com/search?num=5&q=PathGetArgsA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathGetCharType](https://www.google.com/search?num=5&q=PathGetCharTypeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathGetDriveNumber](https://www.google.com/search?num=5&q=PathGetDriveNumberA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsFileSpec](https://www.google.com/search?num=5&q=PathIsFileSpecA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsLFNFileSpec](https://www.google.com/search?num=5&q=PathIsLFNFileSpecA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsPrefix](https://www.google.com/search?num=5&q=PathIsPrefixA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsRelative](https://www.google.com/search?num=5&q=PathIsRelativeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsRoot](https://www.google.com/search?num=5&q=PathIsRootA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsSameRoot](https://www.google.com/search?num=5&q=PathIsSameRootA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsUNC](https://www.google.com/search?num=5&q=PathIsUNCA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsUNCEx](https://www.google.com/search?num=5&q=PathIsUNCEx+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsUNCServer](https://www.google.com/search?num=5&q=PathIsUNCServerA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsUNCServerShare](https://www.google.com/search?num=5&q=PathIsUNCServerShareA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsURL](https://www.google.com/search?num=5&q=PathIsURLA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathIsValidChar](https://www.google.com/search?num=5&q=PathIsValidCharA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathMatchSpec](https://www.google.com/search?num=5&q=PathMatchSpecA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathMatchSpecEx](https://www.google.com/search?num=5&q=PathMatchSpecExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathParseIconLocation](https://www.google.com/search?num=5&q=PathParseIconLocationA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathQuoteSpaces](https://www.google.com/search?num=5&q=PathQuoteSpacesA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRelativePathTo](https://www.google.com/search?num=5&q=PathRelativePathToA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRemoveBackslash](https://www.google.com/search?num=5&q=PathRemoveBackslashA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRemoveBlanks](https://www.google.com/search?num=5&q=PathRemoveBlanksA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRemoveExtension](https://www.google.com/search?num=5&q=PathRemoveExtensionA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRemoveFileSpec](https://www.google.com/search?num=5&q=PathRemoveFileSpecA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathRenameExtension](https://www.google.com/search?num=5&q=PathRenameExtensionA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathSearchAndQualify](https://www.google.com/search?num=5&q=PathSearchAndQualifyA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathSkipRoot](https://www.google.com/search?num=5&q=PathSkipRootA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathStripPath](https://www.google.com/search?num=5&q=PathStripPathA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathStripToRoot](https://www.google.com/search?num=5&q=PathStripToRootA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathUnExpandEnvStrings](https://www.google.com/search?num=5&q=PathUnExpandEnvStringsA+site%3Amicrosoft.com) | kernelbase.dll | |
-[PathUnquoteSpaces](https://www.google.com/search?num=5&q=PathUnquoteSpacesA+site%3Amicrosoft.com) | kernelbase.dll | |
+[PackageFamilyNameFromFullName](http://msdn2.microsoft.com/en-us/library/98E95CE5-E970-4A19-BAD3-994DAEC4BEA0) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.PackageFamilyNameFromFullName
+[PackageFamilyNameFromId](http://msdn2.microsoft.com/en-us/library/198DAB6B-21D2-4ACB-87DF-B3F4EFBEE323) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.PackageFamilyNameFromId
+[PackageFullNameFromId](http://msdn2.microsoft.com/en-us/library/0024AF55-295E-49B1-90C2-9144D336529B) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.PackageFullNameFromId
+[PackageIdFromFullName](http://msdn2.microsoft.com/en-us/library/EED832F8-E4F7-4A0F-93E2-451F78F67767) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.PackageIdFromFullName
+[PackageNameAndPublisherIdFromFamilyName](http://msdn2.microsoft.com/en-us/library/4AA5BD75-F865-40D6-9C10-E54C197D47C4) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.PackageNameAndPublisherIdFromFamilyName
+[ParseApplicationUserModelId](http://msdn2.microsoft.com/en-us/library/03B29E82-611F-47D1-8CB6-047B9BEB4D9E) | kernel32.dll | appmodel.h | Vanara.PInvoke.Kernel32.ParseApplicationUserModelId
[PeekConsoleInput](https://www.google.com/search?num=5&q=PeekConsoleInputA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.PeekConsoleInput
[PeekNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365779) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.PeekNamedPipe
-[PoolPerAppKeyStateInternal](https://www.google.com/search?num=5&q=PoolPerAppKeyStateInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[PostQueuedCompletionStatus](http://msdn2.microsoft.com/en-us/library/aa365458) | kernel32.dll | IoAPI.h | Vanara.PInvoke.Kernel32.PostQueuedCompletionStatus
-[PowerClearRequest](https://www.google.com/search?num=5&q=PowerClearRequest+site%3Amicrosoft.com) | kernel32.dll | |
-[PowerCreateRequest](https://www.google.com/search?num=5&q=PowerCreateRequest+site%3Amicrosoft.com) | kernel32.dll | |
-[PowerSetRequest](https://www.google.com/search?num=5&q=PowerSetRequest+site%3Amicrosoft.com) | kernel32.dll | |
+[PowerClearRequest](http://msdn2.microsoft.com/en-us/library/794248b1-5aa8-495e-aca6-1a1f35dc9c7f) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.PowerClearRequest
+[PowerCreateRequest](http://msdn2.microsoft.com/en-us/library/2122bf00-9e6b-48ab-89b0-f53dd6804902) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.PowerCreateRequest
+[PowerSetRequest](http://msdn2.microsoft.com/en-us/library/85249de8-5832-4f25-bbd9-3576cfd1caa0) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.PowerSetRequest
[PrefetchVirtualMemory](http://msdn2.microsoft.com/en-us/library/hh780543) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.PrefetchVirtualMemory
[PrepareTape](http://msdn2.microsoft.com/en-us/library/aa362532) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.PrepareTape
-[PrivCopyFileExW](https://www.google.com/search?num=5&q=PrivCopyFileExW+site%3Amicrosoft.com) | kernel32.dll | |
-[PrivilegeCheck](https://www.google.com/search?num=5&q=PrivilegeCheck+site%3Amicrosoft.com) | kernelbase.dll | |
-[PrivilegedServiceAuditAlarmW](https://www.google.com/search?num=5&q=PrivilegedServiceAuditAlarmW+site%3Amicrosoft.com) | kernelbase.dll | |
-[PrivMoveFileIdentityW](https://www.google.com/search?num=5&q=PrivMoveFileIdentityW+site%3Amicrosoft.com) | kernel32.dll | |
-[Process32First](https://www.google.com/search?num=5&q=Process32First+site%3Amicrosoft.com) | kernel32.dll | |
-[Process32Next](https://www.google.com/search?num=5&q=Process32Next+site%3Amicrosoft.com) | kernel32.dll | |
+[Process32First](https://www.google.com/search?num=5&q=Process32First+site%3Amicrosoft.com) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Process32First
+[Process32Next](https://www.google.com/search?num=5&q=Process32Next+site%3Amicrosoft.com) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Process32Next
[ProcessIdToSessionId](http://msdn2.microsoft.com/en-us/library/aa382990) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ProcessIdToSessionId
-[ProductIdFromPackageFamilyName](https://www.google.com/search?num=5&q=ProductIdFromPackageFamilyName+site%3Amicrosoft.com) | kernelbase.dll | |
-[PssCaptureSnapshot](https://www.google.com/search?num=5&q=PssCaptureSnapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[PssDuplicateSnapshot](https://www.google.com/search?num=5&q=PssDuplicateSnapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[PssFreeSnapshot](https://www.google.com/search?num=5&q=PssFreeSnapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[PssQuerySnapshot](https://www.google.com/search?num=5&q=PssQuerySnapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerCreate](https://www.google.com/search?num=5&q=PssWalkMarkerCreate+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerFree](https://www.google.com/search?num=5&q=PssWalkMarkerFree+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerGetPosition](https://www.google.com/search?num=5&q=PssWalkMarkerGetPosition+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerRewind](https://www.google.com/search?num=5&q=PssWalkMarkerRewind+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerSeek](https://www.google.com/search?num=5&q=PssWalkMarkerSeek+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerSeekToBeginning](https://www.google.com/search?num=5&q=PssWalkMarkerSeekToBeginning+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerSetPosition](https://www.google.com/search?num=5&q=PssWalkMarkerSetPosition+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkMarkerTell](https://www.google.com/search?num=5&q=PssWalkMarkerTell+site%3Amicrosoft.com) | kernel32.dll | |
-[PssWalkSnapshot](https://www.google.com/search?num=5&q=PssWalkSnapshot+site%3Amicrosoft.com) | kernel32.dll | |
-[PublishStateChangeNotification](https://www.google.com/search?num=5&q=PublishStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
+[PssCaptureSnapshot](http://msdn2.microsoft.com/en-us/library/44F2CB48-A9F6-4131-B21C-9F27A27CECD5) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssCaptureSnapshot
+[PssDuplicateSnapshot](http://msdn2.microsoft.com/en-us/library/5D2751F3-E7E1-4917-8060-E2BC8A7A3DEA) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssDuplicateSnapshot
+[PssFreeSnapshot](http://msdn2.microsoft.com/en-us/library/5D062AE6-2F7C-4121-AB6E-9BFA06AB36C6) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssFreeSnapshot
+[PssQuerySnapshot](http://msdn2.microsoft.com/en-us/library/D9580147-28ED-4FF5-B7DB-844ACB19769F) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssQuerySnapshot
+[PssWalkMarkerCreate](http://msdn2.microsoft.com/en-us/library/58E2FBAF-661C-45BE-A25A-A096AF52ED3E) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkMarkerCreate
+[PssWalkMarkerFree](http://msdn2.microsoft.com/en-us/library/74158846-6A5F-4F81-B4D7-46DED1EE017C) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkMarkerFree
+[PssWalkMarkerGetPosition](http://msdn2.microsoft.com/en-us/library/A2058E81-2B01-4436-ACC6-2A3E58BC4E27) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkMarkerGetPosition
+[PssWalkMarkerSeekToBeginning](http://msdn2.microsoft.com/en-us/library/BE0FA122-3966-4827-9DA3-A98A162EF270) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkMarkerSeekToBeginning
+[PssWalkMarkerSetPosition](http://msdn2.microsoft.com/en-us/library/D89EA4DB-D8C6-43D1-B292-D24F1EAB2E43) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkMarkerSetPosition
+[PssWalkSnapshot](http://msdn2.microsoft.com/en-us/library/C6AC38B5-0A1C-44D7-A1F6-8196AE9B8FB0) | kernel32.dll | processsnapshot.h | Vanara.PInvoke.Kernel32.PssWalkSnapshot
[PulseEvent](http://msdn2.microsoft.com/en-us/library/ms684914) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.PulseEvent
[PurgeComm](http://msdn2.microsoft.com/en-us/library/aa363428) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.PurgeComm
-[QISearch](https://www.google.com/search?num=5&q=QISearch+site%3Amicrosoft.com) | kernelbase.dll | |
[QueryActCtxSettingsW](http://msdn2.microsoft.com/en-us/library/aa375700) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryActCtxSettingsW
-[QueryActCtxSettingsWWorker](https://www.google.com/search?num=5&q=QueryActCtxSettingsWWorker+site%3Amicrosoft.com) | kernel32.dll | |
[QueryActCtxW](http://msdn2.microsoft.com/en-us/library/aa375704) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryActCtxW
-[QueryActCtxWWorker](https://www.google.com/search?num=5&q=QueryActCtxWWorker+site%3Amicrosoft.com) | kernel32.dll | |
[QueryAuxiliaryCounterFrequency](http://msdn2.microsoft.com/en-us/library/mt781218) | kernelbase.dll | Realtimeapiset.h | Vanara.PInvoke.Kernel32.QueryAuxiliaryCounterFrequency
-[QueryDepthSList](https://www.google.com/search?num=5&q=QueryDepthSList+site%3Amicrosoft.com) | kernel32.dll | |
+[QueryDepthSList](http://msdn2.microsoft.com/en-us/library/3f9b4481-647f-457f-bdfb-62e6ae4198e5) | kernel32.dll | interlockedapi.h | Vanara.PInvoke.Kernel32.QueryDepthSList
[QueryDosDevice](http://msdn2.microsoft.com/en-us/library/aa365461) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.QueryDosDevice
-[QueryFullProcessImageName](https://www.google.com/search?num=5&q=QueryFullProcessImageNameA+site%3Amicrosoft.com) | kernel32.dll | |
+[QueryFullProcessImageName](http://msdn2.microsoft.com/en-us/library/49a9d1aa-30f3-45ea-a4ec-9f55df692b8b) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.QueryFullProcessImageName
[QueryIdleProcessorCycleTime](http://msdn2.microsoft.com/en-us/library/ms684922) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryIdleProcessorCycleTime
[QueryIdleProcessorCycleTimeEx](http://msdn2.microsoft.com/en-us/library/dd405507) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryIdleProcessorCycleTimeEx
[QueryInformationJobObject](http://msdn2.microsoft.com/en-us/library/ms684925) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryInformationJobObject
@@ -1206,33 +727,27 @@ Native Method | Native DLL | Header | Managed Method
[QueryInterruptTimePrecise](http://msdn2.microsoft.com/en-us/library/dn903660) | kernelbase.dll | Realtimeapiset.h | Vanara.PInvoke.Kernel32.QueryInterruptTimePrecise
[QueryIoRateControlInformationJobObject](http://msdn2.microsoft.com/en-us/library/mt280127) | kernel32.dll | Jobapi2.h | Vanara.PInvoke.Kernel32.QueryIoRateControlInformationJobObject
[QueryMemoryResourceNotification](http://msdn2.microsoft.com/en-us/library/aa366799) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryMemoryResourceNotification
-[QueryOptionalDelayLoadedAPI](https://www.google.com/search?num=5&q=QueryOptionalDelayLoadedAPI+site%3Amicrosoft.com) | kernelbase.dll | |
+[QueryOptionalDelayLoadedAPI](http://msdn2.microsoft.com/en-us/library/43690689-4372-48ae-ac6d-230250f05f7c) | kernelbase.dll | libloaderapi2.h | Vanara.PInvoke.Kernel32.QueryOptionalDelayLoadedAPI
[QueryPerformanceCounter](http://msdn2.microsoft.com/en-us/library/ms644904) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryPerformanceCounter
[QueryPerformanceFrequency](http://msdn2.microsoft.com/en-us/library/ms644905) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryPerformanceFrequency
[QueryProcessAffinityUpdateMode](http://msdn2.microsoft.com/en-us/library/bb309062) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryProcessAffinityUpdateMode
[QueryProcessCycleTime](http://msdn2.microsoft.com/en-us/library/ms684929) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryProcessCycleTime
[QueryProtectedPolicy](http://msdn2.microsoft.com/en-us/library/dn893591) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryProtectedPolicy
-[QuerySecurityAccessMask](https://www.google.com/search?num=5&q=QuerySecurityAccessMask+site%3Amicrosoft.com) | kernelbase.dll | |
-[QueryStateAtomValueInfo](https://www.google.com/search?num=5&q=QueryStateAtomValueInfo+site%3Amicrosoft.com) | kernelbase.dll | |
-[QueryStateContainerCreatedNew](https://www.google.com/search?num=5&q=QueryStateContainerCreatedNew+site%3Amicrosoft.com) | kernelbase.dll | |
-[QueryStateContainerItemInfo](https://www.google.com/search?num=5&q=QueryStateContainerItemInfo+site%3Amicrosoft.com) | kernelbase.dll | |
[QueryThreadCycleTime](http://msdn2.microsoft.com/en-us/library/ms684943) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryThreadCycleTime
[QueryThreadpoolStackInformation](http://msdn2.microsoft.com/en-us/library/dd405508) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueryThreadpoolStackInformation
-[QueryThreadProfiling](https://www.google.com/search?num=5&q=QueryThreadProfiling+site%3Amicrosoft.com) | kernel32.dll | |
-[QueryUmsThreadInformation](https://www.google.com/search?num=5&q=QueryUmsThreadInformation+site%3Amicrosoft.com) | kernel32.dll | |
+[QueryThreadProfiling](http://msdn2.microsoft.com/en-us/library/dd796402) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryThreadProfiling
+[QueryUmsThreadInformation](http://msdn2.microsoft.com/en-us/library/5f694edf-ba5e-45a2-a938-5013edddcae2) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.QueryUmsThreadInformation
[QueryUnbiasedInterruptTime](http://msdn2.microsoft.com/en-us/library/ee662307) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.QueryUnbiasedInterruptTime
[QueryUnbiasedInterruptTimePrecise](http://msdn2.microsoft.com/en-us/library/dn891448) | kernelbase.dll | Realtimeapiset.h | Vanara.PInvoke.Kernel32.QueryUnbiasedInterruptTimePrecise
[QueryVirtualMemoryInformation](http://msdn2.microsoft.com/en-us/library/mt845761) | kernelbase.dll | MemoryApi.h | Vanara.PInvoke.Kernel32.QueryVirtualMemoryInformation
-[QueryWorkingSet](https://www.google.com/search?num=5&q=QueryWorkingSet+site%3Amicrosoft.com) | kernelbase.dll | |
-[QueryWorkingSetEx](https://www.google.com/search?num=5&q=QueryWorkingSetEx+site%3Amicrosoft.com) | kernelbase.dll | |
+[QueryWorkingSet](http://msdn2.microsoft.com/en-us/library/b932153f-2bbd-460e-8ff7-b3e493c397bb) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.QueryWorkingSet
+[QueryWorkingSetEx](http://msdn2.microsoft.com/en-us/library/59ae76c9-e954-4648-9c9f-787136375b02) | kernelbase.dll | psapi.h | Vanara.PInvoke.Kernel32.QueryWorkingSetEx
[QueueUserAPC](http://msdn2.microsoft.com/en-us/library/ms684954) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueueUserAPC
[QueueUserWorkItem](http://msdn2.microsoft.com/en-us/library/ms684957) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.QueueUserWorkItem
[RaiseException](http://msdn2.microsoft.com/en-us/library/ms680552) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RaiseException
[RaiseFailFastException](http://msdn2.microsoft.com/en-us/library/dd941688) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RaiseFailFastException
-[RaiseInvalid16BitExeError](https://www.google.com/search?num=5&q=RaiseInvalid16BitExeError+site%3Amicrosoft.com) | kernel32.dll | |
[ReadConsole](https://www.google.com/search?num=5&q=ReadConsoleA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ReadConsole
[ReadConsoleInput](https://www.google.com/search?num=5&q=ReadConsoleInputA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ReadConsoleInput
-[ReadConsoleInputEx](https://www.google.com/search?num=5&q=ReadConsoleInputExA+site%3Amicrosoft.com) | kernel32.dll | |
[ReadConsoleOutput](https://www.google.com/search?num=5&q=ReadConsoleOutputA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ReadConsoleOutput
[ReadConsoleOutputAttribute](https://www.google.com/search?num=5&q=ReadConsoleOutputAttribute+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ReadConsoleOutputAttribute
[ReadConsoleOutputCharacter](https://www.google.com/search?num=5&q=ReadConsoleOutputCharacterA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ReadConsoleOutputCharacter
@@ -1241,140 +756,64 @@ Native Method | Native DLL | Header | Managed Method
[ReadFileEx](http://msdn2.microsoft.com/en-us/library/aa365468) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.ReadFileEx
[ReadFileScatter](http://msdn2.microsoft.com/en-us/library/aa365469) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.ReadFileScatter
[ReadProcessMemory](http://msdn2.microsoft.com/en-us/library/ms680553) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReadProcessMemory
-[ReadStateAtomValue](https://www.google.com/search?num=5&q=ReadStateAtomValue+site%3Amicrosoft.com) | kernelbase.dll | |
-[ReadStateContainerValue](https://www.google.com/search?num=5&q=ReadStateContainerValue+site%3Amicrosoft.com) | kernelbase.dll | |
-[ReadThreadProfilingData](https://www.google.com/search?num=5&q=ReadThreadProfilingData+site%3Amicrosoft.com) | kernel32.dll | |
+[ReadThreadProfilingData](http://msdn2.microsoft.com/en-us/library/dd796403) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ReadThreadProfilingData
[ReclaimVirtualMemory](http://msdn2.microsoft.com/en-us/library/dn781437) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReclaimVirtualMemory
-[RefreshPackageInfo](https://www.google.com/search?num=5&q=RefreshPackageInfo+site%3Amicrosoft.com) | kernelbase.dll | |
-[RefreshPolicyExInternal](https://www.google.com/search?num=5&q=RefreshPolicyExInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[RefreshPolicyInternal](https://www.google.com/search?num=5&q=RefreshPolicyInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegCloseKey](https://www.google.com/search?num=5&q=RegCloseKey+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegCreateKeyEx](https://www.google.com/search?num=5&q=RegCreateKeyExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegDeleteKeyEx](https://www.google.com/search?num=5&q=RegDeleteKeyExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegDeleteTree](https://www.google.com/search?num=5&q=RegDeleteTreeA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegDeleteValue](https://www.google.com/search?num=5&q=RegDeleteValueA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegEnumKeyEx](https://www.google.com/search?num=5&q=RegEnumKeyExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegEnumValue](https://www.google.com/search?num=5&q=RegEnumValueA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegGetValue](https://www.google.com/search?num=5&q=RegGetValueA+site%3Amicrosoft.com) | kernelbase.dll | |
[RegisterApplicationRecoveryCallback](http://msdn2.microsoft.com/en-us/library/aa373345) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.RegisterApplicationRecoveryCallback
[RegisterApplicationRestart](http://msdn2.microsoft.com/en-us/library/aa373347) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.RegisterApplicationRestart
[RegisterBadMemoryNotification](http://msdn2.microsoft.com/en-us/library/hh691013) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RegisterBadMemoryNotification
-[RegisterConsoleIME](https://www.google.com/search?num=5&q=RegisterConsoleIME+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterConsoleOS2](https://www.google.com/search?num=5&q=RegisterConsoleOS2+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterConsoleVDM](https://www.google.com/search?num=5&q=RegisterConsoleVDM+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterGPNotificationInternal](https://www.google.com/search?num=5&q=RegisterGPNotificationInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegisterStateChangeNotification](https://www.google.com/search?num=5&q=RegisterStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegisterStateLock](https://www.google.com/search?num=5&q=RegisterStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegisterTraceGuidsW](https://www.google.com/search?num=5&q=RegisterTraceGuidsW+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegisterWaitForInputIdle](https://www.google.com/search?num=5&q=RegisterWaitForInputIdle+site%3Amicrosoft.com) | kernel32.dll | |
[RegisterWaitForSingleObject](http://msdn2.microsoft.com/en-us/library/ms685061) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RegisterWaitForSingleObject
-[RegisterWaitForSingleObjectEx](https://www.google.com/search?num=5&q=RegisterWaitForSingleObjectEx+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterWaitUntilOOBECompleted](https://www.google.com/search?num=5&q=RegisterWaitUntilOOBECompleted+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterWowBaseHandlers](https://www.google.com/search?num=5&q=RegisterWowBaseHandlers+site%3Amicrosoft.com) | kernel32.dll | |
-[RegisterWowExec](https://www.google.com/search?num=5&q=RegisterWowExec+site%3Amicrosoft.com) | kernel32.dll | |
-[RegLoadKey](https://www.google.com/search?num=5&q=RegLoadKeyA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegLoadMUIString](https://www.google.com/search?num=5&q=RegLoadMUIStringA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegOpenKeyEx](https://www.google.com/search?num=5&q=RegOpenKeyExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegQueryInfoKey](https://www.google.com/search?num=5&q=RegQueryInfoKeyA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegQueryValueEx](https://www.google.com/search?num=5&q=RegQueryValueExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegRestoreKey](https://www.google.com/search?num=5&q=RegRestoreKeyA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegSaveKeyEx](https://www.google.com/search?num=5&q=RegSaveKeyExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegSetValueEx](https://www.google.com/search?num=5&q=RegSetValueExA+site%3Amicrosoft.com) | kernelbase.dll | |
-[RegUnLoadKey](https://www.google.com/search?num=5&q=RegUnLoadKeyA+site%3Amicrosoft.com) | kernelbase.dll | |
[ReleaseActCtx](http://msdn2.microsoft.com/en-us/library/aa375713) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ReleaseActCtx
-[ReleaseActCtxWorker](https://www.google.com/search?num=5&q=ReleaseActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
[ReleaseMutex](http://msdn2.microsoft.com/en-us/library/ms685066) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseMutex
[ReleaseMutexWhenCallbackReturns](http://msdn2.microsoft.com/en-us/library/ms685070) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseMutexWhenCallbackReturns
[ReleaseSemaphore](http://msdn2.microsoft.com/en-us/library/ms685071) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseSemaphore
[ReleaseSemaphoreWhenCallbackReturns](http://msdn2.microsoft.com/en-us/library/ms685073) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseSemaphoreWhenCallbackReturns
[ReleaseSRWLockExclusive](http://msdn2.microsoft.com/en-us/library/ms685076) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseSRWLockExclusive
[ReleaseSRWLockShared](http://msdn2.microsoft.com/en-us/library/ms685080) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReleaseSRWLockShared
-[ReleaseStateLock](https://www.google.com/search?num=5&q=ReleaseStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
-[RemapPredefinedHandleInternal](https://www.google.com/search?num=5&q=RemapPredefinedHandleInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[RemoveDirectory](http://msdn2.microsoft.com/en-us/library/aa365488) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.RemoveDirectory
-[RemoveDirectoryTransacted](https://www.google.com/search?num=5&q=RemoveDirectoryTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
+[RemoveDirectoryTransacted](http://msdn2.microsoft.com/en-us/library/e8600166-62dc-4398-9e16-43b07f7f0b89) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.RemoveDirectoryTransacted
[RemoveDllDirectory](http://msdn2.microsoft.com/en-us/library/hh310514) | kernel32.dll | LibLoaderAPI.h | Vanara.PInvoke.Kernel32.RemoveDllDirectory
-[RemoveExtensionProgIds](https://www.google.com/search?num=5&q=RemoveExtensionProgIds+site%3Amicrosoft.com) | kernelbase.dll | |
-[RemoveLocalAlternateComputerName](https://www.google.com/search?num=5&q=RemoveLocalAlternateComputerNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[RemovePackageFromFamilyXref](https://www.google.com/search?num=5&q=RemovePackageFromFamilyXref+site%3Amicrosoft.com) | kernelbase.dll | |
-[RemovePackageStatus](https://www.google.com/search?num=5&q=RemovePackageStatus+site%3Amicrosoft.com) | kernelbase.dll | |
-[RemovePackageStatusForUser](https://www.google.com/search?num=5&q=RemovePackageStatusForUser+site%3Amicrosoft.com) | kernelbase.dll | |
-[RemoveSecureMemoryCacheCallback](https://www.google.com/search?num=5&q=RemoveSecureMemoryCacheCallback+site%3Amicrosoft.com) | kernel32.dll | |
+[RemoveSecureMemoryCacheCallback](http://msdn2.microsoft.com/en-us/library/8be6ff04-34c7-4942-a38c-507584c8bbeb) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.RemoveSecureMemoryCacheCallback
[RemoveVectoredContinueHandler](http://msdn2.microsoft.com/en-us/library/ms680567) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RemoveVectoredContinueHandler
[RemoveVectoredExceptionHandler](http://msdn2.microsoft.com/en-us/library/ms680571) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RemoveVectoredExceptionHandler
-[ReOpenFile](https://www.google.com/search?num=5&q=ReOpenFile+site%3Amicrosoft.com) | kernel32.dll | |
+[ReOpenFile](http://msdn2.microsoft.com/en-us/library/56d8a4b1-e3b5-4134-8d21-bf40761e9dcc) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.ReOpenFile
[ReplaceFile](https://www.google.com/search?num=5&q=ReplaceFile+site%3Amicrosoft.com) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ReplaceFile
-[ReplaceFileExInternal](https://www.google.com/search?num=5&q=ReplaceFileExInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[ReplacePartitionUnit](https://www.google.com/search?num=5&q=ReplacePartitionUnit+site%3Amicrosoft.com) | kernel32.dll | |
[RequestWakeupLatency](http://msdn2.microsoft.com/en-us/library/aa373199) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RequestWakeupLatency
[ResetEvent](http://msdn2.microsoft.com/en-us/library/ms685081) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ResetEvent
-[ResetState](https://www.google.com/search?num=5&q=ResetState+site%3Amicrosoft.com) | kernelbase.dll | |
[ResetWriteWatch](http://msdn2.microsoft.com/en-us/library/aa366874) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ResetWriteWatch
-[ResolveDelayLoadedAPI](https://www.google.com/search?num=5&q=ResolveDelayLoadedAPI+site%3Amicrosoft.com) | kernel32.dll | |
-[ResolveDelayLoadsFromDll](https://www.google.com/search?num=5&q=ResolveDelayLoadsFromDll+site%3Amicrosoft.com) | kernel32.dll | |
[ResolveLocaleName](http://msdn2.microsoft.com/en-us/library/dd319112) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.ResolveLocaleName
[RestoreLastError](https://www.google.com/search?num=5&q=RestoreLastError+site%3Amicrosoft.com) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.RestoreLastError
[ResumeThread](http://msdn2.microsoft.com/en-us/library/ms685086) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.ResumeThread
-[RevertToSelf](https://www.google.com/search?num=5&q=RevertToSelf+site%3Amicrosoft.com) | kernelbase.dll | |
-[RsopLoggingEnabledInternal](https://www.google.com/search?num=5&q=RsopLoggingEnabledInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[RtlAddFunctionTable](http://msdn2.microsoft.com/en-us/library/ms680588) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlAddFunctionTable
[RtlCaptureContext](http://msdn2.microsoft.com/en-us/library/ms680591) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlCaptureContext
-[RtlCaptureStackBackTrace](https://www.google.com/search?num=5&q=RtlCaptureStackBackTrace+site%3Amicrosoft.com) | kernel32.dll | |
-[RtlCompareMemory](https://www.google.com/search?num=5&q=RtlCompareMemory+site%3Amicrosoft.com) | kernel32.dll | |
-[RtlCopyMemory](https://www.google.com/search?num=5&q=RtlCopyMemory+site%3Amicrosoft.com) | kernel32.dll | |
[RtlDeleteFunctionTable](http://msdn2.microsoft.com/en-us/library/ms680593) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlDeleteFunctionTable
-[RtlFillMemory](https://www.google.com/search?num=5&q=RtlFillMemory+site%3Amicrosoft.com) | kernel32.dll | |
[RtlInstallFunctionTableCallback](http://msdn2.microsoft.com/en-us/library/ms680595) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlInstallFunctionTableCallback
[RtlLookupFunctionEntry](http://msdn2.microsoft.com/en-us/library/ms680597) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlLookupFunctionEntry
[RtlMoveMemory](http://msdn2.microsoft.com/en-us/library/aa366788) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.MoveMemory
[RtlPcToFileHeader](http://msdn2.microsoft.com/en-us/library/ms680603) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlPcToFileHeader
-[RtlRaiseException](https://www.google.com/search?num=5&q=RtlRaiseException+site%3Amicrosoft.com) | kernel32.dll | |
[RtlRestoreContext](http://msdn2.microsoft.com/en-us/library/ms680605) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlRestoreContext
[RtlUnwind](http://msdn2.microsoft.com/en-us/library/ms680609) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlUnwind
[RtlUnwindEx](http://msdn2.microsoft.com/en-us/library/ms680615) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlUnwindEx
-[RtlVirtualUnwind](https://www.google.com/search?num=5&q=RtlVirtualUnwind+site%3Amicrosoft.com) | kernel32.dll | |
[RtlZeroMemory](https://www.google.com/search?num=5&q=RtlZeroMemory+site%3Amicrosoft.com) | kernel32.dll | WinNT.h | Vanara.PInvoke.Kernel32.RtlZeroMemory
-[SaveAlternatePackageRootPath](https://www.google.com/search?num=5&q=SaveAlternatePackageRootPath+site%3Amicrosoft.com) | kernelbase.dll | |
-[SaveStateRootFolderPath](https://www.google.com/search?num=5&q=SaveStateRootFolderPath+site%3Amicrosoft.com) | kernelbase.dll | |
[ScrollConsoleScreenBuffer](https://www.google.com/search?num=5&q=ScrollConsoleScreenBufferA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.ScrollConsoleScreenBuffer
[SearchPath](http://msdn2.microsoft.com/en-us/library/aa365527) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SearchPath
-[SetAclInformation](https://www.google.com/search?num=5&q=SetAclInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetCachedSigningLevel](https://www.google.com/search?num=5&q=SetCachedSigningLevel+site%3Amicrosoft.com) | kernel32.dll | |
[SetCalendarInfo](http://msdn2.microsoft.com/en-us/library/dd374048) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.SetCalendarInfo
-[SetClientDynamicTimeZoneInformation](https://www.google.com/search?num=5&q=SetClientDynamicTimeZoneInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetClientTimeZoneInformation](https://www.google.com/search?num=5&q=SetClientTimeZoneInformation+site%3Amicrosoft.com) | kernelbase.dll | |
[SetCommBreak](http://msdn2.microsoft.com/en-us/library/aa363433) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetCommBreak
[SetCommConfig](http://msdn2.microsoft.com/en-us/library/aa363434) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetCommConfig
[SetCommMask](http://msdn2.microsoft.com/en-us/library/aa363435) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetCommMask
[SetCommState](http://msdn2.microsoft.com/en-us/library/aa363436) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetCommState
[SetCommTimeouts](http://msdn2.microsoft.com/en-us/library/aa363437) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetCommTimeouts
-[SetComPlusPackageInstallStatus](https://www.google.com/search?num=5&q=SetComPlusPackageInstallStatus+site%3Amicrosoft.com) | kernel32.dll | |
[SetComputerName](http://msdn2.microsoft.com/en-us/library/ms724930) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetComputerName
[SetComputerNameEx](http://msdn2.microsoft.com/en-us/library/ms724931) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetComputerNameEx
[SetComputerNameEx2W](https://www.google.com/search?num=5&q=SetComputerNameEx2W+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetComputerNameEx2
[SetConsoleActiveScreenBuffer](https://www.google.com/search?num=5&q=SetConsoleActiveScreenBuffer+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleActiveScreenBuffer
[SetConsoleCP](https://www.google.com/search?num=5&q=SetConsoleCP+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleCP
[SetConsoleCtrlHandler](https://www.google.com/search?num=5&q=SetConsoleCtrlHandler+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleCtrlHandler
-[SetConsoleCursor](https://www.google.com/search?num=5&q=SetConsoleCursor+site%3Amicrosoft.com) | kernel32.dll | |
[SetConsoleCursorInfo](https://www.google.com/search?num=5&q=SetConsoleCursorInfo+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleCursorInfo
-[SetConsoleCursorMode](https://www.google.com/search?num=5&q=SetConsoleCursorMode+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleCursorPosition](https://www.google.com/search?num=5&q=SetConsoleCursorPosition+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleCursorPosition
+[SetConsoleCursorPosition](http://msdn2.microsoft.com/en-us/library/8e9abada-a64e-429f-8286-ced1169c7104) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleCursorPosition
[SetConsoleDisplayMode](https://www.google.com/search?num=5&q=SetConsoleDisplayMode+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleDisplayMode
-[SetConsoleFont](https://www.google.com/search?num=5&q=SetConsoleFont+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleHardwareState](https://www.google.com/search?num=5&q=SetConsoleHardwareState+site%3Amicrosoft.com) | kernel32.dll | |
[SetConsoleHistoryInfo](https://www.google.com/search?num=5&q=SetConsoleHistoryInfo+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleHistoryInfo
-[SetConsoleIcon](https://www.google.com/search?num=5&q=SetConsoleIcon+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleInputExeName](https://www.google.com/search?num=5&q=SetConsoleInputExeNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleKeyShortcuts](https://www.google.com/search?num=5&q=SetConsoleKeyShortcuts+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleLocalEUDC](https://www.google.com/search?num=5&q=SetConsoleLocalEUDC+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleMaximumWindowSize](https://www.google.com/search?num=5&q=SetConsoleMaximumWindowSize+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleMenuClose](https://www.google.com/search?num=5&q=SetConsoleMenuClose+site%3Amicrosoft.com) | kernel32.dll | |
[SetConsoleMode](https://www.google.com/search?num=5&q=SetConsoleMode+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleMode
-[SetConsoleNlsMode](https://www.google.com/search?num=5&q=SetConsoleNlsMode+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleNumberOfCommands](https://www.google.com/search?num=5&q=SetConsoleNumberOfCommandsA+site%3Amicrosoft.com) | kernel32.dll | |
-[SetConsoleOS2OemFormat](https://www.google.com/search?num=5&q=SetConsoleOS2OemFormat+site%3Amicrosoft.com) | kernel32.dll | |
[SetConsoleOutputCP](https://www.google.com/search?num=5&q=SetConsoleOutputCP+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleOutputCP
-[SetConsolePalette](https://www.google.com/search?num=5&q=SetConsolePalette+site%3Amicrosoft.com) | kernel32.dll | |
[SetConsoleScreenBufferInfoEx](https://www.google.com/search?num=5&q=SetConsoleScreenBufferInfoEx+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleScreenBufferInfoEx
[SetConsoleScreenBufferSize](https://www.google.com/search?num=5&q=SetConsoleScreenBufferSize+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleScreenBufferSize
[SetConsoleTextAttribute](https://www.google.com/search?num=5&q=SetConsoleTextAttribute+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.SetConsoleTextAttribute
@@ -1393,46 +832,34 @@ Native Method | Native DLL | Header | Managed Method
[SetErrorMode](http://msdn2.microsoft.com/en-us/library/ms680621) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetErrorMode
[SetEvent](http://msdn2.microsoft.com/en-us/library/ms686211) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetEvent
[SetEventWhenCallbackReturns](http://msdn2.microsoft.com/en-us/library/ms686214) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetEventWhenCallbackReturns
-[SetExtensionProperty](https://www.google.com/search?num=5&q=SetExtensionProperty+site%3Amicrosoft.com) | kernelbase.dll | |
[SetFileApisToANSI](http://msdn2.microsoft.com/en-us/library/aa365533) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetFileApisToANSI
[SetFileApisToOEM](http://msdn2.microsoft.com/en-us/library/aa365534) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetFileApisToOEM
[SetFileAttributes](http://msdn2.microsoft.com/en-us/library/aa365535) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFileAttributes
-[SetFileAttributesTransacted](https://www.google.com/search?num=5&q=SetFileAttributesTransactedA+site%3Amicrosoft.com) | kernel32.dll | |
-[SetFileBandwidthReservation](https://www.google.com/search?num=5&q=SetFileBandwidthReservation+site%3Amicrosoft.com) | kernel32.dll | |
-[SetFileCompletionNotificationModes](https://www.google.com/search?num=5&q=SetFileCompletionNotificationModes+site%3Amicrosoft.com) | kernel32.dll | |
+[SetFileAttributesTransacted](http://msdn2.microsoft.com/en-us/library/e25e77b2-a6ad-4ce4-8589-d7ff6c4074f6) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetFileAttributesTransacted
+[SetFileBandwidthReservation](http://msdn2.microsoft.com/en-us/library/a22bd8f3-4fbf-4f77-b8b6-7e786942615a) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetFileBandwidthReservation
+[SetFileCompletionNotificationModes](http://msdn2.microsoft.com/en-us/library/23796484-ee47-4f80-856d-5a5d5635547c) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetFileCompletionNotificationModes
[SetFileInformationByHandle](http://msdn2.microsoft.com/en-us/library/aa365539) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFileInformationByHandle
[SetFileIoOverlappedRange](http://msdn2.microsoft.com/en-us/library/aa365540) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetFileIoOverlappedRange
[SetFilePointer](http://msdn2.microsoft.com/en-us/library/aa365541) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFilePointer
[SetFilePointerEx](http://msdn2.microsoft.com/en-us/library/aa365542) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFilePointerEx
-[SetFileSecurityW](https://www.google.com/search?num=5&q=SetFileSecurityW+site%3Amicrosoft.com) | kernelbase.dll | |
[SetFileShortName](http://msdn2.microsoft.com/en-us/library/aa365543) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetFileShortName
[SetFileTime](http://msdn2.microsoft.com/en-us/library/ms724933) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFileTime
[SetFileValidData](http://msdn2.microsoft.com/en-us/library/aa365544) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.SetFileValidData
[SetFirmwareEnvironmentVariable](http://msdn2.microsoft.com/en-us/library/ms724934) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetFirmwareEnvironmentVariable
-[SetFirmwareEnvironmentVariableEx](https://www.google.com/search?num=5&q=SetFirmwareEnvironmentVariableExA+site%3Amicrosoft.com) | kernel32.dll | |
-[SetHandleCount](https://www.google.com/search?num=5&q=SetHandleCount+site%3Amicrosoft.com) | kernelbase.dll | |
+[SetFirmwareEnvironmentVariableEx](http://msdn2.microsoft.com/en-us/library/D3C2F03F-66F6-40A4-830E-058BBA925ACD) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetFirmwareEnvironmentVariableEx
[SetHandleInformation](http://msdn2.microsoft.com/en-us/library/ms724935) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetHandleInformation
[SetInformationJobObject](http://msdn2.microsoft.com/en-us/library/ms686216) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetInformationJobObject
[SetIoRateControlInformationJobObject](http://msdn2.microsoft.com/en-us/library/mt280128) | kernel32.dll | Jobapi2.h | Vanara.PInvoke.Kernel32.SetIoRateControlInformationJobObject
-[SetIsDeveloperModeEnabled](https://www.google.com/search?num=5&q=SetIsDeveloperModeEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetIsSideloadingEnabled](https://www.google.com/search?num=5&q=SetIsSideloadingEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetKernelObjectSecurity](https://www.google.com/search?num=5&q=SetKernelObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetLastConsoleEventActive](https://www.google.com/search?num=5&q=SetLastConsoleEventActive+site%3Amicrosoft.com) | kernel32.dll | |
[SetLastError](http://msdn2.microsoft.com/en-us/library/ms680627) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetLastError
[SetLocaleInfo](http://msdn2.microsoft.com/en-us/library/dd374049) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.SetLocaleInfo
-[SetLocalPrimaryComputerName](https://www.google.com/search?num=5&q=SetLocalPrimaryComputerNameA+site%3Amicrosoft.com) | kernel32.dll | |
[SetLocalTime](http://msdn2.microsoft.com/en-us/library/ms724936) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetLocalTime
[SetMailslotInfo](http://msdn2.microsoft.com/en-us/library/aa365786) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetMailslotInfo
-[SetNamedPipeAttribute](https://www.google.com/search?num=5&q=SetNamedPipeAttribute+site%3Amicrosoft.com) | kernel32.dll | |
[SetNamedPipeHandleState](http://msdn2.microsoft.com/en-us/library/aa365787) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetNamedPipeHandleState
[SetPriorityClass](http://msdn2.microsoft.com/en-us/library/ms686219) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetPriorityClass
-[SetPrivateObjectSecurity](https://www.google.com/search?num=5&q=SetPrivateObjectSecurity+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetPrivateObjectSecurityEx](https://www.google.com/search?num=5&q=SetPrivateObjectSecurityEx+site%3Amicrosoft.com) | kernelbase.dll | |
[SetProcessAffinityMask](http://msdn2.microsoft.com/en-us/library/ms686223) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetProcessAffinityMask
[SetProcessAffinityUpdateMode](http://msdn2.microsoft.com/en-us/library/bb309063) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetProcessAffinityUpdateMode
[SetProcessDefaultCpuSets](http://msdn2.microsoft.com/en-us/library/mt186427) | kernel32.dll | Processthreadapi.h | Vanara.PInvoke.Kernel32.SetProcessDefaultCpuSets
-[SetProcessDEPPolicy](https://www.google.com/search?num=5&q=SetProcessDEPPolicy+site%3Amicrosoft.com) | kernel32.dll | |
-[SetProcessGroupAffinity](https://www.google.com/search?num=5&q=SetProcessGroupAffinity+site%3Amicrosoft.com) | kernelbase.dll | |
+[SetProcessDEPPolicy](http://msdn2.microsoft.com/en-us/library/17c9f522-fd64-4061-9212-8fc91cc96b18) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetProcessDEPPolicy
[SetProcessInformation](http://msdn2.microsoft.com/en-us/library/hh448389) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetProcessInformation
[SetProcessMitigationPolicy](http://msdn2.microsoft.com/en-us/library/hh769088) | kernel32.dll | Processthreadsapi.h | Vanara.PInvoke.Kernel32.SetProcessMitigationPolicy
[SetProcessPreferredUILanguages](http://msdn2.microsoft.com/en-us/library/dd374050) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.SetProcessPreferredUILanguages
@@ -1442,10 +869,7 @@ Native Method | Native DLL | Header | Managed Method
[SetProcessWorkingSetSize](http://msdn2.microsoft.com/en-us/library/ms686234) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetProcessWorkingSetSize
[SetProcessWorkingSetSizeEx](http://msdn2.microsoft.com/en-us/library/ms686237) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetProcessWorkingSetSizeEx
[SetProtectedPolicy](http://msdn2.microsoft.com/en-us/library/dn893592) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetProtectedPolicy
-[SetProtocolProperty](https://www.google.com/search?num=5&q=SetProtocolProperty+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetRoamingLastObservedChangeTime](https://www.google.com/search?num=5&q=SetRoamingLastObservedChangeTime+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetSearchPathMode](https://www.google.com/search?num=5&q=SetSearchPathMode+site%3Amicrosoft.com) | kernel32.dll | |
-[SetStateVersion](https://www.google.com/search?num=5&q=SetStateVersion+site%3Amicrosoft.com) | kernelbase.dll | |
+[SetSearchPathMode](http://msdn2.microsoft.com/en-us/library/1874933d-92c3-4945-a3e4-e6dede232d5e) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetSearchPathMode
[SetStdHandle](https://www.google.com/search?num=5&q=SetStdHandle+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetStdHandle
[SetStdHandleEx](https://www.google.com/search?num=5&q=SetStdHandleEx+site%3Amicrosoft.com) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetStdHandleEx
[SetSystemFileCacheSize](http://msdn2.microsoft.com/en-us/library/aa965240) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetSystemFileCacheSize
@@ -1454,7 +878,6 @@ Native Method | Native DLL | Header | Managed Method
[SetSystemTimeAdjustment](http://msdn2.microsoft.com/en-us/library/ms724943) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetSystemTimeAdjustment
[SetTapeParameters](http://msdn2.microsoft.com/en-us/library/aa362534) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetTapeParameters
[SetTapePosition](http://msdn2.microsoft.com/en-us/library/aa362536) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetTapePosition
-[SetTermsrvAppInstallMode](https://www.google.com/search?num=5&q=SetTermsrvAppInstallMode+site%3Amicrosoft.com) | kernel32.dll | |
[SetThreadAffinityMask](http://msdn2.microsoft.com/en-us/library/ms686247) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetThreadAffinityMask
[SetThreadContext](http://msdn2.microsoft.com/en-us/library/ms680632) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetThreadContext
[SetThreadDescription](http://msdn2.microsoft.com/en-us/library/mt774976) | kernel32.dll | ProcessThreadsApi.h | Vanara.PInvoke.Kernel32.SetThreadDescription
@@ -1477,43 +900,25 @@ Native Method | Native DLL | Header | Managed Method
[SetThreadPriorityBoost](http://msdn2.microsoft.com/en-us/library/ms686280) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetThreadPriorityBoost
[SetThreadSelectedCpuSets](http://msdn2.microsoft.com/en-us/library/mt186428) | kernel32.dll | Processthreadapi.h | Vanara.PInvoke.Kernel32.SetThreadSelectedCpuSets
[SetThreadStackGuarantee](http://msdn2.microsoft.com/en-us/library/ms686283) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetThreadStackGuarantee
-[SetThreadToken](https://www.google.com/search?num=5&q=SetThreadToken+site%3Amicrosoft.com) | kernel32.dll | |
[SetThreadUILanguage](http://msdn2.microsoft.com/en-us/library/dd374053) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.SetThreadUILanguage
[SetTimeZoneInformation](http://msdn2.microsoft.com/en-us/library/ms724944) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetTimeZoneInformation
-[SetTokenInformation](https://www.google.com/search?num=5&q=SetTokenInformation+site%3Amicrosoft.com) | kernelbase.dll | |
-[SetUmsThreadInformation](https://www.google.com/search?num=5&q=SetUmsThreadInformation+site%3Amicrosoft.com) | kernel32.dll | |
+[SetUmsThreadInformation](http://msdn2.microsoft.com/en-us/library/19f190fd-1f78-4bb6-93eb-73a5c522b44d) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetUmsThreadInformation
[SetUnhandledExceptionFilter](http://msdn2.microsoft.com/en-us/library/ms680634) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetUnhandledExceptionFilter
[SetupComm](http://msdn2.microsoft.com/en-us/library/aa363439) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SetupComm
[SetUserGeoID](http://msdn2.microsoft.com/en-us/library/dd374055) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.SetUserGeoID
-[SetVDMCurrentDirectories](https://www.google.com/search?num=5&q=SetVDMCurrentDirectories+site%3Amicrosoft.com) | kernel32.dll | |
[SetVolumeLabel](http://msdn2.microsoft.com/en-us/library/aa365560) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetVolumeLabel
[SetVolumeMountPoint](http://msdn2.microsoft.com/en-us/library/aa365561) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetVolumeMountPoint
-[SetVolumeMountPointWStub](https://www.google.com/search?num=5&q=SetVolumeMountPointWStub+site%3Amicrosoft.com) | kernel32.dll | |
[SetWaitableTimer](http://msdn2.microsoft.com/en-us/library/ms686289) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetWaitableTimer
[SetWaitableTimerEx](http://msdn2.microsoft.com/en-us/library/dd405521) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SetWaitableTimerEx
-[SetXStateFeaturesMask](https://www.google.com/search?num=5&q=SetXStateFeaturesMask+site%3Amicrosoft.com) | kernel32.dll | |
-[SharedLocalIsEnabled](https://www.google.com/search?num=5&q=SharedLocalIsEnabled+site%3Amicrosoft.com) | kernelbase.dll | |
+[SetXStateFeaturesMask](http://msdn2.microsoft.com/en-us/library/64ADEA8A-DE78-437E-AE68-A68E7214C5FD) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.SetXStateFeaturesMask
[SignalObjectAndWait](http://msdn2.microsoft.com/en-us/library/ms686293) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SignalObjectAndWait
[SizeofResource](http://msdn2.microsoft.com/en-us/library/ms648048) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.SizeofResource
[Sleep](http://msdn2.microsoft.com/en-us/library/ms686298) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.Sleep
[SleepConditionVariableCS](http://msdn2.microsoft.com/en-us/library/ms686301) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SleepConditionVariableCS
[SleepConditionVariableSRW](http://msdn2.microsoft.com/en-us/library/ms686304) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SleepConditionVariableSRW
[SleepEx](http://msdn2.microsoft.com/en-us/library/ms686307) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SleepEx
-[SortCloseHandle](https://www.google.com/search?num=5&q=SortCloseHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[SortGetHandle](https://www.google.com/search?num=5&q=SortGetHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[SpecialMBToWC](https://www.google.com/search?num=5&q=SpecialMBToWC+site%3Amicrosoft.com) | kernelbase.dll | |
[StartThreadpoolIo](http://msdn2.microsoft.com/en-us/library/ms686326) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.StartThreadpoolIo
-[StmAlignSize](https://www.google.com/search?num=5&q=StmAlignSize+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmAllocateFlat](https://www.google.com/search?num=5&q=StmAllocateFlat+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmCoalesceChunks](https://www.google.com/search?num=5&q=StmCoalesceChunks+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmDeinitialize](https://www.google.com/search?num=5&q=StmDeinitialize+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmInitialize](https://www.google.com/search?num=5&q=StmInitialize+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmReduceSize](https://www.google.com/search?num=5&q=StmReduceSize+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmReserve](https://www.google.com/search?num=5&q=StmReserve+site%3Amicrosoft.com) | kernelbase.dll | |
-[StmWrite](https://www.google.com/search?num=5&q=StmWrite+site%3Amicrosoft.com) | kernelbase.dll | |
[SubmitThreadpoolWork](http://msdn2.microsoft.com/en-us/library/ms686338) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SubmitThreadpoolWork
-[SubscribeEdpEnabledStateChange](https://www.google.com/search?num=5&q=SubscribeEdpEnabledStateChange+site%3Amicrosoft.com) | kernelbase.dll | |
-[SubscribeStateChangeNotification](https://www.google.com/search?num=5&q=SubscribeStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
[SuspendThread](http://msdn2.microsoft.com/en-us/library/ms686345) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SuspendThread
[SwitchToFiber](http://msdn2.microsoft.com/en-us/library/ms686350) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SwitchToFiber
[SwitchToThread](http://msdn2.microsoft.com/en-us/library/ms686352) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.SwitchToThread
@@ -1524,35 +929,14 @@ Native Method | Native DLL | Header | Managed Method
[TerminateProcess](http://msdn2.microsoft.com/en-us/library/ms686714) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TerminateProcess
[TerminateProcessOnMemoryExhaustion](https://www.google.com/search?num=5&q=TerminateProcessOnMemoryExhaustion+site%3Amicrosoft.com) | kernelbase.dll | WinBase.h | Vanara.PInvoke.Kernel32.TerminateProcessOnMemoryExhaustion
[TerminateThread](http://msdn2.microsoft.com/en-us/library/ms686717) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TerminateThread
-[TermsrvAppInstallMode](https://www.google.com/search?num=5&q=TermsrvAppInstallMode+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvConvertSysRootToUserDir](https://www.google.com/search?num=5&q=TermsrvConvertSysRootToUserDir+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvCreateRegEntry](https://www.google.com/search?num=5&q=TermsrvCreateRegEntry+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvDeleteKey](https://www.google.com/search?num=5&q=TermsrvDeleteKey+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvDeleteValue](https://www.google.com/search?num=5&q=TermsrvDeleteValue+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvGetPreSetValue](https://www.google.com/search?num=5&q=TermsrvGetPreSetValue+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvGetWindowsDirectory](https://www.google.com/search?num=5&q=TermsrvGetWindowsDirectoryA+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvOpenRegEntry](https://www.google.com/search?num=5&q=TermsrvOpenRegEntry+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvOpenUserClasses](https://www.google.com/search?num=5&q=TermsrvOpenUserClasses+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvRestoreKey](https://www.google.com/search?num=5&q=TermsrvRestoreKey+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvSetKeySecurity](https://www.google.com/search?num=5&q=TermsrvSetKeySecurity+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvSetValueKey](https://www.google.com/search?num=5&q=TermsrvSetValueKey+site%3Amicrosoft.com) | kernel32.dll | |
-[TermsrvSyncUserIniFileExt](https://www.google.com/search?num=5&q=TermsrvSyncUserIniFileExt+site%3Amicrosoft.com) | kernel32.dll | |
-[Thread32First](https://www.google.com/search?num=5&q=Thread32First+site%3Amicrosoft.com) | kernel32.dll | |
-[Thread32Next](https://www.google.com/search?num=5&q=Thread32Next+site%3Amicrosoft.com) | kernel32.dll | |
-[time](https://www.google.com/search?num=5&q=time+site%3Amicrosoft.com) | kernelbase.dll | |
-[timeBeginPeriod](https://www.google.com/search?num=5&q=timeBeginPeriod+site%3Amicrosoft.com) | kernel32.dll | |
-[timeEndPeriod](https://www.google.com/search?num=5&q=timeEndPeriod+site%3Amicrosoft.com) | kernel32.dll | |
-[timeGetDevCaps](https://www.google.com/search?num=5&q=timeGetDevCaps+site%3Amicrosoft.com) | kernel32.dll | |
-[timeGetSystemTime](https://www.google.com/search?num=5&q=timeGetSystemTime+site%3Amicrosoft.com) | kernel32.dll | |
-[timeGetTime](https://www.google.com/search?num=5&q=timeGetTime+site%3Amicrosoft.com) | kernel32.dll | |
+[TermsrvAppInstallMode](http://msdn2.microsoft.com/en-us/library/edf362e6-c1a4-49fe-8e07-1188c66616be) | kernel32.dll | | Vanara.PInvoke.Kernel32.TermsrvAppInstallMode
+[Thread32First](http://msdn2.microsoft.com/en-us/library/d4cb7a19-850e-43b5-bda5-91be48382d2a) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Thread32First
+[Thread32Next](http://msdn2.microsoft.com/en-us/library/5efe514e-626c-4138-97a0-bdad217c424f) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Thread32Next
[TlsAlloc](http://msdn2.microsoft.com/en-us/library/ms686801) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TlsAlloc
[TlsFree](http://msdn2.microsoft.com/en-us/library/ms686804) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TlsFree
[TlsGetValue](http://msdn2.microsoft.com/en-us/library/ms686812) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TlsGetValue
[TlsSetValue](http://msdn2.microsoft.com/en-us/library/ms686818) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TlsSetValue
-[Toolhelp32ReadProcessMemory](https://www.google.com/search?num=5&q=Toolhelp32ReadProcessMemory+site%3Amicrosoft.com) | kernel32.dll | |
-[TraceEvent](https://www.google.com/search?num=5&q=TraceEvent+site%3Amicrosoft.com) | kernelbase.dll | |
-[TraceMessage](https://www.google.com/search?num=5&q=TraceMessage+site%3Amicrosoft.com) | kernelbase.dll | |
-[TraceMessageVa](https://www.google.com/search?num=5&q=TraceMessageVa+site%3Amicrosoft.com) | kernelbase.dll | |
+[Toolhelp32ReadProcessMemory](http://msdn2.microsoft.com/en-us/library/e579b813-32ef-481d-8dc6-f959ec9b6bad) | kernel32.dll | tlhelp32.h | Vanara.PInvoke.Kernel32.Toolhelp32ReadProcessMemory
[TransactNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365790) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.TransactNamedPipe
[TransmitCommChar](http://msdn2.microsoft.com/en-us/library/aa363473) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.TransmitCommChar
[TryAcquireSRWLockExclusive](http://msdn2.microsoft.com/en-us/library/dd405523) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TryAcquireSRWLockExclusive
@@ -1561,7 +945,7 @@ Native Method | Native DLL | Header | Managed Method
[TrySubmitThreadpoolCallback](http://msdn2.microsoft.com/en-us/library/ms686862) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.TrySubmitThreadpoolCallback
[TzSpecificLocalTimeToSystemTime](http://msdn2.microsoft.com/en-us/library/ms725485) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.TzSpecificLocalTimeToSystemTime
[TzSpecificLocalTimeToSystemTimeEx](http://msdn2.microsoft.com/en-us/library/jj206643) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.TzSpecificLocalTimeToSystemTimeEx
-[UmsThreadYield](https://www.google.com/search?num=5&q=UmsThreadYield+site%3Amicrosoft.com) | kernel32.dll | |
+[UmsThreadYield](http://msdn2.microsoft.com/en-us/library/d7c94ed5-9536-4c39-8658-27e4237cc9ba) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.UmsThreadYield
[UnhandledExceptionFilter](http://msdn2.microsoft.com/en-us/library/ms681401) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.UnhandledExceptionFilter
[UnlockFile](http://msdn2.microsoft.com/en-us/library/aa365715) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.UnlockFile
[UnlockFileEx](http://msdn2.microsoft.com/en-us/library/aa365716) | kernel32.dll | FileAPI.h | Vanara.PInvoke.Kernel32.UnlockFileEx
@@ -1571,37 +955,13 @@ Native Method | Native DLL | Header | Managed Method
[UnregisterApplicationRecoveryCallback](http://msdn2.microsoft.com/en-us/library/aa373348) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.UnregisterApplicationRecoveryCallback
[UnregisterApplicationRestart](http://msdn2.microsoft.com/en-us/library/aa373349) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.UnregisterApplicationRestart
[UnregisterBadMemoryNotification](http://msdn2.microsoft.com/en-us/library/hh691014) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.UnregisterBadMemoryNotification
-[UnregisterConsoleIME](https://www.google.com/search?num=5&q=UnregisterConsoleIME+site%3Amicrosoft.com) | kernel32.dll | |
-[UnregisterGPNotificationInternal](https://www.google.com/search?num=5&q=UnregisterGPNotificationInternal+site%3Amicrosoft.com) | kernelbase.dll | |
-[UnregisterStateChangeNotification](https://www.google.com/search?num=5&q=UnregisterStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
-[UnregisterStateLock](https://www.google.com/search?num=5&q=UnregisterStateLock+site%3Amicrosoft.com) | kernelbase.dll | |
-[UnregisterTraceGuids](https://www.google.com/search?num=5&q=UnregisterTraceGuids+site%3Amicrosoft.com) | kernelbase.dll | |
[UnregisterWait](http://msdn2.microsoft.com/en-us/library/ms686870) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.UnregisterWait
[UnregisterWaitEx](http://msdn2.microsoft.com/en-us/library/ms686876) | kernel32.dll | LibLoaderAPI.h | Vanara.PInvoke.Kernel32.UnregisterWaitEx
-[UnregisterWaitUntilOOBECompleted](https://www.google.com/search?num=5&q=UnregisterWaitUntilOOBECompleted+site%3Amicrosoft.com) | kernel32.dll | |
-[UnsubscribeEdpEnabledStateChange](https://www.google.com/search?num=5&q=UnsubscribeEdpEnabledStateChange+site%3Amicrosoft.com) | kernelbase.dll | |
-[UnsubscribeStateChangeNotification](https://www.google.com/search?num=5&q=UnsubscribeStateChangeNotification+site%3Amicrosoft.com) | kernelbase.dll | |
-[UpdateCalendarDayOfWeek](https://www.google.com/search?num=5&q=UpdateCalendarDayOfWeek+site%3Amicrosoft.com) | kernel32.dll | |
-[UpdatePackageStatus](https://www.google.com/search?num=5&q=UpdatePackageStatus+site%3Amicrosoft.com) | kernelbase.dll | |
-[UpdatePackageStatusForUser](https://www.google.com/search?num=5&q=UpdatePackageStatusForUser+site%3Amicrosoft.com) | kernelbase.dll | |
-[UpdatePackageStatusForUserSid](https://www.google.com/search?num=5&q=UpdatePackageStatusForUserSid+site%3Amicrosoft.com) | kernelbase.dll | |
+[UpdateCalendarDayOfWeek](http://msdn2.microsoft.com/en-us/library/b9ae250a-73bb-4ec2-bb0d-e1f8b25c173c) | kernel32.dll | | Vanara.PInvoke.Kernel32.UpdateCalendarDayOfWeek
[UpdateProcThreadAttribute](http://msdn2.microsoft.com/en-us/library/ms686880) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.UpdateProcThreadAttribute
[UpdateResource](http://msdn2.microsoft.com/en-us/library/ms648049) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.UpdateResource
-[UTRegister](https://www.google.com/search?num=5&q=UTRegister+site%3Amicrosoft.com) | kernel32.dll | |
-[UTUnRegister](https://www.google.com/search?num=5&q=UTUnRegister+site%3Amicrosoft.com) | kernel32.dll | |
-[VDMConsoleOperation](https://www.google.com/search?num=5&q=VDMConsoleOperation+site%3Amicrosoft.com) | kernel32.dll | |
-[VDMOperationStarted](https://www.google.com/search?num=5&q=VDMOperationStarted+site%3Amicrosoft.com) | kernel32.dll | |
-[VerFindFile](https://www.google.com/search?num=5&q=VerFindFileA+site%3Amicrosoft.com) | kernelbase.dll | |
-[VerifyApplicationUserModelId](https://www.google.com/search?num=5&q=VerifyApplicationUserModelId+site%3Amicrosoft.com) | kernelbase.dll | |
-[VerifyConsoleIoHandle](https://www.google.com/search?num=5&q=VerifyConsoleIoHandle+site%3Amicrosoft.com) | kernel32.dll | |
-[VerifyPackageFamilyName](https://www.google.com/search?num=5&q=VerifyPackageFamilyName+site%3Amicrosoft.com) | kernelbase.dll | |
-[VerifyPackageFullName](https://www.google.com/search?num=5&q=VerifyPackageFullName+site%3Amicrosoft.com) | kernelbase.dll | |
-[VerifyPackageId](https://www.google.com/search?num=5&q=VerifyPackageId+site%3Amicrosoft.com) | kernelbase.dll | |
-[VerifyPackageRelativeApplicationId](https://www.google.com/search?num=5&q=VerifyPackageRelativeApplicationId+site%3Amicrosoft.com) | kernelbase.dll | |
[VerifyScripts](http://msdn2.microsoft.com/en-us/library/dd374129) | kernel32.dll | Winnls.h | Vanara.PInvoke.Kernel32.VerifyScripts
[VerifyVersionInfo](http://msdn2.microsoft.com/en-us/library/ms725492) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.VerifyVersionInfo
-[VerLanguageName](https://www.google.com/search?num=5&q=VerLanguageNameA+site%3Amicrosoft.com) | kernel32.dll | |
-[VerQueryValue](https://www.google.com/search?num=5&q=VerQueryValueA+site%3Amicrosoft.com) | kernelbase.dll | |
[VerSetConditionMask](http://msdn2.microsoft.com/en-us/library/ms725493) | kernel32.dll | Winnt.h | Vanara.PInvoke.Kernel32.VerSetConditionMask
[VirtualAlloc](http://msdn2.microsoft.com/en-us/library/aa366887) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.VirtualAlloc
[VirtualAllocEx](http://msdn2.microsoft.com/en-us/library/aa366890) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.VirtualAllocEx
@@ -1616,11 +976,9 @@ Native Method | Native DLL | Header | Managed Method
[VirtualQuery](http://msdn2.microsoft.com/en-us/library/aa366902) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.VirtualQuery
[VirtualQueryEx](http://msdn2.microsoft.com/en-us/library/aa366907) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.VirtualQueryEx
[VirtualUnlock](http://msdn2.microsoft.com/en-us/library/aa366910) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.VirtualUnlock
-[VirtualUnlockEx](https://www.google.com/search?num=5&q=VirtualUnlockEx+site%3Amicrosoft.com) | kernelbase.dll | |
[WaitCommEvent](http://msdn2.microsoft.com/en-us/library/aa363479) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WaitCommEvent
[WaitForDebugEvent](http://msdn2.microsoft.com/en-us/library/ms681423) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForDebugEvent
[WaitForDebugEventEx](http://msdn2.microsoft.com/en-us/library/mt171594) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForDebugEventEx
-[WaitForMachinePolicyForegroundProcessingInternal](https://www.google.com/search?num=5&q=WaitForMachinePolicyForegroundProcessingInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[WaitForMultipleObjects](http://msdn2.microsoft.com/en-us/library/ms687025) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForMultipleObjects
[WaitForMultipleObjectsEx](http://msdn2.microsoft.com/en-us/library/ms687028) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForMultipleObjectsEx
[WaitForSingleObject](http://msdn2.microsoft.com/en-us/library/ms687032) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForSingleObject
@@ -1629,54 +987,38 @@ Native Method | Native DLL | Header | Managed Method
[WaitForThreadpoolTimerCallbacks](http://msdn2.microsoft.com/en-us/library/ms687042) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForThreadpoolTimerCallbacks
[WaitForThreadpoolWaitCallbacks](http://msdn2.microsoft.com/en-us/library/ms687047) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForThreadpoolWaitCallbacks
[WaitForThreadpoolWorkCallbacks](http://msdn2.microsoft.com/en-us/library/ms687053) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WaitForThreadpoolWorkCallbacks
-[WaitForUserPolicyForegroundProcessingInternal](https://www.google.com/search?num=5&q=WaitForUserPolicyForegroundProcessingInternal+site%3Amicrosoft.com) | kernelbase.dll | |
[WaitNamedPipe](http://msdn2.microsoft.com/en-us/library/aa365800) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WaitNamedPipe
[WaitOnAddress](http://msdn2.microsoft.com/en-us/library/hh706898) | kernelbase.dll | SynchAPI.h | Vanara.PInvoke.Kernel32.WaitOnAddress
[WakeAllConditionVariable](http://msdn2.microsoft.com/en-us/library/ms687076) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WakeAllConditionVariable
[WakeByAddressAll](http://msdn2.microsoft.com/en-us/library/hh706899) | kernelbase.dll | SynchAPI.h | Vanara.PInvoke.Kernel32.WakeByAddressAll
[WakeByAddressSingle](http://msdn2.microsoft.com/en-us/library/hh706900) | kernelbase.dll | SynchAPI.h | Vanara.PInvoke.Kernel32.WakeByAddressSingle
[WakeConditionVariable](http://msdn2.microsoft.com/en-us/library/ms687080) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WakeConditionVariable
-[WerGetFlags](https://www.google.com/search?num=5&q=WerGetFlags+site%3Amicrosoft.com) | kernel32.dll | |
-[WerGetFlagsWorker](https://www.google.com/search?num=5&q=WerGetFlagsWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerpCleanupMessageMapping](https://www.google.com/search?num=5&q=WerpCleanupMessageMapping+site%3Amicrosoft.com) | kernel32.dll | |
-[WerpNotifyLoadStringResource](https://www.google.com/search?num=5&q=WerpNotifyLoadStringResource+site%3Amicrosoft.com) | kernel32.dll | |
-[WerpNotifyLoadStringResourceEx](https://www.google.com/search?num=5&q=WerpNotifyLoadStringResourceEx+site%3Amicrosoft.com) | kernel32.dll | |
-[WerpNotifyUseStringResource](https://www.google.com/search?num=5&q=WerpNotifyUseStringResource+site%3Amicrosoft.com) | kernel32.dll | |
-[WerpStringLookup](https://www.google.com/search?num=5&q=WerpStringLookup+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterAdditionalProcess](https://www.google.com/search?num=5&q=WerRegisterAdditionalProcess+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterCustomMetadata](https://www.google.com/search?num=5&q=WerRegisterCustomMetadata+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterExcludedMemoryBlock](https://www.google.com/search?num=5&q=WerRegisterExcludedMemoryBlock+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterFile](https://www.google.com/search?num=5&q=WerRegisterFile+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterFileWorker](https://www.google.com/search?num=5&q=WerRegisterFileWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterMemoryBlock](https://www.google.com/search?num=5&q=WerRegisterMemoryBlock+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterMemoryBlockWorker](https://www.google.com/search?num=5&q=WerRegisterMemoryBlockWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterRuntimeExceptionModule](https://www.google.com/search?num=5&q=WerRegisterRuntimeExceptionModule+site%3Amicrosoft.com) | kernel32.dll | |
-[WerRegisterRuntimeExceptionModuleWorker](https://www.google.com/search?num=5&q=WerRegisterRuntimeExceptionModuleWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerSetFlags](https://www.google.com/search?num=5&q=WerSetFlags+site%3Amicrosoft.com) | kernel32.dll | |
-[WerSetFlagsWorker](https://www.google.com/search?num=5&q=WerSetFlagsWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterAdditionalProcess](https://www.google.com/search?num=5&q=WerUnregisterAdditionalProcess+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterCustomMetadata](https://www.google.com/search?num=5&q=WerUnregisterCustomMetadata+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterExcludedMemoryBlock](https://www.google.com/search?num=5&q=WerUnregisterExcludedMemoryBlock+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterFile](https://www.google.com/search?num=5&q=WerUnregisterFile+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterFileWorker](https://www.google.com/search?num=5&q=WerUnregisterFileWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterMemoryBlock](https://www.google.com/search?num=5&q=WerUnregisterMemoryBlock+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterMemoryBlockWorker](https://www.google.com/search?num=5&q=WerUnregisterMemoryBlockWorker+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterRuntimeExceptionModule](https://www.google.com/search?num=5&q=WerUnregisterRuntimeExceptionModule+site%3Amicrosoft.com) | kernel32.dll | |
-[WerUnregisterRuntimeExceptionModuleWorker](https://www.google.com/search?num=5&q=WerUnregisterRuntimeExceptionModuleWorker+site%3Amicrosoft.com) | kernel32.dll | |
+[WerGetFlags](http://msdn2.microsoft.com/en-us/library/8c5f08c0-e2d1-448c-9a57-ef19897f64c6) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerGetFlags
+[WerRegisterAdditionalProcess](http://msdn2.microsoft.com/en-us/library/mt492585) | kernel32.dll | Werapi.h | Vanara.PInvoke.Kernel32.WerRegisterAdditionalProcess
+[WerRegisterCustomMetadata](http://msdn2.microsoft.com/en-us/library/55FB3110-314A-4327-AA8F-3AF77B7006DD) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerRegisterCustomMetadata
+[WerRegisterExcludedMemoryBlock](http://msdn2.microsoft.com/en-us/library/6CDA8EDD-C8A5-471D-9716-3AB29E571133) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerRegisterExcludedMemoryBlock
+[WerRegisterFile](http://msdn2.microsoft.com/en-us/library/4b4bb1bb-6782-447a-901f-75702256d907) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerRegisterFile
+[WerRegisterMemoryBlock](http://msdn2.microsoft.com/en-us/library/10fa2bf3-ec12-4c7c-b986-9b22cdaa7319) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerRegisterMemoryBlock
+[WerRegisterRuntimeExceptionModule](http://msdn2.microsoft.com/en-us/library/b0fb2c0d-cc98-43cc-a508-e80545377b7f) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerRegisterRuntimeExceptionModule
+[WerSetFlags](http://msdn2.microsoft.com/en-us/library/2a71203f-3a08-461f-a230-e3fee00d9d99) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerSetFlags
+[WerUnregisterAdditionalProcess](http://msdn2.microsoft.com/en-us/library/CE840EE8-5EB6-4F0F-935E-5DA9097E950F) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterAdditionalProcess
+[WerUnregisterCustomMetadata](http://msdn2.microsoft.com/en-us/library/29DB2CE5-2A96-450B-96C8-082B786613F9) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterCustomMetadata
+[WerUnregisterExcludedMemoryBlock](http://msdn2.microsoft.com/en-us/library/99FF746E-8EFC-47DB-AEE6-EC46F7BC7F0B) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterExcludedMemoryBlock
+[WerUnregisterFile](http://msdn2.microsoft.com/en-us/library/bb513630) | kernel32.dll | Werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterFile
+[WerUnregisterMemoryBlock](http://msdn2.microsoft.com/en-us/library/016800e8-4a03-40f6-9dba-54cd9082eb48) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterMemoryBlock
+[WerUnregisterRuntimeExceptionModule](http://msdn2.microsoft.com/en-us/library/1a315923-b554-4363-a607-076690fc76a1) | kernel32.dll | werapi.h | Vanara.PInvoke.Kernel32.WerUnregisterRuntimeExceptionModule
[WideCharToMultiByte](http://msdn2.microsoft.com/en-us/library/dd374130) | kernel32.dll | Stringapiset.h | Vanara.PInvoke.Kernel32.WideCharToMultiByte
[WinExec](http://msdn2.microsoft.com/en-us/library/ms687393) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WinExec
[Wow64DisableWow64FsRedirection](http://msdn2.microsoft.com/en-us/library/aa365743) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.Wow64DisableWow64FsRedirection
-[Wow64EnableWow64FsRedirection](https://www.google.com/search?num=5&q=Wow64EnableWow64FsRedirection+site%3Amicrosoft.com) | kernel32.dll | |
-[Wow64GetThreadContext](https://www.google.com/search?num=5&q=Wow64GetThreadContext+site%3Amicrosoft.com) | kernel32.dll | |
-[Wow64GetThreadSelectorEntry](https://www.google.com/search?num=5&q=Wow64GetThreadSelectorEntry+site%3Amicrosoft.com) | kernel32.dll | |
+[Wow64EnableWow64FsRedirection](http://msdn2.microsoft.com/en-us/library/8d11a7ba-540d-4bd0-881a-a61605357dd8) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.Wow64EnableWow64FsRedirection
+[Wow64GetThreadContext](http://msdn2.microsoft.com/en-us/library/1bac28e1-3558-43c4-97e4-d8bb9514c38e) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.Wow64GetThreadContext
+[Wow64GetThreadSelectorEntry](http://msdn2.microsoft.com/en-us/library/68393913-6725-4cc6-90b9-57da2a96c91e) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.Wow64GetThreadSelectorEntry
[Wow64RevertWow64FsRedirection](http://msdn2.microsoft.com/en-us/library/aa365745) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.Wow64RevertWow64FsRedirection
-[Wow64SetThreadContext](https://www.google.com/search?num=5&q=Wow64SetThreadContext+site%3Amicrosoft.com) | kernel32.dll | |
+[Wow64SetThreadContext](http://msdn2.microsoft.com/en-us/library/4119c945-b654-4634-a88b-e41bc762018a) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.Wow64SetThreadContext
[Wow64SetThreadDefaultGuestMachine](https://www.google.com/search?num=5&q=Wow64SetThreadDefaultGuestMachine+site%3Amicrosoft.com) | kernelbase.dll | | Vanara.PInvoke.Kernel32.Wow64SetThreadDefaultGuestMachine
-[Wow64SuspendThread](https://www.google.com/search?num=5&q=Wow64SuspendThread+site%3Amicrosoft.com) | kernel32.dll | |
-[wprintf](https://www.google.com/search?num=5&q=wprintf+site%3Amicrosoft.com) | kernelbase.dll | |
+[Wow64SuspendThread](http://msdn2.microsoft.com/en-us/library/d976675a-5400-41ac-a11d-c39a1b2dd50d) | kernel32.dll | winbase.h | Vanara.PInvoke.Kernel32.Wow64SuspendThread
[WriteConsole](https://www.google.com/search?num=5&q=WriteConsoleA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.WriteConsole
[WriteConsoleInput](https://www.google.com/search?num=5&q=WriteConsoleInputA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.WriteConsoleInput
-[WriteConsoleInputVDM](https://www.google.com/search?num=5&q=WriteConsoleInputVDMA+site%3Amicrosoft.com) | kernel32.dll | |
[WriteConsoleOutput](https://www.google.com/search?num=5&q=WriteConsoleOutputA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.WriteConsoleOutput
[WriteConsoleOutputAttribute](https://www.google.com/search?num=5&q=WriteConsoleOutputAttribute+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.WriteConsoleOutputAttribute
[WriteConsoleOutputCharacter](https://www.google.com/search?num=5&q=WriteConsoleOutputCharacterA+site%3Amicrosoft.com) | kernel32.dll | Wincon.h | Vanara.PInvoke.Kernel32.WriteConsoleOutputCharacter
@@ -1689,14 +1031,9 @@ Native Method | Native DLL | Header | Managed Method
[WriteProcessMemory](http://msdn2.microsoft.com/en-us/library/ms681674) | kernel32.dll | WinBase.h | Vanara.PInvoke.Kernel32.WriteProcessMemory
[WriteProfileSection](http://msdn2.microsoft.com/en-us/library/ms725503) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WriteProfileSection
[WriteProfileString](http://msdn2.microsoft.com/en-us/library/ms725504) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WriteProfileString
-[WriteStateAtomValue](https://www.google.com/search?num=5&q=WriteStateAtomValue+site%3Amicrosoft.com) | kernelbase.dll | |
-[WriteStateContainerValue](https://www.google.com/search?num=5&q=WriteStateContainerValue+site%3Amicrosoft.com) | kernelbase.dll | |
[WriteTapemark](http://msdn2.microsoft.com/en-us/library/aa362668) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WriteTapemark
[WTSGetActiveConsoleSessionId](http://msdn2.microsoft.com/en-us/library/aa383835) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.WTSGetActiveConsoleSessionId
-[WTSGetServiceSessionId](https://www.google.com/search?num=5&q=WTSGetServiceSessionId+site%3Amicrosoft.com) | kernelbase.dll | |
-[WTSIsServerContainer](https://www.google.com/search?num=5&q=WTSIsServerContainer+site%3Amicrosoft.com) | kernelbase.dll | |
[ZombifyActCtx](http://msdn2.microsoft.com/en-us/library/aa376622) | kernel32.dll | Winbase.h | Vanara.PInvoke.Kernel32.ZombifyActCtx
-[ZombifyActCtxWorker](https://www.google.com/search?num=5&q=ZombifyActCtxWorker+site%3Amicrosoft.com) | kernel32.dll | |
### Structures
Native Structure | Header | Managed Structure
--- | --- | ---
@@ -1706,8 +1043,11 @@ Native Structure | Header | Managed Structure
[BLOCK_DATA](https://www.google.com/search?num=5&q=BLOCK_DATA+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PROCESS_HEAP_ENTRY+BLOCK_REGION_UNION+BLOCK_DATA
[BY_HANDLE_FILE_INFORMATION](http://msdn2.microsoft.com/en-us/library/aa363788) | FileAPI.h | Vanara.PInvoke.Kernel32+BY_HANDLE_FILE_INFORMATION
[CACHE_DESCRIPTOR](http://msdn2.microsoft.com/en-us/library/ms681979) | WinNT.h | Vanara.PInvoke.Kernel32+CACHE_DESCRIPTOR
+[CALDATETIME](http://msdn2.microsoft.com/en-us/library/a714ff32-2b1f-4256-931e-324d64daf2ac) | | Vanara.PInvoke.Kernel32+CALDATETIME
[CFG_CALL_TARGET_INFO](http://msdn2.microsoft.com/en-us/library/mt219054) | Ntmmapi.h | Vanara.PInvoke.Kernel32+CFG_CALL_TARGET_INFO
[CHAR_INFO](https://www.google.com/search?num=5&q=CHAR_INFO+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+CHAR_INFO
+[ChunkFinished](https://www.google.com/search?num=5&q=ChunkFinished+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+ChunkFinished
+[ChunkStarted](https://www.google.com/search?num=5&q=ChunkStarted+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+ChunkStarted
[COMMCONFIG](http://msdn2.microsoft.com/en-us/library/aa363188) | Winbase.h | Vanara.PInvoke.Kernel32+COMMCONFIG
[COMMPROP](http://msdn2.microsoft.com/en-us/library/aa363189) | WinBase.h | Vanara.PInvoke.Kernel32+COMMPROP
[COMMTIMEOUTS](http://msdn2.microsoft.com/en-us/library/aa363190) | Winbase.h | Vanara.PInvoke.Kernel32+COMMTIMEOUTS
@@ -1723,6 +1063,8 @@ Native Structure | Header | Managed Structure
[CONTEXT](https://www.google.com/search?num=5&q=CONTEXT+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+CONTEXT
[CONTEXT64](https://www.google.com/search?num=5&q=CONTEXT64+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+CONTEXT64
[COORD](https://www.google.com/search?num=5&q=COORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+COORD
+[COPYFILE2_EXTENDED_PARAMETERS](http://msdn2.microsoft.com/en-us/library/a8da62e5-bc49-4aff-afaa-e774393b7120) | winbase.h | Vanara.PInvoke.Kernel32+COPYFILE2_EXTENDED_PARAMETERS
+[COPYFILE2_MESSAGE](http://msdn2.microsoft.com/en-us/library/ab841bee-90a0-4beb-99d3-764e608c3872) | winbase.h | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE
[CPINFO](http://msdn2.microsoft.com/en-us/library/dd317780) | Winnls.h | Vanara.PInvoke.Kernel32+CPINFO
[CPINFOEX](http://msdn2.microsoft.com/en-us/library/dd317781) | Winnls.h | Vanara.PInvoke.Kernel32+CPINFOEX
[CPU_RATE_CONTROL_UNION](https://www.google.com/search?num=5&q=CPU_RATE_CONTROL_UNION+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+JOBOBJECT_CPU_RATE_CONTROL_INFORMATION+CPU_RATE_CONTROL_UNION
@@ -1733,12 +1075,16 @@ Native Structure | Header | Managed Structure
[CURRENCYFMT](http://msdn2.microsoft.com/en-us/library/dd317784) | Winnls.h | Vanara.PInvoke.Kernel32+CURRENCYFMT
[DCB](http://msdn2.microsoft.com/en-us/library/aa363214) | Winbase.h | Vanara.PInvoke.Kernel32+DCB
[DETAIL](https://www.google.com/search?num=5&q=DETAIL+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+REASON_CONTEXT+REASON+DETAIL
+[DUMMYSTRUCTNAME](https://www.google.com/search?num=5&q=DUMMYSTRUCTNAME+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PACKAGE_VERSION+DUMMYSTRUCTNAME
[DYNAMIC_TIME_ZONE_INFORMATION](http://msdn2.microsoft.com/en-us/library/ms724253) | WinBase.h | Vanara.PInvoke.Kernel32+DYNAMIC_TIME_ZONE_INFORMATION
[ENCLAVE_CREATE_INFO_SGX](http://msdn2.microsoft.com/en-us/library/mt592867) | Winnt.h | Vanara.PInvoke.Kernel32+ENCLAVE_CREATE_INFO_SGX
[ENCLAVE_CREATE_INFO_VBS](http://msdn2.microsoft.com/en-us/library/mt844238) | Winnt.h | Vanara.PInvoke.Kernel32+ENCLAVE_CREATE_INFO_VBS
[ENCLAVE_INIT_INFO_SGX](http://msdn2.microsoft.com/en-us/library/mt592868) | Winnt.h | Vanara.PInvoke.Kernel32+ENCLAVE_INIT_INFO_SGX
[ENCLAVE_INIT_INFO_VBS](http://msdn2.microsoft.com/en-us/library/mt844241) | Winnt.h | Vanara.PInvoke.Kernel32+ENCLAVE_INIT_INFO_VBS
[ENCODING_INFO](https://www.google.com/search?num=5&q=ENCODING_INFO+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+ENCODING_INFO
+[ENUM_PAGE_FILE_INFORMATION](http://msdn2.microsoft.com/en-us/library/020f3be8-f624-4788-8079-0f7679c9bef0) | psapi.h | Vanara.PInvoke.Kernel32+ENUM_PAGE_FILE_INFORMATION
+[Error](https://www.google.com/search?num=5&q=Error+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+Error
+[Event](https://www.google.com/search?num=5&q=Event+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Event
[EXCEPTION_DEBUG_INFO](http://msdn2.microsoft.com/en-us/library/ms679326) | WinBase.h | Vanara.PInvoke.Kernel32+DEBUG_EVENT+EXCEPTION_INFO+EXCEPTION_DEBUG_INFO
[EXCEPTION_POINTERS](http://msdn2.microsoft.com/en-us/library/ms679331) | WinNT.h | Vanara.PInvoke.Kernel32+EXCEPTION_POINTERS
[EXCEPTION_RECORD](http://msdn2.microsoft.com/en-us/library/aa363082) | WinNT.h | Vanara.PInvoke.Kernel32+EXCEPTION_RECORD
@@ -1748,8 +1094,11 @@ Native Structure | Header | Managed Structure
[FLOATING_SAVE_AREA](http://msdn2.microsoft.com/en-us/library/ms681671) | WinNT.h | Vanara.PInvoke.Kernel32+CONTEXT+FLOATING_SAVE_AREA
[FOCUS_EVENT_RECORD](https://www.google.com/search?num=5&q=FOCUS_EVENT_RECORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+FOCUS_EVENT_RECORD
[GROUP_AFFINITY](http://msdn2.microsoft.com/en-us/library/dd405500) | WinNT.h | Vanara.PInvoke.Kernel32+GROUP_AFFINITY
+[HARDWARE_COUNTER_DATA](http://msdn2.microsoft.com/en-us/library/dd796394) | Winnt.h | Vanara.PInvoke.Kernel32+HARDWARE_COUNTER_DATA
[HEAP_OPTIMIZE_RESOURCES_INFORMATION](https://www.google.com/search?num=5&q=HEAP_OPTIMIZE_RESOURCES_INFORMATION+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+HEAP_OPTIMIZE_RESOURCES_INFORMATION
[HEAP_SUMMARY](https://www.google.com/search?num=5&q=HEAP_SUMMARY+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+HEAP_SUMMARY
+[HEAPENTRY32](http://msdn2.microsoft.com/en-us/library/c5f1dc66-d44f-4491-b0b7-961b163d0f1f) | tlhelp32.h | Vanara.PInvoke.Kernel32+HEAPENTRY32
+[HEAPLIST32](http://msdn2.microsoft.com/en-us/library/61e01d23-9f15-44c5-9f6d-45df4809ccad) | tlhelp32.h | Vanara.PInvoke.Kernel32+HEAPLIST32
[INIT_ONCE](https://www.google.com/search?num=5&q=INIT_ONCE+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+INIT_ONCE
[INPUT_RECORD](https://www.google.com/search?num=5&q=INPUT_RECORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+INPUT_RECORD
[INPUT_RECORD_EVENT](https://www.google.com/search?num=5&q=INPUT_RECORD_EVENT+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+INPUT_RECORD+INPUT_RECORD_EVENT
@@ -1780,18 +1129,30 @@ Native Structure | Header | Managed Structure
[LDT_ENTRY](http://msdn2.microsoft.com/en-us/library/ms680348) | WinNT.h | Vanara.PInvoke.Kernel32+LDT_ENTRY
[LOAD_DLL_DEBUG_INFO](http://msdn2.microsoft.com/en-us/library/ms680351) | WinBase.h | Vanara.PInvoke.Kernel32+DEBUG_EVENT+EXCEPTION_INFO+LOAD_DLL_DEBUG_INFO
[M128A](https://www.google.com/search?num=5&q=M128A+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+CONTEXT64+M128A
+[MEMORY_BASIC_INFORMATION](http://msdn2.microsoft.com/en-us/library/dc3fa48e-0986-49cc-88a9-ff8179fbe5f0) | winnt.h | Vanara.PInvoke.Kernel32+MEMORY_BASIC_INFORMATION
[MEMORY_PRIORITY_INFORMATION](http://msdn2.microsoft.com/en-us/library/hh448387) | WinBase.h | Vanara.PInvoke.Kernel32+MEMORY_PRIORITY_INFORMATION
[MEMORYSTATUS](http://msdn2.microsoft.com/en-us/library/aa366772) | WinBase.h | Vanara.PInvoke.Kernel32+MEMORYSTATUS
[MEMORYSTATUSEX](http://msdn2.microsoft.com/en-us/library/aa366770) | WinBase.h | Vanara.PInvoke.Kernel32+MEMORYSTATUSEX
[MENU_EVENT_RECORD](https://www.google.com/search?num=5&q=MENU_EVENT_RECORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+MENU_EVENT_RECORD
+[MODULEENTRY32](http://msdn2.microsoft.com/en-us/library/305fab35-625c-42e3-a434-e2513e4c8870) | tlhelp32.h | Vanara.PInvoke.Kernel32+MODULEENTRY32
+[MODULEINFO](http://msdn2.microsoft.com/en-us/library/583caafe-7fa3-4041-b5bc-4e8899b3a08a) | psapi.h | Vanara.PInvoke.Kernel32+MODULEINFO
[MOUSE_EVENT_RECORD](https://www.google.com/search?num=5&q=MOUSE_EVENT_RECORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+MOUSE_EVENT_RECORD
+[Mutant](https://www.google.com/search?num=5&q=Mutant+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Mutant
[NLSVERSIONINFO](http://msdn2.microsoft.com/en-us/library/dd319086) | Winnls.h | Vanara.PInvoke.Kernel32+NLSVERSIONINFO
[NLSVERSIONINFOEX](http://msdn2.microsoft.com/en-us/library/dd319087) | Winnls.h | Vanara.PInvoke.Kernel32+NLSVERSIONINFOEX
[NUMBERFMT](http://msdn2.microsoft.com/en-us/library/dd319095) | Winnls.h | Vanara.PInvoke.Kernel32+NUMBERFMT
[OFSTRUCT](http://msdn2.microsoft.com/en-us/library/aa365282) | WinBase.h | Vanara.PInvoke.Kernel32+OFSTRUCT
[OSVERSIONINFOEX](http://msdn2.microsoft.com/en-us/library/ms724833) | Winnt.h | Vanara.PInvoke.Kernel32+OSVERSIONINFOEX
[OUTPUT_DEBUG_STRING_INFO](http://msdn2.microsoft.com/en-us/library/ms680545) | WinBase.h | Vanara.PInvoke.Kernel32+DEBUG_EVENT+EXCEPTION_INFO+OUTPUT_DEBUG_STRING_INFO
+[PACKAGE_ID](http://msdn2.microsoft.com/en-us/library/4B15281A-2227-47B7-A750-0A01DB8543FC) | appmodel.h | Vanara.PInvoke.Kernel32+PACKAGE_ID
+[PACKAGE_INFO_REFERENCE](https://www.google.com/search?num=5&q=PACKAGE_INFO_REFERENCE+site%3Amicrosoft.com) | appmodel.h | Vanara.PInvoke.Kernel32+PACKAGE_INFO_REFERENCE
+[PACKAGE_VERSION](http://msdn2.microsoft.com/en-us/library/8543DF84-A908-4DF5-AEE6-169FECB2AA97) | appmodel.h | Vanara.PInvoke.Kernel32+PACKAGE_VERSION
+[PERFORMANCE_DATA](http://msdn2.microsoft.com/en-us/library/dd796401) | Winnt.h | Vanara.PInvoke.Kernel32+PERFORMANCE_DATA
+[PERFORMANCE_INFORMATION](http://msdn2.microsoft.com/en-us/library/efc47f6e-1a60-4e77-9e5d-c725f9042ab8) | psapi.h | Vanara.PInvoke.Kernel32+PERFORMANCE_INFORMATION
+[PollContinue](https://www.google.com/search?num=5&q=PollContinue+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+PollContinue
+[Process](https://www.google.com/search?num=5&q=Process+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Process
[PROCESS_INFORMATION](http://msdn2.microsoft.com/en-us/library/ms684873) | WinBase.h | Vanara.PInvoke.Kernel32+PROCESS_INFORMATION
+[PROCESS_MEMORY_COUNTERS](http://msdn2.microsoft.com/en-us/library/288b5865-28a3-478b-ad32-c710fe4f3a81) | psapi.h | Vanara.PInvoke.Kernel32+PROCESS_MEMORY_COUNTERS
[PROCESS_MEMORY_EXHAUSTION_INFO](http://msdn2.microsoft.com/en-us/library/mt767997) | WinBase.h | Vanara.PInvoke.Kernel32+PROCESS_MEMORY_EXHAUSTION_INFO
[PROCESS_MITIGATION_ASLR_POLICY](http://msdn2.microsoft.com/en-us/library/hh769086) | WinNT.h | Vanara.PInvoke.Kernel32+PROCESS_MITIGATION_ASLR_POLICY
[PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY](http://msdn2.microsoft.com/en-us/library/mt706242) | WinNT.h | Vanara.PInvoke.Kernel32+PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY
@@ -1808,15 +1169,36 @@ Native Structure | Header | Managed Structure
[PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY](http://msdn2.microsoft.com/en-us/library/mt843942) | WinNT.h | Vanara.PInvoke.Kernel32+PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY
[PROCESS_POWER_THROTTLING_STATE](http://msdn2.microsoft.com/en-us/library/mt804324) | Processthreadsapi.h | Vanara.PInvoke.Kernel32+PROCESS_POWER_THROTTLING_STATE
[PROCESS_PROTECTION_LEVEL_INFORMATION](http://msdn2.microsoft.com/en-us/library/mt823702) | Processthreadsapi.h | Vanara.PInvoke.Kernel32+PROCESS_PROTECTION_LEVEL_INFORMATION
+[PROCESSENTRY32](http://msdn2.microsoft.com/en-us/library/9e2f7345-52bf-4bfc-9761-90b0b374c727) | tlhelp32.h | Vanara.PInvoke.Kernel32+PROCESSENTRY32
[PROCESSOR_NUMBER](http://msdn2.microsoft.com/en-us/library/dd405505) | WinNT.h | Vanara.PInvoke.Kernel32+PROCESSOR_NUMBER
+[PSAPI_WS_WATCH_INFORMATION](http://msdn2.microsoft.com/en-us/library/61083366-2a55-431c-807a-3eb85ba0b347) | psapi.h | Vanara.PInvoke.Kernel32+PSAPI_WS_WATCH_INFORMATION
+[PSAPI_WS_WATCH_INFORMATION_EX](http://msdn2.microsoft.com/en-us/library/fb0429b1-ec93-401c-aeb1-f7e9d9acfa47) | psapi.h | Vanara.PInvoke.Kernel32+PSAPI_WS_WATCH_INFORMATION_EX
+[PSS_ALLOCATOR](http://msdn2.microsoft.com/en-us/library/54225F76-9A2E-4CB3-A3B5-9F9DB5551D53) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_ALLOCATOR
+[PSS_AUXILIARY_PAGE_ENTRY](http://msdn2.microsoft.com/en-us/library/A3D948E6-6FFE-4732-A8C7-A292FDA07D7C) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_AUXILIARY_PAGE_ENTRY
+[PSS_AUXILIARY_PAGES_INFORMATION](http://msdn2.microsoft.com/en-us/library/122DD3DF-002A-4250-9E37-BA239638A684) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_AUXILIARY_PAGES_INFORMATION
+[PSS_HANDLE_ENTRY](http://msdn2.microsoft.com/en-us/library/F56E8C35-949A-4DEE-973F-CF24F6596036) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY
+[PSS_HANDLE_INFORMATION](http://msdn2.microsoft.com/en-us/library/77192849-D919-4947-9BFF-343C166C5A51) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_HANDLE_INFORMATION
+[PSS_HANDLE_TRACE_INFORMATION](http://msdn2.microsoft.com/en-us/library/0877DF1F-044C-48F2-9BCC-938EBD6D46EE) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_HANDLE_TRACE_INFORMATION
+[PSS_PERFORMANCE_COUNTERS](http://msdn2.microsoft.com/en-us/library/298C1FC8-D19D-4DB3-84AA-3870D06B16A1) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_PERFORMANCE_COUNTERS
+[PSS_PROCESS_INFORMATION](http://msdn2.microsoft.com/en-us/library/D629FA42-B501-4A0E-9B53-6D70E580B687) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_PROCESS_INFORMATION
+[PSS_THREAD_ENTRY](http://msdn2.microsoft.com/en-us/library/99C89DBB-8C12-482E-B33D-AE59C37662CF) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_THREAD_ENTRY
+[PSS_THREAD_INFORMATION](http://msdn2.microsoft.com/en-us/library/68BC42FD-9A30-462F-AFB1-DF9587C50F45) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_THREAD_INFORMATION
+[PSS_VA_CLONE_INFORMATION](http://msdn2.microsoft.com/en-us/library/F93D61B0-EDB2-4560-A69F-CF839EC98B53) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_VA_CLONE_INFORMATION
+[PSS_VA_SPACE_ENTRY](http://msdn2.microsoft.com/en-us/library/69B8F6A3-76DF-421B-B89B-73BA3254F897) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_VA_SPACE_ENTRY
+[PSS_VA_SPACE_INFORMATION](http://msdn2.microsoft.com/en-us/library/F38FF7EB-DDC5-4692-8F57-8D633193D891) | processsnapshot.h | Vanara.PInvoke.Kernel32+PSS_VA_SPACE_INFORMATION
[PTP_CALLBACK_ENVIRON](https://www.google.com/search?num=5&q=PTP_CALLBACK_ENVIRON+site%3Amicrosoft.com) | threadpoolapiset.h | Vanara.PInvoke.Kernel32+PTP_CALLBACK_ENVIRON
[REASON](https://www.google.com/search?num=5&q=REASON+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+REASON_CONTEXT+REASON
[REASON_CONTEXT](http://msdn2.microsoft.com/en-us/library/dd405536) | MinWinBase.h | Vanara.PInvoke.Kernel32+REASON_CONTEXT
[REGION_DATA](https://www.google.com/search?num=5&q=REGION_DATA+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PROCESS_HEAP_ENTRY+BLOCK_REGION_UNION+REGION_DATA
[RIP_INFO](http://msdn2.microsoft.com/en-us/library/ms680587) | WinBase.h | Vanara.PInvoke.Kernel32+DEBUG_EVENT+EXCEPTION_INFO+RIP_INFO
+[Section](https://www.google.com/search?num=5&q=Section+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Section
+[Semaphore](https://www.google.com/search?num=5&q=Semaphore+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Semaphore
+[SLIST_ENTRY](http://msdn2.microsoft.com/en-us/library/ff563805) | Wdm.h | Vanara.PInvoke.Kernel32+SLIST_ENTRY
[SMALL_RECT](https://www.google.com/search?num=5&q=SMALL_RECT+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+SMALL_RECT
[SRWLOCK](https://www.google.com/search?num=5&q=SRWLOCK+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+SRWLOCK
[STARTUPINFO](http://msdn2.microsoft.com/en-us/library/ms686331) | WinBase.h | Vanara.PInvoke.Kernel32+STARTUPINFO
+[StreamFinished](https://www.google.com/search?num=5&q=StreamFinished+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+StreamFinished
+[StreamStarted](https://www.google.com/search?num=5&q=StreamStarted+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+StreamStarted
[SYNCHRONIZATION_BARRIER](https://www.google.com/search?num=5&q=SYNCHRONIZATION_BARRIER+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+SYNCHRONIZATION_BARRIER
[SYSTEM_CPU_SET_INFORMATION](http://msdn2.microsoft.com/en-us/library/mt186429) | Winnt.h | Vanara.PInvoke.Kernel32+SYSTEM_CPU_SET_INFORMATION
[SYSTEM_CPU_SET_INFORMATION1](https://www.google.com/search?num=5&q=SYSTEM_CPU_SET_INFORMATION1+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+SYSTEM_CPU_SET_INFORMATION1
@@ -1826,12 +1208,21 @@ Native Structure | Header | Managed Structure
[SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION](https://www.google.com/search?num=5&q=SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION+site%3Amicrosoft.com) | WinNT.h | Vanara.PInvoke.Kernel32+SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION
[TAPE_GET_DRIVE_PARAMETERS](http://msdn2.microsoft.com/en-us/library/aa362562) | Winnt.h | Vanara.PInvoke.Kernel32+TAPE_GET_DRIVE_PARAMETERS
[TAPE_GET_MEDIA_PARAMETERS](http://msdn2.microsoft.com/en-us/library/aa362564) | Winnt.h | Vanara.PInvoke.Kernel32+TAPE_GET_MEDIA_PARAMETERS
+[Thread](https://www.google.com/search?num=5&q=Thread+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+Thread
[THREAD_POWER_THROTTLING_STATE](http://msdn2.microsoft.com/en-us/library/mt804325) | Processthreadsapi.h | Vanara.PInvoke.Kernel32+THREAD_POWER_THROTTLING_STATE
+[THREADENTRY32](http://msdn2.microsoft.com/en-us/library/923feca1-8807-4752-8a5a-79075688aabd) | tlhelp32.h | Vanara.PInvoke.Kernel32+THREADENTRY32
[TIME_ZONE_INFORMATION](http://msdn2.microsoft.com/en-us/library/ms725481) | Winbase.h | Vanara.PInvoke.Kernel32+TIME_ZONE_INFORMATION
[TP_POOL_STACK_INFORMATION](https://www.google.com/search?num=5&q=TP_POOL_STACK_INFORMATION+site%3Amicrosoft.com) | threadpoolapiset.h | Vanara.PInvoke.Kernel32+TP_POOL_STACK_INFORMATION
+[UMS_SCHEDULER_STARTUP_INFO](http://msdn2.microsoft.com/en-us/library/e3f7b1b7-d2b8-432d-bce7-3633292e855b) | winbase.h | Vanara.PInvoke.Kernel32+UMS_SCHEDULER_STARTUP_INFO
+[UMS_SYSTEM_THREAD_INFORMATION](http://msdn2.microsoft.com/en-us/library/eecdc592-5046-47c3-a4c6-ecb10899db3c) | winbase.h | Vanara.PInvoke.Kernel32+UMS_SYSTEM_THREAD_INFORMATION
+[Union](https://www.google.com/search?num=5&q=Union+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+COPYFILE2_MESSAGE+Union
+[UNION](https://www.google.com/search?num=5&q=UNION+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+PSS_HANDLE_ENTRY+UNION
[UNLOAD_DLL_DEBUG_INFO](http://msdn2.microsoft.com/en-us/library/ms681403) | WinBase.h | Vanara.PInvoke.Kernel32+DEBUG_EVENT+EXCEPTION_INFO+UNLOAD_DLL_DEBUG_INFO
[WIN32_FILE_ATTRIBUTE_DATA](http://msdn2.microsoft.com/en-us/library/aa365739) | WinBase.h | Vanara.PInvoke.Kernel32+WIN32_FILE_ATTRIBUTE_DATA
[WIN32_FIND_STREAM_DATA](http://msdn2.microsoft.com/en-us/library/aa365741) | WinBase.h | Vanara.PInvoke.Kernel32+WIN32_FIND_STREAM_DATA
[WIN32_MEMORY_RANGE_ENTRY](http://msdn2.microsoft.com/en-us/library/hh780544) | WinBase.h | Vanara.PInvoke.Kernel32+WIN32_MEMORY_RANGE_ENTRY
[WINDOW_BUFFER_SIZE_RECORD](https://www.google.com/search?num=5&q=WINDOW_BUFFER_SIZE_RECORD+site%3Amicrosoft.com) | Wincon.h | Vanara.PInvoke.Kernel32+WINDOW_BUFFER_SIZE_RECORD
+[WOW64_CONTEXT](http://msdn2.microsoft.com/en-us/library/b27205a2-2c33-4f45-8948-9919bcd2355a) | winnt.h | Vanara.PInvoke.Kernel32+WOW64_CONTEXT
+[WOW64_FLOATING_SAVE_AREA](http://msdn2.microsoft.com/en-us/library/56fba1c1-432b-40a8-b882-e4c637c03d5d) | winnt.h | Vanara.PInvoke.Kernel32+WOW64_FLOATING_SAVE_AREA
+[WOW64_LDT_ENTRY](http://msdn2.microsoft.com/en-us/library/a571cd2f-0873-4ad5-bcb8-c0da2d47a820) | winnt.h | Vanara.PInvoke.Kernel32+WOW64_LDT_ENTRY
[XSAVE_FORMAT64](https://www.google.com/search?num=5&q=XSAVE_FORMAT64+site%3Amicrosoft.com) | | Vanara.PInvoke.Kernel32+CONTEXT64+XSAVE_FORMAT64
diff --git a/PInvoke/Kernel32/InterlockedApi.cs b/PInvoke/Kernel32/InterlockedApi.cs
new file mode 100644
index 00000000..1285feeb
--- /dev/null
+++ b/PInvoke/Kernel32/InterlockedApi.cs
@@ -0,0 +1,210 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ ///
+ /// Initializes the head of a singly linked list.
+ ///
+ ///
+ ///
+ /// A pointer to an SLIST_HEADER structure that represents the head of a singly linked list. This structure is for system use only.
+ ///
+ ///
+ ///
+ /// This function does not return a value.
+ ///
+ ///
+ ///
+ /// All list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary. Unaligned items can cause unpredictable results.
+ /// See _aligned_malloc.
+ ///
+ ///
+ /// To add items to the list, use the InterlockedPushEntrySList function. To remove items from the list, use the
+ /// InterlockedPopEntrySList function.
+ ///
+ /// Examples
+ /// For an example, see Using Singly Linked Lists.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-initializeslisthead void
+ // InitializeSListHead( PSLIST_HEADER ListHead );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "4e34f947-1687-4ea9-aaa1-8d8dc11dad70")]
+ public static extern void InitializeSListHead(IntPtr ListHead);
+
+ ///
+ /// Removes all items from a singly linked list. Access to the list is synchronized on a multiprocessor system.
+ ///
+ ///
+ ///
+ /// Pointer to an SLIST_HEADER structure that represents the head of the singly linked list. This structure is for system use only.
+ ///
+ ///
+ ///
+ /// The return value is a pointer to the items removed from the list. If the list is empty, the return value is NULL.
+ ///
+ ///
+ ///
+ /// All list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary; otherwise, this function will behave
+ /// unpredictably. See _aligned_malloc.
+ ///
+ /// Examples
+ /// For an example, see Using Singly Linked Lists.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-interlockedflushslist PSLIST_ENTRY
+ // InterlockedFlushSList( PSLIST_HEADER ListHead );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "3fde3377-8a98-4976-a350-2c173b209e8c")]
+ public static extern IntPtr InterlockedFlushSList(IntPtr ListHead);
+
+ ///
+ /// Removes an item from the front of a singly linked list. Access to the list is synchronized on a multiprocessor system.
+ ///
+ ///
+ /// Pointer to an SLIST_HEADER structure that represents the head of a singly linked list.
+ ///
+ ///
+ /// The return value is a pointer to the item removed from the list. If the list is empty, the return value is NULL.
+ ///
+ ///
+ ///
+ /// All list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary; otherwise, this function will behave
+ /// unpredictably. See _aligned_malloc.
+ ///
+ /// Examples
+ /// For an example, see Using Singly Linked Lists.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-interlockedpopentryslist PSLIST_ENTRY
+ // InterlockedPopEntrySList( PSLIST_HEADER ListHead );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "10760fd4-5973-4ab0-991c-7a5951c798a4")]
+ public static extern IntPtr InterlockedPopEntrySList(IntPtr ListHead);
+
+ ///
+ /// Inserts an item at the front of a singly linked list. Access to the list is synchronized on a multiprocessor system.
+ ///
+ ///
+ /// Pointer to an SLIST_HEADER structure that represents the head of a singly linked list.
+ ///
+ ///
+ /// Pointer to an SLIST_ENTRY structure that represents an item in a singly linked list.
+ ///
+ ///
+ /// The return value is the previous first item in the list. If the list was previously empty, the return value is NULL.
+ ///
+ ///
+ ///
+ /// All list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary; otherwise, this function will behave
+ /// unpredictably. See _aligned_malloc.
+ ///
+ /// Examples
+ /// For an example, see Using Singly Linked Lists.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-interlockedpushentryslist PSLIST_ENTRY
+ // InterlockedPushEntrySList( PSLIST_HEADER ListHead, __drv_aliasesMem PSLIST_ENTRY ListEntry );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "60e3b6f7-f556-4699-be90-db7330cfb8ca")]
+ public static extern IntPtr InterlockedPushEntrySList(IntPtr ListHead, ref SLIST_ENTRY ListEntry);
+
+ ///
+ /// Inserts a singly-linked list at the front of another singly linked list. Access to the lists is synchronized on a multiprocessor system.
+ ///
+ ///
+ /// Pointer to an SLIST_HEADER structure that represents the head of a singly linked list. The list specified by the List and
+ /// ListEnd parameters is inserted at the front of this list.
+ ///
+ /// Pointer to an SLIST_ENTRY structure that represents the first item in the list to be inserted.
+ /// Pointer to an SLIST_ENTRY structure that represents the last item in the list to be inserted.
+ /// The number of items in the list to be inserted.
+ ///
+ /// The return value is the previous first item in the list specified by the ListHead parameter. If the list was previously empty,
+ /// the return value is NULL.
+ ///
+ // PSLIST_ENTRY FASTCALL InterlockedPushListSList( _Inout_ PSLIST_HEADER ListHead, _Inout_ PSLIST_ENTRY List, _Inout_ PSLIST_ENTRY
+ // ListEnd, _In_ ULONG Count); https://msdn.microsoft.com/en-us/library/windows/desktop/hh448545(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("WinBase.h", MSDNShortId = "hh448545")]
+ public static extern IntPtr InterlockedPushListSList(IntPtr ListHead, ref SLIST_ENTRY List, ref SLIST_ENTRY ListEnd, uint Count);
+
+ ///
+ ///
+ /// Inserts a singly-linked list at the front of another singly linked list. Access to the lists is synchronized on a multiprocessor
+ /// system. This version of the method does not use the __fastcall calling convention.
+ ///
+ ///
+ ///
+ ///
+ /// Pointer to an SLIST_HEADER structure that represents the head of a singly linked list. The list specified by the List and
+ /// ListEnd parameters is inserted at the front of this list.
+ ///
+ ///
+ ///
+ /// Pointer to an SLIST_ENTRY structure that represents the first item in the list to be inserted.
+ ///
+ ///
+ /// Pointer to an SLIST_ENTRY structure that represents the last item in the list to be inserted.
+ ///
+ ///
+ /// The number of items in the list to be inserted.
+ ///
+ ///
+ ///
+ /// The return value is the previous first item in the list specified by the ListHead parameter. If the list was previously empty,
+ /// the return value is NULL.
+ ///
+ ///
+ ///
+ ///
+ /// All list items must be aligned on a MEMORY_ALLOCATION_ALIGNMENT boundary; otherwise, this function will behave
+ /// unpredictably. See _aligned_malloc.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-interlockedpushlistslistex PSLIST_ENTRY
+ // InterlockedPushListSListEx( PSLIST_HEADER ListHead, PSLIST_ENTRY List, PSLIST_ENTRY ListEnd, ULONG Count );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "f4f334c6-fda8-4c5f-9177-b672c8aed6b3")]
+ public static extern IntPtr InterlockedPushListSListEx(IntPtr ListHead, ref SLIST_ENTRY List, ref SLIST_ENTRY ListEnd, uint Count);
+
+ ///
+ /// Retrieves the number of entries in the specified singly linked list.
+ ///
+ ///
+ ///
+ /// A pointer to an SLIST_HEADER structure that represents the head of a singly linked list. This structure is for system use only.
+ ///
+ /// The list must be previously initialized with the InitializeSListHead function.
+ ///
+ ///
+ /// The function returns the number of entries in the list, up to a maximum value of 65535.
+ ///
+ ///
+ ///
+ /// The system does not limit the number of entries in a singly linked list. However, the return value of QueryDepthSList is
+ /// truncated to 16 bits, so the maximum value it can return is 65535. If the specified singly linked list contains more than 65535
+ /// entries, QueryDepthSList returns the number of entries in the list modulo 65535. For example, if the specified list
+ /// contains 65536 entries, QueryDepthSList returns zero.
+ ///
+ ///
+ /// The return value of QueryDepthSList should not be relied upon in multithreaded applications because the item count can be
+ /// changed at any time by another thread.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/interlockedapi/nf-interlockedapi-querydepthslist USHORT QueryDepthSList(
+ // PSLIST_HEADER ListHead );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("interlockedapi.h", MSDNShortId = "3f9b4481-647f-457f-bdfb-62e6ae4198e5")]
+ public static extern ushort QueryDepthSList(IntPtr ListHead);
+
+ /// An SLIST_ENTRY structure describes an entry in a sequenced singly linked list.
+ // typedef struct _SLIST_ENTRY { struct _SLIST_ENTRY *Next;} SLIST_ENTRY, *PSLIST_ENTRY; https://msdn.microsoft.com/en-us/library/windows/hardware/ff563805(v=vs.85).aspx
+ [PInvokeData("Wdm.h", MSDNShortId = "ff563805")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SLIST_ENTRY
+ {
+ /// Pointer to the next entry in the list, or NULL if there is no next entry in the list.
+ public IntPtr Next;
+ }
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/LibLoaderApi.cs b/PInvoke/Kernel32/LibLoaderApi.cs
index aacd6fdb..41c0b34f 100644
--- a/PInvoke/Kernel32/LibLoaderApi.cs
+++ b/PInvoke/Kernel32/LibLoaderApi.cs
@@ -4,7 +4,6 @@ using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
-using Vanara.Extensions;
using Vanara.InteropServices;
namespace Vanara.PInvoke
@@ -12,22 +11,23 @@ namespace Vanara.PInvoke
public static partial class Kernel32
{
///
- /// An application-defined callback function used with the EnumResourceLanguages and EnumResourceLanguagesEx functions. It receives the
- /// type, name, and language of a resource item. The ENUMRESLANGPROC type defines a pointer to this callback function. EnumResLangProc is a
- /// placeholder for the application-defined function name.
+ /// An application-defined callback function used with the EnumResourceLanguages and EnumResourceLanguagesEx functions.
+ /// It receives the type, name, and language of a resource item. The ENUMRESLANGPROC type defines a pointer to this callback
+ /// function. EnumResLangProc is a placeholder for the application-defined function name.
///
///
/// Type: HMODULE
///
- /// A handle to the module whose executable file contains the resources for which the languages are being enumerated. If this parameter is NULL,
- /// the function enumerates the resource languages in the module used to create the current process.
+ /// A handle to the module whose executable file contains the resources for which the languages are being enumerated. If this
+ /// parameter is NULL, the function enumerates the resource languages in the module used to create the current process.
///
///
///
/// Type: LPCTSTR
///
- /// The type of resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be , where ID is an integer
- /// value representing a predefined resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.
+ /// The type of resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be ,
+ /// where ID is an integer value representing a predefined resource type. For standard resource types, see Resource Types. For more
+ /// information, see the Remarks section below.
///
///
///
@@ -41,57 +41,60 @@ namespace Vanara.PInvoke
/// Type: WORD
///
/// The language identifier for the resource for which the language is being enumerated. The EnumResourceLanguages or
- /// EnumResourceLanguagesEx function provides this value. For a list of the primary language identifiers and sublanguage identifiers that
- /// constitute a language identifier, see MAKELANGID.
+ /// EnumResourceLanguagesEx function provides this value. For a list of the primary language identifiers and sublanguage
+ /// identifiers that constitute a language identifier, see MAKELANGID.
///
///
///
/// Type: LONG_PTR
///
- /// The application-defined parameter passed to the EnumResourceLanguages or EnumResourceLanguagesEx function. This parameter can be used
- /// in error checking.
+ /// The application-defined parameter passed to the EnumResourceLanguages or EnumResourceLanguagesEx function. This
+ /// parameter can be used in error checking.
///
///
///
/// Type: BOOL
/// Returns TRUE to continue enumeration or FALSE to stop enumeration.
///
- // BOOL CALLBACK EnumResLangProc( _In_opt_ HMODULE hModule, _In_ LPCTSTR lpszType, _In_ LPCTSTR lpszName, _In_ WORD wIDLanguage, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648033(v=vs.85).aspx
+ // BOOL CALLBACK EnumResLangProc( _In_opt_ HMODULE hModule, _In_ LPCTSTR lpszType, _In_ LPCTSTR lpszName, _In_ WORD wIDLanguage, _In_
+ // LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648033(v=vs.85).aspx
[PInvokeData("Winbase.h", MSDNShortId = "ms648033")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool EnumResLangProc([In] IntPtr hModule, [In] SafeResourceId lpszType, [In] SafeResourceId lpszName, ushort wIDLanguage, [In] IntPtr lParam);
///
- /// An application-defined callback function used with the EnumResourceNames and EnumResourceNamesEx functions. It receives the type and
- /// name of a resource. The ENUMRESNAMEPROC type defines a pointer to this callback function. EnumResNameProc is a placeholder for the
- /// application-defined function name.
+ /// An application-defined callback function used with the EnumResourceNames and EnumResourceNamesEx functions. It
+ /// receives the type and name of a resource. The ENUMRESNAMEPROC type defines a pointer to this callback function.
+ /// EnumResNameProc is a placeholder for the application-defined function name.
///
///
/// Type: HMODULE
///
- /// A handle to the module whose executable file contains the resources that are being enumerated. If this parameter is NULL, the function
- /// enumerates the resource names in the module used to create the current process.
+ /// A handle to the module whose executable file contains the resources that are being enumerated. If this parameter is NULL,
+ /// the function enumerates the resource names in the module used to create the current process.
///
///
///
/// Type: LPCTSTR
///
- /// The type of resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be , where ID is an integer value
- /// representing a predefined resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.
+ /// The type of resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be , where ID
+ /// is an integer value representing a predefined resource type. For standard resource types, see Resource Types. For more
+ /// information, see the Remarks section below.
///
///
///
/// Type: LPTSTR
///
- /// The name of a resource of the type being enumerated. Alternately, rather than a pointer, this parameter can be , where ID is the integer identifier
- /// of the resource. For more information, see the Remarks section below.
+ /// The name of a resource of the type being enumerated. Alternately, rather than a pointer, this parameter can be , where ID is the
+ /// integer identifier of the resource. For more information, see the Remarks section below.
///
///
///
/// Type: LONG_PTR
///
- /// An application-defined parameter passed to the EnumResourceNames or EnumResourceNamesEx function. This parameter can be used in error checking.
+ /// An application-defined parameter passed to the EnumResourceNames or EnumResourceNamesEx function. This parameter
+ /// can be used in error checking.
///
///
///
@@ -106,28 +109,30 @@ namespace Vanara.PInvoke
public delegate bool EnumResNameProc(IntPtr hModule, SafeResourceId lpszType, SafeResourceId lpszName, IntPtr lParam);
///
- /// An application-defined callback function used with the EnumResourceTypes and EnumResourceTypesEx functions. It receives resource types.
- /// The ENUMRESTYPEPROC type defines a pointer to this callback function. EnumResTypeProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function used with the EnumResourceTypes and EnumResourceTypesEx functions. It
+ /// receives resource types. The ENUMRESTYPEPROC type defines a pointer to this callback function. EnumResTypeProc is a
+ /// placeholder for the application-defined function name.
///
///
/// Type: HMODULE
///
- /// A handle to the module whose executable file contains the resources for which the types are to be enumerated. If this parameter is NULL, the
- /// function enumerates the resource types in the module used to create the current process.
+ /// A handle to the module whose executable file contains the resources for which the types are to be enumerated. If this parameter
+ /// is NULL, the function enumerates the resource types in the module used to create the current process.
///
///
///
/// Type: LPTSTR
///
- /// The type of resource for which the type is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID),
- /// where ID is the integer identifier of the given resource type. For standard resource types, see Resource Types. For more information, see the Remarks
- /// section below.
+ /// The type of resource for which the type is being enumerated. Alternately, rather than a pointer, this parameter can be
+ /// MAKEINTRESOURCE(ID), where ID is the integer identifier of the given resource type. For standard resource types, see
+ /// Resource Types. For more information, see the Remarks section below.
///
///
///
/// Type: LONG_PTR
///
- /// An application-defined parameter passed to the EnumResourceTypes or EnumResourceTypesEx function. This parameter can be used in error checking.
+ /// An application-defined parameter passed to the EnumResourceTypes or EnumResourceTypesEx function. This parameter
+ /// can be used in error checking.
///
///
///
@@ -138,23 +143,29 @@ namespace Vanara.PInvoke
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
[PInvokeData("Winbase.h", MSDNShortId = "ms648041")]
[return: MarshalAs(UnmanagedType.Bool)]
- public delegate bool EnumResTypeProc(IntPtr hModule, SafeResourceId lpType, IntPtr lParam);
+ public delegate bool EnumResTypeProc(IntPtr hModule, SafeResourceId lpszType, IntPtr lParam);
- /// GetModuleHandleEx flags.
- public enum GET_MODULE_HANDLE_EX
+ /// Flags used by .
+ [PInvokeData("Winbase.h", MSDNShortId = "ms683200")]
+ [Flags]
+ public enum GET_MODULE_HANDLE_EX_FLAG
{
- ///
- /// The module stays loaded until the process is terminated, no matter how many times FreeLibrary is called. This option cannot be used with GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT.
- ///
+ /// The lpModuleName parameter is an address in the module.
GET_MODULE_HANDLE_EX_FLAG_PIN = 0x00000001,
+
///
- /// The reference count for the module is not incremented. This option is equivalent to the behavior of GetModuleHandle. Do not pass the retrieved
- /// module handle to the FreeLibrary function; doing so can cause the DLL to be unmapped prematurely. For more information, see Remarks. This option
- /// cannot be used with GET_MODULE_HANDLE_EX_FLAG_PIN.
+ /// The module stays loaded until the process is terminated, no matter how many times FreeLibrary is called.
+ /// This option cannot be used with GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT.
///
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 0x00000002,
- /// The lpModuleName parameter is an address in the module.
- GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 0x00000004
+
+ ///
+ /// The reference count for the module is not incremented. This option is equivalent to the behavior of GetModuleHandle. Do not
+ /// pass the retrieved module handle to the FreeLibrary function; doing so can cause the DLL to be unmapped prematurely. For more
+ /// information, see Remarks.
+ /// This option cannot be used with GET_MODULE_HANDLE_EX_FLAG_PIN.
+ ///
+ GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS = 0x00000004,
}
/// Flags that may be passed to the function.
@@ -166,63 +177,69 @@ namespace Vanara.PInvoke
None = 0,
///
- /// If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and
- /// termination. Also, the system does not load additional executable modules that are referenced by the specified module.
+ /// If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread
+ /// initialization and termination. Also, the system does not load additional executable modules that are referenced by the
+ /// specified module.
///
///
- /// Do not use this value; it is provided only for backward compatibility. If you are planning to access only data or resources in the DLL, use
- /// or or both. Otherwise, load the library as a DLL or
- /// executable module using the LoadLibrary function.
+ /// Do not use this value; it is provided only for backward compatibility. If you are planning to access only data or resources
+ /// in the DLL, use or or both.
+ /// Otherwise, load the library as a DLL or executable module using the LoadLibrary function.
///
DONT_RESOLVE_DLL_REFERENCES = 0x00000001,
///
- /// If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL. This action applies only to
- /// the DLL being loaded and not to its dependencies. This value is recommended for use in setup programs that must run extracted DLLs during installation.
+ /// If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL. This
+ /// action applies only to the DLL being loaded and not to its dependencies. This value is recommended for use in setup programs
+ /// that must run extracted DLLs during installation.
///
///
///
- /// Windows Server 2008 R2 and Windows 7: On systems with KB2532445 installed, the caller must be running as "LocalSystem" or "TrustedInstaller";
- /// otherwise the system ignores this flag. For more information, see "You can circumvent AppLocker rules by using an Office macro on a computer that
- /// is running Windows 7 or Windows Server 2008 R2" in the Help and Support Knowledge Base at http://support.microsoft.com/kb/2532445.
+ /// Windows Server 2008 R2 and Windows 7: On systems with KB2532445 installed, the caller must be running as "LocalSystem" or
+ /// "TrustedInstaller"; otherwise the system ignores this flag. For more information, see "You can circumvent AppLocker rules by
+ /// using an Office macro on a computer that is running Windows 7 or Windows Server 2008 R2" in the Help and Support Knowledge
+ /// Base at http://support.microsoft.com/kb/2532445.
///
///
- /// Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: AppLocker was introduced in Windows 7 and Windows Server 2008 R2.
+ /// Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: AppLocker was introduced in Windows 7 and Windows
+ /// Server 2008 R2.
///
///
LOAD_IGNORE_CODE_AUTHZ_LEVEL = 0x00000010,
///
- /// If this value is used, the system maps the file into the calling process's virtual address space as if it were a data file. Nothing is done to
- /// execute or prepare to execute the mapped file. Therefore, you cannot call functions like GetModuleFileName, GetModuleHandle or GetProcAddress
- /// with this DLL. Using this value causes writes to read-only memory to raise an access violation. Use this flag when you want to load a DLL only to
- /// extract messages or resources from it.
+ /// If this value is used, the system maps the file into the calling process's virtual address space as if it were a data file.
+ /// Nothing is done to execute or prepare to execute the mapped file. Therefore, you cannot call functions like
+ /// GetModuleFileName, GetModuleHandle or GetProcAddress with this DLL. Using this value causes writes to read-only memory to
+ /// raise an access violation. Use this flag when you want to load a DLL only to extract messages or resources from it.
/// This value can be used with .
///
LOAD_LIBRARY_AS_DATAFILE = 0x00000002,
///
- /// Similar to , except that the DLL file is opened with exclusive write access for the calling process. Other
- /// processes cannot open the DLL file for write access while it is in use. However, the DLL can still be opened by other processes.
+ /// Similar to , except that the DLL file is opened with exclusive write access for the
+ /// calling process. Other processes cannot open the DLL file for write access while it is in use. However, the DLL can still be
+ /// opened by other processes.
/// This value can be used with .
///
/// Windows Server 2003 and Windows XP: This value is not supported until Windows Vista.
LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE = 0x00000040,
///
- /// If this value is used, the system maps the file into the process's virtual address space as an image file. However, the loader does not load the
- /// static imports or perform the other usual initialization steps. Use this flag when you want to load a DLL only to extract messages or resources
- /// from it.
+ /// If this value is used, the system maps the file into the process's virtual address space as an image file. However, the
+ /// loader does not load the static imports or perform the other usual initialization steps. Use this flag when you want to load
+ /// a DLL only to extract messages or resources from it.
///
/// Unless the application depends on the file having the in-memory layout of an image, this value should be used with either
- /// or . For more information, see the Remarks section.
+ /// or . For more information, see the
+ /// Remarks section.
///
///
LOAD_LIBRARY_AS_IMAGE_RESOURCE = 0x00000020,
///
- /// If this value is used, the application's installation directory is searched for the DLL and its dependencies. Directories in the standard search
- /// path are not searched. This value cannot be combined with .
+ /// If this value is used, the application's installation directory is searched for the DLL and its dependencies. Directories in
+ /// the standard search path are not searched. This value cannot be combined with .
///
///
/// Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008: This value requires KB2533623 to be installed.
@@ -231,9 +248,12 @@ namespace Vanara.PInvoke
LOAD_LIBRARY_SEARCH_APPLICATION_DIR = 0x00000200,
///
- /// This value is a combination of , , and
- /// . Directories in the standard search path are not searched. This value cannot be combined with .
- /// This value represents the recommended maximum number of directories an application should include in its DLL search path.
+ /// This value is a combination of , ,
+ /// and . Directories in the standard search path are not searched. This value cannot
+ /// be combined with .
+ ///
+ /// This value represents the recommended maximum number of directories an application should include in its DLL search path.
+ ///
///
///
/// Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008: This value requires KB2533623 to be installed.
@@ -242,12 +262,13 @@ namespace Vanara.PInvoke
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000,
///
- /// If this value is used, the directory that contains the DLL is temporarily added to the beginning of the list of directories that are searched for
- /// the DLL's dependencies. Directories in the standard search path are not searched.
+ /// If this value is used, the directory that contains the DLL is temporarily added to the beginning of the list of directories
+ /// that are searched for the DLL's dependencies. Directories in the standard search path are not searched.
/// The lpFileName parameter must specify a fully qualified path. This value cannot be combined with .
///
- /// For example, if Lib2.dll is a dependency of C:\Dir1\Lib1.dll, loading Lib1.dll with this value causes the system to search for Lib2.dll only in
- /// C:\Dir1. To search for Lib2.dll in C:\Dir1 and all of the directories in the DLL search path, combine this value with .
+ /// For example, if Lib2.dll is a dependency of C:\Dir1\Lib1.dll, loading Lib1.dll with this value causes the system to search
+ /// for Lib2.dll only in C:\Dir1. To search for Lib2.dll in C:\Dir1 and all of the directories in the DLL search path, combine
+ /// this value with .
///
///
///
@@ -257,8 +278,8 @@ namespace Vanara.PInvoke
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100,
///
- /// If this value is used, %windows%\system32 is searched for the DLL and its dependencies. Directories in the standard search path are not searched.
- /// This value cannot be combined with .
+ /// If this value is used, %windows%\system32 is searched for the DLL and its dependencies. Directories in the standard search
+ /// path are not searched. This value cannot be combined with .
///
///
/// Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008: This value requires KB2533623 to be installed.
@@ -267,9 +288,9 @@ namespace Vanara.PInvoke
LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800,
///
- /// If this value is used, directories added using the AddDllDirectory or the SetDllDirectory function are searched for the DLL and its dependencies.
- /// If more than one directory has been added, the order in which the directories are searched is unspecified. Directories in the standard search
- /// path are not searched. This value cannot be combined with .
+ /// If this value is used, directories added using the AddDllDirectory or the SetDllDirectory function are searched for the DLL
+ /// and its dependencies. If more than one directory has been added, the order in which the directories are searched is
+ /// unspecified. Directories in the standard search path are not searched. This value cannot be combined with .
///
///
/// Windows 7, Windows Server 2008 R2, Windows Vista, and Windows Server 2008: This value requires KB2533623 to be installed.
@@ -278,12 +299,12 @@ namespace Vanara.PInvoke
LOAD_LIBRARY_SEARCH_USER_DIRS = 0x00000400,
///
- /// If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed in the Remarks
- /// section to find associated executable modules that the specified module causes to be loaded. If this value is used and lpFileName specifies a
- /// relative path, the behavior is undefined.
+ /// If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed
+ /// in the Remarks section to find associated executable modules that the specified module causes to be loaded. If this value is
+ /// used and lpFileName specifies a relative path, the behavior is undefined.
///
- /// If this value is not used, or if lpFileName does not specify a path, the system uses the standard search strategy discussed in the Remarks
- /// section to find associated executable modules that the specified module causes to be loaded.
+ /// If this value is not used, or if lpFileName does not specify a path, the system uses the standard search strategy discussed
+ /// in the Remarks section to find associated executable modules that the specified module causes to be loaded.
///
/// This value cannot be combined with any LOAD_LIBRARY_SEARCH flag.
///
@@ -294,22 +315,29 @@ namespace Vanara.PInvoke
[Flags]
public enum RESOURCE_ENUM_FLAGS
{
- /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
- RESOURCE_ENUM_LN = 0x0001,
///
- /// Search for resources in .mui files associated with the LN file specified by hModule and with the current language preferences, following the
- /// usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then only the specified .mui file
- /// will be searched. Typically this flag should be used only if hModule references an LN file. If hModule references an .mui file, then that file is
- /// actually covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
+ /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
+ RESOURCE_ENUM_LN = 0x0001,
+
+ ///
+ /// Search for resources in .mui files associated with the LN file specified by hModule and with the current language
+ /// preferences, following the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is
+ /// nonzero, then only the specified .mui file will be searched. Typically this flag should be used only if hModule references an
+ /// LN file. If hModule references an .mui file, then that file is actually covered by the RESOURCE_ENUM_LN flag, despite the
+ /// name of the flag.
///
RESOURCE_ENUM_MUI = 0x0002,
+
/// Restricts the .mui files search to system-installed MUI languages.
RESOURCE_ENUM_MUI_SYSTEM = 0x0004,
+
///
- /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that resources are
- /// properly formatted. The validation sets a maximum limit of 260 characters for each name that is enumerated.
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure
+ /// that resources are properly formatted. The validation sets a maximum limit of 260 characters for each name that is enumerated.
///
RESOURCE_ENUM_VALIDATE = 0x0008,
+
/// Undocumented.
RESOURCE_ENUM_MODULE_EXACT = 0x0010,
}
@@ -317,25 +345,32 @@ namespace Vanara.PInvoke
/// Flags specifying details of the find operation.
public enum SEARCH_FLAGS
{
- /// Test to find out if the value specified by lpStringValue is the first value in the source string indicated by lpStringSource.
+ ///
+ /// Test to find out if the value specified by lpStringValue is the first value in the source string indicated by lpStringSource.
+ ///
FIND_STARTSWITH = 0x00100000,
- /// Test to find out if the value specified by lpStringValue is the last value in the source string indicated by lpStringSource.
+
+ ///
+ /// Test to find out if the value specified by lpStringValue is the last value in the source string indicated by lpStringSource.
+ ///
FIND_ENDSWITH = 0x00200000,
+
/// Search the string, starting with the first character of the string.
FIND_FROMSTART = 0x00400000,
+
/// Search the string in the reverse direction, starting with the last character of the string.
FIND_FROMEND = 0x00800000,
}
/// Adds a directory to the process DLL search path.
///
- /// An absolute path to the directory to add to the search path. For example, to add the directory Dir2 to the process DLL search path, specify \Dir2.
- /// For more information about paths, see Naming Files, Paths, and Namespaces.
+ /// An absolute path to the directory to add to the search path. For example, to add the directory Dir2 to the process DLL search
+ /// path, specify \Dir2. For more information about paths, see Naming Files, Paths, and Namespaces.
///
///
///
- /// If the function succeeds, the return value is an opaque pointer that can be passed to RemoveDllDirectory to remove the DLL from the process
- /// DLL search path.
+ /// If the function succeeds, the return value is an opaque pointer that can be passed to RemoveDllDirectory to remove the DLL
+ /// from the process DLL search path.
///
/// If the function fails, the return value is zero. To get extended error information, call GetLastError.
///
@@ -345,33 +380,35 @@ namespace Vanara.PInvoke
public static extern IntPtr AddDllDirectory(string NewDirectory);
///
- /// Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce the size of the
- /// working set for some applications.
+ /// Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce
+ /// the size of the working set for some applications.
///
///
- /// A handle to the DLL module for which the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications are to be disabled. The LoadLibrary,
- /// LoadLibraryEx, or GetModuleHandle function returns this handle. Note that you cannot call GetModuleHandle with NULL because this
- /// returns the base address of the executable image, not the DLL image.
+ /// A handle to the DLL module for which the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications are to be disabled. The
+ /// LoadLibrary, LoadLibraryEx, or GetModuleHandle function returns this handle. Note that you cannot call
+ /// GetModuleHandle with NULL because this returns the base address of the executable image, not the DLL image.
///
///
/// If the function succeeds, the return value is nonzero.
///
- /// If the function fails, the return value is zero. The DisableThreadLibraryCalls function fails if the DLL specified by hModule has active
- /// static thread local storage, or if hModule is an invalid module handle. To get extended error information, call GetLastError.
+ /// If the function fails, the return value is zero. The DisableThreadLibraryCalls function fails if the DLL specified by
+ /// hModule has active static thread local storage, or if hModule is an invalid module handle. To get extended error information,
+ /// call GetLastError.
///
///
// BOOL WINAPI DisableThreadLibraryCalls( _In_ HMODULE hModule); https://msdn.microsoft.com/en-us/library/windows/desktop/ms682579(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "ms682579")]
[return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool DisableThreadLibraryCalls([In] SafeLibraryHandle hLibModule);
+ public static extern bool DisableThreadLibraryCalls([In] SafeLibraryHandle hModule);
/// Enumerates language-specific resources, of the specified type and name, associated with a binary module.
///
/// Type: HMODULE
///
- /// The handle to a module to be searched. Starting with Windows Vista, if this is a language-neutral Portable Executable (LN file), then appropriate
- /// .mui files (if any exist) are included in the search. If this is a specific .mui file, only that file is searched for resources.
+ /// The handle to a module to be searched. Starting with Windows Vista, if this is a language-neutral Portable Executable (LN file),
+ /// then appropriate .mui files (if any exist) are included in the search. If this is a specific .mui file, only that file is
+ /// searched for resources.
///
/// If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process.
///
@@ -379,8 +416,8 @@ namespace Vanara.PInvoke
/// Type: LPCTSTR
///
/// The type of resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be
- /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see
- /// Resource Types. For more information, see the Remarks section below.
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined
+ /// resource types, see Resource Types. For more information, see the Remarks section below.
///
///
///
@@ -402,8 +439,8 @@ namespace Vanara.PInvoke
/// Type: BOOL
/// Returns TRUE if successful or FALSE otherwise. To get extended error information, call GetLastError.
///
- // BOOL WINAPI EnumResourceLanguages( _In_ HMODULE hModule, _In_ LPCTSTR lpType, _In_ LPCTSTR lpName, _In_ ENUMRESLANGPROC lpEnumFunc, _In_ LONG_PTR
- // lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648035(v=vs.85).aspx
+ // BOOL WINAPI EnumResourceLanguages( _In_ HMODULE hModule, _In_ LPCTSTR lpType, _In_ LPCTSTR lpName, _In_ ENUMRESLANGPROC
+ // lpEnumFunc, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648035(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "EnumResourceLanguagesW")]
[PInvokeData("Winbase.h", MSDNShortId = "ms648035")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -416,9 +453,9 @@ namespace Vanara.PInvoke
///
/// Type: HMODULE
///
- /// The handle to a module to search. Typically this is a language-neutral Portable Executable (LN file), and if flag RESOURCE_ENUM_MUI is set,
- /// then appropriate .mui files are included in the search. Alternately, this can be a handle to an .mui file or other LN file. If this is a specific
- /// .mui file, only that file is searched for resources.
+ /// The handle to a module to search. Typically this is a language-neutral Portable Executable (LN file), and if flag
+ /// RESOURCE_ENUM_MUI is set, then appropriate .mui files are included in the search. Alternately, this can be a handle to an
+ /// .mui file or other LN file. If this is a specific .mui file, only that file is searched for resources.
///
/// If this parameter is NULL, it is equivalent to passing in a handle to the module used to create the current process.
///
@@ -426,8 +463,8 @@ namespace Vanara.PInvoke
/// Type: LPCTSTR
///
/// The type of the resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be
- /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see
- /// Resource Types. For more information, see the Remarks section below.
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined
+ /// resource types, see Resource Types. For more information, see the Remarks section below.
///
///
///
@@ -448,8 +485,8 @@ namespace Vanara.PInvoke
///
/// Type: DWORD
///
- /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN and
- /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the
+ /// RESOURCE_ENUM_LN and RESOURCE_ENUM_MUI flags are assumed to be specified.
///
///
///
@@ -460,15 +497,17 @@ namespace Vanara.PInvoke
/// -
/// RESOURCE_ENUM_MUI0x0002
///
- /// Search for language-specific resources in .mui files associated with the LN file specified by hModule. Alternately, if LangId is nonzero, the only
- /// .mui file searched will be the one matching the specified LangId. Typically this flag should be used only if hModule references an LN file. If
- /// hModule references an .mui file, then that file is actually covered by the RESOURCE_LN flag, despite the name of the flag. See the Remarks section
- /// below for sequence of search.
+ /// Search for language-specific resources in .mui files associated with the LN file specified by hModule. Alternately, if LangId is
+ /// nonzero, the only .mui file searched will be the one matching the specified LangId. Typically this flag should be used only if
+ /// hModule references an LN file. If hModule references an .mui file, then that file is actually covered by the RESOURCE_LN flag,
+ /// despite the name of the flag. See the Remarks section below for sequence of search.
///
///
/// -
/// RESOURCE_ENUM_LN0x0001
- /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
+ /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
///
/// -
/// RESOURCE_ENUM_MUI_SYSTEM0x0004
@@ -477,8 +516,8 @@ namespace Vanara.PInvoke
///
-
/// RESOURCE_ENUM_VALIDATE0x0008
///
- /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that resources are
- /// properly formatted.
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that
+ /// resources are properly formatted.
///
///
///
@@ -487,20 +526,20 @@ namespace Vanara.PInvoke
///
/// Type: LANGID
///
- /// The localization language used to filter the search in the .mui file. This parameter is used only when the RESOURCE_ENUM_MUI flag is set in
- /// dwFlags. If zero is specified, then all .mui files are included in the search. If a nonzero LangId is specified, then the only .mui file searched
- /// will be the one matching the specified LangId.
+ /// The localization language used to filter the search in the .mui file. This parameter is used only when the
+ /// RESOURCE_ENUM_MUI flag is set in dwFlags. If zero is specified, then all .mui files are included in the search. If a
+ /// nonzero LangId is specified, then the only .mui file searched will be the one matching the specified LangId.
///
///
///
/// Type: BOOL
///
- /// Returns TRUE if the function succeeds or FALSE if the function does not find a resource of the type specified, or if the function fails
- /// for another reason. To get extended error information, call GetLastError.
+ /// Returns TRUE if the function succeeds or FALSE if the function does not find a resource of the type specified, or
+ /// if the function fails for another reason. To get extended error information, call GetLastError.
///
///
- // BOOL WINAPI EnumResourceLanguagesEx( _In_ HMODULE hModule, _In_ LPCTSTR lpType, _In_ LPCTSTR lpName, _In_ ENUMRESLANGPROC lpEnumFunc, _In_ LONG_PTR
- // lParam, _In_ DWORD dwFlags, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648036(v=vs.85).aspx
+ // BOOL WINAPI EnumResourceLanguagesEx( _In_ HMODULE hModule, _In_ LPCTSTR lpType, _In_ LPCTSTR lpName, _In_ ENUMRESLANGPROC
+ // lpEnumFunc, _In_ LONG_PTR lParam, _In_ DWORD dwFlags, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648036(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "EnumResourceLanguagesExW")]
[PInvokeData("Winbase.h", MSDNShortId = "ms648036")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -509,27 +548,29 @@ namespace Vanara.PInvoke
/// Enumerates language-specific resources, of the specified type and name, associated with a specified binary module.
///
///
- /// The handle to a module to search. Typically this is a language-neutral Portable Executable (LN file), and if flag RESOURCE_ENUM_MUI is set,
- /// then appropriate .mui files are included in the search. Alternately, this can be a handle to an .mui file or other LN file. If this is a specific
- /// .mui file, only that file is searched for resources.
+ /// The handle to a module to search. Typically this is a language-neutral Portable Executable (LN file), and if flag
+ /// RESOURCE_ENUM_MUI is set, then appropriate .mui files are included in the search. Alternately, this can be a handle to an
+ /// .mui file or other LN file. If this is a specific .mui file, only that file is searched for resources.
///
/// If this parameter is NULL, it is equivalent to passing in a handle to the module used to create the current process.
///
///
/// The type of the resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be
- /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see
- /// Resource Types. For more information, see the Remarks section below.
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined
+ /// resource types, see Resource Types. For more information, see the Remarks section below.
///
///
/// The name of the resource for which the language is being enumerated. Alternately, rather than a pointer, this parameter can be
/// MAKEINTRESOURCE(ID), where ID is the integer identifier of the resource. For more information, see the Remarks section below.
///
- /// The type of file to be searched. Note that if is zero, then the RESOURCE_ENUM_LN and
- /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ ///
+ /// The type of file to be searched. Note that if is zero, then the RESOURCE_ENUM_LN and
+ /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ ///
///
- /// The localization language used to filter the search in the .mui file. This parameter is used only when the RESOURCE_ENUM_MUI flag is set in
- /// dwFlags. If zero is specified, then all .mui files are included in the search. If a nonzero LangId is specified, then the only .mui file searched
- /// will be the one matching the specified LangId.
+ /// The localization language used to filter the search in the .mui file. This parameter is used only when the
+ /// RESOURCE_ENUM_MUI flag is set in dwFlags. If zero is specified, then all .mui files are included in the search. If a
+ /// nonzero LangId is specified, then the only .mui file searched will be the one matching the specified LangId.
///
/// A list of the language identifiers (see Language Identifiers) for which a resource was found.
[PInvokeData("Winbase.h", MSDNShortId = "ms648036")]
@@ -542,24 +583,25 @@ namespace Vanara.PInvoke
}
///
- /// Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable
- /// Executable (LN file), and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that
- /// contain localizable language resources. It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources.
+ /// Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a
+ /// language-neutral Portable Executable (LN file), and the enumeration will also include resources from the corresponding
+ /// language-specific resource files (.mui files) that contain localizable language resources. It is also possible for hModule to
+ /// specify an .mui file, in which case only that file is searched for resources.
///
///
- /// A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any exist) are included in
- /// the search.
+ /// A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any
+ /// exist) are included in the search.
/// If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process.
///
///
- /// The type of the resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where
- /// ID is an integer value representing a predefined resource type.
+ /// The type of the resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type.
///
/// A pointer to the callback function to be called for each enumerated resource name or ID.
/// An application-defined value passed to the callback function. This parameter can be used in error checking.
///
- /// The return value is TRUE if the function succeeds or FALSE if the function does not find a resource of the type specified, or if the function fails
- /// for another reason. To get extended error information, call GetLastError.
+ /// The return value is TRUE if the function succeeds or FALSE if the function does not find a resource of the type specified, or if
+ /// the function fails for another reason. To get extended error information, call GetLastError.
///
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "EnumResourceNamesW")]
[SuppressUnmanagedCodeSecurity]
@@ -568,19 +610,65 @@ namespace Vanara.PInvoke
public static extern bool EnumResourceNames(SafeLibraryHandle hModule, SafeResourceId lpszType, EnumResNameProc lpEnumFunc, IntPtr lParam);
///
- /// Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable
- /// Executable (LN file), and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that
- /// contain localizable language resources. It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources.
+ /// Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a
+ /// language-neutral Portable Executable (LN file), and the enumeration will also include resources from the corresponding
+ /// language-specific resource files (.mui files) that contain localizable language resources. It is also possible for hModule to
+ /// specify an .mui file, in which case only that file is searched for resources.
///
///
- /// A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any exist) are included in
- /// the search.
+ /// A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any
+ /// exist) are included in the search.
/// If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process.
///
///
- /// The type of the resource for which the name is being enumerated. Alternately, rather than a string, this parameter can be MAKEINTRESOURCE(ID), where
- /// ID is an integer value representing a predefined resource type.
+ /// The type of the resource for which the name is being enumerated. Alternately, rather than a string, this parameter can be
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type.
///
+ ///
+ ///
+ /// The type of file to search. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN
+ /// and RESOURCE_ENUM_MUI flags are assumed to be specified.
+ ///
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// RESOURCE_ENUM_MUI0x0002
+ ///
+ /// Search for resources in .mui files associated with the LN file specified by hModule and with the current language preferences,
+ /// following the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then
+ /// only the specified .mui file will be searched. Typically this flag should be used only if hModule references an LN file. If
+ /// hModule references an .mui file, then that file is actually covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
+ ///
+ ///
+ /// -
+ /// RESOURCE_ENUM_LN0x0001
+ ///
+ /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
+ ///
+ /// -
+ /// RESOURCE_ENUM_VALIDATE0x0008
+ ///
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that
+ /// resources are properly formatted. The validation sets a maximum limit of 260 characters for each name that is enumerated.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The localization language used to filter the search in the MUI module. This parameter is used only when the
+ /// RESOURCE_ENUM_MUI flag is set in dwFlags. If zero is specified, then all .mui files that match current language
+ /// preferences are included in the search, following the usual Resource Loader strategy (see User Interface Language Management). If
+ /// a nonzero LangId is specified, then the only .mui file searched will be the one matching the specified LangId.
+ ///
+ ///
+ /// ///
/// A list of strings for each of the resources matching .
[PInvokeData("WinBase.h", MSDNShortId = "ms648037")]
public static IList EnumResourceNamesEx(SafeLibraryHandle hModule, SafeResourceId type, RESOURCE_ENUM_FLAGS flags = 0, ushort langFilter = 0)
@@ -592,14 +680,14 @@ namespace Vanara.PInvoke
}
///
- /// Enumerates resources of a specified type that are associated with a specified binary module. The search can include both an LN file and its
- /// associated .mui files, or it can be limited in several ways.
+ /// Enumerates resources of a specified type that are associated with a specified binary module. The search can include both an LN
+ /// file and its associated .mui files, or it can be limited in several ways.
///
///
/// Type: HMODULE
///
- /// The handle to a module to search. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then appropriate .mui files are included
- /// in the search. Alternately, this can be a handle to an .mui file or other LN file.
+ /// The handle to a module to search. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then appropriate
+ /// .mui files are included in the search. Alternately, this can be a handle to an .mui file or other LN file.
///
/// If this parameter is NULL, it is equivalent to passing in a handle to the module used to create the current process.
///
@@ -607,8 +695,8 @@ namespace Vanara.PInvoke
/// Type: LPCTSTR
///
/// The type of the resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be
- /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined resource types, see
- /// Resource Types. For more information, see the Remarks section below.
+ /// MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For a list of predefined
+ /// resource types, see Resource Types. For more information, see the Remarks section below.
///
///
///
@@ -622,8 +710,8 @@ namespace Vanara.PInvoke
///
/// Type: DWORD
///
- /// The type of file to search. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN and
- /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ /// The type of file to search. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN
+ /// and RESOURCE_ENUM_MUI flags are assumed to be specified.
///
///
///
@@ -634,21 +722,23 @@ namespace Vanara.PInvoke
/// -
/// RESOURCE_ENUM_MUI0x0002
///
- /// Search for resources in .mui files associated with the LN file specified by hModule and with the current language preferences, following the usual
- /// Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then only the specified .mui file will be
- /// searched. Typically this flag should be used only if hModule references an LN file. If hModule references an .mui file, then that file is actually
- /// covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
+ /// Search for resources in .mui files associated with the LN file specified by hModule and with the current language preferences,
+ /// following the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then
+ /// only the specified .mui file will be searched. Typically this flag should be used only if hModule references an LN file. If
+ /// hModule references an .mui file, then that file is actually covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
///
///
/// -
/// RESOURCE_ENUM_LN0x0001
- /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
+ /// Searches the file specified by hModule, regardless of whether the file is an LN file, another type of LN file, or an .mui file.
+ ///
///
/// -
/// RESOURCE_ENUM_VALIDATE0x0008
///
- /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that resources are
- /// properly formatted. The validation sets a maximum limit of 260 characters for each name that is enumerated.
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that
+ /// resources are properly formatted. The validation sets a maximum limit of 260 characters for each name that is enumerated.
///
///
///
@@ -657,21 +747,21 @@ namespace Vanara.PInvoke
///
/// Type: LANGID
///
- /// The localization language used to filter the search in the MUI module. This parameter is used only when the RESOURCE_ENUM_MUI flag is set in
- /// dwFlags. If zero is specified, then all .mui files that match current language preferences are included in the search, following the usual Resource
- /// Loader strategy (see User Interface Language Management). If a nonzero LangId is specified, then the only .mui file searched will be the one matching
- /// the specified LangId.
+ /// The localization language used to filter the search in the MUI module. This parameter is used only when the
+ /// RESOURCE_ENUM_MUI flag is set in dwFlags. If zero is specified, then all .mui files that match current language
+ /// preferences are included in the search, following the usual Resource Loader strategy (see User Interface Language Management). If
+ /// a nonzero LangId is specified, then the only .mui file searched will be the one matching the specified LangId.
///
///
///
/// Type: BOOL
///
- /// The function TRUE if successful, or FALSE if the function does not find a resource of the type specified, or if the function fails for
- /// another reason. To get extended error information, call GetLastError.
+ /// The function TRUE if successful, or FALSE if the function does not find a resource of the type specified, or if the
+ /// function fails for another reason. To get extended error information, call GetLastError.
///
///
- // BOOL WINAPI EnumResourceNamesEx( _In_opt_ HMODULE hModule, _In_ LPCTSTR lpszType, _In_ ENUMRESNAMEPROC lpEnumFunc, _In_ LONG_PTR lParam, _In_ DWORD
- // dwFlags, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648038(v=vs.85).aspx
+ // BOOL WINAPI EnumResourceNamesEx( _In_opt_ HMODULE hModule, _In_ LPCTSTR lpszType, _In_ ENUMRESNAMEPROC lpEnumFunc, _In_ LONG_PTR
+ // lParam, _In_ DWORD dwFlags, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648038(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "EnumResourceNamesExW")]
[PInvokeData("Winbase.h", MSDNShortId = "ms648038")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -679,22 +769,29 @@ namespace Vanara.PInvoke
///
///
- /// Enumerates resource types within a binary module. Starting with Windows Vista, this is typically a language-neutral Portable Executable (LN file),
- /// and the enumeration also includes resources from one of the corresponding language-specific resource files (.mui files)—if one exists—that contain
- /// localizable language resources. It is also possible to use hModule to specify a .mui file, in which case only that file is searched for resource types.
+ /// Enumerates resource types within a binary module. Starting with Windows Vista, this is typically a language-neutral Portable
+ /// Executable (LN file), and the enumeration also includes resources from one of the corresponding language-specific resource files
+ /// (.mui files)—if one exists—that contain localizable language resources. It is also possible to use hModule to specify a .mui
+ /// file, in which case only that file is searched for resource types.
+ ///
+ ///
+ /// Alternately, applications can call EnumResourceTypesEx, which provides more precise control over which resource files to enumerate.
///
- /// Alternately, applications can call EnumResourceTypesEx, which provides more precise control over which resource files to enumerate.
///
///
/// Type: HMODULE
///
- /// A handle to a module to be searched. This handle must be obtained through LoadLibrary or LoadLibraryEx. See Remarks for more information.
+ /// A handle to a module to be searched. This handle must be obtained through LoadLibrary or LoadLibraryEx. See Remarks
+ /// for more information.
///
/// If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process.
///
///
/// Type: ENUMRESTYPEPROC
- /// A pointer to the callback function to be called for each enumerated resource type. For more information, see the EnumResTypeProc function.
+ ///
+ /// A pointer to the callback function to be called for each enumerated resource type. For more information, see the
+ /// EnumResTypeProc function.
+ ///
///
///
/// Type: LONG_PTR
@@ -712,20 +809,22 @@ namespace Vanara.PInvoke
///
///
- /// Enumerates resource types associated with a specified binary module. The search can include both a language-neutral Portable Executable file (LN
- /// file) and its associated .mui files. Alternately, it can be limited to a single binary module of any type, or to the .mui files associated with a
- /// single LN file. The search can also be limited to a single associated .mui file that contains resources for a specific language.
+ /// Enumerates resource types associated with a specified binary module. The search can include both a language-neutral Portable
+ /// Executable file (LN
+ /// file) and its associated .mui files. Alternately, it can be limited to a single binary module of any type, or to the .mui files
+ /// associated with a single LN file. The search can also be limited to a single associated .mui file that contains resources for a
+ /// specific language.
///
///
- /// For each resource type found, EnumResourceTypesEx calls an application-defined callback function lpEnumFunc, passing the resource type it
- /// finds, as well as the various other parameters that were passed to EnumResourceTypesEx.
+ /// For each resource type found, EnumResourceTypesEx calls an application-defined callback function lpEnumFunc, passing the
+ /// resource type it finds, as well as the various other parameters that were passed to EnumResourceTypesEx.
///
///
///
/// Type: HMODULE
///
- /// The handle to a module to be searched. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then appropriate .mui files can be
- /// included in the search. Alternately, this can be a handle to an .mui file or other LN file.
+ /// The handle to a module to be searched. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then
+ /// appropriate .mui files can be included in the search. Alternately, this can be a handle to an .mui file or other LN file.
///
/// If this parameter is NULL, it is equivalent to passing in a handle to the module used to create the current process.
///
@@ -740,8 +839,8 @@ namespace Vanara.PInvoke
///
/// Type: DWORD
///
- /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN and
- /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the
+ /// RESOURCE_ENUM_LN and RESOURCE_ENUM_MUI flags are assumed to be specified.
///
///
///
@@ -752,10 +851,11 @@ namespace Vanara.PInvoke
/// -
/// RESOURCE_ENUM_MUI0x0002
///
- /// Search for resource types in one of the .mui files associated with the file specified by hModule and with the current language preferences, following
- /// the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then only the .mui file of the
- /// language as specified by LangId will be searched. Typically this flag should be used only if hModule references an LN file. If hModule references an
- /// .mui file, then that file is actually covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
+ /// Search for resource types in one of the .mui files associated with the file specified by hModule and with the current language
+ /// preferences, following the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is
+ /// nonzero, then only the .mui file of the language as specified by LangId will be searched. Typically this flag should be used only
+ /// if hModule references an LN file. If hModule references an .mui file, then that file is actually covered by the RESOURCE_ENUM_LN
+ /// flag, despite the name of the flag.
///
///
/// -
@@ -765,8 +865,8 @@ namespace Vanara.PInvoke
///
-
/// RESOURCE_ENUM_VALIDATE0x0008
///
- /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that resources are
- /// properly formatted. The validation sets a maximum limit of 260 characters for each type that is enumerated.
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that
+ /// resources are properly formatted. The validation sets a maximum limit of 260 characters for each type that is enumerated.
///
///
///
@@ -775,21 +875,21 @@ namespace Vanara.PInvoke
///
/// Type: LANGID
///
- /// The language used to filter the search in the MUI module. This parameter is used only when the RESOURCE_ENUM_MUI flag is set in dwFlags. If
- /// zero is specified, then all .mui files that match current language preferences are included in the search, following the usual Resource Loader
- /// strategy (see User Interface Language Management). If a nonzero LangId is specified, then the only .mui file searched will be the one matching the
- /// specified LangId.
+ /// The language used to filter the search in the MUI module. This parameter is used only when the RESOURCE_ENUM_MUI flag is
+ /// set in dwFlags. If zero is specified, then all .mui files that match current language preferences are included in the search,
+ /// following the usual Resource Loader strategy (see User Interface Language Management). If a nonzero LangId is specified, then the
+ /// only .mui file searched will be the one matching the specified LangId.
///
///
///
/// Type: BOOL
///
- /// Returns TRUE if successful or FALSE if the function does not find a resource of the type specified, or if the function fails for
- /// another reason. To get extended error information, call GetLastError.
+ /// Returns TRUE if successful or FALSE if the function does not find a resource of the type specified, or if the
+ /// function fails for another reason. To get extended error information, call GetLastError.
///
///
- // BOOL WINAPI EnumResourceTypesEx( _In_opt_ HMODULE hModule, _In_ ENUMRESTYPEPROC lpEnumFunc, _In_ LONG_PTR lParam, _In_ DWORD dwFlags, _In_ LANGID LangId);
- // https://msdn.microsoft.com/en-us/library/windows/desktop/ms648040(v=vs.85).aspx
+ // BOOL WINAPI EnumResourceTypesEx( _In_opt_ HMODULE hModule, _In_ ENUMRESTYPEPROC lpEnumFunc, _In_ LONG_PTR lParam, _In_ DWORD
+ // dwFlags, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648040(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winbase.h", MSDNShortId = "ms648040")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -797,24 +897,26 @@ namespace Vanara.PInvoke
///
///
- /// Enumerates resource types associated with a specified binary module. The search can include both a language-neutral Portable Executable file (LN
- /// file) and its associated .mui files. Alternately, it can be limited to a single binary module of any type, or to the .mui files associated with a
- /// single LN file. The search can also be limited to a single associated .mui file that contains resources for a specific language.
+ /// Enumerates resource types associated with a specified binary module. The search can include both a language-neutral Portable
+ /// Executable file (LN
+ /// file) and its associated .mui files. Alternately, it can be limited to a single binary module of any type, or to the .mui files
+ /// associated with a single LN file. The search can also be limited to a single associated .mui file that contains resources for a
+ /// specific language.
///
///
///
/// Type: HMODULE
///
- /// The handle to a module to be searched. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then appropriate .mui files can be
- /// included in the search. Alternately, this can be a handle to an .mui file or other LN file.
+ /// The handle to a module to be searched. Typically this is an LN file, and if flag RESOURCE_ENUM_MUI is set, then
+ /// appropriate .mui files can be included in the search. Alternately, this can be a handle to an .mui file or other LN file.
///
/// If this parameter is NULL, it is equivalent to passing in a handle to the module used to create the current process.
///
///
/// Type: DWORD
///
- /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the RESOURCE_ENUM_LN and
- /// RESOURCE_ENUM_MUI flags are assumed to be specified.
+ /// The type of file to be searched. The following values are supported. Note that if dwFlags is zero, then the
+ /// RESOURCE_ENUM_LN and RESOURCE_ENUM_MUI flags are assumed to be specified.
///
///
///
@@ -825,10 +927,11 @@ namespace Vanara.PInvoke
/// -
/// RESOURCE_ENUM_MUI0x0002
///
- /// Search for resource types in one of the .mui files associated with the file specified by hModule and with the current language preferences, following
- /// the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is nonzero, then only the .mui file of the
- /// language as specified by LangId will be searched. Typically this flag should be used only if hModule references an LN file. If hModule references an
- /// .mui file, then that file is actually covered by the RESOURCE_ENUM_LN flag, despite the name of the flag.
+ /// Search for resource types in one of the .mui files associated with the file specified by hModule and with the current language
+ /// preferences, following the usual Resource Loader strategy (see User Interface Language Management). Alternately, if LangId is
+ /// nonzero, then only the .mui file of the language as specified by LangId will be searched. Typically this flag should be used only
+ /// if hModule references an LN file. If hModule references an .mui file, then that file is actually covered by the RESOURCE_ENUM_LN
+ /// flag, despite the name of the flag.
///
///
/// -
@@ -838,8 +941,8 @@ namespace Vanara.PInvoke
///
-
/// RESOURCE_ENUM_VALIDATE0x0008
///
- /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that resources are
- /// properly formatted. The validation sets a maximum limit of 260 characters for each type that is enumerated.
+ /// Performs extra validation on the resource section and its reference in the PE header while doing the enumeration to ensure that
+ /// resources are properly formatted. The validation sets a maximum limit of 260 characters for each type that is enumerated.
///
///
///
@@ -848,10 +951,10 @@ namespace Vanara.PInvoke
///
/// Type: LANGID
///
- /// The language used to filter the search in the MUI module. This parameter is used only when the RESOURCE_ENUM_MUI flag is set in dwFlags. If
- /// zero is specified, then all .mui files that match current language preferences are included in the search, following the usual Resource Loader
- /// strategy (see User Interface Language Management). If a nonzero LangId is specified, then the only .mui file searched will be the one matching the
- /// specified LangId.
+ /// The language used to filter the search in the MUI module. This parameter is used only when the RESOURCE_ENUM_MUI flag is
+ /// set in dwFlags. If zero is specified, then all .mui files that match current language preferences are included in the search,
+ /// following the usual Resource Loader strategy (see User Interface Language Management). If a nonzero LangId is specified, then the
+ /// only .mui file searched will be the one matching the specified LangId.
///
///
/// List of resource identifiers.
@@ -870,29 +973,30 @@ namespace Vanara.PInvoke
///
/// Type: HMODULE
///
- /// A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is NULL, the
- /// function searches the module used to create the current process.
+ /// A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is
+ /// NULL, the function searches the module used to create the current process.
///
///
///
/// Type: LPCTSTR
///
- /// The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of
- /// the resource. For more information, see the Remarks section below.
+ /// The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the
+ /// integer identifier of the resource. For more information, see the Remarks section below.
///
///
///
/// Type: LPCTSTR
///
- /// The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the
- /// given resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.
+ /// The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer
+ /// identifier of the given resource type. For standard resource types, see Resource Types. For more information, see the Remarks
+ /// section below.
///
///
///
/// Type: HRSRC
///
- /// If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this
- /// handle to the LoadResource function.
+ /// If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the
+ /// resource, pass this handle to the LoadResource function.
///
/// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
///
@@ -905,36 +1009,38 @@ namespace Vanara.PInvoke
///
/// Type: HMODULE
///
- /// A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is NULL, the
- /// function searches the module used to create the current process.
+ /// A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is
+ /// NULL, the function searches the module used to create the current process.
///
///
///
/// Type: LPCTSTR
///
- /// The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the
- /// given resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.
+ /// The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer
+ /// identifier of the given resource type. For standard resource types, see Resource Types. For more information, see the Remarks
+ /// section below.
///
///
///
/// Type: LPCTSTR
///
- /// The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of
- /// the resource. For more information, see the Remarks section below.
+ /// The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the
+ /// integer identifier of the resource. For more information, see the Remarks section below.
///
///
///
/// Type: WORD
/// The language of the resource. If this parameter is , the current language associated with the calling thread is used.
///
- /// To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more information, see MAKELANGID.
+ /// To specify a language other than the current language, use the MAKELANGID macro to create this parameter. For more
+ /// information, see MAKELANGID.
///
///
///
/// Type: HRSRC
///
- /// If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this
- /// handle to the LoadResource function.
+ /// If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the
+ /// resource, pass this handle to the LoadResource function.
///
/// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
///
@@ -946,8 +1052,8 @@ namespace Vanara.PInvoke
/// Locates a Unicode string (wide characters) in another Unicode string for a non-linguistic comparison.
///
///
- /// Flags specifying details of the find operation. These flags are mutually exclusive, with FIND_FROMSTART being the default. The application can
- /// specify just one of the find flags.
+ /// Flags specifying details of the find operation. These flags are mutually exclusive, with FIND_FROMSTART being the default. The
+ /// application can specify just one of the find flags.
///
///
///
@@ -976,41 +1082,44 @@ namespace Vanara.PInvoke
///
/// Pointer to the source string, in which the function searches for the string specified by lpStringValue.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application must normally specify a
- /// positive number, or 0. The application can specify -1 if the source string is null-terminated and the function should calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application must
+ /// normally specify a positive number, or 0. The application can specify -1 if the source string is null-terminated and the function
+ /// should calculate the size automatically.
///
/// Pointer to the search string for which the function searches in the source string.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application must normally specify a
- /// positive number, or 0. The application can specify -1 if the string is null-terminated and the function should calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application must
+ /// normally specify a positive number, or 0. The application can specify -1 if the string is null-terminated and the function should
+ /// calculate the size automatically.
///
///
- /// TRUE if the function is to perform a case-insensitive comparison, and FALSE otherwise. The comparison is not a linguistic operation and
- /// is not appropriate for all locales and languages. Its behavior is similar to that for English.
+ /// TRUE if the function is to perform a case-insensitive comparison, and FALSE otherwise. The comparison is not a
+ /// linguistic operation and is not appropriate for all locales and languages. Its behavior is similar to that for English.
///
///
///
- /// Returns a 0-based index into the source string indicated by lpStringSource if successful. If the function succeeds, the found string is the same size
- /// as the value of lpStringValue. A return value of 0 indicates that the function found a match at the beginning of the source string.
+ /// Returns a 0-based index into the source string indicated by lpStringSource if successful. If the function succeeds, the found
+ /// string is the same size as the value of lpStringValue. A return value of 0 indicates that the function found a match at the
+ /// beginning of the source string.
///
///
- /// The function returns -1 if it does not succeed or if it does not find the search string. To get extended error information, the application can call
- /// GetLastError, which can return one of the following error codes:
+ /// The function returns -1 if it does not succeed or if it does not find the search string. To get extended error information, the
+ /// application can call GetLastError, which can return one of the following error codes:
///
///
- // int FindStringOrdinal( _In_ DWORD dwFindStringOrdinalFlags, _In_ LPCWSTR lpStringSource, _In_ int cchSource, _In_ LPCWSTR lpStringValue, _In_ int
- // cchValue, _In_ BOOL bIgnoreCase); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318061(v=vs.85).aspx
+ // int FindStringOrdinal( _In_ DWORD dwFindStringOrdinalFlags, _In_ LPCWSTR lpStringSource, _In_ int cchSource, _In_ LPCWSTR
+ // lpStringValue, _In_ int cchValue, _In_ BOOL bIgnoreCase); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318061(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Libloaderapi.h", MSDNShortId = "dd318061")]
public static extern int FindStringOrdinal(SEARCH_FLAGS dwFindStringOrdinalFlags, string lpStringSource, int cchSource, string lpStringValue, int cchValue, [MarshalAs(UnmanagedType.Bool)] bool bIgnoreCase);
///
- /// Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. When the reference count reaches zero, the
- /// module is unloaded from the address space of the calling process and the handle is no longer valid.
+ /// Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. When the reference count
+ /// reaches zero, the module is unloaded from the address space of the calling process and the handle is no longer valid.
///
///
- /// A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function
- /// returns this handle.
+ /// A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or
+ /// GetModuleHandleEx function returns this handle.
///
///
/// If the function succeeds, the return value is nonzero.
@@ -1023,16 +1132,17 @@ namespace Vanara.PInvoke
public static extern bool FreeLibrary(IntPtr hModule);
///
- /// Decrements the reference count of a loaded dynamic-link library (DLL) by one, then calls ExitThread to terminate the calling thread. The
- /// function does not return.
+ /// Decrements the reference count of a loaded dynamic-link library (DLL) by one, then calls ExitThread to terminate the
+ /// calling thread. The function does not return.
///
///
///
- /// A handle to the DLL module whose reference count the function decrements. The LoadLibrary or GetModuleHandleEx function returns this handle.
+ /// A handle to the DLL module whose reference count the function decrements. The LoadLibrary or GetModuleHandleEx
+ /// function returns this handle.
///
///
- /// Do not call this function with a handle returned by the GetModuleHandle function, since this function does not maintain a reference count for
- /// the module.
+ /// Do not call this function with a handle returned by the GetModuleHandle function, since this function does not maintain a
+ /// reference count for the module.
///
///
/// The exit code for the calling thread.
@@ -1040,15 +1150,17 @@ namespace Vanara.PInvoke
// VOID WINAPI FreeLibraryAndExitThread( _In_ HMODULE hModule, _In_ DWORD dwExitCode); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683153(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "ms683153")]
- public static extern void FreeLibraryAndExitThread([In] IntPtr hLibModule, uint dwExitCode);
+ public static extern void FreeLibraryAndExitThread([In] IntPtr hModule, uint dwExitCode);
///
///
- /// [This function is obsolete and is only supported for backward compatibility with 16-bit Windows. For 32-bit Windows applications, it is not necessary
- /// to free the resources loaded using LoadResource. If used on 32 or 64-bit Windows systems, this function will return FALSE.]
+ /// [This function is obsolete and is only supported for backward compatibility with 16-bit Windows. For 32-bit Windows applications,
+ /// it is not necessary to free the resources loaded using LoadResource. If used on 32 or 64-bit Windows systems, this
+ /// function will return FALSE.]
///
///
- /// Decrements (decreases by one) the reference count of a loaded resource. When the reference count reaches zero, the memory occupied by the resource is freed.
+ /// Decrements (decreases by one) the reference count of a loaded resource. When the reference count reaches zero, the memory
+ /// occupied by the resource is freed.
///
///
///
@@ -1065,47 +1177,50 @@ namespace Vanara.PInvoke
[PInvokeData("Winbase.h", MSDNShortId = "ms648044")]
[Obsolete]
[return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool FreeResource([In] SafeResourceDataHandle hResData);
+ public static extern bool FreeResource([In] SafeResourceDataHandle hglbResource);
///
- /// Retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the current process.
+ ///
+ /// Retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the
+ /// current process.
+ ///
/// To locate the file for a module that was loaded by another process, use the GetModuleFileNameEx function.
///
///
///
- /// A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of the
- /// executable file of the current process.
+ /// A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves
+ /// the path of the executable file of the current process.
///
///
- /// The GetModuleFileName function does not retrieve the path for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For
- /// more information, see LoadLibraryEx.
+ /// The GetModuleFileName function does not retrieve the path for modules that were loaded using the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
///
///
///
///
- /// A pointer to a buffer that receives the fully qualified path of the module. If the length of the path is less than the size that the nSize parameter
- /// specifies, the function succeeds and the path is returned as a null-terminated string.
+ /// A pointer to a buffer that receives the fully qualified path of the module. If the length of the path is less than the size that
+ /// the nSize parameter specifies, the function succeeds and the path is returned as a null-terminated string.
///
///
- /// If the length of the path exceeds the size that the nSize parameter specifies, the function succeeds and the string is truncated to nSize characters
- /// including the terminating null character.
+ /// If the length of the path exceeds the size that the nSize parameter specifies, the function succeeds and the string is truncated
+ /// to nSize characters including the terminating null character.
///
/// Windows XP: The string is truncated to nSize characters and is not null-terminated.
///
- /// The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and
- /// can use the prefix "\\?\". For more information, see Naming a File.
+ /// The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or
+ /// short file name, and can use the prefix "\\?\". For more information, see Naming a File.
///
///
/// The size of the lpFilename buffer, in TCHARs.
///
///
- /// If the function succeeds, the return value is the length of the string that is copied to the buffer, in characters, not including the terminating
- /// null character. If the buffer is too small to hold the module name, the string is truncated to nSize characters including the terminating null
- /// character, the function returns nSize, and the function sets the last error to ERROR_INSUFFICIENT_BUFFER.
+ /// If the function succeeds, the return value is the length of the string that is copied to the buffer, in characters, not including
+ /// the terminating null character. If the buffer is too small to hold the module name, the string is truncated to nSize characters
+ /// including the terminating null character, the function returns nSize, and the function sets the last error to ERROR_INSUFFICIENT_BUFFER.
///
///
- /// Windows XP: If the buffer is too small to hold the module name, the function returns nSize. The last error code remains ERROR_SUCCESS.
- /// If nSize is zero, the return value is zero and the last error code is ERROR_SUCCESS.
+ /// Windows XP: If the buffer is too small to hold the module name, the function returns nSize. The last error code remains
+ /// ERROR_SUCCESS. If nSize is zero, the return value is zero and the last error code is ERROR_SUCCESS.
///
/// If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.
///
@@ -1115,20 +1230,21 @@ namespace Vanara.PInvoke
public static extern uint GetModuleFileName(SafeLibraryHandle hModule, [Out] StringBuilder lpFilename, uint nSize);
///
- /// Retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the current process.
+ /// Retrieves the fully qualified path for the file that contains the specified module. The module must have been loaded by the
+ /// current process.
/// To locate the file for a module that was loaded by another process, use the GetModuleFileNameEx function.
///
///
- /// A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of the executable file
- /// of the current process.
+ /// A handle to the loaded module whose path is being requested. If this parameter is NULL, GetModuleFileName retrieves the path of
+ /// the executable file of the current process.
///
- /// The GetModuleFileName function does not retrieve the path for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more information,
- /// see LoadLibraryEx.
+ /// The GetModuleFileName function does not retrieve the path for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag.
+ /// For more information, see LoadLibraryEx.
///
///
///
- /// The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and
- /// can use the prefix "\\?\". For more information, see Naming a File.
+ /// The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or
+ /// short file name, and can use the prefix "\\?\". For more information, see Naming a File.
///
[SecurityCritical]
[PInvokeData("WinBase.h", MSDNShortId = "ms683197")]
@@ -1153,81 +1269,78 @@ namespace Vanara.PInvoke
///
///
///
- /// The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended.
- /// The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to
- /// specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the
- /// names of modules currently mapped into the address space of the calling process.
+ /// The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension
+ /// .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no
+ /// extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward
+ /// slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the
+ /// calling process.
///
- /// If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
///
- /// The GetModuleHandle function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more
- /// information, see LoadLibraryEx.
+ /// If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
+ ///
+ ///
+ /// The GetModuleHandle function does not retrieve handles for modules that were loaded using the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
///
///
///
/// If the function succeeds, the return value is a handle to the specified module.
/// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
///
- public static SafeLibraryHandle GetModuleHandle(string lpModuleName)
- {
- var ptr = GetModuleHandleInternal(lpModuleName);
- return new SafeLibraryHandle(ptr, false);
- }
+ // HMODULE WINAPI GetModuleHandle( _In_opt_ LPCTSTR lpModuleName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683199(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("Winbase.h", MSDNShortId = "ms683199")]
+ public static extern IntPtr GetModuleHandle([Optional] string lpModuleName);
///
- /// Retrieves a module handle for the specified module and increments the module's reference count unless GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT is
- /// specified. The module must have been loaded by the calling process.
+ /// Retrieves a module handle for the specified module and increments the module's reference count unless
+ /// GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT is specified. The module must have been loaded by the calling process.
///
///
- /// This parameter can be zero or one or more of the following values. If the module's reference count is incremented, the caller must use the
- /// FreeLibrary function to decrement the reference count when the module handle is no longer needed.
+ /// This parameter can be zero or one or more of the following values. If the module's reference count is incremented, the caller
+ /// must use the FreeLibrary function to decrement the reference count when the module handle is no longer needed.
///
///
/// The name of the loaded module (either a .dll or .exe file), or an address in the module (if dwFlags is GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS).
///
- /// For a module name, if the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing
- /// point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to
- /// use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address
- /// space of the calling process.
+ /// For a module name, if the file name extension is omitted, the default library extension .dll is appended. The file name string
+ /// can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify
+ /// a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case
+ /// independently) to the names of modules currently mapped into the address space of the calling process.
///
/// If this parameter is NULL, the function returns a handle to the file used to create the calling process (.exe file).
///
///
/// A handle to the specified module. If the function fails, this parameter is NULL.
///
- /// The GetModuleHandleEx function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more
- /// information, see LoadLibraryEx.
+ /// The GetModuleHandleEx function does not retrieve handles for modules that were loaded using the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
///
///
///
/// If the function succeeds, the return value is nonzero.
/// If the function fails, the return value is zero. To get extended error information, see GetLastError.
///
- public static bool GetModuleHandleEx(GET_MODULE_HANDLE_EX dwFlags, [In] string lpModuleName, out SafeLibraryHandle phModule)
- {
- if (GetModuleHandleExInternal(dwFlags, lpModuleName, out IntPtr mod))
- {
- phModule = new SafeLibraryHandle(mod, (dwFlags & GET_MODULE_HANDLE_EX.GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT) == 0);
- return true;
- }
- phModule = SafeLibraryHandle.Null;
- return false;
- }
+ // BOOL WINAPI GetModuleHandleEx( _In_ DWORD dwFlags, _In_opt_ LPCTSTR lpModuleName, _Out_ HMODULE *phModule); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683200(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("Winbase.h", MSDNShortId = "ms683200")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG dwFlags, [Optional] string lpModuleName, out IntPtr phModule);
/// Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL).
///
///
- /// A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx, LoadPackagedLibrary, or
- /// GetModuleHandle function returns this handle.
+ /// A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx,
+ /// LoadPackagedLibrary, or GetModuleHandle function returns this handle.
///
///
- /// The GetProcAddress function does not retrieve addresses from modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more
- /// information, see LoadLibraryEx.
+ /// The GetProcAddress function does not retrieve addresses from modules that were loaded using the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
///
///
///
- /// The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the
- /// high-order word must be zero.
+ /// The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the
+ /// low-order word; the high-order word must be zero.
///
///
/// If the function succeeds, the return value is the address of the exported function or variable.
@@ -1239,27 +1352,30 @@ namespace Vanara.PInvoke
public static extern IntPtr GetProcAddress(SafeLibraryHandle hModule, [MarshalAs(UnmanagedType.LPStr)] string lpProcName);
///
- /// Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.
+ ///
+ /// Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.
+ ///
/// For additional load options, use the LoadLibraryEx function.
///
///
///
- /// The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). The name specified is the file name
- /// of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition
- /// (.def) file.
+ /// The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). The name
+ /// specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the
+ /// LIBRARY keyword in the module-definition (.def) file.
///
/// If the string specifies a full path, the function searches only that path for the module.
///
- /// If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module; for more
- /// information, see the Remarks.
+ /// If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the
+ /// module; for more information, see the Remarks.
///
///
- /// If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\), not forward slashes (/). For more
- /// information about paths, see Naming a File or Directory.
+ /// If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\), not forward
+ /// slashes (/). For more information about paths, see Naming a File or Directory.
///
///
- /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension .dll
- /// to the module name. To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module name string.
+ /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default
+ /// library extension .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing
+ /// point character (.) in the module name string.
///
///
///
@@ -1271,41 +1387,46 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
public static extern SafeLibraryHandle LoadLibrary([In, MarshalAs(UnmanagedType.LPTStr)] string lpFileName);
- /// Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.
+ ///
+ /// Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.
+ ///
///
///
- /// A string that specifies the file name of the module to load. This name is not related to the name stored in a library module itself, as specified by
- /// the LIBRARY keyword in the module-definition (.def) file.
+ /// A string that specifies the file name of the module to load. This name is not related to the name stored in a library module
+ /// itself, as specified by the LIBRARY keyword in the module-definition (.def) file.
///
///
- /// The module can be a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable module, static
- /// imports are not loaded; instead, the module is loaded as if DONT_RESOLVE_DLL_REFERENCES was specified. See the dwFlags parameter for more information.
+ /// The module can be a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable
+ /// module, static imports are not loaded; instead, the module is loaded as if DONT_RESOLVE_DLL_REFERENCES was specified. See
+ /// the dwFlags parameter for more information.
///
///
- /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension .dll
- /// to the module name. To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module name string.
+ /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default
+ /// library extension .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing
+ /// point character (.) in the module name string.
///
///
- /// If the string specifies a fully qualified path, the function searches only that path for the module. When specifying a path, be sure to use
- /// backslashes (\), not forward slashes (/). For more information about paths, see Naming Files, Paths, and Namespaces.
+ /// If the string specifies a fully qualified path, the function searches only that path for the module. When specifying a path, be
+ /// sure to use backslashes (\), not forward slashes (/). For more information about paths, see Naming Files, Paths, and Namespaces.
///
///
- /// If the string specifies a module name without a path and more than one loaded module has the same base name and extension, the function returns a
- /// handle to the module that was loaded first.
+ /// If the string specifies a module name without a path and more than one loaded module has the same base name and extension, the
+ /// function returns a handle to the module that was loaded first.
///
///
- /// If the string specifies a module name without a path and a module of the same name is not already loaded, or if the string specifies a module name
- /// with a relative path, the function searches for the specified module. The function also searches for modules if loading the specified module causes
- /// the system to load other associated modules (that is, if the module has dependencies). The directories that are searched and the order in which they
- /// are searched depend on the specified path and the dwFlags parameter. For more information, see Remarks.
+ /// If the string specifies a module name without a path and a module of the same name is not already loaded, or if the string
+ /// specifies a module name with a relative path, the function searches for the specified module. The function also searches for
+ /// modules if loading the specified module causes the system to load other associated modules (that is, if the module has
+ /// dependencies). The directories that are searched and the order in which they are searched depend on the specified path and the
+ /// dwFlags parameter. For more information, see Remarks.
///
/// If the function cannot find the module or one of its dependencies, the function fails.
///
/// This parameter is reserved for future use. It must be NULL.
///
///
- /// The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of the
- /// LoadLibrary function. This parameter can be one of the following values.
+ /// The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of
+ /// the LoadLibrary function. This parameter can be one of the following values.
///
///
///
@@ -1316,102 +1437,110 @@ namespace Vanara.PInvoke
/// -
/// DONT_RESOLVE_DLL_REFERENCES0x00000001
///
- /// If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination.
- /// Also, the system does not load additional executable modules that are referenced by the specified module.
+ /// If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization
+ /// and termination. Also, the system does not load additional executable modules that are referenced by the specified module.
///
///
/// -
/// LOAD_IGNORE_CODE_AUTHZ_LEVEL0x00000010
///
- /// If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL. This action applies only to the
- /// DLL being loaded and not to its dependencies. This value is recommended for use in setup programs that must run extracted DLLs during
- /// installation.Windows Server 2008 R2 and Windows 7: On systems with KB2532445 installed, the caller must be running as "LocalSystem"
- /// or "TrustedInstaller"; otherwise the system ignores this flag. For more information, see "You can circumvent AppLocker
- /// rules by using an Office macro on a computer that is running Windows 7 or Windows Server 2008 R2" in the Help and Support Knowledge Base at
- /// http://support.microsoft.com/kb/2532445.Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: AppLocker was introduced in Windows 7
- /// and Windows Server 2008 R2.
+ /// If this value is used, the system does not check AppLocker rules or apply Software Restriction Policies for the DLL. This action
+ /// applies only to the DLL being loaded and not to its dependencies. This value is recommended for use in setup programs that must
+ /// run extracted DLLs during installation.Windows Server 2008 R2 and Windows 7: On systems with KB2532445 installed, the caller must
+ /// be running as "LocalSystem" or "TrustedInstaller"; otherwise the system ignores this flag.
+ /// For more information, see "You can circumvent AppLocker rules by using an Office macro on a computer that is running
+ /// Windows 7 or Windows Server 2008 R2" in the Help and Support Knowledge Base at
+ /// http://support.microsoft.com/kb/2532445.Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP: AppLocker was
+ /// introduced in Windows 7 and Windows Server 2008 R2.
///
///
/// -
/// LOAD_LIBRARY_AS_DATAFILE0x00000002
///
- /// If this value is used, the system maps the file into the calling process's virtual address space as if it were a data file. Nothing is done
- /// to execute or prepare to execute the mapped file. Therefore, you cannot call functions like GetModuleFileName, GetModuleHandle or GetProcAddress with
- /// this DLL. Using this value causes writes to read-only memory to raise an access violation. Use this flag when you want to load a DLL only to extract
- /// messages or resources from it.This value can be used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks.
+ /// If this value is used, the system maps the file into the calling process's virtual address space as if it were a data
+ /// file. Nothing is done to execute or prepare to execute the mapped file. Therefore, you cannot call functions like
+ /// GetModuleFileName, GetModuleHandle or GetProcAddress with this DLL. Using this value causes writes to read-only memory to raise
+ /// an access violation. Use this flag when you want to load a DLL only to extract messages or resources from it.This value can be
+ /// used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks.
///
///
/// -
/// LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE0x00000040
///
- /// Similar to LOAD_LIBRARY_AS_DATAFILE, except that the DLL file is opened with exclusive write access for the calling process. Other processes cannot
- /// open the DLL file for write access while it is in use. However, the DLL can still be opened by other processes.This value can be used with
- /// LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks.Windows Server 2003 and Windows XP: This value is not supported until Windows Vista.
+ /// Similar to LOAD_LIBRARY_AS_DATAFILE, except that the DLL file is opened with exclusive write access for the calling process.
+ /// Other processes cannot open the DLL file for write access while it is in use. However, the DLL can still be opened by other
+ /// processes.This value can be used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks.Windows Server 2003 and
+ /// Windows XP: This value is not supported until Windows Vista.
///
///
/// -
/// LOAD_LIBRARY_AS_IMAGE_RESOURCE0x00000020
///
- /// If this value is used, the system maps the file into the process's virtual address space as an image file. However, the loader does not load
- /// the static imports or perform the other usual initialization steps. Use this flag when you want to load a DLL only to extract messages or resources
- /// from it.Unless the application depends on the file having the in-memory layout of an image, this value should be used with either
- /// LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_DATAFILE. For more information, see the Remarks section.Windows Server 2003 and Windows XP:
- /// This value is not supported until Windows Vista.
+ /// If this value is used, the system maps the file into the process's virtual address space as an image file. However, the
+ /// loader does not load the static imports or perform the other usual initialization steps. Use this flag when you want to load a
+ /// DLL only to extract messages or resources from it.Unless the application depends on the file having the in-memory layout of an
+ /// image, this value should be used with either LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_DATAFILE. For more
+ /// information, see the Remarks section.Windows Server 2003 and Windows XP: This value is not supported until Windows Vista.
///
///
/// -
/// LOAD_LIBRARY_SEARCH_APPLICATION_DIR0x00000200
///
- /// If this value is used, the application's installation directory is searched for the DLL and its dependencies. Directories in the standard
- /// search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows Server 2008 R2, Windows Vista and
- /// Windows Server 2008: This value requires KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is not supported.
+ /// If this value is used, the application's installation directory is searched for the DLL and its dependencies. Directories
+ /// in the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows
+ /// Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to be installed.Windows Server 2003 and
+ /// Windows XP: This value is not supported.
///
///
/// -
/// LOAD_LIBRARY_SEARCH_DEFAULT_DIRS0x00001000
///
- /// This value is a combination of LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, and LOAD_LIBRARY_SEARCH_USER_DIRS. Directories in
- /// the standard search path are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.This value represents the recommended
- /// maximum number of directories an application should include in its DLL search path.Windows 7, Windows Server 2008 R2, Windows Vista and Windows
- /// Server 2008: This value requires KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is not supported.
+ /// This value is a combination of LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, and
+ /// LOAD_LIBRARY_SEARCH_USER_DIRS. Directories in the standard search path are not searched. This value cannot be combined with
+ /// LOAD_WITH_ALTERED_SEARCH_PATH.This value represents the recommended maximum number of directories an application should include
+ /// in its DLL search path.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623 to
+ /// be installed.Windows Server 2003 and Windows XP: This value is not supported.
///
///
/// -
/// LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR0x00000100
///
- /// If this value is used, the directory that contains the DLL is temporarily added to the beginning of the list of directories that are searched for the
- /// DLL's dependencies. Directories in the standard search path are not searched.The lpFileName parameter must specify a fully qualified path.
- /// This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.For example, if Lib2.dll is a dependency of C:\Dir1\Lib1.dll, loading Lib1.dll with
- /// this value causes the system to search for Lib2.dll only in C:\Dir1. To search for Lib2.dll in C:\Dir1 and all of the directories in the DLL search
- /// path, combine this value with LOAD_LIBRARY_DEFAULT_DIRS.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires
- /// KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is not supported.
+ /// If this value is used, the directory that contains the DLL is temporarily added to the beginning of the list of directories that
+ /// are searched for the DLL's dependencies. Directories in the standard search path are not searched.The lpFileName
+ /// parameter must specify a fully qualified path. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.For example, if
+ /// Lib2.dll is a dependency of C:\Dir1\Lib1.dll, loading Lib1.dll with this value causes the system to search for Lib2.dll only in
+ /// C:\Dir1. To search for Lib2.dll in C:\Dir1 and all of the directories in the DLL search path, combine this value with
+ /// LOAD_LIBRARY_DEFAULT_DIRS.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value requires KB2533623
+ /// to be installed.Windows Server 2003 and Windows XP: This value is not supported.
///
///
/// -
/// LOAD_LIBRARY_SEARCH_SYSTEM320x00000800
///
- /// If this value is used, %windows%\system32 is searched for the DLL and its dependencies. Directories in the standard search path are not searched.
- /// This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server 2008: This value
- /// requires KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is not supported.
+ /// If this value is used, %windows%\system32 is searched for the DLL and its dependencies. Directories in the standard search path
+ /// are not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows Server 2008 R2, Windows
+ /// Vista and Windows Server 2008: This value requires KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is
+ /// not supported.
///
///
/// -
/// LOAD_LIBRARY_SEARCH_USER_DIRS0x00000400
///
- /// If this value is used, directories added using the AddDllDirectory or the SetDllDirectory function are searched for the DLL and its dependencies. If
- /// more than one directory has been added, the order in which the directories are searched is unspecified. Directories in the standard search path are
- /// not searched. This value cannot be combined with LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server
+ /// If this value is used, directories added using the AddDllDirectory or the SetDllDirectory function are searched for the DLL and
+ /// its dependencies. If more than one directory has been added, the order in which the directories are searched is unspecified.
+ /// Directories in the standard search path are not searched. This value cannot be combined with
+ /// LOAD_WITH_ALTERED_SEARCH_PATH.Windows 7, Windows Server 2008 R2, Windows Vista and Windows Server
/// 2008: This value requires KB2533623 to be installed.Windows Server 2003 and Windows XP: This value is not supported.
///
///
/// -
/// LOAD_WITH_ALTERED_SEARCH_PATH0x00000008
///
- /// If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed in the Remarks section
- /// to find associated executable modules that the specified module causes to be loaded. If this value is used and lpFileName specifies a relative path,
- /// the behavior is undefined.If this value is not used, or if lpFileName does not specify a path, the system uses the standard search strategy discussed
- /// in the Remarks section to find associated executable modules that the specified module causes to be loaded.This value cannot be combined with any
- /// LOAD_LIBRARY_SEARCH flag.
+ /// If this value is used and lpFileName specifies an absolute path, the system uses the alternate file search strategy discussed in
+ /// the Remarks section to find associated executable modules that the specified module causes to be loaded. If this value is used
+ /// and lpFileName specifies a relative path, the behavior is undefined.If this value is not used, or if lpFileName does not specify
+ /// a path, the system uses the standard search strategy discussed in the Remarks section to find associated executable modules that
+ /// the specified module causes to be loaded.This value cannot be combined with any LOAD_LIBRARY_SEARCH flag.
///
///
///
@@ -1431,8 +1560,8 @@ namespace Vanara.PInvoke
///
/// Type: HMODULE
///
- /// A handle to the module whose executable file contains the resource. If hModule is NULL, the system loads the resource from the module that was
- /// used to create the current process.
+ /// A handle to the module whose executable file contains the resource. If hModule is NULL, the system loads the resource from
+ /// the module that was used to create the current process.
///
///
///
@@ -1454,14 +1583,16 @@ namespace Vanara.PInvoke
///
/// Type: HGLOBAL
///
- /// A handle to the resource to be accessed. The LoadResource function returns this handle. Note that this parameter is listed as an
- /// HGLOBAL variable only for backward compatibility. Do not pass any value as a parameter other than a successful return value from the
- /// LoadResource function.
+ /// A handle to the resource to be accessed. The LoadResource function returns this handle. Note that this parameter is listed
+ /// as an HGLOBAL variable only for backward compatibility. Do not pass any value as a parameter other than a successful
+ /// return value from the LoadResource function.
///
///
///
/// Type: LPVOID
- /// If the loaded resource is available, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.
+ ///
+ /// If the loaded resource is available, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.
+ ///
///
// LPVOID WINAPI LockResource( _In_ HGLOBAL hResData); https://msdn.microsoft.com/en-us/library/windows/desktop/ms648047(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
@@ -1469,6 +1600,69 @@ namespace Vanara.PInvoke
[SuppressUnmanagedCodeSecurity]
public static extern IntPtr LockResource(SafeResourceDataHandle hResData);
+ ///
+ /// Determines whether the specified function in a delay-loaded DLL is available on the system.
+ ///
+ ///
+ ///
+ /// A handle to the calling module. Desktop applications can use the GetModuleHandle or GetModuleHandleEx function to get this
+ /// handle. Windows Store apps should set this parameter to .
+ ///
+ ///
+ ///
+ /// The file name of the delay-loaded DLL that exports the specified function. This parameter is case-insensitive.
+ ///
+ /// Windows Store apps should specify API sets, rather than monolithic DLLs. For example, api-ms-win-core-memory-l1-1-1.dll, rather
+ /// than kernel32.dll.
+ ///
+ ///
+ ///
+ /// The name of the function to query. This parameter is case-sensitive.
+ ///
+ ///
+ /// This parameter is reserved and must be zero (0).
+ ///
+ ///
+ ///
+ /// TRUE if the specified function is available on the system. If the specified function is not available on the system, this
+ /// function returns FALSE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ ///
+ /// A delay-loaded DLL is statically linked but not actually loaded into memory until the running application references a symbol
+ /// exported by that DLL. Applications often delay load DLLs that contain functions the application might call only rarely or not at
+ /// all, because the DLL is only loaded when it is needed instead of being loaded at application startup like other statically linked
+ /// DLLs. This helps improve application performance, especially during initialization. A delay-load DLL is specified at link time
+ /// with the /DELAYLOAD (Delay Load Import) linker option.
+ ///
+ ///
+ /// Applications that target multiple versions of Windows or multiple Windows device families also rely on delay-loaded DLLs to make
+ /// visible extra features when they are available.
+ ///
+ ///
+ /// A desktop application can use delayed loading as an alternative to runtime dynamic linking that uses LoadLibrary or LoadLibraryEx
+ /// to load a DLL and GetProcAddress to get a pointer to a function. A Windows Store app cannot use LoadLibrary or
+ /// LoadLibraryEx, so to get the benefits to runtime dynamic linking, a Windows Store app must use the delayed loading mechanism.
+ ///
+ ///
+ /// To check whether a function in a delay-loaded DLL is available on the system, the application calls
+ /// QueryOptionalDelayLoadedAPI with the specified function. If QueryOptionalDelayLoadedAPI succeeds, the application
+ /// can safely call the specified function.
+ ///
+ /// Examples
+ ///
+ /// The following example shows how to use QueryOptionalDelayLoadedAPI to determine whether the VirtualAllocEx function is
+ /// available on the system.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi2/nf-libloaderapi2-queryoptionaldelayloadedapi BOOL
+ // QueryOptionalDelayLoadedAPI( HMODULE hParentModule, LPCSTR lpDllName, LPCSTR lpProcName, DWORD Reserved );
+ [DllImport(Lib.KernelBase, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Ansi)]
+ [PInvokeData("libloaderapi2.h", MSDNShortId = "43690689-4372-48ae-ac6d-230250f05f7c")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool QueryOptionalDelayLoadedAPI(SafeLibraryHandle hParentModule, string lpDllName, string lpProcName, uint Reserved = 0);
+
/// Removes a directory that was added to the process DLL search path by using AddDllDirectory.
/// The cookie returned by AddDllDirectory when the directory was added to the search path.
///
@@ -1482,8 +1676,8 @@ namespace Vanara.PInvoke
public static extern bool RemoveDllDirectory(IntPtr Cookie);
///
- /// Specifies a default set of directories to search when the calling process loads a DLL. This search path is used when LoadLibraryEx is called
- /// with no LOAD_LIBRARY_SEARCH flags.
+ /// Specifies a default set of directories to search when the calling process loads a DLL. This search path is used when
+ /// LoadLibraryEx is called with no LOAD_LIBRARY_SEARCH flags.
///
///
/// The directories to search. This parameter can be any combination of the following values.
@@ -1500,8 +1694,9 @@ namespace Vanara.PInvoke
/// -
/// LOAD_LIBRARY_SEARCH_DEFAULT_DIRS0x00001000
///
- /// This value is a combination of LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, and LOAD_LIBRARY_SEARCH_USER_DIRS.This value
- /// represents the recommended maximum number of directories an application should include in its DLL search path.
+ /// This value is a combination of LOAD_LIBRARY_SEARCH_APPLICATION_DIR, LOAD_LIBRARY_SEARCH_SYSTEM32, and
+ /// LOAD_LIBRARY_SEARCH_USER_DIRS.This value represents the recommended maximum number of directories an application should include
+ /// in its DLL search path.
///
///
/// -
@@ -1511,8 +1706,8 @@ namespace Vanara.PInvoke
///
-
/// LOAD_LIBRARY_SEARCH_USER_DIRS0x00000400
///
- /// If this value is used, any path explicitly added using the AddDllDirectory or SetDllDirectory function is searched. If more than one directory has
- /// been added, the order in which those directories are searched is unspecified.
+ /// If this value is used, any path explicitly added using the AddDllDirectory or SetDllDirectory function is searched. If more than
+ /// one directory has been added, the order in which those directories are searched is unspecified.
///
///
///
@@ -1547,67 +1742,6 @@ namespace Vanara.PInvoke
[PInvokeData("Winbase.h", MSDNShortId = "ms648048")]
public static extern uint SizeofResource(SafeLibraryHandle hModule, SafeResourceHandle hResInfo);
- ///
- /// Retrieves a module handle for the specified module and increments the module's reference count unless GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT is
- /// specified. The module must have been loaded by the calling process.
- ///
- ///
- /// This parameter can be zero or one or more of the following values. If the module's reference count is incremented, the caller must use the
- /// FreeLibrary function to decrement the reference count when the module handle is no longer needed.
- ///
- ///
- /// The name of the loaded module (either a .dll or .exe file), or an address in the module (if dwFlags is GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS).
- ///
- /// For a module name, if the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing
- /// point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to
- /// use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address
- /// space of the calling process.
- ///
- /// If this parameter is NULL, the function returns a handle to the file used to create the calling process (.exe file).
- ///
- ///
- /// A handle to the specified module. If the function fails, this parameter is NULL.
- ///
- /// The GetModuleHandleEx function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more
- /// information, see LoadLibraryEx.
- ///
- ///
- ///
- /// If the function succeeds, the return value is nonzero.
- /// If the function fails, the return value is zero. To get extended error information, see GetLastError.
- ///
- // BOOL WINAPI GetModuleHandleEx( _In_ DWORD dwFlags, _In_opt_ LPCTSTR lpModuleName, _Out_ HMODULE *phModule); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683200(v=vs.85).aspx
- [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "GetModuleHandleExW")]
- [PInvokeData("Winbase.h", MSDNShortId = "ms683200")]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool GetModuleHandleExInternal(GET_MODULE_HANDLE_EX dwFlags, [In] string lpModuleName, out IntPtr phModule);
-
- ///
- /// Retrieves a module handle for the specified module. The module must have been loaded by the calling process.
- /// To avoid the race conditions described in the Remarks section, use the GetModuleHandleEx function.
- ///
- ///
- ///
- /// The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended.
- /// The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to
- /// specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the
- /// names of modules currently mapped into the address space of the calling process.
- ///
- /// If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file).
- ///
- /// The GetModuleHandle function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more
- /// information, see LoadLibraryEx.
- ///
- ///
- ///
- /// If the function succeeds, the return value is a handle to the specified module.
- /// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
- ///
- // HMODULE WINAPI GetModuleHandle( _In_opt_ LPCTSTR lpModuleName); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683199(v=vs.85).aspx
- [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, EntryPoint = "GetModuleHandleW")]
- [PInvokeData("Winbase.h", MSDNShortId = "ms683199")]
- private static extern IntPtr GetModuleHandleInternal([In] string lpModuleName);
-
/// A safe handle for HMODULE.
///
[PInvokeData("LibLoaderAPI.h")]
@@ -1619,32 +1753,33 @@ namespace Vanara.PInvoke
/// Initializes a new instance of the class.
///
///
- /// A string that specifies the file name of the module to load. This name is not related to the name stored in a library module itself, as specified
- /// by the LIBRARY keyword in the module-definition (.def) file.
+ /// A string that specifies the file name of the module to load. This name is not related to the name stored in a library module
+ /// itself, as specified by the LIBRARY keyword in the module-definition (.def) file.
///
///
- /// The module can be a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable module, static
- /// imports are not loaded; instead, the module is loaded as if was specified. See the
- /// parameter for more information.
+ /// The module can be a library module (a .dll file) or an executable module (an .exe file). If the specified module is an
+ /// executable module, static imports are not loaded; instead, the module is loaded as if was specified. See the parameter for more information.
///
///
- /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension
- /// .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module
- /// name string.
+ /// If the string specifies a module name without a path and the file name extension is omitted, the function appends the default
+ /// library extension .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing
+ /// point character (.) in the module name string.
///
///
- /// If the string specifies a fully qualified path, the function searches only that path for the module. When specifying a path, be sure to use
- /// backslashes (\), not forward slashes (/). For more information about paths, see Naming Files, Paths, and Namespaces.
+ /// If the string specifies a fully qualified path, the function searches only that path for the module. When specifying a path,
+ /// be sure to use backslashes (\), not forward slashes (/). For more information about paths, see Naming Files, Paths, and Namespaces.
///
///
- /// If the string specifies a module name without a path and more than one loaded module has the same base name and extension, the function returns a
- /// handle to the module that was loaded first.
+ /// If the string specifies a module name without a path and more than one loaded module has the same base name and extension,
+ /// the function returns a handle to the module that was loaded first.
///
///
- /// If the string specifies a module name without a path and a module of the same name is not already loaded, or if the string specifies a module
- /// name with a relative path, the function searches for the specified module. The function also searches for modules if loading the specified module
- /// causes the system to load other associated modules (that is, if the module has dependencies). The directories that are searched and the order in
- /// which they are searched depend on the specified path and the dwFlags parameter.
+ /// If the string specifies a module name without a path and a module of the same name is not already loaded, or if the string
+ /// specifies a module name with a relative path, the function searches for the specified module. The function also searches for
+ /// modules if loading the specified module causes the system to load other associated modules (that is, if the module has
+ /// dependencies). The directories that are searched and the order in which they are searched depend on the specified path and
+ /// the dwFlags parameter.
///
/// If the function cannot find the module or one of its dependencies, the function fails.
///
@@ -1666,30 +1801,22 @@ namespace Vanara.PInvoke
public static SafeLibraryHandle Null { get; } = new SafeLibraryHandle(IntPtr.Zero);
///
- /// Gets a value indicating whether the module was loaded as a data file (LOAD_LIBRARY_AS_DATAFILE or LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE). Equivalent
- /// to LDR_IS_DATAFILE.
+ /// Gets a value indicating whether the module was loaded as a data file (LOAD_LIBRARY_AS_DATAFILE or
+ /// LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE). Equivalent to LDR_IS_DATAFILE.
///
public bool IsDataFile => (handle.ToInt64() & 1) != 0;
- /// Gets a value indicating whether the module was loaded as an image file (LOAD_LIBRARY_AS_IMAGE_RESOURCE). Equivalent to LDR_IS_IMAGEMAPPING.
+ ///
+ /// Gets a value indicating whether the module was loaded as an image file (LOAD_LIBRARY_AS_IMAGE_RESOURCE). Equivalent to LDR_IS_IMAGEMAPPING.
+ ///
public bool IsImageMapping => (handle.ToInt64() & 2) != 0;
- /// Gets a value indicating whether the module was loaded as either a data file or an image file. Equivalent to LDR_IS_RESOURCE.
+ ///
+ /// Gets a value indicating whether the module was loaded as either a data file or an image file. Equivalent to LDR_IS_RESOURCE.
+ ///
public bool IsResource => (handle.ToInt64() & 3) != 0;
}
- /// Represents a resource data block handle.
- ///
- public class SafeResourceHandle : GenericSafeHandle
- {
- /// Initializes a new instance of the class.
- public SafeResourceHandle() : this(IntPtr.Zero) { }
-
- /// Initializes a new instance of the class.
- /// The handle.
- public SafeResourceHandle(IntPtr handle) : base(handle, h => true, false) { }
- }
-
/// Represents a loaded resource handle.
///
public class SafeResourceDataHandle : GenericSafeHandle
@@ -1706,5 +1833,17 @@ namespace Vanara.PInvoke
/// Gets the pointer to the memory of the resource.
public IntPtr LockedPtr => bptr != null ? bptr : (bptr = LockResource(this));
}
+
+ /// Represents a resource data block handle.
+ ///
+ public class SafeResourceHandle : GenericSafeHandle
+ {
+ /// Initializes a new instance of the class.
+ public SafeResourceHandle() : this(IntPtr.Zero) { }
+
+ /// Initializes a new instance of the class.
+ /// The handle.
+ public SafeResourceHandle(IntPtr handle) : base(handle, h => true, false) { }
+ }
}
}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/MemoryApi.cs b/PInvoke/Kernel32/MemoryApi.cs
index 5bd24f94..4b75e64c 100644
--- a/PInvoke/Kernel32/MemoryApi.cs
+++ b/PInvoke/Kernel32/MemoryApi.cs
@@ -2840,22 +2840,23 @@ namespace Vanara.PInvoke
public static extern SizeT VirtualQueryEx([In] IntPtr hProcess, [In] IntPtr lpAddress, IntPtr lpBuffer, SizeT dwLength);
///
- /// Unlocks a specified range of pages in the virtual address space of a process, enabling the system to swap the pages out to the paging file if necessary.
+ /// Unlocks a specified range of pages in the virtual address space of a process, enabling the system to swap the pages out to the
+ /// paging file if necessary.
///
/// A pointer to the base address of the region of pages to be unlocked.
///
- /// The size of the region being unlocked, in bytes. The region of affected pages includes all pages containing one or more bytes in the range from the
- /// lpAddress parameter to . This means that a 2-byte range straddling a page boundary causes both pages to be unlocked.
+ /// The size of the region being unlocked, in bytes. The region of affected pages includes all pages containing one or more bytes in
+ /// the range from the lpAddress parameter to . This means that a 2-byte range straddling a page boundary causes both pages to be unlocked.
///
///
/// If the function succeeds, the return value is nonzero.
/// If the function fails, the return value is zero. To get extended error information, call GetLastError.
///
- // BOOL WINAPI VirtualUnlock( _In_ LPVOID lpAddress, _In_ SIZE_T dwSize);
+ // BOOL WINAPI VirtualUnlock( _In_ LPVOID lpAddress, _In_ SIZE_T dwSize); https://msdn.microsoft.com/en-us/library/windows/desktop/aa366910(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "aa366910")]
[return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool VirtualUnlock([In] IntPtr lpAddress, SizeT dwSize);
+ public static extern bool VirtualUnlock(IntPtr lpAddress, SizeT dwSize);
/// Writes data to an area of memory in a specified process. The entire area to be written to must be accessible or the operation fails.
///
diff --git a/PInvoke/Kernel32/ProcessSnapshot.cs b/PInvoke/Kernel32/ProcessSnapshot.cs
new file mode 100644
index 00000000..c6a66af3
--- /dev/null
+++ b/PInvoke/Kernel32/ProcessSnapshot.cs
@@ -0,0 +1,1816 @@
+using System;
+using System.Runtime.InteropServices;
+using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ /// The resolution in microseconds of the performance counters in PSS_PERFORMANCE_COUNTERS.
+ [PInvokeData("processsnapshot.h")]
+ public const uint PSS_PERF_RESOLUTION = 1000000;
+
+ ///
+ /// Flags that specify what PssCaptureSnapshot captures.
+ ///
+ ///
+ ///
+ /// If both PSS_CREATE_FORCE_BREAKAWAY and PSS_CREATE_BREAKAWAY are specified, then PSS_CREATE_FORCE_BREAKAWAY
+ /// takes precedence.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_capture_flags
+ // typedef enum PSS_CAPTURE_FLAGS { PSS_CAPTURE_NONE , PSS_CAPTURE_VA_CLONE , PSS_CAPTURE_RESERVED_00000002 , PSS_CAPTURE_HANDLES ,
+ // PSS_CAPTURE_HANDLE_NAME_INFORMATION , PSS_CAPTURE_HANDLE_BASIC_INFORMATION , PSS_CAPTURE_HANDLE_TYPE_SPECIFIC_INFORMATION ,
+ // PSS_CAPTURE_HANDLE_TRACE , PSS_CAPTURE_THREADS , PSS_CAPTURE_THREAD_CONTEXT , PSS_CAPTURE_THREAD_CONTEXT_EXTENDED ,
+ // PSS_CAPTURE_RESERVED_00000400 , PSS_CAPTURE_VA_SPACE , PSS_CAPTURE_VA_SPACE_SECTION_INFORMATION , PSS_CAPTURE_IPT_TRACE ,
+ // PSS_CREATE_BREAKAWAY_OPTIONAL , PSS_CREATE_BREAKAWAY , PSS_CREATE_FORCE_BREAKAWAY , PSS_CREATE_USE_VM_ALLOCATIONS ,
+ // PSS_CREATE_MEASURE_PERFORMANCE , PSS_CREATE_RELEASE_SECTION } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "6146DDA2-2475-45F8-86F3-65791B10743D")]
+ [Flags]
+ public enum PSS_CAPTURE_FLAGS : uint
+ {
+ /// Capture nothing.
+ PSS_CAPTURE_NONE = 0x00000000,
+
+ ///
+ /// Capture a snapshot of all cloneable pages in the process. The clone includes all MEM_PRIVATE regions, as well as all sections
+ /// (MEM_MAPPED and MEM_IMAGE) that are shareable. All Win32 sections created via CreateFileMapping are shareable.
+ ///
+ PSS_CAPTURE_VA_CLONE = 0x00000001,
+
+ /// (Do not use.)
+ PSS_CAPTURE_RESERVED_00000002 = 0x00000002,
+
+ /// Capture the handle table (handle values only).
+ PSS_CAPTURE_HANDLES = 0x00000004,
+
+ /// Capture name information for each handle.
+ PSS_CAPTURE_HANDLE_NAME_INFORMATION = 0x00000008,
+
+ /// Capture basic handle information such as HandleCount, PointerCount, GrantedAccess, etc.
+ PSS_CAPTURE_HANDLE_BASIC_INFORMATION = 0x00000010,
+
+ /// Capture type-specific information for supported object types: Process, Thread, Event, Mutant, Section.
+ PSS_CAPTURE_HANDLE_TYPE_SPECIFIC_INFORMATION = 0x00000020,
+
+ /// Capture the handle tracing table.
+ PSS_CAPTURE_HANDLE_TRACE = 0x00000040,
+
+ /// Capture thread information (IDs only).
+ PSS_CAPTURE_THREADS = 0x00000080,
+
+ /// Capture the context for each thread.
+ PSS_CAPTURE_THREAD_CONTEXT = 0x00000100,
+
+ /// Capture extended context for each thread (e.g. CONTEXT_XSTATE).
+ PSS_CAPTURE_THREAD_CONTEXT_EXTENDED = 0x00000200,
+
+ /// (Do not use.)
+ PSS_CAPTURE_RESERVED_00000400 = 0x00000400,
+
+ ///
+ /// Capture a snapshot of the virtual address space. The VA space is captured as an array of MEMORY_BASIC_INFORMATION structures.
+ /// This flag does not capture the contents of the pages.
+ ///
+ PSS_CAPTURE_VA_SPACE = 0x00000800,
+
+ ///
+ /// For MEM_IMAGE and MEM_MAPPED regions, dumps the path to the file backing the sections (identical to what GetMappedFileName
+ /// returns). For MEM_IMAGE regions, also dumps: The PROCESS_VM_READ access right is required on the process handle.
+ ///
+ PSS_CAPTURE_VA_SPACE_SECTION_INFORMATION = 0x00001000,
+
+ ///
+ PSS_CAPTURE_IPT_TRACE = 0x00002000,
+
+ ///
+ /// The breakaway is optional. If the clone process fails to create as a breakaway, then it is created still inside the job. This
+ /// flag must be specified in combination with either PSS_CREATE_FORCE_BREAKAWAY and/or PSS_CREATE_BREAKAWAY.
+ ///
+ PSS_CREATE_BREAKAWAY_OPTIONAL = 0x04000000,
+
+ /// The clone is broken away from the parent process' job. This is equivalent to CreateProcess flag CREATE_BREAKAWAY_FROM_JOB.
+ PSS_CREATE_BREAKAWAY = 0x08000000,
+
+ /// The clone is forcefully broken away the parent process's job. This is only allowed for Tcb-privileged callers.
+ PSS_CREATE_FORCE_BREAKAWAY = 0x10000000,
+
+ ///
+ /// The facility should not use the process heap for any persistent or transient allocations. The use of the heap may be
+ /// undesirable in certain contexts such as creation of snapshots in the exception reporting path (where the heap may be corrupted).
+ ///
+ PSS_CREATE_USE_VM_ALLOCATIONS = 0x20000000,
+
+ ///
+ /// Measure performance of the facility. Performance counters can be retrieved via PssQuerySnapshot with the
+ /// PSS_QUERY_PERFORMANCE_COUNTERS information class of PSS_QUERY_INFORMATION_CLASS.
+ ///
+ PSS_CREATE_MEASURE_PERFORMANCE = 0x40000000,
+
+ ///
+ /// The virtual address (VA) clone process does not hold a reference to the underlying image. This will cause functions such as
+ /// QueryFullProcessImageName to fail on the VA clone process.
+ ///
+ PSS_CREATE_RELEASE_SECTION = 0x80000000
+ }
+
+ ///
+ /// Duplication flags for use by PssDuplicateSnapshot.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_duplicate_flags
+ // typedef enum PSS_DUPLICATE_FLAGS { PSS_DUPLICATE_NONE , PSS_DUPLICATE_CLOSE_SOURCE } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "CAD06441-750F-42FC-A95A-7CAA79F31348")]
+ [Flags]
+ public enum PSS_DUPLICATE_FLAGS
+ {
+ /// No flag.
+ PSS_DUPLICATE_NONE = 0x00,
+
+ ///
+ /// Free the source handle. This will only succeed if you set the PSS_CREATE_USE_VM_ALLOCATIONS flag when you called
+ /// PssCaptureSnapshot to create the snapshot and handle. The handle will be freed even if duplication fails. The close operation
+ /// does not protect against concurrent access to the same descriptor.
+ ///
+ PSS_DUPLICATE_CLOSE_SOURCE = 0x01
+ }
+
+ ///
+ /// Flags to specify what parts of a PSS_HANDLE_ENTRY structure are valid.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_handle_flags typedef
+ // enum PSS_HANDLE_FLAGS { PSS_HANDLE_NONE , PSS_HANDLE_HAVE_TYPE , PSS_HANDLE_HAVE_NAME , PSS_HANDLE_HAVE_BASIC_INFORMATION ,
+ // PSS_HANDLE_HAVE_TYPE_SPECIFIC_INFORMATION } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "A4A604A9-0210-413C-BCAC-F8458B371D42")]
+ [Flags]
+ public enum PSS_HANDLE_FLAGS
+ {
+ /// No parts specified.
+ PSS_HANDLE_NONE = 0x00,
+
+ /// The ObjectType member is valid.
+ PSS_HANDLE_HAVE_TYPE = 0x01,
+
+ /// The ObjectName member is valid.
+ PSS_HANDLE_HAVE_NAME = 0x02,
+
+ ///
+ /// The Attributes, GrantedAccess, HandleCount, PointerCount, PagedPoolCharge, and NonPagedPoolCharge members are valid.
+ ///
+ PSS_HANDLE_HAVE_BASIC_INFORMATION = 0x04,
+
+ /// The TypeSpecificInformation member is valid (either Process, Thread, Mutant, Event or Section).
+ PSS_HANDLE_HAVE_TYPE_SPECIFIC_INFORMATION = 0x08
+ }
+
+ ///
+ /// Specifies the object type in a PSS_HANDLE_ENTRY structure.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_object_type typedef
+ // enum PSS_OBJECT_TYPE { PSS_OBJECT_TYPE_UNKNOWN , PSS_OBJECT_TYPE_PROCESS , PSS_OBJECT_TYPE_THREAD , PSS_OBJECT_TYPE_MUTANT ,
+ // PSS_OBJECT_TYPE_EVENT , PSS_OBJECT_TYPE_SECTION , PSS_OBJECT_TYPE_SEMAPHORE } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "3AF2AE47-6E1A-4B20-B6A3-36C1DDB80674")]
+ public enum PSS_OBJECT_TYPE
+ {
+ /// The object type is either unknown or unsupported.
+ PSS_OBJECT_TYPE_UNKNOWN,
+
+ /// The object is a process.
+ PSS_OBJECT_TYPE_PROCESS,
+
+ /// The object is a thread.
+ PSS_OBJECT_TYPE_THREAD,
+
+ /// The object is a mutant/mutex.
+ PSS_OBJECT_TYPE_MUTANT,
+
+ /// The object is an event.
+ PSS_OBJECT_TYPE_EVENT,
+
+ /// The object is a file-mapping object.
+ PSS_OBJECT_TYPE_SECTION,
+
+ ///
+ PSS_OBJECT_TYPE_SEMAPHORE,
+ }
+
+ ///
+ /// Flags that describe a process.
+ ///
+ ///
+ /// There are PSS_PROCESS_FLAGS members in the PSS_PROCESS_INFORMATION and PSS_HANDLE_ENTRY structures.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_process_flags
+ // typedef enum PSS_PROCESS_FLAGS { PSS_PROCESS_FLAGS_NONE , PSS_PROCESS_FLAGS_PROTECTED , PSS_PROCESS_FLAGS_WOW64 ,
+ // PSS_PROCESS_FLAGS_RESERVED_03 , PSS_PROCESS_FLAGS_RESERVED_04 , PSS_PROCESS_FLAGS_FROZEN } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "A1C793DD-EE93-47B6-8EA8-3A45DAD55F2D")]
+ [Flags]
+ public enum PSS_PROCESS_FLAGS
+ {
+ /// No flag.
+ PSS_PROCESS_FLAGS_NONE = 0x00000000,
+
+ /// The process is protected.
+ PSS_PROCESS_FLAGS_PROTECTED = 0x00000001,
+
+ /// The process is a 32-bit process running on a 64-bit native OS.
+ PSS_PROCESS_FLAGS_WOW64 = 0x00000002,
+
+ /// Undefined.
+ PSS_PROCESS_FLAGS_RESERVED_03 = 0x00000004,
+
+ /// Undefined.
+ PSS_PROCESS_FLAGS_RESERVED_04 = 0x00000008,
+
+ ///
+ /// The process is frozen; for example, a debugger is attached and broken into the process or a Store process is suspended by a
+ /// lifetime management service.
+ ///
+ PSS_PROCESS_FLAGS_FROZEN = 0x00000010
+ }
+
+ ///
+ /// Specifies what information PssQuerySnapshot function returns.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_query_information_class
+ // typedef enum PSS_QUERY_INFORMATION_CLASS { PSS_QUERY_PROCESS_INFORMATION , PSS_QUERY_VA_CLONE_INFORMATION ,
+ // PSS_QUERY_AUXILIARY_PAGES_INFORMATION , PSS_QUERY_VA_SPACE_INFORMATION , PSS_QUERY_HANDLE_INFORMATION ,
+ // PSS_QUERY_THREAD_INFORMATION , PSS_QUERY_HANDLE_TRACE_INFORMATION , PSS_QUERY_PERFORMANCE_COUNTERS } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "1C3E5BF4-5AC9-4012-B29D-49C35C0AF90B")]
+ public enum PSS_QUERY_INFORMATION_CLASS
+ {
+ /// Returns a PSS_PROCESS_INFORMATION structure, with information about the original process.
+ PSS_QUERY_PROCESS_INFORMATION,
+
+ /// Returns a PSS_VA_CLONE_INFORMATION structure, with a handle to the VA clone.
+ PSS_QUERY_VA_CLONE_INFORMATION,
+
+ /// Returns a PSS_AUXILIARY_PAGES_INFORMATION structure, which contains the count of auxiliary pages captured.
+ PSS_QUERY_AUXILIARY_PAGES_INFORMATION,
+
+ /// Returns a PSS_VA_SPACE_INFORMATION structure, which contains the count of regions captured.
+ PSS_QUERY_VA_SPACE_INFORMATION,
+
+ /// Returns a PSS_HANDLE_INFORMATION structure, which contains the count of handles captured.
+ PSS_QUERY_HANDLE_INFORMATION,
+
+ /// Returns a PSS_THREAD_INFORMATION structure, which contains the count of threads captured.
+ PSS_QUERY_THREAD_INFORMATION,
+
+ ///
+ /// Returns a PSS_HANDLE_TRACE_INFORMATION structure, which contains a handle to the handle trace section, and its size.
+ ///
+ PSS_QUERY_HANDLE_TRACE_INFORMATION,
+
+ /// Returns a PSS_PERFORMANCE_COUNTERS structure, which contains various performance counters.
+ PSS_QUERY_PERFORMANCE_COUNTERS,
+ }
+
+ ///
+ /// Flags that describe a thread.
+ ///
+ ///
+ /// There is a PSS_THREAD_FLAGS member in the PSS_THREAD_ENTRY structure that PssWalkSnapshot returns.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_thread_flags typedef
+ // enum PSS_THREAD_FLAGS { PSS_THREAD_FLAGS_NONE , PSS_THREAD_FLAGS_TERMINATED } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "8E90F0EA-D50A-431D-9507-B882EB673629")]
+ [Flags]
+ public enum PSS_THREAD_FLAGS
+ {
+ /// No flag.
+ PSS_THREAD_FLAGS_NONE = 0x0000,
+
+ /// The thread terminated.
+ PSS_THREAD_FLAGS_TERMINATED = 0x0001
+ }
+
+ ///
+ /// Specifies what information the PssWalkSnapshot function returns.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ne-processsnapshot-pss_walk_information_class
+ // typedef enum PSS_WALK_INFORMATION_CLASS { PSS_WALK_AUXILIARY_PAGES , PSS_WALK_VA_SPACE , PSS_WALK_HANDLES , PSS_WALK_THREADS } ;
+ [PInvokeData("processsnapshot.h", MSDNShortId = "93A79F7F-2164-4F7A-ADE7-C1655EEFC9BF")]
+ public enum PSS_WALK_INFORMATION_CLASS
+ {
+ ///
+ /// Returns a PSS_AUXILIARY_PAGE_ENTRY structure, which contains the address, page attributes and contents of an auxiliary copied page.
+ ///
+ PSS_WALK_AUXILIARY_PAGES,
+
+ ///
+ /// Returns a PSS_VA_SPACE_ENTRY structure, which contains the MEMORY_BASIC_INFORMATION structure for every distinct VA region.
+ ///
+ PSS_WALK_VA_SPACE,
+
+ ///
+ /// Returns a PSS_HANDLE_ENTRY structure, with information specifying the handle value, its type name, object name (if captured),
+ /// basic information (if captured), and type-specific information (if captured).
+ ///
+ PSS_WALK_HANDLES,
+
+ ///
+ /// Returns a PSS_THREAD_ENTRY structure, with basic information about the thread, as well as its termination state, suspend
+ /// count and Win32 start address.
+ ///
+ PSS_WALK_THREADS,
+ }
+
+ ///
+ /// Captures a snapshot of a target process.
+ ///
+ ///
+ /// A handle to the target process.
+ ///
+ ///
+ /// Flags that specify what to capture. For more information, see PSS_CAPTURE_FLAGS.
+ ///
+ ///
+ /// The CONTEXT record flags to capture if CaptureFlags specifies thread contexts.
+ ///
+ ///
+ /// A handle to the snapshot that this function captures.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success.
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psscapturesnapshot DWORD
+ // PssCaptureSnapshot( HANDLE ProcessHandle, PSS_CAPTURE_FLAGS CaptureFlags, DWORD ThreadContextFlags, HPSS *SnapshotHandle );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "44F2CB48-A9F6-4131-B21C-9F27A27CECD5")]
+ public static extern Win32Error PssCaptureSnapshot(IntPtr ProcessHandle, PSS_CAPTURE_FLAGS CaptureFlags, uint ThreadContextFlags, out IntPtr SnapshotHandle);
+
+ ///
+ /// Duplicates a snapshot handle from one process to another.
+ ///
+ ///
+ ///
+ /// A handle to the source process from which the original snapshot was captured. The handle must have PROCESS_VM_READ and
+ /// PROCESS_DUP_HANDLE rights.
+ ///
+ ///
+ ///
+ /// A handle to the snapshot to duplicate. This handle must be in the context of the source process.
+ ///
+ ///
+ ///
+ /// A handle to the target process that receives the duplicate snapshot. The handle must have PROCESS_VM_OPERATION,
+ /// PROCESS_VM_WRITE, and PROCESS_DUP_HANDLE rights.
+ ///
+ ///
+ ///
+ /// A handle to the duplicate snapshot that this function creates, in the context of the target process.
+ ///
+ ///
+ /// The duplication flags. For more information, see PSS_DUPLICATE_FLAGS.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or the following error code.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INVALID_HANDLE
+ /// The specified handle is invalid.
+ ///
+ ///
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-pssduplicatesnapshot
+ // DWORD PssDuplicateSnapshot( HANDLE SourceProcessHandle, HPSS SnapshotHandle, HANDLE TargetProcessHandle, HPSS
+ // *TargetSnapshotHandle, PSS_DUPLICATE_FLAGS Flags );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "5D2751F3-E7E1-4917-8060-E2BC8A7A3DEA")]
+ public static extern Win32Error PssDuplicateSnapshot(IntPtr SourceProcessHandle, IntPtr SnapshotHandle, IntPtr TargetProcessHandle, out IntPtr TargetSnapshotHandle, PSS_DUPLICATE_FLAGS Flags);
+
+ ///
+ /// Frees a snapshot.
+ ///
+ ///
+ ///
+ /// A handle to the process that contains the snapshot. The handle must have PROCESS_VM_READ, PROCESS_VM_OPERATION, and
+ /// PROCESS_DUP_HANDLE rights. If the snapshot was captured from the current process, or duplicated into the current process,
+ /// then pass in the result of GetCurrentProcess.
+ ///
+ ///
+ ///
+ /// A handle to the snapshot to free.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or one of the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INVALID_HANDLE
+ /// The specified handle is invalid.
+ ///
+ /// -
+ /// ERROR_NOT_SUPPORTED
+ /// The remote snapshot was not created with PSS_CREATE_USE_VM_ALLOCATIONS.
+ ///
+ ///
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ ///
+ ///
+ /// This API can free snapshot handles in the context of either the local or remote processes. If the snapshot was captured in the
+ /// local process with PssCaptureSnapshot, or duplicated into the local process with PssDuplicateSnapshot, then specify the result of
+ /// GetCurrentProcess as the process handle. If the snapshot is in the context of a remote process (for example, duplicated into the
+ /// remote process), then specify the handle to that process.
+ ///
+ /// The operation does not protect against concurrent access to the same descriptor.
+ ///
+ /// For remote process frees, only snapshot handles that were created with PSS_CREATE_USE_VM_ALLOCATIONS or duplicated
+ /// remotely can be freed by this API.
+ ///
+ /// The behavior of this routine on a descriptor that has already been freed is undefined.
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-pssfreesnapshot DWORD
+ // PssFreeSnapshot( HANDLE ProcessHandle, HPSS SnapshotHandle );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "5D062AE6-2F7C-4121-AB6E-9BFA06AB36C6")]
+ public static extern Win32Error PssFreeSnapshot(IntPtr ProcessHandle, IntPtr SnapshotHandle);
+
+ ///
+ /// Queries the snapshot.
+ ///
+ ///
+ /// A handle to the snapshot to query.
+ ///
+ ///
+ /// An enumerator member that selects what information to query. For more information, see PSS_QUERY_INFORMATION_CLASS.
+ ///
+ ///
+ /// The information that this function provides.
+ ///
+ ///
+ /// The size of Buffer, in bytes.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or one of the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_BAD_LENGTH
+ /// The specified buffer length is invalid.
+ ///
+ /// -
+ /// ERROR_INVALID_HANDLE
+ /// The specified handle is invalid.
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// The specified information class is invalid.
+ ///
+ /// -
+ /// ERROR_NOT_FOUND
+ /// The requested information is not in the snapshot.
+ ///
+ ///
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-pssquerysnapshot DWORD
+ // PssQuerySnapshot( HPSS SnapshotHandle, PSS_QUERY_INFORMATION_CLASS InformationClass, void *Buffer, DWORD BufferLength );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "D9580147-28ED-4FF5-B7DB-844ACB19769F")]
+ public static extern Win32Error PssQuerySnapshot(IntPtr SnapshotHandle, PSS_QUERY_INFORMATION_CLASS InformationClass, IntPtr Buffer, uint BufferLength);
+
+ ///
+ /// Creates a walk marker.
+ ///
+ ///
+ ///
+ /// A structure that provides functions to allocate and free memory. If you provide the structure, PssWalkMarkerCreate uses
+ /// the functions to allocate the internal walk marker structures. Otherwise it uses the default process heap. For more information,
+ /// see PSS_ALLOCATOR.
+ ///
+ ///
+ ///
+ /// A handle to the walk marker that this function creates.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or the following error code.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_NOT_ENOUGH_MEMORY
+ /// Could not allocate memory for the walk marker.
+ ///
+ ///
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ ///
+ /// The walk marker maintains the state of a walk, and can be used to reposition or rewind the walk.
+ ///
+ /// The Allocator structure that provides the custom functions should remain valid for the lifetime of the walk marker. The custom
+ /// functions are called from PssWalkMarkerCreate, PssWalkMarkerFree and PssWalkSnapshot using the same thread that calls
+ /// PssWalkMarkerCreate, PssWalkMarkerFree and PssWalkSnapshot. Therefore the custom functions need not be multi-threaded.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalkmarkercreate
+ // DWORD PssWalkMarkerCreate( PSS_ALLOCATOR const *Allocator, HPSSWALK *WalkMarkerHandle );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "58E2FBAF-661C-45BE-A25A-A096AF52ED3E")]
+ public static extern Win32Error PssWalkMarkerCreate(ref PSS_ALLOCATOR Allocator, out IntPtr WalkMarkerHandle);
+
+ ///
+ /// Frees a walk marker created by PssWalkMarkerCreate.
+ ///
+ ///
+ /// A handle to the walk marker.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success.
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ ///
+ ///
+ /// If PssWalkMarkerCreate used AllocRoutine of a custom allocator to create the walk marker, PssWalkMarkerFree uses
+ /// the FreeRoutine of the allocator.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalkmarkerfree DWORD
+ // PssWalkMarkerFree( HPSSWALK WalkMarkerHandle );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "74158846-6A5F-4F81-B4D7-46DED1EE017C")]
+ public static extern Win32Error PssWalkMarkerFree(IntPtr WalkMarkerHandle);
+
+ ///
+ /// Returns the current position of a walk marker.
+ ///
+ ///
+ /// A handle to the walk marker.
+ ///
+ ///
+ /// The walk marker position that this function returns.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success.
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ ///
+ ///
+ /// The position value compared to the values of other positions is not of any significance. The only valid use of the position is to
+ /// set the current position using the PssWalkMarkerSetPosition function.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalkmarkergetposition
+ // DWORD PssWalkMarkerGetPosition( HPSSWALK WalkMarkerHandle, ULONG_PTR *Position );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "A2058E81-2B01-4436-ACC6-2A3E58BC4E27")]
+ public static extern Win32Error PssWalkMarkerGetPosition(IntPtr WalkMarkerHandle, out UIntPtr Position);
+
+ ///
+ /// Rewinds a walk marker back to the beginning.
+ ///
+ ///
+ /// A handle to the walk marker.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success.
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalkmarkerseektobeginning
+ // DWORD PssWalkMarkerSeekToBeginning( HPSSWALK WalkMarkerHandle );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "BE0FA122-3966-4827-9DA3-A98A162EF270")]
+ public static extern Win32Error PssWalkMarkerSeekToBeginning(IntPtr WalkMarkerHandle);
+
+ ///
+ /// Sets the position of a walk marker.
+ ///
+ ///
+ /// A handle to the walk marker.
+ ///
+ ///
+ /// The position to set. This is a position that the PssWalkMarkerGetPosition function provided.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or one of the following error codes.
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalkmarkersetposition
+ // DWORD PssWalkMarkerSetPosition( HPSSWALK WalkMarkerHandle, ULONG_PTR Position );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "D89EA4DB-D8C6-43D1-B292-D24F1EAB2E43")]
+ public static extern Win32Error PssWalkMarkerSetPosition(IntPtr WalkMarkerHandle, UIntPtr Position);
+
+ ///
+ /// Returns information from the current walk position and advanced the walk marker to the next position.
+ ///
+ ///
+ /// A handle to the snapshot.
+ ///
+ ///
+ /// The type of information to return. For more information, see PSS_WALK_INFORMATION_CLASS.
+ ///
+ ///
+ ///
+ /// A handle to a walk marker. The walk marker indicates the walk position from which data is to be returned. PssWalkSnapshot
+ /// advances the walk marker to the next walk position in time order before returning to the caller.
+ ///
+ ///
+ ///
+ /// The snapshot information that this function returns.
+ ///
+ ///
+ /// The size of Buffer, in bytes.
+ ///
+ ///
+ /// This function returns ERROR_SUCCESS on success or one of the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_BAD_LENGTH
+ /// The specified buffer length is invalid.
+ ///
+ /// -
+ /// ERROR_INVALID_HANDLE
+ /// The specified handle is invalid.
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// The specified information class is invalid.
+ ///
+ /// -
+ /// ERROR_MORE_DATA
+ /// Buffer is NULL, and there is data at the current position to return.
+ ///
+ /// -
+ /// ERROR_NO_MORE_ITEMS
+ /// The walk has completed and there are no more items to return.
+ ///
+ /// -
+ /// ERROR_NOT_FOUND
+ /// The requested information is not in the snapshot.
+ ///
+ ///
+ ///
+ /// All error codes are defined in winerror.h. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a message for
+ /// an error code.
+ ///
+ ///
+ ///
+ ///
+ /// For snapshot data types that have a variable number of instances within a snapshot, you use the PssWalkSnapshot function
+ /// to obtain the instances one after another. You set the InformationClass parameter to specify the type of data.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/nf-processsnapshot-psswalksnapshot DWORD
+ // PssWalkSnapshot( HPSS SnapshotHandle, PSS_WALK_INFORMATION_CLASS InformationClass, HPSSWALK WalkMarkerHandle, void *Buffer, DWORD
+ // BufferLength );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processsnapshot.h", MSDNShortId = "C6AC38B5-0A1C-44D7-A1F6-8196AE9B8FB0")]
+ public static extern Win32Error PssWalkSnapshot(IntPtr SnapshotHandle, PSS_WALK_INFORMATION_CLASS InformationClass, IntPtr WalkMarkerHandle, IntPtr Buffer, uint BufferLength);
+
+ ///
+ ///
+ /// Contains information about a range of pages in the virtual address space of a process. The VirtualQuery and VirtualQueryEx
+ /// functions use this structure.
+ ///
+ ///
+ ///
+ ///
+ /// To enable a debugger to debug a target that is running on a different architecture (32-bit versus 64-bit), use one of the
+ /// explicit forms of this structure.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_memory_basic_information typedef struct
+ // _MEMORY_BASIC_INFORMATION { PVOID BaseAddress; PVOID AllocationBase; DWORD AllocationProtect; SIZE_T RegionSize; DWORD State;
+ // DWORD Protect; DWORD Type; } MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
+ [PInvokeData("winnt.h", MSDNShortId = "dc3fa48e-0986-49cc-88a9-ff8179fbe5f0")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct MEMORY_BASIC_INFORMATION
+ {
+ ///
+ /// A pointer to the base address of the region of pages.
+ ///
+ public IntPtr BaseAddress;
+
+ ///
+ ///
+ /// A pointer to the base address of a range of pages allocated by the VirtualAlloc function. The page pointed to by the
+ /// BaseAddress member is contained within this allocation range.
+ ///
+ ///
+ public IntPtr AllocationBase;
+
+ ///
+ ///
+ /// The memory protection option when the region was initially allocated. This member can be one of the memory protection
+ /// constants or 0 if the caller does not have access.
+ ///
+ ///
+ public uint AllocationProtect;
+
+ ///
+ /// The size of the region beginning at the base address in which all pages have identical attributes, in bytes.
+ ///
+ public SizeT RegionSize;
+
+ ///
+ /// The state of the pages in the region. This member can be one of the following values.
+ ///
+ ///
+ /// State
+ /// Meaning
+ ///
+ /// -
+ /// MEM_COMMIT 0x1000
+ ///
+ /// Indicates committed pages for which physical storage has been allocated, either in memory or in the paging file on disk.
+ ///
+ ///
+ /// -
+ /// MEM_FREE 0x10000
+ ///
+ /// Indicates free pages not accessible to the calling process and available to be allocated. For free pages, the information in
+ /// the AllocationBase, AllocationProtect, Protect, and Type members is undefined.
+ ///
+ ///
+ /// -
+ /// MEM_RESERVE 0x2000
+ ///
+ /// Indicates reserved pages where a range of the process's virtual address space is reserved without any physical storage being
+ /// allocated. For reserved pages, the information in the Protect member is undefined.
+ ///
+ ///
+ ///
+ ///
+ public uint State;
+
+ ///
+ ///
+ /// The access protection of the pages in the region. This member is one of the values listed for the AllocationProtect member.
+ ///
+ ///
+ public uint Protect;
+
+ ///
+ /// The type of pages in the region. The following types are defined.
+ ///
+ ///
+ /// Type
+ /// Meaning
+ ///
+ /// -
+ /// MEM_IMAGE 0x1000000
+ /// Indicates that the memory pages within the region are mapped into the view of an image section.
+ ///
+ /// -
+ /// MEM_MAPPED 0x40000
+ /// Indicates that the memory pages within the region are mapped into the view of a section.
+ ///
+ /// -
+ /// MEM_PRIVATE 0x20000
+ /// Indicates that the memory pages within the region are private (that is, not shared by other processes).
+ ///
+ ///
+ ///
+ public uint Type;
+ }
+
+ ///
+ ///
+ /// Specifies custom functions which the Process Snapshotting functions use to allocate and free the internal walk marker structures.
+ ///
+ ///
+ ///
+ ///
+ /// To use custom memory allocation functions, pass this structure to PssWalkMarkerCreate. Otherwise, the Process Snapshotting
+ /// functions use the default process heap.
+ ///
+ ///
+ /// The PSS_ALLOCATOR structure that provides the custom functions should remain valid for the lifetime of the walk marker
+ /// that PssWalkMarkerCreate creates.
+ ///
+ /// FreeRoutine must accept NULL address parameters without failing.
+ ///
+ /// The custom functions are called from PssWalkMarkerCreate, PssWalkMarkerFree and PssWalkSnapshot using the same thread that calls
+ /// PssWalkMarkerCreate, PssWalkMarkerFree and PssWalkSnapshot. Therefore the custom functions need not be multi-threaded.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_allocator typedef
+ // struct PSS_ALLOCATOR { void *Context; void )(void *Context,DWORD Size) *(*AllocRoutine; void((void *Context, void *Address) *
+ // )FreeRoutine; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "54225F76-9A2E-4CB3-A3B5-9F9DB5551D53")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_ALLOCATOR
+ {
+ ///
+ /// An arbitrary pointer-sized value that the Process Snapshotting functions pass to AllocRoutine and FreeRoutine.
+ ///
+ public IntPtr Context;
+
+ ///
+ ///
+ /// A pointer to a WINAPI-calling convention function that takes two parameters. It returns a pointer to the block of memory that
+ /// it allocates, or NULL if allocation fails.
+ ///
+ /// Context
+ /// The context value, as passed in PSS_ALLOCATOR.
+ /// Size
+ /// Number of bytes to allocate.
+ ///
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ public AllocRoutine Alloc;
+
+ ///
+ ///
+ /// A pointer to a WINAPI-calling convention function taking two parameters. It deallocates a block of memory that
+ /// AllocRoutine allocated.
+ ///
+ /// Context
+ /// The context value, as passed in PSS_ALLOCATOR.
+ /// Address
+ /// The address of a block of memory that AllocRoutine allocated.
+ ///
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ public FreeRoutine Free;
+
+ /// A WINAPI-calling convention function that takes two parameters.
+ /// The context.
+ /// The size.
+ /// A pointer to the block of memory that it allocates, or NULL if allocation fails.
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+ public delegate IntPtr AllocRoutine(IntPtr Context, uint Size);
+
+ /// A WINAPI-calling convention function taking two parameters.
+ /// The context.
+ /// The address.
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+ public delegate void FreeRoutine(IntPtr Context, IntPtr Address);
+ }
+
+ ///
+ /// Holds auxiliary page entry information returned by PssWalkSnapshot.
+ ///
+ ///
+ ///
+ /// PssWalkSnapshot returns a PSS_AUXILIARY_PAGE_ENTRY structure when the PSS_WALK_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_WALK_AUXILIARY_PAGES.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_auxiliary_page_entry
+ // typedef struct PSS_AUXILIARY_PAGE_ENTRY { void *Address; MEMORY_BASIC_INFORMATION BasicInformation; FILETIME CaptureTime; void
+ // *PageContents; DWORD PageSize; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "A3D948E6-6FFE-4732-A8C7-A292FDA07D7C")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_AUXILIARY_PAGE_ENTRY
+ {
+ ///
+ /// The address of the captured auxiliary page, in the context of the captured process.
+ ///
+ public IntPtr Address;
+
+ ///
+ /// Basic information about the captured page. See MEMORY_BASIC_INFORMATION for more information.
+ ///
+ public MEMORY_BASIC_INFORMATION BasicInformation;
+
+ ///
+ /// The capture time of the page. For more information, see FILETIME.
+ ///
+ public FILETIME CaptureTime;
+
+ ///
+ ///
+ /// A pointer to the contents of the captured page, in the context of the current process. This member may be NULL if page
+ /// contents were not captured. The pointer is valid for the lifetime of the walk marker passed to PssWalkSnapshot.
+ ///
+ ///
+ public IntPtr PageContents;
+
+ ///
+ /// The size of the page contents that PageContents points to, in bytes.
+ ///
+ public uint PageSize;
+ }
+
+ ///
+ /// Holds auxiliary pages information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_AUXILIARY_PAGES_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the
+ /// caller provides it is PSS_QUERY_AUXILIARY_PAGES_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_auxiliary_pages_information
+ // typedef struct PSS_AUXILIARY_PAGES_INFORMATION { DWORD AuxPagesCaptured; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "122DD3DF-002A-4250-9E37-BA239638A684")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_AUXILIARY_PAGES_INFORMATION
+ {
+ ///
+ /// The count of auxiliary pages captured.
+ ///
+ public uint AuxPagesCaptured;
+ }
+
+ ///
+ /// Holds information about a handle returned by PssWalkSnapshot.
+ ///
+ ///
+ ///
+ /// PssWalkSnapshot returns a PSS_HANDLE_ENTRY structure when the PSS_WALK_INFORMATION_CLASS member that the caller provides
+ /// it is PSS_WALK_HANDLES.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_handle_entry typedef
+ // struct PSS_HANDLE_ENTRY { HANDLE Handle; PSS_HANDLE_FLAGS Flags; PSS_OBJECT_TYPE ObjectType; FILETIME CaptureTime; DWORD
+ // Attributes; DWORD GrantedAccess; DWORD HandleCount; DWORD PointerCount; DWORD PagedPoolCharge; DWORD NonPagedPoolCharge; FILETIME
+ // CreationTime; WORD TypeNameLength; wchar_t const *TypeName; WORD ObjectNameLength; wchar_t const *ObjectName; union { struct {
+ // DWORD ExitStatus; void *PebBaseAddress; ULONG_PTR AffinityMask; LONG BasePriority; DWORD ProcessId; DWORD ParentProcessId; DWORD
+ // Flags; } Process; struct { DWORD ExitStatus; void *TebBaseAddress; DWORD ProcessId; DWORD ThreadId; ULONG_PTR AffinityMask; int
+ // Priority; int BasePriority; void *Win32StartAddress; } Thread; struct { LONG CurrentCount; BOOL Abandoned; DWORD OwnerProcessId;
+ // DWORD OwnerThreadId; } Mutant; struct { BOOL ManualReset; BOOL Signaled; } Event; struct { void *BaseAddress; DWORD
+ // AllocationAttributes; LARGE_INTEGER MaximumSize; } Section; struct { LONG CurrentCount; LONG MaximumCount; } Semaphore; }
+ // TypeSpecificInformation; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "F56E8C35-949A-4DEE-973F-CF24F6596036")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_HANDLE_ENTRY
+ {
+ ///
+ /// The handle value.
+ ///
+ public IntPtr Handle;
+
+ ///
+ /// Flags that indicate what parts of this structure are valid. For more information, see PSS_HANDLE_FLAGS.
+ ///
+ public PSS_HANDLE_FLAGS Flags;
+
+ ///
+ /// The type of the object that the handle references. For more information, see PSS_OBJECT_TYPE.
+ ///
+ public PSS_OBJECT_TYPE ObjectType;
+
+ ///
+ /// The capture time of this information. For more information, see FILETIME.
+ ///
+ public FILETIME CaptureTime;
+
+ ///
+ /// Attributes.
+ ///
+ public uint Attributes;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint GrantedAccess;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint HandleCount;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint PointerCount;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint PagedPoolCharge;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint NonPagedPoolCharge;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public FILETIME CreationTime;
+
+ ///
+ /// The length of TypeName, in bytes.
+ ///
+ public ushort TypeNameLength;
+
+ ///
+ ///
+ /// The type name of the object referenced by this handle. The buffer may not terminated by a NULL character. The pointer
+ /// is valid for the lifetime of the walk marker passed to PssWalkSnapshot.
+ ///
+ ///
+ public IntPtr TypeName;
+
+ ///
+ /// The length of ObjectName, in bytes.
+ ///
+ public ushort ObjectNameLength;
+
+ ///
+ ///
+ /// Specifies the name of the object referenced by this handle. The buffer may not terminated by a NULL character. The
+ /// pointer is valid for the lifetime of the walk marker passed to PssWalkSnapshot.
+ ///
+ ///
+ public IntPtr ObjectName;
+
+ ///
+ /// Type-specific information.
+ ///
+ public UNION TypeSpecificInformation;
+
+ ///
+ /// Type-specific information.
+ ///
+ [StructLayout(LayoutKind.Explicit)]
+ public struct UNION
+ {
+ /// Process
+ [FieldOffset(0)]
+ public Process Process;
+
+ /// Thread
+ [FieldOffset(0)]
+ public Thread Thread;
+
+ /// Mutant
+ [FieldOffset(0)]
+ public Mutant Mutant;
+
+ /// Event
+ [FieldOffset(0)]
+ public Event Event;
+
+ /// Section
+ [FieldOffset(0)]
+ public Section Section;
+
+ /// Semaphore
+ [FieldOffset(0)]
+ public Semaphore Semaphore;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Process
+ {
+ ///
+ /// The exit code of the process. If the process has not exited, this is set to STILL_ACTIVE (259).
+ ///
+ public uint ExitStatus;
+
+ ///
+ /// The address of the process environment block (PEB). Reserved for use by the operating system.
+ ///
+ public IntPtr PebBaseAddress;
+
+ ///
+ /// The affinity mask of the process.
+ ///
+ public UIntPtr AffinityMask;
+
+ ///
+ /// The base priority level of the process.
+ ///
+ public int BasePriority;
+
+ ///
+ /// The process ID.
+ ///
+ public uint ProcessId;
+
+ ///
+ /// The parent process ID.
+ ///
+ public uint ParentProcessId;
+
+ ///
+ /// Flags about the process. For more information, see PSS_PROCESS_FLAGS.
+ ///
+ public uint Flags;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Thread
+ {
+ ///
+ /// The exit code of the process. If the process has not exited, this is set to STILL_ACTIVE (259).
+ ///
+ public uint ExitStatus;
+
+ ///
+ /// The address of the thread environment block (TEB). Reserved for use by the operating system.
+ ///
+ public IntPtr TebBaseAddress;
+
+ ///
+ /// The process ID.
+ ///
+ public uint ProcessId;
+
+ ///
+ /// The thread ID.
+ ///
+ public uint ThreadId;
+
+ ///
+ /// The affinity mask of the process.
+ ///
+ public UIntPtr AffinityMask;
+
+ ///
+ /// The thread’s dynamic priority level.
+ ///
+ public int Priority;
+
+ ///
+ /// The thread’s base priority level.
+ ///
+ public int BasePriority;
+
+ ///
+ /// A pointer to the thread procedure for the thread.
+ ///
+ public IntPtr Win32StartAddress;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Mutant
+ {
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public int CurrentCount;
+
+ ///
+ ///
+ /// TRUE if the mutant has been abandoned (the owning thread exited without releasing the mutex), FALSE if not.
+ ///
+ ///
+ [MarshalAs(UnmanagedType.Bool)] public bool Abandoned;
+
+ ///
+ /// The process ID of the owning thread, at the time of snapshot creation and handle capture.
+ ///
+ public uint OwnerProcessId;
+
+ ///
+ /// The process ID of the owning thread, at the time of snapshot creation and handle capture.
+ ///
+ public uint OwnerThreadId;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Event
+ {
+ ///
+ /// TRUE if the event is manual reset, FALSE if not.
+ ///
+ [MarshalAs(UnmanagedType.Bool)] public bool ManualReset;
+
+ ///
+ /// TRUE if the event was signaled at the time of snapshot creation and handle capture, FALSE if not.
+ ///
+ [MarshalAs(UnmanagedType.Bool)] public bool Signaled;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Section
+ {
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public IntPtr BaseAddress;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint AllocationAttributes;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public long MaximumSize;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Semaphore
+ {
+ /// Undocumented.
+ public int CurrentCount;
+
+ /// Undocumented.
+ public int MaximumCount;
+ }
+ }
+
+ ///
+ /// Holds handle information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_HANDLE_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_HANDLE_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_handle_information
+ // typedef struct PSS_HANDLE_INFORMATION { DWORD HandlesCaptured; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "77192849-D919-4947-9BFF-343C166C5A51")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_HANDLE_INFORMATION
+ {
+ ///
+ /// The count of handles captured.
+ ///
+ public uint HandlesCaptured;
+ }
+
+ ///
+ /// Holds handle trace information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_HANDLE_TRACE_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the
+ /// caller provides it is PSS_QUERY_HANDLE_TRACE_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_handle_trace_information
+ // typedef struct PSS_HANDLE_TRACE_INFORMATION { HANDLE SectionHandle; DWORD Size; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "0877DF1F-044C-48F2-9BCC-938EBD6D46EE")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_HANDLE_TRACE_INFORMATION
+ {
+ ///
+ /// A handle to a section containing the handle trace information.
+ ///
+ public IntPtr SectionHandle;
+
+ ///
+ /// The size of the handle trace section, in bytes.
+ ///
+ public uint Size;
+ }
+
+ ///
+ /// Holds performance counters returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_PERFORMANCE_COUNTERS structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_PERFORMANCE_COUNTERS.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_performance_counters
+ // typedef struct PSS_PERFORMANCE_COUNTERS { UINT64 TotalCycleCount; UINT64 TotalWallClockPeriod; UINT64 VaCloneCycleCount; UINT64
+ // VaCloneWallClockPeriod; UINT64 VaSpaceCycleCount; UINT64 VaSpaceWallClockPeriod; UINT64 AuxPagesCycleCount; UINT64
+ // AuxPagesWallClockPeriod; UINT64 HandlesCycleCount; UINT64 HandlesWallClockPeriod; UINT64 ThreadsCycleCount; UINT64
+ // ThreadsWallClockPeriod; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "298C1FC8-D19D-4DB3-84AA-3870D06B16A1")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_PERFORMANCE_COUNTERS
+ {
+ ///
+ /// The count of clock cycles spent for capture.
+ ///
+ public ulong TotalCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for capture.
+ ///
+ public ulong TotalWallClockPeriod;
+
+ ///
+ /// The count of clock cycles spent for the capture of the VA clone.
+ ///
+ public ulong VaCloneCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for the capture of the VA clone.
+ ///
+ public ulong VaCloneWallClockPeriod;
+
+ ///
+ /// The count of clock cycles spent for the capture of VA space information.
+ ///
+ public ulong VaSpaceCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for the capture VA space information.
+ ///
+ public ulong VaSpaceWallClockPeriod;
+
+ ///
+ /// The count of clock cycles spent for the capture of auxiliary page information.
+ ///
+ public ulong AuxPagesCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for the capture of auxiliary page information.
+ ///
+ public ulong AuxPagesWallClockPeriod;
+
+ ///
+ /// The count of clock cycles spent for the capture of handle information.
+ ///
+ public ulong HandlesCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for the capture of handle information.
+ ///
+ public ulong HandlesWallClockPeriod;
+
+ ///
+ /// The count of clock cycles spent for the capture of thread information.
+ ///
+ public ulong ThreadsCycleCount;
+
+ ///
+ /// The count of FILETIME units spent for the capture of thread information.
+ ///
+ public ulong ThreadsWallClockPeriod;
+ }
+
+ ///
+ /// Holds process information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_PROCESS_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_PROCESS_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_process_information
+ // typedef struct PSS_PROCESS_INFORMATION { DWORD ExitStatus; void *PebBaseAddress; ULONG_PTR AffinityMask; LONG BasePriority; DWORD
+ // ProcessId; DWORD ParentProcessId; PSS_PROCESS_FLAGS Flags; FILETIME CreateTime; FILETIME ExitTime; FILETIME KernelTime; FILETIME
+ // UserTime; DWORD PriorityClass; ULONG_PTR PeakVirtualSize; ULONG_PTR VirtualSize; DWORD PageFaultCount; ULONG_PTR
+ // PeakWorkingSetSize; ULONG_PTR WorkingSetSize; ULONG_PTR QuotaPeakPagedPoolUsage; ULONG_PTR QuotaPagedPoolUsage; ULONG_PTR
+ // QuotaPeakNonPagedPoolUsage; ULONG_PTR QuotaNonPagedPoolUsage; ULONG_PTR PagefileUsage; ULONG_PTR PeakPagefileUsage; ULONG_PTR
+ // PrivateUsage; DWORD ExecuteFlags; wchar_t ImageFileName[MAX_PATH]; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "D629FA42-B501-4A0E-9B53-6D70E580B687")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+ public struct PSS_PROCESS_INFORMATION
+ {
+ ///
+ /// The exit code of the process. If the process has not exited, this is set to STILL_ACTIVE (259).
+ ///
+ public uint ExitStatus;
+
+ ///
+ /// The address to the process environment block (PEB). Reserved for use by the operating system.
+ ///
+ public IntPtr PebBaseAddress;
+
+ ///
+ /// The affinity mask of the process.
+ ///
+ public UIntPtr AffinityMask;
+
+ ///
+ /// The base priority level of the process.
+ ///
+ public int BasePriority;
+
+ ///
+ /// The process ID.
+ ///
+ public uint ProcessId;
+
+ ///
+ /// The parent process ID.
+ ///
+ public uint ParentProcessId;
+
+ ///
+ /// Flags about the process. For more information, see PSS_PROCESS_FLAGS.
+ ///
+ public PSS_PROCESS_FLAGS Flags;
+
+ ///
+ /// The time the process was created. For more information, see FILETIME.
+ ///
+ public FILETIME CreateTime;
+
+ ///
+ /// If the process exited, the time of the exit. For more information, see FILETIME.
+ ///
+ public FILETIME ExitTime;
+
+ ///
+ /// The amount of time the process spent executing in kernel-mode. For more information, see FILETIME.
+ ///
+ public FILETIME KernelTime;
+
+ ///
+ /// The amount of time the process spent executing in user-mode. For more information, see FILETIME.
+ ///
+ public FILETIME UserTime;
+
+ ///
+ /// The priority class.
+ ///
+ public uint PriorityClass;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr PeakVirtualSize;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr VirtualSize;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public uint PageFaultCount;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr PeakWorkingSetSize;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr WorkingSetSize;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr QuotaPeakPagedPoolUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr QuotaPagedPoolUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr QuotaPeakNonPagedPoolUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr QuotaNonPagedPoolUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr PagefileUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr PeakPagefileUsage;
+
+ ///
+ /// A memory usage counter. See the GetProcessMemoryInfo function for more information.
+ ///
+ public UIntPtr PrivateUsage;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public uint ExecuteFlags;
+
+ ///
+ /// The full path to the process executable. If the path exceeds the allocated buffer size, it is truncated.
+ ///
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
+ public string ImageFileName;
+ }
+
+ ///
+ /// Holds thread information returned by PssWalkSnapshot PssWalkSnapshot.
+ ///
+ ///
+ ///
+ /// PssWalkSnapshot returns a PSS_THREAD_ENTRY structure when the PSS_WALK_INFORMATION_CLASS member that the caller provides
+ /// it is PSS_WALK_THREADS.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_thread_entry typedef
+ // struct PSS_THREAD_ENTRY { DWORD ExitStatus; void *TebBaseAddress; DWORD ProcessId; DWORD ThreadId; ULONG_PTR AffinityMask; int
+ // Priority; int BasePriority; void *LastSyscallFirstArgument; WORD LastSyscallNumber; FILETIME CreateTime; FILETIME ExitTime;
+ // FILETIME KernelTime; FILETIME UserTime; void *Win32StartAddress; FILETIME CaptureTime; PSS_THREAD_FLAGS Flags; WORD SuspendCount;
+ // WORD SizeOfContextRecord; PCONTEXT ContextRecord; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "99C89DBB-8C12-482E-B33D-AE59C37662CF")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_THREAD_ENTRY
+ {
+ ///
+ /// The exit code of the process. If the process has not exited, this is set to STILL_ACTIVE (259).
+ ///
+ public uint ExitStatus;
+
+ ///
+ /// The address of the thread environment block (TEB). Reserved for use by the operating system.
+ ///
+ public IntPtr TebBaseAddress;
+
+ ///
+ /// The process ID.
+ ///
+ public uint ProcessId;
+
+ ///
+ /// The thread ID.
+ ///
+ public uint ThreadId;
+
+ ///
+ /// The affinity mask of the process.
+ ///
+ public UIntPtr AffinityMask;
+
+ ///
+ /// The thread’s dynamic priority level.
+ ///
+ public int Priority;
+
+ ///
+ /// The base priority level of the process.
+ ///
+ public int BasePriority;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public IntPtr LastSyscallFirstArgument;
+
+ ///
+ /// Reserved for use by the operating system.
+ ///
+ public ushort LastSyscallNumber;
+
+ ///
+ /// The time the thread was created. For more information, see FILETIME.
+ ///
+ public FILETIME CreateTime;
+
+ ///
+ /// If the thread exited, the time of the exit. For more information, see FILETIME.
+ ///
+ public FILETIME ExitTime;
+
+ ///
+ /// The amount of time the thread spent executing in kernel mode. For more information, see FILETIME.
+ ///
+ public FILETIME KernelTime;
+
+ ///
+ /// The amount of time the thread spent executing in user mode. For more information, see FILETIME.
+ ///
+ public FILETIME UserTime;
+
+ ///
+ /// A pointer to the thread procedure for thread.
+ ///
+ public IntPtr Win32StartAddress;
+
+ ///
+ /// The capture time of this thread. For more information, see FILETIME.
+ ///
+ public FILETIME CaptureTime;
+
+ ///
+ /// Flags about the thread. For more information, see PSS_THREAD_FLAGS.
+ ///
+ public PSS_THREAD_FLAGS Flags;
+
+ ///
+ /// The count of times the thread suspended.
+ ///
+ public ushort SuspendCount;
+
+ ///
+ /// The size of ContextRecord, in bytes.
+ ///
+ public ushort SizeOfContextRecord;
+
+ ///
+ ///
+ /// A pointer to the context record if thread context information was captured. The pointer is valid for the lifetime of the walk
+ /// marker passed to PssWalkSnapshot.
+ ///
+ ///
+ public IntPtr ContextRecord; // valid for life time of walk marker
+ }
+
+ ///
+ /// Holds thread information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_THREAD_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_THREAD_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_thread_information
+ // typedef struct PSS_THREAD_INFORMATION { DWORD ThreadsCaptured; DWORD ContextLength; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "68BC42FD-9A30-462F-AFB1-DF9587C50F45")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_THREAD_INFORMATION
+ {
+ ///
+ /// The count of threads in the snapshot.
+ ///
+ public uint ThreadsCaptured;
+
+ ///
+ /// The length of the CONTEXT record captured, in bytes.
+ ///
+ public uint ContextLength;
+ }
+
+ ///
+ /// Holds virtual address (VA) clone information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_VA_CLONE_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_VA_CLONE_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_va_clone_information
+ // typedef struct PSS_VA_CLONE_INFORMATION { HANDLE VaCloneHandle; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "F93D61B0-EDB2-4560-A69F-CF839EC98B53")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_VA_CLONE_INFORMATION
+ {
+ ///
+ /// A handle to the VA clone process.
+ ///
+ public IntPtr VaCloneHandle;
+ }
+
+ ///
+ /// Holds the MEMORY_BASIC_INFORMATION returned by PssWalkSnapshot for a virtual address (VA) region.
+ ///
+ ///
+ ///
+ /// PssWalkSnapshot returns a PSS_VA_SPACE_ENTRY structure when the PSS_WALK_INFORMATION_CLASS member that the caller provides
+ /// it is PSS_WALK_VA_SPACE.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_va_space_entry
+ // typedef struct PSS_VA_SPACE_ENTRY { void *BaseAddress; void *AllocationBase; DWORD AllocationProtect; ULONG_PTR RegionSize; DWORD
+ // State; DWORD Protect; DWORD Type; DWORD TimeDateStamp; DWORD SizeOfImage; void *ImageBase; DWORD CheckSum; WORD
+ // MappedFileNameLength; wchar_t const *MappedFileName; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "69B8F6A3-76DF-421B-B89B-73BA3254F897")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_VA_SPACE_ENTRY
+ {
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public IntPtr BaseAddress;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public IntPtr AllocationBase;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public uint AllocationProtect;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public UIntPtr RegionSize;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public uint State;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public uint Protect;
+
+ ///
+ /// Information about the VA region. For more information, see MEMORY_BASIC_INFORMATION.
+ ///
+ public uint Type;
+
+ ///
+ ///
+ /// If section information was captured and the region is an executable image ( MEM_IMAGE), this is the
+ /// TimeDateStamp value from the Portable Executable (PE) header which describes the image. It is the low 32 bits of the
+ /// number of seconds since 00:00 January 1, 1970 (a C run-time time_t value), that indicates when the file was created.
+ ///
+ ///
+ public uint TimeDateStamp;
+
+ ///
+ ///
+ /// If section information was captured and the region is an executable image ( MEM_IMAGE), this is the SizeOfImage
+ /// value from the Portable Executable (PE) header which describes the image. It is the size (in bytes) of the image, including
+ /// all headers, as the image is loaded in memory.
+ ///
+ ///
+ public uint SizeOfImage;
+
+ ///
+ ///
+ /// If section information was captured and the region is an executable image ( MEM_IMAGE), this is the ImageBase
+ /// value from the Portable Executable (PE) header which describes the image. It is the preferred address of the first byte of
+ /// the image when loaded into memory.
+ ///
+ ///
+ public IntPtr ImageBase;
+
+ ///
+ ///
+ /// If section information was captured and the region is an executable image ( MEM_IMAGE), this is the CheckSum
+ /// value from the Portable Executable (PE) header which describes the image. It is the image file checksum.
+ ///
+ ///
+ public uint CheckSum;
+
+ ///
+ /// The length of the mapped file name buffer, in bytes.
+ ///
+ public ushort MappedFileNameLength;
+
+ ///
+ ///
+ /// If section information was captured, this is the file path backing the section (if any). The path may be in NT namespace. The
+ /// string may not be terminated by a NULL character. The pointer is valid for the lifetime of the walk marker passed to PssWalkSnapshot.
+ ///
+ ///
+ public IntPtr MappedFileName;
+ }
+
+ ///
+ /// Holds virtual address (VA) space information returned by PssQuerySnapshot.
+ ///
+ ///
+ ///
+ /// PssQuerySnapshot returns a PSS_VA_SPACE_INFORMATION structure when the PSS_QUERY_INFORMATION_CLASS member that the caller
+ /// provides it is PSS_QUERY_VA_SPACE_INFORMATION.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/api/processsnapshot/ns-processsnapshot-pss_va_space_information
+ // typedef struct PSS_VA_SPACE_INFORMATION { DWORD RegionCount; };
+ [PInvokeData("processsnapshot.h", MSDNShortId = "F38FF7EB-DDC5-4692-8F57-8D633193D891")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSS_VA_SPACE_INFORMATION
+ {
+ ///
+ /// The count of VA regions captured.
+ ///
+ public uint RegionCount;
+ }
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/ProcessThreadsApi.cs b/PInvoke/Kernel32/ProcessThreadsApi.cs
index 67d5cddc..39c83688 100644
--- a/PInvoke/Kernel32/ProcessThreadsApi.cs
+++ b/PInvoke/Kernel32/ProcessThreadsApi.cs
@@ -1546,6 +1546,26 @@ namespace Vanara.PInvoke
[PInvokeData("WinBase.h", MSDNShortId = "ms683180")]
public static extern uint GetCurrentProcessId();
+ ///
+ /// Retrieves the number of the processor the current thread was running on during the call to this function.
+ ///
+ ///
+ /// The function returns the current processor number.
+ ///
+ ///
+ /// This function is used to provide information for estimating process performance.
+ ///
+ /// On systems with more than 64 logical processors, the GetCurrentProcessorNumber function returns the processor number
+ /// within the processor group to which the logical processor is assigned. Use the GetCurrentProcessorNumberEx function to retrieve
+ /// the processor group and number of the current processor.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-getcurrentprocessornumber
+ // DWORD GetCurrentProcessorNumber( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("processthreadsapi.h", MSDNShortId = "1f2bebc7-a548-409a-ab74-78a4b55c8fa7")]
+ public static extern uint GetCurrentProcessorNumber();
+
/// Retrieves the processor group and number of the logical processor in which the calling thread is running.
///
/// A pointer to a PROCESSOR_NUMBER structure that receives the processor group to which the logical processor is assigned and the number of the
diff --git a/PInvoke/Kernel32/PsApi.cs b/PInvoke/Kernel32/PsApi.cs
new file mode 100644
index 00000000..f8a3df66
--- /dev/null
+++ b/PInvoke/Kernel32/PsApi.cs
@@ -0,0 +1,1398 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ ///
+ /// An application-defined callback function used with the EnumPageFiles function.
+ ///
+ /// The PENUM_PAGE_FILE_CALLBACK type defines a pointer to this callback function. EnumPageFilesProc is a placeholder
+ /// for the application-defined function name.
+ ///
+ ///
+ ///
+ /// The user-defined data passed from EnumPageFiles.
+ ///
+ ///
+ /// A pointer to an ENUM_PAGE_FILE_INFORMATION structure.
+ ///
+ ///
+ /// The name of the pagefile.
+ ///
+ ///
+ /// To continue enumeration, the callback function must return TRUE.
+ /// To stop enumeration, the callback function must return FALSE.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nc-psapi-penum_page_file_callbacka PENUM_PAGE_FILE_CALLBACKA
+ // PenumPageFileCallbacka; BOOL PenumPageFileCallbacka( LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename
+ // ) {...}
+ [UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "eb3610fb-2c95-4f7b-973d-8dc41d2829f1")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public delegate bool PenumPageFileCallback(IntPtr pContext, ref ENUM_PAGE_FILE_INFORMATION pPageFileInfo, string lpFilename);
+
+ /// Used by .
+ [PInvokeData("psapi.h", MSDNShortId = "0f982f32-31f4-47b6-85d2-d6e17aa4eeb9")]
+ public enum LIST_MODULES
+ {
+ /// Use the default behavior.
+ LIST_MODULES_DEFAULT = 0x0,
+
+ /// List the 32-bit modules.
+ LIST_MODULES_32BIT = 0x01,
+
+ /// List the 64-bit modules.
+ LIST_MODULES_64BIT = 0x02,
+
+ /// List all modules.
+ LIST_MODULES_ALL = 0x03,
+ }
+
+ ///
+ /// Removes as many pages as possible from the working set of the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
+ /// access right and the PROCESS_SET_QUOTA access right. For more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// You can also empty the working set by calling the SetProcessWorkingSetSize or SetProcessWorkingSetSizeEx function with the
+ /// dwMinimumWorkingSetSize and dwMaximumWorkingSetSize parameters set to the value .
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EmptyWorkingSet in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as K32EmptyWorkingSet in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EmptyWorkingSet.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// K32EmptyWorkingSet. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
+ /// with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-emptyworkingset BOOL EmptyWorkingSet( HANDLE hProcess );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "76f2252e-7305-46b0-b1af-40ac084e6696")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EmptyWorkingSet(IntPtr hProcess);
+
+ ///
+ /// Retrieves the load address for each device driver in the system.
+ ///
+ ///
+ /// An array that receives the list of load addresses for the device drivers.
+ ///
+ ///
+ ///
+ /// The size of the lpImageBase array, in bytes. If the array is not large enough to store the load addresses, the lpcbNeeded
+ /// parameter receives the required size of the array.
+ ///
+ ///
+ ///
+ /// The number of bytes returned in the lpImageBase array.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// To determine how many device drivers were enumerated by the call to EnumDeviceDrivers, divide the resulting value in the
+ /// lpcbNeeded parameter by .
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumDeviceDrivers in Psapi.h and exported in Kernel32.lib
+ /// and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumDeviceDrivers in Psapi.h and exported in
+ /// Psapi.lib and Psapi.dll as a wrapper that calls K32EnumDeviceDrivers.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// EnumDeviceDrivers. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
+ /// with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Enumerating all Device Drivers in the System.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-enumdevicedrivers BOOL EnumDeviceDrivers( LPVOID *lpImageBase,
+ // DWORD cb, LPDWORD lpcbNeeded );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "55925741-da23-44b1-93e8-0e9468434a61")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnumDeviceDrivers([In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] lpImageBase, uint cb, out uint lpcbNeeded);
+
+ ///
+ /// Calls the callback routine for each installed pagefile in the system.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get
+ /// extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumPageFiles in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumPageFiles in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EnumPageFiles.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// EnumPageFiles. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-enumpagefilesa BOOL EnumPageFilesA( PENUM_PAGE_FILE_CALLBACKA
+ // pCallBackRoutine, LPVOID pContext );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "9289fe3c-a7d9-4acb-aeb6-a50de65db0a2")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnumPageFiles(PenumPageFileCallback pCallBackRoutine, IntPtr pContext);
+
+ ///
+ /// Retrieves the process identifier for each process object in the system.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// The size of the pProcessIds array, in bytes.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// It is a good idea to use a large array, because it is hard to predict how many processes there will be at the time you call EnumProcesses.
+ ///
+ ///
+ /// To determine how many processes were enumerated, divide the pBytesReturned value by sizeof(DWORD). There is no indication given
+ /// when the buffer is too small to store all process identifiers. Therefore, if pBytesReturned equals cb, consider retrying the call
+ /// with a larger array.
+ ///
+ /// To obtain process handles for the processes whose identifiers you have just obtained, call the OpenProcess function.
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumProcesses in Psapi.h and exported in Kernel32.lib and
+ /// Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumProcesses in Psapi.h and exported in Psapi.lib and
+ /// Psapi.dll as a wrapper that calls K32EnumProcesses.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// EnumProcesses. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with
+ /// –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Enumerating All Processes or Enumerating All Modules for a Process.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-enumprocesses BOOL EnumProcesses( DWORD *lpidProcess, DWORD
+ // cb, LPDWORD lpcbNeeded );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "0c0445cb-27d2-4857-a4a5-7a4c180b068b")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnumProcesses([In, MarshalAs(UnmanagedType.LPArray)] uint[] lpidProcess, uint cb, out uint lpcbNeeded);
+
+ ///
+ /// Retrieves a handle for each module in the specified process.
+ ///
+ /// To control whether a 64-bit application enumerates 32-bit modules, 64-bit modules, or both types of modules, use the
+ /// EnumProcessModulesEx function.
+ ///
+ ///
+ ///
+ /// A handle to the process.
+ ///
+ ///
+ /// An array that receives the list of module handles.
+ ///
+ ///
+ /// The size of the lphModule array, in bytes.
+ ///
+ ///
+ /// The number of bytes required to store all module handles in the lphModule array.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The EnumProcessModules function is primarily designed for use by debuggers and similar applications that must extract
+ /// module information from another process. If the module list in the target process is corrupted or not yet initialized, or if the
+ /// module list changes during the function call as a result of DLLs being loaded or unloaded, EnumProcessModules may fail or
+ /// return incorrect information.
+ ///
+ ///
+ /// It is a good idea to specify a large array of HMODULE values, because it is hard to predict how many modules there will be
+ /// in the process at the time you call EnumProcessModules. To determine if the lphModule array is too small to hold all
+ /// module handles for the process, compare the value returned in lpcbNeeded with the value specified in cb. If lpcbNeeded is greater
+ /// than cb, increase the size of the array and call EnumProcessModules again.
+ ///
+ ///
+ /// To determine how many modules were enumerated by the call to EnumProcessModules, divide the resulting value in the
+ /// lpcbNeeded parameter by .
+ ///
+ ///
+ /// The EnumProcessModules function does not retrieve handles for modules that were loaded with the
+ /// LOAD_LIBRARY_AS_DATAFILE or similar flags. For more information, see LoadLibraryEx.
+ ///
+ ///
+ /// Do not call CloseHandle on any of the handles returned by this function. The information comes from a snapshot, so there are no
+ /// resources to be freed.
+ ///
+ ///
+ /// If this function is called from a 32-bit application running on WOW64, it can only enumerate the modules of a 32-bit process. If
+ /// the process is a 64-bit process, this function fails and the last error code is ERROR_PARTIAL_COPY (299).
+ ///
+ ///
+ /// To take a snapshot of specified processes and the heaps, modules, and threads used by these processes, use the
+ /// CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumProcessModules in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumProcessModules in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EnumProcessModules.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// EnumProcessModules. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Enumerating All Processes or Enumerating All Modules for a Process.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-enumprocessmodules BOOL EnumProcessModules( HANDLE hProcess,
+ // HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "b4088506-2f69-4cf0-9bab-3e6a7185f5b2")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnumProcessModules(IntPtr hProcess, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] lphModule, uint cb, out uint lpcbNeeded);
+
+ ///
+ /// Retrieves a handle for each module in the specified process that meets the specified filter criteria.
+ ///
+ ///
+ /// A handle to the process.
+ ///
+ ///
+ /// An array that receives the list of module handles.
+ ///
+ ///
+ /// The size of the lphModule array, in bytes.
+ ///
+ ///
+ /// The number of bytes required to store all module handles in the lphModule array.
+ ///
+ ///
+ /// The filter criteria. This parameter can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// LIST_MODULES_32BIT 0x01
+ /// List the 32-bit modules.
+ ///
+ /// -
+ /// LIST_MODULES_64BIT 0x02
+ /// List the 64-bit modules.
+ ///
+ /// -
+ /// LIST_MODULES_ALL 0x03
+ /// List all modules.
+ ///
+ /// -
+ /// LIST_MODULES_DEFAULT 0x0
+ /// Use the default behavior.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The EnumProcessModulesEx function is primarily designed for use by debuggers and similar applications that must extract
+ /// module information from another process. If the module list in the target process is corrupted or not yet initialized, or if the
+ /// module list changes during the function call as a result of DLLs being loaded or unloaded, EnumProcessModulesEx may fail
+ /// or return incorrect information.
+ ///
+ ///
+ /// This function is intended primarily for 64-bit applications. If the function is called by a 32-bit application running under
+ /// WOW64, the dwFilterFlag option is ignored and the function provides the same results as the EnumProcessModules function.
+ ///
+ ///
+ /// It is a good idea to specify a large array of HMODULE values, because it is hard to predict how many modules there will be
+ /// in the process at the time you call EnumProcessModulesEx. To determine if the lphModule array is too small to hold all
+ /// module handles for the process, compare the value returned in lpcbNeeded with the value specified in cb. If lpcbNeeded is greater
+ /// than cb, increase the size of the array and call EnumProcessModulesEx again.
+ ///
+ ///
+ /// To determine how many modules were enumerated by the call to EnumProcessModulesEx, divide the resulting value in the
+ /// lpcbNeeded parameter by .
+ ///
+ ///
+ /// The EnumProcessModulesEx function does not retrieve handles for modules that were loaded with the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
+ ///
+ ///
+ /// Do not call CloseHandle on any of the handles returned by this function. The information comes from a snapshot, so there are no
+ /// resources to be freed.
+ ///
+ ///
+ /// To take a snapshot of specified processes and the heaps, modules, and threads used by these processes, use the
+ /// CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32EnumProcessModulesEx in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as EnumProcessModulesEx in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32EnumProcessModulesEx.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// EnumProcessModulesEx. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-enumprocessmodulesex BOOL EnumProcessModulesEx( HANDLE
+ // hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded, DWORD dwFilterFlag );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "0f982f32-31f4-47b6-85d2-d6e17aa4eeb9")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnumProcessModulesEx(IntPtr hProcess, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] lphModule, uint cb, out uint lpcbNeeded, LIST_MODULES dwFilterFlag);
+
+ ///
+ /// Retrieves the base name of the specified device driver.
+ ///
+ ///
+ /// The load address of the device driver. This value can be retrieved using the EnumDeviceDrivers function.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ ///
+ /// The size of the lpBaseName buffer, in characters. If the buffer is not large enough to store the base name plus the terminating
+ /// null character, the string is truncated.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value specifies the length of the string copied to the buffer, not including any terminating
+ /// null character.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetDeviceDriverBaseName in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetDeviceDriverBaseName in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetDeviceDriverBaseName.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetDeviceDriverBaseName. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Enumerating all Device Drivers in the System.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getdevicedriverbasenamea DWORD GetDeviceDriverBaseNameA(
+ // LPVOID ImageBase, LPSTR lpFilename, DWORD nSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "a19a927d-4669-4d4c-951e-43f294a8fb40")]
+ public static extern uint GetDeviceDriverBaseName(IntPtr ImageBase, StringBuilder lpFilename, uint nSize);
+
+ ///
+ /// Retrieves the path available for the specified device driver.
+ ///
+ ///
+ /// The load address of the device driver.
+ ///
+ ///
+ /// A pointer to the buffer that receives the path to the device driver.
+ ///
+ ///
+ ///
+ /// The size of the lpFilename buffer, in characters. If the buffer is not large enough to store the path plus the terminating null
+ /// character, the string is truncated.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value specifies the length of the string copied to the buffer, not including any terminating
+ /// null character.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetDeviceDriverFileName in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetDeviceDriverFileName in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetDeviceDriverFileName.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetDeviceDriverFileName. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getdevicedriverfilenamea DWORD GetDeviceDriverFileNameA(
+ // LPVOID ImageBase, LPSTR lpFilename, DWORD nSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "6ddbcf7e-e41c-4ea7-b60a-01ed5c98c530")]
+ public static extern uint GetDeviceDriverFileName(IntPtr ImageBase, StringBuilder lpFilename, uint nSize);
+
+ ///
+ ///
+ /// Checks whether the specified address is within a memory-mapped file in the address space of the specified process. If so, the
+ /// function returns the name of the memory-mapped file.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. For
+ /// more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// The address to be verified.
+ ///
+ ///
+ /// A pointer to the buffer that receives the name of the memory-mapped file to which the address specified by lpv belongs.
+ ///
+ ///
+ /// The size of the lpFilename buffer, in characters.
+ ///
+ ///
+ /// If the function succeeds, the return value specifies the length of the string copied to the buffer, in characters.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetMappedFileName in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetMappedFileName in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetMappedFileName.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetMappedFileName. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// In Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ /// Examples
+ /// For an example, see Obtaining a File Name From a File Handle.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getmappedfilenamea DWORD GetMappedFileNameA( HANDLE hProcess,
+ // LPVOID lpv, LPSTR lpFilename, DWORD nSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "10a2e5ab-f495-486d-8ef7-ef763716afd1")]
+ public static extern uint GetMappedFileName(IntPtr hProcess, IntPtr lpv, StringBuilder lpFilename, uint nSize);
+
+ ///
+ /// Retrieves the base name of the specified module.
+ ///
+ ///
+ /// A handle to the process that contains the module.
+ ///
+ /// The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. For more information, see
+ /// Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the module. If this parameter is NULL, this function returns the name of the file used to create the calling process.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to the buffer that receives the base name of the module. If the base name is longer than maximum number of characters
+ /// specified by the nSize parameter, the base name is truncated.
+ ///
+ ///
+ ///
+ /// The size of the lpBaseName buffer, in characters.
+ ///
+ ///
+ /// If the function succeeds, the return value specifies the length of the string copied to the buffer, in characters.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The GetModuleBaseName function is primarily designed for use by debuggers and similar applications that must extract
+ /// module information from another process. If the module list in the target process is corrupted or is not yet initialized, or if
+ /// the module list changes during the function call as a result of DLLs being loaded or unloaded, GetModuleBaseName may fail
+ /// or return incorrect information.
+ ///
+ ///
+ /// To retrieve the base name of a module in the current process, use the GetModuleFileName function to retrieve the full module name
+ /// and then use a function call such as to scan to the beginning of the base name within the module name string. This is more
+ /// efficient and more reliable than calling GetModuleBaseName with a handle to the current process.
+ ///
+ ///
+ /// To retrieve the base name of the main executable module for a remote process, use the GetProcessImageFileName or
+ /// QueryFullProcessImageName function to retrieve the module name and then use the function as described in the previous paragraph.
+ /// This is more efficient and more reliable than calling GetModuleBaseName with a NULL module handle.
+ ///
+ ///
+ /// The GetModuleBaseName function does not retrieve the base name for modules that were loaded with the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetModuleBaseName in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetModuleBaseName in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetModuleBaseName.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetModuleBaseName. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Enumerating All Processes.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getmodulebasenamea DWORD GetModuleBaseNameA( HANDLE hProcess,
+ // HMODULE hModule, LPSTR lpBaseName, DWORD nSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "31a9eb69-95f0-4dd7-8fd5-296f2cff0b8a")]
+ public static extern uint GetModuleBaseName(IntPtr hProcess, SafeLibraryHandle hModule, StringBuilder lpBaseName, uint nSize);
+
+ ///
+ /// Retrieves information about the specified module in the MODULEINFO structure.
+ ///
+ ///
+ /// A handle to the process that contains the module.
+ ///
+ /// The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. For more information, see
+ /// Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// A handle to the module.
+ ///
+ ///
+ /// A pointer to the MODULEINFO structure that receives information about the module.
+ ///
+ ///
+ /// The size of the MODULEINFO structure, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// To get information for the calling process, pass the handle returned by GetCurrentProcess.
+ ///
+ /// The GetModuleInformation function does not retrieve information for modules that were loaded with the
+ /// LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetModuleInformation in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as K32GetModuleInformation in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetModuleInformation.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// K32GetModuleInformation. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getmoduleinformation BOOL GetModuleInformation( HANDLE
+ // hProcess, HMODULE hModule, LPMODULEINFO lpmodinfo, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "afb9f4c8-c8ae-4497-96c1-b559cfa2cedf")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetModuleInformation(IntPtr hProcess, SafeLibraryHandle hModule, ref MODULEINFO lpmodinfo, uint cb);
+
+ ///
+ /// Retrieves the performance values contained in the PERFORMANCE_INFORMATION structure.
+ ///
+ ///
+ /// A pointer to a PERFORMANCE_INFORMATION structure that receives the performance information.
+ ///
+ ///
+ /// The size of the PERFORMANCE_INFORMATION structure, in bytes.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error
+ /// information, call GetLastError.
+ ///
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetPerformanceInfo in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetPerformanceInfo in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetPerformanceInfo.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetPerformanceInfo. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program
+ /// with –DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getperformanceinfo BOOL GetPerformanceInfo(
+ // PPERFORMANCE_INFORMATION pPerformanceInformation, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "21655278-49da-4e63-a4f9-0ee9f6179f4a")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetPerformanceInfo(ref PERFORMANCE_INFORMATION pPerformanceInformation, uint cb);
+
+ ///
+ /// Retrieves the name of the executable file for the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
+ /// access right. For more information, see Process Security and Access Rights.
+ ///
+ /// Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right.
+ ///
+ ///
+ /// A pointer to a buffer that receives the full path to the executable file.
+ ///
+ ///
+ /// The size of the lpImageFileName buffer, in characters.
+ ///
+ ///
+ /// If the function succeeds, the return value specifies the length of the string copied to the buffer.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The file Psapi.dll is installed in the %windir%\System32 directory. If there is another copy of this DLL on your computer, it can
+ /// lead to the following error when running applications on your system: "The procedure entry point GetProcessImageFileName could
+ /// not be located in the dynamic link library PSAPI.DLL." To work around this problem, locate any versions that are not in the
+ /// %windir%\System32 directory and delete or rename them, then restart.
+ ///
+ ///
+ /// The GetProcessImageFileName function returns the path in device form, rather than drive letters. For example, the file
+ /// name C:\Windows\System32\Ctype.nls would look as follows in device form:
+ ///
+ /// \Device\Harddisk0\Partition1\Windows\System32\Ctype.nls
+ ///
+ /// To retrieve the module name of the current process, use the GetModuleFileName function with a NULL module handle. This is more
+ /// efficient than calling the GetProcessImageFileName function with a handle to the current process.
+ ///
+ ///
+ /// To retrieve the name of the main executable module for a remote process in win32 path format, use the QueryFullProcessImageName function.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetProcessImageFileName in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetProcessImageFileName in
+ /// Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetProcessImageFileName.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetProcessImageFileName. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile
+ /// the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getprocessimagefilenamea DWORD GetProcessImageFileNameA(
+ // HANDLE hProcess, LPSTR lpImageFileName, DWORD nSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "819fc2f4-0801-417b-9cbb-d7fd2894634e")]
+ public static extern uint GetProcessImageFileName(IntPtr hProcess, StringBuilder lpImageFileName, uint nSize);
+
+ ///
+ /// Retrieves information about the memory usage of the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
+ /// access right and the PROCESS_VM_READ access right. For more information, see Process Security and Access Rights.
+ ///
+ ///
+ /// Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ
+ /// access rights.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to the PROCESS_MEMORY_COUNTERS or PROCESS_MEMORY_COUNTERS_EX structure that receives information about the memory usage
+ /// of the process.
+ ///
+ ///
+ ///
+ /// The size of the ppsmemCounters structure, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetProcessMemoryInfo in Psapi.h
+ /// and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetProcessMemoryInfo.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetProcessMemoryInfo. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile
+ /// the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Collecting Memory Usage Information for a Process.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getprocessmemoryinfo BOOL GetProcessMemoryInfo( HANDLE
+ // Process, PPROCESS_MEMORY_COUNTERS ppsmemCounters, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "12990e8d-6097-4502-824e-db6c3f76c715")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetProcessMemoryInfo(IntPtr Process, ref PROCESS_MEMORY_COUNTERS ppsmemCounters, uint cb);
+
+ ///
+ ///
+ /// Retrieves information about the pages that have been added to the working set of the specified process since the last time this
+ /// function or the InitializeProcessForWsWatch function was called.
+ ///
+ /// To retrieve extended information, use the GetWsChangesEx function.
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see
+ /// Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a user-allocated buffer that receives an array of PSAPI_WS_WATCH_INFORMATION structures. The array is terminated
+ /// with a structure whose FaultingPc member is NULL.
+ ///
+ ///
+ ///
+ /// The size of the lpWatchInfo buffer, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ /// GetLastError returns ERROR_INSUFFICIENT_BUFFER if the lpWatchInfo buffer is not large enough to contain all the working
+ /// set change records; the buffer is returned empty. Reallocate a larger block of memory for the buffer and call again.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system uses one buffer per process to maintain working set change records. If more than one application (or
+ /// multiple threads in the same application) calls this function with the same process handle, neither application will have a
+ /// complete accounting of the working set changes because each call empties the buffer.
+ ///
+ ///
+ /// The operating system does not record new change records while it is processing the query (and emptying the buffer). The function
+ /// sets the error code to NO_MORE_ENTRIES if a concurrent query is received while it is processing another query.
+ ///
+ ///
+ /// If the buffer becomes full, no new records are added to the buffer until this function or the InitializeProcessForWsWatch
+ /// function is called. You should call this method with enough frequency to prevent possible data loss. If records are lost, the
+ /// array is terminated with a structure whose FaultingPc member is NULL and whose FaultingVa member is set to the
+ /// number of records that were lost.
+ ///
+ ///
+ /// Windows Server 2003 and Windows XP: If records are lost, the array is terminated with a structure whose FaultingPc
+ /// member is NULL and whose FaultingVa member is 1.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetWsChanges in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetWsChanges in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetWsChanges.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetWsChanges. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getwschanges BOOL GetWsChanges( HANDLE hProcess,
+ // PPSAPI_WS_WATCH_INFORMATION lpWatchInfo, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "ace5106c-9c7b-4d5f-a69a-c3a8bff0bb2d")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetWsChanges(IntPtr hProcess, IntPtr lpWatchInfo, uint cb);
+
+ ///
+ ///
+ /// Retrieves extended information about the pages that have been added to the working set of the specified process since the last
+ /// time this function or the InitializeProcessForWsWatch function was called.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see
+ /// Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a user-allocated buffer that receives an array of PSAPI_WS_WATCH_INFORMATION_EX structures. The array is terminated
+ /// with a structure whose FaultingPc member is NULL.
+ ///
+ ///
+ ///
+ /// The size of the lpWatchInfoEx buffer, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
+ ///
+ /// The GetLastError function returns ERROR_INSUFFICIENT_BUFFER if the lpWatchInfoEx buffer is not large enough to contain all
+ /// the working set change records; the buffer is returned empty. Reallocate a larger block of memory for the buffer and call again.
+ ///
+ ///
+ ///
+ ///
+ /// The operating system uses one buffer per process to maintain working set change records. If more than one application (or
+ /// multiple threads in the same application) calls this function with the same process handle, neither application will have a
+ /// complete accounting of the working set changes because each call empties the buffer.
+ ///
+ ///
+ /// The operating system does not record new change records while it is processing the query (and emptying the buffer). This function
+ /// sets the error code to NO_MORE_ENTRIES if a concurrent query is received while it is processing another query.
+ ///
+ ///
+ /// If the buffer becomes full, no new records are added to the buffer until this function or the InitializeProcessForWsWatch
+ /// function is called. You should call GetWsChangesEx with enough frequency to prevent possible data loss. If records are
+ /// lost, the array is terminated with a structure whose FaultingPc member is NULL and whose FaultingVa member is set
+ /// to the number of records that were lost.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32GetWsChangesEx in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as GetWsChangesEx in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32GetWsChangesEx.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// GetWsChangesEx. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-getwschangesex BOOL GetWsChangesEx( HANDLE hProcess,
+ // PPSAPI_WS_WATCH_INFORMATION_EX lpWatchInfoEx, PDWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "8572db5c-2ffc-424f-8cec-b6a6902fed62")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetWsChangesEx(IntPtr hProcess, IntPtr lpWatchInfoEx, ref uint cb);
+
+ ///
+ ///
+ /// Initiates monitoring of the working set of the specified process. You must call this function before calling the GetWsChanges function.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see Process
+ /// Security and Access Rights.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32InitializeProcessForWsWatch in Psapi.h and
+ /// exported in Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as
+ /// InitializeProcessForWsWatch in Psapi.h and exported in Psapi.lib and Psapi.dll as a wrapper that calls K32InitializeProcessForWsWatch.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// InitializeProcessForWsWatch. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and
+ /// compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-initializeprocessforwswatch BOOL InitializeProcessForWsWatch(
+ // HANDLE hProcess );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("psapi.h", MSDNShortId = "c928656c-a59d-41b5-9434-911329b0278e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool InitializeProcessForWsWatch(IntPtr hProcess);
+
+ ///
+ /// Retrieves information about the pages currently added to the working set of the specified process.
+ ///
+ /// To retrieve working set information for a subset of virtual addresses, or to retrieve information about pages that are not part
+ /// of the working set (such as AWE or large pages), use the QueryWorkingSetEx function.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. For
+ /// more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// A pointer to the buffer that receives the information. For more information, see PSAPI_WORKING_SET_INFORMATION.
+ ///
+ /// If the buffer pointed to by the pv parameter is not large enough to contain all working set entries for the target process, the
+ /// function fails with ERROR_BAD_LENGTH. In this case, the NumberOfEntries member of the PSAPI_WORKING_SET_INFORMATION
+ /// structure is set to the required number of entries, but the function does not return information about the working set entries.
+ ///
+ ///
+ ///
+ /// The size of the pv buffer, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32QueryWorkingSet in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as QueryWorkingSet in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32QueryWorkingSet.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// QueryWorkingSet. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-queryworkingset BOOL QueryWorkingSet( HANDLE hProcess, PVOID
+ // pv, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "b932153f-2bbd-460e-8ff7-b3e493c397bb")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool QueryWorkingSet(IntPtr hProcess, IntPtr pv, uint cb);
+
+ ///
+ /// Retrieves extended information about the pages at specific virtual addresses in the address space of the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. The handle must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ access rights. For
+ /// more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to an array of PSAPI_WORKING_SET_EX_INFORMATION structures. On input, each item in the array specifies a virtual
+ /// address of interest. On output, each item in the array receives information about the corresponding virtual page.
+ ///
+ ///
+ ///
+ /// The size of the pv buffer, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Unlike the QueryWorkingSet function, which is limited to the working set of the target process, the QueryWorkingSetEx
+ /// function can be used to query addresses that are not in the process working set but are still part of the process, such as AWE
+ /// and large pages.
+ ///
+ ///
+ /// Starting with Windows 7 and Windows Server 2008 R2, Psapi.h establishes version numbers for the PSAPI functions. The PSAPI
+ /// version number affects the name used to call the function and the library that a program must load.
+ ///
+ ///
+ /// If PSAPI_VERSION is 2 or greater, this function is defined as K32QueryWorkingSetEx in Psapi.h and exported in
+ /// Kernel32.lib and Kernel32.dll. If PSAPI_VERSION is 1, this function is defined as QueryWorkingSetEx in Psapi.h and
+ /// exported in Psapi.lib and Psapi.dll as a wrapper that calls K32QueryWorkingSetEx.
+ ///
+ ///
+ /// Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as
+ /// QueryWorkingSetEx. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the
+ /// program with "–DPSAPI_VERSION=1". To use run-time dynamic linking, load Psapi.dll.
+ ///
+ /// Examples
+ /// For an example, see Allocating Memory from a NUMA Node.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/nf-psapi-queryworkingsetex BOOL QueryWorkingSetEx( HANDLE hProcess,
+ // PVOID pv, DWORD cb );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("psapi.h", MSDNShortId = "59ae76c9-e954-4648-9c9f-787136375b02")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool QueryWorkingSetEx(IntPtr hProcess, IntPtr pv, uint cb);
+
+ ///
+ /// Contains information about a pagefile.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_enum_page_file_information typedef struct
+ // _ENUM_PAGE_FILE_INFORMATION { DWORD cb; DWORD Reserved; SIZE_T TotalSize; SIZE_T TotalInUse; SIZE_T PeakUsage; }
+ // ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
+ [PInvokeData("psapi.h", MSDNShortId = "020f3be8-f624-4788-8079-0f7679c9bef0")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public struct ENUM_PAGE_FILE_INFORMATION
+ {
+ ///
+ /// The size of this structure, in bytes.
+ ///
+ public uint cb;
+
+ ///
+ /// This member is reserved.
+ ///
+ public uint Reserved;
+
+ ///
+ /// The total size of the pagefile, in pages.
+ ///
+ public SizeT TotalSize;
+
+ ///
+ /// The current pagefile usage, in pages.
+ ///
+ public SizeT TotalInUse;
+
+ ///
+ /// The peak pagefile usage, in pages.
+ ///
+ public SizeT PeakUsage;
+ }
+
+ ///
+ /// Contains the module load address, size, and entry point.
+ ///
+ ///
+ ///
+ /// The load address of a module is the same as the HMODULE value. The information returned in the SizeOfImage and
+ /// EntryPoint members comes from the module's Portable Executable (PE) header. The module entry point is the location called
+ /// during process startup, thread startup, process shutdown, and thread shutdown. While this is not the address of the DllMain
+ /// function, it should be close enough for most purposes.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_moduleinfo typedef struct _MODULEINFO { LPVOID lpBaseOfDll;
+ // DWORD SizeOfImage; LPVOID EntryPoint; } MODULEINFO, *LPMODULEINFO;
+ [PInvokeData("psapi.h", MSDNShortId = "583caafe-7fa3-4041-b5bc-4e8899b3a08a")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct MODULEINFO
+ {
+ ///
+ /// The load address of the module.
+ ///
+ public IntPtr lpBaseOfDll;
+
+ ///
+ /// The size of the linear space that the module occupies, in bytes.
+ ///
+ public uint SizeOfImage;
+
+ ///
+ /// The entry point of the module.
+ ///
+ public IntPtr EntryPoint;
+ }
+
+ ///
+ /// Contains performance information.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_performance_information typedef struct
+ // _PERFORMANCE_INFORMATION { DWORD cb; SIZE_T CommitTotal; SIZE_T CommitLimit; SIZE_T CommitPeak; SIZE_T PhysicalTotal; SIZE_T
+ // PhysicalAvailable; SIZE_T SystemCache; SIZE_T KernelTotal; SIZE_T KernelPaged; SIZE_T KernelNonpaged; SIZE_T PageSize; DWORD
+ // HandleCount; DWORD ProcessCount; DWORD ThreadCount; } PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION, PERFORMACE_INFORMATION, *PPERFORMACE_INFORMATION;
+ [PInvokeData("psapi.h", MSDNShortId = "efc47f6e-1a60-4e77-9e5d-c725f9042ab8")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PERFORMANCE_INFORMATION
+ {
+ ///
+ /// The size of this structure, in bytes.
+ ///
+ public uint cb;
+
+ ///
+ ///
+ /// The number of pages currently committed by the system. Note that committing pages (using VirtualAlloc with MEM_COMMIT)
+ /// changes this value immediately; however, the physical memory is not charged until the pages are accessed.
+ ///
+ ///
+ public SizeT CommitTotal;
+
+ ///
+ ///
+ /// The current maximum number of pages that can be committed by the system without extending the paging file(s). This number can
+ /// change if memory is added or deleted, or if pagefiles have grown, shrunk, or been added. If the paging file can be extended,
+ /// this is a soft limit.
+ ///
+ ///
+ public SizeT CommitLimit;
+
+ ///
+ /// The maximum number of pages that were simultaneously in the committed state since the last system reboot.
+ ///
+ public SizeT CommitPeak;
+
+ ///
+ /// The amount of actual physical memory, in pages.
+ ///
+ public SizeT PhysicalTotal;
+
+ ///
+ ///
+ /// The amount of physical memory currently available, in pages. This is the amount of physical memory that can be immediately
+ /// reused without having to write its contents to disk first. It is the sum of the size of the standby, free, and zero lists.
+ ///
+ ///
+ public SizeT PhysicalAvailable;
+
+ ///
+ /// The amount of system cache memory, in pages. This is the size of the standby list plus the system working set.
+ ///
+ public SizeT SystemCache;
+
+ ///
+ /// The sum of the memory currently in the paged and nonpaged kernel pools, in pages.
+ ///
+ public SizeT KernelTotal;
+
+ ///
+ /// The memory currently in the paged kernel pool, in pages.
+ ///
+ public SizeT KernelPaged;
+
+ ///
+ /// The memory currently in the nonpaged kernel pool, in pages.
+ ///
+ public SizeT KernelNonpaged;
+
+ ///
+ /// The size of a page, in bytes.
+ ///
+ public SizeT PageSize;
+
+ ///
+ /// The current number of open handles.
+ ///
+ public uint HandleCount;
+
+ ///
+ /// The current number of processes.
+ ///
+ public uint ProcessCount;
+
+ ///
+ /// The current number of threads.
+ ///
+ public uint ThreadCount;
+ }
+
+ ///
+ /// Contains the memory statistics for a process.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_process_memory_counters typedef struct
+ // _PROCESS_MEMORY_COUNTERS { DWORD cb; DWORD PageFaultCount; SIZE_T PeakWorkingSetSize; SIZE_T WorkingSetSize; SIZE_T
+ // QuotaPeakPagedPoolUsage; SIZE_T QuotaPagedPoolUsage; SIZE_T QuotaPeakNonPagedPoolUsage; SIZE_T QuotaNonPagedPoolUsage; SIZE_T
+ // PagefileUsage; SIZE_T PeakPagefileUsage; } PROCESS_MEMORY_COUNTERS;
+ [PInvokeData("psapi.h", MSDNShortId = "288b5865-28a3-478b-ad32-c710fe4f3a81")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PROCESS_MEMORY_COUNTERS
+ {
+ ///
+ /// The size of the structure, in bytes.
+ ///
+ public uint cb;
+
+ ///
+ /// The number of page faults.
+ ///
+ public uint PageFaultCount;
+
+ ///
+ /// The peak working set size, in bytes.
+ ///
+ public SizeT PeakWorkingSetSize;
+
+ ///
+ /// The current working set size, in bytes.
+ ///
+ public SizeT WorkingSetSize;
+
+ ///
+ /// The peak paged pool usage, in bytes.
+ ///
+ public SizeT QuotaPeakPagedPoolUsage;
+
+ ///
+ /// The current paged pool usage, in bytes.
+ ///
+ public SizeT QuotaPagedPoolUsage;
+
+ ///
+ /// The peak nonpaged pool usage, in bytes.
+ ///
+ public SizeT QuotaPeakNonPagedPoolUsage;
+
+ ///
+ /// The current nonpaged pool usage, in bytes.
+ ///
+ public SizeT QuotaNonPagedPoolUsage;
+
+ ///
+ ///
+ /// The Commit Charge value in bytes for this process. Commit Charge is the total amount of memory that the memory manager has
+ /// committed for a running process.
+ ///
+ ///
+ public SizeT PagefileUsage;
+
+ ///
+ /// The peak value in bytes of the Commit Charge during the lifetime of this process.
+ ///
+ public SizeT PeakPagefileUsage;
+ }
+
+ ///
+ /// Contains information about a page added to a process working set.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_psapi_ws_watch_information typedef struct
+ // _PSAPI_WS_WATCH_INFORMATION { LPVOID FaultingPc; LPVOID FaultingVa; } PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
+ [PInvokeData("psapi.h", MSDNShortId = "61083366-2a55-431c-807a-3eb85ba0b347")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSAPI_WS_WATCH_INFORMATION
+ {
+ ///
+ /// A pointer to the instruction that caused the page fault.
+ ///
+ public IntPtr FaultingPc;
+
+ ///
+ /// A pointer to the page that was added to the working set.
+ ///
+ public IntPtr FaultingVa;
+ }
+
+ ///
+ /// Contains extended information about a page added to a process working set.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/psapi/ns-psapi-_psapi_ws_watch_information_ex typedef struct
+ // _PSAPI_WS_WATCH_INFORMATION_EX { PSAPI_WS_WATCH_INFORMATION BasicInfo; ULONG_PTR FaultingThreadId; ULONG_PTR Flags; }
+ // PSAPI_WS_WATCH_INFORMATION_EX, *PPSAPI_WS_WATCH_INFORMATION_EX;
+ [PInvokeData("psapi.h", MSDNShortId = "fb0429b1-ec93-401c-aeb1-f7e9d9acfa47")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PSAPI_WS_WATCH_INFORMATION_EX
+ {
+ ///
+ /// A PSAPI_WS_WATCH_INFORMATION structure.
+ ///
+ public PSAPI_WS_WATCH_INFORMATION BasicInfo;
+
+ ///
+ /// The identifier of the thread that caused the page fault.
+ ///
+ public UIntPtr FaultingThreadId;
+
+ ///
+ /// This member is reserved for future use.
+ ///
+ public UIntPtr Flags;
+ }
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/SecurityBaseApi.cs b/PInvoke/Kernel32/SecurityBaseApi.cs
index ed427207..1d864937 100644
--- a/PInvoke/Kernel32/SecurityBaseApi.cs
+++ b/PInvoke/Kernel32/SecurityBaseApi.cs
@@ -1,117 +1,243 @@
using System;
using System.Runtime.InteropServices;
-using System.Text;
-using Vanara.InteropServices;
-using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
namespace Vanara.PInvoke
{
public static partial class Kernel32
{
- /* AccessCheck
- AccessCheckAndAuditAlarmW
- AccessCheckByType
- AccessCheckByTypeAndAuditAlarmW
- AccessCheckByTypeResultList
- AccessCheckByTypeResultListAndAuditAlarmByHandleW
- AccessCheckByTypeResultListAndAuditAlarmW
- AddAccessAllowedAce
- AddAccessAllowedAceEx
- AddAccessAllowedObjectAce
- AddAccessDeniedAce
- AddAccessDeniedAceEx
- AddAccessDeniedObjectAce
- AddAce
- AddAuditAccessAce
- AddAuditAccessAceEx
- AddAuditAccessObjectAce
- AddMandatoryAce
- AddResourceAttributeAce
- AddScopedPolicyIDAce
- AdjustTokenGroups
- AdjustTokenPrivileges
- AllocateAndInitializeSid
- AllocateLocallyUniqueId
- AreAllAccessesGranted
- AreAnyAccessesGranted
- CheckTokenCapability
- CheckTokenMembership
- CheckTokenMembershipEx
- ConvertToAutoInheritPrivateObjectSecurity
- CopySid
- CreatePrivateObjectSecurity
- CreatePrivateObjectSecurityEx
- CreatePrivateObjectSecurityWithMultipleInheritance
- CreateRestrictedToken
- CreateWellKnownSid
- CveEventWrite
- DeleteAce
- DeriveCapabilitySidsFromName
- DestroyPrivateObjectSecurity
- DuplicateToken
- DuplicateTokenEx
- EqualDomainSid
- EqualPrefixSid
- EqualSid
- FindFirstFreeAce
- FreeSid
- GetAce
- GetAclInformation
- GetAppContainerAce
- GetCachedSigningLevel
- GetFileSecurityW
- GetKernelObjectSecurity
- GetLengthSid
- GetPrivateObjectSecurity
- GetSecurityDescriptorControl
- GetSecurityDescriptorDacl
- GetSecurityDescriptorGroup
- GetSecurityDescriptorLength
- GetSecurityDescriptorOwner
- GetSecurityDescriptorOwner
- GetSecurityDescriptorSacl
- GetSidIdentifierAuthority
- GetSidLengthRequired
- GetSidSubAuthority
- GetSidSubAuthorityCount
- GetTokenInformation
- GetWindowsAccountDomainSid
- ImpersonateAnonymousToken
- ImpersonateLoggedOnUser
- ImpersonateSelf
- InitializeAcl
- InitializeSecurityDescriptor
- InitializeSid
- IsTokenRestricted
- IsValidAcl
- IsValidSecurityDescriptor
- IsValidSid
- IsWellKnownSid
- MakeAbsoluteSD
- MakeSelfRelativeSD
- MapGenericMask
- ObjectCloseAuditAlarmW
- ObjectDeleteAuditAlarmW
- ObjectOpenAuditAlarmW
- ObjectPrivilegeAuditAlarmW
- PrivilegeCheck
- PrivilegedServiceAuditAlarmW
- QuerySecurityAccessMask
- RevertToSelf
- SetAclInformation
- SetCachedSigningLevel
- SetFileSecurityW
- SetKernelObjectSecurity
- SetPrivateObjectSecurity
- SetPrivateObjectSecurityEx
- SetSecurityAccessMask
- SetSecurityDescriptorControl
- SetSecurityDescriptorDacl
- SetSecurityDescriptorGroup
- SetSecurityDescriptorOwner
- SetSecurityDescriptorRMControl
- SetSecurityDescriptorSacl
- SetTokenInformation
- */
+ ///
+ ///
+ /// The AddResourceAttributeAce function adds a SYSTEM_RESOURCE_ATTRIBUTE_ACE access control entry (ACE) to the end of a
+ /// system access control list (SACL). A SYSTEM_RESOURCE_ATTRIBUTE_ACE structure specifies an attribute name and a
+ /// value-ordered list of elements that is associated with a resource and potentially used during access checks. The set of standard
+ /// access rights are defined in the Standard Access Rights topic.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to an access control list (ACL). This function adds an ACE to this ACL. The value of this parameter cannot be
+ /// NULL. The ACE is in the form of a SYSTEM_RESOURCE_ATTRIBUTE_ACE structure.
+ ///
+ ///
+ ///
+ ///
+ /// Specifies the revision level of the ACL being modified. This value can be ACL_REVISION or ACL_REVISION_DS. Use ACL_REVISION_DS if
+ /// the ACL contains object-specific ACEs.
+ ///
+ ///
+ ///
+ ///
+ /// A set of bit flags that control ACE inheritance. The function sets these flags in the AceFlags member of the ACE_HEADER
+ /// structure of the new ACE.
+ ///
+ ///
+ /// For consistency with the Windows 8 Advanced File Permissions UI, applications should specify the CONTAINER_INHERIT_ACE and
+ /// OBJECT_INHERIT_ACE flags in the parameter.
+ ///
+ /// This parameter can be a combination of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// CONTAINER_INHERIT_ACE 2 (0x2)
+ /// The ACE is inherited by the container objects.
+ ///
+ /// -
+ /// INHERIT_ONLY_ACE 8 (0x8)
+ /// The ACE does not apply to the object the ACE is assigned to, but it can be inherited by child objects.
+ ///
+ /// -
+ /// INHERITED_ACE 16 (0x10)
+ ///
+ /// Indicates an inherited ACE. This flag allows operations that change the security on a tree of objects to modify inherited ACEs
+ /// while not changing ACEs that were directly applied to the object.
+ ///
+ ///
+ /// -
+ /// NO_PROPAGATE_INHERIT_ACE 4 (0x4)
+ /// The OBJECT_INHERIT_ACE and CONTAINER_INHERIT_ACE bits are not propagated to an inherited ACE.
+ ///
+ /// -
+ /// OBJECT_INHERIT_ACE 1 (0x1)
+ /// The ACE is inherited by non-container objects.
+ ///
+ ///
+ ///
+ ///
+ /// Must be zero for Windows 8 and Windows Server 2012.
+ ///
+ ///
+ /// Must be the Everyone SID (S-1-1-0) for Windows 8 and Windows Server 2012.
+ ///
+ ///
+ /// Specifies the attribute information that will be appended after the SID in the ACE.
+ ///
+ ///
+ ///
+ /// The size, in bytes, of the actual ACL buffer used. If the buffer specified by the parameter is not big enough, the value of this
+ /// parameter is the total size required for the ACL buffer.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE. To get extended error information, call GetLastError.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/securitybaseapi/nf-securitybaseapi-addresourceattributeace BOOL
+ // AddResourceAttributeAce( PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, DWORD AccessMask, PSID pSid,
+ // PCLAIM_SECURITY_ATTRIBUTES_INFORMATION pAttributeInfo, PDWORD pReturnLength );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("securitybaseapi.h", MSDNShortId = "AA2064E4-6F76-4D7B-8540-D55A91168825")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AddResourceAttributeAce(PACL pAcl, uint dwAceRevision, uint AceFlags, uint AccessMask, PSID pSid, ref CLAIM_SECURITY_ATTRIBUTES_INFORMATION pAttributeInfo, ref uint pReturnLength);
+
+ ///
+ ///
+ /// The AddScopedPolicyIDAce function adds a SYSTEM_SCOPED_POLICY_ID_ACE access control entry (ACE) to the end of a system
+ /// access control list (SACL). A SYSTEM_SCOPED_POLICY_ID_ACE structure specifies a central access policy (CAP) to be
+ /// associated with the resource and can be used during access checks. The set of standard access rights are defined in the Standard
+ /// Access Rights topic.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to an access control list (ACL). This function adds an ACE to this ACL. The value of this parameter cannot be NULL.
+ ///
+ ///
+ ///
+ ///
+ /// Specifies the revision level of the ACL being modified. This value can be ACL_REVISION or ACL_REVISION_DS. Use ACL_REVISION_DS if
+ /// the ACL contains object-specific ACEs.
+ ///
+ ///
+ ///
+ ///
+ /// A set of bit flags that control ACE inheritance. The function sets these flags in the AceFlags member of the ACE_HEADER
+ /// structure of the new ACE.
+ ///
+ ///
+ /// For consistency with the Windows 8 Advanced File Permissions UI, applications should specify the CONTAINER_INHERIT_ACE and
+ /// OBJECT_INHERIT_ACE flags in the parameter.
+ ///
+ /// This parameter can be a combination of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// CONTAINER_INHERIT_ACE 2 (0x2)
+ /// The ACE is inherited by the container objects.
+ ///
+ /// -
+ /// INHERIT_ONLY_ACE 8 (0x8)
+ /// The ACE does not apply to the object the ACE is assigned to, but it can be inherited by child objects.
+ ///
+ /// -
+ /// INHERITED_ACE 16 (0x10)
+ ///
+ /// Indicates an inherited ACE. This flag allows operations that change the security on a tree of objects to modify inherited ACEs
+ /// while not changing ACEs that were directly applied to the object.
+ ///
+ ///
+ /// -
+ /// NO_PROPAGATE_INHERIT_ACE 4 (0x4)
+ /// The OBJECT_INHERIT_ACE and CONTAINER_INHERIT_ACE bits are not propagated to an inherited ACE.
+ ///
+ /// -
+ /// OBJECT_INHERIT_ACE 1 (0x1)
+ /// The ACE is inherited by non-container objects.
+ ///
+ ///
+ ///
+ ///
+ /// Must be zero for Windows 8 and Windows Server 2012.
+ ///
+ ///
+ /// A pointer to the SID (S-1-17-*) that identifies the Central Access Policy to be associated with the resource.
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE. To get extended error information, call GetLastError.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/securitybaseapi/nf-securitybaseapi-addscopedpolicyidace BOOL
+ // AddScopedPolicyIDAce( PACL pAcl, DWORD dwAceRevision, DWORD AceFlags, DWORD AccessMask, PSID pSid );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("securitybaseapi.h", MSDNShortId = "30AA5730-566C-4B02-A904-5A38237EE8E3")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AddScopedPolicyIDAce(PACL pAcl, uint dwAceRevision, uint AceFlags, uint AccessMask, PSID pSid);
+
+ ///
+ /// The CheckTokenCapability function checks the capabilities of a given token.
+ ///
+ ///
+ ///
+ /// A handle to an access token. The handle must have TOKEN_QUERY access to the token. The token must be an impersonation token.
+ ///
+ ///
+ /// If is NULL, CheckTokenCapability uses the impersonation token of the calling thread. If the thread is not
+ /// impersonating, the function duplicates the thread's primary token to create an impersonation token.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a capability SID structure. The CheckTokenCapability function checks the capabilities of this access token.
+ ///
+ ///
+ ///
+ ///
+ /// Receives the results of the check. If the access token has the capability, it returns TRUE, otherwise, it returns FALSE.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/securitybaseapi/nf-securitybaseapi-checktokencapability BOOL
+ // CheckTokenCapability( HANDLE TokenHandle, PSID CapabilitySidToCheck, PBOOL HasCapability );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("securitybaseapi.h", MSDNShortId = "436A5110-B79E-4E64-92E8-1C9E713D0948")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CheckTokenCapability(IntPtr TokenHandle, PSID CapabilitySidToCheck, [MarshalAs(UnmanagedType.Bool)] out bool HasCapability);
+
+ ///
+ ///
+ /// This function constructs two arrays of SIDs out of a capability name. One is an array group SID with NT Authority, and the other
+ /// is an array of capability SIDs with AppAuthority.
+ ///
+ ///
+ ///
+ /// Name of the capability in string form.
+ ///
+ ///
+ /// The GroupSids with NTAuthority.
+ ///
+ ///
+ /// The count of GroupSids in the array.
+ ///
+ ///
+ /// CapabilitySids with AppAuthority.
+ ///
+ ///
+ /// The count of CapabilitySid with AppAuthority.
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The caller is expected to free the individual SIDs returned in each array by calling LocalFree. as well as memory allocated for
+ /// the array itself.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/securitybaseapi/nf-securitybaseapi-derivecapabilitysidsfromname BOOL
+ // DeriveCapabilitySidsFromName( LPCWSTR CapName, PSID **CapabilityGroupSids, DWORD *CapabilityGroupSidCount, PSID **CapabilitySids,
+ // DWORD *CapabilitySidCount );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("securitybaseapi.h", MSDNShortId = "1A911FCC-6D11-4185-B532-20FE6C7C4B0B")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeriveCapabilitySidsFromName([MarshalAs(UnmanagedType.LPWStr)] string CapName, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] IntPtr[] CapabilityGroupSids, ref uint CapabilityGroupSidCount, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] IntPtr[] CapabilitySids, ref uint CapabilitySidCount);
}
}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/SynchApi.cs b/PInvoke/Kernel32/SynchApi.cs
index 7cca64c3..9a83c5d6 100644
--- a/PInvoke/Kernel32/SynchApi.cs
+++ b/PInvoke/Kernel32/SynchApi.cs
@@ -969,7 +969,7 @@ namespace Vanara.PInvoke
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms683560(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms683560")]
- public static extern int InterlockedCompareExchange(ref int Destination, int Exchange, int Comperand);
+ public static extern int InterlockedCompareExchange(ref int Destination, int Exchange, int Comparand);
///
/// Decrements (decreases by one) the value of the specified 32-bit variable as an atomic operation.
@@ -980,7 +980,7 @@ namespace Vanara.PInvoke
// LONG __cdecl InterlockedDecrement( _Inout_ LONG volatile *Addend); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683580(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms683580")]
- public static extern int InterlockedDecrement(ref int lpAddend);
+ public static extern int InterlockedDecrement(ref int Addend);
///
/// Sets a 32-bit variable to the specified value as an atomic operation.
@@ -1017,7 +1017,7 @@ namespace Vanara.PInvoke
// LONG __cdecl InterlockedIncrement( _Inout_ LONG volatile *Addend); https://msdn.microsoft.com/en-us/library/windows/desktop/ms683614(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms683614")]
- public static extern int InterlockedIncrement(ref int lpAddend);
+ public static extern int InterlockedIncrement(ref int Addend);
/// Releases ownership of the specified critical section object.
/// A pointer to the critical section object.
@@ -1300,7 +1300,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("WinBase.h", MSDNShortId = "ms686289")]
[return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool SetWaitableTimer([In] IntPtr hTimer, [In] ref FILETIME lpDueTime, int lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine,
+ public static extern bool SetWaitableTimer([In] IntPtr hTimer, [In] ref FILETIME pDueTime, int lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine,
[In] IntPtr lpArgToCompletionRoutine, [MarshalAs(UnmanagedType.Bool)] bool fResume);
///
diff --git a/PInvoke/Kernel32/TimeZoneApi.cs b/PInvoke/Kernel32/TimeZoneApi.cs
index 2de1fd55..11b8e120 100644
--- a/PInvoke/Kernel32/TimeZoneApi.cs
+++ b/PInvoke/Kernel32/TimeZoneApi.cs
@@ -160,8 +160,12 @@ namespace Vanara.PInvoke
public static extern bool SetDynamicTimeZoneInformation(ref DYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation);
///
- /// Sets the current time zone settings. These settings control translations from Coordinated Universal Time (UTC) to local time.
- /// To support boundaries for daylight saving time that change from year to year, use the SetDynamicTimeZoneInformation function.
+ ///
+ /// Sets the current time zone settings. These settings control translations from Coordinated Universal Time (UTC) to local time.
+ ///
+ ///
+ /// To support boundaries for daylight saving time that change from year to year, use the SetDynamicTimeZoneInformation function.
+ ///
///
/// A pointer to a TIME_ZONE_INFORMATION structure that contains the new settings.
///
@@ -172,7 +176,7 @@ namespace Vanara.PInvoke
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
[PInvokeData("Winbase.h", MSDNShortId = "ms724944")]
[return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool SetTimeZoneInformation([In] ref TIME_ZONE_INFORMATION lpTimeZoneInformation);
+ public static extern bool SetTimeZoneInformation(ref TIME_ZONE_INFORMATION lpTimeZoneInformation);
/// Converts a system time to file time format. System time is based on Coordinated Universal Time (UTC).
///
diff --git a/PInvoke/Kernel32/TlHelp32.cs b/PInvoke/Kernel32/TlHelp32.cs
new file mode 100644
index 00000000..fd1fc2c9
--- /dev/null
+++ b/PInvoke/Kernel32/TlHelp32.cs
@@ -0,0 +1,851 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ /// Used by HEAPENTRY32
+ [PInvokeData("tlhelp32.h", MSDNShortId = "c5f1dc66-d44f-4491-b0b7-961b163d0f1f")]
+ [Flags]
+ public enum HEAPENTRY32_FLAGS
+ {
+ /// The memory block has a fixed (unmovable) location.
+ LF32_FIXED = 0x00000001,
+
+ /// The memory block is not used.
+ LF32_FREE = 0x00000002,
+
+ /// The memory block location can be moved.
+ LF32_MOVEABLE = 0x00000004,
+ }
+
+ /// Used by HEAPLIST32
+ [PInvokeData("tlhelp32.h", MSDNShortId = "61e01d23-9f15-44c5-9f6d-45df4809ccad")]
+ [Flags]
+ public enum HEAPLIST32_FLAGS
+ {
+ /// Process's default heap
+ HF32_DEFAULT = 1,
+
+ /// Process's shared heap
+ HF32_SHARED = 2
+ }
+
+ /// Flags used by .
+ [PInvokeData("tlhelp32.h", MSDNShortId = "df643c25-7558-424c-b187-b3f86ba51358")]
+ public enum TH32CS : uint
+ {
+ /// Indicates that the snapshot handle is to be inheritable.
+ TH32CS_INHERIT = 0x80000000,
+
+ /// Includes all heaps of the process specified in th32ProcessID in the snapshot. To enumerate the heaps, see Heap32ListFirst.
+ TH32CS_SNAPHEAPLIST = 0x00000001,
+
+ ///
+ /// Includes all modules of the process specified in th32ProcessID in the snapshot. To enumerate the modules, see Module32First.
+ /// If the function fails with ERROR_BAD_LENGTH, retry the function until it succeeds.
+ ///
+ /// 64-bit Windows: Using this flag in a 32-bit process includes the 32-bit modules of the process specified in th32ProcessID,
+ /// while using it in a 64-bit process includes the 64-bit modules. To include the 32-bit modules of the process specified in
+ /// th32ProcessID from a 64-bit process, use the TH32CS_SNAPMODULE32 flag.
+ ///
+ ///
+ TH32CS_SNAPMODULE = 0x00000008,
+
+ ///
+ /// Includes all 32-bit modules of the process specified in th32ProcessID in the snapshot when called from a 64-bit process. This
+ /// flag can be combined with TH32CS_SNAPMODULE or TH32CS_SNAPALL. If the function fails with ERROR_BAD_LENGTH, retry the
+ /// function until it succeeds.
+ ///
+ TH32CS_SNAPMODULE32 = 0x00000010,
+
+ /// Includes all processes in the system in the snapshot. To enumerate the processes, see Process32First.
+ TH32CS_SNAPPROCESS = 0x00000002,
+
+ ///
+ /// Includes all threads in the system in the snapshot. To enumerate the threads, see Thread32First.
+ ///
+ /// To identify the threads that belong to a specific process, compare its process identifier to the th32OwnerProcessID member of
+ /// the THREADENTRY32 structure when enumerating the threads.
+ ///
+ ///
+ TH32CS_SNAPTHREAD = 0x00000004,
+
+ ///
+ /// Includes all processes and threads in the system, plus the heaps and modules of the process specified in th32ProcessID.
+ /// Equivalent to specifying the TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and TH32CS_SNAPTHREAD values
+ /// combined using an OR operation ('|').
+ ///
+ TH32CS_SNAPALL = (TH32CS_SNAPHEAPLIST | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD | TH32CS_SNAPMODULE),
+ }
+
+ ///
+ /// Takes a snapshot of the specified processes, as well as the heaps, modules, and threads used by these processes.
+ ///
+ ///
+ /// The portions of the system to be included in the snapshot. This parameter can be one or more of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// TH32CS_INHERIT 0x80000000
+ /// Indicates that the snapshot handle is to be inheritable.
+ ///
+ /// -
+ /// TH32CS_SNAPALL
+ ///
+ /// Includes all processes and threads in the system, plus the heaps and modules of the process specified in . Equivalent to
+ /// specifying the TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPPROCESS, and TH32CS_SNAPTHREAD values combined using an OR
+ /// operation ('|').
+ ///
+ ///
+ /// -
+ /// TH32CS_SNAPHEAPLIST 0x00000001
+ /// Includes all heaps of the process specified in in the snapshot. To enumerate the heaps, see Heap32ListFirst.
+ ///
+ /// -
+ /// TH32CS_SNAPMODULE 0x00000008
+ ///
+ /// Includes all modules of the process specified in in the snapshot. To enumerate the modules, see Module32First. If the function
+ /// fails with ERROR_BAD_LENGTH, retry the function until it succeeds. 64-bit Windows: Using this flag in a 32-bit process includes
+ /// the 32-bit modules of the process specified in , while using it in a 64-bit process includes the 64-bit modules. To include the
+ /// 32-bit modules of the process specified in from a 64-bit process, use the TH32CS_SNAPMODULE32 flag.
+ ///
+ ///
+ /// -
+ /// TH32CS_SNAPMODULE32 0x00000010
+ ///
+ /// Includes all 32-bit modules of the process specified in in the snapshot when called from a 64-bit process. This flag can be
+ /// combined with TH32CS_SNAPMODULE or TH32CS_SNAPALL. If the function fails with ERROR_BAD_LENGTH, retry the function until it succeeds.
+ ///
+ ///
+ /// -
+ /// TH32CS_SNAPPROCESS 0x00000002
+ /// Includes all processes in the system in the snapshot. To enumerate the processes, see Process32First.
+ ///
+ /// -
+ /// TH32CS_SNAPTHREAD 0x00000004
+ ///
+ /// Includes all threads in the system in the snapshot. To enumerate the threads, see Thread32First. To identify the threads that
+ /// belong to a specific process, compare its process identifier to the th32OwnerProcessID member of the THREADENTRY32 structure when
+ /// enumerating the threads.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The process identifier of the process to be included in the snapshot. This parameter can be zero to indicate the current process.
+ /// This parameter is used when the TH32CS_SNAPHEAPLIST, TH32CS_SNAPMODULE, TH32CS_SNAPMODULE32, or
+ /// TH32CS_SNAPALL value is specified. Otherwise, it is ignored and all processes are included in the snapshot.
+ ///
+ ///
+ /// If the specified process is the Idle process or one of the CSRSS processes, this function fails and the last error code is
+ /// ERROR_ACCESS_DENIED because their access restrictions prevent user-level code from opening them.
+ ///
+ ///
+ /// If the specified process is a 64-bit process and the caller is a 32-bit process, this function fails and the last error code is
+ /// ERROR_PARTIAL_COPY (299).
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns an open handle to the specified snapshot.
+ ///
+ /// If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError. Possible
+ /// error codes include ERROR_BAD_LENGTH.
+ ///
+ ///
+ ///
+ ///
+ /// The snapshot taken by this function is examined by the other tool help functions to provide their results. Access to the snapshot
+ /// is read only. The snapshot handle acts as an object handle and is subject to the same rules regarding which processes and threads
+ /// it is valid in.
+ ///
+ ///
+ /// To enumerate the heap or module states for all processes, specify TH32CS_SNAPALL and set to zero. Then, for each
+ /// additional process in the snapshot, call CreateToolhelp32Snapshot again, specifying its process identifier and the
+ /// TH32CS_SNAPHEAPLIST or TH32_SNAPMODULE value.
+ ///
+ ///
+ /// When taking snapshots that include heaps and modules for a process other than the current process, the
+ /// CreateToolhelp32Snapshot function can fail or return incorrect information for a variety of reasons. For example, if the
+ /// loader data table in the target process is corrupted or not initialized, or if the module list changes during the function call
+ /// as a result of DLLs being loaded or unloaded, the function might fail with ERROR_BAD_LENGTH or other error code. Ensure
+ /// that the target process was not started in a suspended state, and try calling the function again. If the function fails with
+ /// ERROR_BAD_LENGTH when called with TH32CS_SNAPMODULE or TH32CS_SNAPMODULE32, call the function again until it succeeds.
+ ///
+ ///
+ /// The TH32CS_SNAPMODULE and TH32CS_SNAPMODULE32 flags do not retrieve handles for modules that were loaded with the
+ /// LOAD_LIBRARY_AS_DATAFILE or similar flags. For more information, see LoadLibraryEx.
+ ///
+ /// To destroy the snapshot, use the CloseHandle function.
+ ///
+ /// Note that you can use the QueryFullProcessImageName function to retrieve the full name of an executable image for both 32- and
+ /// 64-bit processes from a 32-bit process.
+ ///
+ /// Examples
+ /// For an example, see Taking a Snapshot and Viewing Processes.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot HANDLE
+ // CreateToolhelp32Snapshot( DWORD dwFlags, DWORD th32ProcessID );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "df643c25-7558-424c-b187-b3f86ba51358")]
+ public static extern IntPtr CreateToolhelp32Snapshot(TH32CS dwFlags, uint th32ProcessID);
+
+ ///
+ /// Retrieves information about the first block of a heap that has been allocated by a process.
+ ///
+ ///
+ /// A pointer to a HEAPENTRY32 structure.
+ ///
+ ///
+ /// The identifier of the process context that owns the heap.
+ ///
+ ///
+ /// The identifier of the heap to be enumerated.
+ ///
+ ///
+ ///
+ /// Returns TRUE if information for the first heap block has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if the heap is invalid or empty.
+ ///
+ ///
+ ///
+ ///
+ /// The calling application must set the dwSize member of HEAPENTRY32 to the size, in bytes, of the structure.
+ /// Heap32First changes dwSize to the number of bytes written to the structure. This will never be greater than the
+ /// initial value of dwSize, but it may be smaller. If the value is smaller, do not rely on the values of any members whose
+ /// offsets are greater than this value.
+ ///
+ /// To access subsequent blocks of the same heap, use the Heap32Next function.
+ /// Examples
+ /// For an example, see Traversing the Heap List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-heap32first BOOL Heap32First( LPHEAPENTRY32 lphe, DWORD
+ // th32ProcessID, ULONG_PTR th32HeapID );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "79d01e3a-b11b-46b5-99d0-b445000288a7")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Heap32First(ref HEAPENTRY32 lphe, uint th32ProcessID, UIntPtr th32HeapID);
+
+ ///
+ /// Retrieves information about the first heap that has been allocated by a specified process.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a HEAPLIST32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the first entry of the heap list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function when no heap list exists or the snapshot does not
+ /// contain heap list information.
+ ///
+ ///
+ ///
+ ///
+ /// The calling application must set the dwSize member of HEAPLIST32 to the size, in bytes, of the structure.
+ /// Heap32ListFirst changes dwSize to the number of bytes written to the structure. This will never be greater than the
+ /// initial value of dwSize, but it may be smaller. If the value is smaller, do not rely on the values of any members whose
+ /// offsets are greater than this value.
+ ///
+ /// To retrieve information about other heaps in the heap list, use the Heap32ListNext function.
+ /// Examples
+ /// For an example, see Traversing the Heap List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-heap32listfirst BOOL Heap32ListFirst( HANDLE hSnapshot,
+ // LPHEAPLIST32 lphl );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "b9a2992b-0dc1-41c3-aa23-796def674831")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Heap32ListFirst(IntPtr hSnapshot, ref HEAPLIST32 lphl);
+
+ ///
+ /// Retrieves information about the next heap that has been allocated by a process.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a HEAPLIST32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the next entry of the heap list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function when no more entries in the heap list exist.
+ ///
+ ///
+ ///
+ /// To retrieve information about the first heap in a heap list, use the Heap32ListFirst function.
+ /// Examples
+ /// For an example, see Traversing the Heap List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-heap32listnext BOOL Heap32ListNext( HANDLE hSnapshot,
+ // LPHEAPLIST32 lphl );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "bb4d573c-a82f-48ac-be22-440d6a1d0c9c")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Heap32ListNext(IntPtr hSnapshot, ref HEAPLIST32 lphl);
+
+ ///
+ /// Retrieves information about the next block of a heap that has been allocated by a process.
+ ///
+ ///
+ /// A pointer to a HEAPENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if information about the next block in the heap has been copied to the buffer or FALSE otherwise. The
+ /// GetLastError function returns ERROR_NO_MORE_FILES when no more objects in the heap exist and ERROR_INVALID_DATA if
+ /// the heap appears to be corrupt or is modified during the walk in such a way that Heap32Next cannot continue.
+ ///
+ ///
+ ///
+ /// To retrieve information for the first block of a heap, use the Heap32First function.
+ ///
+ /// The Heap32Next function does not maintain a reference to the target process. If the target process dies, the system may
+ /// create a new process using the same process identifier. Therefore, the caller should maintain a reference to the target process
+ /// as long as it is using Heap32Next.
+ ///
+ /// Examples
+ /// For an example, see Traversing the Heap List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-heap32next BOOL Heap32Next( LPHEAPENTRY32 lphe );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "cc3becd0-edba-47cf-ac2d-26a5d98390e7")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Heap32Next(ref HEAPENTRY32 lphe);
+
+ ///
+ /// Retrieves information about the first module associated with a process.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a MODULEENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the first entry of the module list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no modules exist or the snapshot does not
+ /// contain module information.
+ ///
+ ///
+ ///
+ /// The calling application must set the dwSize member of MODULEENTRY32 to the size, in bytes, of the structure.
+ /// To retrieve information about other modules associated with the specified process, use the Module32Next function.
+ /// Examples
+ /// For an example, see Traversing the Module List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-module32first BOOL Module32First( HANDLE hSnapshot,
+ // LPMODULEENTRY32 lpme );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "bb41cab9-13a1-469d-bf76-68c172e982f6")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Module32First(IntPtr hSnapshot, out MODULEENTRY32 lpme);
+
+ ///
+ /// Retrieves information about the next module associated with a process or thread.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a MODULEENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the next entry of the module list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no more modules exist.
+ ///
+ ///
+ ///
+ /// To retrieve information about first module associated with a process, use the Module32First function.
+ /// Examples
+ /// For an example, see Traversing the Module List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-module32next BOOL Module32Next( HANDLE hSnapshot,
+ // LPMODULEENTRY32 lpme );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "88ec1af4-bae7-4cd7-b830-97a98fb337f4")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Module32Next(IntPtr hSnapshot, out MODULEENTRY32 lpme);
+
+ ///
+ /// Retrieves information about the first process encountered in a system snapshot.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ ///
+ /// A pointer to a PROCESSENTRY32 structure. It contains process information such as the name of the executable file, the process
+ /// identifier, and the process identifier of the parent process.
+ ///
+ ///
+ ///
+ ///
+ /// Returns TRUE if the first entry of the process list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no processes exist or the snapshot does not
+ /// contain process information.
+ ///
+ ///
+ ///
+ /// The calling application must set the dwSize member of PROCESSENTRY32 to the size, in bytes, of the structure.
+ /// To retrieve information about other processes recorded in the same snapshot, use the Process32Next function.
+ /// Examples
+ /// For an example, see Taking a Snapshot and Viewing Processes.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-process32first BOOL Process32First( HANDLE hSnapshot,
+ // LPPROCESSENTRY32 lppe );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "097790e8-30c2-4b00-9256-fa26e2ceb893")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
+
+ ///
+ /// Retrieves information about the next process recorded in a system snapshot.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a PROCESSENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the next entry of the process list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no processes exist or the snapshot does not
+ /// contain process information.
+ ///
+ ///
+ ///
+ /// To retrieve information about the first process recorded in a snapshot, use the Process32First function.
+ /// Examples
+ /// For an example, see Taking a Snapshot and Viewing Processes.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-process32next BOOL Process32Next( HANDLE hSnapshot,
+ // LPPROCESSENTRY32 lppe );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "843a95fd-27ae-4215-83d0-82fc402b82b6")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe);
+
+ ///
+ /// Retrieves information about the first thread of any process encountered in a system snapshot.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a THREADENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the first entry of the thread list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no threads exist or the snapshot does not
+ /// contain thread information.
+ ///
+ ///
+ ///
+ ///
+ /// The calling application must set the dwSize member of THREADENTRY32 to the size, in bytes, of the structure.
+ /// Thread32First changes dwSize to the number of bytes written to the structure. This will never be greater than the
+ /// initial value of dwSize, but it may be smaller. If the value is smaller, do not rely on the values of any members whose
+ /// offsets are greater than this value.
+ ///
+ /// To retrieve information about other threads recorded in the same snapshot, use the Thread32Next function.
+ /// Examples
+ /// For an example, see Traversing the Thread List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-thread32first BOOL Thread32First( HANDLE hSnapshot,
+ // LPTHREADENTRY32 lpte );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "d4cb7a19-850e-43b5-bda5-91be48382d2a")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Thread32First(IntPtr hSnapshot, ref THREADENTRY32 lpte);
+
+ ///
+ /// Retrieves information about the next thread of any process encountered in the system memory snapshot.
+ ///
+ ///
+ /// A handle to the snapshot returned from a previous call to the CreateToolhelp32Snapshot function.
+ ///
+ ///
+ /// A pointer to a THREADENTRY32 structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the next entry of the thread list has been copied to the buffer or FALSE otherwise. The
+ /// ERROR_NO_MORE_FILES error value is returned by the GetLastError function if no threads exist or the snapshot does not
+ /// contain thread information.
+ ///
+ ///
+ ///
+ /// To retrieve information about the first thread recorded in a snapshot, use the Thread32First function.
+ /// Examples
+ /// For an example, see Traversing the Thread List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-thread32next BOOL Thread32Next( HANDLE hSnapshot,
+ // LPTHREADENTRY32 lpte );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "5efe514e-626c-4138-97a0-bdad217c424f")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Thread32Next(IntPtr hSnapshot, ref THREADENTRY32 lpte);
+
+ ///
+ /// Copies memory allocated to another process into an application-supplied buffer.
+ ///
+ ///
+ ///
+ /// The identifier of the process whose memory is being copied. This parameter can be zero to copy the memory of the current process.
+ ///
+ ///
+ ///
+ ///
+ /// The base address in the specified process to read. Before transferring any data, the system verifies that all data in the base
+ /// address and memory of the specified size is accessible for read access. If this is the case, the function proceeds. Otherwise,
+ /// the function fails.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the contents of the address space of the specified process.
+ ///
+ ///
+ /// The number of bytes to read from the specified process.
+ ///
+ ///
+ /// The number of bytes copied to the specified buffer. If this parameter is NULL, it is ignored.
+ ///
+ ///
+ /// Returns TRUE if successful.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/nf-tlhelp32-toolhelp32readprocessmemory BOOL
+ // Toolhelp32ReadProcessMemory( DWORD th32ProcessID, LPCVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T cbRead, SIZE_T
+ // *lpNumberOfBytesRead );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("tlhelp32.h", MSDNShortId = "e579b813-32ef-481d-8dc6-f959ec9b6bad")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Toolhelp32ReadProcessMemory(uint th32ProcessID, IntPtr lpBaseAddress, IntPtr lpBuffer, SizeT cbRead, out SizeT lpNumberOfBytesRead);
+
+ ///
+ /// Describes one entry (block) of a heap that is being examined.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/ns-tlhelp32-tagheapentry32 typedef struct tagHEAPENTRY32 { SIZE_T
+ // dwSize; HANDLE hHandle; ULONG_PTR dwAddress; SIZE_T dwBlockSize; DWORD dwFlags; DWORD dwLockCount; DWORD dwResvd; DWORD
+ // th32ProcessID; ULONG_PTR th32HeapID; } HEAPENTRY32;
+ [PInvokeData("tlhelp32.h", MSDNShortId = "c5f1dc66-d44f-4491-b0b7-961b163d0f1f")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct HEAPENTRY32
+ {
+ ///
+ ///
+ /// The size of the structure, in bytes. Before calling the Heap32First function, set this member to . If you do not initialize
+ /// dwSize, Heap32First fails.
+ ///
+ ///
+ public SizeT dwSize;
+
+ ///
+ /// A handle to the heap block.
+ ///
+ public IntPtr hHandle;
+
+ ///
+ /// The linear address of the start of the block.
+ ///
+ public UIntPtr dwAddress;
+
+ ///
+ /// The size of the heap block, in bytes.
+ ///
+ public SizeT dwBlockSize;
+
+ ///
+ /// This member can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// LF32_FIXED
+ /// The memory block has a fixed (unmovable) location.
+ ///
+ /// -
+ /// LF32_FREE
+ /// The memory block is not used.
+ ///
+ /// -
+ /// LF32_MOVEABLE
+ /// The memory block location can be moved.
+ ///
+ ///
+ ///
+ public uint dwFlags;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public uint dwLockCount;
+
+ ///
+ /// Reserved; do not use or alter.
+ ///
+ public uint dwResvd;
+
+ ///
+ /// The identifier of the process that uses the heap.
+ ///
+ public uint th32ProcessID;
+
+ ///
+ /// The heap identifier. This is not a handle, and has meaning only to the tool help functions.
+ ///
+ public UIntPtr th32HeapID;
+ }
+
+ ///
+ /// Describes an entry from a list that enumerates the heaps used by a specified process.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/ns-tlhelp32-tagheaplist32 typedef struct tagHEAPLIST32 { SIZE_T
+ // dwSize; DWORD th32ProcessID; ULONG_PTR th32HeapID; DWORD dwFlags; } HEAPLIST32;
+ [PInvokeData("tlhelp32.h", MSDNShortId = "61e01d23-9f15-44c5-9f6d-45df4809ccad")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct HEAPLIST32
+ {
+ ///
+ ///
+ /// The size of the structure, in bytes. Before calling the Heap32ListFirst function, set this member to . If you do not
+ /// initialize dwSize, Heap32ListFirst will fail.
+ ///
+ ///
+ public SizeT dwSize;
+
+ ///
+ /// The identifier of the process to be examined.
+ ///
+ public uint th32ProcessID;
+
+ ///
+ /// The heap identifier. This is not a handle, and has meaning only to the tool help functions.
+ ///
+ public UIntPtr th32HeapID;
+
+ ///
+ /// This member can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// HF32_DEFAULT
+ /// Process's default heap
+ ///
+ ///
+ ///
+ public HEAPLIST32_FLAGS dwFlags;
+ }
+
+ ///
+ /// Describes an entry from a list of the modules belonging to the specified process.
+ ///
+ ///
+ /// The modBaseAddr and hModule members are valid only in the context of the process specified by th32ProcessID.
+ /// Examples
+ /// For an example that uses MODULEENTRY32, see Traversing the Module List.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/ns-tlhelp32-tagmoduleentry32 typedef struct tagMODULEENTRY32 { DWORD
+ // dwSize; DWORD th32ModuleID; DWORD th32ProcessID; DWORD GlblcntUsage; DWORD ProccntUsage; BYTE *modBaseAddr; DWORD modBaseSize;
+ // HMODULE hModule; char szModule[MAX_MODULE_NAME32 + 1]; char szExePath[MAX_PATH]; } MODULEENTRY32;
+ [PInvokeData("tlhelp32.h", MSDNShortId = "305fab35-625c-42e3-a434-e2513e4c8870")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct MODULEENTRY32
+ {
+ private const int MAX_MODULE_NAME32 = 255;
+
+ ///
+ ///
+ /// The size of the structure, in bytes. Before calling the Module32First function, set this member to . If you do not initialize
+ /// dwSize, Module32First fails.
+ ///
+ ///
+ public uint dwSize;
+
+ ///
+ /// This member is no longer used, and is always set to one.
+ ///
+ public uint th32ModuleID;
+
+ ///
+ /// The identifier of the process whose modules are to be examined.
+ ///
+ public uint th32ProcessID;
+
+ ///
+ /// The load count of the module, which is not generally meaningful, and usually equal to 0xFFFF.
+ ///
+ public uint GlblcntUsage;
+
+ ///
+ /// The load count of the module (same as GlblcntUsage), which is not generally meaningful, and usually equal to 0xFFFF.
+ ///
+ public uint ProccntUsage;
+
+ ///
+ /// The base address of the module in the context of the owning process.
+ ///
+ public IntPtr modBaseAddr;
+
+ ///
+ /// The size of the module, in bytes.
+ ///
+ public uint modBaseSize;
+
+ ///
+ /// A handle to the module in the context of the owning process.
+ ///
+ public IntPtr hModule;
+
+ ///
+ /// The module name.
+ ///
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_MODULE_NAME32 + 1)]
+ public string szModule;
+
+ ///
+ /// The module path.
+ ///
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
+ public string szExePath;
+ }
+
+ ///
+ /// Describes an entry from a list of the processes residing in the system address space when a snapshot was taken.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/ns-tlhelp32-tagprocessentry32 typedef struct tagPROCESSENTRY32 {
+ // DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; ULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; DWORD cntThreads; DWORD
+ // th32ParentProcessID; LONG pcPriClassBase; DWORD dwFlags; CHAR szExeFile[MAX_PATH]; } PROCESSENTRY32;
+ [PInvokeData("tlhelp32.h", MSDNShortId = "9e2f7345-52bf-4bfc-9761-90b0b374c727")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct PROCESSENTRY32
+ {
+ ///
+ ///
+ /// The size of the structure, in bytes. Before calling the Process32First function, set this member to . If you do not
+ /// initialize dwSize, Process32First fails.
+ ///
+ ///
+ public uint dwSize;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public uint cntUsage;
+
+ ///
+ /// The process identifier.
+ ///
+ public uint th32ProcessID;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public UIntPtr th32DefaultHeapID;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public uint th32ModuleID;
+
+ ///
+ /// The number of execution threads started by the process.
+ ///
+ public uint cntThreads;
+
+ ///
+ /// The identifier of the process that created this process (its parent process).
+ ///
+ public uint th32ParentProcessID;
+
+ ///
+ /// The base priority of any threads created by this process.
+ ///
+ public int pcPriClassBase;
+
+ ///
+ /// This member is no longer used, and is always set to zero.
+ ///
+ public uint dwFlags;
+
+ ///
+ ///
+ /// The name of the executable file for the process. To retrieve the full path to the executable file, call the Module32First
+ /// function and check the szExePath member of the MODULEENTRY32 structure that is returned. However, if the calling
+ /// process is a 32-bit process, you must call the QueryFullProcessImageName function to retrieve the full path of the executable
+ /// file for a 64-bit process.
+ ///
+ ///
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)]
+ public string szExeFile;
+ }
+
+ ///
+ /// Describes an entry from a list of the threads executing in the system when a snapshot was taken.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/tlhelp32/ns-tlhelp32-tagthreadentry32 typedef struct tagTHREADENTRY32 { DWORD
+ // dwSize; DWORD cntUsage; DWORD th32ThreadID; DWORD th32OwnerProcessID; LONG tpBasePri; LONG tpDeltaPri; DWORD dwFlags; } THREADENTRY32;
+ [PInvokeData("tlhelp32.h", MSDNShortId = "923feca1-8807-4752-8a5a-79075688aabd")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct THREADENTRY32
+ {
+ ///
+ ///
+ /// The size of the structure, in bytes. Before calling the Thread32First function, set this member to . If you do not initialize
+ /// dwSize, Thread32First fails.
+ ///
+ ///
+ public uint dwSize;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public uint cntUsage;
+
+ ///
+ /// The thread identifier, compatible with the thread identifier returned by the CreateProcess function.
+ ///
+ public uint th32ThreadID;
+
+ ///
+ /// The identifier of the process that created the thread.
+ ///
+ public uint th32OwnerProcessID;
+
+ ///
+ ///
+ /// The kernel base priority level assigned to the thread. The priority is a number from 0 to 31, with 0 representing the lowest
+ /// possible thread priority. For more information, see KeQueryPriorityThread.
+ ///
+ ///
+ public int tpBasePri;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public int tpDeltaPri;
+
+ ///
+ /// This member is no longer used and is always set to zero.
+ ///
+ public uint dwFlags;
+ }
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/Vanara.PInvoke.Kernel32.csproj b/PInvoke/Kernel32/Vanara.PInvoke.Kernel32.csproj
index 849c619a..b8c5b70e 100644
--- a/PInvoke/Kernel32/Vanara.PInvoke.Kernel32.csproj
+++ b/PInvoke/Kernel32/Vanara.PInvoke.Kernel32.csproj
@@ -25,10 +25,10 @@
Currently implements:
Functions
-AcquireSRWLockExclusive, AcquireSRWLockShared, ActivateActCtx, AddAtomA, AddAtomW, AddConsoleAliasA, AddConsoleAliasW, AddDllDirectory, AddRefActCtx, AddSIDToBoundaryDescriptor, AddVectoredContinueHandler, AddVectoredExceptionHandler, AllocateUserPhysicalPages, AllocateUserPhysicalPagesNuma, AllocConsole, ApplicationRecoveryFinished, ApplicationRecoveryInProgress, AreFileApisANSI, AssignProcessToJobObject, AttachConsole, BackupRead, BackupSeek, BackupWrite, Beep, BeginUpdateResourceA, BeginUpdateResourceW, BindIoCompletionCallback, BuildCommDCBA, BuildCommDCBAndTimeoutsA, BuildCommDCBAndTimeoutsW, BuildCommDCBW, CallbackMayRunLong, CallEnclave, CallNamedPipeA, CallNamedPipeW, CancelIo, CancelIoEx, CancelSynchronousIo, CancelThreadpoolIo, CancelWaitableTimer, ChangeTimerQueueTimer, CheckNameLegalDOS8Dot3A, CheckNameLegalDOS8Dot3W, CheckRemoteDebuggerPresent, ClearCommBreak, ClearCommError, CloseHandle, ClosePrivateNamespace, CloseThreadpool, CloseThreadpoolCleanupGroup, CloseThreadpoolCleanupGroupMembers, CloseThreadpoolIo, CloseThreadpoolTimer, CloseThreadpoolWait, CloseThreadpoolWork, CommConfigDialogA, CommConfigDialogW, CompareFileTime, CompareObjectHandles, CompareStringA, CompareStringEx, CompareStringOrdinal, CompareStringW, ConnectNamedPipe, ContinueDebugEvent, ConvertAuxiliaryCounterToPerformanceCounter, ConvertDefaultLocale, ConvertFiberToThread, ConvertPerformanceCounterToAuxiliaryCounter, ConvertThreadToFiber, CopyFileA, CopyFileExA, CopyFileExW, CopyFileW, CreateActCtxA, CreateActCtxW, CreateBoundaryDescriptorA, CreateBoundaryDescriptorW, CreateConsoleScreenBuffer, CreateDirectoryA, CreateDirectoryExA, CreateDirectoryExW, CreateDirectoryW, CreateEnclave, CreateEventA, CreateEventExA, CreateEventExW, CreateEventW, CreateFiber, CreateFiberEx, CreateFile2, CreateFileA, CreateFileMappingA, CreateFileMappingFromApp, CreateFileMappingNumaA, CreateFileMappingNumaW, CreateFileMappingW, CreateFileW, CreateHardLinkA, CreateHardLinkW, CreateIoCompletionPort, CreateJobObjectA, CreateJobObjectW, CreateMailslotA, CreateMailslotW, CreateMemoryResourceNotification, CreateMutexA, CreateMutexExA, CreateMutexExW, CreateMutexW, CreateNamedPipeA, CreateNamedPipeW, CreatePipe, CreatePrivateNamespaceA, CreatePrivateNamespaceW, CreateProcessA, CreateProcessAsUserA, CreateProcessAsUserW, CreateProcessW, CreateRemoteThread, CreateRemoteThreadEx, CreateSemaphoreA, CreateSemaphoreExA, CreateSemaphoreExW, CreateSemaphoreW, CreateSymbolicLinkA, CreateSymbolicLinkW, CreateTapePartition, CreateThread, CreateThreadpool, CreateThreadpoolCleanupGroup, CreateThreadpoolIo, CreateThreadpoolTimer, CreateThreadpoolWait, CreateThreadpoolWork, CreateTimerQueue, CreateTimerQueueTimer, CreateWaitableTimerA, CreateWaitableTimerExA, CreateWaitableTimerExW, CreateWaitableTimerW, DeactivateActCtx, DebugActiveProcess, DebugActiveProcessStop, DebugBreak, DebugBreakProcess, DebugSetProcessKillOnExit, DecodePointer, DecodeRemotePointer, DecodeSystemPointer, DefineDosDeviceA, DefineDosDeviceW, DeleteAtom, DeleteBoundaryDescriptor, DeleteCriticalSection, DeleteEnclave, DeleteFiber, DeleteFileA, DeleteFileW, DeleteProcThreadAttributeList, DeleteSynchronizationBarrier, DeleteTimerQueue, DeleteTimerQueueEx, DeleteTimerQueueTimer, DeleteVolumeMountPointA, DeleteVolumeMountPointW, DeviceIoControl, DisableThreadLibraryCalls, DisassociateCurrentThreadFromCallback, DiscardVirtualMemory, DisconnectNamedPipe, DnsHostnameToComputerNameA, DnsHostnameToComputerNameExW, DnsHostnameToComputerNameW, DosDateTimeToFileTime, DuplicateHandle, EncodePointer, EncodeRemotePointer, EncodeSystemPointer, EndUpdateResourceA, EndUpdateResourceW, EnterCriticalSection, EnterSynchronizationBarrier, EnumCalendarInfoA, EnumCalendarInfoExA, EnumCalendarInfoExEx, EnumCalendarInfoExW, EnumCalendarInfoW, EnumDateFormatsA, EnumDateFormatsExA, EnumDateFormatsExEx, EnumDateFormatsExW, EnumDateFormatsW, EnumDynamicTimeZoneInformation, EnumLanguageGroupLocalesA, EnumLanguageGroupLocalesW, EnumResourceLanguagesExW, EnumResourceLanguagesW, EnumResourceNamesExW, EnumResourceNamesW, EnumResourceTypesExA, EnumResourceTypesExW, EnumResourceTypesW, EnumSystemCodePagesA, EnumSystemCodePagesW, EnumSystemFirmwareTables, EnumSystemGeoID, EnumSystemGeoNames, EnumSystemLanguageGroupsA, EnumSystemLanguageGroupsW, EnumSystemLocalesA, EnumSystemLocalesEx, EnumSystemLocalesW, EnumTimeFormatsA, EnumTimeFormatsEx, EnumTimeFormatsW, EnumUILanguagesA, EnumUILanguagesW, EraseTape, EscapeCommFunction, ExitProcess, ExitThread, ExpandEnvironmentStringsA, ExpandEnvironmentStringsW, FatalAppExitA, FatalAppExitW, FatalExit, FileTimeToDosDateTime, FileTimeToLocalFileTime, FileTimeToSystemTime, FillConsoleOutputAttribute, FillConsoleOutputCharacterA, FillConsoleOutputCharacterW, FindActCtxSectionGuid, FindActCtxSectionStringA, FindActCtxSectionStringW, FindAtomA, FindAtomW, FindClose, FindCloseChangeNotification, FindFirstChangeNotificationA, FindFirstChangeNotificationW, FindFirstFileA, FindFirstFileExA, FindFirstFileExW, FindFirstFileNameW, FindFirstFileW, FindFirstStreamW, FindFirstVolumeA, FindFirstVolumeMountPointA, FindFirstVolumeMountPointW, FindFirstVolumeW, FindNextChangeNotification, FindNextFileA, FindNextFileNameW, FindNextFileW, FindNextStreamW, FindNextVolumeA, FindNextVolumeMountPointA, FindNextVolumeMountPointW, FindNextVolumeW, FindNLSString, FindNLSStringEx, FindResourceExW, FindResourceW, FindStringOrdinal, FindVolumeClose, FindVolumeMountPointClose, FlsAlloc, FlsFree, FlsGetValue, FlsSetValue, FlushConsoleInputBuffer, FlushFileBuffers, FlushInstructionCache, FlushProcessWriteBuffers, FlushViewOfFile, FoldStringA, FoldStringW, FormatMessageA, FormatMessageW, FreeConsole, FreeEnvironmentStringsA, FreeEnvironmentStringsW, FreeLibrary, FreeLibraryAndExitThread, FreeLibraryWhenCallbackReturns, FreeMemoryJobObject, FreeResource, FreeUserPhysicalPages, GenerateConsoleCtrlEvent, GetACP, GetAppContainerNamedObjectPath, GetApplicationRecoveryCallback, GetApplicationRestartSettings, GetAtomNameA, GetAtomNameW, GetCalendarInfoA, GetCalendarInfoEx, GetCalendarInfoW, GetCommandLineA, GetCommandLineW, GetCommConfig, GetCommMask, GetCommModemStatus, GetCommProperties, GetCommState, GetCommTimeouts, GetCompressedFileSizeA, GetCompressedFileSizeW, GetComputerNameA, GetComputerNameExA, GetComputerNameExW, GetComputerNameW, GetConsoleAliasA, GetConsoleAliasesA, GetConsoleAliasesLengthA, GetConsoleAliasesLengthW, GetConsoleAliasesW, GetConsoleAliasExesA, GetConsoleAliasExesLengthA, GetConsoleAliasExesLengthW, GetConsoleAliasExesW, GetConsoleAliasW, GetConsoleCP, GetConsoleCursorInfo, GetConsoleDisplayMode, GetConsoleFontSize, GetConsoleHistoryInfo, GetConsoleMode, GetConsoleOriginalTitleA, GetConsoleOriginalTitleW, GetConsoleOutputCP, GetConsoleProcessList, GetConsoleScreenBufferInfo, GetConsoleScreenBufferInfoEx, GetConsoleSelectionInfo, GetConsoleTitleA, GetConsoleTitleW, GetConsoleWindow, GetCPInfo, GetCPInfoExW, GetCurrencyFormatA, GetCurrencyFormatEx, GetCurrencyFormatW, GetCurrentActCtx, GetCurrentConsoleFont, GetCurrentConsoleFontEx, GetCurrentDirectoryA, GetCurrentDirectoryW, GetCurrentProcess, GetCurrentProcessId, GetCurrentProcessorNumberEx, GetCurrentThread, GetCurrentThreadId, GetCurrentThreadStackLimits, GetDateFormatA, GetDateFormatEx, GetDateFormatW, GetDefaultCommConfigA, GetDefaultCommConfigW, GetDevicePowerState, GetDiskFreeSpaceA, GetDiskFreeSpaceExA, GetDiskFreeSpaceExW, GetDiskFreeSpaceW, GetDllDirectoryA, GetDllDirectoryW, GetDriveTypeA, GetDriveTypeW, GetDurationFormat, GetDurationFormatEx, GetDynamicTimeZoneInformation, GetEnvironmentStringsA, GetEnvironmentStringsW, GetEnvironmentVariableA, GetEnvironmentVariableW, GetErrorMode, GetExitCodeProcess, GetExitCodeThread, GetFileAttributesA, GetFileAttributesExA, GetFileAttributesExW, GetFileAttributesW, GetFileInformationByHandle, GetFileMUIInfo, GetFileMUIPath, GetFileSize, GetFileSizeEx, GetFileTime, GetFileType, GetFinalPathNameByHandleA, GetFinalPathNameByHandleW, GetFirmwareEnvironmentVariableA, GetFirmwareEnvironmentVariableW, GetFullPathNameA, GetFullPathNameW, GetGeoInfoA, GetGeoInfoEx, GetGeoInfoW, GetHandleInformation, GetIntegratedDisplaySize, GetLargePageMinimum, GetLargestConsoleWindowSize, GetLastError, GetLocaleInfoA, GetLocaleInfoEx, GetLocaleInfoW, GetLocalTime, GetLogicalDrives, GetLogicalDriveStringsA, GetLogicalDriveStringsW, GetLogicalProcessorInformation, GetLogicalProcessorInformationEx, GetLongPathNameA, GetLongPathNameW, GetMailslotInfo, GetMemoryErrorHandlingCapabilities, GetModuleFileNameA, GetModuleFileNameW, GetNamedPipeClientComputerNameA, GetNamedPipeClientComputerNameW, GetNamedPipeHandleStateA, GetNamedPipeHandleStateW, GetNamedPipeInfo, GetNativeSystemInfo, GetNLSVersion, GetNLSVersionEx, GetNumaAvailableMemoryNode, GetNumaHighestNodeNumber, GetNumaNodeProcessorMask, GetNumaNodeProcessorMaskEx, GetNumaProcessorNode, GetNumaProximityNodeEx, GetNumberFormatA, GetNumberFormatEx, GetNumberFormatW, GetNumberOfConsoleInputEvents, GetNumberOfConsoleMouseButtons, GetOEMCP, GetOsManufacturingMode, GetOsSafeBootMode, GetOverlappedResult, GetOverlappedResultEx, GetPhysicallyInstalledSystemMemory, GetPriorityClass, GetPrivateProfileIntA, GetPrivateProfileIntW, GetPrivateProfileSectionA, GetPrivateProfileSectionNamesA, GetPrivateProfileSectionNamesW, GetPrivateProfileSectionW, GetPrivateProfileStringA, GetPrivateProfileStringW, GetPrivateProfileStructA, GetPrivateProfileStructW, GetProcAddress, GetProcessAffinityMask, GetProcessDefaultCpuSets, GetProcessGroupAffinity, GetProcessHandleCount, GetProcessHeap, GetProcessHeaps, GetProcessId, GetProcessIdOfThread, GetProcessInformation, GetProcessIoCounters, GetProcessMitigationPolicy, GetProcessorSystemCycleTime, GetProcessPreferredUILanguages, GetProcessPriorityBoost, GetProcessShutdownParameters, GetProcessTimes, GetProcessVersion, GetProcessWorkingSetSize, GetProcessWorkingSetSizeEx, GetProductInfo, GetProfileIntA, GetProfileIntW, GetProfileSectionA, GetProfileSectionW, GetProfileStringA, GetProfileStringW, GetQueuedCompletionStatus, GetQueuedCompletionStatusEx, GetShortPathNameA, GetShortPathNameW, GetStartupInfoA, GetStartupInfoW, GetStdHandle, GetStringScripts, GetStringTypeA, GetStringTypeExA, GetStringTypeExW, GetStringTypeW, GetSystemCpuSetInformation, GetSystemDefaultLangID, GetSystemDefaultLCID, GetSystemDefaultLocaleName, GetSystemDefaultUILanguage, GetSystemDirectoryA, GetSystemDirectoryW, GetSystemFileCacheSize, GetSystemFirmwareTable, GetSystemInfo, GetSystemPowerStatus, GetSystemPreferredUILanguages, GetSystemRegistryQuota, GetSystemTime, GetSystemTimeAdjustment, GetSystemTimeAsFileTime, GetSystemTimePreciseAsFileTime, GetSystemTimes, GetSystemWindowsDirectoryA, GetSystemWindowsDirectoryW, GetSystemWow64Directory2A, GetSystemWow64Directory2W, GetSystemWow64DirectoryA, GetSystemWow64DirectoryW, GetTapeParameters, GetTapePosition, GetTapeStatus, GetTempFileNameA, GetTempFileNameW, GetTempPathA, GetTempPathW, GetThreadContext, GetThreadDescription, GetThreadErrorMode, GetThreadGroupAffinity, GetThreadId, GetThreadIdealProcessorEx, GetThreadInformation, GetThreadIOPendingFlag, GetThreadLocale, GetThreadPreferredUILanguages, GetThreadPriority, GetThreadPriorityBoost, GetThreadSelectedCpuSets, GetThreadSelectorEntry, GetThreadTimes, GetThreadUILanguage, GetTickCount, GetTickCount64, GetTimeFormatA, GetTimeFormatEx, GetTimeFormatW, GetTimeZoneInformation, GetTimeZoneInformationForYear, GetUILanguageInfo, GetUserDefaultGeoName, GetUserDefaultLangID, GetUserDefaultLCID, GetUserDefaultLocaleName, GetUserDefaultUILanguage, GetUserGeoID, GetUserPreferredUILanguages, GetVersion, GetVersionExA, GetVersionExW, GetVolumeInformationA, GetVolumeInformationByHandleW, GetVolumeInformationW, GetVolumeNameForVolumeMountPointA, GetVolumeNameForVolumeMountPointW, GetVolumePathNameA, GetVolumePathNamesForVolumeNameA, GetVolumePathNamesForVolumeNameW, GetVolumePathNameW, GetWindowsDirectoryA, GetWindowsDirectoryW, GetWriteWatch, GlobalAddAtomA, GlobalAddAtomExA, GlobalAddAtomExW, GlobalAddAtomW, GlobalAlloc, GlobalDeleteAtom, GlobalFindAtomA, GlobalFindAtomW, GlobalFlags, GlobalFree, GlobalGetAtomNameA, GlobalGetAtomNameW, GlobalHandle, GlobalLock, GlobalMemoryStatus, GlobalMemoryStatusEx, GlobalReAlloc, GlobalSize, GlobalUnlock, HeapAlloc, HeapCompact, HeapCreate, HeapDestroy, HeapFree, HeapLock, HeapQueryInformation, HeapReAlloc, HeapSetInformation, HeapSize, HeapSummary, HeapUnlock, HeapValidate, HeapWalk, IdnToAscii, IdnToNameprepUnicode, IdnToUnicode, InitAtomTable, InitializeConditionVariable, InitializeCriticalSection, InitializeCriticalSectionAndSpinCount, InitializeCriticalSectionEx, InitializeEnclave, InitializeProcThreadAttributeList, InitializeSRWLock, InitializeSynchronizationBarrier, InitOnceBeginInitialize, InitOnceComplete, InitOnceExecuteOnce, InitOnceInitialize, InstallELAMCertificateInfo, InterlockedCompareExchange, InterlockedDecrement, InterlockedExchange, InterlockedExchangeAdd, InterlockedIncrement, IsBadCodePtr, IsBadReadPtr, IsBadStringPtrA, IsBadStringPtrW, IsBadWritePtr, IsDBCSLeadByte, IsDBCSLeadByteEx, IsDebuggerPresent, IsEnclaveTypeSupported, IsNLSDefinedString, IsNormalizedString, IsProcessCritical, IsProcessInJob, IsProcessorFeaturePresent, IsSystemResumeAutomatic, IsThreadAFiber, IsThreadpoolTimerSet, IsValidCodePage, IsValidLanguageGroup, IsValidLocale, IsValidLocaleName, IsValidNLSVersion, IsWow64GuestMachineSupported, IsWow64Process, IsWow64Process2, LCIDToLocaleName, LCMapStringA, LCMapStringEx, LCMapStringW, LeaveCriticalSection, LeaveCriticalSectionWhenCallbackReturns, LoadEnclaveData, LoadEnclaveImageA, LoadEnclaveImageW, LoadLibraryA, LoadLibraryExA, LoadLibraryExW, LoadLibraryW, LoadModule, LoadResource, LocalAlloc, LocaleNameToLCID, LocalFileTimeToFileTime, LocalFlags, LocalFree, LocalHandle, LocalLock, LocalReAlloc, LocalSize, LocalUnlock, LockFile, LockFileEx, LockResource, lstrlenA, lstrlenW, MapUserPhysicalPages, MapUserPhysicalPagesScatter, MapViewOfFile, MapViewOfFileEx, MapViewOfFileFromApp, MapViewOfFileNuma2, MoveFileA, MoveFileExA, MoveFileExW, MoveFileW, MoveFileWithProgressA, MoveFileWithProgressW, MulDiv, MultiByteToWideChar, NeedCurrentDirectoryForExePathA, NeedCurrentDirectoryForExePathW, NormalizeString, OfferVirtualMemory, OpenEventA, OpenEventW, OpenFile, OpenFileMappingA, OpenFileMappingFromApp, OpenFileMappingW, OpenJobObjectA, OpenJobObjectW, OpenMutexA, OpenMutexW, OpenPrivateNamespaceA, OpenPrivateNamespaceW, OpenProcess, OpenSemaphoreA, OpenSemaphoreW, OpenThread, OpenWaitableTimerA, OpenWaitableTimerW, OutputDebugStringA, OutputDebugStringW, PeekConsoleInputA, PeekConsoleInputW, PeekNamedPipe, PostQueuedCompletionStatus, PrefetchVirtualMemory, PrepareTape, ProcessIdToSessionId, PulseEvent, PurgeComm, QueryActCtxSettingsW, QueryActCtxW, QueryAuxiliaryCounterFrequency, QueryDosDeviceA, QueryDosDeviceW, QueryIdleProcessorCycleTime, QueryIdleProcessorCycleTimeEx, QueryInformationJobObject, QueryInterruptTime, QueryInterruptTimePrecise, QueryIoRateControlInformationJobObject, QueryMemoryResourceNotification, QueryPerformanceCounter, QueryPerformanceFrequency, QueryProcessAffinityUpdateMode, QueryProcessCycleTime, QueryProtectedPolicy, QueryThreadCycleTime, QueryThreadpoolStackInformation, QueryUnbiasedInterruptTime, QueryUnbiasedInterruptTimePrecise, QueryVirtualMemoryInformation, QueueUserAPC, QueueUserWorkItem, RaiseException, RaiseFailFastException, ReadConsoleA, ReadConsoleInputA, ReadConsoleInputW, ReadConsoleOutputA, ReadConsoleOutputAttribute, ReadConsoleOutputCharacterA, ReadConsoleOutputCharacterW, ReadConsoleOutputW, ReadConsoleW, ReadDirectoryChangesW, ReadFile, ReadFileEx, ReadFileScatter, ReadProcessMemory, ReclaimVirtualMemory, RegisterApplicationRecoveryCallback, RegisterApplicationRestart, RegisterBadMemoryNotification, RegisterWaitForSingleObject, ReleaseActCtx, ReleaseMutex, ReleaseMutexWhenCallbackReturns, ReleaseSemaphore, ReleaseSemaphoreWhenCallbackReturns, ReleaseSRWLockExclusive, ReleaseSRWLockShared, RemoveDirectoryA, RemoveDirectoryW, RemoveDllDirectory, RemoveVectoredContinueHandler, RemoveVectoredExceptionHandler, ReplaceFileA, ReplaceFileW, RequestWakeupLatency, ResetEvent, ResetWriteWatch, ResolveLocaleName, RestoreLastError, ResumeThread, RtlAddFunctionTable, RtlCaptureContext, RtlDeleteFunctionTable, RtlInstallFunctionTableCallback, RtlLookupFunctionEntry, RtlMoveMemory, RtlPcToFileHeader, RtlRestoreContext, RtlUnwind, RtlUnwindEx, RtlZeroMemory, ScrollConsoleScreenBufferA, ScrollConsoleScreenBufferW, SearchPathA, SearchPathW, SetCalendarInfoA, SetCalendarInfoW, SetCommBreak, SetCommConfig, SetCommMask, SetCommState, SetCommTimeouts, SetComputerNameA, SetComputerNameEx2W, SetComputerNameExA, SetComputerNameExW, SetComputerNameW, SetConsoleActiveScreenBuffer, SetConsoleCP, SetConsoleCtrlHandler, SetConsoleCursorInfo, SetConsoleCursorPosition, SetConsoleDisplayMode, SetConsoleHistoryInfo, SetConsoleMode, SetConsoleOutputCP, SetConsoleScreenBufferInfoEx, SetConsoleScreenBufferSize, SetConsoleTextAttribute, SetConsoleTitleA, SetConsoleTitleW, SetConsoleWindowInfo, SetCriticalSectionSpinCount, SetCurrentConsoleFontEx, SetCurrentDirectoryA, SetCurrentDirectoryW, SetDefaultCommConfigA, SetDefaultCommConfigW, SetDefaultDllDirectories, SetDllDirectoryA, SetDllDirectoryW, SetDynamicTimeZoneInformation, SetEndOfFile, SetEnvironmentStringsW, SetEnvironmentVariableA, SetEnvironmentVariableW, SetErrorMode, SetEvent, SetEventWhenCallbackReturns, SetFileApisToANSI, SetFileApisToOEM, SetFileAttributesA, SetFileAttributesW, SetFileInformationByHandle, SetFileIoOverlappedRange, SetFilePointer, SetFilePointerEx, SetFileShortNameA, SetFileShortNameW, SetFileTime, SetFileValidData, SetFirmwareEnvironmentVariableA, SetFirmwareEnvironmentVariableW, SetHandleInformation, SetInformationJobObject, SetIoRateControlInformationJobObject, SetLastError, SetLocaleInfoA, SetLocaleInfoW, SetLocalTime, SetMailslotInfo, SetNamedPipeHandleState, SetPriorityClass, SetProcessAffinityMask, SetProcessAffinityUpdateMode, SetProcessDefaultCpuSets, SetProcessInformation, SetProcessMitigationPolicy, SetProcessPreferredUILanguages, SetProcessPriorityBoost, SetProcessShutdownParameters, SetProcessValidCallTargets, SetProcessWorkingSetSize, SetProcessWorkingSetSizeEx, SetProtectedPolicy, SetStdHandle, SetStdHandleEx, SetSystemFileCacheSize, SetSystemPowerState, SetSystemTime, SetSystemTimeAdjustment, SetTapeParameters, SetTapePosition, SetThreadAffinityMask, SetThreadContext, SetThreadDescription, SetThreadErrorMode, SetThreadExecutionState, SetThreadGroupAffinity, SetThreadIdealProcessor, SetThreadIdealProcessorEx, SetThreadInformation, SetThreadLocale, SetThreadpoolStackInformation, SetThreadpoolThreadMaximum, SetThreadpoolThreadMinimum, SetThreadpoolTimer, SetThreadpoolTimerEx, SetThreadpoolWait, SetThreadpoolWaitEx, SetThreadPreferredUILanguages, SetThreadPriority, SetThreadPriorityBoost, SetThreadSelectedCpuSets, SetThreadStackGuarantee, SetThreadUILanguage, SetTimeZoneInformation, SetUnhandledExceptionFilter, SetupComm, SetUserGeoID, SetUserGeoName, SetVolumeLabelA, SetVolumeLabelW, SetVolumeMountPointA, SetVolumeMountPointW, SetWaitableTimer, SetWaitableTimerEx, SignalObjectAndWait, SizeofResource, Sleep, SleepConditionVariableCS, SleepConditionVariableSRW, SleepEx, StartThreadpoolIo, SubmitThreadpoolWork, SuspendThread, SwitchToFiber, SwitchToThread, SystemTimeToFileTime, SystemTimeToTzSpecificLocalTime, SystemTimeToTzSpecificLocalTimeEx, TerminateEnclave, TerminateJobObject, TerminateProcess, TerminateProcessOnMemoryExhaustion, TerminateThread, TlsAlloc, TlsFree, TlsGetValue, TlsSetValue, TransactNamedPipe, TransmitCommChar, TryAcquireSRWLockExclusive, TryAcquireSRWLockShared, TryEnterCriticalSection, TrySubmitThreadpoolCallback, TzSpecificLocalTimeToSystemTime, TzSpecificLocalTimeToSystemTimeEx, UnhandledExceptionFilter, UnlockFile, UnlockFileEx, UnmapViewOfFile, UnmapViewOfFile2, UnmapViewOfFileEx, UnregisterApplicationRecoveryCallback, UnregisterApplicationRestart, UnregisterBadMemoryNotification, UnregisterWait, UnregisterWaitEx, UpdateProcThreadAttribute, UpdateResourceA, UpdateResourceW, VerifyScripts, VerifyVersionInfoA, VerifyVersionInfoW, VerSetConditionMask, VirtualAlloc, VirtualAllocEx, VirtualAllocExNuma, VirtualAllocFromApp, VirtualFree, VirtualFreeEx, VirtualLock, VirtualProtect, VirtualProtectEx, VirtualProtectFromApp, VirtualQuery, VirtualQueryEx, VirtualUnlock, WaitCommEvent, WaitForDebugEvent, WaitForDebugEventEx, WaitForMultipleObjects, WaitForMultipleObjectsEx, WaitForSingleObject, WaitForSingleObjectEx, WaitForThreadpoolIoCallbacks, WaitForThreadpoolTimerCallbacks, WaitForThreadpoolWaitCallbacks, WaitForThreadpoolWorkCallbacks, WaitNamedPipeA, WaitNamedPipeW, WaitOnAddress, WakeAllConditionVariable, WakeByAddressAll, WakeByAddressSingle, WakeConditionVariable, WideCharToMultiByte, WinExec, Wow64DisableWow64FsRedirection, Wow64RevertWow64FsRedirection, Wow64SetThreadDefaultGuestMachine, WriteConsoleA, WriteConsoleInputA, WriteConsoleInputW, WriteConsoleOutputA, WriteConsoleOutputAttribute, WriteConsoleOutputCharacterA, WriteConsoleOutputCharacterW, WriteConsoleOutputW, WriteConsoleW, WriteFile, WriteFileEx, WriteFileGather, WritePrivateProfileSectionA, WritePrivateProfileSectionW, WritePrivateProfileStringA, WritePrivateProfileStringW, WritePrivateProfileStructA, WritePrivateProfileStructW, WriteProcessMemory, WriteProfileSectionA, WriteProfileSectionW, WriteProfileStringA, WriteProfileStringW, WriteTapemark, WTSGetActiveConsoleSessionId, ZombifyActCtx
+AcquireSRWLockExclusive, AcquireSRWLockShared, ActivateActCtx, AddAtomA, AddAtomW, AddConsoleAliasA, AddConsoleAliasW, AddDllDirectory, AddIntegrityLabelToBoundaryDescriptor, AddLocalAlternateComputerNameA, AddLocalAlternateComputerNameW, AddRefActCtx, AddSecureMemoryCacheCallback, AddSIDToBoundaryDescriptor, AddVectoredContinueHandler, AddVectoredExceptionHandler, AdjustCalendarDate, AllocateUserPhysicalPages, AllocateUserPhysicalPagesNuma, AllocConsole, ApplicationRecoveryFinished, ApplicationRecoveryInProgress, AppPolicyGetCreateFileAccess, AppPolicyGetProcessTerminationMethod, AppPolicyGetShowDeveloperDiagnostic, AppPolicyGetThreadInitializationType, AreFileApisANSI, AssignProcessToJobObject, AttachConsole, BackupRead, BackupSeek, BackupWrite, BaseFlushAppcompatCache, Beep, BeginUpdateResourceA, BeginUpdateResourceW, BindIoCompletionCallback, BuildCommDCBA, BuildCommDCBAndTimeoutsA, BuildCommDCBAndTimeoutsW, BuildCommDCBW, CallbackMayRunLong, CallEnclave, CallNamedPipeA, CallNamedPipeW, CancelIo, CancelIoEx, CancelSynchronousIo, CancelThreadpoolIo, CancelWaitableTimer, CeipIsOptedIn, ChangeTimerQueueTimer, CheckNameLegalDOS8Dot3A, CheckNameLegalDOS8Dot3W, CheckRemoteDebuggerPresent, ClearCommBreak, ClearCommError, CloseHandle, ClosePackageInfo, ClosePrivateNamespace, CloseThreadpool, CloseThreadpoolCleanupGroup, CloseThreadpoolCleanupGroupMembers, CloseThreadpoolIo, CloseThreadpoolTimer, CloseThreadpoolWait, CloseThreadpoolWork, CommConfigDialogA, CommConfigDialogW, CompareFileTime, CompareObjectHandles, CompareStringA, CompareStringEx, CompareStringOrdinal, CompareStringW, ConnectNamedPipe, ContinueDebugEvent, ConvertAuxiliaryCounterToPerformanceCounter, ConvertCalDateTimeToSystemTime, ConvertDefaultLocale, ConvertFiberToThread, ConvertPerformanceCounterToAuxiliaryCounter, ConvertSystemTimeToCalDateTime, ConvertThreadToFiber, ConvertThreadToFiberEx, CopyContext, CopyFile2, CopyFileA, CopyFileExA, CopyFileExW, CopyFileTransactedA, CopyFileTransactedW, CopyFileW, CreateActCtxA, CreateActCtxW, CreateBoundaryDescriptorA, CreateBoundaryDescriptorW, CreateConsoleScreenBuffer, CreateDirectoryA, CreateDirectoryExA, CreateDirectoryExW, CreateDirectoryTransactedA, CreateDirectoryTransactedW, CreateDirectoryW, CreateEnclave, CreateEventA, CreateEventExA, CreateEventExW, CreateEventW, CreateFiber, CreateFiberEx, CreateFile2, CreateFileA, CreateFileMappingA, CreateFileMappingFromApp, CreateFileMappingNumaA, CreateFileMappingNumaW, CreateFileMappingW, CreateFileTransactedA, CreateFileTransactedW, CreateFileW, CreateHardLinkA, CreateHardLinkTransactedA, CreateHardLinkTransactedW, CreateHardLinkW, CreateIoCompletionPort, CreateJobObjectA, CreateJobObjectW, CreateMailslotA, CreateMailslotW, CreateMemoryResourceNotification, CreateMutexA, CreateMutexExA, CreateMutexExW, CreateMutexW, CreateNamedPipeA, CreateNamedPipeW, CreatePipe, CreatePrivateNamespaceA, CreatePrivateNamespaceW, CreateProcessA, CreateProcessAsUserA, CreateProcessAsUserW, CreateProcessW, CreateRemoteThread, CreateRemoteThreadEx, CreateSemaphoreA, CreateSemaphoreExA, CreateSemaphoreExW, CreateSemaphoreW, CreateSymbolicLinkA, CreateSymbolicLinkW, CreateTapePartition, CreateThread, CreateThreadpool, CreateThreadpoolCleanupGroup, CreateThreadpoolIo, CreateThreadpoolTimer, CreateThreadpoolWait, CreateThreadpoolWork, CreateTimerQueue, CreateTimerQueueTimer, CreateToolhelp32Snapshot, CreateUmsCompletionList, CreateUmsThreadContext, CreateWaitableTimerA, CreateWaitableTimerExA, CreateWaitableTimerExW, CreateWaitableTimerW, DeactivateActCtx, DebugActiveProcess, DebugActiveProcessStop, DebugBreak, DebugBreakProcess, DebugSetProcessKillOnExit, DecodePointer, DecodeRemotePointer, DecodeSystemPointer, DefineDosDeviceA, DefineDosDeviceW, DeleteAtom, DeleteBoundaryDescriptor, DeleteCriticalSection, DeleteEnclave, DeleteFiber, DeleteFileA, DeleteFileTransactedA, DeleteFileTransactedW, DeleteFileW, DeleteProcThreadAttributeList, DeleteSynchronizationBarrier, DeleteTimerQueue, DeleteTimerQueueEx, DeleteTimerQueueTimer, DeleteUmsCompletionList, DeleteUmsThreadContext, DeleteVolumeMountPointA, DeleteVolumeMountPointW, DequeueUmsCompletionListItems, DeviceIoControl, DisableThreadLibraryCalls, DisableThreadProfiling, DisassociateCurrentThreadFromCallback, DiscardVirtualMemory, DisconnectNamedPipe, DnsHostnameToComputerNameA, DnsHostnameToComputerNameExW, DnsHostnameToComputerNameW, DosDateTimeToFileTime, DuplicateHandle, EmptyWorkingSet, EnableThreadProfiling, EncodePointer, EncodeRemotePointer, EncodeSystemPointer, EndUpdateResourceA, EndUpdateResourceW, EnterCriticalSection, EnterSynchronizationBarrier, EnterUmsSchedulingMode, EnumCalendarInfoA, EnumCalendarInfoExA, EnumCalendarInfoExEx, EnumCalendarInfoExW, EnumCalendarInfoW, EnumDateFormatsA, EnumDateFormatsExA, EnumDateFormatsExEx, EnumDateFormatsExW, EnumDateFormatsW, EnumDeviceDrivers, EnumDynamicTimeZoneInformation, EnumLanguageGroupLocalesA, EnumLanguageGroupLocalesW, EnumPageFiles, EnumProcesses, EnumProcessModules, EnumProcessModulesEx, EnumResourceLanguagesExW, EnumResourceLanguagesW, EnumResourceNamesExW, EnumResourceNamesW, EnumResourceTypesExA, EnumResourceTypesExW, EnumResourceTypesW, EnumSystemCodePagesA, EnumSystemCodePagesW, EnumSystemFirmwareTables, EnumSystemGeoID, EnumSystemGeoNames, EnumSystemLanguageGroupsA, EnumSystemLanguageGroupsW, EnumSystemLocalesA, EnumSystemLocalesEx, EnumSystemLocalesW, EnumTimeFormatsA, EnumTimeFormatsEx, EnumTimeFormatsW, EnumUILanguagesA, EnumUILanguagesW, EraseTape, EscapeCommFunction, ExecuteUmsThread, ExitProcess, ExitThread, ExpandEnvironmentStringsA, ExpandEnvironmentStringsW, FatalAppExitA, FatalAppExitW, FatalExit, FileTimeToDosDateTime, FileTimeToLocalFileTime, FileTimeToSystemTime, FillConsoleOutputAttribute, FillConsoleOutputCharacterA, FillConsoleOutputCharacterW, FindActCtxSectionGuid, FindActCtxSectionStringA, FindActCtxSectionStringW, FindAtomA, FindAtomW, FindClose, FindCloseChangeNotification, FindFirstChangeNotificationA, FindFirstChangeNotificationW, FindFirstFileA, FindFirstFileExA, FindFirstFileExW, FindFirstFileNameTransactedW, FindFirstFileNameW, FindFirstFileTransactedA, FindFirstFileTransactedW, FindFirstFileW, FindFirstStreamTransactedW, FindFirstStreamW, FindFirstVolumeA, FindFirstVolumeMountPointA, FindFirstVolumeMountPointW, FindFirstVolumeW, FindNextChangeNotification, FindNextFileA, FindNextFileNameW, FindNextFileW, FindNextStreamW, FindNextVolumeA, FindNextVolumeMountPointA, FindNextVolumeMountPointW, FindNextVolumeW, FindNLSString, FindNLSStringEx, FindPackagesByPackageFamily, FindResourceExW, FindResourceW, FindStringOrdinal, FindVolumeClose, FindVolumeMountPointClose, FlsAlloc, FlsFree, FlsGetValue, FlsSetValue, FlushConsoleInputBuffer, FlushFileBuffers, FlushInstructionCache, FlushProcessWriteBuffers, FlushViewOfFile, FoldStringA, FoldStringW, FormatApplicationUserModelId, FormatMessageA, FormatMessageW, FreeConsole, FreeEnvironmentStringsA, FreeEnvironmentStringsW, FreeLibrary, FreeLibraryAndExitThread, FreeLibraryWhenCallbackReturns, FreeMemoryJobObject, FreeResource, FreeUserPhysicalPages, GenerateConsoleCtrlEvent, GetACP, GetActiveProcessorCount, GetActiveProcessorGroupCount, GetAppContainerNamedObjectPath, GetApplicationRecoveryCallback, GetApplicationRestartSettings, GetApplicationUserModelId, GetApplicationUserModelIdFromToken, GetAtomNameA, GetAtomNameW, GetBinaryTypeA, GetBinaryTypeW, GetCalendarDateFormatEx, GetCalendarInfoA, GetCalendarInfoEx, GetCalendarInfoW, GetCalendarSupportedDateRange, GetCommandLineA, GetCommandLineW, GetCommConfig, GetCommMask, GetCommModemStatus, GetCommProperties, GetCommState, GetCommTimeouts, GetComPlusPackageInstallStatus, GetCompressedFileSizeA, GetCompressedFileSizeW, GetComputerNameA, GetComputerNameExA, GetComputerNameExW, GetComputerNameW, GetConsoleAliasA, GetConsoleAliasesA, GetConsoleAliasesLengthA, GetConsoleAliasesLengthW, GetConsoleAliasesW, GetConsoleAliasExesA, GetConsoleAliasExesLengthA, GetConsoleAliasExesLengthW, GetConsoleAliasExesW, GetConsoleAliasW, GetConsoleCP, GetConsoleCursorInfo, GetConsoleDisplayMode, GetConsoleFontSize, GetConsoleHistoryInfo, GetConsoleMode, GetConsoleOriginalTitleA, GetConsoleOriginalTitleW, GetConsoleOutputCP, GetConsoleProcessList, GetConsoleScreenBufferInfo, GetConsoleScreenBufferInfoEx, GetConsoleSelectionInfo, GetConsoleTitleA, GetConsoleTitleW, GetConsoleWindow, GetCPInfo, GetCPInfoExW, GetCurrencyFormatA, GetCurrencyFormatEx, GetCurrencyFormatW, GetCurrentActCtx, GetCurrentApplicationUserModelId, GetCurrentConsoleFont, GetCurrentConsoleFontEx, GetCurrentDirectoryA, GetCurrentDirectoryW, GetCurrentPackageFamilyName, GetCurrentPackageFullName, GetCurrentPackageId, GetCurrentPackageInfo, GetCurrentPackagePath, GetCurrentProcess, GetCurrentProcessId, GetCurrentProcessorNumber, GetCurrentProcessorNumberEx, GetCurrentThread, GetCurrentThreadId, GetCurrentThreadStackLimits, GetCurrentUmsThread, GetDateFormatA, GetDateFormatEx, GetDateFormatW, GetDefaultCommConfigA, GetDefaultCommConfigW, GetDeviceDriverBaseNameA, GetDeviceDriverBaseNameW, GetDeviceDriverFileNameA, GetDeviceDriverFileNameW, GetDevicePowerState, GetDiskFreeSpaceA, GetDiskFreeSpaceExA, GetDiskFreeSpaceExW, GetDiskFreeSpaceW, GetDllDirectoryA, GetDllDirectoryW, GetDriveTypeA, GetDriveTypeW, GetDurationFormat, GetDurationFormatEx, GetDynamicTimeZoneInformation, GetDynamicTimeZoneInformationEffectiveYears, GetEnabledXStateFeatures, GetEnvironmentStringsA, GetEnvironmentStringsW, GetEnvironmentVariableA, GetEnvironmentVariableW, GetErrorMode, GetExitCodeProcess, GetExitCodeThread, GetFileAttributesA, GetFileAttributesExA, GetFileAttributesExW, GetFileAttributesTransactedA, GetFileAttributesTransactedW, GetFileAttributesW, GetFileBandwidthReservation, GetFileInformationByHandle, GetFileInformationByHandleEx, GetFileMUIInfo, GetFileMUIPath, GetFileSize, GetFileSizeEx, GetFileTime, GetFileType, GetFinalPathNameByHandleA, GetFinalPathNameByHandleW, GetFirmwareEnvironmentVariableA, GetFirmwareEnvironmentVariableExA, GetFirmwareEnvironmentVariableExW, GetFirmwareEnvironmentVariableW, GetFullPathNameA, GetFullPathNameTransactedA, GetFullPathNameTransactedW, GetFullPathNameW, GetGeoInfoA, GetGeoInfoEx, GetGeoInfoW, GetHandleInformation, GetIntegratedDisplaySize, GetLargePageMinimum, GetLargestConsoleWindowSize, GetLastError, GetLocaleInfoA, GetLocaleInfoEx, GetLocaleInfoW, GetLocalTime, GetLogicalDrives, GetLogicalDriveStringsA, GetLogicalDriveStringsW, GetLogicalProcessorInformation, GetLogicalProcessorInformationEx, GetLongPathNameA, GetLongPathNameTransactedA, GetLongPathNameTransactedW, GetLongPathNameW, GetMailslotInfo, GetMappedFileNameA, GetMappedFileNameW, GetMaximumProcessorCount, GetMaximumProcessorGroupCount, GetMemoryErrorHandlingCapabilities, GetModuleBaseNameA, GetModuleBaseNameW, GetModuleFileNameA, GetModuleFileNameW, GetModuleHandleA, GetModuleHandleExA, GetModuleHandleExW, GetModuleHandleW, GetModuleInformation, GetNamedPipeClientComputerNameA, GetNamedPipeClientComputerNameW, GetNamedPipeClientProcessId, GetNamedPipeClientSessionId, GetNamedPipeHandleStateA, GetNamedPipeHandleStateW, GetNamedPipeInfo, GetNamedPipeServerProcessId, GetNamedPipeServerSessionId, GetNativeSystemInfo, GetNLSVersion, GetNLSVersionEx, GetNumaAvailableMemoryNode, GetNumaAvailableMemoryNodeEx, GetNumaHighestNodeNumber, GetNumaNodeNumberFromHandle, GetNumaNodeProcessorMask, GetNumaNodeProcessorMaskEx, GetNumaProcessorNode, GetNumaProcessorNodeEx, GetNumaProximityNode, GetNumaProximityNodeEx, GetNumberFormatA, GetNumberFormatEx, GetNumberFormatW, GetNumberOfConsoleInputEvents, GetNumberOfConsoleMouseButtons, GetOEMCP, GetOsManufacturingMode, GetOsSafeBootMode, GetOverlappedResult, GetOverlappedResultEx, GetPackageApplicationIds, GetPackageFamilyName, GetPackageFamilyNameFromToken, GetPackageFullNameFromToken, GetPackageInfo, GetPackagePath, GetPackagePathByFullName, GetPackagesByPackageFamily, GetPerformanceInfo, GetPhysicallyInstalledSystemMemory, GetPriorityClass, GetPrivateProfileIntA, GetPrivateProfileIntW, GetPrivateProfileSectionA, GetPrivateProfileSectionNamesA, GetPrivateProfileSectionNamesW, GetPrivateProfileSectionW, GetPrivateProfileStringA, GetPrivateProfileStringW, GetPrivateProfileStructA, GetPrivateProfileStructW, GetProcAddress, GetProcessAffinityMask, GetProcessDefaultCpuSets, GetProcessDEPPolicy, GetProcessGroupAffinity, GetProcessHandleCount, GetProcessHeap, GetProcessHeaps, GetProcessId, GetProcessIdOfThread, GetProcessImageFileNameA, GetProcessImageFileNameW, GetProcessInformation, GetProcessIoCounters, GetProcessMemoryInfoA, GetProcessMemoryInfoW, GetProcessMitigationPolicy, GetProcessorSystemCycleTime, GetProcessPreferredUILanguages, GetProcessPriorityBoost, GetProcessShutdownParameters, GetProcessTimes, GetProcessVersion, GetProcessWorkingSetSize, GetProcessWorkingSetSizeEx, GetProductInfo, GetProfileIntA, GetProfileIntW, GetProfileSectionA, GetProfileSectionW, GetProfileStringA, GetProfileStringW, GetQueuedCompletionStatus, GetQueuedCompletionStatusEx, GetShortPathNameA, GetShortPathNameW, GetStagedPackageOrigin, GetStagedPackagePathByFullName, GetStartupInfoA, GetStartupInfoW, GetStdHandle, GetStringScripts, GetStringTypeA, GetStringTypeExA, GetStringTypeExW, GetStringTypeW, GetSystemCpuSetInformation, GetSystemDefaultLangID, GetSystemDefaultLCID, GetSystemDefaultLocaleName, GetSystemDefaultUILanguage, GetSystemDEPPolicy, GetSystemDirectoryA, GetSystemDirectoryW, GetSystemFileCacheSize, GetSystemFirmwareTable, GetSystemInfo, GetSystemPowerStatus, GetSystemPreferredUILanguages, GetSystemRegistryQuota, GetSystemTime, GetSystemTimeAdjustment, GetSystemTimeAsFileTime, GetSystemTimePreciseAsFileTime, GetSystemTimes, GetSystemWindowsDirectoryA, GetSystemWindowsDirectoryW, GetSystemWow64Directory2A, GetSystemWow64Directory2W, GetSystemWow64DirectoryA, GetSystemWow64DirectoryW, GetTapeParameters, GetTapePosition, GetTapeStatus, GetTempFileNameA, GetTempFileNameW, GetTempPathA, GetTempPathW, GetThreadContext, GetThreadDescription, GetThreadErrorMode, GetThreadGroupAffinity, GetThreadId, GetThreadIdealProcessorEx, GetThreadInformation, GetThreadIOPendingFlag, GetThreadLocale, GetThreadPreferredUILanguages, GetThreadPriority, GetThreadPriorityBoost, GetThreadSelectedCpuSets, GetThreadSelectorEntry, GetThreadTimes, GetThreadUILanguage, GetTickCount, GetTickCount64, GetTimeFormatA, GetTimeFormatEx, GetTimeFormatW, GetTimeZoneInformation, GetTimeZoneInformationForYear, GetUILanguageInfo, GetUmsCompletionListEvent, GetUmsSystemThreadInformation, GetUserDefaultGeoName, GetUserDefaultLangID, GetUserDefaultLCID, GetUserDefaultLocaleName, GetUserDefaultUILanguage, GetUserGeoID, GetUserPreferredUILanguages, GetVersion, GetVersionExA, GetVersionExW, GetVolumeInformationA, GetVolumeInformationByHandleW, GetVolumeInformationW, GetVolumeNameForVolumeMountPointA, GetVolumeNameForVolumeMountPointW, GetVolumePathNameA, GetVolumePathNamesForVolumeNameA, GetVolumePathNamesForVolumeNameW, GetVolumePathNameW, GetWindowsDirectoryA, GetWindowsDirectoryW, GetWriteWatch, GetWsChanges, GetWsChangesExA, GetWsChangesExW, GetXStateFeaturesMask, GlobalAddAtomA, GlobalAddAtomExA, GlobalAddAtomExW, GlobalAddAtomW, GlobalAlloc, GlobalDeleteAtom, GlobalFindAtomA, GlobalFindAtomW, GlobalFlags, GlobalFree, GlobalGetAtomNameA, GlobalGetAtomNameW, GlobalHandle, GlobalLock, GlobalMemoryStatus, GlobalMemoryStatusEx, GlobalReAlloc, GlobalSize, GlobalUnlock, Heap32First, Heap32ListFirst, Heap32ListNext, Heap32Next, HeapAlloc, HeapCompact, HeapCreate, HeapDestroy, HeapFree, HeapLock, HeapQueryInformation, HeapReAlloc, HeapSetInformation, HeapSize, HeapSummary, HeapUnlock, HeapValidate, HeapWalk, IdnToAscii, IdnToNameprepUnicode, IdnToUnicode, InitAtomTable, InitializeConditionVariable, InitializeContext, InitializeCriticalSection, InitializeCriticalSectionAndSpinCount, InitializeCriticalSectionEx, InitializeEnclave, InitializeProcessForWsWatchA, InitializeProcessForWsWatchW, InitializeProcThreadAttributeList, InitializeSListHead, InitializeSRWLock, InitializeSynchronizationBarrier, InitOnceBeginInitialize, InitOnceComplete, InitOnceExecuteOnce, InitOnceInitialize, InstallELAMCertificateInfo, InterlockedCompareExchange, InterlockedDecrement, InterlockedExchange, InterlockedExchangeAdd, InterlockedFlushSList, InterlockedIncrement, InterlockedPopEntrySList, InterlockedPushEntrySList, InterlockedPushListSList, InterlockedPushListSListEx, IsBadCodePtr, IsBadReadPtr, IsBadStringPtrA, IsBadStringPtrW, IsBadWritePtr, IsDBCSLeadByte, IsDBCSLeadByteEx, IsDebuggerPresent, IsEnclaveTypeSupported, IsNativeVhdBoot, IsNLSDefinedString, IsNormalizedString, IsProcessCritical, IsProcessInJob, IsProcessorFeaturePresent, IsSystemResumeAutomatic, IsThreadAFiber, IsThreadpoolTimerSet, IsValidCodePage, IsValidLanguageGroup, IsValidLocale, IsValidLocaleName, IsValidNLSVersion, IsWow64GuestMachineSupported, IsWow64Process, IsWow64Process2, LCIDToLocaleName, LCMapStringA, LCMapStringEx, LCMapStringW, LeaveCriticalSection, LeaveCriticalSectionWhenCallbackReturns, LoadEnclaveData, LoadEnclaveImageA, LoadEnclaveImageW, LoadLibraryA, LoadLibraryExA, LoadLibraryExW, LoadLibraryW, LoadModule, LoadPackagedLibrary, LoadResource, LoadStringByReference, LocalAlloc, LocaleNameToLCID, LocalFileTimeToFileTime, LocalFlags, LocalFree, LocalHandle, LocalLock, LocalReAlloc, LocalSize, LocalUnlock, LocateXStateFeature, LockFile, LockFileEx, LockResource, lstrcmpA, lstrcmpiA, lstrcmpiW, lstrcmpW, lstrcpynA, lstrcpynW, lstrlenA, lstrlenW, MapUserPhysicalPages, MapUserPhysicalPagesScatter, MapViewOfFile, MapViewOfFileEx, MapViewOfFileExNuma, MapViewOfFileFromApp, MapViewOfFileNuma2, Module32First, Module32NextA, Module32NextW, MoveFileA, MoveFileExA, MoveFileExW, MoveFileTransactedAA, MoveFileTransactedAW, MoveFileW, MoveFileWithProgressA, MoveFileWithProgressW, MulDiv, MultiByteToWideChar, NeedCurrentDirectoryForExePathA, NeedCurrentDirectoryForExePathW, NormalizeString, OfferVirtualMemory, OpenEventA, OpenEventW, OpenFile, OpenFileById, OpenFileMappingA, OpenFileMappingFromApp, OpenFileMappingW, OpenJobObjectA, OpenJobObjectW, OpenMutexA, OpenMutexW, OpenPackageInfoByFullName, OpenPrivateNamespaceA, OpenPrivateNamespaceW, OpenProcess, OpenSemaphoreA, OpenSemaphoreW, OpenThread, OpenWaitableTimerA, OpenWaitableTimerW, OutputDebugStringA, OutputDebugStringW, PackageFamilyNameFromFullName, PackageFamilyNameFromId, PackageFullNameFromId, PackageIdFromFullName, PackageNameAndPublisherIdFromFamilyName, ParseApplicationUserModelId, PeekConsoleInputA, PeekConsoleInputW, PeekNamedPipe, PostQueuedCompletionStatus, PowerClearRequest, PowerCreateRequest, PowerSetRequest, PrefetchVirtualMemory, PrepareTape, Process32FirstA, Process32FirstW, Process32NextA, Process32NextW, ProcessIdToSessionId, PssCaptureSnapshot, PssDuplicateSnapshot, PssFreeSnapshot, PssQuerySnapshot, PssWalkMarkerCreate, PssWalkMarkerFree, PssWalkMarkerGetPosition, PssWalkMarkerSeekToBeginning, PssWalkMarkerSetPosition, PssWalkSnapshot, PulseEvent, PurgeComm, QueryActCtxSettingsW, QueryActCtxW, QueryAuxiliaryCounterFrequency, QueryDepthSList, QueryDosDeviceA, QueryDosDeviceW, QueryFullProcessImageNameA, QueryFullProcessImageNameW, QueryIdleProcessorCycleTime, QueryIdleProcessorCycleTimeEx, QueryInformationJobObject, QueryInterruptTime, QueryInterruptTimePrecise, QueryIoRateControlInformationJobObject, QueryMemoryResourceNotification, QueryOptionalDelayLoadedAPI, QueryPerformanceCounter, QueryPerformanceFrequency, QueryProcessAffinityUpdateMode, QueryProcessCycleTime, QueryProtectedPolicy, QueryThreadCycleTime, QueryThreadpoolStackInformation, QueryThreadProfiling, QueryUmsThreadInformation, QueryUnbiasedInterruptTime, QueryUnbiasedInterruptTimePrecise, QueryVirtualMemoryInformation, QueryWorkingSet, QueryWorkingSetEx, QueueUserAPC, QueueUserWorkItem, RaiseException, RaiseFailFastException, ReadConsoleA, ReadConsoleInputA, ReadConsoleInputW, ReadConsoleOutputA, ReadConsoleOutputAttribute, ReadConsoleOutputCharacterA, ReadConsoleOutputCharacterW, ReadConsoleOutputW, ReadConsoleW, ReadDirectoryChangesW, ReadFile, ReadFileEx, ReadFileScatter, ReadProcessMemory, ReadThreadProfilingData, ReclaimVirtualMemory, RegisterApplicationRecoveryCallback, RegisterApplicationRestart, RegisterBadMemoryNotification, RegisterWaitForSingleObject, ReleaseActCtx, ReleaseMutex, ReleaseMutexWhenCallbackReturns, ReleaseSemaphore, ReleaseSemaphoreWhenCallbackReturns, ReleaseSRWLockExclusive, ReleaseSRWLockShared, RemoveDirectoryA, RemoveDirectoryTransactedA, RemoveDirectoryTransactedW, RemoveDirectoryW, RemoveDllDirectory, RemoveSecureMemoryCacheCallback, RemoveVectoredContinueHandler, RemoveVectoredExceptionHandler, ReOpenFile, ReplaceFileA, ReplaceFileW, RequestWakeupLatency, ResetEvent, ResetWriteWatch, ResolveLocaleName, RestoreLastError, ResumeThread, RtlAddFunctionTable, RtlCaptureContext, RtlDeleteFunctionTable, RtlInstallFunctionTableCallback, RtlLookupFunctionEntry, RtlMoveMemory, RtlPcToFileHeader, RtlRestoreContext, RtlUnwind, RtlUnwindEx, RtlZeroMemory, ScrollConsoleScreenBufferA, ScrollConsoleScreenBufferW, SearchPathA, SearchPathW, SetCalendarInfoA, SetCalendarInfoW, SetCommBreak, SetCommConfig, SetCommMask, SetCommState, SetCommTimeouts, SetComputerNameA, SetComputerNameEx2W, SetComputerNameExA, SetComputerNameExW, SetComputerNameW, SetConsoleActiveScreenBuffer, SetConsoleCP, SetConsoleCtrlHandler, SetConsoleCursorInfo, SetConsoleCursorPosition, SetConsoleDisplayMode, SetConsoleHistoryInfo, SetConsoleMode, SetConsoleOutputCP, SetConsoleScreenBufferInfoEx, SetConsoleScreenBufferSize, SetConsoleTextAttribute, SetConsoleTitleA, SetConsoleTitleW, SetConsoleWindowInfo, SetCriticalSectionSpinCount, SetCurrentConsoleFontEx, SetCurrentDirectoryA, SetCurrentDirectoryW, SetDefaultCommConfigA, SetDefaultCommConfigW, SetDefaultDllDirectories, SetDllDirectoryA, SetDllDirectoryW, SetDynamicTimeZoneInformation, SetEndOfFile, SetEnvironmentStringsW, SetEnvironmentVariableA, SetEnvironmentVariableW, SetErrorMode, SetEvent, SetEventWhenCallbackReturns, SetFileApisToANSI, SetFileApisToOEM, SetFileAttributesA, SetFileAttributesTransactedA, SetFileAttributesTransactedW, SetFileAttributesW, SetFileBandwidthReservation, SetFileCompletionNotificationModes, SetFileInformationByHandle, SetFileIoOverlappedRange, SetFilePointer, SetFilePointerEx, SetFileShortNameA, SetFileShortNameW, SetFileTime, SetFileValidData, SetFirmwareEnvironmentVariableA, SetFirmwareEnvironmentVariableExA, SetFirmwareEnvironmentVariableExW, SetFirmwareEnvironmentVariableW, SetHandleInformation, SetInformationJobObject, SetIoRateControlInformationJobObject, SetLastError, SetLocaleInfoA, SetLocaleInfoW, SetLocalTime, SetMailslotInfo, SetNamedPipeHandleState, SetPriorityClass, SetProcessAffinityMask, SetProcessAffinityUpdateMode, SetProcessDefaultCpuSets, SetProcessDEPPolicy, SetProcessInformation, SetProcessMitigationPolicy, SetProcessPreferredUILanguages, SetProcessPriorityBoost, SetProcessShutdownParameters, SetProcessValidCallTargets, SetProcessWorkingSetSize, SetProcessWorkingSetSizeEx, SetProtectedPolicy, SetSearchPathMode, SetStdHandle, SetStdHandleEx, SetSystemFileCacheSize, SetSystemPowerState, SetSystemTime, SetSystemTimeAdjustment, SetTapeParameters, SetTapePosition, SetThreadAffinityMask, SetThreadContext, SetThreadDescription, SetThreadErrorMode, SetThreadExecutionState, SetThreadGroupAffinity, SetThreadIdealProcessor, SetThreadIdealProcessorEx, SetThreadInformation, SetThreadLocale, SetThreadpoolStackInformation, SetThreadpoolThreadMaximum, SetThreadpoolThreadMinimum, SetThreadpoolTimer, SetThreadpoolTimerEx, SetThreadpoolWait, SetThreadpoolWaitEx, SetThreadPreferredUILanguages, SetThreadPriority, SetThreadPriorityBoost, SetThreadSelectedCpuSets, SetThreadStackGuarantee, SetThreadUILanguage, SetTimeZoneInformation, SetUmsThreadInformation, SetUnhandledExceptionFilter, SetupComm, SetUserGeoID, SetUserGeoName, SetVolumeLabelA, SetVolumeLabelW, SetVolumeMountPointA, SetVolumeMountPointW, SetWaitableTimer, SetWaitableTimerEx, SetXStateFeaturesMask, SignalObjectAndWait, SizeofResource, Sleep, SleepConditionVariableCS, SleepConditionVariableSRW, SleepEx, StartThreadpoolIo, SubmitThreadpoolWork, SuspendThread, SwitchToFiber, SwitchToThread, SystemTimeToFileTime, SystemTimeToTzSpecificLocalTime, SystemTimeToTzSpecificLocalTimeEx, TerminateEnclave, TerminateJobObject, TerminateProcess, TerminateProcessOnMemoryExhaustion, TerminateThread, TermsrvAppInstallMode, Thread32First, Thread32Next, TlsAlloc, TlsFree, TlsGetValue, TlsSetValue, Toolhelp32ReadProcessMemory, TransactNamedPipe, TransmitCommChar, TryAcquireSRWLockExclusive, TryAcquireSRWLockShared, TryEnterCriticalSection, TrySubmitThreadpoolCallback, TzSpecificLocalTimeToSystemTime, TzSpecificLocalTimeToSystemTimeEx, UmsThreadYield, UnhandledExceptionFilter, UnlockFile, UnlockFileEx, UnmapViewOfFile, UnmapViewOfFile2, UnmapViewOfFileEx, UnregisterApplicationRecoveryCallback, UnregisterApplicationRestart, UnregisterBadMemoryNotification, UnregisterWait, UnregisterWaitEx, UpdateCalendarDayOfWeek, UpdateProcThreadAttribute, UpdateResourceA, UpdateResourceW, VerifyScripts, VerifyVersionInfoA, VerifyVersionInfoW, VerSetConditionMask, VirtualAlloc, VirtualAllocEx, VirtualAllocExNuma, VirtualAllocFromApp, VirtualFree, VirtualFreeEx, VirtualLock, VirtualProtect, VirtualProtectEx, VirtualProtectFromApp, VirtualQuery, VirtualQueryEx, VirtualUnlock, WaitCommEvent, WaitForDebugEvent, WaitForDebugEventEx, WaitForMultipleObjects, WaitForMultipleObjectsEx, WaitForSingleObject, WaitForSingleObjectEx, WaitForThreadpoolIoCallbacks, WaitForThreadpoolTimerCallbacks, WaitForThreadpoolWaitCallbacks, WaitForThreadpoolWorkCallbacks, WaitNamedPipeA, WaitNamedPipeW, WaitOnAddress, WakeAllConditionVariable, WakeByAddressAll, WakeByAddressSingle, WakeConditionVariable, WerGetFlags, WerRegisterAdditionalProcess, WerRegisterCustomMetadata, WerRegisterExcludedMemoryBlock, WerRegisterFile, WerRegisterMemoryBlock, WerRegisterRuntimeExceptionModule, WerSetFlags, WerUnregisterAdditionalProcess, WerUnregisterCustomMetadata, WerUnregisterExcludedMemoryBlock, WerUnregisterFile, WerUnregisterMemoryBlock, WerUnregisterRuntimeExceptionModule, WideCharToMultiByte, WinExec, Wow64DisableWow64FsRedirection, Wow64EnableWow64FsRedirection, Wow64GetThreadContext, Wow64GetThreadSelectorEntry, Wow64RevertWow64FsRedirection, Wow64SetThreadContext, Wow64SetThreadDefaultGuestMachine, Wow64SuspendThread, WriteConsoleA, WriteConsoleInputA, WriteConsoleInputW, WriteConsoleOutputA, WriteConsoleOutputAttribute, WriteConsoleOutputCharacterA, WriteConsoleOutputCharacterW, WriteConsoleOutputW, WriteConsoleW, WriteFile, WriteFileEx, WriteFileGather, WritePrivateProfileSectionA, WritePrivateProfileSectionW, WritePrivateProfileStringA, WritePrivateProfileStringW, WritePrivateProfileStructA, WritePrivateProfileStructW, WriteProcessMemory, WriteProfileSectionA, WriteProfileSectionW, WriteProfileStringA, WriteProfileStringW, WriteTapemark, WTSGetActiveConsoleSessionId, ZombifyActCtx
Structures
-ENCLAVE_CREATE_INFO_SGX, ENCLAVE_CREATE_INFO_VBS, ENCLAVE_INIT_INFO_SGX, ENCLAVE_INIT_INFO_VBS, EXCEPTION_POINTERS, EXCEPTION_RECORD, BY_HANDLE_FILE_INFORMATION, CREATEFILE2_EXTENDED_PARAMETERS, HEAP_OPTIMIZE_RESOURCES_INFORMATION, HEAP_SUMMARY, JOBOBJECT_IO_RATE_CONTROL_INFORMATION, IO_COUNTERS, JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, JOBOBJECT_BASIC_LIMIT_INFORMATION, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOBOBJECT_BASIC_PROCESS_ID_LIST, JOBOBJECT_BASIC_UI_RESTRICTIONS, JOBOBJECT_SECURITY_LIMIT_INFORMATION, JOBOBJECT_END_OF_JOB_TIME_INFORMATION, JOBOBJECT_ASSOCIATE_COMPLETION_PORT, JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION, JOBOBJECT_JOBSET_INFORMATION, JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION, JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2, JOBOBJECT_LIMIT_VIOLATION_INFORMATION, JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2, JOBOBJECT_CPU_RATE_CONTROL_INFORMATION, JOBOBJECT_NET_RATE_CONTROL_INFORMATION, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V3, JOBOBJECT_IO_ATTRIBUTION_STATS, JOBOBJECT_IO_ATTRIBUTION_INFORMATION, CFG_CALL_TARGET_INFO, WIN32_MEMORY_RANGE_ENTRY, APP_MEMORY_INFORMATION, CONTEXT, CONTEXT64, MEMORY_PRIORITY_INFORMATION, PROCESS_INFORMATION, PROCESS_MEMORY_EXHAUSTION_INFO, PROCESS_MITIGATION_ASLR_POLICY, PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY, PROCESS_MITIGATION_CHILD_PROCESS_POLICY, PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY, PROCESS_MITIGATION_DEP_POLICY, PROCESS_MITIGATION_DYNAMIC_CODE_POLICY, PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY, PROCESS_MITIGATION_FONT_DISABLE_POLICY, PROCESS_MITIGATION_IMAGE_LOAD_POLICY, PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY, PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY, PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY, PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY, PROCESS_POWER_THROTTLING_STATE, PROCESS_PROTECTION_LEVEL_INFORMATION, PROCESSOR_NUMBER, STARTUPINFO, SYSTEM_CPU_SET_INFORMATION, SYSTEM_CPU_SET_INFORMATION1, THREAD_POWER_THROTTLING_STATE, CONDITION_VARIABLE, CRITICAL_SECTION, INIT_ONCE, REASON_CONTEXT, SRWLOCK, SYNCHRONIZATION_BARRIER, CACHE_DESCRIPTOR, MEMORYSTATUS, MEMORYSTATUSEX, OSVERSIONINFOEX, SYSTEM_INFO, SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION, GROUP_AFFINITY, TP_POOL_STACK_INFORMATION, PTP_CALLBACK_ENVIRON, DYNAMIC_TIME_ZONE_INFORMATION, TIME_ZONE_INFORMATION, ACTCTX, ACTCTX_SECTION_KEYED_DATA, TAPE_GET_DRIVE_PARAMETERS, TAPE_GET_MEDIA_PARAMETERS, COMMCONFIG, COMMPROP, COMMTIMEOUTS, COMSTAT, DCB, LDT_ENTRY, OFSTRUCT, WIN32_FILE_ATTRIBUTE_DATA, WIN32_FIND_STREAM_DATA, SYSTEM_POWER_STATUS, CHAR_INFO, CONSOLE_CURSOR_INFO, CONSOLE_FONT_INFO, CONSOLE_FONT_INFOEX, CONSOLE_HISTORY_INFO, CONSOLE_SCREEN_BUFFER_INFO, CONSOLE_SCREEN_BUFFER_INFOEX, CONSOLE_SELECTION_INFO, COORD, ENCODING_INFO, FOCUS_EVENT_RECORD, INPUT_RECORD, KEY_EVENT_RECORD, MENU_EVENT_RECORD, MOUSE_EVENT_RECORD, SMALL_RECT, WINDOW_BUFFER_SIZE_RECORD, CPINFO, CPINFOEX, CURRENCYFMT, FILEMUIINFO, NLSVERSIONINFO, NLSVERSIONINFOEX, NUMBERFMT, CPU_RATE_CONTROL_UNION, FLOATING_SAVE_AREA, M128A, XSAVE_FORMAT64, SYSTEM_CPU_UNION, REASON, INPUT_RECORD_EVENT, EXCEPTION_DEBUG_INFO, CREATE_THREAD_DEBUG_INFO, CREATE_PROCESS_DEBUG_INFO, EXIT_PROCESS_DEBUG_INFO, EXIT_THREAD_DEBUG_INFO, LOAD_DLL_DEBUG_INFO, UNLOAD_DLL_DEBUG_INFO, OUTPUT_DEBUG_STRING_INFO, RIP_INFO, BLOCK_DATA, REGION_DATA, DETAIL
+PACKAGE_ID, PACKAGE_INFO_REFERENCE, PACKAGE_VERSION, ENCLAVE_CREATE_INFO_SGX, ENCLAVE_CREATE_INFO_VBS, ENCLAVE_INIT_INFO_SGX, ENCLAVE_INIT_INFO_VBS, EXCEPTION_POINTERS, EXCEPTION_RECORD, BY_HANDLE_FILE_INFORMATION, CREATEFILE2_EXTENDED_PARAMETERS, HEAP_OPTIMIZE_RESOURCES_INFORMATION, HEAP_SUMMARY, SLIST_ENTRY, JOBOBJECT_IO_RATE_CONTROL_INFORMATION, IO_COUNTERS, JOBOBJECT_BASIC_ACCOUNTING_INFORMATION, JOBOBJECT_BASIC_LIMIT_INFORMATION, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, JOBOBJECT_BASIC_PROCESS_ID_LIST, JOBOBJECT_BASIC_UI_RESTRICTIONS, JOBOBJECT_SECURITY_LIMIT_INFORMATION, JOBOBJECT_END_OF_JOB_TIME_INFORMATION, JOBOBJECT_ASSOCIATE_COMPLETION_PORT, JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION, JOBOBJECT_JOBSET_INFORMATION, JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION, JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2, JOBOBJECT_LIMIT_VIOLATION_INFORMATION, JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2, JOBOBJECT_CPU_RATE_CONTROL_INFORMATION, JOBOBJECT_NET_RATE_CONTROL_INFORMATION, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2, JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V3, JOBOBJECT_IO_ATTRIBUTION_STATS, JOBOBJECT_IO_ATTRIBUTION_INFORMATION, CFG_CALL_TARGET_INFO, WIN32_MEMORY_RANGE_ENTRY, MEMORY_BASIC_INFORMATION, PSS_ALLOCATOR, PSS_AUXILIARY_PAGE_ENTRY, PSS_AUXILIARY_PAGES_INFORMATION, PSS_HANDLE_ENTRY, PSS_HANDLE_INFORMATION, PSS_HANDLE_TRACE_INFORMATION, PSS_PERFORMANCE_COUNTERS, PSS_PROCESS_INFORMATION, PSS_THREAD_ENTRY, PSS_THREAD_INFORMATION, PSS_VA_CLONE_INFORMATION, PSS_VA_SPACE_ENTRY, PSS_VA_SPACE_INFORMATION, APP_MEMORY_INFORMATION, CONTEXT, CONTEXT64, MEMORY_PRIORITY_INFORMATION, PROCESS_INFORMATION, PROCESS_MEMORY_EXHAUSTION_INFO, PROCESS_MITIGATION_ASLR_POLICY, PROCESS_MITIGATION_BINARY_SIGNATURE_POLICY, PROCESS_MITIGATION_CHILD_PROCESS_POLICY, PROCESS_MITIGATION_CONTROL_FLOW_GUARD_POLICY, PROCESS_MITIGATION_DEP_POLICY, PROCESS_MITIGATION_DYNAMIC_CODE_POLICY, PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY, PROCESS_MITIGATION_FONT_DISABLE_POLICY, PROCESS_MITIGATION_IMAGE_LOAD_POLICY, PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY, PROCESS_MITIGATION_STRICT_HANDLE_CHECK_POLICY, PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY, PROCESS_MITIGATION_SYSTEM_CALL_FILTER_POLICY, PROCESS_POWER_THROTTLING_STATE, PROCESS_PROTECTION_LEVEL_INFORMATION, PROCESSOR_NUMBER, STARTUPINFO, SYSTEM_CPU_SET_INFORMATION, SYSTEM_CPU_SET_INFORMATION1, THREAD_POWER_THROTTLING_STATE, ENUM_PAGE_FILE_INFORMATION, MODULEINFO, PERFORMANCE_INFORMATION, PROCESS_MEMORY_COUNTERS, PSAPI_WS_WATCH_INFORMATION, PSAPI_WS_WATCH_INFORMATION_EX, CONDITION_VARIABLE, CRITICAL_SECTION, INIT_ONCE, REASON_CONTEXT, SRWLOCK, SYNCHRONIZATION_BARRIER, CACHE_DESCRIPTOR, MEMORYSTATUS, MEMORYSTATUSEX, OSVERSIONINFOEX, SYSTEM_INFO, SYSTEM_PROCESSOR_CYCLE_TIME_INFORMATION, GROUP_AFFINITY, TP_POOL_STACK_INFORMATION, PTP_CALLBACK_ENVIRON, DYNAMIC_TIME_ZONE_INFORMATION, TIME_ZONE_INFORMATION, HEAPENTRY32, HEAPLIST32, MODULEENTRY32, PROCESSENTRY32, THREADENTRY32, ACTCTX, ACTCTX_SECTION_KEYED_DATA, TAPE_GET_DRIVE_PARAMETERS, TAPE_GET_MEDIA_PARAMETERS, COMMCONFIG, COMMPROP, COMMTIMEOUTS, COMSTAT, DCB, COPYFILE2_EXTENDED_PARAMETERS, COPYFILE2_MESSAGE, UMS_SCHEDULER_STARTUP_INFO, UMS_SYSTEM_THREAD_INFORMATION, LDT_ENTRY, OFSTRUCT, WIN32_FILE_ATTRIBUTE_DATA, WIN32_FIND_STREAM_DATA, SYSTEM_POWER_STATUS, CHAR_INFO, CONSOLE_CURSOR_INFO, CONSOLE_FONT_INFO, CONSOLE_FONT_INFOEX, CONSOLE_HISTORY_INFO, CONSOLE_SCREEN_BUFFER_INFO, CONSOLE_SCREEN_BUFFER_INFOEX, CONSOLE_SELECTION_INFO, COORD, ENCODING_INFO, FOCUS_EVENT_RECORD, INPUT_RECORD, KEY_EVENT_RECORD, MENU_EVENT_RECORD, MOUSE_EVENT_RECORD, SMALL_RECT, WINDOW_BUFFER_SIZE_RECORD, CALDATETIME, CPINFO, CPINFOEX, CURRENCYFMT, FILEMUIINFO, NLSVERSIONINFO, NLSVERSIONINFOEX, NUMBERFMT, HARDWARE_COUNTER_DATA, PERFORMANCE_DATA, WOW64_CONTEXT, WOW64_FLOATING_SAVE_AREA, WOW64_LDT_ENTRY, DUMMYSTRUCTNAME, CPU_RATE_CONTROL_UNION, UNION, Process, Thread, Mutant, Event, Section, Semaphore, FLOATING_SAVE_AREA, M128A, XSAVE_FORMAT64, SYSTEM_CPU_UNION, REASON, Union, ChunkStarted, ChunkFinished, StreamStarted, StreamFinished, PollContinue, Error, INPUT_RECORD_EVENT, EXCEPTION_DEBUG_INFO, CREATE_THREAD_DEBUG_INFO, CREATE_PROCESS_DEBUG_INFO, EXIT_PROCESS_DEBUG_INFO, EXIT_THREAD_DEBUG_INFO, LOAD_DLL_DEBUG_INFO, UNLOAD_DLL_DEBUG_INFO, OUTPUT_DEBUG_STRING_INFO, RIP_INFO, BLOCK_DATA, REGION_DATA, DETAIL
@@ -50,9 +50,11 @@ ENCLAVE_CREATE_INFO_SGX, ENCLAVE_CREATE_INFO_VBS, ENCLAVE_INIT_INFO_SGX, ENCLAVE
+
+
diff --git a/PInvoke/Kernel32/WerApi.cs b/PInvoke/Kernel32/WerApi.cs
new file mode 100644
index 00000000..62fa3d63
--- /dev/null
+++ b/PInvoke/Kernel32/WerApi.cs
@@ -0,0 +1,738 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ /// Flags used by WerGetFlags and WerSetFlags.
+ [PInvokeData("werapi.h", MSDNShortId = "8c5f08c0-e2d1-448c-9a57-ef19897f64c6")]
+ [Flags]
+ public enum WER_FAULT_REPORTING
+ {
+ /// Do not collect heap information in the event of an application crash or non-response.
+ WER_FAULT_REPORTING_FLAG_NOHEAP = 1,
+
+ /// Queue critical reports for the specified process. This does not show any UI.
+ WER_FAULT_REPORTING_FLAG_QUEUE = 2,
+
+ /// Do not suspend the process threads before reporting the error.
+ WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION = 4,
+
+ /// Queue critical reports and upload from the queue.
+ WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD = 8,
+
+ /// Always show error reporting UI for this process. This is applicable for interactive applications only.
+ WER_FAULT_REPORTING_ALWAYS_SHOW_UI = 16,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_NO_UI = 32,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_FLAG_NO_HEAP_ON_QUEUE = 64,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_DISABLE_SNAPSHOT_CRASH = 128,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_DISABLE_SNAPSHOT_HANG = 256,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_CRITICAL = 512,
+
+ /// Undocumented.
+ WER_FAULT_REPORTING_DURABLE = 1024,
+ }
+
+ public enum WER_FILE_TYPE
+ {
+ WerFileTypeMicrodump = 1,
+ WerFileTypeMinidump = 2,
+ WerFileTypeHeapdump = 3,
+ WerFileTypeUserDocument = 4,
+ WerFileTypeOther = 5,
+ WerFileTypeTriagedump = 6,
+ WerFileTypeCustomDump = 7,
+ WerFileTypeAuxiliaryDump = 8,
+ WerFileTypeEtlTrace = 9,
+ WerFileTypeMax
+ }
+
+ /// The file type.
+ [PInvokeData("werapi.h", MSDNShortId = "4b4bb1bb-6782-447a-901f-75702256d907")]
+ public enum WER_REGISTER_FILE_TYPE
+ {
+ ///
+ /// The document in use by the application at the time of the event. This document is only collected if the Watson server asks
+ /// for it.
+ ///
+ WerRegFileTypeUserDocument = 1,
+
+ /// Any other type of file.
+ WerRegFileTypeOther = 2,
+
+ /// The maximum value for the WER_REGISTER_FILE_TYPE enumeration type.
+ WerRegFileTypeMax
+ }
+
+ public enum WER_REPORT_TYPE
+ {
+ WerReportNonCritical = 0,
+ WerReportCritical = 1,
+ WerReportApplicationCrash = 2,
+ WerReportApplicationHang = 3,
+ WerReportKernel = 4,
+ WerReportInvalid
+ }
+
+ public enum WER_REPORT_UI
+ {
+ WerUIAdditionalDataDlgHeader = 1,
+ WerUIIconFilePath = 2,
+ WerUIConsentDlgHeader = 3,
+ WerUIConsentDlgBody = 4,
+ WerUIOnlineSolutionCheckText = 5,
+ WerUIOfflineSolutionCheckText = 6,
+ WerUICloseText = 7,
+ WerUICloseDlgHeader = 8,
+ WerUICloseDlgBody = 9,
+ WerUICloseDlgButtonText = 10,
+ WerUIMax
+ }
+
+ public enum WER_SUBMIT_RESULT
+ {
+ WerReportQueued = 1,
+ WerReportUploaded = 2,
+ WerReportDebug = 3,
+ WerReportFailed = 4,
+ WerDisabled = 5,
+ WerReportCancelled = 6,
+ WerDisabledQueue = 7,
+ WerReportAsync = 8,
+ WerCustomAction = 9,
+ WerThrottled = 10,
+ WerReportUploadedCab = 11,
+ WerStorageLocationNotFound = 12,
+ WerSubmitResultMax
+ }
+
+ ///
+ /// Retrieves the fault reporting settings for the specified process.
+ ///
+ ///
+ /// A handle to the process. This handle must have the PROCESS_VM_READ or PROCESS_QUERY_INFORMATION access right.
+ ///
+ ///
+ /// This parameter can contain one or more of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION
+ /// Do not suspend the process threads before reporting the error.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_NOHEAP
+ /// Do not collect heap information in the event of an application crash or non-response.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_QUEUE
+ /// Queue critical reports for the specified process. This does not show any UI.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD
+ /// Queue critical reports and upload from the queue.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_ALWAYS_SHOW_UI
+ /// Always show error reporting UI for this process. This is applicable for interactive applications only.
+ ///
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-wergetflags HRESULT WerGetFlags( HANDLE hProcess, PDWORD
+ // pdwFlags );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "8c5f08c0-e2d1-448c-9a57-ef19897f64c6")]
+ public static extern HRESULT WerGetFlags(IntPtr hProcess, out WER_FAULT_REPORTING pdwFlags);
+
+ ///
+ /// Registers a process to be included in the error report along with the main application process. Optionally specifies a thread
+ /// within that registered process to get additional data from.
+ ///
+ /// The Id of the process to register.
+ /// The Id of a thread within the registered process from which more information is requested.
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// E_INVALIDARG
+ /// The value of processId is 0.
+ ///
+ /// -
+ /// E_OUTOFMEMORY
+ /// WER could not allocate a large enough heap for the data.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ ///
+ /// Number of WER registered entries (memory blocks, metadata, files) exceeds max (WER_MAX_REGISTERED_ENTRIES) or number of processes
+ /// exceeds max (WER_MAX_REGISTERED_DUMPCOLLECTION)
+ ///
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ ///
+ ///
+ ///
+ // HRESULT WINAPI WerRegisterAdditionalProcess( DWORD processId, DWORD captureExtraInfoForThreadId); https://msdn.microsoft.com/en-us/library/windows/desktop/mt492585(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Werapi.h", MSDNShortId = "mt492585")]
+ public static extern HRESULT WerRegisterAdditionalProcess(uint processId, uint captureExtraInfoForThreadId);
+
+ ///
+ /// Registers app-specific metadata to be collected (in the form of key/value strings) when WER creates an error report.
+ ///
+ ///
+ /// The "key" string for the metadata element being registered.
+ ///
+ ///
+ /// The value string for the metadata element being registered.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// E_INVALIDARG
+ ///
+ /// Strings were NULL, key length was greater than 64 characters or was an invalid xml element name, orvalue length was greater than
+ /// 128 characters or contained characters that were not ASCII printable characters.
+ ///
+ ///
+ /// -
+ /// E_OUTOFMEMORY
+ /// WER could not allocate a large enough heap for the data
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ ///
+ /// The maximum number of registered entries (WER_MAX_REGISTERED_ENTRIES) or maximum amount of registered metadata
+ /// (WER_MAX_REGISTERED_METADATA) has been reached.
+ ///
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This API allows apps to integrate their own app-level telemetry with system-level telemetry (WER) by associating app metadata
+ /// with crash reports corresponding to their processes.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werregistercustommetadata HRESULT WerRegisterCustomMetadata(
+ // PCWSTR key, PCWSTR value );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("werapi.h", MSDNShortId = "55FB3110-314A-4327-AA8F-3AF77B7006DD")]
+ public static extern HRESULT WerRegisterCustomMetadata(string key, string value);
+
+ ///
+ /// Marks a memory block (that is normally included by default in error reports) to be excluded from the error report.
+ ///
+ ///
+ /// The starting address of the memory block.
+ ///
+ ///
+ /// The size of the memory block, in bytes.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// E_INVALIDARG
+ /// address is NULL or size is 0.
+ ///
+ /// -
+ /// E_OUTOFMEMORY
+ /// WER could not allocate a large enough heap for the data
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ /// The number of registered entries exceeds the limit (WER_MAX_REGISTERED_ENTRIES).
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This mechanism is intended for applications that hold large amounts of data in memory that aren't useful for root cause debugging
+ /// and increase the size of the dump file unnecessarily. For example, some Xbox One games hold large amounts of texture data in
+ /// memory that is included in error dumps by default.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werregisterexcludedmemoryblock HRESULT
+ // WerRegisterExcludedMemoryBlock( const void *address, DWORD size );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "6CDA8EDD-C8A5-471D-9716-3AB29E571133")]
+ public static extern HRESULT WerRegisterExcludedMemoryBlock(IntPtr address, uint size);
+
+ ///
+ /// Registers a file to be collected when WER creates an error report.
+ ///
+ ///
+ /// The full path to the file. The maximum length of this path is MAX_PATH characters.
+ ///
+ ///
+ /// The file type. This parameter can be one of the following values from the WER_REGISTER_FILE_TYPE enumeration type.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// WerRegFileTypeMax 3
+ /// The maximum value for the WER_REGISTER_FILE_TYPE enumeration type.
+ ///
+ /// -
+ /// WerRegFileTypeOther 2
+ /// Any other type of file.
+ ///
+ /// -
+ /// WerRegFileTypeUserDocument 1
+ ///
+ /// The document in use by the application at the time of the event. This document is only collected if the Watson server asks for it.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This parameter can be one or more of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// WER_FILE_ANONYMOUS_DATA
+ /// The file does not contain personal information that could be used to identify or contact the user.
+ ///
+ /// -
+ /// WER_FILE_DELETE_WHEN_DONE
+ /// Automatically deletes the file after it is added to the report.
+ ///
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ /// The number of registered memory blocks and files exceeds the limit.
+ ///
+ ///
+ ///
+ ///
+ /// The registered file is added to the report only when additional data is requested by the server.
+ ///
+ /// For crashes and non-responses, the operating system automatically provides error reporting (you do not need to provide any error
+ /// reporting code in your application). If you use this function to register a file, the operating system will add the file to the
+ /// error report created at the time of a crash or non-response (this file is added in addition to the files the operating system
+ /// already collects).
+ ///
+ ///
+ /// For generic event reporting, the application has to use the WerReportAddFile function instead. Alternatively, calling the
+ /// WerReportSubmit function with the WER_SUBMIT_ADD_REGISTERED_DATA flag will include the files that the WerRegisterFile
+ /// function added.
+ ///
+ /// To remove the file from the list, call the WerUnregisterFile function.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werregisterfile HRESULT WerRegisterFile( PCWSTR pwzFile,
+ // WER_REGISTER_FILE_TYPE regFileType, DWORD dwFlags );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "4b4bb1bb-6782-447a-901f-75702256d907")]
+ public static extern HRESULT WerRegisterFile([MarshalAs(UnmanagedType.LPWStr)] string pwzFile, WER_REGISTER_FILE_TYPE regFileType, uint dwFlags);
+
+ ///
+ /// Registers a memory block to be collected when WER creates an error report.
+ ///
+ ///
+ /// The starting address of the memory block.
+ ///
+ ///
+ /// The size of the memory block, in bytes. The maximum value for this parameter is WER_MAX_MEM_BLOCK_SIZE bytes.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ /// The number of registered memory blocks and files exceeds the limit.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Memory registered with this function is only added to heap or larger dump files. This memory is never added to mini dumps or
+ /// smaller dump files.
+ ///
+ ///
+ /// For crashes and no response, the operating system automatically provides error reporting (you do not need to provide any error
+ /// reporting code in your application). If you use this function to register a memory block, the operating system will add the
+ /// memory block information to the dump file at the time of the crash or non-response. The memory block is added to the dump file
+ /// for the report only when additional data is requested by the server.
+ ///
+ ///
+ /// For generic event reporting, the application has to call the WER generic event reporting functions directly. To add the memory
+ /// block to a generic report, call the WerReportAddDump function and then call the WerReportSubmit function and specify the
+ /// WER_SUBMIT_ADD_REGISTERED_DATA flag.
+ ///
+ /// To remove the block from this list, call the WerUnregisterMemoryBlock function.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werregistermemoryblock HRESULT WerRegisterMemoryBlock( PVOID
+ // pvAddress, DWORD dwSize );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "10fa2bf3-ec12-4c7c-b986-9b22cdaa7319")]
+ public static extern HRESULT WerRegisterMemoryBlock(IntPtr pvAddress, uint dwSize);
+
+ ///
+ /// Registers a custom runtime exception handler that is used to provide custom error reporting for crashes.
+ ///
+ ///
+ /// The name of the exception handler DLL to register.
+ ///
+ ///
+ /// A pointer to arbitrary context information that is passed to the handler's callback functions.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)
+ ///
+ /// The number of registered runtime exception modules exceeds the limit. A process can register up to
+ /// WER_MAX_REGISTERED_RUNTIME_EXCEPTION_MODULES handlers.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The exception handler is an out-of-process DLL that the WER service loads when a crash or unhandled exception occurs. The DLL
+ /// must implement and export the following functions:
+ ///
+ ///
+ /// -
+ /// OutOfProcessExceptionEventCallback
+ ///
+ /// -
+ /// OutOfProcessExceptionEventSignatureCallback
+ ///
+ /// -
+ /// OutOfProcessExceptionEventDebuggerLaunchCallback
+ ///
+ ///
+ /// (The DLL must also include the DllMain entry point.)
+ ///
+ /// Using an exception handler is more secure and reliable for reporting crash information than the current, in-process event
+ /// reporting feature. Also, the current generic event reporting feature is suited only for reporting non-fatal errors.
+ ///
+ ///
+ /// This function requires that the pwszOutOfProcessCallbackDll DLL be included in the WER exception handler module list in the
+ /// registry. After registering an exception handler, if the process crashes or raises an unhandled exception, the WER service loads
+ /// your exception handler and calls the OutOfProcessExceptionEventCallback callback function., which you use to state your claim on
+ /// the crash and provide the event name and report parameters count. Note that if the process registers more than one exception
+ /// handler, the service calls each handler until one of the handlers claims the crash. If no handlers claim the crash, WER defaults
+ /// to native crash reporting.
+ ///
+ ///
+ /// If an exception handler claims the exception, the WER service calls the OutOfProcessExceptionEventSignatureCallback callback
+ /// function, which provides the reporting parameters that uniquely define the problem. Then, the WER service calls the
+ /// OutOfProcessExceptionEventDebuggerLaunchCallback callback to determine whether to offer the user the option of launching a
+ /// debugger or launching the debugger automatically. The handler can also specify a custom debugger launch string, which will
+ /// override the default string (the default is the debugger specified in the AeDebug registry key).
+ ///
+ ///
+ /// After the handler has provided the event name, reporting parameters and debugger launch settings, the rest of the error reporting
+ /// flow continues in the usual way.
+ ///
+ ///
+ /// You must call the WerUnregisterRuntimeExceptionModule function to remove the registration before your process exits. A process
+ /// can register up to WER_MAX_REGISTERED_RUNTIME_EXCEPTION_MODULES handlers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werregisterruntimeexceptionmodule HRESULT
+ // WerRegisterRuntimeExceptionModule( PCWSTR pwszOutOfProcessCallbackDll, PVOID pContext );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "b0fb2c0d-cc98-43cc-a508-e80545377b7f")]
+ public static extern HRESULT WerRegisterRuntimeExceptionModule([MarshalAs(UnmanagedType.LPWStr)] string pwszOutOfProcessCallbackDll, IntPtr pContext);
+
+ ///
+ /// Sets the fault reporting settings for the current process.
+ ///
+ ///
+ /// The fault reporting settings. You can specify one or more of the following values:
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION
+ /// Do not suspend the process threads before reporting the error.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_NOHEAP
+ /// Do not collect heap information in the event of an application crash or non-response.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_QUEUE
+ /// Queue critical reports.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD
+ /// Queue critical reports and upload from the queue.
+ ///
+ /// -
+ /// WER_FAULT_REPORTING_ALWAYS_SHOW_UI
+ /// Always show error reporting UI for this process. This is applicable for interactive applications only.
+ ///
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-wersetflags HRESULT WerSetFlags( DWORD dwFlags );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "2a71203f-3a08-461f-a230-e3fee00d9d99")]
+ public static extern HRESULT WerSetFlags(WER_FAULT_REPORTING dwFlags);
+
+ ///
+ /// Removes a process from the list of additional processes to be included in the error report.
+ ///
+ ///
+ /// The Id of the process to remove. It must have been previously registered with WerRegisterAdditionalProcess.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// WER_E_NOT_FOUND
+ /// The list of registered processes does not contain the specified process.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werunregisteradditionalprocess HRESULT
+ // WerUnregisterAdditionalProcess( DWORD processId );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "CE840EE8-5EB6-4F0F-935E-5DA9097E950F")]
+ public static extern HRESULT WerUnregisterAdditionalProcess(uint processId);
+
+ ///
+ /// Removes an item of app-specific metadata being collected during error reporting for the application.
+ ///
+ ///
+ ///
+ /// The "key" string for the metadata element being removed. It must have been previously registered with the
+ /// WerRegisterCustomMetadata function.
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error codes.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// WER_E_NOT_FOUND
+ /// WER could not find the metadata item to remove.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werunregistercustommetadata HRESULT
+ // WerUnregisterCustomMetadata( PCWSTR key );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "29DB2CE5-2A96-450B-96C8-082B786613F9")]
+ public static extern HRESULT WerUnregisterCustomMetadata([MarshalAs(UnmanagedType.LPWStr)] string key);
+
+ ///
+ /// Removes a memory block that was previously marked as excluded (it will again be included in error reports).
+ ///
+ ///
+ ///
+ /// The starting address of the memory block. This memory block must have been registered using the WerRegisterExcludedMemoryBlock function.
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error code.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werunregisterexcludedmemoryblock HRESULT
+ // WerUnregisterExcludedMemoryBlock( const void *address );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "99FF746E-8EFC-47DB-AEE6-EC46F7BC7F0B")]
+ public static extern HRESULT WerUnregisterExcludedMemoryBlock(IntPtr address);
+
+ /// Removes a file from the list of files to be added to reports generated for the current process.
+ /// The full path to the file. This file must have been registered using the WerRegisterFile function.
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error code.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// WER_E_NOT_FOUND
+ /// The list of registered files does not contain the specified file.
+ ///
+ ///
+ ///
+ ///
+ // HRESULT WINAPI WerUnregisterFile( _In_ PCWSTR pwzFilePath); https://msdn.microsoft.com/en-us/library/windows/desktop/bb513630(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Werapi.h", MSDNShortId = "bb513630")]
+ public static extern HRESULT WerUnregisterFile([MarshalAs(UnmanagedType.LPWStr)] string pwzFilePath);
+
+ ///
+ /// Removes a memory block from the list of data to be collected during error reporting for the application.
+ ///
+ ///
+ ///
+ /// The starting address of the memory block. This memory block must have been registered using the WerRegisterMemoryBlock function.
+ ///
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error code.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// WER_E_NOT_FOUND
+ /// The list of registered memory blocks does not contain the specified memory block.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werunregistermemoryblock HRESULT WerUnregisterMemoryBlock(
+ // PVOID pvAddress );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "016800e8-4a03-40f6-9dba-54cd9082eb48")]
+ public static extern HRESULT WerUnregisterMemoryBlock(IntPtr pvAddress);
+
+ ///
+ /// Removes the registration of your WER exception handler.
+ ///
+ ///
+ /// The name of the exception handler DLL whose registration you want to remove.
+ ///
+ ///
+ /// A pointer to arbitrary context information that was passed to the callback.
+ ///
+ ///
+ /// This function returns S_OK on success or an error code on failure, including the following error code.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// WER_E_INVALID_STATE
+ /// The process state is not valid. For example, the process is in application recovery mode.
+ ///
+ /// -
+ /// WER_E_NOT_FOUND
+ /// The list of registered runtime exception handlers does not contain the specified exception handler.
+ ///
+ ///
+ ///
+ ///
+ /// To register your runtime exception handler, call the WerRegisterRuntimeExceptionModule function.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/werapi/nf-werapi-werunregisterruntimeexceptionmodule HRESULT
+ // WerUnregisterRuntimeExceptionModule( PCWSTR pwszOutOfProcessCallbackDll, PVOID pContext );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("werapi.h", MSDNShortId = "1a315923-b554-4363-a607-076690fc76a1")]
+ public static extern HRESULT WerUnregisterRuntimeExceptionModule([MarshalAs(UnmanagedType.LPWStr)] string pwszOutOfProcessCallbackDll, IntPtr pContext);
+ }
+}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/WinBase.File.cs b/PInvoke/Kernel32/WinBase.File.cs
index a23944a9..825839c4 100644
--- a/PInvoke/Kernel32/WinBase.File.cs
+++ b/PInvoke/Kernel32/WinBase.File.cs
@@ -92,33 +92,65 @@ namespace Vanara.PInvoke
CALLBACK_STREAM_SWITCH = 0x00000001,
}
- /// Flags that specify how the file is to be copied.
+ /// Flags used by .
+ [PInvokeData("winbase.h", MSDNShortId = "a8da62e5-bc49-4aff-afaa-e774393b7120")]
[Flags]
- public enum COPY_FILE
+ public enum COPY_FILE : uint
{
- /// An attempt to copy an encrypted file will succeed even if the destination copy cannot be encrypted.
+ /// The copy will be attempted even if the destination file cannot be encrypted.
COPY_FILE_ALLOW_DECRYPTED_DESTINATION = 0x00000008,
+
///
- /// If the source file is a symbolic link, the destination file is also a symbolic link pointing to the same file that the source symbolic link is
- /// pointing to.
- /// Windows Server 2003 and Windows XP: This value is not supported.
+ /// If the source file is a symbolic link, the destination file is also a symbolic link pointing to the same file as the source
+ /// symbolic link.
///
COPY_FILE_COPY_SYMLINK = 0x00000800,
- /// The copy operation fails immediately if the target file already exists.
- COPY_FILE_FAIL_IF_EXISTS = 0x00000001,
+
///
- /// The copy operation is performed using unbuffered I/O, bypassing system I/O cache resources. Recommended for very large file transfers.
- /// Windows Server 2003 and Windows XP: This value is not supported.
+ /// If the destination file exists the copy operation fails immediately. If a file or directory exists with the destination name
+ /// then the CopyFile2 function call will fail with either HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) or
+ /// HRESULT_FROM_WIN32(ERROR_FILE_EXISTS). If COPY_FILE_RESUME_FROM_PAUSE is also specified then a failure is only triggered if
+ /// the destination file does not have a valid restart header.
+ ///
+ COPY_FILE_FAIL_IF_EXISTS = 0x00000001,
+
+ ///
+ /// The copy is performed using unbuffered I/O, bypassing the system cache resources. This flag is recommended for very large
+ /// file copies. It is not recommended to pause copies that are using this flag.
///
COPY_FILE_NO_BUFFERING = 0x00001000,
- /// The file is copied and the original file is opened for write access.
+
+ /// Do not attempt to use the Windows Copy Offload mechanism. This is not generally recommended.
+ COPY_FILE_NO_OFFLOAD = 0x00040000,
+
+ /// The file is copied and the source file is opened for write access.
COPY_FILE_OPEN_SOURCE_FOR_WRITE = 0x00000004,
+
///
- /// Progress of the copy is tracked in the target file in case the copy fails. The failed copy can be restarted at a later time by specifying the
- /// same values for lpExistingFileName and lpNewFileName as those used in the call that failed. This can significantly slow down the copy operation
- /// as the new file may be flushed multiple times during the copy operation.
+ /// The file is copied in a manner that can be restarted if the same source and destination filenames are used again. This is slower.
///
COPY_FILE_RESTARTABLE = 0x00000002,
+
+ ///
+ /// The copy is attempted, specifying ACCESS_SYSTEM_SECURITY for the source file and ACCESS_SYSTEM_SECURITY | WRITE_DAC |
+ /// WRITE_OWNER for the destination file. If these requests are denied the access request will be reduced to the highest
+ /// privilege level for which access is granted. For more information see SACL Access Right. This can be used to allow the
+ /// CopyFile2ProgressRoutine callback to perform operations requiring higher privileges, such as copying the security attributes
+ /// for the file.
+ ///
+ COPY_FILE_REQUEST_SECURITY_PRIVILEGES = 0x00002000,
+
+ ///
+ /// The destination file is examined to see if it was copied using COPY_FILE_RESTARTABLE. If so the copy is resumed. If not the
+ /// file will be fully copied.
+ ///
+ COPY_FILE_RESUME_FROM_PAUSE = 0x00004000,
+
+ /// Undocumented.
+ COPY_FILE_IGNORE_EDP_BLOCK = 0x00400000,
+
+ /// Undocumented.
+ COPY_FILE_IGNORE_SOURCE_ENCRYPTION = 0x00800000,
}
///
diff --git a/PInvoke/Kernel32/WinBase.ProcessThread.cs b/PInvoke/Kernel32/WinBase.ProcessThread.cs
index affc9d34..f4a3d9ca 100644
--- a/PInvoke/Kernel32/WinBase.ProcessThread.cs
+++ b/PInvoke/Kernel32/WinBase.ProcessThread.cs
@@ -43,13 +43,17 @@ namespace Vanara.PInvoke
ES_USER_PRESENT = 0x00000004,
}
- /// Flags for CreateFiberEx.
+ /// Flags used by .
+ [PInvokeData("winbase.h", MSDNShortId = "cb0473f8-bc49-44c9-a8b7-6d5b55aa37a5")]
public enum FIBER_FLAG
{
- /// The floating-point state on x86 systems is not switched and data can be corrupted if a fiber uses floating-point arithmetic.
- FIBER_FLAG_UNSPECIFIED = 0,
+ ///
+ /// The floating-point state on x86 systems is not switched and data can be corrupted if a fiber uses floating-point arithmetic.
+ ///
+ FIBER_FLAG_NONE = 0,
+
/// The floating-point state is switched for the fiber.
- FIBER_FLAG_FLOAT_SWITCH = 1
+ FIBER_FLAG_FLOAT_SWITCH = 1,
}
/// Converts the current fiber into a thread.
@@ -76,6 +80,39 @@ namespace Vanara.PInvoke
[PInvokeData("WinBase.h", MSDNShortId = "ms682115")]
public static extern IntPtr ConvertThreadToFiber([In] IntPtr lpParameter);
+ ///
+ /// Converts the current thread into a fiber. You must convert a thread into a fiber before you can schedule other fibers.
+ ///
+ ///
+ /// A pointer to a variable that is passed to the fiber. The fiber can retrieve this data by using the GetFiberData macro.
+ ///
+ ///
+ ///
+ /// If this parameter is zero, the floating-point state on x86 systems is not switched and data can be corrupted if a fiber uses
+ /// floating-point arithmetic. If this parameter is FIBER_FLAG_FLOAT_SWITCH, the floating-point state is switched for the fiber.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the address of the fiber.
+ /// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// Only fibers can execute other fibers. If a thread needs to execute a fiber, it must call ConvertTheadToFiber or
+ /// ConvertThreadToFiberEx to create an area in which to save fiber state information. The thread is now the current fiber.
+ /// The state information for this fiber includes the fiber data specified by .
+ ///
+ ///
+ /// To compile an application that uses this function, define _WIN32_WINNT as 0x0400 or later. For more information, see Using the
+ /// Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-convertthreadtofiberex LPVOID ConvertThreadToFiberEx(
+ // LPVOID lpParameter, DWORD dwFlags );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "cb0473f8-bc49-44c9-a8b7-6d5b55aa37a5")]
+ public static extern IntPtr ConvertThreadToFiberEx(IntPtr lpParameter, FIBER_FLAG dwFlags);
+
///
/// Allocates a fiber object, assigns it a stack, and sets up execution to begin at the specified start address, typically the fiber function. This
/// function does not schedule the fiber.
diff --git a/PInvoke/Kernel32/WinBase.cs b/PInvoke/Kernel32/WinBase.cs
index f9c9d9cb..11d5df21 100644
--- a/PInvoke/Kernel32/WinBase.cs
+++ b/PInvoke/Kernel32/WinBase.cs
@@ -1,6 +1,8 @@
-using System;
+using Microsoft.Win32.SafeHandles;
+using System;
+using System.IO;
using System.Runtime.InteropServices;
-using Vanara.Extensions;
+using System.Text;
using Vanara.InteropServices;
namespace Vanara.PInvoke
@@ -8,17 +10,19 @@ namespace Vanara.PInvoke
public static partial class Kernel32
{
/*///
- /// Formats a message string. The function requires a message definition as input. The message definition can come from a message table resource in an
- /// already-loaded module. Or the caller can ask the function to search the system's message table resource(s) for the message definition. The function
- /// finds the message definition in a message table resource based on a message identifier and a language identifier. The function returns the formatted
- /// message text, processing any embedded insert sequences if requested. Pointer to a string that consists of
- /// unformatted message text. It will be scanned for inserts and formatted accordingly. An array of values that are used as
- /// insert values in the formatted message. A %1 in the format string indicates the first value in the Arguments array; a %2 indicates the second
- /// argument; and so on. The interpretation of each value depends on the formatting information associated with the insert in the message definition.
- /// Each insert must have a corresponding element in the array. The formatting options, and how to interpret the lpSource
- /// parameter. The low-order byte of dwFlags specifies how the function handles line breaks in the output buffer. The low-order byte can also specify the
- /// maximum width of a formatted output line. If the function succeeds, the return value is the string that specifies the formatted
- /// message. To get extended error information, call GetLastError.
+ /// Formats a message string. The function requires a message definition as input. The message definition can come from a message
+ /// table resource in an already-loaded module. Or the caller can ask the function to search the system's message table resource(s)
+ /// for the message definition. The function finds the message definition in a message table resource based on a message identifier
+ /// and a language identifier. The function returns the formatted message text, processing any embedded insert sequences if
+ /// requested. Pointer to a string that consists of unformatted message text. It will be
+ /// scanned for inserts and formatted accordingly. An array of values that are used as insert values in
+ /// the formatted message. A %1 in the format string indicates the first value in the Arguments array; a %2 indicates the second
+ /// argument; and so on. The interpretation of each value depends on the formatting information associated with the insert in the
+ /// message definition. Each insert must have a corresponding element in the array. The formatting
+ /// options, and how to interpret the lpSource parameter. The low-order byte of dwFlags specifies how the function handles line
+ /// breaks in the output buffer. The low-order byte can also specify the maximum width of a formatted output line.
+ /// If the function succeeds, the return value is the string that specifies the formatted message. To get extended error information,
+ /// call GetLastError.
[PInvokeData("WinBase.h", MSDNShortId = "ms679351")]
private static string FormatMessage(string formatString, object[] args, FormatMessageFlags flags = 0)
{
@@ -46,6 +50,4552 @@ namespace Vanara.PInvoke
return new SafeLocalHandle(ptr, 0).ToString(-1);
}*/
+ /// All active processors in the system.
+ public const ushort ALL_PROCESSOR_GROUPS = 0xffff;
+
+ ///
+ /// An application-defined callback function used with the CopyFileEx, MoveFileTransacted, and MoveFileWithProgress functions. It is
+ /// called when a portion of a copy or move operation is completed. The LPPROGRESS_ROUTINE type defines a pointer to this
+ /// callback function. CopyProgressRoutine is a placeholder for the application-defined function name.
+ ///
+ ///
+ /// The total size of the file, in bytes.
+ ///
+ ///
+ /// The total number of bytes transferred from the source file to the destination file since the copy operation began.
+ ///
+ ///
+ /// The total size of the current file stream, in bytes.
+ ///
+ ///
+ ///
+ /// The total number of bytes in the current stream that have been transferred from the source file to the destination file since the
+ /// copy operation began.
+ ///
+ ///
+ ///
+ /// A handle to the current stream. The first time CopyProgressRoutine is called, the stream number is 1.
+ ///
+ ///
+ /// The reason that CopyProgressRoutine was called. This parameter can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// CALLBACK_CHUNK_FINISHED 0x00000000
+ /// Another part of the data file was copied.
+ ///
+ /// -
+ /// CALLBACK_STREAM_SWITCH 0x00000001
+ ///
+ /// Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the source file.
+ ///
+ ///
+ /// A handle to the destination file
+ ///
+ ///
+ /// Argument passed to CopyProgressRoutine by CopyFileEx, MoveFileTransacted, or MoveFileWithProgress.
+ ///
+ ///
+ /// The CopyProgressRoutine function should return one of the following values.
+ ///
+ ///
+ /// Return code/value
+ /// Description
+ ///
+ /// -
+ /// PROGRESS_CANCEL 1
+ /// Cancel the copy operation and delete the destination file.
+ ///
+ /// -
+ /// PROGRESS_CONTINUE 0
+ /// Continue the copy operation.
+ ///
+ /// -
+ /// PROGRESS_QUIET 3
+ /// Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.
+ ///
+ /// -
+ /// PROGRESS_STOP 2
+ /// Stop the copy operation. It can be restarted at a later time.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// An application can use this information to display a progress bar that shows the total number of bytes copied as a percent of the
+ /// total file size.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nc-winbase-lpprogress_routine LPPROGRESS_ROUTINE LpprogressRoutine;
+ // DWORD LpprogressRoutine( LARGE_INTEGER TotalFileSize, LARGE_INTEGER TotalBytesTransferred, LARGE_INTEGER StreamSize, LARGE_INTEGER
+ // StreamBytesTransferred, DWORD dwStreamNumber, DWORD dwCallbackReason, HANDLE hSourceFile, HANDLE hDestinationFile, LPVOID lpData ) {...}
+ [UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "2c02b212-d4ac-4b01-8955-2561d8c42b1b")]
+ public delegate COPYFILE_CALLBACK_RESULT LpprogressRoutine(long TotalFileSize, long TotalBytesTransferred, long StreamSize, long StreamBytesTransferred, uint dwStreamNumber, COPYFILE_CALLBACK dwCallbackReason, IntPtr hSourceFile, IntPtr hDestinationFile, IntPtr lpData);
+
+ ///
+ ///
+ /// An application-defined callback function used with the CopyFile2 function. It is called when a portion of a copy or move
+ /// operation is completed. The PCOPYFILE2_PROGRESS_ROUTINE type defines a pointer to this callback function.
+ /// CopyFile2ProgressRoutine is a placeholder for the application-defined function name.
+ ///
+ ///
+ ///
+ /// Pointer to a COPYFILE2_MESSAGE structure.
+ ///
+ ///
+ /// Copy of value passed in the pvCallbackContext member of the COPYFILE2_EXTENDED_PARAMETERS structure passed to CopyFile2.
+ ///
+ ///
+ /// Value from the COPYFILE2_MESSAGE_ACTION enumeration indicating what action should be taken.
+ ///
+ ///
+ /// Return code/value
+ /// Description
+ ///
+ /// -
+ /// COPYFILE2_PROGRESS_CONTINUE 0
+ /// Continue the copy operation.
+ ///
+ /// -
+ /// COPYFILE2_PROGRESS_CANCEL 1
+ /// Cancel the copy operation. The CopyFile2 function will fail, return and any partially copied fragments will be deleted.
+ ///
+ /// -
+ /// COPYFILE2_PROGRESS_STOP 2
+ ///
+ /// Stop the copy operation. The CopyFile2 function will fail, return and any partially copied fragments will be left intact. The
+ /// operation can be restarted using the COPY_FILE_RESUME_FROM_PAUSE flag only if COPY_FILE_RESTARTABLE was set in the dwCopyFlags
+ /// member of the COPYFILE2_EXTENDED_PARAMETERS structure passed to the CopyFile2 function.
+ ///
+ ///
+ /// -
+ /// COPYFILE2_PROGRESS_QUIET 3
+ /// Continue the copy operation but do not call the CopyFile2ProgressRoutine callback function again for this operation.
+ ///
+ /// -
+ /// COPYFILE2_PROGRESS_PAUSE 4
+ ///
+ /// Pause the copy operation. In most cases the CopyFile2 function will fail and return and any partially copied fragments will be
+ /// left intact (except for the header written that is used to resume the copy operation later.) In case the copy operation was
+ /// complete at the time the pause request is processed the CopyFile2 call will complete successfully and no resume header will be written.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The COPYFILE2_CALLBACK_STREAM_FINISHED message is the last message for a paused copy. If COPYFILE2_PROGRESS_PAUSE
+ /// is returned in response to a COPYFILE2_CALLBACK_STREAM_FINISHED message then no further callbacks will be sent.
+ ///
+ ///
+ /// To compile an application that uses the PCOPYFILE2_PROGRESS_ROUTINE function pointer type, define the _WIN32_WINNT
+ /// macro as 0x0601 or later. For more information, see Using the Windows Headers.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nc-winbase-pcopyfile2_progress_routine PCOPYFILE2_PROGRESS_ROUTINE
+ // Pcopyfile2ProgressRoutine; COPYFILE2_MESSAGE_ACTION Pcopyfile2ProgressRoutine( const COPYFILE2_MESSAGE *pMessage, PVOID
+ // pvCallbackContext ) {...}
+ [PInvokeData("winbase.h", MSDNShortId = "d14b5f5b-c353-49e8-82bb-a695a3ec76fd")]
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+ public delegate COPYFILE2_MESSAGE_ACTION Pcopyfile2ProgressRoutine(ref COPYFILE2_MESSAGE pMessage, IntPtr pvCallbackContext);
+
+ /// Flags for SetSearchPathMode.
+ [PInvokeData("winbase.h", MSDNShortId = "1874933d-92c3-4945-a3e4-e6dede232d5e")]
+ [Flags]
+ public enum BASE_SEARCH_PATH
+ {
+ /// Enable safe process search mode for the process.
+ BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 0x00000001,
+
+ /// Disable safe process search mode for the process.
+ BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE = 0x00010000,
+
+ ///
+ /// Optional flag to use in combination with BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE to make this mode permanent for this
+ /// process. This is done by bitwise OR operation:
+ /// (BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT)
+ /// This flag cannot be combined with the BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE flag.
+ ///
+ BASE_SEARCH_PATH_PERMANENT = 0x00008000,
+ }
+
+ /// Used by .
+ public enum COPYFILE_CALLBACK
+ {
+ /// Another part of the data file was copied.
+ CALLBACK_CHUNK_FINISHED = 0x00000000,
+
+ ///
+ /// Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
+ ///
+ CALLBACK_STREAM_SWITCH = 0x00000001,
+ }
+
+ /// Returned by .
+ public enum COPYFILE_CALLBACK_RESULT
+ {
+ /// Cancel the copy operation and delete the destination file.
+ PROGRESS_CANCEL = 1,
+
+ /// Continue the copy operation.
+ PROGRESS_CONTINUE = 0,
+
+ /// Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.
+ PROGRESS_QUIET = 3,
+
+ /// Stop the copy operation. It can be restarted at a later time.
+ PROGRESS_STOP = 2,
+ }
+
+ ///
+ ///
+ /// Indicates the phase of a copy at the time of an error. This is used in the Error structure embedded in the
+ /// COPYFILE2_MESSAGE structure.
+ ///
+ ///
+ ///
+ ///
+ /// To compile an application that uses this enumeration, define the _WIN32_WINNT macro as 0x0601 or later. For more
+ /// information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ne-winbase-_copyfile2_copy_phase typedef enum _COPYFILE2_COPY_PHASE {
+ // COPYFILE2_PHASE_NONE , COPYFILE2_PHASE_PREPARE_SOURCE , COPYFILE2_PHASE_PREPARE_DEST , COPYFILE2_PHASE_READ_SOURCE ,
+ // COPYFILE2_PHASE_WRITE_DESTINATION , COPYFILE2_PHASE_SERVER_COPY , COPYFILE2_PHASE_NAMEGRAFT_COPY , COPYFILE2_PHASE_MAX } COPYFILE2_COPY_PHASE;
+ [PInvokeData("winbase.h", MSDNShortId = "92bf9028-78a3-4ea3-bfbb-b53a8df557ab")]
+ // public enum _COPYFILE2_COPY_PHASE{COPYFILE2_PHASE_NONE, COPYFILE2_PHASE_PREPARE_SOURCE, COPYFILE2_PHASE_PREPARE_DEST,
+ // COPYFILE2_PHASE_READ_SOURCE, COPYFILE2_PHASE_WRITE_DESTINATION, COPYFILE2_PHASE_SERVER_COPY, COPYFILE2_PHASE_NAMEGRAFT_COPY,
+ // COPYFILE2_PHASE_MAX, COPYFILE2_COPY_PHASE}
+ public enum COPYFILE2_COPY_PHASE
+ {
+ /// The copy had not yet started processing.
+ COPYFILE2_PHASE_NONE,
+
+ ///
+ /// The source was being prepared including opening a handle to the source. This phase happens once per stream copy operation.
+ ///
+ COPYFILE2_PHASE_PREPARE_SOURCE,
+
+ ///
+ /// The destination was being prepared including opening a handle to the destination. This phase happens once per stream copy operation.
+ ///
+ COPYFILE2_PHASE_PREPARE_DEST,
+
+ /// The source file was being read. This phase happens one or more times per stream copy operation.
+ COPYFILE2_PHASE_READ_SOURCE,
+
+ /// The destination file was being written. This phase happens one or more times per stream copy operation.
+ COPYFILE2_PHASE_WRITE_DESTINATION,
+
+ ///
+ /// Both the source and destination were on the same remote server and the copy was being processed remotely. This phase happens
+ /// once per stream copy operation.
+ ///
+ COPYFILE2_PHASE_SERVER_COPY,
+
+ ///
+ /// The copy operation was processing symbolic links and/or reparse points. This phase happens once per file copy operation.
+ ///
+ COPYFILE2_PHASE_NAMEGRAFT_COPY,
+
+ /// One greater than the maximum value. Valid values for this enumeration will be less than this value.
+ COPYFILE2_PHASE_MAX,
+ }
+
+ ///
+ ///
+ /// Returned by the CopyFile2ProgressRoutine callback function to indicate what action should be taken for the pending copy operation.
+ ///
+ ///
+ ///
+ ///
+ /// To compile an application that uses this enumeration, define the _WIN32_WINNT macro as 0x0601 or later. For more
+ /// information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ne-winbase-_copyfile2_message_action typedef enum
+ // _COPYFILE2_MESSAGE_ACTION { COPYFILE2_PROGRESS_CONTINUE , COPYFILE2_PROGRESS_CANCEL , COPYFILE2_PROGRESS_STOP ,
+ // COPYFILE2_PROGRESS_QUIET , COPYFILE2_PROGRESS_PAUSE } COPYFILE2_MESSAGE_ACTION;
+ [PInvokeData("winbase.h", MSDNShortId = "0beae28e-f493-4ae1-a4d9-3df69de166b7")]
+ public enum COPYFILE2_MESSAGE_ACTION
+ {
+ /// Continue the copy operation.
+ COPYFILE2_PROGRESS_CONTINUE,
+
+ ///
+ /// Cancel the copy operation. The CopyFile2 call will fail and return and any partially copied fragments will be deleted.
+ ///
+ COPYFILE2_PROGRESS_CANCEL,
+
+ ///
+ /// Stop the copy operation. The CopyFile2 call will fail and return and any partially copied fragments will be left intact. The
+ /// operation can be restarted using the COPY_FILE_RESUME_FROM_PAUSE flag only if the COPY_FILE_RESTARTABLE flag was set in the
+ /// dwCopyFlags member of the COPYFILE2_EXTENDED_PARAMETERS structure passed to the CopyFile2 function.
+ ///
+ COPYFILE2_PROGRESS_STOP,
+
+ /// Continue the copy operation but do not call the CopyFile2ProgressRoutine callback function again for this operation.
+ COPYFILE2_PROGRESS_QUIET,
+
+ ///
+ /// Pause the copy operation and write a restart header. This value is not compatible with the COPY_FILE_RESTARTABLE flag for the
+ /// dwCopyFlags member of the COPYFILE2_EXTENDED_PARAMETERS structure. In most cases the CopyFile2 call will fail and return and
+ /// any partially copied fragments will be left intact (except for the header written that is used to resume the copy operation
+ /// later.) In case the copy operation was complete at the time the pause request is processed the CopyFile2 call will complete
+ /// successfully and no resume header will be written. After this value is processed one more callback will be made to the
+ /// CopyFile2ProgressRoutine with the message specifying a COPYFILE2_CALLBACK_STREAM_FINISHED (4) value in the Type member of the
+ /// COPYFILE2_MESSAGE structure. After the callback has returned CopyFile2 will fail with .
+ ///
+ COPYFILE2_PROGRESS_PAUSE,
+ }
+
+ ///
+ /// Indicates the type of message passed in the COPYFILE2_MESSAGE structure to the CopyFile2ProgressRoutine callback function.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this enumeration, define the _WIN32_WINNT macro as 0x0601 or later. For more
+ /// information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ne-winbase-_copyfile2_message_type typedef enum
+ // _COPYFILE2_MESSAGE_TYPE { COPYFILE2_CALLBACK_NONE , COPYFILE2_CALLBACK_CHUNK_STARTED , COPYFILE2_CALLBACK_CHUNK_FINISHED ,
+ // COPYFILE2_CALLBACK_STREAM_STARTED , COPYFILE2_CALLBACK_STREAM_FINISHED , COPYFILE2_CALLBACK_POLL_CONTINUE ,
+ // COPYFILE2_CALLBACK_ERROR , COPYFILE2_CALLBACK_MAX } COPYFILE2_MESSAGE_TYPE;
+ [PInvokeData("winbase.h", MSDNShortId = "3a16ca3b-79af-4064-82d5-c073d2aa531c")]
+ public enum COPYFILE2_MESSAGE_TYPE
+ {
+ /// Not a valid value.
+ COPYFILE2_CALLBACK_NONE,
+
+ /// Indicates a single chunk of a stream has started to be copied.
+ COPYFILE2_CALLBACK_CHUNK_STARTED,
+
+ /// Indicates the copy of a single chunk of a stream has completed.
+ COPYFILE2_CALLBACK_CHUNK_FINISHED,
+
+ ///
+ /// Indicates both source and destination handles for a stream have been opened and the copy of the stream is about to be started.
+ ///
+ COPYFILE2_CALLBACK_STREAM_STARTED,
+
+ /// Indicates the copy operation for a stream have started to be completed.
+ COPYFILE2_CALLBACK_STREAM_FINISHED,
+
+ /// May be sent periodically.
+ COPYFILE2_CALLBACK_POLL_CONTINUE,
+
+ ///
+ COPYFILE2_CALLBACK_ERROR,
+
+ /// An error was encountered during the copy operation.
+ COPYFILE2_CALLBACK_MAX,
+ }
+
+ /// Return values for GetSystemDEPPolicy.
+ [PInvokeData("winbase.h", MSDNShortId = "82cb1d4e-c0e5-4601-aa55-9171a106c286")]
+ public enum DEP_SYSTEM_POLICY_TYPE
+ {
+ ///
+ /// DEP is disabled for all parts of the system, regardless of hardware support for DEP. The processor runs in PAE mode with
+ /// 32-bit versions of Windows unless PAE is disabled in the boot configuration data.
+ ///
+ AlwaysOff = 0,
+
+ ///
+ /// DEP is enabled for all parts of the system. All processes always run with DEP enabled. DEP cannot be explicitly disabled for
+ /// selected applications. System compatibility fixes are ignored.
+ ///
+ AlwaysOn = 1,
+
+ ///
+ /// On systems with processors that are capable of hardware-enforced DEP, DEP is automatically enabled only for operating system
+ /// components. This is the default setting for client versions of Windows. DEP can be explicitly enabled for selected
+ /// applications or the current process.
+ ///
+ OptIn = 2,
+
+ ///
+ /// DEP is automatically enabled for operating system components and all processes. This is the default setting for Windows
+ /// Server versions. DEP can be explicitly disabled for selected applications or the current process. System compatibility fixes
+ /// for DEP are in effect.
+ ///
+ OptOut = 3,
+ }
+
+ /// The modes to be set in SetFileCompletionNotificationModes.
+ [PInvokeData("winbase.h", MSDNShortId = "23796484-ee47-4f80-856d-5a5d5635547c")]
+ [Flags]
+ public enum FILE_NOTIFICATION_MODE : byte
+ {
+ ///
+ /// If the following three conditions are true, the I/O Manager does not queue a completion entry to the port, when it would
+ /// ordinarily do so. The conditions are: When the FileHandle parameter is a socket, this mode is only compatible with Layered
+ /// Service Providers (LSP) that return Installable File Systems (IFS) handles. To detect whether a non-IFS LSP is installed, use
+ /// the WSAEnumProtocols function and examine the dwServiceFlag1 member in each returned WSAPROTOCOL_INFO structure. If the
+ /// XP1_IFS_HANDLES (0x20000) bit is cleared then the specified LSP is not an IFS LSP. Vendors that have non-IFS LSPs are
+ /// encouraged to migrate to the Windows Filtering Platform (WFP).
+ ///
+ FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 0x1,
+
+ ///
+ /// The I/O Manager does not set the event for the file object if a request returns with a success code, or the error returned is
+ /// ERROR_PENDING and the function that is called is not a synchronous function. If an explicit event is provided for the
+ /// request, it is still signaled.
+ ///
+ FILE_SKIP_SET_EVENT_ON_HANDLE = 0x2
+ }
+
+ ///
+ /// The HARDWARE_COUNTER_TYPE enumeration specifies the type of a hardware counter.
+ ///
+ ///
+ /// The Type member of the HARDWARE_COUNTER structure contains a HARDWARE_COUNTER_TYPE enumeration value.
+ ///
+ // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntddk/ne-ntddk-_hardware_counter_type typedef enum
+ // _HARDWARE_COUNTER_TYPE { PMCCounter , MaxHardwareCounterType } HARDWARE_COUNTER_TYPE, *PHARDWARE_COUNTER_TYPE;
+ [PInvokeData("ntddk.h", MSDNShortId = "837f5a55-ca07-4462-85d7-203d02df168c")]
+ public enum HARDWARE_COUNTER_TYPE
+ {
+ /// Performance monitor counter. This type of counter is used by thread-profiling applications.
+ PMCCounter,
+
+ /// The maximum value in this enumeration type.
+ MaxHardwareCounterType
+ }
+
+ ///
+ /// The POWER_REQUEST_TYPE enumeration indicates the power request type.
+ ///
+ ///
+ ///
+ /// This enumeration is used by the kernel-mode PoClearPowerRequest and PoSetPowerRequest routines. Drivers that call these routines
+ /// must specify the PowerRequestSystemRequired enumeration value.
+ ///
+ ///
+ /// The other three enumeration values— PowerRequestDisplayRequired, PowerRequestAwayModeRequired, and
+ /// PowerRequestExecutionRequired—are not used by drivers. Applications specify these power request types in calls to the
+ /// PowerSetRequest and PowerClearRequest functions.
+ ///
+ /// A PowerRequestDisplayRequired power request has the following effects:
+ ///
+ /// While a PowerRequestAwayModeRequired power request is in effect, if the user tries to put the computer into sleep mode
+ /// (for example, by clicking Start and then clicking Sleep), the power manager turns off audio and video so that the
+ /// computer appears to be in sleep mode, but the computer continues to run.
+ ///
+ ///
+ /// While a PowerRequestExecutionRequired power request is in effect, the calling process continues to run instead of being
+ /// suspended or terminated by process lifetime management (PLM) mechanisms. When and how long the process is allowed to run depends
+ /// on the operating system and power policy settings. This type of power request is supported starting with Windows 8.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/ne-wdm-_power_request_type typedef enum
+ // _POWER_REQUEST_TYPE { PowerRequestDisplayRequired , PowerRequestSystemRequired , PowerRequestAwayModeRequired ,
+ // PowerRequestExecutionRequired } POWER_REQUEST_TYPE, *PPOWER_REQUEST_TYPE;
+ [PInvokeData("wdm.h", MSDNShortId = "266cdf1a-6122-4f46-8e93-8f76fceb0180")]
+ public enum POWER_REQUEST_TYPE
+ {
+ /// Not used by drivers. For more information, see Remarks.
+ PowerRequestDisplayRequired,
+
+ /// Prevents the computer from automatically entering sleep mode after a period of user inactivity.
+ PowerRequestSystemRequired,
+
+ /// Not used by drivers. For more information, see Remarks.
+ PowerRequestAwayModeRequired,
+
+ /// Not used by drivers. For more information, see Remarks.
+ PowerRequestExecutionRequired,
+ }
+
+ /// Values returned by .
+ [PInvokeData("winbase.h", MSDNShortId = "adf15b9c-24f4-49ea-9283-0db5f3f13e65")]
+ [Flags]
+ public enum PROCESS_DEP
+ {
+ /// DEP is disabled for the specified process.
+ PROCESS_DEP_DISABLE = 0,
+
+ /// DEP is enabled for the specified process.
+ PROCESS_DEP_ENABLE = 0x00000001,
+
+ ///
+ /// DEP-ATL thunk emulation is disabled for the specified process. For information about DEP-ATL thunk emulation, see SetProcessDEPPolicy.
+ ///
+ PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION = 0x00000002,
+ }
+
+ /// Used by QueryFullProcessImageName.
+ [PInvokeData("winbase.h", MSDNShortId = "49a9d1aa-30f3-45ea-a4ec-9f55df692b8b")]
+ public enum PROCESS_NAME
+ {
+ /// The name should use the Win32 path format.
+ PROCESS_NAME_WIN32,
+
+ /// The name should use the native system path format.
+ PROCESS_NAME_NATIVE
+ }
+
+ /// Used by ReadThreadProfilingData.
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796403")]
+ [Flags]
+ public enum READ_THREAD_PROFILING_FLAG
+ {
+ /// Get the thread profiling data.
+ READ_THREAD_PROFILING_FLAG_DISPATCHING = 0x00000001,
+
+ /// Get the hardware performance counters data.
+ READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS = 0x00000002,
+ }
+
+ /// System executable types.
+ [PInvokeData("winbase.h", MSDNShortId = "ec937372-ee99-4505-a5dd-7c111405cbc6")]
+ public enum SCS
+ {
+ /// A 32-bit Windows-based application
+ SCS_32BIT_BINARY = 0,
+
+ /// A 64-bit Windows-based application.
+ SCS_64BIT_BINARY = 6,
+
+ /// An MS-DOS – based application
+ SCS_DOS_BINARY = 1,
+
+ /// A 16-bit OS/2-based application
+ SCS_OS216_BINARY = 5,
+
+ /// A PIF file that executes an MS-DOS – based application
+ SCS_PIF_BINARY = 3,
+
+ /// A POSIX – based application
+ SCS_POSIX_BINARY = 4,
+
+ /// A 16-bit Windows-based application
+ SCS_WOW_BINARY = 2,
+ }
+
+ /// Used by .
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796393")]
+ public enum THREAD_PROFILING_FLAG
+ {
+ /// Receive no data.
+ THREAD_PROFILING_FLAG_NO_DATA = 0,
+
+ /// Receive thread profiling data such as context switch count.
+ THREAD_PROFILING_FLAG_DISPATCH = 1
+ }
+
+ /// Flags used by UMS_SYSTEM_THREAD_INFORMATION.
+ [PInvokeData("winbase.h", MSDNShortId = "eecdc592-5046-47c3-a4c6-ecb10899db3c")]
+ public enum ThreadUmsFlags : uint
+ {
+ ///
+ ///
+ /// A bitfield that specifies a UMS scheduler thread. If IsUmsSchedulerThread is set, IsUmsWorkerThread must be clear.
+ ///
+ ///
+ IsUmsSchedulerThread = 0x1,
+
+ ///
+ ///
+ /// A bitfield that specifies a UMS worker thread. If IsUmsWorkerThread is set, IsUmsSchedulerThread must be clear.
+ ///
+ ///
+ IsUmsWorkerThread = 0x2,
+ }
+
+ ///
+ /// Represents classes of information about user-mode scheduling (UMS) threads.
+ /// This enumeration is used by the QueryUmsThreadInformation and SetUmsThreadInformation functions.
+ ///
+ // typedef enum _UMS_THREAD_INFO_CLASS { UmsThreadInvalidInfoClass = 0, UmsThreadUserContext = 1, UmsThreadPriority = 2,
+ // UmsThreadAffinity = 3, UmsThreadTeb = 4, UmsThreadIsSuspended = 5, UmsThreadIsTerminated = 6, UmsThreadMaxInfoClass = 7}
+ // UMS_THREAD_INFO_CLASS, *PUMS_THREAD_INFO_CLASS; https://msdn.microsoft.com/en-us/library/windows/desktop/dd627186(v=vs.85).aspx
+ [PInvokeData("WinBase.h", MSDNShortId = "dd627186")]
+ public enum UMS_THREAD_INFO_CLASS
+ {
+ /// Reserved.
+ UmsThreadInvalidInfoClass,
+
+ /// Application-defined information stored in a UMS thread context.
+ UmsThreadUserContext,
+
+ /// Reserved.
+ UmsThreadPriority,
+
+ /// Reserved.
+ UmsThreadAffinity,
+
+ ///
+ /// The thread execution block ( TEB) for a UMS thread. This information class can only be queried; it cannot be set.
+ ///
+ UmsThreadTeb,
+
+ /// The suspension status of the thread. This information can only be queried; it cannot be set.
+ UmsThreadIsSuspended,
+
+ /// The termination status of the thread. This information can only be queried; it cannot be set.
+ UmsThreadIsTerminated,
+
+ /// Reserved.
+ UmsThreadMaxInfoClass,
+ }
+
+ /// Firmware environment variable flags.
+ [PInvokeData("winbase.h", MSDNShortId = "D3C2F03F-66F6-40A4-830E-058BBA925ACD")]
+ [Flags]
+ public enum VARIABLE_ATTRIBUTE
+ {
+ /// The firmware environment variable is stored in non-volatile memory (e.g. NVRAM).
+ VARIABLE_ATTRIBUTE_NON_VOLATILE = 0x00000001,
+
+ /// The firmware environment variable can be accessed during boot service.
+ VARIABLE_ATTRIBUTE_BOOTSERVICE_ACCESS = 0x00000002,
+
+ ///
+ /// The firmware environment variable can be accessed at runtime. Note Variables with this attribute set, must also have
+ /// VARIABLE_ATTRIBUTE_BOOTSERVICE_ACCESS set.
+ ///
+ VARIABLE_ATTRIBUTE_RUNTIME_ACCESS = 0x00000004,
+
+ /// Indicates hardware related errors encountered at runtime.
+ VARIABLE_ATTRIBUTE_HARDWARE_ERROR_RECORD = 0x00000008,
+
+ ///
+ /// Indicates an authentication requirement that must be met before writing to this firmware environment variable. For more
+ /// information see, UEFI spec 2.3.1.
+ ///
+ VARIABLE_ATTRIBUTE_AUTHENTICATED_WRITE_ACCESS = 0x00000010,
+
+ ///
+ /// Indicates authentication and time stamp requirements that must be met before writing to this firmware environment variable.
+ /// When this attribute is set, the buffer, represented by pValue, will begin with an instance of a complete (and serialized)
+ /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. For more information see, UEFI spec 2.3.1.
+ ///
+ VARIABLE_ATTRIBUTE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS = 0x00000020,
+
+ ///
+ /// Append an existing environment variable with the value of pValue. If the firmware does not support the operation, then
+ /// SetFirmwareEnvironmentVariableEx will return ERROR_INVALID_FUNCTION.
+ ///
+ VARIABLE_ATTRIBUTE_APPEND_WRITE = 0x00000040,
+ }
+
+ ///
+ public enum WOW64_CONTEXT_FLAGS : uint
+ {
+ /// this assumes that i386 and
+ WOW64_CONTEXT_i386 = 0x00010000,
+
+ /// i486 have identical context records
+ WOW64_CONTEXT_i486 = 0x00010000,
+
+ /// SS:SP, CS:IP, FLAGS, BP
+ WOW64_CONTEXT_CONTROL = (WOW64_CONTEXT_i386 | 0x00000001),
+
+ /// AX, BX, CX, DX, SI, DI
+ WOW64_CONTEXT_INTEGER = (WOW64_CONTEXT_i386 | 0x00000002),
+
+ /// DS, ES, FS, GS
+ WOW64_CONTEXT_SEGMENTS = (WOW64_CONTEXT_i386 | 0x00000004),
+
+ /// 387 state
+ WOW64_CONTEXT_FLOATING_POINT = (WOW64_CONTEXT_i386 | 0x00000008),
+
+ /// DB 0-3,6,7
+ WOW64_CONTEXT_DEBUG_REGISTERS = (WOW64_CONTEXT_i386 | 0x00000010),
+
+ /// cpu specific extensions
+ WOW64_CONTEXT_EXTENDED_REGISTERS = (WOW64_CONTEXT_i386 | 0x00000020),
+
+ ///
+ WOW64_CONTEXT_FULL = (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS),
+
+ ///
+ WOW64_CONTEXT_ALL = (WOW64_CONTEXT_CONTROL | WOW64_CONTEXT_INTEGER | WOW64_CONTEXT_SEGMENTS | WOW64_CONTEXT_FLOATING_POINT | WOW64_CONTEXT_DEBUG_REGISTERS | WOW64_CONTEXT_EXTENDED_REGISTERS),
+
+ ///
+ WOW64_CONTEXT_XSTATE = (WOW64_CONTEXT_i386 | 0x00000040),
+
+ ///
+ WOW64_CONTEXT_EXCEPTION_ACTIVE = 0x08000000,
+
+ ///
+ WOW64_CONTEXT_SERVICE_ACTIVE = 0x10000000,
+
+ ///
+ WOW64_CONTEXT_EXCEPTION_REQUEST = 0x40000000,
+
+ ///
+ WOW64_CONTEXT_EXCEPTION_REPORTING = 0x80000000,
+ }
+
+ ///
+ /// Adds a new required security identifier (SID) to the specified boundary descriptor.
+ ///
+ ///
+ /// A handle to the boundary descriptor. The CreateBoundaryDescriptor function returns this handle.
+ ///
+ ///
+ ///
+ /// A pointer to a SID structure that represents the mandatory integrity level for the namespace. Use one of the following RID values
+ /// to create the SID:
+ ///
+ ///
+ /// SECURITY_MANDATORY_UNTRUSTED_RIDSECURITY_MANDATORY_LOW_RIDSECURITY_MANDATORY_MEDIUM_RIDSECURITY_MANDATORY_SYSTEM_RIDSECURITY_MANDATORY_PROTECTED_PROCESS_RID
+ /// For more information, see Well-Known SIDs.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// A process can create a private namespace only with an integrity level that is equal to or lower than the current integrity level
+ /// of the process. Therefore, a high integrity-level process can create a high, medium or low integrity-level namespace. A medium
+ /// integrity-level process can create only a medium or low integrity-level namespace.
+ ///
+ ///
+ /// A process would usually specify a namespace at the same integrity level as the process for protection against squatting attacks
+ /// by lower integrity-level processes.
+ ///
+ ///
+ /// The security descriptor that the creator places on the namespace determines who can open the namespace. So a low or medium
+ /// integrity-level process could be given permission to open a high integrity level namespace if the security descriptor of the
+ /// namespace permits it.
+ ///
+ /// To compile an application that uses this function, define _WIN32_WINNT as 0x0601 or later.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-addintegritylabeltoboundarydescriptor BOOL
+ // AddIntegrityLabelToBoundaryDescriptor( HANDLE *BoundaryDescriptor, PSID IntegrityLabel );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "6b56e664-7795-4e30-8bca-1e4df2764606")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AddIntegrityLabelToBoundaryDescriptor(ref IntPtr BoundaryDescriptor, IntPtr IntegrityLabel);
+
+ ///
+ /// Adds an alternate local network name for the computer from which it is called.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the function returns ERROR_SUCCESS. If the function fails, it returns a nonzero error code.
+ /// Among the error codes that it returns are the following:
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/DevNotes/addlocalalternatecomputername DWORD AddLocalAlternateComputerName( _In_
+ // LPCTSTR lpDnsFQHostname, _In_ ULONG ulFlags );
+ [DllImport(Lib.Kernel32, SetLastError = false, CharSet = CharSet.Auto)]
+ [PInvokeData("", MSDNShortId = "e4d8355b-0492-4b6f-988f-3887e63a2bba")]
+ public static extern Win32Error AddLocalAlternateComputerName(string lpDnsFQHostname, uint ulFlags = 0);
+
+ ///
+ /// Registers a callback function to be called when a secured memory range is freed or its protections are changed.
+ ///
+ ///
+ /// A pointer to the application-defined SecureMemoryCacheCallback function to register.
+ ///
+ ///
+ /// If the function succeeds, it registers the callback function and returns TRUE.
+ /// If the function fails, it returns FALSE. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ ///
+ /// An application that performs I/O directly to a high-performance device typically caches a virtual-to-physical memory mapping for
+ /// the buffer it uses for the I/O. The device's driver typically secures this memory address range by calling the
+ /// MmSecureVirtualMemory routine, which prevents the memory range from being freed or its protections changed until the driver
+ /// unsecures the memory.
+ ///
+ ///
+ /// An application can use AddSecureMemoryCacheCallback to register a callback function that will be called when the memory is
+ /// freed or its protections are changed, so the application can invalidate its cached memory mapping. For more information, see SecureMemoryCacheCallback.
+ ///
+ ///
+ /// To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using
+ /// the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-addsecurememorycachecallback BOOL
+ // AddSecureMemoryCacheCallback( PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "6c89d6f3-182e-4b10-931c-8d55d603c9dc")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AddSecureMemoryCacheCallback(PsecureMemoryCacheCallback pfnCallBack);
+
+ ///
+ /// Flushes the application compatibility cache.
+ ///
+ ///
+ /// The function returns TRUE if it succeeds and FALSE otherwise.
+ ///
+ ///
+ /// The caller must be an administrator.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/DevNotes/baseflushappcompatcache BOOL WINAPI BaseFlushAppcompatCache(void);
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "03f47813-87f6-4b71-b453-77a2facab019")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool BaseFlushAppcompatCache();
+
+ ///
+ /// Copies a source context structure (including any XState) onto an initialized destination context structure.
+ ///
+ ///
+ ///
+ /// A pointer to a CONTEXT structure that receives the context copied from the . The CONTEXT structure should be initialized
+ /// by calling InitializeContext before calling this function.
+ ///
+ ///
+ ///
+ ///
+ /// Flags specifying the pieces of the CONTEXT structure that will be copied into the destination. This must be a subset of the
+ /// specified when calling InitializeContext on the CONTEXT.
+ ///
+ ///
+ ///
+ /// A pointer to a CONTEXT structure from which to copy processor context data.
+ ///
+ ///
+ ///
+ /// This function returns TRUE if the context was copied successfully, otherwise FALSE. To get extended error
+ /// information, call GetLastError.
+ ///
+ ///
+ ///
+ ///
+ /// The function copies data from the CONTEXT over the corresponding data in the CONTEXT, including extended context if any is
+ /// present. The CONTEXT must have been initialized with InitializeContext to ensure proper alignment and initialization. If
+ /// any data is present in the CONTEXT and the corresponding flag is not set in the CONTEXT or in the parameter, the
+ /// data remains valid in the .
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-copycontext BOOL CopyContext( PCONTEXT Destination, DWORD
+ // ContextFlags, PCONTEXT Source );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "805CD02A-53BC-487C-83F8-FE804368C770")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CopyContext(ref CONTEXT Destination, CONTEXT_FLAG ContextFlags, ref CONTEXT Source);
+
+ ///
+ /// Copies an existing file to a new file, notifying the application of its progress through a callback function.
+ ///
+ ///
+ /// The name of an existing file.
+ ///
+ /// To extend this limit to 32,767 wide characters, prepend "\?" to the path. For more information, see Naming Files, Paths, and Namespaces.
+ ///
+ ///
+ /// Tip Starting in Windows 10, version 1607, you can opt-in to remove the MAX_PATH character limitation without
+ /// prepending "\\?\". See the "Maximum Path Limitation" section of Naming Files, Paths, and Namespaces for details.
+ ///
+ /// If
+ /// lpExistingFileName
+ /// does not exist, the
+ /// CopyFile2
+ /// function fails returns
+ /// HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)
+ /// .
+ ///
+ ///
+ /// The name of the new file.
+ ///
+ /// To extend this limit to 32,767 wide characters, prepend "\?" to the path. For more information, see Naming Files, Paths, and Namespaces.
+ ///
+ ///
+ /// Tip Starting in Windows 10, version 1607, you can opt-in to remove the MAX_PATH character limitation without
+ /// prepending "\\?\". See the "Maximum Path Limitation" section of Naming Files, Paths, and Namespaces for details.
+ ///
+ ///
+ ///
+ /// Optional address of a COPYFILE2_EXTENDED_PARAMETERS structure.
+ ///
+ ///
+ /// If the function succeeds, the return value will return TRUE when passed to the SUCCEEDED macro.
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// S_OK
+ /// The copy operation completed successfully.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_REQUEST_PAUSED)
+ /// The copy operation was paused by a COPYFILE2_PROGRESS_PAUSE return from the CopyFile2ProgressRoutine callback function.
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_REQUEST_ABORTED)
+ ///
+ /// The copy operation was paused by a COPYFILE2_PROGRESS_CANCEL or COPYFILE2_PROGRESS_STOP return from the CopyFile2ProgressRoutine
+ /// callback function.
+ ///
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)
+ ///
+ /// The dwCopyFlags member of the COPYFILE2_EXTENDED_PARAMETERS structure passed through the parameter contains the
+ /// COPY_FILE_FAIL_IF_EXISTS flag and a conflicting name existed.
+ ///
+ ///
+ /// -
+ /// HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)
+ ///
+ /// The dwCopyFlags member of the COPYFILE2_EXTENDED_PARAMETERS structure passed through the parameter contains the
+ /// COPY_FILE_FAIL_IF_EXISTS flag and a conflicting name existed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This function preserves extended attributes, OLE structured storage, NTFS file system alternate data streams, and file
+ /// attributes. Security attributes for the existing file are not copied to the new file. To copy security attributes, use the
+ /// SHFileOperation function.
+ ///
+ ///
+ /// This function fails with if the destination file already exists and has the FILE_ATTRIBUTE_HIDDEN or
+ /// FILE_ATTRIBUTE_READONLY attribute set.
+ ///
+ ///
+ /// To compile an application that uses this function, define the _WIN32_WINNT macro as _WIN32_WINNT_WIN8 or later. For
+ /// more information, see Using the Windows Headers.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-copyfile2 HRESULT CopyFile2( PCWSTR pwszExistingFileName,
+ // PCWSTR pwszNewFileName, COPYFILE2_EXTENDED_PARAMETERS *pExtendedParameters );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("winbase.h", MSDNShortId = "aa2df686-4b61-4d90-ba0b-c78c5a0d2d59")]
+ public static extern HRESULT CopyFile2(string pwszExistingFileName, string pwszNewFileName, ref COPYFILE2_EXTENDED_PARAMETERS pExtendedParameters);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see
+ ///
+ /// Alternatives to using Transactional NTFS
+ /// .]
+ ///
+ /// Copies an existing file to a new file as a transacted operation, notifying the application of its progress through a callback function.
+ ///
+ ///
+ ///
+ /// The name of an existing file.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ /// If does not exist, the CopyFileTransacted function fails, and the GetLastError function returns ERROR_FILE_NOT_FOUND.
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// The name of the new file.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ ///
+ ///
+ /// The address of a callback function of type LPPROGRESS_ROUTINE that is called each time another portion of the file has
+ /// been copied. This parameter can be NULL. For more information on the progress callback function, see the
+ /// CopyProgressRoutine function.
+ ///
+ ///
+ ///
+ /// The argument to be passed to the callback function. This parameter can be NULL.
+ ///
+ ///
+ ///
+ /// If this flag is set to TRUE during the copy operation, the operation is canceled. Otherwise, the copy operation will
+ /// continue to completion.
+ ///
+ ///
+ ///
+ /// Flags that specify how the file is to be copied. This parameter can be a combination of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// COPY_FILE_COPY_SYMLINK 0x00000800
+ ///
+ /// If the source file is a symbolic link, the destination file is also a symbolic link pointing to the same file that the source
+ /// symbolic link is pointing to.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_FAIL_IF_EXISTS 0x00000001
+ /// The copy operation fails immediately if the target file already exists.
+ ///
+ /// -
+ /// COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
+ /// The file is copied and the original file is opened for write access.
+ ///
+ /// -
+ /// COPY_FILE_RESTARTABLE 0x00000002
+ ///
+ /// Progress of the copy is tracked in the target file in case the copy fails. The failed copy can be restarted at a later time by
+ /// specifying the same values for and as those used in the call that failed. This can significantly slow down the copy operation as
+ /// the new file may be flushed multiple times during the copy operation.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information call GetLastError.
+ ///
+ /// If returns PROGRESS_CANCEL due to the user canceling the operation, CopyFileTransacted will return zero and
+ /// GetLastError will return ERROR_REQUEST_ABORTED. In this case, the partially copied destination file is deleted.
+ ///
+ ///
+ /// If returns PROGRESS_STOP due to the user stopping the operation, CopyFileTransacted will return zero and
+ /// GetLastError will return ERROR_REQUEST_ABORTED. In this case, the partially copied destination file is left intact.
+ ///
+ ///
+ /// If you attempt to call this function with a handle to a transaction that has already been rolled back, CopyFileTransacted
+ /// will return either ERROR_TRANSACTION_NOT_ACTIVE or ERROR_INVALID_TRANSACTION.
+ ///
+ ///
+ ///
+ ///
+ /// This function preserves extended attributes, OLE structured storage, NTFS file system alternate data streams, security
+ /// attributes, and file attributes.
+ ///
+ ///
+ /// Windows 7, Windows Server 2008 R2, Windows Server 2008 and Windows Vista: Security resource attributes (
+ /// ATTRIBUTE_SECURITY_INFORMATION) for the existing file are not copied to the new file until Windows 8 and Windows Server 2012.
+ ///
+ ///
+ /// This function fails with ERROR_ACCESS_DENIED if the destination file already exists and has the
+ /// FILE_ATTRIBUTE_HIDDEN or FILE_ATTRIBUTE_READONLY attribute set.
+ ///
+ /// Encrypted files are not supported by TxF.
+ /// If COPY_FILE_COPY_SYMLINK is specified, the following rules apply:
+ ///
+ /// - If the source file is a symbolic link, the symbolic link is copied, not the target file.
+ /// - If the source file is not a symbolic link, there is no change in behavior.
+ /// - If the destination file is an existing symbolic link, the symbolic link is overwritten, not the target file.
+ /// -
+ /// If COPY_FILE_FAIL_IF_EXISTS is also specified, and the destination file is an existing symbolic link, the operation fails
+ /// in all cases.
+ ///
+ ///
+ /// If
+ /// COPY_FILE_COPY_SYMLINK
+ /// is not specified, the following rules apply:
+ ///
+ /// -
+ /// If COPY_FILE_FAIL_IF_EXISTS is also specified, and the destination file is an existing symbolic link, the operation fails
+ /// only if the target of the symbolic link exists.
+ ///
+ /// - If COPY_FILE_FAIL_IF_EXISTS is not specified, there is no change in behavior.
+ ///
+ /// Link tracking is not supported by TxF.
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// Note that SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-copyfiletransacteda BOOL CopyFileTransactedA( LPCSTR
+ // lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, LPBOOL pbCancel, DWORD dwCopyFlags,
+ // HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "118392de-166b-413e-99c9-b3deb756de0e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CopyFileTransacted(string lpExistingFileName, string lpNewFileName, LpprogressRoutine lpProgressRoutine, IntPtr lpData, [MarshalAs(UnmanagedType.Bool)] ref bool pbCancel, COPY_FILE dwCopyFlags, IntPtr hTransaction);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see
+ ///
+ /// Alternatives to using Transactional NTFS
+ /// .]
+ ///
+ /// Creates a new directory as a transacted operation, with the attributes of a specified template directory. If the underlying file
+ /// system supports security on files and directories, the function applies a specified security descriptor to the new directory. The
+ /// new directory retains the other attributes of the specified template directory.
+ ///
+ ///
+ ///
+ /// The path of the directory to use as a template when creating the new directory. This parameter can be NULL.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ /// The directory must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// The path of the directory to be created.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a SECURITY_ATTRIBUTES structure. The lpSecurityDescriptor member of the structure specifies a security
+ /// descriptor for the new directory.
+ ///
+ ///
+ /// If is NULL, the directory gets a default security descriptor. The access control lists (ACL) in the default security
+ /// descriptor for a directory are inherited from its parent directory.
+ ///
+ ///
+ /// The target file system must support security on files and directories for this parameter to have an effect. This is indicated
+ /// when GetVolumeInformation returns FS_PERSISTENT_ACLS.
+ ///
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ ///
+ /// If the function fails, the return value is zero (0). To get extended error information, call GetLastError. Possible errors
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_ALREADY_EXISTS
+ /// The specified directory already exists.
+ ///
+ /// -
+ /// ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION
+ /// You cannot create a child directory with a parent directory that has encryption disabled.
+ ///
+ /// -
+ /// ERROR_PATH_NOT_FOUND
+ /// One or more intermediate directories do not exist. This function only creates the final directory in the path.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The CreateDirectoryTransacted function allows you to create directories that inherit stream information from other
+ /// directories. This function is useful, for example, when you are using Macintosh directories, which have a resource stream that is
+ /// needed to properly identify directory contents as an attribute.
+ ///
+ ///
+ /// Some file systems, such as the NTFS file system, support compression or encryption for individual files and directories. On
+ /// volumes formatted for such a file system, a new directory inherits the compression and encryption attributes of its parent directory.
+ ///
+ ///
+ /// This function fails with ERROR_EFS_NOT_ALLOWED_IN_TRANSACTION if you try to create a child directory with a parent
+ /// directory that has encryption disabled.
+ ///
+ ///
+ /// You can obtain a handle to a directory by calling the CreateFileTransacted function with the FILE_FLAG_BACKUP_SEMANTICS
+ /// flag set.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createdirectorytransacteda BOOL
+ // CreateDirectoryTransactedA( LPCSTR lpTemplateDirectory, LPCSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE
+ // hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "75663b30-5bd9-4de7-8e4f-dc58016c2c40")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CreateDirectoryTransacted(string lpTemplateDirectory, string lpNewDirectory, SECURITY_ATTRIBUTES lpSecurityAttributes, IntPtr hTransaction);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see
+ ///
+ /// Alternatives to using Transactional NTFS
+ /// .]
+ ///
+ /// Creates or opens a file, file stream, or directory as a transacted operation. The function returns a handle that can be used to
+ /// access the object.
+ ///
+ ///
+ /// To perform this operation as a nontransacted operation or to access objects other than files (for example, named pipes, physical
+ /// devices, mailslots), use the CreateFile function.
+ ///
+ /// For more information about transactions, see the Remarks section of this topic.
+ ///
+ ///
+ /// The name of an object to be created or opened.
+ /// The object must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File. For
+ /// information on special device names, see Defining an MS-DOS Device Name.
+ ///
+ ///
+ /// To create a file stream, specify the name of the file, a colon, and then the name of the stream. For more information, see File Streams.
+ ///
+ ///
+ ///
+ ///
+ /// The access to the object, which can be summarized as read, write, both or neither (zero). The most commonly used values are
+ /// GENERIC_READ, GENERIC_WRITE, or both ( GENERIC_READ | GENERIC_WRITE). For more information, see
+ /// Generic Access Rights and File Security and Access Rights.
+ ///
+ ///
+ /// If this parameter is zero, the application can query file, directory, or device attributes without accessing that file or device.
+ /// For more information, see the Remarks section of this topic.
+ ///
+ ///
+ /// You cannot request an access mode that conflicts with the sharing mode that is specified in an open request that has an open
+ /// handle. For more information, see Creating and Opening Files.
+ ///
+ ///
+ ///
+ /// The sharing mode of an object, which can be read, write, both, delete, all of these, or none (refer to the following table).
+ ///
+ /// If this parameter is zero and CreateFileTransacted succeeds, the object cannot be shared and cannot be opened again until
+ /// the handle is closed. For more information, see the Remarks section of this topic.
+ ///
+ ///
+ /// You cannot request a sharing mode that conflicts with the access mode that is specified in an open request that has an open
+ /// handle, because that would result in the following sharing violation: ERROR_SHARING_VIOLATION. For more information, see
+ /// Creating and Opening Files.
+ ///
+ ///
+ /// To enable a process to share an object while another process has the object open, use a combination of one or more of the
+ /// following values to specify the access mode they can request to open the object.
+ ///
+ ///
+ /// Note The sharing options for each open handle remain in effect until that handle is closed, regardless of process context.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// 0 0x00000000
+ /// Disables subsequent open operations on an object to request any type of access to that object.
+ ///
+ /// -
+ /// FILE_SHARE_DELETE 0x00000004
+ ///
+ /// Enables subsequent open operations on an object to request delete access. Otherwise, other processes cannot open the object if
+ /// they request delete access. If this flag is not specified, but the object has been opened for delete access, the function fails.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_READ 0x00000001
+ ///
+ /// Enables subsequent open operations on an object to request read access. Otherwise, other processes cannot open the object if they
+ /// request read access. If this flag is not specified, but the object has been opened for read access, the function fails.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_WRITE 0x00000002
+ ///
+ /// Enables subsequent open operations on an object to request write access. Otherwise, other processes cannot open the object if
+ /// they request write access. If this flag is not specified, but the object has been opened for write access or has a file mapping
+ /// with write access, the function fails.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a SECURITY_ATTRIBUTES structure that contains an optional security descriptor and also determines whether or not the
+ /// returned handle can be inherited by child processes. The parameter can be NULL.
+ ///
+ ///
+ /// If the parameter is NULL, the handle returned by CreateFileTransacted cannot be inherited by any child processes
+ /// your application may create and the object associated with the returned handle gets a default security descriptor.
+ ///
+ /// The bInheritHandle member of the structure specifies whether the returned handle can be inherited.
+ ///
+ /// The lpSecurityDescriptor member of the structure specifies a security descriptor for an object, but may also be NULL.
+ ///
+ ///
+ /// If lpSecurityDescriptor member is NULL, the object associated with the returned handle is assigned a default
+ /// security descriptor.
+ ///
+ ///
+ /// CreateFileTransacted ignores the lpSecurityDescriptor member when opening an existing file, but continues to use
+ /// the bInheritHandle member.
+ ///
+ /// For more information, see the Remarks section of this topic.
+ ///
+ ///
+ /// An action to take on files that exist and do not exist.
+ /// For more information, see the Remarks section of this topic.
+ /// This parameter must be one of the following values, which cannot be combined.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// CREATE_ALWAYS 2
+ ///
+ /// Creates a new file, always. If the specified file exists and is writable, the function overwrites the file, the function
+ /// succeeds, and last-error code is set to ERROR_ALREADY_EXISTS (183). If the specified file does not exist and is a valid path, a
+ /// new file is created, the function succeeds, and the last-error code is set to zero. For more information, see the Remarks section
+ /// of this topic.
+ ///
+ ///
+ /// -
+ /// CREATE_NEW 1
+ ///
+ /// Creates a new file, only if it does not already exist. If the specified file exists, the function fails and the last-error code
+ /// is set to ERROR_FILE_EXISTS (80). If the specified file does not exist and is a valid path to a writable location, a new file is created.
+ ///
+ ///
+ /// -
+ /// OPEN_ALWAYS 4
+ ///
+ /// Opens a file, always. If the specified file exists, the function succeeds and the last-error code is set to ERROR_ALREADY_EXISTS
+ /// (183). If the specified file does not exist and is a valid path to a writable location, the function creates a file and the
+ /// last-error code is set to zero.
+ ///
+ ///
+ /// -
+ /// OPEN_EXISTING 3
+ ///
+ /// Opens a file or device, only if it exists. If the specified file does not exist, the function fails and the last-error code is
+ /// set to ERROR_FILE_NOT_FOUND (2). For more information, see the Remarks section of this topic.
+ ///
+ ///
+ /// -
+ /// TRUNCATE_EXISTING 5
+ ///
+ /// Opens a file and truncates it so that its size is zero bytes, only if it exists. If the specified file does not exist, the
+ /// function fails and the last-error code is set to ERROR_FILE_NOT_FOUND (2). The calling process must open the file with the
+ /// GENERIC_WRITE bit set as part of the parameter.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The file attributes and flags, FILE_ATTRIBUTE_NORMAL being the most common default value.
+ ///
+ /// This parameter can include any combination of the available file attributes ( FILE_ATTRIBUTE_*). All other file attributes
+ /// override FILE_ATTRIBUTE_NORMAL.
+ ///
+ ///
+ /// This parameter can also contain combinations of flags ( FILE_FLAG_) for control of buffering behavior, access modes, and
+ /// other special-purpose flags. These combine with any FILE_ATTRIBUTE_ values.
+ ///
+ ///
+ /// This parameter can also contain Security Quality of Service (SQOS) information by specifying the SECURITY_SQOS_PRESENT
+ /// flag. Additional SQOS-related flags information is presented in the table following the attributes and flags tables.
+ ///
+ ///
+ /// Note When CreateFileTransacted opens an existing file, it generally combines the file flags with the file
+ /// attributes of the existing file, and ignores any file attributes supplied as part of . Special cases are detailed in Creating and
+ /// Opening Files.
+ ///
+ /// The following file attributes and flags are used only for file objects, not other types of objects that
+ /// CreateFileTransacted
+ ///
+ /// opens (additional information can be found in the Remarks section of this topic). For more advanced access to file attributes, see
+ ///
+ /// SetFileAttributes
+ /// . For a complete list of all file attributes with their values and descriptions, see
+ /// File Attribute Constants
+ /// .
+ ///
+ ///
+ /// Attribute
+ /// Meaning
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_ARCHIVE 32 (0x20)
+ /// The file should be archived. Applications use this attribute to mark files for backup or removal.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_ENCRYPTED 16384 (0x4000)
+ ///
+ /// The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means
+ /// that encryption is the default for newly created files and subdirectories. For more information, see File Encryption. This flag
+ /// has no effect if FILE_ATTRIBUTE_SYSTEM is also specified.
+ ///
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_HIDDEN 2 (0x2)
+ /// The file is hidden. Do not include it in an ordinary directory listing.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_NORMAL 128 (0x80)
+ /// The file does not have other attributes set. This attribute is valid only if used alone.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_OFFLINE 4096 (0x1000)
+ ///
+ /// The data of a file is not immediately available. This attribute indicates that file data is physically moved to offline storage.
+ /// This attribute is used by Remote Storage, the hierarchical storage management software. Applications should not arbitrarily
+ /// change this attribute.
+ ///
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_READONLY 1 (0x1)
+ /// The file is read only. Applications can read the file, but cannot write to or delete it.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_SYSTEM 4 (0x4)
+ /// The file is part of or used exclusively by an operating system.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_TEMPORARY 256 (0x100)
+ ///
+ /// The file is being used for temporary storage. File systems avoid writing data back to mass storage if sufficient cache memory is
+ /// available, because an application deletes a temporary file after a handle is closed. In that case, the system can entirely avoid
+ /// writing the data. Otherwise, the data is written after the handle is closed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Flag
+ /// Meaning
+ ///
+ /// -
+ /// FILE_FLAG_BACKUP_SEMANTICS 0x02000000
+ ///
+ /// The file is being opened or created for a backup or restore operation. The system ensures that the calling process overrides file
+ /// security checks when the process has SE_BACKUP_NAME and SE_RESTORE_NAME privileges. For more information, see Changing Privileges
+ /// in a Token. You must set this flag to obtain a handle to a directory. A directory handle can be passed to some functions instead
+ /// of a file handle. For more information, see Directory Handles.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_DELETE_ON_CLOSE 0x04000000
+ ///
+ /// The file is to be deleted immediately after the last transacted writer handle to the file is closed, provided that the
+ /// transaction is still active. If a file has been marked for deletion and a transacted writer handle is still open after the
+ /// transaction completes, the file will not be deleted. If there are existing open handles to a file, the call fails unless they
+ /// were all opened with the FILE_SHARE_DELETE share mode. Subsequent open requests for the file fail, unless the FILE_SHARE_DELETE
+ /// share mode is specified.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_NO_BUFFERING 0x20000000
+ ///
+ /// The file is being opened with no system caching. This flag does not affect hard disk caching or memory mapped files. When
+ /// combined with FILE_FLAG_OVERLAPPED, the flag gives maximum asynchronous performance, because the I/O does not rely on the
+ /// synchronous operations of the memory manager. However, some I/O operations take more time, because data is not being held in the
+ /// cache. Also, the file metadata may still be cached. To flush the metadata to disk, use the FlushFileBuffers function. An
+ /// application must meet certain requirements when working with files that are opened with FILE_FLAG_NO_BUFFERING: One way to align
+ /// buffers on integer multiples of the volume sector size is to use VirtualAlloc to allocate the buffers. It allocates memory that
+ /// is aligned on addresses that are integer multiples of the operating system's memory page size. Because both memory page and
+ /// volume sector sizes are powers of 2, this memory is also aligned on addresses that are integer multiples of a volume sector size.
+ /// Memory pages are 4 or 8 KB in size; sectors are 512 bytes (hard disks), 2048 bytes (CD), or 4096 bytes (hard disks), and
+ /// therefore, volume sectors can never be larger than memory pages. An application can determine a volume sector size by calling the
+ /// GetDiskFreeSpace function.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_OPEN_NO_RECALL 0x00100000
+ ///
+ /// The file data is requested, but it should continue to be located in remote storage. It should not be transported back to local
+ /// storage. This flag is for use by remote storage systems.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_OPEN_REPARSE_POINT 0x00200000
+ ///
+ /// Normal reparse point processing will not occur; CreateFileTransacted will attempt to open the reparse point. When a file is
+ /// opened, a file handle is returned, whether or not the filter that controls the reparse point is operational. This flag cannot be
+ /// used with the CREATE_ALWAYS flag. If the file is not a reparse point, then this flag is ignored.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_OVERLAPPED 0x40000000
+ ///
+ /// The file is being opened or created for asynchronous I/O. When the operation is complete, the event specified in the OVERLAPPED
+ /// structure is set to the signaled state. Operations that take a significant amount of time to process return ERROR_IO_PENDING. If
+ /// this flag is specified, the file can be used for simultaneous read and write operations. The system does not maintain the file
+ /// pointer, therefore you must pass the file position to the read and write functions in the OVERLAPPED structure or update the file
+ /// pointer. If this flag is not specified, then I/O operations are serialized, even if the calls to the read and write functions
+ /// specify an OVERLAPPED structure.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_POSIX_SEMANTICS 0x0100000
+ ///
+ /// The file is to be accessed according to POSIX rules. This includes allowing multiple files with names, differing only in case,
+ /// for file systems that support that naming. Use care when using this option, because files created with this flag may not be
+ /// accessible by applications that are written for MS-DOS or 16-bit Windows.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_RANDOM_ACCESS 0x10000000
+ /// The file is to be accessed randomly. The system can use this as a hint to optimize file caching.
+ ///
+ /// -
+ /// FILE_FLAG_SESSION_AWARE 0x00800000
+ ///
+ /// The file or device is being opened with session awareness. If this flag is not specified, then per-session devices (such as a
+ /// device using RemoteFX USB Redirection) cannot be opened by processes running in session 0. This flag has no effect for callers
+ /// not in session 0. This flag is supported only on server editions of Windows. Windows Server 2008 R2 and Windows Server 2008: This
+ /// flag is not supported before Windows Server 2012.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
+ ///
+ /// The file is to be accessed sequentially from beginning to end. The system can use this as a hint to optimize file caching. If an
+ /// application moves the file pointer for random access, optimum caching may not occur. However, correct operation is still
+ /// guaranteed. Specifying this flag can increase performance for applications that read large files using sequential access.
+ /// Performance gains can be even more noticeable for applications that read large files mostly sequentially, but occasionally skip
+ /// over small ranges of bytes. This flag has no effect if the file system does not support cached I/O and FILE_FLAG_NO_BUFFERING.
+ ///
+ ///
+ /// -
+ /// FILE_FLAG_WRITE_THROUGH 0x80000000
+ ///
+ /// Write operations will not go through any intermediate cache, they will go directly to disk. If FILE_FLAG_NO_BUFFERING is not also
+ /// specified, so that system caching is in effect, then the data is written to the system cache, but is flushed to disk without
+ /// delay. If FILE_FLAG_NO_BUFFERING is also specified, so that system caching is not in effect, then the data is immediately flushed
+ /// to disk without going through the system cache. The operating system also requests a write-through the hard disk cache to
+ /// persistent media. However, not all hardware supports this write-through capability.
+ ///
+ ///
+ ///
+ ///
+ /// The parameter can also specify Security Quality of Service information. For more information, see Impersonation Levels. When the
+ /// calling application specifies the SECURITY_SQOS_PRESENT flag as part of , it can also contain one or more of the following values.
+ ///
+ ///
+ ///
+ /// Security flag
+ /// Meaning
+ ///
+ /// -
+ /// SECURITY_ANONYMOUS
+ /// Impersonates a client at the Anonymous impersonation level.
+ ///
+ /// -
+ /// SECURITY_CONTEXT_TRACKING
+ /// The security tracking mode is dynamic. If this flag is not specified, the security tracking mode is static.
+ ///
+ /// -
+ /// SECURITY_DELEGATION
+ /// Impersonates a client at the Delegation impersonation level.
+ ///
+ /// -
+ /// SECURITY_EFFECTIVE_ONLY
+ ///
+ /// Only the enabled aspects of the client's security context are available to the server. If you do not specify this flag, all
+ /// aspects of the client's security context are available. This allows the client to limit the groups and privileges that a server
+ /// can use while impersonating the client.
+ ///
+ ///
+ /// -
+ /// SECURITY_IDENTIFICATION
+ /// Impersonates a client at the Identification impersonation level.
+ ///
+ /// -
+ /// SECURITY_IMPERSONATION
+ ///
+ /// Impersonate a client at the impersonation level. This is the default behavior if no other flags are specified along with the
+ /// SECURITY_SQOS_PRESENT flag.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A valid handle to a template file with the GENERIC_READ access right. The template file supplies file attributes and
+ /// extended attributes for the file that is being created. This parameter can be NULL.
+ ///
+ /// When opening an existing file, CreateFileTransacted ignores the template file.
+ /// When opening a new EFS-encrypted file, the file inherits the DACL from its parent directory.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ ///
+ /// The miniversion to be opened. If the transaction specified in is not the transaction that is modifying the file, this parameter
+ /// should be NULL. Otherwise, this parameter can be a miniversion identifier returned by the FSCTL_TXFS_CREATE_MINIVERSION
+ /// control code, or one of the following values.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// TXFS_MINIVERSION_COMMITTED_VIEW 0x0000
+ /// The view of the file as of its last commit.
+ ///
+ /// -
+ /// TXFS_MINIVERSION_DIRTY_VIEW 0xFFFF
+ /// The view of the file as it is being modified by the transaction.
+ ///
+ /// -
+ /// TXFS_MINIVERSION_DEFAULT_VIEW 0xFFFE
+ ///
+ /// Either the committed or dirty view of the file, depending on the context. A transaction that is modifying the file gets the dirty
+ /// view, while a transaction that is not modifying the file gets the committed view.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// If the function succeeds, the return value is an open handle to the specified file, device, named pipe, or mail slot.
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// When using the handle returned by CreateFileTransacted, use the transacted version of file I/O functions instead of the
+ /// standard file I/O functions where appropriate. For more information, see Programming Considerations for Transactional NTFS.
+ ///
+ ///
+ /// When opening a transacted handle to a directory, that handle must have FILE_WRITE_DATA ( FILE_ADD_FILE) and
+ /// FILE_APPEND_DATA ( FILE_ADD_SUBDIRECTORY) permissions. These are included in FILE_GENERIC_WRITE permissions.
+ /// You should open directories with fewer permissions if you are just using the handle to create files or subdirectories; otherwise,
+ /// sharing violations can occur.
+ ///
+ ///
+ /// You cannot open a file with FILE_EXECUTE access level when that file is a part of another transaction (that is, another
+ /// application opened it by calling CreateFileTransacted). This means that CreateFileTransacted fails if the access
+ /// level FILE_EXECUTE or FILE_ALL_ACCESS is specified
+ ///
+ ///
+ /// When a non-transacted application calls CreateFileTransacted with MAXIMUM_ALLOWED specified for , a handle is
+ /// opened with the same access level every time. When a transacted application calls CreateFileTransacted with
+ /// MAXIMUM_ALLOWED specified for , a handle is opened with a differing amount of access based on whether the file is locked
+ /// by a transaction. For example, if the calling application has FILE_EXECUTE access level for a file, the application only
+ /// obtains this access if the file that is being opened is either not locked by a transaction, or is locked by a transaction and the
+ /// application is already a transacted reader for that file.
+ ///
+ /// See Transactional NTFS for a complete description of transacted operations.
+ ///
+ /// Use the CloseHandle function to close an object handle returned by CreateFileTransacted when the handle is no longer
+ /// needed, and prior to committing or rolling back the transaction.
+ ///
+ ///
+ /// Some file systems, such as the NTFS file system, support compression or encryption for individual files and directories. On
+ /// volumes that are formatted for that kind of file system, a new file inherits the compression and encryption attributes of its directory.
+ ///
+ ///
+ /// You cannot use CreateFileTransacted to control compression on a file or directory. For more information, see File
+ /// Compression and Decompression, and File Encryption.
+ ///
+ /// Symbolic link behavior—If the call to this function creates a new file, there is no change in behavior.
+ /// If FILE_FLAG_OPEN_REPARSE_POINT is specified:
+ ///
+ /// - If an existing file is opened and it is a symbolic link, the handle returned is a handle to the symbolic link.
+ /// - If TRUNCATE_EXISTING or FILE_FLAG_DELETE_ON_CLOSE are specified, the file affected is a symbolic link.
+ ///
+ /// If
+ /// FILE_FLAG_OPEN_REPARSE_POINT
+ /// is not specified:
+ ///
+ /// - If an existing file is opened and it is a symbolic link, the handle returned is a handle to the target.
+ /// -
+ /// If CREATE_ALWAYS, TRUNCATE_EXISTING, or FILE_FLAG_DELETE_ON_CLOSE are specified, the file affected is the target.
+ ///
+ ///
+ ///
+ /// A multi-sector write is not guaranteed to be atomic unless you are using a transaction (that is, the handle created is a
+ /// transacted handle). A single-sector write is atomic. Multi-sector writes that are cached may not always be written to the disk;
+ /// therefore, specify
+ ///
+ /// FILE_FLAG_WRITE_THROUGH
+ /// to ensure that an entire multi-sector write is written to the disk without caching.
+ ///
+ /// As stated previously, if the parameter is NULL, the handle returned by CreateFileTransacted cannot be inherited by
+ /// any child processes your application may create. The following information regarding this parameter also applies:
+ ///
+ ///
+ /// -
+ /// If bInheritHandle is not FALSE, which is any nonzero value, then the handle can be inherited. Therefore it is
+ /// critical this structure member be properly initialized to FALSE if you do not intend the handle to be inheritable.
+ ///
+ /// -
+ /// The access control lists (ACL) in the default security descriptor for a file or directory are inherited from its parent directory.
+ ///
+ /// -
+ /// The target file system must support security on files and directories for the lpSecurityDescriptor to have an effect on
+ /// them, which can be determined by using GetVolumeInformation
+ ///
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// Note that SMB 3.0 does not support TxF.
+ /// Files
+ ///
+ /// If you try to create a file on a floppy drive that does not have a floppy disk or a CD-ROM drive that does not have a CD, the
+ /// system displays a message for the user to insert a disk or a CD. To prevent the system from displaying this message, call the
+ ///
+ /// SetErrorMode
+ /// function with
+ /// SEM_FAILCRITICALERRORS
+ /// .
+ /// For more information, see Creating and Opening Files.
+ ///
+ /// If you rename or delete a file and then restore it shortly afterward, the system searches the cache for file information to
+ /// restore. Cached information includes its short/long name pair and creation time.
+ ///
+ ///
+ /// If you call CreateFileTransacted on a file that is pending deletion as a result of a previous call to DeleteFile, the
+ /// function fails. The operating system delays file deletion until all handles to the file are closed. GetLastError returns ERROR_ACCESS_DENIED.
+ ///
+ ///
+ /// The parameter can be zero, allowing the application to query file attributes without accessing the file if the application is
+ /// running with adequate security settings. This is useful to test for the existence of a file without opening it for read and/or
+ /// write access, or to obtain other statistics about the file or directory. See Obtaining and Setting File Information and GetFileInformationByHandle.
+ ///
+ ///
+ /// When an application creates a file across a network, it is better to use GENERIC_READ | GENERIC_WRITE than to use
+ /// GENERIC_WRITE alone. The resulting code is faster, because the redirector can use the cache manager and send fewer SMBs
+ /// with more data. This combination also avoids an issue where writing to a file across a network can occasionally return ERROR_ACCESS_DENIED.
+ ///
+ /// File Streams
+ /// On NTFS file systems, you can use
+ /// CreateFileTransacted
+ /// to create separate streams within a file.
+ /// For more information, see File Streams.
+ /// Directories
+ /// An application cannot create a directory by using
+ /// CreateFileTransacted
+ /// , therefore only the
+ /// OPEN_EXISTING
+ /// value is valid for
+ /// dwCreationDisposition
+ /// for this use case. To create a directory, the application must call
+ /// CreateDirectoryTransacted
+ /// ,
+ /// CreateDirectory
+ /// or
+ /// CreateDirectoryEx
+ /// .
+ ///
+ /// To open a directory using CreateFileTransacted, specify the FILE_FLAG_BACKUP_SEMANTICS flag as part of .
+ /// Appropriate security checks still apply when this flag is used without SE_BACKUP_NAME and SE_RESTORE_NAME privileges.
+ ///
+ ///
+ /// When using CreateFileTransacted to open a directory during defragmentation of a FAT or FAT32 file system volume, do not
+ /// specify the MAXIMUM_ALLOWED access right. Access to the directory is denied if this is done. Specify the
+ /// GENERIC_READ access right instead.
+ ///
+ /// For more information, see About Directory Management.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createfiletransacteda HANDLE CreateFileTransactedA( LPCSTR
+ // lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
+ // DWORD dwFlagsAndAttributes, HANDLE hTemplateFile, HANDLE hTransaction, PUSHORT pusMiniVersion, PVOID lpExtendedParameter );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "0cbc081d-8787-409b-84bc-a6a28d8f83a0")]
+ public static extern SafeFileHandle CreateFileTransacted(string lpFileName, FileAccess dwDesiredAccess, FileShare dwShareMode, SECURITY_ATTRIBUTES lpSecurityAttributes, FileMode dwCreationDisposition, FileFlagsAndAttributes dwFlagsAndAttributes,
+ IntPtr hTemplateFile, IntPtr hTransaction, ref ushort pusMiniVersion, IntPtr lpExtendedParameter);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see
+ ///
+ /// Alternatives to using Transactional NTFS
+ /// .]
+ ///
+ /// Establishes a hard link between an existing file and a new file as a transacted operation. This function is only supported on the
+ /// NTFS file system, and only for files, not directories.
+ ///
+ ///
+ ///
+ /// The name of the new file.
+ /// This parameter cannot specify the name of a directory.
+ ///
+ ///
+ /// The name of the existing file.
+ /// This parameter cannot specify the name of a directory.
+ ///
+ ///
+ /// Reserved; must be NULL.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero (0). To get extended error information, call GetLastError.
+ ///
+ /// The maximum number of hard links that can be created with this function is 1023 per file. If more than 1023 links are created for
+ /// a file, an error results.
+ ///
+ /// The files must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ ///
+ /// Any directory entry for a file that is created with CreateFileTransacted or CreateHardLinkTransacted is a hard link to an
+ /// associated file. An additional hard link that is created with the CreateHardLinkTransacted function allows you to have
+ /// multiple directory entries for a file, that is, multiple hard links to the same file, which can be different names in the same
+ /// directory, or the same or different names in different directories. However, all hard links to a file must be on the same volume.
+ ///
+ ///
+ /// Because hard links are only directory entries for a file, when an application modifies a file through any hard link, all
+ /// applications that use any other hard link to the file see the changes. Also, all of the directory entries are updated if the file
+ /// changes. For example, if a file size changes, all of the hard links to the file show the new file size.
+ ///
+ ///
+ /// The security descriptor belongs to the file to which a hard link points. The link itself is only a directory entry, and does not
+ /// have a security descriptor. Therefore, when you change the security descriptor of a hard link, you a change the security
+ /// descriptor of the underlying file, and all hard links that point to the file allow the newly specified access. You cannot give a
+ /// file different security descriptors on a per-hard-link basis.
+ ///
+ ///
+ /// This function does not modify the security descriptor of the file to be linked to, even if security descriptor information is
+ /// passed in the parameter.
+ ///
+ ///
+ /// Use DeleteFileTransacted to delete hard links. You can delete them in any order regardless of the order in which they are created.
+ ///
+ ///
+ /// Flags, attributes, access, and sharing that are specified in CreateFileTransacted operate on a per-file basis. That is, if you
+ /// open a file that does not allow sharing, another application cannot share the file by creating a new hard link to the file.
+ ///
+ ///
+ /// When you create a hard link on the NTFS file system, the file attribute information in the directory entry is refreshed only when
+ /// the file is opened, or when GetFileInformationByHandle is called with the handle of a specific file.
+ ///
+ /// Symbolic links: If the path points to a symbolic link, the function creates a hard link to the target.
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// Note that SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createhardlinktransacteda BOOL CreateHardLinkTransactedA(
+ // LPCSTR lpFileName, LPCSTR lpExistingFileName, LPSECURITY_ATTRIBUTES lpSecurityAttributes, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "27dd5b0a-08ef-4757-8f51-03d9918028c8")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CreateHardLinkTransacted(string lpFileName, string lpExistingFileName, SECURITY_ATTRIBUTES lpSecurityAttributes, IntPtr hTransaction);
+
+ ///
+ /// Creates a user-mode scheduling (UMS) completion list.
+ ///
+ ///
+ /// A PUMS_COMPLETION_LIST variable. On output, this parameter receives a pointer to an empty UMS completion list.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error values
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_NOT_ENOUGH_MEMORY
+ /// Not enough memory is available to create the completion list.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A completion list is associated with a UMS scheduler thread when the EnterUmsSchedulingMode function is called to create the
+ /// scheduler thread. The system queues newly created UMS worker threads to the completion list. It also queues previously blocked
+ /// UMS worker threads to the completion list when the threads are no longer blocked.
+ ///
+ ///
+ /// When an application's UmsSchedulerProc entry point function is called, the application's scheduler should retrieve items from the
+ /// completion list by calling DequeueUmsCompletionListItems.
+ ///
+ ///
+ /// Each completion list has an associated completion list event which is signaled whenever the system queues items to an empty list.
+ /// Use the GetUmsCompletionListEvent to obtain a handle to the event for a specified completion list.
+ ///
+ ///
+ /// When a completion list is no longer needed, use the DeleteUmsCompletionList to release the list. The list must be empty before it
+ /// can be released.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createumscompletionlist BOOL CreateUmsCompletionList(
+ // PUMS_COMPLETION_LIST *UmsCompletionList );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "6e77b793-a82e-4e23-8c8b-7aff79d69346")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CreateUmsCompletionList(out IntPtr UmsCompletionList);
+
+ ///
+ /// Creates a user-mode scheduling (UMS) thread context to represent a UMS worker thread.
+ ///
+ ///
+ /// A PUMS_CONTEXT variable. On output, this parameter receives a pointer to a UMS thread context.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error values
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_NOT_ENOUGH_MEMORY
+ /// Not enough memory is available to create the UMS thread context.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A UMS thread context represents the state of a UMS worker thread. Thread contexts are used to specify UMS worker threads in
+ /// function calls.
+ ///
+ ///
+ /// A UMS worker thread is created by calling the CreateRemoteThreadEx function after using InitializeProcThreadAttributeList and
+ /// UpdateProcThreadAttribute to prepare a list of UMS attributes for the thread.
+ ///
+ ///
+ /// The underlying structures for a UMS thread context are managed by the system and should not be modified directly. To get and set
+ /// information about a UMS worker thread, use the QueryUmsThreadInformation and SetUmsThreadInformation functions.
+ ///
+ /// After a UMS worker thread terminates, its thread context should be released by calling DeleteUmsThreadContext.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createumsthreadcontext BOOL CreateUmsThreadContext(
+ // PUMS_CONTEXT *lpUmsThread );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "b27ce81a-8463-46af-8acf-2de091f625df")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CreateUmsThreadContext(out IntPtr lpUmsThread);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Deletes an existing file as a transacted operation.
+ ///
+ ///
+ /// The name of the file to be deleted.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// If an application attempts to delete a file that does not exist, the DeleteFileTransacted function fails with
+ /// ERROR_FILE_NOT_FOUND. If the file is a read-only file, the function fails with ERROR_ACCESS_DENIED.
+ ///
+ /// The following list identifies some tips for deleting, removing, or closing files:
+ ///
+ /// -
+ /// To delete a read-only file, first you must remove the read-only attribute.
+ ///
+ /// -
+ ///
+ /// To delete or rename a file, you must have either delete permission on the file, or delete child permission in the parent directory.
+ ///
+ ///
+ /// -
+ /// To recursively delete the files in a directory, use the SHFileOperation function.
+ ///
+ /// -
+ /// To remove an empty directory, use the RemoveDirectoryTransacted function.
+ ///
+ /// -
+ /// To close an open file, use the CloseHandle function.
+ ///
+ ///
+ ///
+ /// If you set up a directory with all access except delete and delete child, and the access control lists (ACL) of new files are
+ /// inherited, then you can create a file without being able to delete it. However, then you can create a file, and then get all the
+ /// access you request on the handle that is returned to you at the time you create the file.
+ ///
+ ///
+ /// If you request delete permission at the time you create a file, you can delete or rename the file with that handle, but not with
+ /// any other handle. For more information, see File Security and Access Rights.
+ ///
+ ///
+ /// The DeleteFileTransacted function fails if an application attempts to delete a file that has other handles open for normal
+ /// I/O or as a memory-mapped file ( FILE_SHARE_DELETE must have been specified when other handles were opened).
+ ///
+ ///
+ /// The DeleteFileTransacted function marks a file for deletion on close. The file is deleted after the last transacted writer
+ /// handle to the file is closed, provided that the transaction is still active. If a file has been marked for deletion and a
+ /// transacted writer handle is still open after the transaction completes, the file will not be deleted.
+ ///
+ ///
+ /// Symbolic links: If the path points to a symbolic link, the symbolic link is deleted, not the target. To delete a target,
+ /// you must call CreateFile and specify FILE_FLAG_DELETE_ON_CLOSE.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-deletefiletransacteda BOOL DeleteFileTransactedA( LPCSTR
+ // lpFileName, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "e0a6230b-2da1-4746-95fe-80f7b6bae41f")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeleteFileTransacted(string lpFileName, IntPtr hTransaction);
+
+ ///
+ /// Deletes the specified user-mode scheduling (UMS) completion list. The list must be empty.
+ ///
+ ///
+ /// A pointer to the UMS completion list to be deleted. The CreateUmsCompletionList function provides this pointer.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// If the completion list is shared, the caller is responsible for ensuring that no active UMS thread holds a reference to the list
+ /// before deleting it.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-deleteumscompletionlist BOOL DeleteUmsCompletionList(
+ // PUMS_COMPLETION_LIST UmsCompletionList );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "98124359-ddd1-468c-9f99-74dd3f631fa1")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeleteUmsCompletionList(IntPtr UmsCompletionList);
+
+ ///
+ /// Deletes the specified user-mode scheduling (UMS) thread context. The thread must be terminated.
+ ///
+ ///
+ /// A pointer to the UMS thread context to be deleted. The CreateUmsThreadContext function provides this pointer.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// A UMS thread context cannot be deleted until the associated thread has terminated.
+ ///
+ /// When a UMS worker thread finishes running (for example, by returning from its thread entry point function), the system terminates
+ /// the thread, sets the termination status in the thread's UMS thread context, and queues the UMS thread context to the associated
+ /// completion list.
+ ///
+ /// Any attempt to execute the UMS thread will fail because the thread is already terminated.
+ ///
+ /// To check the termination status of a thread, the application's scheduler should call QueryUmsThreadInformation with the
+ /// UmsIsThreadTerminated information class.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-deleteumsthreadcontext BOOL DeleteUmsThreadContext(
+ // PUMS_CONTEXT UmsThread );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "cdd118fc-f664-44ce-958d-857216ceb9a7")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeleteUmsThreadContext(IntPtr UmsThread);
+
+ ///
+ /// Retrieves user-mode scheduling (UMS) worker threads from the specified UMS completion list.
+ ///
+ ///
+ /// A pointer to the completion list from which to retrieve worker threads.
+ ///
+ ///
+ ///
+ /// The time-out interval for the retrieval operation, in milliseconds. The function returns if the interval elapses, even if no
+ /// worker threads are queued to the completion list.
+ ///
+ ///
+ /// If the WaitTimeOut parameter is zero, the completion list is checked for available worker threads without waiting for worker
+ /// threads to become available. If the WaitTimeOut parameter is INFINITE, the function's time-out interval never elapses. This is
+ /// not recommended, however, because it causes the function to block until one or more worker threads become available.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a UMS_CONTEXT variable. On output, this parameter receives a pointer to the first UMS thread context in a list of
+ /// UMS thread contexts.
+ ///
+ ///
+ /// If no worker threads are available before the time-out specified by the WaitTimeOut parameter, this parameter is set to NULL.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error values
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_TIMEOUT
+ /// No threads became available before the specified time-out interval elapsed.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The system queues a UMS worker thread to a completion list when the worker thread is created or when a previously blocked worker
+ /// thread becomes unblocked. The DequeueUmsCompletionListItems function retrieves a pointer to a list of all thread contexts
+ /// in the specified completion list. The GetNextUmsListItem function can be used to pop UMS thread contexts off the list into the
+ /// scheduler's own ready thread queue. The scheduler is responsible for selecting threads to run based on priorities chosen by the application.
+ ///
+ ///
+ /// Do not run UMS threads directly from the list provided by DequeueUmsCompletionListItems, or run a thread transferred from
+ /// the list to the ready thread queue before the list is completely empty. This can cause unpredictable behavior in the application.
+ ///
+ ///
+ /// If more than one caller attempts to retrieve threads from a shared completion list, only the first caller retrieves the threads.
+ /// For subsequent callers, the DequeueUmsCompletionListItems function returns success but the UmsThreadList parameter is set
+ /// to NULL.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-dequeueumscompletionlistitems BOOL
+ // DequeueUmsCompletionListItems( PUMS_COMPLETION_LIST UmsCompletionList, DWORD WaitTimeOut, PUMS_CONTEXT *UmsThreadList );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "91499eb9-9fc5-4135-95f6-1bced78f1e07")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DequeueUmsCompletionListItems(IntPtr UmsCompletionList, uint WaitTimeOut, out IntPtr UmsThreadList);
+
+ /// Disables thread profiling.
+ /// The handle that the EnableThreadProfiling function returned.
+ /// Returns ERROR_SUCCESS if the call is successful; otherwise, a system error code (see Winerror.h).
+ // DWORD APIENTRY DisableThreadProfiling( _In_ HANDLE PerformanceDataHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd796392(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796392")]
+ public static extern Win32Error DisableThreadProfiling(IntPtr PerformanceDataHandle);
+
+ /// Enables thread profiling on the specified thread.
+ /// The handle to the thread on which you want to enable profiling. This must be the current thread.
+ ///
+ /// To receive thread profiling data such as context switch count, set this parameter to THREAD_PROFILING_FLAG_DISPATCH; otherwise,
+ /// set to 0.
+ ///
+ ///
+ /// To receive hardware performance counter data, set this parameter to a bitmask that identifies the hardware counters to collect.
+ /// You can specify up to 16 performance counters. Each bit relates directly to the zero-based hardware counter index for the
+ /// hardware performance counters that you configured. Set to zero if you are not collecting hardware counter data. If you set a bit
+ /// for a hardware counter that has not been configured, the counter value that is read for that counter is zero.
+ ///
+ ///
+ /// An opaque handle that you use when calling the ReadThreadProfilingData and DisableThreadProfiling functions.
+ ///
+ /// Returns ERROR_SUCCESS if the call is successful; otherwise, a system error code (see Winerror.h).
+ // DWORD APIENTRY EnableThreadProfiling( _In_ HANDLE ThreadHandle, _In_ DWORD Flags, _In_ DWORD64 HardwareCounters, _Out_ HANDLE
+ // PerformanceDataHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd796393(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796393")]
+ public static extern Win32Error EnableThreadProfiling(IntPtr ThreadHandle, THREAD_PROFILING_FLAG Flags, ulong HardwareCounters, IntPtr PerformanceDataHandle);
+
+ ///
+ /// Converts the calling thread into a user-mode scheduling (UMS) scheduler thread.
+ ///
+ ///
+ ///
+ /// A pointer to a UMS_SCHEDULER_STARTUP_INFO structure that specifies UMS attributes for the thread, including a completion list and
+ /// a UmsSchedulerProc entry point function.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// An application's UMS scheduler creates one UMS scheduler thread for each processor that will be used to run UMS threads. The
+ /// scheduler typically sets the affinity of the scheduler thread for a single processor, effectively reserving the processor for the
+ /// use of that scheduler thread. For more information about thread affinity, see Multiple Processors.
+ ///
+ ///
+ /// When a UMS scheduler thread is created, the system calls the UmsSchedulerProc entry point function specified with the
+ /// EnterUmsSchedulingMode function call. The application's scheduler is responsible for finishing any application-specific
+ /// initialization of the scheduler thread and selecting a UMS worker thread to run.
+ ///
+ ///
+ /// The application's scheduler selects a UMS worker thread to run by calling ExecuteUmsThread with the worker thread's UMS thread
+ /// context. The worker thread runs until it yields control by calling UmsThreadYield, blocks, or terminates. The scheduler thread is
+ /// then available to run another worker thread.
+ ///
+ ///
+ /// A scheduler thread should continue to run until all of its worker threads reach a natural stopping point: that is, all worker
+ /// threads have yielded, blocked, or terminated.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-enterumsschedulingmode BOOL EnterUmsSchedulingMode(
+ // PUMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "792bd7fa-0ae9-4c38-a664-5fb3e3d0c52b")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool EnterUmsSchedulingMode(ref UMS_SCHEDULER_STARTUP_INFO SchedulerStartupInfo);
+
+ ///
+ /// Runs the specified UMS worker thread.
+ ///
+ ///
+ /// A pointer to the UMS thread context of the worker thread to run.
+ ///
+ ///
+ /// If the function succeeds, it does not return a value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error codes
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_RETRY
+ /// The specified UMS worker thread is temporarily locked by the system. The caller can retry the operation.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The ExecuteUmsThread function loads the state of the specified UMS worker thread over the state of the calling UMS
+ /// scheduler thread so that the worker thread can run. The worker thread runs until it yields by calling the UmsThreadYield
+ /// function, blocks, or terminates.
+ ///
+ ///
+ /// When a worker thread yields or blocks, the system calls the scheduler thread's UmsSchedulerProc entry point function. When a
+ /// previously blocked worker thread becomes unblocked, the system queues the worker thread to the completion list specified with the
+ /// UpdateProcThreadAttribute function when the worker thread was created.
+ ///
+ ///
+ /// The ExecuteUmsThread function does not return unless an error occurs. If the function returns ERROR_RETRY, the error is
+ /// transitory and the operation can be retried.
+ ///
+ ///
+ /// If the function returns an error other than ERROR_RETRY, the application's scheduler should check whether the thread is suspended
+ /// or terminated by calling QueryUmsThreadInformation with UmsThreadIsSuspended or UmsThreadIsTerminated,
+ /// respectively. Other possible errors include calling the function on a thread that is not a UMS scheduler thread, passing an
+ /// invalid UMS worker thread context, or specifying a worker thread that is already executing on another scheduler thread.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-executeumsthread BOOL ExecuteUmsThread( PUMS_CONTEXT
+ // UmsThread );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "e4265351-e8e9-4878-bd42-93258b4cd1a0")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ExecuteUmsThread(IntPtr UmsThread);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ ///
+ /// Creates an enumeration of all the hard links to the specified file as a transacted operation. The function returns a handle to
+ /// the enumeration that can be used on subsequent calls to the FindNextFileNameW function.
+ ///
+ ///
+ ///
+ /// The name of the file.
+ ///
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to
+ /// ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE (6805).
+ ///
+ ///
+ ///
+ /// Reserved; specify zero (0).
+ ///
+ ///
+ ///
+ /// The size of the buffer pointed to by the LinkName parameter, in characters. If this call fails and the error is
+ /// ERROR_MORE_DATA (234), the value that is returned by this parameter is the size that the buffer pointed to by LinkName
+ /// must be to contain all the data.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer to store the first link name found for lpFileName.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is a search handle that can be used with the FindNextFileNameW function or closed with
+ /// the FindClose function.
+ ///
+ ///
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE (0xffffffff). To get extended error information, call the
+ /// GetLastError function.
+ ///
+ ///
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-findfirstfilenametransactedw HANDLE
+ // FindFirstFileNameTransactedW( LPCWSTR lpFileName, DWORD dwFlags, LPDWORD StringLength, PWSTR LinkName, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("winbase.h", MSDNShortId = "79c7d32d-3cb7-4e27-9db1-f24282bf606a")]
+ public static extern IntPtr FindFirstFileNameTransactedW(string lpFileName, uint dwFlags, ref uint StringLength, StringBuilder LinkName, IntPtr hTransaction);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Searches a directory for a file or subdirectory with a name that matches a specific name as a transacted operation.
+ /// This function is the transacted form of the FindFirstFileEx function.
+ /// For the most basic version of this function, see FindFirstFile.
+ ///
+ ///
+ ///
+ /// The directory or path, and the file name. The file name can include wildcard characters, for example, an asterisk (*) or a
+ /// question mark (?).
+ ///
+ ///
+ /// This parameter should not be NULL, an invalid string (for example, an empty string or a string that is missing the
+ /// terminating null character), or end in a trailing backslash ().
+ ///
+ ///
+ /// If the string ends with a wildcard, period (.), or directory name, the user must have access to the root and all subdirectories
+ /// on the path.
+ ///
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// The information level of the returned data.
+ /// This parameter is one of the FINDEX_INFO_LEVELS enumeration values.
+ ///
+ ///
+ /// A pointer to the WIN32_FIND_DATA structure that receives information about a found file or subdirectory.
+ ///
+ ///
+ /// The type of filtering to perform that is different from wildcard matching.
+ /// This parameter is one of the FINDEX_SEARCH_OPS enumeration values.
+ ///
+ ///
+ /// A pointer to the search criteria if the specified fSearchOp needs structured search information.
+ ///
+ /// At this time, none of the supported fSearchOp values require extended search information. Therefore, this pointer must be NULL.
+ ///
+ ///
+ ///
+ /// Specifies additional flags that control the search.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FIND_FIRST_EX_CASE_SENSITIVE 1
+ /// Searches are case-sensitive.
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is a search handle used in a subsequent call to FindNextFile or FindClose, and the
+ /// lpFindFileData parameter contains information about the first file or directory found.
+ ///
+ ///
+ /// If the function fails or fails to locate files from the search string in the lpFileName parameter, the return value is
+ /// INVALID_HANDLE_VALUE and the contents of lpFindFileData are indeterminate. To get extended error information, call the
+ /// GetLastError function.
+ ///
+ ///
+ ///
+ ///
+ /// The FindFirstFileTransacted function opens a search handle and returns information about the first file that the file
+ /// system finds with a name that matches the specified pattern. This may or may not be the first file or directory that appears in a
+ /// directory-listing application (such as the dir command) when given the same file name string pattern. This is because
+ /// FindFirstFileTransacted does no sorting of the search results. For additional information, see FindNextFile.
+ ///
+ /// The following list identifies some other search characteristics:
+ ///
+ /// -
+ /// The search is performed strictly on the name of the file, not on any attributes such as a date or a file type.
+ ///
+ /// -
+ /// The search includes the long and short file names.
+ ///
+ /// -
+ /// An attempt to open a search with a trailing backslash always fails.
+ ///
+ /// -
+ ///
+ /// Passing an invalid string, NULL, or empty string for the lpFileName parameter is not a valid use of this function. Results
+ /// in this case are undefined.
+ ///
+ ///
+ ///
+ ///
+ /// Note In rare cases, file information on NTFS file systems may not be current at the time you call this function. To be
+ /// assured of getting the current file information, call the GetFileInformationByHandle function.
+ ///
+ ///
+ /// If the underlying file system does not support the specified type of filtering, other than directory filtering,
+ /// FindFirstFileTransacted fails with the error ERROR_NOT_SUPPORTED. The application must use FINDEX_SEARCH_OPS type
+ /// FileExSearchNameMatch and perform its own filtering.
+ ///
+ ///
+ /// After the search handle is established, use it in the FindNextFile function to search for other files that match the same pattern
+ /// with the same filtering that is being performed. When the search handle is not needed, it should be closed by using the FindClose function.
+ ///
+ ///
+ /// As stated previously, you cannot use a trailing backslash () in the lpFileName input string for FindFirstFileTransacted,
+ /// therefore it may not be obvious how to search root directories. If you want to see files or get the attributes of a root
+ /// directory, the following options would apply:
+ ///
+ ///
+ /// -
+ /// To examine files in a root directory, you can use "C:\*" and step through the directory by using FindNextFile.
+ ///
+ /// -
+ /// To get the attributes of a root directory, use the GetFileAttributes function.
+ ///
+ ///
+ /// Note Prepending the string "\\?\" does not allow access to the root directory.
+ ///
+ /// On network shares, you can use an lpFileName in the form of the following: "\\server\service\*". However, you cannot use an
+ /// lpFileName that points to the share itself; for example, "\\server\service" is not valid.
+ ///
+ ///
+ /// To examine a directory that is not a root directory, use the path to that directory, without a trailing backslash. For example,
+ /// an argument of "C:\Windows" returns information about the directory "C:\Windows", not about a directory or file in "C:\Windows".
+ /// To examine the files and directories in "C:\Windows", use an lpFileName of "C:\Windows*".
+ ///
+ ///
+ /// Be aware that some other thread or process could create or delete a file with this name between the time you query for the result
+ /// and the time you act on the information. If this is a potential concern for your application, one possible solution is to use the
+ /// CreateFile function with CREATE_NEW (which fails if the file exists) or OPEN_EXISTING (which fails if the file does
+ /// not exist).
+ ///
+ ///
+ /// If you are writing a 32-bit application to list all the files in a directory and the application may be run on a 64-bit computer,
+ /// you should call Wow64DisableWow64FsRedirection before calling FindFirstFileTransacted and call
+ /// Wow64RevertWow64FsRedirection after the last call to FindNextFile. For more information, see File System Redirector.
+ ///
+ ///
+ /// If the path points to a symbolic link, the WIN32_FIND_DATA buffer contains information about the symbolic link, not the target.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-findfirstfiletransacteda HANDLE FindFirstFileTransactedA(
+ // LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter,
+ // DWORD dwAdditionalFlags, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "d94bf32b-f14b-44b4-824b-ed453d0424ef")]
+ public static extern IntPtr FindFirstFileTransacted(string lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, out WIN32_FIND_DATA lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, IntPtr lpSearchFilter, FIND_FIRST dwAdditionalFlags, IntPtr hTransaction);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Enumerates the first stream in the specified file or directory as a transacted operation.
+ ///
+ ///
+ /// The fully qualified file name.
+ ///
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to
+ /// ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE (6805).
+ ///
+ ///
+ ///
+ ///
+ /// The information level of the returned data. This parameter is one of the values in the STREAM_INFO_LEVELS enumeration type.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FindStreamInfoStandard 0
+ /// The data is returned in a WIN32_FIND_STREAM_DATA structure.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the file data. The format of this data depends on the value of the InfoLevel parameter.
+ ///
+ ///
+ /// Reserved for future use. This parameter must be zero.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is a search handle that can be used in subsequent calls to the FindNextStreamWfunction.
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// All files contain a default data stream. On NTFS, files can also contain one or more named data streams. On FAT file systems,
+ /// files cannot have more that the default data stream, and therefore, this function will not return valid results when used on FAT
+ /// filesystem files. This function works on all file systems that supports hard links; otherwise, the function returns
+ /// ERROR_STATUS_NOT_IMPLEMENTED (6805).
+ ///
+ ///
+ /// The FindFirstStreamTransactedW function opens a search handle and returns information about the first stream in the
+ /// specified file or directory. For files, this is always the default data stream, ::$DATA. After the search handle has been
+ /// established, use it in the FindNextStreamW function to search for other streams in the specified file or directory. When the
+ /// search handle is no longer needed, it should be closed using the FindClosefunction.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-findfirststreamtransactedw HANDLE
+ // FindFirstStreamTransactedW( LPCWSTR lpFileName, STREAM_INFO_LEVELS InfoLevel, LPVOID lpFindStreamData, DWORD dwFlags, HANDLE
+ // hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("winbase.h", MSDNShortId = "76c64aa9-0501-457d-b774-c209fbac4ccc")]
+ public static extern IntPtr FindFirstStreamTransactedW(string lpFileName, STREAM_INFO_LEVELS InfoLevel, out WIN32_FIND_STREAM_DATA lpFindStreamData, uint dwFlags, IntPtr hTransaction);
+
+ ///
+ /// Returns the number of active processors in a processor group or in the system.
+ ///
+ ///
+ ///
+ /// The processor group number. If this parameter is ALL_PROCESSOR_GROUPS, the function returns the number of active processors in
+ /// the system.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the number of active processors in the specified group.
+ /// If the function fails, the return value is zero. To get extended error information, use GetLastError.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getactiveprocessorcount DWORD GetActiveProcessorCount(
+ // WORD GroupNumber );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "f4ebb0a7-1c05-4478-85e3-80e6327ef8a4")]
+ public static extern uint GetActiveProcessorCount(ushort GroupNumber);
+
+ ///
+ /// Returns the number of active processor groups in the system.
+ ///
+ ///
+ /// If the function succeeds, the return value is the number of active processor groups in the system.
+ /// If the function fails, the return value is zero.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getactiveprocessorgroupcount WORD
+ // GetActiveProcessorGroupCount( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "566c6abe-9269-4e0e-9c98-e4607c808452")]
+ public static extern ushort GetActiveProcessorGroupCount();
+
+ ///
+ /// Determines whether a file is an executable (.exe) file, and if so, which subsystem runs the executable file.
+ ///
+ ///
+ /// The full path of the file whose executable type is to be determined.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a variable to receive information about the executable type of the file specified by lpApplicationName. The
+ /// following constants are defined.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// SCS_32BIT_BINARY 0
+ /// A 32-bit Windows-based application
+ ///
+ /// -
+ /// SCS_64BIT_BINARY 6
+ /// A 64-bit Windows-based application.
+ ///
+ /// -
+ /// SCS_DOS_BINARY 1
+ /// An MS-DOS – based application
+ ///
+ /// -
+ /// SCS_OS216_BINARY 5
+ /// A 16-bit OS/2-based application
+ ///
+ /// -
+ /// SCS_PIF_BINARY 3
+ /// A PIF file that executes an MS-DOS – based application
+ ///
+ /// -
+ /// SCS_POSIX_BINARY 4
+ /// A POSIX – based application
+ ///
+ /// -
+ /// SCS_WOW_BINARY 2
+ /// A 16-bit Windows-based application
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// If the file is executable, the return value is nonzero. The function sets the variable pointed to by lpBinaryType to indicate the
+ /// file's executable type.
+ ///
+ ///
+ /// If the file is not executable, or if the function fails, the return value is zero. To get extended error information, call
+ /// GetLastError. If the file is a DLL, the last error code is ERROR_BAD_EXE_FORMAT.
+ ///
+ ///
+ ///
+ ///
+ /// As an alternative, you can obtain the same information by calling the SHGetFileInfo function, passing the SHGFI_EXETYPE
+ /// flag in the uFlags parameter.
+ ///
+ /// Symbolic link behavior—If the path points to a symbolic link, the target file is used.
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getbinarytypea BOOL GetBinaryTypeA( LPCSTR
+ // lpApplicationName, LPDWORD lpBinaryType );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "ec937372-ee99-4505-a5dd-7c111405cbc6")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetBinaryType(string lpApplicationName, out SCS lpBinaryType);
+
+ ///
+ /// Indicates whether the 64-bit Common Language Runtime (CLR) is installed.
+ ///
+ ///
+ /// This method returns 0 if 32-bit Common Language Runtime(CLR) is installed and 0x00000001 if the 64-bit Common Language
+ /// Runtime(CLR) is installed.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/cossdk/getcompluspackageinstallstatus ULONG WINAPI GetComPlusPackageInstallStatus(void);
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "c68af270-6a40-4026-9725-5fe657123fd5")]
+ public static extern uint GetComPlusPackageInstallStatus();
+
+ ///
+ /// Returns the user-mode scheduling (UMS) thread context of the calling UMS thread.
+ ///
+ ///
+ /// The function returns a pointer to the UMS thread context of the calling thread.
+ /// If calling thread is not a UMS thread, the function returns NULL. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// The GetCurrentUmsThread function can be called for a UMS scheduler thread or UMS worker thread.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getcurrentumsthread PUMS_CONTEXT GetCurrentUmsThread( );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "f2e20816-919a-443d-96d3-94e98afc28f2")]
+ public static extern IntPtr GetCurrentUmsThread();
+
+ ///
+ /// Gets a range, expressed in years, for which a DYNAMIC_TIME_ZONE_INFORMATION has valid entries. Use the returned value to
+ /// identify the specific years to request when calling GetTimeZoneInformationForYear to retrieve time zone information for a
+ /// time zone that experiences annual boundary changes due to daylight saving time adjustments.
+ ///
+ /// Specifies settings for a time zone and dynamic daylight saving time.
+ /// The year that marks the beginning of the range to pass to GetTimeZoneInformationForYear.
+ /// The year that marks the end of the range to pass to GetTimeZoneInformationForYear.
+ ///
+ ///
+ ///
+ /// Return code/value
+ /// Description
+ ///
+ /// -
+ /// ERROR_SUCCESS
+ /// The operation succeeded.
+ ///
+ /// -
+ /// ERROR_FILE_NOT_FOUND
+ /// The system cannot find the effective years.
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER
+ /// One of the parameter values is not valid.
+ ///
+ /// -
+ /// Any other value
+ /// The operation failed.
+ ///
+ ///
+ ///
+ // DWORD WINAPI GetDynamicTimeZoneInformationEffectiveYears( _In_ const PDYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, _Out_
+ // LPDWORD FirstYear, _Out_ LPDWORD LastYear); https://msdn.microsoft.com/en-us/library/windows/desktop/hh706894(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Winbase.h", MSDNShortId = "hh706894")]
+ public static extern Win32Error GetDynamicTimeZoneInformationEffectiveYears(ref DYNAMIC_TIME_ZONE_INFORMATION lpTimeZoneInformation, out uint FirstYear, out uint LastYear);
+
+ ///
+ /// Gets a mask of enabled XState features on x86 or x64 processors.
+ ///
+ /// The definition of XState feature bits are processor vendor specific. Please refer to the relevant processor reference manuals for
+ /// additional information on a particular feature.
+ ///
+ ///
+ ///
+ /// This function returns a bitmask in which each bit represents an XState feature that is enabled on the system.
+ ///
+ ///
+ ///
+ /// An application should call this function to determine what features are present and enabled on the system before using an XState
+ /// processor feature or attempting to manipulate XState contexts. Bits 0 and 1 refer to the X87 FPU and the presence of SSE
+ /// registers, respectively. The meanings of specific feature bits beyond 0 and 1 are defined in the Programmer Reference Manuals
+ /// released by the processor vendors.
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getenabledxstatefeatures DWORD64 GetEnabledXStateFeatures( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "E7DE090F-F83E-440D-B2A3-BCF160889F2E")]
+ public static extern ulong GetEnabledXStateFeatures();
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Retrieves file system attributes for a specified file or directory as a transacted operation.
+ ///
+ ///
+ /// The name of the file or directory.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ /// The file or directory must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ ///
+ /// The level of attribute information to retrieve.
+ /// This parameter can be the following value from the GET_FILEEX_INFO_LEVELS enumeration.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// GetFileExInfoStandard
+ /// The lpFileInformation parameter is a WIN32_FILE_ATTRIBUTE_DATA structure.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the attribute information.
+ ///
+ /// The type of attribute information that is stored into this buffer is determined by the value of fInfoLevelId. If the fInfoLevelId
+ /// parameter is GetFileExInfoStandard then this parameter points to a WIN32_FILE_ATTRIBUTE_DATA structure
+ ///
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero (0). To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// When GetFileAttributesTransacted is called on a directory that is a mounted folder, it returns the attributes of the
+ /// directory, not those of the root directory in the volume that the mounted folder associates with the directory. To obtain the
+ /// file attributes of the associated volume, call GetVolumeNameForVolumeMountPoint to obtain the name of the associated volume. Then
+ /// use the resulting name in a call to GetFileAttributesTransacted. The results are the attributes of the root directory on
+ /// the associated volume.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ /// Symbolic links: If the path points to a symbolic link, the function returns attributes for the symbolic link.
+ /// Transacted Operations
+ ///
+ /// If a file is open for modification in a transaction, no other thread can open the file for modification until the transaction is
+ /// committed. Conversely, if a file is open for modification outside of a transaction, no transacted thread can open the file for
+ /// modification until the non-transacted handle is closed. If a non-transacted thread has a handle opened to modify a file, a call
+ /// to GetFileAttributesTransacted for that file will fail with an ERROR_TRANSACTIONAL_CONFLICT error.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileattributestransacteda BOOL
+ // GetFileAttributesTransactedA( LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation, HANDLE
+ // hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "dd1435da-93e5-440a-913a-9e40e39b4a01")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetFileAttributesTransacted(string lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, ref WIN32_FILE_ATTRIBUTE_DATA lpFileInformation, IntPtr hTransaction);
+
+ ///
+ /// Retrieves the bandwidth reservation properties of the volume on which the specified file resides.
+ ///
+ ///
+ /// A handle to the file.
+ ///
+ ///
+ ///
+ /// A pointer to a variable that receives the period of the reservation, in milliseconds. The period is the time from which the I/O
+ /// is issued to the kernel until the time the I/O should be completed. If no bandwidth has been reserved for this handle, then the
+ /// value returned is the minimum reservation period supported for this volume.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a variable that receives the maximum number of bytes per period that can be reserved on the volume. If no bandwidth
+ /// has been reserved for this handle, then the value returned is the maximum number of bytes per period supported for the volume.
+ ///
+ ///
+ ///
+ ///
+ /// TRUE if I/O should be completed with an error if a driver is unable to satisfy an I/O operation before the period expires.
+ /// FALSE if the underlying subsystem does not support failing in this manner.
+ ///
+ ///
+ ///
+ ///
+ /// The minimum size of any individual I/O request that may be issued by the application. All I/O requests should be multiples of
+ /// TransferSize. If no bandwidth has been reserved for this handle, then the value returned is the minimum transfer size supported
+ /// for this volume.
+ ///
+ ///
+ ///
+ /// The number of TransferSize chunks allowed to be outstanding with the operating system.
+ ///
+ ///
+ /// Returns nonzero if successful or zero otherwise.
+ /// To get extended error information, call GetLastError.
+ ///
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfilebandwidthreservation BOOL
+ // GetFileBandwidthReservation( HANDLE hFile, LPDWORD lpPeriodMilliseconds, LPDWORD lpBytesPerPeriod, LPBOOL pDiscardable, LPDWORD
+ // lpTransferSize, LPDWORD lpNumOutstandingRequests );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "3caf38f6-e853-4057-a192-71cda4443dbd")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetFileBandwidthReservation(SafeFileHandle hFile, out uint lpPeriodMilliseconds, out uint lpBytesPerPeriod, [MarshalAs(UnmanagedType.Bool)] out bool pDiscardable, out uint lpTransferSize, out uint lpNumOutstandingRequests);
+
+ ///
+ /// Retrieves file information for the specified file.
+ /// For a more basic version of this function for desktop apps, see GetFileInformationByHandle.
+ /// To set file information using a file handle, see SetFileInformationByHandle.
+ ///
+ ///
+ /// A handle to the file that contains the information to be retrieved.
+ /// This handle should not be a pipe handle.
+ ///
+ ///
+ /// A FILE_INFO_BY_HANDLE_CLASS enumeration value that specifies the type of information to be retrieved.
+ /// For a table of valid values, see the Remarks section.
+ ///
+ ///
+ ///
+ /// A pointer to the buffer that receives the requested file information. The structure that is returned corresponds to the class
+ /// that is specified by FileInformationClass. For a table of valid structure types, see the Remarks section.
+ ///
+ ///
+ ///
+ /// The size of the lpFileInformation buffer, in bytes.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero and file information data is contained in the buffer pointed to by the
+ /// lpFileInformation parameter.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// If FileInformationClass is FileStreamInfo and the calls succeed but no streams are returned, the error that is returned by
+ /// GetLastError is ERROR_HANDLE_EOF.
+ ///
+ ///
+ /// Certain file information classes behave slightly differently on different operating system releases. These classes are supported
+ /// by the underlying drivers, and any information they return is subject to change between operating system releases.
+ ///
+ ///
+ /// The following table shows the valid file information class types and their corresponding data structure types for use with this function.
+ ///
+ ///
+ ///
+ /// FileInformationClass value
+ /// lpFileInformation type
+ ///
+ /// -
+ /// FileBasicInfo (0)
+ /// FILE_BASIC_INFO
+ ///
+ /// -
+ /// FileStandardInfo (1)
+ /// FILE_STANDARD_INFO
+ ///
+ /// -
+ /// FileNameInfo (2)
+ /// FILE_NAME_INFO
+ ///
+ /// -
+ /// FileStreamInfo (7)
+ /// FILE_STREAM_INFO
+ ///
+ /// -
+ /// FileCompressionInfo (8)
+ /// FILE_COMPRESSION_INFO
+ ///
+ /// -
+ /// FileAttributeTagInfo (9)
+ /// FILE_ATTRIBUTE_TAG_INFO
+ ///
+ /// -
+ /// FileIdBothDirectoryInfo (0xa)
+ /// FILE_ID_BOTH_DIR_INFO
+ ///
+ /// -
+ /// FileIdBothDirectoryRestartInfo (0xb)
+ /// FILE_ID_BOTH_DIR_INFO
+ ///
+ /// -
+ /// FileRemoteProtocolInfo (0xd)
+ /// FILE_REMOTE_PROTOCOL_INFO
+ ///
+ /// -
+ /// FileFullDirectoryInfo (0xe)
+ /// FILE_FULL_DIR_INFO
+ ///
+ /// -
+ /// FileFullDirectoryRestartInfo (0xf)
+ /// FILE_FULL_DIR_INFO
+ ///
+ /// -
+ /// FileStorageInfo (0x10)
+ /// FILE_STORAGE_INFO
+ ///
+ /// -
+ /// FileAlignmentInfo (0x11)
+ /// FILE_ALIGNMENT_INFO
+ ///
+ /// -
+ /// FileIdInfo (0x12)
+ /// FILE_ID_INFO
+ ///
+ /// -
+ /// FileIdExtdDirectoryInfo (0x13)
+ /// FILE_ID_EXTD_DIR_INFO
+ ///
+ /// -
+ /// FileIdExtdDirectoryRestartInfo (0x14)
+ /// FILE_ID_EXTD_DIR_INFO
+ ///
+ ///
+ /// Transacted Operations
+ ///
+ /// If there is a transaction bound to the thread at the time of the call, then the function returns the compressed file size of the
+ /// isolated file view. For more information, see About Transactional NTFS.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex BOOL
+ // GetFileInformationByHandleEx( HANDLE hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, LPVOID lpFileInformation, DWORD
+ // dwBufferSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "e261ea45-d084-490e-94b4-129bd76f6a04")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetFileInformationByHandleEx(SafeFileHandle hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, IntPtr lpFileInformation, uint dwBufferSize);
+
+ ///
+ /// Retrieves the value of the specified firmware environment variable and its attributes.
+ ///
+ ///
+ /// The name of the firmware environment variable. The pointer must not be NULL.
+ ///
+ ///
+ ///
+ /// The GUID that represents the namespace of the firmware environment variable. The GUID must be a string in the format
+ /// "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" where 'x' represents a hexadecimal value. The pointer must not be NULL.
+ ///
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// The size of the pValue buffer, in bytes.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// If the function succeeds, the return value is the number of bytes stored in the pValue buffer.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error codes
+ /// include ERROR_INVALID_FUNCTION.
+ ///
+ ///
+ ///
+ ///
+ /// Starting with Windows 10, version 1803, Universal Windows apps can read and write UEFI firmware variables. See Access UEFI
+ /// firmware variables from a Universal Windows App for details.
+ ///
+ ///
+ /// To read a UEFI firmware environment variable, the user account that the app is running under must have the
+ /// SE_SYSTEM_ENVIRONMENT_NAME privilege. A Universal Windows app must be run from an administrator account and follow the
+ /// requirements outlined in Access UEFI firmware variables from a Universal Windows App .
+ ///
+ ///
+ /// Starting with Windows 10, version 1803, reading Unified Extensible Firmware Interface (UEFI) variables is also supported from
+ /// User-Mode Driver Framework (UMDF) drivers. Writing UEFI variables from UMDF drivers is not supported.
+ ///
+ ///
+ /// The exact set of firmware environment variables is determined by the boot firmware. The location of these environment variables
+ /// is also specified by the firmware. For example, on a UEFI-based system, NVRAM contains firmware environment variables that
+ /// specify system boot settings. For information about specific variables used, see the UEFI specification. For more information
+ /// about UEFI and Windows, see UEFI and Windows.
+ ///
+ ///
+ /// Firmware variables are not supported on a legacy BIOS-based system. The GetFirmwareEnvironmentVariableEx function will
+ /// always fail on a legacy BIOS-based system, or if Windows was installed using legacy BIOS on a system that supports both legacy
+ /// BIOS and UEFI. To identify these conditions, call the function with a dummy firmware environment name such as an empty string
+ /// ("") for the lpName parameter and a dummy GUID such as "{00000000-0000-0000-0000-000000000000}" for the lpGuid parameter. On a
+ /// legacy BIOS-based system, or on a system that supports both legacy BIOS and UEFI where Windows was installed using legacy BIOS,
+ /// the function will fail with ERROR_INVALID_FUNCTION. On a UEFI-based system, the function will fail with an error specific to the
+ /// firmware, such as ERROR_NOACCESS, to indicate that the dummy GUID namespace does not exist.
+ ///
+ ///
+ /// If you are creating a backup application, you can use this function to save all the boot settings for the system so they can be
+ /// restored using the SetFirmwareEnvironmentVariable function if needed.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfirmwareenvironmentvariableexa DWORD
+ // GetFirmwareEnvironmentVariableExA( LPCSTR lpName, LPCSTR lpGuid, PVOID pBuffer, DWORD nSize, PDWORD pdwAttribubutes );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "B093BA68-C68B-4ED6-9902-058650A191FD")]
+ public static extern Win32Error GetFirmwareEnvironmentVariableEx(string lpName, string lpGuid, IntPtr pBuffer, uint nSize, ref uint pdwAttribubutes);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Retrieves the full path and file name of the specified file as a transacted operation.
+ /// To perform this operation without transactions, use the GetFullPathName function.
+ /// For more information about file and path names, see File Names, Paths, and Namespaces.
+ ///
+ ///
+ /// The name of the file.
+ /// This string can use short (the 8.3 form) or long file names. This string can be a share or volume name.
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// The size of the buffer to receive the null-terminated string for the drive and path, in TCHARs.
+ ///
+ ///
+ /// A pointer to a buffer that receives the null-terminated string for the drive and path.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer that receives the address (in lpBuffer) of the final file name component in the path. Specify NULL
+ /// if you do not need to receive this information.
+ ///
+ /// If lpBuffer points to a directory and not a file, lpFilePart receives 0 (zero).
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the length, in TCHARs, of the string copied to lpBuffer, not including the
+ /// terminating null character.
+ ///
+ ///
+ /// If the lpBuffer buffer is too small to contain the path, the return value is the size, in TCHARs, of the buffer that is
+ /// required to hold the path and the terminating null character.
+ ///
+ /// If the function fails for any other reason, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// GetFullPathNameTransacted merges the name of the current drive and directory with a specified file name to determine the
+ /// full path and file name of a specified file. It also calculates the address of the file name portion of the full path and file
+ /// name. This function does not verify that the resulting path and file name are valid, or that they see an existing file on the
+ /// associated volume.
+ ///
+ ///
+ /// Share and volume names are valid input for lpFileName. For example, the following list identities the returned path and file
+ /// names if test-2 is a remote computer and U: is a network mapped drive:
+ ///
+ ///
+ /// -
+ /// If you specify "\\test-2\q$\lh" the path returned is "\\test-2\q$\lh"
+ ///
+ /// -
+ /// If you specify "\\?\UNC\test-2\q$\lh" the path returned is "\\?\UNC\test-2\q$\lh"
+ ///
+ /// -
+ /// If you specify "U:" the path returned is "U:\"
+ ///
+ ///
+ ///
+ /// GetFullPathNameTransacted does not convert the specified file name, lpFileName. If the specified file name exists, you can
+ /// use GetLongPathNameTransacted, GetLongPathName, or GetShortPathName to convert to long or short path names, respectively.
+ ///
+ ///
+ /// If the return value is greater than the value specified in nBufferLength, you can call the function again with a buffer that is
+ /// large enough to hold the path. For an example of this case as well as using zero length buffer for dynamic allocation, see the
+ /// Example Code section.
+ ///
+ ///
+ /// Note Although the return value in this case is a length that includes the terminating null character, the return value on
+ /// success does not include the terminating null character in the count.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfullpathnametransacteda DWORD
+ // GetFullPathNameTransactedA( LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "63cbcec6-e9f0-4db3-bf2f-03a987000af1")]
+ public static extern uint GetFullPathNameTransacted(string lpFileName, uint nBufferLength, StringBuilder lpBuffer, ref IntPtr lpFilePart, IntPtr hTransaction);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Converts the specified path to its long form as a transacted operation.
+ /// To perform this operation without a transaction, use the GetLongPathName function.
+ /// For more information about file and path names, see Naming Files, Paths, and Namespaces.
+ ///
+ ///
+ /// The path to be converted.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH (260) characters. To extend this limit to 32,767
+ /// wide characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming Files,
+ /// Paths, and Namespaces.
+ ///
+ /// The path must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// A pointer to the buffer to receive the long path.
+ /// You can use the same buffer you used for the lpszShortPath parameter.
+ ///
+ ///
+ /// The size of the buffer lpszLongPath points to, in TCHAR s.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the length, in TCHAR s, of the string copied to lpszLongPath, not including
+ /// the terminating null character.
+ ///
+ ///
+ /// If the lpBuffer buffer is too small to contain the path, the return value is the size, in TCHAR s, of the buffer that is
+ /// required to hold the path and the terminating null character.
+ ///
+ ///
+ /// If the function fails for any other reason, such as if the file does not exist, the return value is zero. To get extended error
+ /// information, call GetLastError.
+ ///
+ ///
+ ///
+ /// On many file systems, a short file name contains a tilde () character.
+ ///
+ /// If a long path is not found, this function returns the name specified in the lpszShortPath parameter in the lpszLongPath parameter.
+ ///
+ ///
+ /// If the return value is greater than the value specified in cchBuffer, you can call the function again with a buffer that is large
+ /// enough to hold the path. For an example of this case, see the Example Code section for GetFullPathName.
+ ///
+ ///
+ /// Note Although the return value in this case is a length that includes the terminating null character, the return value on
+ /// success does not include the terminating null character in the count.
+ ///
+ ///
+ /// It is possible to have access to a file or directory but not have access to some of the parent directories of that file or
+ /// directory. As a result, GetLongPathNameTransacted may fail when it is unable to query the parent directory of a path
+ /// component to determine the long name for that component. This check can be skipped for directory components that have file
+ /// extensions longer than 3 characters, or total lengths longer than 12 characters. For more information, see the Short vs. Long
+ /// Names section of Naming Files, Paths, and Namespaces.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getlongpathnametransacteda DWORD
+ // GetLongPathNameTransactedA( LPCSTR lpszShortPath, LPSTR lpszLongPath, DWORD cchBuffer, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "8523cde9-f0dd-4832-8d9d-9e68bac89344")]
+ public static extern uint GetLongPathNameTransacted(string lpszShortPath, StringBuilder lpszLongPath, uint cchBuffer, IntPtr hTransaction);
+
+ ///
+ /// Returns the maximum number of logical processors that a processor group or the system can have.
+ ///
+ ///
+ ///
+ /// The processor group number. If this parameter is ALL_PROCESSOR_GROUPS, the function returns the maximum number of processors that
+ /// the system can have.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the maximum number of processors that the specified group can have.
+ /// If the function fails, the return value is zero. To get extended error information, use GetLastError.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getmaximumprocessorcount DWORD GetMaximumProcessorCount(
+ // WORD GroupNumber );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "71ce4fb4-ef63-4750-a842-bbfb1a5b0543")]
+ public static extern uint GetMaximumProcessorCount(ushort GroupNumber);
+
+ ///
+ /// Returns the maximum number of processor groups that the system can have.
+ ///
+ ///
+ /// If the function succeeds, the return value is the maximum number of processor groups that the system can have.
+ /// If the function fails, the return value is zero.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getmaximumprocessorgroupcount WORD
+ // GetMaximumProcessorGroupCount( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "7762ec89-5892-4af3-9032-bf084aef9075")]
+ public static extern ushort GetMaximumProcessorGroupCount();
+
+ ///
+ /// Retrieves the client process identifier for the specified named pipe.
+ ///
+ ///
+ /// A handle to an instance of a named pipe. This handle must be created by the CreateNamedPipe function.
+ ///
+ ///
+ /// The process identifier.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ ///
+ /// Windows 10, version 1709: Pipes are only supported within an app-container; ie, from one UWP process to another UWP
+ /// process that's part of the same app. Also, named pipes must use the syntax "\.\pipe\LOCAL" for the pipe name.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnamedpipeclientprocessid BOOL
+ // GetNamedPipeClientProcessId( HANDLE Pipe, PULONG ClientProcessId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "7001eb89-3d91-44e3-b245-b19e8ab5f9fe")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNamedPipeClientProcessId(IntPtr Pipe, out uint ClientProcessId);
+
+ ///
+ /// Retrieves the client session identifier for the specified named pipe.
+ ///
+ ///
+ /// A handle to an instance of a named pipe. This handle must be created by the CreateNamedPipe function.
+ ///
+ ///
+ /// The session identifier.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ ///
+ /// Windows 10, version 1709: Pipes are only supported within an app-container; ie, from one UWP process to another UWP
+ /// process that's part of the same app. Also, named pipes must use the syntax "\.\pipe\LOCAL" for the pipe name.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnamedpipeclientsessionid BOOL
+ // GetNamedPipeClientSessionId( HANDLE Pipe, PULONG ClientSessionId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "b3ea0b7f-fead-4369-b87a-2f522a2a1984")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNamedPipeClientSessionId(IntPtr Pipe, out uint ClientSessionId);
+
+ ///
+ /// Retrieves the server process identifier for the specified named pipe.
+ ///
+ ///
+ /// A handle to an instance of a named pipe. This handle must be created by the CreateNamedPipe function.
+ ///
+ ///
+ /// The process identifier.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ ///
+ /// Windows 10, version 1709: Pipes are only supported within an app-container; ie, from one UWP process to another UWP
+ /// process that's part of the same app. Also, named pipes must use the syntax "\.\pipe\LOCAL" for the pipe name.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnamedpipeserverprocessid BOOL
+ // GetNamedPipeServerProcessId( HANDLE Pipe, PULONG ServerProcessId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "1ee33a66-a71c-4c34-b907-aab7860294c4")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNamedPipeServerProcessId(IntPtr Pipe, out uint ServerProcessId);
+
+ ///
+ /// Retrieves the server session identifier for the specified named pipe.
+ ///
+ ///
+ /// A handle to an instance of a named pipe. This handle must be created by the CreateNamedPipe function.
+ ///
+ ///
+ /// The session identifier.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ ///
+ /// Windows 10, version 1709: Pipes are only supported within an app-container; ie, from one UWP process to another UWP
+ /// process that's part of the same app. Also, named pipes must use the syntax "\.\pipe\LOCAL" for the pipe name.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnamedpipeserversessionid BOOL
+ // GetNamedPipeServerSessionId( HANDLE Pipe, PULONG ServerSessionId );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "cd628d6d-aa13-4762-893b-42f6cf7a2ba6")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNamedPipeServerSessionId(IntPtr Pipe, out uint ServerSessionId);
+
+ ///
+ /// Retrieves the amount of memory that is available in a node specified as a USHORT value.
+ ///
+ ///
+ /// The number of the node.
+ ///
+ ///
+ /// The amount of available memory for the node, in bytes.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The GetNumaAvailableMemoryNodeEx function returns the amount of memory consumed by free and zeroed pages on the specified
+ /// node. On systems with more than one node, this memory does not include standby pages. Therefore, the sum of the available memory
+ /// values for all nodes in the system is equal to the value of the Free & Zero Page List Bytes memory performance counter. On
+ /// systems with only one node, the value returned by GetNumaAvailableMemoryNode includes standby pages and is equal to the value of
+ /// the Available Bytes memory performance counter. For more information about performance counters, see Memory Performance Information.
+ ///
+ ///
+ /// The only difference between the GetNumaAvailableMemoryNodeEx function and the GetNumaAvailableMemoryNode function is the
+ /// data type of the Node parameter.
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnumaavailablememorynodeex BOOL
+ // GetNumaAvailableMemoryNodeEx( USHORT Node, PULONGLONG AvailableBytes );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "59382114-f3da-45e0-843e-51c0fd52a164")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNumaAvailableMemoryNodeEx(ushort Node, out ulong AvailableBytes);
+
+ ///
+ /// Retrieves the NUMA node associated with the file or I/O device represented by the specified file handle.
+ ///
+ ///
+ ///
+ /// A handle to a file or I/O device. Examples of I/O devices include files, file streams, volumes, physical disks, and sockets. For
+ /// more information, see the CreateFile function.
+ ///
+ ///
+ ///
+ /// A pointer to a variable to receive the number of the NUMA node associated with the specified file handle.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, use GetLastError.
+ ///
+ ///
+ ///
+ /// If the specified handle does not have a node associated with it, the function returns FALSE. The value of the NodeNumber
+ /// parameter is undetermined and should not be used.
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnumanodenumberfromhandle BOOL
+ // GetNumaNodeNumberFromHandle( HANDLE hFile, PUSHORT NodeNumber );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "7622f7c9-2dfc-4ab7-b3e9-48d483c6cc0e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNumaNodeNumberFromHandle(IntPtr hFile, out ushort NodeNumber);
+
+ ///
+ /// Retrieves the node number as a USHORT value for the specified logical processor.
+ ///
+ ///
+ ///
+ /// A pointer to a PROCESSOR_NUMBER structure that represents the logical processor and the processor group to which it is assigned.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a variable to receive the node number. If the specified processor does not exist, this parameter is set to MAXUSHORT.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, set _WIN32_WINNT >= 0x0601. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnumaprocessornodeex BOOL GetNumaProcessorNodeEx(
+ // PPROCESSOR_NUMBER Processor, PUSHORT NodeNumber );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "6b843cd8-eeb5-4aa1-aad4-ce98916346b1")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNumaProcessorNodeEx(ref PROCESSOR_NUMBER Processor, out ushort NodeNumber);
+
+ ///
+ /// Retrieves the NUMA node number that corresponds to the specified proximity domain identifier.
+ /// Use the GetNumaProximityNodeEx function to retrieve the node number as a USHORT value.
+ ///
+ ///
+ /// The proximity domain identifier of the node.
+ ///
+ ///
+ /// The node number. If the processor does not exist, this parameter is 0xFF.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// A proximity domain identifier is an index to a NUMA node on a NUMA system. Proximity domain identifiers are found in the ACPI
+ /// System Resource Affinity Table (SRAT), where they are used to associate processors and memory regions with a particular NUMA
+ /// node. Proximity domain identifiers are also found in the ACPI namespace, where they are used to associate a device with a
+ /// particular NUMA node. Proximity domain identifiers are typically used only by management applications provided by system
+ /// manufacturers. Windows does not use proximity domain identifiers to identify NUMA nodes; instead, it assigns a unique number to
+ /// each NUMA node in the system.
+ ///
+ ///
+ /// The relative distance between nodes on a system is stored in the ACPI System Locality Distance Information Table (SLIT), which is
+ /// not exposed by any Windows functions. For more information about ACPI tables, see the ACPI specifications.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getnumaproximitynode BOOL GetNumaProximityNode( ULONG
+ // ProximityId, PUCHAR NodeNumber );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "9a2dbfe3-13e7-442d-a5f6-b2632878f618")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetNumaProximityNode(uint ProximityId, out byte NodeNumber);
+
+ ///
+ ///
+ /// Gets the data execution prevention (DEP) and DEP-ATL thunk emulation settings for the specified 32-bit process. Windows XP
+ /// with SP3: Gets the DEP and DEP-ATL thunk emulation settings for the current process.
+ ///
+ ///
+ ///
+ /// A handle to the process. PROCESS_QUERY_INFORMATION privilege is required to get the DEP policy of a process.
+ /// Windows XP with SP3: The hProcess parameter is ignored.
+ ///
+ ///
+ /// A DWORD that receives one or more of the following flags.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// 0
+ /// DEP is disabled for the specified process.
+ ///
+ /// -
+ /// PROCESS_DEP_ENABLE 0x00000001
+ /// DEP is enabled for the specified process.
+ ///
+ /// -
+ /// PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
+ /// DEP-ATL thunk emulation is disabled for the specified process. For information about DEP-ATL thunk emulation, see SetProcessDEPPolicy.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// TRUE if DEP is enabled or disabled permanently for the specified process; otherwise FALSE. If lpPermanent is
+ /// TRUE, the current DEP setting persists for the life of the process and cannot be changed by calling SetProcessDEPPolicy.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE. To retrieve error values defined for this function, call GetLastError.
+ ///
+ ///
+ ///
+ /// GetProcessDEPPolicy is supported for 32-bit processes only. If this function is called on a 64-bit process, it fails with ERROR_NOT_SUPPORTED.
+ ///
+ ///
+ /// To compile an application that calls this function, define _WIN32_WINNT as 0x0600 or later. For more information, see
+ /// Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getprocessdeppolicy BOOL GetProcessDEPPolicy( HANDLE
+ // hProcess, LPDWORD lpFlags, PBOOL lpPermanent );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "adf15b9c-24f4-49ea-9283-0db5f3f13e65")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetProcessDEPPolicy(IntPtr hProcess, out PROCESS_DEP lpFlags, [MarshalAs(UnmanagedType.Bool)] out bool lpPermanent);
+
+ ///
+ /// Gets the data execution prevention (DEP) policy setting for the system.
+ ///
+ ///
+ /// This function returns a value of type DEP_SYSTEM_POLICY_TYPE, which can be one of the following values.
+ ///
+ ///
+ /// Return code/value
+ /// Description
+ ///
+ /// -
+ /// AlwaysOff 0
+ ///
+ /// DEP is disabled for all parts of the system, regardless of hardware support for DEP. The processor runs in PAE mode with 32-bit
+ /// versions of Windows unless PAE is disabled in the boot configuration data.
+ ///
+ ///
+ /// -
+ /// AlwaysOn 1
+ ///
+ /// DEP is enabled for all parts of the system. All processes always run with DEP enabled. DEP cannot be explicitly disabled for
+ /// selected applications. System compatibility fixes are ignored.
+ ///
+ ///
+ /// -
+ /// OptIn 2
+ ///
+ /// On systems with processors that are capable of hardware-enforced DEP, DEP is automatically enabled only for operating system
+ /// components. This is the default setting for client versions of Windows. DEP can be explicitly enabled for selected applications
+ /// or the current process.
+ ///
+ ///
+ /// -
+ /// OptOut 3
+ ///
+ /// DEP is automatically enabled for operating system components and all processes. This is the default setting for Windows Server
+ /// versions. DEP can be explicitly disabled for selected applications or the current process. System compatibility fixes for DEP are
+ /// in effect.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The system-wide DEP policy is configured at boot time according to the policy setting in the boot configuration data. To change
+ /// the system-wide DEP policy setting, use the BCDEdit /set command to set the nx boot entry option.
+ ///
+ ///
+ /// If the system DEP policy is OptIn or OptOut, DEP can be selectively enabled or disabled for the current process by calling the
+ /// SetProcessDEPPolicy function. This function works only for 32-bit processes.
+ ///
+ ///
+ /// A user with administrative privileges can disable DEP for selected applications by using the System Control Panel
+ /// application. If the system DEP policy is OptOut, DEP is disabled for these applications.
+ ///
+ ///
+ /// The Application Compatibility Toolkit can be used to create a list of individual applications that are exempt from DEP. If the
+ /// system DEP policy is OptOut, DEP is automatically disabled for applications on the list.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getsystemdeppolicy DEP_SYSTEM_POLICY_TYPE
+ // GetSystemDEPPolicy( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "82cb1d4e-c0e5-4601-aa55-9171a106c286")]
+ public static extern DEP_SYSTEM_POLICY_TYPE GetSystemDEPPolicy();
+
+ ///
+ /// Retrieves a handle to the event associated with the specified user-mode scheduling (UMS) completion list.
+ ///
+ ///
+ /// A pointer to a UMS completion list. The CreateUmsCompletionList function provides this pointer.
+ ///
+ ///
+ ///
+ /// A pointer to a HANDLE variable. On output, the UmsCompletionEvent parameter is set to a handle to the event associated with the
+ /// specified completion list.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The system signals a UMS completion list event when the system queues items to an empty completion list. A completion list event
+ /// handle can be used with any wait function that takes a handle to an event. When the event is signaled, an application typically
+ /// calls DequeueUmsCompletionListItems to retrieve the contents of the completion list.
+ ///
+ ///
+ /// The event handle remains valid until its completion list is deleted. Do not use the event handle to wait on a completion list
+ /// that has been deleted or is in the process of being deleted.
+ ///
+ /// When the handle is no longer needed, use the CloseHandle function to close the handle.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getumscompletionlistevent BOOL GetUmsCompletionListEvent(
+ // PUMS_COMPLETION_LIST UmsCompletionList, PHANDLE UmsCompletionEvent );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "393f6e0a-fbea-4aa0-9c18-f96da18e61e9")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetUmsCompletionListEvent(IntPtr UmsCompletionList, out IntPtr UmsCompletionEvent);
+
+ ///
+ /// Queries whether the specified thread is a UMS scheduler thread, a UMS worker thread, or a non-UMS thread.
+ ///
+ ///
+ ///
+ /// A handle to a thread. The thread handle must have the THREAD_QUERY_INFORMATION access right. For more information, see Thread
+ /// Security and Access Rights.
+ ///
+ ///
+ ///
+ /// A pointer to an initialized UMS_SYSTEM_THREAD_INFORMATION structure that specifies the kind of thread for the query.
+ ///
+ ///
+ ///
+ /// Returns TRUE if the specified thread matches the kind of thread specified by the SystemThreadInfo parameter. Otherwise, the
+ /// function returns FALSE.
+ ///
+ ///
+ ///
+ ///
+ /// The GetUmsSystemThreadInformation function is intended for use in debuggers, troubleshooting tools, and profiling
+ /// applications. For example, thread-isolated tracing or single-stepping through instructions might involve suspending all other
+ /// threads in the process. However, if the thread to be traced is a UMS worker thread, suspending UMS scheduler threads might cause
+ /// a deadlock because a UMS worker thread requires the intervention of a UMS scheduler thread in order to run. A debugger can call
+ /// GetUmsSystemThreadInformation for each thread that it might suspend to determine the kind of thread, and then suspend it
+ /// or not as needed for the code being debugged.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getumssystemthreadinformation BOOL
+ // GetUmsSystemThreadInformation( HANDLE ThreadHandle, PUMS_SYSTEM_THREAD_INFORMATION SystemThreadInfo );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "7c8347b6-6546-4ea9-9b2a-11794782f482")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetUmsSystemThreadInformation(IntPtr ThreadHandle, ref UMS_SYSTEM_THREAD_INFORMATION SystemThreadInfo);
+
+ ///
+ /// Returns the mask of XState features set within a CONTEXT structure.
+ ///
+ ///
+ /// A pointer to a CONTEXT structure that has been initialized with InitializeContext.
+ ///
+ ///
+ /// A pointer to a variable that receives the mask of XState features which are present in the specified CONTEXT structure.
+ ///
+ ///
+ /// This function returns TRUE if successful, otherwise FALSE.
+ ///
+ ///
+ ///
+ /// The GetXStateFeaturesMask function returns the mask of valid features in the specified context. If a CONTEXT is to be
+ /// passed to GetThreadContext or Wow64GetThreadContext, the application must call SetXStateFeaturesMask to set which features are to
+ /// be retrieved. GetXStateFeaturesMask should then be called on the CONTEXT returned by GetThreadContext or
+ /// Wow64GetThreadContext to determine which feature areas contain valid data. If a particular feature bit is not set, the
+ /// corresponding state is in a processor-specific INITIALIZED state and the contents of the feature area retrieved by
+ /// LocateXStateFeature are undefined.
+ ///
+ ///
+ /// The definition of XState features are processor vendor specific. Please refer to the relevant processor reference manuals for
+ /// additional information on a particular feature.
+ ///
+ ///
+ /// Note The value returned by GetXStateFeaturesMask on a CONTEXT after a context operation will always be a subset of
+ /// the mask specified in a call to SetXStateFeaturesMask prior to the context operation.
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getxstatefeaturesmask BOOL GetXStateFeaturesMask( PCONTEXT
+ // Context, PDWORD64 FeatureMask );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "D9A8D0B6-21E3-46B7-AB88-CE2FF4025A17")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetXStateFeaturesMask(IntPtr Context, out ulong FeatureMask);
+
+ ///
+ /// Initializes a CONTEXT structure inside a buffer with the necessary size and alignment.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer within which to initialize a CONTEXT structure. This parameter can be NULL to determine the buffer
+ /// size required to hold a context record with the specified .
+ ///
+ ///
+ ///
+ ///
+ /// A value indicating which portions of the structure should be initialized. This parameter influences the size of the initialized structure.
+ ///
+ ///
+ /// NoteCONTEXT_XSTATE is not part of CONTEXT_FULL or CONTEXT_ALL. It must be specified separately if an
+ /// XState context is desired.
+ ///
+ ///
+ ///
+ /// A pointer to a variable which receives the address of the initialized CONTEXT structure within the .
+ ///
+ /// Note Due to alignment requirements of CONTEXT structures, the value returned in may not be at the beginning of the
+ /// supplied buffer.
+ ///
+ ///
+ ///
+ ///
+ /// On input, specifies the length of the buffer pointed to by , in bytes. If the buffer is not large enough to contain the specified
+ /// portions of the CONTEXT, the function fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and is set to the required
+ /// size of the buffer. If the function fails with an error other than ERROR_INSUFFICIENT_BUFFER, the contents of are undefined.
+ ///
+ ///
+ ///
+ /// This function returns TRUE if successful, otherwise FALSE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// can be used to initialize a CONTEXT structure within a buffer with the required size and alignment characteristics. This routine
+ /// is required if the CONTEXT_XSTATE is specified since the required context size and alignment may change depending on which
+ /// processor features are enabled on the system.
+ ///
+ ///
+ /// First, call this function with the parameter set to the maximum number of features you will be using and the parameter to
+ /// NULL. The function returns the required buffer size in bytes in the parameter. Allocate enough space for the data in the
+ /// and call the function again to initialize the . Upon successful completion of this routine, the member of the structure is
+ /// initialized, but the remaining contents of the structure are undefined. Some bits specified in the parameter may not be set in
+ /// -> if they are not supported by the system. Applications may subsequently remove, but must never add, bits from the member of CONTEXT.
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-initializecontext BOOL InitializeContext( PVOID Buffer,
+ // DWORD ContextFlags, PCONTEXT *Context, PDWORD ContextLength );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "909BF5F7-0622-4B22-A2EC-27722389700A")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool InitializeContext(IntPtr Buffer, CONTEXT_FLAG ContextFlags, out IntPtr Context, ref uint ContextLength);
+
+ ///
+ /// Indicates if the OS was booted from a VHD container.
+ ///
+ ///
+ /// Pointer to a variable that receives a boolean indicating if the OS was booted from a VHD.
+ ///
+ ///
+ /// TRUE if the OS was a native VHD boot; otherwise, FALSE.
+ /// Call GetLastError to get extended error information.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-isnativevhdboot BOOL IsNativeVhdBoot( PBOOL NativeVhdBoot );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "8198D4AF-553D-42B3-AF22-EC2C63C0E9AE")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool IsNativeVhdBoot([MarshalAs(UnmanagedType.Bool)] out bool NativeVhdBoot);
+
+ ///
+ /// Loads the specified packaged module and its dependencies into the address space of the calling process.
+ ///
+ ///
+ ///
+ /// The file name of the packaged module to load. The module can be a library module (a .dll file) or an executable module (an .exe file).
+ ///
+ ///
+ /// If this parameter specifies a module name without a path and the file name extension is omitted, the function appends the default
+ /// library extension .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing
+ /// point character (.) in the module name string.
+ ///
+ ///
+ /// If this parameter specifies a path, the function searches that path for the module. The path cannot be an absolute path or a
+ /// relative path that contains ".." in the path. When specifying a path, be sure to use backslashes (), not forward slashes (/). For
+ /// more information about paths, see Naming Files, Paths, and Namespaces.
+ ///
+ ///
+ /// If the specified module is already loaded in the process, the function returns a handle to the loaded module. The module must
+ /// have been originally loaded from the package dependency graph of the process.
+ ///
+ ///
+ /// If loading the specified module causes the system to load other associated modules, the function first searches loaded modules,
+ /// then it searches the package dependency graph of the process. For more information, see Remarks.
+ ///
+ ///
+ ///
+ /// This parameter is reserved. It must be 0.
+ ///
+ ///
+ /// If the function succeeds, the return value is a handle to the loaded module.
+ /// If the function fails, the return value is NULL. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The LoadPackagedLibrary function is a simplified version of LoadLibraryEx. Windows Runtime apps can use
+ /// LoadPackagedLibrary to load packaged modules. Desktop applications cannot use LoadPackagedLibrary; if a desktop
+ /// application calls this function it fails with APPMODEL_ERROR_NO_PACKAGE.
+ ///
+ ///
+ /// LoadPackagedLibrary returns a handle to the specified module and increments its reference count. If the module is already
+ /// loaded, the function returns a handle to the loaded module. The calling process can use the handle returned by
+ /// LoadPackagedLibrary to identify the module in calls to the GetProcAddress function. Use the FreeLibrary function to free a
+ /// loaded module and decrement its reference count.
+ ///
+ ///
+ /// If the function must search for the specified module or its dependencies, it searches only the package dependency graph of the
+ /// process. This is the application's package plus any dependencies specified as in the section of the application's package
+ /// manifest. Dependencies are searched in the order they appear in the manifest. The package dependency graph is specified in the
+ /// section of the application's package manifest. Dependencies are searched in the order they appear in the manifest. The search
+ /// proceeds as follows:
+ ///
+ ///
+ /// -
+ ///
+ /// The function first searches modules that are already loaded. If the specified module was originally loaded from the package
+ /// dependency graph of the process, the function returns a handle to the loaded module. If the specified module was not loaded from
+ /// the package dependency graph of the process, the function returns NULL.
+ ///
+ ///
+ /// -
+ /// If the module is not already loaded, the function searches the package dependency graph of the process.
+ ///
+ /// -
+ /// If the function cannot find the specified module or one of its dependencies, the function fails.
+ ///
+ ///
+ /// It is not safe to call LoadPackagedLibrary from DllMain. For more information, see the Remarks section in DllMain.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-loadpackagedlibrary HMODULE LoadPackagedLibrary( LPCWSTR
+ // lpwLibFileName, DWORD Reserved );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "4a103753-a2c9-487f-b797-01d5f5d489f3")]
+ public static extern SafeLibraryHandle LoadPackagedLibrary([MarshalAs(UnmanagedType.LPWStr)] string lpwLibFileName, uint Reserved = 0);
+
+ ///
+ /// Retrieves a pointer to the processor state for an XState feature within a CONTEXT structure.
+ ///
+ /// The definition of XState feature bits are processor vendor specific. Please refer to the relevant processor reference manuals for
+ /// additional information on a particular feature.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a CONTEXT structure containing the state to retrieve or set. This CONTEXT should have been initialized with
+ /// InitializeContext with the CONTEXT_XSTATE flag set in the ContextFlags parameter.
+ ///
+ ///
+ ///
+ /// The number of the feature to locate within the CONTEXT structure.
+ ///
+ ///
+ ///
+ /// A pointer to a variable which receives the length of the feature area in bytes. The contents of this variable are undefined if
+ /// this function returns NULL.
+ ///
+ ///
+ ///
+ ///
+ /// If the specified feature is supported by the system and the specified CONTEXT structure has been initialized with the
+ /// CONTEXT_XSTATE flag, this function returns a pointer to the feature area for the specified feature. The contents and
+ /// layout of this area is processor-specific.
+ ///
+ ///
+ /// If the CONTEXT_XSTATE flag is not set in the CONTEXT structure or the FeatureID is not supported by the system, the return
+ /// value is NULL. No additional error information is available.
+ ///
+ ///
+ ///
+ ///
+ /// The LocateXStateFeature function must be used to find an individual XState feature within an extensible CONTEXT structure.
+ /// Features are not necessarily contiguous in memory and applications should not assume the offset between two consecutive features
+ /// will remain constant in the future.
+ ///
+ ///
+ /// The FeatureID parameter of the function corresponds to a bit within the feature mask. For example, FeatureId 2 corresponds to a
+ /// FeatureMask of 4 in SetXStateFeaturesMask. FeatureID values of 0 and 1 correspond to X87 FPU state and SSE state, respectively.
+ ///
+ ///
+ /// If you are setting XState on a thread via the SetThreadContext or Wow64SetThreadContext APIs, you must also call
+ /// SetXStateFeaturesMask on the CONTEXT structure with the mask value of the filled-in feature to mark the feature as active.
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-locatexstatefeature PVOID LocateXStateFeature( PCONTEXT
+ // Context, DWORD FeatureId, PDWORD Length );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "7AAEA13B-E4A4-4410-BFC7-09B81B92FF26")]
+ public static extern IntPtr LocateXStateFeature(IntPtr Context, uint FeatureId, out uint Length);
+
+ ///
+ /// Compares two character strings. The comparison is case-sensitive.
+ /// To perform a comparison that is not case-sensitive, use the lstrcmpi function.
+ ///
+ ///
+ /// Type: LPCTSTR
+ /// The first null-terminated string to be compared.
+ ///
+ ///
+ /// Type: LPCTSTR
+ /// The second null-terminated string to be compared.
+ ///
+ ///
+ /// Type: int
+ ///
+ /// If the string pointed to by lpString1 is less than the string pointed to by lpString2, the return value is negative. If the
+ /// string pointed to by lpString1 is greater than the string pointed to by lpString2, the return value is positive. If the strings
+ /// are equal, the return value is zero.
+ ///
+ ///
+ ///
+ ///
+ /// The lstrcmp function compares two strings by checking the first characters against each other, the second characters
+ /// against each other, and so on until it finds an inequality or reaches the ends of the strings.
+ ///
+ /// Note that the lpString1 and lpString2 parameters must be null-terminated, otherwise the string comparison can be incorrect.
+ ///
+ /// The function calls CompareStringEx, using the current thread locale, and subtracts 2 from the result, to maintain the C run-time
+ /// conventions for comparing strings.
+ ///
+ ///
+ /// The language (user locale) selected by the user at setup time, or through Control Panel, determines which string is greater (or
+ /// whether the strings are the same). If no language (user locale) is selected, the system performs the comparison by using default values.
+ ///
+ /// With a double-byte character set (DBCS) version of the system, this function can compare two DBCS strings.
+ ///
+ /// The lstrcmp function uses a word sort, rather than a string sort. A word sort treats hyphens and apostrophes differently
+ /// than it treats other symbols that are not alphanumeric, in order to ensure that words such as "coop" and "co-op" stay together
+ /// within a sorted list. For a detailed discussion of word sorts and string sorts, see Handling Sorting in Your Applications.
+ ///
+ /// Security Remarks
+ /// See Security Considerations: International Features for security considerations regarding
+ /// choice of comparison functions.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-lstrcmpa int lstrcmpA( LPCSTR lpString1, LPCSTR lpString2 );
+ [DllImport(Lib.Kernel32, SetLastError = false, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "windows/desktop/api/winbase/nf-winbase-lstrcmpa")]
+ public static extern int lstrcmp(string lpString1, string lpString2);
+
+ ///
+ /// Compares two character strings. The comparison is not case-sensitive.
+ /// To perform a comparison that is case-sensitive, use the lstrcmp function.
+ ///
+ ///
+ /// Type: LPCTSTR
+ /// The first null-terminated string to be compared.
+ ///
+ ///
+ /// Type: LPCTSTR
+ /// The second null-terminated string to be compared.
+ ///
+ ///
+ /// Type: int
+ ///
+ /// If the string pointed to by lpString1 is less than the string pointed to by lpString2, the return value is negative. If the
+ /// string pointed to by lpString1 is greater than the string pointed to by lpString2, the return value is positive. If the strings
+ /// are equal, the return value is zero.
+ ///
+ ///
+ ///
+ ///
+ /// The lstrcmpi function compares two strings by checking the first characters against each other, the second characters
+ /// against each other, and so on until it finds an inequality or reaches the ends of the strings.
+ ///
+ /// Note that the lpString1 and lpString2 parameters must be null-terminated, otherwise the string comparison can be incorrect.
+ ///
+ /// The function calls CompareStringEx, using the current thread locale, and subtracts 2 from the result, to maintain the C run-time
+ /// conventions for comparing strings.
+ ///
+ ///
+ /// For some locales, the lstrcmpi function may be insufficient. If this occurs, use CompareStringEx to ensure proper
+ /// comparison. For example, in Japan call with the NORM_IGNORECASE, NORM_IGNOREKANATYPE, and NORM_IGNOREWIDTH
+ /// values to achieve the most appropriate non-exact string comparison. The NORM_IGNOREKANATYPE and NORM_IGNOREWIDTH
+ /// values are ignored in non-Asian locales, so you can set these values for all locales and be guaranteed to have a culturally
+ /// correct "insensitive" sorting regardless of the locale. Note that specifying these values slows performance, so use them only
+ /// when necessary.
+ ///
+ /// With a double-byte character set (DBCS) version of the system, this function can compare two DBCS strings.
+ ///
+ /// The lstrcmpi function uses a word sort, rather than a string sort. A word sort treats hyphens and apostrophes differently
+ /// than it treats other symbols that are not alphanumeric, in order to ensure that words such as "coop" and "co-op" stay together
+ /// within a sorted list. For a detailed discussion of word sorts and string sorts, see Handling Sorting in Your Applications.
+ ///
+ /// Security Remarks
+ /// See Security Considerations: International Features for security considerations regarding
+ /// choice of comparison functions.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-lstrcmpia int lstrcmpiA( LPCSTR lpString1, LPCSTR
+ // lpString2 );
+ [DllImport(Lib.Kernel32, SetLastError = false, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "windows/desktop/api/winbase/nf-winbase-lstrcmpia")]
+ public static extern int lstrcmpi(string lpString1, string lpString2);
+
+ ///
+ /// Copies a specified number of characters from a source string into a buffer.
+ /// Warning Do not use. Consider using StringCchCopy instead. See Remarks.
+ ///
+ ///
+ /// Type: LPTSTR
+ ///
+ /// The destination buffer, which receives the copied characters. The buffer must be large enough to contain the number of
+ /// TCHAR values specified by iMaxLength, including room for a terminating null character.
+ ///
+ ///
+ ///
+ /// Type: LPCTSTR
+ /// The source string from which the function is to copy characters.
+ ///
+ ///
+ /// Type: int
+ ///
+ /// The number of TCHAR values to be copied from the string pointed to by lpString2 into the buffer pointed to by lpString1,
+ /// including a terminating null character.
+ ///
+ ///
+ ///
+ /// Type: LPTSTR
+ ///
+ /// If the function succeeds, the return value is a pointer to the buffer. The function can succeed even if the source string is
+ /// greater than iMaxLength characters.
+ ///
+ /// If the function fails, the return value is NULL and lpString1 may not be null-terminated.
+ ///
+ ///
+ ///
+ /// The buffer pointed to by lpString1 must be large enough to include a terminating null character, and the string length value
+ /// specified by iMaxLength includes room for a terminating null character.
+ ///
+ /// The lstrcpyn function has an undefined behavior if source and destination buffers overlap.
+ /// Security Warning
+ ///
+ /// Using this function incorrectly can compromise the security of your application. This function uses structured exception handling
+ /// (SEH) to catch access violations and other errors. When this function catches SEH errors, it returns NULL without
+ /// null-terminating the string and without notifying the caller of the error. The caller is not safe to assume that insufficient
+ /// space is the error condition.
+ ///
+ ///
+ /// If the buffer pointed to by lpString1 is not large enough to contain the copied string, a buffer overrun can occur. When copying
+ /// an entire string, note that sizeof returns the number of bytes. For example, if lpString1 points to a buffer szString1
+ /// which is declared as , then sizeof(szString1) gives the size of the buffer in bytes rather than WCHAR, which could lead to
+ /// a buffer overflow for the Unicode version of the function.
+ ///
+ ///
+ /// Buffer overflow situations are the cause of many security problems in applications and can cause a denial of service attack
+ /// against the application if an access violation occurs. In the worst case, a buffer overrun may allow an attacker to inject
+ /// executable code into your process, especially if lpString1 is a stack-based buffer.
+ ///
+ /// Using gives the proper size of the buffer.
+ ///
+ /// Consider using StringCchCopy instead; use either , being aware that must not be a pointer or use , being aware that, when copying
+ /// to a pointer, the caller is responsible for passing in the size of the pointed-to memory in characters.
+ ///
+ /// Review Security Considerations: Windows User Interface before continuing.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-lstrcpyna LPSTR lstrcpynA( LPSTR lpString1, LPCSTR
+ // lpString2, int iMaxLength );
+ [DllImport(Lib.Kernel32, SetLastError = false, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "windows/desktop/api/winbase/nf-winbase-lstrcpyna")]
+ public static extern IntPtr lstrcpyn(StringBuilder lpString1, string lpString2, int iMaxLength);
+
/// Determines the length of the specified string (not including the terminating null character).
///
/// Type: LPCTSTR
@@ -55,22 +4605,393 @@ namespace Vanara.PInvoke
/// Type: int
/// The function returns the length of the string, in characters. If lpString is NULL, the function returns 0.
///
- // int WINAPI lstrlen( _In_ LPCTSTR lpString);
- // https://msdn.microsoft.com/en-us/library/windows/desktop/ms647492(v=vs.85).aspx
+ // int WINAPI lstrlen( _In_ LPCTSTR lpString); https://msdn.microsoft.com/en-us/library/windows/desktop/ms647492(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, CharSet = CharSet.Auto, BestFitMapping = false, ThrowOnUnmappableChar = true)]
[PInvokeData("Winbase.h", MSDNShortId = "ms647492")]
- public static extern int lstrlen(string s);
+ public static extern int lstrlen(string lpString);
///
- /// Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The final result is rounded to the nearest integer.
+ ///
+ /// Maps a view of a file mapping into the address space of a calling process and specifies the NUMA node for the physical memory.
+ ///
+ ///
+ ///
+ /// A handle to a file mapping object. The CreateFileMappingNuma and OpenFileMapping functions return this handle.
+ ///
+ ///
+ ///
+ /// The type of access to a file mapping object, which determines the page protection of the pages. This parameter can be one of the
+ /// following values.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FILE_MAP_ALL_ACCESS
+ ///
+ /// A read/write view of the file is mapped. The file mapping object must have been created with PAGE_READWRITE or
+ /// PAGE_EXECUTE_READWRITE protection. When used with the MapViewOfFileExNuma function, FILE_MAP_ALL_ACCESS is equivalent to FILE_MAP_WRITE.
+ ///
+ ///
+ /// -
+ /// FILE_MAP_COPY
+ ///
+ /// A copy-on-write view of the file is mapped. The file mapping object must have been created with PAGE_READONLY, PAGE_READ_EXECUTE,
+ /// PAGE_WRITECOPY, PAGE_EXECUTE_WRITECOPY, PAGE_READWRITE, or PAGE_EXECUTE_READWRITE protection. When a process writes to a
+ /// copy-on-write page, the system copies the original page to a new page that is private to the process. The new page is backed by
+ /// the paging file. The protection of the new page changes from copy-on-write to read/write. When copy-on-write access is specified,
+ /// the system and process commit charge taken is for the entire view because the calling process can potentially write to every page
+ /// in the view, making all pages private. The contents of the new page are never written back to the original file and are lost when
+ /// the view is unmapped.
+ ///
+ ///
+ /// -
+ /// FILE_MAP_READ
+ ///
+ /// A read-only view of the file is mapped. An attempt to write to the file view results in an access violation. The file mapping
+ /// object must have been created with PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READ, or PAGE_EXECUTE_READWRITE protection.
+ ///
+ ///
+ /// -
+ /// FILE_MAP_WRITE
+ ///
+ /// A read/write view of the file is mapped. The file mapping object must have been created with PAGE_READWRITE or
+ /// PAGE_EXECUTE_READWRITE protection. When used with MapViewOfFileExNuma, and FILE_MAP_ALL_ACCESS are equivalent to FILE_MAP_WRITE.
+ ///
+ ///
+ ///
+ /// Each of the preceding values can be combined with the following value.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FILE_MAP_EXECUTE
+ ///
+ /// An executable view of the file is mapped (mapped memory can be run as code). The file mapping object must have been created with
+ /// PAGE_EXECUTE_READ, PAGE_EXECUTE_WRITECOPY, or PAGE_EXECUTE_READWRITE protection.
+ ///
+ ///
+ ///
+ ///
+ /// For file mapping objects created with the SEC_IMAGE attribute, the dwDesiredAccess parameter has no effect and should be
+ /// set to any valid value such as FILE_MAP_READ.
+ ///
+ /// For more information about access to file mapping objects, see File Mapping Security and Access Rights.
+ ///
+ ///
+ /// The high-order DWORD of the file offset where the view is to begin.
+ ///
+ ///
+ ///
+ /// The low-order DWORD of the file offset where the view is to begin. The combination of the high and low offsets must
+ /// specify an offset within the file mapping. They must also match the memory allocation granularity of the system. That is, the
+ /// offset must be a multiple of the allocation granularity. To obtain the memory allocation granularity of the system, use the
+ /// GetSystemInfo function, which fills in the members of a SYSTEM_INFO structure.
+ ///
+ ///
+ ///
+ ///
+ /// The number of bytes of a file mapping to map to a view. All bytes must be within the maximum size specified by CreateFileMapping.
+ /// If this parameter is 0 (zero), the mapping extends from the specified offset to the end of the file mapping.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to the memory address in the calling process address space where mapping begins. This must be a multiple of the
+ /// system's memory allocation granularity, or the function fails. To determine the memory allocation granularity of the system, use
+ /// the GetSystemInfo function. If there is not enough address space at the specified address, the function fails.
+ ///
+ /// If the lpBaseAddress parameter is NULL, the operating system chooses the mapping address.
+ ///
+ /// While it is possible to specify an address that is safe now (not used by the operating system), there is no guarantee that the
+ /// address will remain safe over time. Therefore, it is better to let the operating system choose the address. In this case, you
+ /// would not store pointers in the memory mapped file; you would store offsets from the base of the file mapping so that the mapping
+ /// can be used at any address.
+ ///
+ ///
+ ///
+ /// The NUMA node where the physical memory should reside.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// NUMA_NO_PREFERRED_NODE 0xffffffff
+ /// No NUMA node is preferred. This is the same as calling the MapViewOfFileEx function.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the starting address of the mapped view.
+ /// If the function fails, the return value is NULL. To get extended error information, call the GetLastError function.
+ ///
+ ///
+ /// Mapping a file makes the specified portion of the file visible in the address space of the calling process.
+ ///
+ /// For files that are larger than the address space, you can map only a small portion of the file data at one time. When the first
+ /// view is complete, then you unmap it and map a new view.
+ ///
+ /// To obtain the size of a view, use the VirtualQueryEx function.
+ /// The initial contents of the pages in a file mapping object backed by the page file are 0 (zero).
+ ///
+ /// If a suggested mapping address is supplied, the file is mapped at the specified address (rounded down to the nearest 64-KB
+ /// boundary) if there is enough address space at the specified address. If there is not enough address space, the function fails.
+ ///
+ ///
+ /// Typically, the suggested address is used to specify that a file should be mapped at the same address in multiple processes. This
+ /// requires the region of address space to be available in all involved processes. No other memory allocation can take place in the
+ /// region that is used for mapping, including the use of the VirtualAllocExNuma function to reserve memory.
+ ///
+ ///
+ /// If the lpBaseAddress parameter specifies a base offset, the function succeeds if the specified memory region is not already in
+ /// use by the calling process. The system does not ensure that the same memory region is available for the memory mapped file in
+ /// other 32-bit processes.
+ ///
+ ///
+ /// Multiple views of a file (or a file mapping object and its mapped file) are coherent if they contain identical data at a
+ /// specified time. This occurs if the file views are derived from the same file mapping object. A process can duplicate a file
+ /// mapping object handle into another process by using the DuplicateHandle function, or another process can open a file mapping
+ /// object by name by using the OpenFileMapping function.
+ ///
+ ///
+ /// With one important exception, file views derived from any file mapping object that is backed by the same file are coherent or
+ /// identical at a specific time. Coherency is guaranteed for views within a process and for views that are mapped by different processes.
+ ///
+ ///
+ /// The exception is related to remote files. Although MapViewOfFileExNuma works with remote files, it does not keep them
+ /// coherent. For example, if two computers both map a file as writable, and both change the same page, each computer only sees its
+ /// own writes to the page. When the data gets updated on the disk, it is not merged.
+ ///
+ /// A mapped view of a file is not guaranteed to be coherent with a file being accessed by the ReadFile or WriteFile function.
+ ///
+ /// To guard against EXCEPTION_IN_PAGE_ERROR exceptions, use structured exception handling to protect any code that writes to
+ /// or reads from a memory mapped view of a file other than the page file. For more information, see Reading and Writing From a File View.
+ ///
+ ///
+ /// When modifying a file through a mapped view, the last modification timestamp may not be updated automatically. If required, the
+ /// caller should use SetFileTime to set the timestamp.
+ ///
+ ///
+ /// To have a file with executable permissions, an application must call the CreateFileMappingNuma function with either
+ /// PAGE_EXECUTE_READWRITE or PAGE_EXECUTE_READ and then call the MapViewOfFileExNuma function with
+ /// FILE_MAP_EXECUTE | FILE_MAP_WRITE or FILE_MAP_EXECUTE | FILE_MAP_READ.
+ ///
+ /// In Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-mapviewoffileexnuma LPVOID MapViewOfFileExNuma( HANDLE
+ // hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap, LPVOID
+ // lpBaseAddress, DWORD nndPreferred );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "1e28c8db-112d-481d-b470-8ca618e125ce")]
+ public static extern IntPtr MapViewOfFileExNuma(IntPtr hFileMappingObject, FileAccess dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, SizeT dwNumberOfBytesToMap, IntPtr lpBaseAddress, uint nndPreferred);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Moves an existing file or a directory, including its children, as a transacted operation.
+ ///
+ ///
+ /// The current name of the existing file or directory on the local computer.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ ///
+ ///
+ /// The new name for the file or directory. The new name must not already exist. A new file may be on a different file system or
+ /// drive. A new directory must be on the same drive.
+ ///
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a CopyProgressRoutine callback function that is called each time another portion of the file has been moved. The
+ /// callback function can be useful if you provide a user interface that displays the progress of the operation. This parameter can
+ /// be NULL.
+ ///
+ ///
+ ///
+ /// An argument to be passed to the CopyProgressRoutine callback function. This parameter can be NULL.
+ ///
+ ///
+ /// The move options. This parameter can be one or more of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// MOVEFILE_COPY_ALLOWED 2 (0x2)
+ ///
+ /// If the file is to be moved to a different volume, the function simulates the move by using the CopyFile and DeleteFile functions.
+ /// If the file is successfully copied to a different volume and the original file is unable to be deleted, the function succeeds
+ /// leaving the source file intact. This value cannot be used with MOVEFILE_DELAY_UNTIL_REBOOT.
+ ///
+ ///
+ /// -
+ /// MOVEFILE_CREATE_HARDLINK 16 (0x10)
+ /// Reserved for future use.
+ ///
+ /// -
+ /// MOVEFILE_DELAY_UNTIL_REBOOT 4 (0x4)
+ ///
+ /// The system does not move the file until the operating system is restarted. The system moves the file immediately after AUTOCHK is
+ /// executed, but before creating any paging files. Consequently, this parameter enables the function to delete paging files from
+ /// previous startups. This value can only be used if the process is in the context of a user who belongs to the administrators group
+ /// or the LocalSystem account. This value cannot be used with MOVEFILE_COPY_ALLOWED. The write operation to the registry value as
+ /// detailed in the Remarks section is what is transacted. The file move is finished when the computer restarts, after the
+ /// transaction is complete.
+ ///
+ ///
+ /// -
+ /// MOVEFILE_REPLACE_EXISTING 1 (0x1)
+ ///
+ /// If a file named lpNewFileName exists, the function replaces its contents with the contents of the lpExistingFileName file. This
+ /// value cannot be used if lpNewFileName or lpExistingFileName names a directory.
+ ///
+ ///
+ /// -
+ /// MOVEFILE_WRITE_THROUGH 8 (0x8)
+ ///
+ /// A call to MoveFileTransacted means that the move file operation is complete when the commit operation is completed. This flag is
+ /// unnecessary; there are no negative affects if this flag is specified, other than an operation slowdown. The function does not
+ /// return until the file has actually been moved on the disk. Setting this value guarantees that a move performed as a copy and
+ /// delete operation is flushed to disk before the function returns. The flush occurs at the end of the copy operation. This value
+ /// has no effect if MOVEFILE_DELAY_UNTIL_REBOOT is set.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ /// When moving a file across volumes, if lpProgressRoutine returns PROGRESS_CANCEL due to the user canceling the operation,
+ /// MoveFileTransacted will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.
+ ///
+ ///
+ /// When moving a file across volumes, if lpProgressRoutine returns PROGRESS_STOP due to the user stopping the operation,
+ /// MoveFileTransacted will return zero and GetLastError will return ERROR_REQUEST_ABORTED. The existing file is left intact.
+ ///
+ ///
+ ///
+ ///
+ /// If the dwFlags parameter specifies MOVEFILE_DELAY_UNTIL_REBOOT, MoveFileTransacted fails if it cannot access the
+ /// registry. The function transactionally stores the locations of the files to be renamed at restart in the following registry
+ /// value: HKEY_LOCAL_MACHINE<b>SYSTEM<b>CurrentControlSet<b>Control<b>Session Manager<b>PendingFileRenameOperations
+ ///
+ ///
+ /// This registry value is of type REG_MULTI_SZ. Each rename operation stores one of the following NULL-terminated
+ /// strings, depending on whether the rename is a delete or not:
+ ///
+ /// szDstFile\0\0
+ /// szSrcFile\0szDstFile\0
+ /// The string szDstFile\0\0 indicates that the file szDstFile is to be deleted on reboot.
+ /// The string szSrcFile\0szDstFile\0 indicates that szSrcFile is to be renamed szDstFile on reboot.
+ ///
+ /// Note Although \0\0 is technically not allowed in a REG_MULTI_SZ node, it can because the file is considered to be
+ /// renamed to a null name.
+ ///
+ ///
+ /// The system uses these registry entries to complete the operations at restart in the same order that they were issued. For more
+ /// information about using the MOVEFILE_DELAY_UNTIL_REBOOT flag, see MoveFileWithProgress.
+ ///
+ ///
+ /// If a file is moved across volumes, MoveFileTransacted does not move the security descriptor with the file. The file is
+ /// assigned the default security descriptor in the destination directory.
+ ///
+ ///
+ /// This function always fails if you specify the MOVEFILE_FAIL_IF_NOT_TRACKABLE flag; tracking is not supported by TxF.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-movefiletransacteda BOOL MoveFileTransactedA( LPCSTR
+ // lpExistingFileName, LPCSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "466d733b-30d2-4297-a0e6-77038f1a21d5")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool MoveFileTransacted(string lpExistingFileName, string lpNewFileName, LpprogressRoutine lpProgressRoutine, IntPtr lpData, MOVEFILE dwFlags, IntPtr hTransaction);
+
+ ///
+ /// Multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The final result is rounded to the
+ /// nearest integer.
///
/// The multiplicand.
/// The multiplier.
/// The number by which the result of the multiplication operation is to be divided.
///
///
- /// If the function succeeds, the return value is the result of the multiplication and division, rounded to the nearest integer. If the result is a
- /// positive half integer (ends in .5), it is rounded up. If the result is a negative half integer, it is rounded down.
+ /// If the function succeeds, the return value is the result of the multiplication and division, rounded to the nearest integer. If
+ /// the result is a positive half integer (ends in .5), it is rounded up. If the result is a negative half integer, it is rounded down.
///
/// If either an overflow occurred or nDenominator was 0, the return value is -1.
///
@@ -79,11 +5000,2152 @@ namespace Vanara.PInvoke
[PInvokeData("Winbase.h", MSDNShortId = "aa383718")]
public static extern int MulDiv(int nNumber, int nNumerator, int nDenominator);
+ ///
+ /// Opens the file that matches the specified identifier.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// The access to the object. Access can be read, write, or both.
+ ///
+ /// For more information, see File Security and Access Rights. You cannot request an access mode that conflicts with the sharing mode
+ /// that is specified in an open request that has an open handle.
+ ///
+ ///
+ /// If this parameter is zero (0), the application can query file and device attributes without accessing a device. This is useful
+ /// for an application to determine the size of a floppy disk drive and the formats it supports without requiring a floppy in a
+ /// drive. It can also be used to test for the existence of a file or directory without opening them for read or write access.
+ ///
+ ///
+ ///
+ /// The sharing mode of an object, which can be read, write, both, or none.
+ ///
+ /// You cannot request a sharing mode that conflicts with the access mode that is specified in an open request that has an open
+ /// handle, because that would result in the following sharing violation: ( ERROR_SHARING_VIOLATION). For more information,
+ /// see Creating and Opening Files.
+ ///
+ ///
+ /// If this parameter is zero (0) and OpenFileById succeeds, the object cannot be shared and cannot be opened again until the
+ /// handle is closed. For more information, see the Remarks section of this topic.
+ ///
+ /// The sharing options remain in effect until you close the handle to an object.
+ ///
+ /// To enable a processes to share an object while another process has the object open, use a combination of one or more of the
+ /// following values to specify the access mode they can request to open the object.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FILE_SHARE_DELETE 0x00000004
+ ///
+ /// Enables subsequent open operations on an object to request delete access. Otherwise, other processes cannot open the object if
+ /// they request delete access. If this flag is not specified, but the object has been opened for delete access, the function fails.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_READ 0x00000001
+ ///
+ /// Enables subsequent open operations on an object to request read access. Otherwise, other processes cannot open the object if they
+ /// request read access. If this flag is not specified, but the object has been opened for read access, the function fails.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_WRITE 0x00000002
+ ///
+ /// Enables subsequent open operations on an object to request write access. Otherwise, other processes cannot open the object if
+ /// they request write access. If this flag is not specified, but the object has been opened for write access or has a file mapping
+ /// with write access, the function fails.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Reserved.
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// If the function succeeds, the return value is an open handle to a specified file.
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// Use the CloseHandle function to close an object handle that OpenFileById returns.
+ ///
+ /// If you call OpenFileById on a file that is pending deletion as a result of a previous call to DeleteFile, the function
+ /// fails. The operating system delays file deletion until all handles to the file are closed. GetLastError returns ERROR_ACCESS_DENIED.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-openfilebyid HANDLE OpenFileById( HANDLE hVolumeHint,
+ // LPFILE_ID_DESCRIPTOR lpFileId, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD
+ // dwFlagsAndAttributes );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "caa757a2-fc3f-4883-8d3e-b98d28f92517")]
+ public static extern IntPtr OpenFileById(IntPtr hVolumeHint, IntPtr lpFileId, FileAccess dwDesiredAccess, FileShare dwShareMode, ref SECURITY_ATTRIBUTES lpSecurityAttributes, FileFlagsAndAttributes dwFlagsAndAttributes);
+
+ ///
+ /// Decrements the count of power requests of the specified type for a power request object.
+ ///
+ ///
+ /// A handle to a power request object.
+ ///
+ ///
+ /// The power request type to be decremented. This parameter can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// PowerRequestDisplayRequired
+ /// The display remains on even if there is no user input for an extended period of time.
+ ///
+ /// -
+ /// PowerRequestSystemRequired
+ /// The system continues to run instead of entering sleep after a period of user inactivity.
+ ///
+ /// -
+ /// PowerRequestAwayModeRequired
+ ///
+ /// The system enters away mode instead of sleep. In away mode, the system continues to run but turns off audio and video to give the
+ /// appearance of sleep.
+ ///
+ ///
+ /// -
+ /// PowerRequestExecutionRequired
+ ///
+ /// The calling process continues to run instead of being suspended or terminated by process lifetime management mechanisms. When and
+ /// how long the process is allowed to run depends on the operating system and power policy settings. When a
+ /// PowerRequestExecutionRequired request is active, it implies PowerRequestSystemRequired. The PowerRequestExecutionRequired request
+ /// type can be used only by applications. Services cannot use this request type. Windows 7 and Windows Server 2008 R2: This request
+ /// type is supported starting with Windows 8 and Windows Server 2012.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, it returns zero. To get extended error information, call GetLastError.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-powerclearrequest BOOL PowerClearRequest( HANDLE
+ // PowerRequest, POWER_REQUEST_TYPE RequestType );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "794248b1-5aa8-495e-aca6-1a1f35dc9c7f")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool PowerClearRequest(IntPtr PowerRequest, POWER_REQUEST_TYPE RequestType);
+
+ ///
+ /// Creates a new power request object.
+ ///
+ ///
+ /// Points to a REASON_CONTEXT structure that contains information about the power request.
+ ///
+ ///
+ /// If the function succeeds, the return value is a handle to the power request object.
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// When the power request object is no longer needed, use the CloseHandle function to free the handle and clean up the object.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-powercreaterequest HANDLE PowerCreateRequest(
+ // PREASON_CONTEXT Context );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "2122bf00-9e6b-48ab-89b0-f53dd6804902")]
+ public static extern IntPtr PowerCreateRequest(ref REASON_CONTEXT Context);
+
+ ///
+ /// Increments the count of power requests of the specified type for a power request object.
+ ///
+ ///
+ /// A handle to a power request object.
+ ///
+ ///
+ /// The power request type to be incremented. This parameter can be one of the following values.
+ /// PowerRequestDisplayRequired
+ /// The display remains on even if there is no user input for an extended period of time.
+ /// PowerRequestSystemRequired
+ /// The system continues to run instead of entering sleep after a period of user inactivity.
+ /// PowerRequestAwayModeRequired
+ ///
+ /// The system enters away mode instead of sleep in response to explicit action by the user. In away mode, the system continues to
+ /// run but turns off audio and video to give the appearance of sleep.
+ ///
+ /// PowerRequestExecutionRequired
+ ///
+ /// The calling process continues to run instead of being suspended or terminated by process lifetime management mechanisms. When and
+ /// how long the process is allowed to run depends on the operating system and power policy settings.
+ ///
+ /// On systems not capable of connected standby, an active PowerRequestExecutionRequired request implies PowerRequestSystemRequired.
+ /// NotePowerRequestExecutionRequired is supported starting with Windows 8 and Windows Server 2012.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, it returns zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// To conserve power and provide the best user experience, applications that use power requests should follow these best practices:
+ ///
+ ///
+ /// -
+ ///
+ /// When creating a power request, provide a localized text string that describes the reason for the request in the REASON_CONTEXT structure.
+ ///
+ ///
+ /// -
+ /// Call PowerSetRequest immediately before the scenario that requires the request.
+ ///
+ /// -
+ /// Call PowerClearRequest to decrement the reference count for the request as soon as the scenario is finished.
+ ///
+ /// -
+ /// Clean up all request objects and associated handles before the process exits or the service stops.
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-powersetrequest BOOL PowerSetRequest( HANDLE PowerRequest,
+ // POWER_REQUEST_TYPE RequestType );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "85249de8-5832-4f25-bbd9-3576cfd1caa0")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool PowerSetRequest(IntPtr PowerRequest, POWER_REQUEST_TYPE RequestType);
+
+ ///
+ /// Retrieves the full name of the executable image for the specified process.
+ ///
+ ///
+ ///
+ /// A handle to the process. This handle must be created with the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
+ /// access right. For more information, see Process Security and Access Rights.
+ ///
+ ///
+ ///
+ /// This parameter can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// 0
+ /// The name should use the Win32 path format.
+ ///
+ /// -
+ /// PROCESS_NAME_NATIVE 0x00000001
+ /// The name should use the native system path format.
+ ///
+ ///
+ ///
+ ///
+ /// The path to the executable image. If the function succeeds, this string is null-terminated.
+ ///
+ ///
+ ///
+ /// On input, specifies the size of the lpExeName buffer, in characters. On success, receives the number of characters written to the
+ /// buffer, not including the null-terminating character.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ /// To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-queryfullprocessimagenamea BOOL
+ // QueryFullProcessImageNameA( HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD lpdwSize );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "49a9d1aa-30f3-45ea-a4ec-9f55df692b8b")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool QueryFullProcessImageName(IntPtr hProcess, PROCESS_NAME dwFlags, StringBuilder lpExeName, ref uint lpdwSize);
+
+ /// Determines whether thread profiling is enabled for the specified thread.
+ /// The handle to the thread of interest.
+ /// Is TRUE if thread profiling is enabled for the specified thread; otherwise, FALSE.
+ /// Returns ERROR_SUCCESS if the call is successful; otherwise, a system error code (see Winerror.h).
+ // DWORD APIENTRY QueryThreadProfiling( _In_ HANDLE ThreadHandle, _Out_ PBOOLEAN Enabled); https://msdn.microsoft.com/en-us/library/windows/desktop/dd796402(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796402")]
+ public static extern Win32Error QueryThreadProfiling(IntPtr ThreadHandle, [MarshalAs(UnmanagedType.U1)] out bool Enabled);
+
+ ///
+ /// Retrieves information about the specified user-mode scheduling (UMS) worker thread.
+ ///
+ ///
+ /// A pointer to a UMS thread context.
+ ///
+ ///
+ /// A UMS_THREAD_INFO_CLASS value that specifies the kind of information to retrieve.
+ ///
+ ///
+ ///
+ /// A pointer to a buffer to receive the specified information. The required size of this buffer depends on the specified information class.
+ ///
+ /// If the information class is UmsThreadContext or UmsThreadTeb, the buffer must be .
+ /// If the information class is UmsThreadIsSuspended or UmsThreadIsTerminated, the buffer must be .
+ ///
+ ///
+ /// The size of the UmsThreadInformation buffer, in bytes.
+ ///
+ ///
+ ///
+ /// A pointer to a ULONG variable. On output, this parameter receives the number of bytes written to the UmsThreadInformation buffer.
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error values
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INFO_LENGTH_MISMATCH
+ /// The buffer is too small for the requested information.
+ ///
+ /// -
+ /// ERROR_INVALID_INFO_CLASS
+ /// The specified information class is not supported.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The QueryUmsThreadInformation function retrieves information about the specified UMS worker thread such as its
+ /// application-defined context, its thread execution block (TEB), and whether the thread is suspended or terminated.
+ ///
+ ///
+ /// The underlying structures for UMS worker threads are managed by the system. Information that is not exposed through
+ /// QueryUmsThreadInformation should be considered reserved.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-queryumsthreadinformation BOOL QueryUmsThreadInformation(
+ // PUMS_CONTEXT UmsThread, UMS_THREAD_INFO_CLASS UmsThreadInfoClass, PVOID UmsThreadInformation, ULONG UmsThreadInformationLength,
+ // PULONG ReturnLength );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "5f694edf-ba5e-45a2-a938-5013edddcae2")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool QueryUmsThreadInformation(IntPtr UmsThread, RTL_UMS_THREAD_INFO_CLASS UmsThreadInfoClass, IntPtr UmsThreadInformation, uint UmsThreadInformationLength, out uint ReturnLength);
+
+ /// Reads the specified profiling data associated with the thread.
+ /// The handle that the EnableThreadProfiling function returned.
+ ///
+ ///
+ /// One or more of the following flags that specify the counter data to read. The flags must have been set when you called the
+ /// EnableThreadProfiling function.
+ ///
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// READ_THREAD_PROFILING_FLAG_DISPATCHING0x00000001
+ /// Get the thread profiling data.
+ ///
+ /// -
+ /// READ_THREAD_PROFILING_FLAG_HARDWARE_COUNTERS0x00000002
+ /// Get the hardware performance counters data.
+ ///
+ ///
+ ///
+ ///
+ /// A PERFORMANCE_DATA structure that contains the thread profiling and hardware counter data.
+ /// Returns ERROR_SUCCESS if the call is successful; otherwise, a system error code (see Winerror.h).
+ // DWORD APIENTRY ReadThreadProfilingData( _In_ HANDLE PerformanceDataHandle, _In_ DWORD Flags, _Out_ PPERFORMANCE_DATA
+ // PerformanceData); https://msdn.microsoft.com/en-us/library/windows/desktop/dd796403(v=vs.85).aspx
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("Winbase.h", MSDNShortId = "dd796403")]
+ public static extern Win32Error ReadThreadProfilingData(IntPtr PerformanceDataHandle, uint Flags, out PERFORMANCE_DATA PerformanceData);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Deletes an existing empty directory as a transacted operation.
+ ///
+ ///
+ ///
+ /// The path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete
+ /// access to the directory.
+ ///
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see Naming a File.
+ ///
+ /// The directory must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The RemoveDirectoryTransacted function marks a directory for deletion on close. Therefore, the directory is not removed
+ /// until the last handle to the directory is closed.
+ ///
+ ///
+ /// RemoveDirectory removes a directory junction, even if the contents of the target are not empty; the function removes directory
+ /// junctions regardless of the state of the target object.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF .
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-removedirectorytransacteda BOOL
+ // RemoveDirectoryTransactedA( LPCSTR lpPathName, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "e8600166-62dc-4398-9e16-43b07f7f0b89")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool RemoveDirectoryTransacted(string lpPathName, IntPtr hTransaction);
+
+ ///
+ /// Unregisters a callback function that was previously registered with the AddSecureMemoryCacheCallback function.
+ ///
+ ///
+ /// A pointer to the application-defined SecureMemoryCacheCallback function to remove.
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the
+ /// Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-removesecurememorycachecallback BOOL
+ // RemoveSecureMemoryCacheCallback( PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "8be6ff04-34c7-4942-a38c-507584c8bbeb")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool RemoveSecureMemoryCacheCallback(PsecureMemoryCacheCallback pfnCallBack);
+
+ ///
+ /// Reopens the specified file system object with different access rights, sharing mode, and flags.
+ ///
+ ///
+ /// A handle to the object to be reopened. The object must have been created by the CreateFile function.
+ ///
+ ///
+ ///
+ /// The required access to the object. For a list of values, see File Security and Access Rights. You cannot request an access mode
+ /// that conflicts with the sharing mode specified in a previous open request whose handle is still open.
+ ///
+ ///
+ /// If this parameter is zero (0), the application can query device attributes without accessing the device. This is useful if an
+ /// application wants to determine the size of a floppy disk drive and the formats it supports without requiring a floppy in the drive.
+ ///
+ ///
+ ///
+ ///
+ /// The sharing mode of the object. You cannot request a sharing mode that conflicts with the access mode specified in a previous
+ /// open request whose handle is still open.
+ ///
+ ///
+ /// If this parameter is zero (0) and CreateFile succeeds, the object cannot be shared and cannot be opened again until the handle is closed.
+ ///
+ ///
+ /// To enable other processes to share the object while your process has it open, use a combination of one or more of the following
+ /// values to specify the type of access they can request when they open the object. These sharing options remain in effect until you
+ /// close the handle to the object.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FILE_SHARE_DELETE 0x00000004
+ ///
+ /// Enables subsequent open operations on the object to request delete access. Otherwise, other processes cannot open the object if
+ /// they request delete access. If the object has already been opened with delete access, the sharing mode must include this flag.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_READ 0x00000001
+ ///
+ /// Enables subsequent open operations on the object to request read access. Otherwise, other processes cannot open the object if
+ /// they request read access. If the object has already been opened with read access, the sharing mode must include this flag.
+ ///
+ ///
+ /// -
+ /// FILE_SHARE_WRITE 0x00000002
+ ///
+ /// Enables subsequent open operations on the object to request write access. Otherwise, other processes cannot open the object if
+ /// they request write access. If the object has already been opened with write access, the sharing mode must include this flag.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// TBD
+ ///
+ ///
+ /// If the function succeeds, the return value is an open handle to the specified file.
+ /// If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The dwFlags parameter cannot contain any of the file attribute flags ( FILE_ATTRIBUTE_*). These can only be specified when
+ /// the file is created.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-reopenfile HANDLE ReOpenFile( HANDLE hOriginalFile, DWORD
+ // dwDesiredAccess, DWORD dwShareMode, DWORD dwFlagsAndAttributes );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "56d8a4b1-e3b5-4134-8d21-bf40761e9dcc")]
+ public static extern SafeFileHandle ReOpenFile(IntPtr hOriginalFile, FileAccess dwDesiredAccess, FileShare dwShareMode, FileFlagsAndAttributes dwFlagsAndAttributes);
+
+ ///
+ ///
+ /// [Microsoft strongly recommends developers utilize alternative means to achieve your application’s needs. Many scenarios that TxF
+ /// was developed for can be achieved through simpler and more readily available techniques. Furthermore, TxF may not be available in
+ /// future versions of Microsoft Windows. For more information, and alternatives to TxF, please see Alternatives to using
+ /// Transactional NTFS.]
+ ///
+ /// Sets the attributes for a file or directory as a transacted operation.
+ ///
+ ///
+ /// The name of the file whose attributes are to be set.
+ ///
+ /// In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide
+ /// characters, call the Unicode version of the function and prepend "\?" to the path. For more information, see File Names, Paths,
+ /// and Namespaces.
+ ///
+ /// The file must reside on the local computer; otherwise, the function fails and the last error code is set to ERROR_TRANSACTIONS_UNSUPPORTED_REMOTE.
+ ///
+ ///
+ /// The file attributes to set for the file.
+ ///
+ /// For a list of file attribute value and their descriptions, see File Attribute Constants. This parameter can be one or more
+ /// values, combined using the bitwise-OR operator. However, all other values override FILE_ATTRIBUTE_NORMAL.
+ ///
+ /// Not all attributes are supported by this function. For more information, see the Remarks section.
+ /// The following is a list of supported attribute values.
+ /// FILE_ATTRIBUTE_ARCHIVE (32 (0x20))
+ /// FILE_ATTRIBUTE_HIDDEN (2 (0x2))
+ /// FILE_ATTRIBUTE_NORMAL (128 (0x80))
+ /// FILE_ATTRIBUTE_NOT_CONTENT_INDEXED (8192 (0x2000))
+ /// FILE_ATTRIBUTE_OFFLINE (4096 (0x1000))
+ /// FILE_ATTRIBUTE_READONLY (1 (0x1))
+ /// FILE_ATTRIBUTE_SYSTEM (4 (0x4))
+ /// FILE_ATTRIBUTE_TEMPORARY (256 (0x100))
+ ///
+ ///
+ /// A handle to the transaction. This handle is returned by the CreateTransaction function.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The following table describes how to set the attributes that cannot be set using SetFileAttributesTransacted. Note that
+ /// these are not transacted operations.
+ ///
+ ///
+ ///
+ /// Attribute
+ /// How to Set
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_COMPRESSED 0x800
+ /// To set a file's compression state, use the DeviceIoControl function with the FSCTL_SET_COMPRESSION operation.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_DEVICE 0x40
+ /// Reserved; do not use.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_DIRECTORY 0x10
+ /// Files cannot be converted into directories. To create a directory, use the CreateDirectory or CreateDirectoryEx function.
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_ENCRYPTED 0x4000
+ ///
+ /// To create an encrypted file, use the CreateFile function with the FILE_ATTRIBUTE_ENCRYPTED attribute. To convert an existing file
+ /// into an encrypted file, use the EncryptFile function.
+ ///
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_REPARSE_POINT 0x400
+ ///
+ /// To associate a reparse point with a file or directory, use the DeviceIoControl function with the FSCTL_SET_REPARSE_POINT operation.
+ ///
+ ///
+ /// -
+ /// FILE_ATTRIBUTE_SPARSE_FILE 0x200
+ /// To set a file's sparse attribute, use the DeviceIoControl function with the FSCTL_SET_SPARSE operation.
+ ///
+ ///
+ ///
+ /// If a file is open for modification in a transaction, no other thread can successfully open the file for modification until the
+ /// transaction is committed. If a transacted thread opens the file first, any subsequent threads that attempt to open the file for
+ /// modification before the transaction is committed will receive a sharing violation. If a non-transacted thread opens the file for
+ /// modification before the transacted thread does, and it is still open when the transacted thread attempts to open it, the
+ /// transaction will receive the ERROR_TRANSACTIONAL_CONFLICT error.
+ ///
+ /// For more information on transactions, see Transactional NTFS.
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// SMB 3.0 does not support TxF.
+ /// Transacted Operations
+ ///
+ /// If a file is open for modification in a transaction, no other thread can open the file for modification until the transaction is
+ /// committed. So if a transacted thread opens the file first, any subsequent threads that try modifying the file before the
+ /// transaction is committed receives a sharing violation. If a non-transacted thread modifies the file before the transacted thread
+ /// does, and the file is still open when the transaction attempts to open it, the transaction receives the error ERROR_TRANSACTIONAL_CONFLICT.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setfileattributestransacteda BOOL
+ // SetFileAttributesTransactedA( LPCSTR lpFileName, DWORD dwFileAttributes, HANDLE hTransaction );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "e25e77b2-a6ad-4ce4-8589-d7ff6c4074f6")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetFileAttributesTransacted(string lpFileName, FileFlagsAndAttributes dwFileAttributes, IntPtr hTransaction);
+
+ ///
+ ///
+ /// Requests that bandwidth for the specified file stream be reserved. The reservation is specified as a number of bytes in a period
+ /// of milliseconds for I/O requests on the specified file handle.
+ ///
+ ///
+ ///
+ /// A handle to the file.
+ ///
+ ///
+ ///
+ /// The period of the reservation, in milliseconds. The period is the time from which the I/O is issued to the kernel until the time
+ /// the I/O should be completed. The minimum supported value for the file stream can be determined by looking at the value returned
+ /// through the lpPeriodMilliseconds parameter to the GetFileBandwidthReservation function, on a handle that has not had a bandwidth
+ /// reservation set.
+ ///
+ ///
+ ///
+ ///
+ /// The bandwidth to reserve, in bytes per period. The maximum supported value for the file stream can be determined by looking at
+ /// the value returned through the lpBytesPerPeriod parameter to the GetFileBandwidthReservation function, on a handle that has not
+ /// had a bandwidth reservation set.
+ ///
+ ///
+ ///
+ ///
+ /// Indicates whether I/O should be completed with an error if a driver is unable to satisfy an I/O operation before the period
+ /// expires. If one of the drivers for the specified file stream does not support this functionality, this function may return
+ /// success and ignore the flag. To verify whether the setting will be honored, call the GetFileBandwidthReservation function using
+ /// the same hFile handle and examine the *pDiscardable return value.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a variable that receives the minimum size of any individual I/O request that may be issued by the application. All
+ /// I/O requests should be multiples of TransferSize.
+ ///
+ ///
+ ///
+ ///
+ /// A pointer to a variable that receives the number of TransferSize chunks the application should allow to be outstanding with the
+ /// operating system. This allows the storage stack to keep the device busy and allows maximum throughput.
+ ///
+ ///
+ ///
+ /// Returns nonzero if successful or zero otherwise.
+ ///
+ /// A reservation can fail if there is not enough bandwidth available on the volume because of existing reservations; in this case
+ /// ERROR_NO_SYSTEM_RESOURCES is returned.
+ ///
+ /// To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The requested bandwidth reservation must be greater than or equal to one packet per period. The minimum period, in milliseconds,
+ /// maximum bytes per period, and minimum transfer size, in bytes, for a specific volume are returned through the
+ /// lpPeriodMilliseconds, lpBytesPerPeriod, and lpTransferSize parameters to GetFileBandwidthReservation on a handle that has not
+ /// been used in a call to SetFileBandwidthReservation. In other words:
+ ///
+ /// 1 ≤ (nBytesPerPeriod)×(lpPeriodMilliseconds)/(lpTransferSize)/(nPeriodMilliseconds)
+ /// IIn Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// No
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setfilebandwidthreservation BOOL
+ // SetFileBandwidthReservation( HANDLE hFile, DWORD nPeriodMilliseconds, DWORD nBytesPerPeriod, BOOL bDiscardable, LPDWORD
+ // lpTransferSize, LPDWORD lpNumOutstandingRequests );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "a22bd8f3-4fbf-4f77-b8b6-7e786942615a")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetFileBandwidthReservation(SafeFileHandle hFile, uint nPeriodMilliseconds, uint nBytesPerPeriod, [MarshalAs(UnmanagedType.Bool)] bool bDiscardable, out uint lpTransferSize, out uint lpNumOutstandingRequests);
+
+ ///
+ ///
+ /// Sets the notification modes for a file handle, allowing you to specify how completion notifications work for the specified file.
+ ///
+ ///
+ ///
+ /// A handle to the file.
+ ///
+ ///
+ ///
+ /// The modes to be set. One or more modes can be set at the same time; however, after a mode has been set for a file handle, it
+ /// cannot be removed.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
+ ///
+ /// If the following three conditions are true, the I/O Manager does not queue a completion entry to the port, when it would
+ /// ordinarily do so. The conditions are: When the FileHandle parameter is a socket, this mode is only compatible with Layered
+ /// Service Providers (LSP) that return Installable File Systems (IFS) handles. To detect whether a non-IFS LSP is installed, use the
+ /// WSAEnumProtocols function and examine the dwServiceFlag1 member in each returned WSAPROTOCOL_INFO structure. If the
+ /// XP1_IFS_HANDLES (0x20000) bit is cleared then the specified LSP is not an IFS LSP. Vendors that have non-IFS LSPs are encouraged
+ /// to migrate to the Windows Filtering Platform (WFP).
+ ///
+ ///
+ /// -
+ /// FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
+ ///
+ /// The I/O Manager does not set the event for the file object if a request returns with a success code, or the error returned is
+ /// ERROR_PENDING and the function that is called is not a synchronous function. If an explicit event is provided for the request, it
+ /// is still signaled.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Returns nonzero if successful or zero otherwise.
+ /// To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0600 or later. For more information,
+ /// see Using the Windows Headers.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setfilecompletionnotificationmodes BOOL
+ // SetFileCompletionNotificationModes( HANDLE FileHandle, UCHAR Flags );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "23796484-ee47-4f80-856d-5a5d5635547c")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetFileCompletionNotificationModes(SafeFileHandle FileHandle, FILE_NOTIFICATION_MODE Flags);
+
+ ///
+ ///
+ /// Sets the value of the specified firmware environment variable as the attributes that indicate how this variable is stored and maintained.
+ ///
+ ///
+ ///
+ /// The name of the firmware environment variable. The pointer must not be NULL.
+ ///
+ ///
+ ///
+ /// The GUID that represents the namespace of the firmware environment variable. The GUID must be a string in the format
+ /// "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}". If the system does not support GUID-based namespaces, this parameter is ignored. The
+ /// pointer must not be NULL.
+ ///
+ ///
+ ///
+ /// A pointer to the new value for the firmware environment variable.
+ ///
+ ///
+ ///
+ /// The size of the pValue buffer, in bytes. Unless the VARIABLE_ATTRIBUTE_APPEND_WRITE,
+ /// VARIABLE_ATTRIBUTE_AUTHENTICATED_WRITE_ACCESS, or VARIABLE_ATTRIBUTE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS variable attribute is
+ /// set via dwAttributes, setting this value to zero will result in the deletion of this variable.
+ ///
+ ///
+ ///
+ /// Bitmask to set UEFI variable attributes associated with the variable. See also UEFI Spec 2.3.1, Section 7.2.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_NON_VOLATILE 0x00000001
+ /// The firmware environment variable is stored in non-volatile memory (e.g. NVRAM).
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_BOOTSERVICE_ACCESS 0x00000002
+ /// The firmware environment variable can be accessed during boot service.
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_RUNTIME_ACCESS 0x00000004
+ /// The firmware environment variable can be accessed at runtime.
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_HARDWARE_ERROR_RECORD 0x00000008
+ /// Indicates hardware related errors encountered at runtime.
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_AUTHENTICATED_WRITE_ACCESS 0x00000010
+ ///
+ /// Indicates an authentication requirement that must be met before writing to this firmware environment variable. For more
+ /// information see, UEFI spec 2.3.1.
+ ///
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
+ ///
+ /// Indicates authentication and time stamp requirements that must be met before writing to this firmware environment variable. When
+ /// this attribute is set, the buffer, represented by pValue, will begin with an instance of a complete (and serialized)
+ /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. For more information see, UEFI spec 2.3.1.
+ ///
+ ///
+ /// -
+ /// VARIABLE_ATTRIBUTE_APPEND_WRITE 0x00000040
+ ///
+ /// Append an existing environment variable with the value of pValue. If the firmware does not support the operation, then
+ /// SetFirmwareEnvironmentVariableEx will return ERROR_INVALID_FUNCTION.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error codes
+ /// include ERROR_INVALID_FUNCTION.
+ ///
+ ///
+ ///
+ ///
+ /// Starting with Windows 10, version 1803, Universal Windows apps can read and write UEFI firmware variables. See Access UEFI
+ /// firmware variables from a Universal Windows Appfor details.
+ ///
+ ///
+ /// Starting with Windows 10, version 1803, reading UEFI firmware variables is also supported from User-Mode Driver Framework (UMDF)
+ /// drivers. Writing UEFI firmware variables from UMDF drivers is not supported.
+ ///
+ ///
+ /// To write a firmware environment variable, the user account that the app is running under must have the SE_SYSTEM_ENVIRONMENT_NAME
+ /// privilege. A Universal Windows app must be run from an administrator account and follow the requirements outlined in Access UEFI
+ /// firmware variables from a Universal Windows App.
+ ///
+ /// The correct method of changing the attributes of a variable is to delete the variable and recreate it with different attributes.
+ ///
+ /// The exact set of firmware environment variables is determined by the boot firmware. The location of these environment variables
+ /// is also specified by the firmware. For example, on a UEFI-based system, NVRAM contains firmware environment variables that
+ /// specify system boot settings. For information about specific variables used, see the UEFI specification. For more information
+ /// about UEFI and Windows, see UEFI and Windows.
+ ///
+ ///
+ /// Firmware variables are not supported on a legacy BIOS-based system. The SetFirmwareEnvironmentVariableEx function will
+ /// always fail on a legacy BIOS-based system, or if Windows was installed using legacy BIOS on a system that supports both legacy
+ /// BIOS and UEFI. To identify these conditions, call the function with a dummy firmware environment name such as an empty string
+ /// ("") for the lpName parameter and a dummy GUID such as "{00000000-0000-0000-0000-000000000000}" for the lpGuid parameter. On a
+ /// legacy BIOS-based system, or on a system that supports both legacy BIOS and UEFI where Windows was installed using legacy BIOS,
+ /// the function will fail with ERROR_INVALID_FUNCTION. On a UEFI-based system, the function will fail with an error specific to the
+ /// firmware, such as ERROR_NOACCESS, to indicate that the dummy GUID namespace does not exist.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setfirmwareenvironmentvariableexa BOOL
+ // SetFirmwareEnvironmentVariableExA( LPCSTR lpName, LPCSTR lpGuid, PVOID pValue, DWORD nSize, DWORD dwAttributes );
+ [DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
+ [PInvokeData("winbase.h", MSDNShortId = "D3C2F03F-66F6-40A4-830E-058BBA925ACD")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetFirmwareEnvironmentVariableEx(string lpName, string lpGuid, IntPtr pValue, uint nSize, VARIABLE_ATTRIBUTE dwAttributes);
+
+ ///
+ /// Changes data execution prevention (DEP) and DEP-ATL thunk emulation settings for a 32-bit process.
+ ///
+ ///
+ /// A DWORD that can be one or more of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// 0
+ ///
+ /// If the DEP system policy is OptIn or OptOut and DEP is enabled for the process, setting dwFlags to 0 disables DEP for the process.
+ ///
+ ///
+ /// -
+ /// PROCESS_DEP_ENABLE 0x00000001
+ ///
+ /// Enables DEP permanently on the current process. After DEP has been enabled for the process by setting PROCESS_DEP_ENABLE, it
+ /// cannot be disabled for the life of the process.
+ ///
+ ///
+ /// -
+ /// PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
+ ///
+ /// Disables DEP-ATL thunk emulation for the current process, which prevents the system from intercepting NX faults that originate
+ /// from the Active Template Library (ATL) thunk layer. For more information, see the Remarks section. This flag can be specified
+ /// only with PROCESS_DEP_ENABLE.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, it returns TRUE.
+ /// If the function fails, it returns FALSE. To retrieve error values defined for this function, call GetLastError.
+ ///
+ ///
+ ///
+ /// The SetProcessDEPPolicy function overrides the system DEP policy for the current process unless its DEP policy was
+ /// specified at process creation. The system DEP policy setting must be OptIn or OptOut. If the system DEP policy is AlwaysOff or
+ /// AlwaysOn, SetProcessDEPPolicy returns an error. After DEP is enabled for a process, subsequent calls to
+ /// SetProcessDEPPolicy are ignored.
+ ///
+ ///
+ /// DEP policy specified at process creation with the PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY attribute cannot be changed for the
+ /// life of the process. In this case, calls to SetProcessDEPPolicy fail with ERROR_ACCESS_DENIED.
+ ///
+ ///
+ /// SetProcessDEPPolicy is supported for 32-bit processes only. If this function is called on a 64-bit process, it fails with ERROR_NOT_SUPPORTED.
+ ///
+ ///
+ /// Applications written to ATL 7.1 and earlier can attempt to execute code on pages marked as non-executable, which triggers an NX
+ /// fault and terminates the application. DEP-ATL thunk emulation allows an application that would otherwise trigger an NX fault to
+ /// run with DEP enabled. For information about ATL versions, see ATL and MFC Version Numbers.
+ ///
+ ///
+ /// If DEP-ATL thunk emulation is enabled, the system intercepts NX faults, emulates the instructions, and handles the exceptions so
+ /// the application can continue to run. If DEP-ATL thunk emulation is disabled by setting
+ /// PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION for the process, NX faults are not intercepted, which is useful when testing
+ /// applications for compatibility with DEP.
+ ///
+ ///
+ /// The following table summarizes the interactions between system DEP policy, DEP-ATL thunk emulation, and
+ /// SetProcessDEPPolicy. To get the system DEP policy setting, use the GetSystemDEPPolicy function.
+ ///
+ ///
+ ///
+ /// System DEP policy
+ /// DEP behavior
+ /// DEP_ATL thunk emulation behavior
+ /// SetProcessDEPPolicy behavior
+ ///
+ /// -
+ /// AlwaysOff 0
+ /// Disabled for the operating system and all processes.
+ /// Not applicable.
+ /// Returns an error.
+ ///
+ /// -
+ /// AlwaysOn 1
+ /// Enabled for the operating system and all processes.
+ /// Disabled.
+ /// Returns an error.
+ ///
+ /// -
+ /// OptIn 2 Default configuration for Windows client versions.
+ ///
+ /// Enabled for the operating system and disabled for nonsystem processes. Administrators can explicitly enable DEP for selected
+ /// executable files.
+ ///
+ /// Not applicable.
+ ///
+ /// DEP can be enabled for the current process. If DEP is enabled for the current process, DEP-ATL thunk emulation can be disabled
+ /// for that process.
+ ///
+ ///
+ /// -
+ /// OptOut 3 Default configuration for Windows Server versions.
+ ///
+ /// Enabled for the operating system and all processes. Administrators can explicitly disable DEP for selected executable files.
+ ///
+ /// Enabled.
+ ///
+ /// DEP can be disabled for the current process. If DEP is disabled for the current process, DEP-ATL thunk emulation is automatically
+ /// disabled for that process.
+ ///
+ ///
+ ///
+ ///
+ /// To compile an application that calls this function, define _WIN32_WINNT as 0x0600 or later. For more information, see
+ /// Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setprocessdeppolicy BOOL SetProcessDEPPolicy( DWORD
+ // dwFlags );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "17c9f522-fd64-4061-9212-8fc91cc96b18")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetProcessDEPPolicy(PROCESS_DEP dwFlags);
+
+ ///
+ /// Sets the per-process mode that the SearchPath function uses when locating files.
+ ///
+ ///
+ /// The search mode to use.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE 0x00000001
+ /// Enable safe process search mode for the process.
+ ///
+ /// -
+ /// BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE 0x00010000
+ /// Disable safe process search mode for the process.
+ ///
+ /// -
+ /// BASE_SEARCH_PATH_PERMANENT 0x00008000
+ ///
+ /// Optional flag to use in combination with BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE to make this mode permanent for this process.
+ /// This is done by bitwise OR operation: This flag cannot be combined with the BASE_SEARCH_PATH_DISABLE_SAFE_SEARCHMODE flag.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// If the operation completes successfully, the SetSearchPathMode function returns a nonzero value.
+ ///
+ /// If the operation fails, the SetSearchPathMode function returns zero. To get extended error information, call the
+ /// GetLastError function.
+ ///
+ ///
+ /// If the SetSearchPathMode function fails because a parameter value is not valid, the value returned by the GetLastError
+ /// function will be ERROR_INVALID_PARAMETER.
+ ///
+ ///
+ /// If the SetSearchPathMode function fails because the combination of current state and parameter value is not valid, the
+ /// value returned by the GetLastError function will be ERROR_ACCESS_DENIED. For more information, see the Remarks section.
+ ///
+ ///
+ ///
+ ///
+ /// If the SetSearchPathMode function has not been successfully called for the current process, the search mode used by the
+ /// SearchPath function is obtained from the system registry. For more information, see SearchPath.
+ ///
+ ///
+ /// After the SetSearchPathMode function has been successfully called for the current process, the setting in the system
+ /// registry is ignored in favor of the mode most recently set successfully.
+ ///
+ ///
+ /// If the SetSearchPathMode function has been successfully called for the current process with Flags set to , safe mode is
+ /// set permanently for the calling process. Any subsequent calls to the SetSearchPathMode function from within that process
+ /// that attempt to change the search mode will fail with ERROR_ACCESS_DENIED from the GetLastError function.
+ ///
+ ///
+ /// Note Because setting safe search mode permanently cannot be disabled for the life of the process for which is was set, it
+ /// should be used with careful consideration. This is particularly true for DLL development, where the user of the DLL will be
+ /// affected by this process-wide setting.
+ ///
+ /// It is not possible to permanently disable safe search mode.
+ /// This function does not modify the system registry.
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// Yes
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// Yes
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// Yes
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setsearchpathmode BOOL SetSearchPathMode( DWORD Flags );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "1874933d-92c3-4945-a3e4-e6dede232d5e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetSearchPathMode(BASE_SEARCH_PATH Flags);
+
+ ///
+ /// Sets application-specific context information for the specified user-mode scheduling (UMS) worker thread.
+ ///
+ ///
+ /// A pointer to a UMS thread context.
+ ///
+ ///
+ /// A UMS_THREAD_INFO_CLASS value that specifies the kind of information to set. This parameter must be UmsThreadUserContext.
+ ///
+ ///
+ /// A pointer to a buffer that contains the information to set.
+ ///
+ ///
+ /// The size of the UmsThreadInformation buffer, in bytes.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError. Possible error values
+ /// include the following.
+ ///
+ ///
+ ///
+ /// Return code
+ /// Description
+ ///
+ /// -
+ /// ERROR_INFO_LENGTH_MISMATCH
+ /// The buffer size does not match the required size for the specified information class.
+ ///
+ /// -
+ /// ERROR_INVALID_INFO_CLASS
+ /// The UmsThreadInfoClass parameter specifies an information class that is not supported.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// The SetUmsThreadInformation function can be used to set an application-defined context for the specified UMS worker
+ /// thread. The context information can consist of anything the application might find useful to track, such as per-scheduler or
+ /// per-worker thread state. The underlying structures for UMS worker threads are managed by the system and should not be modified directly.
+ ///
+ ///
+ /// The QueryUmsThreadInformation function can be used to retrieve other exposed information about the specified thread, such as its
+ /// thread execution block (TEB) and whether the thread is suspended or terminated. Information that is not exposed through
+ /// QueryUmsThreadInformation should be considered reserved.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setumsthreadinformation BOOL SetUmsThreadInformation(
+ // PUMS_CONTEXT UmsThread, UMS_THREAD_INFO_CLASS UmsThreadInfoClass, PVOID UmsThreadInformation, ULONG UmsThreadInformationLength );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "19f190fd-1f78-4bb6-93eb-73a5c522b44d")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetUmsThreadInformation(IntPtr UmsThread, UMS_THREAD_INFO_CLASS UmsThreadInfoClass, IntPtr UmsThreadInformation, uint UmsThreadInformationLength);
+
+ ///
+ /// Sets the mask of XState features set within a CONTEXT structure.
+ ///
+ ///
+ /// A pointer to a CONTEXT structure that has been initialized with InitializeContext.
+ ///
+ ///
+ /// A mask of XState features to set in the specified CONTEXT structure.
+ ///
+ ///
+ /// This function returns TRUE if successful, otherwise FALSE.
+ ///
+ ///
+ ///
+ /// The SetXStateFeaturesMask function sets the mask of valid features in the specified context. Before calling
+ /// GetThreadContext, Wow64GetThreadContext, SetThreadContext, or Wow64SetThreadContext the application must call
+ /// SetXStateFeaturesMask to specify which set of features to retrieve or set. The system silently ignores any feature
+ /// specified in the FeatureMask which is not enabled on the processor.
+ ///
+ ///
+ /// Windows 7 with SP1 and Windows Server 2008 R2 with SP1: The AVX API is first implemented on Windows 7 with SP1 and Windows
+ /// Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work
+ /// with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using
+ /// GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-setxstatefeaturesmask BOOL SetXStateFeaturesMask( PCONTEXT
+ // Context, DWORD64 FeatureMask );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "64ADEA8A-DE78-437E-AE68-A68E7214C5FD")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool SetXStateFeaturesMask(IntPtr Context, ulong FeatureMask);
+
+ ///
+ /// [This function is not supported and should not be used. It may change or disappear completely without advance notice.]
+ /// Determines whether the Terminal Server is in the INSTALL mode.
+ ///
+ ///
+ /// This function returns TRUE if the Terminal Server is in INSTALL mode and FALSE if it is in EXECUTE mode.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/devnotes/termsrvappinstallmode BOOL TermsrvAppInstallMode(void);
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "edf362e6-c1a4-49fe-8e07-1188c66616be")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool TermsrvAppInstallMode();
+
+ ///
+ /// Yields control to the user-mode scheduling (UMS) scheduler thread on which the calling UMS worker thread is running.
+ ///
+ ///
+ /// A parameter to pass to the scheduler thread's UmsSchedulerProc function.
+ ///
+ ///
+ /// If the function succeeds, it returns a nonzero value.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// A UMS worker thread calls the UmsThreadYield function to cooperatively yield control to the UMS scheduler thread on which
+ /// the worker thread is running. If a UMS worker thread never calls UmsThreadYield, the worker thread runs until it either
+ /// blocks or is terminated.
+ ///
+ ///
+ /// When control switches to the UMS scheduler thread, the system calls the associated scheduler entry point function with the reason
+ /// UmsSchedulerThreadYield and the ScheduleParam parameter specified by the worker thread in the UmsThreadYield call.
+ ///
+ /// The application's scheduler is responsible for rescheduling the worker thread.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-umsthreadyield BOOL UmsThreadYield( PVOID SchedulerParam );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "d7c94ed5-9536-4c39-8658-27e4237cc9ba")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool UmsThreadYield(IntPtr SchedulerParam);
+
+ ///
+ /// Enables or disables file system redirection for the calling thread.
+ ///
+ /// This function may not work reliably when there are nested calls. Therefore, this function has been replaced by the
+ /// Wow64DisableWow64FsRedirection and Wow64RevertWow64FsRedirection functions.
+ ///
+ ///
+ /// Note These two methods of controlling file system redirection cannot be combined in any way. Do not use the
+ /// Wow64EnableWow64FsRedirection function with either the Wow64DisableWow64FsRedirection or the Wow64RevertWow64FsRedirection function.
+ ///
+ ///
+ ///
+ ///
+ /// Indicates the type of request for WOW64 system folder redirection. If TRUE, requests redirection be enabled; if
+ /// FALSE, requests redirection be disabled.
+ ///
+ ///
+ ///
+ ///
+ /// Boolean value indicating whether the function succeeded. If TRUE, the function succeeded; if FALSE, the function failed.
+ ///
+ ///
+ ///
+ ///
+ /// This function is useful for 32-bit applications that want to gain access to the native system32 directory. By default, WOW64 file
+ /// system redirection is enabled.
+ ///
+ ///
+ /// Note The Wow64EnableWow64FsRedirection function affects all file operations performed by the current thread, which
+ /// can have unintended consequences if file system redirection is disabled for any length of time. For example, DLL loading depends
+ /// on file system redirection, so disabling file system redirection will cause DLL loading to fail. Also, many feature
+ /// implementations use delayed loading and will fail while redirection is disabled. The failure state of the initial delay-load
+ /// operation is persisted, so any subsequent use of the delay-load function will fail even after file system redirection is
+ /// re-enabled. To avoid these problems, disable file system redirection immediately before calls to specific file I/O functions
+ /// (such as CreateFile) that must not be redirected, and re-enable file system redirection immediately afterward using .
+ ///
+ ///
+ /// File redirection is enabled or disabled only for the thread calling this function. This affects only operations made by the
+ /// current thread. Some functions, such as CreateProcessAsUser, do their work on another thread, which is not affected by the state
+ /// of file system redirection in the calling thread.
+ ///
+ /// In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
+ ///
+ ///
+ /// Technology
+ /// Supported
+ ///
+ /// -
+ /// Server Message Block (SMB) 3.0 protocol
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 Transparent Failover (TFO)
+ /// No
+ ///
+ /// -
+ /// SMB 3.0 with Scale-out File Shares (SO)
+ /// No
+ ///
+ /// -
+ /// Cluster Shared Volume File System (CsvFS)
+ /// Yes
+ ///
+ /// -
+ /// Resilient File System (ReFS)
+ /// No
+ ///
+ ///
+ /// Examples
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-wow64enablewow64fsredirection BOOLEAN
+ // Wow64EnableWow64FsRedirection( BOOLEAN Wow64FsEnableRedirection );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "8d11a7ba-540d-4bd0-881a-a61605357dd8")]
+ [return: MarshalAs(UnmanagedType.U1)]
+ public static extern bool Wow64EnableWow64FsRedirection([MarshalAs(UnmanagedType.U1)] bool Wow64FsEnableRedirection);
+
+ ///
+ /// Retrieves the context of the specified WOW64 thread.
+ ///
+ ///
+ ///
+ /// A handle to the thread whose context is to be retrieved. The handle must have THREAD_GET_CONTEXT access to the thread. For
+ /// more information, see Thread Security and Access Rights.
+ ///
+ ///
+ ///
+ /// A WOW64_CONTEXT structure. The caller must initialize the ContextFlags member of this structure.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// This function is used to retrieve the thread context of the specified thread. The function retrieves a selective context based on
+ /// the value of the ContextFlags member of the context structure. The thread identified by the hThread parameter is typically
+ /// being debugged, but the function can also operate when the thread is not being debugged.
+ ///
+ ///
+ /// You cannot get a valid context for a running thread. Use the Wow64SuspendThread function to suspend the thread before calling Wow64GetThreadContext.
+ ///
+ ///
+ /// If you call Wow64GetThreadContext for the current thread, the function returns successfully; however, the context returned
+ /// is not valid.
+ ///
+ ///
+ /// This function is intended for 64-bit applications. It is not supported on 32-bit Windows; such calls fail and set the last error
+ /// code to ERROR_INVALID_FUNCTION. A 32-bit application can call this function on a WOW64 thread; the result is the same as
+ /// calling the GetThreadContext function.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-wow64getthreadcontext BOOL Wow64GetThreadContext( HANDLE
+ // hThread, PWOW64_CONTEXT lpContext );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "1bac28e1-3558-43c4-97e4-d8bb9514c38e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Wow64GetThreadContext(IntPtr hThread, IntPtr lpContext);
+
+ ///
+ /// Retrieves a descriptor table entry for the specified selector and WOW64 thread.
+ ///
+ ///
+ ///
+ /// A handle to the thread containing the specified selector. The handle must have been created with THREAD_QUERY_INFORMATION access
+ /// to the thread. For more information, see Thread Security and Access Rights.
+ ///
+ ///
+ ///
+ /// The global or local selector value to look up in the thread's descriptor tables.
+ ///
+ ///
+ ///
+ /// A pointer to a WOW64_LDT_ENTRY structure that receives a copy of the descriptor table entry if the specified selector has an
+ /// entry in the specified thread's descriptor table. This information can be used to convert a segment-relative address to a linear
+ /// virtual address.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero. In that case, the structure pointed to by the lpSelectorEntry parameter
+ /// receives a copy of the specified descriptor table entry.
+ ///
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// The Wow64GetThreadSelectorEntry function is functional only on 64-bit systems and can be called only by 64-bit processes.
+ /// If this function is called by a 32-bit process, the function fails with ERROR_NOT_SUPPORTED. A 32-bit process should use the
+ /// GetThreadSelectorEntry function instead.
+ ///
+ ///
+ /// Debuggers use this function to convert segment-relative addresses to linear virtual addresses. The ReadProcessMemory and
+ /// WriteProcessMemory functions use linear virtual addresses.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-wow64getthreadselectorentry BOOL
+ // Wow64GetThreadSelectorEntry( HANDLE hThread, DWORD dwSelector, PWOW64_LDT_ENTRY lpSelectorEntry );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "68393913-6725-4cc6-90b9-57da2a96c91e")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Wow64GetThreadSelectorEntry(IntPtr hThread, uint dwSelector, ref WOW64_LDT_ENTRY lpSelectorEntry);
+
+ ///
+ /// Sets the context of the specified WOW64 thread.
+ ///
+ ///
+ /// A handle to the thread whose context is to be set.
+ ///
+ ///
+ /// A WOW64_CONTEXT structure. The caller must initialize the ContextFlags member of this structure.
+ ///
+ ///
+ /// If the function succeeds, the return value is nonzero.
+ /// If the function fails, the return value is zero. To get extended error information, call GetLastError.
+ ///
+ ///
+ ///
+ /// This function allows the selective context to be set based on the value of the ContextFlags member of the context
+ /// structure. The thread handle identified by the hThread parameter is typically being debugged, but the function can also operate
+ /// even when it is not being debugged.
+ ///
+ ///
+ /// This function is intended for 64-bit applications. It is not supported on 32-bit Windows; such calls fail and set the last error
+ /// code to ERROR_INVALID_FUNCTION. A 32-bit application can call this function on a WOW64 thread; the result is the same as
+ /// calling the SetThreadContext function.
+ ///
+ ///
+ /// Do not try to set the context for a running thread; the results are unpredictable. Use the Wow64SuspendThread function to suspend
+ /// the thread before calling Wow64SetThreadContext.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-wow64setthreadcontext BOOL Wow64SetThreadContext( HANDLE
+ // hThread, CONST WOW64_CONTEXT *lpContext );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "4119c945-b654-4634-a88b-e41bc762018a")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool Wow64SetThreadContext(IntPtr hThread, ref WOW64_CONTEXT lpContext);
+
+ ///
+ /// Suspends the specified WOW64 thread.
+ ///
+ ///
+ /// A handle to the thread that is to be suspended.
+ /// The handle must have the THREAD_SUSPEND_RESUME access right. For more information, see Thread Security and Access Rights.
+ ///
+ ///
+ ///
+ /// If the function succeeds, the return value is the thread's previous suspend count; otherwise, it is (DWORD) -1. To get extended
+ /// error information, use the GetLastError function.
+ ///
+ ///
+ ///
+ ///
+ /// If the function succeeds, execution of the specified thread is suspended and the thread's suspend count is incremented.
+ /// Suspending a thread causes the thread to stop executing user-mode (application) code.
+ ///
+ ///
+ /// This function is primarily designed for use by debuggers. It is not intended to be used for thread synchronization. Calling
+ /// Wow64SuspendThread on a thread that owns a synchronization object, such as a mutex or critical section, can lead to a
+ /// deadlock if the calling thread tries to obtain a synchronization object owned by a suspended thread. To avoid this situation, a
+ /// thread within an application that is not a debugger should signal the other thread to suspend itself. The target thread must be
+ /// designed to watch for this signal and respond appropriately.
+ ///
+ ///
+ /// Each thread has a suspend count (with a maximum value of MAXIMUM_SUSPEND_COUNT). If the suspend count is greater than zero, the
+ /// thread is suspended; otherwise, the thread is not suspended and is eligible for execution. Calling Wow64SuspendThread
+ /// causes the target thread's suspend count to be incremented. Attempting to increment past the maximum suspend count causes an
+ /// error without incrementing the count.
+ ///
+ /// The ResumeThread function decrements the suspend count of a suspended thread.
+ ///
+ /// This function is intended for 64-bit applications. It is not supported on 32-bit Windows; such calls fail and set the last error
+ /// code to ERROR_INVALID_FUNCTION. A 32-bit application can call this function on a WOW64 thread; the result is the same as calling
+ /// the SuspendThread function.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-wow64suspendthread DWORD Wow64SuspendThread( HANDLE
+ // hThread );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("winbase.h", MSDNShortId = "d976675a-5400-41ac-a11d-c39a1b2dd50d")]
+ public static extern uint Wow64SuspendThread(IntPtr hThread);
+
+ ///
+ /// Contains extended parameters for the CopyFile2 function.
+ ///
+ ///
+ ///
+ /// To compile an application that uses this structure, define the _WIN32_WINNT macro as _WIN32_WINNT_WIN8 or later.
+ /// For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-copyfile2_extended_parameters typedef struct
+ // COPYFILE2_EXTENDED_PARAMETERS { DWORD dwSize; DWORD dwCopyFlags; BOOL *pfCancel; PCOPYFILE2_PROGRESS_ROUTINE pProgressRoutine;
+ // PVOID pvCallbackContext; };
+ [PInvokeData("winbase.h", MSDNShortId = "a8da62e5-bc49-4aff-afaa-e774393b7120")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct COPYFILE2_EXTENDED_PARAMETERS
+ {
+ ///
+ /// Contains the size of this structure, .
+ ///
+ public uint dwSize;
+
+ ///
+ /// Contains a combination of zero or more of these flag values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// COPY_FILE_ALLOW_DECRYPTED_DESTINATION 0x00000008
+ /// The copy will be attempted even if the destination file cannot be encrypted.
+ ///
+ /// -
+ /// COPY_FILE_COPY_SYMLINK 0x00000800
+ ///
+ /// If the source file is a symbolic link, the destination file is also a symbolic link pointing to the same file as the source
+ /// symbolic link.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_FAIL_IF_EXISTS 0x00000001
+ ///
+ /// If the destination file exists the copy operation fails immediately. If a file or directory exists with the destination name
+ /// then the CopyFile2 function call will fail with either or . If COPY_FILE_RESUME_FROM_PAUSE is also specified then a failure
+ /// is only triggered if the destination file does not have a valid restart header.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_NO_BUFFERING 0x00001000
+ ///
+ /// The copy is performed using unbuffered I/O, bypassing the system cache resources. This flag is recommended for very large
+ /// file copies. It is not recommended to pause copies that are using this flag.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_NO_OFFLOAD 0x00040000
+ /// Do not attempt to use the Windows Copy Offload mechanism. This is not generally recommended.
+ ///
+ /// -
+ /// COPY_FILE_OPEN_SOURCE_FOR_WRITE 0x00000004
+ /// The file is copied and the source file is opened for write access.
+ ///
+ /// -
+ /// COPY_FILE_RESTARTABLE 0x00000002
+ ///
+ /// The file is copied in a manner that can be restarted if the same source and destination filenames are used again. This is slower.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_REQUEST_SECURITY_PRIVILEGES 0x00002000
+ ///
+ /// The copy is attempted, specifying for the source file and for the destination file. If these requests are denied the access
+ /// request will be reduced to the highest privilege level for which access is granted. For more information see SACL Access
+ /// Right. This can be used to allow the CopyFile2ProgressRoutine callback to perform operations requiring higher privileges,
+ /// such as copying the security attributes for the file.
+ ///
+ ///
+ /// -
+ /// COPY_FILE_RESUME_FROM_PAUSE 0x00004000
+ ///
+ /// The destination file is examined to see if it was copied using COPY_FILE_RESTARTABLE. If so the copy is resumed. If not the
+ /// file will be fully copied.
+ ///
+ ///
+ ///
+ ///
+ public COPY_FILE dwCopyFlags;
+
+ ///
+ /// If this flag is set to TRUE during the copy operation then the copy operation is canceled.
+ ///
+ public IntPtr pfCancel;
+
+ ///
+ ///
+ /// The optional address of a callback function of type PCOPYFILE2_PROGRESS_ROUTINE that is called each time another
+ /// portion of the file has been copied. This parameter can be NULL. For more information on the progress callback
+ /// function, see the CopyFile2ProgressRoutine callback function.
+ ///
+ ///
+ [MarshalAs(UnmanagedType.FunctionPtr)]
+ public Pcopyfile2ProgressRoutine pProgressRoutine;
+
+ ///
+ /// A pointer to application-specific context information to be passed to the CopyFile2ProgressRoutine.
+ ///
+ public IntPtr pvCallbackContext;
+ }
+
+ ///
+ /// Passed to the CopyFile2ProgressRoutine callback function with information about a pending copy operation.
+ ///
+ ///
+ ///
+ /// To compile an application that uses the COPYFILE2_MESSAGE structure, define the _WIN32_WINNT macro as 0x0601 or
+ /// later. For more information, see Using the Windows Headers.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-copyfile2_message
+ [PInvokeData("winbase.h", MSDNShortId = "ab841bee-90a0-4beb-99d3-764e608c3872")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct COPYFILE2_MESSAGE
+ {
+ ///
+ /// Value from the COPYFILE2_MESSAGE_TYPE enumeration used as a discriminant for the Info union within this structure.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_CHUNK_STARTED 1
+ ///
+ /// Indicates a single chunk of a stream has started to be copied. Information is in the ChunkStarted structure within the Info union.
+ ///
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_CHUNK_FINISHED 2
+ ///
+ /// Indicates the copy of a single chunk of a stream has completed. Information is in the ChunkFinished structure within the Info union.
+ ///
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_STREAM_STARTED 3
+ ///
+ /// Indicates both source and destination handles for a stream have been opened and the copy of the stream is about to be
+ /// started. Information is in the StreamStarted structure within the Info union. This does not indicate that the copy has
+ /// started for that stream.
+ ///
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_STREAM_FINISHED 4
+ ///
+ /// Indicates the copy operation for a stream have started to be completed, either successfully or due to a
+ /// COPYFILE2_PROGRESS_STOP return from CopyFile2ProgressRoutine. Information is in the StreamFinished structure within the Info union.
+ ///
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_POLL_CONTINUE 5
+ /// May be sent periodically. Information is in the PollContinue structure within the Info union.
+ ///
+ /// -
+ /// COPYFILE2_CALLBACK_ERROR 6
+ /// An error was encountered during the copy operation. Information is in the Error structure within the Info union.
+ ///
+ ///
+ ///
+ public COPYFILE2_MESSAGE_TYPE Type;
+
+ private uint dwPadding;
+
+ /// Union
+ public Union Info;
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Explicit)]
+ public struct Union
+ {
+ /// Undocumented.
+ [FieldOffset(0)]
+ public ChunkStarted ChunkStarted;
+
+ /// Undocumented.
+ [FieldOffset(0)]
+ public ChunkFinished ChunkFinished;
+
+ /// Undocumented.
+ [FieldOffset(0)]
+ public StreamStarted StreamStarted;
+
+ /// Undocumented.
+ [FieldOffset(0)]
+ public StreamFinished StreamFinished;
+
+ /// Undocumented.
+ [FieldOffset(0)]
+ public PollContinue PollContinue;
+
+ /// Undocumented.
+ [FieldOffset(0)]
+ public Error Error;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct ChunkStarted
+ {
+ ///
+ ///
+ /// Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will
+ /// start at one (1) and will always be higher than any previous stream for that file.
+ ///
+ ///
+ public uint dwStreamNumber;
+
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwReserved;
+
+ ///
+ /// Handle to the source stream.
+ ///
+ public IntPtr hSourceFile;
+
+ ///
+ /// Handle to the destination stream.
+ ///
+ public IntPtr hDestinationFile;
+
+ ///
+ ///
+ /// Indicates which chunk within the current stream is about to be copied. The value used for a chunk will start at zero (0)
+ /// and will always be higher than that of any previous chunk for the current stream.
+ ///
+ ///
+ public ulong uliChunkNumber;
+
+ ///
+ /// Size of the copied chunk, in bytes.
+ ///
+ public ulong uliChunkSize;
+
+ ///
+ /// Size of the current stream, in bytes.
+ ///
+ public ulong uliStreamSize;
+
+ ///
+ /// Size of all streams for this file, in bytes.
+ ///
+ public ulong uliTotalFileSize;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct ChunkFinished
+ {
+ ///
+ ///
+ /// Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will
+ /// start at one (1) and will always be higher than any previous stream for that file.
+ ///
+ ///
+ public uint dwStreamNumber;
+
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwFlags;
+
+ ///
+ /// Handle to the source stream.
+ ///
+ public IntPtr hSourceFile;
+
+ ///
+ /// Handle to the destination stream.
+ ///
+ public IntPtr hDestinationFile;
+
+ ///
+ ///
+ /// Indicates which chunk within the current stream is in process. The value used for a chunk will start at zero (0) and will
+ /// always be higher than that of any previous chunk for the current stream.
+ ///
+ ///
+ public ulong uliChunkNumber;
+
+ ///
+ /// Size of the copied chunk, in bytes.
+ ///
+ public ulong uliChunkSize;
+
+ ///
+ /// Size of the current stream, in bytes.
+ ///
+ public ulong uliStreamSize;
+
+ ///
+ /// Total bytes copied for this stream so far.
+ ///
+ public ulong uliStreamBytesTransferred;
+
+ ///
+ /// Size of all streams for this file, in bytes.
+ ///
+ public ulong uliTotalFileSize;
+
+ ///
+ /// Total bytes copied for this file so far.
+ ///
+ public ulong uliTotalBytesTransferred;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct StreamStarted
+ {
+ ///
+ ///
+ /// Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will
+ /// start at one (1) and will always be higher than any previous stream for that file.
+ ///
+ ///
+ public uint dwStreamNumber;
+
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwReserved;
+
+ ///
+ /// Handle to the source stream.
+ ///
+ public IntPtr hSourceFile;
+
+ ///
+ /// Handle to the destination stream.
+ ///
+ public IntPtr hDestinationFile;
+
+ ///
+ /// Size of the current stream, in bytes.
+ ///
+ public ulong uliStreamSize;
+
+ ///
+ /// Size of all streams for this file, in bytes.
+ ///
+ public ulong uliTotalFileSize;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct StreamFinished
+ {
+ ///
+ ///
+ /// Indicates which stream within the file is about to be copied. The value used for identifying a stream within a file will
+ /// start at one (1) and will always be higher than any previous stream for that file.
+ ///
+ ///
+ public uint dwStreamNumber;
+
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwReserved;
+
+ ///
+ /// Handle to the source stream.
+ ///
+ public IntPtr hSourceFile;
+
+ ///
+ /// Handle to the destination stream.
+ ///
+ public IntPtr hDestinationFile;
+
+ ///
+ /// Size of the current stream, in bytes.
+ ///
+ public ulong uliStreamSize;
+
+ ///
+ /// Total bytes copied for this stream so far.
+ ///
+ public ulong uliStreamBytesTransferred;
+
+ ///
+ /// Size of all streams for this file, in bytes.
+ ///
+ public ulong uliTotalFileSize;
+
+ ///
+ /// Total bytes copied for this file so far.
+ ///
+ public ulong uliTotalBytesTransferred;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct PollContinue
+ {
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwReserved;
+ }
+
+ /// Undocumented.
+ [StructLayout(LayoutKind.Sequential)]
+ public struct Error
+ {
+ ///
+ /// Value from the COPYFILE2_COPY_PHASE enumeration indicating the current phase of the copy at the time of the error.
+ ///
+ public COPYFILE2_COPY_PHASE CopyPhase;
+
+ ///
+ /// The number of the stream that was being processed at the time of the error.
+ ///
+ public uint dwStreamNumber;
+
+ ///
+ /// Value indicating the problem.
+ ///
+ public HRESULT hrFailure;
+
+ ///
+ /// This member is reserved for internal use.
+ ///
+ public uint dwReserved;
+
+ ///
+ ///
+ /// Indicates which chunk within the current stream was being processed at the time of the error. The value used for a chunk
+ /// will start at zero (0) and will always be higher than that of any previous chunk for the current stream.
+ ///
+ ///
+ public ulong uliChunkNumber;
+
+ ///
+ /// Size, in bytes, of the stream being processed.
+ ///
+ public ulong uliStreamSize;
+
+ ///
+ /// Number of bytes that had been successfully transferred for the stream being processed.
+ ///
+ public ulong uliStreamBytesTransferred;
+
+ ///
+ /// Size, in bytes, of the total file being processed.
+ ///
+ public ulong uliTotalFileSize;
+
+ ///
+ /// Number of bytes that had been successfully transferred for the entire copy operation.
+ ///
+ public ulong uliTotalBytesTransferred;
+ }
+ }
+
+ ///
+ ///
+ /// Specifies attributes for a user-mode scheduling (UMS) scheduler thread. The EnterUmsSchedulingMode function uses this structure.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_ums_scheduler_startup_info typedef struct
+ // _UMS_SCHEDULER_STARTUP_INFO { ULONG UmsVersion; PUMS_COMPLETION_LIST CompletionList; PUMS_SCHEDULER_ENTRY_POINT SchedulerProc;
+ // PVOID SchedulerParam; } UMS_SCHEDULER_STARTUP_INFO, *PUMS_SCHEDULER_STARTUP_INFO;
+ [PInvokeData("winbase.h", MSDNShortId = "e3f7b1b7-d2b8-432d-bce7-3633292e855b")]
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
+ public struct UMS_SCHEDULER_STARTUP_INFO
+ {
+ ///
+ /// The UMS version for which the application was built. This parameter must be UMS_VERSION (0x0100).
+ ///
+ public uint UmsVersion;
+
+ ///
+ /// A pointer to a UMS completion list to associate with the calling thread.
+ ///
+ public IntPtr CompletionList;
+
+ ///
+ ///
+ /// A pointer to an application-defined UmsSchedulerProc entry point function. The system calls this function when the calling
+ /// thread has been converted to UMS and is ready to run UMS worker threads. Subsequently, it calls this function when a UMS
+ /// worker thread running on the calling thread yields or blocks.
+ ///
+ ///
+ public RtlUmsSchedulerEntryPoint SchedulerProc;
+
+ ///
+ /// An application-defined parameter to pass to the specified UmsSchedulerProc function.
+ ///
+ public IntPtr SchedulerParam;
+ }
+
+ ///
+ ///
+ /// Specifies a UMS scheduler thread, UMS worker thread, or non-UMS thread. The GetUmsSystemThreadInformation function uses this structure.
+ ///
+ ///
+ ///
+ /// If both IsUmsSchedulerThread and IsUmsWorkerThread are clear, the structure specifies a non-UMS thread.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_ums_system_thread_information typedef struct
+ // _UMS_SYSTEM_THREAD_INFORMATION { ULONG UmsVersion; union { struct { ULONG IsUmsSchedulerThread : 1; ULONG IsUmsWorkerThread : 1; }
+ // DUMMYSTRUCTNAME; ULONG ThreadUmsFlags; } DUMMYUNIONNAME; } UMS_SYSTEM_THREAD_INFORMATION, *PUMS_SYSTEM_THREAD_INFORMATION;
+ [PInvokeData("winbase.h", MSDNShortId = "eecdc592-5046-47c3-a4c6-ecb10899db3c")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct UMS_SYSTEM_THREAD_INFORMATION
+ {
+ ///
+ /// The UMS version. This member must be UMS_VERSION.
+ ///
+ public uint UmsVersion;
+
+ /// A bitfield that specifies a UMS thread type.
+ public ThreadUmsFlags ThreadUmsFlags;
+ }
+
/// SafeHandle instance using upon disposal.
public class SafeObjectHandle : GenericSafeHandle
{
/// Initializes a new instance of the class.
public SafeObjectHandle() : this(IntPtr.Zero) { }
+
/// Initializes a new instance of the class.
/// The handle.
public SafeObjectHandle(IntPtr handle) : base(handle, CloseHandle) { }
diff --git a/PInvoke/Kernel32/WinCon.cs b/PInvoke/Kernel32/WinCon.cs
index 9554675c..492a0187 100644
--- a/PInvoke/Kernel32/WinCon.cs
+++ b/PInvoke/Kernel32/WinCon.cs
@@ -1371,22 +1371,40 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetConsoleCursorInfo(IntPtr hConsoleOutput, ref CONSOLE_CURSOR_INFO lpConsoleCursorInfo);
- /// Sets the cursor position in the specified console screen buffer.
+ ///
+ /// Sets the cursor position in the specified console screen buffer.
+ ///
///
- /// A handle to the console screen buffer. The handle must have the GENERIC_READ access right. For more information, see Console Buffer Security
- /// and Access Rights.
+ ///
+ /// [in]A handle to the console screen buffer. The handle must have the GENERIC_READ access right. For more information, see
+ /// Console Buffer Security and Access Rights.
+ ///
///
///
- /// A COORD structure that specifies the new cursor position, in characters. The coordinates are the column and row of a screen buffer character
- /// cell. The coordinates must be within the boundaries of the console screen buffer.
+ ///
+ /// [in]A COORD structure that specifies the new cursor position, in characters. The coordinates are the column and row of a
+ /// screen buffer character cell. The coordinates must be within the boundaries of the console screen buffer.
+ ///
///
///
/// If the function succeeds, the return value is nonzero.
/// If the function fails, the return value is zero. To get extended error information, call GetLastError.
///
+ ///
+ ///
+ /// The cursor position determines where characters written by the WriteFile or WriteConsole function, or echoed by the
+ /// ReadFile or ReadConsole function, are displayed. To determine the current position of the cursor, use the
+ /// GetConsoleScreenBufferInfo function.
+ ///
+ ///
+ /// If the new cursor position is not within the boundaries of the console screen buffer's window, the window origin changes to make
+ /// the cursor visible.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/console/setconsolecursorposition
// BOOL WINAPI SetConsoleCursorPosition( _In_ HANDLE hConsoleOutput, _In_ COORD dwCursorPosition );
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
- [PInvokeData("Wincon.h", MSDNShortId = "")]
+ [PInvokeData("Wincon.h", MSDNShortId = "8e9abada-a64e-429f-8286-ced1169c7104")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetConsoleCursorPosition(IntPtr hConsoleOutput, COORD dwCursorPosition);
diff --git a/PInvoke/Kernel32/WinNT.cs b/PInvoke/Kernel32/WinNT.cs
index 703b4fb0..810faa36 100644
--- a/PInvoke/Kernel32/WinNT.cs
+++ b/PInvoke/Kernel32/WinNT.cs
@@ -1,11 +1,216 @@
using System;
using System.Runtime.InteropServices;
+using static Vanara.Extensions.BitHelper;
+
// ReSharper disable InconsistentNaming
namespace Vanara.PInvoke
{
public static partial class Kernel32
{
+ ///
+ ///
+ /// An application-defined function previously registered with the AddSecureMemoryCacheCallback function that is called when a
+ /// secured memory range is freed or its protections are changed.
+ ///
+ ///
+ /// The PSECURE_MEMORY_CACHE_CALLBACK type defines a pointer to this callback function. is a placeholder for the
+ /// application-defined function name.
+ ///
+ ///
+ ///
+ /// The starting address of the memory range.
+ ///
+ ///
+ /// The size of the memory range, in bytes.
+ ///
+ ///
+ /// The return value indicates the success or failure of this function.
+ /// If the caller has secured the specified memory range, this function should unsecure the memory and return TRUE.
+ /// If the caller has not secured the specified memory range, this function should return FALSE.
+ ///
+ ///
+ ///
+ /// After the callback function is registered, it is called after any attempt to free the specified memory range or change its
+ /// protections. If the application has secured any part of the specified memory range, the callback function must invalidate all of
+ /// the application's cached memory mappings for the secured memory range, unsecure the secured parts of the memory range, and return
+ /// TRUE. Otherwise it must return FALSE.
+ ///
+ ///
+ /// The application secures and unsecures a memory range by sending requests to a device driver, which uses the MmSecureVirtualMemory
+ /// and MmUnsecureVirtualMemory functions to actually secure and unsecure the range. Operations on other types of secured or locked
+ /// memory do not trigger this callback.
+ ///
+ ///
+ /// Examples of function calls that trigger the callback function include calls to the VirtualFree, VirtualFreeEx, VirtualProtect,
+ /// VirtualProtectEx, and UnmapViewOfFile functions.
+ ///
+ ///
+ /// The callback function can also be triggered by a heap operation. In this case, the function must not perform any further
+ /// operations on the heap that triggered the callback. This includes calling heap functions on a private heap or the process's
+ /// default heap, or calling standard library functions such as malloc and free, which implicitly use the process's
+ /// default heap.
+ ///
+ /// To unregister the callback function, use the RemoveSecureMemoryCacheCallback function.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/nc-winnt-psecure_memory_cache_callback
+ // BOOLEAN PsecureMemoryCacheCallback( PVOID Addr, SIZE_T Range ) {...}
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+ [PInvokeData("winnt.h", MSDNShortId = "abde4b6f-7cd8-4a4b-9b00-f035b2c29054")]
+ [return: MarshalAs(UnmanagedType.U1)]
+ public delegate bool PsecureMemoryCacheCallback(IntPtr Addr, SizeT Range);
+
+ ///
+ /// The application-defined user-mode scheduling (UMS) scheduler entry point function associated with a UMS completion list.
+ ///
+ /// The PUMS_SCHEDULER_ENTRY_POINT type defines a pointer to this function. UmsSchedulerProc is a placeholder for the
+ /// application-defined function name.
+ ///
+ ///
+ ///
+ /// The reason the scheduler entry point is being called. This parameter can be one of the following values.
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// UmsSchedulerStartup 0
+ ///
+ /// A UMS scheduler thread was created. The entry point is called with this reason once each time EnterUmsSchedulingMode is called.
+ ///
+ ///
+ /// -
+ /// UmsSchedulerThreadBlocked 1
+ /// A UMS worker thread blocked.
+ ///
+ /// -
+ /// UmsSchedulerThreadYield 2
+ /// An executing UMS worker thread yielded control by calling the UmsThreadYield function.
+ ///
+ ///
+ ///
+ ///
+ /// If the Reason parameter is UmsSchedulerStartup, this parameter is NULL.
+ ///
+ /// If the Reason parameter is UmsSchedulerThreadBlocked, bit 0 of this parameter indicates the type of activity that was
+ /// being serviced when the UMS worker thread blocked.
+ ///
+ ///
+ ///
+ /// Value
+ /// Meaning
+ ///
+ /// -
+ /// 0
+ ///
+ /// The thread blocked on a trap (for example, a hard page fault) or an interrupt (for example, an asynchronous procedure call).
+ ///
+ ///
+ /// -
+ /// 1
+ /// The thread blocked on a system call.
+ ///
+ ///
+ ///
+ /// If the Reason parameter is UmsSchedulerThreadYield, this parameter is a pointer to the UMS thread context of the UMS
+ /// worker thread that yielded.
+ ///
+ ///
+ ///
+ ///
+ /// If the Reason parameter is UmsSchedulerStartup, this parameter is the SchedulerParam member of the
+ /// UMS_SCHEDULER_STARTUP_INFO structure passed to the EnterUmsSchedulingMode function that triggered the entry point call.
+ ///
+ ///
+ /// If the Reason parameter is UmsSchedulerThreadYield this parameter is the SchedulerParam parameter passed to the
+ /// UmsThreadYield function that triggered the entry point call.
+ ///
+ /// If the Reason parameter is UmsSchedulerThreadBlocked, this parameter is NULL.
+ ///
+ ///
+ /// This function does not return a value.
+ ///
+ ///
+ ///
+ /// The UmsSchedulerProc function pointer type is defined as PUMS_SCHEDULER_ENTRY_POINT in WinBase.h. The underlying function
+ /// type is defined as RTL_UMS_SCHEDULER_ENTRY_POINT in WinNT.h
+ ///
+ ///
+ /// Each UMS scheduler thread has an associated UmsSchedulerProc entry point function that is specified when the thread calls the
+ /// EnterUmsSchedulingMode function. The system calls the scheduler entry point function with a reason of UmsSchedulerStartup
+ /// when the scheduler thread is converted for UMS.
+ ///
+ ///
+ /// Subsequently, when a UMS worker thread that is running on the scheduler thread yields or blocks, the system calls the scheduler
+ /// thread's entry point function with a pointer to the UMS thread context of the worker thread.
+ ///
+ ///
+ /// The application's scheduler is responsible for selecting the next UMS worker thread to run. The scheduler implements all policies
+ /// that influence execution of its UMS threads, including processor affinity and thread priority. For example, a scheduler might
+ /// give priority to I/O-intensive threads, or it might run threads on a first-come, first-served basis. This logic can be
+ /// implemented in the scheduler entry point function or elsewhere in the application.
+ ///
+ ///
+ /// When a blocked UMS worker thread becomes unblocked, the system queues the unblocked thread to the associated completion list and
+ /// signals the completion list event. To retrieve UMS worker threads from the completion list, use the DequeueUmsCompletionListItems function.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/nc-winnt-rtl_ums_scheduler_entry_point RTL_UMS_SCHEDULER_ENTRY_POINT
+ // RtlUmsSchedulerEntryPoint; void RtlUmsSchedulerEntryPoint( RTL_UMS_SCHEDULER_REASON Reason, ULONG_PTR ActivationPayload, PVOID
+ // SchedulerParam ) {...}
+ [PInvokeData("winnt.h", MSDNShortId = "10de1c48-255d-45c3-acf0-25f8a564b585")]
+ [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+ public delegate void RtlUmsSchedulerEntryPoint(RTL_UMS_SCHEDULER_REASON Reason, UIntPtr ActivationPayload, IntPtr SchedulerParam);
+
+ /// Used by thread context functions.
+ [PInvokeData("winnt.h")]
+ [Flags]
+ public enum CONTEXT_FLAG : uint
+ {
+ /// Undocumented.
+ CONTEXT_AMD64 = 0x00100000,
+
+ /// Undocumented.
+ CONTEXT_CONTROL = (CONTEXT_AMD64 | 0x00000001),
+
+ /// Undocumented.
+ CONTEXT_INTEGER = (CONTEXT_AMD64 | 0x00000002),
+
+ /// Undocumented.
+ CONTEXT_SEGMENTS = (CONTEXT_AMD64 | 0x00000004),
+
+ /// Undocumented.
+ CONTEXT_FLOATING_POINT = (CONTEXT_AMD64 | 0x00000008),
+
+ /// Undocumented.
+ CONTEXT_DEBUG_REGISTERS = (CONTEXT_AMD64 | 0x00000010),
+
+ /// Undocumented.
+ CONTEXT_FULL = (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT),
+
+ /// Undocumented.
+ CONTEXT_ALL = (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS),
+
+ /// Undocumented.
+ CONTEXT_XSTATE = (CONTEXT_AMD64 | 0x00000040),
+
+ /// Undocumented.
+ CONTEXT_KERNEL_DEBUGGER = 0x04000000,
+
+ /// Undocumented.
+ CONTEXT_EXCEPTION_ACTIVE = 0x08000000,
+
+ /// Undocumented.
+ CONTEXT_SERVICE_ACTIVE = 0x10000000,
+
+ /// Undocumented.
+ CONTEXT_EXCEPTION_REQUEST = 0x40000000,
+
+ /// Undocumented.
+ CONTEXT_EXCEPTION_REPORTING = 0x80000000
+ }
+
/// The flags that control the enforcement of the minimum and maximum working set sizes.
[PInvokeData("winnt.h")]
[Flags]
@@ -13,74 +218,462 @@ namespace Vanara.PInvoke
{
/// The working set will not fall below the minimum working set limit.
QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001,
+
/// The working set may fall below the minimum working set limit if memory demands are high.
QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002,
+
/// The working set will not exceed the maximum working set limit.
QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004,
+
/// The working set may exceed the maximum working set limit if there is abundant memory.
QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008,
+
/// The quota limits use default limits
QUOTA_LIMITS_USE_DEFAULT_LIMITS = 0x00000010,
}
+ /// Used by .
+ [PInvokeData("winnt.h", MSDNShortId = "10de1c48-255d-45c3-acf0-25f8a564b585")]
+ public enum RTL_UMS_SCHEDULER_REASON
+ {
+ ///
+ /// A UMS scheduler thread was created. The entry point is called with this reason once each time EnterUmsSchedulingMode is called.
+ ///
+ UmsSchedulerStartup = 0,
+
+ /// A UMS worker thread blocked.
+ UmsSchedulerThreadBlocked = 1,
+
+ /// An executing UMS worker thread yielded control by calling the UmsThreadYield function.
+ UmsSchedulerThreadYield = 2,
+ }
+
+ ///
+ /// Represents classes of information about user-mode scheduling (UMS) threads.
+ /// This enumeration is used by the QueryUmsThreadInformation and SetUmsThreadInformation functions.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ne-winnt-_rtl_ums_thread_info_class typedef enum
+ // _RTL_UMS_THREAD_INFO_CLASS { UmsThreadInvalidInfoClass , UmsThreadUserContext , UmsThreadPriority , UmsThreadAffinity ,
+ // UmsThreadTeb , UmsThreadIsSuspended , UmsThreadIsTerminated , UmsThreadMaxInfoClass } RTL_UMS_THREAD_INFO_CLASS, *PRTL_UMS_THREAD_INFO_CLASS;
+ [PInvokeData("winnt.h", MSDNShortId = "2d6730b2-4d01-45f5-9514-0d91806f50d5")]
+ public enum RTL_UMS_THREAD_INFO_CLASS
+ {
+ /// Reserved.
+ UmsThreadInvalidInfoClass,
+
+ /// Application-defined information stored in a UMS thread context.
+ UmsThreadUserContext,
+
+ /// Reserved.
+ UmsThreadPriority,
+
+ /// Reserved.
+ UmsThreadAffinity,
+
+ ///
+ /// The thread execution block (TEB) for a UMS thread. This information class can only be queried; it cannot be set.
+ ///
+ UmsThreadTeb,
+
+ /// The suspension status of the thread. This information can only be queried; it cannot be set.
+ UmsThreadIsSuspended,
+
+ /// The termination status of the thread. This information can only be queried; it cannot be set.
+ UmsThreadIsTerminated,
+
+ /// Reserved.
+ UmsThreadMaxInfoClass,
+ }
+
[PInvokeData("winnt.h")]
[Flags]
public enum SECTION_MAP : uint
{
- SECTION_QUERY = 0x0001,
- SECTION_MAP_WRITE = 0x0002,
- SECTION_MAP_READ = 0x0004,
- SECTION_MAP_EXECUTE = 0x0008,
- SECTION_EXTEND_SIZE = 0x0010,
+ SECTION_QUERY = 0x0001,
+ SECTION_MAP_WRITE = 0x0002,
+ SECTION_MAP_READ = 0x0004,
+ SECTION_MAP_EXECUTE = 0x0008,
+ SECTION_EXTEND_SIZE = 0x0010,
SECTION_MAP_EXECUTE_EXPLICIT = 0x0020,
SECTION_ALL_ACCESS = ACCESS_MASK.STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE | SECTION_MAP_READ | SECTION_MAP_EXECUTE | SECTION_EXTEND_SIZE,
}
///
- /// A mask that indicates the member of the OSVERSIONINFOEX structure whose comparison operator is being set. This value corresponds to one of the bits
- /// specified in the dwTypeMask parameter for the VerifyVersionInfo function.
+ /// The operator to be used for the comparison. The VerifyVersionInfo function uses this operator to compare a specified attribute
+ /// value to the corresponding value for the currently running system.
+ ///
+ public enum VERSION_CONDITION : byte
+ {
+ /// The current value must be equal to the specified value.
+ VER_EQUAL = 1,
+
+ /// The current value must be greater than the specified value.
+ VER_GREATER,
+
+ /// The current value must be greater than or equal to the specified value.
+ VER_GREATER_EQUAL,
+
+ /// The current value must be less than the specified value.
+ VER_LESS,
+
+ /// The current value must be less than or equal to the specified value.
+ VER_LESS_EQUAL,
+
+ /// All product suites specified in the wSuiteMask member must be present in the current system.
+ VER_AND,
+
+ /// At least one of the specified product suites must be present in the current system.
+ VER_OR,
+ }
+
+ ///
+ /// A mask that indicates the member of the OSVERSIONINFOEX structure whose comparison operator is being set. This value corresponds
+ /// to one of the bits specified in the dwTypeMask parameter for the VerifyVersionInfo function.
///
[Flags]
public enum VERSION_MASK : uint
{
/// dwMinorVersion
VER_MINORVERSION = 0x0000001,
+
/// dwMajorVersion
VER_MAJORVERSION = 0x0000002,
+
/// dwBuildNumber
VER_BUILDNUMBER = 0x0000004,
+
/// dwPlatformId
VER_PLATFORMID = 0x0000008,
+
/// wServicePackMinor
VER_SERVICEPACKMINOR = 0x0000010,
+
/// wServicePackMajor
VER_SERVICEPACKMAJOR = 0x0000020,
+
/// wSuiteMask
VER_SUITENAME = 0x0000040,
+
/// wProductType
VER_PRODUCT_TYPE = 0x0000080,
}
- ///
- /// The operator to be used for the comparison. The VerifyVersionInfo function uses this operator to compare a specified attribute value to the
- /// corresponding value for the currently running system.
- ///
- public enum VERSION_CONDITION : byte
+ /// Contains the hardware counter value.
+ // typedef struct _HARDWARE_COUNTER_DATA { HARDWARE_COUNTER_TYPE Type; DWORD Reserved; DWORD64 Value;} HARDWARE_COUNTER_DATA,
+ // *PHARDWARE_COUNTER_DATA; https://msdn.microsoft.com/en-us/library/windows/desktop/dd796394(v=vs.85).aspx
+ [PInvokeData("Winnt.h", MSDNShortId = "dd796394")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct HARDWARE_COUNTER_DATA
{
- /// The current value must be equal to the specified value.
- VER_EQUAL = 1,
- /// The current value must be greater than the specified value.
- VER_GREATER,
- /// The current value must be greater than or equal to the specified value.
- VER_GREATER_EQUAL,
- /// The current value must be less than the specified value.
- VER_LESS,
- /// The current value must be less than or equal to the specified value.
- VER_LESS_EQUAL,
- /// All product suites specified in the wSuiteMask member must be present in the current system.
- VER_AND,
- /// At least one of the specified product suites must be present in the current system.
- VER_OR,
+ /// The type of hardware counter data collected. For possible values, see the HARDWARE_COUNTER_TYPE enumeration.
+ public HARDWARE_COUNTER_TYPE Type;
+
+ /// Reserved. Initialize to zero.
+ public uint Reserved;
+
+ ///
+ /// The counter index. Each hardware counter in a processor's performance monitoring unit (PMU) is identified by an index.
+ ///
+ public ulong Value;
+ }
+
+ /// Contains the thread profiling and hardware counter data that you requested.
+ // typedef struct _PERFORMANCE_DATA { WORD Size; BYTE Version; BYTE HwCountersCount; DWORD ContextSwitchCount; DWORD64
+ // WaitReasonBitMap; DWORD64 CycleTime; DWORD RetryCount; DWORD Reserved; HARDWARE_COUNTER_DATA HwCounters[MAX_HW_COUNTERS];}
+ // PERFORMANCE_DATA, *PPERFORMANCE_DATA; https://msdn.microsoft.com/en-us/library/windows/desktop/dd796401(v=vs.85).aspx
+ [PInvokeData("Winnt.h", MSDNShortId = "dd796401")]
+ [StructLayout(LayoutKind.Sequential, Pack = 1)]
+ public struct PERFORMANCE_DATA
+ {
+ private const int MAX_HW_COUNTERS = 16;
+
+ /// The size of this structure.
+ public ushort Size;
+
+ /// The version of this structure. Must be set to PERFORMANCE_DATA_VERSION.
+ public byte Version;
+
+ ///
+ /// The number of array elements in the HwCounters array that contain hardware counter data. A value of 3 means that the
+ /// array contains data for three hardware counters, not that elements 0 through 2 contain counter data.
+ ///
+ public byte HwCountersCount;
+
+ /// The number of context switches that occurred from the time profiling was enabled.
+ public uint ContextSwitchCount;
+
+ ///
+ /// A bitmask that identifies the reasons for the context switches that occurred since the last time the data was read. For
+ /// possible values, see the KWAIT_REASON enumeration (the enumeration is included in the Wdm.h file in the WDK).
+ ///
+ public ulong WaitReasonBitMap;
+
+ /// The cycle time of the thread (excludes the time spent interrupted) from the time profiling was enabled.
+ public ulong CycleTime;
+
+ /// The number of times that the read operation read the data to ensure a consistent snapshot of the data.
+ public uint RetryCount;
+
+ /// Reserved. Set to zero.
+ public uint Reserved;
+
+ ///
+ /// An array of HARDWARE_COUNTER_DATA structures that contain the counter values. The elements of the array that contain
+ /// counter data relate directly to the bits set in the HardwareCounters bitmask that you specified when you called the
+ /// EnableThreadProfiling function. For example, if you set bit 3 in the HardwareCounters bitmask, HwCounters[3] will
+ /// contain the counter data for that counter.
+ ///
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_HW_COUNTERS)]
+ public HARDWARE_COUNTER_DATA[] HwCounters;
+ }
+
+ ///
+ /// Represents a context frame on WOW64. Refer to the header file WinNT.h for the definition of this structure.
+ ///
+ ///
+ ///
+ /// In the following versions of Windows, Slot 1 of Thread Local Storage (TLS) holds a pointer to a structure that contains a
+ /// WOW64_CONTEXT structure starting at offset 4. This might change in later versions of Windows.
+ ///
+ ///
+ ///
+ /// Windows Vista
+ /// Windows Server 2008
+ ///
+ /// -
+ /// Windows 7
+ /// Windows Server 2008 R2
+ ///
+ /// -
+ /// Windows 8
+ /// Windows Server 2012
+ ///
+ /// -
+ /// Windows 8.1
+ /// Windows Server 2012 R2
+ ///
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_wow64_context
+ [PInvokeData("winnt.h", MSDNShortId = "b27205a2-2c33-4f45-8948-9919bcd2355a")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct WOW64_CONTEXT
+ {
+ ///
+ public WOW64_CONTEXT_FLAGS ContextFlags;
+
+ ///
+ public uint Dr0;
+
+ ///
+ public uint Dr1;
+
+ ///
+ public uint Dr2;
+
+ ///
+ public uint Dr3;
+
+ ///
+ public uint Dr6;
+
+ ///
+ public uint Dr7;
+
+ ///
+ public WOW64_FLOATING_SAVE_AREA FloatSave;
+
+ ///
+ public uint SegGs;
+
+ ///
+ public uint SegFs;
+
+ ///
+ public uint SegEs;
+
+ ///
+ public uint SegDs;
+
+ ///
+ public uint Edi;
+
+ ///
+ public uint Esi;
+
+ ///
+ public uint Ebx;
+
+ ///
+ public uint Edx;
+
+ ///
+ public uint Ecx;
+
+ ///
+ public uint Eax;
+
+ ///
+ public uint Ebp;
+
+ ///
+ public uint Eip;
+
+ ///
+ public uint SegCs;
+
+ ///
+ public uint EFlags;
+
+ ///
+ public uint Esp;
+
+ ///
+ public uint SegSs;
+
+ ///
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
+ public byte[] ExtendedRegisters;
+ }
+
+ ///
+ /// Represents the 80387 save area on WOW64. Refer to the header file WinNT.h for the definition of this structure.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_wow64_floating_save_area
+ [PInvokeData("winnt.h", MSDNShortId = "56fba1c1-432b-40a8-b882-e4c637c03d5d")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct WOW64_FLOATING_SAVE_AREA
+ {
+ ///
+ public uint ControlWord;
+
+ ///
+ public uint StatusWord;
+
+ ///
+ public uint TagWord;
+
+ ///
+ public uint ErrorOffset;
+
+ ///
+ public uint ErrorSelector;
+
+ ///
+ public uint DataOffset;
+
+ ///
+ public uint DataSelector;
+
+ ///
+ [MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
+ public byte[] RegisterArea;
+
+ ///
+ public uint Cr0NpxState;
+ }
+
+ ///
+ ///
+ /// Describes an entry in the descriptor table for a 32-bit thread on a 64-bit system. This structure is valid only on 64-bit systems.
+ ///
+ ///
+ ///
+ ///
+ /// The Wow64GetThreadSelectorEntry function fills this structure with information from an entry in the descriptor table. You can use
+ /// this information to convert a segment-relative address to a linear virtual address.
+ ///
+ ///
+ /// The base address of a segment is the address of offset 0 in the segment. To calculate this value, combine the BaseLow,
+ /// BaseMid, and BaseHi members.
+ ///
+ ///
+ /// The limit of a segment is the address of the last byte that can be addressed in the segment. To calculate this value, combine the
+ /// LimitLow and LimitHi members.
+ ///
+ ///
+ /// The WOW64_LDT_ENTRY structure has the same layout for a 64-bit process as the LDT_ENTRY structure has for a 32-bit process.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_wow64_ldt_entry typedef struct _WOW64_LDT_ENTRY { WORD
+ // LimitLow; WORD BaseLow; union { struct { BYTE BaseMid; BYTE Flags1; BYTE Flags2; BYTE BaseHi; } Bytes; struct { DWORD BaseMid : 8;
+ // DWORD Type : 5; DWORD Dpl : 2; DWORD Pres : 1; DWORD LimitHi : 4; DWORD Sys : 1; DWORD Reserved_0 : 1; DWORD Default_Big : 1;
+ // DWORD Granularity : 1; DWORD BaseHi : 8; } Bits; } HighWord; } WOW64_LDT_ENTRY, *PWOW64_LDT_ENTRY;
+ [PInvokeData("winnt.h", MSDNShortId = "a571cd2f-0873-4ad5-bcb8-c0da2d47a820")]
+ [StructLayout(LayoutKind.Sequential, Pack = 1)]
+ public struct WOW64_LDT_ENTRY
+ {
+ ///
+ /// The low-order part of the address of the last byte in the segment.
+ ///
+ public ushort LimitLow;
+
+ ///
+ /// The low-order part of the base address of the segment.
+ ///
+ public ushort BaseLow;
+
+ ///
+ /// Middle bits (16-23) of the base address of the segment.
+ ///
+ public byte BaseMid;
+
+ private ushort Flags;
+
+ ///
+ /// The high bits (24-31) of the base address of the segment.
+ ///
+ public byte BaseHi;
+
+ ///
+ /// The type of segment. This member can be one of the following values:
+ ///
+ public byte Type { get => (byte)GetBits(Flags, 0, 5); set => SetBits(ref Flags, 0, 5, value); }
+
+ ///
+ ///
+ /// The privilege level of the descriptor. This member is an integer value in the range 0 (most privileged) through 3 (least privileged).
+ ///
+ ///
+ public byte Dpl { get => (byte)GetBits(Flags, 5, 2); set => SetBits(ref Flags, 5, 2, value); }
+
+ ///
+ /// The present flag. This member is 1 if the segment is present in physical memory or 0 if it is not.
+ ///
+ public bool Pres { get => GetBit(Flags, 7); set => SetBit(ref Flags, 7, value); }
+
+ ///
+ /// The high bits (16–19) of the address of the last byte in the segment.
+ ///
+ public byte LimitHi { get => (byte)GetBits(Flags, 8, 4); set => SetBits(ref Flags, 8, 4, value); }
+
+ ///
+ ///
+ /// The space that is available to system programmers. This member might be used for marking segments in some system-specific way.
+ ///
+ ///
+ public bool Sys { get => GetBit(Flags, 12); set => SetBit(ref Flags, 12, value); }
+
+ ///
+ /// Reserved.
+ ///
+ public bool Reserved_0 { get => GetBit(Flags, 13); set => SetBit(ref Flags, 13, value); }
+
+ ///
+ ///
+ /// The size of segment. If the segment is a data segment, this member contains 1 if the segment is larger than 64 kilobytes (KB)
+ /// or 0 if the segment is smaller than or equal to 64 KB.
+ ///
+ ///
+ /// If the segment is a code segment, this member contains 1. The segment runs with the default (native mode) instruction set.
+ ///
+ ///
+ public bool Default_Big { get => GetBit(Flags, 14); set => SetBit(ref Flags, 14, value); }
+
+ ///
+ /// The granularity. This member contains 0 if the segment is byte granular, 1 if the segment is page granular.
+ ///
+ public bool Granularity { get => GetBit(Flags, 15); set => SetBit(ref Flags, 15, value); }
}
}
}
\ No newline at end of file
diff --git a/PInvoke/Kernel32/WinNls.cs b/PInvoke/Kernel32/WinNls.cs
index 80031cd7..8c69b61c 100644
--- a/PInvoke/Kernel32/WinNls.cs
+++ b/PInvoke/Kernel32/WinNls.cs
@@ -8,17 +8,24 @@ namespace Vanara.PInvoke
{
public const ushort LANG_INVARIANT = 0x7f;
public const ushort LANG_NEUTRAL = 0;
+
/// Name of an invariant locale that provides stable locale and calendar data.
public const string LOCALE_NAME_INVARIANT = "";
- /// Maximum length of a locale name. The maximum number of characters allowed for this string is 85, including a terminating null character.
+
+ ///
+ /// Maximum length of a locale name. The maximum number of characters allowed for this string is 85, including a terminating null character.
+ ///
public const int LOCALE_NAME_MAX_LENGTH = 85;
+
/// Name of the current operating system locale.
public const string LOCALE_NAME_SYSTEM_DEFAULT = "!x-sys-default-locale";
+
///
- /// Name of the current user locale, matching the preference set in the regional and language options portion of Control Panel. This locale can be
- /// different from the locale for the current user interface language.
+ /// Name of the current user locale, matching the preference set in the regional and language options portion of Control Panel. This
+ /// locale can be different from the locale for the current user interface language.
///
public const string LOCALE_NAME_USER_DEFAULT = null;
+
public const ushort SORT_DEFAULT = 0;
public const ushort SUBLANG_CUSTOM_DEFAULT = 0x03;
public const ushort SUBLANG_CUSTOM_UNSPECIFIED = 0x04;
@@ -38,11 +45,13 @@ namespace Vanara.PInvoke
public static readonly uint LOCALE_USER_DEFAULT = MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT);
///
- /// An application-defined callback function that processes enumerated calendar information provided by the EnumCalendarInfo function. The
- /// CALINFO_ENUMPROC type defines a pointer to this callback function. EnumCalendarInfoProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated calendar information provided by the EnumCalendarInfo
+ /// function. The CALINFO_ENUMPROC type defines a pointer to this callback function. EnumCalendarInfoProc is a placeholder for
+ /// the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar type passed to EnumCalendarInfo.
+ /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar
+ /// type passed to EnumCalendarInfo.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK EnumCalendarInfoProc( _In_ LPTSTR lpCalendarInfoString); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317806(v=vs.85).aspx
@@ -52,12 +61,13 @@ namespace Vanara.PInvoke
public delegate bool EnumCalendarInfoProc(string lpCalendarInfoString);
///
- /// An application-defined callback function that processes enumerated calendar information provided by the EnumCalendarInfoEx function. The
- /// CALINFO_ENUMPROCEX type defines a pointer to this callback function. EnumCalendarInfoProcEx is a placeholder for the application-defined
- /// function name.
+ /// An application-defined callback function that processes enumerated calendar information provided by the EnumCalendarInfoEx
+ /// function. The CALINFO_ENUMPROCEX type defines a pointer to this callback function. EnumCalendarInfoProcEx is a placeholder
+ /// for the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar type passed to EnumCalendarInfoEx.
+ /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar
+ /// type passed to EnumCalendarInfoEx.
///
/// Calendar identifier that specifies the calendar associated with the supplied information.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -68,29 +78,32 @@ namespace Vanara.PInvoke
public delegate bool EnumCalendarInfoProcEx(string lpCalendarInfoString, uint Calendar);
///
- /// An application-defined callback function that processes enumerated calendar information provided by the EnumCalendarInfoExEx function. The
- /// CALINFO_ENUMPROCEXEX type defines a pointer to this callback function. EnumCalendarInfoProcExEx is a placeholder for the application-defined
- /// function name.
+ /// An application-defined callback function that processes enumerated calendar information provided by the
+ /// EnumCalendarInfoExEx function. The CALINFO_ENUMPROCEXEX type defines a pointer to this callback function.
+ /// EnumCalendarInfoProcExEx is a placeholder for the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar type passed to EnumCalendarInfoExEx.
+ /// Pointer to a buffer containing a null-terminated calendar information string. This string is formatted according to the calendar
+ /// type passed to EnumCalendarInfoExEx.
///
/// Calendar identifier that specifies the calendar associated with the specified information.
/// Reserved; must be NULL.
///
- /// An application-provided input parameter of EnumCalendarInfoExEx. This value is especially useful for multi-threaded applications, since it can
- /// be used to pass thread-specific data to this callback function.
+ /// An application-provided input parameter of EnumCalendarInfoExEx. This value is especially useful for multi-threaded
+ /// applications, since it can be used to pass thread-specific data to this callback function.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
- // BOOL CALLBACK EnumCalendarInfoProcExEx( _In_ LPWSTR lpCalendarInfoString, _In_ CALID Calendar, _In_ LPWSTR lpReserved, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317808(v=vs.85).aspx
+ // BOOL CALLBACK EnumCalendarInfoProcExEx( _In_ LPWSTR lpCalendarInfoString, _In_ CALID Calendar, _In_ LPWSTR lpReserved, _In_ LPARAM
+ // lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317808(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317808")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Unicode)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool EnumCalendarInfoProcExEx(string lpCalendarInfoString, uint Calendar, string lpReserved, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated code page information provided by the EnumSystemCodePages function. The
- /// CODEPAGE_ENUMPROC type defines a pointer to this callback function. EnumCodePagesProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated code page information provided by the
+ /// EnumSystemCodePages function. The CODEPAGE_ENUMPROC type defines a pointer to this callback function.
+ /// EnumCodePagesProc is a placeholder for the application-defined function name.
///
/// Pointer to a buffer containing a null-terminated code page identifier string.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -101,12 +114,13 @@ namespace Vanara.PInvoke
public delegate bool EnumCodePagesProc(string lpCodePageString);
///
- /// An application-defined callback function that processes date format information provided by the EnumDateFormats function. The DATEFMT_ENUMPROC
- /// type defines a pointer to this callback function. EnumDateFormatsProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes date format information provided by the EnumDateFormats function.
+ /// The DATEFMT_ENUMPROC type defines a pointer to this callback function. EnumDateFormatsProc is a placeholder for the
+ /// application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the value of the
- /// dwFlags parameter of EnumDateFormats.
+ /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the
+ /// value of the dwFlags parameter of EnumDateFormats.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK EnumDateFormatsProc( _In_ LPTSTR lpDateFormatString); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317813(v=vs.85).aspx
@@ -116,13 +130,13 @@ namespace Vanara.PInvoke
public delegate bool EnumDateFormatsProc(string lpDateFormatString);
///
- /// An application-defined callback function that processes enumerated date format information provided by the EnumDateFormatsEx function. The
- /// DATEFMT_ENUMPROCEX type defines a pointer to this callback function. EnumDateFormatsProcEx is a placeholder for the application-defined
- /// function name.
+ /// An application-defined callback function that processes enumerated date format information provided by the
+ /// EnumDateFormatsEx function. The DATEFMT_ENUMPROCEX type defines a pointer to this callback function.
+ /// EnumDateFormatsProcEx is a placeholder for the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the value of the
- /// dwFlags parameter of EnumDateFormatsEx.
+ /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the
+ /// value of the dwFlags parameter of EnumDateFormatsEx.
///
/// Calendar identifier associated with the date format string.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -133,18 +147,18 @@ namespace Vanara.PInvoke
public delegate bool EnumDateFormatsProcEx(string lpDateFormatString, uint CalendarID);
///
- /// An application-defined function that processes enumerated date format information provided by the EnumDateFormatsExEx function. The
- /// DATEFMT_ENUMPROCEXEX type defines a pointer to this callback function. EnumDateFormatsProcExEx is a placeholder for the application-defined
- /// function name.
+ /// An application-defined function that processes enumerated date format information provided by the EnumDateFormatsExEx
+ /// function. The DATEFMT_ENUMPROCEXEX type defines a pointer to this callback function. EnumDateFormatsProcExEx is a
+ /// placeholder for the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the value of the
- /// dwFlags parameter passed to EnumDateFormatsExEx.
+ /// Pointer to a buffer containing a null-terminated date format string. This string is a long or short date format, depending on the
+ /// value of the dwFlags parameter passed to EnumDateFormatsExEx.
///
/// Calendar identifier associated with the specified date format string.
///
- /// An application-provided input parameter of EnumDateFormatsExEx. This parameter is especially useful for multi-threaded applications, since it
- /// can be used to pass thread-specific data to this callback function.
+ /// An application-provided input parameter of EnumDateFormatsExEx. This parameter is especially useful for multi-threaded
+ /// applications, since it can be used to pass thread-specific data to this callback function.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK EnumDateFormatsProcExEx( _In_ LPWSTR lpDateFormatString, _In_ CALID CalendarID, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317815(v=vs.85).aspx
@@ -154,8 +168,9 @@ namespace Vanara.PInvoke
public delegate bool EnumDateFormatsProcExEx(string lpDateFormatString, uint CalendarID, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated geographical location information provided by the EnumSystemGeoID function.
- /// The GEO_ENUMPROC type defines a pointer to this callback function. EnumGeoInfoProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated geographical location information provided by the
+ /// EnumSystemGeoID function. The GEO_ENUMPROC type defines a pointer to this callback function. EnumGeoInfoProc is a
+ /// placeholder for the application-defined function name.
///
/// Identifier of the geographical location to check.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -166,37 +181,42 @@ namespace Vanara.PInvoke
public delegate bool EnumGeoInfoProc(int GeoId);
///
- /// An application-defined callback function that processes enumerated language group locale information provided by the EnumLanguageGroupLocales
- /// function. The LANGGROUPLOCALE_ENUMPROC type defines a pointer to this callback function. EnumLanguageGroupLocalesProc is a placeholder for the
- /// application-defined function name.
+ /// An application-defined callback function that processes enumerated language group locale information provided by the
+ /// EnumLanguageGroupLocales function. The LANGGROUPLOCALE_ENUMPROC type defines a pointer to this callback function.
+ /// EnumLanguageGroupLocalesProc is a placeholder for the application-defined function name.
///
/// Identifier of the language group. This parameter can have one of the following values:
///
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
/// Pointer to a buffer containing a null-terminated locale identifier string.
- /// Application-defined value passed to the EnumLanguageGroupLocales function. This parameter can be used for error checking.
+ ///
+ /// Application-defined value passed to the EnumLanguageGroupLocales function. This parameter can be used for error checking.
+ ///
/// Returns TRUE to continue enumeration or FALSE otherwise.
- // BOOL CALLBACK EnumLanguageGroupLocalesProc( _In_ LGRPID LanguageGroup, _In_ LCID Locale, _In_ LPTSTR lpLocaleString, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317820(v=vs.85).aspx
+ // BOOL CALLBACK EnumLanguageGroupLocalesProc( _In_ LGRPID LanguageGroup, _In_ LCID Locale, _In_ LPTSTR lpLocaleString, _In_ LONG_PTR
+ // lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317820(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317820")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool EnumLanguageGroupLocalesProc(LGRPID LanguageGroup, uint Locale, string lpLocaleString, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated language group information provided by the EnumSystemLanguageGroups
- /// function. The LANGUAGEGROUP_ENUMPROC type defines a pointer to this callback function. EnumLanguageGroupsProc is a placeholder for the
- /// application-defined function name.
+ /// An application-defined callback function that processes enumerated language group information provided by the
+ /// EnumSystemLanguageGroups function. The LANGUAGEGROUP_ENUMPROC type defines a pointer to this callback function.
+ /// EnumLanguageGroupsProc is a placeholder for the application-defined function name.
///
/// Language group identifier. This parameter can have one of the following values:
/// Pointer to a buffer containing a null-terminated language group identifier string.
/// Pointer to a buffer containing a null-terminated language group name string.
///
- /// Flag specifying whether the language group identifier is supported or installed. This parameter can have one of the following values.
+ ///
+ /// Flag specifying whether the language group identifier is supported or installed. This parameter can have one of the following values.
+ ///
///
///
///
@@ -220,16 +240,17 @@ namespace Vanara.PInvoke
///
/// Application-defined parameter. This parameter can be used for error checking.
/// Returns TRUE to continue enumeration or FALSE otherwise.
- // BOOL CALLBACK EnumLanguageGroupsProc( _In_ LGRPID LanguageGroup, _In_ LPTSTR lpLanguageGroupString, _In_ LPTSTR lpLanguageGroupNameString, _In_ DWORD
- // dwFlags, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317821(v=vs.85).aspx
+ // BOOL CALLBACK EnumLanguageGroupsProc( _In_ LGRPID LanguageGroup, _In_ LPTSTR lpLanguageGroupString, _In_ LPTSTR
+ // lpLanguageGroupNameString, _In_ DWORD dwFlags, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317821(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317821")]
[UnmanagedFunctionPointer(CallingConvention.Winapi, CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool EnumLanguageGroupsProc(LGRPID LanguageGroup, string lpLanguageGroupString, string lpLanguageGroupNameString, LGRPID_FLAGS dwFlags, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated locale information provided by the EnumSystemLocales function. The
- /// LOCALE_ENUMPROC type defines a pointer to this callback function. EnumLocalesProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated locale information provided by the EnumSystemLocales
+ /// function. The LOCALE_ENUMPROC type defines a pointer to this callback function. EnumLocalesProc is a placeholder for the
+ /// application-defined function name.
///
/// Pointer to a buffer containing a null-terminated locale identifier string.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -240,18 +261,19 @@ namespace Vanara.PInvoke
public delegate bool EnumLocalesProc(string lpLocaleString);
///
- /// An application-defined callback function that processes enumerated locale information provided by the EnumSystemLocalesEx function. The
- /// LOCALE_ENUMPROCEX type defines a pointer to this callback function. EnumLocalesProcEx is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated locale information provided by the EnumSystemLocalesEx
+ /// function. The LOCALE_ENUMPROCEX type defines a pointer to this callback function. EnumLocalesProcEx is a placeholder for
+ /// the application-defined function name.
///
/// Pointer to a buffer containing a null-terminated locale name string.
///
- /// Flags defining locale information. Values for this parameter can include a binary OR of flags, but some flag combinations never occur. If the
- /// application specifies LOCALE_WINDOWS or LOCALE_ALTERNATE_SORTS, it can also specify LOCALE_REPLACEMENT so that the EnumSystemLocalesEx
- /// function can test to see if the locale is a replacement.
+ /// Flags defining locale information. Values for this parameter can include a binary OR of flags, but some flag combinations never
+ /// occur. If the application specifies LOCALE_WINDOWS or LOCALE_ALTERNATE_SORTS, it can also specify LOCALE_REPLACEMENT so that the
+ /// EnumSystemLocalesEx function can test to see if the locale is a replacement.
///
///
- /// An application-provided input parameter of EnumSystemLocalesEx. This value is especially useful for multi-threaded applications, since it can
- /// be used to pass thread-specific data to this callback function.
+ /// An application-provided input parameter of EnumSystemLocalesEx. This value is especially useful for multi-threaded
+ /// applications, since it can be used to pass thread-specific data to this callback function.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK EnumLocalesProcEx( _In_ LPWSTR lpLocaleString, _In_ DWORD dwFlags, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317823(v=vs.85).aspx
@@ -261,8 +283,9 @@ namespace Vanara.PInvoke
public delegate bool EnumLocalesProcEx(string lpLocaleString, LOCALE_FLAGS dwFlags, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated time format information provided by the EnumTimeFormats function. The
- /// TIMEFMT_ENUMPROC type defines a pointer to this callback function. EnumTimeFormatsProc is a placeholder for the application-defined function name.
+ /// An application-defined callback function that processes enumerated time format information provided by the EnumTimeFormats
+ /// function. The TIMEFMT_ENUMPROC type defines a pointer to this callback function. EnumTimeFormatsProc is a placeholder for
+ /// the application-defined function name.
///
/// Pointer to a buffer containing a null-terminated time format string.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -273,14 +296,14 @@ namespace Vanara.PInvoke
public delegate bool EnumTimeFormatsProc(string lpTimeFormatString);
///
- /// An application-defined callback function that processes enumerated time format information provided by the EnumTimeFormatsEx function. The
- /// TIMEFMT_ENUMPROCEX type defines a pointer to this callback function. EnumTimeFormatsProcEx is a placeholder for the application-defined
- /// function name.
+ /// An application-defined callback function that processes enumerated time format information provided by the
+ /// EnumTimeFormatsEx function. The TIMEFMT_ENUMPROCEX type defines a pointer to this callback function.
+ /// EnumTimeFormatsProcEx is a placeholder for the application-defined function name.
///
/// Pointer to a buffer containing a null-terminated time format string.
///
- /// An application-provided input parameter of EnumTimeFormatsEx. This value is especially useful for multi-threaded applications, since it can be
- /// used to pass thread-specific data to this callback function.
+ /// An application-provided input parameter of EnumTimeFormatsEx. This value is especially useful for multi-threaded
+ /// applications, since it can be used to pass thread-specific data to this callback function.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK EnumTimeFormatsProcEx( _In_ LPWSTR lpTimeFormatString, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317833(v=vs.85).aspx
@@ -290,13 +313,13 @@ namespace Vanara.PInvoke
public delegate bool EnumTimeFormatsProcEx(string lpTimeFormatString, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated user interface language information provided by the EnumUILanguages
- /// function. The UILANGUAGE_ENUMPROC type defines a pointer to this callback function. EnumUILanguagesProc is a placeholder for the
- /// application-defined function name.
+ /// An application-defined callback function that processes enumerated user interface language information provided by the
+ /// EnumUILanguages function. The UILANGUAGE_ENUMPROC type defines a pointer to this callback function.
+ /// EnumUILanguagesProc is a placeholder for the application-defined function name.
///
///
- /// Pointer to a buffer containing a null-terminated string representing a user interface language identifier or language name, depending on the value
- /// for the dwFlags parameter passed in the call to EnumUILanguages.
+ /// Pointer to a buffer containing a null-terminated string representing a user interface language identifier or language name,
+ /// depending on the value for the dwFlags parameter passed in the call to EnumUILanguages.
///
/// Application-defined value.
/// Returns TRUE to continue enumeration or FALSE otherwise.
@@ -307,16 +330,17 @@ namespace Vanara.PInvoke
public delegate bool EnumUILanguagesProc(string lpUILanguageString, IntPtr lParam);
///
- /// An application-defined callback function that processes enumerated geographical location information provided by the EnumSystemGeoNames
- /// function. The GEO_ENUMNAMEPROC type defines a pointer to this callback function. Geo_EnumNameProc is a placeholder for the application-defined
- /// function name.
+ /// An application-defined callback function that processes enumerated geographical location information provided by the
+ /// EnumSystemGeoNames function. The GEO_ENUMNAMEPROC type defines a pointer to this callback function.
+ /// Geo_EnumNameProc is a placeholder for the application-defined function name.
///
///
- /// A two-letter International Organization for Standardization (ISO) 3166-1 code or numeric United Nations (UN) Series M, Number 49 (M.49) code for a
- /// geographical location that is available on the operating system.
+ /// A two-letter International Organization for Standardization (ISO) 3166-1 code or numeric United Nations (UN) Series M, Number 49
+ /// (M.49) code for a geographical location that is available on the operating system.
///
///
- /// Application-specific information that was specified by the data parameter when the application called the EnumSystemGeoNames function.
+ /// Application-specific information that was specified by the data parameter when the application called the
+ /// EnumSystemGeoNames function.
///
/// Returns TRUE to continue enumeration or FALSE otherwise.
// BOOL CALLBACK Geo_EnumNameProc( _In_ PWSTR GeoName, LPARAM data); https://msdn.microsoft.com/en-us/library/windows/desktop/mt826488(v=vs.85).aspx
@@ -325,6 +349,92 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public delegate bool Geo_EnumNameProc(string GeoName, IntPtr data);
+ ///
+ /// Deprecated. Specifies the date units for adjusting the CALDATETIME structure.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/intl/caldatetime-dateunit enum CALDATETIME_DATEUNIT { EraUnit, YearUnit,
+ // MonthUnit, WeekUnit, DayUnit, HourUnit, MinuteUnit, SecondUnit, TickUnit };
+ [PInvokeData("", MSDNShortId = "20d0cd7a-6e6b-4c82-9cfa-e4f4315d6362")]
+ public enum CALDATETIME_DATEUNIT
+ {
+ /// The era date time unit.
+ EraUnit,
+
+ /// The year date time unit.
+ YearUnit,
+
+ /// The month date time unit.
+ MonthUnit,
+
+ /// The week date time unit.
+ WeekUnit,
+
+ /// The day date time unit.
+ DayUnit,
+
+ /// The hour date time unit.
+ HourUnit,
+
+ /// The minute date time unit.
+ MinuteUnit,
+
+ ///
+ SecondUnit,
+
+ ///
+ TickUnit
+ }
+
+ ///
+ /// The calendar identifiers (data type CALID) that are used to specify different calendars. Your applications can use these
+ /// identifiers when using the following NLS functions and callback functions, which have parameters that take the CALID data type.
+ ///
+ [PInvokeData("", MSDNShortId = "ba2e841e-e24e-476a-851e-a29b3af4f04d")]
+ public enum CALID
+ {
+ /// Gregorian (localized)
+ CAL_GREGORIAN = 1,
+
+ /// Gregorian (English strings always)
+ CAL_GREGORIAN_US = 2,
+
+ /// Japanese Emperor Era
+ CAL_JAPAN = 3,
+
+ /// Taiwan calendar
+ CAL_TAIWAN = 4,
+
+ /// Korean Tangun Era
+ CAL_KOREA = 5,
+
+ /// Hijri (Arabic Lunar)
+ CAL_HIJRI = 6,
+
+ /// Thai
+ CAL_THAI = 7,
+
+ /// Hebrew (Lunar)
+ CAL_HEBREW = 8,
+
+ /// Gregorian Middle East French
+ CAL_GREGORIAN_ME_FRENCH = 9,
+
+ /// Gregorian Arabic
+ CAL_GREGORIAN_ARABIC = 10,
+
+ /// Gregorian transliterated English
+ CAL_GREGORIAN_XLIT_ENGLISH = 11,
+
+ /// Gregorian transliterated French
+ CAL_GREGORIAN_XLIT_FRENCH = 12,
+
+ /// Windows Vista and later: Persian
+ CAL_PERSIAN = 22,
+
+ /// Windows Vista and later: Um Al Qura (Arabic lunar) calendar
+ CAL_UMALQURA = 23,
+ }
+
/// Type of calendar information to retrieve.
[Flags]
public enum CALTYPE : uint
@@ -400,6 +510,7 @@ namespace Vanara.PInvoke
{
/// Enumerate only installed code pages.
CP_INSTALLED = 1,
+
/// Enumerate all supported code pages.
CP_SUPPORTED = 2
}
@@ -410,26 +521,34 @@ namespace Vanara.PInvoke
{
/// Use short date formats. This value cannot be used with any of the other flag values.
DATE_SHORTDATE = 0x00000001,
+
/// Use long date formats. This value cannot be used with any of the other flag values.
DATE_LONGDATE = 0x00000002,
+
///
- /// Use the alternate calendar, if one exists, to format the date string. If this flag is set, the function uses the default format for that
- /// alternate calendar, rather than using any user overrides. The user overrides will be used only in the event that there is no default format for
- /// the specified alternate calendar.
+ /// Use the alternate calendar, if one exists, to format the date string. If this flag is set, the function uses the default
+ /// format for that alternate calendar, rather than using any user overrides. The user overrides will be used only in the event
+ /// that there is no default format for the specified alternate calendar.
///
DATE_USE_ALT_CALENDAR = 0x00000004,
+
/// Use year/month formats. This value cannot be used with any of the other flag values.
DATE_YEARMONTH = 0x00000008,
+
/// Add marks for left-to-right reading layout. This value cannot be used with DATE_RTLREADING.
DATE_LTRREADING = 0x00000010,
+
/// Add marks for right-to-left reading layout. This value cannot be used with DATE_LTRREADING
DATE_RTLREADING = 0x00000020,
+
///
- /// Windows 7 and later: Detect the need for right-to-left and left-to-right reading layout using the locale and calendar information, and add
- /// marks accordingly. This value cannot be used with DATE_LTRREADING or DATE_RTLREADING. DATE_AUTOLAYOUT is preferred over DATE_LTRREADING and
- /// DATE_RTLREADING because it uses the locales and calendars to determine the correct addition of marks.
+ /// Windows 7 and later: Detect the need for right-to-left and left-to-right reading layout using the locale and calendar
+ /// information, and add marks accordingly. This value cannot be used with DATE_LTRREADING or DATE_RTLREADING. DATE_AUTOLAYOUT is
+ /// preferred over DATE_LTRREADING and DATE_RTLREADING because it uses the locales and calendars to determine the correct
+ /// addition of marks.
///
DATE_AUTOLAYOUT = 0x00000040,
+
/// Use month/day formats. This value cannot be used with any of the other flag values.
DATE_MONTHDAY = 0x00000080,
}
@@ -438,13 +557,14 @@ namespace Vanara.PInvoke
public enum GetStringScriptsFlag
{
///
- /// Ignores any inherited or common characters in the input string indicated by lpString. Neither "Qaii" nor "Zyyy" appears in the script string,
- /// even if the input string contains such characters.
+ /// Ignores any inherited or common characters in the input string indicated by lpString. Neither "Qaii" nor "Zyyy" appears in
+ /// the script string, even if the input string contains such characters.
///
GSS_IGNORE_INHERITED_COMMON = 0x0000,
+
///
- /// Retrieve "Qaii" (INHERITED) and "Zyyy" (COMMON) script information. This flag does not affect the processing of unassigned characters. These
- /// characters in the input string always cause a "Zzzz" (UNASSIGNED script) to appear in the script string.
+ /// Retrieve "Qaii" (INHERITED) and "Zyyy" (COMMON) script information. This flag does not affect the processing of unassigned
+ /// characters. These characters in the input string always cause a "Zzzz" (UNASSIGNED script) to appear in the script string.
///
GSS_ALLOW_INHERITED_COMMON = 0x0001,
}
@@ -454,28 +574,33 @@ namespace Vanara.PInvoke
public enum IDN_FLAGS
{
///
- /// Allow unassigned code points to be included in the input string. The default is to not allow unassigned code points, and fail with an extended
- /// error code of ERROR_INVALID_NAME.This flag allows the function to process characters that are not currently legal in IDNs, but might be legal in
- /// later versions of the IDNA standard. If your application encodes unassigned code points as Punycode, the resulting domain names should be
- /// illegal. Security can be compromised if a later version of IDNA makes these names legal or if an application filters out the illegal characters
- /// to try to create a legal domain name. For more information, see Handling Internationalized Domain Names (IDNs).
+ /// Allow unassigned code points to be included in the input string. The default is to not allow unassigned code points, and fail
+ /// with an extended error code of ERROR_INVALID_NAME.This flag allows the function to process characters that are not currently
+ /// legal in IDNs, but might be legal in later versions of the IDNA standard. If your application encodes unassigned code points
+ /// as Punycode, the resulting domain names should be illegal. Security can be compromised if a later version of IDNA makes these
+ /// names legal or if an application filters out the illegal characters to try to create a legal domain name. For more
+ /// information, see Handling Internationalized Domain Names (IDNs).
///
IDN_ALLOW_UNASSIGNED = 0x01,
+
///
- /// Filter out ASCII characters that are not allowed in STD3 names. The only ASCII characters allowed in the input Unicode string are letters,
- /// digits, and the hyphen-minus. The string cannot begin or end with the hyphen-minus. The function fails if the input Unicode string contains ASCII
- /// characters, such as "[", "]", or "/", that cannot occur in domain names.The function fails
- /// if the input Unicode string contains control characters (U+0001 through U+0020) or the "delete" character (U+007F). In either
- /// case, this flag has no effect on the non-ASCII characters that are allowed in the Unicode string.
+ /// Filter out ASCII characters that are not allowed in STD3 names. The only ASCII characters allowed in the input Unicode string
+ /// are letters, digits, and the hyphen-minus. The string cannot begin or end with the hyphen-minus. The function fails if the
+ /// input Unicode string contains ASCII characters, such as "[", "]", or
+ /// "/", that cannot occur in domain names.The function fails if the input Unicode string contains control
+ /// characters (U+0001 through U+0020) or the "delete" character (U+007F). In either case, this flag has no
+ /// effect on the non-ASCII characters that are allowed in the Unicode string.
///
IDN_USE_STD3_ASCII_RULES = 0x02,
+
///
- /// Starting with Windows 8: Enable EAI algorithmic fallback for the local parts of email addresses (such as <local>@microsoft.com).
- /// The default is for this function to fail when an email address has an invalid address or syntax.An application can set this flag to enable Email
- /// Address Internationalization (EAI) to return a discoverable fallback address, if possible. For more information, see the IETF Email Address
- /// Internationalization (eai) Charter.
+ /// Starting with Windows 8: Enable EAI algorithmic fallback for the local parts of email addresses (such as
+ /// <local>@microsoft.com). The default is for this function to fail when an email address has an invalid address
+ /// or syntax.An application can set this flag to enable Email Address Internationalization (EAI) to return a discoverable
+ /// fallback address, if possible. For more information, see the IETF Email Address Internationalization (eai) Charter.
///
IDN_EMAIL_ADDRESS = 0x04,
+
/// Starting with Windows 8: Disable the validation and mapping of Punycode.
IDN_RAW_PUNYCODE = 0x08,
}
@@ -486,11 +611,13 @@ namespace Vanara.PInvoke
{
/// Enumerate only installed locale identifiers. This value cannot be used with LCID_SUPPORTED.
LCID_INSTALLED = 0x00000001,
+
/// Enumerate all supported locale identifiers. This value cannot be used with LCID_INSTALLED.
LCID_SUPPORTED = 0x00000002,
+
///
- /// Enumerate only the alternate sort locale identifiers. If this value is used with either LCID_INSTALLED or LCID_SUPPORTED, the installed or
- /// supported locales are retrieved, as well as the alternate sort locale identifiers.
+ /// Enumerate only the alternate sort locale identifiers. If this value is used with either LCID_INSTALLED or LCID_SUPPORTED, the
+ /// installed or supported locales are retrieved, as well as the alternate sort locale identifiers.
///
LCID_ALTERNATE_SORTS = 0x00000004,
}
@@ -501,36 +628,52 @@ namespace Vanara.PInvoke
{
/// For locales and scripts capable of handling uppercase and lowercase, map all characters to lowercase.
LCMAP_LOWERCASE = 0x00000100,
+
/// For locales and scripts capable of handling uppercase and lowercase, map all characters to uppercase.
LCMAP_UPPERCASE = 0x00000200,
+
/// Windows 7: Map all characters to title case, in which the first letter of each major word is capitalized.
LCMAP_TITLECASE = 0x00000300,
+
///
- /// Produce a normalized sort key. If the LCMAP_SORTKEY flag is not specified, the function performs string mapping. For details of sort key
- /// generation and string mapping, see the Remarks section.
+ /// Produce a normalized sort key. If the LCMAP_SORTKEY flag is not specified, the function performs string mapping. For details
+ /// of sort key generation and string mapping, see the Remarks section.
///
LCMAP_SORTKEY = 0x00000400,
+
/// Use byte reversal. For example, if the application passes in 0x3450 0x4822, the result is 0x5034 0x2248.
LCMAP_BYTEREV = 0x00000800,
+
/// Map all katakana characters to hiragana. This flag and LCMAP_KATAKANA are mutually exclusive.
LCMAP_HIRAGANA = 0x00100000,
+
/// Map all hiragana characters to katakana. This flag and LCMAP_HIRAGANA are mutually exclusive.
LCMAP_KATAKANA = 0x00200000,
+
/// Use narrow characters where applicable. This flag and LCMAP_FULLWIDTH are mutually exclusive.
LCMAP_HALFWIDTH = 0x00400000,
+
///
- /// Use Unicode (wide) characters where applicable. This flag and LCMAP_HALFWIDTH are mutually exclusive. With this flag, the mapping may use
- /// Normalization Form C even if an input character is already full-width. For example, the string "は゛" (which is already full-width) is normalized
- /// to "ば". See Unicode normalization forms.
+ /// Use Unicode (wide) characters where applicable. This flag and LCMAP_HALFWIDTH are mutually exclusive. With this flag, the
+ /// mapping may use Normalization Form C even if an input character is already full-width. For example, the string "は゛" (which is
+ /// already full-width) is normalized to "ば". See Unicode normalization forms.
///
LCMAP_FULLWIDTH = 0x00800000,
+
///
- /// Use linguistic rules for casing, instead of file system rules (default). This flag is valid with LCMAP_LOWERCASE or LCMAP_UPPERCASE only.
+ /// Use linguistic rules for casing, instead of file system rules (default). This flag is valid with LCMAP_LOWERCASE or
+ /// LCMAP_UPPERCASE only.
///
LCMAP_LINGUISTIC_CASING = 0x01000000,
- /// Map traditional Chinese characters to simplified Chinese characters. This flag and LCMAP_TRADITIONAL_CHINESE are mutually exclusive.
+
+ ///
+ /// Map traditional Chinese characters to simplified Chinese characters. This flag and LCMAP_TRADITIONAL_CHINESE are mutually exclusive.
+ ///
LCMAP_SIMPLIFIED_CHINESE = 0x02000000,
- /// Map simplified Chinese characters to traditional Chinese characters. This flag and LCMAP_SIMPLIFIED_CHINESE are mutually exclusive.
+
+ ///
+ /// Map simplified Chinese characters to traditional Chinese characters. This flag and LCMAP_SIMPLIFIED_CHINESE are mutually exclusive.
+ ///
LCMAP_TRADITIONAL_CHINESE = 0x04000000,
}
@@ -705,38 +848,55 @@ namespace Vanara.PInvoke
{
/// Western Europe & U.S.
LGRPID_WESTERN_EUROPE = 0x0001,
+
/// Central Europe
LGRPID_CENTRAL_EUROPE = 0x0002,
+
/// Baltic
LGRPID_BALTIC = 0x0003,
+
/// Greek
LGRPID_GREEK = 0x0004,
+
/// Cyrillic
LGRPID_CYRILLIC = 0x0005,
+
/// Turkic
LGRPID_TURKIC = 0x0006,
+
/// Turkish
LGRPID_TURKISH = 0x0006,
+
/// Japanese
LGRPID_JAPANESE = 0x0007,
+
/// Korean
LGRPID_KOREAN = 0x0008,
+
/// Traditional Chinese
LGRPID_TRADITIONAL_CHINESE = 0x0009,
+
/// Simplified Chinese
LGRPID_SIMPLIFIED_CHINESE = 0x000a,
+
/// Thai
LGRPID_THAI = 0x000b,
+
/// Hebrew
LGRPID_HEBREW = 0x000c,
+
/// Arabic
LGRPID_ARABIC = 0x000d,
+
/// Vietnamese
LGRPID_VIETNAMESE = 0x000e,
+
/// Indic
LGRPID_INDIC = 0x000f,
+
/// Georgian
LGRPID_GEORGIAN = 0x0010,
+
/// Armenian
LGRPID_ARMENIAN = 0x0011,
}
@@ -746,6 +906,7 @@ namespace Vanara.PInvoke
{
/// Language group identifier is installed.
LGRPID_INSTALLED = 0x00000001,
+
/// Language group identifier is both supported and installed.
LGRPID_SUPPORTED = 0x00000002,
}
@@ -755,23 +916,31 @@ namespace Vanara.PInvoke
public enum LOCALE_FLAGS
{
///
- /// Windows Vista and later: Enumerate all locales. Using this constant is equivalent to using LOCALE_WINDOWS | LOCALE_SUPPLEMENTAL |
- /// LOCALE_ALTERNATE_SORTS | LOCALE_NEUTRALDATA.
+ /// Windows Vista and later: Enumerate all locales. Using this constant is equivalent to using LOCALE_WINDOWS |
+ /// LOCALE_SUPPLEMENTAL | LOCALE_ALTERNATE_SORTS | LOCALE_NEUTRALDATA.
///
LOCALE_ALL = 0,
+
///
- /// Windows Vista and later: Enumerate all locales that come with the operating system, including replacement locales, but excluding alternate sorts.
- /// For more information, see Custom Locales.
+ /// Windows Vista and later: Enumerate all locales that come with the operating system, including replacement locales, but
+ /// excluding alternate sorts. For more information, see Custom Locales.
///
LOCALE_WINDOWS = 0x00000001,
+
/// Windows Vista and later: Enumerate supplemental locales.
LOCALE_SUPPLEMENTAL = 0x00000002,
+
/// Windows Vista and later: Enumerate only the alternate sorts, locales with a nonzero sort order identifier.
LOCALE_ALTERNATE_SORTS = 0x00000004,
+
/// Windows Vista and later: Enumerate replacement locales. This constant is valid input only for EnumLocalesProcEx.
LOCALE_REPLACEMENT = 0x00000008,
- /// Windows 7 and later: Neutral locale data, that is, data defined by language only. Country/region data uses the default.
+
+ ///
+ /// Windows 7 and later: Neutral locale data, that is, data defined by language only. Country/region data uses the default.
+ ///
LOCALE_NEUTRALDATA = 0x00000010,
+
/// Windows 7 and later: Locale data specified by both language and country/region.
LOCALE_SPECIFICDATA = 0x00000020,
}
@@ -781,6 +950,7 @@ namespace Vanara.PInvoke
{
/// Formats the string using user overrides to the default currency format for the locale.
LOCALE_UNSPECIFIED = 0,
+
/// Format the string using the system default currency format for the specified locale.
LOCALE_NOUSEROVERRIDE = 0x80000000
}
@@ -791,12 +961,16 @@ namespace Vanara.PInvoke
{
/// The language is fully localized.
MUI_FULL_LANGUAGE = 1,
+
/// The language is fully localized.
MUI_PARTIAL_LANGUAGE = 2,
+
/// The language is an LIP language.
MUI_LIP_LANGUAGE = 4,
+
/// The language is installed on this computer.
MUI_LANGUAGE_INSTALLED = 32,
+
/// The language is appropriately licensed for the current user.
MUI_LANGUAGE_LICENSED = 64,
}
@@ -807,6 +981,7 @@ namespace Vanara.PInvoke
{
/// Pass the language identifier in the language string to the callback function.
MUI_LANGUAGE_ID = 4,
+
/// Pass the language name in the language string to the callback function.
MUI_LANGUAGE_NAME = 8
}
@@ -820,9 +995,9 @@ namespace Vanara.PInvoke
///
/// -
///
- /// MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL: The specified input file does not have resource configuration data. Thus it is neither an LN file nor a
- /// language-specific resource file. This type of file is typical for older executable files. If this file type is
- /// specified, the function will not retrieve useful information for the other types.
+ /// MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL: The specified input file does not have resource configuration data. Thus it is neither an
+ /// LN file nor a language-specific resource file. This type of file is typical for older
+ /// executable files. If this file type is specified, the function will not retrieve useful information for the other types.
///
///
/// -
@@ -834,49 +1009,59 @@ namespace Vanara.PInvoke
///
///
MUI_QUERY_TYPE = 0x001,
+
///
- /// Retrieve the resource checksum of the input file in the pChecksum member of FILEMUIINFO. If the input file does not have resource configuration
- /// data, this member of the structure contains 0.
+ /// Retrieve the resource checksum of the input file in the pChecksum member of FILEMUIINFO. If the input file does not have
+ /// resource configuration data, this member of the structure contains 0.
///
MUI_QUERY_CHECKSUM = 0x002,
+
///
- /// Retrieve the language associated with the input file. For a language-specific resource file, this flag requests the associated language. For an
- /// LN file, this flag requests the language of the ultimate fallback resources for the module, which can be either in the LN file or in a separate
- /// language-specific resource file referenced by the resource configuration data of the LN file. For more information, see the Remarks section.
+ /// Retrieve the language associated with the input file. For a language-specific resource file, this flag requests the
+ /// associated language. For an LN file, this flag requests the language of the ultimate fallback resources for the module, which
+ /// can be either in the LN file or in a separate language-specific resource file referenced by the resource configuration data
+ /// of the LN file. For more information, see the Remarks section.
///
MUI_QUERY_LANGUAGE_NAME = 0x004,
+
///
- /// Retrieve lists of resource types in the language-specific resource files and LN files as they are specified in the resource configuration data.
- /// See the Remarks section for a way to access this information.
+ /// Retrieve lists of resource types in the language-specific resource files and LN files as they are specified in the resource
+ /// configuration data. See the Remarks section for a way to access this information.
///
MUI_QUERY_RESOURCE_TYPES = 0x008,
}
/// Specifies the supported normalization forms.
- // typedef enum _NORM_FORM { NormalizationOther = 0, NormalizationC = 0x1, NormalizationD = 0x2, NormalizationKC = 0x5, NormalizationKD = 0x6} NORM_FORM; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319094(v=vs.85).aspx
+ // typedef enum _NORM_FORM { NormalizationOther = 0, NormalizationC = 0x1, NormalizationD = 0x2, NormalizationKC = 0x5,
+ // NormalizationKD = 0x6} NORM_FORM; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319094(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd319094")]
public enum NORM_FORM
{
/// Not supported.
NormalizationOther = 0,
+
///
- /// Unicode normalization form C, canonical composition. Transforms each decomposed grouping, consisting of a base character plus combining
- /// characters, to the canonical precomposed equivalent. For example, A + ¨ becomes Ä.
+ /// Unicode normalization form C, canonical composition. Transforms each decomposed grouping, consisting of a base character plus
+ /// combining characters, to the canonical precomposed equivalent. For example, A + ¨ becomes Ä.
///
NormalizationC = 1,
+
///
- /// Unicode normalization form D, canonical decomposition. Transforms each precomposed character to its canonical decomposed equivalent. For example,
- /// Ä becomes A + ¨.
+ /// Unicode normalization form D, canonical decomposition. Transforms each precomposed character to its canonical decomposed
+ /// equivalent. For example, Ä becomes A + ¨.
///
NormalizationD = 2,
+
///
- /// Unicode normalization form KC, compatibility composition. Transforms each base plus combining characters to the canonical precomposed equivalent
- /// and all compatibility characters to their equivalents. For example, the ligature fi becomes f + i; similarly, A + ¨ + fi + n becomes Ä + f + i + n.
+ /// Unicode normalization form KC, compatibility composition. Transforms each base plus combining characters to the canonical
+ /// precomposed equivalent and all compatibility characters to their equivalents. For example, the ligature fi becomes f + i;
+ /// similarly, A + ¨ + fi + n becomes Ä + f + i + n.
///
NormalizationKC = 5,
+
///
- /// Unicode normalization form KD, compatibility decomposition. Transforms each precomposed character to its canonical decomposed equivalent and all
- /// compatibility characters to their equivalents. For example, Ä + fi + n becomes A + ¨ + f + i + n.
+ /// Unicode normalization form KD, compatibility decomposition. Transforms each precomposed character to its canonical decomposed
+ /// equivalent and all compatibility characters to their equivalents. For example, Ä + fi + n becomes A + ¨ + f + i + n.
///
NormalizationKD = 6,
}
@@ -888,86 +1073,120 @@ namespace Vanara.PInvoke
{
/// Class for nation geographical location identifiers.
GEOCLASS_NATION = 16,
+
/// Class for region geographical location identifiers.
GEOCLASS_REGION = 14,
+
/// Starting with Windows 8: Class for all geographical location identifiers.
GEOCLASS_ALL = 0
}
- /// Defines the type of geographical location information requested in the GetGeoInfo or GetGeoInfoEx function.
- // enum SYSGEOTYPE { GEO_NATION = 0x0001, GEO_LATITUDE = 0x0002, GEO_LONGITUDE = 0x0003, GEO_ISO2 = 0x0004, GEO_ISO3 = 0x0005, GEO_RFC1766 = 0x0006,
- // GEO_LCID = 0x0007, GEO_FRIENDLYNAME = 0x0008, GEO_OFFICIALNAME = 0x0009, GEO_TIMEZONES = 0x000A, GEO_OFFICIALLANGUAGES = 0x000B, GEO_ISO_UN_NUMBER =
- // 0x000C, GEO_PARENT = 0x000D, GEO_DIALINGCODE = 0x000E, GEO_CURRENCYCODE = 0x000F, GEO_CURRENCYSYMBOL = 0x0010, GEO_NAME = 0x0011, GEO_ID = 0x000E }; https://msdn.microsoft.com/en-us/library/windows/desktop/dd374071(v=vs.85).aspx
+ ///
+ /// Defines the type of geographical location information requested in the GetGeoInfo or GetGeoInfoEx function.
+ ///
+ // enum SYSGEOTYPE { GEO_NATION = 0x0001, GEO_LATITUDE = 0x0002, GEO_LONGITUDE = 0x0003, GEO_ISO2 = 0x0004, GEO_ISO3 = 0x0005,
+ // GEO_RFC1766 = 0x0006, GEO_LCID = 0x0007, GEO_FRIENDLYNAME = 0x0008, GEO_OFFICIALNAME = 0x0009, GEO_TIMEZONES = 0x000A,
+ // GEO_OFFICIALLANGUAGES = 0x000B, GEO_ISO_UN_NUMBER = 0x000C, GEO_PARENT = 0x000D, GEO_DIALINGCODE = 0x000E, GEO_CURRENCYCODE =
+ // 0x000F, GEO_CURRENCYSYMBOL = 0x0010, GEO_NAME = 0x0011, GEO_ID = 0x000E }; https://msdn.microsoft.com/en-us/library/windows/desktop/dd374071(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd374071")]
public enum SYSGEOTYPE
{
///
/// The geographical location identifier (GEOID) of a nation. This value is stored in a long integer.
- /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should not be used.
+ ///
+ /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should
+ /// not be used.
+ ///
///
GEO_NATION = 1,
+
/// The latitude of the location. This value is stored in a floating-point number.
GEO_LATITUDE,
+
/// The longitude of the location. This value is stored in a floating-point number.
GEO_LONGITUDE,
+
/// The ISO 2-letter country/region code. This value is stored in a string.
GEO_ISO2,
+
/// The ISO 3-letter country/region code. This value is stored in a string.
GEO_ISO3,
+
///
///
- /// The name for a string, compliant with RFC 4646 (starting with Windows Vista), that is derived from the GetGeoInfo parameters language and GeoId.
+ /// The name for a string, compliant with RFC 4646 (starting with Windows Vista), that is derived from the GetGeoInfo
+ /// parameters language and GeoId.
+ ///
+ ///
+ /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should
+ /// not be used.
///
- /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should not be used.
///
GEO_RFC1766,
+
///
/// A locale identifier derived using GetGeoInfo.
- /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should not be used.
+ ///
+ /// Starting with Windows 10, version 1709: This value is not supported for the GetGeoInfoEx function, and should
+ /// not be used.
+ ///
///
GEO_LCID,
+
/// The friendly name of the nation, for example, Germany. This value is stored in a string.
GEO_FRIENDLYNAME,
+
/// The official name of the nation, for example, Federal Republic of Germany. This value is stored in a string.
GEO_OFFICIALNAME,
+
/// Not implemented.
GEO_TIMEZONES,
+
/// Not implemented.
GEO_OFFICIALLANGUAGES,
+
/// Starting with Windows 8: The ISO 3-digit country/region code. This value is stored in a string.
GEO_ISO_UN_NUMBER,
+
///
- /// Starting with Windows 8: The geographical location identifier of the parent region of a country/region. This value is stored in a string.
+ /// Starting with Windows 8: The geographical location identifier of the parent region of a country/region. This value is
+ /// stored in a string.
///
GEO_PARENT,
+
///
- /// Starting with Windows 10, version 1709: The dialing code to use with telephone numbers in the geographic location. For example, 1 for the
- /// United States.
+ /// Starting with Windows 10, version 1709: The dialing code to use with telephone numbers in the geographic location. For
+ /// example, 1 for the United States.
///
GEO_DIALINGCODE,
+
///
- /// Starting with Windows 10, version 1709: The three-letter code for the currency that the geographic location uses. For example, USD for
- /// United States dollars.
+ /// Starting with Windows 10, version 1709: The three-letter code for the currency that the geographic location uses. For
+ /// example, USD for United States dollars.
///
GEO_CURRENCYCODE,
+
///
- /// Starting with Windows 10, version 1709: The symbol for the currency that the geographic location uses. For example, the dollar sign ($).
+ /// Starting with Windows 10, version 1709: The symbol for the currency that the geographic location uses. For example,
+ /// the dollar sign ($).
///
GEO_CURRENCYSYMBOL,
+
///
///
- /// Starting with Windows 10, version 1709: The two-letter International Organization for Standardization (ISO) 3166-1 code or numeric United
- /// Nations (UN) Series M, Number 49 (M.49) code for the geographic region.
+ /// Starting with Windows 10, version 1709: The two-letter International Organization for Standardization (ISO) 3166-1
+ /// code or numeric United Nations (UN) Series M, Number 49 (M.49) code for the geographic region.
///
///
- /// For information about two-letter ISO 3166-1 codes, see Country Codes - ISO 3166. For information about numeric UN M.49 codes, see Standard
- /// country or area codes for statistical use (M49).
+ /// For information about two-letter ISO 3166-1 codes, see Country Codes - ISO 3166. For information about numeric UN M.49 codes,
+ /// see Standard country or area codes for statistical use (M49).
///
///
GEO_NAME,
+
///
- /// Starting with Windows 10, version 1709: The Windows geographical location identifiers (GEOID) for the region. This value is provided for
- /// backward compatibility. Do not use this value in new applications, but use GEO_NAME instead.
+ /// Starting with Windows 10, version 1709: The Windows geographical location identifiers (GEOID) for the region. This
+ /// value is provided for backward compatibility. Do not use this value in new applications, but use GEO_NAME instead.
///
GEO_ID,
}
@@ -978,7 +1197,8 @@ namespace Vanara.PInvoke
public enum SYSNLS_FUNCTION
{
///
- /// Value indicating comparison of two strings in the manner of the CompareString function or LCMapString with the LCMAP_SORTKEY flag specified.
+ /// Value indicating comparison of two strings in the manner of the CompareString function or LCMapString with the LCMAP_SORTKEY
+ /// flag specified.
///
COMPARE_STRING = 0x0001
}
@@ -989,11 +1209,13 @@ namespace Vanara.PInvoke
{
/// Use the current user's long time format.
USE_CURRENT = 0,
+
/// Windows 7 and later: Use the current user's short time format.
TIME_NOSECONDS = 2,
+
///
- /// Specified with the ANSI version of this function, EnumTimeFormatsA (not recommended), to use the system default Windows ANSI code page (ACP)
- /// instead of the locale code page.
+ /// Specified with the ANSI version of this function, EnumTimeFormatsA (not recommended), to use the system default Windows ANSI
+ /// code page (ACP) instead of the locale code page.
///
LOCAL_USE_CP_ACP = 0x40000000
}
@@ -1003,23 +1225,78 @@ namespace Vanara.PInvoke
{
/// No flags
NONE,
+
/// Allow "Latn" (Latin script) in the test list even if it is not in the locale list.
VS_ALLOW_LATIN
}
+ ///
+ /// Deprecated. Adjusts a date by a specified number of years, months, weeks, or days.
+ ///
+ ///
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
+ ///
+ ///
+ /// - ERROR_DATE_OUT_OF_RANGE. The specified date was out of range.
+ /// - ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with the module handle and the name of this
+ /// function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/adjustcalendardate BOOL AdjustCalendarDate( _Inout_ LPCALDATETIME
+ // lpCalDateTime, _In_ CALDATETIME_DATEUNIT calUnit, _Out_ INT amount );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "be8d61fd-efa3-4386-969f-30216c282ebc")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool AdjustCalendarDate(ref CALDATETIME lpCalDateTime, CALDATETIME_DATEUNIT calUnit, int amount);
+
+ ///
+ /// Deprecated. Converts a specified CALDATETIME structure to a SYSTEMTIME structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
+ ///
+ ///
+ /// - ERROR_DATE_OUT_OF_RANGE. The specified date was out of range.
+ /// - ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with the module handle and the name of this
+ /// function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/convertcaldatetimetosystemtime BOOL ConvertCalDateTimeToSystemTime( _In_
+ // const LPCALDATETIME lpCalDateTime, _Out_ SYSTEMTIME *lpSysTime );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "0c3f602d-62de-4c27-95d9-d35738f3279d")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ConvertCalDateTimeToSystemTime(ref CALDATETIME lpCalDateTime, out SYSTEMTIME lpSysTime);
+
/// Converts a default locale value to an actual locale identifier.
///
///
- /// Default locale identifier value to convert. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Default locale identifier value to convert. You can use the MAKELCID macro to create a locale identifier or use one of the
+ /// following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
///
/// Returns the appropriate locale identifier if successful.
///
- /// This function returns the value of the Locale parameter if it does not succeed. The function fails when the Locale value is not one of the default
- /// values listed above.
+ /// This function returns the value of the Locale parameter if it does not succeed. The function fails when the Locale value is not
+ /// one of the default values listed above.
///
///
// LCID ConvertDefaultLocale( _In_ LCID Locale); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317768(v=vs.85).aspx
@@ -1027,23 +1304,50 @@ namespace Vanara.PInvoke
[PInvokeData("Winnls.h", MSDNShortId = "dd317768")]
public static extern uint ConvertDefaultLocale(uint Locale);
+ ///
+ /// Deprecated. Converts a specified SYSTEMTIME structure to a CALDATETIME structure.
+ ///
+ ///
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
+ ///
+ ///
+ /// - ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ /// The earliest date supported by this function is January 1, 1601.
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with the module handle and the name of this
+ /// function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/convertsystemtimetocaldatetime BOOL ConvertSystemTimeToCalDateTime( _In_
+ // const SYSTEMTIME lpSysTime, _In_ CALID calId, _Out_ LPCALDATETIME lpCalDateTime );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "d21f75bc-1a93-4cb9-8b9b-6fa0e81886bf")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool ConvertSystemTimeToCalDateTime(SYSTEMTIME lpSysTime, CALID calId, out CALDATETIME lpCalDateTime);
+
/// Enumerates calendar information for a specified locale.
/// Pointer to an application-defined callback function. For more information, see EnumCalendarInfoProc.
///
- /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to create a locale
- /// identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to
+ /// create a locale identifier or use one of the following predefined values.
///
///
- /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be ENUM_ALL_CALENDARS, to
- /// enumerate all calendars that are associated with the locale.
+ /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be
+ /// ENUM_ALL_CALENDARS, to enumerate all calendars that are associated with the locale.
///
///
- /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per call to this function,
- /// except where noted.
+ /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per
+ /// call to this function, except where noted.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumCalendarInfo( _In_ CALINFO_ENUMPROC pCalInfoEnumProc, _In_ LCID Locale, _In_ CALID Calendar, _In_ CALTYPE CalType); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317803(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1055,22 +1359,22 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function. For more information, see EnumCalendarInfoProcEx.
///
///
- /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to create an identifier
- /// or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to
+ /// create an identifier or use one of the following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
///
- /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be ENUM_ALL_CALENDARS, to
- /// enumerate all calendars that are associated with the locale.
+ /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be
+ /// ENUM_ALL_CALENDARS, to enumerate all calendars that are associated with the locale.
///
///
- /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per call to this function,
- /// except where noted.
+ /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per
+ /// call to this function, except where noted.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumCalendarInfoEx( _In_ CALINFO_ENUMPROCEX pCalInfoEnumProcEx, _In_ LCID Locale, _In_ CALID Calendar, _In_ CALTYPE CalType); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317804(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1082,21 +1386,23 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function. For more information, see EnumCalendarInfoProcExEx.
/// Pointer to a locale name, or one of the following predefined values.
///
- /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be ENUM_ALL_CALENDARS, to
- /// enumerate all calendars that are associated with the locale.
+ /// Calendar identifier that specifies the calendar for which information is requested. Note that this identifier can be
+ /// ENUM_ALL_CALENDARS, to enumerate all calendars that are associated with the locale.
///
/// Reserved; must be NULL.
///
- /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per call to this function,
- /// except where noted.
+ /// Type of calendar information. For more information, see Calendar Type Information. Only one calendar type can be specified per
+ /// call to this function, except where noted.
+ ///
+ ///
+ /// Application-provided parameter to pass to the callback function. This value is especially useful for multi-threaded applications.
///
- /// Application-provided parameter to pass to the callback function. This value is especially useful for multi-threaded applications.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
- // BOOL EnumCalendarInfoExEx( _In_ CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, _In_opt_ LPCWSTR lpLocaleName, _In_ CALID Calendar, _In_opt_ LPCWSTR
- // lpReserved, _In_ CALTYPE CalType, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317805(v=vs.85).aspx
+ // BOOL EnumCalendarInfoExEx( _In_ CALINFO_ENUMPROCEXEX pCalInfoEnumProcExEx, _In_opt_ LPCWSTR lpLocaleName, _In_ CALID Calendar,
+ // _In_opt_ LPCWSTR lpReserved, _In_ CALTYPE CalType, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317805(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd317805")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -1105,13 +1411,13 @@ namespace Vanara.PInvoke
/// Enumerates the long date, short date, or year/month formats that are available for a specified locale.
/// Pointer to an application-defined callback function. For more information, see EnumDateFormatsProc.
///
- /// Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro to create an
- /// identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro
+ /// to create an identifier or use one of the following predefined values.
///
/// Flag specifying date formats. For detailed definitions, see the dwFlags parameter of EnumDateFormatsExEx.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumDateFormats( _In_ DATEFMT_ENUMPROC lpDateFmtEnumProc, _In_ LCID Locale, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317810(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1123,15 +1429,15 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function. For more information, see EnumDateFormatsProcEx.
///
///
- /// Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro to create an
- /// identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve date format information. You can use the MAKELCID macro
+ /// to create an identifier or use one of the following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
/// Flag specifying date formats. For detailed definitions, see the dwFlags parameter of EnumDateFormatsExEx.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumDateFormatsEx( _In_ DATEFMT_ENUMPROCEX lpDateFmtEnumProcEx, _In_ LCID Locale, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317811(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1169,12 +1475,15 @@ namespace Vanara.PInvoke
///
///
///
- /// An application-provided parameter to pass to the callback function. This value is especially useful for multi-threaded applications.
+ ///
+ /// An application-provided parameter to pass to the callback function. This value is especially useful for multi-threaded applications.
+ ///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
- // BOOL EnumDateFormatsExEx( _In_ DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317812(v=vs.85).aspx
+ // BOOL EnumDateFormatsExEx( _In_ DATEFMT_ENUMPROCEXEX lpDateFmtEnumProcExEx, _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_
+ // LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317812(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd317812")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -1182,18 +1491,20 @@ namespace Vanara.PInvoke
/// Enumerates the locales in a specified language group.
/// Pointer to an application-defined callback function. For more information, see EnumLanguageGroupLocalesProc.
- /// Identifier of the language group for which to enumerate locales. This parameter can have one of the following values:
+ ///
+ /// Identifier of the language group for which to enumerate locales. This parameter can have one of the following values:
+ ///
/// Reserved; must be 0.
///
- /// An application-defined value to pass to the callback function. This value can be used for error checking. It can also be used to ensure thread safety
- /// in the callback function.
+ /// An application-defined value to pass to the callback function. This value can be used for error checking. It can also be used to
+ /// ensure thread safety in the callback function.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
- // BOOL EnumLanguageGroupLocales( _In_ LANGGROUPLOCALE_ENUMPROC lpLangGroupLocaleEnumProc, _In_ LGRPID LanguageGroup, _In_ DWORD dwFlags, _In_ LONG_PTR
- // lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317819(v=vs.85).aspx
+ // BOOL EnumLanguageGroupLocales( _In_ LANGGROUPLOCALE_ENUMPROC lpLangGroupLocaleEnumProc, _In_ LGRPID LanguageGroup, _In_ DWORD
+ // dwFlags, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317819(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd317819")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -1201,8 +1512,8 @@ namespace Vanara.PInvoke
/// Enumerates the code pages that are either installed on or supported by an operating system.
///
- /// Pointer to an application-defined callback function. The EnumSystemCodePages function enumerates code pages by making repeated calls to this
- /// callback function. For more information, see EnumCodePagesProc.
+ /// Pointer to an application-defined callback function. The EnumSystemCodePages function enumerates code pages by making
+ /// repeated calls to this callback function. For more information, see EnumCodePagesProc.
///
///
/// Flag specifying the code pages to enumerate. This parameter can have one of the following values, which are mutually exclusive.
@@ -1224,8 +1535,8 @@ namespace Vanara.PInvoke
///
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumSystemCodePages( _In_ CODEPAGE_ENUMPROC lpCodePageEnumProc, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317825(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1235,23 +1546,23 @@ namespace Vanara.PInvoke
///
///
- /// [ EnumSystemGeoID is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in
- /// subsequent versions. Instead, use EnumSystemGeoNames.]
+ /// [ EnumSystemGeoID is available for use in the operating systems specified in the Requirements section. It may be altered
+ /// or unavailable in subsequent versions. Instead, use EnumSystemGeoNames.]
///
/// Enumerates the geographical location identifiers (type GEOID) that are available on the operating system.
///
///
- /// Geographical location class for which to enumerate the identifiers. At present, only GEOCLASS_NATION is supported. This type causes the function to
- /// enumerate all geographical identifiers for nations on the operating system.
+ /// Geographical location class for which to enumerate the identifiers. At present, only GEOCLASS_NATION is supported. This type
+ /// causes the function to enumerate all geographical identifiers for nations on the operating system.
///
/// Reserved. This parameter must be 0.
///
- /// Pointer to the application-defined callback function EnumGeoInfoProc. The EnumSystemGeoID function makes repeated calls to this
- /// callback function until it returns FALSE.
+ /// Pointer to the application-defined callback function EnumGeoInfoProc. The EnumSystemGeoID function makes repeated
+ /// calls to this callback function until it returns FALSE.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumSystemGeoID( _In_ GEOCLASS GeoClass, _In_ GEOID ParentGeoId, _In_ GEO_ENUMPROC lpGeoEnumProc); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317826(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -1260,20 +1571,22 @@ namespace Vanara.PInvoke
public static extern bool EnumSystemGeoID(SYSGEOCLASS GeoClass, [Optional] int ParentGeoId, EnumGeoInfoProc lpGeoEnumProc);
///
- /// Enumerates the two-letter International Organization for Standardization (ISO) 3166-1 codes or numeric United Nations (UN) Series M, Number 49 (M.49)
- /// codes for geographical locations that are available on the operating system.
+ /// Enumerates the two-letter International Organization for Standardization (ISO) 3166-1 codes or numeric United Nations (UN) Series
+ /// M, Number 49 (M.49) codes for geographical locations that are available on the operating system.
///
- /// The geographical location class for which to enumerate the available two-letter ISO 3166-1 or numeric UN M.49 codes.
+ ///
+ /// The geographical location class for which to enumerate the available two-letter ISO 3166-1 or numeric UN M.49 codes.
+ ///
///
- /// Pointer to the application-defined callback function Geo_EnumNameProc. The EnumSystemGeoNames function calls this callback function for each
- /// of the two-letter ISO 3166-1 or numeric UN M.49 codes for geographical locations that are available on the operating system until callback function
- /// returns FALSE.
+ /// Pointer to the application-defined callback function Geo_EnumNameProc. The EnumSystemGeoNames function calls this callback
+ /// function for each of the two-letter ISO 3166-1 or numeric UN M.49 codes for geographical locations that are available on the
+ /// operating system until callback function returns FALSE.
///
/// Application-specific information to pass to the callback function that the genEnumProc parameter specifies.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, call GetLastError, which can return one of the
- /// following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, call GetLastError, which can
+ /// return one of the following error codes:
///
///
///
@@ -1320,12 +1633,12 @@ namespace Vanara.PInvoke
///
///
///
- /// Application-defined value to pass to the callback function. This parameter can be used in error checking. It can also be used to ensure thread safety
- /// in the callback function.
+ /// Application-defined value to pass to the callback function. This parameter can be used in error checking. It can also be used to
+ /// ensure thread safety in the callback function.
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumSystemLanguageGroups( _In_ LANGUAGEGROUP_ENUMPROC lpLanguageGroupEnumProc, _In_ DWORD dwFlags, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317827(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1337,8 +1650,8 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function. For more information, see EnumLocalesProc.
///
///
- /// Flags specifying the locale identifiers to enumerate. The flags can be used singly or combined using a binary OR. If the application specifies 0 for
- /// this parameter, the function behaves as for LCID_SUPPORTED.
+ /// Flags specifying the locale identifiers to enumerate. The flags can be used singly or combined using a binary OR. If the
+ /// application specifies 0 for this parameter, the function behaves as for LCID_SUPPORTED.
///
///
///
@@ -1357,16 +1670,16 @@ namespace Vanara.PInvoke
/// -
/// LCID_ALTERNATE_SORTS
///
- /// Enumerate only the alternate sort locale identifiers. If this value is used with either LCID_INSTALLED or LCID_SUPPORTED, the installed or supported
- /// locales are retrieved, as well as the alternate sort locale identifiers.
+ /// Enumerate only the alternate sort locale identifiers. If this value is used with either LCID_INSTALLED or LCID_SUPPORTED, the
+ /// installed or supported locales are retrieved, as well as the alternate sort locale identifiers.
///
///
///
///
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumSystemLocales( _In_ LOCALE_ENUMPROC lpLocaleEnumProc, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317828(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1376,20 +1689,23 @@ namespace Vanara.PInvoke
/// Enumerates the locales that are either installed on or supported by an operating system.
///
- /// Pointer to an application-defined callback function. The EnumSystemLocalesEx function enumerates locales by making repeated calls to this
- /// callback function. For more information, see EnumLocalesProcEx.
+ /// Pointer to an application-defined callback function. The EnumSystemLocalesEx function enumerates locales by making
+ /// repeated calls to this callback function. For more information, see EnumLocalesProcEx.
///
///
- /// Flags identifying the locales to enumerate. The flags can be used singly or combined using a binary OR. If the application specifies 0 for this
- /// parameter, the function behaves as for LOCALE_ALL.
+ /// Flags identifying the locales to enumerate. The flags can be used singly or combined using a binary OR. If the application
+ /// specifies 0 for this parameter, the function behaves as for LOCALE_ALL.
+ ///
+ ///
+ /// An application-provided parameter to be passed to the callback function. This is especially useful for multi-threaded applications.
///
- /// An application-provided parameter to be passed to the callback function. This is especially useful for multi-threaded applications.
/// Reserved; must be NULL.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
- // BOOL EnumSystemLocalesEx( _In_ LOCALE_ENUMPROCEX lpLocaleEnumProcEx, _In_ DWORD dwFlags, _In_ LPARAM lParam, _In_opt_ LPVOID lpReserved); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317829(v=vs.85).aspx
+ // BOOL EnumSystemLocalesEx( _In_ LOCALE_ENUMPROCEX lpLocaleEnumProcEx, _In_ DWORD dwFlags, _In_ LPARAM lParam, _In_opt_ LPVOID
+ // lpReserved); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317829(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd317829")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -1398,8 +1714,8 @@ namespace Vanara.PInvoke
/// Enumerates the time formats that are available for a locale specified by identifier.
/// Pointer to an application-defined callback function. For more information, see EnumTimeFormatsProc.
///
- /// Locale identifier that specifies the locale for which to retrieve time format information. You can use the MAKELCID macro to create a locale
- /// identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve time format information. You can use the MAKELCID macro
+ /// to create a locale identifier or use one of the following predefined values.
///
///
/// The time format. This parameter can specify a combination of any of the following values.
@@ -1420,16 +1736,16 @@ namespace Vanara.PInvoke
/// -
/// LOCAL_USE_CP_ACP
///
- /// Specified with the ANSI version of this function, EnumTimeFormatsA (not recommended), to use the system default Windows ANSI code page (ACP) instead
- /// of the locale code page.
+ /// Specified with the ANSI version of this function, EnumTimeFormatsA (not recommended), to use the system default Windows ANSI code
+ /// page (ACP) instead of the locale code page.
///
///
///
///
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumTimeFormats( _In_ TIMEFMT_ENUMPROC lpTimeFmtEnumProc, _In_ LCID Locale, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317830(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1441,30 +1757,35 @@ namespace Vanara.PInvoke
/// Pointer to an application-defined callback function. For more information, see EnumTimeFormatsProcEx.
/// Pointer to a locale name, or one of the following predefined values.
///
- /// The time format. Set to 0 to use the current user's long time format, or TIME_NOSECONDS (starting with Windows 7) to use the short time format.
+ /// The time format. Set to 0 to use the current user's long time format, or TIME_NOSECONDS (starting with Windows 7) to use the
+ /// short time format.
+ ///
+ ///
+ /// An application-provided parameter to be passed to the callback function. This is especially useful for multi-threaded applications.
///
- /// An application-provided parameter to be passed to the callback function. This is especially useful for multi-threaded applications.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
- // BOOL EnumTimeFormatsEx( _In_ TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317831(v=vs.85).aspx
+ // BOOL EnumTimeFormatsEx( _In_ TIMEFMT_ENUMPROCEX lpTimeFmtEnumProcEx, _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_
+ // LPARAM lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317831(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd317831")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, TIME_FORMAT_ENUM dwFlags, IntPtr lParam);
///
- /// Enumerates the user interface languages that are available on the operating system and calls the callback function with every language in the list.
+ /// Enumerates the user interface languages that are available on the operating system and calls the callback function with every
+ /// language in the list.
///
///
- /// Pointer to an application-defined EnumUILanguagesProc callback function. EnumUILanguages calls this function repeatedly to enumerate
- /// the languages in the list.
+ /// Pointer to an application-defined EnumUILanguagesProc callback function. EnumUILanguages calls this function
+ /// repeatedly to enumerate the languages in the list.
///
///
///
- /// Flags identifying language format and filtering. The following flags specify the format of the language to pass to the callback function. The format
- /// flags are mutually exclusive, and MUI_LANGUAGE_ID is the default.
+ /// Flags identifying language format and filtering. The following flags specify the format of the language to pass to the callback
+ /// function. The format flags are mutually exclusive, and MUI_LANGUAGE_ID is the default.
///
///
///
@@ -1483,8 +1804,8 @@ namespace Vanara.PInvoke
///
///
///
- /// The following flags specify the filtering for the function to use in enumerating the languages. The filtering flags are mutually exclusive, and the
- /// default is MUI_LICENSED_LANGUAGES.
+ /// The following flags specify the filtering for the function to use in enumerating the languages. The filtering flags are mutually
+ /// exclusive, and the default is MUI_LICENSED_LANGUAGES.
///
///
///
@@ -1507,15 +1828,15 @@ namespace Vanara.PInvoke
///
///
///
- /// Windows Vista and later: The application can set dwFlags to 0, or to one or more of the specified flags. A setting of 0 causes the parameter
- /// value to default to MUI_LANGUAGE_ID | MUI_LICENSED_LANGUAGES.
+ /// Windows Vista and later: The application can set dwFlags to 0, or to one or more of the specified flags. A setting of 0
+ /// causes the parameter value to default to MUI_LANGUAGE_ID | MUI_LICENSED_LANGUAGES.
///
/// Windows 2000, Windows XP, Windows Server 2003: The application must set dwFlags to 0.
///
/// Application-defined value.
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL EnumUILanguages( _In_ UILANGUAGE_ENUMPROC lpUILanguageEnumProc, _In_ DWORD dwFlags, _In_ LONG_PTR lParam); https://msdn.microsoft.com/en-us/library/windows/desktop/dd317834(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -1523,10 +1844,13 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool EnumUILanguages(EnumUILanguagesProc lpUILanguageEnumProc, MUI_LANGUAGE_ENUM dwFlags, IntPtr lParam);
- /// Locates a Unicode string (wide characters) or its equivalent in another Unicode string for a locale specified by identifier.
+ ///
+ /// Locates a Unicode string (wide characters) or its equivalent in another Unicode string for a locale specified by identifier.
+ ///
///
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create an identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create an identifier or use one of the
+ /// following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
@@ -1535,43 +1859,46 @@ namespace Vanara.PInvoke
///
/// Pointer to the source string, in which the function searches for the string specified by lpStringValue.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application cannot specify 0 or any
- /// negative number other than -1 for this parameter. The application specifies -1 if the source string is null-terminated and the function should
- /// calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application cannot
+ /// specify 0 or any negative number other than -1 for this parameter. The application specifies -1 if the source string is
+ /// null-terminated and the function should calculate the size automatically.
///
/// Pointer to the search string, for which the function searches in the source string.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application cannot specify 0 or any
- /// negative number other than -1 for this parameter. The application specifies -1 if the search string is null-terminated and the function should
- /// calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application cannot
+ /// specify 0 or any negative number other than -1 for this parameter. The application specifies -1 if the search string is
+ /// null-terminated and the function should calculate the size automatically.
///
///
/// Pointer to a buffer containing the length of the string that the function finds. For details, see the pcchFound parameter of FindNLSStringEx.
///
///
///
- /// Returns a 0-based index into the source string indicated by lpStringSource if successful. In combination with the value in pcchFound, this index
- /// provides the exact location of the entire found string in the source string. A return value of 0 is an error-free index into the source string, and
- /// the matching string is in the source string at offset 0.
+ /// Returns a 0-based index into the source string indicated by lpStringSource if successful. In combination with the value in
+ /// pcchFound, this index provides the exact location of the entire found string in the source string. A return value of 0 is an
+ /// error-free index into the source string, and the matching string is in the source string at offset 0.
///
///
- /// The function returns -1 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns -1 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int FindNLSString( _In_ LCID Locale, _In_ DWORD dwFindNLSStringFlags, _In_ LPCWSTR lpStringSource, _In_ int cchSource, _In_ LPCWSTR lpStringValue,
- // _In_ int cchValue, _Out_opt_ LPINT pcchFound); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318056(v=vs.85).aspx
+ // int FindNLSString( _In_ LCID Locale, _In_ DWORD dwFindNLSStringFlags, _In_ LPCWSTR lpStringSource, _In_ int cchSource, _In_
+ // LPCWSTR lpStringValue, _In_ int cchValue, _Out_opt_ LPINT pcchFound); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318056(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318056")]
public static extern int FindNLSString(uint Locale, COMPARE_STRING dwFindNLSStringFlags, string lpStringSource, int cchSource, string lpStringValue, int cchValue, out int pcchFound);
- /// Locates a Unicode string (wide characters) or its equivalent in another Unicode string for a locale specified by name.
+ ///
+ /// Locates a Unicode string (wide characters) or its equivalent in another Unicode string for a locale specified by name.
+ ///
/// Pointer to a locale name, or one of the following predefined values.
///
///
- /// Flags specifying details of the find operation. These flags are mutually exclusive, with FIND_FROMSTART being the default. The application can
- /// specify just one of the find flags with any of the filtering flags defined in the next table. If the application does not specify a flag, the
- /// function uses the default comparison for the specified locale. As discussed in Handling Sorting in Your Applications, there is no binary comparison mode.
+ /// Flags specifying details of the find operation. These flags are mutually exclusive, with FIND_FROMSTART being the default. The
+ /// application can specify just one of the find flags with any of the filtering flags defined in the next table. If the application
+ /// does not specify a flag, the function uses the default comparison for the specified locale. As discussed in Handling Sorting in
+ /// Your Applications, there is no binary comparison mode.
///
///
///
@@ -1618,7 +1945,9 @@ namespace Vanara.PInvoke
///
/// -
/// NORM_IGNOREKANATYPE
- /// Do not differentiate between hiragana and katakana characters. Corresponding hiragana and katakana characters compare as equal.
+ ///
+ /// Do not differentiate between hiragana and katakana characters. Corresponding hiragana and katakana characters compare as equal.
+ ///
///
/// -
/// NORM_IGNORENONSPACE
@@ -1631,8 +1960,8 @@ namespace Vanara.PInvoke
///
-
/// NORM_IGNOREWIDTH
///
- /// Ignore the difference between half-width and full-width characters, for example, C a t == cat. The full-width form is a formatting distinction used
- /// in Chinese and Japanese scripts.
+ /// Ignore the difference between half-width and full-width characters, for example, C a t == cat. The full-width form is a
+ /// formatting distinction used in Chinese and Japanese scripts.
///
///
/// -
@@ -1644,52 +1973,54 @@ namespace Vanara.PInvoke
///
/// Pointer to the source string, in which the function searches for the string specified by lpStringValue.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application cannot specify 0 or any
- /// negative number other than -1 for this parameter. The application specifies -1 if the source string is null-terminated and the function should
- /// calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringSource. The application cannot
+ /// specify 0 or any negative number other than -1 for this parameter. The application specifies -1 if the source string is
+ /// null-terminated and the function should calculate the size automatically.
///
/// Pointer to the search string, for which the function searches in the source string.
///
- /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application cannot specify 0 or any
- /// negative number other than -1 for this parameter. The application specifies -1 if the search string is null-terminated and the function should
- /// calculate the size automatically.
+ /// Size, in characters excluding the terminating null character, of the string indicated by lpStringValue. The application cannot
+ /// specify 0 or any negative number other than -1 for this parameter. The application specifies -1 if the search string is
+ /// null-terminated and the function should calculate the size automatically.
///
///
///
- /// Pointer to a buffer containing the length of the string that the function finds. The string can be either longer or shorter than the search string.
- /// If the function fails to find the search string, this parameter is not modified.
+ /// Pointer to a buffer containing the length of the string that the function finds. The string can be either longer or shorter than
+ /// the search string. If the function fails to find the search string, this parameter is not modified.
///
///
- /// The function can retrieve NULL in this parameter. In this case, the function makes no indication if the length of the found string differs
- /// from the length of the source string.
+ /// The function can retrieve NULL in this parameter. In this case, the function makes no indication if the length of the
+ /// found string differs from the length of the source string.
+ ///
+ ///
+ /// Note that the value of pcchFound is often identical to the value provided in cchValue, but can differ in the following cases:
///
- /// Note that the value of pcchFound is often identical to the value provided in cchValue, but can differ in the following cases:
///
/// Reserved; must be NULL.
/// Reserved; must be NULL.
/// Reserved; must be 0.
///
///
- /// Returns a 0-based index into the source string indicated by lpStringSource if successful. In combination with the value in pcchFound, this index
- /// provides the exact location of the entire found string in the source string. A return value of 0 is an error-free index into the source string, and
- /// the matching string is in the source string at offset 0.
+ /// Returns a 0-based index into the source string indicated by lpStringSource if successful. In combination with the value in
+ /// pcchFound, this index provides the exact location of the entire found string in the source string. A return value of 0 is an
+ /// error-free index into the source string, and the matching string is in the source string at offset 0.
///
///
- /// The function returns -1 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns -1 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int FindNLSStringEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFindNLSStringFlags, _In_ LPCWSTR lpStringSource, _In_ int cchSource, _In_ LPCWSTR
- // lpStringValue, _In_ int cchValue, _Out_opt_ LPINT pcchFound, _In_opt_ LPNLSVERSIONINFO lpVersionInformation, _In_opt_ LPVOID lpReserved, _In_opt_
- // LPARAM sortHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318059(v=vs.85).aspx
+ // int FindNLSStringEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFindNLSStringFlags, _In_ LPCWSTR lpStringSource, _In_ int
+ // cchSource, _In_ LPCWSTR lpStringValue, _In_ int cchValue, _Out_opt_ LPINT pcchFound, _In_opt_ LPNLSVERSIONINFO
+ // lpVersionInformation, _In_opt_ LPVOID lpReserved, _In_opt_ LPARAM sortHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318059(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318059")]
public static extern int FindNLSStringEx(string lpLocaleName, COMPARE_STRING dwFindNLSStringFlags, string lpStringSource, int cchSource, string lpStringValue, int cchValue, out int pcchFound, [Optional] IntPtr lpVersionInformation, [Optional] IntPtr lpReserved, [Optional] IntPtr sortHandle);
/// Retrieves the current Windows ANSI code page identifier for the operating system.
///
- /// Returns the current Windows ANSI code page (ACP) identifier for the operating system. See Code Page Identifiers for a list of identifiers for Windows
- /// ANSI code pages and other code pages.
+ /// Returns the current Windows ANSI code page (ACP) identifier for the operating system. See Code Page Identifiers for a list of
+ /// identifiers for Windows ANSI code pages and other code pages.
///
// UINT GetACP(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318070(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
@@ -1697,50 +2028,128 @@ namespace Vanara.PInvoke
public static extern uint GetACP();
///
- /// Retrieves information about a calendar for a locale specified by identifier. For interoperability reasons, the application should
- /// prefer the GetCalendarInfoEx function to GetCalendarInfo because Microsoft is migrating toward the use of locale names instead of locale identifiers
- /// for new locales. Any application that runs only on Windows Vista and later should use GetCalendarInfoEx.
+ /// Deprecated. Retrieves a properly formatted date string for the specified locale using the specified date and calendar. The user
+ /// can specify the short date format, the long date format, the year month format, or a custom format pattern.
+ ///
+ ///
+ /// Pointer to a locale name, or one of the following predefined values.
+ ///
+ /// -
+ /// LOCALE_NAME_INVARIANT
+ ///
+ /// -
+ /// LOCALE_NAME_SYSTEM_DEFAULT
+ ///
+ /// -
+ /// LOCALE_NAME_USER_DEFAULT
+ ///
+ ///
+ ///
+ ///
+ /// Flags specifying date format options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to
+ /// NULL, the application can specify a combination of the following values and LOCALE_NOUSEROVERRIDE.
+ ///
+ /// Pointer to a CALDATETIME structure that contains the date and calendar information to format.
+ ///
+ /// Pointer to a format picture string that is used to form the date string. Possible values for the format picture string are
+ /// defined in Day, Month, Year, and Era Format Pictures.
+ ///
+ /// The format picture string must be null-terminated.The function uses the locale only for information not specified in the format
+ /// picture string, for example, the day and month names for the locale.The application sets this parameter to NULL if the function
+ /// is to use the date format of the specified locale.
+ ///
+ ///
+ /// Pointer to a buffer in which this function receives the formatted date string.
+ ///
+ /// Size, in characters, of the lpDateStr buffer. Alternatively, the application can set this parameter to 0. In this case, the
+ /// function returns the number of characters required to hold the formatted date string, and the lpDateStr parameter is not used.
+ ///
+ ///
+ ///
+ /// Returns the number of characters written to the lpDateStr buffer if successful. If the cchDate parameter is set to 0, the
+ /// function returns the number of characters required to hold the formatted date string, including the terminating null character.
+ ///
+ ///
+ /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
+ ///
+ ///
+ /// -
+ /// ERROR_DATE_OUT_OF_RANGE. The specified date was out of range.
+ ///
+ /// -
+ /// ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
+ ///
+ /// -
+ /// ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ ///
+ /// The earliest date supported by this function is January 1, 1601.
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with that module handle and the name of
+ /// this function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/getcalendardateformatex BOOL GetCalendarDateFormatEx( _In_ LPCWSTR
+ // lpszLocale, _In_ DWORD dwFlags, _In_ const LPCALDATETIME lpCalDateTime, _In_ LPCWSTR lpFormat, _Out_ LPWSTR lpDateStr, _In_ int
+ // cchDate );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("", MSDNShortId = "eb2622bc-a98d-42bd-ab59-7a849000d79d")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetCalendarDateFormatEx(string lpszLocale, DATE_FORMAT dwFlags, ref CALDATETIME lpCalDateTime, string lpFormat, StringBuilder lpDateStr, int cchDate);
+
+ ///
+ /// Retrieves information about a calendar for a locale specified by identifier. For interoperability reasons, the
+ /// application should prefer the GetCalendarInfoEx function to GetCalendarInfo because Microsoft is migrating toward the use of
+ /// locale names instead of locale identifiers for new locales. Any application that runs only on Windows Vista and later should use GetCalendarInfoEx.
///
///
- /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to create a locale identifier
- /// or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which to retrieve calendar information. You can use the MAKELCID macro to create
+ /// a locale identifier or use one of the following predefined values.
///
/// Calendar identifier.
///
/// Type of information to retrieve. For more information, see Calendar Type Information.
/// CAL_USE_CP_ACP is relevant only for the ANSI version of this function.
///
- /// For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the current system default
- /// locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX. CAL_ITWODIGITYEARMAX is the only value that can be
- /// set by SetCalendarInfo.
+ /// For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the
+ /// current system default locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX.
+ /// CAL_ITWODIGITYEARMAX is the only value that can be set by SetCalendarInfo.
///
///
///
- /// Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in CalType, this parameter
- /// must retrieve NULL.
+ /// Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in
+ /// CalType, this parameter must retrieve NULL.
///
///
- /// Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the calendar data buffer.
- /// In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value of cchData must be 0.
+ /// Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the
+ /// calendar data buffer. In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value
+ /// of cchData must be 0.
///
///
- /// Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue must not be NULL. If
- /// CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.
+ /// Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue
+ /// must not be NULL. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.
///
///
///
- /// Returns the number of characters retrieved in the lpCalData buffer if successful. If the function succeeds, cchData is set to 0, and
- /// CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the locale information. If the function succeeds,
- /// cchData is set to 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value written to the lpValue parameter. This size is
- /// always 2.
+ /// Returns the number of characters retrieved in the lpCalData buffer if successful. If the function succeeds, cchData is set to 0,
+ /// and CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the locale information. If
+ /// the function succeeds, cchData is set to 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value written
+ /// to the lpValue parameter. This size is always 2.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCalendarInfo( _In_ LCID Locale, _In_ CALID Calendar, _In_ CALTYPE CalType, _Out_opt_ LPTSTR lpCalData, _In_ int cchData, _Out_opt_ LPDWORD
- // lpValue); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318072(v=vs.85).aspx
+ // int GetCalendarInfo( _In_ LCID Locale, _In_ CALID Calendar, _In_ CALTYPE CalType, _Out_opt_ LPTSTR lpCalData, _In_ int cchData,
+ // _Out_opt_ LPDWORD lpValue); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318072(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318072")]
public static extern int GetCalendarInfo(uint Locale, uint Calendar, CALTYPE CalType, [Out] StringBuilder lpCalData, int cchData, out uint lpValue);
@@ -1752,47 +2161,82 @@ namespace Vanara.PInvoke
///
/// Type of information to retrieve. For more information, see Calendar Type Information.
///
- /// For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the current system default
- /// locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX. CAL_ITWODIGITYEARMAX is the only value that can be
- /// set by SetCalendarInfo.
+ /// For CAL_NOUSEROVERRIDE, the function ignores any value set by SetCalendarInfo and uses the database settings for the
+ /// current system default locale. This type is relevant only in the combination CAL_NOUSEROVERRIDE | CAL_ITWODIGITYEARMAX.
+ /// CAL_ITWODIGITYEARMAX is the only value that can be set by SetCalendarInfo.
///
///
///
- /// Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in CalType, this parameter
- /// must retrieve NULL.
+ /// Pointer to a buffer in which this function retrieves the requested data as a string. If CAL_RETURN_NUMBER is specified in
+ /// CalType, this parameter must retrieve NULL.
///
///
- /// Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the calendar data buffer.
- /// In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value of cchData must be 0.
+ /// Size, in characters, of the lpCalData buffer. The application can set this parameter to 0 to return the required size for the
+ /// calendar data buffer. In this case, the lpCalData parameter is not used. If CAL_RETURN_NUMBER is specified for CalType, the value
+ /// of cchData must be 0.
///
///
- /// Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue must not be
- /// NULL. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.
+ /// Pointer to a variable that receives the requested data as a number. If CAL_RETURN_NUMBER is specified in CalType, then lpValue
+ /// must not be NULL. If CAL_RETURN_NUMBER is not specified in CalType, then lpValue must be NULL.
///
///
///
- /// Returns the number of characters retrieved in the lpCalData buffer if successful. If the function succeeds, cchData is set to 0, and
- /// CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the locale information. If the function succeeds,
- /// cchData is set to 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value written to the lpValue parameter. This size is
- /// always 2.
+ /// Returns the number of characters retrieved in the lpCalData buffer if successful. If the function succeeds, cchData is set to 0,
+ /// and CAL_RETURN_NUMBER is not specified, the return value is the size of the buffer required to hold the locale information. If
+ /// the function succeeds, cchData is set to 0, and CAL_RETURN_NUMBER is specified, the return value is the size of the value written
+ /// to the lpValue parameter. This size is always 2.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCalendarInfoEx( _In_opt_ LPCWSTR lpLocaleName, _In_ CALID Calendar, _In_opt_ LPCWSTR lpReserved, _In_ CALTYPE CalType, _Out_opt_ LPWSTR
- // lpCalData, _In_ int cchData, _Out_opt_ LPDWORD lpValue); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318075(v=vs.85).aspx
+ // int GetCalendarInfoEx( _In_opt_ LPCWSTR lpLocaleName, _In_ CALID Calendar, _In_opt_ LPCWSTR lpReserved, _In_ CALTYPE CalType,
+ // _Out_opt_ LPWSTR lpCalData, _In_ int cchData, _Out_opt_ LPDWORD lpValue); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318075(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318075")]
public static extern int GetCalendarInfoEx(string lpLocaleName, uint Calendar, string lpReserved, CALTYPE CalType, [Out] StringBuilder lpCalData, int cchData, out uint lpValue);
- /// Retrieves information about any valid installed or available code page.
- /// Identifier for the code page for which to retrieve information. For details, see the CodePage parameter of GetCPInfoEx.
- /// Pointer to a CPINFO structure that receives information about the code page. See the Remarks section.
+ /// Deprecated. Gets the supported date range for a specified calendar.
+ /// The calendar.
+ /// The lp cal minimum date time.
+ /// The lp cal maximum date time.
///
- /// Returns 1 if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can return one of the
- /// following error codes:
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
+ ///
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ ///
+ /// The earliest date supported by this function is January 1, 1601.
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with the module handle and the name of this
+ /// function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/getcalendarsupporteddaterange BOOL GetCalendarSupportedDateRange( _In_ CALID
+ // Calendar, _Out_ LPCALDATETIME lpCalMinDateTime, _Out_ LPCALDATETIME lpCalMaxDateTime );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "fe036ac5-77c0-4e83-8d70-db3fa0f7c803")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetCalendarSupportedDateRange(uint Calendar, out CALDATETIME lpCalMinDateTime, out CALDATETIME lpCalMaxDateTime);
+
+ /// Retrieves information about any valid installed or available code page.
+ ///
+ /// Identifier for the code page for which to retrieve information. For details, see the CodePage parameter of GetCPInfoEx.
+ ///
+ ///
+ /// Pointer to a CPINFO structure that receives information about the code page. See the Remarks section.
+ ///
+ ///
+ /// Returns 1 if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which
+ /// can return one of the following error codes:
///
// BOOL GetCPInfo( _In_ UINT CodePage, _Out_ LPCPINFO lpCPInfo); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318078(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -1803,8 +2247,9 @@ namespace Vanara.PInvoke
/// Retrieves information about any valid installed or available code page.
///
///
- /// Identifier for the code page for which to retrieve information. The application can specify the code page identifier for any installed or available
- /// code page, or one of the following predefined values. See Code Page Identifiers for a list of identifiers for ANSI and other code pages.
+ /// Identifier for the code page for which to retrieve information. The application can specify the code page identifier for any
+ /// installed or available code page, or one of the following predefined values. See Code Page Identifiers for a list of identifiers
+ /// for ANSI and other code pages.
///
///
///
@@ -1834,8 +2279,8 @@ namespace Vanara.PInvoke
/// Reserved; must be 0.
/// Pointer to a CPINFOEX structure that receives information about the code page.
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL GetCPInfoEx( _In_ UINT CodePage, _In_ DWORD dwFlags, _Out_ LPCPINFOEX lpCPInfoEx); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318081(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Unicode)]
@@ -1845,76 +2290,80 @@ namespace Vanara.PInvoke
/// Formats a number string as a currency string for a locale specified by identifier.
///
- /// Locale identifier that specifies the locale for which this function formats the currency string. You can use the MAKELCID macro to create a
- /// locale identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which this function formats the currency string. You can use the MAKELCID
+ /// macro to create a locale identifier or use one of the following predefined values.
///
///
- /// Flags controlling currency format. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case, the function
- /// formats the string using user overrides to the default currency format for the locale. If lpFormat is set to NULL, the application can specify
- /// LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for the specified locale.
+ /// Flags controlling currency format. The application must set this parameter to 0 if lpFormat is not set to NULL. In this
+ /// case, the function formats the string using user overrides to the default currency format for the locale. If lpFormat is set to
+ /// NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for
+ /// the specified locale.
///
/// For details, see the lpValue parameter of GetCurrencyFormatEx.
///
- /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must contain appropriate
- /// values. The application can set this parameter to NULL if function is to use the currency format of the specified locale. If this parameter is
- /// not set to NULL, the function uses the specified locale only for formatting information not specified in the CURRENCYFMT structure, for
- /// example, the string value for the negative sign used by the locale.
+ /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must
+ /// contain appropriate values. The application can set this parameter to NULL if function is to use the currency format of
+ /// the specified locale. If this parameter is not set to NULL, the function uses the specified locale only for formatting
+ /// information not specified in the CURRENCYFMT structure, for example, the string value for the negative sign used by the locale.
///
/// Pointer to a buffer in which this function retrieves the formatted currency string.
///
- /// Size, in characters, of the lpCurrencyStr buffer. The application sets this parameter to 0 if the function is to return the size of the buffer
- /// required to hold the formatted currency string. In this case, the lpCurrencyStr parameter is not used.
+ /// Size, in characters, of the lpCurrencyStr buffer. The application sets this parameter to 0 if the function is to return the size
+ /// of the buffer required to hold the formatted currency string. In this case, the lpCurrencyStr parameter is not used.
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter is set to 0, the
- /// function returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter
+ /// is set to 0, the function returns the size of the buffer required to hold the formatted currency string, including a terminating
+ /// null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCurrencyFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_ LPTSTR
- // lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318083(v=vs.85).aspx
+ // int GetCurrencyFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_
+ // LPTSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318083(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318083")]
public static extern int GetCurrencyFormat(uint Locale, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [In] ref CURRENCYFMT lpFormat, [Out] StringBuilder lpCurrencyStr, int cchCurrency);
/// Formats a number string as a currency string for a locale specified by identifier.
///
- /// Locale identifier that specifies the locale for which this function formats the currency string. You can use the MAKELCID macro to create a
- /// locale identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which this function formats the currency string. You can use the MAKELCID
+ /// macro to create a locale identifier or use one of the following predefined values.
///
///
- /// Flags controlling currency format. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case, the function
- /// formats the string using user overrides to the default currency format for the locale. If lpFormat is set to NULL, the application can specify
- /// LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for the specified locale.
+ /// Flags controlling currency format. The application must set this parameter to 0 if lpFormat is not set to NULL. In this
+ /// case, the function formats the string using user overrides to the default currency format for the locale. If lpFormat is set to
+ /// NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for
+ /// the specified locale.
///
/// For details, see the lpValue parameter of GetCurrencyFormatEx.
///
- /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must contain appropriate
- /// values. The application can set this parameter to NULL if function is to use the currency format of the specified locale. If this parameter is
- /// not set to NULL, the function uses the specified locale only for formatting information not specified in the CURRENCYFMT structure, for
- /// example, the string value for the negative sign used by the locale.
+ /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must
+ /// contain appropriate values. The application can set this parameter to NULL if function is to use the currency format of
+ /// the specified locale. If this parameter is not set to NULL, the function uses the specified locale only for formatting
+ /// information not specified in the CURRENCYFMT structure, for example, the string value for the negative sign used by the locale.
///
/// Pointer to a buffer in which this function retrieves the formatted currency string.
///
- /// Size, in characters, of the lpCurrencyStr buffer. The application sets this parameter to 0 if the function is to return the size of the buffer
- /// required to hold the formatted currency string. In this case, the lpCurrencyStr parameter is not used.
+ /// Size, in characters, of the lpCurrencyStr buffer. The application sets this parameter to 0 if the function is to return the size
+ /// of the buffer required to hold the formatted currency string. In this case, the lpCurrencyStr parameter is not used.
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter is set to 0, the
- /// function returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter
+ /// is set to 0, the function returns the size of the buffer required to hold the formatted currency string, including a terminating
+ /// null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCurrencyFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_ LPTSTR
- // lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318083(v=vs.85).aspx
+ // int GetCurrencyFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_
+ // LPTSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318083(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318083")]
public static extern int GetCurrencyFormat(uint Locale, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [Optional] IntPtr lpFormat, [Out] StringBuilder lpCurrencyStr, int cchCurrency);
@@ -1922,37 +2371,38 @@ namespace Vanara.PInvoke
/// Formats a number string as a currency string for a locale specified by name.
/// Pointer to a locale name or one of the following predefined values.
///
- /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case,
- /// the function formats the string using user overrides to the default currency format for the locale. If lpFormat is set to NULL, the
- /// application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for the specified locale.
+ /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to
+ /// NULL. In this case, the function formats the string using user overrides to the default currency format for the locale. If
+ /// lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default
+ /// currency format for the specified locale.
///
///
- /// Pointer to a null-terminated string containing the number string to format. This string can contain only the following characters. All other
- /// characters are invalid. The function returns an error if the string deviates from these rules.
+ /// Pointer to a null-terminated string containing the number string to format. This string can contain only the following
+ /// characters. All other characters are invalid. The function returns an error if the string deviates from these rules.
///
///
- /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must contain appropriate
- /// values. The application can set this parameter to NULL if function is to use the currency format of the specified locale. If this parameter is
- /// not set to NULL, the function uses the specified locale only for formatting information not specified in the CURRENCYFMT structure, for
- /// example, the string value for the negative sign used by the locale.
+ /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must
+ /// contain appropriate values. The application can set this parameter to NULL if function is to use the currency format of
+ /// the specified locale. If this parameter is not set to NULL, the function uses the specified locale only for formatting
+ /// information not specified in the CURRENCYFMT structure, for example, the string value for the negative sign used by the locale.
///
/// Pointer to a buffer in which this function retrieves the formatted currency string.
///
- /// Size, in characters, of the lpCurrencyStr buffer. The application can set this parameter to 0 to return the size of the buffer required to hold the
- /// formatted currency string. In this case, the buffer indicated by lpCurrencyStr is not used.
+ /// Size, in characters, of the lpCurrencyStr buffer. The application can set this parameter to 0 to return the size of the buffer
+ /// required to hold the formatted currency string. In this case, the buffer indicated by lpCurrencyStr is not used.
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter is 0, the function
- /// returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter
+ /// is 0, the function returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCurrencyFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_
- // LPWSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318084(v=vs.85).aspx
+ // int GetCurrencyFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const CURRENCYFMT
+ // *lpFormat, _Out_opt_ LPWSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318084(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318084")]
public static extern int GetCurrencyFormatEx(string lpLocaleName, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [In] ref CURRENCYFMT lpFormat, [Out] StringBuilder lpCurrencyStr, int cchCurrency);
@@ -1960,37 +2410,38 @@ namespace Vanara.PInvoke
/// Formats a number string as a currency string for a locale specified by name.
/// Pointer to a locale name or one of the following predefined values.
///
- /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case,
- /// the function formats the string using user overrides to the default currency format for the locale. If lpFormat is set to NULL, the
- /// application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default currency format for the specified locale.
+ /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to
+ /// NULL. In this case, the function formats the string using user overrides to the default currency format for the locale. If
+ /// lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default
+ /// currency format for the specified locale.
///
///
- /// Pointer to a null-terminated string containing the number string to format. This string can contain only the following characters. All other
- /// characters are invalid. The function returns an error if the string deviates from these rules.
+ /// Pointer to a null-terminated string containing the number string to format. This string can contain only the following
+ /// characters. All other characters are invalid. The function returns an error if the string deviates from these rules.
///
///
- /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must contain appropriate
- /// values. The application can set this parameter to NULL if function is to use the currency format of the specified locale. If this parameter is
- /// not set to NULL, the function uses the specified locale only for formatting information not specified in the CURRENCYFMT structure, for
- /// example, the string value for the negative sign used by the locale.
+ /// Pointer to a CURRENCYFMT structure that contains currency formatting information. All members of the structure must
+ /// contain appropriate values. The application can set this parameter to NULL if function is to use the currency format of
+ /// the specified locale. If this parameter is not set to NULL, the function uses the specified locale only for formatting
+ /// information not specified in the CURRENCYFMT structure, for example, the string value for the negative sign used by the locale.
///
/// Pointer to a buffer in which this function retrieves the formatted currency string.
///
- /// Size, in characters, of the lpCurrencyStr buffer. The application can set this parameter to 0 to return the size of the buffer required to hold the
- /// formatted currency string. In this case, the buffer indicated by lpCurrencyStr is not used.
+ /// Size, in characters, of the lpCurrencyStr buffer. The application can set this parameter to 0 to return the size of the buffer
+ /// required to hold the formatted currency string. In this case, the buffer indicated by lpCurrencyStr is not used.
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter is 0, the function
- /// returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter
+ /// is 0, the function returns the size of the buffer required to hold the formatted currency string, including a terminating null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetCurrencyFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const CURRENCYFMT *lpFormat, _Out_opt_
- // LPWSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318084(v=vs.85).aspx
+ // int GetCurrencyFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const CURRENCYFMT
+ // *lpFormat, _Out_opt_ LPWSTR lpCurrencyStr, _In_ int cchCurrency); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318084(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318084")]
public static extern int GetCurrencyFormatEx(string lpLocaleName, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [Optional] IntPtr lpFormat, [Out] StringBuilder lpCurrencyStr, int cchCurrency);
@@ -1998,51 +2449,54 @@ namespace Vanara.PInvoke
/// Formats a duration of time as a time string for a locale specified by identifier.
///
///
- /// Locale identifier that specifies the locale for which this function formats the duration. You can use the MAKELCID macro to create a locale
- /// identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale for which this function formats the duration. You can use the MAKELCID macro
+ /// to create a locale identifier or use one of the following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
///
- /// Flags specifying function options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to NULL, your
- /// application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default duration format for the specified locale.
+ /// Flags specifying function options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to
+ /// NULL, your application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default duration format for
+ /// the specified locale.
///
///
- /// Pointer to a SYSTEMTIME structure that contains the time duration information to format. If this pointer is NULL, the function ignores
- /// this parameter and uses ullDuration.
+ /// Pointer to a SYSTEMTIME structure that contains the time duration information to format. If this pointer is NULL,
+ /// the function ignores this parameter and uses ullDuration.
///
///
- /// 64-bit unsigned integer that represents the number of 100-nanosecond intervals in the duration. If both lpDuration and ullDuration are present,
- /// lpDuration takes precedence. If lpDuration is set to NULL and ullDuration is set to 0, the duration is zero.
+ /// 64-bit unsigned integer that represents the number of 100-nanosecond intervals in the duration. If both lpDuration and
+ /// ullDuration are present, lpDuration takes precedence. If lpDuration is set to NULL and ullDuration is set to 0, the
+ /// duration is zero.
///
/// Pointer to the format string. For details, see the lpFormat parameter of GetDurationFormatEx.
///
/// Pointer to the buffer in which the function retrieves the duration string.
///
- /// Alternatively, this parameter can contain NULL if cchDuration is set to 0. In this case, the function returns the required size for the
- /// duration string buffer.
+ /// Alternatively, this parameter can contain NULL if cchDuration is set to 0. In this case, the function returns the required
+ /// size for the duration string buffer.
///
///
///
/// Size, in characters, of the buffer indicated by lpDurationStr.
///
- /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpDurationStr and returns the
- /// required size for the duration string buffer.
+ /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpDurationStr and
+ /// returns the required size for the duration string buffer.
///
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpDurationStr if successful. If lpDurationStr is set to NULL and
- /// cchDuration is set to 0, the function returns the required size for the duration string buffer, including the null terminating character. For
- /// example, if 10 characters are written to the buffer, the function returns 11 to include the terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpDurationStr if successful. If lpDurationStr is set to
+ /// NULL and cchDuration is set to 0, the function returns the required size for the duration string buffer, including the
+ /// null terminating character. For example, if 10 characters are written to the buffer, the function returns 11 to include the
+ /// terminating null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetDurationFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_opt_ const SYSTEMTIME *lpDuration, _In_ ULONGLONG ullDuration, _In_opt_ LPCWSTR
- // lpFormat, _Out_opt_ LPWSTR lpDurationStr, _In_ int cchDuration); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318091(v=vs.85).aspx
+ // int GetDurationFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_opt_ const SYSTEMTIME *lpDuration, _In_ ULONGLONG ullDuration,
+ // _In_opt_ LPCWSTR lpFormat, _Out_opt_ LPWSTR lpDurationStr, _In_ int cchDuration); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318091(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318091")]
public static extern int GetDurationFormat(uint Locale, LOCALE_FORMAT_FLAG dwFlags, [In] ref SYSTEMTIME lpDuration, ulong ullDuration, string lpFormat, [Out] StringBuilder lpDurationStr, int cchDuration);
@@ -2050,22 +2504,24 @@ namespace Vanara.PInvoke
/// Formats a duration of time as a time string for a locale specified by name.
/// Pointer to a locale name, or one of the following predefined values.
///
- /// Flags specifying function options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to NULL, your
- /// application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default duration format for the specified locale.
+ /// Flags specifying function options. If lpFormat is not set to NULL, this parameter must be set to 0. If lpFormat is set to
+ /// NULL, your application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default duration format for
+ /// the specified locale.
///
///
- /// Pointer to a SYSTEMTIME structure that contains the time duration information to format. The application sets this parameter to NULL if
- /// the function is to ignore it and use ullDuration.
+ /// Pointer to a SYSTEMTIME structure that contains the time duration information to format. The application sets this
+ /// parameter to NULL if the function is to ignore it and use ullDuration.
///
///
- /// 64-bit unsigned integer that represents the number of 100-nanosecond intervals in the duration. If both lpDuration and ullDuration are set, the
- /// lpDuration parameter takes precedence. If lpDuration is set to NULL and ullDuration is set to 0, the duration is 0.
+ /// 64-bit unsigned integer that represents the number of 100-nanosecond intervals in the duration. If both lpDuration and
+ /// ullDuration are set, the lpDuration parameter takes precedence. If lpDuration is set to NULL and ullDuration is set to 0,
+ /// the duration is 0.
///
///
///
- /// Pointer to the format string with characters as shown below. The application can set this parameter to NULL if the function is to format the
- /// string according to the duration format for the specified locale. If lpFormat is not set to NULL, the function uses the locale only for
- /// information not specified in the format picture string.
+ /// Pointer to the format string with characters as shown below. The application can set this parameter to NULL if the
+ /// function is to format the string according to the duration format for the specified locale. If lpFormat is not set to
+ /// NULL, the function uses the locale only for information not specified in the format picture string.
///
///
///
@@ -2111,30 +2567,31 @@ namespace Vanara.PInvoke
///
/// Pointer to the buffer in which the function retrieves the duration string.
///
- /// Alternatively, this parameter retrieves NULL if cchDuration is set to 0. In this case, the function returns the required size for the duration
- /// string buffer.
+ /// Alternatively, this parameter retrieves NULL if cchDuration is set to 0. In this case, the function returns the required
+ /// size for the duration string buffer.
///
///
///
/// Size, in characters, of the buffer indicated by lpDurationStr.
///
- /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpDurationStr and returns the
- /// required size for the duration string buffer.
+ /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpDurationStr and
+ /// returns the required size for the duration string buffer.
///
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpDurationStr if successful. If lpDurationStr is set to NULL and
- /// cchDuration is set to 0, the function returns the required size for the duration string buffer, including the terminating null character. For
- /// example, if 10 characters are written to the buffer, the function returns 11 to include the terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpDurationStr if successful. If lpDurationStr is set to
+ /// NULL and cchDuration is set to 0, the function returns the required size for the duration string buffer, including the
+ /// terminating null character. For example, if 10 characters are written to the buffer, the function returns 11 to include the
+ /// terminating null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetDurationFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_opt_ const SYSTEMTIME *lpDuration, _In_ ULONGLONG ullDuration,
- // _In_opt_ LPCWSTR lpFormat, _Out_opt_ LPWSTR lpDurationStr, _In_ int cchDuration); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318092(v=vs.85).aspx
+ // int GetDurationFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_opt_ const SYSTEMTIME *lpDuration, _In_ ULONGLONG
+ // ullDuration, _In_opt_ LPCWSTR lpFormat, _Out_opt_ LPWSTR lpDurationStr, _In_ int cchDuration); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318092(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318092")]
public static extern int GetDurationFormatEx(string lpLocaleName, LOCALE_FORMAT_FLAG dwFlags, [In] ref SYSTEMTIME lpDuration, ulong ullDuration, string lpFormat, [Out] StringBuilder lpDurationStr, int cchDuration);
@@ -2142,7 +2599,8 @@ namespace Vanara.PInvoke
/// Retrieves resource-related information about a file.
///
///
- /// Flags specifying the information to retrieve. Any combination of the following flags is allowed. The default value of the flags is MUI_QUERY_TYPE | MUI_QUERY_CHECKSUM.
+ /// Flags specifying the information to retrieve. Any combination of the following flags is allowed. The default value of the flags
+ /// is MUI_QUERY_TYPE | MUI_QUERY_CHECKSUM.
///
///
///
@@ -2157,70 +2615,75 @@ namespace Vanara.PInvoke
/// -
/// MUI_QUERY_CHECKSUM
///
- /// Retrieve the resource checksum of the input file in the pChecksum member of FILEMUIINFO. If the input file does not have resource configuration data,
- /// this member of the structure contains 0.
+ /// Retrieve the resource checksum of the input file in the pChecksum member of FILEMUIINFO. If the input file does not have resource
+ /// configuration data, this member of the structure contains 0.
///
///
/// -
/// MUI_QUERY_LANGUAGE_NAME
///
- /// Retrieve the language associated with the input file. For a language-specific resource file, this flag requests the associated language. For an LN
- /// file, this flag requests the language of the ultimate fallback resources for the module, which can be either in the LN file or in a separate
- /// language-specific resource file referenced by the resource configuration data of the LN file. For more information, see the Remarks section.
+ /// Retrieve the language associated with the input file. For a language-specific resource file, this flag requests the associated
+ /// language. For an LN file, this flag requests the language of the ultimate fallback resources for the module, which can be either
+ /// in the LN file or in a separate language-specific resource file referenced by the resource configuration data of the LN file. For
+ /// more information, see the Remarks section.
///
///
/// -
/// MUI_QUERY_RESOURCE_TYPES
///
- /// Retrieve lists of resource types in the language-specific resource files and LN files as they are specified in the resource configuration data. See
- /// the Remarks section for a way to access this information.
+ /// Retrieve lists of resource types in the language-specific resource files and LN files as they are specified in the resource
+ /// configuration data. See the Remarks section for a way to access this information.
///
///
///
///
///
///
- /// Pointer to a null-terminated string indicating the path to the file. Typically the file is either an LN file or a language-specific resource file. If
- /// it is not one of these types, the only significant value that the function retrieves is MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL. The function only
- /// retrieves this value if the MUI_QUERY_RESOURCE_TYPES flag is set.
+ /// Pointer to a null-terminated string indicating the path to the file. Typically the file is either an LN file or a
+ /// language-specific resource file. If it is not one of these types, the only significant value that the function retrieves is
+ /// MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL. The function only retrieves this value if the MUI_QUERY_RESOURCE_TYPES flag is set.
///
///
///
- /// Pointer to a buffer containing file information in a FILEMUIINFO structure and possibly in data following that structure. The information
- /// buffer might have to be much larger than the size of the structure itself. Depending on flag settings, the function can store considerable
- /// information following the structure, at offsets retrieved in the structure. For more information, see the Remarks section.
+ /// Pointer to a buffer containing file information in a FILEMUIINFO structure and possibly in data following that structure.
+ /// The information buffer might have to be much larger than the size of the structure itself. Depending on flag settings, the
+ /// function can store considerable information following the structure, at offsets retrieved in the structure. For more information,
+ /// see the Remarks section.
///
///
- /// Alternatively, the application can set this parameter to NULL if pcbFileMUIInfo is set to 0. In this case, the function retrieves the required
- /// size for the information buffer in pcbFileMUIInfo.
+ /// Alternatively, the application can set this parameter to NULL if pcbFileMUIInfo is set to 0. In this case, the function
+ /// retrieves the required size for the information buffer in pcbFileMUIInfo.
///
///
///
///
- /// Pointer to the buffer size, in bytes, for the file information indicated by pFileMUIInfo. On successful return from the function, this parameter
- /// contains the size of the retrieved file information buffer and the FILEMUIINFO structure that contains it.
+ /// Pointer to the buffer size, in bytes, for the file information indicated by pFileMUIInfo. On successful return from the function,
+ /// this parameter contains the size of the retrieved file information buffer and the FILEMUIINFO structure that contains it.
///
///
- /// Alternatively, the application can set this parameter to 0 if it sets NULL in pFileMUIInfo. In this case, the function retrieves the required
- /// file information buffer size in pcbFileMUIInfo. To allocate the correct amount of memory, this value should be added to the size of the
- /// FILEMUIINFO structure itself.
+ /// Alternatively, the application can set this parameter to 0 if it sets NULL in pFileMUIInfo. In this case, the function
+ /// retrieves the required file information buffer size in pcbFileMUIInfo. To allocate the correct amount of memory, this value
+ /// should be added to the size of the FILEMUIINFO structure itself.
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError.
- // BOOL GetFileMUIInfo( _In_ DWORD dwFlags, _In_ PCWSTR pcwszFilePath, _Inout_opt_ PFILEMUIINFO pFileMUIInfo, _Inout_ DWORD *pcbFileMUIInfo); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318095(v=vs.85).aspx
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError.
+ ///
+ // BOOL GetFileMUIInfo( _In_ DWORD dwFlags, _In_ PCWSTR pcwszFilePath, _Inout_opt_ PFILEMUIINFO pFileMUIInfo, _Inout_ DWORD
+ // *pcbFileMUIInfo); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318095(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318095")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetFileMUIInfo(MUI_QUERY dwFlags, string pcwszFilePath, ref FILEMUIINFO pFileMUIInfo, ref uint pcbFileMUIInfo);
///
- /// Retrieves the path to all language-specific resource files associated with the supplied LN file. The application must call this function repeatedly
- /// to get the path for each resource file.
+ /// Retrieves the path to all language-specific resource files associated with the supplied LN file. The application must call this
+ /// function repeatedly to get the path for each resource file.
///
///
///
- /// Flags identifying language format and filtering. The following flags specify the format of the language indicated by pwszLanguage. The flags are
- /// mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying language format and filtering. The following flags specify the format of the language indicated by
+ /// pwszLanguage. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
///
///
///
@@ -2239,8 +2702,8 @@ namespace Vanara.PInvoke
///
///
///
- /// The following flags specify the filtering for the function to use in locating language-specific resource files if pwszLanguage is set to NULL.
- /// The filtering flags are mutually exclusive, and the default is MUI_USER_PREFERRED_UI_LANGUAGES.
+ /// The following flags specify the filtering for the function to use in locating language-specific resource files if pwszLanguage is
+ /// set to NULL. The filtering flags are mutually exclusive, and the default is MUI_USER_PREFERRED_UI_LANGUAGES.
///
///
///
@@ -2251,30 +2714,32 @@ namespace Vanara.PInvoke
/// -
/// MUI_USE_SEARCH_ALL_LANGUAGES
///
- /// Retrieve all language-specific resource files for the path indicated by pcwszFilePath, without considering file licensing. This flag is relevant only
- /// if the application supplies a null string for pwszLanguage.
+ /// Retrieve all language-specific resource files for the path indicated by pcwszFilePath, without considering file licensing. This
+ /// flag is relevant only if the application supplies a null string for pwszLanguage.
///
///
/// -
/// MUI_USER_PREFERRED_UI_LANGUAGES
///
- /// Retrieve only the files that implement languages in the fallback list. Successive calls enumerate the successive fallbacks, in the appropriate order.
- /// The first file indicated by the output value of pcchFileMUIPath should be the best fit. This flag is relevant only if the application supplies a null
- /// string for pwszLanguage.
+ /// Retrieve only the files that implement languages in the fallback list. Successive calls enumerate the successive fallbacks, in
+ /// the appropriate order. The first file indicated by the output value of pcchFileMUIPath should be the best fit. This flag is
+ /// relevant only if the application supplies a null string for pwszLanguage.
///
///
/// -
/// MUI_USE_INSTALLED_LANGUAGES
///
- /// Retrieve only the files for the languages installed on the computer. This flag is relevant only if the application supplies a null string for pwszLanguage.
+ /// Retrieve only the files for the languages installed on the computer. This flag is relevant only if the application supplies a
+ /// null string for pwszLanguage.
///
///
///
///
///
- /// The following flags allow the user to indicate the type of file that is specified by pcwszFilePath so that the function can determine if it must add
- /// ".mui" to the file name. The flags are mutually exclusive. If the application passes both flags, the function fails. If the application passes
- /// neither flag, the function checks the file in the root folder to verify the file type and decide on file naming.
+ /// The following flags allow the user to indicate the type of file that is specified by pcwszFilePath so that the function can
+ /// determine if it must add ".mui" to the file name. The flags are mutually exclusive. If the application passes both flags, the
+ /// function fails. If the application passes neither flag, the function checks the file in the root folder to verify the file type
+ /// and decide on file naming.
///
///
///
@@ -2285,69 +2750,76 @@ namespace Vanara.PInvoke
/// -
/// MUI_LANG_NEUTRAL_PE_FILE
///
- /// Do not verify the file passed in pcwszFilePath and append ".mui" to the file name before processing. For example, change Abc.exe to Abc.exe.mui.
+ /// Do not verify the file passed in pcwszFilePath and append ".mui" to the file name before processing. For
+ /// example, change Abc.exe to Abc.exe.mui.
///
///
/// -
/// MUI_NON_LANG_NEUTRAL_FILE
///
- /// Do not verify the file passed in pcwszFilePath and do not append ".mui" to the file name before processing. For example, use
- /// Abc.txt or Abc.chm.
+ /// Do not verify the file passed in pcwszFilePath and do not append ".mui" to the file name before processing. For
+ /// example, use Abc.txt or Abc.chm.
///
///
///
///
///
///
- /// Pointer to a null-terminated string specifying a file path. The path is either for an existing LN file or for a file such as a .txt, .inf, or .msc
- /// file. If the file is an LN file, the function looks for files containing the associated language-specific resources. For all other types of files,
- /// the function seeks files that correspond exactly to the file name and path indicated. Your application can overwrite the behavior of the file type
- /// check by using the MUI_LANG_NEUTRAL_PE_FILE or MUI_NON_LANG_NEUTRAL_FILE flag. For more information, see the Remarks section.
+ /// Pointer to a null-terminated string specifying a file path. The path is either for an existing LN file or for a file such as a
+ /// .txt, .inf, or .msc file. If the file is an LN file, the function looks for files containing the associated language-specific
+ /// resources. For all other types of files, the function seeks files that correspond exactly to the file name and path indicated.
+ /// Your application can overwrite the behavior of the file type check by using the MUI_LANG_NEUTRAL_PE_FILE or
+ /// MUI_NON_LANG_NEUTRAL_FILE flag. For more information, see the Remarks section.
///
///
///
- /// Pointer to a buffer containing a language string. On input, this buffer contains the language identifier or language name for which the application
- /// should find language-specific resource files, depending on the settings of dwFlags. On successful return from the function, this parameter contains
- /// the language of the language-specific resource file that the function has found.
+ /// Pointer to a buffer containing a language string. On input, this buffer contains the language identifier or language name for
+ /// which the application should find language-specific resource files, depending on the settings of dwFlags. On successful return
+ /// from the function, this parameter contains the language of the language-specific resource file that the function has found.
///
///
- /// Alternatively, the application can set this parameter to NULL, with the value referenced by pcchLanguage set to 0. In this case, the function
- /// retrieves the required buffer size in pcchLanguage.
+ /// Alternatively, the application can set this parameter to NULL, with the value referenced by pcchLanguage set to 0. In this
+ /// case, the function retrieves the required buffer size in pcchLanguage.
///
///
///
- /// Pointer to the buffer size, in characters, for the language string indicated by pwszLanguage. If the application sets the value referenced by this
- /// parameter to 0 and passes NULL for pwszLanguage, then the required buffer size will be returned in pcchLanguage and the returned buffer size
- /// is always LOCALE_NAME_MAX_LENGTH, because the function is typically called multiple times in succession. The function cannot determine the exact size
- /// of the language name for all successive calls, and cannot extend the buffer on subsequent calls. Thus LOCALE_NAME_MAX_LENGTH is the only safe maximum.
+ /// Pointer to the buffer size, in characters, for the language string indicated by pwszLanguage. If the application sets the value
+ /// referenced by this parameter to 0 and passes NULL for pwszLanguage, then the required buffer size will be returned in
+ /// pcchLanguage and the returned buffer size is always LOCALE_NAME_MAX_LENGTH, because the function is typically called multiple
+ /// times in succession. The function cannot determine the exact size of the language name for all successive calls, and cannot
+ /// extend the buffer on subsequent calls. Thus LOCALE_NAME_MAX_LENGTH is the only safe maximum.
///
///
///
- /// Pointer to a buffer containing the path to the language-specific resource file. It is strongly recommended to allocate this buffer to be of size MAX_PATH.
+ /// Pointer to a buffer containing the path to the language-specific resource file. It is strongly recommended to allocate this
+ /// buffer to be of size MAX_PATH.
///
///
- /// Alternatively, this parameter can retrieve NULL if the value referenced by pcchFileMUIPath is set to 0. In this case, the function retrieves
- /// the required size for the file path buffer in pcchFileMUIPath.
+ /// Alternatively, this parameter can retrieve NULL if the value referenced by pcchFileMUIPath is set to 0. In this case, the
+ /// function retrieves the required size for the file path buffer in pcchFileMUIPath.
///
///
///
- /// Pointer to the buffer size, in characters, for the file path indicated by pwszFileMUIPath. On successful return from the function, this parameter
- /// indicates the size of the retrieved file path. If the application sets the value referenced by this parameter to 0, the function retrieves
- /// NULL for pwszFileMUIPath, the required buffer size will be returned in pcchFileMUIPath and the returned buffer size is always MAX_PATH,
- /// because the function is typically called multiple times in succession. The function cannot determine the exact size of the path for all successive
- /// calls, and cannot extend the buffer on subsequent calls. Thus MAX_PATH is the only safe maximum.
+ /// Pointer to the buffer size, in characters, for the file path indicated by pwszFileMUIPath. On successful return from the
+ /// function, this parameter indicates the size of the retrieved file path. If the application sets the value referenced by this
+ /// parameter to 0, the function retrieves NULL for pwszFileMUIPath, the required buffer size will be returned in
+ /// pcchFileMUIPath and the returned buffer size is always MAX_PATH, because the function is typically called multiple times in
+ /// succession. The function cannot determine the exact size of the path for all successive calls, and cannot extend the buffer on
+ /// subsequent calls. Thus MAX_PATH is the only safe maximum.
///
///
- /// Pointer to an enumeration variable. The first time this function is called, the value of the variable should be 0. Between subsequent calls, the
- /// application should not change the value of this parameter. After the function retrieves all possible language-specific resource file paths, it
- /// returns FALSE.
+ /// Pointer to an enumeration variable. The first time this function is called, the value of the variable should be 0. Between
+ /// subsequent calls, the application should not change the value of this parameter. After the function retrieves all possible
+ /// language-specific resource file paths, it returns FALSE.
///
///
/// Returns TRUE if successful or FALSE otherwise. If the function fails, the output parameters do not change.
- /// To get extended error information, the application can call GetLastError, which can return the following error codes:
+ ///
+ /// To get extended error information, the application can call GetLastError, which can return the following error codes:
+ ///
///
- // BOOL GetFileMUIPath( _In_ DWORD dwFlags, _In_ PCWSTR pcwszFilePath, _Inout_opt_ PWSTR pwszLanguage, _Inout_ PULONG pcchLanguage, _Out_opt_ PWSTR
- // pwszFileMUIPath, _Inout_ PULONG pcchFileMUIPath, _Inout_ PULONGLONG pululEnumerator); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318097(v=vs.85).aspx
+ // BOOL GetFileMUIPath( _In_ DWORD dwFlags, _In_ PCWSTR pcwszFilePath, _Inout_opt_ PWSTR pwszLanguage, _Inout_ PULONG pcchLanguage,
+ // _Out_opt_ PWSTR pwszFileMUIPath, _Inout_ PULONG pcchFileMUIPath, _Inout_ PULONGLONG pululEnumerator); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318097(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318097")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -2355,41 +2827,41 @@ namespace Vanara.PInvoke
///
///
- /// [ GetGeoInfo is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in
- /// subsequent versions. Instead, use GetGeoInfoEx.]
+ /// [ GetGeoInfo is available for use in the operating systems specified in the Requirements section. It may be altered or
+ /// unavailable in subsequent versions. Instead, use GetGeoInfoEx.]
///
/// Retrieves information about a specified geographical location.
///
///
- /// Identifier for the geographical location for which to get information. For more information, see Table of Geographical Locations. You can obtain the
- /// available values by calling EnumSystemGeoID.
+ /// Identifier for the geographical location for which to get information. For more information, see Table of Geographical Locations.
+ /// You can obtain the available values by calling EnumSystemGeoID.
///
///
///
- /// Type of information to retrieve. Possible values are defined by the SYSGEOTYPE enumeration. If the value of GeoType is GEO_LCID, the function
- /// retrieves a locale identifier. If the value of GeoType is GEO_RFC1766, the function retrieves a string name that is compliant with RFC 4646 (Windows
- /// Vista). For more information, see the Remarks section.
+ /// Type of information to retrieve. Possible values are defined by the SYSGEOTYPE enumeration. If the value of GeoType is
+ /// GEO_LCID, the function retrieves a locale identifier. If the value of GeoType is GEO_RFC1766, the function retrieves a string
+ /// name that is compliant with RFC 4646 (Windows Vista). For more information, see the Remarks section.
///
/// Windows XP: When GeoType is set to GEO_LCID, the retrieved string is an 8-digit hexadecimal value.
/// Windows Me: When GeoType is set to GEO_LCID, the retrieved string is a decimal value.
///
/// Pointer to the buffer in which this function retrieves the information.
///
- /// Size of the buffer indicated by lpGeoData. The size is the number of bytes for the ANSI version of the function, or the number of words for the
- /// Unicode version. The application can set this parameter to 0 if the function is to return the required size of the buffer.
+ /// Size of the buffer indicated by lpGeoData. The size is the number of bytes for the ANSI version of the function, or the number of
+ /// words for the Unicode version. The application can set this parameter to 0 if the function is to return the required size of the buffer.
///
///
- /// Identifier for the language, used with the value of Location. The application can set this parameter to 0, with GEO_RFC1766 or GEO_LCID specified for
- /// GeoType. This setting causes the function to retrieve the language identifier by calling GetUserDefaultLangID.
+ /// Identifier for the language, used with the value of Location. The application can set this parameter to 0, with GEO_RFC1766 or
+ /// GEO_LCID specified for GeoType. This setting causes the function to retrieve the language identifier by calling GetUserDefaultLangID.
///
///
///
- /// Returns the number of bytes (ANSI) or words (Unicode) of geographical location information retrieved in the output buffer. If cchData is set to 0,
- /// the function returns the required size for the buffer.
+ /// Returns the number of bytes (ANSI) or words (Unicode) of geographical location information retrieved in the output buffer. If
+ /// cchData is set to 0, the function returns the required size for the buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int GetGeoInfo( _In_ GEOID Location, _In_ GEOTYPE GeoType, _Out_opt_ LPTSTR lpGeoData, _In_ int cchData, _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318099(v=vs.85).aspx
@@ -2398,22 +2870,23 @@ namespace Vanara.PInvoke
public static extern int GetGeoInfo(int Location, SYSGEOTYPE GeoType, [Out] StringBuilder lpGeoData, int cchData, ushort LangId);
///
- /// Retrieves information about a geographic location that you specify by using a two-letter International Organization for Standardization (ISO) 3166-1
- /// code or numeric United Nations (UN) Series M, Number 49 (M.49) code.
+ /// Retrieves information about a geographic location that you specify by using a two-letter International Organization for
+ /// Standardization (ISO) 3166-1 code or numeric United Nations (UN) Series M, Number 49 (M.49) code.
///
///
- /// The two-letter ISO 3166-1 or numeric UN M.49 code for the geographic location for which to get information. To get the codes that are available on
- /// the operating system, call EnumSystemGeoNames.
+ /// The two-letter ISO 3166-1 or numeric UN M.49 code for the geographic location for which to get information. To get the codes that
+ /// are available on the operating system, call EnumSystemGeoNames.
///
/// The type of information you want to retrieve. Possible values are defined by the SYSGEOTYPE enumeration.
/// A pointer to the buffer in which GetGeoInfoEx should write the requested information.
///
- /// The size of the buffer to which the GeoData parameter points, in characters. Set this parameter to 0 to specify that the function should only return
- /// the size of the buffer required to store the requested information without writing the requested information to the buffer.
+ /// The size of the buffer to which the GeoData parameter points, in characters. Set this parameter to 0 to specify that the function
+ /// should only return the size of the buffer required to store the requested information without writing the requested information
+ /// to the buffer.
///
///
- /// The number of bytes of geographical location information that the function wrote the output buffer. If geoDataCount is 0, the function returns the
- /// size of the buffer required to hold the information without writing the information to the buffer.
+ /// The number of bytes of geographical location information that the function wrote the output buffer. If geoDataCount is 0, the
+ /// function returns the size of the buffer required to hold the information without writing the information to the buffer.
/// 0 indicates that the function did not succeed.To get extended error information, call GetLastError.
///
// int WINAPI GetGeoInfoEx( _In_ PWSTR location, _In_ GEOTYPE geoType, _Out_opt_ PWSTR geoData, _In_ int geoDataCount ); https://msdn.microsoft.com/en-us/library/windows/desktop/mt826489(v=vs.85).aspx
@@ -2423,28 +2896,29 @@ namespace Vanara.PInvoke
/// Retrieves information about a locale specified by identifier.
///
- /// Locale identifier for which to retrieve information. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier for which to retrieve information. You can use the MAKELCID macro to create a locale identifier or use
+ /// one of the following predefined values.
///
/// The locale information to retrieve. For detailed definitions, see the LCType parameter of GetLocaleInfoEx.
///
- /// Pointer to a buffer in which this function retrieves the requested locale information. This pointer is not used if cchData is set to 0. For more
- /// information, see the Remarks section.
+ /// Pointer to a buffer in which this function retrieves the requested locale information. This pointer is not used if cchData is set
+ /// to 0. For more information, see the Remarks section.
///
///
- /// Size, in TCHAR values, of the data buffer indicated by lpLCData. Alternatively, the application can set this parameter to 0. In this case, the
- /// function does not use the lpLCData parameter and returns the required buffer size, including the terminating null character.
+ /// Size, in TCHAR values, of the data buffer indicated by lpLCData. Alternatively, the application can set this parameter to 0. In
+ /// this case, the function does not use the lpLCData parameter and returns the required buffer size, including the terminating null character.
///
///
///
- /// Returns the number of characters retrieved in the locale data buffer if successful and cchData is a nonzero value. If the function succeeds, cchData
- /// is nonzero, and LOCALE_RETURN_NUMBER is specified, the return value is the size of the integer retrieved in the data buffer; that is, 2 for the
- /// Unicode version of the function or 4 for the ANSI version. If the function succeeds and the value of cchData is 0, the return value is the required
- /// size, in characters including a null character, for the locale data buffer.
+ /// Returns the number of characters retrieved in the locale data buffer if successful and cchData is a nonzero value. If the
+ /// function succeeds, cchData is nonzero, and LOCALE_RETURN_NUMBER is specified, the return value is the size of the integer
+ /// retrieved in the data buffer; that is, 2 for the Unicode version of the function or 4 for the ANSI version. If the function
+ /// succeeds and the value of cchData is 0, the return value is the required size, in characters including a null character, for the
+ /// locale data buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int GetLocaleInfo( _In_ LCID Locale, _In_ LCTYPE LCType, _Out_opt_ LPTSTR lpLCData, _In_ int cchData); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318101(v=vs.85).aspx
@@ -2456,35 +2930,39 @@ namespace Vanara.PInvoke
/// Pointer to a locale name, or one of the following predefined values.
///
///
- /// The locale information to retrieve. For possible values, see the "Constants Used in the LCType Parameter of GetLocaleInfo, GetLocaleInfoEx, and
- /// SetLocaleInfo" section in Locale Information Constants. Note that only one piece of locale information can be specified per call.
+ /// The locale information to retrieve. For possible values, see the "Constants Used in the LCType Parameter of GetLocaleInfo,
+ /// GetLocaleInfoEx, and SetLocaleInfo" section in Locale Information Constants. Note that only one piece of locale information can
+ /// be specified per call.
///
///
- /// The application can use the binary OR operator to combine LOCALE_RETURN_NUMBER with any other allowed constant. In this case, the function retrieves
- /// the value as a number instead of a string. The buffer that receives the value must be at least the length of a DWORD value, which is 2.
+ /// The application can use the binary OR operator to combine LOCALE_RETURN_NUMBER with any other allowed constant. In this case, the
+ /// function retrieves the value as a number instead of a string. The buffer that receives the value must be at least the length of a
+ /// DWORD value, which is 2.
///
/// If LCType is set to LOCALE_IOPTIONALCALENDAR, the function retrieves only the first alternate calendar.
///
- /// Starting with Windows Vista, your applications should not use LOCALE_ILANGUAGE in the LCType parameter to avoid failure or retrieval of unexpected
- /// data. Instead, it is recommended for your applications to call GetLocaleInfoEx.
+ /// Starting with Windows Vista, your applications should not use LOCALE_ILANGUAGE in the LCType parameter to avoid failure or
+ /// retrieval of unexpected data. Instead, it is recommended for your applications to call GetLocaleInfoEx.
///
///
///
- /// Pointer to a buffer in which this function retrieves the requested locale information. This pointer is not used if cchData is set to 0.
+ /// Pointer to a buffer in which this function retrieves the requested locale information. This pointer is not used if cchData is set
+ /// to 0.
///
///
- /// Size, in characters, of the data buffer indicated by lpLCData. Alternatively, the application can set this parameter to 0. In this case, the function
- /// does not use the lpLCData parameter and returns the required buffer size, including the terminating null character.
+ /// Size, in characters, of the data buffer indicated by lpLCData. Alternatively, the application can set this parameter to 0. In
+ /// this case, the function does not use the lpLCData parameter and returns the required buffer size, including the terminating null character.
///
///
///
- /// Returns the number of characters retrieved in the locale data buffer if successful and cchData is a nonzero value. If the function succeeds, cchData
- /// is nonzero, and LOCALE_RETURN_NUMBER is specified, the return value is the size of the integer retrieved in the data buffer, that is, 2. If the
- /// function succeeds and the value of cchData is 0, the return value is the required size, in characters including a null character, for the locale data buffer.
+ /// Returns the number of characters retrieved in the locale data buffer if successful and cchData is a nonzero value. If the
+ /// function succeeds, cchData is nonzero, and LOCALE_RETURN_NUMBER is specified, the return value is the size of the integer
+ /// retrieved in the data buffer, that is, 2. If the function succeeds and the value of cchData is 0, the return value is the
+ /// required size, in characters including a null character, for the locale data buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int GetLocaleInfoEx( _In_opt_ LPCWSTR lpLocaleName, _In_ LCTYPE LCType, _Out_opt_ LPWSTR lpLCData, _In_ int cchData); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318103(v=vs.85).aspx
@@ -2496,7 +2974,8 @@ namespace Vanara.PInvoke
/// The NLS capability to query. This value must be COMPARE_STRING. See the SYSNLS_FUNCTION enumeration.
///
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create an identifier or use one of the following predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create an identifier or use one of the
+ /// following predefined values.
///
/// Windows Vista and later: The following custom locale identifiers are also supported.
///
@@ -2504,8 +2983,8 @@ namespace Vanara.PInvoke
/// Pointer to an NLSVERSIONINFO structure. The application must initialize the dwNLSVersionInfoSize member to .
///
///
- /// Returns TRUE if and only if the application has supplied valid values in lpVersionInformation, or FALSE otherwise. To get extended
- /// error information, the application can call GetLastError, which can return one of the following error codes:
+ /// Returns TRUE if and only if the application has supplied valid values in lpVersionInformation, or FALSE otherwise.
+ /// To get extended error information, the application can call GetLastError, which can return one of the following error codes:
///
// BOOL GetNLSVersion( _In_ NLS_FUNCTION Function, _In_ LCID Locale, _Inout_ LPNLSVERSIONINFO lpVersionInformation); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318105(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -2520,8 +2999,8 @@ namespace Vanara.PInvoke
/// Pointer to an NLSVERSIONINFOEX structure. The application must initialize the dwNLSVersionInfoSize member to .
///
///
- /// Returns TRUE if and only if the application has supplied valid values in lpVersionInformation, or FALSE otherwise. To get extended
- /// error information, the application can call GetLastError, which can return one of the following error codes:
+ /// Returns TRUE if and only if the application has supplied valid values in lpVersionInformation, or FALSE otherwise.
+ /// To get extended error information, the application can call GetLastError, which can return one of the following error codes:
///
// BOOL GetNLSVersionEx( _In_ NLS_FUNCTION function, _In_opt_ LPCWSTR lpLocaleName, _Inout_ LPNLSVERSIONINFOEX lpVersionInformation); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318107(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
@@ -2531,40 +3010,44 @@ namespace Vanara.PInvoke
/// Formats a number string as a number string customized for a locale specified by identifier.
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
///
- /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case,
- /// the function formats the string using user overrides to the default number format for the locale. If lpFormat is set to NULL, the application
- /// can specify LOCALE_NOUSEROVERRIDE to format the string using the system default number format for the specified locale.
+ /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to
+ /// NULL. In this case, the function formats the string using user overrides to the default number format for the locale. If
+ /// lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default
+ /// number format for the specified locale.
///
///
- /// Pointer to a null-terminated string containing the number string to format. This string can only contain the following characters. All other
- /// characters are invalid. The function returns an error if the string indicated by lpValue deviates from these rules.
+ /// Pointer to a null-terminated string containing the number string to format. This string can only contain the following
+ /// characters. All other characters are invalid. The function returns an error if the string indicated by lpValue deviates from
+ /// these rules.
///
///
- /// Pointer to a NUMBERFMT structure that contains number formatting information, with all members set to appropriate values. If this parameter
- /// does is not set to NULL, the function uses the locale only for formatting information not specified in the structure, for example, the
- /// locale-specific string value for the negative sign.
+ /// Pointer to a NUMBERFMT structure that contains number formatting information, with all members set to appropriate values.
+ /// If this parameter does is not set to NULL, the function uses the locale only for formatting information not specified in
+ /// the structure, for example, the locale-specific string value for the negative sign.
///
/// Pointer to a buffer in which this function retrieves the formatted number string.
///
- /// Size, in TCHAR values, for the number string buffer indicated by lpNumberStr. Alternatively, the application can set this parameter to 0. In this
- /// case, the function returns the required size for the number string buffer, and does not use the lpNumberStr parameter.
+ /// Size, in TCHAR values, for the number string buffer indicated by lpNumberStr. Alternatively, the application can set this
+ /// parameter to 0. In this case, the function returns the required size for the number string buffer, and does not use the
+ /// lpNumberStr parameter.
///
///
///
- /// Returns the number of TCHAR values retrieved in the buffer indicated by lpNumberStr if successful. If the cchNumber parameter is set to 0, the
- /// function returns the number of characters required to hold the formatted number string, including a terminating null character.
+ /// Returns the number of TCHAR values retrieved in the buffer indicated by lpNumberStr if successful. If the cchNumber parameter is
+ /// set to 0, the function returns the number of characters required to hold the formatted number string, including a terminating
+ /// null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetNumberFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const NUMBERFMT *lpFormat, _Out_opt_ LPTSTR lpNumberStr,
- // _In_ int cchNumber); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318110(v=vs.85).aspx
+ // int GetNumberFormat( _In_ LCID Locale, _In_ DWORD dwFlags, _In_ LPCTSTR lpValue, _In_opt_ const NUMBERFMT *lpFormat, _Out_opt_
+ // LPTSTR lpNumberStr, _In_ int cchNumber); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318110(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318110")]
public static extern int GetNumberFormat(uint Locale, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [In] ref NUMBERFMT lpFormat, [Out] StringBuilder lpNumberStr, int cchNumber);
@@ -2572,39 +3055,42 @@ namespace Vanara.PInvoke
/// Formats a number string as a number string customized for a locale specified by name.
/// Pointer to a locale name, or one of the following predefined values.
///
- /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case,
- /// the function formats the string using user overrides to the default number format for the locale. If lpFormat is set to NULL, the application
- /// can specify LOCALE_NOUSEROVERRIDE to format the string using the system default number format for the specified locale.
+ /// Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to
+ /// NULL. In this case, the function formats the string using user overrides to the default number format for the locale. If
+ /// lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default
+ /// number format for the specified locale.
///
///
- /// Pointer to a null-terminated string containing the number string to format. This string can only contain the following characters. All other
- /// characters are invalid. The function returns an error if the string indicated by lpValue deviates from these rules.
+ /// Pointer to a null-terminated string containing the number string to format. This string can only contain the following
+ /// characters. All other characters are invalid. The function returns an error if the string indicated by lpValue deviates from
+ /// these rules.
///
///
- /// Pointer to a NUMBERFMT structure that contains number formatting information, with all members set to appropriate values. If the application
- /// does not set this parameter to NULL, the function uses the locale only for formatting information not specified in the structure, for example,
- /// the locale string value for the negative sign.
+ /// Pointer to a NUMBERFMT structure that contains number formatting information, with all members set to appropriate values.
+ /// If the application does not set this parameter to NULL, the function uses the locale only for formatting information not
+ /// specified in the structure, for example, the locale string value for the negative sign.
///
///
- /// Pointer to a buffer in which this function retrieves the formatted number string. Alternatively, this parameter contains NULL if cchNumber is
- /// set to 0. In this case, the function returns the required size for the number string buffer.
+ /// Pointer to a buffer in which this function retrieves the formatted number string. Alternatively, this parameter contains
+ /// NULL if cchNumber is set to 0. In this case, the function returns the required size for the number string buffer.
///
///
- /// Size, in characters, for the number string buffer indicated by lpNumberStr. Alternatively, the application can set this parameter to 0. In this case,
- /// the function returns the required size for the number string buffer and does not use the lpNumberStr parameter.
+ /// Size, in characters, for the number string buffer indicated by lpNumberStr. Alternatively, the application can set this parameter
+ /// to 0. In this case, the function returns the required size for the number string buffer and does not use the lpNumberStr parameter.
///
///
///
- /// Returns the number of characters retrieved in the buffer indicated by lpNumberStr if successful. If the cchNumber parameter is set to 0, the function
- /// returns the number of characters required to hold the formatted number string, including a terminating null character.
+ /// Returns the number of characters retrieved in the buffer indicated by lpNumberStr if successful. If the cchNumber parameter is
+ /// set to 0, the function returns the number of characters required to hold the formatted number string, including a terminating
+ /// null character.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetNumberFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const NUMBERFMT *lpFormat, _Out_opt_ LPWSTR
- // lpNumberStr, _In_ int cchNumber); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318113(v=vs.85).aspx
+ // int GetNumberFormatEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwFlags, _In_ LPCWSTR lpValue, _In_opt_ const NUMBERFMT
+ // *lpFormat, _Out_opt_ LPWSTR lpNumberStr, _In_ int cchNumber); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318113(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318113")]
public static extern int GetNumberFormatEx(string lpLocaleName, LOCALE_FORMAT_FLAG dwFlags, [In] string lpValue, [In] ref NUMBERFMT lpFormat, [Out] StringBuilder lpNumberStr, int cchNumber);
@@ -2619,7 +3105,8 @@ namespace Vanara.PInvoke
/// Retrieves the process preferred UI languages. For more information, see User Interface Language Management.
///
///
- /// Flags identifying the language format to use for the process preferred UI languages. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying the language format to use for the process preferred UI languages. The flags are mutually exclusive, and the
+ /// default is MUI_LANGUAGE_NAME.
///
///
///
@@ -2641,36 +3128,36 @@ namespace Vanara.PInvoke
/// Pointer to the number of languages retrieved in pwszLanguagesBuffer.
///
///
- /// Optional. Pointer to a double null-terminated multi-string buffer in which the function retrieves an ordered, null-delimited list in preference
- /// order, starting with the most preferable.
+ /// Optional. Pointer to a double null-terminated multi-string buffer in which the function retrieves an ordered, null-delimited list
+ /// in preference order, starting with the most preferable.
///
///
- /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer. The required size includes the two null characters.
+ /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer. The required size includes the two null characters.
///
///
///
///
- /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the function, the parameter
- /// contains the size of the retrieved language buffer.
+ /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the
+ /// function, the parameter contains the size of the retrieved language buffer.
///
///
- /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer.
+ /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer.
///
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
///
- /// If the process preferred UI language list is empty or if the languages specified for the process are not valid, the function succeeds and returns an
- /// empty multistring in pwszLanguagesBuffer and 2 in the pcchLanguagesBuffer parameter.
+ /// If the process preferred UI language list is empty or if the languages specified for the process are not valid, the function
+ /// succeeds and returns an empty multistring in pwszLanguagesBuffer and 2 in the pcchLanguagesBuffer parameter.
///
///
- // BOOL GetProcessPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer, _Inout_ PULONG
- // pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318115(v=vs.85).aspx
+ // BOOL GetProcessPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer,
+ // _Inout_ PULONG pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318115(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318115")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -2688,56 +3175,60 @@ namespace Vanara.PInvoke
/// -
/// GSS_ALLOW_INHERITED_COMMON
///
- /// Retrieve "Qaii" (INHERITED) and "Zyyy" (COMMON) script information. This flag does not affect the processing of unassigned characters. These
- /// characters in the input string always cause a "Zzzz" (UNASSIGNED script) to appear in the script string.
+ /// Retrieve "Qaii" (INHERITED) and "Zyyy" (COMMON) script information. This flag does not affect the processing of unassigned
+ /// characters. These characters in the input string always cause a "Zzzz" (UNASSIGNED script) to appear in the script string.
///
///
///
- /// By default, GetStringScripts ignores any inherited or common characters in the input string indicated by lpString. If
- /// GSS_ALLOW_INHERITED_COMMON is not set, neither "Qaii" nor "Zyyy" appears in the script string, even if the input string contains such characters. If
- /// GSS_ALLOW_INHERITED_COMMON is set, and if the input string contains inherited and/or common characters, "Qaii" and/or "Zyyy", respectively, appear in
- /// the script string. See the Remarks section.
+ /// By default, GetStringScripts ignores any inherited or common characters in the input string indicated by
+ /// lpString. If GSS_ALLOW_INHERITED_COMMON is not set, neither "Qaii" nor "Zyyy" appears in the script string, even if the input
+ /// string contains such characters. If GSS_ALLOW_INHERITED_COMMON is set, and if the input string contains inherited and/or common
+ /// characters, "Qaii" and/or "Zyyy", respectively, appear in the script string. See the Remarks section.
///
///
/// Pointer to the Unicode string to analyze.
///
- /// Size, in characters, of the Unicode string indicated by lpString. The application sets this parameter to -1 if the Unicode string is null-terminated.
- /// If the application sets this parameter to 0, the function retrieves a null Unicode string (L"\0") in lpScripts and returns 1.
+ /// Size, in characters, of the Unicode string indicated by lpString. The application sets this parameter to -1 if the Unicode string
+ /// is null-terminated. If the application sets this parameter to 0, the function retrieves a null Unicode string (L"\0") in
+ /// lpScripts and returns 1.
///
///
///
- /// Pointer to a buffer in which this function retrieves a null-terminated string representing a list of scripts, using the 4-character notation used in
- /// ISO 15924. Each script name consists of four Latin characters, and the names are retrieved in alphabetical order. Each name, including the last, is
- /// followed by a semicolon.
+ /// Pointer to a buffer in which this function retrieves a null-terminated string representing a list of scripts, using the
+ /// 4-character notation used in ISO 15924. Each script name consists of four Latin characters, and the names are retrieved in
+ /// alphabetical order. Each name, including the last, is followed by a semicolon.
///
///
- /// Alternatively, this parameter contains NULL if cchScripts is set to 0. In this case, the function returns the required size for the script buffer.
+ /// Alternatively, this parameter contains NULL if cchScripts is set to 0. In this case, the function returns the required
+ /// size for the script buffer.
///
///
///
/// Size, in characters, of the script buffer indicated by lpScripts.
///
- /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpScripts and returns the required
- /// size for the script buffer.
+ /// Alternatively, the application can set this parameter to 0. In this case, the function retrieves NULL in lpScripts and
+ /// returns the required size for the script buffer.
///
///
///
///
- /// Returns the number of characters retrieved in the output buffer, including a terminating null character, if successful and cchScripts is set to a
- /// nonzero value. The function returns 1 to indicate that no script has been found, for example, when the input string only contains COMMON or INHERITED
- /// characters and GSS_ALLOW_INHERITED_COMMON is not set. Given that each found script adds five characters (four characters + delimiter), a simple
- /// mathematical operation provides the script count as (return_code - 1) / 5.
+ /// Returns the number of characters retrieved in the output buffer, including a terminating null character, if successful and
+ /// cchScripts is set to a nonzero value. The function returns 1 to indicate that no script has been found, for example, when the
+ /// input string only contains COMMON or INHERITED characters and GSS_ALLOW_INHERITED_COMMON is not set. Given that each found script
+ /// adds five characters (four characters + delimiter), a simple mathematical operation provides the script count as (return_code -
+ /// 1) / 5.
///
///
- /// If the function succeeds and the value of cchScripts is 0, the function returns the required size, in characters including a terminating null
- /// character, for the script buffer. The script count is as described above.
+ /// If the function succeeds and the value of cchScripts is 0, the function returns the required size, in characters including a
+ /// terminating null character, for the script buffer. The script count is as described above.
///
///
- /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int GetStringScripts( _In_ DWORD dwFlags, _In_ LPCWSTR lpString, _In_ int cchString, _Out_opt_ LPWSTR lpScripts, _In_ int cchScripts); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318116(v=vs.85).aspx
+ // int GetStringScripts( _In_ DWORD dwFlags, _In_ LPCWSTR lpString, _In_ int cchString, _Out_opt_ LPWSTR lpScripts, _In_ int
+ // cchScripts); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318116(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318116")]
public static extern int GetStringScripts(GetStringScriptsFlag dwFlags, string lpString, int cchString, [Out] StringBuilder lpScripts, int cchScripts);
@@ -2745,9 +3236,9 @@ namespace Vanara.PInvoke
/// Returns the language identifier for the system locale.
///
///
- /// Returns the language identifier for the system locale. This is the language used when displaying text in programs that do not support Unicode. It is
- /// set by the Administrator under Control Panel > Clock, Language, and Region > Change date, time, or number formats >
- /// Administrative tab.
+ /// Returns the language identifier for the system locale. This is the language used when displaying text in programs that do not
+ /// support Unicode. It is set by the Administrator under Control Panel > Clock, Language, and Region > Change
+ /// date, time, or number formats > Administrative tab.
///
/// For more information on language identifiers, see Language Identifier Constants and Strings.
///
@@ -2766,14 +3257,16 @@ namespace Vanara.PInvoke
/// Retrieves the system default locale name.
/// Pointer to a buffer in which this function retrieves the locale name.
///
- /// Size, in characters, of the output buffer indicated by lpLocaleName. The maximum possible character length of a locale name (including a terminating
- /// null character) is the value of LOCALE_NAME_MAX_LENGTH. This is the recommended size.
+ /// Size, in characters, of the output buffer indicated by lpLocaleName. The maximum possible character length of a locale name
+ /// (including a terminating null character) is the value of LOCALE_NAME_MAX_LENGTH. This is the recommended size.
///
///
- /// Returns a value greater than 0 that indicates the length of the locale name, including the terminating null character, if successful.
///
- /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// Returns a value greater than 0 that indicates the length of the locale name, including the terminating null character, if successful.
+ ///
+ ///
+ /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int GetSystemDefaultLocaleName( _Out_ LPWSTR lpLocaleName, _In_ int cchLocaleName); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318122(v=vs.85).aspx
@@ -2782,10 +3275,12 @@ namespace Vanara.PInvoke
public static extern int GetSystemDefaultLocaleName([Out] StringBuilder lpLocaleName, int cchLocaleName);
///
- /// Retrieves the language identifier for the system default UI language of the operating system, also known as the "install language" on Windows Vista
- /// and later. For more information, see User Interface Language Management.
+ /// Retrieves the language identifier for the system default UI language of the operating system, also known as the "install
+ /// language" on Windows Vista and later. For more information, see User Interface Language Management.
///
- /// Returns the language identifier for the system default UI language of the operating system. For more information, see the Remarks section.
+ ///
+ /// Returns the language identifier for the system default UI language of the operating system. For more information, see the Remarks section.
+ ///
// LANGID GetSystemDefaultUILanguage(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318123(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318123")]
@@ -2794,8 +3289,8 @@ namespace Vanara.PInvoke
/// Retrieves the system preferred UI languages. For more information, see User Interface Language Management.
///
///
- /// Flags identifying language format and filtering. The following flags specify the format to use for the system preferred UI languages. The flags are
- /// mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying language format and filtering. The following flags specify the format to use for the system preferred UI
+ /// languages. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
///
///
///
@@ -2814,8 +3309,8 @@ namespace Vanara.PInvoke
///
///
///
- /// The following flag specifies whether the function is to validate the list of languages (default) or retrieve the system preferred UI languages list
- /// exactly as it is stored in the registry.
+ /// The following flag specifies whether the function is to validate the list of languages (default) or retrieve the system preferred
+ /// UI languages list exactly as it is stored in the registry.
///
///
///
@@ -2826,9 +3321,10 @@ namespace Vanara.PInvoke
/// -
/// MUI_MACHINE_LANGUAGE_SETTINGS
///
- /// Retrieve the stored system preferred UI languages list, checking only to ensure that each language name corresponds to a valid NLS locale. If this
- /// flag is not set, the function retrieves the system preferred UI languages in pwszLanguagesBuffer, as long as the list is non-empty and meets the
- /// validation criteria. Otherwise, the function retrieves the system default user interface language in the language buffer.
+ /// Retrieve the stored system preferred UI languages list, checking only to ensure that each language name corresponds to a valid
+ /// NLS locale. If this flag is not set, the function retrieves the system preferred UI languages in pwszLanguagesBuffer, as long as
+ /// the list is non-empty and meets the validation criteria. Otherwise, the function retrieves the system default user interface
+ /// language in the language buffer.
///
///
///
@@ -2837,33 +3333,33 @@ namespace Vanara.PInvoke
/// Pointer to the number of languages retrieved in pwszLanguagesBuffer.
///
///
- /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited system preferred UI languages list, in the format specified
- /// by dwFlags. This list ends with two null characters.
+ /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited system preferred UI languages list, in
+ /// the format specified by dwFlags. This list ends with two null characters.
///
///
- /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer. The required size includes the two null characters
+ /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer. The required size includes the two null characters
///
///
///
///
- /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the function, the parameter
- /// contains the size of the retrieved language buffer.
+ /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the
+ /// function, the parameter contains the size of the retrieved language buffer.
///
///
- /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer.
+ /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer.
///
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
/// If the function fails for any other reason, the parameters pulNumLanguages and pcchLanguagesBuffer are undefined.
///
- // BOOL GetSystemPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer, _Inout_ PULONG
- // pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318124(v=vs.85).aspx
+ // BOOL GetSystemPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer,
+ // _Inout_ PULONG pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318124(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318124")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -2873,9 +3369,9 @@ namespace Vanara.PInvoke
///
/// Returns the locale identifier of the locale associated with the current thread.
///
- /// Windows Vista: This function can return the identifier of a custom locale. If the current thread locale is a custom locale, the function
- /// returns LOCALE_CUSTOM_DEFAULT. If the current thread locale is a supplemental custom locale, the function can return LOCALE_CUSTOM_UNSPECIFIED. All
- /// supplemental locales share this locale identifier.
+ /// Windows Vista: This function can return the identifier of a custom locale. If the current thread locale is a custom
+ /// locale, the function returns LOCALE_CUSTOM_DEFAULT. If the current thread locale is a supplemental custom locale, the function
+ /// can return LOCALE_CUSTOM_UNSPECIFIED. All supplemental locales share this locale identifier.
///
///
// LCID GetThreadLocale(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318127(v=vs.85).aspx
@@ -2883,11 +3379,13 @@ namespace Vanara.PInvoke
[PInvokeData("Winnls.h", MSDNShortId = "dd318127")]
public static extern uint GetThreadLocale();
- /// Retrieves the thread preferred UI languages for the current thread. For more information, see User Interface Language Management.
+ ///
+ /// Retrieves the thread preferred UI languages for the current thread. For more information, see User Interface Language Management.
+ ///
///
///
- /// Flags identifying language format and filtering. The following flags specify the language format to use for the thread preferred UI languages. The
- /// flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying language format and filtering. The following flags specify the language format to use for the thread preferred
+ /// UI languages. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
///
///
///
@@ -2905,7 +3403,10 @@ namespace Vanara.PInvoke
///
///
///
- /// The following flags specify filtering for the function to use in retrieving the thread preferred UI languages. The default flag is MUI_MERGE_USER_FALLBACK.
+ ///
+ /// The following flags specify filtering for the function to use in retrieving the thread preferred UI languages. The default flag
+ /// is MUI_MERGE_USER_FALLBACK.
+ ///
///
///
///
@@ -2915,31 +3416,32 @@ namespace Vanara.PInvoke
/// -
/// MUI_MERGE_SYSTEM_FALLBACK
///
- /// Use the system fallback to retrieve a list that corresponds exactly to the language list used by the resource loader. This flag can be used only in
- /// combination with MUI_MERGE_USER_FALLBACK. Using the flags in combination alters the usual effect of MUI_MERGE_USER_FALLBACK by including fallback and
- /// neutral languages in the list.
+ /// Use the system fallback to retrieve a list that corresponds exactly to the language list used by the resource loader. This flag
+ /// can be used only in combination with MUI_MERGE_USER_FALLBACK. Using the flags in combination alters the usual effect of
+ /// MUI_MERGE_USER_FALLBACK by including fallback and neutral languages in the list.
///
///
/// -
/// MUI_MERGE_USER_FALLBACK
///
- /// Retrieve a composite list consisting of the thread preferred UI languages, followed by process preferred UI languages, followed by any user preferred
- /// UI languages that are distinct from these, followed by the system default UI language, if it is not already in the list. If the user preferred UI
- /// languages list is empty, the function retrieves the system preferred UI languages. This flag cannot be combined with MUI_THREAD_LANGUAGES.
+ /// Retrieve a composite list consisting of the thread preferred UI languages, followed by process preferred UI languages, followed
+ /// by any user preferred UI languages that are distinct from these, followed by the system default UI language, if it is not already
+ /// in the list. If the user preferred UI languages list is empty, the function retrieves the system preferred UI languages. This
+ /// flag cannot be combined with MUI_THREAD_LANGUAGES.
///
///
/// -
/// MUI_THREAD_LANGUAGES
///
- /// Retrieve only the thread preferred UI languages for the current thread, or an empty list if no preferred languages are set for the current thread.
- /// This flag cannot be combined with MUI_MERGE_USER_FALLBACK or MUI_MERGE_SYSTEM_FALLBACK.
+ /// Retrieve only the thread preferred UI languages for the current thread, or an empty list if no preferred languages are set for
+ /// the current thread. This flag cannot be combined with MUI_MERGE_USER_FALLBACK or MUI_MERGE_SYSTEM_FALLBACK.
///
///
/// -
/// MUI_UI_FALLBACK
///
- /// Retrieve a complete thread preferred UI languages list along with associated fallback and neutral languages. Use of this flag is equivalent to
- /// combining MUI_MERGE_SYSTEM_FALLBACK and MUI_MERGE_USER_FALLBACK. (Applicable only for Windows 7 and later).
+ /// Retrieve a complete thread preferred UI languages list along with associated fallback and neutral languages. Use of this flag is
+ /// equivalent to combining MUI_MERGE_SYSTEM_FALLBACK and MUI_MERGE_USER_FALLBACK. (Applicable only for Windows 7 and later).
///
///
///
@@ -2948,33 +3450,33 @@ namespace Vanara.PInvoke
/// Pointer to the number of languages retrieved in pwszLanguagesBuffer.
///
///
- /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited thread preferred UI languages list, in the format specified
- /// by dwFlags. This list ends with two null characters.
+ /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited thread preferred UI languages list, in
+ /// the format specified by dwFlags. This list ends with two null characters.
///
///
- /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer. The required size includes the two null characters.
+ /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer. The required size includes the two null characters.
///
///
///
///
- /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the function, the parameter
- /// contains the size of the retrieved language buffer.
+ /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the
+ /// function, the parameter contains the size of the retrieved language buffer.
///
///
- /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer.
+ /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer.
///
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// returns one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which returns one of the following error codes:
///
/// If the function fails for any other reason, the parameters pulNumLanguages and pcchLanguagesBuffer are undefined.
///
- // BOOL GetThreadPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer, _Inout_ PULONG
- // pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318128(v=vs.85).aspx
+ // BOOL GetThreadPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer,
+ // _Inout_ PULONG pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318128(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318128")]
[return: MarshalAs(UnmanagedType.Bool)]
@@ -2982,8 +3484,9 @@ namespace Vanara.PInvoke
/// Returns the language identifier of the first user interface language for the current thread.
///
- /// Returns the identifier for a language explicitly associated with the thread by SetThreadUILanguage or SetThreadPreferredUILanguages.
- /// Alternatively, if no language has been explicitly associated with the current thread, the identifier can indicate a user or system user interface language.
+ /// Returns the identifier for a language explicitly associated with the thread by SetThreadUILanguage or
+ /// SetThreadPreferredUILanguages. Alternatively, if no language has been explicitly associated with the current thread, the
+ /// identifier can indicate a user or system user interface language.
///
// LANGID GetThreadUILanguage(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318129(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
@@ -3011,32 +3514,34 @@ namespace Vanara.PInvoke
///
///
///
- /// Pointer to languages for which the function is to retrieve information. This parameter indicates an ordered, null-delimited list of language
- /// identifiers or language names, depending on the flag setting. For information on the use of this parameter, see the Remarks section.
+ /// Pointer to languages for which the function is to retrieve information. This parameter indicates an ordered, null-delimited list
+ /// of language identifiers or language names, depending on the flag setting. For information on the use of this parameter, see the
+ /// Remarks section.
///
///
///
- /// Pointer to a buffer in which this function retrieves an ordered, null-delimited list of fallback languages, formatted as defined by the setting for
- /// dwFlags. This list ends with two null characters.
+ /// Pointer to a buffer in which this function retrieves an ordered, null-delimited list of fallback languages, formatted as defined
+ /// by the setting for dwFlags. This list ends with two null characters.
///
///
- /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer. The required size includes the two null characters.
+ /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer. The required size includes the two null characters.
///
///
///
///
- /// Pointer to the size, in characters, for the language buffer indicated by pwszFallbackLanguages. On successful return from the function, the parameter
- /// contains the size of the retrieved language buffer.
+ /// Pointer to the size, in characters, for the language buffer indicated by pwszFallbackLanguages. On successful return from the
+ /// function, the parameter contains the size of the retrieved language buffer.
///
///
- /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer.
+ /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer.
///
///
///
///
- /// Pointer to flags indicating attributes of the input language list. The function always retrieves the flag characterizing the last language listed.
+ /// Pointer to flags indicating attributes of the input language list. The function always retrieves the flag characterizing the last
+ /// language listed.
///
///
///
@@ -3078,37 +3583,39 @@ namespace Vanara.PInvoke
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return the following error codes:
///
/// If GetLastError returns any other error code, the parameters pcchFallbackLanguages and pdwAttributes are undefined.
///
- // BOOL GetUILanguageInfo( _In_ DWORD dwFlags, _In_ PCZZWSTR pwmszLanguage, _Out_opt_ PZZWSTR pwszFallbackLanguages, _Inout_opt_ PDWORD
- // pcchFallbackLanguages, _Out_ PDWORD pdwAttributes); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318133(v=vs.85).aspx
+ // BOOL GetUILanguageInfo( _In_ DWORD dwFlags, _In_ PCZZWSTR pwmszLanguage, _Out_opt_ PZZWSTR pwszFallbackLanguages, _Inout_opt_
+ // PDWORD pcchFallbackLanguages, _Out_ PDWORD pdwAttributes); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318133(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318133")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetUILanguageInfo(MUI_LANGUAGE_ENUM dwFlags, IntPtr pwmszLanguage, IntPtr pwszFallbackLanguages, ref uint pcchFallbackLanguages, out MUI_LANGUAGE pdwAttributes);
///
- /// Retrieves the two-letter International Organization for Standardization (ISO) 3166-1 code or numeric United Nations (UN) Series M, Number 49 (M.49)
- /// code for the default geographical location of the user.
+ /// Retrieves the two-letter International Organization for Standardization (ISO) 3166-1 code or numeric United Nations (UN) Series
+ /// M, Number 49 (M.49) code for the default geographical location of the user.
///
///
- /// Pointer to a buffer in which this function should write the null-terminated two-letter ISO 3166-1 or numeric UN M.49 code for the default geographic
- /// location of the user.
+ /// Pointer to a buffer in which this function should write the null-terminated two-letter ISO 3166-1 or numeric UN M.49 code for the
+ /// default geographic location of the user.
///
///
- /// The size of the buffer that the geoName parameter specifies. If this value is zero, the function only returns the number of characters that function
- /// would copy to the output buffer, but does not write the name of the default geographic location of the user to the buffer.
+ /// The size of the buffer that the geoName parameter specifies. If this value is zero, the function only returns the number of
+ /// characters that function would copy to the output buffer, but does not write the name of the default geographic location of the
+ /// user to the buffer.
///
///
///
- /// The number of characters the function would copy to the output buffer, if the value of the geoNameCount parameter is zero. Otherwise, the number of
- /// characters that the function copied to the buffer that the geoName parameter specifies.
+ /// The number of characters the function would copy to the output buffer, if the value of the geoNameCount parameter is zero.
+ /// Otherwise, the number of characters that the function copied to the buffer that the geoName parameter specifies.
///
///
- /// Zero indicates that the function failed. To get extended error information, call GetLastError, which can return one of the following error codes:
+ /// Zero indicates that the function failed. To get extended error information, call GetLastError, which can return one of the
+ /// following error codes:
///
///
///
@@ -3139,8 +3646,8 @@ namespace Vanara.PInvoke
/// Returns the language identifier of the Region Format setting for the current user.
///
///
- /// Returns the language identifier for the current user as set under Control Panel > Clock, Language, and Region > Change date,
- /// time, or number formats > Formats tab > Format dropdown.
+ /// Returns the language identifier for the current user as set under Control Panel > Clock, Language, and Region
+ /// > Change date, time, or number formats > Formats tab > Format dropdown.
///
/// For more information on language identifiers, see Language Identifier Constants and Strings.
///
@@ -3151,9 +3658,9 @@ namespace Vanara.PInvoke
/// Returns the locale identifier for the user default locale.
///
- /// Returns the locale identifier for the user default locale, represented as LOCALE_USER_DEFAULT. If the user default locale is a custom locale, this
- /// function always returns LOCALE_CUSTOM_DEFAULT, regardless of the custom locale that is selected. For example, whether the user locale is Hawaiian
- /// (US), haw-US, or Fijiian (Fiji), fj-FJ, the function returns the same value.
+ /// Returns the locale identifier for the user default locale, represented as LOCALE_USER_DEFAULT. If the user default locale is a
+ /// custom locale, this function always returns LOCALE_CUSTOM_DEFAULT, regardless of the custom locale that is selected. For example,
+ /// whether the user locale is Hawaiian (US), haw-US, or Fijiian (Fiji), fj-FJ, the function returns the same value.
///
// LCID GetUserDefaultLCID(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318135(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
@@ -3163,14 +3670,14 @@ namespace Vanara.PInvoke
/// Retrieves the user default locale name.
/// Pointer to a buffer in which this function retrieves the locale name.
///
- /// Size, in characters, of the buffer indicated by lpLocaleName. The maximum possible length of a locale name, including a terminating null character,
- /// is LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply in this parameter.
+ /// Size, in characters, of the buffer indicated by lpLocaleName. The maximum possible length of a locale name, including a
+ /// terminating null character, is LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply in this parameter.
///
///
/// Returns the size of the buffer containing the locale name, including the terminating null character, if successful.
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int GetUserDefaultLocaleName( _Out_ LPWSTR lpLocaleName, _In_ int cchLocaleName); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318136(v=vs.85).aspx
@@ -3180,9 +3687,9 @@ namespace Vanara.PInvoke
///
/// Returns the language identifier for the user UI language for the current user. If the current user has not set a language,
- /// GetUserDefaultUILanguage returns the preferred language set for the system. If there is no preferred language set for the system, then the
- /// system default UI language (also known as "install language") is returned. For more information about the user UI language, see User Interface
- /// Language Management.
+ /// GetUserDefaultUILanguage returns the preferred language set for the system. If there is no preferred language set for the
+ /// system, then the system default UI language (also known as "install language") is returned. For more information about the user
+ /// UI language, see User Interface Language Management.
///
/// Returns the language identifier for the user UI language for the current user.
// LANGID GetUserDefaultUILanguage(void); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318137(v=vs.85).aspx
@@ -3192,8 +3699,8 @@ namespace Vanara.PInvoke
///
///
- /// [ GetUserGeoID is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in
- /// subsequent versions. Instead, use GetUserDefaultGeoName.]
+ /// [ GetUserGeoID is available for use in the operating systems specified in the Requirements section. It may be altered or
+ /// unavailable in subsequent versions. Instead, use GetUserDefaultGeoName.]
///
/// Retrieves information about the geographical location of the user. For more information, see Table of Geographical Locations.
///
@@ -3210,8 +3717,8 @@ namespace Vanara.PInvoke
/// Retrieves information about the user preferred UI languages. For more information, see User Interface Language Management.
///
///
- /// Flags identifying language format and filtering. The following flags specify the language format to use for the user preferred UI languages list. The
- /// flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying language format and filtering. The following flags specify the language format to use for the user preferred UI
+ /// languages list. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
///
///
///
@@ -3233,41 +3740,41 @@ namespace Vanara.PInvoke
/// Pointer to the number of languages retrieved in pwszLanguagesBuffer.
///
///
- /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited user preferred UI languages list, in the format specified
- /// by dwflags. This list ends with two null characters.
+ /// Optional. Pointer to a buffer in which this function retrieves an ordered, null-delimited user preferred UI languages list, in
+ /// the format specified by dwflags. This list ends with two null characters.
///
///
- /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer. The required size includes the two null characters.
+ /// Alternatively if this parameter is set to NULL and pcchLanguagesBuffer is set to 0, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer. The required size includes the two null characters.
///
///
///
///
- /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the function, the parameter
- /// contains the size of the retrieved language buffer.
+ /// Pointer to the size, in characters, for the language buffer indicated by pwszLanguagesBuffer. On successful return from the
+ /// function, the parameter contains the size of the retrieved language buffer.
///
///
- /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required size of the language
- /// buffer in pcchLanguagesBuffer.
+ /// Alternatively if this parameter is set to 0 and pwszLanguagesBuffer is set to NULL, the function retrieves the required
+ /// size of the language buffer in pcchLanguagesBuffer.
///
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return one of the following error codes:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
/// If the function fails for any other reason, the values of pulNumLanguages and pcchLanguagesBuffer are undefined.
///
- // BOOL GetUserPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer, _Inout_ PULONG
- // pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318139(v=vs.85).aspx
+ // BOOL GetUserPreferredUILanguages( _In_ DWORD dwFlags, _Out_ PULONG pulNumLanguages, _Out_opt_ PZZWSTR pwszLanguagesBuffer, _Inout_
+ // PULONG pcchLanguagesBuffer); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318139(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318139")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetUserPreferredUILanguages(MUI_LANGUAGE_ENUM dwFlags, out uint pulNumLanguages, IntPtr pwszLanguagesBuffer, ref uint pcchLanguagesBuffer);
///
- /// Converts an internationalized domain name (IDN) or another internationalized label to a Unicode (wide character) representation of the ASCII string
- /// that represents the name in the Punycode transfer encoding syntax.
+ /// Converts an internationalized domain name (IDN) or another internationalized label to a Unicode (wide character) representation
+ /// of the ASCII string that represents the name in the Punycode transfer encoding syntax.
///
///
/// Flags specifying conversion options. The following table lists the possible values.
@@ -3280,30 +3787,32 @@ namespace Vanara.PInvoke
/// -
/// IDN_ALLOW_UNASSIGNED
///
- /// Allow unassigned code points to be included in the input string. The default is to not allow unassigned code points, and fail with an extended error
- /// code of ERROR_INVALID_NAME.This flag allows the function to process characters that are not currently legal in IDNs, but might be legal in later
- /// versions of the IDNA standard. If your application encodes unassigned code points as Punycode, the resulting domain names should be illegal. Security
- /// can be compromised if a later version of IDNA makes these names legal or if an application filters out the illegal characters to try to create a
- /// legal domain name. For more information, see Handling Internationalized Domain Names (IDNs).
+ /// Allow unassigned code points to be included in the input string. The default is to not allow unassigned code points, and fail
+ /// with an extended error code of ERROR_INVALID_NAME.This flag allows the function to process characters that are not currently
+ /// legal in IDNs, but might be legal in later versions of the IDNA standard. If your application encodes unassigned code points as
+ /// Punycode, the resulting domain names should be illegal. Security can be compromised if a later version of IDNA makes these names
+ /// legal or if an application filters out the illegal characters to try to create a legal domain name. For more information, see
+ /// Handling Internationalized Domain Names (IDNs).
///
///
/// -
/// IDN_USE_STD3_ASCII_RULES
///
- /// Filter out ASCII characters that are not allowed in STD3 names. The only ASCII characters allowed in the input Unicode string are letters, digits,
- /// and the hyphen-minus. The string cannot begin or end with the hyphen-minus. The function fails if the input Unicode string contains ASCII characters,
- /// such as "[", "]", or "/", that cannot occur in domain names.The function fails if the input
- /// Unicode string contains control characters (U+0001 through U+0020) or the "delete" character (U+007F). In either case, this flag
- /// has no effect on the non-ASCII characters that are allowed in the Unicode string.
+ /// Filter out ASCII characters that are not allowed in STD3 names. The only ASCII characters allowed in the input Unicode string are
+ /// letters, digits, and the hyphen-minus. The string cannot begin or end with the hyphen-minus. The function fails if the input
+ /// Unicode string contains ASCII characters, such as "[", "]", or "/", that
+ /// cannot occur in domain names.The function fails if the input Unicode string contains control characters (U+0001 through U+0020)
+ /// or the "delete" character (U+007F). In either case, this flag has no effect on the non-ASCII characters that
+ /// are allowed in the Unicode string.
///
///
/// -
/// IDN_EMAIL_ADDRESS
///
- /// Starting with Windows 8: Enable EAI algorithmic fallback for the local parts of email addresses (such as <local>@microsoft.com). The
- /// default is for this function to fail when an email address has an invalid address or syntax.An application can set this flag to enable Email Address
- /// Internationalization (EAI) to return a discoverable fallback address, if possible. For more information, see the IETF Email Address
- /// Internationalization (eai) Charter.
+ /// Starting with Windows 8: Enable EAI algorithmic fallback for the local parts of email addresses (such as
+ /// <local>@microsoft.com). The default is for this function to fail when an email address has an invalid address or
+ /// syntax.An application can set this flag to enable Email Address Internationalization (EAI) to return a discoverable fallback
+ /// address, if possible. For more information, see the IETF Email Address Internationalization (eai) Charter.
///
///
/// -
@@ -3316,111 +3825,118 @@ namespace Vanara.PInvoke
/// Pointer to a Unicode string representing an IDN or another internationalized label.
/// Count of characters in the input Unicode string indicated by lpUnicodeCharStr.
///
- /// Pointer to a buffer that receives a Unicode string consisting only of characters in the ASCII character set. On return from this function, the buffer
- /// contains the ASCII string equivalent of the string provided in lpUnicodeCharStr under Punycode. Alternatively, the function can retrieve NULL
- /// for this parameter, if cchASCIIChar is set to 0. In this case, the function returns the size required for this buffer.
+ /// Pointer to a buffer that receives a Unicode string consisting only of characters in the ASCII character set. On return from this
+ /// function, the buffer contains the ASCII string equivalent of the string provided in lpUnicodeCharStr under Punycode.
+ /// Alternatively, the function can retrieve NULL for this parameter, if cchASCIIChar is set to 0. In this case, the function
+ /// returns the size required for this buffer.
///
///
/// Size of the buffer indicated by lpASCIICharStr. The application can set the parameter to 0 to retrieve NULL in lpASCIICharStr.
///
///
///
- /// Returns the number of characters retrieved in lpASCIICharStr if successful. The retrieved string is null-terminated only if the input Unicode string
- /// is null-terminated.
+ /// Returns the number of characters retrieved in lpASCIICharStr if successful. The retrieved string is null-terminated only if the
+ /// input Unicode string is null-terminated.
///
///
- /// If the function succeeds and the value of cchASCIIChar is 0, the function returns the required size, in characters including a terminating null
- /// character if it was part of the input buffer.
+ /// If the function succeeds and the value of cchASCIIChar is 0, the function returns the required size, in characters including a
+ /// terminating null character if it was part of the input buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int IdnToAscii( _In_ DWORD dwFlags, _In_ LPCWSTR lpUnicodeCharStr, _In_ int cchUnicodeChar, _Out_opt_ LPWSTR lpASCIICharStr, _In_ int cchASCIIChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318149(v=vs.85).aspx
+ // int IdnToAscii( _In_ DWORD dwFlags, _In_ LPCWSTR lpUnicodeCharStr, _In_ int cchUnicodeChar, _Out_opt_ LPWSTR lpASCIICharStr, _In_
+ // int cchASCIIChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318149(v=vs.85).aspx
[DllImport(Lib.Normaliz, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318149")]
public static extern int IdnToAscii(IDN_FLAGS dwFlags, string lpUnicodeCharStr, int cchUnicodeChar, [Out] StringBuilder lpASCIICharStr, int cchASCIIChar);
///
- /// Converts an internationalized domain name (IDN) or another internationalized label to the NamePrep form specified by Network Working Group RFC 3491,
- /// but does not perform the additional conversion to Punycode. For more information and links to related draft standards, see Handling Internationalized
- /// Domain Names (IDNs).
+ /// Converts an internationalized domain name (IDN) or another internationalized label to the NamePrep form specified by Network
+ /// Working Group RFC 3491, but does not perform the additional conversion to Punycode. For more information and links to related
+ /// draft standards, see Handling Internationalized Domain Names (IDNs).
///
/// Flags specifying conversion options. For detailed definitions, see the dwFlags parameter of IdnToAscii.
/// Pointer to a Unicode string representing an IDN or another internationalized label.
/// Count of Unicode characters in the input Unicode string indicated by lpUnicodeCharStr.
///
- /// Pointer to a buffer that receives a version of the input Unicode string converted through NamePrep processing. Alternatively, the function can
- /// retrieve NULL for this parameter, if cchNameprepChar is set to 0. In this case, the function returns the size required for this buffer.
+ /// Pointer to a buffer that receives a version of the input Unicode string converted through NamePrep processing. Alternatively, the
+ /// function can retrieve NULL for this parameter, if cchNameprepChar is set to 0. In this case, the function returns the size
+ /// required for this buffer.
///
///
- /// Size, in characters, of the buffer indicated by lpNameprepCharStr. The application can set the size to 0 to retrieve NULL in lpNameprepCharStr
- /// and have the function return the required buffer size.
+ /// Size, in characters, of the buffer indicated by lpNameprepCharStr. The application can set the size to 0 to retrieve NULL
+ /// in lpNameprepCharStr and have the function return the required buffer size.
///
///
///
- /// Returns the number of characters retrieved in lpNameprepCharStr if successful. The retrieved string is null-terminated only if the input Unicode
- /// string is null-terminated.
+ /// Returns the number of characters retrieved in lpNameprepCharStr if successful. The retrieved string is null-terminated only if
+ /// the input Unicode string is null-terminated.
///
///
- /// If the function succeeds and the value of cchNameprepChar is 0, the function returns the required size, in characters including a terminating null
- /// character if it was part of the input buffer.
+ /// If the function succeeds and the value of cchNameprepChar is 0, the function returns the required size, in characters including a
+ /// terminating null character if it was part of the input buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int IdnToNameprepUnicode( _In_ DWORD dwFlags, _In_ LPCWSTR lpUnicodeCharStr, _In_ int cchUnicodeChar, _Out_opt_ LPWSTR lpNameprepCharStr, _In_ int
- // cchNameprepChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318150(v=vs.85).aspx
+ // int IdnToNameprepUnicode( _In_ DWORD dwFlags, _In_ LPCWSTR lpUnicodeCharStr, _In_ int cchUnicodeChar, _Out_opt_ LPWSTR
+ // lpNameprepCharStr, _In_ int cchNameprepChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318150(v=vs.85).aspx
[DllImport(Lib.Normaliz, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318150")]
public static extern int IdnToNameprepUnicode(IDN_FLAGS dwFlags, string lpUnicodeCharStr, int cchUnicodeChar, [Out] StringBuilder lpNameprepCharStr, int cchNameprepChar);
///
- /// Converts the Punycode form of an internationalized domain name (IDN) or another internationalized label to the normal Unicode UTF-16 encoding syntax.
+ /// Converts the Punycode form of an internationalized domain name (IDN) or another internationalized label to the normal Unicode
+ /// UTF-16 encoding syntax.
///
/// Flags specifying conversion options. For detailed definitions, see the dwFlags parameter of IdnToAscii.
///
- /// Pointer to a string representing the Punycode encoding of an IDN or another internationalized label. This string must consist only of ASCII
- /// characters, and can include Punycode-encoded Unicode. The function decodes Punycode values to their UTF-16 values.
+ /// Pointer to a string representing the Punycode encoding of an IDN or another internationalized label. This string must consist
+ /// only of ASCII characters, and can include Punycode-encoded Unicode. The function decodes Punycode values to their UTF-16 values.
///
/// Count of characters in the input string indicated by lpASCIICharStr.
///
- /// Pointer to a buffer that receives a normal Unicode UTF-16 encoding equivalent to the Punycode value of the input string. Alternatively, the function
- /// can retrieve NULL for this parameter, if cchUnicodeChar set to 0. In this case, the function returns the size required for this buffer.
+ /// Pointer to a buffer that receives a normal Unicode UTF-16 encoding equivalent to the Punycode value of the input string.
+ /// Alternatively, the function can retrieve NULL for this parameter, if cchUnicodeChar set to 0. In this case, the function
+ /// returns the size required for this buffer.
///
///
- /// Size, in characters, of the buffer indicated by lpUnicodeCharStr. The application can set the size to 0 to retrieve NULL in lpUnicodeCharStr
- /// and have the function return the required buffer size.
+ /// Size, in characters, of the buffer indicated by lpUnicodeCharStr. The application can set the size to 0 to retrieve NULL
+ /// in lpUnicodeCharStr and have the function return the required buffer size.
///
///
///
- /// Returns the number of characters retrieved in lpUnicodeCharStr if successful. The retrieved string is null-terminated only if the input string is null-terminated.
+ /// Returns the number of characters retrieved in lpUnicodeCharStr if successful. The retrieved string is null-terminated only if the
+ /// input string is null-terminated.
///
///
- /// If the function succeeds and the value of cchUnicodeChar is 0, the function returns the required size, in characters including a terminating null
- /// character if it was part of the input buffer.
+ /// If the function succeeds and the value of cchUnicodeChar is 0, the function returns the required size, in characters including a
+ /// terminating null character if it was part of the input buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int IdnToUnicode( _In_ DWORD dwFlags, _In_ LPCWSTR lpASCIICharStr, _In_ int cchASCIIChar, _Out_opt_ LPWSTR lpUnicodeCharStr, _In_ int cchUnicodeChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318151(v=vs.85).aspx
+ // int IdnToUnicode( _In_ DWORD dwFlags, _In_ LPCWSTR lpASCIICharStr, _In_ int cchASCIIChar, _Out_opt_ LPWSTR lpUnicodeCharStr, _In_
+ // int cchUnicodeChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318151(v=vs.85).aspx
[DllImport(Lib.Normaliz, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318151")]
public static extern int IdnToUnicode(IDN_FLAGS dwFlags, string lpASCIICharStr, int cchASCIIChar, [Out] StringBuilder lpUnicodeCharStr, int cchUnicodeChar);
///
- /// Determines if a specified character is a lead byte for the system default Windows ANSI code page ( CP_ACP). A lead byte is the first byte of a
- /// two-byte character in a double-byte character set (DBCS) for the code page.
+ /// Determines if a specified character is a lead byte for the system default Windows ANSI code page ( CP_ACP). A lead byte is
+ /// the first byte of a two-byte character in a double-byte character set (DBCS) for the code page.
///
/// The character to test.
///
- /// Returns a nonzero value if the test character is potentially a lead byte. The function returns 0 if the test character is not a lead byte or if it is
- /// a single-byte character. To get extended error information, the application can call GetLastError.
+ /// Returns a nonzero value if the test character is potentially a lead byte. The function returns 0 if the test character is not a
+ /// lead byte or if it is a single-byte character. To get extended error information, the application can call GetLastError.
///
// BOOL IsDBCSLeadByte( _In_ BYTE TestChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318664(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -3429,13 +3945,14 @@ namespace Vanara.PInvoke
public static extern bool IsDBCSLeadByte(byte TestChar);
///
- /// Determines if a specified character is potentially a lead byte. A lead byte is the first byte of a two-byte character in a double-byte character set
- /// (DBCS) for the code page.
+ /// Determines if a specified character is potentially a lead byte. A lead byte is the first byte of a two-byte character in a
+ /// double-byte character set (DBCS) for the code page.
///
///
///
- /// Identifier of the code page used to check lead byte ranges. This parameter can be one of the code page identifiers defined in Unicode and Character
- /// Set Constants or one of the following predefined values. This function validates lead byte values only in code pages 932, 936, 949, 950, and 1361.
+ /// Identifier of the code page used to check lead byte ranges. This parameter can be one of the code page identifiers defined in
+ /// Unicode and Character Set Constants or one of the following predefined values. This function validates lead byte values only in
+ /// code pages 932, 936, 949, 950, and 1361.
///
///
///
@@ -3464,8 +3981,8 @@ namespace Vanara.PInvoke
///
/// The character to test.
///
- /// Returns a nonzero value if the byte is a lead byte. The function returns 0 if the byte is not a lead byte or if the character is a single-byte
- /// character. To get extended error information, the application can call GetLastError.
+ /// Returns a nonzero value if the byte is a lead byte. The function returns 0 if the byte is not a lead byte or if the character is
+ /// a single-byte character. To get extended error information, the application can call GetLastError.
///
// BOOL IsDBCSLeadByteEx( _In_ UINT CodePage, _In_ BYTE TestChar); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318667(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -3477,41 +3994,46 @@ namespace Vanara.PInvoke
/// NLS capability to query. This value must be COMPARE_STRING. See the SYSNLS_FUNCTION enumeration.
/// Flags defining the function. Must be 0.
///
- /// Pointer to an NLSVERSIONINFO structure containing version information. Typically, the information is obtained by calling GetNLSVersion.
- /// The application sets this parameter to NULL if the function is to use the current version.
+ /// Pointer to an NLSVERSIONINFO structure containing version information. Typically, the information is obtained by calling
+ /// GetNLSVersion. The application sets this parameter to NULL if the function is to use the current version.
///
/// Pointer to the UTF-16 string to examine.
///
///
- /// Number of UTF-16 characters in the string indicated by lpString. This count can include a terminating null character. If the terminating null
- /// character is included in the character count, it does not affect the checking behavior because the terminating null character is always defined.
+ /// Number of UTF-16 characters in the string indicated by lpString. This count can include a terminating null character. If the
+ /// terminating null character is included in the character count, it does not affect the checking behavior because the terminating
+ /// null character is always defined.
+ ///
+ ///
+ /// The application should supply -1 to indicate that the string is null-terminated. In this case, the function itself calculates the
+ /// string length.
///
- /// The application should supply -1 to indicate that the string is null-terminated. In this case, the function itself calculates the string length.
///
///
- /// Returns TRUE if successful, only if the input string is valid, or FALSE otherwise. To get extended error information, the application
- /// can call GetLastError, which can return one of the following error codes:
+ /// Returns TRUE if successful, only if the input string is valid, or FALSE otherwise. To get extended error
+ /// information, the application can call GetLastError, which can return one of the following error codes:
///
- // BOOL IsNLSDefinedString( _In_ NLS_FUNCTION Function, _In_ DWORD dwFlags, _In_ LPNLSVERSIONINFO lpVersionInformation, _In_ LPCWSTR lpString, _In_ INT
- // cchStr); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318669(v=vs.85).aspx
+ // BOOL IsNLSDefinedString( _In_ NLS_FUNCTION Function, _In_ DWORD dwFlags, _In_ LPNLSVERSIONINFO lpVersionInformation, _In_ LPCWSTR
+ // lpString, _In_ INT cchStr); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318669(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318669")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsNLSDefinedString(SYSNLS_FUNCTION Function, [Optional] uint dwFlags, ref NLSVERSIONINFO lpVersionInformation, string lpString, int cchStr);
///
- /// Verifies that a string is normalized according to Unicode 4.0 TR#15. For more information, see Using Unicode Normalization to Represent Strings.
+ /// Verifies that a string is normalized according to Unicode 4.0 TR#15. For more information, see Using Unicode Normalization to
+ /// Represent Strings.
///
/// Normalization form to use. NORM_FORM specifies the standard Unicode normalization forms.
/// Pointer to the string to test.
///
- /// Length, in characters, of the input string, including a null terminating character. If this value is -1, the function assumes the string to be
- /// null-terminated and calculates the length automatically.
+ /// Length, in characters, of the input string, including a null terminating character. If this value is -1, the function assumes the
+ /// string to be null-terminated and calculates the length automatically.
///
///
///
- /// Returns TRUE if the input string is already normalized to the appropriate form, or FALSE otherwise. To get extended error information,
- /// the application can call GetLastError, which can return one of the following error codes:
+ /// Returns TRUE if the input string is already normalized to the appropriate form, or FALSE otherwise. To get extended
+ /// error information, the application can call GetLastError, which can return one of the following error codes:
///
/// If you need to reliably determine FALSE from an error condition, then it must call SetLastError(ERROR_SUCCESS).
///
@@ -3530,10 +4052,14 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool IsValidCodePage(uint CodePage);
- /// Determines if a language group is installed or supported on the operating system. For more information, see NLS Terminology.
+ ///
+ /// Determines if a language group is installed or supported on the operating system. For more information, see NLS Terminology.
+ ///
/// Identifier of language group to validate. This parameter can have one of the following values:
///
- /// Flag specifying the validity test to apply to the language group identifier. This parameter can be set to one of the following values.
+ ///
+ /// Flag specifying the validity test to apply to the language group identifier. This parameter can be set to one of the following values.
+ ///
///
///
///
@@ -3560,14 +4086,16 @@ namespace Vanara.PInvoke
///
///
- /// [ IsValidLocale is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in
- /// subsequent versions. Instead, use IsValidLocaleName to determine the validity of a supplemental locale.]
+ /// [ IsValidLocale is available for use in the operating systems specified in the Requirements section. It may be altered or
+ /// unavailable in subsequent versions. Instead, use IsValidLocaleName to determine the validity of a supplemental locale.]
+ ///
+ ///
+ /// Determines if the specified locale is installed or supported on the operating system. For more information, see Locales and Languages.
///
- /// Determines if the specified locale is installed or supported on the operating system. For more information, see Locales and Languages.
///
///
- /// Locale identifier of the locale to validate. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier of the locale to validate. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
///
/// Flag specifying the validity test to apply to the locale identifier. This parameter can have one of the following values.
@@ -3588,14 +4116,16 @@ namespace Vanara.PInvoke
/// -
/// 0x39
///
- /// Do not use. Instead, use LCID_INSTALLED.Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP and Windows 2000: Setting dwFlags to 0x39
- /// is a special case that can behave like LCID_INSTALLED for some locales on some versions of Windows.
+ /// Do not use. Instead, use LCID_INSTALLED.Windows Server 2008, Windows Vista, Windows Server 2003, Windows XP and Windows 2000:
+ /// Setting dwFlags to 0x39 is a special case that can behave like LCID_INSTALLED for some locales on some versions of Windows.
///
///
///
///
///
- /// Returns a nonzero value if the locale identifier passes the specified validity test. The function returns 0 if it does not succeed.
+ ///
+ /// Returns a nonzero value if the locale identifier passes the specified validity test. The function returns 0 if it does not succeed.
+ ///
// BOOL IsValidLocale( _In_ LCID Locale, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318679(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318679")]
@@ -3626,17 +4156,23 @@ namespace Vanara.PInvoke
/// Converts a locale identifier to a locale name.
///
///
- /// Locale identifier to translate. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
+ /// Locale identifier to translate. You can use the MAKELCID macro to create a locale identifier or use one of the following
+ /// predefined values.
///
/// Windows Vista: The following custom locale identifiers are also supported.
///
- /// Pointer to a buffer in which this function retrieves the locale name, or one of the following predefined values.
+ ///
+ /// Pointer to a buffer in which this function retrieves the locale name, or one of the following predefined values.
+ ///
///
///
- /// Size, in characters, of the locale name buffer. The maximum possible length of a locale name, including a terminating null character, is
- /// LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply for this parameter.
+ /// Size, in characters, of the locale name buffer. The maximum possible length of a locale name, including a terminating null
+ /// character, is LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply for this parameter.
+ ///
+ ///
+ /// Alternatively, the application can set this parameter to 0. In this case, the function returns the required size for the locale
+ /// name buffer.
///
- /// Alternatively, the application can set this parameter to 0. In this case, the function returns the required size for the locale name buffer.
///
///
/// Before Windows 7: Reserved; should always be 0.
@@ -3644,12 +4180,13 @@ namespace Vanara.PInvoke
///
///
///
- /// Returns the count of characters, including the terminating null character, in the locale name if successful. If the function succeeds and the value
- /// of cchName is 0, the return value is the required size, in characters (including nulls), for the locale name buffer.
+ /// Returns the count of characters, including the terminating null character, in the locale name if successful. If the function
+ /// succeeds and the value of cchName is 0, the return value is the required size, in characters (including nulls), for the locale
+ /// name buffer.
///
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int LCIDToLocaleName( _In_ LCID Locale, _Out_opt_ LPWSTR lpName, _In_ int cchName, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318698(v=vs.85).aspx
@@ -3658,76 +4195,82 @@ namespace Vanara.PInvoke
public static extern int LCIDToLocaleName(uint Locale, [Out] StringBuilder lpName, int cchName, LCTYPE dwFlags);
///
- /// For a locale specified by identifier, maps one input character string to another using a specified transformation, or generates a sort key for the
- /// input string.
+ /// For a locale specified by identifier, maps one input character string to another using a specified transformation, or generates a
+ /// sort key for the input string.
///
///
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
/// The following custom locale identifiers are also supported.
///
///
- /// Flags specifying the type of transformation to use during string mapping or the type of sort key to generate. For detailed definitions, see the
- /// dwMapFlags parameter of LCMapStringEx.
+ /// Flags specifying the type of transformation to use during string mapping or the type of sort key to generate. For detailed
+ /// definitions, see the dwMapFlags parameter of LCMapStringEx.
+ ///
+ ///
+ /// Pointer to a source string that the function maps or uses for sort key generation. This string cannot have a size of 0.
///
- /// Pointer to a source string that the function maps or uses for sort key generation. This string cannot have a size of 0.
///
///
- /// Size, in characters, of the source string indicated by lpSrcStr. The size of the source string can include the terminating null character, but does
- /// not have to. If the terminating null character is included, the mapping behavior of the function is not greatly affected because the terminating null
- /// character is considered to be unsortable and always maps to itself.
+ /// Size, in characters, of the source string indicated by lpSrcStr. The size of the source string can include the terminating null
+ /// character, but does not have to. If the terminating null character is included, the mapping behavior of the function is not
+ /// greatly affected because the terminating null character is considered to be unsortable and always maps to itself.
///
///
- /// The application can set the parameter to any negative value to specify that the source string is null-terminated. In this case, if LCMapString
- /// is being used in its string-mapping mode, the function calculates the string length itself, and null-terminates the mapped string indicated by lpDestStr.
+ /// The application can set the parameter to any negative value to specify that the source string is null-terminated. In this case,
+ /// if LCMapString is being used in its string-mapping mode, the function calculates the string length itself, and
+ /// null-terminates the mapped string indicated by lpDestStr.
///
/// The application cannot set this parameter to 0.
///
///
- /// Pointer to a buffer in which this function retrieves the mapped string or a sort key. When the application uses this function to generate a sort key,
- /// the destination string can contain an odd number of bytes. The LCMAP_BYTEREV flag only reverses an even number of bytes. The last byte
- /// (odd-positioned) in the sort key is not reversed.
+ /// Pointer to a buffer in which this function retrieves the mapped string or a sort key. When the application uses this function to
+ /// generate a sort key, the destination string can contain an odd number of bytes. The LCMAP_BYTEREV flag only reverses an even
+ /// number of bytes. The last byte (odd-positioned) in the sort key is not reversed.
///
///
///
- /// Size, in characters, of the destination string indicated by lpDestStr. If the application is using the function for string mapping, it supplies a
- /// character count for this parameter. If space for a terminating null character is included in cchSrc, cchDest must also include space for a
- /// terminating null character.
+ /// Size, in characters, of the destination string indicated by lpDestStr. If the application is using the function for string
+ /// mapping, it supplies a character count for this parameter. If space for a terminating null character is included in cchSrc,
+ /// cchDest must also include space for a terminating null character.
///
///
- /// If the application is using the function to generate a sort key, it supplies a byte count for the size. This byte count must include space for the
- /// sort key 0x00 terminator.
+ /// If the application is using the function to generate a sort key, it supplies a byte count for the size. This byte count must
+ /// include space for the sort key 0x00 terminator.
///
///
- /// The application can set cchDest to 0. In this case, the function does not use the lpDestStr parameter and returns the required buffer size for the
- /// mapped string or sort key.
+ /// The application can set cchDest to 0. In this case, the function does not use the lpDestStr parameter and returns the required
+ /// buffer size for the mapped string or sort key.
///
///
///
///
- /// Returns the number of characters or bytes in the translated string or sort key, including a terminating null character, if successful. If the
- /// function succeeds and the value of cchDest is 0, the return value is the size of the buffer required to hold the translated string or sort key,
- /// including a terminating null character.
+ /// Returns the number of characters or bytes in the translated string or sort key, including a terminating null character, if
+ /// successful. If the function succeeds and the value of cchDest is 0, the return value is the size of the buffer required to hold
+ /// the translated string or sort key, including a terminating null character.
///
///
- /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int LCMapString( _In_ LCID Locale, _In_ DWORD dwMapFlags, _In_ LPCTSTR lpSrcStr, _In_ int cchSrc, _Out_opt_ LPTSTR lpDestStr, _In_ int cchDest); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318700(v=vs.85).aspx
+ // int LCMapString( _In_ LCID Locale, _In_ DWORD dwMapFlags, _In_ LPCTSTR lpSrcStr, _In_ int cchSrc, _Out_opt_ LPTSTR lpDestStr, _In_
+ // int cchDest); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318700(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318700")]
public static extern int LCMapString(uint Locale, uint dwMapFlags, [In] string lpSrcStr, int cchSrc, [Out] StringBuilder lpDestStr, int cchDest);
///
- /// For a locale specified by name, maps an input character string to another using a specified transformation, or generates a sort key for the input string.
+ /// For a locale specified by name, maps an input character string to another using a specified transformation, or generates a sort
+ /// key for the input string.
///
/// Pointer to a locale name, or one of the following predefined values.
///
///
- /// Flag specifying the type of transformation to use during string mapping or the type of sort key to generate. This parameter can have the following values.
+ /// Flag specifying the type of transformation to use during string mapping or the type of sort key to generate. This parameter can
+ /// have the following values.
///
///
///
@@ -3742,9 +4285,9 @@ namespace Vanara.PInvoke
/// -
/// LCMAP_FULLWIDTH
///
- /// Use Unicode (wide) characters where applicable. This flag and LCMAP_HALFWIDTH are mutually exclusive. With this flag, the mapping may use
- /// Normalization Form C even if an input character is already full-width. For example, the string "は゛" (which is already full-width)
- /// is normalized to "ば". See Unicode normalization forms.
+ /// Use Unicode (wide) characters where applicable. This flag and LCMAP_HALFWIDTH are mutually exclusive. With this flag, the mapping
+ /// may use Normalization Form C even if an input character is already full-width. For example, the string "は゛"
+ /// (which is already full-width) is normalized to "ば". See Unicode normalization forms.
///
///
/// -
@@ -3761,7 +4304,10 @@ namespace Vanara.PInvoke
///
/// -
/// LCMAP_LINGUISTIC_CASING
- /// Use linguistic rules for casing, instead of file system rules (default). This flag is valid with LCMAP_LOWERCASE or LCMAP_UPPERCASE only.
+ ///
+ /// Use linguistic rules for casing, instead of file system rules (default). This flag is valid with LCMAP_LOWERCASE or
+ /// LCMAP_UPPERCASE only.
+ ///
///
/// -
/// LCMAP_LOWERCASE
@@ -3769,13 +4315,15 @@ namespace Vanara.PInvoke
///
/// -
/// LCMAP_SIMPLIFIED_CHINESE
- /// Map traditional Chinese characters to simplified Chinese characters. This flag and LCMAP_TRADITIONAL_CHINESE are mutually exclusive.
+ ///
+ /// Map traditional Chinese characters to simplified Chinese characters. This flag and LCMAP_TRADITIONAL_CHINESE are mutually exclusive.
+ ///
///
/// -
/// LCMAP_SORTKEY
///
- /// Produce a normalized sort key. If the LCMAP_SORTKEY flag is not specified, the function performs string mapping. For details of sort key generation
- /// and string mapping, see the Remarks section.
+ /// Produce a normalized sort key. If the LCMAP_SORTKEY flag is not specified, the function performs string mapping. For details of
+ /// sort key generation and string mapping, see the Remarks section.
///
///
/// -
@@ -3784,7 +4332,9 @@ namespace Vanara.PInvoke
///
/// -
/// LCMAP_TRADITIONAL_CHINESE
- /// Map simplified Chinese characters to traditional Chinese characters. This flag and LCMAP_SIMPLIFIED_CHINESE are mutually exclusive.
+ ///
+ /// Map simplified Chinese characters to traditional Chinese characters. This flag and LCMAP_SIMPLIFIED_CHINESE are mutually exclusive.
+ ///
///
/// -
/// LCMAP_UPPERCASE
@@ -3793,8 +4343,8 @@ namespace Vanara.PInvoke
///
///
///
- /// The following flags can be used alone, with one another, or with the LCMAP_SORTKEY and/or LCMAP_BYTEREV flags. However, they cannot be combined with
- /// the other flags listed above.
+ /// The following flags can be used alone, with one another, or with the LCMAP_SORTKEY and/or LCMAP_BYTEREV flags. However, they
+ /// cannot be combined with the other flags listed above.
///
///
///
@@ -3833,13 +4383,15 @@ namespace Vanara.PInvoke
///
/// -
/// NORM_IGNOREKANATYPE
- /// Do not differentiate between hiragana and katakana characters. Corresponding hiragana and katakana characters compare as equal.
+ ///
+ /// Do not differentiate between hiragana and katakana characters. Corresponding hiragana and katakana characters compare as equal.
+ ///
///
/// -
/// NORM_IGNOREWIDTH
///
- /// Ignore the difference between half-width and full-width characters, for example, C a t == cat. The full-width form is a formatting distinction used
- /// in Chinese and Japanese scripts.
+ /// Ignore the difference between half-width and full-width characters, for example, C a t == cat. The full-width form is a
+ /// formatting distinction used in Chinese and Japanese scripts.
///
///
/// -
@@ -3857,41 +4409,45 @@ namespace Vanara.PInvoke
///
///
///
- /// Pointer to a source string that the function maps or uses for sort key generation. This string cannot have a size of 0.
+ ///
+ /// Pointer to a source string that the function maps or uses for sort key generation. This string cannot have a size of 0.
+ ///
///
///
- /// Size, in characters, of the source string indicated by lpSrcStr. The size of the source string can include the terminating null character, but does
- /// not have to. If the terminating null character is included, the mapping behavior of the function is not greatly affected because the terminating null
- /// character is considered to be unsortable and always maps to itself.
+ /// Size, in characters, of the source string indicated by lpSrcStr. The size of the source string can include the terminating null
+ /// character, but does not have to. If the terminating null character is included, the mapping behavior of the function is not
+ /// greatly affected because the terminating null character is considered to be unsortable and always maps to itself.
///
///
- /// The application can set this parameter to any negative value to specify that the source string is null-terminated. In this case, if
- /// LCMapStringEx is being used in its string-mapping mode, the function calculates the string length itself, and null-terminates the mapped
- /// string indicated by lpDestStr.
+ /// The application can set this parameter to any negative value to specify that the source string is null-terminated. In this case,
+ /// if LCMapStringEx is being used in its string-mapping mode, the function calculates the string length itself, and
+ /// null-terminates the mapped string indicated by lpDestStr.
///
/// The application cannot set this parameter to 0.
///
///
- /// Pointer to a buffer in which this function retrieves the mapped string or sort key. If the application specifies LCMAP_SORTKEY, the function stores a
- /// sort key in the buffer as an opaque array of byte values that can include embedded 0 bytes.
+ /// Pointer to a buffer in which this function retrieves the mapped string or sort key. If the application specifies LCMAP_SORTKEY,
+ /// the function stores a sort key in the buffer as an opaque array of byte values that can include embedded 0 bytes.
///
///
///
- /// Size, in characters, of the buffer indicated by lpDestStr. If the application is using the function for string mapping, it supplies a character count
- /// for this parameter. If space for a terminating null character is included in cchSrc, cchDest must also include space for a terminating null character.
+ /// Size, in characters, of the buffer indicated by lpDestStr. If the application is using the function for string mapping, it
+ /// supplies a character count for this parameter. If space for a terminating null character is included in cchSrc, cchDest must also
+ /// include space for a terminating null character.
///
///
- /// If the application is using the function to generate a sort key, it supplies a byte count for the size. This byte count must include space for the
- /// sort key 0x00 terminator.
+ /// If the application is using the function to generate a sort key, it supplies a byte count for the size. This byte count must
+ /// include space for the sort key 0x00 terminator.
///
///
- /// The application can set cchDest to 0. In this case, the function does not use the lpDestStr parameter and returns the required buffer size for the
- /// mapped string or sort key.
+ /// The application can set cchDest to 0. In this case, the function does not use the lpDestStr parameter and returns the required
+ /// buffer size for the mapped string or sort key.
///
///
///
///
- /// Pointer to an NLSVERSIONINFOEX structure that contains the version information about the relevant NLS capability; usually retrieved from GetNLSVersionEx.
+ /// Pointer to an NLSVERSIONINFOEX structure that contains the version information about the relevant NLS capability; usually
+ /// retrieved from GetNLSVersionEx.
///
/// Windows Vista, Windows 7: Reserved; must set to NULL.
///
@@ -3899,21 +4455,59 @@ namespace Vanara.PInvoke
/// Reserved; must be 0.
///
///
- /// Returns the number of characters or bytes in the translated string or sort key, including a terminating null character, if successful. If the
- /// function succeeds and the value of cchDest is 0, the return value is the size of the buffer required to hold the translated string or sort key,
- /// including a terminating null character if the input was null terminated.
+ /// Returns the number of characters or bytes in the translated string or sort key, including a terminating null character, if
+ /// successful. If the function succeeds and the value of cchDest is 0, the return value is the size of the buffer required to hold
+ /// the translated string or sort key, including a terminating null character if the input was null terminated.
///
///
- /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// This function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
- // int LCMapStringEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwMapFlags, _In_ LPCWSTR lpSrcStr, _In_ int cchSrc, _Out_opt_ LPWSTR lpDestStr, _In_ int
- // cchDest, _In_opt_ LPNLSVERSIONINFO lpVersionInformation, _In_opt_ LPVOID lpReserved, _In_opt_ LPARAM sortHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318702(v=vs.85).aspx
+ // int LCMapStringEx( _In_opt_ LPCWSTR lpLocaleName, _In_ DWORD dwMapFlags, _In_ LPCWSTR lpSrcStr, _In_ int cchSrc, _Out_opt_ LPWSTR
+ // lpDestStr, _In_ int cchDest, _In_opt_ LPNLSVERSIONINFO lpVersionInformation, _In_opt_ LPVOID lpReserved, _In_opt_ LPARAM
+ // sortHandle); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318702(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd318702")]
public static extern int LCMapStringEx(string lpLocaleName, uint dwMapFlags, string lpSrcStr, int cchSrc, [Out] StringBuilder lpDestStr, int cchDest, ref NLSVERSIONINFO lpVersionInformation, [Optional] IntPtr lpReserved, [Optional] IntPtr sortHandle);
+ ///
+ /// Unsupported. LoadStringByReference may be altered or unavailable. Instead, use SHLoadIndirectString.
+ ///
+ ///
+ /// Reserved.
+ ///
+ ///
+ /// The language.
+ ///
+ ///
+ /// The source string reference.
+ ///
+ ///
+ /// The buffer to receive the string.
+ ///
+ ///
+ /// The size of Buffer, in characters.
+ ///
+ ///
+ /// The directory path to SourceString.
+ ///
+ ///
+ /// The number of characters written to Buffer.
+ ///
+ ///
+ /// A BOOL datatype.
+ ///
+ ///
+ /// LoadStringByReference is not supported and may be altered or unavailable in the future. Instead, use SHLoadIndirectString.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/winnls/nf-winnls-loadstringbyreference BOOL LoadStringByReference( DWORD
+ // Flags, PCWSTR Language, PCWSTR SourceString, PWSTR Buffer, ULONG cchBuffer, PCWSTR Directory, PULONG pcchBufferOut );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)]
+ [PInvokeData("winnls.h", MSDNShortId = "4E0470ED-512F-4B76-A3E4-31C8B269CD5C")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool LoadStringByReference(uint Flags, string Language, string SourceString, StringBuilder Buffer, uint cchBuffer, string Directory, out uint pcchBufferOut);
+
/// Converts a locale name to a locale identifier.
/// Pointer to a null-terminated string representing a locale name, or one of the following predefined values.
///
@@ -3922,14 +4516,16 @@ namespace Vanara.PInvoke
///
///
///
- /// Returns the locale identifier corresponding to the locale name if successful. If the supplied locale name corresponds to a custom locale that is the
- /// user default, this function returns LOCALE_CUSTOM_DEFAULT. If the locale name corresponds to a custom locale that is not the user default, the
- /// function returns LOCALE_CUSTOM_UNSPECIFIED.
+ /// Returns the locale identifier corresponding to the locale name if successful. If the supplied locale name corresponds to a custom
+ /// locale that is the user default, this function returns LOCALE_CUSTOM_DEFAULT. If the locale name corresponds to a custom locale
+ /// that is not the user default, the function returns LOCALE_CUSTOM_UNSPECIFIED.
///
- /// If the locale provided is a transient locale or a CLDR (Unicode Common Locale Data Repository) locale, then the LCID returned is 0x1000.
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// If the locale provided is a transient locale or a CLDR (Unicode Common Locale Data Repository) locale, then the LCID returned is 0x1000.
+ ///
+ ///
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// LCID LocaleNameToLCID( _In_ LPCWSTR lpName, _In_ DWORD dwFlags); https://msdn.microsoft.com/en-us/library/windows/desktop/dd318711(v=vs.85).aspx
@@ -3939,14 +4535,14 @@ namespace Vanara.PInvoke
/// Creates a language identifier from a primary language identifier and a sublanguage identifier.
///
- /// Primary language identifier. This identifier can be a predefined value or a value for a user-defined primary language. For a user-defined language,
- /// the identifier is a value in the range 0x0200 to 0x03FF. All other values are reserved for operating system use. For more information, see Language
- /// Identifier Constants and Strings.
+ /// Primary language identifier. This identifier can be a predefined value or a value for a user-defined primary language. For a
+ /// user-defined language, the identifier is a value in the range 0x0200 to 0x03FF. All other values are reserved for operating
+ /// system use. For more information, see Language Identifier Constants and Strings.
///
///
- /// Sublanguage identifier. This parameter can be a predefined sublanguage identifier or a user-defined sublanguage. For a user-defined sublanguage, the
- /// identifier is a value in the range 0x20 to 0x3F. All other values are reserved for operating system use. For more information, see Language
- /// Identifier Constants and Strings.
+ /// Sublanguage identifier. This parameter can be a predefined sublanguage identifier or a user-defined sublanguage. For a
+ /// user-defined sublanguage, the identifier is a value in the range 0x20 to 0x3F. All other values are reserved for operating system
+ /// use. For more information, see Language Identifier Constants and Strings.
///
/// Returns the language identifier.
// WORD MAKELANGID( USHORT usPrimaryLanguage, USHORT usSubLanguage); https://msdn.microsoft.com/en-us/library/windows/desktop/dd373908(v=vs.85).aspx
@@ -3955,8 +4551,8 @@ namespace Vanara.PInvoke
/// Creates a locale identifier from a language identifier and a sort order identifier.
///
- /// Language identifier. This identifier is a combination of a primary language identifier and a sublanguage identifier and is usually created by using
- /// the MAKELANGID macro.
+ /// Language identifier. This identifier is a combination of a primary language identifier and a sublanguage identifier and is
+ /// usually created by using the MAKELANGID macro.
///
/// Sort order identifier.
/// Returns the locale identifier.
@@ -3966,8 +4562,8 @@ namespace Vanara.PInvoke
/// Constructs a locale identifier (LCID) from a language identifier, a sort order identifier, and the sort version.
///
- /// Language identifier. This parameter is a combination of a primary language identifier and a sublanguage identifier and is usually created by using
- /// the MAKELANGID macro.
+ /// Language identifier. This parameter is a combination of a primary language identifier and a sublanguage identifier and is usually
+ /// created by using the MAKELANGID macro.
///
/// Sort order identifier.
/// Reserved; must be 0.
@@ -3977,49 +4573,51 @@ namespace Vanara.PInvoke
public static uint MAKESORTLCID(ushort lgid, ushort srtid, ushort ver) => MAKELCID(lgid, srtid) | (((uint)ver & 0xf) << 20);
///
- /// Normalizes characters of a text string according to Unicode 4.0 TR#15. For more information, see Using Unicode Normalization to Represent Strings.
+ /// Normalizes characters of a text string according to Unicode 4.0 TR#15. For more information, see Using Unicode Normalization to
+ /// Represent Strings.
///
/// Normalization form to use. NORM_FORM specifies the standard Unicode normalization forms.
/// Pointer to the non-normalized source string.
///
- /// Length, in characters, of the buffer containing the source string. The application can set this parameter to -1 if the function should assume the
- /// string to be null-terminated and calculate the length automatically.
+ /// Length, in characters, of the buffer containing the source string. The application can set this parameter to -1 if the function
+ /// should assume the string to be null-terminated and calculate the length automatically.
///
///
- /// Pointer to a buffer in which the function retrieves the destination string. Alternatively, this parameter contains NULL if cwDstLength is set
- /// to 0.
+ /// Pointer to a buffer in which the function retrieves the destination string. Alternatively, this parameter contains NULL if
+ /// cwDstLength is set to 0.
///
///
- /// Length, in characters, of the buffer containing the destination string. Alternatively, the application can set this parameter to 0 to request the
- /// function to return the required size for the destination buffer.
+ /// Length, in characters, of the buffer containing the destination string. Alternatively, the application can set this parameter to
+ /// 0 to request the function to return the required size for the destination buffer.
///
///
///
- /// Returns the length of the normalized string in the destination buffer. If cwDstLength is set to 0, the function returns the estimated buffer length
- /// required to do the actual conversion.
+ /// Returns the length of the normalized string in the destination buffer. If cwDstLength is set to 0, the function returns the
+ /// estimated buffer length required to do the actual conversion.
///
///
- /// If the string in the input buffer is null-terminated or if cwSrcLength is -1, the string written to the destination buffer is null-terminated and the
- /// returned string length includes the terminating null character.
+ /// If the string in the input buffer is null-terminated or if cwSrcLength is -1, the string written to the destination buffer is
+ /// null-terminated and the returned string length includes the terminating null character.
///
///
- /// The function returns a value that is less than or equal to 0 if it does not succeed. To get extended error information, the application can call
- /// GetLastError, which can return one of the following error codes:
+ /// The function returns a value that is less than or equal to 0 if it does not succeed. To get extended error information, the
+ /// application can call GetLastError, which can return one of the following error codes:
///
///
- // int NormalizeString( _In_ NORM_FORM NormForm, _In_ LPCWSTR lpSrcString, _In_ int cwSrcLength, _Out_opt_ LPWSTR lpDstString, _In_ int cwDstLength); https://msdn.microsoft.com/en-us/library/windows/desktop/dd319093(v=vs.85).aspx
+ // int NormalizeString( _In_ NORM_FORM NormForm, _In_ LPCWSTR lpSrcString, _In_ int cwSrcLength, _Out_opt_ LPWSTR lpDstString, _In_
+ // int cwDstLength); https://msdn.microsoft.com/en-us/library/windows/desktop/dd319093(v=vs.85).aspx
[DllImport(Lib.Normaliz, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd319093")]
public static extern int NormalizeString(NORM_FORM NormForm, string lpSrcString, int cwSrcLength, [Out] StringBuilder lpDstString, int cwDstLength);
/// Extracts a primary language identifier from a language identifier.
///
- /// Language identifier. This value is a combination of a primary language identifier and a sublanguage identifier and is usually created by using the
- /// MAKELANGID macro.
+ /// Language identifier. This value is a combination of a primary language identifier and a sublanguage identifier and is usually
+ /// created by using the MAKELANGID macro.
///
///
- /// Returns the primary language identifier. It can be one of the predefined primary language identifiers or a user-defined primary language identifier.
- /// For more information, see MAKELANGID.
+ /// Returns the primary language identifier. It can be one of the predefined primary language identifiers or a user-defined primary
+ /// language identifier. For more information, see MAKELANGID.
///
// WORD PRIMARYLANGID( WORD lgid); https://msdn.microsoft.com/en-us/library/windows/desktop/dd319102(v=vs.85).aspx
[PInvokeData("Winnt.h", MSDNShortId = "dd319102")]
@@ -4028,18 +4626,18 @@ namespace Vanara.PInvoke
/// Finds a possible locale name match for the supplied name.
/// Pointer to a name to resolve, for example, "en-FJ" for English (Fiji).
///
- /// Pointer to a buffer in which this function retrieves the locale name that is the match for the input name. For example, the match for the name
- /// "en-FJ" is "en-US" for English (United States).
+ /// Pointer to a buffer in which this function retrieves the locale name that is the match for the input name. For example, the match
+ /// for the name "en-FJ" is "en-US" for English (United States).
///
///
- /// Size, in characters, of the buffer indicated by lpLocaleName. The maximum possible length of a locale name, including a terminating null character,
- /// is the value of LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply in this parameter.
+ /// Size, in characters, of the buffer indicated by lpLocaleName. The maximum possible length of a locale name, including a
+ /// terminating null character, is the value of LOCALE_NAME_MAX_LENGTH. This is the recommended size to supply in this parameter.
///
///
/// Returns the size of the buffer containing the locale name, including the terminating null character, if successful.
///
- /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError, which can return one
- /// of the following error codes:
+ /// The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError,
+ /// which can return one of the following error codes:
///
///
// int ResolveLocaleName( _In_opt_ LPCWSTR lpNameToResolve, _Out_opt_ LPWSTR lpLocaleName, _In_ int cchLocaleName); https://msdn.microsoft.com/en-us/library/windows/desktop/dd319112(v=vs.85).aspx
@@ -4051,28 +4649,28 @@ namespace Vanara.PInvoke
/// Sets an item of locale information for a calendar. For more information, see Date and Calendar.
///
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
/// The following custom locale identifiers are also supported.
///
/// Calendar identifier for the calendar for which to set information.
///
///
- /// Type of calendar information to set. Only the following CALTYPE values are valid for this function. The CAL_USE_CP_ACP constant is only meaningful
- /// for the ANSI version of the function.
+ /// Type of calendar information to set. Only the following CALTYPE values are valid for this function. The CAL_USE_CP_ACP constant
+ /// is only meaningful for the ANSI version of the function.
///
///
- /// The application can specify only one calendar identifier per call to this function. An exception can be made if the application uses the binary OR
- /// operator to combine CAL_USE_CP_ACP with any valid CALTYPE value defined in Calendar Type Information.
+ /// The application can specify only one calendar identifier per call to this function. An exception can be made if the application
+ /// uses the binary OR operator to combine CAL_USE_CP_ACP with any valid CALTYPE value defined in Calendar Type Information.
///
///
///
/// Pointer to a null-terminated calendar information string. The information must be in the format of the specified calendar type.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL SetCalendarInfo( _In_ LCID Locale, _In_ CALID Calendar, _In_ CALTYPE CalType, _In_ LPCTSTR lpCalData); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374048(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -4080,27 +4678,30 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetCalendarInfo(uint Locale, uint Calendar, CALTYPE CalType, [In] string lpCalData);
- /// Sets an item of information in the user override portion of the current locale. This function does not set the system defaults.
+ ///
+ /// Sets an item of information in the user override portion of the current locale. This function does not set the system defaults.
+ ///
///
///
- /// For the ANSI version of the function, the locale identifier of the locale with the code page used when interpreting the lpLCData information. For the
- /// Unicode version, this parameter is ignored.
+ /// For the ANSI version of the function, the locale identifier of the locale with the code page used when interpreting the lpLCData
+ /// information. For the Unicode version, this parameter is ignored.
///
/// You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
/// The following custom locale identifiers are also supported.
///
///
- /// Type of locale information to set. For valid constants see "Constants Used in the LCType Parameter of GetLocaleInfo, GetLocaleInfoEx, and
- /// SetLocaleInfo" section of Locale Information Constants. The application can specify only one value per call, but it can use the binary OR operator to
- /// combine LOCALE_USE_CP_ACP with any other constant.
+ /// Type of locale information to set. For valid constants see "Constants Used in the LCType Parameter of GetLocaleInfo,
+ /// GetLocaleInfoEx, and SetLocaleInfo" section of Locale Information Constants. The application can specify only one value per call,
+ /// but it can use the binary OR operator to combine LOCALE_USE_CP_ACP with any other constant.
///
///
- /// Pointer to a null-terminated string containing the locale information to set. The information must be in the format specific to the specified
- /// constant. The application uses a Unicode string for the Unicode version of the function, and an ANSI string for the ANSI version.
+ /// Pointer to a null-terminated string containing the locale information to set. The information must be in the format specific to
+ /// the specified constant. The application uses a Unicode string for the Unicode version of the function, and an ANSI string for the
+ /// ANSI version.
///
///
- /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call GetLastError, which can
- /// return one of the following error codes:
+ /// Returns a nonzero value if successful, or 0 otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
///
// BOOL SetLocaleInfo( _In_ LCID Locale, _In_ LCTYPE LCType, _In_ LPCTSTR lpLCData); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374049(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, CharSet = CharSet.Auto)]
@@ -4108,10 +4709,13 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetLocaleInfo(uint Locale, LCTYPE LCType, [In] string lpLCData);
- /// Sets the process preferred UI languages for the application process. For more information, see User Interface Language Management.
+ ///
+ /// Sets the process preferred UI languages for the application process. For more information, see User Interface Language Management.
+ ///
///
///
- /// Flags identifying the language format to use for the process preferred UI languages. The flags are mutually exclusive, and the default is MUI_LANGUAGE_NAME.
+ /// Flags identifying the language format to use for the process preferred UI languages. The flags are mutually exclusive, and the
+ /// default is MUI_LANGUAGE_NAME.
///
/// We recommend that you use MUI_LANGUAGE_NAME instead of MUI_LANGUAGE_ID.
///
@@ -4133,12 +4737,12 @@ namespace Vanara.PInvoke
///
///
///
- /// Pointer to a double null-terminated multi-string buffer that contains an ordered, null-delimited list in decreasing order of preference. If there are
- /// more than five languages in the buffer, the function only sets the first five valid languages.
+ /// Pointer to a double null-terminated multi-string buffer that contains an ordered, null-delimited list in decreasing order of
+ /// preference. If there are more than five languages in the buffer, the function only sets the first five valid languages.
///
///
- /// Alternatively, this parameter can contain NULL if no language list is required. In this case, the function clears the preferred UI languages
- /// for the process.
+ /// Alternatively, this parameter can contain NULL if no language list is required. In this case, the function clears the
+ /// preferred UI languages for the process.
///
///
///
@@ -4146,12 +4750,12 @@ namespace Vanara.PInvoke
///
///
///
- /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which
- /// can return the following error code:
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return the following error code:
///
///
- /// If the process preferred UI languages list is empty or if the languages specified for the process are not valid, the function succeeds and sets 0 in
- /// the pulNumLanguages parameter.
+ /// If the process preferred UI languages list is empty or if the languages specified for the process are not valid, the function
+ /// succeeds and sets 0 in the pulNumLanguages parameter.
///
///
// BOOL SetProcessPreferredUILanguages( _In_ DWORD dwFlags, _In_opt_ PCZZWSTR pwszLanguagesBuffer, _Out_opt_ PULONG pulNumLanguages); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374050(v=vs.85).aspx
@@ -4162,8 +4766,8 @@ namespace Vanara.PInvoke
/// Sets the current locale of the calling thread.
///
- /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following
- /// predefined values.
+ /// Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of
+ /// the following predefined values.
///
/// The function should return an LCID on success. This is the LCID of the previous thread locale.
// BOOL SetThreadLocale( _In_ LCID Locale); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374051(v=vs.85).aspx
@@ -4172,12 +4776,14 @@ namespace Vanara.PInvoke
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetThreadLocale(uint Locale);
- /// Sets the thread preferred UI languages for the current thread. For more information, see User Interface Language Management.
+ ///
+ /// Sets the thread preferred UI languages for the current thread. For more information, see User Interface Language Management.
+ ///
///
/// Flags identifying format and filtering for the languages to set.
///
- /// The following format flags specify the language format to use for the thread preferred UI languages. The flags are mutually exclusive, and the
- /// default is MUI_LANGUAGE_NAME.
+ /// The following format flags specify the language format to use for the thread preferred UI languages. The flags are mutually
+ /// exclusive, and the default is MUI_LANGUAGE_NAME.
///
/// We recommend that you use MUI_LANGUAGE_NAME instead of MUI_LANGUAGE_ID.
///
@@ -4209,41 +4815,44 @@ namespace Vanara.PInvoke
/// -
/// MUI_COMPLEX_SCRIPT_FILTER
///
- /// GetThreadPreferredUILanguages should replace with the appropriate fallback all languages having complex scripts. When this flag is specified, NULL
- /// must be passed for all other parameters.
+ /// GetThreadPreferredUILanguages should replace with the appropriate fallback all languages having complex scripts. When this flag
+ /// is specified, NULL must be passed for all other parameters.
///
///
/// -
/// MUI_CONSOLE_FILTER
///
- /// GetThreadPreferredUILanguages should replace with the appropriate fallback all languages that cannot display properly in a console window with the
- /// current operating system settings. When this flag is specified, NULL must be passed for all other parameters.
+ /// GetThreadPreferredUILanguages should replace with the appropriate fallback all languages that cannot display properly in a
+ /// console window with the current operating system settings. When this flag is specified, NULL must be passed for all other parameters.
///
///
/// -
/// MUI_RESET_FILTERS
///
- /// Reset the filtering for the language list by removing any other filter settings. When this flag is specified, NULL must be passed for all other
- /// parameters. After setting this flag, the application can call GetThreadPreferredUILanguages to retrieve the complete unfiltered list.
+ /// Reset the filtering for the language list by removing any other filter settings. When this flag is specified, NULL must be passed
+ /// for all other parameters. After setting this flag, the application can call GetThreadPreferredUILanguages to retrieve the
+ /// complete unfiltered list.
///
///
///
///
///
///
- /// Pointer to a double null-terminated multi-string buffer that contains an ordered, null-delimited list, in the format specified by dwFlags.
///
- /// To clear the thread preferred UI languages list, an application sets this parameter to a null string or an empty double null-terminated string. If an
- /// application clears a language list, it should specify either a format flag or 0 for the dwFlags parameter.
+ /// Pointer to a double null-terminated multi-string buffer that contains an ordered, null-delimited list, in the format specified by dwFlags.
///
///
- /// When the application specifies one of the filtering flags, it must set this parameter to NULL. In this case, the function succeeds, but does
- /// not reset the thread preferred languages.
+ /// To clear the thread preferred UI languages list, an application sets this parameter to a null string or an empty double
+ /// null-terminated string. If an application clears a language list, it should specify either a format flag or 0 for the dwFlags parameter.
+ ///
+ ///
+ /// When the application specifies one of the filtering flags, it must set this parameter to NULL. In this case, the function
+ /// succeeds, but does not reset the thread preferred languages.
///
///
///
- /// Pointer to the number of languages that the function has set in the thread preferred UI languages list. When the application specifies one of the
- /// filtering flags, the function must set this parameter to NULL.
+ /// Pointer to the number of languages that the function has set in the thread preferred UI languages list. When the application
+ /// specifies one of the filtering flags, the function must set this parameter to NULL.
///
/// Returns TRUE if the function succeeds or FALSE otherwise.
// BOOL SetThreadPreferredUILanguages( _In_ DWORD dwFlags, _In_opt_ PCZZWSTR pwszLanguagesBuffer, _Out_opt_ PULONG pulNumLanguages); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374052(v=vs.85).aspx
@@ -4255,31 +4864,34 @@ namespace Vanara.PInvoke
///
/// Sets the user interface language for the current thread.
///
- /// Windows Vista and later: This function cannot clear the thread preferred UI languages list. Your MUI application should call
- /// SetThreadPreferredUILanguages to clear the language list.
+ /// Windows Vista and later: This function cannot clear the thread preferred UI languages list. Your MUI application should
+ /// call SetThreadPreferredUILanguages to clear the language list.
///
///
- /// Windows XP: This function is limited to allowing the operating system to identify and set a value that is safe to use on the Windows console.
+ /// Windows XP: This function is limited to allowing the operating system to identify and set a value that is safe to use on
+ /// the Windows console.
///
///
///
/// Language identifier for the user interface language for the thread.
///
- /// Windows Vista and later: The application can specify a language identifier of 0 or a nonzero identifier. For more information, see the Remarks section.
+ /// Windows Vista and later: The application can specify a language identifier of 0 or a nonzero identifier. For more
+ /// information, see the Remarks section.
///
///
- /// Windows XP: The application can only set this parameter to 0. This setting causes the function to select the language that best supports the
- /// console display. For more information, see the Remarks section.
+ /// Windows XP: The application can only set this parameter to 0. This setting causes the function to select the language that
+ /// best supports the console display. For more information, see the Remarks section.
///
///
///
///
- /// Returns the input language identifier if successful. If the input identifier is nonzero, the function returns that value. If the language identifier
- /// is 0, the function always succeeds and returns the identifier of the language that best supports the Windows console. See the Remarks section.
+ /// Returns the input language identifier if successful. If the input identifier is nonzero, the function returns that value. If the
+ /// language identifier is 0, the function always succeeds and returns the identifier of the language that best supports the Windows
+ /// console. See the Remarks section.
///
///
- /// If the input language identifier is nonzero and the function fails, the return value differs from the input language identifier. To get extended
- /// error information, the application can call GetLastError.
+ /// If the input language identifier is nonzero and the function fails, the return value differs from the input language identifier.
+ /// To get extended error information, the application can call GetLastError.
///
///
// LANGID SetThreadUILanguage( _In_ LANGID LangId); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374053(v=vs.85).aspx
@@ -4289,19 +4901,25 @@ namespace Vanara.PInvoke
///
///
- /// [ SetUserGeoID is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in
- /// subsequent versions. Instead, use SetUserGeoName.]
+ /// [ SetUserGeoID is available for use in the operating systems specified in the Requirements section. It may be altered or
+ /// unavailable in subsequent versions. Instead, use SetUserGeoName.]
+ ///
+ ///
+ /// Sets the geographical location identifier for the user. This identifier should have one of the values described in Table of
+ /// Geographical Locations.
///
- /// Sets the geographical location identifier for the user. This identifier should have one of the values described in Table of Geographical Locations.
///
/// Identifier for the geographical location of the user.
///
/// Returns TRUE if successful or FALSE otherwise.
///
- /// Windows XP, Windows Server 2003: This function does not supply extended error information. Thus it is not appropriate for an application to
- /// call GetLastError after this function. If the application does call GetLastError, it can return a value set by some previously called function.
+ /// Windows XP, Windows Server 2003: This function does not supply extended error information. Thus it is not appropriate for
+ /// an application to call GetLastError after this function. If the application does call GetLastError, it can return a
+ /// value set by some previously called function.
+ ///
+ ///
+ /// If this function does not succeed, the application can call GetLastError, which can return one of the following error codes:
///
- /// If this function does not succeed, the application can call GetLastError, which can return one of the following error codes:
///
// BOOL SetUserGeoID( _In_ GEOID GeoId); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374055(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
@@ -4310,12 +4928,12 @@ namespace Vanara.PInvoke
public static extern bool SetUserGeoID(int GeoId);
///
- /// Sets the geographic location for the current user to the specified two-letter International Organization for Standardization (ISO) 3166-1 code or
- /// numeric United Nations (UN) Series M, Number 49 (M.49) code.
+ /// Sets the geographic location for the current user to the specified two-letter International Organization for Standardization
+ /// (ISO) 3166-1 code or numeric United Nations (UN) Series M, Number 49 (M.49) code.
///
///
- /// The two-letter ISO 3166-1 or numeric UN M.49 code for the geographic location to set for the current user. To get the codes that are available on the
- /// operating system, call EnumSystemGeoNames.
+ /// The two-letter ISO 3166-1 or numeric UN M.49 code for the geographic location to set for the current user. To get the codes that
+ /// are available on the operating system, call EnumSystemGeoNames.
///
/// Returns TRUE if successful or FALSE otherwise.
// BOOL WINAPI SetUserGeoName(_In_ PWSTR geoName); https://msdn.microsoft.com/en-us/library/windows/desktop/mt812045(v=vs.85).aspx
@@ -4328,11 +4946,47 @@ namespace Vanara.PInvoke
///
/// Language identifier. You can supply predefined values for this parameter, or create an identifier using the MAKELANGID macro.
///
- /// Returns a sublanguage identifier. This can be a predefined sublanguage identifier or a user-defined sublanguage identifier.
+ ///
+ /// Returns a sublanguage identifier. This can be a predefined sublanguage identifier or a user-defined sublanguage identifier.
+ ///
// WORD SUBLANGID( WORD lgid); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374066(v=vs.85).aspx
[PInvokeData("Winnt.h", MSDNShortId = "dd374066")]
public static ushort SUBLANGID(ushort lgid) => (ushort)(lgid >> 10);
+ ///
+ ///
+ /// Deprecated. Gets the day of the week that corresponds to a specified day and populates the DayOfWeek member in the
+ /// specified CALDATETIME structure with that value.
+ ///
+ ///
+ ///
+ ///
+ /// Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call
+ /// GetLastError, which can return one of the following error codes:
+ ///
+ ///
+ /// -
+ /// ERROR_DATE_OUT_OF_RANGE. The specified date was out of range.
+ ///
+ /// -
+ /// ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// This function does not have an associated header file or library file. The application can call LoadLibrary with the DLL
+ /// name (Kernel32.dll) to obtain a module handle. It can then call GetProcAddress with that module handle and the name of
+ /// this function to get the function address.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/intl/updatecalendardayofweek BOOL UpdateCalendarDayOfWeek( _Inout_ LPCALDATETIME
+ // lpCalDateTime );
+ [DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
+ [PInvokeData("", MSDNShortId = "b9ae250a-73bb-4ec2-bb0d-e1f8b25c173c")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool UpdateCalendarDayOfWeek(ref CALDATETIME lpCalDateTime);
+
/// Compares two enumerated lists of scripts.
///
/// Flags specifying script verification options.
@@ -4350,36 +5004,80 @@ namespace Vanara.PInvoke
///
///
///
- /// Pointer to the locale list, the enumerated list of scripts for a given locale. This list is typically populated by calling GetLocaleInfoEx
- /// with LCType set to LOCALE_SSCRIPTS.
+ /// Pointer to the locale list, the enumerated list of scripts for a given locale. This list is typically populated by calling
+ /// GetLocaleInfoEx with LCType set to LOCALE_SSCRIPTS.
///
///
- /// Size, in characters, of the string indicated by lpLocaleScripts. The application sets this parameter to -1 if the string is null-terminated. If this
- /// parameter is set to 0, the function fails.
+ /// Size, in characters, of the string indicated by lpLocaleScripts. The application sets this parameter to -1 if the string is
+ /// null-terminated. If this parameter is set to 0, the function fails.
+ ///
+ ///
+ /// Pointer to the test list, a second enumerated list of scripts. This list is typically populated by calling GetStringScripts.
///
- /// Pointer to the test list, a second enumerated list of scripts. This list is typically populated by calling GetStringScripts.
///
- /// Size, in characters, of the string indicated by lpTestScripts. The application sets this parameter to -1 if the string is null-terminated. If this
- /// parameter is set to 0, the function fails.
+ /// Size, in characters, of the string indicated by lpTestScripts. The application sets this parameter to -1 if the string is
+ /// null-terminated. If this parameter is set to 0, the function fails.
///
///
///
- /// Returns TRUE if the test list is non-empty and all items in the list are also included in the locale list. The function still returns
- /// TRUE if the locale list contains more scripts than the test list, but all the test list scripts must be contained in the locale list. If
- /// VS_ALLOW_LATIN is specified in dwFlags, the function behaves as if "Latn;" is always in the locale list.
+ /// Returns TRUE if the test list is non-empty and all items in the list are also included in the locale list. The function
+ /// still returns TRUE if the locale list contains more scripts than the test list, but all the test list scripts must be
+ /// contained in the locale list. If VS_ALLOW_LATIN is specified in dwFlags, the function behaves as if "Latn;" is always in the
+ /// locale list.
///
///
- /// In all other cases, the function returns FALSE. This return can indicate that the test list contains an item that is not in the locale list,
- /// or it can indicate an error. To distinguish between these two cases, the application should call GetLastError, which can return one of the
- /// following error codes:
+ /// In all other cases, the function returns FALSE. This return can indicate that the test list contains an item that is not
+ /// in the locale list, or it can indicate an error. To distinguish between these two cases, the application should call
+ /// GetLastError, which can return one of the following error codes:
///
///
- // BOOL VerifyScripts( _In_ DWORD dwFlags, _In_ LPCWSTR lpLocaleScripts, _In_ int cchLocaleScripts, _In_ LPCWSTR lpTestScripts, _In_ int cchTestScripts); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374129(v=vs.85).aspx
+ // BOOL VerifyScripts( _In_ DWORD dwFlags, _In_ LPCWSTR lpLocaleScripts, _In_ int cchLocaleScripts, _In_ LPCWSTR lpTestScripts, _In_
+ // int cchTestScripts); https://msdn.microsoft.com/en-us/library/windows/desktop/dd374129(v=vs.85).aspx
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)]
[PInvokeData("Winnls.h", MSDNShortId = "dd374129")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool VerifyScripts(VS_FLAGS dwFlags, string lpLocaleScripts, int cchLocaleScripts, string lpTestScripts, int cchTestScripts);
+ ///
+ /// Deprecated. Represents an instant in time, typically expressed as a date and time of day and a corresponding calendar.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/Intl/caldatetime typedef struct _caldatetime { CALID CalId; UINT Era; UINT Year;
+ // UINT Month; UINT Day; UINT DayOfWeek; UINT Hour; UINT Minute; UINT Second; ULONG Tick; } CALDATETIME, *LPCALDATETIME;
+ [PInvokeData("", MSDNShortId = "a714ff32-2b1f-4256-931e-324d64daf2ac")]
+ [StructLayout(LayoutKind.Sequential)]
+ public struct CALDATETIME
+ {
+ /// The calendar identifier for the instant in time.
+ public CALID CalId;
+
+ /// The era information for the instant in time.
+ public uint Era;
+
+ /// The year for the instant in time.
+ public uint Year;
+
+ /// The month for the instant in time.
+ public uint Month;
+
+ /// The day for the instant in time.
+ public uint Day;
+
+ /// The day of the week for the instant in time.
+ public uint DayOfWeek;
+
+ /// The hour for the instant in time.
+ public uint Hour;
+
+ /// The minute for the instant in time.
+ public uint Minute;
+
+ /// The second for the instant in time.
+ public uint Second;
+
+ /// The tick for the instant in time.
+ public uint Tick;
+ }
+
/// Contains information about a code page. This structure is used by the GetCPInfo function.
// typedef struct _cpinfo { UINT MaxCharSize; BYTE DefaultChar[MAX_DEFAULTCHAR]; BYTE LeadByte[MAX_LEADBYTES];} CPINFO, *LPCPINFO; https://msdn.microsoft.com/en-us/library/windows/desktop/dd317780(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317780")]
@@ -4387,153 +5085,189 @@ namespace Vanara.PInvoke
public struct CPINFO
{
///
- /// Maximum length, in bytes, of a character in the code page. The length can be 1 for a single-byte character set (SBCS), 2 for a double-byte
- /// character set (DBCS), or a value larger than 2 for other character set types. The function cannot use the size to distinguish an SBCS or a DBCS
- /// from other character sets because of other factors, for example, the use of ISCII or ISO-2022-xx code pages.
+ /// Maximum length, in bytes, of a character in the code page. The length can be 1 for a single-byte character set (SBCS), 2 for
+ /// a double-byte character set (DBCS), or a value larger than 2 for other character set types. The function cannot use the size
+ /// to distinguish an SBCS or a DBCS from other character sets because of other factors, for example, the use of ISCII or
+ /// ISO-2022-xx code pages.
///
public uint MaxCharSize;
+
///
- /// Default character used when translating character strings to the specific code page. This character is used by the WideCharToMultiByte
- /// function if an explicit default character is not specified. The default is usually the "?" character for the code page.
+ /// Default character used when translating character strings to the specific code page. This character is used by the
+ /// WideCharToMultiByte function if an explicit default character is not specified. The default is usually the "?"
+ /// character for the code page.
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] DefaultChar;
+
///
- /// A fixed-length array of lead byte ranges, for which the number of lead byte ranges is variable. If the code page has no lead bytes, every element
- /// of the array is set to NULL. If the code page has lead bytes, the array specifies a starting value and an ending value for each range.
- /// Ranges are inclusive, and the maximum number of ranges for any code page is five. The array uses two bytes to describe each range, with two null
- /// bytes as a terminator after the last range.
+ /// A fixed-length array of lead byte ranges, for which the number of lead byte ranges is variable. If the code page has no lead
+ /// bytes, every element of the array is set to NULL. If the code page has lead bytes, the array specifies a starting
+ /// value and an ending value for each range. Ranges are inclusive, and the maximum number of ranges for any code page is five.
+ /// The array uses two bytes to describe each range, with two null bytes as a terminator after the last range.
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] LeadByte;
}
/// Contains information about a code page. This structure is used by the GetCPInfoEx function.
- // typedef struct _cpinfoex { UINT MaxCharSize; BYTE DefaultChar[MAX_DEFAULTCHAR]; BYTE LeadByte[MAX_LEADBYTES]; WCHAR UnicodeDefaultChar; UINT CodePage;
- // TCHAR CodePageName[MAX_PATH];} CPINFOEX, *LPCPINFOEX; https://msdn.microsoft.com/en-us/library/windows/desktop/dd317781(v=vs.85).aspx
+ // typedef struct _cpinfoex { UINT MaxCharSize; BYTE DefaultChar[MAX_DEFAULTCHAR]; BYTE LeadByte[MAX_LEADBYTES]; WCHAR
+ // UnicodeDefaultChar; UINT CodePage; TCHAR CodePageName[MAX_PATH];} CPINFOEX, *LPCPINFOEX; https://msdn.microsoft.com/en-us/library/windows/desktop/dd317781(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317781")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CPINFOEX
{
///
- /// Maximum length, in bytes, of a character in the code page. The length can be 1 for a single-byte character set (SBCS), 2 for a double-byte
- /// character set (DBCS), or a value larger than 2 for other character set types. The function cannot use the size to distinguish an SBCS or a DBCS
- /// from other character sets because of other factors, for example, the use of ISCII or ISO-2022-xx code pages.
+ /// Maximum length, in bytes, of a character in the code page. The length can be 1 for a single-byte character set (SBCS), 2 for
+ /// a double-byte character set (DBCS), or a value larger than 2 for other character set types. The function cannot use the size
+ /// to distinguish an SBCS or a DBCS from other character sets because of other factors, for example, the use of ISCII or
+ /// ISO-2022-xx code pages.
///
public uint MaxCharSize;
+
///
- /// Default character used when translating character strings to the specific code page. This character is used by the WideCharToMultiByte
- /// function if an explicit default character is not specified. The default is usually the "?" character for the code page.
+ /// Default character used when translating character strings to the specific code page. This character is used by the
+ /// WideCharToMultiByte function if an explicit default character is not specified. The default is usually the "?"
+ /// character for the code page.
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] DefaultChar;
+
///
- /// A fixed-length array of lead byte ranges, for which the number of lead byte ranges is variable. If the code page has no lead bytes, every element
- /// of the array is set to NULL. If the code page has lead bytes, the array specifies a starting value and an ending value for each range.
- /// Ranges are inclusive, and the maximum number of ranges for any code page is five. The array uses two bytes to describe each range, with two null
- /// bytes as a terminator after the last range.
+ /// A fixed-length array of lead byte ranges, for which the number of lead byte ranges is variable. If the code page has no lead
+ /// bytes, every element of the array is set to NULL. If the code page has lead bytes, the array specifies a starting
+ /// value and an ending value for each range. Ranges are inclusive, and the maximum number of ranges for any code page is five.
+ /// The array uses two bytes to describe each range, with two null bytes as a terminator after the last range.
///
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public char UnicodeDefaultChar;
+
///
- /// Code page value. This value reflects the code page passed to the GetCPInfoEx function. See Code Page Identifiers for a list of ANSI and
- /// other code pages.
+ /// Code page value. This value reflects the code page passed to the GetCPInfoEx function. See Code Page Identifiers for a
+ /// list of ANSI and other code pages.
///
public uint CodePage;
+
///
- /// Full name of the code page. Note that this name is localized and is not guaranteed for uniqueness or consistency between operating system
- /// versions or computers.
+ /// Full name of the code page. Note that this name is localized and is not guaranteed for uniqueness or consistency between
+ /// operating system versions or computers.
///
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string CodePageName;
}
///
- /// Contains information that defines the format of a currency string. The GetCurrencyFormat function uses this information to customize a
- /// currency string for a specified locale.
+ /// Contains information that defines the format of a currency string. The GetCurrencyFormat function uses this information to
+ /// customize a currency string for a specified locale.
///
- // typedef struct _currencyfmt { UINT NumDigits; UINT LeadingZero; UINT Grouping; LPTSTR lpDecimalSep; LPTSTR lpThousandSep; UINT NegativeOrder; UINT
- // PositiveOrder; LPTSTR lpCurrencySymbol;} CURRENCYFMT, *LPCURRENCYFMT; https://msdn.microsoft.com/en-us/library/windows/desktop/dd317784(v=vs.85).aspx
+ // typedef struct _currencyfmt { UINT NumDigits; UINT LeadingZero; UINT Grouping; LPTSTR lpDecimalSep; LPTSTR lpThousandSep; UINT
+ // NegativeOrder; UINT PositiveOrder; LPTSTR lpCurrencySymbol;} CURRENCYFMT, *LPCURRENCYFMT; https://msdn.microsoft.com/en-us/library/windows/desktop/dd317784(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd317784")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct CURRENCYFMT
{
/// Number of fractional digits. This number is equivalent to LOCALE_ICURRDIGITS.
public uint NumDigits;
+
/// Value indicating if leading zeros should be used in decimal fields. This value is equivalent to LOCALE_ILZERO.
public uint LeadingZero;
+
///
- /// Number of digits in each group of numbers to the left of the decimal separator specified by lpDecimalSep. The most significant grouping
- /// digit indicates the number of digits in the least significant group immediately to the left of the decimal separator. Each subsequent grouping
- /// digit indicates the next significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups
- /// repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group digits as in
- /// 123,456,789.00; and 32 to group digits as in 12,34,56,789.00.
+ /// Number of digits in each group of numbers to the left of the decimal separator specified by lpDecimalSep. The most
+ /// significant grouping digit indicates the number of digits in the least significant group immediately to the left of the
+ /// decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous
+ /// group. If the last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this
+ /// member are: 0 to group digits as in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00.
///
public uint Grouping;
+
/// Pointer to a null-terminated decimal separator string.
public string lpDecimalSep;
+
/// Pointer to a null-terminated thousand separator string.
public string lpThousandSep;
+
/// Negative currency mode. This mode is equivalent to LOCALE_INEGCURR.
public uint NegativeOrder;
+
/// Positive currency mode. This mode is equivalent to LOCALE_ICURRENCY.
public uint PositiveOrder;
+
/// Pointer to a null-terminated currency symbol string.
public string lpCurrencySymbol;
}
///
- /// Contains information about a file, related to its use with MUI. Most of this data is stored in the resource configuration data for the particular
- /// file. When this structure is retrieved by GetFileMUIInfo, not all fields are necessarily filled in. The fields used depend on the flags that
- /// the application has passed to that function.
+ /// Contains information about a file, related to its use with MUI. Most of this data is stored in the resource configuration data
+ /// for the particular file. When this structure is retrieved by GetFileMUIInfo, not all fields are necessarily filled in. The
+ /// fields used depend on the flags that the application has passed to that function.
///
- // typedef struct _FILEMUIINFO { DWORD dwSize; DWORD dwVersion; DWORD dwFileType; BYTE pChecksum[16]; BYTE pServiceChecksum[16]; DWORD
- // dwLanguageNameOffset; DWORD dwTypeIDMainSize; DWORD dwTypeIDMainOffset; DWORD dwTypeNameMainOffset; DWORD dwTypeIDMUISize; DWORD dwTypeIDMUIOffset;
- // DWORD dwTypeNameMUIOffset; BYTE abBuffer[8];} FILEMUIINFO, *PFILEMUIINFO; https://msdn.microsoft.com/en-us/library/windows/desktop/dd318039(v=vs.85).aspx
+ // typedef struct _FILEMUIINFO { DWORD dwSize; DWORD dwVersion; DWORD dwFileType; BYTE pChecksum[16]; BYTE pServiceChecksum[16];
+ // DWORD dwLanguageNameOffset; DWORD dwTypeIDMainSize; DWORD dwTypeIDMainOffset; DWORD dwTypeNameMainOffset; DWORD dwTypeIDMUISize;
+ // DWORD dwTypeIDMUIOffset; DWORD dwTypeNameMUIOffset; BYTE abBuffer[8];} FILEMUIINFO, *PFILEMUIINFO; https://msdn.microsoft.com/en-us/library/windows/desktop/dd318039(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd318039")]
[StructLayout(LayoutKind.Sequential)]
public struct FILEMUIINFO
{
- /// Size of the structure, including the buffer, which can be extended past the 8 bytes declared. The minimum value allowed is .
+ ///
+ /// Size of the structure, including the buffer, which can be extended past the 8 bytes declared. The minimum value allowed is .
+ ///
public uint dwSize;
+
/// Version of the structure. The current version is 0x001.
public uint dwVersion;
+
/// The file type. Possible values are:
public uint dwFileType;
+
/// Pointer to a 128-bit checksum for the file, if it is either an LN file or a language-specific resource file.
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] pChecksum;
+
/// Pointer to a 128-bit checksum for the file, used for servicing.
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] pServiceChecksum;
+
///
- /// Offset, in bytes, from the beginning of the structure to the language name string for a language-specific resource file, or to the ultimate
- /// fallback language name string for an LN file.
+ /// Offset, in bytes, from the beginning of the structure to the language name string for a language-specific resource file, or
+ /// to the ultimate fallback language name string for an LN file.
///
public uint dwLanguageNameOffset;
+
///
- /// Size of the array for which the offset is indicated by dwTypeIDMainOffset. The size also corresponds to the number of strings in the multi-string
- /// array indicated by dwTypeNameMainOffset.
+ /// Size of the array for which the offset is indicated by dwTypeIDMainOffset. The size also corresponds to the number of strings
+ /// in the multi-string array indicated by dwTypeNameMainOffset.
///
public uint dwTypeIDMainSize;
- /// Offset, in bytes, from the beginning of the structure to a DWORD array enumerating the resource types contained in the LN file.
- public uint dwTypeIDMainOffset;
+
///
- /// Offset, in bytes, from the beginning of the structure to a series of null-terminated strings in a multi-string array enumerating the resource
- /// names contained in the LN file.
+ /// Offset, in bytes, from the beginning of the structure to a DWORD array enumerating the resource types contained in the LN file.
+ ///
+ public uint dwTypeIDMainOffset;
+
+ ///
+ /// Offset, in bytes, from the beginning of the structure to a series of null-terminated strings in a multi-string array
+ /// enumerating the resource names contained in the LN file.
///
public uint dwTypeNameMainOffset;
+
///
- /// Size of the array with the offset indicated by dwTypeIDMUIOffset. The size also corresponds to the number of strings in the series of strings
- /// indicated by dwTypeNameMUIOffset.
+ /// Size of the array with the offset indicated by dwTypeIDMUIOffset. The size also corresponds to the number of strings in the
+ /// series of strings indicated by dwTypeNameMUIOffset.
///
public uint dwTypeIDMUISize;
- /// Offset, in bytes, from the beginning of the structure to a DWORD array enumerating the resource types contained in the LN file.
- public uint dwTypeIDMUIOffset;
+
///
- /// Offset, in bytes, from the beginning of the structure to a multi-string array enumerating the resource names contained in the LN file.
+ /// Offset, in bytes, from the beginning of the structure to a DWORD array enumerating the resource types contained in the LN file.
+ ///
+ public uint dwTypeIDMUIOffset;
+
+ ///
+ /// Offset, in bytes, from the beginning of the structure to a multi-string array enumerating the resource names contained in the
+ /// LN file.
///
public uint dwTypeNameMUIOffset;
+
/// Remainder of the allocated memory for this structure. See the Remarks section for correct use of this array.
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] abBuffer;
@@ -4543,90 +5277,105 @@ namespace Vanara.PInvoke
/// Deprecated. Contains version information about an NLS capability.
/// Starting with Windows 8, your app should use NLSVERSIONINFOEX instead of NLSVERSIONINFO.
///
- // typedef struct _nlsversioninfo { DWORD dwNLSVersionInfoSize; DWORD dwNLSVersion; DWORD dwDefinedVersion;} NLSVERSIONINFO, *LPNLSVERSIONINFO; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319086(v=vs.85).aspx
+ // typedef struct _nlsversioninfo { DWORD dwNLSVersionInfoSize; DWORD dwNLSVersion; DWORD dwDefinedVersion;} NLSVERSIONINFO,
+ // *LPNLSVERSIONINFO; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319086(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd319086")]
[StructLayout(LayoutKind.Sequential)]
public struct NLSVERSIONINFO
{
/// Size, in bytes, of the structure.
public uint dwNLSVersionInfoSize;
+
///
- /// NLS version. This value is used to track changes and additions to the set of code points that have the indicated capability for a particular
- /// locale. The value is locale-specific, and increments when the capability changes. For example, using the COMPARE_STRING capability defined by the
- /// SYSNLS_FUNCTION enumeration, the version changes if sorting weights are assigned to code points that previously had no weights defined for
- /// the locale.
+ /// NLS version. This value is used to track changes and additions to the set of code points that have the indicated capability
+ /// for a particular locale. The value is locale-specific, and increments when the capability changes. For example, using the
+ /// COMPARE_STRING capability defined by the SYSNLS_FUNCTION enumeration, the version changes if sorting weights are
+ /// assigned to code points that previously had no weights defined for the locale.
///
public uint dwNLSVersion;
+
///
- /// Defined version. This value is used to track changes in the repertoire of Unicode code points. The value increments when the Unicode repertoire
- /// is extended, for example, if more characters are defined.
+ /// Defined version. This value is used to track changes in the repertoire of Unicode code points. The value increments when the
+ /// Unicode repertoire is extended, for example, if more characters are defined.
///
public uint dwDefinedVersion;
}
/// Contains version information about an NLS capability.
- // typedef struct _nlsversioninfoex { DWORD dwNLSVersionInfoSize; DWORD dwNLSVersion; DWORD dwDefinedVersion; DWORD dwEffectiveId; GUID
- // guidCustomVersion;} NLSVERSIONINFOEX, *LPNLSVERSIONINFOEX; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319087(v=vs.85).aspx
+ // typedef struct _nlsversioninfoex { DWORD dwNLSVersionInfoSize; DWORD dwNLSVersion; DWORD dwDefinedVersion; DWORD dwEffectiveId;
+ // GUID guidCustomVersion;} NLSVERSIONINFOEX, *LPNLSVERSIONINFOEX; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319087(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd319087")]
public struct NLSVERSIONINFOEX
{
///
///
- /// Defined version. This value is used to track changes in the repertoire of Unicode code points. The value increments when the Unicode repertoire
- /// is extended, for example, if more characters are defined.
+ /// Defined version. This value is used to track changes in the repertoire of Unicode code points. The value increments when the
+ /// Unicode repertoire is extended, for example, if more characters are defined.
///
/// Starting with Windows 8: Deprecated. Use dwNLSVersion instead.
///
public uint dwDefinedVersion;
+
///
///
- /// Identifier of the sort order used for the input locale for the represented version. For example, for a custom locale en-Mine that uses 0409 for a
- /// sort order identifier, this member contains "0409". If this member specifies a "real" sort, guidCustomVersion is set to an empty GUID.
+ /// Identifier of the sort order used for the input locale for the represented version. For example, for a custom locale en-Mine
+ /// that uses 0409 for a sort order identifier, this member contains "0409". If this member specifies a "real" sort,
+ /// guidCustomVersion is set to an empty GUID.
///
/// Starting with Windows 8: Deprecated. Use guidCustomVersion instead.
///
public uint dwEffectiveId;
+
///
- /// Version. This value is used to track changes and additions to the set of code points that have the indicated capability for a particular locale.
- /// The value is locale-specific, and increments when the capability changes. For example, using the COMPARE_STRING capability defined by the
- /// SYSNLS_FUNCTION enumeration, the version changes if sorting weights are assigned to code points that previously had no weights defined for
- /// the locale.
+ /// Version. This value is used to track changes and additions to the set of code points that have the indicated capability for a
+ /// particular locale. The value is locale-specific, and increments when the capability changes. For example, using the
+ /// COMPARE_STRING capability defined by the SYSNLS_FUNCTION enumeration, the version changes if sorting weights are
+ /// assigned to code points that previously had no weights defined for the locale.
///
public uint dwNLSVersion;
+
/// Size, in bytes, of the structure.
public uint dwNLSVersionInfoSize;
+
/// Unique GUID for the behavior of a custom sort used by the locale for the represented version.
public Guid guidCustomVersion;
}
///
- /// Contains information that defines the format of a number string. The GetNumberFormat function uses this information to customize a number
- /// string for a specified locale.
+ /// Contains information that defines the format of a number string. The GetNumberFormat function uses this information to
+ /// customize a number string for a specified locale.
///
- // typedef struct _numberfmt { UINT NumDigits; UINT LeadingZero; UINT Grouping; LPTSTR lpDecimalSep; LPTSTR lpThousandSep; UINT NegativeOrder;}
- // NUMBERFMT, *LPNUMBERFMT; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319095(v=vs.85).aspx
+ // typedef struct _numberfmt { UINT NumDigits; UINT LeadingZero; UINT Grouping; LPTSTR lpDecimalSep; LPTSTR lpThousandSep; UINT
+ // NegativeOrder;} NUMBERFMT, *LPNUMBERFMT; https://msdn.microsoft.com/en-us/library/windows/desktop/dd319095(v=vs.85).aspx
[PInvokeData("Winnls.h", MSDNShortId = "dd319095")]
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct NUMBERFMT
{
/// Number of fractional digits. This value is equivalent to the locale information specified by the value LOCALE_IDIGITS.
public uint NumDigits;
+
///
- /// A value indicating if leading zeros should be used in decimal fields. This value is equivalent to the locale information specified by the value LOCALE_ILZERO.
+ /// A value indicating if leading zeros should be used in decimal fields. This value is equivalent to the locale information
+ /// specified by the value LOCALE_ILZERO.
///
public uint LeadingZero;
+
///
- /// Number of digits in each group of numbers to the left of the decimal separator specified by lpDecimalSep. Values in the range 0 through 9
- /// and 32 are valid. The most significant grouping digit indicates the number of digits in the least significant group immediately to the left of
- /// the decimal separator. Each subsequent grouping digit indicates the next significant group of digits to the left of the previous group. If the
- /// last value supplied is not 0, the remaining groups repeat the last group. Typical examples of settings for this member are: 0 to group digits as
- /// in 123456789.00; 3 to group digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00.
+ /// Number of digits in each group of numbers to the left of the decimal separator specified by lpDecimalSep. Values in
+ /// the range 0 through 9 and 32 are valid. The most significant grouping digit indicates the number of digits in the least
+ /// significant group immediately to the left of the decimal separator. Each subsequent grouping digit indicates the next
+ /// significant group of digits to the left of the previous group. If the last value supplied is not 0, the remaining groups
+ /// repeat the last group. Typical examples of settings for this member are: 0 to group digits as in 123456789.00; 3 to group
+ /// digits as in 123,456,789.00; and 32 to group digits as in 12,34,56,789.00.
///
public uint Grouping;
+
/// Pointer to a null-terminated decimal separator string.
public string lpDecimalSep;
+
/// Pointer to a null-terminated thousand separator string.
public string lpThousandSep;
+
/// Negative number mode. This mode is equivalent to the locale information specified by the value LOCALE_INEGNUMBER.
public uint NegativeOrder;
}
diff --git a/PInvoke/Kernel32/WindowsCeip.cs b/PInvoke/Kernel32/WindowsCeip.cs
new file mode 100644
index 00000000..37312d4d
--- /dev/null
+++ b/PInvoke/Kernel32/WindowsCeip.cs
@@ -0,0 +1,20 @@
+using System.Runtime.InteropServices;
+
+namespace Vanara.PInvoke
+{
+ public static partial class Kernel32
+ {
+ ///
+ /// Checks whether the user has opted in for SQM data collection as part of the Customer Experience Improvement Program (CEIP).
+ ///
+ ///
+ /// True if SQM data collection is opted in and the machine can send data. Otherwise, false.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/windowsceip/nf-windowsceip-ceipisoptedin
+ // BOOL CeipIsOptedIn( );
+ [DllImport(Lib.Kernel32, SetLastError = false, ExactSpelling = true)]
+ [PInvokeData("windowsceip.h", MSDNShortId = "4CDB5B09-B172-4E99-AB46-A08E32346266")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CeipIsOptedIn();
+ }
+}
\ No newline at end of file