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
1ed98cc7
Commit
1ed98cc7
authored
Apr 21, 2006
by
Robert Reif
Committed by
Alexandre Julliard
May 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add some lsa tests.
parent
b871ac4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
.gitignore
dlls/advapi32/tests/.gitignore
+1
-0
Makefile.in
dlls/advapi32/tests/Makefile.in
+1
-0
lsa.c
dlls/advapi32/tests/lsa.c
+87
-0
No files found.
dlls/advapi32/tests/.gitignore
View file @
1ed98cc7
...
...
@@ -4,6 +4,7 @@ crypt_lmhash.ok
crypt_md4.ok
crypt_md5.ok
crypt_sha.ok
lsa.ok
registry.ok
security.ok
testlist.c
dlls/advapi32/tests/Makefile.in
View file @
1ed98cc7
...
...
@@ -11,6 +11,7 @@ CTESTS = \
crypt_md4.c
\
crypt_md5.c
\
crypt_sha.c
\
lsa.c
\
registry.c
\
security.c
...
...
dlls/advapi32/tests/lsa.c
0 → 100644
View file @
1ed98cc7
/*
* Unit tests for lsa functions
*
* Copyright (c) 2006 Robert Reif
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdarg.h>
#include <stdio.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winternl.h"
#include "ntsecapi.h"
#include "wine/test.h"
static
HMODULE
hadvapi32
;
static
NTSTATUS
(
WINAPI
*
pLsaClose
)(
LSA_HANDLE
);
static
NTSTATUS
(
WINAPI
*
pLsaFreeMemory
)(
PVOID
);
static
NTSTATUS
(
WINAPI
*
pLsaOpenPolicy
)(
PLSA_UNICODE_STRING
,
PLSA_OBJECT_ATTRIBUTES
,
ACCESS_MASK
,
PLSA_HANDLE
);
static
NTSTATUS
(
WINAPI
*
pLsaQueryInformationPolicy
)(
LSA_HANDLE
,
POLICY_INFORMATION_CLASS
,
PVOID
*
);
static
BOOL
init
(
void
)
{
hadvapi32
=
GetModuleHandle
(
"advapi32.dll"
);
if
(
hadvapi32
)
{
pLsaClose
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaClose"
);
pLsaFreeMemory
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaFreeMemory"
);
pLsaOpenPolicy
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaOpenPolicy"
);
pLsaQueryInformationPolicy
=
(
void
*
)
GetProcAddress
(
hadvapi32
,
"LsaQueryInformationPolicy"
);
if
(
pLsaClose
&&
pLsaFreeMemory
&&
pLsaOpenPolicy
&&
pLsaQueryInformationPolicy
)
return
TRUE
;
}
return
FALSE
;
}
static
void
test_lsa
(
void
)
{
NTSTATUS
status
;
LSA_HANDLE
handle
;
LSA_OBJECT_ATTRIBUTES
object_attributes
;
ZeroMemory
(
&
object_attributes
,
sizeof
(
object_attributes
));
status
=
pLsaOpenPolicy
(
NULL
,
&
object_attributes
,
POLICY_ALL_ACCESS
,
&
handle
);
ok
(
status
==
STATUS_SUCCESS
,
"LsaOpenPolicy() returned 0x%08lx
\n
"
,
status
);
if
(
status
==
STATUS_SUCCESS
)
{
PPOLICY_PRIMARY_DOMAIN_INFO
domain_info
;
status
=
pLsaQueryInformationPolicy
(
handle
,
PolicyPrimaryDomainInformation
,
(
PVOID
*
)
&
domain_info
);
ok
(
status
==
STATUS_SUCCESS
,
"LsaQueryInformationPolicy() failed, returned 0x%08lx
\n
"
,
status
);
if
(
status
==
STATUS_SUCCESS
)
pLsaFreeMemory
((
LPVOID
)
domain_info
);
status
=
pLsaClose
(
handle
);
ok
(
status
==
STATUS_SUCCESS
,
"LsaClose() failed, returned 0x%08lx
\n
"
,
status
);
}
}
START_TEST
(
lsa
)
{
if
(
!
init
())
return
;
test_lsa
();
}
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