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
c487f21b
Commit
c487f21b
authored
Sep 09, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e9090e1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
86 additions
and
114 deletions
+86
-114
Makefile.in
dlls/advapi32/Makefile.in
+2
-0
advapi.c
dlls/advapi32/advapi.c
+0
-1
cred.c
dlls/advapi32/cred.c
+28
-29
crypt.c
dlls/advapi32/crypt.c
+13
-33
eventlog.c
dlls/advapi32/eventlog.c
+0
-1
lsa.c
dlls/advapi32/lsa.c
+10
-11
registry.c
dlls/advapi32/registry.c
+2
-3
security.c
dlls/advapi32/security.c
+24
-27
service.c
dlls/advapi32/service.c
+6
-7
wmi.c
dlls/advapi32/wmi.c
+0
-1
loader.c
dlls/kernel32/tests/loader.c
+1
-1
No files found.
dlls/advapi32/Makefile.in
View file @
c487f21b
...
@@ -4,6 +4,8 @@ IMPORTLIB = advapi32
...
@@ -4,6 +4,8 @@ IMPORTLIB = advapi32
IMPORTS
=
kernelbase sechost
IMPORTS
=
kernelbase sechost
DELAYIMPORTS
=
rpcrt4
DELAYIMPORTS
=
rpcrt4
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
C_SRCS
=
\
advapi.c
\
advapi.c
\
cred.c
\
cred.c
\
...
...
dlls/advapi32/advapi.c
View file @
c487f21b
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
#include "wincred.h"
#include "wincred.h"
#include "wct.h"
#include "wct.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "advapi32_misc.h"
#include "advapi32_misc.h"
...
...
dlls/advapi32/cred.c
View file @
c487f21b
This diff is collapsed.
Click to expand it.
dlls/advapi32/crypt.c
View file @
c487f21b
...
@@ -24,21 +24,11 @@
...
@@ -24,21 +24,11 @@
* - Thread-safing
* - Thread-safing
*/
*/
#include "config.h"
#include "wine/port.h"
#include <limits.h>
#include <limits.h>
#include <time.h>
#include <time.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "ntstatus.h"
#include "ntstatus.h"
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
...
@@ -47,7 +37,6 @@
...
@@ -47,7 +37,6 @@
#include "winreg.h"
#include "winreg.h"
#include "rpc.h"
#include "rpc.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "winternl.h"
#include "winternl.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
WINE_DEFAULT_DEBUG_CHANNEL
(
crypt
);
...
@@ -79,11 +68,11 @@ static inline PWSTR CRYPT_GetProvKeyName(PCWSTR pProvName)
...
@@ -79,11 +68,11 @@ static inline PWSTR CRYPT_GetProvKeyName(PCWSTR pProvName)
};
};
PWSTR
keyname
;
PWSTR
keyname
;
keyname
=
CRYPT_Alloc
((
strlenW
(
KEYSTR
)
+
strlenW
(
pProvName
)
+
1
)
*
sizeof
(
WCHAR
));
keyname
=
CRYPT_Alloc
((
lstrlenW
(
KEYSTR
)
+
l
strlenW
(
pProvName
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
keyname
)
if
(
keyname
)
{
{
strcpyW
(
keyname
,
KEYSTR
);
l
strcpyW
(
keyname
,
KEYSTR
);
strcpyW
(
keyname
+
strlenW
(
KEYSTR
),
pProvName
);
lstrcpyW
(
keyname
+
l
strlenW
(
KEYSTR
),
pProvName
);
}
else
}
else
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
keyname
;
return
keyname
;
...
@@ -108,11 +97,11 @@ static inline PWSTR CRYPT_GetTypeKeyName(DWORD dwType, BOOL user)
...
@@ -108,11 +97,11 @@ static inline PWSTR CRYPT_GetTypeKeyName(DWORD dwType, BOOL user)
PWSTR
keyname
;
PWSTR
keyname
;
PWSTR
ptr
;
PWSTR
ptr
;
keyname
=
CRYPT_Alloc
(
((
user
?
strlenW
(
USERSTR
)
:
strlenW
(
MACHINESTR
))
+
1
)
*
sizeof
(
WCHAR
));
keyname
=
CRYPT_Alloc
(
((
user
?
lstrlenW
(
USERSTR
)
:
l
strlenW
(
MACHINESTR
))
+
1
)
*
sizeof
(
WCHAR
));
if
(
keyname
)
if
(
keyname
)
{
{
user
?
strcpyW
(
keyname
,
USERSTR
)
:
strcpyW
(
keyname
,
MACHINESTR
);
user
?
lstrcpyW
(
keyname
,
USERSTR
)
:
l
strcpyW
(
keyname
,
MACHINESTR
);
ptr
=
keyname
+
strlenW
(
keyname
);
ptr
=
keyname
+
l
strlenW
(
keyname
);
*
(
--
ptr
)
=
(
dwType
%
10
)
+
'0'
;
*
(
--
ptr
)
=
(
dwType
%
10
)
+
'0'
;
*
(
--
ptr
)
=
((
dwType
/
10
)
%
10
)
+
'0'
;
*
(
--
ptr
)
=
((
dwType
/
10
)
%
10
)
+
'0'
;
*
(
--
ptr
)
=
(
dwType
/
100
)
+
'0'
;
*
(
--
ptr
)
=
(
dwType
/
100
)
+
'0'
;
...
@@ -303,19 +292,10 @@ static void CRYPT_CreateMachineGuid(void)
...
@@ -303,19 +292,10 @@ static void CRYPT_CreateMachineGuid(void)
{
{
UUID
uuid
;
UUID
uuid
;
WCHAR
buf
[
37
];
WCHAR
buf
[
37
];
RPC_STATUS
rs
;
static
const
WCHAR
uuidFmt
[]
=
{
if
(
UuidCreate
(
&
uuid
)
==
S_OK
)
'%'
,
'0'
,
'8'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
0
};
rs
=
UuidCreate
(
&
uuid
);
if
(
rs
==
S_OK
)
{
{
s
printfW
(
buf
,
uuidFmt
,
s
wprintf
(
buf
,
ARRAY_SIZE
(
buf
),
L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"
,
uuid
.
Data1
,
uuid
.
Data2
,
uuid
.
Data3
,
uuid
.
Data1
,
uuid
.
Data2
,
uuid
.
Data3
,
uuid
.
Data4
[
0
],
uuid
.
Data4
[
1
],
uuid
.
Data4
[
0
],
uuid
.
Data4
[
1
],
uuid
.
Data4
[
2
],
uuid
.
Data4
[
3
],
uuid
.
Data4
[
2
],
uuid
.
Data4
[
3
],
...
@@ -445,12 +425,12 @@ BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
...
@@ -445,12 +425,12 @@ BOOL WINAPI CryptAcquireContextW (HCRYPTPROV *phProv, LPCWSTR pszContainer,
}
}
RegCloseKey
(
key
);
RegCloseKey
(
key
);
}
else
{
}
else
{
if
(
!
(
provname
=
CRYPT_Alloc
((
strlenW
(
pszProvider
)
+
1
)
*
sizeof
(
WCHAR
)))
)
if
(
!
(
provname
=
CRYPT_Alloc
((
l
strlenW
(
pszProvider
)
+
1
)
*
sizeof
(
WCHAR
)))
)
{
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
goto
error
;
goto
error
;
}
}
strcpyW
(
provname
,
pszProvider
);
l
strcpyW
(
provname
,
pszProvider
);
}
}
keyname
=
CRYPT_GetProvKeyName
(
provname
);
keyname
=
CRYPT_GetProvKeyName
(
provname
);
...
@@ -1343,7 +1323,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
...
@@ -1343,7 +1323,7 @@ BOOL WINAPI CryptEnumProviderTypesW (DWORD dwIndex, DWORD *pdwReserved,
RegOpenKeyW
(
hKey
,
keyname
,
&
hSubkey
);
RegOpenKeyW
(
hKey
,
keyname
,
&
hSubkey
);
RegCloseKey
(
hKey
);
RegCloseKey
(
hKey
);
ch
=
keyname
+
strlenW
(
keyname
);
ch
=
keyname
+
l
strlenW
(
keyname
);
/* Convert "Type 000" to 0, etc/ */
/* Convert "Type 000" to 0, etc/ */
*
pdwProvType
=
*
(
--
ch
)
-
'0'
;
*
pdwProvType
=
*
(
--
ch
)
-
'0'
;
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
10
;
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
10
;
...
@@ -2135,7 +2115,7 @@ BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *p
...
@@ -2135,7 +2115,7 @@ BOOL WINAPI CryptSetProviderExW (LPCWSTR pszProvName, DWORD dwProvType, DWORD *p
CRYPT_Free
(
keyname
);
CRYPT_Free
(
keyname
);
if
(
RegSetValueExW
(
hTypeKey
,
nameW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
pszProvName
,
if
(
RegSetValueExW
(
hTypeKey
,
nameW
,
0
,
REG_SZ
,
(
const
BYTE
*
)
pszProvName
,
(
strlenW
(
pszProvName
)
+
1
)
*
sizeof
(
WCHAR
)))
(
l
strlenW
(
pszProvName
)
+
1
)
*
sizeof
(
WCHAR
)))
{
{
RegCloseKey
(
hTypeKey
);
RegCloseKey
(
hTypeKey
);
RegCloseKey
(
hProvKey
);
RegCloseKey
(
hProvKey
);
...
...
dlls/advapi32/eventlog.c
View file @
c487f21b
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
#include "evntrace.h"
#include "evntrace.h"
#include "evntprov.h"
#include "evntprov.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "advapi32_misc.h"
#include "advapi32_misc.h"
...
...
dlls/advapi32/lsa.c
View file @
c487f21b
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
#include "advapi32_misc.h"
#include "advapi32_misc.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
...
@@ -344,7 +343,7 @@ static LONG lsa_reflist_add_domain(LSA_REFERENCED_DOMAIN_LIST *list, LSA_UNICODE
...
@@ -344,7 +343,7 @@ static LONG lsa_reflist_add_domain(LSA_REFERENCED_DOMAIN_LIST *list, LSA_UNICODE
{
{
/* try to reuse index */
/* try to reuse index */
if
((
list
->
Domains
[
i
].
Name
.
Length
==
domain
->
Length
)
&&
if
((
list
->
Domains
[
i
].
Name
.
Length
==
domain
->
Length
)
&&
(
!
strncmpiW
(
list
->
Domains
[
i
].
Name
.
Buffer
,
domain
->
Buffer
,
(
domain
->
Length
/
sizeof
(
WCHAR
)))))
(
!
wcsnicmp
(
list
->
Domains
[
i
].
Name
.
Buffer
,
domain
->
Buffer
,
(
domain
->
Length
/
sizeof
(
WCHAR
)))))
{
{
return
i
;
return
i
;
}
}
...
@@ -565,9 +564,9 @@ NTSTATUS WINAPI LsaLookupSids(
...
@@ -565,9 +564,9 @@ NTSTATUS WINAPI LsaLookupSids(
}
}
else
if
(
ConvertSidToStringSidW
(
Sids
[
i
],
&
strsid
))
else
if
(
ConvertSidToStringSidW
(
Sids
[
i
],
&
strsid
))
{
{
(
*
Names
)[
i
].
Name
.
Length
=
strlenW
(
strsid
)
*
sizeof
(
WCHAR
);
(
*
Names
)[
i
].
Name
.
Length
=
l
strlenW
(
strsid
)
*
sizeof
(
WCHAR
);
(
*
Names
)[
i
].
Name
.
MaximumLength
=
(
strlenW
(
strsid
)
+
1
)
*
sizeof
(
WCHAR
);
(
*
Names
)[
i
].
Name
.
MaximumLength
=
(
l
strlenW
(
strsid
)
+
1
)
*
sizeof
(
WCHAR
);
name_fullsize
+=
(
strlenW
(
strsid
)
+
1
)
*
sizeof
(
WCHAR
);
name_fullsize
+=
(
l
strlenW
(
strsid
)
+
1
)
*
sizeof
(
WCHAR
);
LocalFree
(
strsid
);
LocalFree
(
strsid
);
}
}
...
@@ -616,11 +615,11 @@ NTSTATUS WINAPI LsaLookupSids(
...
@@ -616,11 +615,11 @@ NTSTATUS WINAPI LsaLookupSids(
}
}
else
if
(
ConvertSidToStringSidW
(
Sids
[
i
],
&
strsid
))
else
if
(
ConvertSidToStringSidW
(
Sids
[
i
],
&
strsid
))
{
{
strcpyW
((
*
Names
)[
i
].
Name
.
Buffer
,
strsid
);
l
strcpyW
((
*
Names
)[
i
].
Name
.
Buffer
,
strsid
);
LocalFree
(
strsid
);
LocalFree
(
strsid
);
}
}
name_buffer
+=
strlenW
(
name_buffer
)
+
1
;
name_buffer
+=
l
strlenW
(
name_buffer
)
+
1
;
}
}
TRACE
(
"mapped %u out of %u
\n
"
,
mapped
,
Count
);
TRACE
(
"mapped %u out of %u
\n
"
,
mapped
,
Count
);
...
@@ -806,11 +805,11 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
...
@@ -806,11 +805,11 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
{
{
WCHAR
*
dot
;
WCHAR
*
dot
;
dot
=
strrchrW
(
xdi
->
domain_name
,
'.'
);
dot
=
wcsrchr
(
xdi
->
domain_name
,
'.'
);
if
(
dot
)
*
dot
=
0
;
if
(
dot
)
*
dot
=
0
;
struprW
(
xdi
->
domain_name
);
wcsupr
(
xdi
->
domain_name
);
xdi
->
info
.
Name
.
Buffer
=
xdi
->
domain_name
;
xdi
->
info
.
Name
.
Buffer
=
xdi
->
domain_name
;
xdi
->
info
.
Name
.
Length
=
strlenW
(
xdi
->
domain_name
)
*
sizeof
(
WCHAR
);
xdi
->
info
.
Name
.
Length
=
l
strlenW
(
xdi
->
domain_name
)
*
sizeof
(
WCHAR
);
xdi
->
info
.
Name
.
MaximumLength
=
xdi
->
info
.
Name
.
Length
+
sizeof
(
WCHAR
);
xdi
->
info
.
Name
.
MaximumLength
=
xdi
->
info
.
Name
.
Length
+
sizeof
(
WCHAR
);
TRACE
(
"setting Name to %s
\n
"
,
debugstr_w
(
xdi
->
info
.
Name
.
Buffer
));
TRACE
(
"setting Name to %s
\n
"
,
debugstr_w
(
xdi
->
info
.
Name
.
Buffer
));
}
}
...
@@ -1064,7 +1063,7 @@ NTSTATUS WINAPI LsaLookupPrivilegeName(LSA_HANDLE handle, LUID *luid, LSA_UNICOD
...
@@ -1064,7 +1063,7 @@ NTSTATUS WINAPI LsaLookupPrivilegeName(LSA_HANDLE handle, LUID *luid, LSA_UNICOD
if
(
!
(
privnameW
=
get_wellknown_privilege_name
(
luid
)))
if
(
!
(
privnameW
=
get_wellknown_privilege_name
(
luid
)))
return
STATUS_NO_SUCH_PRIVILEGE
;
return
STATUS_NO_SUCH_PRIVILEGE
;
length
=
strlenW
(
privnameW
);
length
=
l
strlenW
(
privnameW
);
*
name
=
heap_alloc
(
sizeof
(
**
name
)
+
(
length
+
1
)
*
sizeof
(
WCHAR
));
*
name
=
heap_alloc
(
sizeof
(
**
name
)
+
(
length
+
1
)
*
sizeof
(
WCHAR
));
if
(
!*
name
)
if
(
!*
name
)
return
STATUS_NO_MEMORY
;
return
STATUS_NO_MEMORY
;
...
...
dlls/advapi32/registry.c
View file @
c487f21b
...
@@ -36,7 +36,6 @@
...
@@ -36,7 +36,6 @@
#include "winerror.h"
#include "winerror.h"
#include "winternl.h"
#include "winternl.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/list.h"
#include "wine/list.h"
...
@@ -365,7 +364,7 @@ LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR subkey, DWORD type, LPCWSTR data
...
@@ -365,7 +364,7 @@ LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR subkey, DWORD type, LPCWSTR data
if
(
type
!=
REG_SZ
||
!
data
)
return
ERROR_INVALID_PARAMETER
;
if
(
type
!=
REG_SZ
||
!
data
)
return
ERROR_INVALID_PARAMETER
;
return
RegSetKeyValueW
(
hkey
,
subkey
,
NULL
,
type
,
data
,
(
strlenW
(
data
)
+
1
)
*
sizeof
(
WCHAR
)
);
return
RegSetKeyValueW
(
hkey
,
subkey
,
NULL
,
type
,
data
,
(
l
strlenW
(
data
)
+
1
)
*
sizeof
(
WCHAR
)
);
}
}
/******************************************************************************
/******************************************************************************
...
@@ -576,7 +575,7 @@ LSTATUS WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey,
...
@@ -576,7 +575,7 @@ LSTATUS WINAPI RegConnectRegistryW( LPCWSTR lpMachineName, HKEY hKey,
lpMachineName
+=
2
;
lpMachineName
+=
2
;
if
(
GetComputerNameW
(
compName
,
&
len
))
if
(
GetComputerNameW
(
compName
,
&
len
))
{
{
if
(
!
strcmpiW
(
lpMachineName
,
compName
))
if
(
!
wcsicmp
(
lpMachineName
,
compName
))
ret
=
RegOpenKeyW
(
hKey
,
NULL
,
phkResult
);
ret
=
RegOpenKeyW
(
hKey
,
NULL
,
phkResult
);
else
else
{
{
...
...
dlls/advapi32/security.c
View file @
c487f21b
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
*
*
*/
*/
#include "config.h"
#include <stdarg.h>
#include <stdarg.h>
#include <string.h>
#include <string.h>
...
@@ -43,7 +41,6 @@
...
@@ -43,7 +41,6 @@
#include "lmcons.h"
#include "lmcons.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
WINE_DEFAULT_DEBUG_CHANNEL
(
advapi
);
...
@@ -272,18 +269,18 @@ static inline DWORD get_security_regkey( LPWSTR full_key_name, DWORD access, HAN
...
@@ -272,18 +269,18 @@ static inline DWORD get_security_regkey( LPWSTR full_key_name, DWORD access, HAN
static
const
WCHAR
current_userW
[]
=
{
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
current_userW
[]
=
{
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
machineW
[]
=
{
'M'
,
'A'
,
'C'
,
'H'
,
'I'
,
'N'
,
'E'
,
0
};
static
const
WCHAR
machineW
[]
=
{
'M'
,
'A'
,
'C'
,
'H'
,
'I'
,
'N'
,
'E'
,
0
};
static
const
WCHAR
usersW
[]
=
{
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
0
};
static
const
WCHAR
usersW
[]
=
{
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
0
};
LPWSTR
p
=
strchrW
(
full_key_name
,
'\\'
);
LPWSTR
p
=
wcschr
(
full_key_name
,
'\\'
);
int
len
=
p
-
full_key_name
;
int
len
=
p
-
full_key_name
;
HKEY
hParent
;
HKEY
hParent
;
if
(
!
p
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
p
)
return
ERROR_INVALID_PARAMETER
;
if
(
strncmpW
(
full_key_name
,
classes_rootW
,
len
)
==
0
)
if
(
wcsncmp
(
full_key_name
,
classes_rootW
,
len
)
==
0
)
hParent
=
HKEY_CLASSES_ROOT
;
hParent
=
HKEY_CLASSES_ROOT
;
else
if
(
strncmpW
(
full_key_name
,
current_userW
,
len
)
==
0
)
else
if
(
wcsncmp
(
full_key_name
,
current_userW
,
len
)
==
0
)
hParent
=
HKEY_CURRENT_USER
;
hParent
=
HKEY_CURRENT_USER
;
else
if
(
strncmpW
(
full_key_name
,
machineW
,
len
)
==
0
)
else
if
(
wcsncmp
(
full_key_name
,
machineW
,
len
)
==
0
)
hParent
=
HKEY_LOCAL_MACHINE
;
hParent
=
HKEY_LOCAL_MACHINE
;
else
if
(
strncmpW
(
full_key_name
,
usersW
,
len
)
==
0
)
else
if
(
wcsncmp
(
full_key_name
,
usersW
,
len
)
==
0
)
hParent
=
HKEY_USERS
;
hParent
=
HKEY_USERS
;
else
else
return
ERROR_INVALID_PARAMETER
;
return
ERROR_INVALID_PARAMETER
;
...
@@ -309,7 +306,7 @@ BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
...
@@ -309,7 +306,7 @@ BOOL ADVAPI_IsLocalComputer(LPCWSTR ServerName)
Result
=
GetComputerNameW
(
buf
,
&
dwSize
);
Result
=
GetComputerNameW
(
buf
,
&
dwSize
);
if
(
Result
&&
(
ServerName
[
0
]
==
'\\'
)
&&
(
ServerName
[
1
]
==
'\\'
))
if
(
Result
&&
(
ServerName
[
0
]
==
'\\'
)
&&
(
ServerName
[
1
]
==
'\\'
))
ServerName
+=
2
;
ServerName
+=
2
;
Result
=
Result
&&
!
lstrcmpW
(
ServerName
,
buf
);
Result
=
Result
&&
!
wcscmp
(
ServerName
,
buf
);
heap_free
(
buf
);
heap_free
(
buf
);
return
Result
;
return
Result
;
...
@@ -652,7 +649,7 @@ LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid )
...
@@ -652,7 +649,7 @@ LookupPrivilegeValueW( LPCWSTR lpSystemName, LPCWSTR lpName, PLUID lpLuid )
{
{
if
(
!
WellKnownPrivNames
[
i
]
)
if
(
!
WellKnownPrivNames
[
i
]
)
continue
;
continue
;
if
(
strcmpiW
(
WellKnownPrivNames
[
i
],
lpName
)
)
if
(
wcsicmp
(
WellKnownPrivNames
[
i
],
lpName
)
)
continue
;
continue
;
lpLuid
->
LowPart
=
i
;
lpLuid
->
LowPart
=
i
;
lpLuid
->
HighPart
=
0
;
lpLuid
->
HighPart
=
0
;
...
@@ -809,7 +806,7 @@ LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName,
...
@@ -809,7 +806,7 @@ LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName,
SetLastError
(
ERROR_NO_SUCH_PRIVILEGE
);
SetLastError
(
ERROR_NO_SUCH_PRIVILEGE
);
return
FALSE
;
return
FALSE
;
}
}
privNameLen
=
strlenW
(
WellKnownPrivNames
[
lpLuid
->
LowPart
]);
privNameLen
=
l
strlenW
(
WellKnownPrivNames
[
lpLuid
->
LowPart
]);
/* Windows crashes if cchName is NULL, so will I */
/* Windows crashes if cchName is NULL, so will I */
if
(
*
cchName
<=
privNameLen
)
if
(
*
cchName
<=
privNameLen
)
{
{
...
@@ -819,7 +816,7 @@ LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName,
...
@@ -819,7 +816,7 @@ LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName,
}
}
else
else
{
{
strcpyW
(
lpName
,
WellKnownPrivNames
[
lpLuid
->
LowPart
]);
l
strcpyW
(
lpName
,
WellKnownPrivNames
[
lpLuid
->
LowPart
]);
*
cchName
=
privNameLen
;
*
cchName
=
privNameLen
;
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1277,7 +1274,7 @@ static BOOL lookup_user_account_name(PSID Sid, PDWORD cbSid, LPWSTR ReferencedDo
...
@@ -1277,7 +1274,7 @@ static BOOL lookup_user_account_name(PSID Sid, PDWORD cbSid, LPWSTR ReferencedDo
ret
=
FALSE
;
ret
=
FALSE
;
}
}
else
if
(
ReferencedDomainName
)
else
if
(
ReferencedDomainName
)
strcpyW
(
ReferencedDomainName
,
domainName
);
l
strcpyW
(
ReferencedDomainName
,
domainName
);
*
cchReferencedDomainName
=
nameLen
;
*
cchReferencedDomainName
=
nameLen
;
...
@@ -1323,7 +1320,7 @@ static BOOL lookup_computer_account_name(PSID Sid, PDWORD cbSid, LPWSTR Referenc
...
@@ -1323,7 +1320,7 @@ static BOOL lookup_computer_account_name(PSID Sid, PDWORD cbSid, LPWSTR Referenc
ret
=
FALSE
;
ret
=
FALSE
;
}
}
else
if
(
ReferencedDomainName
)
else
if
(
ReferencedDomainName
)
strcpyW
(
ReferencedDomainName
,
domainName
);
l
strcpyW
(
ReferencedDomainName
,
domainName
);
*
cchReferencedDomainName
=
nameLen
;
*
cchReferencedDomainName
=
nameLen
;
...
@@ -1360,9 +1357,9 @@ static void split_domain_account( const LSA_UNICODE_STRING *str, LSA_UNICODE_STR
...
@@ -1360,9 +1357,9 @@ static void split_domain_account( const LSA_UNICODE_STRING *str, LSA_UNICODE_STR
static
BOOL
match_domain
(
ULONG
idx
,
const
LSA_UNICODE_STRING
*
domain
)
static
BOOL
match_domain
(
ULONG
idx
,
const
LSA_UNICODE_STRING
*
domain
)
{
{
ULONG
len
=
strlenW
(
ACCOUNT_SIDS
[
idx
].
domain
);
ULONG
len
=
l
strlenW
(
ACCOUNT_SIDS
[
idx
].
domain
);
if
(
len
==
domain
->
Length
/
sizeof
(
WCHAR
)
&&
!
strncmpiW
(
domain
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
domain
,
len
))
if
(
len
==
domain
->
Length
/
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
domain
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
domain
,
len
))
return
TRUE
;
return
TRUE
;
return
FALSE
;
return
FALSE
;
...
@@ -1370,15 +1367,15 @@ static BOOL match_domain( ULONG idx, const LSA_UNICODE_STRING *domain )
...
@@ -1370,15 +1367,15 @@ static BOOL match_domain( ULONG idx, const LSA_UNICODE_STRING *domain )
static
BOOL
match_account
(
ULONG
idx
,
const
LSA_UNICODE_STRING
*
account
)
static
BOOL
match_account
(
ULONG
idx
,
const
LSA_UNICODE_STRING
*
account
)
{
{
ULONG
len
=
strlenW
(
ACCOUNT_SIDS
[
idx
].
account
);
ULONG
len
=
l
strlenW
(
ACCOUNT_SIDS
[
idx
].
account
);
if
(
len
==
account
->
Length
/
sizeof
(
WCHAR
)
&&
!
strncmpiW
(
account
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
account
,
len
))
if
(
len
==
account
->
Length
/
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
account
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
account
,
len
))
return
TRUE
;
return
TRUE
;
if
(
ACCOUNT_SIDS
[
idx
].
alias
)
if
(
ACCOUNT_SIDS
[
idx
].
alias
)
{
{
len
=
strlenW
(
ACCOUNT_SIDS
[
idx
].
alias
);
len
=
l
strlenW
(
ACCOUNT_SIDS
[
idx
].
alias
);
if
(
len
==
account
->
Length
/
sizeof
(
WCHAR
)
&&
!
strncmpiW
(
account
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
alias
,
len
))
if
(
len
==
account
->
Length
/
sizeof
(
WCHAR
)
&&
!
wcsnicmp
(
account
->
Buffer
,
ACCOUNT_SIDS
[
idx
].
alias
,
len
))
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -1426,7 +1423,7 @@ BOOL lookup_local_wellknown_name( const LSA_UNICODE_STRING *account_and_domain,
...
@@ -1426,7 +1423,7 @@ BOOL lookup_local_wellknown_name( const LSA_UNICODE_STRING *account_and_domain,
*
cbSid
=
sidLen
;
*
cbSid
=
sidLen
;
}
}
len
=
strlenW
(
ACCOUNT_SIDS
[
i
].
domain
);
len
=
l
strlenW
(
ACCOUNT_SIDS
[
i
].
domain
);
if
(
*
cchReferencedDomainName
<=
len
||
!
ret
)
if
(
*
cchReferencedDomainName
<=
len
||
!
ret
)
{
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
...
@@ -1435,7 +1432,7 @@ BOOL lookup_local_wellknown_name( const LSA_UNICODE_STRING *account_and_domain,
...
@@ -1435,7 +1432,7 @@ BOOL lookup_local_wellknown_name( const LSA_UNICODE_STRING *account_and_domain,
}
}
else
if
(
ReferencedDomainName
)
else
if
(
ReferencedDomainName
)
{
{
strcpyW
(
ReferencedDomainName
,
ACCOUNT_SIDS
[
i
].
domain
);
l
strcpyW
(
ReferencedDomainName
,
ACCOUNT_SIDS
[
i
].
domain
);
}
}
*
cchReferencedDomainName
=
len
;
*
cchReferencedDomainName
=
len
;
...
@@ -1473,7 +1470,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
...
@@ -1473,7 +1470,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
{
{
/* check to make sure this account is on this computer */
/* check to make sure this account is on this computer */
if
(
GetComputerNameW
(
userName
,
&
nameLen
)
&&
if
(
GetComputerNameW
(
userName
,
&
nameLen
)
&&
(
domain
.
Length
/
sizeof
(
WCHAR
)
!=
nameLen
||
strncmpW
(
domain
.
Buffer
,
userName
,
nameLen
)))
(
domain
.
Length
/
sizeof
(
WCHAR
)
!=
nameLen
||
wcsncmp
(
domain
.
Buffer
,
userName
,
nameLen
)))
{
{
SetLastError
(
ERROR_NONE_MAPPED
);
SetLastError
(
ERROR_NONE_MAPPED
);
ret
=
FALSE
;
ret
=
FALSE
;
...
@@ -1482,7 +1479,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
...
@@ -1482,7 +1479,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
}
}
if
(
GetUserNameW
(
userName
,
&
nameLen
)
&&
if
(
GetUserNameW
(
userName
,
&
nameLen
)
&&
account
.
Length
/
sizeof
(
WCHAR
)
==
nameLen
-
1
&&
!
strncmpW
(
account
.
Buffer
,
userName
,
nameLen
-
1
))
account
.
Length
/
sizeof
(
WCHAR
)
==
nameLen
-
1
&&
!
wcsncmp
(
account
.
Buffer
,
userName
,
nameLen
-
1
))
{
{
ret
=
lookup_user_account_name
(
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
ret
=
lookup_user_account_name
(
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
*
handled
=
TRUE
;
*
handled
=
TRUE
;
...
@@ -1491,7 +1488,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
...
@@ -1491,7 +1488,7 @@ BOOL lookup_local_user_name( const LSA_UNICODE_STRING *account_and_domain,
{
{
nameLen
=
UNLEN
+
1
;
nameLen
=
UNLEN
+
1
;
if
(
GetComputerNameW
(
userName
,
&
nameLen
)
&&
if
(
GetComputerNameW
(
userName
,
&
nameLen
)
&&
account
.
Length
/
sizeof
(
WCHAR
)
==
nameLen
&&
!
strncmpW
(
account
.
Buffer
,
userName
,
nameLen
))
account
.
Length
/
sizeof
(
WCHAR
)
==
nameLen
&&
!
wcsncmp
(
account
.
Buffer
,
userName
,
nameLen
))
{
{
ret
=
lookup_computer_account_name
(
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
ret
=
lookup_computer_account_name
(
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
*
handled
=
TRUE
;
*
handled
=
TRUE
;
...
@@ -1522,7 +1519,7 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
...
@@ -1522,7 +1519,7 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
return
FALSE
;
return
FALSE
;
}
}
if
(
!
lpAccountName
||
!
strcmpW
(
lpAccountName
,
Blank
))
if
(
!
lpAccountName
||
!
wcscmp
(
lpAccountName
,
Blank
))
{
{
lpAccountName
=
BUILTIN
;
lpAccountName
=
BUILTIN
;
}
}
...
@@ -2149,7 +2146,7 @@ static DWORD trustee_to_sid( DWORD nDestinationSidLength, PSID pDestinationSid,
...
@@ -2149,7 +2146,7 @@ static DWORD trustee_to_sid( DWORD nDestinationSidLength, PSID pDestinationSid,
DWORD
sid_size
=
nDestinationSidLength
;
DWORD
sid_size
=
nDestinationSidLength
;
DWORD
domain_size
=
MAX_COMPUTERNAME_LENGTH
+
1
;
DWORD
domain_size
=
MAX_COMPUTERNAME_LENGTH
+
1
;
SID_NAME_USE
use
;
SID_NAME_USE
use
;
if
(
!
strcmpW
(
pTrustee
->
ptstrName
,
CURRENT_USER
))
if
(
!
wcscmp
(
pTrustee
->
ptstrName
,
CURRENT_USER
))
{
{
if
(
!
lookup_user_account_name
(
pDestinationSid
,
&
sid_size
,
NULL
,
&
domain_size
,
&
use
))
if
(
!
lookup_user_account_name
(
pDestinationSid
,
&
sid_size
,
NULL
,
&
domain_size
,
&
use
))
{
{
...
...
dlls/advapi32/service.c
View file @
c487f21b
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winsvc.h"
#include "winsvc.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "advapi32_misc.h"
#include "advapi32_misc.h"
...
@@ -168,9 +167,9 @@ EnumServicesStatusW( SC_HANDLE manager, DWORD type, DWORD state, ENUM_SERVICE_ST
...
@@ -168,9 +167,9 @@ EnumServicesStatusW( SC_HANDLE manager, DWORD type, DWORD state, ENUM_SERVICE_ST
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
{
{
*
ret_size
+=
sizeof
(
ENUM_SERVICE_STATUSW
);
*
ret_size
+=
sizeof
(
ENUM_SERVICE_STATUSW
);
*
ret_size
+=
(
strlenW
(
status_ex
[
i
].
lpServiceName
)
+
1
)
*
sizeof
(
WCHAR
);
*
ret_size
+=
(
l
strlenW
(
status_ex
[
i
].
lpServiceName
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
status_ex
[
i
].
lpDisplayName
)
if
(
status_ex
[
i
].
lpDisplayName
)
*
ret_size
+=
(
strlenW
(
status_ex
[
i
].
lpDisplayName
)
+
1
)
*
sizeof
(
WCHAR
);
*
ret_size
+=
(
l
strlenW
(
status_ex
[
i
].
lpDisplayName
)
+
1
)
*
sizeof
(
WCHAR
);
if
(
*
ret_size
<=
size
)
if
(
*
ret_size
<=
size
)
++*
ret_count
;
++*
ret_count
;
...
@@ -179,14 +178,14 @@ EnumServicesStatusW( SC_HANDLE manager, DWORD type, DWORD state, ENUM_SERVICE_ST
...
@@ -179,14 +178,14 @@ EnumServicesStatusW( SC_HANDLE manager, DWORD type, DWORD state, ENUM_SERVICE_ST
p
=
(
WCHAR
*
)(
status
+
*
ret_count
);
p
=
(
WCHAR
*
)(
status
+
*
ret_count
);
for
(
i
=
0
;
i
<
*
ret_count
;
i
++
)
for
(
i
=
0
;
i
<
*
ret_count
;
i
++
)
{
{
strcpyW
(
p
,
status_ex
[
i
].
lpServiceName
);
l
strcpyW
(
p
,
status_ex
[
i
].
lpServiceName
);
status
[
i
].
lpServiceName
=
(
WCHAR
*
)
p
;
status
[
i
].
lpServiceName
=
(
WCHAR
*
)
p
;
p
+=
strlenW
(
p
)
+
1
;
p
+=
l
strlenW
(
p
)
+
1
;
if
(
status_ex
[
i
].
lpDisplayName
)
if
(
status_ex
[
i
].
lpDisplayName
)
{
{
strcpyW
(
p
,
status_ex
[
i
].
lpDisplayName
);
l
strcpyW
(
p
,
status_ex
[
i
].
lpDisplayName
);
status
[
i
].
lpDisplayName
=
(
WCHAR
*
)
p
;
status
[
i
].
lpDisplayName
=
(
WCHAR
*
)
p
;
p
+=
strlenW
(
p
)
+
1
;
p
+=
l
strlenW
(
p
)
+
1
;
}
}
else
status
[
i
].
lpDisplayName
=
NULL
;
else
status
[
i
].
lpDisplayName
=
NULL
;
...
...
dlls/advapi32/wmi.c
View file @
c487f21b
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
#define _WMI_SOURCE_
#define _WMI_SOURCE_
#include "wmium.h"
#include "wmium.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "advapi32_misc.h"
#include "advapi32_misc.h"
...
...
dlls/kernel32/tests/loader.c
View file @
c487f21b
...
@@ -4044,7 +4044,7 @@ START_TEST(loader)
...
@@ -4044,7 +4044,7 @@ START_TEST(loader)
test_wow64_redirection
();
test_wow64_redirection
();
test_dll_file
(
"ntdll.dll"
,
FALSE
);
test_dll_file
(
"ntdll.dll"
,
FALSE
);
test_dll_file
(
"kernel32.dll"
,
TRUE
);
test_dll_file
(
"kernel32.dll"
,
TRUE
);
test_dll_file
(
"advapi32.dll"
,
TRU
E
);
test_dll_file
(
"advapi32.dll"
,
FALS
E
);
test_dll_file
(
"user32.dll"
,
TRUE
);
test_dll_file
(
"user32.dll"
,
TRUE
);
/* 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
();
...
...
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