4 * Copyright 2004 Jon Griffiths
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(actctx);
34 #define ACTCTX_FLAGS_ALL (\
35 ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID |\
36 ACTCTX_FLAG_LANGID_VALID |\
37 ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID |\
38 ACTCTX_FLAG_RESOURCE_NAME_VALID |\
39 ACTCTX_FLAG_SET_PROCESS_DEFAULT |\
40 ACTCTX_FLAG_APPLICATION_NAME_VALID |\
41 ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF |\
42 ACTCTX_FLAG_HMODULE_VALID )
44 #define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
45 #define ACTCTX_FAKE_COOKIE ((ULONG_PTR) 0xf00bad)
47 /***********************************************************************
48 * CreateActCtxA (KERNEL32.@)
50 * Create an activation context.
52 HANDLE WINAPI CreateActCtxA(PCACTCTXA pActCtx)
54 FIXME("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
57 return INVALID_HANDLE_VALUE;
58 if (pActCtx->cbSize != sizeof *pActCtx)
59 return INVALID_HANDLE_VALUE;
60 if (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL)
61 return INVALID_HANDLE_VALUE;
62 return ACTCTX_FAKE_HANDLE;
65 /***********************************************************************
66 * CreateActCtxW (KERNEL32.@)
68 * Create an activation context.
70 HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
72 FIXME("%p %08x\n", pActCtx, pActCtx ? pActCtx->dwFlags : 0);
75 return INVALID_HANDLE_VALUE;
76 if (pActCtx->cbSize != sizeof *pActCtx)
77 return INVALID_HANDLE_VALUE;
78 if (pActCtx->dwFlags & ~ACTCTX_FLAGS_ALL)
79 return INVALID_HANDLE_VALUE;
80 return ACTCTX_FAKE_HANDLE;
83 /***********************************************************************
84 * ActivateActCtx (KERNEL32.@)
86 * Activate an activation context.
88 BOOL WINAPI ActivateActCtx(HANDLE hActCtx, ULONG_PTR *ulCookie)
90 static BOOL reported = FALSE;
93 TRACE("%p %p\n", hActCtx, ulCookie);
96 FIXME("%p %p\n", hActCtx, ulCookie);
101 *ulCookie = ACTCTX_FAKE_COOKIE;
105 /***********************************************************************
106 * DeactivateActCtx (KERNEL32.@)
108 * Deactivate an activation context.
110 BOOL WINAPI DeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
112 static BOOL reported = FALSE;
115 TRACE("%08x %08lx\n", dwFlags, ulCookie);
118 FIXME("%08x %08lx\n", dwFlags, ulCookie);
122 if (ulCookie != ACTCTX_FAKE_COOKIE)
127 /***********************************************************************
128 * GetCurrentActCtx (KERNEL32.@)
130 * Get the current activation context.
132 BOOL WINAPI GetCurrentActCtx(HANDLE* phActCtx)
134 FIXME("%p\n", phActCtx);
135 *phActCtx = ACTCTX_FAKE_HANDLE;
139 /***********************************************************************
140 * AddRefActCtx (KERNEL32.@)
142 * Add a reference to an activation context.
144 void WINAPI AddRefActCtx(HANDLE hActCtx)
146 FIXME("%p\n", hActCtx);
149 /***********************************************************************
150 * ReleaseActCtx (KERNEL32.@)
152 * Release a reference to an activation context.
154 void WINAPI ReleaseActCtx(HANDLE hActCtx)
156 FIXME("%p\n", hActCtx);
159 /***********************************************************************
160 * ZombifyActCtx (KERNEL32.@)
162 * Release a reference to an activation context.
164 BOOL WINAPI ZombifyActCtx(HANDLE hActCtx)
166 FIXME("%p\n", hActCtx);
167 if (hActCtx != ACTCTX_FAKE_HANDLE)
172 /***********************************************************************
173 * FindActCtxSectionStringA (KERNEL32.@)
175 * Find information about a GUID in an activation context.
177 BOOL WINAPI FindActCtxSectionStringA(DWORD dwFlags, const GUID* lpExtGuid,
178 ULONG ulId, LPCSTR lpSearchStr,
179 PACTCTX_SECTION_KEYED_DATA pInfo)
181 FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
182 ulId, debugstr_a(lpSearchStr), pInfo);
183 SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
187 /***********************************************************************
188 * FindActCtxSectionStringW (KERNEL32.@)
190 * Find information about a GUID in an activation context.
192 BOOL WINAPI FindActCtxSectionStringW(DWORD dwFlags, const GUID* lpExtGuid,
193 ULONG ulId, LPCWSTR lpSearchStr,
194 PACTCTX_SECTION_KEYED_DATA pInfo)
196 FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
197 ulId, debugstr_w(lpSearchStr), pInfo);
201 FIXME("expected lpExtGuid == NULL\n");
202 SetLastError(ERROR_INVALID_PARAMETER);
206 if (dwFlags & ~FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX)
208 FIXME("unknown dwFlags %08x\n", dwFlags);
209 SetLastError(ERROR_INVALID_PARAMETER);
213 if (!pInfo || pInfo->cbSize < sizeof (ACTCTX_SECTION_KEYED_DATA))
215 SetLastError(ERROR_INVALID_PARAMETER);
219 pInfo->ulDataFormatVersion = 1;
220 pInfo->lpData = NULL;
221 pInfo->lpSectionGlobalData = NULL;
222 pInfo->ulSectionGlobalDataLength = 0;
223 pInfo->lpSectionBase = NULL;
224 pInfo->ulSectionTotalLength = 0;
225 pInfo->hActCtx = ACTCTX_FAKE_HANDLE;
226 pInfo->ulAssemblyRosterIndex = 0;
231 /***********************************************************************
232 * FindActCtxSectionGuid (KERNEL32.@)
234 * Find information about a GUID in an activation context.
236 BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID* lpExtGuid,
237 ULONG ulId, const GUID* lpSearchGuid,
238 PACTCTX_SECTION_KEYED_DATA pInfo)
240 FIXME("%08x %s %u %s %p\n", dwFlags, debugstr_guid(lpExtGuid),
241 ulId, debugstr_guid(lpSearchGuid), pInfo);
242 SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
246 /***********************************************************************
247 * QueryActCtxW (KERNEL32.@)
249 * Get information about an activation context.
251 BOOL WINAPI QueryActCtxW(DWORD dwFlags, HANDLE hActCtx, PVOID pvSubInst,
252 ULONG ulClass, PVOID pvBuff, SIZE_T cbBuff,
255 FIXME("%08x %p %p %u %p %ld %p\n", dwFlags, hActCtx,
256 pvSubInst, ulClass, pvBuff, cbBuff, pcbLen);
257 /* this makes Adobe Photoshop 7.0 happy */
258 SetLastError( ERROR_CALL_NOT_IMPLEMENTED);