|
Packit Service |
fa4841 |
/**
|
|
Packit Service |
fa4841 |
* WinPR: Windows Portable Runtime
|
|
Packit Service |
fa4841 |
* Credentials Management UI
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit Service |
fa4841 |
* you may not use this file except in compliance with the License.
|
|
Packit Service |
fa4841 |
* You may obtain a copy of the License at
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit Service |
fa4841 |
*
|
|
Packit Service |
fa4841 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit Service |
fa4841 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit Service |
fa4841 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit Service |
fa4841 |
* See the License for the specific language governing permissions and
|
|
Packit Service |
fa4841 |
* limitations under the License.
|
|
Packit Service |
fa4841 |
*/
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifndef WINPR_CREDUI_H
|
|
Packit Service |
fa4841 |
#define WINPR_CREDUI_H
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <winpr/winpr.h>
|
|
Packit Service |
fa4841 |
#include <winpr/wtypes.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <winpr/nt.h>
|
|
Packit Service |
fa4841 |
#include <winpr/sspi.h>
|
|
Packit Service |
fa4841 |
#include <winpr/error.h>
|
|
Packit Service |
fa4841 |
#include <winpr/credentials.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef _WIN32
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#include <wincred.h>
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_MESSAGE_LENGTH 32767
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_CAPTION_LENGTH 128
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_GENERIC_TARGET_LENGTH CRED_MAX_GENERIC_TARGET_NAME_LENGTH
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_DOMAIN_TARGET_LENGTH CRED_MAX_DOMAIN_TARGET_NAME_LENGTH
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_USERNAME_LENGTH CRED_MAX_USERNAME_LENGTH
|
|
Packit Service |
fa4841 |
#define CREDUI_MAX_PASSWORD_LENGTH (CRED_MAX_CREDENTIAL_BLOB_SIZE / 2)
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_INCORRECT_PASSWORD 0x00000001
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_DO_NOT_PERSIST 0x00000002
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_REQUEST_ADMINISTRATOR 0x00000004
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_EXCLUDE_CERTIFICATES 0x00000008
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_REQUIRE_CERTIFICATE 0x00000010
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_SHOW_SAVE_CHECK_BOX 0x00000040
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_ALWAYS_SHOW_UI 0x00000080
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_REQUIRE_SMARTCARD 0x00000100
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_PASSWORD_ONLY_OK 0x00000200
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_VALIDATE_USERNAME 0x00000400
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_COMPLETE_USERNAME 0x00000800
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_PERSIST 0x00001000
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_SERVER_CREDENTIAL 0x00004000
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x00020000
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x00040000
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_USERNAME_TARGET_CREDENTIALS 0x00080000
|
|
Packit Service |
fa4841 |
#define CREDUI_FLAGS_KEEP_USERNAME 0x00100000
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_GENERIC 0x00000001
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_CHECKBOX 0x00000002
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_AUTHPACKAGE_ONLY 0x00000010
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_IN_CRED_ONLY 0x00000020
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_ENUMERATE_ADMINS 0x00000100
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_ENUMERATE_CURRENT_USER 0x00000200
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_SECURE_PROMPT 0x00001000
|
|
Packit Service |
fa4841 |
#define CREDUIWIN_PACK_32_WOW 0x10000000
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct _CREDUI_INFOA
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
DWORD cbSize;
|
|
Packit Service |
fa4841 |
HWND hwndParent;
|
|
Packit Service |
fa4841 |
PCSTR pszMessageText;
|
|
Packit Service |
fa4841 |
PCSTR pszCaptionText;
|
|
Packit Service |
fa4841 |
HBITMAP hbmBanner;
|
|
Packit Service |
fa4841 |
} CREDUI_INFOA, *PCREDUI_INFOA;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
typedef struct _CREDUI_INFOW
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
DWORD cbSize;
|
|
Packit Service |
fa4841 |
HWND hwndParent;
|
|
Packit Service |
fa4841 |
PCWSTR pszMessageText;
|
|
Packit Service |
fa4841 |
PCWSTR pszCaptionText;
|
|
Packit Service |
fa4841 |
HBITMAP hbmBanner;
|
|
Packit Service |
fa4841 |
} CREDUI_INFOW, *PCREDUI_INFOW;
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
fa4841 |
#define CREDUI_INFO CREDUI_INFOW
|
|
Packit Service |
fa4841 |
#define PCREDUI_INFO PCREDUI_INFOW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
fa4841 |
#define CREDUI_INFO CREDUI_INFOA
|
|
Packit Service |
fa4841 |
#define PCREDUI_INFO PCREDUI_INFOA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
extern "C"
|
|
Packit Service |
fa4841 |
{
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIPromptForCredentialsW(PCREDUI_INFOW pUiInfo, PCWSTR pszTargetName,
|
|
Packit Service |
fa4841 |
PCtxtHandle pContext, DWORD dwAuthError,
|
|
Packit Service |
fa4841 |
PWSTR pszUserName, ULONG ulUserNameBufferSize,
|
|
Packit Service |
fa4841 |
PWSTR pszPassword, ULONG ulPasswordBufferSize,
|
|
Packit Service |
fa4841 |
BOOL* save, DWORD dwFlags);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIPromptForCredentialsA(PCREDUI_INFOA pUiInfo, PCSTR pszTargetName,
|
|
Packit Service |
fa4841 |
PCtxtHandle pContext, DWORD dwAuthError,
|
|
Packit Service |
fa4841 |
PSTR pszUserName, ULONG ulUserNameBufferSize,
|
|
Packit Service |
fa4841 |
PSTR pszPassword, ULONG ulPasswordBufferSize,
|
|
Packit Service |
fa4841 |
BOOL* save, DWORD dwFlags);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIParseUserNameW(CONST WCHAR* UserName, WCHAR* user, ULONG userBufferSize,
|
|
Packit Service |
fa4841 |
WCHAR* domain, ULONG domainBufferSize);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIParseUserNameA(CONST CHAR* userName, CHAR* user, ULONG userBufferSize,
|
|
Packit Service |
fa4841 |
CHAR* domain, ULONG domainBufferSize);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUICmdLinePromptForCredentialsW(PCWSTR pszTargetName, PCtxtHandle pContext,
|
|
Packit Service |
fa4841 |
DWORD dwAuthError, PWSTR UserName,
|
|
Packit Service |
fa4841 |
ULONG ulUserBufferSize, PWSTR pszPassword,
|
|
Packit Service |
fa4841 |
ULONG ulPasswordBufferSize, PBOOL pfSave,
|
|
Packit Service |
fa4841 |
DWORD dwFlags);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUICmdLinePromptForCredentialsA(PCSTR pszTargetName, PCtxtHandle pContext,
|
|
Packit Service |
fa4841 |
DWORD dwAuthError, PSTR UserName,
|
|
Packit Service |
fa4841 |
ULONG ulUserBufferSize, PSTR pszPassword,
|
|
Packit Service |
fa4841 |
ULONG ulPasswordBufferSize, PBOOL pfSave,
|
|
Packit Service |
fa4841 |
DWORD dwFlags);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIConfirmCredentialsW(PCWSTR pszTargetName, BOOL bConfirm);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIConfirmCredentialsA(PCSTR pszTargetName, BOOL bConfirm);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIStoreSSOCredW(PCWSTR pszRealm, PCWSTR pszUsername, PCWSTR pszPassword,
|
|
Packit Service |
fa4841 |
BOOL bPersist);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIStoreSSOCredA(PCSTR pszRealm, PCSTR pszUsername, PCSTR pszPassword,
|
|
Packit Service |
fa4841 |
BOOL bPersist);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIReadSSOCredW(PCWSTR pszRealm, PWSTR* ppszUsername);
|
|
Packit Service |
fa4841 |
WINPR_API DWORD CredUIReadSSOCredA(PCSTR pszRealm, PSTR* ppszUsername);
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef __cplusplus
|
|
Packit Service |
fa4841 |
}
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#ifdef UNICODE
|
|
Packit Service |
fa4841 |
#define CredUIPromptForCredentials CredUIPromptForCredentialsW
|
|
Packit Service |
fa4841 |
#define CredUIParseUserName CredUIParseUserNameW
|
|
Packit Service |
fa4841 |
#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsW
|
|
Packit Service |
fa4841 |
#define CredUIConfirmCredentials CredUIConfirmCredentialsW
|
|
Packit Service |
fa4841 |
#define CredUIStoreSSOCred CredUIStoreSSOCredW
|
|
Packit Service |
fa4841 |
#define CredUIReadSSOCred CredUIReadSSOCredW
|
|
Packit Service |
fa4841 |
#else
|
|
Packit Service |
fa4841 |
#define CredUIPromptForCredentials CredUIPromptForCredentialsA
|
|
Packit Service |
fa4841 |
#define CredUIParseUserName CredUIParseUserNameA
|
|
Packit Service |
fa4841 |
#define CredUICmdLinePromptForCredentials CredUICmdLinePromptForCredentialsA
|
|
Packit Service |
fa4841 |
#define CredUIConfirmCredentials CredUIConfirmCredentialsA
|
|
Packit Service |
fa4841 |
#define CredUIStoreSSOCred CredUIStoreSSOCredA
|
|
Packit Service |
fa4841 |
#define CredUIReadSSOCred CredUIReadSSOCredA
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif
|
|
Packit Service |
fa4841 |
|
|
Packit Service |
fa4841 |
#endif /* WINPR_CREDUI_H */
|