From c9087160945a766e46c37879e4f428ec381c254e Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 25 Apr 2024 19:10:35 +0300 Subject: [PATCH] [KERNEL32] actctx.c: reduce diff to wine-1.7.55 --- dll/win32/kernel32/wine/actctx.c | 110 +++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 4 deletions(-) diff --git a/dll/win32/kernel32/wine/actctx.c b/dll/win32/kernel32/wine/actctx.c index 369f0c75fea..98adc5c1a25 100644 --- a/dll/win32/kernel32/wine/actctx.c +++ b/dll/win32/kernel32/wine/actctx.c @@ -10,7 +10,7 @@ * Samuel Serapión */ -/* Partly synched with Wine 1.7.17 */ +/* Synched with Wine 1.7.55 */ #include @@ -18,8 +18,6 @@ #include DEBUG_CHANNEL(actctx); -#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa) - /*********************************************************************** * CreateActCtxA (KERNEL32.@) * @@ -116,6 +114,90 @@ HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx) return hActCtx; } +#ifndef __REACTOS__ +/*********************************************************************** + * ActivateActCtx (KERNEL32.@) + * + * Activate an activation context. + */ +BOOL WINAPI ActivateActCtx(HANDLE hActCtx, ULONG_PTR *ulCookie) +{ + NTSTATUS status; + + if ((status = RtlActivateActivationContext( 0, hActCtx, ulCookie ))) + { + SetLastError(RtlNtStatusToDosError(status)); + return FALSE; + } + return TRUE; +} + +/*********************************************************************** + * DeactivateActCtx (KERNEL32.@) + * + * Deactivate an activation context. + */ +BOOL WINAPI DeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie) +{ + RtlDeactivateActivationContext( dwFlags, ulCookie ); + return TRUE; +} + +/*********************************************************************** + * GetCurrentActCtx (KERNEL32.@) + * + * Get the current activation context. + */ +BOOL WINAPI GetCurrentActCtx(HANDLE* phActCtx) +{ + NTSTATUS status; + + if ((status = RtlGetActiveActivationContext(phActCtx))) + { + SetLastError(RtlNtStatusToDosError(status)); + return FALSE; + } + return TRUE; +} + +/*********************************************************************** + * AddRefActCtx (KERNEL32.@) + * + * Add a reference to an activation context. + */ +void WINAPI AddRefActCtx(HANDLE hActCtx) +{ + RtlAddRefActivationContext(hActCtx); +} + +/*********************************************************************** + * ReleaseActCtx (KERNEL32.@) + * + * Release a reference to an activation context. + */ +void WINAPI ReleaseActCtx(HANDLE hActCtx) +{ + RtlReleaseActivationContext(hActCtx); +} + +/*********************************************************************** + * ZombifyActCtx (KERNEL32.@) + * + * Deactivate context without releasing it. + */ +BOOL WINAPI ZombifyActCtx(HANDLE hActCtx) +{ + NTSTATUS status; + + if ((status = RtlZombifyActivationContext(hActCtx))) + { + SetLastError(RtlNtStatusToDosError(status)); + return FALSE; + } + return TRUE; +} +#endif // !__REACTOS__ + /*********************************************************************** * FindActCtxSectionStringA (KERNEL32.@) * @@ -195,4 +277,24 @@ BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID* lpExtGuid, return TRUE; } -/* EOF */ +#ifndef __REACTOS__ +/*********************************************************************** + * QueryActCtxW (KERNEL32.@) + * + * Get information about an activation context. + */ +BOOL WINAPI QueryActCtxW(DWORD dwFlags, HANDLE hActCtx, PVOID pvSubInst, + ULONG ulClass, PVOID pvBuff, SIZE_T cbBuff, + SIZE_T *pcbLen) +{ + NTSTATUS status; + + if ((status = RtlQueryInformationActivationContext( dwFlags, hActCtx, pvSubInst, ulClass, + pvBuff, cbBuff, pcbLen ))) + { + SetLastError(RtlNtStatusToDosError(status)); + return FALSE; + } + return TRUE; +} +#endif // !__REACTOS__