mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 15:59:24 +00:00
Replaced a few calls to lstr* functions by their CRTDLL or libc
equivalent.
This commit is contained in:
parent
7147e4cfd4
commit
89f079bfd1
|
@ -22,6 +22,7 @@
|
|||
#include "winerror.h"
|
||||
#include "objbase.h"
|
||||
#include "commctrl.h"
|
||||
#include "crtdll.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(commctrl)
|
||||
|
@ -33,10 +34,8 @@ extern HANDLE COMCTL32_hHeap; /* handle to the private heap */
|
|||
* We put some function prototypes here that don't seem to belong in
|
||||
* any header file. When they find their place, we can remove them.
|
||||
*/
|
||||
extern LPWSTR __cdecl CRTDLL_wcschr(LPCWSTR, WCHAR);
|
||||
extern LPSTR WINAPI lstrrchr(LPCSTR, LPCSTR, WORD);
|
||||
extern LPWSTR WINAPI lstrrchrw(LPCWSTR, LPCWSTR, WORD);
|
||||
extern LPWSTR WINAPI strstrw(LPCWSTR, LPCWSTR);
|
||||
|
||||
|
||||
typedef struct _STREAMDATA
|
||||
|
@ -1994,7 +1993,7 @@ LPWSTR WINAPI COMCTL32_StrChrW( LPCWSTR lpStart, WORD wMatch) {
|
|||
*
|
||||
*/
|
||||
INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) {
|
||||
return lstrncmpA(lpStr1, lpStr2, nChar);
|
||||
return strncmp(lpStr1, lpStr2, nChar);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -2002,7 +2001,7 @@ INT WINAPI COMCTL32_StrCmpNA( LPCSTR lpStr1, LPCSTR lpStr2, int nChar) {
|
|||
*
|
||||
*/
|
||||
INT WINAPI COMCTL32_StrCmpNW( LPCWSTR lpStr1, LPCWSTR lpStr2, int nChar) {
|
||||
return lstrncmpW(lpStr1, lpStr2, nChar);
|
||||
return CRTDLL_wcsncmp(lpStr1, lpStr2, nChar);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
@ -2034,7 +2033,7 @@ LPSTR WINAPI COMCTL32_StrStrA( LPCSTR lpFirst, LPCSTR lpSrch) {
|
|||
*
|
||||
*/
|
||||
LPWSTR WINAPI COMCTL32_StrStrW( LPCWSTR lpFirst, LPCWSTR lpSrch) {
|
||||
return strstrw(lpFirst, lpSrch);
|
||||
return CRTDLL_wcsstr(lpFirst, lpSrch);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -298,8 +298,8 @@ static void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, PRINT_PTRA* PrintStructur
|
|||
LoadStringA(COMDLG32_hInstance, (1<<i),
|
||||
ResourceString, 255);
|
||||
if (StatusMsg[0]!='\0') /* append ; before next item */
|
||||
lstrcatA(StatusMsg, "; ");
|
||||
lstrcatA(StatusMsg,ResourceString);
|
||||
strcat(StatusMsg, "; ");
|
||||
strcat(StatusMsg,ResourceString);
|
||||
}
|
||||
}
|
||||
if (StatusMsg[0]=='\0') /* no Status ??? */
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# include <wctype.h>
|
||||
#endif
|
||||
#include "wine/winestring.h"
|
||||
#include "crtdll.h"
|
||||
#include "heap.h"
|
||||
#include "winnls.h"
|
||||
#include "debugtools.h"
|
||||
|
@ -224,7 +225,7 @@ DWORD WINAPI RtlEqualUnicodeString(PUNICODE_STRING s1,PUNICODE_STRING s2,DWORD x
|
|||
return 0;
|
||||
if (s1->Length != s2->Length)
|
||||
return 1;
|
||||
return !lstrncmpW(s1->Buffer,s2->Buffer,s1->Length/2);
|
||||
return !CRTDLL_wcsncmp(s1->Buffer,s2->Buffer,s1->Length/2);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -545,7 +545,7 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
|||
|
||||
hWndCtl = GetDlgItem( hWnd, IDC_WINE_TEXT );
|
||||
SendMessageA( hWndCtl, WM_GETTEXT, 512, (LPARAM)Template );
|
||||
if( !lstrncmpA( Template, "WINE", 4 ) )
|
||||
if( !strncmp( Template, "WINE", 4 ) )
|
||||
SetWindowTextA( GetDlgItem(hWnd, IDC_STATIC_TEXT), Template );
|
||||
else
|
||||
{ char* pch = Template + strlen(Template) - strlen(__appendix_str);
|
||||
|
@ -554,8 +554,8 @@ BOOL WINAPI AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
|
|||
(WPARAM)-1, (LPARAM)Template );
|
||||
}
|
||||
|
||||
lstrcpyA( Template, pstr );
|
||||
lstrcatA( Template, __appendix_str );
|
||||
strcpy( Template, pstr );
|
||||
strcat( Template, __appendix_str );
|
||||
SetWindowTextA( hWndCtl, Template );
|
||||
SetWindowLongA( hWnd, DWL_MSGRESULT, 1 );
|
||||
return TRUE;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "winnls.h"
|
||||
#include "winversion.h"
|
||||
#include "winreg.h"
|
||||
#include "crtdll.h"
|
||||
|
||||
#include "shlobj.h"
|
||||
#include "shell32_main.h"
|
||||
|
@ -130,7 +131,7 @@ LPWSTR WINAPI PathAddBackslashW(LPWSTR path)
|
|||
{ int len;
|
||||
TRACE("%p->%s\n",path,debugstr_w(path));
|
||||
|
||||
len = lstrlenW(path);
|
||||
len = CRTDLL_wcslen(path);
|
||||
if (len && path[len-1]!=(WCHAR)'\\')
|
||||
{ path[len] = (WCHAR)'\\';
|
||||
path[len+1]= 0x00;
|
||||
|
@ -170,10 +171,10 @@ LPWSTR WINAPI PathRemoveBlanksW(LPWSTR str)
|
|||
TRACE("%s\n",debugstr_w(str));
|
||||
while (*x==' ') x++;
|
||||
if (x!=str)
|
||||
lstrcpyW(str,x);
|
||||
CRTDLL_wcscpy(str,x);
|
||||
if (!*str)
|
||||
return str;
|
||||
x=str+lstrlenW(str)-1;
|
||||
x=str+CRTDLL_wcslen(str)-1;
|
||||
while (*x==' ')
|
||||
x--;
|
||||
if (*x==' ')
|
||||
|
@ -319,19 +320,19 @@ LPWSTR WINAPI PathCombineW(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
|
|||
|
||||
|
||||
if (!lpszFile || !lpszFile[0] || (lpszFile[0]==(WCHAR)'.' && !lpszFile[1]) )
|
||||
{ lstrcpyW(szDest,lpszDir);
|
||||
{ CRTDLL_wcscpy(szDest,lpszDir);
|
||||
return szDest;
|
||||
}
|
||||
|
||||
/* if lpszFile is a complete path don't care about lpszDir */
|
||||
if (PathIsRootW(lpszFile))
|
||||
{ lstrcpyW(szDest,lpszFile);
|
||||
{ CRTDLL_wcscpy(szDest,lpszFile);
|
||||
}
|
||||
else
|
||||
{ lstrcpyW(sTemp,lpszDir);
|
||||
{ CRTDLL_wcscpy(sTemp,lpszDir);
|
||||
PathAddBackslashW(sTemp);
|
||||
lstrcatW(sTemp,lpszFile);
|
||||
lstrcpyW(szDest,sTemp);
|
||||
CRTDLL_wcscat(sTemp,lpszFile);
|
||||
CRTDLL_wcscpy(szDest,sTemp);
|
||||
}
|
||||
return szDest;
|
||||
}
|
||||
|
@ -625,7 +626,7 @@ VOID WINAPI PathUnquoteSpacesA(LPSTR str)
|
|||
return;
|
||||
}
|
||||
VOID WINAPI PathUnquoteSpacesW(LPWSTR str)
|
||||
{ DWORD len = lstrlenW(str);
|
||||
{ DWORD len = CRTDLL_wcslen(str);
|
||||
|
||||
TRACE("%s\n",debugstr_w(str));
|
||||
|
||||
|
@ -634,7 +635,7 @@ VOID WINAPI PathUnquoteSpacesW(LPWSTR str)
|
|||
if (str[len-1]!='"')
|
||||
return;
|
||||
str[len-1]='\0';
|
||||
lstrcpyW(str,str+1);
|
||||
CRTDLL_wcscpy(str,str+1);
|
||||
return;
|
||||
}
|
||||
VOID WINAPI PathUnquoteSpacesAW(LPVOID str)
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "wine/winestring.h"
|
||||
#include "winerror.h"
|
||||
#include "heap.h"
|
||||
#include "crtdll.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(ver)
|
||||
|
@ -400,7 +401,7 @@ VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT32 *inf
|
|||
|
||||
while ( (DWORD)child < (DWORD)info + info->wLength )
|
||||
{
|
||||
if ( !lstrncmpiW( child->szKey, szKey, cbKey ) )
|
||||
if ( !CRTDLL__wcsnicmp( child->szKey, szKey, cbKey ) )
|
||||
return child;
|
||||
|
||||
child = VersionInfo32_Next( child );
|
||||
|
|
|
@ -545,7 +545,7 @@ BOOL DOSFS_FindUnixName( LPCSTR path, LPCSTR name, LPSTR long_buf,
|
|||
{
|
||||
if (!ignore_case)
|
||||
{
|
||||
if (!lstrncmpA( long_name, name, len )) break;
|
||||
if (!strncmp( long_name, name, len )) break;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1867,15 +1867,15 @@ DWORD WINAPI QueryDosDeviceA(LPCSTR devname,LPSTR target,DWORD bufsize)
|
|||
TRACE_(dosfs)("(%s,...)\n",devname?devname:"<null>");
|
||||
if (!devname) {
|
||||
/* return known MSDOS devices */
|
||||
lstrcpyA(buffer,"CON COM1 COM2 LPT1 NUL ");
|
||||
strcpy(buffer,"CON COM1 COM2 LPT1 NUL ");
|
||||
while ((s=strchr(buffer,' ')))
|
||||
*s='\0';
|
||||
|
||||
lstrcpynA(target,buffer,bufsize);
|
||||
return strlen(buffer);
|
||||
}
|
||||
lstrcpyA(buffer,"\\DEV\\");
|
||||
lstrcatA(buffer,devname);
|
||||
strcpy(buffer,"\\DEV\\");
|
||||
strcat(buffer,devname);
|
||||
if ((s=strchr(buffer,':'))) *s='\0';
|
||||
lstrcpynA(target,buffer,bufsize);
|
||||
return strlen(buffer);
|
||||
|
|
|
@ -945,14 +945,14 @@ UINT WINAPI ThunkConnect16(
|
|||
) {
|
||||
BOOL directionSL;
|
||||
|
||||
if (!lstrncmpA(TD->magic, "SL01", 4))
|
||||
if (!strncmp(TD->magic, "SL01", 4))
|
||||
{
|
||||
directionSL = TRUE;
|
||||
|
||||
TRACE_(thunk)("SL01 thunk %s (%lx) -> %s (%s), Reason: %ld\n",
|
||||
module16, (DWORD)TD, module32, thunkfun32, dwReason);
|
||||
}
|
||||
else if (!lstrncmpA(TD->magic, "LS01", 4))
|
||||
else if (!strncmp(TD->magic, "LS01", 4))
|
||||
{
|
||||
directionSL = FALSE;
|
||||
|
||||
|
|
|
@ -7,12 +7,7 @@ INT16 WINAPI WideCharToLocal16(LPSTR,LPWSTR,INT16);
|
|||
INT WINAPI WideCharToLocal(LPSTR,LPWSTR,INT);
|
||||
INT16 WINAPI LocalToWideChar16(LPWSTR,LPSTR,INT16);
|
||||
INT WINAPI LocalToWideChar(LPWSTR,LPSTR,INT);
|
||||
INT WINAPI lstrncmpA(LPCSTR,LPCSTR,INT);
|
||||
INT WINAPI lstrncmpW(LPCWSTR,LPCWSTR,INT);
|
||||
#define lstrncmp WINELIB_NAME_AW(lstrncmp)
|
||||
INT WINAPI lstrncmpiA(LPCSTR,LPCSTR,INT);
|
||||
INT WINAPI lstrncmpiW(LPCWSTR,LPCWSTR,INT);
|
||||
#define lstrncmpi WINELIB_NAME_AW(lstrncmpi)
|
||||
LPWSTR WINAPI lstrcpyAtoW(LPWSTR,LPCSTR);
|
||||
LPSTR WINAPI lstrcpyWtoA(LPSTR,LPCWSTR);
|
||||
LPWSTR WINAPI lstrcpynAtoW(LPWSTR,LPCSTR,INT);
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "resource.h"
|
||||
#include "debugtools.h"
|
||||
#include "heap.h"
|
||||
#include "crtdll.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(resource)
|
||||
|
@ -79,7 +80,8 @@ HRSRC LIBRES_FindResource( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
|
|||
for(Res=ResBlock->Resources; *Res; Res++)
|
||||
if(name)
|
||||
{
|
||||
if((*Res)->restype==typeid && !lstrncmpiW((LPCWSTR)((*Res)->resname+1), name, *((*Res)->resname)))
|
||||
if((*Res)->restype==typeid &&
|
||||
!CRTDLL__wcsnicmp((LPCWSTR)((*Res)->resname+1), name, *((*Res)->resname)))
|
||||
return (HRSRC)*Res;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "libres.h"
|
||||
#include "stackframe.h"
|
||||
#include "neexe.h"
|
||||
#include "crtdll.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -71,7 +72,7 @@ PIMAGE_RESOURCE_DIRECTORY GetResDirEntryW(PIMAGE_RESOURCE_DIRECTORY resdirptr,
|
|||
entryTable[entrynum].u1.s.NameOffset);
|
||||
if(namelen != str->Length)
|
||||
continue;
|
||||
if(lstrncmpiW(name,str->NameString,str->Length)==0)
|
||||
if(CRTDLL__wcsnicmp(name,str->NameString,str->Length)==0)
|
||||
return (PIMAGE_RESOURCE_DIRECTORY) (
|
||||
root +
|
||||
entryTable[entrynum].u2.s.OffsetToDirectory);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
#include "debugtools.h"
|
||||
#include "crtdll.h"
|
||||
#include "main.h"
|
||||
|
||||
DECLARE_DEBUG_CHANNEL(file)
|
||||
|
@ -2401,7 +2402,7 @@ UINT WINAPI CompareStringW(DWORD lcid, DWORD fdwStyle,
|
|||
l2 = (l2==-1)?lstrlenW(s2):l2;
|
||||
len = l1<l2 ? l1:l2;
|
||||
ret = (fdwStyle & NORM_IGNORECASE) ?
|
||||
lstrncmpiW(s1,s2,len) : lstrncmpW(s1,s2,len);
|
||||
CRTDLL__wcsnicmp(s1,s2,len) : CRTDLL_wcsncmp(s1,s2,len);
|
||||
/* not equal, return 1 or 3 */
|
||||
if(ret!=0) return ret+2;
|
||||
/* same len, return 2 */
|
||||
|
@ -2801,13 +2802,10 @@ static INT OLE_GetFormatW(LCID locale, DWORD flags, DWORD tflags,
|
|||
/* cat buf onto the output */
|
||||
outlen = lstrlenW(buf);
|
||||
if (outpos + buflen < outlen) {
|
||||
output[outpos] = 0; /* a "hook" for strcat */
|
||||
lstrcatW(output, buf);
|
||||
lstrcpyW( output + outpos, buf );
|
||||
outpos += buflen;
|
||||
} else {
|
||||
output[outpos] = 0;
|
||||
lstrcatnW(output, buf, outlen - outpos);
|
||||
output[outlen - 1] = 0;
|
||||
lstrcpynW( output + outpos, buf, outlen - outpos );
|
||||
Overflow = 1;
|
||||
break; /* Abnormal exit */
|
||||
}
|
||||
|
|
|
@ -207,14 +207,14 @@ UINT WINAPI ThunkConnect32(
|
|||
) {
|
||||
BOOL directionSL;
|
||||
|
||||
if (!lstrncmpA(TD->magic, "SL01", 4))
|
||||
if (!strncmp(TD->magic, "SL01", 4))
|
||||
{
|
||||
directionSL = TRUE;
|
||||
|
||||
TRACE_(thunk)("SL01 thunk %s (%lx) <- %s (%s), Reason: %ld\n",
|
||||
module32, (DWORD)TD, module16, thunkfun16, dwReason);
|
||||
}
|
||||
else if (!lstrncmpA(TD->magic, "LS01", 4))
|
||||
else if (!strncmp(TD->magic, "LS01", 4))
|
||||
{
|
||||
directionSL = FALSE;
|
||||
|
||||
|
|
Loading…
Reference in a new issue