Example #1
0
        public unsafe bool GetBlockSendInputResets()
        {
            Boolean32 simulatedInputBlocked = new Boolean32();

            Error.ThrowLastErrorIfFalse(
                Imports.SystemParametersInfoW(SystemParameterType.SPI_GETBLOCKSENDINPUTRESETS, 0, &simulatedInputBlocked, 0));
            return(simulatedInputBlocked);
        }
Example #2
0
        public unsafe bool GetBeep()
        {
            Boolean32 beeperOn = new Boolean32();

            Error.ThrowLastErrorIfFalse(
                Imports.SystemParametersInfoW(SystemParameterType.SPI_GETBEEP, 0, &beeperOn, 0));
            return(beeperOn);
        }
Example #3
0
        public unsafe bool GetBlockSendInputResets()
        {
            Boolean32 simulatedInputBlocked = new Boolean32();

            if (!Imports.SystemParametersInfoW(SystemParameterType.SPI_GETBLOCKSENDINPUTRESETS, 0, &simulatedInputBlocked, 0))
            {
                throw Error.GetExceptionForLastError();
            }
            return(simulatedInputBlocked);
        }
Example #4
0
        public unsafe bool GetBeep()
        {
            Boolean32 beeperOn = new Boolean32();

            if (!Imports.SystemParametersInfoW(SystemParameterType.SPI_GETBEEP, 0, &beeperOn, 0))
            {
                throw Error.GetExceptionForLastError();
            }
            return(beeperOn);
        }
Example #5
0
        /// <summary>
        /// CopyFile2 wrapper. Only available on Windows8 and above.
        /// </summary>
        public unsafe static void CopyFile2(string source, string destination, bool overwrite = false)
        {
            Boolean32 cancel = false;
            COPYFILE2_EXTENDED_PARAMETERS parameters = new COPYFILE2_EXTENDED_PARAMETERS()
            {
                dwSize      = (uint)sizeof(COPYFILE2_EXTENDED_PARAMETERS),
                pfCancel    = &cancel,
                dwCopyFlags = overwrite ? 0 : CopyFileFlags.FailIfExists
            };

            Imports.CopyFile2(source, destination, ref parameters).ThrowIfFailed();
        }
Example #6
0
        static void DisplayTime(DeviceContext hdc, Boolean32 f24Hour, Boolean32 fSuppress)
        {
            SystemTime st = SystemInformation.GetLocalTime();

            if (f24Hour)
            {
                DisplayTwoDigits(hdc, st.Hour, fSuppress);
            }
            else
            {
                DisplayTwoDigits(hdc, (st.Hour % 12) != 0 ? st.Hour : 12, fSuppress);
            }
            DisplayColon(hdc);
            DisplayTwoDigits(hdc, st.Minute, false);
            DisplayColon(hdc);
            DisplayTwoDigits(hdc, st.Second, false);
        }
Example #7
0
        public void BOOLConversion()
        {
            Boolean32 B = true;

            (B == true).Should().BeTrue("Comparison of TRUE with true is true");
            (B == false).Should().BeFalse("Comparison of TRUE with false is false");
            B.IsTrue.Should().BeTrue("IsTrue should be true when true");
            B.IsFalse.Should().BeFalse("IsFalse should be false when true");
            bool b = B;

            b.Should().BeTrue("assignment is true");
            b = false;
            B = b;
            (B == true).Should().BeFalse("Comparison of FALSE with true is false");
            (B == false).Should().BeTrue("Comparison of FALSE with false is true");
            B.IsTrue.Should().BeFalse("IsTrue should be false when false");
            B.IsFalse.Should().BeTrue("IsFalse should be true when False");
        }
Example #8
0
        /// <summary>
        /// Updates Rasterizer primitive discard state based on guest gpu state.
        /// </summary>
        /// <param name="state">Current GPU state</param>
        private void UpdateRasterizerState(GpuState state)
        {
            Boolean32 enable = state.Get <Boolean32>(MethodOffset.RasterizeEnable);

            _context.Renderer.Pipeline.SetRasterizerDiscard(!enable);
        }
Example #9
0
 public unsafe static extern Boolean32 PrivilegeCheck(
     AccessToken ClientToken,
     PrivilegeSet *RequiredPrivileges,
     out Boolean32 pfResult);