From c281601afed280b5349d40775e1091620f207ba0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sat, 11 Jan 2025 14:10:37 +0100 Subject: [PATCH] windows: Update comment about RtlNtStatusToDosError() side effect --- lib/i386-io-windows.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index 898a781..434c098 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -121,7 +121,11 @@ SetProcessUserModeIOPLFunc(LPVOID Arg) * If we have optional RtlNtStatusToDosError() function then use it for * translating NT status to Win32 error. If we do not have it then translate * two important status codes which we use later STATUS_NOT_IMPLEMENTED and - * STATUS_PRIVILEGE_NOT_HELD. + * STATUS_PRIVILEGE_NOT_HELD. Note that RtlNtStatusToDosError() not only + * returns the translated Win32 error code from the passed NT status, but it + * also changes the current thread status value to the passed NT status. + * We are not using the thread status value at all, so it does not matter + * that this side effect happens. */ if (RtlNtStatusToDosErrorPtr) SetLastError(RtlNtStatusToDosErrorPtr(nt_status)); -- 2.47.3