~ubuntu-branches/ubuntu/precise/krb5/precise-updates

« back to all changes in this revision

Viewing changes to src/windows/identity/uilib/khnewcred.h

  • Committer: Package Import Robot
  • Author(s): Sam Hartman
  • Date: 2011-12-01 19:34:41 UTC
  • mfrom: (28.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20111201193441-9tipg3aru1jsidyv
Tags: 1.10+dfsg~alpha1-6
* Fix segfault with unknown hostnames in krb5_sname_to_principal,
  Closes: #650671
* Indicate that this library breaks libsmbclient versions that depend on
  krb5_locate_kdc, Closes: #650603, #650611

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2005 Massachusetts Institute of Technology
3
 
 *
4
 
 * Permission is hereby granted, free of charge, to any person
5
 
 * obtaining a copy of this software and associated documentation
6
 
 * files (the "Software"), to deal in the Software without
7
 
 * restriction, including without limitation the rights to use, copy,
8
 
 * modify, merge, publish, distribute, sublicense, and/or sell copies
9
 
 * of the Software, and to permit persons to whom the Software is
10
 
 * furnished to do so, subject to the following conditions:
11
 
 *
12
 
 * The above copyright notice and this permission notice shall be
13
 
 * included in all copies or substantial portions of the Software.
14
 
 *
15
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
 
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
 
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
 
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
 
 * SOFTWARE.
23
 
 */
24
 
 
25
 
/* $Id$ */
26
 
 
27
 
#ifndef __KHIMAIRA_KHNEWCRED_H
28
 
#define __KHIMAIRA_KHNEWCRED_H
29
 
 
30
 
/********************************************************************
31
 
  New credentials windows
32
 
*********************************************************************/
33
 
 
34
 
/*! \addtogroup khui
35
 
@{ */
36
 
 
37
 
/*! \defgroup khui_cred Credentials acquisition
38
 
 
39
 
    Declarations associated with credentials acquisition.
40
 
 
41
 
@{ */
42
 
 
43
 
/*! \brief Window message sent to credentials type panels
44
 
 
45
 
    This message is sent to the child windows.
46
 
 
47
 
    The format of the message is :
48
 
    - uMsg : KHUI_WM_NC_NOTIFY
49
 
    - HIWORD(wParam) : one of ::khui_wm_nc_notifications
50
 
    - LPARAM : pointer to the ::khui_new_creds structure (except where noted)
51
 
*/
52
 
#define KHUI_WM_NC_NOTIFY (WM_APP + 0x101)
53
 
 
54
 
/*! \brief The first control ID that may be used by an identity provider */
55
 
#define KHUI_CW_ID_MIN 8016
56
 
 
57
 
/*! \brief The maximum number of controls that may be created by an identity provider*/
58
 
#define KHUI_CW_MAX_CTRLS 8
59
 
 
60
 
/*! \brief The maximum control ID that may be used by an identity provider */
61
 
#define KHUI_CW_ID_MAX (KHUI_CW_ID_MIN + KHUI_CW_MAX_CTRLS - 1)
62
 
 
63
 
 
64
 
/*! \brief Credentials dialog notifications
65
 
 
66
 
    These notifications will be sent to the individual dialog
67
 
    procedures of the credential type panels or to the new credentials
68
 
    window as a ::KHUI_WM_NC_NOTIFY message.
69
 
*/
70
 
enum khui_wm_nc_notifications {
71
 
    WMNC_DIALOG_EXPAND = 1,
72
 
    /*!< The dialog is switching from basic to advanced mode or vice
73
 
      versa.
74
 
 
75
 
      In expanded mode, all credentials type panels are visible as
76
 
      opposed to the compressed mode where they are not visible.  The
77
 
      message is not sent to credentials type panels.
78
 
 
79
 
      Only sent to the new credentials window.
80
 
    */
81
 
 
82
 
    WMNC_DIALOG_SETUP,
83
 
    /*!< Sent to the new creds window to notify it that the dialog
84
 
      should create all the type configuration panels.
85
 
 
86
 
      Until this message is issued, none of the credentials type
87
 
      panels exist.  The credentials type panels will receive
88
 
      WM_INITDIALOG etc as per the normal dialog creation process.
89
 
 
90
 
      Only sent to the new credentials window.
91
 
    */
92
 
 
93
 
    WMNC_DIALOG_ACTIVATE,
94
 
    /*!< Sent to the new creds window to notify it that the dialog
95
 
      should do final initialization work and activate.
96
 
 
97
 
      Only sent to the new credentials window.
98
 
    */
99
 
 
100
 
    WMNC_DIALOG_MOVE,
101
 
    /*!< The new credentials window has moved.
102
 
 
103
 
      This message is sent to all the credentials type panels when the
104
 
      new credentials window is being moved.  It will be sent
105
 
      continuously if the user is dragging the window.  Plug-ins
106
 
      rarely need to know their position on the screen.  However, if
107
 
      there are any other windows that were created by the plug-in,
108
 
      such as floating controls or tooltips, they may need to be
109
 
      repositioned in response to this message.
110
 
 
111
 
      Sent to all the credentials type panels.
112
 
     */
113
 
 
114
 
    WMNC_DIALOG_SWITCH_PANEL,
115
 
    /*!< Sent to the new creds window to cause it to switch to the
116
 
      panel identified by LOWORD(wParam).
117
 
 
118
 
      Does nothing if the specified panel is already the current
119
 
      panel.  If the dialog is in compact mode and making the
120
 
      specified panel visible requires switching to expanded mode, the
121
 
      dialog will do so.
122
 
 
123
 
      Only sent to the new credentials window.
124
 
    */
125
 
 
126
 
    WMNC_UPDATE_CREDTEXT,
127
 
    /*!< Update the credentials text associated with a panel.
128
 
 
129
 
      During the new credentials operation, each plug-in is expected
130
 
      to maintain a textual representation of the credentials that the
131
 
      plug-in expects to obtain for the selected identity.  It can,
132
 
      alternatively, be used to indicate the state of the credentials
133
 
      type in respect to the selected identity (for example, whether
134
 
      the credentials type is disabled for the identity and why).
135
 
 
136
 
      This text is not visible when the new credentials window is in
137
 
      basic mode, but it is visible when the window is in advanced
138
 
      mode.  The following image shows the expanded new credentials
139
 
      window including the credentials text from a several plug-ins:
140
 
 
141
 
      \image html new_creds_expanded.png
142
 
 
143
 
      Once this message is received, each plug-in should construct its
144
 
      credentials text string and store it in the \c credtext member
145
 
      of its ::khui_new_creds_by_type structure as shown in the sample
146
 
      code below:
147
 
 
148
 
      \code
149
 
      // Handler for window message WM_NC_NOTIFY with
150
 
      // HWND hwnd, WPARAM wParam and LPARAM lParam
151
 
 
152
 
      // This structure holds the dialog data for the panel.  We
153
 
      // assume it has 'nc' and 'nct' fields that point to the
154
 
      // khui_new_creds and khui_new_creds_by_type structures
155
 
      // respectively.
156
 
 
157
 
      ...
158
 
      struct nc_dialog_data * d;
159
 
      ...
160
 
 
161
 
      // Retrieve the data structure from the dialog user data.
162
 
      d = (struct nc_dialog_data *) GetWindowLongPtr(hwnd, DWLP_USER);
163
 
 
164
 
      switch (HIWORD(wParam)) {
165
 
      case WMNC_UPDATE_CREDTEXT:
166
 
        {
167
 
          wchar_t buffer[KHUI_MAXCCH_LONG_DESC];
168
 
          size_t cb_size;
169
 
 
170
 
          // we are being requested to update the credentials text. We
171
 
          // already allocated a buffer when we created the nct
172
 
          // structure.  So we can just set the text here.
173
 
 
174
 
          // The credentials text should reflect the credentials that
175
 
          // will be obtained when the new credentials operation
176
 
          // completes.
177
 
 
178
 
          assert(d && d->nc && d->nct);
179
 
 
180
 
          if (d->nct->credtext) {
181
 
              free(d->nct->credtext);
182
 
              d->nct->credtext = NULL;
183
 
          }
184
 
 
185
 
          // We only display something if there is a selected identity
186
 
          if (d->nc->n_identities > 0) {
187
 
            StringCbPrintf(buffer, sizeof(buffer),
188
 
                           L"<p>My Credentials<tab>: %s</p>",
189
 
                           get_credential_name(d));
190
 
            StringCbLength(buffer, sizeof(buffer), &cb_size);
191
 
            cb_size += sizeof(wchar_t); // account for the terminating NULL
192
 
 
193
 
            d->nct->credtext = malloc(cb_size);
194
 
            if (d->nct->credtext) {
195
 
               StringCbCopy(d->nct->credtext, cb_size, buffer);
196
 
            }
197
 
          }
198
 
 
199
 
          break;
200
 
        }
201
 
 
202
 
      ... // Handler other notifications
203
 
      }
204
 
      \endcode
205
 
 
206
 
      The text that is specified as the credentials text is formatted
207
 
      hypertext.  For more information about support for formatting
208
 
      and hypertext and handling hyperlinks, see \ref khui_htwnd.
209
 
 
210
 
      \note When this message is sent to the new credentials window,
211
 
      the application will send the ::WMNC_UPDATE_CREDTEXT message to
212
 
      all the credential type panels and update the credential text
213
 
      window. */
214
 
 
215
 
    WMNC_CREDTEXT_LINK,
216
 
    /*!< A hyperlink was activated.
217
 
 
218
 
      Sent to a panel dialog procedure when a user clicks an embedded
219
 
      link in the credentials text that belongs to that panel.  The \a
220
 
      lParam parameter of the message is a pointer to a
221
 
      ::khui_htwnd_link structure describing the link.
222
 
 
223
 
      \see \ref khui_htwnd
224
 
 
225
 
      \note The \a lParam parameter does not point to a
226
 
      ::khui_new_creds structure for this message.
227
 
    */
228
 
 
229
 
    WMNC_IDENTITY_CHANGE,
230
 
    /*!< The primary identity has changed.
231
 
 
232
 
      The ::khui_new_creds structure contains a list of identities to
233
 
      which the current operation should be applied.  In its current
234
 
      implementation, only the first identity in this list is used.
235
 
      Therefore, the list will contain at most one identity.  It is
236
 
      possible for the list to be empty (for example, if the user
237
 
      hasn't selected an identity yet).
238
 
 
239
 
      When handling this notification, the plug-in should check the \c
240
 
      n_identities member of the ::khui_new_creds structure to see
241
 
      whether there are any identities selected.  This value would be
242
 
      either zero or one.  If it is non-zero, then a handle to the
243
 
      selected identity will be in \c khui_new_creds::identities[0].
244
 
 
245
 
      Plug-ins typically use this notfication to load identity
246
 
      specific settings when a new identity is selected.
247
 
 
248
 
      This notification is sent to all the credentials type panels.
249
 
     */
250
 
 
251
 
    WMNC_CLEAR_PROMPTS,
252
 
    /*!< Sent to the new creds window to clear any custom prompts.
253
 
 
254
 
      Only sent to the new credentials window.
255
 
     */
256
 
 
257
 
    WMNC_SET_PROMPTS,
258
 
    /*!< Sent to the new creds window to set custom prompts.
259
 
 
260
 
      Only sent to the new credentials window. */
261
 
 
262
 
    WMNC_DIALOG_PREPROCESS,
263
 
    /*!< The credentials acquisition process is about to start.
264
 
 
265
 
      Sent to all the credentials type panels to notify them that the
266
 
      credentials acquisition process will start.  Once all plug-ins
267
 
      have handled the notification, the application will start
268
 
      sending out <::KMSG_CRED, ::KMSG_CRED_PROCESS> messages to the
269
 
      credentials providers which are participating in the new
270
 
      credentials operation.
271
 
    */
272
 
 
273
 
    WMNC_DIALOG_PROCESS,
274
 
    /*!< This notification is no longer used. */
275
 
#pragma deprecated(WMNC_DIALOG_PROCESS)
276
 
 
277
 
    WMNC_DIALOG_PROCESS_COMPLETE,
278
 
    /*!< Sent to the new creds window to indicate that the all the
279
 
      threads have completed processing.*/
280
 
 
281
 
    WMNC_TYPE_STATE,
282
 
    /*!< Sent to the new creds window as notification that a
283
 
      particular credentials type has changed state from enabled to
284
 
      disabled or vice versa.  The LPARAM member of the message
285
 
      specifies the credentials type identifier for the changed
286
 
      type */
287
 
 
288
 
    WMNC_ADD_CONTROL_ROW,
289
 
    /*!< Add a row of controls to a new cred dialog.  This is an
290
 
      internal message. */
291
 
 
292
 
    WMNC_UPDATE_LAYOUT,
293
 
    /*!< Update the layout of a dialog or window.  This is an internal
294
 
      message. */
295
 
};
296
 
 
297
 
/*! \brief Plugins can use WMNC_NOTIFY message codes from here on up
298
 
 
299
 
    \see ::KHUI_WM_NC_NOTIFY
300
 
 */
301
 
#define WMNC_USER 2048
302
 
 
303
 
/*! \brief Notifications to the identity provider
304
 
 
305
 
    These notifications are sent through to the identity provider's UI
306
 
    callback that was obtained using a ::KMSG_IDENT_GET_UI_CB message.
307
 
 
308
 
    The callback routine is called from the context of the UI thread
309
 
    and is expected to not make any blocking calls.  One of the
310
 
    following commands will be passed in as the \a cmd parameter to
311
 
    the callback.
312
 
 */
313
 
enum khui_wm_nc_ident_notify {
314
 
    WMNC_IDENT_INIT,
315
 
    /*!< Initialize an identity selector for a new credentials
316
 
         dialog. The \a lParam parameter contains a handle to the
317
 
         dialog window which will contain the identity selector
318
 
         controls.  The identity provider may make use of the \a
319
 
         ident_aux field of the ::khui_new_creds structure to hold any
320
 
         data pertaining to the credentials acquisition dialog.*/
321
 
 
322
 
    WMNC_IDENT_WMSG,
323
 
    /*!< Windows message.  Presumably sent from one of the controls
324
 
         that was created by the identity provider.  The callback is
325
 
         expected to return TRUE if it processed the message or FALSE
326
 
         if it did not.  The \a uMsg, \a wParam and \a lParam
327
 
         parameters are set to the values passed in by Windows. */
328
 
 
329
 
    WMNC_IDENT_EXIT,
330
 
    /*!< Terminate a credentials acquisition dialog. Sent just before
331
 
      the dialog is terminated. */
332
 
 
333
 
    WMNC_IDENT_PREPROCESS,
334
 
    /*!< The identity is about to be fetched from the \a
335
 
       ::khui_new_creds structure.  The callback is expected to ensure
336
 
       that the primary identity listed in that structure is
337
 
       consistent with the user selection. */
338
 
};
339
 
 
340
 
/*! \name Standard credtext link IDs
341
 
@{*/
342
 
 
343
 
/*! \brief Switch the panel
344
 
 
345
 
    The \a id attribute of the link specifies the ordinal of the panel
346
 
    to switch to.
347
 
*/
348
 
#define CTLINKID_SWITCH_PANEL L"SwitchPanel"
349
 
 
350
 
/*@}*/
351
 
 
352
 
/*forward dcl*/
353
 
struct tag_khui_new_creds_by_type;
354
 
typedef struct tag_khui_new_creds_by_type khui_new_creds_by_type;
355
 
struct tag_khui_new_creds_prompt;
356
 
typedef struct tag_khui_new_creds_prompt khui_new_creds_prompt;
357
 
struct tag_khui_new_creds;
358
 
typedef struct tag_khui_new_creds khui_new_creds;
359
 
 
360
 
typedef LRESULT
361
 
(KHMAPI *khui_ident_new_creds_cb)(khui_new_creds * nc,
362
 
                                  UINT cmd,
363
 
                                  HWND hwnd,
364
 
                                  UINT uMsg,
365
 
                                  WPARAM wParam,
366
 
                                  LPARAM lParam);
367
 
 
368
 
/*! \brief New credentials acquisition blob
369
 
 
370
 
    A pointer to an object of this type is passed in along with the
371
 
    credentials acquisition messages.
372
 
 
373
 
    \see \ref cred_acq for more information
374
 
*/
375
 
typedef struct tag_khui_new_creds {
376
 
    khm_int32   magic;          /*!< Internal use */
377
 
 
378
 
    khm_int32   subtype;        /*!< Subtype of the request that is
379
 
                                  being handled through this object.
380
 
                                  One of ::KMSG_CRED_NEW_CREDS,
381
 
                                  ::KMSG_CRED_RENEW_CREDS or
382
 
                                  ::KMSG_CRED_PASSWORD */
383
 
 
384
 
    CRITICAL_SECTION cs;        /*!< Internal use */
385
 
 
386
 
    khm_boolean set_default;    /*!< After a successfull credentials
387
 
                                  acquisition, set the primary
388
 
                                  identity as the default. */
389
 
 
390
 
    khm_handle  *identities;    /*!< The list of identities associated
391
 
                                  with this request.  The first
392
 
                                  identity in this list (\a
393
 
                                  identities[0]) is the primary
394
 
                                  identity. */
395
 
 
396
 
    khm_size    n_identities;   /*!< Number of identities in the list
397
 
                                  \a identities */
398
 
 
399
 
    khm_size    nc_identities;  /*!< Internal use */
400
 
 
401
 
    khui_action_context ctx;    /*!< An action context specifying the
402
 
                                  context in which the credentials
403
 
                                  acquisition operation was
404
 
                                  launced. */
405
 
 
406
 
    khm_int32   mode;           /*!< The mode of the user interface.
407
 
                                  One of ::KHUI_NC_MODE_MINI or
408
 
                                  ::KHUI_NC_MODE_EXPANDED. */
409
 
 
410
 
    HWND        hwnd;           /*!< Handle to the new credentials
411
 
                                  window. */
412
 
 
413
 
    struct tag_khui_new_creds_by_type **types;
414
 
                                /*!< Internal use */
415
 
    khm_handle  *type_subs;     /*!< Internal use */
416
 
    khm_size    n_types;        /*!< Internal use */
417
 
    khm_size    nc_types;       /*!< Internal use */
418
 
 
419
 
    khm_int32   result;     /*!< One of ::KHUI_NC_RESULT_CANCEL or
420
 
                                ::KHUI_NC_RESULT_PROCESS indicating
421
 
                                the result of the dialog with the
422
 
                                user */
423
 
 
424
 
    khm_int32   response;   /*!< Response.  See individual message
425
 
                                documentation for info on what to do
426
 
                                with this field */
427
 
 
428
 
    wchar_t     *password;  /*!< Not used. */
429
 
 
430
 
    /* UI stuff */
431
 
 
432
 
    wchar_t     *banner;        /*!< Internal use */
433
 
    wchar_t     *pname;         /*!< Internal use */
434
 
    khm_size    n_prompts;      /*!< Internal use */
435
 
    khm_size    nc_prompts;     /*!< Internal use */
436
 
    struct tag_khui_new_creds_prompt ** prompts; /*!< Internal use */
437
 
 
438
 
    khui_ident_new_creds_cb ident_cb; /*!< Internal use */
439
 
 
440
 
    wchar_t     *window_title;  /*!< Internal use */
441
 
 
442
 
    LPARAM      ident_aux;      /*!< Auxilliary field which is
443
 
                                  reserved for use by the identity
444
 
                                  provider during the course of
445
 
                                  conducting this dialog. */
446
 
 
447
 
} khui_new_creds;
448
 
 
449
 
#define KHUI_NC_MAGIC 0x84270427
450
 
 
451
 
/*!\name Result values for khui_new_creds_t::result
452
 
  @{*/
453
 
#define KHUI_NC_RESULT_PROCESS    0
454
 
#define KHUI_NC_RESULT_CANCEL       1
455
 
/*@}*/
456
 
 
457
 
/*!\name Mode values for khui_new_creds_t::mode
458
 
  @{*/
459
 
#define KHUI_NC_MODE_MINI       0
460
 
#define KHUI_NC_MODE_EXPANDED   1
461
 
/*@}*/
462
 
 
463
 
/*!\name Response values for khui_new_creds_t::response
464
 
  @{*/
465
 
/*!\brief No known response */
466
 
#define KHUI_NC_RESPONSE_NONE     0
467
 
 
468
 
/*!\brief It is okay to exit the dialog now
469
 
 
470
 
    This is the default, which is why it has a value of zero.  In
471
 
    order to prevent the dialog from exiting, set the
472
 
    KHUI_NC_RESPONSE_NOEXIT response bit. */
473
 
#define KHUI_NC_RESPONSE_EXIT     0
474
 
 
475
 
/*!\brief It is NOT okay to exit the dialog now
476
 
 
477
 
    Used to indicate that further user-interaction is necessary to
478
 
    process the dialog.  Usually this is accompanied by setting
479
 
    necessary custom prompts and notifications so the user knows why
480
 
    the dialog is prompting for more information.
481
 
 */
482
 
#define KHUI_NC_RESPONSE_NOEXIT    0x00000002
483
 
 
484
 
/*!\brief The dialog was processed successfully
485
 
 
486
 
    Since this is the default response, the value is zero.  Use one of
487
 
    KHUI_NC_RESPONSE_FAILED or KHUI_NC_RESPONSE_PENDING to indicate an
488
 
    error or pending status.
489
 
 */
490
 
#define KHUI_NC_RESPONSE_SUCCESS  0
491
 
 
492
 
/*!\brief The processing of the dialog failed
493
 
 
494
 
    Self explanatory.  More information about the failure should have
495
 
    been reported using the khlog API, however, this response value
496
 
    indicates to other credential types that depend on this credential
497
 
    type that whatever it was that this credential type was supposed
498
 
    to do didn't happen.
499
 
*/
500
 
#define KHUI_NC_RESPONSE_FAILED    0x00000008
501
 
 
502
 
/*!\brief Further interaction required
503
 
 
504
 
    Set along with KHUI_NC_RESPONSE_NOEXIT although it is not
505
 
    required.  Setting this bit will automatically add the
506
 
    KHUI_NC_RESPONSE_NOEXIT.
507
 
 
508
 
    If this bit is set, all dependent plugins will be set on hold
509
 
    until another round of processing clears the pending bit.
510
 
 */
511
 
#define KHUI_NC_RESPONSE_PENDING   0x00000010
512
 
 
513
 
/*! \brief Completed
514
 
 
515
 
    This is automatically set if the plugin sets a response which does
516
 
    not indicate either KHUI_NC_RESPONSE_NOEXIT or
517
 
    KHUI_NC_RESPONSE_PENDING, which is considered to mean that the
518
 
    plugin is completed processing.
519
 
 
520
 
    This flag cannot be explicitly specified in a response.
521
 
 */
522
 
#define KHUI_NC_RESPONSE_COMPLETED 0x00000020
523
 
 
524
 
/*! \brief Processing
525
 
 
526
 
    This is an internal flag set while the credentials acquisition
527
 
    process is executing.
528
 
 */
529
 
#define KHUI_NC_RESPONSE_PROCESSING 0x00010000
530
 
 
531
 
#define KHUI_NCMASK_RESPONSE (KHUI_NC_RESPONSE_EXIT|KHUI_NC_RESPONSE_NOEXIT)
532
 
#define KHUI_NCMASK_RESULT  (KHUI_NC_RESPONSE_SUCCESS|KHUI_NC_RESPONSE_FAILED|KHUI_NC_RESPONSE_PENDING)
533
 
/*@}*/
534
 
 
535
 
/*!\brief Maximum number of dependencies for a credentials type */
536
 
#define KHUI_MAX_TYPE_DEPS 8
537
 
 
538
 
/*!\brief Maximum number of credential types for a new creds window */
539
 
#define KHUI_MAX_NCTYPES 16
540
 
 
541
 
/*!\brief Maximum number of characters in a password
542
 
 
543
 
  Length includes the termininating NULL
544
 
*/
545
 
#define KHUI_MAXCCH_PASSWORD 512
546
 
 
547
 
/*! \brief Maximum number of bytes in a password
548
 
 
549
 
  Includes terminating NULL
550
 
*/
551
 
#define KHUI_MAXCB_PASSWORD (KHUI_MAXCCH_PASSWORD * sizeof(wchar_t))
552
 
 
553
 
/*! \brief Maximum number of characters in a custom banner
554
 
 
555
 
    Length includes terminating NULL
556
 
*/
557
 
#define KHUI_MAXCCH_BANNER 256
558
 
 
559
 
 
560
 
/*! \brief Maximum number of bytes in a custom banner
561
 
 
562
 
    Length includes terminating NULL
563
 
*/
564
 
#define KHUI_MAXCB_BANNER (KHUI_MAXCCH_BANNER * sizeof(wchar_t))
565
 
 
566
 
/*! \brief Maximum number of characters in a panel name
567
 
 
568
 
    Length includes terminating NULL
569
 
*/
570
 
#define KHUI_MAXCCH_PNAME 256
571
 
 
572
 
/*! \brief Maximum number of bytes in a panel name
573
 
 
574
 
    Length includes terminating NULL
575
 
*/
576
 
#define KHUI_MAXCB_PNAME (KHUI_MAXCCH_PNAME * sizeof(wchar_t))
577
 
 
578
 
/*! \brief A descriptor of a panel in the new credentials acquisition tab
579
 
 
580
 
    When processing certain credentials messages such as
581
 
    ::KMSG_CRED_PASSWORD, ::KMSG_CRED_NEW_CREDS,
582
 
    ::KMSG_CRED_RENEW_CREDS, a pointer to a ::khui_new_creds structure
583
 
    will be passed in to the message handler.  If the handler of the
584
 
    message needs to add one or more credentials types as participants
585
 
    of the operation, the handler will need to call khui_cw_add_type()
586
 
    and specify a ::khui_new_creds_by_type structure.
587
 
 
588
 
    Note that the memory address passed in to the call to
589
 
    khui_cw_add_type() will not be copied.  Therefore, the block of
590
 
    memory should remain as-is for the lifetime of the
591
 
    ::khui_new_creds structure or until it is removed with a call to
592
 
    khui_cw_del_type().
593
 
 
594
 
    Some of the credentials messages that require specifying a
595
 
    ::khui_new_creds_by_type structure require providing a
596
 
    user-interface.  In these cases, the fields marked for providing a
597
 
    UI may be required to hold valid values.  If the message does not
598
 
    require providing a UI, these fields will be ignored.
599
 
*/
600
 
typedef struct tag_khui_new_creds_by_type {
601
 
    khui_new_creds * nc;        /*!< Internal use.  Do not set */
602
 
    khm_int32   flags;          /*!< Internal use.  Do not set */
603
 
 
604
 
    khm_int32   type;           /*!< The identifier of the credentials
605
 
                                  type.  This is a credentials type
606
 
                                  identifier allocated with a call to
607
 
                                  kcdb_credtype_register(). */
608
 
 
609
 
    khm_int32   type_deps[KHUI_MAX_TYPE_DEPS];
610
 
                                /*!< credentials types that this
611
 
                                    credential type depends on.  Each
612
 
                                    element defines a credentials type
613
 
                                    identifier that this type depends
614
 
                                    on for this operation.  The number
615
 
                                    of valid values in this array
616
 
                                    should be specified in the \a
617
 
                                    n_type_deps field. */
618
 
 
619
 
    khm_size    n_type_deps;    /*!< Number of dependencies listed
620
 
                                  above.  Should be between 0 and
621
 
                                  ::KHUI_MAX_TYPE_DEPS.  Specify 0 if
622
 
                                  there are no dependencies. */
623
 
 
624
 
    khm_size    ordinal;        /*!< The requested ordinal.  The UI
625
 
                                  would attempt to place this panel at
626
 
                                  the reqested order in the list of
627
 
                                  panels.  Set to -1 if the order does
628
 
                                  not matter.  Once the dialog is
629
 
                                  activated this field will be updated
630
 
                                  to reflect the actual ordinal of the
631
 
                                  panel. */
632
 
 
633
 
    wchar_t    *name;           /*!< Name of the panel (localized,
634
 
                                  optional).  If NULL, the localized
635
 
                                  name of the credentials type is
636
 
                                  used. Only used if providing a
637
 
                                  user-interface. */
638
 
 
639
 
    HICON       icon;           /*!< Icon for the panel (optional).
640
 
                                  Only used if providing a
641
 
                                  user-interface. */
642
 
 
643
 
    wchar_t    *tooltip;        /*!< Tooltip for the panel (localized,
644
 
                                  optional).  If NULL, no tooltip will
645
 
                                  be assigned for the panel.  Only
646
 
                                  used if providing a
647
 
                                  user-interface.  */
648
 
 
649
 
    HMODULE     h_module;       /*!< Handle to the module containing
650
 
                                  the dialog resource.  Only used if
651
 
                                  providing a user-interface. */
652
 
 
653
 
    LPWSTR      dlg_template;   /*!< The dialog resource.  Only used
654
 
                                  if providing a user-interface. */
655
 
    DLGPROC     dlg_proc;       /*!< The dialog procedure. Only used
656
 
                                  if providing a user-interface. */
657
 
 
658
 
    HWND        hwnd_panel;     /*!< The dialog window.  Once the
659
 
                                  dialog panel is created, a handle to
660
 
                                  the panel will be assigned here.
661
 
                                  Note that the handle is assigned
662
 
                                  after a successful call to
663
 
                                  CreateDialogParam and hence would
664
 
                                  not be available when handling the
665
 
                                  WM_INITDIALOG message from the
666
 
                                  dialog procedure.  Only used of
667
 
                                  providing a user-interface. */
668
 
 
669
 
    HWND        hwnd_tc;        /*!< Internal use. Do not set */
670
 
 
671
 
    wchar_t    *credtext;       /*!< A brief description of the
672
 
                                  current state of this cred
673
 
                                  type. (localized, optional).  Only
674
 
                                  used if providing a
675
 
                                  user-interface. If this field is
676
 
                                  non-NULL, then it should point to a
677
 
                                  NULL terminated string that does not
678
 
                                  exceed ::KHUI_MAXCCH_LONG_DESC
679
 
                                  characters in length including the
680
 
                                  terminating NULL.
681
 
 
682
 
                                  \see \ref khui_htwnd for information
683
 
                                  on how to format the string for this
684
 
                                  field.
685
 
                                */
686
 
 
687
 
    LPARAM      aux;            /*!< auxilliary field.  For use by the
688
 
                                  plug-in. */
689
 
} khui_new_creds_by_type;
690
 
 
691
 
/*!\name Flags for khui_new_creds_by_type
692
 
 
693
 
    Note that KHUI_NC_RESPONSE_SUCCESS, KHUI_NC_RESPONSE_FAILED,
694
 
    KHUI_NC_RESPONSE_PENDING are also stored in the flags.
695
 
 
696
 
@{*/
697
 
#define KHUI_NCT_FLAG_PROCESSED 1024
698
 
#define KHUI_NCT_FLAG_DISABLED  2048
699
 
/*@}*/
700
 
 
701
 
/*! \brief Width of a new creds dialog panel in dialog units*/
702
 
#define NCDLG_WIDTH     300
703
 
/*! \brief Height of a new creds dialog panel in dialog units*/
704
 
#define NCDLG_HEIGHT    166
705
 
 
706
 
/*! \brief A custom prompt */
707
 
typedef struct tag_khui_new_creds_prompt {
708
 
    khm_size    index;          /*!< Set to the zero based index
709
 
                                  of this prompt. */
710
 
 
711
 
    khm_int32   type;           /*!< one of KHUI_NCPROMPT_TYPE_* */
712
 
    wchar_t *   prompt;         /*!< prompt string. Cannot exceed
713
 
                                  KHUI_MAXCCH_PROMPT */
714
 
    wchar_t *   def;            /*!< default value. Cannot exceed
715
 
                                  KHUI_MAXCCH_PROMPT_VALUE */
716
 
    wchar_t *   value;          /*!< On completion, this is set to the
717
 
                                  value that the user entered. Will
718
 
                                  not exceed
719
 
                                  KHUI_MAXCCH_PROMPT_VALUE */
720
 
 
721
 
    khm_int32   flags;          /*!< Combination of
722
 
                                  KHUI_NCPROMPT_FLAG_* */
723
 
 
724
 
    HWND        hwnd_static;    /* internal use */
725
 
    HWND        hwnd_edit;      /* internal use */
726
 
} khui_new_creds_prompt;
727
 
 
728
 
/*! \brief The prompt input is hidden
729
 
 
730
 
    The input is hidden for prompts which accept passwords.  The
731
 
    control which represents the input will display an asterisk or a
732
 
    small circle corresponding to each character typed in, but will
733
 
    not show the actual character.
734
 
 */
735
 
#define KHUI_NCPROMPT_FLAG_HIDDEN   1
736
 
 
737
 
/*! \brief Internal use */
738
 
#define KHUI_NCPROMPT_FLAG_STOCK    2
739
 
 
740
 
/*! \brief Maximum number of characters in a prompt
741
 
 
742
 
    Refers to the prompt text that accompanies an input control.  THe
743
 
    length includes the terminating NULL.
744
 
 */
745
 
#define KHUI_MAXCCH_PROMPT 256
746
 
 
747
 
/*! \brief Maximum number of bytes in a prompt
748
 
 
749
 
    Refers to the prompt text that accompanies an input control.  THe
750
 
    length includes the terminating NULL.
751
 
 */
752
 
#define KHUI_MAXCB_PROMPT (KHUI_MAXCCH_PROMPT * sizeof(wchar_t))
753
 
 
754
 
/*! \brief Maximum number of characters that can be entered in an input control
755
 
 
756
 
    Refers to the input control of a prompt.  The length includes the
757
 
    terminating NULL.
758
 
 */
759
 
#define KHUI_MAXCCH_PROMPT_VALUE 256
760
 
 
761
 
/*! \brief Maximum number of bytes that can be entered in an input control
762
 
 
763
 
    Refers to the input control of a prompt.  The length includes the
764
 
    terminating NULL.
765
 
 */
766
 
#define KHUI_MAXCB_PROMPT_VALUE (KHUI_MAXCCH_PROMPT_VALUE * sizeof(wchar_t))
767
 
 
768
 
/* from krb5.h.  Redefining here because we don't want to depend on
769
 
   krb5.h for all credential types */
770
 
 
771
 
/*! \brief A password control */
772
 
#define KHUI_NCPROMPT_TYPE_PASSWORD             1
773
 
 
774
 
/*! \brief New password control
775
 
 
776
 
    Used when changing the password
777
 
 */
778
 
#define KHUI_NCPROMPT_TYPE_NEW_PASSWORD         2
779
 
 
780
 
/*! \brief New password again control
781
 
 
782
 
    Used when changing the password
783
 
 */
784
 
#define KHUI_NCPROMPT_TYPE_NEW_PASSWORD_AGAIN   3
785
 
 
786
 
/*! \brief Preauthentication (reserved) */
787
 
#define KHUI_NCPROMPT_TYPE_PREAUTH              4
788
 
 
789
 
/*! \brief Control sizes */
790
 
typedef enum tag_khui_control_size {
791
 
    KHUI_CTRLSIZE_SMALL,
792
 
    /*!< A small control fits in about 1/5 the width of the new
793
 
      credentials panel */
794
 
    KHUI_CTRLSIZE_HALF,
795
 
    /*!< Half size controls fit in 1/2 the width of the new
796
 
      credentials panel */
797
 
    KHUI_CTRLSIZE_FULL,
798
 
    /*!< Takes up the whole width of the crednetials panel */
799
 
} khui_control_size;
800
 
 
801
 
/*! \brief Internal use */
802
 
typedef struct tag_khui_control_row {
803
 
    HWND label;
804
 
    HWND input;
805
 
    khui_control_size size;
806
 
} khui_control_row;
807
 
 
808
 
/*! \brief Create a ::khui_new_creds object
809
 
 
810
 
    Creates and initializes a ::khui_new_creds object.  The created
811
 
    object must be destroyed using the khui_cw_destroy_cred_blob()
812
 
    function.
813
 
 
814
 
    \note Plugins should not call this function directly.  The
815
 
         necessary ::khui_new_creds objects will be created by
816
 
         NetIDMgr.
817
 
 
818
 
    \see khui_cw_destroy_cred_blob()
819
 
 */
820
 
KHMEXP khm_int32 KHMAPI
821
 
khui_cw_create_cred_blob(khui_new_creds ** c);
822
 
 
823
 
/*! \brief Destroy a ::khui_new_creds object
824
 
 
825
 
    Destroys a ::khui_new_creds object that was fomerly created using
826
 
    a call to khui_cw_create_cred_blob().
827
 
 
828
 
    \note Plugins should not call this function directly.  The
829
 
         necessary ::khui_new_creds objects will be created by
830
 
         NetIDMgr.
831
 
 
832
 
    \see khui_cw_create_cred_blob()
833
 
*/
834
 
KHMEXP khm_int32 KHMAPI
835
 
khui_cw_destroy_cred_blob(khui_new_creds *c);
836
 
 
837
 
/*! \brief Lock the new_creds object
838
 
 
839
 
    When a plugin is accessing the fields of a ::khui_new_creds
840
 
    object, it must first obtain a lock on the object so that other
841
 
    threads will not modify the fields at the same time.  Locking the
842
 
    object ensures that the fields of the object will be consistent.
843
 
 
844
 
    Use khui_cw_unlock_nc() to undo the lock obtained through a call
845
 
    to khui_cw_lock_nc().
846
 
 
847
 
    It is not necessary to lock a new credentials object when
848
 
    modifying it using the NetIDMgr API.
849
 
 */
850
 
KHMEXP khm_int32 KHMAPI
851
 
khui_cw_lock_nc(khui_new_creds * c);
852
 
 
853
 
/*! \brief Unlock a new_creds object
854
 
 
855
 
    \see khui_cw_lock_nc()
856
 
 */
857
 
KHMEXP khm_int32 KHMAPI
858
 
khui_cw_unlock_nc(khui_new_creds * c);
859
 
 
860
 
/*! \brief Add a new panel to a new credentials acquisition window
861
 
 
862
 
    See the description of ::khui_new_cred_panel for information on
863
 
    how to populate it to describe a credentials type panel.
864
 
 
865
 
    Note that the structure pointed to by \a t is added by reference.
866
 
    The memory pointed to by \a t is not copied.  Hence, the block of
867
 
    memory and any other blocks pointed to by the
868
 
    ::khui_new_creds_by_type structure located there should remain
869
 
    intact for the lifetime of the ::khui_new_creds structure pointed
870
 
    to by \a c or until the credentials type panel is removed from the
871
 
    ::khui_new_creds structure with a call to khui_cw_del_type().
872
 
 
873
 
    Generally, a plug-in that calls this function should allocate a
874
 
    block of memory to contain the ::khui_new_creds_by_type structure,
875
 
    fill it in and then pass in the address in a call to
876
 
    khui_cw_add_type() while handling a ::KMSG_CRED_PASSWORD,
877
 
    ::KMSG_CRED_NEW_CREDS or ::KMSG_CRED_RENEW_CREDS message.  Then
878
 
    the plug-in should remove the reference with a call to
879
 
    khui_cw_del_type() while processing ::KMSG_CRED_END.
880
 
 
881
 
    \see khui_cw_del_type()
882
 
    \see \ref cred_acq_panel_spec
883
 
    \see ::khui_new_cred_panel
884
 
    \see ::khui_new_creds
885
 
*/
886
 
KHMEXP khm_int32 KHMAPI
887
 
khui_cw_add_type(khui_new_creds * c,
888
 
                 khui_new_creds_by_type * t);
889
 
 
890
 
/*! \brief Remove a panel from a new credentials acquisition window
891
 
 
892
 
    \see khui_cw_add_type()
893
 
 */
894
 
KHMEXP khm_int32 KHMAPI
895
 
khui_cw_del_type(khui_new_creds * c,
896
 
                 khm_int32 type);
897
 
 
898
 
/*! \brief Find the panel belonging to a particular credentials type
899
 
 
900
 
    This panel would have been added to the new credentials window
901
 
    using khui_cw_add_type().
902
 
 
903
 
    \see khui_cw_add_type()
904
 
 */
905
 
KHMEXP khm_int32 KHMAPI
906
 
khui_cw_find_type(khui_new_creds * c,
907
 
                  khm_int32 type,
908
 
                  khui_new_creds_by_type **t);
909
 
 
910
 
/*! \brief Enable/disable a particular credentials type
911
 
 
912
 
    Enables or disables the panel associated with a particular
913
 
    credentials type.  Does not preclude the credentials type from
914
 
    participating in the new credentials acquisition.  However, the
915
 
    user will be prevented from interacting with the specific panel.
916
 
 */
917
 
KHMEXP khm_int32 KHMAPI
918
 
khui_cw_enable_type(khui_new_creds * c,
919
 
                    khm_int32 type,
920
 
                    khm_boolean enable);
921
 
 
922
 
/*! \brief Set the primary identity in a new credentials acuisition
923
 
 
924
 
    The primary identity dictates many of the defaults and the
925
 
    semantics associated with the credentials acquision process.
926
 
    Setting the primary identity also triggers the
927
 
    ::WMNC_IDENTITY_CHANGE notification which will be sent to all the
928
 
    credentials type panels.
929
 
 
930
 
    Has no effect if the primary identity is already the same as the
931
 
    one specified in \a id.  Specify NULL for \a id if the current
932
 
    primary identity is to be cleared.
933
 
 
934
 
    If the primary identity is changed, then all the additional
935
 
    identities associated with the new credentials acquisition dialog
936
 
    will also be discarded.
937
 
 */
938
 
KHMEXP khm_int32 KHMAPI
939
 
khui_cw_set_primary_id(khui_new_creds * c,
940
 
                       khm_handle id);
941
 
 
942
 
/*! \brief Add an additional identity to the new credentials acquisition
943
 
 
944
 
    Individual plugins are free to decide how to handle additional
945
 
    identities.  Generally, they would attempt to obtain credentials
946
 
    for the primary and additional identities, but would not consider
947
 
    it an error if an additional identity failed to obtain
948
 
    credentials.
949
 
 
950
 
    Calling this function with \a id of NULL does nothing.
951
 
*/
952
 
KHMEXP khm_int32 KHMAPI
953
 
khui_cw_add_identity(khui_new_creds * c,
954
 
                     khm_handle id);
955
 
 
956
 
/*! \brief Clear all custom prompts
957
 
 
958
 
    Removes all the custom prompts from the new credentials dialog.
959
 
 */
960
 
KHMEXP khm_int32 KHMAPI
961
 
khui_cw_clear_prompts(khui_new_creds * c);
962
 
 
963
 
/*! \brief Synchronize custom prompt values
964
 
 
965
 
    It is important to synchronize the values before accessing their
966
 
    values.  The controls associated with custom prompts update the
967
 
    values in the ::khui_new_creds object periodically.  However, the
968
 
    values may lose sync intermittently.
969
 
 */
970
 
KHMEXP khm_int32 KHMAPI
971
 
khui_cw_sync_prompt_values(khui_new_creds * c);
972
 
 
973
 
/*! \brief Begin custom prompting
974
 
 
975
 
    Begins the process of defining custom prompts.  Implicity removes
976
 
    all the custom prompts that are currently being displayed.  The \a
977
 
    banner and \a name will be displayed in separate controls above
978
 
    the set of new custom prompts.
979
 
 
980
 
    The controls associated with the prompts will not actually be
981
 
    created until all the prompts have been added using
982
 
    khui_cw_add_prompt().  The number of promtps that can be added
983
 
    will be exactly \a n_prompts.
984
 
 */
985
 
KHMEXP khm_int32 KHMAPI
986
 
khui_cw_begin_custom_prompts(khui_new_creds * c,
987
 
                             khm_size n_prompts,
988
 
                             wchar_t * banner,
989
 
                             wchar_t * name);
990
 
 
991
 
/*! \brief Add a custom prompt
992
 
 
993
 
    After khui_cw_begin_custom_prompts() is called, the plugin should
994
 
    call khui_cw_add_prompt() to add the actual prompts.  The number
995
 
    of prompts that can be added is the \a n_prompts value specified
996
 
    in the earlier call to \a khui_cw_begin_custom_prompts().
997
 
 
998
 
    Once \a n_prompts prompts have been added, the new prompts will
999
 
    automatically be created and shown in the user interface.
1000
 
    However, if less than that prompts are added, nothing is displayed
1001
 
    to the user.
1002
 
 
1003
 
    \param[in] c Pointer to ::khui_new_creds structure
1004
 
 
1005
 
    \param[in] type Type of prompt.  One of
1006
 
        ::KHUI_NCPROMPT_TYPE_PREAUTH, ::KHUI_NCPROMPT_TYPE_PASSWORD,
1007
 
        ::KHUI_NCPROMPT_TYPE_NEW_PASSWORD,
1008
 
        ::KHUI_NCPROMPT_TYPE_NEW_PASSWORD_AGAIN
1009
 
 
1010
 
    \param[in] prompt Text of the prompt.  Constrained by
1011
 
        ::KHUI_MAXCCH_PROMPT. (Localized, required)
1012
 
 
1013
 
    \param[in] def Default value.  (optional).  Constrained by
1014
 
        ::KHUI_MAXCCH_PROMPT_VALUE.  Set to NULL if not provided.
1015
 
 
1016
 
    \param[in] flags Flags.  Combination of
1017
 
        ::KHUI_NCPROMPT_FLAG_HIDDEN
1018
 
 */
1019
 
KHMEXP khm_int32 KHMAPI
1020
 
khui_cw_add_prompt(khui_new_creds * c,
1021
 
                   khm_int32 type,
1022
 
                   wchar_t * prompt,
1023
 
                   wchar_t * def,
1024
 
                   khm_int32 flags);
1025
 
 
1026
 
/*! \brief Retrieve a custom prompt
1027
 
 
1028
 
    Retrieves an individual prompt.  The \a idx parameter is a
1029
 
    zero-based index of the prompt to retrieve.  The ordering is the
1030
 
    same as the order in which khui_cw_add_prompt() was called.
1031
 
 */
1032
 
KHMEXP khm_int32 KHMAPI
1033
 
khui_cw_get_prompt(khui_new_creds * c,
1034
 
                   khm_size idx,
1035
 
                   khui_new_creds_prompt ** prompt);
1036
 
 
1037
 
/*! \brief Get the number of custom prompts
1038
 
 
1039
 
    Retrieves the number of custom prompts currently displayed.  If
1040
 
    this function is called between calling
1041
 
    khui_cw_begin_custom_prompts() and adding all the prompts, the
1042
 
    number returned will be the number of prompts that is expected to
1043
 
    be registered (i.e. the \a n_prompts parameter passed to
1044
 
    khui_cw_begin_custom_prompts()).
1045
 
 */
1046
 
KHMEXP khm_int32 KHMAPI
1047
 
khui_cw_get_prompt_count(khui_new_creds * c,
1048
 
                         khm_size * np);
1049
 
 
1050
 
 
1051
 
/*! \brief Get the value of a custom prompt
1052
 
 
1053
 
    Retrieve the value of a specific prompt.  The value is the string
1054
 
    that was typed into the input control associated with a custom
1055
 
    prompt.  The \a idx parameter is the zero-based index of the
1056
 
    prompt from which to retrieve the value from.  The ordering is the
1057
 
    same as the order in which khui_cw_add_prompt() was called.
1058
 
 
1059
 
    It is important to call khui_cw_sync_prompt_values() before
1060
 
    starting to call khui_cw_get_prompt_value() so that the values
1061
 
    returned are up-to-date.
1062
 
 */
1063
 
KHMEXP khm_int32 KHMAPI
1064
 
khui_cw_get_prompt_value(khui_new_creds * c,
1065
 
                         khm_size idx,
1066
 
                         wchar_t * buf,
1067
 
                         khm_size *cbbuf);
1068
 
 
1069
 
/*! \brief Set the response for a plugin
1070
 
 
1071
 
    When handling ::KMSG_CRED_DIALOG_PROCESS from within the plugin
1072
 
    thread, it is important to set the response by calling this
1073
 
    function.  The response can be used to signal whether the plugin
1074
 
    successfully obtained credentials or whether further interaction
1075
 
    is required, or the credentials acquisition failed.
1076
 
 
1077
 
    The response is a combination of :
1078
 
    - ::KHUI_NC_RESPONSE_PENDING
1079
 
    - ::KHUI_NC_RESPONSE_FAILED
1080
 
    - ::KHUI_NC_RESPONSE_PENDING
1081
 
    - ::KHUI_NC_RESPONSE_SUCCESS
1082
 
    - ::KHUI_NC_RESPONSE_NOEXIT
1083
 
    - ::KHUI_NC_RESPONSE_EXIT
1084
 
 */
1085
 
KHMEXP khm_int32 KHMAPI
1086
 
khui_cw_set_response(khui_new_creds * c,
1087
 
                     khm_int32 type,
1088
 
                     khm_int32 response);
1089
 
 
1090
 
/*! \brief Check whether a specified credential type panel succeeded
1091
 
 
1092
 
    This is called during the processing of ::KMSG_CRED_DIALOG_PROCESS
1093
 
    to determine whether a specified credential type succeeded in
1094
 
    obtaining credentials.  The credential type that is being queried
1095
 
    should have also been listed as a dependency when adding the
1096
 
    current credentials type, otherwise the type queried may not have
1097
 
    been invoked yet.
1098
 
 
1099
 
    \return TRUE iff the queried type has reported that it successfully
1100
 
        completed the credentials acquision operation.
1101
 
 */
1102
 
KHMEXP khm_boolean KHMAPI
1103
 
khui_cw_type_succeeded(khui_new_creds * c,
1104
 
                       khm_int32 type);
1105
 
 
1106
 
/*! \brief Add a row of controls to the identity specifier area
1107
 
 
1108
 
    Only for use by identity provider callbacks that wish to add an
1109
 
    identity selector control.  A row of controls consist of a label
1110
 
    control and some input control.
1111
 
 
1112
 
    When the ::WMNC_IDENT_INIT message is sent to the identity
1113
 
    provider, it receives a handle to the dialog panel in the \a
1114
 
    lParam parameter which should be the parent window of both the
1115
 
    windows specified here.  The control ID for any controls created
1116
 
    must fall within the ::KHUI_CW_ID_MIN and ::KHUI_CW_ID_MAX range.
1117
 
 
1118
 
    Both controls will be resized to fit in the row.
1119
 
 
1120
 
    If \a long_label is TRUE then the size of the label will be larger
1121
 
    than normal and will accomodate more text.
1122
 
 */
1123
 
KHMEXP khm_int32 KHMAPI
1124
 
khui_cw_add_control_row(khui_new_creds * c,
1125
 
                        HWND label,
1126
 
                        HWND input,
1127
 
                        khui_control_size size);
1128
 
 
1129
 
/*!@}*/ /* Credentials acquisition */
1130
 
/*!@}*/
1131
 
 
1132
 
#endif