Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0c631ebb
Commit
0c631ebb
authored
Sep 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e5c0e8e2
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
128 additions
and
244 deletions
+128
-244
Makefile.in
dlls/kernel32/Makefile.in
+2
-2
atom.c
dlls/kernel32/atom.c
+3
-6
comm.c
dlls/kernel32/comm.c
+18
-21
computername.c
dlls/kernel32/computername.c
+0
-4
console.c
dlls/kernel32/console.c
+2
-3
debugger.c
dlls/kernel32/debugger.c
+2
-1
editline.c
dlls/kernel32/editline.c
+0
-4
file.c
dlls/kernel32/file.c
+1
-8
heap.c
dlls/kernel32/heap.c
+0
-3
kernel_main.c
dlls/kernel32/kernel_main.c
+0
-4
lcformat.c
dlls/kernel32/lcformat.c
+14
-17
locale.c
dlls/kernel32/locale.c
+0
-4
lzexpand.c
dlls/kernel32/lzexpand.c
+2
-7
module.c
dlls/kernel32/module.c
+4
-10
path.c
dlls/kernel32/path.c
+3
-6
process.c
dlls/kernel32/process.c
+1
-20
profile.c
dlls/kernel32/profile.c
+68
-72
resource.c
dlls/kernel32/resource.c
+1
-5
sync.c
dlls/kernel32/sync.c
+0
-7
loader.c
dlls/kernel32/tests/loader.c
+5
-17
thread.c
dlls/kernel32/thread.c
+0
-2
toolhelp.c
dlls/kernel32/toolhelp.c
+0
-5
version.c
dlls/kernel32/version.c
+0
-4
virtual.c
dlls/kernel32/virtual.c
+2
-9
volume.c
dlls/kernel32/volume.c
+0
-3
No files found.
dlls/kernel32/Makefile.in
View file @
0c631ebb
EXTRADEFS
=
-D_KERNEL32_
-D_NORMALIZE_
MODULE
=
kernel32.dll
IMPORTLIB
=
kernel32
IMPORTS
=
winecrt0 kernelbase ntdll
EXTRADLLFLAGS
=
-nodefaultlibs
-Wb
,-F,KERNEL32.dll
-Wl
,--image-base,0x7b600000
IMPORTS
=
kernelbase ntdll winecrt0
EXTRADLLFLAGS
=
-
mno-cygwin
-
nodefaultlibs
-Wb
,-F,KERNEL32.dll
-Wl
,--image-base,0x7b600000
C_SRCS
=
\
atom.c
\
...
...
dlls/kernel32/atom.c
View file @
0c631ebb
...
...
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -30,10 +27,10 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "winternl.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "kernel_private.h"
#define MAX_ATOM_LEN 255
...
...
@@ -170,7 +167,7 @@ ATOM WINAPI GlobalAddAtomW( LPCWSTR str )
if
(
!
check_integral_atom
(
str
,
&
atom
))
{
if
(
!
set_ntstatus
(
NtAddAtom
(
str
,
strlenW
(
str
)
*
sizeof
(
WCHAR
),
&
atom
)))
return
0
;
if
(
!
set_ntstatus
(
NtAddAtom
(
str
,
l
strlenW
(
str
)
*
sizeof
(
WCHAR
),
&
atom
)))
return
0
;
}
return
atom
;
}
...
...
@@ -302,7 +299,7 @@ ATOM WINAPI GlobalFindAtomW( LPCWSTR str )
if
(
!
check_integral_atom
(
str
,
&
atom
))
{
if
(
!
set_ntstatus
(
NtFindAtom
(
str
,
strlenW
(
str
)
*
sizeof
(
WCHAR
),
&
atom
)))
return
0
;
if
(
!
set_ntstatus
(
NtFindAtom
(
str
,
l
strlenW
(
str
)
*
sizeof
(
WCHAR
),
&
atom
)))
return
0
;
}
return
atom
;
}
...
...
dlls/kernel32/comm.c
View file @
0c631ebb
...
...
@@ -18,21 +18,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winerror.h"
#include "winioctl.h"
#include "ddk/ntddser.h"
#include "wine/server.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
@@ -50,7 +47,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr)
/* The device control string may optionally start with "COMx" followed
by an optional ':' and spaces. */
if
(
!
strncmpiW
(
ptr
,
comW
,
3
))
if
(
!
wcsnicmp
(
ptr
,
comW
,
3
))
{
ptr
+=
3
;
...
...
@@ -84,7 +81,7 @@ static LPCWSTR COMM_ParseStart(LPCWSTR ptr)
static
LPCWSTR
COMM_ParseNumber
(
LPCWSTR
ptr
,
LPDWORD
lpnumber
)
{
if
(
*
ptr
<
'0'
||
*
ptr
>
'9'
)
return
NULL
;
*
lpnumber
=
strtoulW
(
ptr
,
NULL
,
10
);
*
lpnumber
=
wcstoul
(
ptr
,
NULL
,
10
);
while
(
*
ptr
>=
'0'
&&
*
ptr
<=
'9'
)
ptr
++
;
return
ptr
;
}
...
...
@@ -145,7 +142,7 @@ static LPCWSTR COMM_ParseStopBits(LPCWSTR ptr, LPBYTE lpstopbits)
DWORD
temp
;
static
const
WCHAR
stopbits15W
[]
=
{
'1'
,
'.'
,
'5'
,
0
};
if
(
!
strncmpW
(
stopbits15W
,
ptr
,
3
))
if
(
!
wcsncmp
(
stopbits15W
,
ptr
,
3
))
{
ptr
+=
3
;
*
lpstopbits
=
ONE5STOPBITS
;
...
...
@@ -171,12 +168,12 @@ static LPCWSTR COMM_ParseOnOff(LPCWSTR ptr, LPDWORD lponoff)
static
const
WCHAR
onW
[]
=
{
'o'
,
'n'
,
0
};
static
const
WCHAR
offW
[]
=
{
'o'
,
'f'
,
'f'
,
0
};
if
(
!
strncmpiW
(
onW
,
ptr
,
2
))
if
(
!
wcsnicmp
(
onW
,
ptr
,
2
))
{
ptr
+=
2
;
*
lponoff
=
1
;
}
else
if
(
!
strncmpiW
(
offW
,
ptr
,
3
))
else
if
(
!
wcsnicmp
(
offW
,
ptr
,
3
))
{
ptr
+=
3
;
*
lponoff
=
0
;
...
...
@@ -314,31 +311,31 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
{
while
(
*
device
==
' '
)
device
++
;
if
(
!
strncmpiW
(
baudW
,
device
,
5
))
if
(
!
wcsnicmp
(
baudW
,
device
,
5
))
{
baud
=
TRUE
;
if
(
!
(
device
=
COMM_ParseNumber
(
device
+
5
,
&
lpdcb
->
BaudRate
)))
return
FALSE
;
}
else
if
(
!
strncmpiW
(
parityW
,
device
,
7
))
else
if
(
!
wcsnicmp
(
parityW
,
device
,
7
))
{
if
(
!
(
device
=
COMM_ParseParity
(
device
+
7
,
&
lpdcb
->
Parity
)))
return
FALSE
;
}
else
if
(
!
strncmpiW
(
dataW
,
device
,
5
))
else
if
(
!
wcsnicmp
(
dataW
,
device
,
5
))
{
if
(
!
(
device
=
COMM_ParseByteSize
(
device
+
5
,
&
lpdcb
->
ByteSize
)))
return
FALSE
;
}
else
if
(
!
strncmpiW
(
stopW
,
device
,
5
))
else
if
(
!
wcsnicmp
(
stopW
,
device
,
5
))
{
stop
=
TRUE
;
if
(
!
(
device
=
COMM_ParseStopBits
(
device
+
5
,
&
lpdcb
->
StopBits
)))
return
FALSE
;
}
else
if
(
!
strncmpiW
(
toW
,
device
,
3
))
else
if
(
!
wcsnicmp
(
toW
,
device
,
3
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
3
,
&
temp
)))
return
FALSE
;
...
...
@@ -349,7 +346,7 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
lptimeouts
->
WriteTotalTimeoutMultiplier
=
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
)))
return
FALSE
;
...
...
@@ -357,35 +354,35 @@ static BOOL COMM_BuildNewCommDCB(LPCWSTR device, LPDCB lpdcb, LPCOMMTIMEOUTS lpt
lpdcb
->
fOutX
=
temp
;
lpdcb
->
fInX
=
temp
;
}
else
if
(
!
strncmpiW
(
odsrW
,
device
,
5
))
else
if
(
!
wcsnicmp
(
odsrW
,
device
,
5
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
5
,
&
temp
)))
return
FALSE
;
lpdcb
->
fOutxDsrFlow
=
temp
;
}
else
if
(
!
strncmpiW
(
octsW
,
device
,
5
))
else
if
(
!
wcsnicmp
(
octsW
,
device
,
5
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
5
,
&
temp
)))
return
FALSE
;
lpdcb
->
fOutxCtsFlow
=
temp
;
}
else
if
(
!
strncmpiW
(
dtrW
,
device
,
4
))
else
if
(
!
wcsnicmp
(
dtrW
,
device
,
4
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
4
,
&
temp
)))
return
FALSE
;
lpdcb
->
fDtrControl
=
temp
;
}
else
if
(
!
strncmpiW
(
rtsW
,
device
,
4
))
else
if
(
!
wcsnicmp
(
rtsW
,
device
,
4
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
4
,
&
temp
)))
return
FALSE
;
lpdcb
->
fRtsControl
=
temp
;
}
else
if
(
!
strncmpiW
(
idsrW
,
device
,
5
))
else
if
(
!
wcsnicmp
(
idsrW
,
device
,
5
))
{
if
(
!
(
device
=
COMM_ParseOnOff
(
device
+
5
,
&
temp
)))
return
FALSE
;
...
...
@@ -500,7 +497,7 @@ BOOL WINAPI BuildCommDCBAndTimeoutsW(
if
(
ptr
==
NULL
)
result
=
FALSE
;
else
if
(
strchrW
(
ptr
,
','
))
else
if
(
wcschr
(
ptr
,
','
))
result
=
COMM_BuildOldCommDCB
(
ptr
,
&
dcb
);
else
result
=
COMM_BuildNewCommDCB
(
ptr
,
&
dcb
,
&
timeouts
);
...
...
dlls/kernel32/computername.c
View file @
0c631ebb
...
...
@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
...
...
@@ -34,7 +31,6 @@
#include "winerror.h"
#include "winnls.h"
#include "winternl.h"
#include "wine/unicode.h"
#include "wine/exception.h"
#include "kernel_private.h"
...
...
dlls/kernel32/console.c
View file @
0c631ebb
...
...
@@ -39,7 +39,6 @@
#include "wine/condrv.h"
#include "wine/server.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "excpt.h"
#include "console_private.h"
...
...
@@ -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
);
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
);
return
INVALID_HANDLE_VALUE
;
...
...
@@ -674,7 +673,7 @@ int CONSOLE_GetHistory(int idx, WCHAR* buf, int buf_len)
*/
BOOL
CONSOLE_AppendHistory
(
const
WCHAR
*
ptr
)
{
size_t
len
=
strlenW
(
ptr
);
size_t
len
=
l
strlenW
(
ptr
);
BOOL
ret
;
while
(
len
&&
(
ptr
[
len
-
1
]
==
'\n'
||
ptr
[
len
-
1
]
==
'\r'
))
len
--
;
...
...
dlls/kernel32/debugger.c
View file @
0c631ebb
...
...
@@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdio.h>
#include <string.h>
...
...
@@ -33,6 +32,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
debugstr
);
void
*
dummy
=
RtlUnwind
;
/* force importing RtlUnwind from ntdll */
static
LONG
WINAPI
debug_exception_handler
(
EXCEPTION_POINTERS
*
eptr
)
{
EXCEPTION_RECORD
*
rec
=
eptr
->
ExceptionRecord
;
...
...
dlls/kernel32/editline.c
View file @
0c631ebb
...
...
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <string.h>
...
...
@@ -28,7 +25,6 @@
#include "winbase.h"
#include "wincon.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "wine/debug.h"
#include "console_private.h"
...
...
dlls/kernel32/file.c
View file @
0c631ebb
...
...
@@ -20,15 +20,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
...
...
@@ -46,7 +40,6 @@
#include "shlwapi.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
file
);
...
...
@@ -132,7 +125,7 @@ DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen )
{
DWORD
ret
;
if
(
srclen
<
0
)
srclen
=
strlenW
(
src
)
+
1
;
if
(
srclen
<
0
)
srclen
=
l
strlenW
(
src
)
+
1
;
if
(
!
destlen
)
{
if
(
!
AreFileApisANSI
())
...
...
dlls/kernel32/heap.c
View file @
0c631ebb
...
...
@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
...
...
dlls/kernel32/kernel_main.c
View file @
0c631ebb
...
...
@@ -18,10 +18,6 @@
* 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 <stdarg.h>
#include <string.h>
...
...
dlls/kernel32/lcformat.c
View file @
0c631ebb
...
...
@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -32,7 +29,7 @@
#include "windef.h"
#include "winbase.h"
#include "win
e/unicode
.h"
#include "win
nls
.h"
#include "wine/debug.h"
#include "winternl.h"
...
...
@@ -130,7 +127,7 @@ static WCHAR* NLS_GetLocaleString(LCID lcid, DWORD dwFlags)
szBuff
[
0
]
=
'\0'
;
GetLocaleInfoW
(
lcid
,
dwFlags
,
szBuff
,
ARRAY_SIZE
(
szBuff
));
dwLen
=
strlenW
(
szBuff
)
+
1
;
dwLen
=
l
strlenW
(
szBuff
)
+
1
;
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwLen
*
sizeof
(
WCHAR
));
if
(
str
)
memcpy
(
str
,
szBuff
,
dwLen
*
sizeof
(
WCHAR
));
...
...
@@ -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 */
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
));
GetGenitiveMonth
(
new_node
,
i
)
=
NULL
;
...
...
@@ -677,10 +674,10 @@ static INT NLS_GetDateTimeFormatW(LCID lcid, DWORD dwFlags,
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'.'
,
'*'
,
'd'
,
0
};
/* We have a numeric value to add */
s
nprintfW
(
buff
,
ARRAY_SIZE
(
buff
),
fmtW
,
count
,
dwVal
);
s
wprintf
(
buff
,
ARRAY_SIZE
(
buff
),
fmtW
,
count
,
dwVal
);
}
dwLen
=
szAdd
?
strlenW
(
szAdd
)
:
0
;
dwLen
=
szAdd
?
l
strlenW
(
szAdd
)
:
0
;
if
(
cchOut
&&
dwLen
)
{
...
...
@@ -1143,7 +1140,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
szNegBuff
,
ARRAY_SIZE
(
szNegBuff
));
lpszNegStart
=
lpszNeg
=
szNegBuff
;
}
lpszNeg
=
lpszNeg
+
strlenW
(
lpszNeg
)
-
1
;
lpszNeg
=
lpszNeg
+
l
strlenW
(
lpszNeg
)
-
1
;
dwFlags
&=
(
LOCALE_NOUSEROVERRIDE
|
LOCALE_USE_CP_ACP
);
...
...
@@ -1218,7 +1215,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
}
else
{
LPWSTR
lpszDec
=
lpFormat
->
lpDecimalSep
+
strlenW
(
lpFormat
->
lpDecimalSep
)
-
1
;
LPWSTR
lpszDec
=
lpFormat
->
lpDecimalSep
+
l
strlenW
(
lpFormat
->
lpDecimalSep
)
-
1
;
if
(
dwDecimals
<=
lpFormat
->
NumDigits
)
{
...
...
@@ -1288,7 +1285,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
dwCurrentGroupCount
++
;
if
(
szSrc
>=
lpszValue
&&
dwCurrentGroupCount
==
dwGroupCount
&&
*
szSrc
!=
'-'
)
{
LPWSTR
lpszGrp
=
lpFormat
->
lpThousandSep
+
strlenW
(
lpFormat
->
lpThousandSep
)
-
1
;
LPWSTR
lpszGrp
=
lpFormat
->
lpThousandSep
+
l
strlenW
(
lpFormat
->
lpThousandSep
)
-
1
;
while
(
lpszGrp
>=
lpFormat
->
lpThousandSep
)
*
szOut
--
=
*
lpszGrp
--
;
/* Write grouping char */
...
...
@@ -1324,7 +1321,7 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
}
szOut
++
;
iRet
=
strlenW
(
szOut
)
+
1
;
iRet
=
l
strlenW
(
szOut
)
+
1
;
if
(
cchOut
)
{
if
(
iRet
<=
cchOut
)
...
...
@@ -1538,9 +1535,9 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
}
dwFlags
&=
(
LOCALE_NOUSEROVERRIDE
|
LOCALE_USE_CP_ACP
);
lpszNeg
=
lpszNeg
+
strlenW
(
lpszNeg
)
-
1
;
lpszNeg
=
lpszNeg
+
l
strlenW
(
lpszNeg
)
-
1
;
lpszCyStart
=
lpFormat
->
lpCurrencySymbol
;
lpszCy
=
lpszCyStart
+
strlenW
(
lpszCyStart
)
-
1
;
lpszCy
=
lpszCyStart
+
l
strlenW
(
lpszCyStart
)
-
1
;
/* Format the currency backwards into a temporary buffer */
...
...
@@ -1627,7 +1624,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
}
else
{
LPWSTR
lpszDec
=
lpFormat
->
lpDecimalSep
+
strlenW
(
lpFormat
->
lpDecimalSep
)
-
1
;
LPWSTR
lpszDec
=
lpFormat
->
lpDecimalSep
+
l
strlenW
(
lpFormat
->
lpDecimalSep
)
-
1
;
if
(
dwDecimals
<=
lpFormat
->
NumDigits
)
{
...
...
@@ -1696,7 +1693,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
dwCurrentGroupCount
++
;
if
(
szSrc
>=
lpszValue
&&
dwCurrentGroupCount
==
dwGroupCount
&&
*
szSrc
!=
'-'
)
{
LPWSTR
lpszGrp
=
lpFormat
->
lpThousandSep
+
strlenW
(
lpFormat
->
lpThousandSep
)
-
1
;
LPWSTR
lpszGrp
=
lpFormat
->
lpThousandSep
+
l
strlenW
(
lpFormat
->
lpThousandSep
)
-
1
;
while
(
lpszGrp
>=
lpFormat
->
lpThousandSep
)
*
szOut
--
=
*
lpszGrp
--
;
/* Write grouping char */
...
...
@@ -1736,7 +1733,7 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
*
szOut
--
=
'('
;
szOut
++
;
iRet
=
strlenW
(
szOut
)
+
1
;
iRet
=
l
strlenW
(
szOut
)
+
1
;
if
(
cchOut
)
{
if
(
iRet
<=
cchOut
)
...
...
dlls/kernel32/locale.c
View file @
0c631ebb
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include <locale.h>
#include <string.h>
...
...
@@ -37,7 +34,6 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "wine/unicode.h"
#include "winnls.h"
#include "winerror.h"
#include "winver.h"
...
...
dlls/kernel32/lzexpand.c
View file @
0c631ebb
...
...
@@ -33,23 +33,18 @@
*
*/
#include "config.h"
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include "lzexpand.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
file
);
...
...
@@ -315,7 +310,7 @@ INT WINAPI GetExpandedNameW( LPWSTR in, LPWSTR out )
char
*
xout
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
3
);
WideCharToMultiByte
(
CP_ACP
,
0
,
in
,
-
1
,
xin
,
len
,
NULL
,
NULL
);
if
((
ret
=
GetExpandedNameA
(
xin
,
xout
))
>
0
)
MultiByteToWideChar
(
CP_ACP
,
0
,
xout
,
-
1
,
out
,
strlenW
(
in
)
+
4
);
MultiByteToWideChar
(
CP_ACP
,
0
,
xout
,
-
1
,
out
,
l
strlenW
(
in
)
+
4
);
HeapFree
(
GetProcessHeap
(),
0
,
xin
);
HeapFree
(
GetProcessHeap
(),
0
,
xout
);
return
ret
;
...
...
dlls/kernel32/module.c
View file @
0c631ebb
...
...
@@ -18,18 +18,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "winerror.h"
...
...
@@ -43,7 +38,6 @@
#include "wine/list.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
module
);
...
...
@@ -230,14 +224,14 @@ BOOL WINAPI GetBinaryTypeW( LPCWSTR name, LPDWORD type )
*
type
=
SCS_DOS_BINARY
;
return
TRUE
;
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
;
return
TRUE
;
}
if
(
!
strcmpiW
(
ptr
,
pifW
))
if
(
!
wcsicmp
(
ptr
,
pifW
))
{
*
type
=
SCS_PIF_BINARY
;
return
TRUE
;
...
...
dlls/kernel32/path.c
View file @
0c631ebb
...
...
@@ -21,9 +21,6 @@
*
*/
#include "config.h"
#include "wine/port.h"
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
...
...
@@ -33,10 +30,10 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winternl.h"
#include "kernel_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
file
);
...
...
@@ -235,10 +232,10 @@ BOOL WINAPI CreateDirectoryExA( LPCSTR template, LPCSTR path, LPSECURITY_ATTRIBU
*/
UINT
WINAPI
GetSystemDirectoryW
(
LPWSTR
path
,
UINT
count
)
{
UINT
len
=
strlenW
(
DIR_System
)
+
1
;
UINT
len
=
l
strlenW
(
DIR_System
)
+
1
;
if
(
path
&&
count
>=
len
)
{
strcpyW
(
path
,
DIR_System
);
l
strcpyW
(
path
,
DIR_System
);
len
--
;
}
return
len
;
...
...
dlls/kernel32/process.c
View file @
0c631ebb
...
...
@@ -18,9 +18,6 @@
* 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 <errno.h>
...
...
@@ -28,33 +25,17 @@
#include <stdarg.h>
#include <stdio.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"
#define WIN32_NO_STATUS
#include "winternl.h"
#include "winbase.h"
#include "winnls.h"
#include "wincon.h"
#include "kernel_private.h"
#include "psapi.h"
#include "wine/exception.h"
#include "wine/server.h"
#include "wine/unicode.h"
#include "wine/asm.h"
#include "wine/debug.h"
...
...
dlls/kernel32/profile.c
View file @
0c631ebb
...
...
@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdarg.h>
...
...
@@ -32,7 +29,6 @@
#include "winreg.h"
#include "winternl.h"
#include "shlwapi.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
profile
);
...
...
@@ -110,11 +106,11 @@ static void PROFILE_CopyEntry( LPWSTR buffer, LPCWSTR value, int len )
if
(
*
value
==
'\''
||
*
value
==
'\"'
)
{
if
(
value
[
1
]
&&
(
value
[
strlenW
(
value
)
-
1
]
==
*
value
))
quote
=
*
value
++
;
if
(
value
[
1
]
&&
(
value
[
l
strlenW
(
value
)
-
1
]
==
*
value
))
quote
=
*
value
++
;
}
lstrcpynW
(
buffer
,
value
,
len
);
if
(
quote
&&
(
len
>=
lstrlenW
(
value
)))
buffer
[
strlenW
(
buffer
)
-
1
]
=
'\0'
;
if
(
quote
&&
(
len
>=
lstrlenW
(
value
)))
buffer
[
l
strlenW
(
buffer
)
-
1
]
=
'\0'
;
}
/* 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
{
int
len
=
0
;
if
(
section
->
name
[
0
])
len
+=
strlenW
(
section
->
name
)
+
4
;
if
(
section
->
name
[
0
])
len
+=
l
strlenW
(
section
->
name
)
+
4
;
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
{
len
+=
strlenW
(
key
->
name
)
+
2
;
if
(
key
->
value
)
len
+=
strlenW
(
key
->
value
)
+
1
;
len
+=
l
strlenW
(
key
->
name
)
+
2
;
if
(
key
->
value
)
len
+=
l
strlenW
(
key
->
value
)
+
1
;
}
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
...
...
@@ -218,8 +214,8 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
if
(
section
->
name
[
0
])
{
*
p
++
=
'['
;
strcpyW
(
p
,
section
->
name
);
p
+=
strlenW
(
p
);
l
strcpyW
(
p
,
section
->
name
);
p
+=
l
strlenW
(
p
);
*
p
++
=
']'
;
*
p
++
=
'\r'
;
*
p
++
=
'\n'
;
...
...
@@ -227,13 +223,13 @@ static void PROFILE_Save( HANDLE hFile, const PROFILESECTION *section, ENCODING
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
{
strcpyW
(
p
,
key
->
name
);
p
+=
strlenW
(
p
);
l
strcpyW
(
p
,
key
->
name
);
p
+=
l
strlenW
(
p
);
if
(
key
->
value
)
{
*
p
++
=
'='
;
strcpyW
(
p
,
key
->
value
);
p
+=
strlenW
(
p
);
l
strcpyW
(
p
,
key
->
value
);
p
+=
l
strlenW
(
p
);
}
*
p
++
=
'\r'
;
*
p
++
=
'\n'
;
...
...
@@ -499,12 +495,12 @@ static BOOL PROFILE_DeleteKey( PROFILESECTION **section,
{
while
(
*
section
)
{
if
(
!
strcmpiW
(
(
*
section
)
->
name
,
section_name
))
if
(
!
wcsicmp
(
(
*
section
)
->
name
,
section_name
))
{
PROFILEKEY
**
key
=
&
(
*
section
)
->
key
;
while
(
*
key
)
{
if
(
!
strcmpiW
(
(
*
key
)
->
name
,
key_name
))
if
(
!
wcsicmp
(
(
*
key
)
->
name
,
key_name
))
{
PROFILEKEY
*
to_del
=
*
key
;
*
key
=
to_del
->
next
;
...
...
@@ -531,7 +527,7 @@ static void PROFILE_DeleteAllKeys( LPCWSTR section_name)
PROFILESECTION
**
section
=
&
CurProfile
->
section
;
while
(
*
section
)
{
if
(
!
strcmpiW
(
(
*
section
)
->
name
,
section_name
))
if
(
!
wcsicmp
(
(
*
section
)
->
name
,
section_name
))
{
PROFILEKEY
**
key
=
&
(
*
section
)
->
key
;
while
(
*
key
)
...
...
@@ -562,7 +558,7 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
while
(
PROFILE_isspaceW
(
*
section_name
))
section_name
++
;
if
(
*
section_name
)
{
p
=
section_name
+
strlenW
(
section_name
)
-
1
;
p
=
section_name
+
l
strlenW
(
section_name
)
-
1
;
while
((
p
>
section_name
)
&&
PROFILE_isspaceW
(
*
p
))
p
--
;
seclen
=
p
-
section_name
+
1
;
}
...
...
@@ -570,14 +566,14 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
while
(
PROFILE_isspaceW
(
*
key_name
))
key_name
++
;
if
(
*
key_name
)
{
p
=
key_name
+
strlenW
(
key_name
)
-
1
;
p
=
key_name
+
l
strlenW
(
key_name
)
-
1
;
while
((
p
>
key_name
)
&&
PROFILE_isspaceW
(
*
p
))
p
--
;
keylen
=
p
-
key_name
+
1
;
}
while
(
*
section
)
{
if
(
!
strncmpiW
((
*
section
)
->
name
,
section_name
,
seclen
)
&&
if
(
!
wcsnicmp
((
*
section
)
->
name
,
section_name
,
seclen
)
&&
((
*
section
)
->
name
)[
seclen
]
==
'\0'
)
{
PROFILEKEY
**
key
=
&
(
*
section
)
->
key
;
...
...
@@ -591,16 +587,16 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
*/
if
(
!
create_always
)
{
if
(
(
!
(
strncmpiW
(
(
*
key
)
->
name
,
key_name
,
keylen
)))
if
(
(
!
(
wcsnicmp
(
(
*
key
)
->
name
,
key_name
,
keylen
)))
&&
(((
*
key
)
->
name
)[
keylen
]
==
'\0'
)
)
return
*
key
;
}
key
=
&
(
*
key
)
->
next
;
}
if
(
!
create
)
return
NULL
;
if
(
!
(
*
key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PROFILEKEY
)
+
strlenW
(
key_name
)
*
sizeof
(
WCHAR
)
)))
if
(
!
(
*
key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PROFILEKEY
)
+
l
strlenW
(
key_name
)
*
sizeof
(
WCHAR
)
)))
return
NULL
;
strcpyW
(
(
*
key
)
->
name
,
key_name
);
l
strcpyW
(
(
*
key
)
->
name
,
key_name
);
(
*
key
)
->
value
=
NULL
;
(
*
key
)
->
next
=
NULL
;
return
*
key
;
...
...
@@ -608,17 +604,17 @@ static PROFILEKEY *PROFILE_Find( PROFILESECTION **section, LPCWSTR section_name,
section
=
&
(
*
section
)
->
next
;
}
if
(
!
create
)
return
NULL
;
*
section
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PROFILESECTION
)
+
strlenW
(
section_name
)
*
sizeof
(
WCHAR
)
);
*
section
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PROFILESECTION
)
+
l
strlenW
(
section_name
)
*
sizeof
(
WCHAR
)
);
if
(
*
section
==
NULL
)
return
NULL
;
strcpyW
(
(
*
section
)
->
name
,
section_name
);
l
strcpyW
(
(
*
section
)
->
name
,
section_name
);
(
*
section
)
->
next
=
NULL
;
if
(
!
((
*
section
)
->
key
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PROFILEKEY
)
+
strlenW
(
key_name
)
*
sizeof
(
WCHAR
)
)))
sizeof
(
PROFILEKEY
)
+
l
strlenW
(
key_name
)
*
sizeof
(
WCHAR
)
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
*
section
);
return
NULL
;
}
strcpyW
(
(
*
section
)
->
key
->
name
,
key_name
);
l
strcpyW
(
(
*
section
)
->
key
->
name
,
key_name
);
(
*
section
)
->
key
->
value
=
NULL
;
(
*
section
)
->
key
->
next
=
NULL
;
return
(
*
section
)
->
key
;
...
...
@@ -732,14 +728,14 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
filename
=
wininiW
;
if
((
RtlDetermineDosPathNameType_U
(
filename
)
==
RELATIVE_PATH
)
&&
!
strchrW
(
filename
,
'\\'
)
&&
!
strchrW
(
filename
,
'/'
))
!
wcschr
(
filename
,
'\\'
)
&&
!
wcschr
(
filename
,
'/'
))
{
static
const
WCHAR
wszSeparator
[]
=
{
'\\'
,
0
};
WCHAR
windirW
[
MAX_PATH
];
GetWindowsDirectoryW
(
windirW
,
MAX_PATH
);
strcpyW
(
buffer
,
windirW
);
strcatW
(
buffer
,
wszSeparator
);
strcatW
(
buffer
,
filename
);
l
strcpyW
(
buffer
,
windirW
);
l
strcatW
(
buffer
,
wszSeparator
);
l
strcatW
(
buffer
,
filename
);
}
else
{
...
...
@@ -761,7 +757,7 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
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
));
if
(
i
)
...
...
@@ -810,8 +806,8 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
if
(
CurProfile
->
filename
)
PROFILE_ReleaseFile
();
/* OK, now that CurProfile is definitely free we assign it our new file */
CurProfile
->
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
CurProfile
->
filename
,
buffer
);
CurProfile
->
filename
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
l
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
)
);
l
strcpyW
(
CurProfile
->
filename
,
buffer
);
if
(
hFile
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -855,7 +851,7 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name,
for
(
section
=
CurProfile
->
section
;
section
;
section
=
section
->
next
)
{
if
(
!
strcmpiW
(
section
->
name
,
section_name
))
if
(
!
wcsicmp
(
section
->
name
,
section_name
))
{
UINT
oldlen
=
len
;
for
(
key
=
section
->
key
;
key
;
key
=
key
->
next
)
...
...
@@ -865,15 +861,15 @@ static INT PROFILE_GetSection( const WCHAR *filename, LPCWSTR section_name,
if
(
IS_ENTRY_COMMENT
(
key
->
name
))
continue
;
/* Skip comments */
if
(
!
return_values
&&
!
key
->
value
)
continue
;
/* Skip lines w.o. '=' */
lstrcpynW
(
buffer
,
key
->
name
,
len
-
1
);
len
-=
strlenW
(
buffer
)
+
1
;
buffer
+=
strlenW
(
buffer
)
+
1
;
len
-=
l
strlenW
(
buffer
)
+
1
;
buffer
+=
l
strlenW
(
buffer
)
+
1
;
if
(
len
<
2
)
break
;
if
(
return_values
&&
key
->
value
)
{
buffer
[
-
1
]
=
'='
;
lstrcpynW
(
buffer
,
key
->
value
,
len
-
1
);
len
-=
strlenW
(
buffer
)
+
1
;
buffer
+=
strlenW
(
buffer
)
+
1
;
len
-=
l
strlenW
(
buffer
)
+
1
;
buffer
+=
l
strlenW
(
buffer
)
+
1
;
}
}
*
buffer
=
'\0'
;
...
...
@@ -914,7 +910,7 @@ static BOOL PROFILE_DeleteSection( const WCHAR *filename, const WCHAR *name )
for
(
section
=
&
CurProfile
->
section
;
*
section
;
section
=
&
(
*
section
)
->
next
)
{
if
(
!
strcmpiW
(
(
*
section
)
->
name
,
name
))
if
(
!
wcsicmp
(
(
*
section
)
->
name
,
name
))
{
PROFILESECTION
*
to_del
=
*
section
;
*
section
=
to_del
->
next
;
...
...
@@ -952,7 +948,7 @@ static INT PROFILE_GetSectionNames( LPWSTR buffer, UINT len )
section
=
CurProfile
->
section
;
while
((
section
!=
NULL
))
{
if
(
section
->
name
[
0
])
{
tmplen
=
strlenW
(
section
->
name
)
+
1
;
tmplen
=
l
strlenW
(
section
->
name
)
+
1
;
if
(
tmplen
>=
buflen
)
{
if
(
buflen
>
0
)
{
memcpy
(
buf
,
section
->
name
,
(
buflen
-
1
)
*
sizeof
(
WCHAR
));
...
...
@@ -1001,7 +997,7 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name,
if
(
key
->
value
)
{
if
(
!
strcmpW
(
key
->
value
,
value
))
if
(
!
wcscmp
(
key
->
value
,
value
))
{
TRACE
(
" no change needed
\n
"
);
return
TRUE
;
/* No change needed */
...
...
@@ -1010,8 +1006,8 @@ static BOOL PROFILE_SetString( LPCWSTR section_name, LPCWSTR key_name,
HeapFree
(
GetProcessHeap
(),
0
,
key
->
value
);
}
else
TRACE
(
" creating key
\n
"
);
key
->
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
key
->
value
,
value
);
key
->
value
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
l
strlenW
(
value
)
+
1
)
*
sizeof
(
WCHAR
)
);
l
strcpyW
(
key
->
value
,
value
);
CurProfile
->
changed
=
TRUE
;
}
return
TRUE
;
...
...
@@ -1090,7 +1086,7 @@ static HKEY open_mapped_key( const WCHAR *path, BOOL write )
for
(
p
=
path
;
strchr
(
"!#@"
,
*
p
);
p
++
)
FIXME
(
"ignoring %c modifier
\n
"
,
*
p
);
if
(
!
strncmpW
(
p
,
usrW
,
ARRAY_SIZE
(
usrW
)
))
if
(
!
wcsncmp
(
p
,
usrW
,
ARRAY_SIZE
(
usrW
)
))
{
if
(
write
)
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 )
return
res
?
NULL
:
key
;
}
if
(
!
strncmpW
(
p
,
sysW
,
ARRAY_SIZE
(
sysW
)
))
if
(
!
wcsncmp
(
p
,
sysW
,
ARRAY_SIZE
(
sysW
)
))
{
p
+=
4
;
if
(
!
(
combined_path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
ARRAY_SIZE
(
softwareW
)
+
strlenW
(
p
))
*
sizeof
(
WCHAR
)
)))
(
ARRAY_SIZE
(
softwareW
)
+
l
strlenW
(
p
))
*
sizeof
(
WCHAR
)
)))
return
NULL
;
strcpyW
(
combined_path
,
softwareW
);
strcatW
(
combined_path
,
p
);
l
strcpyW
(
combined_path
,
softwareW
);
l
strcatW
(
combined_path
,
p
);
if
(
write
)
res
=
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
combined_path
,
0
,
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,
if
((
path
=
get_key_value
(
key
,
NULL
)))
{
if
((
combined_path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
path
)
+
strlenW
(
section
)
+
2
)
*
sizeof
(
WCHAR
)
)))
(
lstrlenW
(
path
)
+
l
strlenW
(
section
)
+
2
)
*
sizeof
(
WCHAR
)
)))
{
strcpyW
(
combined_path
,
path
);
strcatW
(
combined_path
,
backslashW
);
strcatW
(
combined_path
,
section
);
l
strcpyW
(
combined_path
,
path
);
l
strcatW
(
combined_path
,
backslashW
);
l
strcatW
(
combined_path
,
section
);
}
HeapFree
(
GetProcessHeap
(),
0
,
path
);
path
=
combined_path
;
...
...
@@ -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
)
{
lstrcpynW
(
buffer
+
ret
,
entry
,
size
-
ret
-
1
);
ret
=
min
(
ret
+
strlenW
(
entry
)
+
1
,
size
-
1
);
ret
=
min
(
ret
+
l
strlenW
(
entry
)
+
1
,
size
-
1
);
if
(
return_values
&&
ret
<
size
-
1
&&
(
value
=
get_key_value
(
key
,
entry
)))
{
buffer
[
ret
-
1
]
=
'='
;
lstrcpynW
(
buffer
+
ret
,
value
,
size
-
ret
-
1
);
ret
=
min
(
ret
+
strlenW
(
value
)
+
1
,
size
-
1
);
ret
=
min
(
ret
+
l
strlenW
(
value
)
+
1
,
size
-
1
);
HeapFree
(
GetProcessHeap
(),
0
,
value
);
}
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
...
...
@@ -1224,12 +1220,12 @@ static DWORD get_section( const WCHAR *filename, const WCHAR *section,
if
((
value
=
get_key_value
(
entry_key
,
entry
)))
{
lstrcpynW
(
buffer
+
ret
,
entry
,
size
-
ret
-
1
);
ret
=
min
(
ret
+
strlenW
(
entry
)
+
1
,
size
-
1
);
ret
=
min
(
ret
+
l
strlenW
(
entry
)
+
1
,
size
-
1
);
if
(
return_values
&&
ret
<
size
-
1
)
{
buffer
[
ret
-
1
]
=
'='
;
lstrcpynW
(
buffer
+
ret
,
value
,
size
-
ret
-
1
);
ret
=
min
(
ret
+
strlenW
(
value
)
+
1
,
size
-
1
);
ret
=
min
(
ret
+
l
strlenW
(
value
)
+
1
,
size
-
1
);
}
HeapFree
(
GetProcessHeap
(),
0
,
value
);
}
...
...
@@ -1368,13 +1364,13 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
if
(
!
buffer
[
0
])
{
PROFILE_CopyEntry
(
buffer
,
def_val
,
len
);
ret
=
strlenW
(
buffer
);
ret
=
l
strlenW
(
buffer
);
}
return
ret
;
}
/* strip any trailing ' ' of def_val. */
p
=
def_val
+
strlenW
(
def_val
)
-
1
;
p
=
def_val
+
l
strlenW
(
def_val
)
-
1
;
while
(
p
>
def_val
&&
*
p
==
' '
)
p
--
;
...
...
@@ -1407,7 +1403,7 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
else
lstrcpynW
(
buffer
,
def_val
,
len
);
ret
=
strlenW
(
buffer
);
ret
=
l
strlenW
(
buffer
);
}
else
{
...
...
@@ -1418,12 +1414,12 @@ INT WINAPI GetPrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
PROFILEKEY
*
key
=
PROFILE_Find
(
&
CurProfile
->
section
,
section
,
entry
,
FALSE
,
FALSE
);
PROFILE_CopyEntry
(
buffer
,
(
key
&&
key
->
value
)
?
key
->
value
:
def_val
,
len
);
TRACE
(
"-> %s
\n
"
,
debugstr_w
(
buffer
));
ret
=
strlenW
(
buffer
);
ret
=
l
strlenW
(
buffer
);
}
else
{
lstrcpynW
(
buffer
,
def_val
,
len
);
ret
=
strlenW
(
buffer
);
ret
=
l
strlenW
(
buffer
);
}
LeaveCriticalSection
(
&
PROFILE_CritSect
);
...
...
@@ -1675,7 +1671,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
if
(
string
)
res
=
RegSetValueExW
(
key
,
entry
,
0
,
REG_SZ
,
(
const
BYTE
*
)
string
,
(
strlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
)
);
(
l
strlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
)
);
else
res
=
RegDeleteValueW
(
key
,
entry
);
RegCloseKey
(
key
);
...
...
@@ -1754,9 +1750,9 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
const
WCHAR
*
entry
,
*
p
;
for
(
entry
=
string
;
*
entry
;
entry
+=
strlenW
(
entry
)
+
1
)
for
(
entry
=
string
;
*
entry
;
entry
+=
l
strlenW
(
entry
)
+
1
)
{
if
((
p
=
strchrW
(
entry
,
'='
)))
if
((
p
=
wcschr
(
entry
,
'='
)))
{
WCHAR
*
entry_copy
;
p
++
;
...
...
@@ -1770,7 +1766,7 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
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
,
(
strlenW
(
p
)
+
1
)
*
sizeof
(
WCHAR
)
);
(
l
strlenW
(
p
)
+
1
)
*
sizeof
(
WCHAR
)
);
RegCloseKey
(
section_key
);
if
(
res
)
{
...
...
@@ -1795,15 +1791,15 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
ret
=
TRUE
;
while
(
*
string
&&
ret
)
{
WCHAR
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
strlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
)
);
strcpyW
(
buf
,
string
);
if
((
p
=
strchrW
(
buf
,
'='
)))
WCHAR
*
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
l
strlenW
(
string
)
+
1
)
*
sizeof
(
WCHAR
)
);
l
strcpyW
(
buf
,
string
);
if
((
p
=
wcschr
(
buf
,
'='
)))
{
*
p
=
'\0'
;
ret
=
PROFILE_SetString
(
section
,
buf
,
p
+
1
,
TRUE
);
}
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
string
+=
strlenW
(
string
)
+
1
;
string
+=
l
strlenW
(
string
)
+
1
;
}
if
(
ret
)
ret
=
PROFILE_FlushFile
();
}
...
...
@@ -1917,7 +1913,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size,
for
(
i
=
0
;
(
section
=
enum_key
(
key
,
i
));
++
i
)
{
lstrcpynW
(
buffer
+
ret
,
section
,
size
-
ret
-
1
);
ret
=
min
(
ret
+
strlenW
(
section
)
+
1
,
size
-
1
);
ret
=
min
(
ret
+
l
strlenW
(
section
)
+
1
,
size
-
1
);
HeapFree
(
GetProcessHeap
(),
0
,
section
);
}
...
...
dlls/kernel32/resource.c
View file @
0c631ebb
...
...
@@ -20,9 +20,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#define NONAMELESSUNION
...
...
@@ -34,7 +31,6 @@
#include "winternl.h"
#include "wine/debug.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/list.h"
#include "kernel_private.h"
...
...
@@ -213,7 +209,7 @@ static int resource_strcmp( LPCWSTR a, LPCWSTR b )
if
(
a
==
b
)
return
0
;
if
(
!
IS_INTRESOURCE
(
a
)
&&
!
IS_INTRESOURCE
(
b
)
)
return
lstrcmpW
(
a
,
b
);
return
wcscmp
(
a
,
b
);
/* strings come before ids */
if
(
!
IS_INTRESOURCE
(
a
)
&&
IS_INTRESOURCE
(
b
))
return
-
1
;
...
...
dlls/kernel32/sync.c
View file @
0c631ebb
...
...
@@ -18,13 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -42,7 +36,6 @@
#include "ddk/wdm.h"
#include "wine/asm.h"
#include "wine/unicode.h"
#include "kernel_private.h"
#include "wine/debug.h"
...
...
dlls/kernel32/tests/loader.c
View file @
0c631ebb
...
...
@@ -3901,7 +3901,7 @@ static void test_wow64_redirection(void)
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
);
IMAGE_NT_HEADERS
*
nt
,
*
nt_file
;
...
...
@@ -3926,29 +3926,17 @@ static void test_dll_file( const char *name, BOOL is_todo )
nt_file
=
pRtlImageNtHeader
(
ptr
);
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 )
todo_wine_if
(
is_todo
)
OK_FIELD
(
FileHeader
.
NumberOfSections
);
todo_wine_if
(
is_todo
)
OK_FIELD
(
OptionalHeader
.
AddressOfEntryPoint
);
OK_FIELD
(
OptionalHeader
.
NumberOfRvaAndSizes
);
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
);
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
);
}
sec
=
(
IMAGE_SECTION_HEADER
*
)((
char
*
)
&
nt
->
OptionalHeader
+
nt
->
FileHeader
.
SizeOfOptionalHeader
);
sec_file
=
(
IMAGE_SECTION_HEADER
*
)((
char
*
)
&
nt_file
->
OptionalHeader
+
nt_file
->
FileHeader
.
SizeOfOptionalHeader
);
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
);
UnmapViewOfFile
(
ptr
);
#undef OK_FIELD
...
...
@@ -4042,10 +4030,10 @@ START_TEST(loader)
test_InMemoryOrderModuleList
();
test_LoadPackagedLibrary
();
test_wow64_redirection
();
test_dll_file
(
"ntdll.dll"
,
FALSE
);
test_dll_file
(
"kernel32.dll"
,
TRUE
);
test_dll_file
(
"advapi32.dll"
,
FALSE
);
test_dll_file
(
"user32.dll"
,
FALSE
);
test_dll_file
(
"ntdll.dll"
);
test_dll_file
(
"kernel32.dll"
);
test_dll_file
(
"advapi32.dll"
);
test_dll_file
(
"user32.dll"
);
/* loader test must be last, it can corrupt the internal loader state on Windows */
test_Loader
();
}
dlls/kernel32/thread.c
View file @
0c631ebb
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <sys/types.h>
...
...
dlls/kernel32/toolhelp.c
View file @
0c631ebb
...
...
@@ -19,14 +19,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ctype.h>
#include <assert.h>
#include "ntstatus.h"
...
...
dlls/kernel32/version.c
View file @
0c631ebb
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
...
...
@@ -36,7 +33,6 @@
#include "winuser.h"
#include "winternl.h"
#include "winerror.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ver
);
...
...
dlls/kernel32/virtual.c
View file @
0c631ebb
...
...
@@ -18,17 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <fcntl.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#define WINE_NO_INLINE_STRING
#include "ntstatus.h"
...
...
@@ -41,7 +35,6 @@
#include "winerror.h"
#include "psapi.h"
#include "wine/exception.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "kernel_private.h"
...
...
@@ -285,7 +278,7 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
{
__TRY
{
strcatW
(
dst
,
src
);
wcscat
(
dst
,
src
);
}
__EXCEPT
(
badptr_handler
)
{
...
...
@@ -325,7 +318,7 @@ LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
{
__TRY
{
strcpyW
(
dst
,
src
);
wcscpy
(
dst
,
src
);
}
__EXCEPT
(
badptr_handler
)
{
...
...
dlls/kernel32/volume.c
View file @
0c631ebb
...
...
@@ -22,9 +22,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment