Commit 93652e1a authored by Alexandre Julliard's avatar Alexandre Julliard

Moved a bunch of functions out of libwine/kernel/gdi into USER.

parent b0efe28f
......@@ -25,13 +25,13 @@ import ntdll.dll
7 register VxDCall6(long) VxDCall
8 register VxDCall7(long) VxDCall
9 register VxDCall8(long) VxDCall
10 stdcall k32CharToOemA(str str) CharToOemA
11 stdcall k32CharToOemBuffA(str str long) CharToOemBuffA
12 stdcall k32OemToCharA(ptr ptr) OemToCharA
13 stdcall k32OemToCharBuffA(ptr ptr long) OemToCharBuffA
14 stdcall k32LoadStringA(long long ptr long) LoadStringA
15 varargs k32wsprintfA(str str) wsprintfA
16 stdcall k32wvsprintfA(ptr str ptr) wvsprintfA
10 forward k32CharToOemA user32.CharToOemA
11 forward k32CharToOemBuffA user32.CharToOemBuffA
12 forward k32OemToCharA user32.OemToCharA
13 forward k32OemToCharBuffA user32.OemToCharBuffA
14 forward k32LoadStringA user32.LoadStringA
15 forward k32wsprintfA user32.wsprintfA
16 forward k32wvsprintfA user32.wvsprintfA
17 register CommonUnimpStub() CommonUnimpStub
18 stdcall GetProcessDword(long long) GetProcessDword
19 stub ThunkTheTemplateHandle
......
......@@ -6,17 +6,22 @@ MODULE = user32
SOVERSION = 1.0
WRCEXTRA = -w16 -m
ALTNAMES = user keyboard ddeml display mouse
IMPORTS = gdi32
IMPORTS = gdi32 kernel32
C_SRCS = \
bidi16.c \
cache.c \
ddeml.c \
display.c \
exticon.c \
lstr.c \
misc.c \
mouse.c \
network.c \
user_main.c \
thunk.c
resource.c \
text.c \
thunk.c \
user_main.c
RC_SRCS = \
disp.rc \
......
/*
* String functions
*
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
* Copyright 1996 Marcus Meissner
*/
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "heap.h"
#include "ldt.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(resource);
/***********************************************************************
* FormatMessage16 (USER.606)
*/
DWORD WINAPI FormatMessage16(
DWORD dwFlags,
SEGPTR lpSource, /*not always a valid pointer*/
WORD dwMessageId,
WORD dwLanguageId,
LPSTR lpBuffer, /* *((HLOCAL16*)) for FORMAT_MESSAGE_ALLOCATE_BUFFER*/
WORD nSize,
LPDWORD args /* va_list *args */
) {
#ifdef __i386__
/* This implementation is completely dependant on the format of the va_list on x86 CPUs */
LPSTR target,t;
DWORD talloced;
LPSTR from,f;
DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
BOOL eos = FALSE;
LPSTR allocstring = NULL;
TRACE("(0x%lx,%lx,%d,0x%x,%p,%d,%p)\n",
dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args);
if ((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
&& (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)) return 0;
if ((dwFlags & FORMAT_MESSAGE_FROM_STRING)
&&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
|| (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0;
if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK)
FIXME("line wrapping (%lu) not supported.\n", width);
from = NULL;
if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
from = HEAP_strdupA( GetProcessHeap(), 0, PTR_SEG_TO_LIN(lpSource));
if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) {
from = HeapAlloc( GetProcessHeap(),0,200 );
sprintf(from,"Systemmessage, messageid = 0x%08x\n",dwMessageId);
}
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) {
INT16 bufsize;
HINSTANCE16 hinst16 = ((HMODULE)lpSource & 0xffff);
dwMessageId &= 0xFFFF;
bufsize=LoadString16(hinst16,dwMessageId,NULL,0);
if (bufsize) {
from = HeapAlloc( GetProcessHeap(), 0, bufsize +1);
LoadString16(hinst16,dwMessageId,from,bufsize+1);
}
}
target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100);
t = target;
talloced= 100;
#define ADD_TO_T(c) \
*t++=c;\
if (t-target == talloced) {\
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
t = target+talloced;\
talloced*=2;\
}
if (from) {
f=from;
while (*f && !eos) {
if (*f=='%') {
int insertnr;
char *fmtstr,*x,*lastf;
DWORD *argliststart;
fmtstr = NULL;
lastf = f;
f++;
if (!*f) {
ADD_TO_T('%');
continue;
}
switch (*f) {
case '1':case '2':case '3':case '4':case '5':
case '6':case '7':case '8':case '9':
insertnr=*f-'0';
switch (f[1]) {
case '0':case '1':case '2':case '3':
case '4':case '5':case '6':case '7':
case '8':case '9':
f++;
insertnr=insertnr*10+*f-'0';
f++;
break;
default:
f++;
break;
}
if (*f=='!') {
f++;
if (NULL!=(x=strchr(f,'!'))) {
*x='\0';
fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2);
sprintf(fmtstr,"%%%s",f);
f=x+1;
} else {
fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2);
sprintf(fmtstr,"%%%s",f);
f+=strlen(f); /*at \0*/
}
} else
if(!args)
break;
else
fmtstr=HEAP_strdupA(GetProcessHeap(),0,"%s");
if (args) {
int sz;
LPSTR b = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz = 100);
argliststart=args+insertnr-1;
/* CMF - This makes a BIG assumption about va_list */
while (vsnprintf(b, sz, fmtstr, (va_list) argliststart) < 0) {
b = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, b, sz += 100);
}
for (x=b; *x; x++) ADD_TO_T(*x);
} else {
/* NULL args - copy formatstr
* (probably wrong)
*/
while ((lastf<f)&&(*lastf)) {
ADD_TO_T(*lastf++);
}
}
HeapFree(GetProcessHeap(),0,fmtstr);
break;
case '0': /* Just stop processing format string */
eos = TRUE;
f++;
break;
case 'n': /* 16 bit version just outputs 'n' */
default:
ADD_TO_T(*f++);
break;
}
} else { /* '\n' or '\r' gets mapped to "\r\n" */
if(*f == '\n' || *f == '\r') {
if (width == 0) {
ADD_TO_T('\r');
ADD_TO_T('\n');
if(*f++ == '\r' && *f == '\n')
f++;
}
} else {
ADD_TO_T(*f++);
}
}
}
*t='\0';
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
}
TRACE("-- %s\n",debugstr_a(target));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
/* nSize is the MINIMUM size */
HLOCAL16 h = LocalAlloc16(LPTR,talloced);
SEGPTR ptr = LocalLock16(h);
allocstring = PTR_SEG_TO_LIN( ptr );
memcpy( allocstring,target,talloced);
LocalUnlock16( h );
*((HLOCAL16*)lpBuffer) = h;
} else
lstrcpynA(lpBuffer,target,nSize);
HeapFree(GetProcessHeap(),0,target);
if (from) HeapFree(GetProcessHeap(),0,from);
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
strlen(allocstring):
strlen(lpBuffer);
#else
return 0;
#endif /* __i386__ */
}
#undef ADD_TO_T
/*
* Misc USER functions
*
* Copyright 1995 Thomas Sandford
* Copyright 1997 Marcus Meissner
*/
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(win);
/**********************************************************************
* SetLastErrorEx [USER32.485] Sets the last-error code.
*
* RETURNS
* None.
*/
void WINAPI SetLastErrorEx(
DWORD error, /* [in] Per-thread error code */
DWORD type) /* [in] Error type */
{
TRACE("(0x%08lx, 0x%08lx)\n", error,type);
switch(type) {
case 0:
break;
case SLE_ERROR:
case SLE_MINORERROR:
case SLE_WARNING:
/* Fall through for now */
default:
FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
break;
}
SetLastError( error );
}
/******************************************************************************
* GetProcessWindowStation [USER32.280] Returns handle of window station
*
* NOTES
* Docs say the return value is HWINSTA
*
* RETURNS
* Success: Handle to window station associated with calling process
* Failure: NULL
*/
DWORD WINAPI GetProcessWindowStation(void)
{
FIXME("(void): stub\n");
return 1;
}
/******************************************************************************
* GetThreadDesktop [USER32.295] Returns handle to desktop
*
* NOTES
* Docs say the return value is HDESK
*
* PARAMS
* dwThreadId [I] Thread identifier
*
* RETURNS
* Success: Handle to desktop associated with specified thread
* Failure: NULL
*/
DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
{
FIXME("(%lx): stub\n",dwThreadId);
return 1;
}
/******************************************************************************
* SetDebugErrorLevel [USER32.475]
* Sets the minimum error level for generating debugging events
*
* PARAMS
* dwLevel [I] Debugging error level
*/
VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
{
FIXME("(%ld): stub\n", dwLevel);
}
/******************************************************************************
* GetProcessDefaultLayout [USER32.802]
*
* Gets the default layout for parentless windows.
* Right now, just returns 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
{
if ( !pdwDefaultLayout ) {
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
*pdwDefaultLayout = 0;
return TRUE;
}
/******************************************************************************
* SetProcessDefaultLayout [USER32.803]
*
* Sets the default layout for parentless windows.
* Right now, only accepts 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
{
if ( dwDefaultLayout == 0 )
return TRUE;
FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
}
/******************************************************************************
* OpenDesktopA [USER32.408]
*
* NOTES
* Return type should be HDESK
*
* Not supported on Win9x - returns NULL and calls SetLastError.
*/
HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
BOOL fInherit, DWORD dwDesiredAccess )
{
FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
fInherit,dwDesiredAccess);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/******************************************************************************
* SetUserObjectInformationA (USER32.512)
*/
BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
LPVOID pvInfo, DWORD nLength )
{
FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
return TRUE;
}
/******************************************************************************
* SetThreadDesktop (USER32.510)
*/
BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
{
FIXME("(%x): stub\n",hDesktop);
return TRUE;
}
/***********************************************************************
* RegisterShellHookWindow [USER32.459]
*/
HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
{
FIXME("0x%08lx stub\n",u);
return 0;
}
/***********************************************************************
* DeregisterShellHookWindow [USER32.132]
*/
HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
{
FIXME("0x%08lx stub\n",u);
return 0;
}
/***********************************************************************
* RegisterTaskList [USER23.436]
*/
DWORD WINAPI RegisterTaskList (DWORD x)
{
FIXME("0x%08lx\n",x);
return TRUE;
}
......@@ -7,7 +7,6 @@ MODULE = graphics
C_SRCS = \
bitblt.c \
cache.c \
dispdib.c \
driver.c \
env.c \
......
......@@ -30,11 +30,8 @@
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "task.h"
#include "heap.h"
#include "ldt.h"
#include "stackframe.h"
#include "module.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(resource);
......@@ -462,180 +459,3 @@ BOOL WINAPI IsCharUpperW(WCHAR x)
{
return iswupper(x);
}
/***********************************************************************
* FormatMessage16 (USER.606)
*/
DWORD WINAPI FormatMessage16(
DWORD dwFlags,
SEGPTR lpSource, /*not always a valid pointer*/
WORD dwMessageId,
WORD dwLanguageId,
LPSTR lpBuffer, /* *((HLOCAL16*)) for FORMAT_MESSAGE_ALLOCATE_BUFFER*/
WORD nSize,
LPDWORD args /* va_list *args */
) {
#ifdef __i386__
/* This implementation is completely dependant on the format of the va_list on x86 CPUs */
LPSTR target,t;
DWORD talloced;
LPSTR from,f;
DWORD width = dwFlags & FORMAT_MESSAGE_MAX_WIDTH_MASK;
BOOL eos = FALSE;
LPSTR allocstring = NULL;
TRACE("(0x%lx,%lx,%d,0x%x,%p,%d,%p)\n",
dwFlags,lpSource,dwMessageId,dwLanguageId,lpBuffer,nSize,args);
if ((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
&& (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)) return 0;
if ((dwFlags & FORMAT_MESSAGE_FROM_STRING)
&&((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM)
|| (dwFlags & FORMAT_MESSAGE_FROM_HMODULE))) return 0;
if (width && width != FORMAT_MESSAGE_MAX_WIDTH_MASK)
FIXME("line wrapping (%lu) not supported.\n", width);
from = NULL;
if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
from = HEAP_strdupA( GetProcessHeap(), 0, PTR_SEG_TO_LIN(lpSource));
if (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) {
from = HeapAlloc( GetProcessHeap(),0,200 );
sprintf(from,"Systemmessage, messageid = 0x%08x\n",dwMessageId);
}
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE) {
INT16 bufsize;
HINSTANCE16 hinst16 = ((HMODULE)lpSource & 0xffff);
dwMessageId &= 0xFFFF;
bufsize=LoadString16(hinst16,dwMessageId,NULL,0);
if (bufsize) {
from = HeapAlloc( GetProcessHeap(), 0, bufsize +1);
LoadString16(hinst16,dwMessageId,from,bufsize+1);
}
}
target = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, 100);
t = target;
talloced= 100;
#define ADD_TO_T(c) \
*t++=c;\
if (t-target == talloced) {\
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,talloced*2);\
t = target+talloced;\
talloced*=2;\
}
if (from) {
f=from;
while (*f && !eos) {
if (*f=='%') {
int insertnr;
char *fmtstr,*x,*lastf;
DWORD *argliststart;
fmtstr = NULL;
lastf = f;
f++;
if (!*f) {
ADD_TO_T('%');
continue;
}
switch (*f) {
case '1':case '2':case '3':case '4':case '5':
case '6':case '7':case '8':case '9':
insertnr=*f-'0';
switch (f[1]) {
case '0':case '1':case '2':case '3':
case '4':case '5':case '6':case '7':
case '8':case '9':
f++;
insertnr=insertnr*10+*f-'0';
f++;
break;
default:
f++;
break;
}
if (*f=='!') {
f++;
if (NULL!=(x=strchr(f,'!'))) {
*x='\0';
fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2);
sprintf(fmtstr,"%%%s",f);
f=x+1;
} else {
fmtstr=HeapAlloc(GetProcessHeap(),0,strlen(f)+2);
sprintf(fmtstr,"%%%s",f);
f+=strlen(f); /*at \0*/
}
} else
if(!args)
break;
else
fmtstr=HEAP_strdupA(GetProcessHeap(),0,"%s");
if (args) {
int sz;
LPSTR b = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sz = 100);
argliststart=args+insertnr-1;
/* CMF - This makes a BIG assumption about va_list */
while (vsnprintf(b, sz, fmtstr, (va_list) argliststart) < 0) {
b = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, b, sz += 100);
}
for (x=b; *x; x++) ADD_TO_T(*x);
} else {
/* NULL args - copy formatstr
* (probably wrong)
*/
while ((lastf<f)&&(*lastf)) {
ADD_TO_T(*lastf++);
}
}
HeapFree(GetProcessHeap(),0,fmtstr);
break;
case '0': /* Just stop processing format string */
eos = TRUE;
f++;
break;
case 'n': /* 16 bit version just outputs 'n' */
default:
ADD_TO_T(*f++);
break;
}
} else { /* '\n' or '\r' gets mapped to "\r\n" */
if(*f == '\n' || *f == '\r') {
if (width == 0) {
ADD_TO_T('\r');
ADD_TO_T('\n');
if(*f++ == '\r' && *f == '\n')
f++;
}
} else {
ADD_TO_T(*f++);
}
}
}
*t='\0';
}
talloced = strlen(target)+1;
if (nSize && talloced<nSize) {
target = (char*)HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,target,nSize);
}
TRACE("-- %s\n",debugstr_a(target));
if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) {
/* nSize is the MINIMUM size */
*((HLOCAL16*)lpBuffer)= LocalAlloc16(LPTR,talloced);
allocstring=PTR_SEG_OFF_TO_LIN(CURRENT_DS,*((HLOCAL16*)lpBuffer));
memcpy( allocstring,target,talloced);
} else
lstrcpynA(lpBuffer,target,nSize);
HeapFree(GetProcessHeap(),0,target);
if (from) HeapFree(GetProcessHeap(),0,from);
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
strlen(allocstring):
strlen(lpBuffer);
#else
return 0;
#endif /* __i386__ */
}
#undef ADD_TO_T
......@@ -746,16 +746,6 @@ BOOL16 WINAPI IsDCCurrentPalette16(HDC16 hDC)
/***********************************************************************
* SelectPalette16 (USER.282)
*/
HPALETTE16 WINAPI SelectPalette16( HDC16 hDC, HPALETTE16 hPal,
BOOL16 bForceBackground )
{
return SelectPalette( hDC, hPal, bForceBackground );
}
/***********************************************************************
* SelectPalette [GDI32.300] Selects logical palette into DC
*
* RETURNS
......@@ -784,15 +774,6 @@ HPALETTE WINAPI SelectPalette(
/***********************************************************************
* RealizePalette16 (USER.283)
*/
UINT16 WINAPI RealizePalette16( HDC16 hDC )
{
return RealizePalette( hDC );
}
/***********************************************************************
* RealizePalette [GDI32.280] Maps palette entries to system palette
*
* RETURNS
......
......@@ -28,8 +28,6 @@
#include "stackframe.h"
#include "builtin16.h"
#include "debugtools.h"
#include "queue.h"
#include "hook.h"
#include "winnls.h"
DEFAULT_DEBUG_CHANNEL(thread);
......@@ -360,32 +358,6 @@ void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
/**********************************************************************
* SetLastErrorEx [USER32.485] Sets the last-error code.
*
* RETURNS
* None.
*/
void WINAPI SetLastErrorEx(
DWORD error, /* [in] Per-thread error code */
DWORD type) /* [in] Error type */
{
TRACE("(0x%08lx, 0x%08lx)\n", error,type);
switch(type) {
case 0:
break;
case SLE_ERROR:
case SLE_MINORERROR:
case SLE_WARNING:
/* Fall through for now */
default:
FIXME("(error=%08lx, type=%08lx): Unhandled type\n", error,type);
break;
}
SetLastError( error );
}
/**********************************************************************
* TlsAlloc [KERNEL32.530] Allocates a TLS index.
*
* Allocates a thread local storage index
......@@ -748,95 +720,6 @@ BOOL WINAPI GetThreadTimes(
/**********************************************************************
* AttachThreadInput [KERNEL32.8] Attaches input of 1 thread to other
*
* Attaches the input processing mechanism of one thread to that of
* another thread.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* TODO:
* 1. Reset the Key State (currenly per thread key state is not maintained)
*/
BOOL WINAPI AttachThreadInput(
DWORD idAttach, /* [in] Thread to attach */
DWORD idAttachTo, /* [in] Thread to attach to */
BOOL fAttach) /* [in] Attach or detach */
{
#if 0 /* FIXME: cannot call USER functions here */
MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
BOOL16 bRet = 0;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
/* A thread cannot attach to itself */
if ( idAttach == idAttachTo )
goto CLEANUP;
/* According to the docs this method should fail if a
* "Journal record" hook is installed. (attaches all input queues together)
*/
if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
goto CLEANUP;
/* Retrieve message queues corresponding to the thread id's */
pTgtMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue16( idAttach ) );
pSrcMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue16( idAttachTo ) );
/* Ensure we have message queues and that Src and Tgt threads
* are not system threads.
*/
if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
goto CLEANUP;
if (fAttach) /* Attach threads */
{
/* Only attach if currently detached */
if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
{
/* First release the target threads perQData */
PERQDATA_Release( pTgtMsgQ->pQData );
/* Share a reference to the source threads perQDATA */
PERQDATA_Addref( pSrcMsgQ->pQData );
pTgtMsgQ->pQData = pSrcMsgQ->pQData;
}
}
else /* Detach threads */
{
/* Only detach if currently attached */
if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
{
/* First release the target threads perQData */
PERQDATA_Release( pTgtMsgQ->pQData );
/* Give the target thread its own private perQDATA once more */
pTgtMsgQ->pQData = PERQDATA_CreateInstance();
}
}
/* TODO: Reset the Key State */
bRet = 1; /* Success */
CLEANUP:
/* Unlock the queues before returning */
if ( pSrcMsgQ )
QUEUE_Unlock( pSrcMsgQ );
if ( pTgtMsgQ )
QUEUE_Unlock( pTgtMsgQ );
return bRet;
#endif
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
FIXME( "broken for now\n" );
return FALSE;
}
/**********************************************************************
* VWin32_BoostThreadGroup [KERNEL.535]
*/
VOID WINAPI VWin32_BoostThreadGroup( DWORD threadId, INT boost )
......
......@@ -14,7 +14,6 @@ C_SRCS = \
init.c \
kernel32.c \
newfns.c \
ordinals.c \
process.c \
struct32.c \
time.c
......
......@@ -227,56 +227,6 @@ DWORD WINAPI GetCompressedFileSizeW(
/******************************************************************************
* GetProcessWindowStation [USER32.280] Returns handle of window station
*
* NOTES
* Docs say the return value is HWINSTA
*
* RETURNS
* Success: Handle to window station associated with calling process
* Failure: NULL
*/
DWORD WINAPI GetProcessWindowStation(void)
{
FIXME("(void): stub\n");
return 1;
}
/******************************************************************************
* GetThreadDesktop [USER32.295] Returns handle to desktop
*
* NOTES
* Docs say the return value is HDESK
*
* PARAMS
* dwThreadId [I] Thread identifier
*
* RETURNS
* Success: Handle to desktop associated with specified thread
* Failure: NULL
*/
DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
{
FIXME("(%lx): stub\n",dwThreadId);
return 1;
}
/******************************************************************************
* SetDebugErrorLevel [USER32.475]
* Sets the minimum error level for generating debugging events
*
* PARAMS
* dwLevel [I] Debugging error level
*/
VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
{
FIXME("(%ld): stub\n", dwLevel);
}
/******************************************************************************
* SetComputerNameA [KERNEL32.621]
*/
BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
......@@ -311,44 +261,6 @@ BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,LPDWORD
}
/******************************************************************************
* OpenDesktopA [USER32.408]
*
* NOTES
* Return type should be HDESK
*
* Not supported on Win9x - returns NULL and calls SetLastError.
*/
HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
BOOL fInherit, DWORD dwDesiredAccess )
{
FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
fInherit,dwDesiredAccess);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return 0;
}
/******************************************************************************
* SetUserObjectInformationA
*/
BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, INT nIndex,
LPVOID pvInfo, DWORD nLength )
{
FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
return TRUE;
}
/******************************************************************************
* SetThreadDesktop
*/
BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
{
FIXME("(%x): stub\n",hDesktop);
return TRUE;
}
/******************************************************************************
* CreateIoCompletionPort
*/
HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle,
......@@ -358,52 +270,3 @@ DWORD dwNumberOfConcurrentThreads)
FIXME("(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle, hExistingCompletionPort, dwCompletionKey, dwNumberOfConcurrentThreads);
return (HANDLE)NULL;
}
/******************************************************************************
* GetProcessDefaultLayout [USER32.802]
*
* Gets the default layout for parentless windows.
* Right now, just returns 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
{
if ( !pdwDefaultLayout ) {
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
FIXME( "( %p ): No BiDi\n", pdwDefaultLayout );
*pdwDefaultLayout = 0;
return TRUE;
}
/******************************************************************************
* SetProcessDefaultLayout [USER32.803]
*
* Sets the default layout for parentless windows.
* Right now, only accepts 0 (left-to-right).
*
* RETURNS
* Success: Nonzero
* Failure: Zero
*
* BUGS
* No RTL
*/
BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
{
if ( dwDefaultLayout == 0 )
return TRUE;
FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout );
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE;
}
/*
* Win32 ordinal only exported functions that can't be stuffed somehwere else.
*
* Copyright 1997 Marcus Meissner
*/
#include "thread.h"
#include "winerror.h"
#include "heap.h"
#include "selectors.h"
#include "miscemu.h"
#include "winnt.h"
#include "process.h"
#include "module.h"
#include "task.h"
#include "callback.h"
#include "stackframe.h"
#include "debugtools.h"
DECLARE_DEBUG_CHANNEL(win);
/***********************************************************************
* RegisterShellHookWindow [USER32.459]
*/
HRESULT WINAPI RegisterShellHookWindow ( DWORD u )
{ FIXME_(win)("0x%08lx stub\n",u);
return 0;
}
/***********************************************************************
* DeregisterShellHookWindow [USER32.132]
*/
HRESULT WINAPI DeregisterShellHookWindow ( DWORD u )
{ FIXME_(win)("0x%08lx stub\n",u);
return 0;
}
/***********************************************************************
* RegisterTaskList [USER23.436]
*/
DWORD WINAPI RegisterTaskList (DWORD x)
{ FIXME_(win)("0x%08lx\n",x);
return TRUE;
}
......@@ -8,6 +8,7 @@
#include <assert.h>
#include "windef.h"
#include "wingdi.h"
#include "winerror.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "miscemu.h"
......@@ -1660,3 +1661,88 @@ LONG WINAPI GetMessageExtraInfo(void)
return ret;
}
/**********************************************************************
* AttachThreadInput [USER32.8] Attaches input of 1 thread to other
*
* Attaches the input processing mechanism of one thread to that of
* another thread.
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* TODO:
* 1. Reset the Key State (currenly per thread key state is not maintained)
*/
BOOL WINAPI AttachThreadInput(
DWORD idAttach, /* [in] Thread to attach */
DWORD idAttachTo, /* [in] Thread to attach to */
BOOL fAttach) /* [in] Attach or detach */
{
MESSAGEQUEUE *pSrcMsgQ = 0, *pTgtMsgQ = 0;
BOOL16 bRet = 0;
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
/* A thread cannot attach to itself */
if ( idAttach == idAttachTo )
goto CLEANUP;
/* According to the docs this method should fail if a
* "Journal record" hook is installed. (attaches all input queues together)
*/
if ( HOOK_IsHooked( WH_JOURNALRECORD ) )
goto CLEANUP;
/* Retrieve message queues corresponding to the thread id's */
pTgtMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue16( idAttach ) );
pSrcMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( GetThreadQueue16( idAttachTo ) );
/* Ensure we have message queues and that Src and Tgt threads
* are not system threads.
*/
if ( !pSrcMsgQ || !pTgtMsgQ || !pSrcMsgQ->pQData || !pTgtMsgQ->pQData )
goto CLEANUP;
if (fAttach) /* Attach threads */
{
/* Only attach if currently detached */
if ( pTgtMsgQ->pQData != pSrcMsgQ->pQData )
{
/* First release the target threads perQData */
PERQDATA_Release( pTgtMsgQ->pQData );
/* Share a reference to the source threads perQDATA */
PERQDATA_Addref( pSrcMsgQ->pQData );
pTgtMsgQ->pQData = pSrcMsgQ->pQData;
}
}
else /* Detach threads */
{
/* Only detach if currently attached */
if ( pTgtMsgQ->pQData == pSrcMsgQ->pQData )
{
/* First release the target threads perQData */
PERQDATA_Release( pTgtMsgQ->pQData );
/* Give the target thread its own private perQDATA once more */
pTgtMsgQ->pQData = PERQDATA_CreateInstance();
}
}
/* TODO: Reset the Key State */
bRet = 1; /* Success */
CLEANUP:
/* Unlock the queues before returning */
if ( pSrcMsgQ )
QUEUE_Unlock( pSrcMsgQ );
if ( pTgtMsgQ )
QUEUE_Unlock( pTgtMsgQ );
return bRet;
}
......@@ -279,7 +279,7 @@ rc.left, rc.top, rc.right, rc.bottom, (UINT16)flags );
if( (dc = (DC *)GDI_GetObjPtr(hDC, DC_MAGIC)) )
{
if (dc->w.hVisRgn) {
wnd->pDriver->pSurfaceCopy(wnd,dc,dx,dy,&rc,bUpdate);
wnd->pDriver->pSurfaceCopy(wnd,hDC,dx,dy,&rc,bUpdate);
if( bUpdate )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment