From 910209a77d3311f845c535023d49b409d90e63ef Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Tue, 6 Dec 2016 10:57:52 +0900 Subject: [PATCH] [x86/Linux] Revise COMPlusThrowCallback (#8430) GetCallerToken and GetImpersonationToken methods in FrameSecurityDescriptorBaseObject are implemented only for Windows-platform. --- src/vm/excep.h | 4 ++++ src/vm/i386/excepx86.cpp | 2 ++ src/vm/object.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/vm/excep.h b/src/vm/excep.h index f170a3e6a453c..7ef19215930d8 100644 --- a/src/vm/excep.h +++ b/src/vm/excep.h @@ -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; @@ -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; diff --git a/src/vm/i386/excepx86.cpp b/src/vm/i386/excepx86.cpp index 91dffa5c7709c..025098c3ad0d7 100644 --- a/src/vm/i386/excepx86.cpp +++ b/src/vm/i386/excepx86.cpp @@ -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) @@ -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) diff --git a/src/vm/object.h b/src/vm/object.h index d3abce28dda47..73ecb62b80989 100644 --- a/src/vm/object.h +++ b/src/vm/object.h @@ -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