1 | /* $Id: VBoxCredentialProvider.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxCredentialProvider - Main file of the VirtualBox Credential Provider.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___VBOX_CREDENTIALPROVIDER_H___
|
---|
19 | #define ___VBOX_CREDENTIALPROVIDER_H___
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <iprt/win/windows.h>
|
---|
25 | #include <credentialprovider.h>
|
---|
26 | #include <Shlguid.h>
|
---|
27 |
|
---|
28 | #include "VBoxCredProvUtils.h"
|
---|
29 |
|
---|
30 | /** The VirtualBox credential provider class ID -- must not be changed. */
|
---|
31 | DEFINE_GUID(CLSID_VBoxCredProvider, 0x275d3bcc, 0x22bb, 0x4948, 0xa7, 0xf6, 0x3a, 0x30, 0x54, 0xeb, 0xa9, 0x2b);
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * The credential provider's UI field IDs, used for
|
---|
35 | * handling / identifying them.
|
---|
36 | */
|
---|
37 | enum VBOXCREDPROV_FIELDID
|
---|
38 | {
|
---|
39 | VBOXCREDPROV_FIELDID_TILEIMAGE = 0,
|
---|
40 | VBOXCREDPROV_FIELDID_USERNAME = 1,
|
---|
41 | VBOXCREDPROV_FIELDID_PASSWORD = 2,
|
---|
42 | VBOXCREDPROV_FIELDID_DOMAINNAME = 3,
|
---|
43 | VBOXCREDPROV_FIELDID_SUBMIT_BUTTON = 4,
|
---|
44 | VBOXCREDPROV_FIELDID_PROVIDER_LOGO = 5,
|
---|
45 | VBOXCREDPROV_FIELDID_PROVIDER_LABEL = 6
|
---|
46 | };
|
---|
47 |
|
---|
48 | /* Note: If new fields are added to VBOXCREDPROV_FIELDID and s_VBoxCredProvFields,
|
---|
49 | don't forget to increase this define! */
|
---|
50 | #define VBOXCREDPROV_NUM_FIELDS 7
|
---|
51 |
|
---|
52 | /** Maximum credential provider field length (in characters). */
|
---|
53 | #define VBOXCREDPROV_MAX_FIELD_LEN 255
|
---|
54 |
|
---|
55 | struct VBOXCREDPROV_FIELD
|
---|
56 | {
|
---|
57 | /** The actual description of this field: It's label,
|
---|
58 | * official field type ID, ... */
|
---|
59 | CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR desc;
|
---|
60 | /** The field's display state within the. */
|
---|
61 | CREDENTIAL_PROVIDER_FIELD_STATE state;
|
---|
62 | /** The interactive state: Used when this field gets shown to determine
|
---|
63 | * its state -- currently, only focussing is implemented. */
|
---|
64 | CREDENTIAL_PROVIDER_FIELD_INTERACTIVE_STATE stateInteractive;
|
---|
65 | };
|
---|
66 |
|
---|
67 | #ifndef PCREDENTIAL_PROVIDER_FIELD_DESCRIPTOR
|
---|
68 | #define PCREDENTIAL_PROVIDER_FIELD_DESCRIPTOR CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR*
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | #ifndef CPFG_CREDENTIAL_PROVIDER_LOGO
|
---|
72 | /* 2d837775-f6cd-464e-a745-482fd0b47493 */
|
---|
73 | DEFINE_GUID(CPFG_CREDENTIAL_PROVIDER_LOGO, 0x2d837775, 0xf6cd, 0x464e, 0xa7, 0x45, 0x48, 0x2f, 0xd0, 0xb4, 0x74, 0x93);
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | #ifndef CPFG_CREDENTIAL_PROVIDER_LABEL
|
---|
77 | /* 286BBFF3-BAD4-438F-B007-79B7267C3D48 */
|
---|
78 | DEFINE_GUID(CPFG_CREDENTIAL_PROVIDER_LABEL, 0x286BBFF3, 0xBAD4, 0x438F, 0xB0 ,0x07, 0x79, 0xB7, 0x26, 0x7C, 0x3D, 0x48);
|
---|
79 | #endif
|
---|
80 |
|
---|
81 | /** The credential provider's default fields. */
|
---|
82 | static const VBOXCREDPROV_FIELD s_VBoxCredProvDefaultFields[] =
|
---|
83 | {
|
---|
84 | /** The user's profile image (tile). */
|
---|
85 | { { VBOXCREDPROV_FIELDID_TILEIMAGE, CPFT_TILE_IMAGE, L"Tile Image", 0, }, CPFS_DISPLAY_IN_BOTH, CPFIS_NONE },
|
---|
86 | { { VBOXCREDPROV_FIELDID_USERNAME, CPFT_LARGE_TEXT, L"Username", CPFG_LOGON_USERNAME }, CPFS_DISPLAY_IN_BOTH, CPFIS_NONE },
|
---|
87 | { { VBOXCREDPROV_FIELDID_PASSWORD, CPFT_PASSWORD_TEXT, L"Password", CPFG_LOGON_PASSWORD }, CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED },
|
---|
88 | { { VBOXCREDPROV_FIELDID_DOMAINNAME, CPFT_LARGE_TEXT, L"", 0 }, CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED },
|
---|
89 | { { VBOXCREDPROV_FIELDID_SUBMIT_BUTTON, CPFT_SUBMIT_BUTTON, L"Submit", 0 }, CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED },
|
---|
90 | /** New since Windows 8: The image used to represent a credential provider on the logon page. */
|
---|
91 | { { VBOXCREDPROV_FIELDID_PROVIDER_LOGO, CPFT_TILE_IMAGE, L"Provider Logo", CPFG_CREDENTIAL_PROVIDER_LOGO }, CPFS_HIDDEN /* Not used yet. */, CPFIS_NONE },
|
---|
92 | /** New since Windows 8: The label associated with a credential provider on the logon page. */
|
---|
93 | { { VBOXCREDPROV_FIELDID_PROVIDER_LABEL, CPFT_SMALL_TEXT, L"Provider Label", CPFG_CREDENTIAL_PROVIDER_LABEL }, CPFS_HIDDEN /* Not used yet. */, CPFIS_NONE }
|
---|
94 | };
|
---|
95 |
|
---|
96 | /** Prototypes. */
|
---|
97 | void VBoxCredentialProviderAcquire(void);
|
---|
98 | void VBoxCredentialProviderRelease(void);
|
---|
99 | LONG VBoxCredentialProviderRefCount(void);
|
---|
100 |
|
---|
101 | HRESULT VBoxCredentialProviderCreate(REFCLSID classID,
|
---|
102 | REFIID interfaceID, void **ppvInterface);
|
---|
103 |
|
---|
104 | #endif /* !___VBOX_CREDENTIALPROVIDER_H___ */
|
---|
105 |
|
---|