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
51c7c030
Commit
51c7c030
authored
Aug 16, 2006
by
Robert Reif
Committed by
Alexandre Julliard
Aug 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Fix GetComputerObjectName tests based on feedback from Paul Vriens.
parent
7814420f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
9 deletions
+42
-9
secur32.c
dlls/secur32/tests/secur32.c
+42
-9
No files found.
dlls/secur32/tests/secur32.c
View file @
51c7c030
...
...
@@ -27,22 +27,28 @@
#include "wine/test.h"
static
void
testGetComputerObjectName
()
static
HMODULE
secdll
;
static
BOOLEAN
(
WINAPI
*
pGetComputerObjectNameA
)(
EXTENDED_NAME_FORMAT
NameFormat
,
LPSTR
lpNameBuffer
,
PULONG
lpnSize
);
static
BOOLEAN
(
WINAPI
*
pGetComputerObjectNameW
)(
EXTENDED_NAME_FORMAT
NameFormat
,
LPWSTR
lpNameBuffer
,
PULONG
lpnSize
);
static
EXTENDED_NAME_FORMAT
formats
[]
=
{
NameUnknown
,
NameFullyQualifiedDN
,
NameSamCompatible
,
NameDisplay
,
NameUniqueId
,
NameCanonical
,
NameUserPrincipal
,
NameCanonicalEx
,
NameServicePrincipal
,
NameDnsDomain
};
static
void
testGetComputerObjectNameA
(
void
)
{
char
name
[
256
];
WCHAR
nameW
[
256
];
ULONG
size
;
BOOLEAN
rc
;
int
i
;
EXTENDED_NAME_FORMAT
formats
[]
=
{
NameUnknown
,
NameFullyQualifiedDN
,
NameSamCompatible
,
NameDisplay
,
NameUniqueId
,
NameCanonical
,
NameUserPrincipal
,
NameCanonicalEx
,
NameServicePrincipal
,
NameDnsDomain
};
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]));
i
++
)
{
size
=
sizeof
(
name
);
ZeroMemory
(
name
,
sizeof
(
name
));
rc
=
GetComputerObjectNameA
(
formats
[
i
],
name
,
&
size
);
rc
=
p
GetComputerObjectNameA
(
formats
[
i
],
name
,
&
size
);
ok
(
rc
||
((
formats
[
i
]
==
NameUnknown
)
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
))
||
(
GetLastError
()
==
ERROR_CANT_ACCESS_DOMAIN_INFO
),
...
...
@@ -50,10 +56,20 @@ static void testGetComputerObjectName()
formats
[
i
],
GetLastError
());
if
(
rc
)
trace
(
"GetComputerObjectNameA() returned %s
\n
"
,
name
);
}
}
static
void
testGetComputerObjectNameW
(
void
)
{
WCHAR
nameW
[
256
];
ULONG
size
;
BOOLEAN
rc
;
int
i
;
for
(
i
=
0
;
i
<
(
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]));
i
++
)
{
size
=
sizeof
(
nameW
)
/
sizeof
(
nameW
[
0
]);
ZeroMemory
(
nameW
,
sizeof
(
nameW
));
rc
=
GetComputerObjectNameW
(
formats
[
i
],
nameW
,
&
size
);
rc
=
p
GetComputerObjectNameW
(
formats
[
i
],
nameW
,
&
size
);
ok
(
rc
||
((
formats
[
i
]
==
NameUnknown
)
&&
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
))
||
(
GetLastError
()
==
ERROR_CANT_ACCESS_DOMAIN_INFO
),
...
...
@@ -64,5 +80,22 @@ static void testGetComputerObjectName()
START_TEST
(
secur32
)
{
testGetComputerObjectName
();
secdll
=
LoadLibraryA
(
"secur32.dll"
);
if
(
!
secdll
)
secdll
=
LoadLibraryA
(
"security.dll"
);
if
(
secdll
)
{
pGetComputerObjectNameA
=
(
PVOID
)
GetProcAddress
(
secdll
,
"GetComputerObjectNameA"
);
pGetComputerObjectNameW
=
(
PVOID
)
GetProcAddress
(
secdll
,
"GetComputerObjectNameW"
);
if
(
pGetComputerObjectNameA
)
testGetComputerObjectNameA
();
if
(
pGetComputerObjectNameW
)
testGetComputerObjectNameW
();
FreeLibrary
(
secdll
);
}
}
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