Commit 3850c1ae authored by Alexandre Julliard's avatar Alexandre Julliard

Moved most USER string functions to dlls/user.

Cleaned up a few more inter-dll dependencies.
parent cb10fdab
......@@ -87,6 +87,8 @@ static int CONSOLE_Init(void)
if the resolution is set on the command-line... */
CONSOLE_NotifyResizeScreen(driver.x_res, driver.y_res);
atexit(CONSOLE_Close);
/* For now, always return TRUE */
return TRUE;
}
......@@ -104,7 +106,7 @@ void CONSOLE_Write(char out, int fg_color, int bg_color, int attribute)
}
}
void CONSOLE_Close()
void CONSOLE_Close(void)
{
if (driver.close)
driver.close();
......
......@@ -30,13 +30,6 @@ DEFAULT_DEBUG_CHANNEL(commctrl);
extern HANDLE COMCTL32_hHeap; /* handle to the private heap */
/*
* We put some function prototypes here that don't seem to belong in
* any header file. When they find their place, we can remove them.
*/
extern LPSTR WINAPI lstrrchr(LPCSTR, LPCSTR, WORD);
extern LPWSTR WINAPI lstrrchrw(LPCWSTR, LPCWSTR, WORD);
typedef struct _STREAMDATA
{
......@@ -2168,18 +2161,43 @@ INT WINAPI COMCTL32_StrCmpNIW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) {
* StrRChrA [COMCTL32.351]
*
*/
LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch) {
return lstrrchr(lpStart, lpEnd, wMatch);
LPSTR WINAPI COMCTL32_StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
{
LPCSTR lpGotIt = NULL;
BOOL dbcs = IsDBCSLeadByte( LOBYTE(wMatch) );
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
{
if (*lpStart != LOBYTE(wMatch)) continue;
if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue;
lpGotIt = lpStart;
}
return (LPSTR)lpGotIt;
}
/**************************************************************************
* StrRChrW [COMCTL32.359]
*
*/
LPWSTR WINAPI COMCTL32_StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch) {
return lstrrchrw(lpStart, lpEnd, wMatch);
LPWSTR WINAPI COMCTL32_StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch)
{
LPCWSTR lpGotIt = NULL;
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlenW(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
if (*lpStart == wMatch) lpGotIt = lpStart;
return (LPWSTR)lpGotIt;
}
/**************************************************************************
* StrStrA [COMCTL32.354]
*
......
......@@ -38,3 +38,12 @@ BOOL WINAPI MAIN_GdiInit(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved
return TRUE;
}
/***********************************************************************
* Copy (GDI.250)
*/
void WINAPI Copy16( LPVOID src, LPVOID dst, WORD size )
{
memcpy( dst, src, size );
}
......@@ -83,17 +83,17 @@ owner kernel32
75 stub OpenPathName
76 stub DeletePathName
# Reserved*: old Win 2.x functions now moved to USER (Win 3.0+)
77 pascal Reserved1(segptr) AnsiNext16
78 pascal Reserved2(segptr segptr) AnsiPrev16
79 pascal Reserved3(segstr) AnsiUpper16
80 pascal Reserved4(segstr) AnsiLower16
77 stub Reserved1 #AnsiNext16
78 stub Reserved2 #AnsiPrev16
79 stub Reserved3 #AnsiUpper16
80 stub Reserved4 #AnsiLower16
81 pascal16 _lclose(word) _lclose16
82 pascal16 _lread(word segptr word) WIN16_lread
83 pascal16 _lcreat(str word) _lcreat16
84 pascal _llseek(word long word) _llseek16
85 pascal16 _lopen(str word) _lopen16
86 pascal16 _lwrite(word ptr word) _lwrite16
87 pascal16 Reserved5(str str) lstrcmp16
87 pascal16 Reserved5(str str) strcmp
88 pascal lstrcpy(segptr str) lstrcpy16
89 pascal lstrcat(segstr str) lstrcat16
90 pascal16 lstrlen(str) lstrlen16
......@@ -291,7 +291,7 @@ owner kernel32
345 pascal16 IsSharedSelector(word) IsSharedSelector16
346 pascal16 IsBadHugeReadPtr(segptr long) IsBadHugeReadPtr16
347 pascal16 IsBadHugeWritePtr(segptr long) IsBadHugeWritePtr16
348 pascal16 hmemcpy(ptr ptr long) hmemcpy16
348 pascal16 hmemcpy(ptr ptr long) memcpy
349 pascal _hread(word segptr long) WIN16_hread
350 pascal _hwrite(word ptr long) _hwrite16
351 pascal16 BUNNY_351() KERNEL_nop
......
......@@ -98,3 +98,10 @@ BOOL WINAPI MAIN_KernelInit( HINSTANCE hinst, DWORD reason, LPVOID reserved )
}
return TRUE;
}
/***********************************************************************
* KERNEL_nop
*
* Entry point for kernel functions that do nothing.
*/
LONG WINAPI KERNEL_nop(void) { return 0; }
......@@ -5,6 +5,7 @@
* Copyright 1999 Alexandre Julliard
*/
#include <assert.h>
#include <signal.h>
#include "winnt.h"
#include "ntddk.h"
......@@ -75,12 +76,12 @@ static DWORD EXC_CallHandler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame,
newframe.frame.Handler = nested_handler;
newframe.prevFrame = frame;
EXC_push_frame( &newframe.frame );
__wine_push_frame( &newframe.frame );
TRACE( "calling handler at %p code=%lx flags=%lx\n",
handler, record->ExceptionCode, record->ExceptionFlags );
ret = handler( record, frame, context, dispatcher );
TRACE( "handler returned %lx\n", ret );
EXC_pop_frame( &newframe.frame );
__wine_pop_frame( &newframe.frame );
return ret;
}
......@@ -259,7 +260,7 @@ void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME pEndFrame, LPVOID unusedEip,
RtlRaiseException( &newrec ); /* never returns */
break;
}
frame = EXC_pop_frame( frame );
frame = __wine_pop_frame( frame );
}
}
......@@ -292,3 +293,60 @@ void WINAPI RtlRaiseStatus( NTSTATUS status )
ExceptionRec.NumberParameters = 0;
RtlRaiseException( &ExceptionRec );
}
/*************************************************************
* __wine_exception_handler
*
* Exception handler for exception blocks declared in Wine code.
*/
DWORD __wine_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
if (wine_frame->u.filter)
{
EXCEPTION_POINTERS ptrs;
ptrs.ExceptionRecord = record;
ptrs.ContextRecord = context;
switch(wine_frame->u.filter( &ptrs ))
{
case EXCEPTION_CONTINUE_SEARCH:
return ExceptionContinueSearch;
case EXCEPTION_CONTINUE_EXECUTION:
return ExceptionContinueExecution;
case EXCEPTION_EXECUTE_HANDLER:
break;
default:
MESSAGE( "Invalid return value from exception filter\n" );
assert( FALSE );
}
}
/* hack to make GetExceptionCode() work in handler */
wine_frame->ExceptionCode = record->ExceptionCode;
wine_frame->ExceptionRecord = wine_frame;
RtlUnwind( frame, 0, record, 0 );
__wine_pop_frame( frame );
longjmp( wine_frame->jmp, 1 );
}
/*************************************************************
* __wine_finally_handler
*
* Exception handler for try/finally blocks declared in Wine code.
*/
DWORD __wine_finally_handler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
if (!(record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)))
return ExceptionContinueSearch;
wine_frame->u.finally_func( FALSE );
return ExceptionContinueSearch;
}
......@@ -991,3 +991,7 @@ type win32
@ stub _wtol
@ stub RtlSetPropertySetClassId
@ stdcall NtPowerInformation(long long long long long) NtPowerInformation
# Wine extensions
@ cdecl __wine_exception_handler(ptr ptr ptr ptr) __wine_exception_handler
@ cdecl __wine_finally_handler(ptr ptr ptr ptr) __wine_finally_handler
......@@ -265,10 +265,10 @@ import kernel32.dll
314 stub StrNCmpW
315 stdcall StrNCpyA (ptr str long) lstrcpynA
316 stdcall StrNCpyW (ptr wstr long)lstrcpynW
317 stdcall StrRChrA (str str long) lstrrchr
317 forward StrRChrA shlwapi.StrRChrA
318 stub StrRChrIA
319 stub StrRChrIW
320 stdcall StrRChrW (wstr wstr long) lstrrchrw
320 forward StrRChrW shlwapi.StrRChrW
321 stub StrRStrA
322 stub StrRStrIA
323 stub StrRStrIW
......
......@@ -639,10 +639,10 @@ import kernel32
@ stub StrNCatW
@ stub StrPBrkA
@ stub StrPBrkW
@ stdcall StrRChrA (str str long) lstrrchr
@ stdcall StrRChrA (str str long) StrRChrA
@ stub StrRChrIA
@ stub StrRChrIW
@ stdcall StrRChrW (wstr wstr long) lstrrchrw
@ stdcall StrRChrW (wstr wstr long) StrRChrW
@ stub StrRStrIA
@ stub StrRStrIW
@ stub StrSpnA
......
......@@ -169,7 +169,7 @@ LPSTR WINAPI StrDupA (LPCSTR lpSrc)
*/
LPWSTR WINAPI StrDupW (LPCWSTR lpSrc)
{
int len = lstrlenW(lpSrc);
int len = strlenW(lpSrc);
LPWSTR lpDest = (LPWSTR) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * (len+1));
TRACE("%s\n", debugstr_w(lpSrc));
......@@ -207,12 +207,12 @@ int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet)
*/
int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
{
int i,j, pos = lstrlenW(lpStr);
int i,j, pos = strlenW(lpStr);
TRACE("(%p %s %p %s)\n",
lpStr, debugstr_w(lpStr), lpSet, debugstr_w(lpSet));
for (i=0; i < lstrlenW(lpSet) ; i++ )
for (i=0; i < strlenW(lpSet) ; i++ )
{
for (j = 0; j < pos;j++)
{
......@@ -226,6 +226,47 @@ int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
return pos;
}
/**************************************************************************
* StrRChrA [SHLWAPI.@]
*
*/
LPSTR WINAPI StrRChrA( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
{
LPCSTR lpGotIt = NULL;
BOOL dbcs = IsDBCSLeadByte( LOBYTE(wMatch) );
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
{
if (*lpStart != LOBYTE(wMatch)) continue;
if (dbcs && lpStart[1] != HIBYTE(wMatch)) continue;
lpGotIt = lpStart;
}
return (LPSTR)lpGotIt;
}
/**************************************************************************
* StrRChrW [SHLWAPI.@]
*
*/
LPWSTR WINAPI StrRChrW( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch)
{
LPCWSTR lpGotIt = NULL;
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlenW(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
if (*lpStart == wMatch) lpGotIt = lpStart;
return (LPWSTR)lpGotIt;
}
/*************************************************************************
* StrCatBuffA [SHLWAPI]
*
......@@ -235,7 +276,7 @@ int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
*/
LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size)
{
LPSTR dst = front + lstrlenA(front);
LPSTR dst = front + strlen(front);
LPCSTR src = back, end = front + size - 1;
while(dst < end && *src)
......@@ -253,7 +294,7 @@ LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size)
*/
LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size)
{
LPWSTR dst = front + lstrlenW(front);
LPWSTR dst = front + strlenW(front);
LPCWSTR src = back, end = front + size - 1;
while(dst < end && *src)
......
/*
* String functions
* USER string functions
*
* Copyright 1993 Yngvi Sigurjonsson (yngvi@hafro.is)
* Copyright 1996 Alexandre Julliard
* Copyright 1996 Marcus Meissner
*/
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "heap.h"
#include "ldt.h"
......@@ -21,6 +25,300 @@
DEFAULT_DEBUG_CHANNEL(resource);
/***********************************************************************
* AnsiToOem16 (KEYBOARD.5)
*/
INT16 WINAPI AnsiToOem16( LPCSTR s, LPSTR d )
{
CharToOemA( s, d );
return -1;
}
/***********************************************************************
* OemToAnsi16 (KEYBOARD.6)
*/
INT16 WINAPI OemToAnsi16( LPCSTR s, LPSTR d )
{
OemToCharA( s, d );
return -1;
}
/***********************************************************************
* AnsiToOemBuff16 (KEYBOARD.134)
*/
void WINAPI AnsiToOemBuff16( LPCSTR s, LPSTR d, UINT16 len )
{
if (len != 0) CharToOemBuffA( s, d, len );
}
/***********************************************************************
* OemToAnsiBuff16 (KEYBOARD.135)
*/
void WINAPI OemToAnsiBuff16( LPCSTR s, LPSTR d, UINT16 len )
{
if (len != 0) OemToCharBuffA( s, d, len );
}
/***********************************************************************
* AnsiUpper16 (USER.431)
*/
SEGPTR WINAPI AnsiUpper16( SEGPTR strOrChar )
{
/* uppercase only one char if strOrChar < 0x10000 */
if (HIWORD(strOrChar))
{
CharUpperA( PTR_SEG_TO_LIN(strOrChar) );
return strOrChar;
}
else return toupper((char)strOrChar);
}
/***********************************************************************
* AnsiLower16 (USER.432)
*/
SEGPTR WINAPI AnsiLower16( SEGPTR strOrChar )
{
/* lowercase only one char if strOrChar < 0x10000 */
if (HIWORD(strOrChar))
{
CharLowerA( PTR_SEG_TO_LIN(strOrChar) );
return strOrChar;
}
else return tolower((char)strOrChar);
}
/***********************************************************************
* AnsiUpperBuff16 (USER.437)
*/
UINT16 WINAPI AnsiUpperBuff16( LPSTR str, UINT16 len )
{
CharUpperBuffA( str, len ? len : 65536 );
return len;
}
/***********************************************************************
* AnsiLowerBuff16 (USER.438)
*/
UINT16 WINAPI AnsiLowerBuff16( LPSTR str, UINT16 len )
{
CharLowerBuffA( str, len ? len : 65536 );
return len;
}
/***********************************************************************
* AnsiNext16 (USER.472)
*/
SEGPTR WINAPI AnsiNext16(SEGPTR current)
{
char *ptr = (char *)PTR_SEG_TO_LIN(current);
return current + (CharNextA(ptr) - ptr);
}
/***********************************************************************
* AnsiPrev16 (USER.473)
*/
SEGPTR WINAPI AnsiPrev16( LPCSTR start, SEGPTR current )
{
char *ptr = (char *)PTR_SEG_TO_LIN(current);
return current - (ptr - CharPrevA( start, ptr ));
}
/***********************************************************************
* CharNextA (USER32.@)
*/
LPSTR WINAPI CharNextA( LPCSTR ptr )
{
if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByte( ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1);
}
/***********************************************************************
* CharNextExA (USER32.@)
*/
LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
{
if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByteEx( codepage, ptr[0] ) && ptr[1]) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1);
}
/***********************************************************************
* CharNextExW (USER32.@)
*/
LPWSTR WINAPI CharNextExW( WORD codepage, LPCWSTR ptr, DWORD flags )
{
/* doesn't make sense, there are no codepages for Unicode */
return NULL;
}
/***********************************************************************
* CharNextW (USER32.@)
*/
LPWSTR WINAPI CharNextW(LPCWSTR x)
{
if (*x) x++;
else return (LPWSTR)x;
}
/***********************************************************************
* CharPrevA (USER32.@)
*/
LPSTR WINAPI CharPrevA( LPCSTR start, LPCSTR ptr )
{
while (*start && (start < ptr))
{
LPCSTR next = CharNextA( start );
if (next >= ptr) break;
start = next;
}
return (LPSTR)start;
}
/***********************************************************************
* CharPrevExA (USER32.@)
*/
LPSTR WINAPI CharPrevExA( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags )
{
while (*start && (start < ptr))
{
LPCSTR next = CharNextExA( codepage, start, flags );
if (next > ptr) break;
start = next;
}
return (LPSTR)start;
}
/***********************************************************************
* CharPrevExW (USER32.@)
*/
LPSTR WINAPI CharPrevExW( WORD codepage, LPCWSTR start, LPCWSTR ptr, DWORD flags )
{
/* doesn't make sense, there are no codepages for Unicode */
return NULL;
}
/***********************************************************************
* CharPrevW (USER32.@)
*/
LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x)
{
if (x>start) return (LPWSTR)(x-1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharToOemA (USER32.@)
*/
BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d )
{
if ( !s || !d ) return TRUE;
return CharToOemBuffA( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* CharToOemBuffA (USER32.@)
*/
BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len )
{
WCHAR *bufW;
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if( bufW )
{
MultiByteToWideChar( CP_ACP, 0, s, len, bufW, len );
WideCharToMultiByte( CP_OEMCP, 0, bufW, len, d, len, NULL, NULL );
HeapFree( GetProcessHeap(), 0, bufW );
}
return TRUE;
}
/***********************************************************************
* CharToOemBuffW (USER32.@)
*/
BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
{
if ( !s || !d ) return TRUE;
WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL );
return TRUE;
}
/***********************************************************************
* CharToOemW (USER32.@)
*/
BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
{
return CharToOemBuffW( s, d, strlenW( s ) + 1 );
}
/***********************************************************************
* OemToCharA (USER32.@)
*/
BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d )
{
return OemToCharBuffA( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* OemToCharBuffA (USER32.@)
*/
BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
{
WCHAR *bufW;
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if( bufW )
{
MultiByteToWideChar( CP_OEMCP, 0, s, len, bufW, len );
WideCharToMultiByte( CP_ACP, 0, bufW, len, d, len, NULL, NULL );
HeapFree( GetProcessHeap(), 0, bufW );
}
return TRUE;
}
/***********************************************************************
* OemToCharBuffW (USER32.@)
*/
BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
{
MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
return TRUE;
}
/***********************************************************************
* OemToCharW (USER32.@)
*/
BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
{
return OemToCharBuffW( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* FormatMessage16 (USER.606)
*/
DWORD WINAPI FormatMessage16(
......
......@@ -207,3 +207,23 @@ DWORD WINAPI RegisterTaskList (DWORD x)
FIXME("0x%08lx\n",x);
return TRUE;
}
/***********************************************************************
* stub_USER_489
*/
LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_490
*/
LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_492
*/
LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_496
*/
LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
......@@ -405,13 +405,13 @@ owner user32
427 pascal16 FindWindowEx(word word str str) FindWindowEx16
428 stub TileWindows
429 stub CascadeWindows
430 pascal16 lstrcmp(str str) lstrcmp16
430 pascal16 lstrcmp(str str) strcmp
431 pascal AnsiUpper(segstr) AnsiUpper16
432 pascal AnsiLower(segstr) AnsiLower16
433 pascal16 IsCharAlpha(word) IsCharAlpha16
434 pascal16 IsCharAlphaNumeric(word) IsCharAlphaNumeric16
435 pascal16 IsCharUpper(word) IsCharUpper16
436 pascal16 IsCharLower(word) IsCharLower16
433 pascal16 IsCharAlpha(word) IsCharAlphaA
434 pascal16 IsCharAlphaNumeric(word) IsCharAlphaNumericA
435 pascal16 IsCharUpper(word) IsCharUpperA
436 pascal16 IsCharLower(word) IsCharLowerA
437 pascal16 AnsiUpperBuff(str word) AnsiUpperBuff16
438 pascal16 AnsiLowerBuff(str word) AnsiLowerBuff16
441 pascal16 InsertMenuItem(word word word ptr) InsertMenuItem16
......@@ -439,9 +439,9 @@ owner user32
465 pascal16 DragDetect(word long) DragDetect16
466 pascal16 DrawFocusRect(word ptr) DrawFocusRect16
470 stub StringFunc
471 pascal16 lstrcmpi(str str) lstrcmpi16
471 pascal16 lstrcmpi(str str) lstrcmpiA
472 pascal AnsiNext(segptr) AnsiNext16
473 pascal AnsiPrev(segptr segptr) AnsiPrev16
473 pascal AnsiPrev(str segptr) AnsiPrev16
475 pascal16 SetScrollInfo(word s_word ptr word) SetScrollInfo16
476 pascal16 GetScrollInfo(word s_word ptr) GetScrollInfo16
477 pascal16 GetKeyboardLayoutName(ptr) GetKeyboardLayoutName16
......
......@@ -7,7 +7,6 @@ MODULE = if1632
C_SRCS = \
builtin.c \
dummy.c \
relay.c \
snoop.c \
thunk.c
......
/*
* Dummy function definitions
*/
#include "windef.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(relay);
/***********************************************************************
* stub_GDI_379
*/
LONG WINAPI stub_GDI_379(HDC16 hdc) { FIXME("STARTPAGE: stub\n"); return 1; }
/***********************************************************************
* stub_GDI_381
*/
LONG WINAPI stub_GDI_381(HDC16 hdc, SEGPTR proc) { FIXME("SETABORTPROC: stub\n"); return 1; }
/***********************************************************************
* stub_GDI_382
*/
LONG WINAPI stub_GDI_382(void) { FIXME("ABORTPROC: stub\n"); return 1; }
/***********************************************************************
* stub_USER_489
*/
LONG WINAPI stub_USER_489(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_490
*/
LONG WINAPI stub_USER_490(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_492
*/
LONG WINAPI stub_USER_492(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* stub_USER_496
*/
LONG WINAPI stub_USER_496(void) { FIXME("stub\n"); return 0; }
/***********************************************************************
* KERNEL_nop
*/
LONG WINAPI KERNEL_nop(void) { return 0; }
......@@ -70,12 +70,12 @@
#define __EXCEPT(func) \
} while(0); \
EXC_pop_frame( &__f.frame ); \
__wine_pop_frame( &__f.frame ); \
break; \
} else { \
__f.frame.Handler = (PEXCEPTION_HANDLER)WINE_exception_handler; \
__f.frame.Handler = (PEXCEPTION_HANDLER)__wine_exception_handler; \
__f.u.filter = (func); \
EXC_push_frame( &__f.frame ); \
__wine_push_frame( &__f.frame ); \
if (setjmp( __f.jmp)) { \
const __WINE_FRAME * const __eptr WINE_UNUSED = &__f; \
do {
......@@ -90,13 +90,13 @@
#define __FINALLY(func) \
} while(0); \
EXC_pop_frame( &__f.frame ); \
__wine_pop_frame( &__f.frame ); \
(func)(1); \
break; \
} else { \
__f.frame.Handler = (PEXCEPTION_HANDLER)WINE_finally_handler; \
__f.u.finally_func = (func); \
EXC_push_frame( &__f.frame ); \
__wine_push_frame( &__f.frame ); \
__first = 0; \
} \
} while (0);
......@@ -128,14 +128,14 @@ typedef struct __tagWINE_FRAME
const struct __tagWINE_FRAME *ExceptionRecord;
} __WINE_FRAME;
extern DWORD WINE_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
extern DWORD __wine_exception_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher );
extern DWORD __wine_finally_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher );
extern DWORD WINE_finally_handler( PEXCEPTION_RECORD record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher );
#endif /* USE_COMPILER_EXCEPTIONS */
static inline EXCEPTION_FRAME * WINE_UNUSED EXC_push_frame( EXCEPTION_FRAME *frame )
static inline EXCEPTION_FRAME * WINE_UNUSED __wine_push_frame( EXCEPTION_FRAME *frame )
{
#if defined(__GNUC__) && defined(__i386__)
EXCEPTION_FRAME *prev;
......@@ -152,7 +152,7 @@ static inline EXCEPTION_FRAME * WINE_UNUSED EXC_push_frame( EXCEPTION_FRAME *fra
#endif
}
static inline EXCEPTION_FRAME * WINE_UNUSED EXC_pop_frame( EXCEPTION_FRAME *frame )
static inline EXCEPTION_FRAME * WINE_UNUSED __wine_pop_frame( EXCEPTION_FRAME *frame )
{
#if defined(__GNUC__) && defined(__i386__)
__asm__ __volatile__(".byte 0x64\n\tmovl %0,(0)"
......@@ -166,12 +166,7 @@ static inline EXCEPTION_FRAME * WINE_UNUSED EXC_pop_frame( EXCEPTION_FRAME *fram
}
#ifdef __WINE__
extern void WINAPI EXC_NtRaiseException( PEXCEPTION_RECORD, PCONTEXT, BOOL, PCONTEXT );
extern void WINAPI EXC_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
extern void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME, LPVOID,
PEXCEPTION_RECORD, DWORD, CONTEXT * );
extern void WINAPI EXC_DebugBreak( CONTEXT *context );
extern BOOL SIGNAL_Init(void);
#endif
......
......@@ -2,12 +2,14 @@
#define __WINE_WINE_WINESTRING_H
#include "windef.h"
#include "winnls.h"
LPWSTR WINAPI lstrcpyAtoW(LPWSTR,LPCSTR);
LPSTR WINAPI lstrcpyWtoA(LPSTR,LPCWSTR);
LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT);
LPSTR WINAPI lstrcpynWtoA(LPSTR,LPCWSTR,INT);
/* compatibility macros; will be removed some day, please don't use them */
#define lstrcpyAtoW(dst,src) ((void)MultiByteToWideChar(CP_ACP,0,(src),-1,(dst),0x7fffffff))
#define lstrcpyWtoA(dst,src) ((void)WideCharToMultiByte(CP_ACP,0,(src),-1,(dst),0x7fffffff,NULL,NULL))
#define lstrncmpiA strncasecmp
#endif /* __WINE_WINE_WINESTRING_H */
......@@ -615,7 +615,7 @@ BOOL16 WINAPI AdjustWindowRectEx16(LPRECT16,DWORD,BOOL16,DWORD);
SEGPTR WINAPI AnsiLower16(SEGPTR);
UINT16 WINAPI AnsiLowerBuff16(LPSTR,UINT16);
SEGPTR WINAPI AnsiNext16(SEGPTR);
SEGPTR WINAPI AnsiPrev16(SEGPTR,SEGPTR);
SEGPTR WINAPI AnsiPrev16(LPCSTR,SEGPTR);
SEGPTR WINAPI AnsiUpper16(SEGPTR);
UINT16 WINAPI AnsiUpperBuff16(LPSTR,UINT16);
BOOL16 WINAPI AnyPopup16(void);
......
......@@ -3247,14 +3247,12 @@ LPSTR WINAPI CharNextA(LPCSTR);
LPWSTR WINAPI CharNextW(LPCWSTR);
#define CharNext WINELIB_NAME_AW(CharNext)
LPSTR WINAPI CharNextExA(WORD,LPCSTR,DWORD);
LPWSTR WINAPI CharNextExW(WORD,LPCWSTR,DWORD);
#define CharNextEx WINELIB_NAME_AW(CharNextEx)
/* no CharNextExW (doesn't make sense) */
LPSTR WINAPI CharPrevA(LPCSTR,LPCSTR);
LPWSTR WINAPI CharPrevW(LPCWSTR,LPCWSTR);
#define CharPrev WINELIB_NAME_AW(CharPrev)
LPSTR WINAPI CharPrevExA(WORD,LPCSTR,LPCSTR,DWORD);
LPWSTR WINAPI CharPrevExW(WORD,LPCWSTR,LPCWSTR,DWORD);
#define CharPrevEx WINELIB_NAME_AW(CharPrevEx)
/* no CharPrevExW (doesn't make sense) */
LPSTR WINAPI CharUpperA(LPSTR);
LPWSTR WINAPI CharUpperW(LPWSTR);
#define CharUpper WINELIB_NAME_AW(CharUpper)
......
......@@ -10,24 +10,16 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/keyboard16.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "winerror.h"
#include "winnls.h"
#include "ldt.h"
#include "debugtools.h"
#include "winnls.h"
DEFAULT_DEBUG_CHANNEL(string);
/* Internaly used by strchr family functions */
static BOOL ChrCmpA( WORD word1, WORD word2);
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
......@@ -38,15 +30,6 @@ static WINE_EXCEPTION_FILTER(page_fault)
/***********************************************************************
* hmemcpy (KERNEL.348)
*/
void WINAPI hmemcpy16( LPVOID dst, LPCVOID src, LONG count )
{
memcpy( dst, src, count );
}
/***********************************************************************
* lstrcat16 (KERNEL.89)
*/
SEGPTR WINAPI lstrcat16( SEGPTR dst, LPCSTR src )
......@@ -110,15 +93,6 @@ SEGPTR WINAPI lstrcatn16( SEGPTR dst, LPCSTR src, INT16 n )
/***********************************************************************
* lstrcmp16 (USER.430)
*/
INT16 WINAPI lstrcmp16( LPCSTR str1, LPCSTR str2 )
{
return (INT16)strcmp( str1, str2 );
}
/***********************************************************************
* lstrcmpA (KERNEL.602)
*/
INT WINAPI lstrcmpA( LPCSTR str1, LPCSTR str2 )
......@@ -146,15 +120,6 @@ INT WINAPI lstrcmpW( LPCWSTR str1, LPCWSTR str2 )
/***********************************************************************
* lstrcmpi16 (USER.471)
*/
INT16 WINAPI lstrcmpi16( LPCSTR str1, LPCSTR str2 )
{
return (INT16)lstrcmpiA( str1, str2 );
}
/***********************************************************************
* lstrcmpiA (KERNEL32.605)
*/
INT WINAPI lstrcmpiA( LPCSTR str1, LPCSTR str2 )
......@@ -333,26 +298,6 @@ INT WINAPI lstrlenW( LPCWSTR str )
/***********************************************************************
* lstrcpyAtoW (Not a Windows API)
*/
LPWSTR WINAPI lstrcpyAtoW( LPWSTR dst, LPCSTR src )
{
MultiByteToWideChar( CP_ACP, 0, src, -1, dst, 0x7fffffff );
return dst;
}
/***********************************************************************
* lstrcpyWtoA (Not a Windows API)
*/
LPSTR WINAPI lstrcpyWtoA( LPSTR dst, LPCWSTR src )
{
WideCharToMultiByte( CP_ACP, 0, src, -1, dst, 0x7fffffff, NULL, NULL );
return dst;
}
/***********************************************************************
* lstrcpynAtoW (Not a Windows API)
* Note: this function differs from the UNIX strncpy, it _always_ writes
* a terminating \0
......@@ -389,212 +334,3 @@ INT16 WINAPI UnicodeToAnsi16( LPCWSTR src, LPSTR dst, INT16 codepage )
return WideCharToMultiByte( codepage, 0, src, -1, dst, 0x7fffffff, NULL, NULL );
}
/***********************************************************************
* Copy (GDI.250)
*/
void WINAPI Copy16( LPVOID src, LPVOID dst, WORD size )
{
memcpy( dst, src, size );
}
/***********************************************************************
* AnsiToOem16 (KEYBOARD.5)
*/
INT16 WINAPI AnsiToOem16( LPCSTR s, LPSTR d )
{
CharToOemA( s, d );
return -1;
}
/***********************************************************************
* OemToAnsi16 (KEYBOARD.6)
*/
INT16 WINAPI OemToAnsi16( LPCSTR s, LPSTR d )
{
OemToCharA( s, d );
return -1;
}
/***********************************************************************
* AnsiToOemBuff16 (KEYBOARD.134)
*/
void WINAPI AnsiToOemBuff16( LPCSTR s, LPSTR d, UINT16 len )
{
if (len != 0) CharToOemBuffA( s, d, len );
}
/***********************************************************************
* OemToAnsiBuff16 (KEYBOARD.135)
*/
void WINAPI OemToAnsiBuff16( LPCSTR s, LPSTR d, UINT16 len )
{
if (len != 0) OemToCharBuffA( s, d, len );
}
/***********************************************************************
* CharToOemA (USER32.37)
*/
BOOL WINAPI CharToOemA( LPCSTR s, LPSTR d )
{
if ( !s || !d ) return TRUE;
return CharToOemBuffA( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* CharToOemBuffA (USER32.38)
*/
BOOL WINAPI CharToOemBuffA( LPCSTR s, LPSTR d, DWORD len )
{
WCHAR *bufW;
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if( bufW )
{
MultiByteToWideChar( CP_ACP, 0, s, len, bufW, len );
WideCharToMultiByte( CP_OEMCP, 0, bufW, len, d, len, NULL, NULL );
HeapFree( GetProcessHeap(), 0, bufW );
}
return TRUE;
}
/***********************************************************************
* CharToOemBuffW (USER32.39)
*/
BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
{
if ( !s || !d ) return TRUE;
WideCharToMultiByte( CP_OEMCP, 0, s, len, d, len, NULL, NULL );
return TRUE;
}
/***********************************************************************
* CharToOemW (USER32.40)
*/
BOOL WINAPI CharToOemW( LPCWSTR s, LPSTR d )
{
return CharToOemBuffW( s, d, strlenW( s ) + 1 );
}
/***********************************************************************
* OemToCharA (USER32.402)
*/
BOOL WINAPI OemToCharA( LPCSTR s, LPSTR d )
{
return OemToCharBuffA( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* OemToCharBuffA (USER32.403)
*/
BOOL WINAPI OemToCharBuffA( LPCSTR s, LPSTR d, DWORD len )
{
WCHAR *bufW;
bufW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if( bufW )
{
MultiByteToWideChar( CP_OEMCP, 0, s, len, bufW, len );
WideCharToMultiByte( CP_ACP, 0, bufW, len, d, len, NULL, NULL );
HeapFree( GetProcessHeap(), 0, bufW );
}
return TRUE;
}
/***********************************************************************
* OemToCharBuffW (USER32.404)
*/
BOOL WINAPI OemToCharBuffW( LPCSTR s, LPWSTR d, DWORD len )
{
MultiByteToWideChar( CP_OEMCP, 0, s, len, d, len );
return TRUE;
}
/***********************************************************************
* OemToCharW (USER32.405)
*/
BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
{
return OemToCharBuffW( s, d, strlen( s ) + 1 );
}
/***********************************************************************
* lstrrchr (Not a Windows API)
*
* This is the implementation meant to be invoked from within
* COMCTL32_StrRChrA and shell32(TODO)...
*
* Return a pointer to the last occurence of wMatch in lpStart
* not looking further than lpEnd...
*/
LPSTR WINAPI lstrrchr( LPCSTR lpStart, LPCSTR lpEnd, WORD wMatch )
{
LPCSTR lpGotIt = NULL;
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + strlen(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextA(lpStart))
if (!ChrCmpA( GET_WORD(lpStart), wMatch))
lpGotIt = lpStart;
return ((LPSTR)lpGotIt);
}
/***********************************************************************
* ChrCmpW
* This fuction returns FALSE if both words match, TRUE otherwise...
*/
static BOOL ChrCmpW( WORD word1, WORD word2) {
return (word1 != word2);
}
/***********************************************************************
* lstrrchrw (Not a Windows API)
*
* This is the implementation meant to be invoked form within
* COMCTL32_StrRChrW and shell32(TODO)...
*
* Return a pointer to the last occurence of wMatch in lpStart
* not looking further than lpEnd...
*/
LPWSTR WINAPI lstrrchrw( LPCWSTR lpStart, LPCWSTR lpEnd, WORD wMatch )
{
LPCWSTR lpGotIt = NULL;
TRACE("(%p, %p, %x)\n", lpStart, lpEnd, wMatch);
if (!lpEnd) lpEnd = lpStart + lstrlenW(lpStart);
for(; lpStart < lpEnd; lpStart = CharNextW(lpStart))
if (!ChrCmpW( GET_WORD(lpStart), wMatch))
lpGotIt = lpStart;
return (LPWSTR)lpGotIt;
}
/***********************************************************************
* ChrCmpA
* This fuction returns FALSE if both words match, TRUE otherwise...
*/
static BOOL ChrCmpA( WORD word1, WORD word2) {
if (LOBYTE(word1) == LOBYTE(word2)) {
if (IsDBCSLeadByte(LOBYTE(word1))) {
return (word1 != word2);
}
return FALSE;
}
return TRUE;
}
......@@ -38,207 +38,6 @@ DEFAULT_DEBUG_CHANNEL(resource);
extern const WORD OLE2NLS_CT_CType3_LUT[]; /* FIXME: does not belong here */
/* Funny to divide them between user and kernel. */
/***********************************************************************
* IsCharAlpha (USER.433)
*/
BOOL16 WINAPI IsCharAlpha16(CHAR ch)
{
return isalpha(ch); /* This is probably not right for NLS */
}
/***********************************************************************
* IsCharAlphaNumeric (USER.434)
*/
BOOL16 WINAPI IsCharAlphaNumeric16(CHAR ch)
{
return isalnum(ch);
}
/***********************************************************************
* IsCharUpper (USER.435)
*/
BOOL16 WINAPI IsCharUpper16(CHAR ch)
{
return isupper(ch);
}
/***********************************************************************
* IsCharLower (USER.436)
*/
BOOL16 WINAPI IsCharLower16(CHAR ch)
{
return islower(ch);
}
/***********************************************************************
* AnsiUpper16 (USER.431)
*/
SEGPTR WINAPI AnsiUpper16( SEGPTR strOrChar )
{
/* I am not sure if the locale stuff works with toupper, but then again
I am not sure if the Linux libc locale stuffs works at all */
/* uppercase only one char if strOrChar < 0x10000 */
if (HIWORD(strOrChar))
{
char *s;
for (s = PTR_SEG_TO_LIN(strOrChar); *s; s++) *s = toupper(*s);
return strOrChar;
}
else return toupper((char)strOrChar);
}
/***********************************************************************
* AnsiUpperBuff16 (USER.437)
*/
UINT16 WINAPI AnsiUpperBuff16( LPSTR str, UINT16 len )
{
UINT count = len ? len : 65536;
for (; count; count--, str++) *str = toupper(*str);
return len;
}
/***********************************************************************
* AnsiLower16 (USER.432)
*/
SEGPTR WINAPI AnsiLower16( SEGPTR strOrChar )
{
/* I am not sure if the locale stuff works with toupper, but then again
I am not sure if the Linux libc locale stuffs works at all */
/* lowercase only one char if strOrChar < 0x10000 */
if (HIWORD(strOrChar))
{
char *s;
for (s = PTR_SEG_TO_LIN( strOrChar ); *s; s++) *s = tolower( *s );
return strOrChar;
}
else return tolower((char)strOrChar);
}
/***********************************************************************
* AnsiLowerBuff16 (USER.438)
*/
UINT16 WINAPI AnsiLowerBuff16( LPSTR str, UINT16 len )
{
UINT count = len ? len : 65536;
for (; count; count--, str++) *str = tolower(*str);
return len;
}
/***********************************************************************
* AnsiNext16 (USER.472)
*/
SEGPTR WINAPI AnsiNext16(SEGPTR current)
{
return (*(char *)PTR_SEG_TO_LIN(current)) ? current + 1 : current;
}
/***********************************************************************
* AnsiPrev16 (USER.473)
*/
SEGPTR WINAPI AnsiPrev16( SEGPTR start, SEGPTR current )
{
return (current == start) ? start : current - 1;
}
/***********************************************************************
* CharNextA (USER32.29)
*/
LPSTR WINAPI CharNextA( LPCSTR ptr )
{
if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByte( *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1);
}
/***********************************************************************
* CharNextExA (USER32.30)
*/
LPSTR WINAPI CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
{
if (!*ptr) return (LPSTR)ptr;
if (IsDBCSLeadByteEx( codepage, *ptr ) && (*(ptr+1) != 0) ) return (LPSTR)(ptr + 2);
return (LPSTR)(ptr + 1);
}
/***********************************************************************
* CharNextExW (USER32.31)
*/
LPWSTR WINAPI CharNextExW(WORD codepage,LPCWSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (*x) return (LPWSTR)(x+1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharNextW (USER32.32)
*/
LPWSTR WINAPI CharNextW(LPCWSTR x)
{
if (*x) return (LPWSTR)(x+1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharPrevA (USER32.33)
*/
LPSTR WINAPI CharPrevA( LPCSTR start, LPCSTR ptr )
{
while (*start && (start < ptr))
{
LPCSTR next = CharNextA( start );
if (next >= ptr) break;
start = next;
}
return (LPSTR)start;
}
/***********************************************************************
* CharPrevExA (USER32.34)
*/
LPSTR WINAPI CharPrevExA( WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags )
{
while (*start && (start < ptr))
{
LPCSTR next = CharNextExA( codepage, start, flags );
if (next > ptr) break;
start = next;
}
return (LPSTR)start;
}
/***********************************************************************
* CharPrevExW (USER32.35)
*/
LPWSTR WINAPI CharPrevExW(WORD codepage,LPCWSTR start,LPCWSTR x,DWORD flags)
{
/* FIXME: add DBCS / codepage stuff */
if (x>start) return (LPWSTR)(x-1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharPrevW (USER32.36)
*/
LPWSTR WINAPI CharPrevW(LPCWSTR start,LPCWSTR x)
{
if (x>start) return (LPWSTR)(x-1);
else return (LPWSTR)x;
}
/***********************************************************************
* CharLowerA (USER32.25)
* FIXME: handle current locale
......@@ -337,36 +136,24 @@ LPSTR WINAPI CharUpperA(LPSTR x)
* CharUpperBuffA (USER32.42)
* FIXME: handle current locale
*/
DWORD WINAPI CharUpperBuffA(LPSTR x,DWORD buflen)
DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
{
DWORD done=0;
if (!x) return 0; /* YES */
while (*x && (buflen--))
{
*x=toupper(*x);
x++;
done++;
}
return done;
DWORD ret = len;
if (!str) return 0; /* YES */
for (; len; len--, str++) *str = toupper(*str);
return ret;
}
/***********************************************************************
* CharUpperBuffW (USER32.43)
* FIXME: handle current locale
*/
DWORD WINAPI CharUpperBuffW(LPWSTR x,DWORD buflen)
DWORD WINAPI CharUpperBuffW( LPWSTR str, DWORD len )
{
DWORD done=0;
if (!x) return 0; /* YES */
while (*x && (buflen--))
{
*x=toupperW(*x);
x++;
done++;
}
return done;
DWORD ret = len;
if (!str) return 0; /* YES */
for (; len; len--, str++) *str = toupperW(*str);
return ret;
}
/***********************************************************************
......@@ -389,7 +176,7 @@ LPWSTR WINAPI CharUpperW(LPWSTR x)
}
/***********************************************************************
* IsCharAlphaA (USER32.331)
* IsCharAlphaA (USER.433) (USER32.331)
* FIXME: handle current locale
*/
BOOL WINAPI IsCharAlphaA(CHAR x)
......@@ -398,7 +185,7 @@ BOOL WINAPI IsCharAlphaA(CHAR x)
}
/***********************************************************************
* IsCharAlphaNumericA (USER32.332)
* IsCharAlphaNumericA (USER.434) (USER32.332)
* FIXME: handle current locale
*/
BOOL WINAPI IsCharAlphaNumericA(CHAR x)
......@@ -425,7 +212,7 @@ BOOL WINAPI IsCharAlphaW(WCHAR x)
}
/***********************************************************************
* IsCharLowerA (USER32.335)
* IsCharLowerA (USER.436) (USER32.335)
* FIXME: handle current locale
*/
BOOL WINAPI IsCharLowerA(CHAR x)
......@@ -443,7 +230,7 @@ BOOL WINAPI IsCharLowerW(WCHAR x)
}
/***********************************************************************
* IsCharUpperA (USER32.337)
* IsCharUpperA (USER.435) (USER32.337)
* FIXME: handle current locale
*/
BOOL WINAPI IsCharUpperA(CHAR x)
......
......@@ -544,22 +544,12 @@ end_MAIN_GetLanguageID:
/***********************************************************************
* called_at_exit
*/
static void called_at_exit(void)
{
CONSOLE_Close();
}
/***********************************************************************
* MAIN_WineInit
*
* Wine initialisation and command-line parsing
*/
void MAIN_WineInit(void)
{
struct timeval tv;
#ifdef MALLOC_DEBUGGING
char *trace;
......@@ -577,10 +567,7 @@ void MAIN_WineInit(void)
setbuf(stdout,NULL);
setbuf(stderr,NULL);
setlocale(LC_CTYPE,"");
gettimeofday( &tv, NULL);
atexit(called_at_exit);
}
/***********************************************************************
......
......@@ -208,16 +208,7 @@ SNOOP_PrintArg(DWORD x) {
static char buf[200];
int i,nostring;
char * volatile ret=0;
MEMORY_BASIC_INFORMATION mbi;
if ( !HIWORD(x) ||
!VirtualQuery((LPVOID)x,&mbi,sizeof(mbi)) ||
!mbi.Type ||
(mbi.Protect == PAGE_NOACCESS)
) {
sprintf(buf,"%08lx",x);
return buf;
}
__TRY{
LPBYTE s=(LPBYTE)x;
i=0;nostring=0;
......
......@@ -22,7 +22,6 @@
*
*/
#include <assert.h>
#include <stdio.h>
#include "windef.h"
#include "winerror.h"
......@@ -205,60 +204,3 @@ void WINAPI FatalAppExitW( UINT action, LPCWSTR str )
Callout.MessageBoxW( 0, str, NULL, MB_SYSTEMMODAL | MB_OK );
ExitProcess(0);
}
/*************************************************************
* WINE_exception_handler
*
* Exception handler for exception blocks declared in Wine code.
*/
DWORD WINE_exception_handler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND | EH_NESTED_CALL))
return ExceptionContinueSearch;
if (wine_frame->u.filter)
{
EXCEPTION_POINTERS ptrs;
ptrs.ExceptionRecord = record;
ptrs.ContextRecord = context;
switch(wine_frame->u.filter( &ptrs ))
{
case EXCEPTION_CONTINUE_SEARCH:
return ExceptionContinueSearch;
case EXCEPTION_CONTINUE_EXECUTION:
return ExceptionContinueExecution;
case EXCEPTION_EXECUTE_HANDLER:
break;
default:
MESSAGE( "Invalid return value from exception filter\n" );
assert( FALSE );
}
}
/* hack to make GetExceptionCode() work in handler */
wine_frame->ExceptionCode = record->ExceptionCode;
wine_frame->ExceptionRecord = wine_frame;
RtlUnwind( frame, 0, record, 0 );
EXC_pop_frame( frame );
longjmp( wine_frame->jmp, 1 );
}
/*************************************************************
* WINE_finally_handler
*
* Exception handler for try/finally blocks declared in Wine code.
*/
DWORD WINE_finally_handler( EXCEPTION_RECORD *record, EXCEPTION_FRAME *frame,
CONTEXT *context, LPVOID pdispatcher )
{
__WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
if (!(record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND)))
return ExceptionContinueSearch;
wine_frame->u.finally_func( FALSE );
return ExceptionContinueSearch;
}
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