Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.1 KiB

#include "stdinc.h"
FARPROC
WINAPI
SxApwGetKernel32ProcAddress(
PCSTR pszProcName
)
{
static HMODULE hmodKernel32;
if (hmodKernel32 == NULL)
{
hmodKernel32 = GetModuleHandleW(L"Kernel32.dll");
if (hmodKernel32 == NULL)
return NULL;
}
return GetProcAddress(hmodKernel32, pszProcName);
}
BOOL
WINAPI
SxApwActivateActCtx(
HANDLE hActCtx,
ULONG_PTR *lpCookie
)
{
typedef BOOL (WINAPI* PFN)(HANDLE hActCtx, ULONG_PTR *lpCookie);
static PFN pfn;
if (pfn == NULL)
{
pfn = reinterpret_cast<PFN>(SxApwGetKernel32ProcAddress("ActivateActCtx"));
if (pfn == NULL)
return FALSE;
}
return pfn(hActCtx, lpCookie);
}
BOOL
WINAPI
SxApwDeactivateActCtx(
DWORD dwFlags,
ULONG_PTR ulCookie
)
{
typedef BOOL (WINAPI* PFN)(DWORD dwFlags, ULONG_PTR ulCookie);
static PFN pfn;
if (pfn == NULL)
{
pfn = reinterpret_cast<PFN>(SxApwGetKernel32ProcAddress("DeactivateActCtx"));
if (pfn == NULL)
return FALSE;
}
return pfn(dwFlags, ulCookie);
}