Replaced all lstr* calls from inside Wine code by their str* equivalent.

This commit is contained in:
Alexandre Julliard 2000-08-14 14:41:19 +00:00
parent d586dc99be
commit c7e7df8b17
56 changed files with 303 additions and 366 deletions

View File

@ -11,6 +11,7 @@
#include "wingdi.h"
#include "winuser.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "win.h"
#include "heap.h"
@ -70,7 +71,7 @@ static BOOL ICONTITLE_GetTitlePos( WND* wnd, LPRECT lpRect )
if( length )
{
str = HeapAlloc( GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR) );
lstrcpyW( str, wnd->owner->text );
strcpyW( str, wnd->owner->text );
while( str[length - 1] == ' ' ) /* remove trailing spaces */
{
str[--length] = '\0';

View File

@ -712,7 +712,7 @@ static LRESULT LISTBOX_GetText( WND *wnd, LB_DESCR *descr, INT index,
{
if (!buffer)
return strlen(descr->items[index].str);
lstrcpyA( buffer, descr->items[index].str );
strcpy( buffer, descr->items[index].str );
return strlen(buffer);
} else {
if (buffer)

View File

@ -20,8 +20,7 @@
#include "winreg.h"
#include "winerror.h"
#include "wine/winbase16.h"
#include "winversion.h"
#include "file.h"
#include "wine/unicode.h"
#include "heap.h"
#include "server.h"
#include "debugtools.h"
@ -56,8 +55,8 @@ static inline DWORD copy_nameW( LPWSTR dest, LPCWSTR name )
{
if (name)
{
if (lstrlenW(name) > MAX_PATH) return ERROR_MORE_DATA;
lstrcpyW( dest, name );
if (strlenW(name) > MAX_PATH) return ERROR_MORE_DATA;
strcpyW( dest, name );
}
else dest[0] = 0;
return ERROR_SUCCESS;
@ -307,8 +306,8 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_le
req->index = index;
if ((ret = reg_server_call( REQ_ENUM_KEY )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
cls_len = lstrlenW( req->class ) + 1;
len = strlenW( req->name ) + 1;
cls_len = strlenW( req->class ) + 1;
if (len > *name_len) return ERROR_MORE_DATA;
if (class_len && (cls_len > *class_len)) return ERROR_MORE_DATA;
@ -319,7 +318,7 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_le
if (class) memcpy( class, req->class, cls_len * sizeof(WCHAR) );
*class_len = cls_len - 1;
}
if (ft) DOSFS_UnixTimeToFileTime( req->modif, ft, 0 );
if (ft) RtlSecondsSince1970ToTime( req->modif, ft );
return ERROR_SUCCESS;
}
@ -342,8 +341,8 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_len
req->index = index;
if ((ret = reg_server_call( REQ_ENUM_KEY )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
cls_len = lstrlenW( req->class ) + 1;
len = strlenW( req->name ) + 1;
cls_len = strlenW( req->class ) + 1;
if (len > *name_len) return ERROR_MORE_DATA;
if (class_len && (cls_len > *class_len)) return ERROR_MORE_DATA;
@ -354,7 +353,7 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_len
if (class) memcpyWtoA( class, req->class, cls_len );
*class_len = cls_len - 1;
}
if (ft) DOSFS_UnixTimeToFileTime( req->modif, ft, 0 );
if (ft) RtlSecondsSince1970ToTime( req->modif, ft );
return ERROR_SUCCESS;
}
@ -411,7 +410,7 @@ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWO
TRACE( "(0x%x,%p,%ld,%p,%p,%p,%p,%p,%p,%p,%p)\n", hkey, class, class_len ? *class_len : 0,
reserved, subkeys, max_subkey, values, max_value, max_data, security, modif );
if (class && !class_len && (VERSION_GetVersion() == NT40))
if (class && !class_len && !(GetVersion() & 0x80000000 /*NT*/))
return ERROR_INVALID_PARAMETER;
req->hkey = hkey;
@ -419,21 +418,21 @@ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWO
if (class)
{
if (class_len && (lstrlenW(req->class) + 1 > *class_len))
if (class_len && (strlenW(req->class) + 1 > *class_len))
{
*class_len = lstrlenW(req->class);
*class_len = strlenW(req->class);
return ERROR_MORE_DATA;
}
lstrcpyW( class, req->class );
strcpyW( class, req->class );
}
if (class_len) *class_len = lstrlenW( req->class );
if (class_len) *class_len = strlenW( req->class );
if (subkeys) *subkeys = req->subkeys;
if (max_subkey) *max_subkey = req->max_subkey;
if (max_class) *max_class = req->max_class;
if (values) *values = req->values;
if (max_value) *max_value = req->max_value;
if (max_data) *max_data = req->max_data;
if (modif) DOSFS_UnixTimeToFileTime( req->modif, modif, 0 );
if (modif) RtlSecondsSince1970ToTime( req->modif, modif );
return ERROR_SUCCESS;
}
@ -453,7 +452,7 @@ DWORD WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDWOR
TRACE( "(0x%x,%p,%ld,%p,%p,%p,%p,%p,%p,%p,%p)\n", hkey, class, class_len ? *class_len : 0,
reserved, subkeys, max_subkey, values, max_value, max_data, security, modif );
if (class && !class_len && (VERSION_GetVersion() == NT40))
if (class && !class_len && !(GetVersion() & 0x80000000 /*NT*/))
return ERROR_INVALID_PARAMETER;
req->hkey = hkey;
@ -461,21 +460,21 @@ DWORD WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDWOR
if (class)
{
if (class_len && (lstrlenW(req->class) + 1 > *class_len))
if (class_len && (strlenW(req->class) + 1 > *class_len))
{
*class_len = lstrlenW(req->class);
*class_len = strlenW(req->class);
return ERROR_MORE_DATA;
}
lstrcpyWtoA( class, req->class );
}
if (class_len) *class_len = lstrlenW( req->class );
if (class_len) *class_len = strlenW( req->class );
if (subkeys) *subkeys = req->subkeys;
if (max_subkey) *max_subkey = req->max_subkey;
if (max_class) *max_class = req->max_class;
if (values) *values = req->values;
if (max_value) *max_value = req->max_value;
if (max_data) *max_data = req->max_data;
if (modif) DOSFS_UnixTimeToFileTime( req->modif, modif, 0 );
if (modif) RtlSecondsSince1970ToTime( req->modif, modif );
return ERROR_SUCCESS;
}
@ -670,7 +669,7 @@ DWORD WINAPI RegSetValueW( HKEY hkey, LPCWSTR name, DWORD type, LPCWSTR data, DW
}
ret = RegSetValueExW( subkey, NULL, 0, REG_SZ, (LPBYTE)data,
(lstrlenW( data ) + 1) * sizeof(WCHAR) );
(strlenW( data ) + 1) * sizeof(WCHAR) );
if (subkey != hkey) RegCloseKey( subkey );
return ret;
}
@ -906,7 +905,7 @@ DWORD WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_co
req->offset = 0;
if ((ret = reg_server_call( REQ_ENUM_KEY_VALUE )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
len = strlenW( req->name ) + 1;
if (len > *val_count) return ERROR_MORE_DATA;
memcpy( value, req->name, len * sizeof(WCHAR) );
*val_count = len - 1;
@ -959,7 +958,7 @@ DWORD WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_cou
req->offset = 0;
if ((ret = reg_server_call( REQ_ENUM_KEY_VALUE )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
len = strlenW( req->name ) + 1;
if (len > *val_count) return ERROR_MORE_DATA;
memcpyWtoA( value, req->name, len );
*val_count = len - 1;

View File

@ -10,10 +10,11 @@
#include "winsvc.h"
#include "winerror.h"
#include "winreg.h"
#include "wine/unicode.h"
#include "heap.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(advapi)
DEFAULT_DEBUG_CHANNEL(advapi);
static DWORD start_dwNumServiceArgs;
static LPWSTR *start_lpServiceArgVectors;
@ -352,7 +353,7 @@ OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName,
dwDesiredAccess);
lstrcpyAtoW(lpServiceKey,str);
lstrcatW(lpServiceKey,lpServiceName);
strcatW(lpServiceKey,lpServiceName);
TRACE("Opening reg key %s\n", debugstr_w(lpServiceKey));
@ -410,7 +411,7 @@ CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
if(lpDisplayName)
{
r = RegSetValueExA(hKey, "DisplayName", 0, REG_SZ, lpDisplayName, lstrlenA(lpDisplayName) );
r = RegSetValueExA(hKey, "DisplayName", 0, REG_SZ, lpDisplayName, strlen(lpDisplayName) );
if (r!=ERROR_SUCCESS)
return 0;
}
@ -431,7 +432,7 @@ CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
if(lpBinaryPathName)
{
r = RegSetValueExA(hKey, "ImagePath", 0, REG_SZ,
lpBinaryPathName,lstrlenA(lpBinaryPathName)+1 );
lpBinaryPathName,strlen(lpBinaryPathName)+1 );
if (r!=ERROR_SUCCESS)
return 0;
}
@ -439,7 +440,7 @@ CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
if(lpLoadOrderGroup)
{
r = RegSetValueExA(hKey, "Group", 0, REG_SZ,
lpLoadOrderGroup, lstrlenA(lpLoadOrderGroup)+1 );
lpLoadOrderGroup, strlen(lpLoadOrderGroup)+1 );
if (r!=ERROR_SUCCESS)
return 0;
}
@ -455,7 +456,7 @@ CreateServiceA( DWORD hSCManager, LPCSTR lpServiceName,
/* determine the length of a double null terminated multi string */
do {
len += (lstrlenA(&lpDependencies[len])+1);
len += (strlen(&lpDependencies[len])+1);
} while (lpDependencies[len++]);
/* fixme: this should be unicode */

View File

@ -475,7 +475,7 @@ FreeMRUListA (HANDLE hMRUList)
if (!(hmru->dwParam1 & 1001)) {
RegSetValueExA (hmru->hKeyMRU, "MRUList", 0, REG_SZ,
hmru->lpszMRUString,
lstrlenA (hmru->lpszMRUString));
strlen (hmru->lpszMRUString));
}
@ -685,7 +685,7 @@ Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
if (!lpDest && lpSrc)
return lstrlenA (lpSrc);
return strlen (lpSrc);
if (nMaxLen == 0)
return 0;
@ -695,7 +695,7 @@ Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
return 0;
}
len = lstrlenA (lpSrc);
len = strlen (lpSrc);
if (len >= nMaxLen)
len = nMaxLen - 1;
@ -722,10 +722,10 @@ Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
TRACE("(%p %p)\n", lppDest, lpSrc);
if (lpSrc) {
LPSTR ptr = COMCTL32_ReAlloc (*lppDest, lstrlenA (lpSrc) + 1);
LPSTR ptr = COMCTL32_ReAlloc (*lppDest, strlen (lpSrc) + 1);
if (!ptr)
return FALSE;
lstrcpyA (ptr, lpSrc);
strcpy (ptr, lpSrc);
*lppDest = ptr;
}
else {
@ -758,7 +758,7 @@ Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
TRACE("(%p %p %d)\n", lpSrc, lpDest, nMaxLen);
if (!lpDest && lpSrc)
return lstrlenW (lpSrc);
return strlenW (lpSrc);
if (nMaxLen == 0)
return 0;
@ -768,7 +768,7 @@ Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
return 0;
}
len = lstrlenW (lpSrc);
len = strlenW (lpSrc);
if (len >= nMaxLen)
len = nMaxLen - 1;
@ -795,11 +795,11 @@ Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
TRACE("(%p %p)\n", lppDest, lpSrc);
if (lpSrc) {
INT len = lstrlenW (lpSrc) + 1;
INT len = strlenW (lpSrc) + 1;
LPWSTR ptr = COMCTL32_ReAlloc (*lppDest, len * sizeof(WCHAR));
if (!ptr)
return FALSE;
lstrcpyW (ptr, lpSrc);
strcpyW (ptr, lpSrc);
*lppDest = ptr;
}
else {

View File

@ -22,6 +22,7 @@
#include <string.h>
#include "winbase.h"
#include "wine/unicode.h"
#include "commctrl.h"
#include "debugtools.h"
@ -208,7 +209,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
GetObjectA (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
textRect = r;
DrawTextW (hdc, phdi->pszText, lstrlenW (phdi->pszText),
DrawTextW (hdc, phdi->pszText, -1,
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
tx = textRect.right - textRect.left;
ry = r.bottom - r.top;
@ -263,7 +264,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
r.left += 3;
r.right -= 3;
SetTextColor (hdc, bHotTrack ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
DrawTextW (hdc, phdi->pszText, lstrlenW (phdi->pszText),
DrawTextW (hdc, phdi->pszText, -1,
&r, uTextJustify|DT_VCENTER|DT_SINGLELINE);
if (oldBkMode != TRANSPARENT)
SetBkMode(hdc, oldBkMode);
@ -821,7 +822,7 @@ HEADER_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (!phdi->pszText) /* null pointer check */
phdi->pszText = "";
if (phdi->pszText != LPSTR_TEXTCALLBACKA) {
len = lstrlenA (phdi->pszText);
len = strlen (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyAtoW (lpItem->pszText, phdi->pszText);
}
@ -905,9 +906,9 @@ HEADER_InsertItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (!phdi->pszText) /* null pointer check */
phdi->pszText = &wide_null_char;
if (phdi->pszText != LPSTR_TEXTCALLBACKW) {
len = lstrlenW (phdi->pszText);
len = strlenW (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (lpItem->pszText, phdi->pszText);
strcpyW (lpItem->pszText, phdi->pszText);
}
else
lpItem->pszText = LPSTR_TEXTCALLBACKW;
@ -1018,7 +1019,7 @@ HEADER_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->pszText = NULL;
}
if (phdi->pszText) {
INT len = lstrlenA (phdi->pszText);
INT len = strlen (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyAtoW (lpItem->pszText, phdi->pszText);
}
@ -1081,9 +1082,9 @@ HEADER_SetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpItem->pszText = NULL;
}
if (phdi->pszText) {
INT len = lstrlenW (phdi->pszText);
INT len = strlenW (phdi->pszText);
lpItem->pszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (lpItem->pszText, phdi->pszText);
strcpyW (lpItem->pszText, phdi->pszText);
}
}
else

View File

@ -362,8 +362,7 @@ static void MONTHCAL_DrawDay(HDC hdc, MONTHCAL_INFO *infoPtr, int day, int month
SetBkColor(hdc, oldBk);
}
DrawTextA(hdc, buf, lstrlenA(buf), &r,
DT_CENTER | DT_VCENTER | DT_SINGLELINE );
DrawTextA(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
/* draw a rectangle around the currently selected days text */
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth)) {
@ -468,10 +467,10 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
* MCM_HitTestInfo wants month & year rects, so prepare these now.
*(no, we can't draw them separately; the whole text is centered)
*/
GetTextExtentPoint32A(hdc, buf, lstrlenA(buf), &size);
GetTextExtentPoint32A(hdc, buf, strlen(buf), &size);
titlemonth->left = title->right / 2 - size.cx / 2;
titleyear->right = title->right / 2 + size.cx / 2;
GetTextExtentPoint32A(hdc, thisMonthtxt, lstrlenA(thisMonthtxt), &size);
GetTextExtentPoint32A(hdc, thisMonthtxt, strlen(thisMonthtxt), &size);
titlemonth->right = titlemonth->left + size.cx;
titleyear->right = titlemonth->right;
@ -652,8 +651,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
if(IntersectRect(&rcTemp, &(ps->rcPaint), rtoday))
{
DrawTextA(hdc, buf, lstrlenA(buf), rtoday,
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
DrawTextA(hdc, buf, -1, rtoday, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
}
SelectObject(hdc, infoPtr->hFont);
}
@ -672,8 +670,7 @@ static void MONTHCAL_Refresh(HWND hwnd, HDC hdc, PAINTSTRUCT* ps)
weeknum/=7;
for(i=0; i<6; i++) {
sprintf(buf, "%d", weeknum + i);
DrawTextA(hdc, buf, lstrlenA(buf), weeknums,
DT_CENTER | DT_BOTTOM | DT_SINGLELINE );
DrawTextA(hdc, buf, -1, weeknums, DT_CENTER | DT_BOTTOM | DT_SINGLELINE );
weeknums->top+=textHeight * 1.25;
weeknums->bottom+=textHeight * 1.25;
}

View File

@ -22,6 +22,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "wine/unicode.h"
#include "commctrl.h"
#include "debugtools.h"
@ -1207,7 +1208,7 @@ REBAR_InsertBandW (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT len = lstrlenW (lprbbi->lpText);
if (len > 0) {
lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
lstrcpyW (lpBand->lpText, lprbbi->lpText);
strcpyW (lpBand->lpText, lprbbi->lpText);
}
}
@ -1436,7 +1437,7 @@ REBAR_SetBandInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lprbbi->lpText) {
INT len = lstrlenW (lprbbi->lpText);
lpBand->lpText = (LPWSTR)COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
lstrcpyW (lpBand->lpText, lprbbi->lpText);
strcpyW (lpBand->lpText, lprbbi->lpText);
}
}

View File

@ -13,6 +13,7 @@
*/
#include "winbase.h"
#include "wine/unicode.h"
#include "commctrl.h"
#include "debugtools.h"
@ -422,7 +423,7 @@ STATUSBAR_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
result = part->text ? lstrlenW (part->text) : 0;
result |= (part->style << 16);
if (lParam)
lstrcpyW ((LPWSTR)lParam, part->text);
strcpyW ((LPWSTR)lParam, part->text);
}
return result;
}
@ -744,7 +745,7 @@ STATUSBAR_SetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* duplicate string */
if (text && (len = lstrlenW(text))) {
part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW(part->text, text);
strcpyW(part->text, text);
}
}
part->style = style;
@ -875,7 +876,7 @@ STATUSBAR_WMCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpCreate->lpszName &&
(len = lstrlenW ((LPCWSTR)lpCreate->lpszName))) {
self->parts[0].text = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
lstrcpyW (self->parts[0].text, (LPCWSTR)lpCreate->lpszName);
strcpyW (self->parts[0].text, (LPCWSTR)lpCreate->lpszName);
}
}
else {
@ -976,7 +977,7 @@ STATUSBAR_WMGetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
len = lstrlenW (infoPtr->parts[0].text);
if (wParam > len) {
if (infoPtr->bUnicode)
lstrcpyW ((LPWSTR)lParam, infoPtr->parts[0].text);
strcpyW ((LPWSTR)lParam, infoPtr->parts[0].text);
else
lstrcpyWtoA ((LPSTR)lParam, infoPtr->parts[0].text);
return len;
@ -1085,7 +1086,7 @@ STATUSBAR_WMSetText (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (infoPtr->bUnicode) {
if (lParam && (len = lstrlenW((LPCWSTR)lParam))) {
part->text = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (part->text, (LPCWSTR)lParam);
strcpyW (part->text, (LPCWSTR)lParam);
}
}
else {

View File

@ -1887,7 +1887,7 @@ TAB_InsertItem (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (pti->mask & TCIF_TEXT) {
len = lstrlenA (pti->pszText);
infoPtr->items[iItem].pszText = COMCTL32_Alloc (len+1);
lstrcpyA (infoPtr->items[iItem].pszText, pti->pszText);
strcpy (infoPtr->items[iItem].pszText, pti->pszText);
infoPtr->items[iItem].cchTextMax = pti->cchTextMax;
}
@ -1955,7 +1955,7 @@ TAB_SetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
len=lstrlenA (tabItem->pszText);
if (len>wineItem->cchTextMax)
wineItem->pszText= COMCTL32_ReAlloc (wineItem->pszText, len+1);
lstrcpyA (wineItem->pszText, tabItem->pszText);
strcpy (wineItem->pszText, tabItem->pszText);
}
/*

View File

@ -32,6 +32,7 @@
#include "windef.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "commctrl.h"
#include "imagelist.h"
#include "cache.h"
@ -1488,7 +1489,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpyW (infoPtr->strings[infoPtr->nNumStrings], szString);
strcpyW (infoPtr->strings[infoPtr->nNumStrings], szString);
infoPtr->nNumStrings++;
}
}
@ -1519,7 +1520,7 @@ TOOLBAR_AddStringW (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->strings[infoPtr->nNumStrings] =
COMCTL32_Alloc (sizeof(WCHAR)*(len+1));
lstrcpyW (infoPtr->strings[infoPtr->nNumStrings], p);
strcpyW (infoPtr->strings[infoPtr->nNumStrings], p);
infoPtr->nNumStrings++;
p += (len+1);
@ -2026,7 +2027,7 @@ TOOLBAR_GetButtonTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lParam == 0)
return -1;
lstrcpyW ((LPWSTR)lParam, (LPWSTR)infoPtr->strings[nStringIndex]);
strcpyW ((LPWSTR)lParam, (LPWSTR)infoPtr->strings[nStringIndex]);
return lstrlenW ((LPWSTR)infoPtr->strings[nStringIndex]);
}

View File

@ -60,6 +60,7 @@
#include <string.h>
#include "winbase.h"
#include "wine/unicode.h"
#include "commctrl.h"
#include "debugtools.h"
@ -810,7 +811,7 @@ TOOLTIPS_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("add text %s!\n",
debugstr_w(lpToolInfo->lpszText));
toolPtr->lpszText = COMCTL32_Alloc ((len + 1)*sizeof(WCHAR));
lstrcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
strcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
}
}
@ -1269,7 +1270,7 @@ TOOLTIPS_GetTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
nTool = TOOLTIPS_GetToolFromInfoW (infoPtr, lpToolInfo);
if (nTool == -1) return 0;
lstrcpyW (lpToolInfo->lpszText, infoPtr->tools[nTool].lpszText);
strcpyW (lpToolInfo->lpszText, infoPtr->tools[nTool].lpszText);
return 0;
}
@ -1748,7 +1749,7 @@ TOOLTIPS_SetToolInfoW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpToolInfo->lpszText) {
INT len = lstrlenW (lpToolInfo->lpszText);
toolPtr->lpszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
strcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
}
}
}
@ -1920,7 +1921,7 @@ TOOLTIPS_UpdateTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
if (lpToolInfo->lpszText) {
INT len = lstrlenW (lpToolInfo->lpszText);
toolPtr->lpszText = COMCTL32_Alloc ((len+1)*sizeof(WCHAR));
lstrcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
strcpyW (toolPtr->lpszText, lpToolInfo->lpszText);
}
}
}

View File

@ -2014,7 +2014,7 @@ TREEVIEW_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("(%p,%s)\n", &tvItem->pszText, tvItem->pszText);
len = lstrlenA (tvItem->pszText)+1;
wineItem->pszText= COMCTL32_Alloc (len+1);
lstrcpyA (wineItem->pszText, tvItem->pszText);
strcpy (wineItem->pszText, tvItem->pszText);
wineItem->cchTextMax=len;
}
else

View File

@ -272,11 +272,11 @@ static void FILEDLG_StripEditControl(HWND hwnd)
GetDlgItemTextW( hwnd, edt1, temp, sizeof(temp) );
cp = strrchrW(temp, '\\');
if (cp != NULL) {
lstrcpyW(temp, cp+1);
strcpyW(temp, cp+1);
}
cp = strrchrW(temp, ':');
if (cp != NULL) {
lstrcpyW(temp, cp+1);
strcpyW(temp, cp+1);
}
/* FIXME: shouldn't we do something with the result here? ;-) */
}
@ -346,7 +346,7 @@ static BOOL FILEDLG_ScanDir(HWND hWnd, LPWSTR newPath)
}
}
/* list of directories */
lstrcpyW(buffer, FILE_star);
strcpyW(buffer, FILE_star);
return DlgDirListW(hWnd, buffer, lst2, stc1, DDL_EXCLUSIVE | DDL_DIRECTORY);
}
@ -712,15 +712,15 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
pstr = HeapAlloc(GetProcessHeap(), 0, BUFFILEALLOC);
SendDlgItemMessageW(hWnd, lst2, LB_GETTEXT, lRet,
(LPARAM)pstr);
lstrcpyW( tmpstr, pstr );
strcpyW( tmpstr, pstr );
HeapFree(GetProcessHeap(), 0, pstr);
/* get the selected directory in tmpstr */
if (tmpstr[0] == '[')
{
tmpstr[lstrlenW(tmpstr) - 1] = 0;
lstrcpyW(tmpstr,tmpstr+1);
strcpyW(tmpstr,tmpstr+1);
}
lstrcatW(tmpstr, FILE_bslash);
strcatW(tmpstr, FILE_bslash);
/* directory *has* to be changed before notifying the hook */
SetCurrentDirectoryW( tmpstr );
/* notify the app */
@ -789,7 +789,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
}
else
{
lstrcpyW(tmpstr2, tmpstr);
strcpyW(tmpstr2, tmpstr);
*tmpstr=0;
}
@ -802,7 +802,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
/* try appending a wildcard and reading the directory */
pstr2 = tmpstr + lstrlenW(tmpstr);
if (pstr == NULL || *(pstr+1) != 0)
lstrcatW(tmpstr, FILE_bslash);
strcatW(tmpstr, FILE_bslash);
lRet = SendDlgItemMessageW(hWnd, cmb1, CB_GETCURSEL, 0, 0);
if (lRet == LB_ERR) return TRUE;
ofnW->nFilterIndex = lRet + 1;
@ -830,7 +830,7 @@ static LRESULT FILEDLG_WMCommand(HWND hWnd, LPARAM lParam, UINT notification,
lstrcpynW(tmpstr2, pstr+1, sizeof(tmpstr2) );
/* Should we MessageBox() if this fails? */
if (!FILEDLG_ScanDir(hWnd, tmpstr)) return TRUE;
lstrcpyW(tmpstr, tmpstr2);
strcpyW(tmpstr, tmpstr2);
}
else SetDlgItemTextW( hWnd, edt1, tmpstr );
FILEDLG_UpdateResult(lfs, tmpstr, tmpstr2);

View File

@ -345,7 +345,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
s = (LPWSTR)ofn->lpstrFilter;
while (*s) {
lstrcpyWtoA(x,s);
x+=lstrlenA(x)+1;
x+=strlen(x)+1;
s+=lstrlenW(s)+1;
}
*x=0;
@ -369,7 +369,7 @@ BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType)
s = (LPWSTR)ofn->lpstrCustomFilter;
while (*s) {
lstrcpyWtoA(x,s);
x+=lstrlenA(x)+1;
x+=strlen(x)+1;
s+=lstrlenW(s)+1;
}
*x=0;
@ -1122,8 +1122,8 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCou
}
}
nSizePath = lstrlenA(lpstrPathSpec);
lstrcpyA( lpstrFile, lpstrPathSpec);
nSizePath = strlen(lpstrPathSpec);
strcpy( lpstrFile, lpstrPathSpec);
memcpy( lpstrFile + nSizePath + 1, lpstrFileList, sizeUsed );
fodInfos->ofnInfos->nFileOffset = nSizePath + 1;
@ -2229,7 +2229,7 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
if ( ! IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl) ) /* Ignore folders */
{
nLength += lstrlenA( lpstrTemp ) + 3;
nLength += strlen( lpstrTemp ) + 3;
nFiles++;
}
COMDLG32_SHFree( pidl );
@ -2261,14 +2261,14 @@ void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd)
if ( nFiles > 1)
{
*lpstrCurrFile++ = '\"';
lstrcpyA( lpstrCurrFile, lpstrTemp );
lpstrCurrFile += lstrlenA( lpstrTemp );
lstrcpyA( lpstrCurrFile, "\" " );
strcpy( lpstrCurrFile, lpstrTemp );
lpstrCurrFile += strlen( lpstrTemp );
strcpy( lpstrCurrFile, "\" " );
lpstrCurrFile += 2;
}
else
{
lstrcpyA( lpstrAllFile, lpstrTemp );
strcpy( lpstrAllFile, lpstrTemp );
}
}
COMDLG32_SHFree( (LPVOID) pidl );

View File

@ -89,7 +89,7 @@ static void COMDLG32_FR_HandleWMCommand(HWND hDlgWnd, COMDLG32_FR_Data *pData, i
}
else
{
lstrcpyA(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
}
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
}
@ -121,8 +121,8 @@ Replace:
}
else
{
lstrcpyA(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
lstrcpyA(pData->user_fr.fra->lpstrReplaceWith, pData->fr.lpstrReplaceWith);
strcpy(pData->user_fr.fra->lpstrFindWhat, pData->fr.lpstrFindWhat);
strcpy(pData->user_fr.fra->lpstrReplaceWith, pData->fr.lpstrReplaceWith);
}
SendMessageA(pData->fr.hwndOwner, FindReplaceMessage, 0, (LPARAM)pData->user_fr.fra);
}

View File

@ -660,7 +660,7 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
(LPARAM)buffer);
GetObjectA( hBitmapTT, sizeof(bm), &bm );
TextOutA(lpdi->hDC, lpdi->rcItem.left + bm.bmWidth + 10,
lpdi->rcItem.top, buffer, lstrlenA(buffer));
lpdi->rcItem.top, buffer, strlen(buffer));
#if 0
nFontType = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
/* FIXME: draw bitmap if truetype usage */
@ -680,14 +680,14 @@ static LRESULT CFn_WMDrawItem(HWND hDlg, WPARAM wParam, LPARAM lParam)
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutA(lpdi->hDC, lpdi->rcItem.left,
lpdi->rcItem.top, buffer, lstrlenA(buffer));
lpdi->rcItem.top, buffer, strlen(buffer));
break;
case cmb4: /* TRACE(commdlg,"WM_DRAWITEM cmb4 (=COLOR)\n"); */
SendMessageA(lpdi->hwndItem, CB_GETLBTEXT, lpdi->itemID,
(LPARAM)buffer);
TextOutA(lpdi->hDC, lpdi->rcItem.left + 25+5,
lpdi->rcItem.top, buffer, lstrlenA(buffer));
lpdi->rcItem.top, buffer, strlen(buffer));
cr = SendMessageA(lpdi->hwndItem, CB_GETITEMDATA, lpdi->itemID,0L);
hBrush = CreateSolidBrush(cr);
if (hBrush)

View File

@ -14,6 +14,7 @@
#include "debugtools.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "dplayx_global.h"
#include "dplayx_messages.h" /* For CreateMessageReceptionThread only */
@ -129,10 +130,10 @@ LPSTR DPLAYX_strdupA( DWORD flags, LPCSTR str )
LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str );
LPWSTR DPLAYX_strdupW( DWORD flags, LPCWSTR str )
{
INT len = lstrlenW(str) + 1;
INT len = strlenW(str) + 1;
LPWSTR p = DPLAYX_PrivHeapAlloc( flags, len * sizeof(WCHAR) );
if(p) {
lstrcpyW( p, str );
strcpyW( p, str );
}
return p;
}
@ -501,18 +502,18 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src )
/* Session names may or may not exist */
if( src->lpSessionDesc->sess.lpszSessionNameA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->sess.lpszSessionNameA );
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->sess.lpszSessionNameA );
dest->lpSessionDesc->sess.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
lstrlenA( (LPSTR)dest->lpSessionDesc->sess.lpszSessionName ) + 1;
strlen( (LPSTR)dest->lpSessionDesc->sess.lpszSessionName ) + 1;
}
if( src->lpSessionDesc->pass.lpszPasswordA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPasswordA );
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPasswordA );
dest->lpSessionDesc->pass.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
lstrlenA( (LPSTR)dest->lpSessionDesc->pass.lpszPasswordA ) + 1;
strlen( (LPSTR)dest->lpSessionDesc->pass.lpszPasswordA ) + 1;
}
}
@ -525,18 +526,18 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src )
if( src->lpPlayerName->psn.lpszShortNameA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortNameA );
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortNameA );
dest->lpPlayerName->psn.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
lstrlenA( (LPSTR)dest->lpPlayerName->psn.lpszShortNameA ) + 1;
strlen( (LPSTR)dest->lpPlayerName->psn.lpszShortNameA ) + 1;
}
if( src->lpPlayerName->pln.lpszLongNameA )
{
lstrcpyA( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongNameA );
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongNameA );
dest->lpPlayerName->pln.lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
lstrlenA( (LPSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 ;
strlen( (LPSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 ;
}
}
@ -613,18 +614,18 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src )
/* Session names may or may not exist */
if( src->lpSessionDesc->sess.lpszSessionName )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->sess.lpszSessionName );
strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->sess.lpszSessionName );
src->lpSessionDesc->sess.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( lstrlenW( (LPWSTR)dest->lpSessionDesc->sess.lpszSessionName ) + 1 );
( strlenW( (LPWSTR)dest->lpSessionDesc->sess.lpszSessionName ) + 1 );
}
if( src->lpSessionDesc->pass.lpszPassword )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPassword );
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPassword );
dest->lpSessionDesc->pass.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( lstrlenW( (LPWSTR)dest->lpSessionDesc->pass.lpszPassword ) + 1 );
( strlenW( (LPWSTR)dest->lpSessionDesc->pass.lpszPassword ) + 1 );
}
}
@ -637,18 +638,18 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src )
if( src->lpPlayerName->psn.lpszShortName )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortName );
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortName );
dest->lpPlayerName->psn.lpszShortName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( lstrlenW( (LPWSTR)dest->lpPlayerName->psn.lpszShortName ) + 1 );
( strlenW( (LPWSTR)dest->lpPlayerName->psn.lpszShortName ) + 1 );
}
if( src->lpPlayerName->pln.lpszLongName )
{
lstrcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongName );
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongName );
dest->lpPlayerName->pln.lpszLongName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( lstrlenW( (LPWSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 );
( strlenW( (LPWSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 );
}
}
@ -796,12 +797,12 @@ DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn )
if( lpConn->lpSessionDesc->sess.lpszSessionNameA )
{
dwTotalSize += lstrlenA( lpConn->lpSessionDesc->sess.lpszSessionNameA ) + 1;
dwTotalSize += strlen( lpConn->lpSessionDesc->sess.lpszSessionNameA ) + 1;
}
if( lpConn->lpSessionDesc->pass.lpszPasswordA )
{
dwTotalSize += lstrlenA( lpConn->lpSessionDesc->pass.lpszPasswordA ) + 1;
dwTotalSize += strlen( lpConn->lpSessionDesc->pass.lpszPasswordA ) + 1;
}
}
@ -811,12 +812,12 @@ DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn )
if( lpConn->lpPlayerName->psn.lpszShortNameA )
{
dwTotalSize += lstrlenA( lpConn->lpPlayerName->psn.lpszShortNameA ) + 1;
dwTotalSize += strlen( lpConn->lpPlayerName->psn.lpszShortNameA ) + 1;
}
if( lpConn->lpPlayerName->pln.lpszLongNameA )
{
dwTotalSize += lstrlenA( lpConn->lpPlayerName->pln.lpszLongNameA ) + 1;
dwTotalSize += strlen( lpConn->lpPlayerName->pln.lpszLongNameA ) + 1;
}
}
@ -844,13 +845,13 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
if( lpConn->lpSessionDesc->sess.lpszSessionName )
{
dwTotalSize += sizeof( WCHAR ) *
( lstrlenW( lpConn->lpSessionDesc->sess.lpszSessionName ) + 1 );
( strlenW( lpConn->lpSessionDesc->sess.lpszSessionName ) + 1 );
}
if( lpConn->lpSessionDesc->pass.lpszPassword )
{
dwTotalSize += sizeof( WCHAR ) *
( lstrlenW( lpConn->lpSessionDesc->pass.lpszPassword ) + 1 );
( strlenW( lpConn->lpSessionDesc->pass.lpszPassword ) + 1 );
}
}
@ -861,13 +862,13 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
if( lpConn->lpPlayerName->psn.lpszShortName )
{
dwTotalSize += sizeof( WCHAR ) *
( lstrlenW( lpConn->lpPlayerName->psn.lpszShortName ) + 1 );
( strlenW( lpConn->lpPlayerName->psn.lpszShortName ) + 1 );
}
if( lpConn->lpPlayerName->pln.lpszLongName )
{
dwTotalSize += sizeof( WCHAR ) *
( lstrlenW( lpConn->lpPlayerName->pln.lpszLongName ) + 1 );
( strlenW( lpConn->lpPlayerName->pln.lpszLongName ) + 1 );
}
}

View File

@ -13,6 +13,7 @@
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "wine/unicode.h"
#include "heap.h"
#include "debugtools.h"
@ -116,7 +117,7 @@ static INT load_messageW( HMODULE instance, UINT id, WORD lang,
{
if (retval) {
lstrcpynAtoW( buffer, buffer2, buflen );
retval = lstrlenW( buffer );
retval = strlenW( buffer );
}
HeapFree( GetProcessHeap(), 0, buffer2 );
}
@ -474,7 +475,7 @@ DWORD WINAPI FormatMessageW(
/* possible invalid pointers */
xarr[1]=*(argliststart+1);
xarr[2]=*(argliststart+2);
sprintfbuf=HeapAlloc(GetProcessHeap(),0,lstrlenW((LPWSTR)argliststart[0])*2+1);
sprintfbuf=HeapAlloc(GetProcessHeap(),0,strlenW((LPWSTR)argliststart[0])*2+1);
/* CMF - This makes a BIG assumption about va_list */
vsprintf(sprintfbuf, fmtstr, (va_list) xarr);
@ -537,8 +538,8 @@ DWORD WINAPI FormatMessageW(
HeapFree(GetProcessHeap(),0,target);
if (from) HeapFree(GetProcessHeap(),0,from);
return (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER) ?
lstrlenW(*(LPWSTR*)lpBuffer):
lstrlenW(lpBuffer);
strlenW(*(LPWSTR*)lpBuffer):
strlenW(lpBuffer);
#else
return 0;
#endif /* __i386__ */

View File

@ -87,7 +87,7 @@ void MSACM_RegisterAllDrivers(void)
MSACM_RegisterDriver(s, s2, 0);
}
}
s += lstrlenA(s) + 1; /* Either next char or \0 */
s += strlen(s) + 1; /* Either next char or \0 */
}
}

View File

@ -77,7 +77,7 @@ BOOL VFWAPI ICInfo(
return TRUE;
}
}
s=s+lstrlenA(s)+1; /* either next char or \0 */
s=s+strlen(s)+1; /* either next char or \0 */
}
}
return FALSE;
@ -295,7 +295,7 @@ HIC VFWAPI ICLocate(
}
}
}
s += lstrlenA(s) + 1;
s += strlen(s) + 1;
}
}
HeapFree(GetProcessHeap(),0,pszBuffer);

View File

@ -163,10 +163,7 @@ INT __cdecl NTDLL_wcsncmp( LPCWSTR str1, LPCWSTR str2, INT n )
*/
LPWSTR __cdecl NTDLL_wcsncpy( LPWSTR s1, LPCWSTR s2, INT n )
{
LPWSTR ret = s1;
while (n-- > 0) if (!(*s1++ = *s2++)) break;
while (n-- > 0) *s1++ = 0;
return ret;
return strncpyW( s1, s2, n );
}

View File

@ -7,10 +7,11 @@
#include <assert.h>
#include "winbase.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "wine/obj_moniker.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/* AntiMoniker data structure */
typedef struct AntiMonikerImpl{
@ -530,7 +531,7 @@ HRESULT WINAPI AntiMonikerImpl_GetDisplayName(IMoniker* iface,
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
lstrcpyW(*ppszDisplayName,back);
strcpyW(*ppszDisplayName,back);
return S_OK;
}

View File

@ -7,11 +7,12 @@
#include <string.h>
#include <assert.h>
#include "winerror.h"
#include "wine/unicode.h"
#include "wine/obj_moniker.h"
#include "debugtools.h"
#include "heap.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/* represent the first size table and it's increment block size */
#define BLOCK_TAB_SIZE 10
@ -379,7 +380,7 @@ HRESULT WINAPI BindCtxImpl_RegisterObjectParam(IBindCtx* iface,LPOLESTR pszkey,
if (This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj==NULL)
return E_OUTOFMEMORY;
lstrcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
strcpyW(This->bindCtxTable[This->bindCtxTableLastIndex].pkeyObj,pszkey);
}
This->bindCtxTableLastIndex++;

View File

@ -8,9 +8,10 @@
#include "winerror.h"
#include "debugtools.h"
#include "wine/obj_inplace.h"
#include "wine/unicode.h"
#include "ole2.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
#define BLOCK_TAB_SIZE 5 /* represent the first size table and it's increment block size */
@ -1353,7 +1354,7 @@ HRESULT WINAPI CompositeMonikerImpl_GetDisplayName(IMoniker* iface,
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
lstrcatW(*ppszDisplayName,tempStr);
strcatW(*ppszDisplayName,tempStr);
CoTaskMemFree(tempStr);
IMoniker_Release(tempMk);

View File

@ -35,11 +35,12 @@
#include "winbase.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "ole2.h"
#include "wine/obj_oleview.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/****************************************************************************
* DefaultHandler
@ -832,14 +833,14 @@ static HRESULT WINAPI DefaultHandler_SetHostNames(
{
if ((this->containerApp = HeapAlloc( GetProcessHeap(), 0,
(lstrlenW(szContainerApp) + 1) * sizeof(WCHAR) )))
lstrcpyW( this->containerApp, szContainerApp );
strcpyW( this->containerApp, szContainerApp );
}
if (szContainerObj != NULL)
{
if ((this->containerObj = HeapAlloc( GetProcessHeap(), 0,
(lstrlenW(szContainerObj) + 1) * sizeof(WCHAR) )))
lstrcpyW( this->containerObj, szContainerObj );
strcpyW( this->containerObj, szContainerObj );
}
return S_OK;
}

View File

@ -7,13 +7,14 @@
#include <assert.h>
#include "winbase.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "debugtools.h"
#include "objbase.h"
#include "wine/obj_storage.h"
#include "wine/obj_moniker.h"
#include "wine/obj_base.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/* filemoniker data structure */
typedef struct FileMonikerImpl{
@ -453,7 +454,7 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
if (This->filePathName==NULL)
return E_OUTOFMEMORY;
lstrcpyW(This->filePathName,lpszPathName);
strcpyW(This->filePathName,lpszPathName);
nb=FileMonikerImpl_DecomposePath(This->filePathName,&tabStr);
@ -487,10 +488,10 @@ HRESULT WINAPI FileMonikerImpl_Construct(FileMonikerImpl* This, LPCOLESTR lpszPa
*This->filePathName=0;
for(i=0;tabStr[i]!=NULL;i++)
lstrcatW(This->filePathName,tabStr[i]);
strcatW(This->filePathName,tabStr[i]);
if (addBkSlash)
lstrcatW(This->filePathName,bkSlash);
strcatW(This->filePathName,bkSlash);
}
for(i=0; tabStr[i]!=NULL;i++)
@ -767,13 +768,13 @@ HRESULT WINAPI FileMonikerImpl_ComposeWith(IMoniker* iface,
/* new path is the concatenation of the rest of str1 and str2 */
for(*newStr=0,j=0;j<=lastIdx1;j++)
lstrcatW(newStr,strDec1[j]);
strcatW(newStr,strDec1[j]);
if ((strDec2[i]==NULL && lastIdx1>-1 && lastIdx2>-1) || lstrcmpW(strDec2[i],bkSlash)!=0)
lstrcatW(newStr,bkSlash);
strcatW(newStr,bkSlash);
for(j=i;j<=lastIdx2;j++)
lstrcatW(newStr,strDec2[j]);
strcatW(newStr,strDec2[j]);
/* create a new moniker with the new string */
res=CreateFileMoniker(newStr,ppmkComposite);
@ -1039,7 +1040,7 @@ HRESULT WINAPI FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOth
return MK_E_NOPREFIX;
for(i=0;i<sameIdx;i++)
lstrcatW(commonPath,stringTable1[i]);
strcatW(commonPath,stringTable1[i]);
for(i=0;i<nb1;i++)
CoTaskMemFree(stringTable1[i]);
@ -1085,7 +1086,7 @@ int WINAPI FileMonikerImpl_DecomposePath(LPOLESTR str, LPOLESTR** stringTable)
if (strgtable[tabIndex]==NULL)
return E_OUTOFMEMORY;
lstrcpyW(strgtable[tabIndex++],bSlash);
strcpyW(strgtable[tabIndex++],bSlash);
i++;
@ -1102,7 +1103,7 @@ int WINAPI FileMonikerImpl_DecomposePath(LPOLESTR str, LPOLESTR** stringTable)
if (strgtable[tabIndex]==NULL)
return E_OUTOFMEMORY;
lstrcpyW(strgtable[tabIndex++],word);
strcpyW(strgtable[tabIndex++],word);
}
}
strgtable[tabIndex]=NULL;
@ -1163,11 +1164,11 @@ HRESULT WINAPI FileMonikerImpl_RelativePathTo(IMoniker* iface,IMoniker* pmOther,
if (len2>0 && !(len1==1 && len2==1 && sameIdx==0))
for(j=sameIdx;(tabStr1[j] != NULL); j++)
if (*tabStr1[j]!='\\')
lstrcatW(relPath,back);
strcatW(relPath,back);
/* add items of the second path (similar items with the first path are not included) to the relativePath */
for(j=sameIdx;tabStr2[j]!=NULL;j++)
lstrcatW(relPath,tabStr2[j]);
strcatW(relPath,tabStr2[j]);
res=CreateFileMoniker(relPath,ppmkRelPath);
@ -1211,7 +1212,7 @@ HRESULT WINAPI FileMonikerImpl_GetDisplayName(IMoniker* iface,
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
lstrcpyW(*ppszDisplayName,This->filePathName);
strcpyW(*ppszDisplayName,This->filePathName);
return S_OK;
}

View File

@ -12,8 +12,9 @@
#include "winerror.h"
#include "debugtools.h"
#include "wine/obj_inplace.h"
#include "wine/unicode.h"
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/* ItemMoniker data structure */
typedef struct ItemMonikerImpl{
@ -355,8 +356,8 @@ HRESULT WINAPI ItemMonikerImpl_Construct(ItemMonikerImpl* This, LPCOLESTR lpszDe
if ((This->itemName==NULL)||(This->itemDelimiter==NULL))
return E_OUTOFMEMORY;
lstrcpyW(This->itemName,lpszItem);
lstrcpyW(This->itemDelimiter,lpszDelim);
strcpyW(This->itemName,lpszItem);
strcpyW(This->itemDelimiter,lpszDelim);
return S_OK;
}
@ -799,8 +800,8 @@ HRESULT WINAPI ItemMonikerImpl_GetDisplayName(IMoniker* iface,
if (*ppszDisplayName==NULL)
return E_OUTOFMEMORY;
lstrcpyW(*ppszDisplayName,This->itemDelimiter);
lstrcatW(*ppszDisplayName,This->itemName);
strcpyW(*ppszDisplayName,This->itemDelimiter);
strcatW(*ppszDisplayName,This->itemName);
return S_OK;
}

View File

@ -13,12 +13,12 @@
#include <sys/types.h>
#include <unistd.h>
#include "windef.h"
#include "ntddk.h"
#include "winerror.h"
#include "wine/winestring.h"
#include "wine/winbase16.h"
#include "wingdi.h"
#include "wtypes.h"
#include "file.h"
#include "wine/obj_base.h"
#include "wine/obj_storage.h"
#include "heap.h"
@ -372,10 +372,12 @@ STORAGE_dump_pps_entry(struct storage_pps_entry *stde) {
DPRINTF("guid: %s\n",debugstr_guid(&(stde->pps_guid)));
if (stde->pps_type !=2) {
time_t t;
t = DOSFS_FileTimeToUnixTime(&(stde->pps_ft1),NULL);
DWORD dw;
RtlTimeToSecondsSince1970(&(stde->pps_ft1),&dw);
t = dw;
DPRINTF("ts1: %s\n",ctime(&t));
t = DOSFS_FileTimeToUnixTime(&(stde->pps_ft2),NULL);
RtlTimeToSecondsSince1970(&(stde->pps_ft2),&dw);
t = dw;
DPRINTF("ts2: %s\n",ctime(&t));
}
DPRINTF("startblock: %ld\n",stde->pps_sb);
@ -1350,7 +1352,7 @@ HRESULT WINAPI IStorage16_fnCreateStorage(
assert(STORAGE_put_pps_entry(lpstg->hf,x,&stde));
assert(1==STORAGE_get_pps_entry(lpstg->hf,ppsent,&(lpstg->stde)));
lstrcpyAtoW(lpstg->stde.pps_rawname,pwcsName);
lpstg->stde.pps_sizeofname = lstrlenA(pwcsName)*2+2;
lpstg->stde.pps_sizeofname = strlen(pwcsName)*2+2;
lpstg->stde.pps_next = -1;
lpstg->stde.pps_prev = -1;
lpstg->stde.pps_dir = -1;
@ -1403,7 +1405,7 @@ HRESULT WINAPI IStorage16_fnCreateStream(
assert(STORAGE_put_pps_entry(lpstr->hf,x,&stde));
assert(1==STORAGE_get_pps_entry(lpstr->hf,ppsent,&(lpstr->stde)));
lstrcpyAtoW(lpstr->stde.pps_rawname,pwcsName);
lpstr->stde.pps_sizeofname = lstrlenA(pwcsName)*2+2;
lpstr->stde.pps_sizeofname = strlen(pwcsName)*2+2;
lpstr->stde.pps_next = -1;
lpstr->stde.pps_prev = -1;
lpstr->stde.pps_dir = -1;

View File

@ -17,6 +17,7 @@
#include "winbase.h" /* for lstrlenW() and the likes */
#include "winnls.h"
#include "wine/unicode.h"
#include "debugtools.h"
#include "storage32.h"
@ -25,7 +26,7 @@
#include "winreg.h"
#include "wine/wingdi16.h"
DEFAULT_DEBUG_CHANNEL(storage)
DEFAULT_DEBUG_CHANNEL(storage);
#define FILE_BEGIN 0
@ -684,7 +685,7 @@ HRESULT WINAPI StorageBaseImpl_RenameElement(
if (renamedProperty.sizeOfNameString > PROPERTY_NAME_BUFFER_LEN)
return STG_E_INVALIDNAME;
lstrcpyW(renamedProperty.name, pwcsNewName);
strcpyW(renamedProperty.name, pwcsNewName);
renamedProperty.propertyType = currentProperty.propertyType;
renamedProperty.startingBlock = currentProperty.startingBlock;
@ -858,7 +859,7 @@ HRESULT WINAPI StorageBaseImpl_CreateStream(
if (newStreamProperty.sizeOfNameString > PROPERTY_NAME_BUFFER_LEN)
return STG_E_INVALIDNAME;
lstrcpyW(newStreamProperty.name, pwcsName);
strcpyW(newStreamProperty.name, pwcsName);
newStreamProperty.propertyType = PROPTYPE_STREAM;
newStreamProperty.startingBlock = BLOCK_END_OF_CHAIN;
@ -1043,7 +1044,7 @@ HRESULT WINAPI StorageImpl_CreateStorage(
if (newProperty.sizeOfNameString > PROPERTY_NAME_BUFFER_LEN)
return STG_E_INVALIDNAME;
lstrcpyW(newProperty.name, pwcsName);
strcpyW(newProperty.name, pwcsName);
newProperty.propertyType = PROPTYPE_STORAGE;
newProperty.startingBlock = BLOCK_END_OF_CHAIN;
@ -3981,7 +3982,7 @@ void StorageUtl_CopyPropertyToSTATSTG(
destination->pwcsName =
CoTaskMemAlloc((lstrlenW(source->name)+1)*sizeof(WCHAR));
lstrcpyW((LPWSTR)destination->pwcsName, source->name);
strcpyW((LPWSTR)destination->pwcsName, source->name);
}
switch (source->propertyType)

View File

@ -9,6 +9,7 @@
#include <assert.h>
#include <string.h>
#include "winerror.h"
#include "wine/unicode.h"
#include "oleauto.h" /* for SysAllocString(....) */
#include "wine/obj_olefont.h"
#include "wine/obj_storage.h"
@ -17,7 +18,7 @@
#include "heap.h"
#include "connpt.h" /* for CreateConnectionPoint */
DEFAULT_DEBUG_CHANNEL(ole)
DEFAULT_DEBUG_CHANNEL(ole);
/***********************************************************************
* Declaration of constants used when serializing the font object.
@ -376,7 +377,7 @@ static OLEFontImpl* OLEFontImpl_Construct(LPFONTDESC fontDesc)
newObject->description.lpstrName = HeapAlloc(GetProcessHeap(),
0,
(lstrlenW(fontDesc->lpstrName)+1) * sizeof(WCHAR));
lstrcpyW(newObject->description.lpstrName, fontDesc->lpstrName);
strcpyW(newObject->description.lpstrName, fontDesc->lpstrName);
newObject->description.cySize = fontDesc->cySize;
newObject->description.sWeight = fontDesc->sWeight;
newObject->description.sCharset = fontDesc->sCharset;
@ -587,7 +588,7 @@ static HRESULT WINAPI OLEFontImpl_put_Name(
if (this->description.lpstrName==0)
return E_OUTOFMEMORY;
lstrcpyW(this->description.lpstrName, name);
strcpyW(this->description.lpstrName, name);
TRACE("new name %s\n", debugstr_w(this->description.lpstrName));
OLEFont_SendNotify(this, DISPID_FONT_NAME);
return S_OK;
@ -925,7 +926,7 @@ static HRESULT WINAPI OLEFontImpl_get_hFont(
logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logFont.lfQuality = DEFAULT_QUALITY;
logFont.lfPitchAndFamily = DEFAULT_PITCH;
lstrcpyW(logFont.lfFaceName,this->description.lpstrName);
strcpyW(logFont.lfFaceName,this->description.lpstrName);
this->gdiFont = CreateFontIndirectW(&logFont);
}

View File

@ -132,7 +132,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
_ILSimpleGetText(apidl[i], szFileName + rootsize, MAX_PATH - rootsize);
size = strlen(szFileName) + 1;
lstrcpyA(((char*)pDropFiles)+offset, szFileName);
strcpy(((char*)pDropFiles)+offset, szFileName);
offset += size;
}

View File

@ -13,7 +13,6 @@
#include "wine/winbase16.h"
#include "wine/shell16.h"
#include "winerror.h"
#include "file.h"
#include "heap.h"
#include "ldt.h"
#include "module.h"
@ -159,7 +158,7 @@ UINT16 WINAPI DragQueryFile16(
}
}
i = lstrlenA(lpDrop);
i = strlen(lpDrop);
i++;
if (!lpszFile ) goto end; /* needed buffer size */
i = (wLength > i) ? i : wLength;

View File

@ -495,8 +495,8 @@ DWORD WINAPI SHRestricted (DWORD pol) {
}
/* we have a known policy */
lstrcpyA(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
lstrcatA(regstr, sh32_policy_table[polidx].appstr);
strcpy(regstr, "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\");
strcat(regstr, sh32_policy_table[polidx].appstr);
/* first check if this policy has been cached, return it if so */
if (sh32_policy_table[polidx].cache != SHELL_NO_POLICY)

View File

@ -9,6 +9,7 @@
#include "windef.h"
#include "wine/undocshell.h"
#include "wine/unicode.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(shell);
@ -141,12 +142,12 @@ DWORD WINAPI SHLWAPI_193 ()
* check me!
*/
LPWSTR WINAPI SHLWAPI_215 (
LPSTR lpStrSrc,
LPWSTR lpStrSrc,
LPVOID lpwStrDest,
int len)
{
WARN("(%s %p %u)\n",lpStrSrc,lpwStrDest,len);
return NTDLL_wcsncpy(lpwStrDest, lpStrSrc, len);
WARN("(%p %p %u)\n",lpStrSrc,lpwStrDest,len);
return strncpyW(lpwStrDest, lpStrSrc, len);
}
/*************************************************************************

View File

@ -285,32 +285,6 @@ LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
return (LPWSTR)(lastpoint?lastpoint:lpszPath);
}
/*************************************************************************
* PathGetExtensionA [internal]
*
* NOTES
* exported by ordinal
* return value points to the first char after the dot
*/
LPSTR WINAPI PathGetExtensionA(LPCSTR lpszPath)
{
TRACE("(%s)\n",lpszPath);
lpszPath = PathFindExtensionA(lpszPath);
return (LPSTR)(*lpszPath?(lpszPath+1):lpszPath);
}
/*************************************************************************
* PathGetExtensionW [internal]
*/
LPWSTR WINAPI PathGetExtensionW(LPCWSTR lpszPath)
{
TRACE("(%s)\n",debugstr_w(lpszPath));
lpszPath = PathFindExtensionW(lpszPath);
return (LPWSTR)(*lpszPath?(lpszPath+1):lpszPath);
}
/*************************************************************************
* PathGetArgsA [SHLWAPI.@]
*
@ -661,7 +635,7 @@ void WINAPI PathRemoveBlanksW(LPWSTR str)
if(str)
{
while (*x==' ') x = CharNextW(x);
if (x!=str) lstrcpyW(str,x);
if (x!=str) strcpyW(str,x);
x=str+strlenW(str)-1;
while (*x==' ') x = CharPrevW(str, x);
if (*x==' ') *x='\0';
@ -726,7 +700,7 @@ VOID WINAPI PathUnquoteSpacesA(LPSTR str)
if (str[len-1]!='"')
return;
str[len-1]='\0';
lstrcpyA(str,str+1);
strcpy(str,str+1);
return;
}
@ -807,24 +781,6 @@ BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs)
return FALSE;
}
/*************************************************************************
* PathCleanupSpecA [SHLWAPI.@]
*/
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y)
{
FIXME("(%p %s, %p %s) stub\n",x,debugstr_a(x),y,debugstr_a(y));
return TRUE;
}
/*************************************************************************
* PathCleanupSpecW [SHLWAPI.@]
*/
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y)
{
FIXME("(%p %s, %p %s) stub\n",x,debugstr_w(x),y,debugstr_w(y));
return TRUE;
}
/*************************************************************************
* PathCompactPathExA [SHLWAPI.@]
*/
@ -964,42 +920,6 @@ BOOL WINAPI PathIsRootW(LPCWSTR lpszPath)
}
/*************************************************************************
* PathIsExeA [internal]
*/
BOOL WINAPI PathIsExeA (LPCSTR lpszPath)
{
LPCSTR lpszExtension = PathGetExtensionA(lpszPath);
int i = 0;
static char * lpszExtensions[6] = {"exe", "com", "pid", "cmd", "bat", NULL };
TRACE("path=%s\n",lpszPath);
for(i=0; lpszExtensions[i]; i++)
if (!strcasecmp(lpszExtension,lpszExtensions[i])) return TRUE;
return FALSE;
}
/*************************************************************************
* PathIsExeW [internal]
*/
BOOL WINAPI PathIsExeW (LPCWSTR lpszPath)
{
LPCWSTR lpszExtension = PathGetExtensionW(lpszPath);
int i = 0;
static WCHAR lpszExtensions[6][4] =
{{'e','x','e','\0'}, {'c','o','m','\0'}, {'p','i','d','\0'},
{'c','m','d','\0'}, {'b','a','t','\0'}, {'\0'} };
TRACE("path=%s\n",debugstr_w(lpszPath));
for(i=0; lpszExtensions[i]; i++)
if (!strcmpiW(lpszExtension,lpszExtensions[i])) return TRUE;
return FALSE;
}
/*************************************************************************
* PathIsDirectoryA [SHLWAPI.@]
*/
@ -1618,9 +1538,9 @@ BOOL WINAPI PathAddExtensionW(
if (*(PathFindExtensionW(pszPath))) return FALSE;
if (!pszExtension || *pszExtension=='\0')
lstrcatW(pszPath, ext);
strcatW(pszPath, ext);
else
lstrcatW(pszPath, pszExtension);
strcatW(pszPath, pszExtension);
}
return TRUE;

View File

@ -17,7 +17,7 @@
#include "heap.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL(ver)
DEFAULT_DEBUG_CHANNEL(ver);
/******************************************************************************
@ -176,9 +176,9 @@ typedef struct
( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )
#define VersionInfo16_Value( ver ) \
DWORD_ALIGN( (ver), (ver)->szKey + lstrlenA((ver)->szKey) + 1 )
DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 )
#define VersionInfo32_Value( ver ) \
DWORD_ALIGN( (ver), (ver)->szKey + lstrlenW((ver)->szKey) + 1 )
DWORD_ALIGN( (ver), (ver)->szKey + strlenW((ver)->szKey) + 1 )
#define VersionInfo16_Children( ver ) \
(VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \

View File

@ -15,12 +15,13 @@
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "wine/unicode.h"
#include "debugtools.h"
#include "heap.h"
#include "commctrl.h"
#include "winnls.h"
DEFAULT_DEBUG_CHANNEL(winspool)
DEFAULT_DEBUG_CHANNEL(winspool);
CRITICAL_SECTION PRINT32_RegistryBlocker;
@ -1733,7 +1734,7 @@ static BOOL WINSPOOL_GetPrinterDriver(HANDLE hPrinter, LPWSTR pEnvironment,
if(size <= cbBuf) {
cbBuf -= size;
if(unicode)
lstrcpyW((LPWSTR)ptr, DriverName);
strcpyW((LPWSTR)ptr, DriverName);
else
WideCharToMultiByte(CP_ACP, 0, DriverName, -1, ptr, size, NULL,
NULL);
@ -1766,7 +1767,7 @@ static BOOL WINSPOOL_GetPrinterDriver(HANDLE hPrinter, LPWSTR pEnvironment,
if(size <= cbBuf) {
cbBuf -= size;
if(unicode)
lstrcpyW((LPWSTR)ptr, pEnvironment);
strcpyW((LPWSTR)ptr, pEnvironment);
else
WideCharToMultiByte(CP_ACP, 0, pEnvironment, -1, ptr, size,
NULL, NULL);

View File

@ -191,7 +191,7 @@ INT WINAPI Escape( HDC hdc, INT nEscape, INT cbInput,
case GETTECHNOLOGY: {
LPSTR x=PTR_SEG_TO_LIN(segout);
lstrcpyA(lpvOutData,x);
strcpy(lpvOutData,x);
SEGPTR_FREE(x);
break;
}
@ -205,7 +205,7 @@ INT WINAPI Escape( HDC hdc, INT nEscape, INT cbInput,
}
case GETFACENAME: {
LPSTR x = (LPSTR)PTR_SEG_TO_LIN(segout);
lstrcpyA(lpvOutData,x);
strcpy(lpvOutData,x);
SEGPTR_FREE(x);
break;
}

View File

@ -1428,9 +1428,9 @@ static fontAlias* XFONT_CreateAlias( LPCSTR lpTypeFace, LPCSTR lpAlias )
pfa->next = NULL;
pfa->faTypeFace = (LPSTR)(pfa + 1);
lstrcpyA( pfa->faTypeFace, lpTypeFace );
strcpy( pfa->faTypeFace, lpTypeFace );
pfa->faAlias = pfa->faTypeFace + j;
lstrcpyA( pfa->faAlias, lpAlias );
strcpy( pfa->faAlias, lpAlias );
TRACE("added alias '%s' for '%s'\n", lpAlias, lpTypeFace );

View File

@ -35,9 +35,6 @@ void WINAPI PathUnquoteSpacesW(LPWSTR str);
int WINAPI PathParseIconLocationA(LPSTR lpszPath);
int WINAPI PathParseIconLocationW(LPWSTR lpszPath);
BOOL WINAPI PathIsExeA(LPCSTR lpszPath);
BOOL WINAPI PathIsExeW(LPCWSTR lpszPath);
BOOL WINAPI PathIsDirectoryA(LPCSTR lpszPath);
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath);

View File

@ -572,9 +572,6 @@ LPWSTR WINAPI PathFindExtensionW(LPCWSTR path);
#define PathFindExtension WINELIB_NAME_AW(PathFindExtension)
LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
LPSTR WINAPI PathGetExtensionA(LPCSTR lpszPath);
LPWSTR WINAPI PathGetExtensionW(LPCWSTR lpszPath);
#define PathGetExtension WINELIB_NAME_AW(PathGetExtension)
LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath);
LPSTR WINAPI PathGetArgs(LPCSTR lpszPath);
@ -705,10 +702,6 @@ LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf );
LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf );
#define StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize)
DWORD WINAPI PathCleanupSpecA(LPSTR x, LPSTR y);
DWORD WINAPI PathCleanupSpecW(LPWSTR x, LPWSTR y);
#define PathCleanupSpec WINELIB_NAME_AW(PathCleanupSpec)
/****************************************************************************
* Shell Namespace Routines
*/

View File

@ -133,6 +133,14 @@ static inline int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
return *str1 - *str2;
}
static inline WCHAR *strncpyW( WCHAR *str1, const WCHAR *str2, int n )
{
WCHAR *ret = str1;
while (n-- > 0) if (!(*str1++ = *str2++)) break;
while (n-- > 0) *str1++ = 0;
return ret;
}
static inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
{
strcpyW( dst + strlenW(dst), src );

View File

@ -8,6 +8,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "module.h"
#include "debugtools.h"
@ -47,7 +48,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 )
*((WORD *)dialog16)++ = *((WORD *)p)++; break;
default: lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p );
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
break;
}
@ -59,14 +60,14 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 )
*((WORD *)dialog16)++ = *((WORD *)p)++; break;
default: lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p );
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
break;
}
/* Transfer window caption */
lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p );
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
/* Transfer font info */
if (style & DS_SETFONT)
@ -79,7 +80,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 )
}
lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p ); /* faceName */
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
}
/* Transfer dialog items */
@ -121,7 +122,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 )
*((BYTE *)dialog16)++ = (BYTE)*((WORD *)p)++; break;
default: lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p );
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
break;
}
@ -133,7 +134,7 @@ VOID WINAPI ConvertDialog32To16( LPVOID dialog32, DWORD size, LPVOID dialog16 )
*((WORD *)dialog16)++ = *((WORD *)p)++; break;
default: lstrcpyWtoA( (LPSTR)dialog16, (LPWSTR)p );
((LPSTR)dialog16) += strlen( (LPSTR)dialog16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
break;
}
@ -187,7 +188,7 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 )
{
case 0x0000: ((WORD *)p)++; break;
case 0xffff: ((WORD *)p) += 2; break;
default: ((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1; break;
default: ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break;
}
/* Skip class name */
@ -195,11 +196,11 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 )
{
case 0x0000: ((WORD *)p)++; break;
case 0xffff: ((WORD *)p) += 2; break;
default: ((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1; break;
default: ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break;
}
/* Skip window caption */
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
/* Skip font info */
if (style & DS_SETFONT)
@ -210,7 +211,7 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 )
((WORD *)p)++; /* weight */
((WORD *)p)++; /* italic */
}
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1; /* faceName */
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; /* faceName */
}
/* Skip dialog items */
@ -246,7 +247,7 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 )
{
case 0x0000: ((WORD *)p)++; break;
case 0xffff: ((WORD *)p) += 2; break;
default: ((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1; break;
default: ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break;
}
/* Skip window name */
@ -254,7 +255,7 @@ WORD WINAPI GetDialog32Size16( LPVOID dialog32 )
{
case 0x0000: ((WORD *)p)++; break;
case 0xffff: ((WORD *)p) += 2; break;
default: ((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1; break;
default: ((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1; break;
}
/* Skip data */
@ -296,7 +297,7 @@ VOID WINAPI ConvertMenu32To16( LPVOID menu32, DWORD size, LPVOID menu16 )
lstrcpyWtoA( (LPSTR)menu16, (LPWSTR)p );
((LPSTR)menu16) += strlen( (LPSTR)menu16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
if ( flags & MF_END )
level--;
@ -310,7 +311,7 @@ VOID WINAPI ConvertMenu32To16( LPVOID menu32, DWORD size, LPVOID menu16 )
lstrcpyWtoA( (LPSTR)menu16, (LPWSTR)p );
((LPSTR)menu16) += strlen( (LPSTR)menu16 ) + 1;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
/* align on DWORD boundary (32-bit only) */
p = (LPVOID)((((int)p) + 3) & ~3);
@ -348,7 +349,7 @@ WORD WINAPI GetMenu32Size16( LPVOID menu32 )
else
level++;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
if ( flags & MF_END )
level--;
@ -360,7 +361,7 @@ WORD WINAPI GetMenu32Size16( LPVOID menu32 )
((DWORD *)p)++; /* ID */
flags = *((WORD *)p)++;
((LPWSTR)p) += lstrlenW( (LPWSTR)p ) + 1;
((LPWSTR)p) += strlenW( (LPWSTR)p ) + 1;
/* align on DWORD boundary (32-bit only) */
p = (LPVOID)((((int)p) + 3) & ~3);

View File

@ -18,6 +18,7 @@
#include "windef.h"
#include "wine/winbase16.h"
#include "wine/unicode.h"
#include "winerror.h"
#include "instance.h"
#include "ldt.h"
@ -629,7 +630,7 @@ static UINT ATOM_GetAtomNameA( ATOM atom, LPSTR buffer, INT count, BOOL local )
req->local = local;
if (server_call( REQ_GET_ATOM_NAME )) return 0;
lstrcpynWtoA( buffer, req->name, count );
len = lstrlenW( req->name );
len = strlenW( req->name );
}
if (count <= len)
{
@ -697,7 +698,7 @@ static UINT ATOM_GetAtomNameW( ATOM atom, LPWSTR buffer, INT count, BOOL local )
req->local = local;
if (server_call( REQ_GET_ATOM_NAME )) return 0;
lstrcpynW( buffer, req->name, count );
len = lstrlenW( req->name );
len = strlenW( req->name );
}
if (count <= len)
{

View File

@ -11,6 +11,7 @@
#include <string.h>
#include "wine/winbase16.h"
#include "wine/winestring.h"
#include "wine/unicode.h"
#include "selectors.h"
#include "global.h"
#include "winbase.h"
@ -1670,7 +1671,7 @@ LPWSTR HEAP_strdupW( HANDLE heap, DWORD flags, LPCWSTR str )
LPWSTR p = HeapAlloc( heap, flags, len * sizeof(WCHAR) );
if(p) {
SET_EIP(p);
lstrcpyW( p, str );
strcpyW( p, str );
}
return p;
}

View File

@ -20,8 +20,7 @@
#include "winreg.h"
#include "winerror.h"
#include "wine/winbase16.h"
#include "winversion.h"
#include "file.h"
#include "wine/unicode.h"
#include "heap.h"
#include "server.h"
#include "debugtools.h"
@ -56,8 +55,8 @@ static inline DWORD copy_nameW( LPWSTR dest, LPCWSTR name )
{
if (name)
{
if (lstrlenW(name) > MAX_PATH) return ERROR_MORE_DATA;
lstrcpyW( dest, name );
if (strlenW(name) > MAX_PATH) return ERROR_MORE_DATA;
strcpyW( dest, name );
}
else dest[0] = 0;
return ERROR_SUCCESS;
@ -307,8 +306,8 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_le
req->index = index;
if ((ret = reg_server_call( REQ_ENUM_KEY )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
cls_len = lstrlenW( req->class ) + 1;
len = strlenW( req->name ) + 1;
cls_len = strlenW( req->class ) + 1;
if (len > *name_len) return ERROR_MORE_DATA;
if (class_len && (cls_len > *class_len)) return ERROR_MORE_DATA;
@ -319,7 +318,7 @@ DWORD WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_le
if (class) memcpy( class, req->class, cls_len * sizeof(WCHAR) );
*class_len = cls_len - 1;
}
if (ft) DOSFS_UnixTimeToFileTime( req->modif, ft, 0 );
if (ft) RtlSecondsSince1970ToTime( req->modif, ft );
return ERROR_SUCCESS;
}
@ -342,8 +341,8 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_len
req->index = index;
if ((ret = reg_server_call( REQ_ENUM_KEY )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
cls_len = lstrlenW( req->class ) + 1;
len = strlenW( req->name ) + 1;
cls_len = strlenW( req->class ) + 1;
if (len > *name_len) return ERROR_MORE_DATA;
if (class_len && (cls_len > *class_len)) return ERROR_MORE_DATA;
@ -354,7 +353,7 @@ DWORD WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_len
if (class) memcpyWtoA( class, req->class, cls_len );
*class_len = cls_len - 1;
}
if (ft) DOSFS_UnixTimeToFileTime( req->modif, ft, 0 );
if (ft) RtlSecondsSince1970ToTime( req->modif, ft );
return ERROR_SUCCESS;
}
@ -411,7 +410,7 @@ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWO
TRACE( "(0x%x,%p,%ld,%p,%p,%p,%p,%p,%p,%p,%p)\n", hkey, class, class_len ? *class_len : 0,
reserved, subkeys, max_subkey, values, max_value, max_data, security, modif );
if (class && !class_len && (VERSION_GetVersion() == NT40))
if (class && !class_len && !(GetVersion() & 0x80000000 /*NT*/))
return ERROR_INVALID_PARAMETER;
req->hkey = hkey;
@ -419,21 +418,21 @@ DWORD WINAPI RegQueryInfoKeyW( HKEY hkey, LPWSTR class, LPDWORD class_len, LPDWO
if (class)
{
if (class_len && (lstrlenW(req->class) + 1 > *class_len))
if (class_len && (strlenW(req->class) + 1 > *class_len))
{
*class_len = lstrlenW(req->class);
*class_len = strlenW(req->class);
return ERROR_MORE_DATA;
}
lstrcpyW( class, req->class );
strcpyW( class, req->class );
}
if (class_len) *class_len = lstrlenW( req->class );
if (class_len) *class_len = strlenW( req->class );
if (subkeys) *subkeys = req->subkeys;
if (max_subkey) *max_subkey = req->max_subkey;
if (max_class) *max_class = req->max_class;
if (values) *values = req->values;
if (max_value) *max_value = req->max_value;
if (max_data) *max_data = req->max_data;
if (modif) DOSFS_UnixTimeToFileTime( req->modif, modif, 0 );
if (modif) RtlSecondsSince1970ToTime( req->modif, modif );
return ERROR_SUCCESS;
}
@ -453,7 +452,7 @@ DWORD WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDWOR
TRACE( "(0x%x,%p,%ld,%p,%p,%p,%p,%p,%p,%p,%p)\n", hkey, class, class_len ? *class_len : 0,
reserved, subkeys, max_subkey, values, max_value, max_data, security, modif );
if (class && !class_len && (VERSION_GetVersion() == NT40))
if (class && !class_len && !(GetVersion() & 0x80000000 /*NT*/))
return ERROR_INVALID_PARAMETER;
req->hkey = hkey;
@ -461,21 +460,21 @@ DWORD WINAPI RegQueryInfoKeyA( HKEY hkey, LPSTR class, LPDWORD class_len, LPDWOR
if (class)
{
if (class_len && (lstrlenW(req->class) + 1 > *class_len))
if (class_len && (strlenW(req->class) + 1 > *class_len))
{
*class_len = lstrlenW(req->class);
*class_len = strlenW(req->class);
return ERROR_MORE_DATA;
}
lstrcpyWtoA( class, req->class );
}
if (class_len) *class_len = lstrlenW( req->class );
if (class_len) *class_len = strlenW( req->class );
if (subkeys) *subkeys = req->subkeys;
if (max_subkey) *max_subkey = req->max_subkey;
if (max_class) *max_class = req->max_class;
if (values) *values = req->values;
if (max_value) *max_value = req->max_value;
if (max_data) *max_data = req->max_data;
if (modif) DOSFS_UnixTimeToFileTime( req->modif, modif, 0 );
if (modif) RtlSecondsSince1970ToTime( req->modif, modif );
return ERROR_SUCCESS;
}
@ -670,7 +669,7 @@ DWORD WINAPI RegSetValueW( HKEY hkey, LPCWSTR name, DWORD type, LPCWSTR data, DW
}
ret = RegSetValueExW( subkey, NULL, 0, REG_SZ, (LPBYTE)data,
(lstrlenW( data ) + 1) * sizeof(WCHAR) );
(strlenW( data ) + 1) * sizeof(WCHAR) );
if (subkey != hkey) RegCloseKey( subkey );
return ret;
}
@ -906,7 +905,7 @@ DWORD WINAPI RegEnumValueW( HKEY hkey, DWORD index, LPWSTR value, LPDWORD val_co
req->offset = 0;
if ((ret = reg_server_call( REQ_ENUM_KEY_VALUE )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
len = strlenW( req->name ) + 1;
if (len > *val_count) return ERROR_MORE_DATA;
memcpy( value, req->name, len * sizeof(WCHAR) );
*val_count = len - 1;
@ -959,7 +958,7 @@ DWORD WINAPI RegEnumValueA( HKEY hkey, DWORD index, LPSTR value, LPDWORD val_cou
req->offset = 0;
if ((ret = reg_server_call( REQ_ENUM_KEY_VALUE )) != ERROR_SUCCESS) return ret;
len = lstrlenW( req->name ) + 1;
len = strlenW( req->name ) + 1;
if (len > *val_count) return ERROR_MORE_DATA;
memcpyWtoA( value, req->name, len );
*val_count = len - 1;

View File

@ -900,6 +900,6 @@ BOOL WINAPI GetICMProfileA(HDC hDC, LPDWORD lpcbName, LPSTR lpszFilename)
}
/* behavior 3: if buffer size OK and pointer not NULL, copy and return size */
lstrcpyA(lpszFilename, WINEICM);
strcpy(lpszFilename, WINEICM);
return TRUE;
}

View File

@ -1965,7 +1965,7 @@ INT WINAPI LCMapStringW(
return 0;
}
if (srclen==-1)
srclen = lstrlenW(srcstr)+1;
srclen = strlenW(srcstr)+1;
/* FIXME: Both this function and it's companion LCMapStringA()
* completely ignore the "lcid" parameter. In place of the "lcid"
@ -2358,8 +2358,8 @@ UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle,
/* Is strcmp defaulting to string sort or to word sort?? */
/* FIXME: Handle NORM_STRINGSORT */
l1 = (l1==-1)?lstrlenW(s1):l1;
l2 = (l2==-1)?lstrlenW(s2):l2;
l1 = (l1==-1)?strlenW(s1):l1;
l2 = (l2==-1)?strlenW(s2):l2;
len = l1<l2 ? l1:l2;
ret = (fdwStyle & NORM_IGNORECASE) ? strncmpiW(s1,s2,len) : strncmpW(s1,s2,len);
/* not equal, return 1 or 3 */
@ -2759,9 +2759,9 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags,
inpos--;
/* cat buf onto the output */
outlen = lstrlenW(buf);
outlen = strlenW(buf);
if (outpos + buflen < outlen) {
lstrcpyW( output + outpos, buf );
strcpyW( output + outpos, buf );
outpos += buflen;
} else {
lstrcpynW( output + outpos, buf, outlen - outpos );
@ -3651,7 +3651,7 @@ INT WINAPI GetNumberFormatW(LCID locale, DWORD dwflags,
FIXME("%s: stub, no reformating done\n",debugstr_w(lpvalue));
lstrcpynW( lpNumberStr, lpvalue, cchNumber );
return cchNumber? lstrlenW( lpNumberStr ) : 0;
return cchNumber? strlenW( lpNumberStr ) : 0;
}
/**************************************************************************

View File

@ -15,6 +15,11 @@
#include <stdlib.h>
#include <string.h>
#include "wine/winbase16.h"
#include "winerror.h"
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "class.h"
#include "heap.h"
#include "win.h"
@ -23,12 +28,8 @@
#include "toolhelp.h"
#include "winproc.h"
#include "debugtools.h"
#include "winerror.h"
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
DEFAULT_DEBUG_CHANNEL(class)
DEFAULT_DEBUG_CHANNEL(class);
static CLASS *firstClass = NULL;
@ -156,8 +157,8 @@ static void CLASS_SetMenuNameW( CLASS *classPtr, LPCWSTR name )
if (HIWORD(classPtr->menuNameA)) SEGPTR_FREE( classPtr->menuNameA );
if (classPtr->menuNameW) HeapFree( SystemHeap, 0, classPtr->menuNameW );
if ((classPtr->menuNameW = HeapAlloc( SystemHeap, 0,
(lstrlenW(name)+1)*sizeof(WCHAR) )))
lstrcpyW( classPtr->menuNameW, name );
(strlenW(name)+1)*sizeof(WCHAR) )))
strcpyW( classPtr->menuNameW, name );
classPtr->menuNameA = 0;
}
@ -225,8 +226,8 @@ static void CLASS_SetClassNameW( CLASS *classPtr, LPCWSTR name )
if (HIWORD(classPtr->classNameA)) SEGPTR_FREE( classPtr->classNameA );
if (classPtr->classNameW) HeapFree( SystemHeap, 0, classPtr->classNameW );
if ((classPtr->classNameW = HeapAlloc( SystemHeap, 0,
(lstrlenW(name)+1)*sizeof(WCHAR) )))
lstrcpyW( classPtr->classNameW, name );
(strlenW(name)+1)*sizeof(WCHAR) )))
strcpyW( classPtr->classNameW, name );
classPtr->classNameA = 0;
}

View File

@ -93,7 +93,7 @@ void DEFWND_SetTextW( WND *wndPtr, LPCWSTR text )
if (wndPtr->text) HeapFree(SystemHeap, 0, wndPtr->text);
if ((wndPtr->text = HeapAlloc(SystemHeap, 0, count * sizeof(WCHAR))))
lstrcpyW( wndPtr->text, text );
strcpyW( wndPtr->text, text );
else
ERR("Not enough memory for window text");

View File

@ -317,7 +317,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
else
{
info->className = (LPCSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
}
if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
@ -328,7 +328,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
else
{
info->windowName = (LPCSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
}
TRACE(" %s %s %d, %d, %d, %d, %d, %08lx, %08lx, %08lx\n",
@ -566,7 +566,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
default:
result->menuName = (LPCSTR)p;
TRACE(" MENU %s\n", debugstr_w( (LPCWSTR)p ));
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
break;
}
@ -586,14 +586,14 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
default:
result->className = (LPCSTR)p;
TRACE(" CLASS %s\n", debugstr_w( (LPCWSTR)p ));
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
break;
}
/* Get the window caption */
result->caption = (LPCSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
TRACE(" CAPTION %s\n", debugstr_w( (LPCWSTR)result->caption ) );
/* Get the font name */
@ -613,7 +613,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
result->italic = FALSE;
}
result->faceName = (LPCSTR)p;
p += lstrlenW( (LPCWSTR)p ) + 1;
p += strlenW( (LPCWSTR)p ) + 1;
TRACE(" FONT %d, %s, %d, %s\n",
result->pointSize, debugstr_w( (LPCWSTR)result->faceName ),
result->weight, result->italic ? "TRUE" : "FALSE" );

View File

@ -73,6 +73,7 @@
#include "windef.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "win.h"
#include "heap.h"
#include "nonclient.h"
@ -1141,25 +1142,25 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND hClient,
static const WCHAR lpBracket[] = {' ','-',' ','[',0};
static const WCHAR lpBracket2[] = {']',0};
int i_frame_text_length = lstrlenW(ci->frameTitle);
int i_child_text_length = lstrlenW(childWnd->text);
int i_frame_text_length = strlenW(ci->frameTitle);
int i_child_text_length = strlenW(childWnd->text);
lstrcpynW( lpBuffer, ci->frameTitle, MDI_MAXTITLELENGTH);
if( i_frame_text_length + 6 < MDI_MAXTITLELENGTH )
{
lstrcatW( lpBuffer, lpBracket );
strcatW( lpBuffer, lpBracket );
if( i_frame_text_length + i_child_text_length + 6 < MDI_MAXTITLELENGTH )
{
lstrcatW( lpBuffer, childWnd->text );
lstrcatW( lpBuffer, lpBracket2 );
strcatW( lpBuffer, childWnd->text );
strcatW( lpBuffer, lpBracket2 );
}
else
{
lstrcpynW( lpBuffer + i_frame_text_length + 4,
childWnd->text, MDI_MAXTITLELENGTH - i_frame_text_length - 5 );
lstrcatW( lpBuffer, lpBracket2 );
strcatW( lpBuffer, lpBracket2 );
}
}
}
@ -2338,7 +2339,7 @@ static BOOL WINAPI MDI_MoreWindowsDlgProc (HWND hDlg, UINT iMsg, WPARAM wParam,
SendMessageW(hListBox, LB_ADDSTRING, 0, (LPARAM) pWnd->text);
SendMessageA(hListBox, LB_SETITEMDATA, i, (LPARAM) pWnd);
length = lstrlenW(pWnd->text);
length = strlenW(pWnd->text);
WIN_ReleaseWndPtr(pWnd);
if (length > widest)

View File

@ -8,6 +8,7 @@
#include "wingdi.h"
#include "winbase.h"
#include "winuser.h"
#include "wine/unicode.h"
/**********************************************************************/
@ -84,7 +85,7 @@ BOOL WINAPI GetMonitorInfoA(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEXA))
lstrcpyA(((MONITORINFOEXA*)lpMonitorInfo)->szDevice, "DISPLAY");
strcpy(((MONITORINFOEXA*)lpMonitorInfo)->szDevice, "DISPLAY");
return TRUE;
}
@ -111,7 +112,7 @@ BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY;
if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEXW))
lstrcpyW(((MONITORINFOEXW*)lpMonitorInfo)->szDevice, (LPCWSTR)"D\0I\0S\0P\0L\0A\0Y\0\0");
strcpyW(((MONITORINFOEXW*)lpMonitorInfo)->szDevice, (LPCWSTR)"D\0I\0S\0P\0L\0A\0Y\0\0");
return TRUE;
}

View File

@ -8,6 +8,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "region.h"
#include "win.h"
#include "queue.h"
@ -1483,7 +1484,7 @@ static BOOL PAINTING_DrawState(HDC hdc, HBRUSH hbr,
if((opcode == DST_TEXT || opcode == DST_PREFIXTEXT) && !len) /* The string is '\0' terminated */
{
if(unicode)
len = lstrlenW((LPWSTR)lp);
len = strlenW((LPWSTR)lp);
else if(_32bit)
len = strlen((LPSTR)lp);
else

View File

@ -832,7 +832,7 @@ const char *SPY_GetWndName( HWND hwnd )
WIN_ReleaseWndPtr(pWnd);
}
else lstrcpyA( wnd_buffer, "\"NULL\"" );
else strcpy( wnd_buffer, "\"NULL\"" );
return wnd_buffer;
}
/***********************************************************************