Commit e4e2e8e5 authored by Alexandre Julliard's avatar Alexandre Julliard

comctl32: Build with msvcrt.

parent 54bd7e65
...@@ -4,6 +4,8 @@ IMPORTLIB = comctl32 ...@@ -4,6 +4,8 @@ IMPORTLIB = comctl32
IMPORTS = uuid user32 gdi32 advapi32 usp10 imm32 IMPORTS = uuid user32 gdi32 advapi32 usp10 imm32
DELAYIMPORTS = winmm uxtheme DELAYIMPORTS = winmm uxtheme
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
animate.c \ animate.c \
button.c \ button.c \
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "vssym32.h" #include "vssym32.h"
#include "commctrl.h" #include "commctrl.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "commctrl.h" #include "commctrl.h"
#include "comctl32.h" #include "comctl32.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(comboex); WINE_DEFAULT_DEBUG_CHANNEL(comboex);
...@@ -632,14 +631,14 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci ...@@ -632,14 +631,14 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (item->mask & CBEIF_TEXT) { if (item->mask & CBEIF_TEXT) {
INT len = 0; INT len = 0;
if (is_textW(cit->pszText)) len = strlenW (cit->pszText); if (is_textW(cit->pszText)) len = lstrlenW (cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) { if (!item->pszText) {
Free(item); Free(item);
return -1; return -1;
} }
strcpyW (item->pszText, cit->pszText); lstrcpyW (item->pszText, cit->pszText);
} }
else if (cit->pszText == LPSTR_TEXTCALLBACKW) else if (cit->pszText == LPSTR_TEXTCALLBACKW)
item->pszText = LPSTR_TEXTCALLBACKW; item->pszText = LPSTR_TEXTCALLBACKW;
...@@ -765,11 +764,11 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit) ...@@ -765,11 +764,11 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, const COMBOBOXEXITEMW *cit)
INT len = 0; INT len = 0;
COMBOEX_FreeText(item); COMBOEX_FreeText(item);
if (is_textW(cit->pszText)) len = strlenW(cit->pszText); if (is_textW(cit->pszText)) len = lstrlenW(cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) return FALSE; if (!item->pszText) return FALSE;
strcpyW(item->pszText, cit->pszText); lstrcpyW(item->pszText, cit->pszText);
} else if (cit->pszText == LPSTR_TEXTCALLBACKW) } else if (cit->pszText == LPSTR_TEXTCALLBACKW)
item->pszText = LPSTR_TEXTCALLBACKW; item->pszText = LPSTR_TEXTCALLBACKW;
item->cchTextMax = cit->cchTextMax; item->cchTextMax = cit->cchTextMax;
...@@ -1404,7 +1403,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di ...@@ -1404,7 +1403,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
str = COMBOEX_GetText(infoPtr, item); str = COMBOEX_GetText(infoPtr, item);
if (!str) str = nil; if (!str) str = nil;
len = strlenW (str); len = lstrlenW (str);
GetTextExtentPoint32W (dis->hDC, str, len, &txtsize); GetTextExtentPoint32W (dis->hDC, str, len, &txtsize);
if (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) { if (dis->itemAction & (ODA_SELECT | ODA_DRAWENTIRE)) {
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
* COMCTL32.DLL (internally). * COMCTL32.DLL (internally).
* *
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
...@@ -47,7 +45,6 @@ ...@@ -47,7 +45,6 @@
#include "objbase.h" #include "objbase.h"
#include "winerror.h" #include "winerror.h"
#include "wine/unicode.h"
#include "comctl32.h" #include "comctl32.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -311,7 +308,7 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp ) ...@@ -311,7 +308,7 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp )
if (mp->wineFlags & WMRUF_CHANGED) { if (mp->wineFlags & WMRUF_CHANGED) {
mp->wineFlags &= ~WMRUF_CHANGED; mp->wineFlags &= ~WMRUF_CHANGED;
err = RegSetValueExW(newkey, strMRUList, 0, REG_SZ, (LPBYTE)mp->realMRU, err = RegSetValueExW(newkey, strMRUList, 0, REG_SZ, (LPBYTE)mp->realMRU,
(strlenW(mp->realMRU) + 1)*sizeof(WCHAR)); (lstrlenW(mp->realMRU) + 1)*sizeof(WCHAR));
if (err) { if (err) {
ERR("error saving MRUList, err=%d\n", err); ERR("error saving MRUList, err=%d\n", err);
} }
...@@ -470,7 +467,7 @@ INT WINAPI AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData) ...@@ -470,7 +467,7 @@ INT WINAPI AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) { if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) {
/* Item exists, just move it to the front */ /* Item exists, just move it to the front */
LPWSTR pos = strchrW(mp->realMRU, replace + 'a'); LPWSTR pos = wcschr(mp->realMRU, replace + 'a');
while (pos > mp->realMRU) while (pos > mp->realMRU)
{ {
pos[0] = pos[-1]; pos[0] = pos[-1];
...@@ -555,7 +552,7 @@ INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString) ...@@ -555,7 +552,7 @@ INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString)
} }
return AddMRUData(hList, lpszString, return AddMRUData(hList, lpszString,
(strlenW(lpszString) + 1) * sizeof(WCHAR)); (lstrlenW(lpszString) + 1) * sizeof(WCHAR));
} }
/************************************************************************** /**************************************************************************
...@@ -747,8 +744,8 @@ HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *infoW, DWORD dwParam2, ...@@ -747,8 +744,8 @@ HANDLE WINAPI CreateMRUListLazyW (const MRUINFOW *infoW, DWORD dwParam2,
mp = Alloc(sizeof(WINEMRULIST)); mp = Alloc(sizeof(WINEMRULIST));
memcpy(&mp->extview, infoW, sizeof(MRUINFOW)); memcpy(&mp->extview, infoW, sizeof(MRUINFOW));
mp->extview.lpszSubKey = Alloc((strlenW(infoW->lpszSubKey) + 1) * sizeof(WCHAR)); mp->extview.lpszSubKey = Alloc((lstrlenW(infoW->lpszSubKey) + 1) * sizeof(WCHAR));
strcpyW(mp->extview.lpszSubKey, infoW->lpszSubKey); lstrcpyW(mp->extview.lpszSubKey, infoW->lpszSubKey);
mp->isUnicode = TRUE; mp->isUnicode = TRUE;
return create_mru_list(mp); return create_mru_list(mp);
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#include "shlwapi.h" #include "shlwapi.h"
#include "comctl32.h" #include "comctl32.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(commctrl); WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
...@@ -136,7 +135,7 @@ BOOL WINAPI RegisterClassNameW(const WCHAR *class) ...@@ -136,7 +135,7 @@ BOOL WINAPI RegisterClassNameW(const WCHAR *class)
while (min <= max) while (min <= max)
{ {
int res, pos = (min + max) / 2; int res, pos = (min + max) / 2;
if (!(res = strcmpiW(class, classes[pos].nameW))) if (!(res = wcsicmp(class, classes[pos].nameW)))
{ {
classes[pos].fn_register(); classes[pos].fn_register();
return TRUE; return TRUE;
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "commctrl.h" #include "commctrl.h"
#include "comctl32.h" #include "comctl32.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(datetime); WINE_DEFAULT_DEBUG_CHANNEL(datetime);
...@@ -251,7 +250,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, LPCWSTR formattxt) ...@@ -251,7 +250,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, LPCWSTR formattxt)
*nrFields = 0; *nrFields = 0;
infoPtr->fieldspec[*nrFields] = 0; infoPtr->fieldspec[*nrFields] = 0;
len = strlenW(allowedformatchars); len = lstrlenW(allowedformatchars);
k = 0; k = 0;
for (i = 0; formattxt[i]; i++) { for (i = 0; formattxt[i]; i++) {
...@@ -715,7 +714,7 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co ...@@ -715,7 +714,7 @@ static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int co
break; break;
} }
} }
GetTextExtentPoint32W (hdc, bufptr, strlenW(bufptr), &size); GetTextExtentPoint32W (hdc, bufptr, lstrlenW(bufptr), &size);
return size.cx; return size.cx;
} }
...@@ -735,14 +734,14 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) ...@@ -735,14 +734,14 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
WCHAR txt[80]; WCHAR txt[80];
DATETIME_ReturnTxt (infoPtr, 0, txt, ARRAY_SIZE(txt)); DATETIME_ReturnTxt (infoPtr, 0, txt, ARRAY_SIZE(txt));
GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size);
rcDraw->bottom = size.cy + 2; rcDraw->bottom = size.cy + 2;
prevright = infoPtr->checkbox.right = ((infoPtr->dwStyle & DTS_SHOWNONE) ? 18 : 2); prevright = infoPtr->checkbox.right = ((infoPtr->dwStyle & DTS_SHOWNONE) ? 18 : 2);
for (i = 0; i < infoPtr->nrFields; i++) { for (i = 0; i < infoPtr->nrFields; i++) {
DATETIME_ReturnTxt (infoPtr, i, txt, ARRAY_SIZE(txt)); DATETIME_ReturnTxt (infoPtr, i, txt, ARRAY_SIZE(txt));
GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size);
field = &infoPtr->fieldRect[i]; field = &infoPtr->fieldRect[i];
field->left = prevright; field->left = prevright;
field->right = prevright + DATETIME_GetFieldWidth (infoPtr, hdc, i); field->right = prevright + DATETIME_GetFieldWidth (infoPtr, hdc, i);
...@@ -762,7 +761,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) ...@@ -762,7 +761,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
{ {
memcpy(txt, infoPtr->charsEntered, infoPtr->nCharsEntered * sizeof(WCHAR)); memcpy(txt, infoPtr->charsEntered, infoPtr->nCharsEntered * sizeof(WCHAR));
txt[infoPtr->nCharsEntered] = 0; txt[infoPtr->nCharsEntered] = 0;
GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size);
} }
SetRect(&selection, 0, 0, size.cx, size.cy); SetRect(&selection, 0, 0, size.cx, size.cy);
...@@ -778,7 +777,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) ...@@ -778,7 +777,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText); oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText);
/* draw the date text using the colour set above */ /* draw the date text using the colour set above */
DrawTextW (hdc, txt, strlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE); DrawTextW (hdc, txt, lstrlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
SetTextColor (hdc, oldTextColor); SetTextColor (hdc, oldTextColor);
} }
SetBkMode (hdc, oldBkMode); SetBkMode (hdc, oldBkMode);
...@@ -1460,7 +1459,7 @@ static BOOL DATETIME_GetIdealSize(DATETIME_INFO *infoPtr, SIZE *size) ...@@ -1460,7 +1459,7 @@ static BOOL DATETIME_GetIdealSize(DATETIME_INFO *infoPtr, SIZE *size)
/* Get text font height */ /* Get text font height */
DATETIME_ReturnTxt(infoPtr, 0, txt, ARRAY_SIZE(txt)); DATETIME_ReturnTxt(infoPtr, 0, txt, ARRAY_SIZE(txt));
GetTextExtentPoint32W(hdc, txt, strlenW(txt), &field_size); GetTextExtentPoint32W(hdc, txt, lstrlenW(txt), &field_size);
size->cy = field_size.cy; size->cy = field_size.cy;
/* Get text font width */ /* Get text font width */
...@@ -1572,11 +1571,11 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst) ...@@ -1572,11 +1571,11 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst)
for (i = 0; i < infoPtr->nrFields; i++) for (i = 0; i < infoPtr->nrFields; i++)
{ {
DATETIME_ReturnTxt(infoPtr, i, buf, ARRAY_SIZE(buf)); DATETIME_ReturnTxt(infoPtr, i, buf, ARRAY_SIZE(buf));
if ((strlenW(dst) + strlenW(buf)) < count) if ((lstrlenW(dst) + lstrlenW(buf)) < count)
strcatW(dst, buf); lstrcatW(dst, buf);
else break; else break;
} }
return strlenW(dst); return lstrlenW(dst);
} }
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
* *
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -46,7 +44,6 @@ ...@@ -46,7 +44,6 @@
#include "commctrl.h" #include "commctrl.h"
#include "uxtheme.h" #include "uxtheme.h"
#include "vsstyle.h" #include "vsstyle.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
...@@ -176,7 +173,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap); ...@@ -176,7 +173,7 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap);
*/ */
static inline BOOL EDIT_EM_CanUndo(const EDITSTATE *es) static inline BOOL EDIT_EM_CanUndo(const EDITSTATE *es)
{ {
return (es->undo_insert_count || strlenW(es->undo_text)); return (es->undo_insert_count || lstrlenW(es->undo_text));
} }
...@@ -212,7 +209,7 @@ static HBRUSH EDIT_NotifyCtlColor(EDITSTATE *es, HDC hdc) ...@@ -212,7 +209,7 @@ static HBRUSH EDIT_NotifyCtlColor(EDITSTATE *es, HDC hdc)
static inline UINT get_text_length(EDITSTATE *es) static inline UINT get_text_length(EDITSTATE *es)
{ {
if(es->text_length == (UINT)-1) if(es->text_length == (UINT)-1)
es->text_length = strlenW(es->text); es->text_length = lstrlenW(es->text);
return es->text_length; return es->text_length;
} }
...@@ -520,7 +517,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta ...@@ -520,7 +517,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
/* Mark type of line termination */ /* Mark type of line termination */
if (!(*cp)) { if (!(*cp)) {
current_line->ending = END_0; current_line->ending = END_0;
current_line->net_length = strlenW(current_position); current_line->net_length = lstrlenW(current_position);
} else if ((cp > current_position) && (*(cp - 1) == '\r')) { } else if ((cp > current_position) && (*(cp - 1) == '\r')) {
current_line->ending = END_SOFT; current_line->ending = END_SOFT;
current_line->net_length = cp - current_position - 1; current_line->net_length = cp - current_position - 1;
...@@ -2190,7 +2187,7 @@ static void EDIT_PaintLine(EDITSTATE *es, HDC dc, INT line, BOOL rev) ...@@ -2190,7 +2187,7 @@ static void EDIT_PaintLine(EDITSTATE *es, HDC dc, INT line, BOOL rev)
if (es->cue_banner_text && es->text_length == 0 && (!(es->flags & EF_FOCUSED) || es->cue_banner_draw_focused)) if (es->cue_banner_text && es->text_length == 0 && (!(es->flags & EF_FOCUSED) || es->cue_banner_draw_focused))
{ {
SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT)); SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT));
TextOutW(dc, x, y, es->cue_banner_text, strlenW(es->cue_banner_text)); TextOutW(dc, x, y, es->cue_banner_text, lstrlenW(es->cue_banner_text));
} }
} }
...@@ -2480,7 +2477,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r ...@@ -2480,7 +2477,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
memcpy(buf, es->text + s, bufl * sizeof(WCHAR)); memcpy(buf, es->text + s, bufl * sizeof(WCHAR));
buf[bufl] = 0; /* ensure 0 termination */ buf[bufl] = 0; /* ensure 0 termination */
/* now delete */ /* now delete */
strcpyW(es->text + s, es->text + e); lstrcpyW(es->text + s, es->text + e);
text_buffer_changed(es); text_buffer_changed(es);
} }
if (strl) { if (strl) {
...@@ -2508,7 +2505,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r ...@@ -2508,7 +2505,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
/* if text is too long undo all changes */ /* if text is too long undo all changes */
if (honor_limit && !(es->style & ES_AUTOVSCROLL) && (es->line_count > vlc)) { if (honor_limit && !(es->style & ES_AUTOVSCROLL) && (es->line_count > vlc)) {
if (strl) if (strl)
strcpyW(es->text + e, es->text + e + strl); lstrcpyW(es->text + e, es->text + e + strl);
if (e != s) if (e != s)
for (i = 0 , p = es->text ; i < e - s ; i++) for (i = 0 , p = es->text ; i < e - s ; i++)
p[i + s] = buf[i]; p[i + s] = buf[i];
...@@ -2528,7 +2525,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r ...@@ -2528,7 +2525,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
/* remove chars that don't fit */ /* remove chars that don't fit */
if (honor_limit && !(es->style & ES_AUTOHSCROLL) && (es->text_width > fw)) { if (honor_limit && !(es->style & ES_AUTOHSCROLL) && (es->text_width > fw)) {
while ((es->text_width > fw) && s + strl >= s) { while ((es->text_width > fw) && s + strl >= s) {
strcpyW(es->text + s + strl - 1, es->text + s + strl); lstrcpyW(es->text + s + strl - 1, es->text + s + strl);
strl--; strl--;
es->text_length = -1; es->text_length = -1;
EDIT_InvalidateUniscribeData(es); EDIT_InvalidateUniscribeData(es);
...@@ -2541,7 +2538,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r ...@@ -2541,7 +2538,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
if (e != s) { if (e != s) {
if (can_undo) { if (can_undo) {
utl = strlenW(es->undo_text); utl = lstrlenW(es->undo_text);
if (!es->undo_insert_count && (*es->undo_text && (s == es->undo_position))) { if (!es->undo_insert_count && (*es->undo_text && (s == es->undo_position))) {
/* undo-buffer is extended to the right */ /* undo-buffer is extended to the right */
EDIT_MakeUndoFit(es, utl + e - s); EDIT_MakeUndoFit(es, utl + e - s);
...@@ -2880,11 +2877,11 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es) ...@@ -2880,11 +2877,11 @@ static BOOL EDIT_EM_Undo(EDITSTATE *es)
if( es->style & ES_READONLY ) if( es->style & ES_READONLY )
return !(es->style & ES_MULTILINE); return !(es->style & ES_MULTILINE);
ulength = strlenW(es->undo_text); ulength = lstrlenW(es->undo_text);
utext = heap_alloc((ulength + 1) * sizeof(WCHAR)); utext = heap_alloc((ulength + 1) * sizeof(WCHAR));
strcpyW(utext, es->undo_text); lstrcpyW(utext, es->undo_text);
TRACE("before UNDO:insertion length = %d, deletion buffer = %s\n", TRACE("before UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, debugstr_w(utext)); es->undo_insert_count, debugstr_w(utext));
...@@ -2935,9 +2932,9 @@ static void EDIT_WM_Paste(EDITSTATE *es) ...@@ -2935,9 +2932,9 @@ static void EDIT_WM_Paste(EDITSTATE *es)
OpenClipboard(es->hwndSelf); OpenClipboard(es->hwndSelf);
if ((hsrc = GetClipboardData(CF_UNICODETEXT))) { if ((hsrc = GetClipboardData(CF_UNICODETEXT))) {
src = GlobalLock(hsrc); src = GlobalLock(hsrc);
len = strlenW(src); len = lstrlenW(src);
/* Protect single-line edit against pasting new line character */ /* Protect single-line edit against pasting new line character */
if (!(es->style & ES_MULTILINE) && ((ptr = strchrW(src, '\n')))) { if (!(es->style & ES_MULTILINE) && ((ptr = wcschr(src, '\n')))) {
len = ptr - src; len = ptr - src;
if (len && src[len - 1] == '\r') if (len && src[len - 1] == '\r')
--len; --len;
...@@ -3202,7 +3199,7 @@ static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst) ...@@ -3202,7 +3199,7 @@ static INT EDIT_WM_GetText(const EDITSTATE *es, INT count, LPWSTR dst)
return 0; return 0;
lstrcpynW(dst, es->text, count); lstrcpynW(dst, es->text, count);
return strlenW(dst); return lstrlenW(dst);
} }
/********************************************************************* /*********************************************************************
...@@ -3808,7 +3805,7 @@ static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text) ...@@ -3808,7 +3805,7 @@ static void EDIT_WM_SetText(EDITSTATE *es, LPCWSTR text)
if (text) if (text)
{ {
TRACE("%s\n", debugstr_w(text)); TRACE("%s\n", debugstr_w(text));
EDIT_EM_ReplaceSel(es, FALSE, text, strlenW(text), FALSE, FALSE); EDIT_EM_ReplaceSel(es, FALSE, text, lstrlenW(text), FALSE, FALSE);
} }
else else
{ {
...@@ -4209,9 +4206,9 @@ static LRESULT EDIT_EM_GetThumb(EDITSTATE *es) ...@@ -4209,9 +4206,9 @@ static LRESULT EDIT_EM_GetThumb(EDITSTATE *es)
static inline WCHAR *heap_strdupW(const WCHAR *str) static inline WCHAR *heap_strdupW(const WCHAR *str)
{ {
int len = strlenW(str) + 1; int len = lstrlenW(str) + 1;
WCHAR *ret = heap_alloc(len * sizeof(WCHAR)); WCHAR *ret = heap_alloc(len * sizeof(WCHAR));
strcpyW(ret, str); lstrcpyW(ret, str);
return ret; return ret;
} }
...@@ -4536,7 +4533,7 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name) ...@@ -4536,7 +4533,7 @@ static LRESULT EDIT_WM_Create(EDITSTATE *es, const WCHAR *name)
if (name && *name) if (name && *name)
{ {
EDIT_EM_ReplaceSel(es, FALSE, name, strlenW(name), FALSE, FALSE); EDIT_EM_ReplaceSel(es, FALSE, name, lstrlenW(name), FALSE, FALSE);
/* if we insert text to the editline, the text scrolls out /* if we insert text to the editline, the text scrolls out
* of the window, as the caret is placed after the insert * of the window, as the caret is placed after the insert
* pos normally; thus we reset es->selection... to 0 and * pos normally; thus we reset es->selection... to 0 and
...@@ -4706,7 +4703,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ...@@ -4706,7 +4703,7 @@ static LRESULT CALLBACK EDIT_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
{ {
const WCHAR *textW = (const WCHAR *)lParam; const WCHAR *textW = (const WCHAR *)lParam;
EDIT_EM_ReplaceSel(es, (BOOL)wParam, textW, strlenW(textW), TRUE, TRUE); EDIT_EM_ReplaceSel(es, (BOOL)wParam, textW, lstrlenW(textW), TRUE, TRUE);
result = 1; result = 1;
break; break;
} }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "vsstyle.h" #include "vsstyle.h"
#include "vssym32.h" #include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
...@@ -83,12 +82,12 @@ static void IPADDRESS_UpdateText (const IPADDRESS_INFO *infoPtr) ...@@ -83,12 +82,12 @@ static void IPADDRESS_UpdateText (const IPADDRESS_INFO *infoPtr)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4)) if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4))
strcatW(ip, field); lstrcatW(ip, field);
else else
/* empty edit treated as zero */ /* empty edit treated as zero */
strcatW(ip, zero); lstrcatW(ip, zero);
if (i != 3) if (i != 3)
strcatW(ip, dot); lstrcatW(ip, dot);
} }
SetWindowTextW(infoPtr->Self, ip); SetWindowTextW(infoPtr->Self, ip);
...@@ -237,7 +236,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) ...@@ -237,7 +236,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
hSysFont = GetStockObject(ANSI_VAR_FONT); hSysFont = GetStockObject(ANSI_VAR_FONT);
GetObjectW(hSysFont, sizeof(LOGFONTW), &logSysFont); GetObjectW(hSysFont, sizeof(LOGFONTW), &logSysFont);
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0); SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
strcpyW(logFont.lfFaceName, logSysFont.lfFaceName); lstrcpyW(logFont.lfFaceName, logSysFont.lfFaceName);
hFont = CreateFontIndirectW(&logFont); hFont = CreateFontIndirectW(&logFont);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
...@@ -336,7 +335,7 @@ static int IPADDRESS_GetAddress (const IPADDRESS_INFO *infoPtr, LPDWORD ip_addre ...@@ -336,7 +335,7 @@ static int IPADDRESS_GetAddress (const IPADDRESS_INFO *infoPtr, LPDWORD ip_addre
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
ip_addr *= 256; ip_addr *= 256;
if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4)) if (GetWindowTextW (infoPtr->Part[i].EditHwnd, field, 4))
ip_addr += atolW(field); ip_addr += wcstol(field, NULL, 10);
else else
invalid++; invalid++;
} }
...@@ -418,7 +417,7 @@ static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int current ...@@ -418,7 +417,7 @@ static BOOL IPADDRESS_ConstrainField (const IPADDRESS_INFO *infoPtr, int current
part = &infoPtr->Part[currentfield]; part = &infoPtr->Part[currentfield];
if (!GetWindowTextW (part->EditHwnd, field, 4)) return FALSE; if (!GetWindowTextW (part->EditHwnd, field, 4)) return FALSE;
curValue = atoiW(field); curValue = wcstol(field, NULL, 10);
TRACE(" curValue=%d\n", curValue); TRACE(" curValue=%d\n", curValue);
newValue = IPADDRESS_IPNotify(infoPtr, currentfield, curValue); newValue = IPADDRESS_IPNotify(infoPtr, currentfield, curValue);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include "commctrl.h" #include "commctrl.h"
#include "uxtheme.h" #include "uxtheme.h"
#include "vssym32.h" #include "vssym32.h"
#include "wine/unicode.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
...@@ -684,14 +683,14 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, ...@@ -684,14 +683,14 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect,
else if (!(descr->style & LBS_USETABSTOPS)) else if (!(descr->style & LBS_USETABSTOPS))
ExtTextOutW( hdc, rect->left + 1, rect->top, ExtTextOutW( hdc, rect->left + 1, rect->top,
ETO_OPAQUE | ETO_CLIPPED, rect, item_str, ETO_OPAQUE | ETO_CLIPPED, rect, item_str,
strlenW(item_str), NULL ); lstrlenW(item_str), NULL );
else else
{ {
/* Output empty string to paint background in the full width. */ /* Output empty string to paint background in the full width. */
ExtTextOutW( hdc, rect->left + 1, rect->top, ExtTextOutW( hdc, rect->left + 1, rect->top,
ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL ); ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL );
TabbedTextOutW( hdc, rect->left + 1 , rect->top, TabbedTextOutW( hdc, rect->left + 1 , rect->top,
item_str, strlenW(item_str), item_str, lstrlenW(item_str),
descr->nb_tabs, descr->tabs, 0); descr->nb_tabs, descr->tabs, 0);
} }
if (selected) if (selected)
...@@ -857,14 +856,14 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL ...@@ -857,14 +856,14 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL
WCHAR *str = get_item_string(descr, index); WCHAR *str = get_item_string(descr, index);
if (!buffer) if (!buffer)
return strlenW(str); return lstrlenW(str);
TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(str)); TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(str));
__TRY /* hide a Delphi bug that passes a read-only buffer */ __TRY /* hide a Delphi bug that passes a read-only buffer */
{ {
strcpyW(buffer, str); lstrcpyW(buffer, str);
len = strlenW(buffer); len = lstrlenW(buffer);
} }
__EXCEPT_PAGE_FAULT __EXCEPT_PAGE_FAULT
{ {
...@@ -1011,7 +1010,7 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa ...@@ -1011,7 +1010,7 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
else else
{ {
/* Special case for drives and directories: ignore prefix */ /* Special case for drives and directories: ignore prefix */
INT len = strlenW(str); INT len = lstrlenW(str);
WCHAR *item_str; WCHAR *item_str;
for (i = 0, index = start; i < descr->nb_items; i++, index++) for (i = 0, index = start; i < descr->nb_items; i++, index++)
...@@ -1019,11 +1018,11 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa ...@@ -1019,11 +1018,11 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
if (index == descr->nb_items) index = 0; if (index == descr->nb_items) index = 0;
item_str = get_item_string(descr, index); item_str = get_item_string(descr, index);
if (!strncmpiW(str, item_str, len)) return index; if (!wcsnicmp(str, item_str, len)) return index;
if (item_str[0] == '[') if (item_str[0] == '[')
{ {
if (!strncmpiW(str, item_str + 1, len)) return index; if (!wcsnicmp(str, item_str + 1, len)) return index;
if (item_str[1] == '-' && !strncmpiW(str, item_str + 2, len)) return index; if (item_str[1] == '-' && !wcsnicmp(str, item_str + 2, len)) return index;
} }
} }
} }
...@@ -1688,12 +1687,12 @@ static LRESULT LISTBOX_InsertString( LB_DESCR *descr, INT index, LPCWSTR str ) ...@@ -1688,12 +1687,12 @@ static LRESULT LISTBOX_InsertString( LB_DESCR *descr, INT index, LPCWSTR str )
{ {
static const WCHAR empty_stringW[] = { 0 }; static const WCHAR empty_stringW[] = { 0 };
if (!str) str = empty_stringW; if (!str) str = empty_stringW;
if (!(new_str = HeapAlloc( GetProcessHeap(), 0, (strlenW(str) + 1) * sizeof(WCHAR) ))) if (!(new_str = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(str) + 1) * sizeof(WCHAR) )))
{ {
SEND_NOTIFICATION( descr, LBN_ERRSPACE ); SEND_NOTIFICATION( descr, LBN_ERRSPACE );
return LB_ERRSPACE; return LB_ERRSPACE;
} }
strcpyW(new_str, str); lstrcpyW(new_str, str);
} }
if (index == -1) index = descr->nb_items; if (index == -1) index = descr->nb_items;
...@@ -1880,13 +1879,13 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib, ...@@ -1880,13 +1879,13 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
static const WCHAR bracketW[] = { ']',0 }; static const WCHAR bracketW[] = { ']',0 };
static const WCHAR dotW[] = { '.',0 }; static const WCHAR dotW[] = { '.',0 };
if (!(attrib & DDL_DIRECTORY) || if (!(attrib & DDL_DIRECTORY) ||
!strcmpW( entry.cFileName, dotW )) continue; !lstrcmpW( entry.cFileName, dotW )) continue;
buffer[0] = '['; buffer[0] = '[';
if (!long_names && entry.cAlternateFileName[0]) if (!long_names && entry.cAlternateFileName[0])
strcpyW( buffer + 1, entry.cAlternateFileName ); lstrcpyW( buffer + 1, entry.cAlternateFileName );
else else
strcpyW( buffer + 1, entry.cFileName ); lstrcpyW( buffer + 1, entry.cFileName );
strcatW(buffer, bracketW); lstrcatW(buffer, bracketW);
} }
else /* not a directory */ else /* not a directory */
{ {
...@@ -1898,9 +1897,9 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib, ...@@ -1898,9 +1897,9 @@ static LRESULT LISTBOX_Directory( LB_DESCR *descr, UINT attrib,
continue; continue;
#undef ATTRIBS #undef ATTRIBS
if (!long_names && entry.cAlternateFileName[0]) if (!long_names && entry.cAlternateFileName[0])
strcpyW( buffer, entry.cAlternateFileName ); lstrcpyW( buffer, entry.cAlternateFileName );
else else
strcpyW( buffer, entry.cFileName ); lstrcpyW( buffer, entry.cFileName );
} }
if (!long_names) CharLowerW( buffer ); if (!long_names) CharLowerW( buffer );
pos = LISTBOX_FindFileStrPos( descr, buffer ); pos = LISTBOX_FindFileStrPos( descr, buffer );
...@@ -2732,7 +2731,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, ...@@ -2732,7 +2731,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
return LB_ERR; return LB_ERR;
} }
if (!HAS_STRINGS(descr)) return sizeof(ULONG_PTR); if (!HAS_STRINGS(descr)) return sizeof(ULONG_PTR);
return strlenW(get_item_string(descr, wParam)); return lstrlenW(get_item_string(descr, wParam));
case LB_GETCURSEL: case LB_GETCURSEL:
if (descr->nb_items == 0) if (descr->nb_items == 0)
......
...@@ -124,9 +124,6 @@ ...@@ -124,9 +124,6 @@
* -- LVGroupComparE * -- LVGroupComparE
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
...@@ -145,7 +142,6 @@ ...@@ -145,7 +142,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(listview); WINE_DEFAULT_DEBUG_CHANNEL(listview);
...@@ -997,7 +993,7 @@ static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISP ...@@ -997,7 +993,7 @@ static BOOL notify_dispinfoT(const LISTVIEW_INFO *infoPtr, UINT code, LPNMLVDISP
} }
else if (return_unicode && (pdi->hdr.code == LVN_GETDISPINFOW)) else if (return_unicode && (pdi->hdr.code == LVN_GETDISPINFOW))
{ {
strcpyW(ret_text, pdi->item.pszText); lstrcpyW(ret_text, pdi->item.pszText);
} }
else if (return_ansi) /* note : pointer can be changed by app ! */ else if (return_ansi) /* note : pointer can be changed by app ! */
{ {
...@@ -1870,7 +1866,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L ...@@ -1870,7 +1866,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
if (!charCode || !keyData || infoPtr->nItemCount == 0) return 0; if (!charCode || !keyData || infoPtr->nItemCount == 0) return 0;
/* only allow the valid WM_CHARs through */ /* only allow the valid WM_CHARs through */
if (!isalnumW(charCode) && if (!iswalnum(charCode) &&
charCode != '.' && charCode != '`' && charCode != '!' && charCode != '.' && charCode != '`' && charCode != '!' &&
charCode != '@' && charCode != '#' && charCode != '$' && charCode != '@' && charCode != '#' && charCode != '$' &&
charCode != '%' && charCode != '^' && charCode != '&' && charCode != '%' && charCode != '^' && charCode != '&' &&
...@@ -6405,7 +6401,7 @@ again: ...@@ -6405,7 +6401,7 @@ again:
{ {
if (lpFindInfo->flags & (LVFI_PARTIAL | LVFI_SUBSTRING)) if (lpFindInfo->flags & (LVFI_PARTIAL | LVFI_SUBSTRING))
{ {
WCHAR *p = strstrW(lvItem.pszText, lpFindInfo->psz); WCHAR *p = wcsstr(lvItem.pszText, lpFindInfo->psz);
if (!p || p != lvItem.pszText) continue; if (!p || p != lvItem.pszText) continue;
} }
else else
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include "comctl32.h" #include "comctl32.h"
#include "uxtheme.h" #include "uxtheme.h"
#include "vssym32.h" #include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h" #include "wine/heap.h"
...@@ -885,18 +884,18 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU ...@@ -885,18 +884,18 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
/* draw formatted date string */ /* draw formatted date string */
GetDateFormatW(LOCALE_USER_DEFAULT, DATE_YEARMONTH, st, NULL, strW, ARRAY_SIZE(strW)); GetDateFormatW(LOCALE_USER_DEFAULT, DATE_YEARMONTH, st, NULL, strW, ARRAY_SIZE(strW));
DrawTextW(hdc, strW, strlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE); DrawTextW(hdc, strW, lstrlenW(strW), title, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, ARRAY_SIZE(fmtW)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SYEARMONTH, fmtW, ARRAY_SIZE(fmtW));
wsprintfW(yearW, fmtyearW, st->wYear); wsprintfW(yearW, fmtyearW, st->wYear);
/* month is trickier as it's possible to have different format pictures, we'll /* month is trickier as it's possible to have different format pictures, we'll
test for M, MM, MMM, and MMMM */ test for M, MM, MMM, and MMMM */
if (strstrW(fmtW, mmmmW)) if (wcsstr(fmtW, mmmmW))
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW));
else if (strstrW(fmtW, mmmW)) else if (wcsstr(fmtW, mmmW))
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVMONTHNAME1+st->wMonth-1, monthW, ARRAY_SIZE(monthW));
else if (strstrW(fmtW, mmW)) else if (wcsstr(fmtW, mmW))
wsprintfW(monthW, fmtmmW, st->wMonth); wsprintfW(monthW, fmtmmW, st->wMonth);
else else
wsprintfW(monthW, fmtmW, st->wMonth); wsprintfW(monthW, fmtmW, st->wMonth);
...@@ -905,7 +904,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU ...@@ -905,7 +904,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
yearoffset = 0; yearoffset = 0;
while (strW[yearoffset]) while (strW[yearoffset])
{ {
if (!strncmpW(&strW[yearoffset], yearW, strlenW(yearW))) if (!wcsncmp(&strW[yearoffset], yearW, lstrlenW(yearW)))
break; break;
yearoffset++; yearoffset++;
} }
...@@ -913,7 +912,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU ...@@ -913,7 +912,7 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
monthoffset = 0; monthoffset = 0;
while (strW[monthoffset]) while (strW[monthoffset])
{ {
if (!strncmpW(&strW[monthoffset], monthW, strlenW(monthW))) if (!wcsncmp(&strW[monthoffset], monthW, lstrlenW(monthW)))
break; break;
monthoffset++; monthoffset++;
} }
...@@ -930,15 +929,15 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU ...@@ -930,15 +929,15 @@ static void MONTHCAL_PaintTitle(MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRU
infoPtr->calendars[calIdx].titlemonth.left = sz.cx; infoPtr->calendars[calIdx].titlemonth.left = sz.cx;
/* for right limits use actual string parts lengths */ /* for right limits use actual string parts lengths */
GetTextExtentPoint32W(hdc, &strW[yearoffset], strlenW(yearW), &sz); GetTextExtentPoint32W(hdc, &strW[yearoffset], lstrlenW(yearW), &sz);
infoPtr->calendars[calIdx].titleyear.right = infoPtr->calendars[calIdx].titleyear.left + sz.cx; infoPtr->calendars[calIdx].titleyear.right = infoPtr->calendars[calIdx].titleyear.left + sz.cx;
GetTextExtentPoint32W(hdc, monthW, strlenW(monthW), &sz); GetTextExtentPoint32W(hdc, monthW, lstrlenW(monthW), &sz);
infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx; infoPtr->calendars[calIdx].titlemonth.right = infoPtr->calendars[calIdx].titlemonth.left + sz.cx;
/* Finally translate rectangles to match center aligned string, /* Finally translate rectangles to match center aligned string,
hit rectangles are relative to title rectangle before translation. */ hit rectangles are relative to title rectangle before translation. */
GetTextExtentPoint32W(hdc, strW, strlenW(strW), &sz); GetTextExtentPoint32W(hdc, strW, lstrlenW(strW), &sz);
shiftX = (title->right - title->left - sz.cx) / 2 + title->left; shiftX = (title->right - title->left - sz.cx) / 2 + title->left;
OffsetRect(&infoPtr->calendars[calIdx].titleyear, shiftX, 0); OffsetRect(&infoPtr->calendars[calIdx].titleyear, shiftX, 0);
OffsetRect(&infoPtr->calendars[calIdx].titlemonth, shiftX, 0); OffsetRect(&infoPtr->calendars[calIdx].titlemonth, shiftX, 0);
...@@ -974,7 +973,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con ...@@ -974,7 +973,7 @@ static void MONTHCAL_PaintWeeknumbers(const MONTHCAL_INFO *infoPtr, HDC hdc, con
The first week of the year must contain only days of the new year The first week of the year must contain only days of the new year
*/ */
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTWEEKOFYEAR, buf, ARRAY_SIZE(buf)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTWEEKOFYEAR, buf, ARRAY_SIZE(buf));
weeknum = atoiW(buf); weeknum = wcstol(buf, NULL, 10);
switch (weeknum) switch (weeknum)
{ {
case 1: mindays = 6; case 1: mindays = 6;
...@@ -1205,7 +1204,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const ...@@ -1205,7 +1204,7 @@ static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const
i = infoPtr->firstDay; i = infoPtr->firstDay;
for(j = 0; j < 7; j++) { for(j = 0; j < 7; j++) {
get_localized_dayname(infoPtr, (i + j + 6) % 7, buf, ARRAY_SIZE(buf)); get_localized_dayname(infoPtr, (i + j + 6) % 7, buf, ARRAY_SIZE(buf));
DrawTextW(hdc, buf, strlenW(buf), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE); DrawTextW(hdc, buf, lstrlenW(buf), &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
OffsetRect(&r, infoPtr->width_increment, 0); OffsetRect(&r, infoPtr->width_increment, 0);
} }
...@@ -1411,9 +1410,9 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day) ...@@ -1411,9 +1410,9 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day)
WCHAR buf[80]; WCHAR buf[80];
GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, ARRAY_SIZE(buf)); GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_IFIRSTDAYOFWEEK, buf, ARRAY_SIZE(buf));
TRACE("%s %d\n", debugstr_w(buf), strlenW(buf)); TRACE("%s %d\n", debugstr_w(buf), lstrlenW(buf));
new_day = atoiW(buf); new_day = wcstol(buf, NULL, 10);
infoPtr->firstDaySet = FALSE; infoPtr->firstDaySet = FALSE;
} }
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
/****************************************************************************** /******************************************************************************
* Data structures * Data structures
...@@ -177,9 +176,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(propsheet); ...@@ -177,9 +176,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(propsheet);
static WCHAR *heap_strdupW(const WCHAR *str) static WCHAR *heap_strdupW(const WCHAR *str)
{ {
int len = strlenW(str) + 1; int len = lstrlenW(str) + 1;
WCHAR *ret = Alloc(len * sizeof(WCHAR)); WCHAR *ret = Alloc(len * sizeof(WCHAR));
strcpyW(ret, str); lstrcpyW(ret, str);
return ret; return ret;
} }
...@@ -2148,8 +2147,8 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText) ...@@ -2148,8 +2147,8 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
if (dwStyle & PSH_PROPTITLE) if (dwStyle & PSH_PROPTITLE)
{ {
WCHAR* dest; WCHAR* dest;
int lentitle = strlenW(lpszText); int lentitle = lstrlenW(lpszText);
int lenprop = strlenW(psInfo->strPropertiesFor); int lenprop = lstrlenW(psInfo->strPropertiesFor);
dest = Alloc( (lentitle + lenprop + 1)*sizeof (WCHAR)); dest = Alloc( (lentitle + lenprop + 1)*sizeof (WCHAR));
wsprintfW(dest, psInfo->strPropertiesFor, lpszText); wsprintfW(dest, psInfo->strPropertiesFor, lpszText);
...@@ -2934,7 +2933,7 @@ static LPWSTR load_string( HINSTANCE instance, LPCWSTR str ) ...@@ -2934,7 +2933,7 @@ static LPWSTR load_string( HINSTANCE instance, LPCWSTR str )
} }
else else
{ {
int len = (strlenW(str) + 1) * sizeof(WCHAR); int len = (lstrlenW(str) + 1) * sizeof(WCHAR);
ret = Alloc( len ); ret = Alloc( len );
if (ret) memcpy( ret, str, len ); if (ret) memcpy( ret, str, len );
} }
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
#include "wine/unicode.h"
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
#include "commctrl.h" #include "commctrl.h"
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
...@@ -486,10 +485,10 @@ STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf) ...@@ -486,10 +485,10 @@ STATUSBAR_GetTextW (STATUS_INFO *infoPtr, INT nPart, LPWSTR buf)
if (part->style & SBT_OWNERDRAW) if (part->style & SBT_OWNERDRAW)
result = (LRESULT)part->text; result = (LRESULT)part->text;
else { else {
result = part->text ? strlenW (part->text) : 0; result = part->text ? lstrlenW (part->text) : 0;
result |= (part->style << 16); result |= (part->style << 16);
if (part->text && buf) if (part->text && buf)
strcpyW (buf, part->text); lstrcpyW (buf, part->text);
} }
return result; return result;
} }
...@@ -512,7 +511,7 @@ STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart) ...@@ -512,7 +511,7 @@ STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
part = &infoPtr->parts[nPart]; part = &infoPtr->parts[nPart];
if ((~part->style & SBT_OWNERDRAW) && part->text) if ((~part->style & SBT_OWNERDRAW) && part->text)
result = strlenW(part->text); result = lstrlenW(part->text);
else else
result = 0; result = 0;
...@@ -736,16 +735,16 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style, ...@@ -736,16 +735,16 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
if (!ntext) return FALSE; if (!ntext) return FALSE;
MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len ); MultiByteToWideChar( CP_ACP, 0, atxt, -1, ntext, len );
} else if (text) { } else if (text) {
ntext = Alloc( (strlenW(text) + 1)*sizeof(WCHAR) ); ntext = Alloc( (lstrlenW(text) + 1)*sizeof(WCHAR) );
if (!ntext) return FALSE; if (!ntext) return FALSE;
strcpyW (ntext, text); lstrcpyW (ntext, text);
} else ntext = 0; } else ntext = 0;
/* replace nonprintable characters with spaces */ /* replace nonprintable characters with spaces */
if (ntext) { if (ntext) {
idx = ntext; idx = ntext;
while (*idx) { while (*idx) {
if(!isprintW(*idx)) if(!iswprint(*idx))
*idx = ' '; *idx = ' ';
idx++; idx++;
} }
...@@ -926,11 +925,11 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) ...@@ -926,11 +925,11 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
OpenThemeData (hwnd, themeClass); OpenThemeData (hwnd, themeClass);
if (lpCreate->lpszName && (len = strlenW ((LPCWSTR)lpCreate->lpszName))) if (lpCreate->lpszName && (len = lstrlenW ((LPCWSTR)lpCreate->lpszName)))
{ {
infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR)); infoPtr->parts[0].text = Alloc ((len + 1)*sizeof(WCHAR));
if (!infoPtr->parts[0].text) goto create_fail; if (!infoPtr->parts[0].text) goto create_fail;
strcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName); lstrcpyW (infoPtr->parts[0].text, (LPCWSTR)lpCreate->lpszName);
} }
dwStyle = GetWindowLongW (hwnd, GWL_STYLE); dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
...@@ -979,12 +978,12 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf) ...@@ -979,12 +978,12 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
if (!(infoPtr->parts[0].text)) if (!(infoPtr->parts[0].text))
return 0; return 0;
len = strlenW (infoPtr->parts[0].text); len = lstrlenW (infoPtr->parts[0].text);
if (!size) if (!size)
return len; return len;
else if (size > len) { else if (size > len) {
strcpyW (buf, infoPtr->parts[0].text); lstrcpyW (buf, infoPtr->parts[0].text);
return len; return len;
} }
else { else {
...@@ -1065,10 +1064,10 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text) ...@@ -1065,10 +1064,10 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
Free (part->text); Free (part->text);
part->text = 0; part->text = 0;
if (text && (len = strlenW((LPCWSTR)text))) { if (text && (len = lstrlenW((LPCWSTR)text))) {
part->text = Alloc ((len+1)*sizeof(WCHAR)); part->text = Alloc ((len+1)*sizeof(WCHAR));
if (!part->text) return FALSE; if (!part->text) return FALSE;
strcpyW (part->text, (LPCWSTR)text); lstrcpyW (part->text, (LPCWSTR)text);
} }
InvalidateRect(infoPtr->Self, &part->bound, FALSE); InvalidateRect(infoPtr->Self, &part->bound, FALSE);
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
* *
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdlib.h> /* atoi */ #include <stdlib.h> /* atoi */
...@@ -36,7 +33,6 @@ ...@@ -36,7 +33,6 @@
#include "comctl32.h" #include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -208,7 +204,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen) ...@@ -208,7 +204,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen); TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
if (!lpDest && lpSrc) if (!lpDest && lpSrc)
return strlenW (lpSrc); return lstrlenW (lpSrc);
if (nMaxLen == 0) if (nMaxLen == 0)
return 0; return 0;
...@@ -218,7 +214,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen) ...@@ -218,7 +214,7 @@ INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
return 0; return 0;
} }
len = strlenW (lpSrc); len = lstrlenW (lpSrc);
if (len >= nMaxLen) if (len >= nMaxLen)
len = nMaxLen - 1; len = nMaxLen - 1;
...@@ -238,11 +234,11 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc) ...@@ -238,11 +234,11 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
TRACE("(%p %s)\n", lppDest, debugstr_w(lpSrc)); TRACE("(%p %s)\n", lppDest, debugstr_w(lpSrc));
if (lpSrc) { if (lpSrc) {
INT len = strlenW (lpSrc) + 1; INT len = lstrlenW (lpSrc) + 1;
LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR)); LPWSTR ptr = ReAlloc (*lppDest, len * sizeof(WCHAR));
if (!ptr) if (!ptr)
return FALSE; return FALSE;
strcpyW (ptr, lpSrc); lstrcpyW (ptr, lpSrc);
*lppDest = ptr; *lppDest = ptr;
} }
else { else {
...@@ -391,8 +387,8 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) ...@@ -391,8 +387,8 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
if (!lpszStr || !lpszSearch || !*lpszSearch) if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL; return NULL;
iLen = strlenW(lpszSearch); iLen = lstrlenW(lpszSearch);
end = lpszStr + strlenW(lpszStr); end = lpszStr + lstrlenW(lpszStr);
while (lpszStr + iLen <= end) while (lpszStr + iLen <= end)
{ {
...@@ -410,7 +406,7 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch) ...@@ -410,7 +406,7 @@ LPWSTR WINAPI StrStrIW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
*/ */
INT WINAPI StrToIntW (LPCWSTR lpString) INT WINAPI StrToIntW (LPCWSTR lpString)
{ {
return atoiW(lpString); return wcstol(lpString, NULL, 10);
} }
/************************************************************************* /*************************************************************************
...@@ -472,7 +468,7 @@ LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch) ...@@ -472,7 +468,7 @@ LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
TRACE("(%s,%i)\n", debugstr_w(lpszStr), ch); TRACE("(%s,%i)\n", debugstr_w(lpszStr), ch);
if (lpszStr) if (lpszStr)
lpszRet = strchrW(lpszStr, ch); lpszRet = wcschr(lpszStr, ch);
return lpszRet; return lpszRet;
} }
...@@ -558,7 +554,7 @@ LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch) ...@@ -558,7 +554,7 @@ LPWSTR WINAPI StrRChrW(LPCWSTR str, LPCWSTR end, WORD ch)
WCHAR *ret = NULL; WCHAR *ret = NULL;
if (!str) return NULL; if (!str) return NULL;
if (!end) end = str + strlenW(str); if (!end) end = str + lstrlenW(str);
while (str < end) while (str < end)
{ {
if (*str == ch) ret = (WCHAR *)str; if (*str == ch) ret = (WCHAR *)str;
...@@ -594,7 +590,7 @@ LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch) ...@@ -594,7 +590,7 @@ LPSTR WINAPI StrStrA(LPCSTR lpszStr, LPCSTR lpszSearch)
LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch) LPWSTR WINAPI StrStrW(LPCWSTR lpszStr, LPCWSTR lpszSearch)
{ {
if (!lpszStr || !lpszSearch) return NULL; if (!lpszStr || !lpszSearch) return NULL;
return strstrW( lpszStr, lpszSearch ); return wcsstr( lpszStr, lpszSearch );
} }
/************************************************************************* /*************************************************************************
...@@ -638,10 +634,10 @@ LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch) ...@@ -638,10 +634,10 @@ LPWSTR WINAPI StrChrIW(LPCWSTR lpszStr, WCHAR ch)
if (lpszStr) if (lpszStr)
{ {
ch = toupperW(ch); ch = towupper(ch);
while (*lpszStr) while (*lpszStr)
{ {
if (toupperW(*lpszStr) == ch) if (towupper(*lpszStr) == ch)
return (LPWSTR)lpszStr; return (LPWSTR)lpszStr;
lpszStr++; lpszStr++;
} }
...@@ -713,10 +709,10 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch) ...@@ -713,10 +709,10 @@ LPWSTR WINAPI StrRStrIW(LPCWSTR lpszStr, LPCWSTR lpszEnd, LPCWSTR lpszSearch)
if (!lpszStr || !lpszSearch || !*lpszSearch) if (!lpszStr || !lpszSearch || !*lpszSearch)
return NULL; return NULL;
iLen = strlenW(lpszSearch); iLen = lstrlenW(lpszSearch);
if (!lpszEnd) if (!lpszEnd)
lpszEnd = lpszStr + strlenW(lpszStr); lpszEnd = lpszStr + lstrlenW(lpszStr);
else /* reproduce the broken behaviour on Windows */ else /* reproduce the broken behaviour on Windows */
lpszEnd += min(iLen - 1, lstrlenW(lpszEnd)); lpszEnd += min(iLen - 1, lstrlenW(lpszEnd));
...@@ -826,7 +822,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch) ...@@ -826,7 +822,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch)
WCHAR *ret = NULL; WCHAR *ret = NULL;
if (!str) return NULL; if (!str) return NULL;
if (!end) end = str + strlenW(str); if (!end) end = str + lstrlenW(str);
while (str < end) while (str < end)
{ {
if (!COMCTL32_ChrCmpIW(*str, ch)) ret = (WCHAR *)str; if (!COMCTL32_ChrCmpIW(*str, ch)) ret = (WCHAR *)str;
...@@ -843,7 +839,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch) ...@@ -843,7 +839,7 @@ LPWSTR WINAPI StrRChrIW(LPCWSTR str, LPCWSTR end, WORD ch)
int WINAPI StrCSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch) int WINAPI StrCSpnW(LPCWSTR lpszStr, LPCWSTR lpszMatch)
{ {
if (!lpszStr || !lpszMatch) return 0; if (!lpszStr || !lpszMatch) return 0;
return strcspnW( lpszStr, lpszMatch ); return wcscspn( lpszStr, lpszMatch );
} }
/************************************************************************* /*************************************************************************
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "winnls.h" #include "winnls.h"
#include "commctrl.h" #include "commctrl.h"
#include "comctl32.h" #include "comctl32.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/list.h" #include "wine/list.h"
...@@ -124,7 +123,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN ...@@ -124,7 +123,7 @@ static PDOC_ITEM SYSLINK_AppendDocItem (SYSLINK_INFO *infoPtr, LPCWSTR Text, UIN
{ {
PDOC_ITEM Item; PDOC_ITEM Item;
textlen = min(textlen, strlenW(Text)); textlen = min(textlen, lstrlenW(Text));
Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[textlen + 1])); Item = Alloc(FIELD_OFFSET(DOC_ITEM, Text[textlen + 1]));
if(Item == NULL) if(Item == NULL)
{ {
...@@ -183,7 +182,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) ...@@ -183,7 +182,7 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
{ {
if(*current == '<') if(*current == '<')
{ {
if(!strncmpiW(current, SL_LINKOPEN, ARRAY_SIZE(SL_LINKOPEN)) && (CurrentType == slText)) if(!wcsnicmp(current, SL_LINKOPEN, ARRAY_SIZE(SL_LINKOPEN)) && (CurrentType == slText))
{ {
BOOL ValidParam = FALSE, ValidLink = FALSE; BOOL ValidParam = FALSE, ValidLink = FALSE;
...@@ -211,14 +210,14 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text) ...@@ -211,14 +210,14 @@ static UINT SYSLINK_ParseText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
CheckParameter: CheckParameter:
/* compare the current position with all known parameters */ /* compare the current position with all known parameters */
if(!strncmpiW(tmp, SL_HREF, ARRAY_SIZE(SL_HREF))) if(!wcsnicmp(tmp, SL_HREF, ARRAY_SIZE(SL_HREF)))
{ {
taglen += 6; taglen += 6;
ValidParam = TRUE; ValidParam = TRUE;
CurrentParameter = &lpUrl; CurrentParameter = &lpUrl;
CurrentParameterLen = &lenUrl; CurrentParameterLen = &lenUrl;
} }
else if(!strncmpiW(tmp, SL_ID, ARRAY_SIZE(SL_ID))) else if(!wcsnicmp(tmp, SL_ID, ARRAY_SIZE(SL_ID)))
{ {
taglen += 4; taglen += 4;
ValidParam = TRUE; ValidParam = TRUE;
...@@ -292,7 +291,7 @@ CheckParameter: ...@@ -292,7 +291,7 @@ CheckParameter:
} }
} }
} }
else if(!strncmpiW(current, SL_LINKCLOSE, ARRAY_SIZE(SL_LINKCLOSE)) && (CurrentType == slLink) && firsttag) else if(!wcsnicmp(current, SL_LINKCLOSE, ARRAY_SIZE(SL_LINKCLOSE)) && (CurrentType == slLink) && firsttag)
{ {
/* there's a <a...> tag opened, first add the previous text, if present */ /* there's a <a...> tag opened, first add the previous text, if present */
if(textstart != NULL && textlen > 0 && firsttag > textstart) if(textstart != NULL && textlen > 0 && firsttag > textstart)
...@@ -330,7 +329,7 @@ CheckParameter: ...@@ -330,7 +329,7 @@ CheckParameter:
/* Copy the tag parameters */ /* Copy the tag parameters */
if(lpID != NULL) if(lpID != NULL)
{ {
nc = min(lenId, strlenW(lpID)); nc = min(lenId, lstrlenW(lpID));
nc = min(nc, MAX_LINKID_TEXT - 1); nc = min(nc, MAX_LINKID_TEXT - 1);
Last->u.Link.szID = Alloc((nc + 1) * sizeof(WCHAR)); Last->u.Link.szID = Alloc((nc + 1) * sizeof(WCHAR));
if(Last->u.Link.szID != NULL) if(Last->u.Link.szID != NULL)
...@@ -342,7 +341,7 @@ CheckParameter: ...@@ -342,7 +341,7 @@ CheckParameter:
Last->u.Link.szID = NULL; Last->u.Link.szID = NULL;
if(lpUrl != NULL) if(lpUrl != NULL)
{ {
nc = min(lenUrl, strlenW(lpUrl)); nc = min(lenUrl, lstrlenW(lpUrl));
nc = min(nc, L_MAX_URL_LENGTH - 1); nc = min(nc, L_MAX_URL_LENGTH - 1);
Last->u.Link.szUrl = Alloc((nc + 1) * sizeof(WCHAR)); Last->u.Link.szUrl = Alloc((nc + 1) * sizeof(WCHAR));
if(Last->u.Link.szUrl != NULL) if(Last->u.Link.szUrl != NULL)
...@@ -408,7 +407,7 @@ CheckParameter: ...@@ -408,7 +407,7 @@ CheckParameter:
/* Copy the tag parameters */ /* Copy the tag parameters */
if(lpID != NULL) if(lpID != NULL)
{ {
nc = min(lenId, strlenW(lpID)); nc = min(lenId, lstrlenW(lpID));
nc = min(nc, MAX_LINKID_TEXT - 1); nc = min(nc, MAX_LINKID_TEXT - 1);
Last->u.Link.szID = Alloc((nc + 1) * sizeof(WCHAR)); Last->u.Link.szID = Alloc((nc + 1) * sizeof(WCHAR));
if(Last->u.Link.szID != NULL) if(Last->u.Link.szID != NULL)
...@@ -420,7 +419,7 @@ CheckParameter: ...@@ -420,7 +419,7 @@ CheckParameter:
Last->u.Link.szID = NULL; Last->u.Link.szID = NULL;
if(lpUrl != NULL) if(lpUrl != NULL)
{ {
nc = min(lenUrl, strlenW(lpUrl)); nc = min(lenUrl, lstrlenW(lpUrl));
nc = min(nc, L_MAX_URL_LENGTH - 1); nc = min(nc, L_MAX_URL_LENGTH - 1);
Last->u.Link.szUrl = Alloc((nc + 1) * sizeof(WCHAR)); Last->u.Link.szUrl = Alloc((nc + 1) * sizeof(WCHAR));
if(Last->u.Link.szUrl != NULL) if(Last->u.Link.szUrl != NULL)
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "comctl32.h" #include "comctl32.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(taskdialog); WINE_DEFAULT_DEBUG_CHANNEL(taskdialog);
...@@ -134,8 +133,8 @@ static WCHAR *taskdialog_get_exe_name(WCHAR *name, DWORD length) ...@@ -134,8 +133,8 @@ static WCHAR *taskdialog_get_exe_name(WCHAR *name, DWORD length)
if (len && len < length) if (len && len < length)
{ {
WCHAR *p; WCHAR *p;
if ((p = strrchrW(name, '/'))) name = p + 1; if ((p = wcsrchr(name, '/'))) name = p + 1;
if ((p = strrchrW(name, '\\'))) name = p + 1; if ((p = wcsrchr(name, '\\'))) name = p + 1;
return name; return name;
} }
else else
...@@ -164,7 +163,7 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi ...@@ -164,7 +163,7 @@ static DLGTEMPLATE *create_taskdialog_template(const TASKDIALOGCONFIG *taskconfi
titleW = taskconfig->pszWindowTitle; titleW = taskconfig->pszWindowTitle;
if (!titleW) if (!titleW)
titleW = emptyW; titleW = emptyW;
title_size = (strlenW(titleW) + 1) * sizeof(WCHAR); title_size = (lstrlenW(titleW) + 1) * sizeof(WCHAR);
size = sizeof(DLGTEMPLATE) + 2 * sizeof(WORD); size = sizeof(DLGTEMPLATE) + 2 * sizeof(WORD);
size += title_size; size += title_size;
...@@ -359,7 +358,7 @@ static WCHAR *taskdialog_gettext(struct taskdialog_info *dialog_info, BOOL user_ ...@@ -359,7 +358,7 @@ static WCHAR *taskdialog_gettext(struct taskdialog_info *dialog_info, BOOL user_
else else
{ {
textW = text; textW = text;
length = strlenW(textW); length = lstrlenW(textW);
} }
ret = Alloc((length + 1) * sizeof(WCHAR)); ret = Alloc((length + 1) * sizeof(WCHAR));
......
...@@ -76,7 +76,6 @@ ...@@ -76,7 +76,6 @@
#include "winreg.h" #include "winreg.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h"
#include "winnls.h" #include "winnls.h"
#include "commctrl.h" #include "commctrl.h"
#include "comctl32.h" #include "comctl32.h"
...@@ -1227,7 +1226,7 @@ TOOLBAR_MeasureString(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr, ...@@ -1227,7 +1226,7 @@ TOOLBAR_MeasureString(const TOOLBAR_INFO *infoPtr, const TBUTTON_INFO *btnPtr,
if(lpText != NULL) { if(lpText != NULL) {
/* first get size of all the text */ /* first get size of all the text */
GetTextExtentPoint32W (hdc, lpText, strlenW (lpText), lpSize); GetTextExtentPoint32W (hdc, lpText, lstrlenW (lpText), lpSize);
/* feed above size into the rectangle for DrawText */ /* feed above size into the rectangle for DrawText */
SetRect(&myrect, 0, 0, lpSize->cx, lpSize->cy); SetRect(&myrect, 0, 0, lpSize->cx, lpSize->cy);
...@@ -2957,7 +2956,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) ...@@ -2957,7 +2956,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
delimiter = *szString; delimiter = *szString;
p = szString + 1; p = szString + 1;
while ((next_delim = strchrW(p, delimiter)) != NULL) { while ((next_delim = wcschr(p, delimiter)) != NULL) {
*next_delim = 0; *next_delim = 0;
if (next_delim + 1 >= szString + len) if (next_delim + 1 >= szString + len)
{ {
...@@ -2981,7 +2980,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam) ...@@ -2981,7 +2980,7 @@ TOOLBAR_AddStringW (TOOLBAR_INFO *infoPtr, HINSTANCE hInstance, LPARAM lParam)
return -1; return -1;
TRACE("adding string(s) from array\n"); TRACE("adding string(s) from array\n");
while (*p) { while (*p) {
len = strlenW (p); len = lstrlenW (p);
TRACE("len=%d %s\n", len, debugstr_w(p)); TRACE("len=%d %s\n", len, debugstr_w(p));
infoPtr->strings = ReAlloc(infoPtr->strings, sizeof(LPWSTR)*(infoPtr->nNumStrings+1)); infoPtr->strings = ReAlloc(infoPtr->strings, sizeof(LPWSTR)*(infoPtr->nNumStrings+1));
...@@ -3436,8 +3435,8 @@ TOOLBAR_GetButtonText (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr, BOOL i ...@@ -3436,8 +3435,8 @@ TOOLBAR_GetButtonText (const TOOLBAR_INFO *infoPtr, INT Id, LPWSTR lpStr, BOOL i
{ {
if (lpText) if (lpText)
{ {
ret = strlenW (lpText); ret = lstrlenW (lpText);
if (lpStr) strcpyW (lpStr, lpText); if (lpStr) lstrcpyW (lpStr, lpText);
} }
} }
else else
...@@ -3848,7 +3847,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt ...@@ -3848,7 +3847,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt
if (!(btnPtr->fsStyle & BTNS_NOPREFIX) && if (!(btnPtr->fsStyle & BTNS_NOPREFIX) &&
!(btnPtr->fsState & TBSTATE_HIDDEN)) !(btnPtr->fsState & TBSTATE_HIDDEN))
{ {
int iLen = strlenW(wszAccel); int iLen = lstrlenW(wszAccel);
LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr); LPCWSTR lpszStr = TOOLBAR_GetText(infoPtr, btnPtr);
if (!lpszStr) if (!lpszStr)
...@@ -3861,7 +3860,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt ...@@ -3861,7 +3860,7 @@ TOOLBAR_MapAccelerator (const TOOLBAR_INFO *infoPtr, WCHAR wAccel, UINT *pIDButt
lpszStr += 2; lpszStr += 2;
continue; continue;
} }
if (!strncmpiW(lpszStr, wszAccel, iLen)) if (!wcsnicmp(lpszStr, wszAccel, iLen))
{ {
*pIDButton = btnPtr->idCommand; *pIDButton = btnPtr->idCommand;
return TRUE; return TRUE;
...@@ -5141,7 +5140,7 @@ TOOLBAR_GetStringW (const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPWSTR str) ...@@ -5141,7 +5140,7 @@ TOOLBAR_GetStringW (const TOOLBAR_INFO *infoPtr, WPARAM wParam, LPWSTR str)
if (iString < infoPtr->nNumStrings) if (iString < infoPtr->nNumStrings)
{ {
len = min(len, strlenW(infoPtr->strings[iString])); len = min(len, lstrlenW(infoPtr->strings[iString]));
ret = (len+1)*sizeof(WCHAR); ret = (len+1)*sizeof(WCHAR);
if (str) if (str)
{ {
...@@ -6150,7 +6149,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm ...@@ -6150,7 +6149,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
TRACE("TBN_GETINFOTIPW - got string %s\n", debugstr_w(tbgit.pszText)); TRACE("TBN_GETINFOTIPW - got string %s\n", debugstr_w(tbgit.pszText));
len = strlenW(tbgit.pszText); len = lstrlenW(tbgit.pszText);
if (len > ARRAY_SIZE(lpnmtdi->szText) - 1) if (len > ARRAY_SIZE(lpnmtdi->szText) - 1)
{ {
/* need to allocate temporary buffer in infoPtr as there /* need to allocate temporary buffer in infoPtr as there
...@@ -6214,7 +6213,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm ...@@ -6214,7 +6213,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
!(infoPtr->buttons[index].fsStyle & BTNS_SHOWTEXT)) !(infoPtr->buttons[index].fsStyle & BTNS_SHOWTEXT))
{ {
LPWSTR pszText = TOOLBAR_GetText(infoPtr, &infoPtr->buttons[index]); LPWSTR pszText = TOOLBAR_GetText(infoPtr, &infoPtr->buttons[index]);
len = pszText ? strlenW(pszText) : 0; len = pszText ? lstrlenW(pszText) : 0;
TRACE("using button hidden text %s\n", debugstr_w(pszText)); TRACE("using button hidden text %s\n", debugstr_w(pszText));
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h"
#include "wingdi.h" #include "wingdi.h"
#include "winuser.h" #include "winuser.h"
#include "winnls.h" #include "winnls.h"
...@@ -502,7 +501,7 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer) ...@@ -502,7 +501,7 @@ TOOLTIPS_GetTipText (const TOOLTIPS_INFO *infoPtr, INT nTool, WCHAR *buffer)
if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & TTS_NOPREFIX)) { if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & TTS_NOPREFIX)) {
WCHAR *ptrW; WCHAR *ptrW;
if ((ptrW = strchrW(buffer, '\t'))) if ((ptrW = wcschr(buffer, '\t')))
*ptrW = 0; *ptrW = 0;
} }
...@@ -963,7 +962,7 @@ TOOLTIPS_CopyInfoT (const TOOLTIPS_INFO *infoPtr, INT index, TTTOOLINFOW *ti, BO ...@@ -963,7 +962,7 @@ TOOLTIPS_CopyInfoT (const TOOLTIPS_INFO *infoPtr, INT index, TTTOOLINFOW *ti, BO
toolPtr->lpszText == LPSTR_TEXTCALLBACKW) toolPtr->lpszText == LPSTR_TEXTCALLBACKW)
ti->lpszText = toolPtr->lpszText; ti->lpszText = toolPtr->lpszText;
else if (isW) else if (isW)
strcpyW (ti->lpszText, toolPtr->lpszText); lstrcpyW (ti->lpszText, toolPtr->lpszText);
else else
/* ANSI version, the buffer is maximum 80 bytes without null. */ /* ANSI version, the buffer is maximum 80 bytes without null. */
WideCharToMultiByte(CP_ACP, 0, toolPtr->lpszText, -1, WideCharToMultiByte(CP_ACP, 0, toolPtr->lpszText, -1,
...@@ -1090,7 +1089,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW) ...@@ -1090,7 +1089,7 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
INT len = lstrlenW (ti->lpszText); INT len = lstrlenW (ti->lpszText);
TRACE("add text %s\n", debugstr_w(ti->lpszText)); TRACE("add text %s\n", debugstr_w(ti->lpszText));
toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR)); toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
strcpyW (toolPtr->lpszText, ti->lpszText); lstrcpyW (toolPtr->lpszText, ti->lpszText);
} }
else { else {
INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0); INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
...@@ -1167,7 +1166,7 @@ static void TOOLTIPS_SetToolText(TTTOOL_INFO *toolPtr, WCHAR *text, BOOL is_unic ...@@ -1167,7 +1166,7 @@ static void TOOLTIPS_SetToolText(TTTOOL_INFO *toolPtr, WCHAR *text, BOOL is_unic
len = lstrlenW(text); len = lstrlenW(text);
toolPtr->lpszText = Alloc ((len + 1) * sizeof(WCHAR)); toolPtr->lpszText = Alloc ((len + 1) * sizeof(WCHAR));
if (toolPtr->lpszText) if (toolPtr->lpszText)
strcpyW (toolPtr->lpszText, text); lstrcpyW (toolPtr->lpszText, text);
} }
else else
{ {
...@@ -1640,7 +1639,7 @@ TOOLTIPS_SetTitleT (TOOLTIPS_INFO *infoPtr, UINT_PTR uTitleIcon, LPCWSTR pszTitl ...@@ -1640,7 +1639,7 @@ TOOLTIPS_SetTitleT (TOOLTIPS_INFO *infoPtr, UINT_PTR uTitleIcon, LPCWSTR pszTitl
{ {
if (isW) if (isW)
{ {
size = (strlenW(pszTitle)+1)*sizeof(WCHAR); size = (lstrlenW(pszTitle)+1)*sizeof(WCHAR);
infoPtr->pszTitle = Alloc(size); infoPtr->pszTitle = Alloc(size);
if (!infoPtr->pszTitle) if (!infoPtr->pszTitle)
return FALSE; return FALSE;
...@@ -1977,7 +1976,7 @@ TOOLTIPS_SetFont (TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw) ...@@ -1977,7 +1976,7 @@ TOOLTIPS_SetFont (TOOLTIPS_INFO *infoPtr, HFONT hFont, BOOL redraw)
static inline LRESULT static inline LRESULT
TOOLTIPS_GetTextLength(const TOOLTIPS_INFO *infoPtr) TOOLTIPS_GetTextLength(const TOOLTIPS_INFO *infoPtr)
{ {
return strlenW(infoPtr->szTipText); return lstrlenW(infoPtr->szTipText);
} }
/****************************************************************** /******************************************************************
...@@ -1999,7 +1998,7 @@ TOOLTIPS_OnWMGetText (const TOOLTIPS_INFO *infoPtr, WPARAM size, LPWSTR pszText) ...@@ -1999,7 +1998,7 @@ TOOLTIPS_OnWMGetText (const TOOLTIPS_INFO *infoPtr, WPARAM size, LPWSTR pszText)
if(!size) if(!size)
return 0; return 0;
res = min(strlenW(infoPtr->szTipText)+1, size); res = min(lstrlenW(infoPtr->szTipText)+1, size);
memcpy(pszText, infoPtr->szTipText, res*sizeof(WCHAR)); memcpy(pszText, infoPtr->szTipText, res*sizeof(WCHAR));
pszText[res-1] = '\0'; pszText[res-1] = '\0';
return res-1; return res-1;
......
...@@ -1121,7 +1121,7 @@ TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr) ...@@ -1121,7 +1121,7 @@ TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
} }
static int comp_tics (const void *ap, const void *bp) static int __cdecl comp_tics (const void *ap, const void *bp)
{ {
const DWORD a = *(const DWORD *)ap; const DWORD a = *(const DWORD *)ap;
const DWORD b = *(const DWORD *)bp; const DWORD b = *(const DWORD *)bp;
......
...@@ -40,9 +40,6 @@ ...@@ -40,9 +40,6 @@
* Scroll (instead of repaint) as much as possible. * Scroll (instead of repaint) as much as possible.
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -61,7 +58,6 @@ ...@@ -61,7 +58,6 @@
#include "comctl32.h" #include "comctl32.h"
#include "uxtheme.h" #include "uxtheme.h"
#include "vssym32.h" #include "vssym32.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/heap.h" #include "wine/heap.h"
...@@ -766,7 +762,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, ...@@ -766,7 +762,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item,
if (newText) if (newText)
{ {
item->pszText = newText; item->pszText = newText;
strcpyW(item->pszText, callback.item.pszText); lstrcpyW(item->pszText, callback.item.pszText);
item->cchTextMax = len; item->cchTextMax = len;
} }
/* If realloc fails we have nothing to do, but keep original text */ /* If realloc fails we have nothing to do, but keep original text */
...@@ -901,7 +897,7 @@ TREEVIEW_ComputeTextWidth(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, HDC ...@@ -901,7 +897,7 @@ TREEVIEW_ComputeTextWidth(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item, HDC
hOldFont = SelectObject(hdc, TREEVIEW_FontForItem(infoPtr, item)); hOldFont = SelectObject(hdc, TREEVIEW_FontForItem(infoPtr, item));
} }
GetTextExtentPoint32W(hdc, item->pszText, strlenW(item->pszText), &sz); GetTextExtentPoint32W(hdc, item->pszText, lstrlenW(item->pszText), &sz);
item->textWidth = sz.cx; item->textWidth = sz.cx;
if (hDC == 0) if (hDC == 0)
...@@ -2674,7 +2670,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item) ...@@ -2674,7 +2670,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
debugstr_w(item->pszText), wine_dbgstr_rect(&rcText)); debugstr_w(item->pszText), wine_dbgstr_rect(&rcText));
/* Draw it */ /* Draw it */
GetTextExtentPoint32W(hdc, item->pszText, strlenW(item->pszText), &sz); GetTextExtentPoint32W(hdc, item->pszText, lstrlenW(item->pszText), &sz);
align = SetTextAlign(hdc, TA_LEFT | TA_TOP); align = SetTextAlign(hdc, TA_LEFT | TA_TOP);
ExtTextOutW(hdc, rcText.left + 2, (rcText.top + rcText.bottom - sz.cy) / 2, ExtTextOutW(hdc, rcText.left + 2, (rcText.top + rcText.bottom - sz.cy) / 2,
...@@ -3845,7 +3841,7 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -3845,7 +3841,7 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
hOldFont = SelectObject(hdc, hFont); hOldFont = SelectObject(hdc, hFont);
} }
if (GetTextExtentPoint32W(hdc, buffer, strlenW(buffer), &sz)) if (GetTextExtentPoint32W(hdc, buffer, lstrlenW(buffer), &sz))
{ {
TEXTMETRICW textMetric; TEXTMETRICW textMetric;
...@@ -3925,7 +3921,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem) ...@@ -3925,7 +3921,7 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem)
/* Get string length in pixels */ /* Get string length in pixels */
if (hItem->pszText) if (hItem->pszText)
GetTextExtentPoint32W(hdc, hItem->pszText, strlenW(hItem->pszText), GetTextExtentPoint32W(hdc, hItem->pszText, lstrlenW(hItem->pszText),
&sz); &sz);
else else
GetTextExtentPoint32A(hdc, "", 0, &sz); GetTextExtentPoint32A(hdc, "", 0, &sz);
...@@ -4041,7 +4037,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel) ...@@ -4041,7 +4037,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
iLength = len - 1; iLength = len - 1;
} }
if (strcmpW(newText, editedItem->pszText) != 0) if (lstrcmpW(newText, editedItem->pszText) != 0)
{ {
WCHAR *ptr = heap_realloc(editedItem->pszText, sizeof(WCHAR)*(iLength + 1)); WCHAR *ptr = heap_realloc(editedItem->pszText, sizeof(WCHAR)*(iLength + 1));
if (ptr == NULL) if (ptr == NULL)
...@@ -4057,7 +4053,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel) ...@@ -4057,7 +4053,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel)
{ {
editedItem->pszText = ptr; editedItem->pszText = ptr;
editedItem->cchTextMax = iLength + 1; editedItem->cchTextMax = iLength + 1;
strcpyW(editedItem->pszText, newText); lstrcpyW(editedItem->pszText, newText);
TREEVIEW_ComputeTextWidth(infoPtr, editedItem, 0); TREEVIEW_ComputeTextWidth(infoPtr, editedItem, 0);
} }
} }
...@@ -4417,7 +4413,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam) ...@@ -4417,7 +4413,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam)
hOldFont = SelectObject(hdc, infoPtr->hFont); hOldFont = SelectObject(hdc, infoPtr->hFont);
if (dragItem->pszText) if (dragItem->pszText)
GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText), GetTextExtentPoint32W(hdc, dragItem->pszText, lstrlenW(dragItem->pszText),
&size); &size);
else else
GetTextExtentPoint32A(hdc, "", 0, &size); GetTextExtentPoint32A(hdc, "", 0, &size);
...@@ -4445,7 +4441,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam) ...@@ -4445,7 +4441,7 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam)
SetRect(&rc, cx, 0, size.cx, size.cy); SetRect(&rc, cx, 0, size.cx, size.cy);
if (dragItem->pszText) if (dragItem->pszText)
DrawTextW(hdc, dragItem->pszText, strlenW(dragItem->pszText), &rc, DrawTextW(hdc, dragItem->pszText, lstrlenW(dragItem->pszText), &rc,
DT_LEFT); DT_LEFT);
SelectObject(hdc, hOldFont); SelectObject(hdc, hOldFont);
...@@ -4698,12 +4694,12 @@ static INT TREEVIEW_ProcessLetterKeys(TREEVIEW_INFO *infoPtr, WPARAM charCode, L ...@@ -4698,12 +4694,12 @@ static INT TREEVIEW_ProcessLetterKeys(TREEVIEW_INFO *infoPtr, WPARAM charCode, L
TREEVIEW_GetItemT( infoPtr, &item, TRUE ); TREEVIEW_GetItemT( infoPtr, &item, TRUE );
/* check for a match */ /* check for a match */
if (strncmpiW(item.pszText,infoPtr->szSearchParam,infoPtr->nSearchParamLength) == 0) { if (wcsnicmp(item.pszText,infoPtr->szSearchParam,infoPtr->nSearchParamLength) == 0) {
nItem=idx; nItem=idx;
break; break;
} else if ( (charCode != 0) && (nItem == NULL) && } else if ( (charCode != 0) && (nItem == NULL) &&
(nItem != infoPtr->selectedItem) && (nItem != infoPtr->selectedItem) &&
(strncmpiW(item.pszText,infoPtr->szSearchParam,1) == 0) ) { (wcsnicmp(item.pszText,infoPtr->szSearchParam,1) == 0) ) {
/* This would work but we must keep looking for a longer match */ /* This would work but we must keep looking for a longer match */
nItem=idx; nItem=idx;
} }
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "uxtheme.h" #include "uxtheme.h"
#include "vssym32.h" #include "vssym32.h"
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(updown); WINE_DEFAULT_DEBUG_CHANNEL(updown);
...@@ -288,7 +287,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr) ...@@ -288,7 +287,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
*dst = 0; *dst = 0;
/* try to convert the number and validate it */ /* try to convert the number and validate it */
newVal = strtolW(txt, &src, infoPtr->Base); newVal = wcstol(txt, &src, infoPtr->Base);
if(*src || !UPDOWN_InBounds (infoPtr, newVal)) return FALSE; if(*src || !UPDOWN_InBounds (infoPtr, newVal)) return FALSE;
} }
......
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