Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f6b2aa4a
Commit
f6b2aa4a
authored
Oct 15, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Compile with -D__WINESRC__.
parent
08422163
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
67 deletions
+72
-67
Makefile.in
dlls/advapi32/tests/Makefile.in
+0
-1
cred.c
dlls/advapi32/tests/cred.c
+14
-13
crypt.c
dlls/advapi32/tests/crypt.c
+20
-20
eventlog.c
dlls/advapi32/tests/eventlog.c
+5
-5
lsa.c
dlls/advapi32/tests/lsa.c
+1
-1
registry.c
dlls/advapi32/tests/registry.c
+23
-18
security.c
dlls/advapi32/tests/security.c
+0
-0
service.c
dlls/advapi32/tests/service.c
+9
-9
No files found.
dlls/advapi32/tests/Makefile.in
View file @
f6b2aa4a
TESTDLL
=
advapi32.dll
TESTDLL
=
advapi32.dll
IMPORTS
=
ole32 advapi32
IMPORTS
=
ole32 advapi32
EXTRADEFS
=
-U__WINESRC__
-DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS
C_SRCS
=
\
C_SRCS
=
\
cred.c
\
cred.c
\
...
...
dlls/advapi32/tests/cred.c
View file @
f6b2aa4a
...
@@ -187,7 +187,7 @@ static void test_CredReadDomainCredentialsA(void)
...
@@ -187,7 +187,7 @@ static void test_CredReadDomainCredentialsA(void)
char
target_name
[]
=
"no_such_target"
;
char
target_name
[]
=
"no_such_target"
;
CREDENTIAL_TARGET_INFORMATIONA
info
=
{
target_name
,
NULL
,
target_name
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
NULL
};
CREDENTIAL_TARGET_INFORMATIONA
info
=
{
target_name
,
NULL
,
target_name
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
0
,
NULL
};
DWORD
count
;
DWORD
count
;
PCREDENTIAL
*
creds
;
PCREDENTIAL
A
*
creds
;
if
(
!
pCredReadDomainCredentialsA
)
if
(
!
pCredReadDomainCredentialsA
)
{
{
...
@@ -744,18 +744,19 @@ static void test_CredIsMarshaledCredentialA(void)
...
@@ -744,18 +744,19 @@ static void test_CredIsMarshaledCredentialA(void)
START_TEST
(
cred
)
START_TEST
(
cred
)
{
{
DWORD
persists
[
CRED_TYPE_MAXIMUM
];
DWORD
persists
[
CRED_TYPE_MAXIMUM
];
HMODULE
mod
=
GetModuleHandleA
(
"advapi32.dll"
);
pCredEnumerateA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredEnumerateA"
);
pCredFree
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredFree"
);
pCredEnumerateA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredEnumerateA"
);
pCredGetSessionTypes
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredGetSessionTypes"
);
pCredFree
=
(
void
*
)
GetProcAddress
(
mod
,
"CredFree"
);
pCredWriteA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredWriteA"
);
pCredGetSessionTypes
=
(
void
*
)
GetProcAddress
(
mod
,
"CredGetSessionTypes"
);
pCredDeleteA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredDeleteA"
);
pCredWriteA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredWriteA"
);
pCredReadA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredReadA"
);
pCredDeleteA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredDeleteA"
);
pCredRenameA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredRenameA"
);
pCredReadA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredReadA"
);
pCredReadDomainCredentialsA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredReadDomainCredentialsA"
);
pCredRenameA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredRenameA"
);
pCredMarshalCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredMarshalCredentialA"
);
pCredReadDomainCredentialsA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredReadDomainCredentialsA"
);
pCredUnmarshalCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredUnmarshalCredentialA"
);
pCredMarshalCredentialA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredMarshalCredentialA"
);
pCredIsMarshaledCredentialA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"advapi32.dll"
),
"CredIsMarshaledCredentialA"
);
pCredUnmarshalCredentialA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredUnmarshalCredentialA"
);
pCredIsMarshaledCredentialA
=
(
void
*
)
GetProcAddress
(
mod
,
"CredIsMarshaledCredentialA"
);
if
(
!
pCredEnumerateA
||
!
pCredFree
||
!
pCredWriteA
||
!
pCredDeleteA
||
!
pCredReadA
)
if
(
!
pCredEnumerateA
||
!
pCredFree
||
!
pCredWriteA
||
!
pCredDeleteA
||
!
pCredReadA
)
{
{
...
...
dlls/advapi32/tests/crypt.c
View file @
f6b2aa4a
...
@@ -474,21 +474,21 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam
...
@@ -474,21 +474,21 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam
HKEY
subkey
;
HKEY
subkey
;
DWORD
size
=
sizeof
(
DWORD
);
DWORD
size
=
sizeof
(
DWORD
);
if
(
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider"
,
&
hKey
))
if
(
RegOpenKey
A
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider"
,
&
hKey
))
return
FALSE
;
return
FALSE
;
RegQueryInfoKey
(
hKey
,
NULL
,
NULL
,
NULL
,
pdwProvCount
,
pcbProvName
,
RegQueryInfoKey
A
(
hKey
,
NULL
,
NULL
,
NULL
,
pdwProvCount
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
(
*
pcbProvName
)
++
;
(
*
pcbProvName
)
++
;
if
(
!
(
*
pszProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbProvName
)))
if
(
!
(
*
pszProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbProvName
)))
return
FALSE
;
return
FALSE
;
RegEnumKeyEx
(
hKey
,
dwIndex
,
*
pszProvName
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
);
RegEnumKeyEx
A
(
hKey
,
dwIndex
,
*
pszProvName
,
pcbProvName
,
NULL
,
NULL
,
NULL
,
NULL
);
(
*
pcbProvName
)
++
;
(
*
pcbProvName
)
++
;
RegOpenKey
(
hKey
,
*
pszProvName
,
&
subkey
);
RegOpenKey
A
(
hKey
,
*
pszProvName
,
&
subkey
);
RegQueryValueEx
(
subkey
,
"Type"
,
NULL
,
NULL
,
(
LPBYTE
)
pdwProvType
,
&
size
);
RegQueryValueEx
A
(
subkey
,
"Type"
,
NULL
,
NULL
,
(
LPBYTE
)
pdwProvType
,
&
size
);
RegCloseKey
(
subkey
);
RegCloseKey
(
subkey
);
RegCloseKey
(
hKey
);
RegCloseKey
(
hKey
);
...
@@ -599,10 +599,10 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
...
@@ -599,10 +599,10 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
DWORD
cbName
;
DWORD
cbName
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
if
(
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider Types"
,
&
hKey
))
if
(
RegOpenKey
A
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider Types"
,
&
hKey
))
return
FALSE
;
return
FALSE
;
if
(
RegQueryInfoKey
(
hKey
,
NULL
,
NULL
,
NULL
,
pdwTypeCount
,
&
cbName
,
NULL
,
if
(
RegQueryInfoKey
A
(
hKey
,
NULL
,
NULL
,
NULL
,
pdwTypeCount
,
&
cbName
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
))
NULL
,
NULL
,
NULL
,
NULL
,
NULL
))
goto
cleanup
;
goto
cleanup
;
cbName
++
;
cbName
++
;
...
@@ -610,7 +610,7 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
...
@@ -610,7 +610,7 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
if
(
!
(
szName
=
LocalAlloc
(
LMEM_ZEROINIT
,
cbName
)))
if
(
!
(
szName
=
LocalAlloc
(
LMEM_ZEROINIT
,
cbName
)))
goto
cleanup
;
goto
cleanup
;
while
(
!
RegEnumKeyEx
(
hKey
,
*
pdwIndex
,
szName
,
&
cbName
,
NULL
,
NULL
,
NULL
,
NULL
))
while
(
!
RegEnumKeyEx
A
(
hKey
,
*
pdwIndex
,
szName
,
&
cbName
,
NULL
,
NULL
,
NULL
,
NULL
))
{
{
cbName
++
;
cbName
++
;
ch
=
szName
+
strlen
(
szName
);
ch
=
szName
+
strlen
(
szName
);
...
@@ -619,15 +619,15 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
...
@@ -619,15 +619,15 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
10
;
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
10
;
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
100
;
*
pdwProvType
+=
(
*
(
--
ch
)
-
'0'
)
*
100
;
if
(
RegOpenKey
(
hKey
,
szName
,
&
hSubKey
))
if
(
RegOpenKey
A
(
hKey
,
szName
,
&
hSubKey
))
break
;
break
;
if
(
!
RegQueryValueEx
(
hSubKey
,
"TypeName"
,
NULL
,
NULL
,
NULL
,
pcbTypeName
))
if
(
!
RegQueryValueEx
A
(
hSubKey
,
"TypeName"
,
NULL
,
NULL
,
NULL
,
pcbTypeName
))
{
{
if
(
!
(
*
pszTypeName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbTypeName
)))
if
(
!
(
*
pszTypeName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbTypeName
)))
break
;
break
;
if
(
!
RegQueryValueEx
(
hSubKey
,
"TypeName"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszTypeName
,
pcbTypeName
))
if
(
!
RegQueryValueEx
A
(
hSubKey
,
"TypeName"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszTypeName
,
pcbTypeName
))
{
{
ret
=
TRUE
;
ret
=
TRUE
;
break
;
break
;
...
@@ -763,14 +763,14 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
...
@@ -763,14 +763,14 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
}
else
}
else
return
FALSE
;
return
FALSE
;
if
(
RegOpenKey
((
dwFlags
&
CRYPT_USER_DEFAULT
)
?
HKEY_CURRENT_USER
:
HKEY_LOCAL_MACHINE
,
keyname
,
&
hKey
))
if
(
RegOpenKey
A
((
dwFlags
&
CRYPT_USER_DEFAULT
)
?
HKEY_CURRENT_USER
:
HKEY_LOCAL_MACHINE
,
keyname
,
&
hKey
))
{
{
LocalFree
(
keyname
);
LocalFree
(
keyname
);
return
FALSE
;
return
FALSE
;
}
}
LocalFree
(
keyname
);
LocalFree
(
keyname
);
if
(
RegQueryValueEx
(
hKey
,
"Name"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszProvName
,
pcbProvName
))
if
(
RegQueryValueEx
A
(
hKey
,
"Name"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszProvName
,
pcbProvName
))
{
{
if
(
GetLastError
()
!=
ERROR_MORE_DATA
)
if
(
GetLastError
()
!=
ERROR_MORE_DATA
)
SetLastError
(
NTE_PROV_TYPE_ENTRY_BAD
);
SetLastError
(
NTE_PROV_TYPE_ENTRY_BAD
);
...
@@ -780,7 +780,7 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
...
@@ -780,7 +780,7 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN
if
(
!
(
*
pszProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbProvName
)))
if
(
!
(
*
pszProvName
=
LocalAlloc
(
LMEM_ZEROINIT
,
*
pcbProvName
)))
return
FALSE
;
return
FALSE
;
if
(
RegQueryValueEx
(
hKey
,
"Name"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszProvName
,
pcbProvName
))
if
(
RegQueryValueEx
A
(
hKey
,
"Name"
,
NULL
,
NULL
,
(
LPBYTE
)
*
pszProvName
,
pcbProvName
))
{
{
if
(
GetLastError
()
!=
ERROR_MORE_DATA
)
if
(
GetLastError
()
!=
ERROR_MORE_DATA
)
SetLastError
(
NTE_PROV_TYPE_ENTRY_BAD
);
SetLastError
(
NTE_PROV_TYPE_ENTRY_BAD
);
...
@@ -899,13 +899,13 @@ static void test_set_provider_ex(void)
...
@@ -899,13 +899,13 @@ static void test_set_provider_ex(void)
ok
(
result
,
"%d
\n
"
,
GetLastError
());
ok
(
result
,
"%d
\n
"
,
GetLastError
());
/* check pdwReserved for NULL */
/* check pdwReserved for NULL */
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
,
PROV_RSA_FULL
,
&
notNull
,
CRYPT_MACHINE_DEFAULT
);
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
_A
,
PROV_RSA_FULL
,
&
notNull
,
CRYPT_MACHINE_DEFAULT
);
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected %i, got %d
\n
"
,
ok
(
!
result
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected %i, got %d
\n
"
,
ERROR_INVALID_PARAMETER
,
GetLastError
());
ERROR_INVALID_PARAMETER
,
GetLastError
());
/* remove the default provider and then set it to MS_DEF_PROV/PROV_RSA_FULL */
/* remove the default provider and then set it to MS_DEF_PROV/PROV_RSA_FULL */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
,
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
|
CRYPT_DELETE_DEFAULT
);
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
_A
,
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
|
CRYPT_DELETE_DEFAULT
);
if
(
!
result
)
if
(
!
result
)
{
{
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
||
broken
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
),
...
@@ -915,7 +915,7 @@ static void test_set_provider_ex(void)
...
@@ -915,7 +915,7 @@ static void test_set_provider_ex(void)
return
;
return
;
}
}
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
,
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
);
result
=
pCryptSetProviderExA
(
MS_DEF_PROV
_A
,
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
);
ok
(
result
,
"%d
\n
"
,
GetLastError
());
ok
(
result
,
"%d
\n
"
,
GetLastError
());
/* call CryptGetDefaultProvider to see if they match */
/* call CryptGetDefaultProvider to see if they match */
...
@@ -925,8 +925,8 @@ static void test_set_provider_ex(void)
...
@@ -925,8 +925,8 @@ static void test_set_provider_ex(void)
goto
reset
;
goto
reset
;
result
=
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
pszProvName
,
&
cbProvName
);
result
=
pCryptGetDefaultProviderA
(
PROV_RSA_FULL
,
NULL
,
CRYPT_MACHINE_DEFAULT
,
pszProvName
,
&
cbProvName
);
ok
(
result
&&
!
strcmp
(
MS_DEF_PROV
,
pszProvName
),
"expected %s, got %s
\n
"
,
MS_DEF_PROV
,
pszProvName
);
ok
(
result
&&
!
strcmp
(
MS_DEF_PROV
_A
,
pszProvName
),
"expected %s, got %s
\n
"
,
MS_DEF_PROV_A
,
pszProvName
);
ok
(
result
&&
cbProvName
==
(
strlen
(
MS_DEF_PROV
)
+
1
),
"expected %i, got %d
\n
"
,
(
lstrlenA
(
MS_DEF_PROV
)
+
1
),
cbProvName
);
ok
(
result
&&
cbProvName
==
(
strlen
(
MS_DEF_PROV
_A
)
+
1
),
"expected %i, got %d
\n
"
,
(
lstrlenA
(
MS_DEF_PROV_A
)
+
1
),
cbProvName
);
LocalFree
(
pszProvName
);
LocalFree
(
pszProvName
);
...
@@ -1026,7 +1026,7 @@ static void test_rc2_keylen(void)
...
@@ -1026,7 +1026,7 @@ static void test_rc2_keylen(void)
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
pCryptAcquireContextA
(
&
provider
,
NULL
,
MS_DEF_PROV
,
ret
=
pCryptAcquireContextA
(
&
provider
,
NULL
,
MS_DEF_PROV
_A
,
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
PROV_RSA_FULL
,
CRYPT_VERIFYCONTEXT
);
ok
(
ret
,
"CryptAcquireContext error %08x
\n
"
,
GetLastError
());
ok
(
ret
,
"CryptAcquireContext error %08x
\n
"
,
GetLastError
());
...
...
dlls/advapi32/tests/eventlog.c
View file @
f6b2aa4a
...
@@ -761,11 +761,11 @@ static void test_readwrite(void)
...
@@ -761,11 +761,11 @@ static void test_readwrite(void)
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
ReportEvent
(
handle
,
0x20
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
);
ret
=
ReportEvent
A
(
handle
,
0x20
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
);
if
(
!
ret
&&
GetLastError
()
==
ERROR_CRC
)
if
(
!
ret
&&
GetLastError
()
==
ERROR_CRC
)
{
{
win_skip
(
"Win7 fails when using incorrect event types
\n
"
);
win_skip
(
"Win7 fails when using incorrect event types
\n
"
);
ret
=
ReportEvent
(
handle
,
0
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
);
ret
=
ReportEvent
A
(
handle
,
0
,
0
,
0
,
NULL
,
0
,
0
,
NULL
,
NULL
);
ok
(
ret
,
"Expected success : %d
\n
"
,
GetLastError
());
ok
(
ret
,
"Expected success : %d
\n
"
,
GetLastError
());
}
}
else
else
...
@@ -822,9 +822,9 @@ static void test_readwrite(void)
...
@@ -822,9 +822,9 @@ static void test_readwrite(void)
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
ok
(
handle
!=
NULL
,
"Expected a handle
\n
"
);
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
ReportEvent
(
handle
,
read_write
[
i
].
evt_type
,
read_write
[
i
].
evt_cat
,
ret
=
ReportEvent
A
(
handle
,
read_write
[
i
].
evt_type
,
read_write
[
i
].
evt_cat
,
read_write
[
i
].
evt_id
,
run_sidtests
?
user
:
NULL
,
read_write
[
i
].
evt_id
,
run_sidtests
?
user
:
NULL
,
read_write
[
i
].
evt_numstrings
,
0
,
read_write
[
i
].
evt_strings
,
NULL
);
read_write
[
i
].
evt_numstrings
,
0
,
read_write
[
i
].
evt_strings
,
NULL
);
ok
(
ret
,
"Expected ReportEvent success : %d
\n
"
,
GetLastError
());
ok
(
ret
,
"Expected ReportEvent success : %d
\n
"
,
GetLastError
());
count
=
0xdeadbeef
;
count
=
0xdeadbeef
;
...
...
dlls/advapi32/tests/lsa.c
View file @
f6b2aa4a
...
@@ -47,7 +47,7 @@ static NTSTATUS (WINAPI *pLsaLookupSids)(LSA_HANDLE,ULONG,PSID*,LSA_REFERENCED_D
...
@@ -47,7 +47,7 @@ static NTSTATUS (WINAPI *pLsaLookupSids)(LSA_HANDLE,ULONG,PSID*,LSA_REFERENCED_D
static
BOOL
init
(
void
)
static
BOOL
init
(
void
)
{
{
hadvapi32
=
GetModuleHandle
(
"advapi32.dll"
);
hadvapi32
=
GetModuleHandle
A
(
"advapi32.dll"
);
pLsaClose
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaClose"
);
pLsaClose
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaClose"
);
pLsaEnumerateAccountRights
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaEnumerateAccountRights"
);
pLsaEnumerateAccountRights
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaEnumerateAccountRights"
);
...
...
dlls/advapi32/tests/registry.c
View file @
f6b2aa4a
...
@@ -31,6 +31,11 @@
...
@@ -31,6 +31,11 @@
#include "winerror.h"
#include "winerror.h"
#include "aclapi.h"
#include "aclapi.h"
#undef SE_BACKUP_NAME
#undef SE_RESTORE_NAME
#define SE_BACKUP_NAME "SeBackupPrivilege"
#define SE_RESTORE_NAME "SeRestorePrivilege"
#define IS_HKCR(hk) ((UINT_PTR)hk > 0 && ((UINT_PTR)hk & 3) == 2)
#define IS_HKCR(hk) ((UINT_PTR)hk > 0 && ((UINT_PTR)hk & 3) == 2)
static
HKEY
hkey_main
;
static
HKEY
hkey_main
;
...
@@ -1084,8 +1089,8 @@ static void test_reg_create_key(void)
...
@@ -1084,8 +1089,8 @@ static void test_reg_create_key(void)
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
/* clean up */
/* clean up */
RegDeleteKey
(
hkey2
,
""
);
RegDeleteKey
A
(
hkey2
,
""
);
RegDeleteKey
(
hkey1
,
""
);
RegDeleteKey
A
(
hkey1
,
""
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey1
);
RegCloseKey
(
hkey1
);
...
@@ -1103,8 +1108,8 @@ static void test_reg_create_key(void)
...
@@ -1103,8 +1108,8 @@ static void test_reg_create_key(void)
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
/* clean up */
/* clean up */
RegDeleteKey
(
hkey2
,
""
);
RegDeleteKey
A
(
hkey2
,
""
);
RegDeleteKey
(
hkey1
,
""
);
RegDeleteKey
A
(
hkey1
,
""
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey2
);
RegCloseKey
(
hkey1
);
RegCloseKey
(
hkey1
);
...
@@ -1114,7 +1119,7 @@ static void test_reg_create_key(void)
...
@@ -1114,7 +1119,7 @@ static void test_reg_create_key(void)
ok
(
ret
==
ERROR_BAD_PATHNAME
,
"expected ERROR_BAD_PATHNAME, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_BAD_PATHNAME
,
"expected ERROR_BAD_PATHNAME, got %d
\n
"
,
ret
);
else
{
else
{
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
ok
(
!
ret
,
"RegCreateKeyExA failed with error %d
\n
"
,
ret
);
RegDeleteKey
(
hkey1
,
NULL
);
RegDeleteKey
A
(
hkey1
,
NULL
);
RegCloseKey
(
hkey1
);
RegCloseKey
(
hkey1
);
}
}
...
@@ -1248,7 +1253,7 @@ static void test_reg_delete_key(void)
...
@@ -1248,7 +1253,7 @@ static void test_reg_delete_key(void)
{
{
DWORD
ret
;
DWORD
ret
;
ret
=
RegDeleteKey
(
hkey_main
,
NULL
);
ret
=
RegDeleteKey
A
(
hkey_main
,
NULL
);
/* There is a bug in NT4 and W2K that doesn't check if the subkey is NULL. If
/* There is a bug in NT4 and W2K that doesn't check if the subkey is NULL. If
* there are also no subkeys available it will delete the key pointed to by hkey_main.
* there are also no subkeys available it will delete the key pointed to by hkey_main.
...
@@ -1271,7 +1276,7 @@ static void test_reg_save_key(void)
...
@@ -1271,7 +1276,7 @@ static void test_reg_save_key(void)
{
{
DWORD
ret
;
DWORD
ret
;
ret
=
RegSaveKey
(
hkey_main
,
"saved_key"
,
NULL
);
ret
=
RegSaveKey
A
(
hkey_main
,
"saved_key"
,
NULL
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
}
}
...
@@ -1280,10 +1285,10 @@ static void test_reg_load_key(void)
...
@@ -1280,10 +1285,10 @@ static void test_reg_load_key(void)
DWORD
ret
;
DWORD
ret
;
HKEY
hkHandle
;
HKEY
hkHandle
;
ret
=
RegLoadKey
(
HKEY_LOCAL_MACHINE
,
"Test"
,
"saved_key"
);
ret
=
RegLoadKey
A
(
HKEY_LOCAL_MACHINE
,
"Test"
,
"saved_key"
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ret
=
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"Test"
,
&
hkHandle
);
ret
=
RegOpenKey
A
(
HKEY_LOCAL_MACHINE
,
"Test"
,
&
hkHandle
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
RegCloseKey
(
hkHandle
);
RegCloseKey
(
hkHandle
);
...
@@ -1293,11 +1298,11 @@ static void test_reg_unload_key(void)
...
@@ -1293,11 +1298,11 @@ static void test_reg_unload_key(void)
{
{
DWORD
ret
;
DWORD
ret
;
ret
=
RegUnLoadKey
(
HKEY_LOCAL_MACHINE
,
"Test"
);
ret
=
RegUnLoadKey
A
(
HKEY_LOCAL_MACHINE
,
"Test"
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
ok
(
ret
==
ERROR_SUCCESS
,
"expected ERROR_SUCCESS, got %d
\n
"
,
ret
);
DeleteFile
(
"saved_key"
);
DeleteFile
A
(
"saved_key"
);
DeleteFile
(
"saved_key.LOG"
);
DeleteFile
A
(
"saved_key.LOG"
);
}
}
static
BOOL
set_privileges
(
LPCSTR
privilege
,
BOOL
set
)
static
BOOL
set_privileges
(
LPCSTR
privilege
,
BOOL
set
)
...
@@ -1309,7 +1314,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set)
...
@@ -1309,7 +1314,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set)
if
(
!
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_ADJUST_PRIVILEGES
,
&
hToken
))
if
(
!
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_ADJUST_PRIVILEGES
,
&
hToken
))
return
FALSE
;
return
FALSE
;
if
(
!
LookupPrivilegeValue
(
NULL
,
privilege
,
&
luid
))
if
(
!
LookupPrivilegeValue
A
(
NULL
,
privilege
,
&
luid
))
{
{
CloseHandle
(
hToken
);
CloseHandle
(
hToken
);
return
FALSE
;
return
FALSE
;
...
@@ -1704,7 +1709,7 @@ static void test_rw_order(void)
...
@@ -1704,7 +1709,7 @@ static void test_rw_order(void)
ok
(
!
RegEnumValueA
(
hKey
,
3
,
value_buf
,
&
value_len
,
NULL
,
NULL
,
NULL
,
NULL
),
"RegEnumValueA failed
\n
"
);
ok
(
!
RegEnumValueA
(
hKey
,
3
,
value_buf
,
&
value_len
,
NULL
,
NULL
,
NULL
,
NULL
),
"RegEnumValueA failed
\n
"
);
todo_wine
ok
(
strcmp
(
value_buf
,
"B"
)
==
0
,
"Expected name
\"
B
\"
, got %s
\n
"
,
value_buf
);
todo_wine
ok
(
strcmp
(
value_buf
,
"B"
)
==
0
,
"Expected name
\"
B
\"
, got %s
\n
"
,
value_buf
);
ok
(
!
RegDeleteKey
(
HKEY_CURRENT_USER
,
keyname
),
"Failed to delete key
\n
"
);
ok
(
!
RegDeleteKey
A
(
HKEY_CURRENT_USER
,
keyname
),
"Failed to delete key
\n
"
);
}
}
static
void
test_symlinks
(
void
)
static
void
test_symlinks
(
void
)
...
@@ -1822,10 +1827,10 @@ static void test_symlinks(void)
...
@@ -1822,10 +1827,10 @@ static void test_symlinks(void)
KEY_ALL_ACCESS
,
NULL
,
&
key
,
NULL
);
KEY_ALL_ACCESS
,
NULL
,
&
key
,
NULL
);
ok
(
err
==
ERROR_ALREADY_EXISTS
,
"RegCreateKeyEx wrong error %u
\n
"
,
err
);
ok
(
err
==
ERROR_ALREADY_EXISTS
,
"RegCreateKeyEx wrong error %u
\n
"
,
err
);
err
=
RegDeleteKey
(
hkey_main
,
"target"
);
err
=
RegDeleteKey
A
(
hkey_main
,
"target"
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKey failed error %u
\n
"
,
err
);
ok
(
err
==
ERROR_SUCCESS
,
"RegDeleteKey failed error %u
\n
"
,
err
);
err
=
RegDeleteKey
(
hkey_main
,
"link"
);
err
=
RegDeleteKey
A
(
hkey_main
,
"link"
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"RegDeleteKey wrong error %u
\n
"
,
err
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"RegDeleteKey wrong error %u
\n
"
,
err
);
status
=
pNtDeleteKey
(
link
);
status
=
pNtDeleteKey
(
link
);
...
@@ -2362,7 +2367,7 @@ static void test_classesroot(void)
...
@@ -2362,7 +2367,7 @@ static void test_classesroot(void)
RegCloseKey
(
hklmsub1
);
RegCloseKey
(
hklmsub1
);
/* delete subkey1 from hkcr (should point at user's classes) */
/* delete subkey1 from hkcr (should point at user's classes) */
res
=
RegDeleteKey
(
hkcr
,
"subkey1"
);
res
=
RegDeleteKey
A
(
hkcr
,
"subkey1"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegDeleteKey failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegDeleteKey failed: %d
\n
"
,
res
);
/* confirm key was removed in hkey but not hklm */
/* confirm key was removed in hkey but not hklm */
...
@@ -2373,7 +2378,7 @@ static void test_classesroot(void)
...
@@ -2373,7 +2378,7 @@ static void test_classesroot(void)
ok
(
!
IS_HKCR
(
hklmsub1
),
"hkcr mask set in %p
\n
"
,
hklmsub1
);
ok
(
!
IS_HKCR
(
hklmsub1
),
"hkcr mask set in %p
\n
"
,
hklmsub1
);
/* delete subkey1 from hkcr again (which should now point at hklm) */
/* delete subkey1 from hkcr again (which should now point at hklm) */
res
=
RegDeleteKey
(
hkcr
,
"subkey1"
);
res
=
RegDeleteKey
A
(
hkcr
,
"subkey1"
);
ok
(
res
==
ERROR_SUCCESS
,
"RegDeleteKey failed: %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"RegDeleteKey failed: %d
\n
"
,
res
);
/* confirm hkey was removed in hklm */
/* confirm hkey was removed in hklm */
...
...
dlls/advapi32/tests/security.c
View file @
f6b2aa4a
This diff is collapsed.
Click to expand it.
dlls/advapi32/tests/service.c
View file @
f6b2aa4a
...
@@ -166,7 +166,7 @@ static void test_open_svc(void)
...
@@ -166,7 +166,7 @@ static void test_open_svc(void)
/* Try to open the service with this displayname, unless the displayname equals
/* Try to open the service with this displayname, unless the displayname equals
* the servicename as that would defeat the purpose of this test.
* the servicename as that would defeat the purpose of this test.
*/
*/
if
(
!
lstrcmpi
(
spooler
,
displayname
))
if
(
!
lstrcmpi
A
(
spooler
,
displayname
))
{
{
skip
(
"displayname equals servicename
\n
"
);
skip
(
"displayname equals servicename
\n
"
);
CloseServiceHandle
(
scm_handle
);
CloseServiceHandle
(
scm_handle
);
...
@@ -701,7 +701,7 @@ static void test_get_displayname(void)
...
@@ -701,7 +701,7 @@ static void test_get_displayname(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
servicename
,
displayname
,
&
displaysize
);
ret
=
GetServiceDisplayNameA
(
scm_handle
,
servicename
,
displayname
,
&
displaysize
);
ok
(
ret
,
"Expected success, got error %u
\n
"
,
GetLastError
());
ok
(
ret
,
"Expected success, got error %u
\n
"
,
GetLastError
());
ok
(
!
lstrcmpi
(
displayname
,
servicename
),
ok
(
!
lstrcmpi
A
(
displayname
,
servicename
),
"Expected displayname to be %s, got %s
\n
"
,
servicename
,
displayname
);
"Expected displayname to be %s, got %s
\n
"
,
servicename
,
displayname
);
/* Delete the service */
/* Delete the service */
...
@@ -869,7 +869,7 @@ static void test_get_servicekeyname(void)
...
@@ -869,7 +869,7 @@ static void test_get_servicekeyname(void)
{
{
ok
(
strlen
(
servicename
)
==
tempsize
/
2
,
ok
(
strlen
(
servicename
)
==
tempsize
/
2
,
"Expected the buffer to be twice the length of the string
\n
"
)
;
"Expected the buffer to be twice the length of the string
\n
"
)
;
ok
(
!
lstrcmpi
(
servicename
,
spooler
),
"Expected %s, got %s
\n
"
,
spooler
,
servicename
);
ok
(
!
lstrcmpi
A
(
servicename
,
spooler
),
"Expected %s, got %s
\n
"
,
spooler
,
servicename
);
ok
(
servicesize
==
(
tempsize
*
2
),
ok
(
servicesize
==
(
tempsize
*
2
),
"Expected servicesize not to change if buffer not insufficient
\n
"
)
;
"Expected servicesize not to change if buffer not insufficient
\n
"
)
;
}
}
...
@@ -1057,9 +1057,9 @@ static void test_enum_svc(void)
...
@@ -1057,9 +1057,9 @@ static void test_enum_svc(void)
DWORD
neededW
,
returnedW
;
DWORD
neededW
,
returnedW
;
DWORD
tempneeded
,
tempreturned
,
missing
;
DWORD
tempneeded
,
tempreturned
,
missing
;
DWORD
servicecountactive
,
servicecountinactive
;
DWORD
servicecountactive
,
servicecountinactive
;
ENUM_SERVICE_STATUS
*
services
;
ENUM_SERVICE_STATUS
A
*
services
;
ENUM_SERVICE_STATUSW
*
servicesW
;
ENUM_SERVICE_STATUSW
*
servicesW
;
ENUM_SERVICE_STATUS_PROCESS
*
exservices
;
ENUM_SERVICE_STATUS_PROCESS
A
*
exservices
;
UINT
i
;
UINT
i
;
/* All NULL or wrong */
/* All NULL or wrong */
...
@@ -1289,7 +1289,7 @@ static void test_enum_svc(void)
...
@@ -1289,7 +1289,7 @@ static void test_enum_svc(void)
/* Allocate less than the needed bytes and don't specify a resume handle */
/* Allocate less than the needed bytes and don't specify a resume handle */
services
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tempneeded
);
services
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tempneeded
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
A
);
needed
=
0xdeadbeef
;
needed
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1302,7 +1302,7 @@ static void test_enum_svc(void)
...
@@ -1302,7 +1302,7 @@ static void test_enum_svc(void)
"Expected ERROR_MORE_DATA, got %d
\n
"
,
GetLastError
());
"Expected ERROR_MORE_DATA, got %d
\n
"
,
GetLastError
());
/* Allocate less than the needed bytes, this time with a correct resume handle */
/* Allocate less than the needed bytes, this time with a correct resume handle */
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
A
);
needed
=
0xdeadbeef
;
needed
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
resume
=
0
;
resume
=
0
;
...
@@ -1604,7 +1604,7 @@ static void test_enum_svc(void)
...
@@ -1604,7 +1604,7 @@ static void test_enum_svc(void)
/* Allocate less than the needed bytes and don't specify a resume handle */
/* Allocate less than the needed bytes and don't specify a resume handle */
exservices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tempneeded
);
exservices
=
HeapAlloc
(
GetProcessHeap
(),
0
,
tempneeded
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
A
);
needed
=
0xdeadbeef
;
needed
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1617,7 +1617,7 @@ static void test_enum_svc(void)
...
@@ -1617,7 +1617,7 @@ static void test_enum_svc(void)
"Expected ERROR_MORE_DATA, got %d
\n
"
,
GetLastError
());
"Expected ERROR_MORE_DATA, got %d
\n
"
,
GetLastError
());
/* Allocate less than the needed bytes, this time with a correct resume handle */
/* Allocate less than the needed bytes, this time with a correct resume handle */
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
);
bufsize
=
(
tempreturned
-
1
)
*
sizeof
(
ENUM_SERVICE_STATUS
A
);
needed
=
0xdeadbeef
;
needed
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
returned
=
0xdeadbeef
;
resume
=
0
;
resume
=
0
;
...
...
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