2015-09-21 19:53:37 +00:00
|
|
|
#include "actctx.h"
|
|
|
|
|
|
|
|
HANDLE PyWin_DLLhActivationContext=NULL;
|
|
|
|
PFN_GETCURRENTACTCTX pfnGetCurrentActCtx=NULL;
|
|
|
|
PFN_ACTIVATEACTCTX pfnActivateActCtx=NULL;
|
|
|
|
PFN_DEACTIVATEACTCTX pfnDeactivateActCtx=NULL;
|
|
|
|
PFN_ADDREFACTCTX pfnAddRefActCtx=NULL;
|
|
|
|
PFN_RELEASEACTCTX pfnReleaseActCtx=NULL;
|
|
|
|
|
|
|
|
ULONG_PTR _My_ActivateActCtx()
|
|
|
|
{
|
2019-07-11 15:58:33 +00:00
|
|
|
ULONG_PTR ret = 0;
|
|
|
|
if (PyWin_DLLhActivationContext && pfnActivateActCtx)
|
|
|
|
if (!(*pfnActivateActCtx)(PyWin_DLLhActivationContext, &ret)) {
|
|
|
|
ret = 0; // no promise the failing function didn't change it!
|
|
|
|
}
|
|
|
|
return ret;
|
2015-09-21 19:53:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void _My_DeactivateActCtx(ULONG_PTR cookie)
|
|
|
|
{
|
2019-07-11 15:58:33 +00:00
|
|
|
if (cookie && pfnDeactivateActCtx)
|
|
|
|
if (!(*pfnDeactivateActCtx)(0, cookie)){}
|
2015-09-21 19:53:37 +00:00
|
|
|
}
|
|
|
|
|