]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
windows: Update comment about RtlNtStatusToDosError() side effect
authorPali Rohár <pali@kernel.org>
Sat, 11 Jan 2025 13:10:37 +0000 (14:10 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Jun 2025 15:19:58 +0000 (17:19 +0200)
lib/i386-io-windows.h

index 898a781b6118df8c6983b6ddb672d79540581880..434c0986edb2b7bf2aaf37f2fa1b6ba185f09a41 100644 (file)
@@ -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));