Author: fireball
Date: Sat May 20 18:31:38 2006
New Revision: 21949
URL:
http://svn.reactos.ru/svn/reactos?rev=21949&view=rev
Log:
- Update ActiveContext functions in kernel32.dll, implementing them as "smart
stubs". Implementation taken from Wine's kernel32 (helps Adobe Photoshop 7.0
according to Wine)
Modified:
trunk/reactos/dll/win32/kernel32/misc/actctx.c
trunk/reactos/dll/win32/kernel32/misc/stubs.c
trunk/reactos/include/winbase.h
Modified: trunk/reactos/dll/win32/kernel32/misc/actctx.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/act…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/actctx.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/actctx.c Sat May 20 18:31:38 2006
@@ -2,6 +2,19 @@
#define NDEBUG
#include "../include/debug.h"
+
+#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)
/*
* @implemented
@@ -94,3 +107,162 @@
return hRetVal;
}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+ActivateActCtx(
+ HANDLE hActCtx,
+ ULONG_PTR *ulCookie
+ )
+{
+ DPRINT("ActivateActCtx(%p %p)\n", hActCtx, ulCookie );
+ if (ulCookie)
+ *ulCookie = ACTCTX_FAKE_COOKIE;
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+STDCALL
+AddRefActCtx(
+ HANDLE hActCtx
+ )
+{
+ DPRINT("AddRefActCtx(%p)\n", hActCtx);
+}
+
+/*
+ * @unimplemented
+ */
+HANDLE
+STDCALL
+CreateActCtxW(
+ PCACTCTXW pActCtx
+ )
+{
+ DPRINT("CreateActCtxW(%p %08lx)\n", pActCtx, pActCtx ? pActCtx->dwFlags
: 0);
+
+ 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;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+DeactivateActCtx(
+ DWORD dwFlags,
+ ULONG_PTR ulCookie
+ )
+{
+ DPRINT("DeactivateActCtx(%08lx %08lx)\n", dwFlags, ulCookie);
+ if (ulCookie != ACTCTX_FAKE_COOKIE)
+ return FALSE;
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+FindActCtxSectionGuid(
+ DWORD dwFlags,
+ const GUID *lpExtensionGuid,
+ ULONG ulSectionId,
+ const GUID *lpGuidToFind,
+ PACTCTX_SECTION_KEYED_DATA ReturnedData
+ )
+{
+ DPRINT("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+FindActCtxSectionStringW(
+ DWORD dwFlags,
+ const GUID *lpExtensionGuid,
+ ULONG ulSectionId,
+ LPCWSTR lpStringToFind,
+ PACTCTX_SECTION_KEYED_DATA ReturnedData
+ )
+{
+ DPRINT("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+GetCurrentActCtx(
+ HANDLE *phActCtx)
+{
+ DPRINT("GetCurrentActCtx(%p)\n", phActCtx);
+ *phActCtx = ACTCTX_FAKE_HANDLE;
+ return TRUE;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+QueryActCtxW(
+ DWORD dwFlags,
+ HANDLE hActCtx,
+ PVOID pvSubInstance,
+ ULONG ulInfoClass,
+ PVOID pvBuffer,
+ SIZE_T cbBuffer OPTIONAL,
+ SIZE_T *pcbWrittenOrRequired OPTIONAL
+ )
+{
+ DPRINT("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
+ /* this makes Adobe Photoshop 7.0 happy */
+ SetLastError( ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+/*
+ * @unimplemented
+ */
+VOID
+STDCALL
+ReleaseActCtx(
+ HANDLE hActCtx
+ )
+{
+ DPRINT("ReleaseActCtx(%p)\n", hActCtx);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+ZombifyActCtx(
+ HANDLE hActCtx
+ )
+{
+ DPRINT("ZombifyActCtx(%p)\n", hActCtx);
+ if (hActCtx != ACTCTX_FAKE_HANDLE)
+ return FALSE;
+ return TRUE;
+}
Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/stu…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/kernel32/misc/stubs.c Sat May 20 18:31:38 2006
@@ -362,32 +362,6 @@
*/
BOOL
STDCALL
-ActivateActCtx(
- HANDLE hActCtx,
- ULONG_PTR *lpCookie
- )
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-VOID
-STDCALL
-AddRefActCtx(
- HANDLE hActCtx
- )
-{
- STUB;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
AllocateUserPhysicalPages(
HANDLE hProcess,
PULONG_PTR NumberOfPages,
@@ -429,19 +403,6 @@
/*
* @unimplemented
*/
-HANDLE
-STDCALL
-CreateActCtxW(
- PCACTCTXW pActCtx
- )
-{
- STUB;
- return INVALID_HANDLE_VALUE;
-}
-
-/*
- * @unimplemented
- */
BOOL
STDCALL
CreateJobSet (
@@ -458,37 +419,6 @@
*/
BOOL
STDCALL
-DeactivateActCtx(
- DWORD dwFlags,
- ULONG_PTR ulCookie
- )
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-FindActCtxSectionGuid(
- DWORD dwFlags,
- const GUID *lpExtensionGuid,
- ULONG ulSectionId,
- const GUID *lpGuidToFind,
- PACTCTX_SECTION_KEYED_DATA ReturnedData
- )
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
FindVolumeClose(
HANDLE hFindVolume
)
@@ -520,18 +450,6 @@
PULONG_PTR NumberOfPages,
PULONG_PTR PageArray
)
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetCurrentActCtx(
- HANDLE *lphActCtx)
{
STUB;
return 0;
@@ -707,25 +625,6 @@
*/
BOOL
STDCALL
-QueryActCtxW(
- DWORD dwFlags,
- HANDLE hActCtx,
- PVOID pvSubInstance,
- ULONG ulInfoClass,
- PVOID pvBuffer,
- SIZE_T cbBuffer OPTIONAL,
- SIZE_T *pcbWrittenOrRequired OPTIONAL
- )
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
QueueUserWorkItem(
LPTHREAD_START_ROUTINE Function,
PVOID Context,
@@ -794,18 +693,6 @@
/*
* @unimplemented
*/
-VOID
-STDCALL
-ReleaseActCtx(
- HANDLE hActCtx
- )
-{
- STUB;
-}
-
-/*
- * @unimplemented
- */
ULONG
STDCALL
RemoveVectoredExceptionHandler(
@@ -959,19 +846,6 @@
*/
BOOL
STDCALL
-ZombifyActCtx(
- HANDLE hActCtx
- )
-{
- STUB;
- return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
DeleteVolumeMountPointW(
LPCWSTR lpszVolumeMountPoint
)
@@ -993,23 +867,6 @@
{
STUB;
return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-FindActCtxSectionStringW(
- DWORD dwFlags,
- const GUID *lpExtensionGuid,
- ULONG ulSectionId,
- LPCWSTR lpStringToFind,
- PACTCTX_SECTION_KEYED_DATA ReturnedData
- )
-{
- STUB;
- return FALSE;
}
/*
Modified: trunk/reactos/include/winbase.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/include/winbase.h?rev=21949…
==============================================================================
--- trunk/reactos/include/winbase.h (original)
+++ trunk/reactos/include/winbase.h Sat May 20 18:31:38 2006
@@ -495,6 +495,7 @@
#define ACTCTX_FLAG_RESOURCE_NAME_VALID 0x00000008
#define ACTCTX_FLAG_SET_PROCESS_DEFAULT 0x00000010
#define ACTCTX_FLAG_APPLICATION_NAME_VALID 0x00000020
+#define ACTCTX_FLAG_SOURCE_IS_ASSEMBLYREF 0x00000040
#define ACTCTX_FLAG_HMODULE_VALID 0x00000080
#define DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION 0x00000001
#define FIND_ACTCTX_SECTION_KEY_RETURN_HACTCTX 0x00000001