< prev index next >

src/java.base/windows/classes/sun/nio/fs/WindowsSecurity.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 2008, 2025, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 104,13 ***
          final long token = hToken;
          final boolean stopImpersontating = impersontating;
          final boolean needToRevert = elevated;
  
          // prevent yielding with privileges
!         if (ContinuationSupport.isSupported())
-             Continuation.pin();
- 
          return () -> {
              try {
                  if (token != 0L) {
                      try {
                          if (stopImpersontating)
--- 104,11 ---
          final long token = hToken;
          final boolean stopImpersontating = impersontating;
          final boolean needToRevert = elevated;
  
          // prevent yielding with privileges
!         boolean pinned = ContinuationSupport.pinIfSupported();
          return () -> {
              try {
                  if (token != 0L) {
                      try {
                          if (stopImpersontating)

*** 124,12 ***
                          CloseHandle(token);
                      }
                  }
              } finally {
                  LocalFree(pLuid);
!                 if (ContinuationSupport.isSupported())
-                     Continuation.unpin();
              }
          };
      }
  
      /**
--- 122,11 ---
                          CloseHandle(token);
                      }
                  }
              } finally {
                  LocalFree(pLuid);
!                 if (pinned) Continuation.unpin();
              }
          };
      }
  
      /**
< prev index next >