Alan,
Do you agree with
    /**
* Check the access right against the securityInfo in the current thread.
     */
    static boolean checkAccessMask(long securityInfo, int accessMask,
int genericRead, int genericWrite, int genericExecute, int genericAll)
        throws WindowsException
    {
        int privilegies = TOKEN_QUERY;
long hToken = OpenThreadToken(GetCurrentThread(), privilegies, false);
        if (hToken == 0L && processTokenWithDuplicateAccess != 0L)
            hToken = DuplicateTokenEx(processTokenWithDuplicateAccess,
                privilegies);

        boolean hasRight = false;
        if (hToken != 0L) {
            try {
                hasRight = AccessCheck(hToken, securityInfo, accessMask,
genericRead, genericWrite, genericExecute, genericAll);
            } finally {
                CloseHandle(hToken);
            }
        }
        return hasRight;
    }
implementation approach?

Regards,
-uta

On 01.03.2013 19:02, Alan Bateman wrote:
A minor point is that in checkAccessMask then you could call OpenThreadToken before the try/finally. That way you wouldn't need to check hToken. Otherwise I think this is good to go and it's nice to finally fix this issue.

-Alan

Reply via email to