2004-01-30 23:57:21 +01:00
|
|
|
/*
|
|
|
|
* Activation contexts
|
|
|
|
*
|
|
|
|
* Copyright 2004 Jon Griffiths
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-01-30 23:57:21 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "winnls.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(actctx);
|
|
|
|
|
|
|
|
|
2006-03-07 10:24:24 +01:00
|
|
|
#define ACTCTX_FLAGS_ALL (\
|
|
|
|
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID |\
|
|
|
|
ACTCTX_FLAG_LANGID_VALID |\
|
|
|
|
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID |\
|
|
|
|
ACTCTX_FLAG_RESOURCE_NAME_VALID |\
|
|
|
|
ACTCTX_FLAG_SET_PROCESS_DEFAULT |\
|
|
|
|
ACTCTX_FLAG_APPLICATION_NAME_VALID |\
|
|
|
|
ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF |\
|
|
|
|
ACTCTX_FLAG_HMODULE_VALID )
|
|
|
|
|
|
|
|
#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
|
|
|
|
#define ACTCTX_FAKE_COOKIE ((ULONG_PTR) 0xf00bad)
|
|
|
|
|
2004-01-30 23:57:21 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* CreateActCtxA (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Create an activation context.
|
|
|
|
*/
|
2004-02-27 22:28:34 +01:00
|
|
|
HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
|
2006-03-07 10:24:24 +01:00
|
|
|
|
|
|
|
if (!pActCtx)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
if (pActCtx->cbSize != sizeof *pActCtx)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
if (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
return ACTCTX_FAKE_HANDLE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateActCtxW (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Create an activation context.
|
|
|
|
*/
|
2004-02-27 22:28:34 +01:00
|
|
|
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
|
2006-03-07 10:24:24 +01:00
|
|
|
|
|
|
|
if (!pActCtx)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
if (pActCtx->cbSize != sizeof *pActCtx)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
if (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL)
|
|
|
|
return INVALID_HANDLE_VALUE;
|
|
|
|
return ACTCTX_FAKE_HANDLE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ActivateActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Activate an activation context.
|
|
|
|
*/
|
2004-02-27 22:28:34 +01:00
|
|
|
BOOL WINAPI ActivateActCtx(HANDLE hActCtx, ULONG_PTR *ulCookie)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-03-07 10:24:24 +01:00
|
|
|
FIXME("%p %p\n", hActCtx, ulCookie );
|
|
|
|
if (ulCookie)
|
|
|
|
*ulCookie = ACTCTX_FAKE_COOKIE;
|
|
|
|
return TRUE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DeactivateActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Deactivate an activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI DeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
|
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%08x %08lx\n", dwFlags, ulCookie);
|
2006-03-07 10:24:24 +01:00
|
|
|
if (ulCookie != ACTCTX_FAKE_COOKIE)
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetCurrentActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Get the current activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI GetCurrentActCtx(HANDLE* phActCtx)
|
|
|
|
{
|
2006-03-07 10:24:24 +01:00
|
|
|
FIXME("%p\n", phActCtx);
|
|
|
|
*phActCtx = ACTCTX_FAKE_HANDLE;
|
|
|
|
return TRUE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* AddRefActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Add a reference to an activation context.
|
|
|
|
*/
|
|
|
|
void WINAPI AddRefActCtx(HANDLE hActCtx)
|
|
|
|
{
|
2006-03-07 10:24:24 +01:00
|
|
|
FIXME("%p\n", hActCtx);
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ReleaseActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Release a reference to an activation context.
|
|
|
|
*/
|
|
|
|
void WINAPI ReleaseActCtx(HANDLE hActCtx)
|
|
|
|
{
|
2006-03-07 10:24:24 +01:00
|
|
|
FIXME("%p\n", hActCtx);
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ZombifyActCtx (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Release a reference to an activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
|
|
|
|
{
|
2006-03-07 10:24:24 +01:00
|
|
|
FIXME("%p\n", hActCtx);
|
|
|
|
if (hActCtx != ACTCTX_FAKE_HANDLE)
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* FindActCtxSectionStringA (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Find information about a GUID in an activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID* lpExtGuid,
|
|
|
|
ULONG ulId, LPCSTR lpSearchStr,
|
2004-02-27 22:28:34 +01:00
|
|
|
PACTCTX_SECTION_KEYED_DATA pInfo)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
|
2006-08-21 07:28:20 +02:00
|
|
|
ulId, debugstr_a(lpSearchStr), pInfo);
|
|
|
|
SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
|
2004-01-30 23:57:21 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* FindActCtxSectionStringW (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Find information about a GUID in an activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID* lpExtGuid,
|
|
|
|
ULONG ulId, LPCWSTR lpSearchStr,
|
2004-02-27 22:28:34 +01:00
|
|
|
PACTCTX_SECTION_KEYED_DATA pInfo)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
|
2006-10-05 08:12:35 +02:00
|
|
|
ulId, debugstr_w(lpSearchStr), pInfo);
|
|
|
|
|
|
|
|
if (lpExtGuid)
|
|
|
|
{
|
|
|
|
FIXME("expected lpExtGuid == NULL\n");
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dwFlags & ~FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
|
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("unknown dwFlags %08x\n", dwFlags);
|
2006-10-05 08:12:35 +02:00
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!pInfo || pInfo->cbSize < sizeof (ACTCTX_SECTION_KEYED_DATA))
|
|
|
|
{
|
|
|
|
SetLastError(ERROR_INVALID_PARAMETER);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pInfo->ulDataFormatVersion = 1;
|
|
|
|
pInfo->lpData = NULL;
|
|
|
|
pInfo->lpSectionGlobalData = NULL;
|
|
|
|
pInfo->ulSectionGlobalDataLength = 0;
|
|
|
|
pInfo->lpSectionBase = NULL;
|
|
|
|
pInfo->ulSectionTotalLength = 0;
|
|
|
|
pInfo->hActCtx = ACTCTX_FAKE_HANDLE;
|
|
|
|
pInfo->ulAssemblyRosterIndex = 0;
|
|
|
|
|
|
|
|
return TRUE;
|
2004-01-30 23:57:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* FindActCtxSectionGuid (KERNEL32.@)
|
|
|
|
*
|
|
|
|
* Find information about a GUID in an activation context.
|
|
|
|
*/
|
|
|
|
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID* lpExtGuid,
|
|
|
|
ULONG ulId, const GUID* lpSearchGuid,
|
2004-02-27 22:28:34 +01:00
|
|
|
PACTCTX_SECTION_KEYED_DATA pInfo)
|
2004-01-30 23:57:21 +01:00
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
|
2006-08-21 07:28:20 +02:00
|
|
|
ulId, debugstr_guid(lpSearchGuid), pInfo);
|
|
|
|
SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
|
2004-01-30 23:57:21 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* 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)
|
|
|
|
{
|
2006-10-12 22:56:29 +02:00
|
|
|
FIXME("%08x %p %p %u %p %ld %p\n", dwFlags, hActCtx,
|
2006-08-21 07:28:20 +02:00
|
|
|
pvSubInst, ulClass, pvBuff, cbBuff, pcbLen);
|
2004-06-14 18:59:19 +02:00
|
|
|
/* this makes Adobe Photoshop 7.0 happy */
|
|
|
|
SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
|
2004-01-30 23:57:21 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|