58 NameUnknown, NameFullyQualifiedDN, NameSamCompatible, NameDisplay,
59 NameUniqueId, NameCanonical, NameUserPrincipal, NameCanonicalEx,
60 NameServicePrincipal, NameDnsDomain
74 ok(!rc,
"GetComputerObjectName(%u) should fail\n",
formats[
i]);
97 ok(!rc,
"GetComputerObjectName(%u) should fail\n",
formats[
i]);
119 ok(!rc ||
broken(rc) ,
"GetComputerObjectName(%u) should fail\n",
formats[
i]);
143 ok(!rc,
"GetComputerObjectName(%u) should fail\n",
formats[
i]);
171 "GetUserNameExW(%d) failed: %d\n",
176 pGetUserNameExA(NameSamCompatible,
NULL,
NULL);
179 rc = pGetUserNameExA(NameSamCompatible,
NULL, &
size);
181 ok(
size != 0,
"Expected size to be set to required size\n");
186 pGetUserNameExA(NameSamCompatible,
NULL, &
size);
190 rc = pGetUserNameExA(NameSamCompatible,
name, &
size);
192 ok(
size != 0,
"Expected size to be set to required size\n");
195 rc = pGetUserNameExA(NameSamCompatible,
name, &
size);
197 ok(1 <
size,
"Expected size to be set to required size\n");
198 ok(
name[0] == (
char) 0xff,
"Expected unchanged buffer\n");
218 "GetUserNameExW(%d) failed: %d\n",
223 pGetUserNameExW(NameSamCompatible,
NULL,
NULL);
226 rc = pGetUserNameExW(NameSamCompatible,
NULL, &
size);
228 ok(
size != 0,
"Expected size to be set to required size\n");
233 pGetUserNameExW(NameSamCompatible,
NULL, &
size);
237 rc = pGetUserNameExW(NameSamCompatible,
nameW, &
size);
239 ok(
size != 0,
"Expected size to be set to required size\n");
242 rc = pGetUserNameExW(NameSamCompatible,
nameW, &
size);
244 ok(1 <
size,
"Expected size to be set to required size\n");
245 ok(
nameW[0] == (
WCHAR) 0xff,
"Expected unchanged buffer\n");
253 sftA = pInitSecurityInterfaceA();
254 ok(sftA !=
NULL,
"pInitSecurityInterfaceA failed\n");
257 "Reserved2 should be NULL instead of %p in security function table\n",
260 "Reserved3 should be equal to EncryptMessage in the security function table\n");
262 "Reserved4 should be equal to DecryptMessage in the security function table\n");
264 if (!pInitSecurityInterfaceW)
266 win_skip(
"InitSecurityInterfaceW not exported by secur32.dll\n");
270 sftW = pInitSecurityInterfaceW();
271 ok(sftW !=
NULL,
"pInitSecurityInterfaceW failed\n");
273 ok(!sftW->
Reserved2,
"Reserved2 should be NULL instead of %p in security function table\n", sftW->
Reserved2);
274 ok(sftW->
Reserved3 == sftW->
EncryptMessage,
"Reserved3 should be equal to EncryptMessage in the security function table\n");
275 ok(sftW->
Reserved4 == sftW->
DecryptMessage,
"Reserved4 should be equal to DecryptMessage in the security function table\n");
280 static const WCHAR username[] = {
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',0};
281 static const WCHAR domainname[] = {
'd',
'o',
'm',
'a',
'i',
'n',
'n',
'a',
'm',
'e',0};
282 static const WCHAR password[] = {
'p',
'a',
's',
's',
'w',
'o',
'r',
'd',0};
283 const WCHAR *username_ptr, *domainname_ptr, *password_ptr;
287 if (!pSspiEncodeStringsAsAuthIdentity)
289 win_skip(
"SspiEncodeAuthIdentityAsStrings not exported by secur32.dll\n" );
304 ok(
id !=
NULL,
"id not set\n" );
305 pSspiFreeAuthIdentity(
id );
310 ok(
id !=
NULL,
"id not set\n" );
311 pSspiFreeAuthIdentity(
id );
316 ok(
id !=
NULL,
"id not set\n" );
317 pSspiFreeAuthIdentity(
id );
322 ok(
id !=
NULL,
"id not set\n" );
323 pSspiFreeAuthIdentity(
id );
328 ok(
id !=
NULL,
"id not set\n" );
330 username_ptr = domainname_ptr = password_ptr =
NULL;
331 status = pSspiEncodeAuthIdentityAsStrings(
id, &username_ptr, &domainname_ptr, &password_ptr );
334 ok( !
lstrcmpW( domainname, domainname_ptr ),
"wrong domainname\n" );
337 pSspiZeroAuthIdentity(
id );
339 pSspiLocalFree( (
void *)username_ptr );
340 pSspiLocalFree( (
void *)domainname_ptr );
341 pSspiLocalFree( (
void *)password_ptr );
342 pSspiFreeAuthIdentity(
id );
347 ok(
id !=
NULL,
"id not set\n" );
349 username_ptr = password_ptr =
NULL;
350 domainname_ptr = (
const WCHAR *)0xdeadbeef;
351 status = pSspiEncodeAuthIdentityAsStrings(
id, &username_ptr, &domainname_ptr, &password_ptr );
354 ok( domainname_ptr ==
NULL,
"domainname_ptr not cleared\n" );
357 pSspiLocalFree( (
void *)username_ptr );
358 pSspiLocalFree( (
void *)password_ptr );
359 pSspiFreeAuthIdentity(
id );
364 static const WCHAR usernameW[] =
365 {
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',0};
366 static const WCHAR domainnameW[] =
367 {
'd',
'o',
'm',
'a',
'i',
'n',
'n',
'a',
'm',
'e',0};
368 static const WCHAR passwordW[] =
369 {
'p',
'a',
's',
's',
'w',
'o',
'r',
'd',0};
370 static const WCHAR targetW[] =
371 {
'd',
'o',
'm',
'a',
'i',
'n',
'n',
'a',
'm',
'e',
'\\',
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',0};
372 static const WCHAR target2W[] =
373 {
'd',
'o',
'm',
'a',
'i',
'n',
'n',
'a',
'm',
'e',
'2',
'\\',
'u',
's',
'e',
'r',
'n',
'a',
'm',
'e',
'2',0};
380 if (!pSspiPrepareForCredWrite)
382 win_skip(
"SspiPrepareForCredWrite not exported by secur32.dll\n" );
386 status = pSspiEncodeStringsAsAuthIdentity( usernameW, domainnameW, passwordW, &
id );
395 ok( !
memcmp(
blob, passwordW,
sizeof(passwordW) -
sizeof(
WCHAR) ),
"wrong data\n" );
397 pSspiLocalFree( (
void *)
target );
399 pSspiLocalFree(
blob );
407 ok( !
memcmp(
blob, passwordW,
sizeof(passwordW) -
sizeof(
WCHAR) ),
"wrong data\n" );
409 pSspiLocalFree( (
void *)
target );
411 pSspiLocalFree(
blob );
413 pSspiFreeAuthIdentity(
id );
423 SEC_CHAR provider[] = {
'K',
'e',
'r',
'b',
'e',
'r',
'o',
's',0};
425 static const ULONG expected_flags =
441 static const ULONG optional_mask =
452 ok( (
info->fCapabilities & ~optional_mask) == expected_flags,
"got %08x, expected %08x\n",
info->fCapabilities, expected_flags );
453 ok(
info->wVersion == 1,
"got %u\n",
info->wVersion );
455 ok(
info->cbMaxToken >= 12000,
"got %u\n",
info->cbMaxToken );
457 ok( !
lstrcmpA(
info->Comment,
"Microsoft Kerberos V1.0" ),
"got %s\n",
info->Comment );
476 pSspiEncodeAuthIdentityAsStrings = (
void *)
GetProcAddress(
secdll,
"SspiEncodeAuthIdentityAsStrings");
477 pSspiEncodeStringsAsAuthIdentity = (
void *)
GetProcAddress(
secdll,
"SspiEncodeStringsAsAuthIdentity");
489 if (pGetComputerObjectNameA)
492 win_skip(
"GetComputerObjectNameA not exported by secur32.dll\n");
494 if (pGetComputerObjectNameW)
497 win_skip(
"GetComputerObjectNameW not exported by secur32.dll\n");
502 win_skip(
"GetUserNameExA not exported by secur32.dll\n");
507 win_skip(
"GetUserNameExW not exported by secur32.dll\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
static const WCHAR nameW[]
#define ERROR_INSUFFICIENT_BUFFER
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define SECPKG_FLAG_APPCONTAINER_CHECKS
#define SECPKG_FLAG_TOKEN_ONLY
#define SECPKG_FLAG_IMPERSONATION
#define SECPKG_CRED_OUTBOUND
#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION
void * PSEC_WINNT_AUTH_IDENTITY_OPAQUE
#define SECPKG_FLAG_EXTENDED_ERROR
#define FreeCredentialHandle
#define SECPKG_FLAG_PRIVACY
#define SECPKG_FLAG_RESTRICTED_TOKENS
#define SECPKG_FLAG_MULTI_REQUIRED
#define SECPKG_FLAG_CONNECTION
#define SECPKG_FLAG_NEGOTIABLE
#define SECPKG_FLAG_DELEGATION
#define SECPKG_FLAG_INTEGRITY
struct _SECURITY_FUNCTION_TABLE_A * PSecurityFunctionTableA
struct _SECURITY_FUNCTION_TABLE_W * PSecurityFunctionTableW
#define SECPKG_FLAG_MUTUAL_AUTH
#define SECPKG_FLAG_DATAGRAM
#define SECPKG_FLAG_LOGON
#define SECPKG_FLAG_READONLY_WITH_CHECKSUM
#define SECPKG_FLAG_ACCEPT_WIN32_NAME
#define SECPKG_FLAG_GSS_COMPATIBLE
#define RPC_C_AUTHN_GSS_KERBEROS
static PCWSTR PCWSTR PCWSTR *static PCWSTR
static void testGetUserNameExA(void)
static void test_kerberos(void)
static LPSTR lpNameBuffer
static EXTENDED_NAME_FORMAT formats[]
static void test_SspiEncodeStringsAsAuthIdentity(void)
static LPSTR PULONG lpnSize
static void test_SspiPrepareForCredWrite(void)
static void test_InitSecurityInterface(void)
static void testGetComputerObjectNameW(void)
static void testGetComputerObjectNameA(void)
static void testGetUserNameExW(void)
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
ENCRYPT_MESSAGE_FN EncryptMessage
DECRYPT_MESSAGE_FN DecryptMessage
ENCRYPT_MESSAGE_FN EncryptMessage
DECRYPT_MESSAGE_FN DecryptMessage
DWORD WINAPI GetLastError(void)
#define CRED_TYPE_DOMAIN_PASSWORD
#define ERROR_CANT_ACCESS_DOMAIN_INFO
#define WSAHOST_NOT_FOUND
#define SEC_E_INVALID_TOKEN
#define ERROR_NO_SUCH_USER
#define ERROR_NONE_MAPPED
SECURITY_STATUS WINAPI AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse, PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn, PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
SECURITY_STATUS WINAPI QuerySecurityPackageInfoA(SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo)