From: Pali Rohár Date: Sat, 11 Jan 2025 13:10:37 +0000 (+0100) Subject: windows: Update comment about RtlNtStatusToDosError() side effect X-Git-Tag: v3.14.0~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c281601afed280b5349d40775e1091620f207ba0;p=thirdparty%2Fpciutils.git windows: Update comment about RtlNtStatusToDosError() side effect --- 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));