1 | //
|
---|
2 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
|
---|
3 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
---|
4 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
|
---|
5 | // PARTICULAR PURPOSE.
|
---|
6 | //
|
---|
7 | // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
|
---|
8 | //
|
---|
9 | // This file contains some global variables that describe what our
|
---|
10 | // sample tile looks like. For example, it defines what fields a tile has
|
---|
11 | // and which fields show in which states of LogonUI.
|
---|
12 | //
|
---|
13 | // Modifications (c) 2009-2010 Oracle Corporation
|
---|
14 | //
|
---|
15 |
|
---|
16 | #ifndef ___common_h
|
---|
17 | #define ___common_h
|
---|
18 |
|
---|
19 | #include <credentialprovider.h>
|
---|
20 | #include <ntsecapi.h>
|
---|
21 | #define SECURITY_WIN32
|
---|
22 | #include <security.h>
|
---|
23 | #include <intsafe.h>
|
---|
24 |
|
---|
25 | #define MAX_ULONG ((ULONG)(-1))
|
---|
26 |
|
---|
27 | // The indexes of each of the fields in our credential provider's tiles.
|
---|
28 | enum SAMPLE_FIELD_ID
|
---|
29 | {
|
---|
30 | SFI_TILEIMAGE = 0,
|
---|
31 | SFI_USERNAME = 1,
|
---|
32 | SFI_PASSWORD = 2,
|
---|
33 | SFI_DOMAINNAME = 3,
|
---|
34 | SFI_SUBMIT_BUTTON = 4,
|
---|
35 | SFI_NUM_FIELDS = 5, /* Note: if new fields are added, keep NUM_FIELDS last. This is used as a count of the number of fields. */
|
---|
36 | };
|
---|
37 |
|
---|
38 | // The first value indicates when the tile is displayed (selected, not selected)
|
---|
39 | // the second indicates things like whether the field is enabled, whether it has key focus, etc.
|
---|
40 | struct FIELD_STATE_PAIR
|
---|
41 | {
|
---|
42 | CREDENTIAL_PROVIDER_FIELD_STATE cpfs;
|
---|
43 | CREDENTIAL_PROVIDER_FIELD_INTERACTIVE_STATE cpfis;
|
---|
44 | };
|
---|
45 |
|
---|
46 | // These two arrays are seperate because a credential provider might
|
---|
47 | // want to set up a credential with various combinations of field state pairs
|
---|
48 | // and field descriptors.
|
---|
49 |
|
---|
50 | // The field state value indicates whether the field is displayed
|
---|
51 | // in the selected tile, the deselected tile, or both.
|
---|
52 | // The Field interactive state indicates when
|
---|
53 | static const FIELD_STATE_PAIR s_rgFieldStatePairs[] =
|
---|
54 | {
|
---|
55 | { CPFS_DISPLAY_IN_BOTH, CPFIS_NONE }, // SFI_TILEIMAGE
|
---|
56 | { CPFS_DISPLAY_IN_BOTH, CPFIS_NONE }, // SFI_USERNAME
|
---|
57 | { CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED }, // SFI_PASSWORD
|
---|
58 | { CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_NONE }, // SFI_SUBMIT_BUTTON
|
---|
59 | { CPFS_DISPLAY_IN_SELECTED_TILE, CPFIS_FOCUSED } // SFI_DOMAINNAME
|
---|
60 | };
|
---|
61 |
|
---|
62 | // Field descriptors for unlock and logon.
|
---|
63 | // The first field is the index of the field.
|
---|
64 | // The second is the type of the field.
|
---|
65 | // The third is the name of the field, NOT the value which will appear in the field.
|
---|
66 | static const CREDENTIAL_PROVIDER_FIELD_DESCRIPTOR s_rgCredProvFieldDescriptors[] =
|
---|
67 | {
|
---|
68 | { SFI_TILEIMAGE, CPFT_TILE_IMAGE, L"Image" },
|
---|
69 | { SFI_USERNAME, CPFT_LARGE_TEXT, L"Username" },
|
---|
70 | { SFI_PASSWORD, CPFT_PASSWORD_TEXT, L"Password" },
|
---|
71 | { SFI_SUBMIT_BUTTON, CPFT_SUBMIT_BUTTON, L"Submit" },
|
---|
72 | { SFI_DOMAINNAME, CPFT_LARGE_TEXT, L"Domain Name" }
|
---|
73 | };
|
---|
74 |
|
---|
75 | #endif ___common_h
|
---|