Commit 0c631ebb authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Build with msvcrt.

parent e5c0e8e2
EXTRADEFS = -D_KERNEL32_ -D_NORMALIZE_ EXTRADEFS = -D_KERNEL32_ -D_NORMALIZE_
MODULE = kernel32.dll MODULE = kernel32.dll
IMPORTLIB = kernel32 IMPORTLIB = kernel32
IMPORTS = winecrt0 kernelbase ntdll IMPORTS = kernelbase ntdll winecrt0
EXTRADLLFLAGS = -nodefaultlibs -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b600000 EXTRADLLFLAGS = -mno-cygwin -nodefaultlibs -Wb,-F,KERNEL32.dll -Wl,--image-base,0x7b600000
C_SRCS = \ C_SRCS = \
atom.c \ atom.c \
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
...@@ -30,10 +27,10 @@ ...@@ -30,10 +27,10 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winerror.h" #include "winerror.h"
#include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "kernel_private.h" #include "kernel_private.h"
#define MAX_ATOM_LEN 255 #define MAX_ATOM_LEN 255
...@@ -170,7 +167,7 @@ ATOM WINAPI GlobalAddAtomW( LPCWSTR str ) ...@@ -170,7 +167,7 @@ ATOM WINAPI GlobalAddAtomW( LPCWSTR str )
if (!check_integral_atom( str, &atom )) if (!check_integral_atom( str, &atom ))
{ {
if (!set_ntstatus( NtAddAtom( str, strlenW( str ) * sizeof(WCHAR), &atom ))) return 0; if (!set_ntstatus( NtAddAtom( str, lstrlenW( str ) * sizeof(WCHAR), &atom ))) return 0;
} }
return atom; return atom;
} }
...@@ -302,7 +299,7 @@ ATOM WINAPI GlobalFindAtomW( LPCWSTR str ) ...@@ -302,7 +299,7 @@ ATOM WINAPI GlobalFindAtomW( LPCWSTR str )
if (!check_integral_atom( str, &atom )) if (!check_integral_atom( str, &atom ))
{ {
if (!set_ntstatus( NtFindAtom( str, strlenW( str ) * sizeof(WCHAR), &atom ))) return 0; if (!set_ntstatus( NtFindAtom( str, lstrlenW( str ) * sizeof(WCHAR), &atom ))) return 0;
} }
return atom; return atom;
} }
......
...@@ -18,21 +18,18 @@ ...@@ -18,21 +18,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h"
#include "winerror.h" #include "winerror.h"
#include "winioctl.h" #include "winioctl.h"
#include "ddk/ntddser.h" #include "ddk/ntddser.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
...@@ -50,7 +47,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr) ...@@ -50,7 +47,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr)
/* The device control string may optionally start with "COMx" followed /* The device control string may optionally start with "COMx" followed
by an optional ':' and spaces. */ by an optional ':' and spaces. */
if(!strncmpiW(ptr, comW, 3)) if(!wcsnicmp(ptr, comW, 3))
{ {
ptr += 3; ptr += 3;
...@@ -84,7 +81,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr) ...@@ -84,7 +81,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr)
static LPCWSTR COMM_ParseNumber(LPCWSTR ptr, LPDWORD lpnumber) static LPCWSTR COMM_ParseNumber(LPCWSTR ptr, LPDWORD lpnumber)
{ {
if(*ptr < '0' || *ptr > '9') return NULL; if(*ptr < '0' || *ptr > '9') return NULL;
*lpnumber = strtoulW(ptr, NULL, 10); *lpnumber = wcstoul(ptr, NULL, 10);
while(*ptr >= '0' && *ptr <= '9') ptr++; while(*ptr >= '0' && *ptr <= '9') ptr++;
return ptr; return ptr;
} }
...@@ -145,7 +142,7 @@ static LPCWSTR COMM_ParseStopBits(LPCWSTR ptr, LPBYTE lpstopbits) ...@@ -145,7 +142,7 @@ static LPCWSTR COMM_ParseStopBits(LPCWSTR ptr, LPBYTE lpstopbits)
DWORD temp; DWORD temp;
static const WCHAR stopbits15W[] = {'1','.','5',0}; static const WCHAR stopbits15W[] = {'1','.','5',0};
if(!strncmpW(stopbits15W, ptr, 3)) if(!wcsncmp(stopbits15W, ptr, 3))
{ {
ptr += 3; ptr += 3;
*lpstopbits = ONE5STOPBITS; *lpstopbits = ONE5STOPBITS;
...@@ -171,12 +168,12 @@ static LPCWSTR COMM_ParseOnOff(LPCWSTR ptr, LPDWORD lponoff) ...@@ -171,12 +168,12 @@ static LPCWSTR COMM_ParseOnOff(LPCWSTR ptr, LPDWORD lponoff)
static const WCHAR onW[] = {'o','n',0}; static const WCHAR onW[] = {'o','n',0};
static const WCHAR offW[] = {'o','f','f',0}; static const WCHAR offW[] = {'o','f','f',0};
if(!strncmpiW(onW, ptr, 2)) if(!wcsnicmp(onW, ptr, 2))
{ {
ptr += 2; ptr += 2;
*lponoff = 1; *lponoff = 1;
} }
else if(!strncmpiW(offW, ptr, 3)) else if(!wcsnicmp(offW, ptr, 3))
{ {
ptr += 3; ptr += 3;
*lponoff = 0; *lponoff = 0;
...@@ -314,31 +311,31 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt ...@@ -314,31 +311,31 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
{ {
while(*device == ' ') device++; while(*device == ' ') device++;
if(!strncmpiW(baudW, device, 5)) if(!wcsnicmp(baudW, device, 5))
{ {
baud = TRUE; baud = TRUE;
if(!(device = COMM_ParseNumber(device + 5, &lpdcb->BaudRate))) if(!(device = COMM_ParseNumber(device + 5, &lpdcb->BaudRate)))
return FALSE; return FALSE;
} }
else if(!strncmpiW(parityW, device, 7)) else if(!wcsnicmp(parityW, device, 7))
{ {
if(!(device = COMM_ParseParity(device + 7, &lpdcb->Parity))) if(!(device = COMM_ParseParity(device + 7, &lpdcb->Parity)))
return FALSE; return FALSE;
} }
else if(!strncmpiW(dataW, device, 5)) else if(!wcsnicmp(dataW, device, 5))
{ {
if(!(device = COMM_ParseByteSize(device + 5, &lpdcb->ByteSize))) if(!(device = COMM_ParseByteSize(device + 5, &lpdcb->ByteSize)))
return FALSE; return FALSE;
} }
else if(!strncmpiW(stopW, device, 5)) else if(!wcsnicmp(stopW, device, 5))
{ {
stop = TRUE; stop = TRUE;
if(!(device = COMM_ParseStopBits(device + 5, &lpdcb->StopBits))) if(!(device = COMM_ParseStopBits(device + 5, &lpdcb->StopBits)))
return FALSE; return FALSE;
} }
else if(!strncmpiW(toW, device, 3)) else if(!wcsnicmp(toW, device, 3))
{ {
if(!(device = COMM_ParseOnOff(device + 3, &temp))) if(!(device = COMM_ParseOnOff(device + 3, &temp)))
return FALSE; return FALSE;
...@@ -349,7 +346,7 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt ...@@ -349,7 +346,7 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
lptimeouts->WriteTotalTimeoutMultiplier = 0; lptimeouts->WriteTotalTimeoutMultiplier = 0;
lptimeouts->WriteTotalTimeoutConstant = temp ? 60000 : 0; lptimeouts->WriteTotalTimeoutConstant = temp ? 60000 : 0;
} }
else if(!strncmpiW(xonW, device, 4)) else if(!wcsnicmp(xonW, device, 4))
{ {
if(!(device = COMM_ParseOnOff(device + 4, &temp))) if(!(device = COMM_ParseOnOff(device + 4, &temp)))
return FALSE; return FALSE;
...@@ -357,35 +354,35 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt ...@@ -357,35 +354,35 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
lpdcb->fOutX = temp; lpdcb->fOutX = temp;
lpdcb->fInX = temp; lpdcb->fInX = temp;
} }
else if(!strncmpiW(odsrW, device, 5)) else if(!wcsnicmp(odsrW, device, 5))
{ {
if(!(device = COMM_ParseOnOff(device + 5, &temp))) if(!(device = COMM_ParseOnOff(device + 5, &temp)))
return FALSE; return FALSE;
lpdcb->fOutxDsrFlow = temp; lpdcb->fOutxDsrFlow = temp;
} }
else if(!strncmpiW(octsW, device, 5)) else if(!wcsnicmp(octsW, device, 5))
{ {
if(!(device = COMM_ParseOnOff(device + 5, &temp))) if(!(device = COMM_ParseOnOff(device + 5, &temp)))
return FALSE; return FALSE;
lpdcb->fOutxCtsFlow = temp; lpdcb->fOutxCtsFlow = temp;
} }
else if(!strncmpiW(dtrW, device, 4)) else if(!wcsnicmp(dtrW, device, 4))
{ {
if(!(device = COMM_ParseOnOff(device + 4, &temp))) if(!(device = COMM_ParseOnOff(device + 4, &temp)))
return FALSE; return FALSE;
lpdcb->fDtrControl = temp; lpdcb->fDtrControl = temp;
} }
else if(!strncmpiW(rtsW, device, 4)) else if(!wcsnicmp(rtsW, device, 4))
{ {
if(!(device = COMM_ParseOnOff(device + 4, &temp))) if(!(device = COMM_ParseOnOff(device + 4, &temp)))
return FALSE; return FALSE;
lpdcb->fRtsControl = temp; lpdcb->fRtsControl = temp;
} }
else if(!strncmpiW(idsrW, device, 5)) else if(!wcsnicmp(idsrW, device, 5))
{ {
if(!(device = COMM_ParseOnOff(device + 5, &temp))) if(!(device = COMM_ParseOnOff(device + 5, &temp)))
return FALSE; return FALSE;
...@@ -500,7 +497,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW( ...@@ -500,7 +497,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(
if(ptr == NULL) if(ptr == NULL)
result = FALSE; result = FALSE;
else if(strchrW(ptr, ',')) else if(wcschr(ptr, ','))
result = COMM_BuildOldCommDCB(ptr, &dcb); result = COMM_BuildOldCommDCB(ptr, &dcb);
else else
result = COMM_BuildNewCommDCB(ptr, &dcb, &timeouts); result = COMM_BuildNewCommDCB(ptr, &dcb, &timeouts);
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -34,7 +31,6 @@ ...@@ -34,7 +31,6 @@
#include "winerror.h" #include "winerror.h"
#include "winnls.h" #include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "wine/unicode.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "kernel_private.h" #include "kernel_private.h"
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "wine/condrv.h" #include "wine/condrv.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "excpt.h" #include "excpt.h"
#include "console_private.h" #include "console_private.h"
...@@ -81,7 +80,7 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat ...@@ -81,7 +80,7 @@ HANDLE WINAPI OpenConsoleW(LPCWSTR name, DWORD access, BOOL inherit, DWORD creat
TRACE("(%s, 0x%08x, %d, %u)\n", debugstr_w(name), access, inherit, creation); TRACE("(%s, 0x%08x, %d, %u)\n", debugstr_w(name), access, inherit, creation);
if (!name || (strcmpiW( coninW, name ) && strcmpiW( conoutW, name )) || creation != OPEN_EXISTING) if (!name || (wcsicmp( coninW, name ) && wcsicmp( conoutW, name )) || creation != OPEN_EXISTING)
{ {
SetLastError( ERROR_INVALID_PARAMETER ); SetLastError( ERROR_INVALID_PARAMETER );
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
...@@ -674,7 +673,7 @@ int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len) ...@@ -674,7 +673,7 @@ int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len)
*/ */
BOOL CONSOLE_AppendHistory(const WCHAR* ptr) BOOL CONSOLE_AppendHistory(const WCHAR* ptr)
{ {
size_t len = strlenW(ptr); size_t len = lstrlenW(ptr);
BOOL ret; BOOL ret;
while (len && (ptr[len - 1] == '\n' || ptr[len - 1] == '\r')) len--; while (len && (ptr[len - 1] == '\n' || ptr[len - 1] == '\r')) len--;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
...@@ -33,6 +32,8 @@ ...@@ -33,6 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(debugstr); WINE_DEFAULT_DEBUG_CHANNEL(debugstr);
void *dummy = RtlUnwind; /* force importing RtlUnwind from ntdll */
static LONG WINAPI debug_exception_handler( EXCEPTION_POINTERS *eptr ) static LONG WINAPI debug_exception_handler( EXCEPTION_POINTERS *eptr )
{ {
EXCEPTION_RECORD *rec = eptr->ExceptionRecord; EXCEPTION_RECORD *rec = eptr->ExceptionRecord;
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
...@@ -28,7 +25,6 @@ ...@@ -28,7 +25,6 @@
#include "winbase.h" #include "winbase.h"
#include "wincon.h" #include "wincon.h"
#include "winuser.h" #include "winuser.h"
#include "wine/unicode.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "console_private.h" #include "console_private.h"
......
...@@ -20,15 +20,9 @@ ...@@ -20,15 +20,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
...@@ -46,7 +40,6 @@ ...@@ -46,7 +40,6 @@
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);
...@@ -132,7 +125,7 @@ DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen ) ...@@ -132,7 +125,7 @@ DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen )
{ {
DWORD ret; DWORD ret;
if (srclen < 0) srclen = strlenW( src ) + 1; if (srclen < 0) srclen = lstrlenW( src ) + 1;
if (!destlen) if (!destlen)
{ {
if (!AreFileApisANSI()) if (!AreFileApisANSI())
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
...@@ -32,7 +29,7 @@ ...@@ -32,7 +29,7 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wine/unicode.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "winternl.h" #include "winternl.h"
...@@ -130,7 +127,7 @@ static WCHAR* NLS_GetLocaleString(LCID lcid, DWORD dwFlags) ...@@ -130,7 +127,7 @@ static WCHAR* NLS_GetLocaleString(LCID lcid, DWORD dwFlags)
szBuff[0] = '\0'; szBuff[0] = '\0';
GetLocaleInfoW(lcid, dwFlags, szBuff, ARRAY_SIZE(szBuff)); GetLocaleInfoW(lcid, dwFlags, szBuff, ARRAY_SIZE(szBuff));
dwLen = strlenW(szBuff) + 1; dwLen = lstrlenW(szBuff) + 1;
str = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR)); str = HeapAlloc(GetProcessHeap(), 0, dwLen * sizeof(WCHAR));
if (str) if (str)
memcpy(str, szBuff, dwLen * sizeof(WCHAR)); memcpy(str, szBuff, dwLen * sizeof(WCHAR));
...@@ -265,7 +262,7 @@ static const NLS_FORMAT_NODE *NLS_GetFormats(LCID lcid, DWORD dwFlags) ...@@ -265,7 +262,7 @@ static const NLS_FORMAT_NODE *NLS_GetFormats(LCID lcid, DWORD dwFlags)
/* Save some memory if month genitive name is the same or not present */ /* Save some memory if month genitive name is the same or not present */
for (i = 0; i < 12; i++) for (i = 0; i < 12; i++)
{ {
if (strcmpW(GetLongMonth(new_node, i), GetGenitiveMonth(new_node, i)) == 0) if (wcscmp(GetLongMonth(new_node, i), GetGenitiveMonth(new_node, i)) == 0)
{ {
HeapFree(GetProcessHeap(), 0, GetGenitiveMonth(new_node, i)); HeapFree(GetProcessHeap(), 0, GetGenitiveMonth(new_node, i));
GetGenitiveMonth(new_node, i) = NULL; GetGenitiveMonth(new_node, i) = NULL;
...@@ -677,10 +674,10 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags, ...@@ -677,10 +674,10 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags,
{ {
static const WCHAR fmtW[] = {'%','.','*','d',0}; static const WCHAR fmtW[] = {'%','.','*','d',0};
/* We have a numeric value to add */ /* We have a numeric value to add */
snprintfW(buff, ARRAY_SIZE(buff), fmtW, count, dwVal); swprintf(buff, ARRAY_SIZE(buff), fmtW, count, dwVal);
} }
dwLen = szAdd ? strlenW(szAdd) : 0; dwLen = szAdd ? lstrlenW(szAdd) : 0;
if (cchOut && dwLen) if (cchOut && dwLen)
{ {
...@@ -1143,7 +1140,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, ...@@ -1143,7 +1140,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
szNegBuff, ARRAY_SIZE(szNegBuff)); szNegBuff, ARRAY_SIZE(szNegBuff));
lpszNegStart = lpszNeg = szNegBuff; lpszNegStart = lpszNeg = szNegBuff;
} }
lpszNeg = lpszNeg + strlenW(lpszNeg) - 1; lpszNeg = lpszNeg + lstrlenW(lpszNeg) - 1;
dwFlags &= (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP); dwFlags &= (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);
...@@ -1218,7 +1215,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, ...@@ -1218,7 +1215,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
} }
else else
{ {
LPWSTR lpszDec = lpFormat->lpDecimalSep + strlenW(lpFormat->lpDecimalSep) - 1; LPWSTR lpszDec = lpFormat->lpDecimalSep + lstrlenW(lpFormat->lpDecimalSep) - 1;
if (dwDecimals <= lpFormat->NumDigits) if (dwDecimals <= lpFormat->NumDigits)
{ {
...@@ -1288,7 +1285,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, ...@@ -1288,7 +1285,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
dwCurrentGroupCount++; dwCurrentGroupCount++;
if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-') if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-')
{ {
LPWSTR lpszGrp = lpFormat->lpThousandSep + strlenW(lpFormat->lpThousandSep) - 1; LPWSTR lpszGrp = lpFormat->lpThousandSep + lstrlenW(lpFormat->lpThousandSep) - 1;
while (lpszGrp >= lpFormat->lpThousandSep) while (lpszGrp >= lpFormat->lpThousandSep)
*szOut-- = *lpszGrp--; /* Write grouping char */ *szOut-- = *lpszGrp--; /* Write grouping char */
...@@ -1324,7 +1321,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, ...@@ -1324,7 +1321,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
} }
szOut++; szOut++;
iRet = strlenW(szOut) + 1; iRet = lstrlenW(szOut) + 1;
if (cchOut) if (cchOut)
{ {
if (iRet <= cchOut) if (iRet <= cchOut)
...@@ -1538,9 +1535,9 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, ...@@ -1538,9 +1535,9 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
} }
dwFlags &= (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP); dwFlags &= (LOCALE_NOUSEROVERRIDE|LOCALE_USE_CP_ACP);
lpszNeg = lpszNeg + strlenW(lpszNeg) - 1; lpszNeg = lpszNeg + lstrlenW(lpszNeg) - 1;
lpszCyStart = lpFormat->lpCurrencySymbol; lpszCyStart = lpFormat->lpCurrencySymbol;
lpszCy = lpszCyStart + strlenW(lpszCyStart) - 1; lpszCy = lpszCyStart + lstrlenW(lpszCyStart) - 1;
/* Format the currency backwards into a temporary buffer */ /* Format the currency backwards into a temporary buffer */
...@@ -1627,7 +1624,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, ...@@ -1627,7 +1624,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
} }
else else
{ {
LPWSTR lpszDec = lpFormat->lpDecimalSep + strlenW(lpFormat->lpDecimalSep) - 1; LPWSTR lpszDec = lpFormat->lpDecimalSep + lstrlenW(lpFormat->lpDecimalSep) - 1;
if (dwDecimals <= lpFormat->NumDigits) if (dwDecimals <= lpFormat->NumDigits)
{ {
...@@ -1696,7 +1693,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, ...@@ -1696,7 +1693,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
dwCurrentGroupCount++; dwCurrentGroupCount++;
if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-') if (szSrc >= lpszValue && dwCurrentGroupCount == dwGroupCount && *szSrc != '-')
{ {
LPWSTR lpszGrp = lpFormat->lpThousandSep + strlenW(lpFormat->lpThousandSep) - 1; LPWSTR lpszGrp = lpFormat->lpThousandSep + lstrlenW(lpFormat->lpThousandSep) - 1;
while (lpszGrp >= lpFormat->lpThousandSep) while (lpszGrp >= lpFormat->lpThousandSep)
*szOut-- = *lpszGrp--; /* Write grouping char */ *szOut-- = *lpszGrp--; /* Write grouping char */
...@@ -1736,7 +1733,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags, ...@@ -1736,7 +1733,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
*szOut-- = '('; *szOut-- = '(';
szOut++; szOut++;
iRet = strlenW(szOut) + 1; iRet = lstrlenW(szOut) + 1;
if (cchOut) if (cchOut)
{ {
if (iRet <= cchOut) if (iRet <= cchOut)
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <locale.h> #include <locale.h>
#include <string.h> #include <string.h>
...@@ -37,7 +34,6 @@ ...@@ -37,7 +34,6 @@
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winternl.h" #include "winternl.h"
#include "wine/unicode.h"
#include "winnls.h" #include "winnls.h"
#include "winerror.h" #include "winerror.h"
#include "winver.h" #include "winver.h"
......
...@@ -33,23 +33,18 @@ ...@@ -33,23 +33,18 @@
* *
*/ */
#include "config.h"
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "lzexpand.h" #include "lzexpand.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);
...@@ -315,7 +310,7 @@ INT WINAPI GetExpandedNameW( LPWSTR in, LPWSTR out ) ...@@ -315,7 +310,7 @@ INT WINAPI GetExpandedNameW( LPWSTR in, LPWSTR out )
char *xout = HeapAlloc( GetProcessHeap(), 0, len+3 ); char *xout = HeapAlloc( GetProcessHeap(), 0, len+3 );
WideCharToMultiByte( CP_ACP, 0, in, -1, xin, len, NULL, NULL ); WideCharToMultiByte( CP_ACP, 0, in, -1, xin, len, NULL, NULL );
if ((ret = GetExpandedNameA( xin, xout )) > 0) if ((ret = GetExpandedNameA( xin, xout )) > 0)
MultiByteToWideChar( CP_ACP, 0, xout, -1, out, strlenW(in)+4 ); MultiByteToWideChar( CP_ACP, 0, xout, -1, out, lstrlenW(in)+4 );
HeapFree( GetProcessHeap(), 0, xin ); HeapFree( GetProcessHeap(), 0, xin );
HeapFree( GetProcessHeap(), 0, xout ); HeapFree( GetProcessHeap(), 0, xout );
return ret; return ret;
......
...@@ -18,18 +18,13 @@ ...@@ -18,18 +18,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "winerror.h" #include "winerror.h"
...@@ -43,7 +38,6 @@ ...@@ -43,7 +38,6 @@
#include "wine/list.h" #include "wine/list.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(module); WINE_DEFAULT_DEBUG_CHANNEL(module);
...@@ -230,14 +224,14 @@ BOOL WINAPI GetBinaryTypeW( LPCWSTR name, LPDWORD type ) ...@@ -230,14 +224,14 @@ BOOL WINAPI GetBinaryTypeW( LPCWSTR name, LPDWORD type )
*type = SCS_DOS_BINARY; *type = SCS_DOS_BINARY;
return TRUE; return TRUE;
case STATUS_INVALID_IMAGE_NOT_MZ: case STATUS_INVALID_IMAGE_NOT_MZ:
if ((ptr = strrchrW( name, '.' ))) if ((ptr = wcsrchr( name, '.' )))
{ {
if (!strcmpiW( ptr, comW )) if (!wcsicmp( ptr, comW ))
{ {
*type = SCS_DOS_BINARY; *type = SCS_DOS_BINARY;
return TRUE; return TRUE;
} }
if (!strcmpiW( ptr, pifW )) if (!wcsicmp( ptr, pifW ))
{ {
*type = SCS_PIF_BINARY; *type = SCS_PIF_BINARY;
return TRUE; return TRUE;
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* *
*/ */
#include "config.h"
#include "wine/port.h"
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -33,10 +30,10 @@ ...@@ -33,10 +30,10 @@
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(file); WINE_DEFAULT_DEBUG_CHANNEL(file);
...@@ -235,10 +232,10 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU ...@@ -235,10 +232,10 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU
*/ */
UINT WINAPI GetSystemDirectoryW( LPWSTR path, UINT count ) UINT WINAPI GetSystemDirectoryW( LPWSTR path, UINT count )
{ {
UINT len = strlenW( DIR_System ) + 1; UINT len = lstrlenW( DIR_System ) + 1;
if (path && count >= len) if (path && count >= len)
{ {
strcpyW( path, DIR_System ); lstrcpyW( path, DIR_System );
len--; len--;
} }
return len; return len;
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
...@@ -28,33 +25,17 @@ ...@@ -28,33 +25,17 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h" #include "ntstatus.h"
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include "winternl.h" #include "winternl.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h"
#include "wincon.h" #include "wincon.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "psapi.h" #include "psapi.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/server.h" #include "wine/server.h"
#include "wine/unicode.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/debug.h" #include "wine/debug.h"
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -32,7 +29,6 @@ ...@@ -32,7 +29,6 @@
#include "winreg.h" #include "winreg.h"
#include "winternl.h" #include "winternl.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(profile); WINE_DEFAULT_DEBUG_CHANNEL(profile);
...@@ -110,11 +106,11 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len ) ...@@ -110,11 +106,11 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len )
if (*value == '\'' || *value == '\"') if (*value == '\'' || *value == '\"')
{ {
if (value[1] && (value[strlenW(value)-1] == *value)) quote = *value++; if (value[1] && (value[lstrlenW(value)-1] == *value)) quote = *value++;
} }
lstrcpynW( buffer, value, len ); lstrcpynW( buffer, value, len );
if (quote && (len >= lstrlenW(value))) buffer[strlenW(buffer)-1] = '\0'; if (quote && (len >= lstrlenW(value))) buffer[lstrlenW(buffer)-1] = '\0';
} }
/* byte-swaps shorts in-place in a buffer. len is in WCHARs */ /* byte-swaps shorts in-place in a buffer. len is in WCHARs */
...@@ -203,12 +199,12 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING ...@@ -203,12 +199,12 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
{ {
int len = 0; int len = 0;
if (section->name[0]) len += strlenW(section->name) + 4; if (section->name[0]) len += lstrlenW(section->name) + 4;
for (key = section->key; key; key = key->next) for (key = section->key; key; key = key->next)
{ {
len += strlenW(key->name) + 2; len += lstrlenW(key->name) + 2;
if (key->value) len += strlenW(key->value) + 1; if (key->value) len += lstrlenW(key->value) + 1;
} }
buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
...@@ -218,8 +214,8 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING ...@@ -218,8 +214,8 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
if (section->name[0]) if (section->name[0])
{ {
*p++ = '['; *p++ = '[';
strcpyW( p, section->name ); lstrcpyW( p, section->name );
p += strlenW(p); p += lstrlenW(p);
*p++ = ']'; *p++ = ']';
*p++ = '\r'; *p++ = '\r';
*p++ = '\n'; *p++ = '\n';
...@@ -227,13 +223,13 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING ...@@ -227,13 +223,13 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
for (key = section->key; key; key = key->next) for (key = section->key; key; key = key->next)
{ {
strcpyW( p, key->name ); lstrcpyW( p, key->name );
p += strlenW(p); p += lstrlenW(p);
if (key->value) if (key->value)
{ {
*p++ = '='; *p++ = '=';
strcpyW( p, key->value ); lstrcpyW( p, key->value );
p += strlenW(p); p += lstrlenW(p);
} }
*p++ = '\r'; *p++ = '\r';
*p++ = '\n'; *p++ = '\n';
...@@ -499,12 +495,12 @@ static BOOL PROFILE_DeleteKey( PROFILESECTION **section, ...@@ -499,12 +495,12 @@ static BOOL PROFILE_DeleteKey( PROFILESECTION **section,
{ {
while (*section) while (*section)
{ {
if (!strcmpiW( (*section)->name, section_name )) if (!wcsicmp( (*section)->name, section_name ))
{ {
PROFILEKEY **key = &(*section)->key; PROFILEKEY **key = &(*section)->key;
while (*key) while (*key)
{ {
if (!strcmpiW( (*key)->name, key_name )) if (!wcsicmp( (*key)->name, key_name ))
{ {
PROFILEKEY *to_del = *key; PROFILEKEY *to_del = *key;
*key = to_del->next; *key = to_del->next;
...@@ -531,7 +527,7 @@ static void PROFILE_DeleteAllKeys( LPCWSTR section_name) ...@@ -531,7 +527,7 @@ static void PROFILE_DeleteAllKeys( LPCWSTR section_name)
PROFILESECTION **section= &CurProfile->section; PROFILESECTION **section= &CurProfile->section;
while (*section) while (*section)
{ {
if (!strcmpiW( (*section)->name, section_name )) if (!wcsicmp( (*section)->name, section_name ))
{ {
PROFILEKEY **key = &(*section)->key; PROFILEKEY **key = &(*section)->key;
while (*key) while (*key)
...@@ -562,7 +558,7 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name, ...@@ -562,7 +558,7 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
while (PROFILE_isspaceW(*section_name)) section_name++; while (PROFILE_isspaceW(*section_name)) section_name++;
if (*section_name) if (*section_name)
{ {
p = section_name + strlenW(section_name) - 1; p = section_name + lstrlenW(section_name) - 1;
while ((p > section_name) && PROFILE_isspaceW(*p)) p--; while ((p > section_name) && PROFILE_isspaceW(*p)) p--;
seclen = p - section_name + 1; seclen = p - section_name + 1;
} }
...@@ -570,14 +566,14 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name, ...@@ -570,14 +566,14 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
while (PROFILE_isspaceW(*key_name)) key_name++; while (PROFILE_isspaceW(*key_name)) key_name++;
if (*key_name) if (*key_name)
{ {
p = key_name + strlenW(key_name) - 1; p = key_name + lstrlenW(key_name) - 1;
while ((p > key_name) && PROFILE_isspaceW(*p)) p--; while ((p > key_name) && PROFILE_isspaceW(*p)) p--;
keylen = p - key_name + 1; keylen = p - key_name + 1;
} }
while (*section) while (*section)
{ {
if (!strncmpiW((*section)->name, section_name, seclen) && if (!wcsnicmp((*section)->name, section_name, seclen) &&
((*section)->name)[seclen] == '\0') ((*section)->name)[seclen] == '\0')
{ {
PROFILEKEY **key = &(*section)->key; PROFILEKEY **key = &(*section)->key;
...@@ -591,16 +587,16 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name, ...@@ -591,16 +587,16 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
*/ */
if(!create_always) if(!create_always)
{ {
if ( (!(strncmpiW( (*key)->name, key_name, keylen ))) if ( (!(wcsnicmp( (*key)->name, key_name, keylen )))
&& (((*key)->name)[keylen] == '\0') ) && (((*key)->name)[keylen] == '\0') )
return *key; return *key;
} }
key = &(*key)->next; key = &(*key)->next;
} }
if (!create) return NULL; if (!create) return NULL;
if (!(*key = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILEKEY) + strlenW(key_name) * sizeof(WCHAR) ))) if (!(*key = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILEKEY) + lstrlenW(key_name) * sizeof(WCHAR) )))
return NULL; return NULL;
strcpyW( (*key)->name, key_name ); lstrcpyW( (*key)->name, key_name );
(*key)->value = NULL; (*key)->value = NULL;
(*key)->next = NULL; (*key)->next = NULL;
return *key; return *key;
...@@ -608,17 +604,17 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name, ...@@ -608,17 +604,17 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
section = &(*section)->next; section = &(*section)->next;
} }
if (!create) return NULL; if (!create) return NULL;
*section = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILESECTION) + strlenW(section_name) * sizeof(WCHAR) ); *section = HeapAlloc( GetProcessHeap(), 0, sizeof(PROFILESECTION) + lstrlenW(section_name) * sizeof(WCHAR) );
if(*section == NULL) return NULL; if(*section == NULL) return NULL;
strcpyW( (*section)->name, section_name ); lstrcpyW( (*section)->name, section_name );
(*section)->next = NULL; (*section)->next = NULL;
if (!((*section)->key = HeapAlloc( GetProcessHeap(), 0, if (!((*section)->key = HeapAlloc( GetProcessHeap(), 0,
sizeof(PROFILEKEY) + strlenW(key_name) * sizeof(WCHAR) ))) sizeof(PROFILEKEY) + lstrlenW(key_name) * sizeof(WCHAR) )))
{ {
HeapFree(GetProcessHeap(), 0, *section); HeapFree(GetProcessHeap(), 0, *section);
return NULL; return NULL;
} }
strcpyW( (*section)->key->name, key_name ); lstrcpyW( (*section)->key->name, key_name );
(*section)->key->value = NULL; (*section)->key->value = NULL;
(*section)->key->next = NULL; (*section)->key->next = NULL;
return (*section)->key; return (*section)->key;
...@@ -732,14 +728,14 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access ) ...@@ -732,14 +728,14 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
filename = wininiW; filename = wininiW;
if ((RtlDetermineDosPathNameType_U(filename) == RELATIVE_PATH) && if ((RtlDetermineDosPathNameType_U(filename) == RELATIVE_PATH) &&
!strchrW(filename, '\\') && !strchrW(filename, '/')) !wcschr(filename, '\\') && !wcschr(filename, '/'))
{ {
static const WCHAR wszSeparator[] = {'\\', 0}; static const WCHAR wszSeparator[] = {'\\', 0};
WCHAR windirW[MAX_PATH]; WCHAR windirW[MAX_PATH];
GetWindowsDirectoryW( windirW, MAX_PATH ); GetWindowsDirectoryW( windirW, MAX_PATH );
strcpyW(buffer, windirW); lstrcpyW(buffer, windirW);
strcatW(buffer, wszSeparator); lstrcatW(buffer, wszSeparator);
strcatW(buffer, filename); lstrcatW(buffer, filename);
} }
else else
{ {
...@@ -761,7 +757,7 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access ) ...@@ -761,7 +757,7 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
for(i=0;i<N_CACHED_PROFILES;i++) for(i=0;i<N_CACHED_PROFILES;i++)
{ {
if ((MRUProfile[i]->filename && !strcmpiW( buffer, MRUProfile[i]->filename ))) if ((MRUProfile[i]->filename && !wcsicmp( buffer, MRUProfile[i]->filename )))
{ {
TRACE("MRU Filename: %s, new filename: %s\n", debugstr_w(MRUProfile[i]->filename), debugstr_w(buffer)); TRACE("MRU Filename: %s, new filename: %s\n", debugstr_w(MRUProfile[i]->filename), debugstr_w(buffer));
if(i) if(i)
...@@ -810,8 +806,8 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access ) ...@@ -810,8 +806,8 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
if(CurProfile->filename) PROFILE_ReleaseFile(); if(CurProfile->filename) PROFILE_ReleaseFile();
/* OK, now that CurProfile is definitely free we assign it our new file */ /* OK, now that CurProfile is definitely free we assign it our new file */
CurProfile->filename = HeapAlloc( GetProcessHeap(), 0, (strlenW(buffer)+1) * sizeof(WCHAR) ); CurProfile->filename = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(buffer)+1) * sizeof(WCHAR) );
strcpyW( CurProfile->filename, buffer ); lstrcpyW( CurProfile->filename, buffer );
if (hFile != INVALID_HANDLE_VALUE) if (hFile != INVALID_HANDLE_VALUE)
{ {
...@@ -855,7 +851,7 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name, ...@@ -855,7 +851,7 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name,
for (section = CurProfile->section; section; section = section->next) for (section = CurProfile->section; section; section = section->next)
{ {
if (!strcmpiW( section->name, section_name )) if (!wcsicmp( section->name, section_name ))
{ {
UINT oldlen = len; UINT oldlen = len;
for (key = section->key; key; key = key->next) for (key = section->key; key; key = key->next)
...@@ -865,15 +861,15 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name, ...@@ -865,15 +861,15 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name,
if (IS_ENTRY_COMMENT(key->name)) continue; /* Skip comments */ if (IS_ENTRY_COMMENT(key->name)) continue; /* Skip comments */
if (!return_values && !key->value) continue; /* Skip lines w.o. '=' */ if (!return_values && !key->value) continue; /* Skip lines w.o. '=' */
lstrcpynW( buffer, key->name, len - 1 ); lstrcpynW( buffer, key->name, len - 1 );
len -= strlenW(buffer) + 1; len -= lstrlenW(buffer) + 1;
buffer += strlenW(buffer) + 1; buffer += lstrlenW(buffer) + 1;
if (len < 2) if (len < 2)
break; break;
if (return_values && key->value) { if (return_values && key->value) {
buffer[-1] = '='; buffer[-1] = '=';
lstrcpynW( buffer, key->value, len - 1 ); lstrcpynW( buffer, key->value, len - 1 );
len -= strlenW(buffer) + 1; len -= lstrlenW(buffer) + 1;
buffer += strlenW(buffer) + 1; buffer += lstrlenW(buffer) + 1;
} }
} }
*buffer = '\0'; *buffer = '\0';
...@@ -914,7 +910,7 @@ static BOOL PROFILE_DeleteSection( const WCHAR *filename, const WCHAR *name ) ...@@ -914,7 +910,7 @@ static BOOL PROFILE_DeleteSection( const WCHAR *filename, const WCHAR *name )
for (section = &CurProfile->section; *section; section = &(*section)->next) for (section = &CurProfile->section; *section; section = &(*section)->next)
{ {
if (!strcmpiW( (*section)->name, name )) if (!wcsicmp( (*section)->name, name ))
{ {
PROFILESECTION *to_del = *section; PROFILESECTION *to_del = *section;
*section = to_del->next; *section = to_del->next;
...@@ -952,7 +948,7 @@ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len ) ...@@ -952,7 +948,7 @@ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len )
section = CurProfile->section; section = CurProfile->section;
while ((section!=NULL)) { while ((section!=NULL)) {
if (section->name[0]) { if (section->name[0]) {
tmplen = strlenW(section->name)+1; tmplen = lstrlenW(section->name)+1;
if (tmplen >= buflen) { if (tmplen >= buflen) {
if (buflen > 0) { if (buflen > 0) {
memcpy(buf, section->name, (buflen-1) * sizeof(WCHAR)); memcpy(buf, section->name, (buflen-1) * sizeof(WCHAR));
...@@ -1001,7 +997,7 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name, ...@@ -1001,7 +997,7 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name,
if (key->value) if (key->value)
{ {
if (!strcmpW( key->value, value )) if (!wcscmp( key->value, value ))
{ {
TRACE(" no change needed\n" ); TRACE(" no change needed\n" );
return TRUE; /* No change needed */ return TRUE; /* No change needed */
...@@ -1010,8 +1006,8 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name, ...@@ -1010,8 +1006,8 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name,
HeapFree( GetProcessHeap(), 0, key->value ); HeapFree( GetProcessHeap(), 0, key->value );
} }
else TRACE(" creating key\n" ); else TRACE(" creating key\n" );
key->value = HeapAlloc( GetProcessHeap(), 0, (strlenW(value)+1) * sizeof(WCHAR) ); key->value = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(value)+1) * sizeof(WCHAR) );
strcpyW( key->value, value ); lstrcpyW( key->value, value );
CurProfile->changed = TRUE; CurProfile->changed = TRUE;
} }
return TRUE; return TRUE;
...@@ -1090,7 +1086,7 @@ static HKEY open_mapped_key( const WCHAR *path, BOOL write ) ...@@ -1090,7 +1086,7 @@ static HKEY open_mapped_key( const WCHAR *path, BOOL write )
for (p = path; strchr("!#@", *p); p++) for (p = path; strchr("!#@", *p); p++)
FIXME("ignoring %c modifier\n", *p); FIXME("ignoring %c modifier\n", *p);
if (!strncmpW( p, usrW, ARRAY_SIZE( usrW ) )) if (!wcsncmp( p, usrW, ARRAY_SIZE( usrW ) ))
{ {
if (write) if (write)
res = RegCreateKeyExW( HKEY_CURRENT_USER, p + 4, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &key, NULL ); res = RegCreateKeyExW( HKEY_CURRENT_USER, p + 4, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &key, NULL );
...@@ -1099,14 +1095,14 @@ static HKEY open_mapped_key( const WCHAR *path, BOOL write ) ...@@ -1099,14 +1095,14 @@ static HKEY open_mapped_key( const WCHAR *path, BOOL write )
return res ? NULL : key; return res ? NULL : key;
} }
if (!strncmpW( p, sysW, ARRAY_SIZE( sysW ) )) if (!wcsncmp( p, sysW, ARRAY_SIZE( sysW ) ))
{ {
p += 4; p += 4;
if (!(combined_path = HeapAlloc( GetProcessHeap(), 0, if (!(combined_path = HeapAlloc( GetProcessHeap(), 0,
(ARRAY_SIZE( softwareW ) + strlenW( p )) * sizeof(WCHAR) ))) (ARRAY_SIZE( softwareW ) + lstrlenW( p )) * sizeof(WCHAR) )))
return NULL; return NULL;
strcpyW( combined_path, softwareW ); lstrcpyW( combined_path, softwareW );
strcatW( combined_path, p ); lstrcatW( combined_path, p );
if (write) if (write)
res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, combined_path, 0, NULL, res = RegCreateKeyExW( HKEY_LOCAL_MACHINE, combined_path, 0, NULL,
0, KEY_READ | KEY_WRITE, NULL, &key, NULL ); 0, KEY_READ | KEY_WRITE, NULL, &key, NULL );
...@@ -1146,11 +1142,11 @@ static BOOL get_mapped_section_key( const WCHAR *filename, const WCHAR *section, ...@@ -1146,11 +1142,11 @@ static BOOL get_mapped_section_key( const WCHAR *filename, const WCHAR *section,
if ((path = get_key_value( key, NULL ))) if ((path = get_key_value( key, NULL )))
{ {
if ((combined_path = HeapAlloc( GetProcessHeap(), 0, if ((combined_path = HeapAlloc( GetProcessHeap(), 0,
(strlenW( path ) + strlenW( section ) + 2) * sizeof(WCHAR) ))) (lstrlenW( path ) + lstrlenW( section ) + 2) * sizeof(WCHAR) )))
{ {
strcpyW( combined_path, path ); lstrcpyW( combined_path, path );
strcatW( combined_path, backslashW ); lstrcatW( combined_path, backslashW );
strcatW( combined_path, section ); lstrcatW( combined_path, section );
} }
HeapFree( GetProcessHeap(), 0, path ); HeapFree( GetProcessHeap(), 0, path );
path = combined_path; path = combined_path;
...@@ -1173,12 +1169,12 @@ static DWORD get_mapped_section( HKEY key, WCHAR *buffer, DWORD size, BOOL retur ...@@ -1173,12 +1169,12 @@ static DWORD get_mapped_section( HKEY key, WCHAR *buffer, DWORD size, BOOL retur
for (i = 0; (entry = enum_key( key, i )); ++i) for (i = 0; (entry = enum_key( key, i )); ++i)
{ {
lstrcpynW( buffer + ret, entry, size - ret - 1 ); lstrcpynW( buffer + ret, entry, size - ret - 1 );
ret = min( ret + strlenW( entry ) + 1, size - 1 ); ret = min( ret + lstrlenW( entry ) + 1, size - 1 );
if (return_values && ret < size - 1 && (value = get_key_value( key, entry ))) if (return_values && ret < size - 1 && (value = get_key_value( key, entry )))
{ {
buffer[ret - 1] = '='; buffer[ret - 1] = '=';
lstrcpynW( buffer + ret, value, size - ret - 1 ); lstrcpynW( buffer + ret, value, size - ret - 1 );
ret = min( ret + strlenW( value ) + 1, size - 1 ); ret = min( ret + lstrlenW( value ) + 1, size - 1 );
HeapFree( GetProcessHeap(), 0, value ); HeapFree( GetProcessHeap(), 0, value );
} }
HeapFree( GetProcessHeap(), 0, entry ); HeapFree( GetProcessHeap(), 0, entry );
...@@ -1224,12 +1220,12 @@ static DWORD get_section( const WCHAR *filename, const WCHAR *section, ...@@ -1224,12 +1220,12 @@ static DWORD get_section( const WCHAR *filename, const WCHAR *section,
if ((value = get_key_value( entry_key, entry ))) if ((value = get_key_value( entry_key, entry )))
{ {
lstrcpynW( buffer + ret, entry, size - ret - 1 ); lstrcpynW( buffer + ret, entry, size - ret - 1 );
ret = min( ret + strlenW( entry ) + 1, size - 1 ); ret = min( ret + lstrlenW( entry ) + 1, size - 1 );
if (return_values && ret < size - 1) if (return_values && ret < size - 1)
{ {
buffer[ret - 1] = '='; buffer[ret - 1] = '=';
lstrcpynW( buffer + ret, value, size - ret - 1 ); lstrcpynW( buffer + ret, value, size - ret - 1 );
ret = min( ret + strlenW( value ) + 1, size - 1 ); ret = min( ret + lstrlenW( value ) + 1, size - 1 );
} }
HeapFree( GetProcessHeap(), 0, value ); HeapFree( GetProcessHeap(), 0, value );
} }
...@@ -1368,13 +1364,13 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry, ...@@ -1368,13 +1364,13 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
if (!buffer[0]) if (!buffer[0])
{ {
PROFILE_CopyEntry( buffer, def_val, len ); PROFILE_CopyEntry( buffer, def_val, len );
ret = strlenW( buffer ); ret = lstrlenW( buffer );
} }
return ret; return ret;
} }
/* strip any trailing ' ' of def_val. */ /* strip any trailing ' ' of def_val. */
p = def_val + strlenW(def_val) - 1; p = def_val + lstrlenW(def_val) - 1;
while (p > def_val && *p == ' ') p--; while (p > def_val && *p == ' ') p--;
...@@ -1407,7 +1403,7 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry, ...@@ -1407,7 +1403,7 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
else else
lstrcpynW( buffer, def_val, len ); lstrcpynW( buffer, def_val, len );
ret = strlenW( buffer ); ret = lstrlenW( buffer );
} }
else else
{ {
...@@ -1418,12 +1414,12 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry, ...@@ -1418,12 +1414,12 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
PROFILEKEY *key = PROFILE_Find( &CurProfile->section, section, entry, FALSE, FALSE ); PROFILEKEY *key = PROFILE_Find( &CurProfile->section, section, entry, FALSE, FALSE );
PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val, len ); PROFILE_CopyEntry( buffer, (key && key->value) ? key->value : def_val, len );
TRACE("-> %s\n", debugstr_w( buffer )); TRACE("-> %s\n", debugstr_w( buffer ));
ret = strlenW( buffer ); ret = lstrlenW( buffer );
} }
else else
{ {
lstrcpynW( buffer, def_val, len ); lstrcpynW( buffer, def_val, len );
ret = strlenW( buffer ); ret = lstrlenW( buffer );
} }
LeaveCriticalSection( &PROFILE_CritSect ); LeaveCriticalSection( &PROFILE_CritSect );
...@@ -1675,7 +1671,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry, ...@@ -1675,7 +1671,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
if (string) if (string)
res = RegSetValueExW( key, entry, 0, REG_SZ, (const BYTE *)string, res = RegSetValueExW( key, entry, 0, REG_SZ, (const BYTE *)string,
(strlenW( string ) + 1) * sizeof(WCHAR) ); (lstrlenW( string ) + 1) * sizeof(WCHAR) );
else else
res = RegDeleteValueW( key, entry ); res = RegDeleteValueW( key, entry );
RegCloseKey( key ); RegCloseKey( key );
...@@ -1754,9 +1750,9 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, ...@@ -1754,9 +1750,9 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
const WCHAR *entry, *p; const WCHAR *entry, *p;
for (entry = string; *entry; entry += strlenW( entry ) + 1) for (entry = string; *entry; entry += lstrlenW( entry ) + 1)
{ {
if ((p = strchrW( entry, '=' ))) if ((p = wcschr( entry, '=' )))
{ {
WCHAR *entry_copy; WCHAR *entry_copy;
p++; p++;
...@@ -1770,7 +1766,7 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, ...@@ -1770,7 +1766,7 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
if (get_mapped_section_key( filename, section, entry_copy, TRUE, &section_key )) if (get_mapped_section_key( filename, section, entry_copy, TRUE, &section_key ))
{ {
LSTATUS res = RegSetValueExW( section_key, entry_copy, 0, REG_SZ, (const BYTE *)p, LSTATUS res = RegSetValueExW( section_key, entry_copy, 0, REG_SZ, (const BYTE *)p,
(strlenW( p ) + 1) * sizeof(WCHAR) ); (lstrlenW( p ) + 1) * sizeof(WCHAR) );
RegCloseKey( section_key ); RegCloseKey( section_key );
if (res) if (res)
{ {
...@@ -1795,15 +1791,15 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, ...@@ -1795,15 +1791,15 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
ret = TRUE; ret = TRUE;
while (*string && ret) while (*string && ret)
{ {
WCHAR *buf = HeapAlloc( GetProcessHeap(), 0, (strlenW( string ) + 1) * sizeof(WCHAR) ); WCHAR *buf = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( string ) + 1) * sizeof(WCHAR) );
strcpyW( buf, string ); lstrcpyW( buf, string );
if ((p = strchrW( buf, '='))) if ((p = wcschr( buf, '=')))
{ {
*p = '\0'; *p = '\0';
ret = PROFILE_SetString( section, buf, p+1, TRUE ); ret = PROFILE_SetString( section, buf, p+1, TRUE );
} }
HeapFree( GetProcessHeap(), 0, buf ); HeapFree( GetProcessHeap(), 0, buf );
string += strlenW( string ) + 1; string += lstrlenW( string ) + 1;
} }
if (ret) ret = PROFILE_FlushFile(); if (ret) ret = PROFILE_FlushFile();
} }
...@@ -1917,7 +1913,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size, ...@@ -1917,7 +1913,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size,
for (i = 0; (section = enum_key( key, i )); ++i) for (i = 0; (section = enum_key( key, i )); ++i)
{ {
lstrcpynW( buffer + ret, section, size - ret - 1 ); lstrcpynW( buffer + ret, section, size - ret - 1 );
ret = min( ret + strlenW( section ) + 1, size - 1 ); ret = min( ret + lstrlenW( section ) + 1, size - 1 );
HeapFree( GetProcessHeap(), 0, section ); HeapFree( GetProcessHeap(), 0, section );
} }
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#define NONAMELESSUNION #define NONAMELESSUNION
...@@ -34,7 +31,6 @@ ...@@ -34,7 +31,6 @@
#include "winternl.h" #include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/list.h" #include "wine/list.h"
#include "kernel_private.h" #include "kernel_private.h"
...@@ -213,7 +209,7 @@ static int resource_strcmp( LPCWSTR a, LPCWSTR b ) ...@@ -213,7 +209,7 @@ static int resource_strcmp( LPCWSTR a, LPCWSTR b )
if ( a == b ) if ( a == b )
return 0; return 0;
if (!IS_INTRESOURCE( a ) && !IS_INTRESOURCE( b ) ) if (!IS_INTRESOURCE( a ) && !IS_INTRESOURCE( b ) )
return lstrcmpW( a, b ); return wcscmp( a, b );
/* strings come before ids */ /* strings come before ids */
if (!IS_INTRESOURCE( a ) && IS_INTRESOURCE( b )) if (!IS_INTRESOURCE( a ) && IS_INTRESOURCE( b ))
return -1; return -1;
......
...@@ -18,13 +18,7 @@ ...@@ -18,13 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
...@@ -42,7 +36,6 @@ ...@@ -42,7 +36,6 @@
#include "ddk/wdm.h" #include "ddk/wdm.h"
#include "wine/asm.h" #include "wine/asm.h"
#include "wine/unicode.h"
#include "kernel_private.h" #include "kernel_private.h"
#include "wine/debug.h" #include "wine/debug.h"
......
...@@ -3901,7 +3901,7 @@ static void test_wow64_redirection(void) ...@@ -3901,7 +3901,7 @@ static void test_wow64_redirection(void)
ok(pWow64RevertWow64FsRedirection(OldValue), "Re-enabling FS redirection failed\n"); ok(pWow64RevertWow64FsRedirection(OldValue), "Re-enabling FS redirection failed\n");
} }
static void test_dll_file( const char *name, BOOL is_todo ) static void test_dll_file( const char *name )
{ {
HMODULE module = GetModuleHandleA( name ); HMODULE module = GetModuleHandleA( name );
IMAGE_NT_HEADERS *nt, *nt_file; IMAGE_NT_HEADERS *nt, *nt_file;
...@@ -3926,29 +3926,17 @@ static void test_dll_file( const char *name, BOOL is_todo ) ...@@ -3926,29 +3926,17 @@ static void test_dll_file( const char *name, BOOL is_todo )
nt_file = pRtlImageNtHeader( ptr ); nt_file = pRtlImageNtHeader( ptr );
ok( nt_file != NULL, "%s: invalid header\n", path ); ok( nt_file != NULL, "%s: invalid header\n", path );
#define OK_FIELD(x) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " %x / %x\n", name, i, nt->x, nt_file->x ) #define OK_FIELD(x) ok( nt->x == nt_file->x, "%s:%u: wrong " #x " %x / %x\n", name, i, nt->x, nt_file->x )
todo_wine_if(is_todo)
OK_FIELD( FileHeader.NumberOfSections ); OK_FIELD( FileHeader.NumberOfSections );
todo_wine_if(is_todo)
OK_FIELD( OptionalHeader.AddressOfEntryPoint ); OK_FIELD( OptionalHeader.AddressOfEntryPoint );
OK_FIELD( OptionalHeader.NumberOfRvaAndSizes ); OK_FIELD( OptionalHeader.NumberOfRvaAndSizes );
for (i = 0; i < nt->OptionalHeader.NumberOfRvaAndSizes; i++) for (i = 0; i < nt->OptionalHeader.NumberOfRvaAndSizes; i++)
{ {
todo_wine_if( is_todo &&
(i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
(i == IMAGE_DIRECTORY_ENTRY_IMPORT && nt->OptionalHeader.DataDirectory[i].Size) ||
i == IMAGE_DIRECTORY_ENTRY_RESOURCE ||
i == IMAGE_DIRECTORY_ENTRY_BASERELOC ))
OK_FIELD( OptionalHeader.DataDirectory[i].VirtualAddress ); OK_FIELD( OptionalHeader.DataDirectory[i].VirtualAddress );
todo_wine_if( is_todo &&
(i == IMAGE_DIRECTORY_ENTRY_EXPORT ||
(i == IMAGE_DIRECTORY_ENTRY_IMPORT && nt->OptionalHeader.DataDirectory[i].Size) ||
i == IMAGE_DIRECTORY_ENTRY_BASERELOC ))
OK_FIELD( OptionalHeader.DataDirectory[i].Size ); OK_FIELD( OptionalHeader.DataDirectory[i].Size );
} }
sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader); sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader);
sec_file = (IMAGE_SECTION_HEADER *)((char *)&nt_file->OptionalHeader + nt_file->FileHeader.SizeOfOptionalHeader); sec_file = (IMAGE_SECTION_HEADER *)((char *)&nt_file->OptionalHeader + nt_file->FileHeader.SizeOfOptionalHeader);
for (i = 0; i < nt->FileHeader.NumberOfSections; i++) for (i = 0; i < nt->FileHeader.NumberOfSections; i++)
todo_wine_if(is_todo)
ok( !memcmp( sec + i, sec_file + i, sizeof(*sec) ), "%s: wrong section %d\n", name, i ); ok( !memcmp( sec + i, sec_file + i, sizeof(*sec) ), "%s: wrong section %d\n", name, i );
UnmapViewOfFile( ptr ); UnmapViewOfFile( ptr );
#undef OK_FIELD #undef OK_FIELD
...@@ -4042,10 +4030,10 @@ START_TEST(loader) ...@@ -4042,10 +4030,10 @@ START_TEST(loader)
test_InMemoryOrderModuleList(); test_InMemoryOrderModuleList();
test_LoadPackagedLibrary(); test_LoadPackagedLibrary();
test_wow64_redirection(); test_wow64_redirection();
test_dll_file( "ntdll.dll", FALSE ); test_dll_file( "ntdll.dll" );
test_dll_file( "kernel32.dll", TRUE ); test_dll_file( "kernel32.dll" );
test_dll_file( "advapi32.dll", FALSE ); test_dll_file( "advapi32.dll" );
test_dll_file( "user32.dll", FALSE ); test_dll_file( "user32.dll" );
/* loader test must be last, it can corrupt the internal loader state on Windows */ /* loader test must be last, it can corrupt the internal loader state on Windows */
test_Loader(); test_Loader();
} }
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/types.h> #include <sys/types.h>
......
...@@ -19,14 +19,9 @@ ...@@ -19,14 +19,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>
#include "ntstatus.h" #include "ntstatus.h"
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -36,7 +33,6 @@ ...@@ -36,7 +33,6 @@
#include "winuser.h" #include "winuser.h"
#include "winternl.h" #include "winternl.h"
#include "winerror.h" #include "winerror.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ver); WINE_DEFAULT_DEBUG_CHANNEL(ver);
......
...@@ -18,17 +18,11 @@ ...@@ -18,17 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#define WINE_NO_INLINE_STRING #define WINE_NO_INLINE_STRING
#include "ntstatus.h" #include "ntstatus.h"
...@@ -41,7 +35,6 @@ ...@@ -41,7 +35,6 @@
#include "winerror.h" #include "winerror.h"
#include "psapi.h" #include "psapi.h"
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "kernel_private.h" #include "kernel_private.h"
...@@ -285,7 +278,7 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src ) ...@@ -285,7 +278,7 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
{ {
__TRY __TRY
{ {
strcatW( dst, src ); wcscat( dst, src );
} }
__EXCEPT( badptr_handler ) __EXCEPT( badptr_handler )
{ {
...@@ -325,7 +318,7 @@ LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src ) ...@@ -325,7 +318,7 @@ LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
{ {
__TRY __TRY
{ {
strcpyW( dst, src ); wcscpy( dst, src );
} }
__EXCEPT( badptr_handler ) __EXCEPT( badptr_handler )
{ {
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
......
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