Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
PowerSettingAccessCheck (powrprof)
 
.
Summary
Queries for a group policy override for specified power settings.

C# Signature:

     /* http://msdn2.microsoft.com/en-us/library/aa372761.aspx */

    /// <summary>
    /// Full call to Vista method PowerSettingAccessCheck().
    /// </summary>
    /// <param name="AccessFlags">One or more check specifier flags</param>
    /// <param name="PowerGuid">The relevant Power Policy GUID</param>
    /// <returns></returns>
    [DllImport("powerprof.dll", CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.U4)]
    internal static extern UInt32 PowerSettingAccessCheck(
                            POWER_DATA_ACCESSOR AccessFlags,
                            [MarshalAs(UnmanagedType.LPStruct)] Guid PowerGuid
                            );

    /// <summary>
    /// Partial call to Vista method PowerSettingAccessCheck() supporting null GUID parameter.
    /// </summary>
    /// <param name="AccessFlags">One or more check specifier flags</param>
    /// <param name="PowerGuid">null</param>
    /// <returns></returns>
    [DllImport("powerprof.dll", CharSet = CharSet.Auto, SetLastError = true)]
    [return: MarshalAs(UnmanagedType.U4)]
    internal static extern UInt32 PowerSettingAccessCheck(
                            POWER_DATA_ACCESSOR AccessFlags,
                            IntPtr PowerGuid
                            );

    #region Group Policy Access FlagsAttribute

    [Flags]
    public enum POWER_DATA_ACCESSOR
    {
        /// <summary>
        /// Check for overrides on AC power settings.
        /// </summary>
        ACCESS_AC_POWER_SETTING_INDEX = 0x0,
        /// <summary>
        /// Check for overrides on DC power settings.
        /// </summary>
        ACCESS_DC_POWER_SETTING_INDEX = 0x1,
        /// <summary>
        /// Check for restrictions on specific power schemes.
        /// </summary>
        ACCESS_SCHEME = 0x10,
        /// <summary>
        /// Check for restrictions on active power schemes.
        /// </summary>
        ACCESS_ACTIVE_SCHEME = 0x13,
        /// <summary>
        /// Check for restrictions on creating or restoring power schemes.
        /// </summary>
        ACCESS_CREATE_SCHEME = 0x14
    };

    #endregion

VB Signature:

Declare Function PowerSettingAccessCheck Lib "powrprof.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions