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
DWM_TIMING_INFO (Structures)
 
.
Summary

C# Definition:

    /// <summary>
    /// Used by DWM_TIMING_INFO
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct UNSIGNED_RATIO
    {
        public UInt32 uiNumerator;
        public UInt32 uiDenominator;
    }

    /// <summary>
    /// Specifies Desktop Window Manager (DWM) composition timing information.
    /// Used by the DwmGetCompositionTimingInfo function.
    /// </summary>
    /// <remark>
    /// It's necessary to get rid of padding (by setting Pack = 1)
    /// The member sbSize must be set to (uint)Marshal.SizeOf(typeof(DWM_TIMING_INFO))
    /// before calling DwmGetCompositionTimingInfo function else it won't work.
    /// </remark>
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct DWM_TIMING_INFO
    {
        public UInt32 cbSize;
        public UNSIGNED_RATIO rateRefresh;
        public UInt64 qpcRefreshPeriod;
        public UNSIGNED_RATIO rateCompose;
        public UInt64 qpcVBlank;
        public UInt64 cRefresh;
        public UInt32 cDXRefresh;
        public UInt64 qpcCompose;
        public UInt64 cFrame;
        public UInt32 cDXPresent;
        public UInt64 cRefreshFrame;
        public UInt64 cFrameSubmitted;
        public UInt32 cDXPresentSubmitted;
        public UInt64 cFrameConfirmed;
        public UInt32 cDXPresentConfirmed;
        public UInt64 cRefreshConfirmed;
        public UInt32 cDXRefreshConfirmed;
        public UInt64 cFramesLate;
        public UInt32 cFramesOutstanding;
        public UInt64 cFrameDisplayed;
        public UInt64 qpcFrameDisplayed;
        public UInt64 cRefreshFrameDisplayed;
        public UInt64 cFrameComplete;
        public UInt64 qpcFrameComplete;
        public UInt64 cFramePending;
        public UInt64 qpcFramePending;
        public UInt64 cFramesDisplayed;
        public UInt64 cFramesComplete;
        public UInt64 cFramesPending;
        public UInt64 cFramesAvailable;
        public UInt64 cFramesDropped;
        public UInt64 cFramesMissed;
        public UInt64 cRefreshNextDisplayed;
        public UInt64 cRefreshNextPresented;
        public UInt64 cRefreshesDisplayed;
        public UInt64 cRefreshesPresented;
        public UInt64 cRefreshStarted;
        public UInt64 cPixelsReceived;
        public UInt64 cPixelsDrawn;
        public UInt64 cBuffersEmpty;
    }

Notes:

Member cbSize must be set before calling DwmGetCompositionTimingInfo function.

    cbSize = (uint)Marshal.SizeOf(typeof(DWM_TIMING_INFO));

Member qpcVBlank here is UInt64, this is very strange since it represents a QPC(QueryPerformanceCounter) value which itself is Int64.

For convenience we can use Int64 instead of UInt64 to avoid unnecessary casting, it's pretty safe to do so.

Normally, the frequency of QPC(QueryPerformanceFrequency) is below 10 MHz, a 10 MHz QPC won't exceed Int64.MaxValue in:

    Int64.MaxValue / (10.0 * 1000 * 1000) / 3600 / 24 / 365 = more than 29247 years.

Even if the QPC has a frequency of 10 GHz, it would still take more than 29 years to exceed Int64.MaxValue.

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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