< prev index next > src/java.base/windows/classes/sun/nio/fs/WindowsSecurity.java
Print this page
/*
- * Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
+ * 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
final long token = hToken;
final boolean stopImpersontating = impersontating;
final boolean needToRevert = elevated;
// prevent yielding with privileges
- if (ContinuationSupport.isSupported())
- Continuation.pin();
-
+ boolean pinned = ContinuationSupport.pinIfSupported();
return () -> {
try {
if (token != 0L) {
try {
if (stopImpersontating)
CloseHandle(token);
}
}
} finally {
LocalFree(pLuid);
- if (ContinuationSupport.isSupported())
- Continuation.unpin();
+ if (pinned) Continuation.unpin();
}
};
}
/**
< prev index next >