From 66d05b22429b094baabeccb2b3e991e7929dc6c4 Mon Sep 17 00:00:00 2001 From: John Klehm Date: Wed, 9 Apr 2008 18:44:36 -0500 Subject: wintab32: Implement WTSetA/W --- dlls/wintab32/context.c | 40 ++++++++++++++++++++++++++++++++++------ 1 files changed, 34 insertions(+), 6 deletions(-) diff --git a/dlls/wintab32/context.c b/dlls/wintab32/context.c index 3147ec0..e1c7d00 100644 --- a/dlls/wintab32/context.c +++ b/dlls/wintab32/context.c @@ -692,11 +692,25 @@ BOOL WINAPI WTGetW(HCTX hCtx, LPLOGCONTEXTW lpLogCtx) */ BOOL WINAPI WTSetA(HCTX hCtx, LPLOGCONTEXTA lpLogCtx) { - FIXME("(%p, %p): stub\n", hCtx, lpLogCtx); + LPOPENCONTEXT context; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + TRACE("hCtx=%p, lpLogCtx=%p\n", hCtx, lpLogCtx); - return FALSE; + if (!hCtx || !lpLogCtx) + { + TRACE("no op due to null pointers.\n"); + return FALSE; + } + + /* TODO: if cur process not owner of hCtx only modify + * attribs not locked by owner */ + + EnterCriticalSection(&csTablet); + context = TABLET_FindOpenContext(hCtx); + LOGCONTEXTAtoW(lpLogCtx, &context->context); + LeaveCriticalSection(&csTablet); + + return TRUE; } /*********************************************************************** @@ -704,11 +718,25 @@ BOOL WINAPI WTSetA(HCTX hCtx, LPLOGCONTEXTA lpLogCtx) */ BOOL WINAPI WTSetW(HCTX hCtx, LPLOGCONTEXTW lpLogCtx) { - FIXME("(%p, %p): stub\n", hCtx, lpLogCtx); + LPOPENCONTEXT context; - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + TRACE("hCtx=%p, lpLogCtx=%p\n", hCtx, lpLogCtx); - return FALSE; + if (!hCtx || !lpLogCtx) + { + TRACE("No op due to null pointers.\n"); + return FALSE; + } + + /* TODO: if cur process not hCtx owner only modify + * attribs not locked by owner */ + + EnterCriticalSection(&csTablet); + context = TABLET_FindOpenContext(hCtx); + memmove(&context->context, lpLogCtx, sizeof(LOGCONTEXTW)); + LeaveCriticalSection(&csTablet); + + return TRUE; } /*********************************************************************** -- 1.5.4.5