Skip to content

Commit 69015e1

Browse files
committedDec 28, 2023
try to fix error 0xc000000d from winserver 2019
1 parent 69decd3 commit 69015e1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎Source/DXControl/DXControl.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
MIT License
3-
Copyright (C) 2022 DUONG DIEU PHAP
3+
Copyright (C) 2022-2024 DUONG DIEU PHAP
44
Project & license info: https://github.com/d2phap/DXControl
55
*/
66
using DirectN;
@@ -506,14 +506,20 @@ private void Ticker_Tick(object? sender, VerticalBlankTickerEventArgs e)
506506

507507
private void Ticker_WaitError(object? sender, VerticalBlankTickerErrorEventArgs e)
508508
{
509-
const uint UNKNOWN_ERROR = 0xc01e0006;
510509
const uint WAIT_TIMEOUT = 258;
511510

511+
// Win Server 2019: Unknown Error https://github.com/d2phap/ImageGlass/issues/1771
512+
const uint UNKNOWN_ERROR_WinSrv2019 = 0xc000000d;
513+
512514
// happens when the screen is off, we handle this error and put the thread
513515
// into sleep so that it will auto-recover when the screen is on again
514516
// https://github.com/smourier/DirectN/issues/29
515-
if (e.Error == unchecked((int)UNKNOWN_ERROR)
516-
|| e.Error == WAIT_TIMEOUT)
517+
const uint UNKNOWN_ERROR = 0xc01e0006;
518+
519+
520+
if (e.Error == WAIT_TIMEOUT
521+
|| e.Error == unchecked((int)UNKNOWN_ERROR)
522+
|| e.Error == unchecked((int)UNKNOWN_ERROR_WinSrv2019))
517523
{
518524
Thread.Sleep(1000);
519525
e.Handled = true;

0 commit comments

Comments
 (0)