Blame winpr/include/winpr/credui.h

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