Skip to content

Commit

Permalink
[x86/Linux] Revise COMPlusThrowCallback (dotnet#8430)
Browse files Browse the repository at this point in the history
GetCallerToken and GetImpersonationToken methods in FrameSecurityDescriptorBaseObject
are implemented only for Windows-platform.
  • Loading branch information
parjong authored and jkotas committed Dec 6, 2016
1 parent 6c1b9cc commit 910209a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/vm/excep.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ struct ThrowCallbackType
MethodDesc * pProfilerNotify; // Context for profiler callbacks -- see COMPlusFrameHandler().
BOOL bReplaceStack; // Used to pass info to SaveStackTrace call
BOOL bSkipLastElement;// Used to pass info to SaveStackTrace call
#ifndef FEATURE_PAL
HANDLE hCallerToken;
HANDLE hImpersonationToken;
BOOL bImpersonationTokenSet;
#endif // !FEATURE_PAL
#ifdef _DEBUG
void * pCurrentExceptionRecord;
void * pPrevExceptionRecord;
Expand All @@ -114,9 +116,11 @@ struct ThrowCallbackType
pProfilerNotify = NULL;
bReplaceStack = FALSE;
bSkipLastElement = FALSE;
#ifndef FEATURE_PAL
hCallerToken = NULL;
hImpersonationToken = NULL;
bImpersonationTokenSet = FALSE;
#endif // !FEATURE_PAL

#ifdef _DEBUG
pCurrentExceptionRecord = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/vm/i386/excepx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2424,6 +2424,7 @@ StackWalkAction COMPlusThrowCallback( // SWA value
pData->bSkipLastElement = FALSE;
}

#ifndef FEATURE_PAL
// Check for any impersonation on the frame and save that for use during EH filter callbacks
OBJECTREF* pRefSecDesc = pCf->GetAddrOfSecurityObject();
if (pRefSecDesc != NULL && *pRefSecDesc != NULL)
Expand All @@ -2442,6 +2443,7 @@ StackWalkAction COMPlusThrowCallback( // SWA value
}
}
}
#endif // !FEATURE_PAL

// now we've got the stack trace, if we aren't allowed to catch this and we're first pass, return
if (pData->bDontCatch)
Expand Down
2 changes: 2 additions & 0 deletions src/vm/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -2880,8 +2880,10 @@ class FrameSecurityDescriptorBaseObject : public Object
LIMITED_METHOD_CONTRACT;
m_declSecComputed = !!declSec;
}
#ifndef FEATURE_PAL
LPVOID GetCallerToken();
LPVOID GetImpersonationToken();
#endif // FEATURE_PAL
};

#ifdef FEATURE_COMPRESSEDSTACK
Expand Down

0 comments on commit 910209a

Please sign in to comment.