KFW 3.0 Final Network Identity Manager updates
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 6 Dec 2005 01:06:13 +0000 (01:06 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 6 Dec 2005 01:06:13 +0000 (01:06 +0000)
Add new documentation files

Add new icons

Add "set default" functionality to the New Credentials dialog

Remove inconsistencies in the Options configuration dialog

Replace the menu bar so that it responds to Alt- and keyboard
shortcuts

Fix an --autoinit race condition

many more things....

ticket: new
target_version: 1.4.4
status: resolved
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17546 dc483132-0cff-0310-8789-dd5450dbe970

92 files changed:
src/windows/identity/apiversion.txt
src/windows/identity/config/Makefile.w32
src/windows/identity/doc/netidmgr.doc [new file with mode: 0755]
src/windows/identity/doc/netidmgr.pdf [new file with mode: 0755]
src/windows/identity/help/html/about_netidmgr.htm
src/windows/identity/help/html/act_chpw.htm
src/windows/identity/help/html/act_destroy_creds.htm
src/windows/identity/help/html/act_import_creds.htm
src/windows/identity/help/html/act_new_creds.htm
src/windows/identity/help/html/bugs.htm
src/windows/identity/help/html/images/screen_new_creds.bmp [new file with mode: 0755]
src/windows/identity/help/html/images/screen_new_creds_err01.bmp [new file with mode: 0755]
src/windows/identity/help/html/images/screen_new_creds_exp.bmp [new file with mode: 0755]
src/windows/identity/help/html/menu_help.htm
src/windows/identity/help/html/menu_options.htm
src/windows/identity/help/html/menu_view.htm
src/windows/identity/help/html/nidmgr.css
src/windows/identity/help/html/using.htm
src/windows/identity/help/html/welcome.htm
src/windows/identity/help/khhelp.h
src/windows/identity/help/netidmgr.hhp
src/windows/identity/help/popups_newcreds.txt
src/windows/identity/include/khmsgtypes.h
src/windows/identity/kconfig/api.c
src/windows/identity/kconfig/kconfig.h
src/windows/identity/kconfig/kconfiginternal.h
src/windows/identity/kcreddb/attrib.c
src/windows/identity/kcreddb/credential.c
src/windows/identity/kcreddb/credset.c
src/windows/identity/kcreddb/identity.c
src/windows/identity/kcreddb/kcreddb.h
src/windows/identity/kcreddb/lang/en_us/kcredres.rc
src/windows/identity/kcreddb/langres.h
src/windows/identity/kcreddb/type.c
src/windows/identity/kherr/kherr.c
src/windows/identity/kherr/kherr.h
src/windows/identity/kmm/kmm_registrar.c
src/windows/identity/kmm/kmminternal.h
src/windows/identity/plugins/common/Makefile
src/windows/identity/plugins/krb4/krb4newcreds.c
src/windows/identity/plugins/krb4/lang/en_us/langres.rc
src/windows/identity/plugins/krb5/errorfuncs.c
src/windows/identity/plugins/krb5/krb5configdlg.c
src/windows/identity/plugins/krb5/krb5configid.c
src/windows/identity/plugins/krb5/krb5funcs.c
src/windows/identity/plugins/krb5/krb5identpro.c
src/windows/identity/plugins/krb5/krb5newcreds.c
src/windows/identity/plugins/krb5/krbconfig.csv
src/windows/identity/plugins/krb5/lang/en_us/langres.rc
src/windows/identity/plugins/krb5/lang/krb5_msgs.mc
src/windows/identity/plugins/krb5/langres.h
src/windows/identity/ui/appglobal.h
src/windows/identity/ui/cfg_identities_wnd.c
src/windows/identity/ui/cfg_notif_wnd.c
src/windows/identity/ui/configwnd.c
src/windows/identity/ui/credfuncs.c
src/windows/identity/ui/credfuncs.h
src/windows/identity/ui/credwnd.c
src/windows/identity/ui/credwnd.h
src/windows/identity/ui/images/app_notify_error.ico
src/windows/identity/ui/images/app_state_exp.ico [new file with mode: 0644]
src/windows/identity/ui/images/app_state_ok.ico [new file with mode: 0644]
src/windows/identity/ui/images/app_state_warn.ico [new file with mode: 0644]
src/windows/identity/ui/images/flag-critical.bmp
src/windows/identity/ui/images/flag-warning.bmp
src/windows/identity/ui/images/flag_expired.bmp
src/windows/identity/ui/images/flag_renewable.bmp [new file with mode: 0644]
src/windows/identity/ui/lang/en_us/khapp.rc
src/windows/identity/ui/main.c
src/windows/identity/ui/mainmenu.c
src/windows/identity/ui/mainmenu.h
src/windows/identity/ui/mainwnd.c
src/windows/identity/ui/newcredwnd.c
src/windows/identity/ui/newcredwnd.h
src/windows/identity/ui/notifier.c
src/windows/identity/ui/notifier.h
src/windows/identity/ui/reqdaemon.c
src/windows/identity/ui/resource.h
src/windows/identity/ui/timer.c
src/windows/identity/ui/timer.h
src/windows/identity/ui/toolbar.c
src/windows/identity/ui/uiconfig.csv
src/windows/identity/uilib/accel.csv
src/windows/identity/uilib/action.c
src/windows/identity/uilib/actions.csv
src/windows/identity/uilib/creddlg.c
src/windows/identity/uilib/khactiondef.h
src/windows/identity/uilib/khnewcred.h
src/windows/identity/uilib/khremote.h
src/windows/identity/util/hashtable.c
src/windows/identity/util/perfstat.c
src/windows/identity/util/perfstat.h

index c382eb52e76ba4ae0e56a9594157c841551dbcb8..e2367db2a84bb21e31543eda710363ac3456a6f5 100644 (file)
@@ -44,11 +44,14 @@ Date=NOTRELEASED
 Version=2\r
 AppVersion=0.1.1.0\r
 Date=Nov 01, 2005\r
-# Beta 1 release of NetIDMgr\r
+# Alpha 1 release of NetIDMgr, along with KFW 3.0.0 beta\r
 \r
 #----------------------------------------------------------------\r
 Version=3\r
 AppVersion=0.1.2.0\r
 Date=Nov 30, 2005\r
-# Beta 2 release\r
+# Alpha 2 release of NetIDMgr, along with KFW 3.0.0 beta 2\r
 \r
+Version=4\r
+AppVersion=1.0.0.0\r
+Date=Dec 05, 2005\r
index 49524dfd97b51f729ff6bf902fb7b7da64044a5e..264d19ed28128f48b13f14277feba4e98f32bc1f 100644 (file)
@@ -3,7 +3,7 @@
 #             This file will be included by all the makefiles\r
 #             in the build tree.\r
 #\r
-# Copyright (c) 2004 Massachusetts Institute of Technology\r
+# Copyright (c) 2004,2005 Massachusetts Institute of Technology\r
 #\r
 # Permission is hereby granted, free of charge, to any person\r
 # obtaining a copy of this software and associated documentation files\r
@@ -44,11 +44,11 @@ KHIMAIRA_WIN32_CONFIG=1
 #      SPECIAL    : Special build.  Typically one with non-mainline patches.\r
 \r
 # Version info\r
-NETIDMGR_VERSION_MAJOR=0\r
-NETIDMGR_VERSION_MINOR=1\r
-NETIDMGR_VERSION_PATCH=3\r
+NETIDMGR_VERSION_MAJOR=1\r
+NETIDMGR_VERSION_MINOR=0\r
+NETIDMGR_VERSION_PATCH=0\r
 NETIDMGR_VERSION_AUX=0\r
-NETIDMGR_RELEASEDESC=Beta 3\r
+NETIDMGR_RELEASEDESC=\r
 \r
 # The API version.  This number must be incremented each time the API\r
 # changes.  Plugins specify the version of the API that they were\r
@@ -57,7 +57,7 @@ NETIDMGR_RELEASEDESC=Beta 3
 #\r
 # Changes to the API version numbers should be documented in\r
 # apiversion.txt at the root of the source tree.\r
-NETIDMGR_VERSION_API=3\r
+NETIDMGR_VERSION_API=4\r
 \r
 NETIDMGR_VERSION=$(NETIDMGR_VERSION_MAJOR).$(NETIDMGR_VERSION_MINOR).$(NETIDMGR_VERSION_PATCH).$(NETIDMGR_VERSION_AUX)\r
 NETIDMGR_VERSIONC=$(NETIDMGR_VERSION_MAJOR),$(NETIDMGR_VERSION_MINOR),$(NETIDMGR_VERSION_PATCH),$(NETIDMGR_VERSION_AUX)\r
@@ -81,7 +81,7 @@ KH_BUILD=DEBUG
 \r
 # The default release type is PRIVATE is no other type is specified\r
 !if ("$(KH_RELEASE)" != "OFFICIAL") && ("$(KH_RELEASE)" != "PRERELEASE") && ("$(KH_RELEASE)" != "PRIVATE") && ("$(KH_RELEASE)" != "SPECIAL")\r
-KH_RELEASE=PRERELEASE\r
+KH_RELEASE=PRIVATE\r
 !endif\r
 \r
 # Actual build environment settings\r
diff --git a/src/windows/identity/doc/netidmgr.doc b/src/windows/identity/doc/netidmgr.doc
new file mode 100755 (executable)
index 0000000..f6eda5d
Binary files /dev/null and b/src/windows/identity/doc/netidmgr.doc differ
diff --git a/src/windows/identity/doc/netidmgr.pdf b/src/windows/identity/doc/netidmgr.pdf
new file mode 100755 (executable)
index 0000000..0e6ab02
Binary files /dev/null and b/src/windows/identity/doc/netidmgr.pdf differ
index 76c5f9f22af173a01300f36de6e97057f2c5170b..d6fec057ba557508ccf69cc4da0e0c4b4e9cfc33 100644 (file)
@@ -19,7 +19,7 @@ Identity Manager.
 <p>\r
 Network Identity Manager was conceived as an identity management\r
 solution to make up for the shortcomings of Leash32 (distributed with\r
-MIT Kerberos for Windows) and AFSCREDS (distributed with OpenAFS).\r
+MIT Kerberos for Windows) and AFSCreds (distributed with OpenAFS).\r
 </p>\r
 \r
 <p>\r
@@ -33,17 +33,18 @@ source code.
 </p>\r
 \r
 <p>\r
-A presentation given about Khimaira at the <a\r
+Khimaira was presented at the <a\r
 href="http://www.pmw.org/afsbpw05/">AFS and Kerberos Best Practices\r
-Workshop 2005</a> can be found on the workshop website and <a\r
+Workshop 2005</a>.  The slides can be found on the workshop website and <a\r
 href="http://web.mit.edu/asanka/www/misc.shtml">here</a>.\r
 </p>\r
 \r
 <p>\r
-The work on Khimaira was funded by <a\r
+The work on Network Identity Manager was supported by <a\r
 href="http://web.mit.edu">MIT</a> <a\r
 href="http://web.mit.edu/ist/">Information Services and\r
-Technology</a>.\r
+Technology</a>, <a href="http://www.jpl.nasa.gov">NASA Jet Propulsion Laboratory</a>,\r
+and <a href="http://www.secure-endpoints.com">Secure Endpoints Inc.</a>.\r
 </p>\r
 \r
 <h3>Design</h3>\r
index 5e39963da075ddd8f9d3b853f4159e63c693c83d..40f97054a62eda75d7dc83c555042df4c411f996 100644 (file)
@@ -1,11 +1,30 @@
 <html>\r
 <head>\r
-  <title>title</title>\r
-  <meta name="description" content="">\r
-  <meta name="keywords" content="">\r
+  <title>Change Password</title>\r
+  <meta name="description" content="change password">\r
+  <meta name="keywords" content="change password dialog">\r
   <link rel="stylesheet" type="text/css" href="nidmgr.css">\r
 </head>\r
 <body>\r
 \r
+<h1>Change Password</h1>\r
+\r
+<p>The change password dialog can be invoked from the <a\r
+href="menu_credential.htm">Credentials</a> menu.  This is used to\r
+change the password for the primary credentials provider (currently\r
+Kerberos 5).\r
+</p>\r
+\r
+<p>For the default identity provider (Kerberos 5), there are two input\r
+boxes to specify the identity for which the password is to be changed.\r
+The identity uniquely maps to the Kerberos principal of the same name.\r
+Then the current password must be entered along with the new password\r
+twice.\r
+</p>\r
+\r
+<p>Note that currently, when the password for an identity is being\r
+changed, only the associated Kerberos 5 password is changed.\r
+</p>\r
+\r
 </body>\r
 </html>
\ No newline at end of file
index 5e39963da075ddd8f9d3b853f4159e63c693c83d..ff24561e8c997a85611646b8005cd29fb2adb3d9 100644 (file)
@@ -1,11 +1,33 @@
 <html>\r
 <head>\r
-  <title>title</title>\r
-  <meta name="description" content="">\r
-  <meta name="keywords" content="">\r
+  <title>Destroy Credentials</title>\r
+  <meta name="description" content="Destroy Credentials">\r
+  <meta name="keywords" content="destroy credentials">\r
   <link rel="stylesheet" type="text/css" href="nidmgr.css">\r
 </head>\r
 <body>\r
 \r
+<h1>Destroy Credentials</h1>\r
+\r
+<p>This action will attempt to destroy the credentials that are\r
+currently selected in the credentials window.  How the credentials are\r
+destroyed is up to each credentials provider.\r
+</p>\r
+\r
+<p>In some cases, you may need to select all the credentials of a\r
+specific type for the delete operation to succeed.  This happens when\r
+the credentials provider does not support deleting individual\r
+credentials, but supports deleting all the credentials stored in one\r
+specific location.\r
+</p>\r
+\r
+<p>The action can be invoked by selecting the credentials and then\r
+pressing the <span class="pre">Delete</span> key or by pressing <span\r
+class="pre">Ctrl + D</span>.  You can also select the <span\r
+class="pre">Delete credentials</span> action from the context menu\r
+(available via right-clicking inside the credentials window) or the\r
+credentials menu.\r
+</p>\r
+\r
 </body>\r
 </html>
\ No newline at end of file
index 5e39963da075ddd8f9d3b853f4159e63c693c83d..550bb39e257e97669f5843800cbf65092ca445ce 100644 (file)
@@ -1,11 +1,27 @@
 <html>\r
 <head>\r
-  <title>title</title>\r
-  <meta name="description" content="">\r
-  <meta name="keywords" content="">\r
+  <title>Import Credentials</title>\r
+  <meta name="description" content="Import Credentials">\r
+  <meta name="keywords" content="Import Credentials">\r
   <link rel="stylesheet" type="text/css" href="nidmgr.css">\r
 </head>\r
 <body>\r
 \r
+<h1>Import Credentials</h1>\r
+\r
+<p>Allows you to import credentials from the Windows LSA credentials\r
+cache into any of the caches under the control of any credentials\r
+provider.  Currently, the only credentials provider that supports\r
+importing is Kerberos 5.\r
+</p>\r
+\r
+<p>This action can be invoked via the <a\r
+href="menu_credential.htm">Credentials</a> menu or by pressing <span\r
+class="pre">Ctrl + I</span>.  In addition, the Kerberos 5\r
+configuration pane accessible via the <a\r
+href="menu_options.htm">Options</a> menu provides an options that\r
+control how the importing of credentials happen.\r
+</p>\r
+\r
 </body>\r
 </html>
\ No newline at end of file
index 5e39963da075ddd8f9d3b853f4159e63c693c83d..01917ffdc874a373d36d1f6a6ed5fc8823eb514f 100644 (file)
 <html>\r
 <head>\r
-  <title>title</title>\r
-  <meta name="description" content="">\r
-  <meta name="keywords" content="">\r
+  <title>New Credentials</title>\r
+  <meta name="description" content="obtain new credentials">\r
+  <meta name="keywords" content="new creds">\r
   <link rel="stylesheet" type="text/css" href="nidmgr.css">\r
 </head>\r
 <body>\r
 \r
+<h1>New Credentials</h1>\r
+\r
+<p>The new credentials dialog can be invoked from the <a\r
+href="menu_credential.htm">Credentials</a> menu, by typing <span\r
+class="pre">Ctrl + N</span>, using the context menu in the credentials\r
+window or using the context menu in the NetIDMgr icon in the system\r
+notification area.\r
+</p>\r
+\r
+<p>Once invoked, you will be presented with a dialog similar to the\r
+following:\r
+</p>\r
+\r
+<p>\r
+<img src="images/screen_new_creds.bmp" alt="New credentials dialog"/>\r
+<p class="caption">New credentials dialog with a valid identity\r
+selected.</p> <p class="caption"><i>Note that the above screenshot is\r
+from an instance of NetIDMgr with Kerberos 5, Kerberos 4 and OpenAFS\r
+plugins with a Kerberos 5 identity manager.  Actual display may be\r
+different depending on the plugins that are active.</i></p>\r
+</p>\r
+\r
+<p>If the Kerberos 5 identity provider is used, the dialog will ask\r
+for a username and a realm to determine the identity for which new\r
+credentials will be obtained for.  Depending on the selected identity,\r
+you may be required to provide a password or other form of\r
+authentication for new credentials to be obtained.\r
+</p>\r
+\r
+<p>Below the prompts is the credentials summary window.  This window\r
+provides an overview of the credentals that will be obtained when the\r
+dialog is completed.\r
+</p>\r
+\r
+<h3>Expanded view</h3>\r
+\r
+<p>If you click any of the hyperlinks in the credentials summary\r
+window or select the <span class="pre">Options &gt;&gt;</span> button,\r
+the dialog will switch to the exanded view.  An example of this is\r
+shown below:\r
+</p>\r
+\r
+<p>\r
+<img src="images/screen_new_creds_exp.bmp"\r
+alt="Expanded new credentials window" />\r
+\r
+<p class="caption">Expanded view of the new credetials dialog</p>\r
+</p>\r
+\r
+<p>\r
+The expanded view provides access to additional options available for\r
+each credential provider.  For example, the Kerberos 5 credentials\r
+provider allows you to set the lifetime of the obtained Kerberos\r
+ticket as well as ticket flags such as <i>renewable</i> or\r
+<i>forwardable</i>.\r
+</p>\r
+\r
+<h3>Credentials summary window</h3>\r
+\r
+<p>\r
+The credentials summary window provides an overview of the credentials\r
+that will be obtained after the successful completion of the new\r
+credentials dialog.  The window contains hyperlinks that will take you\r
+to the corresponding credentials option panels where you will be able\r
+to set additional options for each type.\r
+</p>\r
+\r
+<p>\r
+If there is a problem with the selected identity, the credentials\r
+window will display a message describing the problem.  For example:\r
+</p>\r
+\r
+<p>\r
+<img src="images/screen_new_creds_err01.bmp" alt="Credentials summary window showing an invalid identity" />\r
+</p>\r
+\r
+<p>\r
+The above is an example of what you would see if the provided identity\r
+is invalid.  Once the identity provider (in this case, Kerberos 5)\r
+indicates that the identity is invalid, it will be displayed as above\r
+along with a brief description of why the identity was found to be\r
+invalid.  Here, the Kerberos 5 identity provider is reporting that the\r
+specified principal does not exist in the Kerberos database.\r
+</p>\r
+\r
+<h3>Additional notes</h3>\r
+\r
+<p>\r
+The new credentials dialog can be invoked from the command line using\r
+the <span class="pre"> -i </span> or <span class="pre"> --kinit\r
+</span> command line option.  Additionally, if you specify the <span\r
+class="pre"> -a </span> or <span class="pre"> --autoinit </span>\r
+command line option, the new credentials dialog will be displayed if\r
+there are no credentials available.\r
+</p>\r
+\r
+<p>\r
+Setting the <span class="pre">Prompt for new credentials if there\r
+aren't any at startup</span> option is set in the <span\r
+class="pre">General</span> configuration panel, then the behavior is\r
+similar to the <span class="pre">--autoinit</span> option.\r
+</p>\r
+\r
 </body>\r
 </html>
\ No newline at end of file
index a2e8d34ca84641b2c1a2868ad80452ca567d65a2..fcc563c9acef3f6e7e306d82ccff31a388d8dc1d 100644 (file)
@@ -18,8 +18,9 @@ enable us to reproduce the problem.
 <p><a href="mailto:kerberos@MIT.EDU" class="mail">kerberos@MIT.EDU</a>\r
 is a mailing list set up for discussing Kerberos issues. It is\r
 gatewayed to the Usenet newsgroup 'comp.protocols.kerberos'. If you\r
-prefer to read it via mail, send a request to kerberos-request@MIT.EDU\r
-to get added or subscribe via the web page:</p>\r
+prefer to read it via mail, send a subscription request to \r
+<a href="mailto:kerberos-request@MIT.EDU" class="mail">kerberos-request@MIT.EDU</a>\r
+or subscribe via the web page:</p>\r
 \r
 <p> <a href="http://mailman.mit.edu/mailman/listinfo/kerberos"\r
 class="external">\r
diff --git a/src/windows/identity/help/html/images/screen_new_creds.bmp b/src/windows/identity/help/html/images/screen_new_creds.bmp
new file mode 100755 (executable)
index 0000000..7d7335a
Binary files /dev/null and b/src/windows/identity/help/html/images/screen_new_creds.bmp differ
diff --git a/src/windows/identity/help/html/images/screen_new_creds_err01.bmp b/src/windows/identity/help/html/images/screen_new_creds_err01.bmp
new file mode 100755 (executable)
index 0000000..44bf0f9
Binary files /dev/null and b/src/windows/identity/help/html/images/screen_new_creds_err01.bmp differ
diff --git a/src/windows/identity/help/html/images/screen_new_creds_exp.bmp b/src/windows/identity/help/html/images/screen_new_creds_exp.bmp
new file mode 100755 (executable)
index 0000000..b1711a7
Binary files /dev/null and b/src/windows/identity/help/html/images/screen_new_creds_exp.bmp differ
index d9554544897c7e8a0cd1a23dcb2e81706e16c2a2..bceb2a9919fa7d1710368e408e459137f7796ce2 100644 (file)
@@ -27,11 +27,8 @@ needs to be explained, we have decided to include it here just for
 completeness.  It is bad enough that it is the last menu on the menu\r
 bar.  We didn't want to pile on any more disrespect by not documenting\r
 it.  We encourage you to not read this and just go ahead and click any\r
-item on this menu.  It is guaranteed that nothing bad will happen.\r
-This is not a generalization that would extend to, say, the <a\r
-href="menu_credential.htm">Credentials</a> menu.  If anything bad\r
-happens, please file a bug report at <a\r
-href="mailto:kfw-bugs@mit.edu">kfw-bugs@mit.edu</a>.\r
+item on this menu.  If anything unexpected happens, please file a bug \r
+report at <a href="mailto:kfw-bugs@mit.edu">kfw-bugs@mit.edu</a>.\r
 </p>\r
 \r
 <p>\r
index 4d5bea9bb09f0987a9059ed3771a1a0ae42d2c8c..2d60f1ae39c71586d2e54bcf4320a149dd00c9c0 100644 (file)
@@ -43,6 +43,9 @@ Opens the identities configuration panel.</li>
 <li><a name="notifs" /><span class="title">Notifications ...</span>:\r
 Opens the Notifications control panel.</li>\r
 \r
+<li><a name="plugins" /><span class="title">Plugins ...</span>:\r
+Opens the Plug-ins and Modules control panel.</li>\r
+\r
 </ul>\r
 \r
 </body>\r
index 94920e12671a2232a115589555d2fedcdca04dce..53a46e1894d28b00d7f338f5f3a489ba74e5d72e 100644 (file)
@@ -36,8 +36,9 @@ without invoking the <span class="pre">View</span> menu.
 \r
 <ul>\r
 \r
-<li><a name="choosecol" /> <span class="title">Choolse Columns\r
-...</span>: Invokes a dialog where you can choose which columns are\r
+<li><a name="choosecol" /> <span class="title">Choose Columns\r
+...</span>: <b>Not implemented in this release.</b>\r
+Invokes a dialog where you can choose which columns are\r
 displayed in the view window.  If you change the columns, or their\r
 order, a new custom layout will be created for you which you can later\r
 use using the <span class="pre">Layout</span> submenu later.</li>\r
@@ -51,7 +52,8 @@ display.
       where the credentials will be grouped by identity and by\r
       credentials type, in that order.</li>\r
 \r
-      <li><span class="title">By Type</span>: A predefined layout\r
+      <li><span class="title">By Type</span>: <b>Not implemented in\r
+      this release.</b> A predefined layout\r
       where the credentials are grouped by credentials type</li>\r
 \r
       <li><span class="title">By Location</span>: A predefined layout\r
@@ -62,12 +64,6 @@ display.
       href="concept_cred_pro.htm">credential providers</a> choose the\r
       interpretation of the <span class="pre">location</span> property\r
       as the concept of location changes from type to type.</li>\r
-\r
-      <li><span class="title">Custom</span>: The custom layout.  If\r
-      you customize the layout by adding, removing or reordering the\r
-      columns, then NetIDMgr will create a new custom layout using the\r
-      customizations.  You can choose this option to revisit that layout</li>\r
-\r
    </ul>\r
 </li>\r
 \r
index 16c45104b0aa3dfb546b1c7c9622ffbd5da8a57f..9ace122299501758b7305027c5fd2694c5c76ec2 100644 (file)
@@ -68,4 +68,5 @@ SPAN.pre {
 \r
 SPAN.title {\r
    font-weight: bold;\r
-}
\ No newline at end of file
+}\r
+\r
index 2d84df2cdd95fab873f1345b22950aebe12a081b..c3699e84125e915832f045080abbe910405d58af 100644 (file)
@@ -22,8 +22,7 @@ notification area, select the icon from the start menu, or type
 <p>\r
 Once you open the NetIDMgr window, you will be presented with a view\r
 of your existing credentials, or a message notifying you that you\r
-don't have any.  The credentials view should be fairly self\r
-explanatory, but if there's any doubt, more information <a\r
+don't have any.  Details of the credentials view objects <a\r
 href="wnd_main.htm">can be found here.</a>\r
 </p>\r
 \r
index 9cd7bc43ef77fbace28e6150f14af7dd1d19b46c..7423b848d28688c149b7a25ab6150da9dbc7107f 100644 (file)
@@ -14,8 +14,8 @@
 \r
 <p>\r
 The Network Identity Manager (or NetIDMgr for short) allows you to\r
-manage your credentials (Kerberos tickets, AFS tokens, etc.) on a per\r
-identity basis.\r
+manage your network identities and the associated credentials \r
+(Kerberos tickets, AFS tokens, etc.).\r
 </p>\r
 \r
 <p>\r
@@ -28,7 +28,7 @@ installing the appropriate plugins.
 <p>\r
 This version is distributed as a part of the MIT Kerberos for Windows\r
 product along with the Kerberos 5 and Kerberos 4 plugins.  The OpenAFS\r
-plugin, which is required for supporting OpenAFS tokens, is\r
+plugin, which is required for supporting AFS tokens, is\r
 distributed separately.\r
 </p>\r
 \r
index 2e07838c629c645c397415e044dcc57019ba6496..88f73c0b3e70a046628f4a6b34f0181c4e41a21c 100644 (file)
 #define IDH_ACTION_OPT_KHIM        2012\r
 #define IDH_ACTION_OPT_INIT        2013\r
 #define IDH_ACTION_OPT_NOTIF       2014\r
+\r
+#define IDH_NC_CREDWND             3000\r
+#define IDH_NC_OK                  3001\r
+#define IDH_NC_CANCEL              3002\r
+#define IDH_NC_HELP                3003\r
+#define IDH_NC_TABBUTTON           3004\r
+#define IDH_NC_OPTIONS             3005\r
+#define IDH_NC_TABMAIN             3006\r
+#define IDH_NC_SETDEF              3007\r
index 9930dc5bced3672a6b4dcf7a70dfc091b14cadbc..9f2ae733213d32decb1d313733f272ccc2e277b2 100644 (file)
@@ -15,6 +15,8 @@ MainHelpWnd="NetIDMgr Help","toc.hhc","Index.hhk","html/welcome.htm","html/welco
 \r
 \r
 [ALIAS]\r
+IDH_ACTION_NEW_ID=html\act_new_creds.htm\r
+IDH_ACTION_PASSWD_ID=html\act_chpw.htm\r
 IDH_WELCOME=html\welcome.htm\r
 \r
 [MAP]\r
@@ -23,6 +25,7 @@ IDH_WELCOME=html\welcome.htm
 [TEXT POPUPS]\r
 khhelp.h\r
 popups_newcreds.txt\r
+popups_password.txt\r
 \r
 [INFOTYPES]\r
 Category:Concepts\r
index 7d58703b1119507aaa2985ff936c28cacf2ff99f..52c61244bf536e64108c6a3e4577e56e54588017 100644 (file)
@@ -1 +1,30 @@
-foo \r
+.topic IDH_NC_TABMAIN\r
+Opens the identity selection panel.\r
+\r
+.topic IDH_NC_TABBUTTON\r
+Opens the option panel for this credentials type.\r
+\r
+.topic IDH_NC_OK\r
+Obtains new credentials using the information that you provided.\r
+\r
+.topic IDH_NC_CANCEL\r
+Cancels the new credentials operation.\r
+\r
+.topic IDH_NC_HELP\r
+Provides help for this dialog box.\r
+\r
+.topic IDH_NC_OPTIONS\r
+Expands the dialog and allows you to set additional\r
+options for the credentials that will be obtained\r
+by this dialog.\r
+\r
+.topic IDH_NC_CREDWND\r
+Provides an overview of the credentials that will be obtained\r
+after the successful completion of the new credentials dialog.\r
+Clicking on the hyperlinks will take you to the corresponding\r
+credentials option panels where you will be able to set\r
+additional options for each type.\r
+\r
+.topic IDH_NC_SETDEF\r
+If checked, once the credentials acquisition operation completes, the\r
+identity will be set as the default.\r
index dfc39e2f0bbadfc39e9d4745d86d803ece4335bd..9b63455e76d0a469b6a49c04d372964421978d01 100644 (file)
 \r
 #define KMSG_ACT_BEGIN_CMDLINE 128\r
 \r
+#define KMSG_ACT_CONTINUE_CMDLINE 129\r
+\r
 /*@}*/\r
 \r
 /*! \defgroup kmq_msg_cred KMSG_CRED subtypes\r
index e860e9e51eae46b2f44df3dd5b1cfba6dc9f11e4..30e5f488fb1d19b4f35115658507d672bc4e9859 100644 (file)
@@ -183,6 +183,12 @@ khcint_space_release(kconf_conf_space * s) {
                 RegCloseKey(s->regkey_user);\r
             s->regkey_machine = NULL;\r
             s->regkey_user = NULL;\r
+\r
+            if (s->flags &\r
+                (KCONF_SPACE_FLAG_DELETE_M |\r
+                 KCONF_SPACE_FLAG_DELETE_U)) {\r
+                khcint_remove_space(s, s->flags);\r
+            }\r
         }\r
 \r
         LeaveCriticalSection(&cs_conf_global);\r
@@ -197,7 +203,7 @@ khcint_RegOpenKeyEx(HKEY hkey, LPCWSTR sSubKey, DWORD ulOptions,
     wchar_t sk_name[KCONF_MAXCCH_NAME];\r
     FILETIME ft;\r
     size_t cch;\r
-    HKEY hkp;\r
+    HKEY hkp = NULL;\r
     const wchar_t * t;\r
     LONG rv = ERROR_SUCCESS;\r
 \r
@@ -1375,7 +1381,7 @@ khc_write_string(khm_handle pconf,
     LONG hr;\r
     size_t cbsize;\r
     wchar_t * value = NULL;\r
-    int free_space;\r
+    int free_space = 0;\r
     khm_handle conf = NULL;\r
 \r
 \r
@@ -1453,7 +1459,7 @@ khc_write_int32(khm_handle pconf,
     khm_int32 rv = KHM_ERROR_SUCCESS;\r
     LONG hr;\r
     wchar_t * value = NULL;\r
-    int free_space;\r
+    int free_space = 0;\r
     khm_handle conf = NULL;\r
 \r
 \r
@@ -1519,7 +1525,7 @@ khc_write_int64(khm_handle pconf, wchar_t * pvalue, khm_int64 buf) {
     khm_int32 rv = KHM_ERROR_SUCCESS;\r
     LONG hr;\r
     wchar_t * value = NULL;\r
-    int free_space;\r
+    int free_space = 0;\r
     khm_handle conf = NULL;\r
 \r
 \r
@@ -1587,7 +1593,7 @@ khc_write_binary(khm_handle pconf,
     khm_int32 rv = KHM_ERROR_SUCCESS;\r
     LONG hr;\r
     wchar_t * value = NULL;\r
-    int free_space;\r
+    int free_space = 0;\r
     khm_handle conf = NULL;\r
 \r
 \r
@@ -1850,10 +1856,58 @@ khc_remove_value(khm_handle conf, wchar_t * value, khm_int32 flags) {
     return rv;\r
 }\r
 \r
+khm_int32\r
+khcint_remove_space(kconf_conf_space * c, khm_int32 flags) {\r
+    kconf_conf_space * cc;\r
+    kconf_conf_space * cn;\r
+\r
+    /* TODO: if this is the last child space and the parent is marked\r
+       for deletion, delete the parent as well. */\r
+\r
+    cc = TFIRSTCHILD(c);\r
+    while (cc) {\r
+        cn = LNEXT(cc);\r
+\r
+        khcint_remove_space(cc, flags);\r
+\r
+        cc = cn;\r
+    }\r
+\r
+    cc = TFIRSTCHILD(c);\r
+    if (!cc) {\r
+        kconf_conf_space * p;\r
+\r
+        if (c->refcount) {\r
+            c->flags |= (flags &\r
+                         (KCONF_SPACE_FLAG_DELETE_M |\r
+                          KCONF_SPACE_FLAG_DELETE_U));\r
+        } else {\r
+            p = TPARENT(c);\r
+            \r
+            TDELCHILD(p, c);\r
+\r
+            if (c->regpath) {\r
+                if (flags & KCONF_SPACE_FLAG_DELETE_U)\r
+                    RegDeleteKey(HKEY_CURRENT_USER,\r
+                                 c->regpath);\r
+                if (flags & KCONF_SPACE_FLAG_DELETE_M)\r
+                    RegDeleteKey(HKEY_LOCAL_MACHINE,\r
+                                 c->regpath);\r
+            }\r
+\r
+            khcint_free_space(c);\r
+        }\r
+    } else {\r
+        c->flags |= (flags &\r
+                     (KCONF_SPACE_FLAG_DELETE_M |\r
+                      KCONF_SPACE_FLAG_DELETE_U));\r
+    }\r
+\r
+    return KHM_ERROR_SUCCESS;\r
+}\r
+\r
 KHMEXP khm_int32 KHMAPI\r
 khc_remove_space(khm_handle conf) {\r
-    /* TODO: implement this */\r
-\r
     /*\r
        - mark this space as well as all child spaces as\r
          'delete-on-close' using flags.  Mark should indicate which\r
@@ -1867,9 +1921,32 @@ khc_remove_space(khm_handle conf) {
          space has any children left.  If there are none, check if the\r
          parent space is also marked for deletion.\r
     */\r
-    assert(FALSE);\r
+    HKEY hku = NULL;\r
+    HKEY hkm = NULL;\r
+    kconf_conf_space * c;\r
+    khm_int32 rv = KHM_ERROR_SUCCESS;\r
+    khm_int32 flags = 0;\r
+\r
+    if(!khc_is_config_running())\r
+        return KHM_ERROR_NOT_READY;\r
+\r
+    if(!khc_is_handle(conf))\r
+        return KHM_ERROR_INVALID_PARAM;\r
+\r
+    c = khc_space_from_handle(conf);\r
+\r
+    EnterCriticalSection(&cs_conf_global);\r
 \r
-    return 0;\r
+    if (khc_is_machine_handle(conf))\r
+        flags |= KCONF_SPACE_FLAG_DELETE_M;\r
+    if (khc_is_user_handle(conf))\r
+        flags |= KCONF_SPACE_FLAG_DELETE_U;\r
+\r
+    rv = khcint_remove_space(c, flags);\r
+\r
+    LeaveCriticalSection(&cs_conf_global);\r
+\r
+    return rv;\r
 }\r
 \r
 khm_boolean \r
index d2226be2010f0ede1b78f9b5cca12a50ed585a57..4e9a49e9bebebd096fbf1c9ec7f9a25613822548 100644 (file)
@@ -865,6 +865,15 @@ khc_enum_subspaces(khm_handle conf,
                    khm_handle prev,\r
                    khm_handle * next);\r
 \r
+/*! \brief Remove a configuration space\r
+\r
+    The configuration space will be marked for removal.  Once all the\r
+    handles for the space have been released, it will be deleted.  The\r
+    configuration stores that will be affected are the write enabled\r
+    configuration stores for the handle.\r
+ */\r
+KHMEXP khm_int32 KHMAPI\r
+khc_remove_space(khm_handle conf);\r
 /*@}*/\r
 \r
 #endif\r
index 3a23af1279da9a8d92e9d7e34a4da927900ef694..64068f4a9031cf80cb04f91be901fb7d06a3f260 100644 (file)
@@ -63,7 +63,8 @@ typedef struct kconf_conf_space_t {
 } kconf_conf_space;\r
 \r
 //#define KCONF_SPACE_FLAG_SCHEMA 0x00000020\r
-#define KCONF_SPACE_FLAG_DELETED 0x00000040\r
+#define KCONF_SPACE_FLAG_DELETE_U 0x00000040\r
+#define KCONF_SPACE_FLAG_DELETE_M 0x00000080\r
 \r
 typedef struct kconf_conf_handle_t {\r
     khm_int32   magic;\r
@@ -89,7 +90,7 @@ extern LONG conf_status;
 \r
 #define khc_is_config_running() (conf_init && conf_status)\r
 \r
-#define CONFIG_REGPATHW L"SOFTWARE\\MIT\\NetIDMgr"\r
+#define CONFIG_REGPATHW L"Software\\MIT\\NetIDMgr"\r
 \r
 void init_kconf(void);\r
 void exit_kconf(void);\r
@@ -122,4 +123,7 @@ khcint_space_release(kconf_conf_space * s);
 HKEY\r
 khcint_space_open_key(kconf_conf_space * s, khm_int32 flags);\r
 \r
+khm_int32\r
+khcint_remove_space(kconf_conf_space * c, khm_int32 flags);\r
+\r
 #endif\r
index badfb2b497be054853aeb41950a535c8b8025293..f77ebccf1a44f912d7a18734fedcc29058bd3a82 100644 (file)
@@ -128,28 +128,30 @@ kcdb_attr_sys_cb(khm_handle vcred,
 \r
     case KCDB_ATTR_TIMELEFT:\r
         {\r
-            /* we are going to make liberal use of __int64 here.  It\r
-               is equivalent to FILETIME and also the MSDN docs say we\r
-               should use it if the compiler supports it */\r
             khm_int32 rv = KHM_ERROR_SUCCESS;\r
-            unsigned __int64 ftc;\r
-            SYSTEMTIME st;\r
 \r
-            if(!buf || *pcb_buf < sizeof(__int64)) {\r
-                *pcb_buf = sizeof(__int64);\r
+            if(!buf || *pcb_buf < sizeof(FILETIME)) {\r
+                *pcb_buf = sizeof(FILETIME);\r
                 rv = KHM_ERROR_TOO_LONG;\r
             } else if(!kcdb_cred_buf_exist(c,KCDB_ATTR_EXPIRE)) {\r
-                *pcb_buf = sizeof(__int64);\r
+                *pcb_buf = sizeof(FILETIME);\r
                 /* setting the timeleft to _I64_MAX has the\r
                    interpretation that this credential does not\r
                    expire, which is the default behavior if the\r
                    expiration time is not known */\r
-                *((__int64 *) buf) = _I64_MAX;\r
+                *((FILETIME *) buf) = IntToFt(_I64_MAX);\r
             } else {\r
-                GetSystemTime(&st);\r
-                SystemTimeToFileTime(&st, (LPFILETIME) &ftc);\r
-                *((__int64 *) buf) =\r
-                    *((__int64 *) kcdb_cred_buf_get(c,KCDB_ATTR_EXPIRE)) - ftc;\r
+                FILETIME ftc;\r
+                khm_int64 iftc;\r
+\r
+                GetSystemTimeAsFileTime(&ftc);\r
+                iftc = FtToInt(&ftc);\r
+\r
+                *((FILETIME *) buf) =\r
+                    IntToFt(FtToInt((FILETIME *) \r
+                                    kcdb_cred_buf_get(c,KCDB_ATTR_EXPIRE))\r
+                            - iftc);\r
+                *pcb_buf = sizeof(FILETIME);\r
             }\r
 \r
             return rv;\r
@@ -157,28 +159,28 @@ kcdb_attr_sys_cb(khm_handle vcred,
 \r
     case KCDB_ATTR_RENEW_TIMELEFT:\r
         {\r
-            /* we are going to make liberal use of __int64 here.  It\r
-               is equivalent to FILETIME and also the MSDN docs say we\r
-               should use it if the compiler supports it */\r
             khm_int32 rv = KHM_ERROR_SUCCESS;\r
-            unsigned __int64 ftc;\r
-            SYSTEMTIME st;\r
 \r
-            if(!buf || *pcb_buf < sizeof(__int64)) {\r
-                *pcb_buf = sizeof(__int64);\r
+            if(!buf || *pcb_buf < sizeof(FILETIME)) {\r
+                *pcb_buf = sizeof(FILETIME);\r
                 rv = KHM_ERROR_TOO_LONG;\r
             } else if(!kcdb_cred_buf_exist(c,KCDB_ATTR_RENEW_EXPIRE)) {\r
-                *pcb_buf = sizeof(__int64);\r
+                *pcb_buf = sizeof(FILETIME);\r
                 /* setting the timeleft to _I64_MAX has the\r
                    interpretation that this credential does not\r
                    expire, which is the default behavior if the\r
                    expiration time is not known */\r
-                *((__int64 *) buf) = _I64_MAX;\r
+                *((FILETIME *) buf) = IntToFt(_I64_MAX);\r
             } else {\r
-                GetSystemTime(&st);\r
-                SystemTimeToFileTime(&st, (LPFILETIME) &ftc);\r
-                *((__int64 *) buf) =\r
-                    *((__int64 *) kcdb_cred_buf_get(c,KCDB_ATTR_RENEW_EXPIRE)) - ftc;\r
+                FILETIME ftc;\r
+\r
+                GetSystemTimeAsFileTime(&ftc);\r
+\r
+                *((FILETIME *) buf) =\r
+                    IntToFt(FtToInt(((FILETIME *)\r
+                                     kcdb_cred_buf_get(c,KCDB_ATTR_RENEW_EXPIRE))\r
+                                    - FtToInt(&ftc)));\r
+                *pcb_buf = sizeof(FILETIME);\r
             }\r
 \r
             return rv;\r
@@ -688,7 +690,7 @@ KHMEXP khm_int32 KHMAPI kcdb_attrib_describe(
 {\r
     kcdb_attrib_i * ai;\r
     size_t cb_size = 0;\r
-    khm_boolean prop;\r
+    khm_boolean prop = FALSE;\r
 \r
     if(!cbsize)\r
         return KHM_ERROR_INVALID_PARAM;\r
@@ -697,6 +699,8 @@ KHMEXP khm_int32 KHMAPI kcdb_attrib_describe(
         prop = FALSE;\r
     else if(id >= KCDB_ATTR_MIN_PROP_ID && id <= KCDB_ATTR_MAX_PROP_ID)\r
         prop = TRUE;\r
+    else \r
+       return KHM_ERROR_INVALID_PARAM;\r
 \r
     if(prop)\r
         ai = kcdb_property_tbl[id - KCDB_ATTR_MIN_PROP_ID];\r
index ccad383e6f4702cb338dd251d45cf1c7f04b0a76..37f246534da4cfb5cc0b2d4534e94fa1da24afc0 100644 (file)
@@ -601,9 +601,9 @@ KHMEXP khm_int32 KHMAPI kcdb_cred_get_attr_string(
             code = KHM_ERROR_NOT_FOUND;\r
     }\r
 \r
-_exit:\r
+ _exit:\r
     kcdb_cred_unlock_read();\r
-_exit_nolock:\r
+ _exit_nolock:\r
     if(type)\r
         kcdb_type_release_info(type);\r
     if(attrib)\r
@@ -990,11 +990,12 @@ kcdb_cred_get_flags(khm_handle vcred,
     if (!(f & KCDB_CRED_FLAG_EXPIRED) && \r
         kcdb_cred_buf_exist(cred, KCDB_ATTR_EXPIRE)) {\r
 \r
-        khm_int64 ftc;\r
+        FILETIME ftc;\r
             \r
-        GetSystemTimeAsFileTime((LPFILETIME) &ftc);\r
-        if (ftc > *((khm_int64 *) \r
-                    kcdb_cred_buf_get(cred, KCDB_ATTR_EXPIRE)))\r
+        GetSystemTimeAsFileTime(&ftc);\r
+        if (CompareFileTime(&ftc, ((FILETIME *) \r
+                                   kcdb_cred_buf_get(cred, KCDB_ATTR_EXPIRE)))\r
+            >= 0)\r
             f |= KCDB_CRED_FLAG_EXPIRED;\r
     }\r
 \r
@@ -1004,10 +1005,11 @@ kcdb_cred_get_flags(khm_handle vcred,
     if (!(f & KCDB_CRED_FLAG_INVALID)) {\r
         if (f & KCDB_CRED_FLAG_RENEWABLE) {\r
             if (kcdb_cred_buf_exist(cred, KCDB_ATTR_RENEW_EXPIRE)) {\r
-                khm_int64 ftc;\r
+                FILETIME ftc;\r
 \r
-                GetSystemTimeAsFileTime((LPFILETIME) &ftc);\r
-                if (ftc > *((khm_int64 *) kcdb_cred_buf_get(cred, KCDB_ATTR_RENEW_EXPIRE)))\r
+                GetSystemTimeAsFileTime(&ftc);\r
+                if (CompareFileTime(&ftc, ((FILETIME *)\r
+                                           kcdb_cred_buf_get(cred, KCDB_ATTR_RENEW_EXPIRE))) >= 0)\r
                     f |= KCDB_CRED_FLAG_INVALID;\r
             }\r
         } else {\r
index 869cd8409da749c2fc5a362feaf2e6b49bdeb553..9be551ba1f28c77392bd806a09cbfa80b563d1e5 100644 (file)
@@ -79,7 +79,7 @@ void kcdb_credset_buf_assert_size(kcdb_credset * cs, khm_int32 nclist)
             (((nclist - (KCDB_CREDSET_INITIAL_SIZE + 1)) / KCDB_CREDSET_GROWTH_FACTOR) + 1) *\r
             KCDB_CREDSET_GROWTH_FACTOR;\r
 \r
-        new_clist = calloc(nclist, sizeof(kcdb_credset_credref));\r
+        new_clist = PCALLOC(nclist, sizeof(kcdb_credset_credref));\r
 \r
         memcpy(new_clist, cs->clist, cs->nclist * sizeof(kcdb_credset_credref));\r
 \r
@@ -693,8 +693,7 @@ KHMEXP khm_int32 KHMAPI kcdb_credset_find_filtered(
     khm_int32 rv = KHM_ERROR_SUCCESS;\r
     int i;\r
 \r
-    if((credset && !kcdb_credset_is_credset(credset)) ||\r
-        (!f || !cred))\r
+    if((credset && !kcdb_credset_is_credset(credset)) || !f)\r
         return KHM_ERROR_INVALID_PARAM;\r
 \r
     if(credset)\r
@@ -724,10 +723,14 @@ KHMEXP khm_int32 KHMAPI kcdb_credset_find_filtered(
     cs->flags &= ~KCDB_CREDSET_FLAG_ENUM;\r
 \r
     if(i < cs->nclist) {\r
-        *cred = (khm_handle) cs->clist[i].cred;\r
-        kcdb_cred_hold(*cred);\r
-        if(idx)\r
+        if (cred) {\r
+            *cred = (khm_handle) cs->clist[i].cred;\r
+            kcdb_cred_hold(*cred);\r
+        }\r
+\r
+        if(idx) {\r
             *idx = i;\r
+        }\r
     } else {\r
         rv = KHM_ERROR_NOT_FOUND;\r
     }\r
index 43dd425c4a46756b29e7d89fccb7ea103dd540f7..896f723c5935a287426ba084281721bea20baa4d 100644 (file)
@@ -180,8 +180,8 @@ KHMEXP khm_int32 KHMAPI
 kcdb_identity_create(const wchar_t *name, \r
                      khm_int32 flags, \r
                      khm_handle * result) {\r
-    kcdb_identity * id;\r
-    kcdb_identity * id_tmp;\r
+    kcdb_identity * id = NULL;\r
+    kcdb_identity * id_tmp = NULL;\r
     size_t namesize;\r
 \r
     if(!result || !name)\r
@@ -823,9 +823,9 @@ kcdb_identity_set_attr(khm_handle vid,
                        void * buffer,\r
                        khm_size cbbuf)\r
 {\r
-    kcdb_identity * id;\r
-    kcdb_attrib * attrib;\r
-    kcdb_type * type;\r
+    kcdb_identity * id = NULL;\r
+    kcdb_attrib * attrib = NULL;\r
+    kcdb_type * type = NULL;\r
     khm_size slot;\r
     khm_size cbdest;\r
     khm_int32 code = KHM_ERROR_SUCCESS;\r
index e49c750d512a67967befdd019eacec998f8688c7..e1bbfb0bd605a8fdeaeee05ff02501a02bd3a4a2 100644 (file)
@@ -2287,6 +2287,26 @@ FtIntervalToMilliseconds(LPFILETIME pft);
 KHMEXP long KHMAPI \r
 FtCompare(LPFILETIME pft1, LPFILETIME pft2);\r
 \r
+/*! \brief Convert a FILETIME to a 64 bit int\r
+*/\r
+KHMEXP khm_int64 KHMAPI FtToInt(LPFILETIME pft);\r
+\r
+/*! \brief Convert a 64 bit int to a FILETIME\r
+*/\r
+KHMEXP FILETIME KHMAPI IntToFt(khm_int64 i);\r
+\r
+/*! \brief Calculate the difference between two FILETIMEs\r
+\r
+    Returns the value of ft1 - ft2\r
+ */\r
+KHMEXP FILETIME KHMAPI FtSub(LPFILETIME ft1, LPFILETIME ft2);\r
+\r
+/*! \brief Calculate the sum of two FILETIMEs\r
+\r
+    Return the value of ft1 + ft2\r
+ */\r
+KHMEXP FILETIME KHMAPI FtAdd(LPFILETIME ft1, LPFILETIME ft2);\r
+\r
 /*! \brief Convert a FILETIME inverval to a string\r
 */\r
 KHMEXP khm_int32 KHMAPI \r
index 2f733199a73ed5cf9bf3a66eac801c29b28fd333..4c221eeebaf2010fcf73d6e670e58307ede3429a 100644 (file)
@@ -72,11 +72,11 @@ END
 STRINGTABLE \r
 BEGIN\r
     IDS_CREDDB              "Khimaira Credentials Database"\r
-    IDS_NAME                "Name"\r
+    IDS_NAME                "Service Name"\r
     IDS_IDENTITY            "Identity"\r
     IDS_ISSUED              "Issued on"\r
     IDS_EXPIRES             "Expires on"\r
-    IDS_TIMELEFT            "Time left"\r
+    IDS_TIMELEFT            "Time Remaining"\r
     IDS_LOCATION            "Location"\r
     IDS_PARENT              "Parent"\r
     IDS_TYPE                "Type"\r
@@ -106,7 +106,7 @@ END
 \r
 STRINGTABLE \r
 BEGIN\r
-    IDS_IVl_W_SPEC          "w,wk,wks,weeks"\r
+    128                     "w,wk,wks,weeks"\r
     IDS_FLAGS               "Flags"\r
     IDS_RENEW_TIMELEFT      "Renewable Time left"\r
     IDS_RENEW_EXPIRES       "Renewable time expires"\r
index ab6620cd5161053540b21c20b97e3d55b5e3e928..417b214e0a4658ea7c8198f22562e3efcedf04a2 100644 (file)
@@ -1,6 +1,6 @@
 //{{NO_DEPENDENCIES}}\r
 // Microsoft Visual C++ generated include file.\r
-// Used by D:\work\khimaira\src\kcreddb\lang\en_us\kcredres.rc\r
+// Used by D:\work\pismere\athena\auth\krb5\src\windows\identity\kcreddb\lang\en_us\kcredres.rc\r
 //\r
 #define IDS_CREDDB                      101\r
 #define IDS_NAME                        102\r
@@ -31,7 +31,6 @@
 #define IDS_IVL_D_SPEC                  127\r
 #define IDS_IVl_W_SPEC                  128\r
 #define IDS_IVL_W_SPEC                  128\r
-#define IDS_IVl_W_SPEC                  128\r
 #define IDS_FLAGS                       129\r
 #define IDS_RENEW_TIMELEFT              130\r
 #define IDS_RENEW_EXPIRES               131\r
index 004beb62f9487c3b7b44e2852a98caa880901691..3df10482c6520b89a61d7a4ef825c0e8cdf4e9bd 100644 (file)
@@ -318,14 +318,17 @@ khm_int32 KHMAPI kcdb_type_date_dup(
 /* returns the number of milliseconds that must elapse away from the\r
    interval specified in pft for the representation of pft to change\r
    from whatever it is right now */\r
-KHMEXP long KHMAPI FtIntervalMsToRepChange(LPFILETIME pft)\r
+KHMEXP long KHMAPI \r
+FtIntervalMsToRepChange(LPFILETIME pft)\r
 {\r
     __int64 ms,s,m,h,d;\r
+    __int64 ift;\r
     long l;\r
 \r
-    ms = *((__int64 *) pft) / 10000i64;\r
+    ift = FtToInt(pft);\r
+    ms = ift / 10000i64;\r
     \r
-    if(ms < 0 || *((__int64 *) pft) == _I64_MAX)\r
+    if(ms < 0 || ift == _I64_MAX)\r
         return -1;\r
 \r
     s = ms / 1000i64;\r
@@ -333,36 +336,44 @@ KHMEXP long KHMAPI FtIntervalMsToRepChange(LPFILETIME pft)
     h = s / 3600;\r
     d = s / (3600*24);\r
 \r
-    if(d > 0) {\r
+    if (d > 0) {\r
         /* rep change at next hour change */\r
         l = (long) (ms % (3600*1000i64));\r
-    } else if(h > 0) {\r
+    } else if (h > 0) {\r
+        /* rep change at next minute change */\r
+        l = (long) (ms % (60*1000i64));\r
+    } else if (m > 5) {\r
         /* rep change at next minute change */\r
         l = (long) (ms % (60*1000i64));\r
     } else {\r
+        /* rep change at next second change */\r
         l = (long) (ms % 1000);\r
     }\r
 \r
     return l;\r
 }\r
 \r
-KHMEXP khm_int32 KHMAPI FtIntervalToString(LPFILETIME data, wchar_t * buffer, khm_size * cb_buf)\r
+KHMEXP khm_int32 KHMAPI \r
+FtIntervalToString(LPFILETIME data, wchar_t * buffer, khm_size * cb_buf)\r
 {\r
     size_t cbsize;\r
     __int64 s,m,h,d;\r
+    __int64 ift;\r
     wchar_t ibuf[256];\r
     wchar_t fbuf[256];\r
     wchar_t * t;\r
 \r
     if(!cb_buf)\r
         return KHM_ERROR_INVALID_PARAM;\r
-    s = *((__int64 *) data) / 10000000i64;\r
+\r
+    ift = FtToInt(data);\r
+    s = ift / 10000000i64;\r
 \r
     m = s / 60;\r
     h = s / 3600;\r
     d = s / (3600*24);\r
 \r
-    if(*((__int64 *) data) == _I64_MAX) {\r
+    if(ift == _I64_MAX) {\r
         LoadString(hinst_kcreddb, IDS_IVL_UNKNOWN, ibuf, sizeof(ibuf)/sizeof(wchar_t));\r
     } else if(s < 0) {\r
         LoadString(hinst_kcreddb, IDS_IVL_EXPIRED, ibuf, sizeof(ibuf)/sizeof(wchar_t));\r
@@ -385,16 +396,21 @@ KHMEXP khm_int32 KHMAPI FtIntervalToString(LPFILETIME data, wchar_t * buffer, kh
                 StringCbPrintf(t, sizeof(ibuf) - wcslen(ibuf)*sizeof(wchar_t), fbuf, h);\r
             }\r
         }\r
-    } else if(h > 0) {\r
+    } else if(h > 0 || m > 5) {\r
         m = (s - (h * 3600)) / 60;\r
         if(h == 1) {\r
             LoadString(hinst_kcreddb, IDS_IVL_1H, ibuf, ARRAYLENGTH(ibuf));\r
-        } else {\r
+        } else if (h > 1) {\r
             LoadString(hinst_kcreddb, IDS_IVL_H, fbuf, ARRAYLENGTH(fbuf));\r
             StringCbPrintf(ibuf, sizeof(ibuf), fbuf, h);\r
+        } else {\r
+            *ibuf = L'\0';\r
         }\r
-        if(m > 0) {\r
-            StringCbCat(ibuf, sizeof(ibuf), L" ");\r
+\r
+        if(m > 0 || h == 0) {\r
+            if (h >= 1)\r
+                StringCbCat(ibuf, sizeof(ibuf), L" ");\r
+\r
             t = ibuf + wcslen(ibuf);\r
             if(m == 1)\r
             {\r
@@ -446,12 +462,12 @@ KHMEXP khm_int32 KHMAPI FtIntervalToString(LPFILETIME data, wchar_t * buffer, kh
     return KHM_ERROR_SUCCESS;\r
 }\r
 \r
-khm_int32 KHMAPI kcdb_type_interval_toString(\r
-    const void * data, \r
-    khm_size cbd, \r
-    wchar_t * buffer, \r
-    khm_size * cb_buf, \r
-    khm_int32 flags)\r
+khm_int32 KHMAPI \r
+kcdb_type_interval_toString(const void * data, \r
+                            khm_size cbd, \r
+                            wchar_t * buffer, \r
+                            khm_size * cb_buf, \r
+                            khm_int32 flags)\r
 {\r
     return FtIntervalToString((LPFILETIME) data, buffer, cb_buf);\r
 }\r
@@ -471,8 +487,8 @@ khm_int32 KHMAPI kcdb_type_interval_comp(
 {\r
     __int64 i1, i2;\r
 \r
-    i1 = *((__int64 *) d1);\r
-    i2 = *((__int64 *) d2);\r
+    i1 = FtToInt((FILETIME *) d1);\r
+    i2 = FtToInt((FILETIME *) d2);\r
 \r
     if(i1 < i2)\r
         return -1;\r
@@ -488,12 +504,12 @@ khm_int32 KHMAPI kcdb_type_interval_dup(
     void * d_dst,\r
     khm_size * cbd_dst)\r
 {\r
-    if(d_dst && *cbd_dst >= sizeof(__int64)) {\r
-        *cbd_dst = sizeof(__int64);\r
-        *((__int64 *) d_dst) = *((__int64 *) d_src);\r
+    if(d_dst && *cbd_dst >= sizeof(FILETIME)) {\r
+        *cbd_dst = sizeof(FILETIME);\r
+        *((FILETIME *) d_dst) = *((FILETIME *) d_src);\r
         return KHM_ERROR_SUCCESS;\r
     } else {\r
-        *cbd_dst = sizeof(__int64);\r
+        *cbd_dst = sizeof(FILETIME);\r
         return KHM_ERROR_TOO_LONG;\r
     }\r
 }\r
@@ -759,8 +775,8 @@ void kcdb_type_init(void)
     type.toString = kcdb_type_interval_toString;\r
     type.name = KCDB_TYPENAME_INTERVAL;\r
     type.id = KCDB_TYPE_INTERVAL;\r
-    type.cb_max = sizeof(__int64);\r
-    type.cb_min = sizeof(__int64);\r
+    type.cb_max = sizeof(FILETIME);\r
+    type.cb_min = sizeof(FILETIME);\r
     type.flags = KCDB_TYPE_FLAG_CB_FIXED;\r
 \r
     kcdb_type_register(&type, NULL);\r
@@ -1088,39 +1104,92 @@ KHMEXP khm_int32 KHMAPI kcdb_type_get_next_free(khm_int32 * id)
 \r
 KHMEXP void KHMAPI TimetToFileTime( time_t t, LPFILETIME pft )\r
 {\r
-    LONGLONG ll = Int32x32To64(t, 10000000) + 116444736000000000i64;\r
+    LONGLONG ll;\r
+\r
+    if ( sizeof(time_t) == 4 )\r
+       ll = Int32x32To64(t, 10000000) + 116444736000000000i64;\r
+    else {\r
+       ll = t * 10000000i64 + 116444736000000000i64;\r
+    }\r
     pft->dwLowDateTime = (DWORD) ll;\r
     pft->dwHighDateTime = (DWORD) (ll >> 32);\r
 }\r
 \r
 KHMEXP void KHMAPI TimetToFileTimeInterval(time_t t, LPFILETIME pft)\r
 {\r
-    LONGLONG ll = Int32x32To64(t, 10000000);\r
+    LONGLONG ll;\r
+    \r
+    if ( sizeof(time_t) == 4 )\r
+       ll = Int32x32To64(t, 10000000);\r
+    else {\r
+       ll = t * 10000000i64;\r
+    }\r
     pft->dwLowDateTime = (DWORD) ll;\r
     pft->dwHighDateTime = (DWORD) (ll >> 32);\r
 }\r
 \r
 KHMEXP long KHMAPI FtIntervalToSeconds(LPFILETIME pft)\r
 {\r
-    __int64 i = *((__int64 *) pft);\r
+    __int64 i = FtToInt(pft);\r
     return (long) (i / 10000000i64);\r
 }\r
 \r
 KHMEXP long KHMAPI FtIntervalToMilliseconds(LPFILETIME pft)\r
 {\r
-    __int64 i = *((__int64 *) pft);\r
+    __int64 i = FtToInt(pft);\r
     return (long) (i / 10000i64);\r
 }\r
 \r
-KHMEXP long KHMAPI FtCompare(LPFILETIME pft1, LPFILETIME pft2) {\r
-    __int64 i1 = *((__int64 *) pft1);\r
-    __int64 i2 = *((__int64 *) pft2);\r
+KHMEXP khm_int64 KHMAPI FtToInt(LPFILETIME pft) {\r
+    LARGE_INTEGER ll;\r
+    ll.LowPart = pft->dwLowDateTime;\r
+    ll.HighPart = pft->dwHighDateTime;\r
+    return ll.QuadPart;\r
+}\r
 \r
-    if (i1 < i2)\r
-        return -1;\r
-    if (i1 == i2)\r
-        return 0;\r
-    return 1;\r
+KHMEXP FILETIME KHMAPI IntToFt(khm_int64 i) {\r
+    LARGE_INTEGER ll;\r
+    FILETIME ft;\r
+\r
+    ll.QuadPart = i;\r
+    ft.dwLowDateTime = ll.LowPart;\r
+    ft.dwHighDateTime = ll.HighPart;\r
+\r
+    return ft;\r
+}\r
+\r
+KHMEXP FILETIME KHMAPI FtSub(LPFILETIME ft1, LPFILETIME ft2) {\r
+    FILETIME d;\r
+    LARGE_INTEGER l1, l2;\r
+\r
+    l1.LowPart = ft1->dwLowDateTime;\r
+    l1.HighPart = ft1->dwHighDateTime;\r
+    l2.LowPart = ft2->dwLowDateTime;\r
+    l2.HighPart = ft2->dwHighDateTime;\r
+\r
+    l1.QuadPart -= l2.QuadPart;\r
+\r
+    d.dwLowDateTime = l1.LowPart;\r
+    d.dwHighDateTime = l1.HighPart;\r
+\r
+    return d;\r
+}\r
+\r
+KHMEXP FILETIME KHMAPI FtAdd(LPFILETIME ft1, LPFILETIME ft2) {\r
+    FILETIME d;\r
+    LARGE_INTEGER l1, l2;\r
+\r
+    l1.LowPart = ft1->dwLowDateTime;\r
+    l1.HighPart = ft1->dwHighDateTime;\r
+    l2.LowPart = ft2->dwLowDateTime;\r
+    l2.HighPart = ft2->dwHighDateTime;\r
+\r
+    l1.QuadPart += l2.QuadPart;\r
+\r
+    d.dwLowDateTime = l1.LowPart;\r
+    d.dwHighDateTime = l1.HighPart;\r
+\r
+    return d;\r
 }\r
 \r
 KHMEXP int KHMAPI AnsiStrToUnicode( wchar_t * wstr, size_t cbwstr, const char * astr)\r
@@ -1222,10 +1291,9 @@ KHMEXP khm_int32 KHMAPI IntervalStringToFt(FILETIME * pft, wchar_t * str)
 {\r
     size_t cb;\r
     wchar_t * b;\r
-    __int64 *pr, t;\r
+    __int64 t;\r
 \r
-    pr = (__int64 *) pft;\r
-    *pr = 0;\r
+    *pft = IntToFt(0);\r
 \r
     /* ideally we should synchronize this, but it doesn't hurt if two\r
        threads do this at the same time, because we only set the ivspecs_loaded\r
@@ -1289,7 +1357,7 @@ KHMEXP khm_int32 KHMAPI IntervalStringToFt(FILETIME * pft, wchar_t * str)
         b = e;\r
     }\r
 \r
-    *pr = t;\r
+    *pft = IntToFt(t);\r
 \r
     return KHM_ERROR_SUCCESS;\r
 }\r
index cc4b9d3cc86508da0662173d936328e12bed317f..d8b145d240b034d055c47b68d04ca9ca80e913f2 100644 (file)
@@ -26,9 +26,7 @@
 \r
 #include<kherrinternal.h>\r
 #include<assert.h>\r
-#ifdef Debug\r
 #include<stdarg.h>\r
-#endif\r
 \r
 CRITICAL_SECTION cs_error;\r
 DWORD tls_error = 0;\r
@@ -679,6 +677,65 @@ _exit:
     LeaveCriticalSection(&cs_error);\r
 }\r
 \r
+KHMEXP kherr_event * __cdecl\r
+kherr_reportf(const wchar_t * long_desc_fmt, ...) {\r
+    va_list vl;\r
+    wchar_t buf[1024];\r
+    kherr_event * e;\r
+\r
+    va_start(vl, long_desc_fmt);\r
+    StringCbVPrintf(buf, sizeof(buf), long_desc_fmt, vl);\r
+#ifdef DEBUG\r
+    OutputDebugString(buf);\r
+#endif\r
+    va_end(vl);\r
+\r
+    e = kherr_report(KHERR_DEBUG_1,\r
+                     NULL, NULL, NULL, buf, NULL, 0,\r
+                     KHERR_SUGGEST_NONE, 0, 0, 0, 0, KHERR_RF_CSTR_LONG_DESC\r
+#ifdef _WIN32\r
+                     ,NULL\r
+#endif\r
+                     );\r
+    if (e) {\r
+        kherr_evaluate_event(e);\r
+    }\r
+\r
+    return e;\r
+}\r
+\r
+KHMEXP kherr_event * __cdecl\r
+kherr_reportf_ex(enum kherr_severity severity,\r
+                 const wchar_t * facility,\r
+                 khm_int32 facility_id,\r
+#ifdef _WIN32\r
+                 HMODULE hModule,\r
+#endif\r
+                 const wchar_t * long_desc_fmt, ...) {\r
+    va_list vl;\r
+    wchar_t buf[1024];\r
+    kherr_event * e;\r
+\r
+    va_start(vl, long_desc_fmt);\r
+    StringCbVPrintf(buf, sizeof(buf), long_desc_fmt, vl);\r
+#ifdef DEBUG\r
+    OutputDebugString(buf);\r
+#endif\r
+    va_end(vl);\r
+\r
+    e = kherr_report(severity, NULL, facility, NULL, buf, NULL, facility_id,\r
+                     KHERR_SUGGEST_NONE, 0, 0, 0, 0, KHERR_RF_CSTR_LONG_DESC\r
+#ifdef _WIN32\r
+                     ,hModule\r
+#endif\r
+                     );\r
+    if (e) {\r
+        kherr_evaluate_event(e);\r
+    }\r
+\r
+    return e;\r
+}\r
+\r
 KHMEXP kherr_event * KHMAPI \r
 kherr_report(enum kherr_severity severity,\r
              const wchar_t * short_desc,\r
index 973390f5eb5c7d68e5bd0ac12fc816f250d9031f..6ae943e4ecffa8eade9f2c674af345431ce5476b 100644 (file)
@@ -569,6 +569,34 @@ KHMEXP kherr_event * KHMAPI kherr_report(
 #endif\r
 );\r
 \r
+/*! \brief Report a formatted message\r
+\r
+    The format string \a long_desc_fmt should be a string constant and\r
+    the format specifiers follow that of \a sprintf.  This creates an\r
+    event with the long description set to the expansion of the format\r
+    string against the arguments.\r
+ */\r
+KHMEXP kherr_event * __cdecl\r
+kherr_reportf_ex(enum kherr_severity severity,\r
+                 const wchar_t * facility,\r
+                 khm_int32 facility_id,\r
+#ifdef _WIN32\r
+                 HMODULE hModule,\r
+#endif\r
+                 const wchar_t * long_desc_fmt,\r
+                 ...);\r
+\r
+/*! \brief Report a formatted message\r
+\r
+    The format string \a long_desc_fmt should be a string constant and\r
+    the format specifiers follow that of \a sprintf.  This creates an\r
+    event with the long description set to the expansion of the format\r
+    string against the arguments.\r
+ */\r
+KHMEXP kherr_event * __cdecl\r
+kherr_reportf(const wchar_t * long_desc_fmt,\r
+              ...);\r
+\r
 /*! \brief Create a parameter out of a transient string\r
 \r
     A parameter is created by duplicating the string that is passed\r
index f9fdd4de815bdaddeda86e6462f4f448ec4e57b5..1e632c7bac619971ba52399d99e7248585d57cd2 100644 (file)
@@ -59,14 +59,25 @@ kmmint_remove_from_module_queue(void) {
 }\r
 \r
 void\r
-kmmint_add_to_plugin_queue(void) {\r
-    InterlockedIncrement(&pending_plugins);\r
+kmmint_add_to_plugin_queue(kmm_plugin_i * plugin) {\r
+    EnterCriticalSection(&cs_kmm);\r
+    if (!(plugin->flags & KMM_PLUGIN_FLAG_IN_QUEUE)) {\r
+        InterlockedIncrement(&pending_plugins);\r
+        plugin->flags |= KMM_PLUGIN_FLAG_IN_QUEUE;\r
+    }\r
+    LeaveCriticalSection(&cs_kmm);\r
 }\r
 \r
 void\r
-kmmint_remove_from_plugin_queue(void) {\r
-    InterlockedDecrement(&pending_plugins);\r
+kmmint_remove_from_plugin_queue(kmm_plugin_i * plugin) {\r
+    EnterCriticalSection(&cs_kmm);\r
 \r
+    if (plugin->flags & KMM_PLUGIN_FLAG_IN_QUEUE) {\r
+        InterlockedDecrement(&pending_plugins);\r
+        plugin->flags &= ~KMM_PLUGIN_FLAG_IN_QUEUE;\r
+    }\r
+\r
+    LeaveCriticalSection(&cs_kmm);\r
     kmmint_check_completion();\r
 }\r
 \r
@@ -160,7 +171,7 @@ DWORD WINAPI kmm_plugin_broker(LPVOID lpParameter)
 \r
     /* if it fails to initialize, we exit the plugin */\r
     if(KHM_FAILED(rv)) {\r
-        kmmint_remove_from_plugin_queue();\r
+        kmmint_remove_from_plugin_queue(p);\r
         rv = 1;\r
         goto _exit;\r
     }\r
@@ -198,6 +209,7 @@ DWORD WINAPI kmm_plugin_broker(LPVOID lpParameter)
             pd->n_unresolved--;\r
 \r
             if(pd->n_unresolved == 0) {\r
+                kmmint_add_to_plugin_queue(pd);\r
                 kmm_hold_plugin(kmm_handle_from_plugin(pd));\r
                 kmq_post_message(KMSG_KMM, KMSG_KMM_I_REG, KMM_REG_INIT_PLUGIN, (void *) pd);\r
             }\r
@@ -205,7 +217,7 @@ DWORD WINAPI kmm_plugin_broker(LPVOID lpParameter)
     } while(FALSE);\r
     LeaveCriticalSection(&cs_kmm);\r
 \r
-    kmmint_remove_from_plugin_queue();\r
+    kmmint_remove_from_plugin_queue(p);\r
 \r
     /* main message loop */\r
     while(KHM_SUCCEEDED(kmq_dispatch(INFINITE)));\r
@@ -402,7 +414,7 @@ void kmm_init_plugin(kmm_plugin_i * p) {
         goto _exit_post;\r
     }\r
 \r
-    kmmint_add_to_plugin_queue();\r
+    kmmint_add_to_plugin_queue(p);\r
 \r
     p->ht_thread = CreateThread(NULL,\r
                                 0,\r
@@ -567,17 +579,19 @@ void kmm_init_module(kmm_module_i * m) {
     if(KHM_SUCCEEDED(khc_read_int32(csp_mod, L"FailureCount", &i))) {\r
         khm_int64 tm;\r
         khm_int64 ct;\r
+        FILETIME fct;\r
         khm_int32 last_reason = 0;\r
 \r
         /* reset the failure count if the failure count reset time\r
            period has elapsed */\r
         tm = 0;\r
         khc_read_int64(csp_mod, L"FailureTime", &tm);\r
-        GetSystemTimeAsFileTime((LPFILETIME) &ct);\r
-        ct -= tm;\r
+        GetSystemTimeAsFileTime(&fct);\r
+\r
+        ct = (FtToInt(&fct) - tm) / 10000000i64;\r
 \r
         if(tm > 0 && \r
-           FtIntervalToSeconds((LPFILETIME) &ct) > fail_reset_time) {\r
+           ct > fail_reset_time) {\r
             i = 0;\r
             khc_write_int32(csp_mod, L"FailureCount", 0);\r
             khc_write_int64(csp_mod, L"FailureTime", 0);\r
@@ -722,7 +736,7 @@ void kmm_init_module(kmm_module_i * m) {
  _exit:\r
     if(csp_mod) {\r
         if(record_failure) {\r
-            khm_int64 ct;\r
+            FILETIME fct;\r
 \r
             i = 0;\r
             khc_read_int32(csp_mod, L"FailureCount", &i);\r
@@ -730,8 +744,8 @@ void kmm_init_module(kmm_module_i * m) {
             khc_write_int32(csp_mod, L"FailureCount", i);\r
 \r
             if(i==1) { /* first fault */\r
-                GetSystemTimeAsFileTime((LPFILETIME) &ct);\r
-                khc_write_int64(csp_mod, L"FailureTime", ct);\r
+                GetSystemTimeAsFileTime(&fct);\r
+                khc_write_int64(csp_mod, L"FailureTime", FtToInt(&fct));\r
             }\r
 \r
             khc_write_int32(csp_mod, L"FailureReason", m->state);\r
index 3ef45198efdc7a274d5bee5471b26bc4b4e21605..c4e47238767c460c98c22820a44392cfd451a890 100644 (file)
@@ -143,6 +143,8 @@ typedef struct kmm_plugin_i_t {
 /* the plugin is in the module's plugin list */\r
 #define KMM_PLUGIN_FLAG_IN_MODLIST  4\r
 \r
+#define KMM_PLUGIN_FLAG_IN_QUEUE    0x10\r
+\r
 enum kmm_registrar_uparam_t {\r
     KMM_REG_INIT_MODULE,\r
     KMM_REG_EXIT_MODULE,\r
index cbadbc64480d36a82725da3db6686996eaefd5fe..5107edca4685ed79822bc0862c0685ec20905261 100644 (file)
@@ -37,6 +37,7 @@ all: mkdirs $(INCFILES) $(OBJFILES)
 \r
 clean::\r
        $(RM) $(INCFILES)\r
+       $(RM) $(OBJFILES)\r
 \r
 {}.c{$(LIBDIR)}.obj:\r
        $(C2OBJ)\r
index fdbe304fa0727a985059b8eca6e55374c5819280..28ae71a1ff93370654e65bfe38668786a05e5598 100644 (file)
@@ -68,8 +68,10 @@ void k4_update_display(k4_dlg_data * d) {
         EnableWindow(GetDlgItem(d->hwnd, IDC_NCK4_K524), FALSE);\r
     }\r
 \r
-    CheckRadioButton(d->hwnd, IDC_NCK4_AUTO, IDC_NCK4_K524,\r
+    CheckRadioButton(d->hwnd, IDC_NCK4_AUTO, IDC_NCK4_PWD,\r
                      method_to_id[d->method]);\r
+\r
+    khui_cw_enable_type(d->nc, credtype_id_krb4, d->k4_enabled);\r
 }\r
 \r
 void k4_update_data(k4_dlg_data * d) {\r
@@ -99,6 +101,30 @@ void k4_update_data(k4_dlg_data * d) {
     }\r
 }\r
 \r
+khm_boolean k4_should_identity_get_k4(khm_handle ident) {\r
+    khm_int32 idflags = 0;\r
+\r
+    if (KHM_FAILED(kcdb_identity_get_flags(ident, &idflags)))\r
+        return FALSE;\r
+\r
+    if (!(idflags & KCDB_IDENT_FLAG_DEFAULT)) {\r
+        /* we only support k4 for one identity, and that is the\r
+           default identity.  If we are trying to get tickets for\r
+           a non-default identity, then we start off as\r
+           disabled. */\r
+\r
+        khm_handle defident = NULL;\r
+\r
+        if (KHM_SUCCEEDED(kcdb_identity_get_default(&defident))) {\r
+            kcdb_identity_release(defident);\r
+\r
+            return FALSE;\r
+        }\r
+    }\r
+\r
+    return TRUE;\r
+}\r
+\r
 void k4_read_identity_data(k4_dlg_data * d) {\r
     khm_handle csp_ident = NULL;\r
     khm_handle csp_k4 = NULL;\r
@@ -139,23 +165,10 @@ void k4_read_identity_data(k4_dlg_data * d) {
             }\r
 \r
             khc_close_space(csp_ident);\r
-\r
-            kcdb_identity_get_flags(d->nc->identities[0], &idflags);\r
         }\r
 \r
-        if (!(idflags & KCDB_IDENT_FLAG_DEFAULT)) {\r
-            /* we only support k4 for one identity, and that is the\r
-               default identity.  If we are trying to get tickets for\r
-               a non-default identity, then we start off as\r
-               disabled. */\r
-\r
-            khm_handle defident = NULL;\r
-\r
-            if (KHM_SUCCEEDED(kcdb_identity_get_default(&defident))) {\r
-                kcdb_identity_release(defident);\r
-\r
-                d->k4_enabled = FALSE;\r
-            }\r
+        if (d->k4_enabled) {\r
+            d->k4_enabled = k4_should_identity_get_k4(d->nc->identities[0]);\r
         }\r
     } else {\r
         d->k4_enabled = FALSE;\r
@@ -417,6 +430,12 @@ krb4_msg_newcred(khm_int32 msg_type, khm_int32 msg_subtype,
 \r
             nc = (khui_new_creds *) vparam;\r
 \r
+            if (!nc->ctx.identity)\r
+                break;\r
+\r
+            if (!k4_should_identity_get_k4(nc->ctx.identity))\r
+                break;\r
+\r
             nct = PMALLOC(sizeof(*nct));\r
 #ifdef DEBUG\r
             assert(nct);\r
index 042da77b7acb789f9091eba9232f36e1d650f304..a07dc4b3089067eac5e14bfa7fad59ced86916bd 100644 (file)
@@ -63,10 +63,10 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,26,97,10\r
     CONTROL         "Automatically determine method",IDC_NCK4_AUTO,"Button",\r
                     BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,23,58,119,10\r
-    CONTROL         "Password",IDC_NCK4_PWD,"Button",BS_AUTORADIOBUTTON | \r
-                    WS_TABSTOP,23,75,47,10\r
     CONTROL         "Kerberos 5 to 4 translation",IDC_NCK4_K524,"Button",\r
-                    BS_AUTORADIOBUTTON | WS_TABSTOP,23,92,101,10\r
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,23,76,101,10\r
+    CONTROL         "Password",IDC_NCK4_PWD,"Button",BS_AUTORADIOBUTTON | \r
+                    WS_TABSTOP,23,94,47,10\r
     GROUPBOX        "Obtain Kerberos 4 tickets using",IDC_STATIC,7,43,286,72,\r
                     WS_GROUP\r
 END\r
index 28016d3cb8e9c05348eb180ae7379c732ea3303c..d2fabbad4066e01e891987042250ac09455138fe 100644 (file)
@@ -83,6 +83,9 @@ void khm_err_describe(long code, wchar_t * buf, khm_size cbbuf,
     case kadm_err_base:\r
        break;\r
     default:\r
+        if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) {\r
+            *suggestion = MSG_ERR_S_INTEGRITY;\r
+        }\r
         *suggest_code = KHERR_SUGGEST_RETRY;\r
         AnsiStrToUnicode(buf, cbbuf, com_err_msg);\r
        return;\r
index 63fdc32b633393fb142e8983d975156c51342115..8cf89c7cd0ce1dfaf78e878bda53fba21be27fa2 100644 (file)
@@ -78,6 +78,8 @@ typedef struct tag_k5_config_data {
 \r
     wchar_t       config_file[MAX_PATH]; /* path to configuration file */\r
     khm_boolean   create_config_file; /* create config_file if missing? */\r
+    khm_boolean   inc_realms;   /* include full realm list in new\r
+                                   credentials dialog? */\r
 \r
     /* [libdefaults] */\r
     khm_boolean   dns_lookup_kdc;\r
@@ -100,15 +102,16 @@ typedef struct tag_k5_config_data {
     khm_int32     flags;\r
 } k5_config_data;\r
 \r
-#define K5_CDFLAG_MOD_DEF_REALM      1\r
-#define K5_CDFLAG_MOD_CONF_FILE      2\r
-#define K5_CDFLAG_MOD_DNS_LOOKUP_KDC 4\r
-#define K5_CDFLAG_MOD_DNS_LOOKUP_RLM 8\r
-#define K5_CDFLAG_MOD_DNS_FALLBACK   0x10\r
-#define K5_CDFLAG_MOD_NOADDRESSES    0x20\r
-#define K5_CDFLAG_MOD_LSA_IMPORT     0x40\r
-#define K5_CDFLAG_MOD_CREATE_CONF    0x80\r
-#define K5_CDFLAG_MOD_REALMS         0x1000\r
+#define K5_CDFLAG_MOD_DEF_REALM      0x00000001\r
+#define K5_CDFLAG_MOD_CONF_FILE      0x00000002\r
+#define K5_CDFLAG_MOD_DNS_LOOKUP_KDC 0x00000004\r
+#define K5_CDFLAG_MOD_DNS_LOOKUP_RLM 0x00000008\r
+#define K5_CDFLAG_MOD_DNS_FALLBACK   0x00000010\r
+#define K5_CDFLAG_MOD_NOADDRESSES    0x00000020\r
+#define K5_CDFLAG_MOD_LSA_IMPORT     0x00000040\r
+#define K5_CDFLAG_MOD_CREATE_CONF    0x00000080\r
+#define K5_CDFLAG_MOD_INC_REALMS     0x00000100\r
+#define K5_CDFLAG_MOD_REALMS         0x00001000\r
 \r
 static const char *const conf_yes[] = {\r
     "y", "yes", "true", "t", "1", "on",\r
@@ -506,16 +509,23 @@ k5_read_config_data(k5_config_data * d) {
         pprofile_release(profile);\r
     }\r
 \r
-    /* last, read the MSLSA import setting */\r
     {\r
         khm_int32 t;\r
 \r
+        /* last, read the MSLSA import setting */\r
         if (KHM_SUCCEEDED(khc_read_int32(csp_params,\r
                                          L"MsLsaImport", &t))) {\r
             d->lsa_import = t;\r
         } else {\r
             d->lsa_import = K5_LSAIMPORT_ALWAYS;\r
         }\r
+\r
+        if (KHM_SUCCEEDED(khc_read_int32(csp_params,\r
+                                         L"UseFullRealmList", &t))) {\r
+            d->inc_realms = !!t;\r
+        } else {\r
+            d->inc_realms = TRUE;\r
+        }\r
     }\r
 \r
     d->flags = 0;\r
@@ -546,9 +556,11 @@ k5_write_config_data(k5_config_data * d) {
 \r
     /* write the MSLSA import setting */\r
     if (d->flags & K5_CDFLAG_MOD_LSA_IMPORT) {\r
-\r
         khc_write_int32(csp_params, L"MsLsaImport", d->lsa_import);\r
+    }\r
 \r
+    if (d->flags & K5_CDFLAG_MOD_INC_REALMS) {\r
+        khc_write_int32(csp_params, L"UseFullRealmList", d->inc_realms);\r
     }\r
 \r
     if (!(d->flags & \r
@@ -912,6 +924,9 @@ k5_config_dlgproc(HWND hwnd,
 \r
             d->node_main = (khui_config_node) lParam;\r
 \r
+            CheckDlgButton(hwnd, IDC_CFG_INCREALMS,\r
+                           (d->inc_realms)? BST_CHECKED: BST_UNCHECKED);\r
+\r
             hw = GetDlgItem(hwnd, IDC_CFG_DEFREALM);\r
 #ifdef DEBUG\r
             assert(hw);\r
@@ -984,6 +999,21 @@ k5_config_dlgproc(HWND hwnd,
                                    KHUI_CNFLAG_MODIFIED);\r
                 return TRUE;\r
             }\r
+\r
+            if (wParam == MAKEWPARAM(IDC_CFG_INCREALMS, BN_CLICKED)) {\r
+                if (IsDlgButtonChecked(hwnd, IDC_CFG_INCREALMS) ==\r
+                    BST_CHECKED) {\r
+                    d->inc_realms = TRUE;\r
+                } else {\r
+                    d->inc_realms = FALSE;\r
+                }\r
+                d->flags |= K5_CDFLAG_MOD_INC_REALMS;\r
+\r
+                khui_cfg_set_flags(d->node_main,\r
+                                   KHUI_CNFLAG_MODIFIED,\r
+                                   KHUI_CNFLAG_MODIFIED);\r
+                return TRUE;\r
+            }\r
         }\r
         break;\r
 \r
index 17ab40929bc5a1a6acbd037e3c75a0a47f0e32fe..a4e549d3d245085a54696dc1d3a466f91f3e835c 100644 (file)
@@ -60,7 +60,10 @@ k5_id_read_params(k5_id_dlg_data * d) {
     khm_handle csp_idroot = NULL;\r
 \r
     cb = sizeof(idname);\r
-    khui_cfg_get_name(d->cfg.ctx_node, idname, &cb);\r
+    rv = khui_cfg_get_name(d->cfg.ctx_node, idname, &cb);\r
+#ifdef DEBUG\r
+    assert(KHM_SUCCEEDED(rv));\r
+#endif\r
 \r
     rv = kcdb_identity_create(idname, 0, &d->ident);\r
 #ifdef DEBUG\r
@@ -93,8 +96,12 @@ k5_id_read_params(k5_id_dlg_data * d) {
 \r
     cb = sizeof(d->ccache);\r
     rv = khc_read_string(csp_ident, L"DefaultCCName", d->ccache, &cb);\r
-    if (KHM_FAILED(rv))\r
-        ZeroMemory(d->ccache, sizeof(d->ccache));\r
+    if (KHM_FAILED(rv) || cb <= sizeof(wchar_t)) {\r
+        cb = sizeof(d->ccache);\r
+        if (KHM_FAILED(kcdb_identity_get_attr(d->ident, attr_id_krb5_ccname,\r
+                                              NULL, d->ccache, &cb)))\r
+            ZeroMemory(d->ccache, sizeof(d->ccache));\r
+    }\r
 \r
     khui_tracker_initialize(&d->tc_life);\r
     d->tc_life.current = d->life;\r
index 3dfea750ca05329a74fbf163a6a3f12cf15d6a29..5c076951a62e9af901811de89a2e3fc5a0abba7c 100644 (file)
@@ -220,7 +220,7 @@ static long get_tickets_from_cache(krb5_context ctx,
     khm_handle      ident = NULL;\r
     khm_handle      cred = NULL;\r
     time_t          tt;\r
-    khm_int64       ft, eft;\r
+    FILETIME        ft, eft;\r
     khm_int32       ti;\r
 \r
 \r
@@ -372,25 +372,32 @@ static long get_tickets_from_cache(krb5_context ctx,
             KRBv5Credentials.times.starttime = KRBv5Credentials.times.authtime;\r
 \r
         tt = KRBv5Credentials.times.starttime;\r
-        TimetToFileTime(tt, (LPFILETIME) &ft);\r
+        TimetToFileTime(tt, &ft);\r
         kcdb_cred_set_attr(cred, KCDB_ATTR_ISSUE, &ft, sizeof(ft));\r
 \r
         tt = KRBv5Credentials.times.endtime;\r
-        TimetToFileTime(tt, (LPFILETIME) &eft);\r
+        TimetToFileTime(tt, &eft);\r
         kcdb_cred_set_attr(cred, KCDB_ATTR_EXPIRE, &eft, sizeof(eft));\r
 \r
-        eft -= ft;\r
-        kcdb_cred_set_attr(cred, KCDB_ATTR_LIFETIME, &eft, sizeof(eft));\r
+        {\r
+            FILETIME ftl;\r
+\r
+            ftl = FtSub(&eft, &ft);\r
+            kcdb_cred_set_attr(cred, KCDB_ATTR_LIFETIME, &ftl, sizeof(ftl));\r
+        }\r
 \r
         if (KRBv5Credentials.times.renew_till > 0) {\r
+            FILETIME ftl;\r
+\r
             tt = KRBv5Credentials.times.renew_till;\r
-            TimetToFileTime(tt, (LPFILETIME) &eft);\r
+            TimetToFileTime(tt, &eft);\r
             kcdb_cred_set_attr(cred, KCDB_ATTR_RENEW_EXPIRE, &eft, \r
                                sizeof(eft));\r
 \r
-            eft -= ft;\r
-            kcdb_cred_set_attr(cred, KCDB_ATTR_RENEW_LIFETIME, &eft, \r
-                               sizeof(eft));\r
+\r
+            ftl = FtSub(&eft, &ft);\r
+            kcdb_cred_set_attr(cred, KCDB_ATTR_RENEW_LIFETIME, &ftl, \r
+                               sizeof(ftl));\r
         }\r
 \r
         ti = KRBv5Credentials.ticket_flags;\r
@@ -441,7 +448,7 @@ static long get_tickets_from_cache(krb5_context ctx,
             int n = 0;\r
             while ( KRBv5Credentials.addresses[n] )\r
                 n++;\r
-            list->addrList = calloc(1, n * sizeof(char *));\r
+            list->addrList = PCALLOC(1, n * sizeof(char *));\r
             if (!list->addrList) {\r
                 MessageBox(NULL, "Memory Error", "Error", MB_OK);\r
                 return ENOMEM;            \r
@@ -449,7 +456,7 @@ static long get_tickets_from_cache(krb5_context ctx,
             list->addrCount = n;\r
             for ( n=0; n<list->addrCount; n++ ) {\r
                 wsprintf(Buffer, "Address: %s", one_addr(KRBv5Credentials.addresses[n]));\r
-                list->addrList[n] = (char*) calloc(1, strlen(Buffer)+1);\r
+                list->addrList[n] = (char*) PCALLOC(1, strlen(Buffer)+1);\r
                 if (!list->addrList[n])\r
                 {\r
                     MessageBox(NULL, "Memory Error", "Error", MB_OK);\r
@@ -461,9 +468,9 @@ static long get_tickets_from_cache(krb5_context ctx,
 #endif\r
 \r
         if(cred_flags & KCDB_CRED_FLAG_INITIAL) {\r
-            __int64 t_issue_new;\r
-            __int64 t_expire_old;\r
-            __int64 t_expire_new;\r
+            FILETIME ft_issue_new;\r
+            FILETIME ft_expire_old;\r
+            FILETIME ft_expire_new;\r
             khm_size cb;\r
 \r
             /* an initial ticket!  If we find one, we generally set\r
@@ -472,30 +479,30 @@ static long get_tickets_from_cache(krb5_context ctx,
                the current primary credential. */\r
 \r
             tt = KRBv5Credentials.times.endtime;\r
-            TimetToFileTime(tt, (LPFILETIME) &t_expire_new);\r
+            TimetToFileTime(tt, &ft_expire_new);\r
 \r
             tt = KRBv5Credentials.times.starttime;\r
-            TimetToFileTime(tt, (LPFILETIME) &t_issue_new);\r
+            TimetToFileTime(tt, &ft_issue_new);\r
 \r
-            cb = sizeof(t_expire_old);\r
+            cb = sizeof(ft_expire_old);\r
             if(KHM_FAILED(kcdb_identity_get_attr(tident, \r
                                                  KCDB_ATTR_EXPIRE, \r
-                                                 NULL, &t_expire_old, \r
+                                                 NULL, &ft_expire_old, \r
                                                  &cb))\r
-                || t_expire_new > t_expire_old)\r
-            {\r
+               || CompareFileTime(&ft_expire_new, &ft_expire_old) > 0) {\r
+\r
                 kcdb_identity_set_attr(tident, attr_id_krb5_ccname, \r
                                        wcc_name, KCDB_CBSIZE_AUTO);\r
                 kcdb_identity_set_attr(tident, KCDB_ATTR_EXPIRE, \r
-                                       &t_expire_new, \r
-                                       sizeof(t_expire_new));\r
+                                       &ft_expire_new, \r
+                                       sizeof(ft_expire_new));\r
                 kcdb_identity_set_attr(tident, KCDB_ATTR_ISSUE,\r
-                                       &t_issue_new,\r
-                                       sizeof(t_issue_new));\r
+                                       &ft_issue_new,\r
+                                       sizeof(ft_issue_new));\r
 \r
                 if (KRBv5Credentials.times.renew_till > 0) {\r
                     tt = KRBv5Credentials.times.renew_till;\r
-                    TimetToFileTime(tt, (LPFILETIME) &ft);\r
+                    TimetToFileTime(tt, &ft);\r
                     kcdb_identity_set_attr(tident, \r
                                            KCDB_ATTR_RENEW_EXPIRE, \r
                                            &ft, sizeof(ft));\r
@@ -1515,60 +1522,44 @@ khm_krb5_ms2mit(BOOL save_creds)
     char *princ_name = NULL;\r
     BOOL rc = FALSE;\r
 \r
-#ifdef DEBUG\r
-    kherr_debug_printf(L"Begin : khm_krb5_ms2mit. save_cred=%d\n", (int) save_creds);\r
-#endif\r
+    kherr_reportf(L"Begin : khm_krb5_ms2mit. save_cred=%d\n", (int) save_creds);\r
+\r
     if ( !pkrb5_init_context )\r
         goto cleanup;\r
 \r
     if (code = pkrb5_init_context(&kcontext))\r
         goto cleanup;\r
 \r
-#ifdef DEBUG\r
-    kherr_debug_printf(L"Resolving MSLSA\n");\r
-#endif\r
+    kherr_reportf(L"Resolving MSLSA\n");\r
+\r
     if (code = pkrb5_cc_resolve(kcontext, "MSLSA:", &mslsa_ccache))\r
         goto cleanup;\r
 \r
     if ( save_creds ) {\r
-#ifdef DEBUG\r
-        kherr_debug_printf(L"Getting principal\n");\r
-#endif\r
-       if (code = pkrb5_cc_get_principal(kcontext, mslsa_ccache, &princ))\r
+        kherr_reportf(L"Getting principal\n");\r
+        if (code = pkrb5_cc_get_principal(kcontext, mslsa_ccache, &princ))\r
             goto cleanup;\r
 \r
-#ifdef DEBUG\r
-       kherr_debug_printf(L"Unparsing name\n");\r
-#endif\r
-       if (code = pkrb5_unparse_name(kcontext, princ, &princ_name))\r
+        kherr_reportf(L"Unparsing name\n");\r
+        if (code = pkrb5_unparse_name(kcontext, princ, &princ_name))\r
             goto cleanup;\r
 \r
-#ifdef DEBUG\r
-        kherr_debug_printf(L"Unparsed [%S].  Resolving target cache\n", princ_name);\r
-#endif\r
+        kherr_reportf(L"Unparsed [%S].  Resolving target cache\n", princ_name);\r
         /* TODO: actually look up the preferred ccache name */\r
         if (code = pkrb5_cc_resolve(kcontext, princ_name, &ccache)) {\r
-#ifdef DEBUG\r
-            kherr_debug_printf(L"Cannot resolve cache [%S] with code=%d.  Trying default.\n", princ_name, code);\r
-#endif\r
+            kherr_reportf(L"Cannot resolve cache [%S] with code=%d.  Trying default.\n", princ_name, code);\r
 \r
             if (code = pkrb5_cc_default(kcontext, &ccache)) {\r
-#ifdef DEBUG\r
-                kherr_debug_printf(L"Failed to resolve default ccache. Code=%d", code);\r
-#endif\r
+                kherr_reportf(L"Failed to resolve default ccache. Code=%d", code);\r
                 goto cleanup;\r
             }\r
         }\r
 \r
-#ifdef DEBUG\r
-        kherr_debug_printf(L"Initializing ccache\n");\r
-#endif\r
+        kherr_reportf(L"Initializing ccache\n");\r
         if (code = pkrb5_cc_initialize(kcontext, ccache, princ))\r
             goto cleanup;\r
 \r
-#ifdef DEBUG\r
-        kherr_debug_printf(L"Copying credentials\n");\r
-#endif\r
+        kherr_reportf(L"Copying credentials\n");\r
         if (code = pkrb5_cc_copy_creds(kcontext, mslsa_ccache, ccache))\r
             goto cleanup;\r
 \r
@@ -1591,9 +1582,7 @@ khm_krb5_ms2mit(BOOL save_creds)
     }\r
 \r
 cleanup:\r
-#ifdef DEBUG\r
-    kherr_debug_printf(L"  Received code=%d", code);\r
-#endif\r
+    kherr_reportf(L"  Received code=%d", code);\r
 \r
     if (princ_name)\r
         pkrb5_free_unparsed_name(kcontext, princ_name);\r
index 858243daf7495d6415af9c9d932d0efdb9674da1..2ad904b43a58f7b86e946274263dd19f692ab68f 100644 (file)
@@ -516,8 +516,39 @@ ui_cb(khui_new_creds * nc,
                             0,\r
                             (LPARAM) t);\r
             }\r
+         _done_adding_lru:\r
+\r
+            {\r
+                khm_int32 inc_realms = 0;\r
+\r
+                if (KHM_FAILED(khc_read_int32(csp_params,\r
+                                              L"UseFullRealmList",\r
+                                              &inc_realms)) ||\r
+                    !inc_realms)\r
+                    goto _done_adding_all_realms;\r
+            }\r
+\r
+           if(ms)\r
+               PFREE(ms);\r
+\r
+           ms = khm_krb5_get_realm_list();\r
+           if(ms) {\r
+               for (t = ms; t && *t; t = multi_string_next(t)) {\r
+                   lr = SendMessage(d->hw_realm,\r
+                                     CB_FINDSTRINGEXACT,\r
+                                     (WPARAM) -1,\r
+                                     (LPARAM) t);\r
+                   if (lr != CB_ERR)\r
+                       continue;\r
+\r
+                   SendMessage(d->hw_realm,\r
+                                CB_ADDSTRING,\r
+                                0,\r
+                                (LPARAM) t);\r
+               }\r
+           }\r
+        _done_adding_all_realms:\r
 \r
-        _done_adding_lru:\r
             /* set the current selection of the realms list */\r
             if (defrealm) {\r
                 SendMessage(d->hw_realm,\r
@@ -1080,12 +1111,8 @@ k5_ident_update(khm_int32 msg_type,
     return KHM_ERROR_SUCCESS;\r
 }\r
 \r
-\r
-static khm_int32\r
-k5_ident_init(khm_int32 msg_type,\r
-              khm_int32 msg_subtype,\r
-              khm_ui_4 uparam,\r
-              void * vparam) {\r
+static khm_boolean\r
+k5_refresh_default_identity(krb5_context ctx) {\r
     /* just like notify_create, except now we set the default identity\r
        based on what we find in the configuration */\r
     krb5_ccache cc = NULL;\r
@@ -1096,31 +1123,23 @@ k5_ident_init(khm_int32 msg_type,
     khm_handle ident = NULL;\r
     khm_boolean found_default = FALSE;\r
 \r
-    assert(k5_identpro_ctx != NULL);\r
+    assert(ctx != NULL);\r
 \r
-    code = pkrb5_cc_default(k5_identpro_ctx, &cc);\r
+    code = pkrb5_cc_default(ctx, &cc);\r
     if (code)\r
         goto _nc_cleanup;\r
-\r
-    code = pkrb5_cc_get_principal(k5_identpro_ctx,\r
-                                  cc,\r
-                                  &princ);\r
+    \r
+    code = pkrb5_cc_get_principal(ctx, cc, &princ);\r
     if (code)\r
         goto _nc_cleanup;\r
 \r
-    code = pkrb5_unparse_name(k5_identpro_ctx,\r
-                              princ,\r
-                              &princ_nameA);\r
+    code = pkrb5_unparse_name(ctx, princ, &princ_nameA);\r
     if (code)\r
         goto _nc_cleanup;\r
 \r
-    AnsiStrToUnicode(princ_nameW,\r
-                     sizeof(princ_nameW),\r
-                     princ_nameA);\r
+    AnsiStrToUnicode(princ_nameW, sizeof(princ_nameW), princ_nameA);\r
 \r
-    if (KHM_FAILED(kcdb_identity_create(princ_nameW,\r
-                                        0,\r
-                                        &ident)))\r
+    if (KHM_FAILED(kcdb_identity_create(princ_nameW, 0, &ident)))\r
         goto _nc_cleanup;\r
 \r
     kcdb_identity_set_default_int(ident);\r
@@ -1129,17 +1148,31 @@ k5_ident_init(khm_int32 msg_type,
 \r
  _nc_cleanup:\r
     if (princ_nameA)\r
-        pkrb5_free_unparsed_name(k5_identpro_ctx,\r
-                                 princ_nameA);\r
+        pkrb5_free_unparsed_name(ctx, princ_nameA);\r
+\r
     if (princ)\r
-        pkrb5_free_principal(k5_identpro_ctx,\r
-                             princ);\r
+        pkrb5_free_principal(ctx, princ);\r
+\r
     if (cc)\r
-        pkrb5_cc_close(k5_identpro_ctx, cc);\r
+        pkrb5_cc_close(ctx, cc);\r
 \r
     if (ident)\r
         kcdb_identity_release(ident);\r
 \r
+    return found_default;\r
+}\r
+\r
+static khm_int32\r
+k5_ident_init(khm_int32 msg_type,\r
+              khm_int32 msg_subtype,\r
+              khm_ui_4 uparam,\r
+              void * vparam) {\r
+\r
+    khm_boolean found_default;\r
+    khm_handle ident;\r
+\r
+    found_default = k5_refresh_default_identity(k5_identpro_ctx);\r
+\r
     if (!found_default) {\r
         wchar_t widname[KCDB_IDENT_MAXCCH_NAME];\r
         khm_size cb;\r
@@ -1284,6 +1317,143 @@ k5_ident_name_comp_func(const void * dl, khm_size cb_dl,
         return r;\r
 }\r
 \r
+\r
+/* Identity change notification thread */\r
+\r
+HANDLE h_ccname_exit_event;\r
+HANDLE h_ccname_thread;\r
+\r
+DWORD WINAPI k5_ccname_monitor_thread(LPVOID lpParameter) {\r
+    krb5_context ctx = 0;\r
+\r
+    HKEY hk_ccname;\r
+    HANDLE h_notify;\r
+    HANDLE h_waits[2];\r
+\r
+    khm_int32 rv = KHM_ERROR_SUCCESS;\r
+    DWORD dwType;\r
+    DWORD dwSize;\r
+    DWORD dwDisp;\r
+    wchar_t reg_ccname[KRB5_MAXCCH_CCNAME];\r
+    LONG l;\r
+\r
+    l = RegOpenKeyEx(HKEY_CURRENT_USER,\r
+                     L"Software\\MIT\\kerberos5",\r
+                     0,\r
+                     KEY_READ | KEY_WRITE,\r
+                     &hk_ccname);\r
+\r
+    if (l != ERROR_SUCCESS)\r
+        l = RegCreateKeyEx(HKEY_CURRENT_USER,\r
+                           L"Software\\MIT\\kerberos5",\r
+                           0,\r
+                           NULL,\r
+                           REG_OPTION_NON_VOLATILE,\r
+                           KEY_READ | KEY_WRITE,\r
+                           NULL,\r
+                           &hk_ccname,\r
+                           &dwDisp);\r
+\r
+    if (l != ERROR_SUCCESS) {\r
+        rv = KHM_ERROR_UNKNOWN;\r
+        goto _exit;\r
+    }\r
+\r
+    dwSize = sizeof(reg_ccname);\r
+    \r
+    l = RegQueryValueEx(hk_ccname,\r
+                        L"ccname",\r
+                        NULL,\r
+                        &dwType,\r
+                        (LPBYTE) reg_ccname,\r
+                        &dwSize);\r
+\r
+    if (l != ERROR_SUCCESS ||\r
+        dwType != REG_SZ) {\r
+\r
+        reg_ccname[0] = L'\0';\r
+    }\r
+\r
+    l = pkrb5_init_context(&ctx);\r
+\r
+    if (l)\r
+        goto _exit_0;\r
+\r
+    h_notify = CreateEvent(NULL, FALSE, FALSE, L"Local\\Krb5CCNameChangeNotifier");\r
+\r
+    if (h_notify == NULL)\r
+        goto _exit_0;\r
+\r
+    /* begin wait loop */\r
+\r
+    h_waits[0] = h_ccname_exit_event;\r
+    h_waits[1] = h_notify;\r
+\r
+    do {\r
+        DWORD dwrv;\r
+\r
+        l = RegNotifyChangeKeyValue(hk_ccname, FALSE,\r
+                                    REG_NOTIFY_CHANGE_LAST_SET,\r
+                                    h_notify, TRUE);\r
+\r
+        if (l != ERROR_SUCCESS) {\r
+            rv = KHM_ERROR_UNKNOWN;\r
+            break;\r
+        }\r
+\r
+        dwrv = WaitForMultipleObjects(2, h_waits, FALSE, INFINITE);\r
+\r
+        if (dwrv == WAIT_OBJECT_0) {\r
+            /* exit! */\r
+            break;\r
+\r
+        } else if (dwrv == WAIT_OBJECT_0 + 1) {\r
+            /* change notify! */\r
+            wchar_t new_ccname[KRB5_MAXCCH_CCNAME];\r
+\r
+            dwSize = sizeof(new_ccname);\r
+    \r
+            l = RegQueryValueEx(hk_ccname,\r
+                                L"ccname",\r
+                                NULL,\r
+                                &dwType,\r
+                                (LPBYTE) new_ccname,\r
+                                &dwSize);\r
+\r
+            if (l != ERROR_SUCCESS ||\r
+                dwType != REG_SZ) {\r
+                new_ccname[0] = L'\0';\r
+            }\r
+\r
+            if (wcsicmp(new_ccname, reg_ccname)) {\r
+                k5_refresh_default_identity(ctx);\r
+                StringCbCopy(reg_ccname, sizeof(reg_ccname), new_ccname);\r
+            }\r
+\r
+        } else {\r
+            /* something went wrong */\r
+            rv = KHM_ERROR_UNKNOWN;\r
+            break;\r
+        }\r
+\r
+    } while (TRUE);\r
+\r
+    CloseHandle(h_notify);\r
+\r
+ _exit_0:\r
+\r
+    RegCloseKey(hk_ccname);\r
+\r
+    if (ctx)\r
+        pkrb5_free_context(ctx);\r
+\r
+ _exit:\r
+    ExitThread(rv);\r
+\r
+    /* not reached */\r
+    return rv;\r
+}\r
+\r
 khm_int32\r
 k5_msg_system_idpro(khm_int32 msg_type, khm_int32 msg_subtype,\r
                     khm_ui_4 uparam, void * vparam) {\r
@@ -1329,11 +1499,34 @@ k5_msg_system_idpro(khm_int32 msg_type, khm_int32 msg_subtype,
 \r
                 kcdb_attrib_release_info(attr);\r
             }\r
+\r
+            h_ccname_exit_event = CreateEvent(NULL, FALSE, FALSE, NULL);\r
+            if (h_ccname_exit_event) {\r
+                h_ccname_thread = CreateThread(NULL,\r
+                                               200 * 1024,\r
+                                               k5_ccname_monitor_thread,\r
+                                               NULL,\r
+                                               0,\r
+                                               NULL);\r
+            } else {\r
+                h_ccname_thread = NULL;\r
+            }\r
         }\r
         break;\r
 \r
     case KMSG_SYSTEM_EXIT:\r
         {\r
+\r
+            if (h_ccname_thread) {\r
+                SetEvent(h_ccname_exit_event);\r
+                WaitForSingleObject(h_ccname_thread, INFINITE);\r
+                CloseHandle(h_ccname_thread);\r
+                CloseHandle(h_ccname_exit_event);\r
+\r
+                h_ccname_exit_event = NULL;\r
+                h_ccname_thread = NULL;\r
+            }\r
+\r
             if (k5_identpro_ctx) {\r
                 pkrb5_free_context(k5_identpro_ctx);\r
                 k5_identpro_ctx = NULL;\r
index a08fb91d948aabbb056be7cbe62bfd6b754df7d5..e6bf6479de4ab98e7f69fc4b1ea81cf82e9ea1dc 100644 (file)
@@ -459,6 +459,7 @@ k5_kinit_fiber_proc(PVOID lpParameter)
                     goto _switch_to_main;\r
 \r
                 if (!k5_cp_check_continue()) {\r
+                    g_fjob.code = KRB5KRB_AP_ERR_BAD_INTEGRITY;\r
                     goto _switch_to_main;\r
                 }\r
             }\r
@@ -1278,7 +1279,7 @@ k5_msg_cred_dialog(khm_int32 msg_type,
             nct->type = credtype_id_krb5;\r
             nct->ordinal = 1;\r
 \r
-            LoadString(hResModule, IDS_KRB5_SHORT_DESC\r
+            LoadString(hResModule, IDS_KRB5_NC_NAME\r
                        wbuf, ARRAYLENGTH(wbuf));\r
             StringCbLength(wbuf, sizeof(wbuf), &cbsize);\r
             cbsize += sizeof(wchar_t);\r
@@ -1343,12 +1344,10 @@ k5_msg_cred_dialog(khm_int32 msg_type,
 \r
                 realms = khm_krb5_get_realm_list();\r
                 if(realms) {\r
-                    t = realms;\r
-                    while(t && *t) {\r
+                    for (t = realms; t && *t; t = multi_string_next(t)) {\r
                         SendDlgItemMessage(hwnd, IDC_NCK5_REALM, \r
                                            CB_ADDSTRING,\r
                                            0, (LPARAM) t);\r
-                        t = multi_string_next(t);\r
                     }\r
                     PFREE(realms);\r
                 }\r
@@ -1698,7 +1697,6 @@ k5_msg_cred_dialog(khm_int32 msg_type,
                                     NULL))))\r
                     g_fjob.code = 0;\r
 \r
-\r
                 if(g_fjob.code != 0) {\r
                     wchar_t tbuf[1024];\r
                     DWORD suggestion;\r
@@ -1771,6 +1769,10 @@ k5_msg_cred_dialog(khm_int32 msg_type,
 \r
                     khm_krb5_list_tickets(&ctx);\r
 \r
+                    if (nc->set_default) {\r
+                        kcdb_identity_set_default(nc->identities[0]);\r
+                    }\r
+\r
                     /* If there is no default identity, then make this the default */\r
                     kcdb_identity_refresh(nc->identities[0]);\r
                     {\r
@@ -1841,7 +1843,7 @@ k5_msg_cred_dialog(khm_int32 msg_type,
                                                 wbuf);\r
 \r
                     atsign = wcschr(idname, L'@');\r
-                    if (atsign != NULL)\r
+                    if (atsign == NULL)\r
                         goto _done_with_LRU;\r
 \r
                     atsign++;\r
@@ -1911,6 +1913,7 @@ k5_msg_cred_dialog(khm_int32 msg_type,
 \r
                     if (wbuf)\r
                         PFREE(wbuf);\r
+\r
                 } else if (g_fjob.state == FIBER_STATE_NONE) {\r
                     /* the user cancelled the operation */\r
                     r = KHUI_NC_RESPONSE_EXIT | \r
@@ -1942,11 +1945,11 @@ k5_msg_cred_dialog(khm_int32 msg_type,
                 _end_task();\r
             } else if (nc->subtype == KMSG_CRED_RENEW_CREDS) {\r
 \r
-                __int64 ftidexp = 0;\r
-                __int64 ftcurrent;\r
+                FILETIME ftidexp = {0,0};\r
+                FILETIME ftcurrent;\r
                 khm_size cb;\r
 \r
-                GetSystemTimeAsFileTime((LPFILETIME) &ftcurrent);\r
+                GetSystemTimeAsFileTime(&ftcurrent);\r
 \r
                 _begin_task(0);\r
                 _report_mr0(KHERR_NONE, MSG_CTX_RENEW_CREDS);\r
@@ -1983,7 +1986,7 @@ k5_msg_cred_dialog(khm_int32 msg_type,
                         khui_cw_set_response(nc, credtype_id_krb5, \r
                                              KHUI_NC_RESPONSE_EXIT | \r
                                              KHUI_NC_RESPONSE_FAILED);\r
-                    } else if (ftcurrent < ftidexp) {\r
+                    } else if (CompareFileTime(&ftcurrent, &ftidexp) < 0) {\r
                         wchar_t tbuf[1024];\r
                         DWORD suggestion;\r
                         kherr_suggestion sug_id;\r
index 0059f0ab1aa09ba502dff14e5b0a2ccd9e5eca19..9b849c88ff00f08167427b680a624142c8135f4e 100644 (file)
@@ -20,6 +20,7 @@ Krb5Cred,KC_SPACE,0,Kerberos V Credentials Provider
     DefaultRenewLifetime,KC_INT32,604800,Default renewable lifetime\r
     MaxRenewLifetime,KC_INT32,2592000,Maximum renewable lifetime\r
     MinRenewLifetime,KC_INT32,60,Maximum renewable lifetime\r
+    UseFullRealmList,KC_INT32,0,Use the full list of realms in the New Creds dialog\r
     LRURealms,KC_STRING,,\r
     LRUPrincipals,KC_STRING,,\r
     LastDefaultIdent,KC_STRING,,Last known default identity\r
index d95c58d860e4aaccc115e3ed86858362d5a891f0..d54fc101e0d29fe4e8b79aaf0828b9412d7c6f2f 100644 (file)
@@ -62,7 +62,7 @@ BEGIN
     COMBOBOX        IDC_NCK5_REALM,60,25,233,17,CBS_DROPDOWN | \r
                     CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Specify &additional realms ...",IDC_NCK5_ADD_REALMS,181,\r
-                    43,112,16,BS_NOTIFY | WS_DISABLED\r
+                    43,112,16,BS_NOTIFY | NOT WS_VISIBLE | WS_DISABLED\r
     LTEXT           "&Lifetime",IDC_STATIC,7,67,61,12\r
     EDITTEXT        IDC_NCK5_LIFETIME_EDIT,85,67,107,12,ES_AUTOHSCROLL\r
     CONTROL         "&Renewable for",IDC_NCK5_RENEWABLE,"Button",\r
@@ -131,13 +131,16 @@ BEGIN
                     WS_VSCROLL | WS_TABSTOP\r
     PUSHBUTTON      "Configure Realms ...",IDC_CFG_CFGREALMS,76,25,84,14,\r
                     WS_DISABLED\r
-    GROUPBOX        "Keberos Configuration File",IDC_CFG_CFGFILEGRP,7,57,241,\r
-                    48\r
-    LTEXT           "Location",IDC_CFG_LBL_CFGFILE,13,71,28,8\r
-    EDITTEXT        IDC_CFG_CFGFILE,76,68,119,14,ES_AUTOHSCROLL\r
-    PUSHBUTTON      "Browse...",IDC_CFG_BROWSE,198,68,44,14\r
+    GROUPBOX        "Keberos Configuration File",IDC_CFG_CFGFILEGRP,7,45,241,\r
+                    61\r
+    LTEXT           "Location",IDC_CFG_LBL_CFGFILE,13,61,28,8\r
+    EDITTEXT        IDC_CFG_CFGFILE,76,58,119,14,ES_AUTOHSCROLL\r
+    PUSHBUTTON      "Browse...",IDC_CFG_BROWSE,198,58,44,14\r
     CONTROL         "Create file if missing",IDC_CFG_CREATECONFIG,"Button",\r
-                    BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,76,89,80,10\r
+                    BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,76,76,80,10\r
+    CONTROL         "Include realms in New Credentials realm list",\r
+                    IDC_CFG_INCREALMS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,\r
+                    76,91,153,10\r
     GROUPBOX        "Windows® Options",IDC_CFG_WINGRP,7,110,241,65\r
     LTEXT           "Hostname",IDC_CFG_LBL_HOSTNAME,13,123,33,8\r
     EDITTEXT        IDC_CFG_HOSTNAME,76,120,166,14,ES_AUTOHSCROLL | \r
@@ -385,7 +388,7 @@ BEGIN
     IDS_ETYPE_UNKNOWN       "(Unknown)"\r
     IDS_ETYPE_LOCAL_DES3_HMAC_SHA1 "LOCAL-DES3-HMAC-SHA1"\r
     IDS_ETYPE_LOCAL_RC4_MD4 "LOCAL-RC4-MD4"\r
-    IDS_KRB5_SHORT_DESC     "Kerberos 5"\r
+    IDS_KRB5_SHORT_DESC     "Kerberos 5 tickets"\r
     IDS_KRB5_LONG_DESC      "Kerberos 5 tickets"\r
 END\r
 \r
@@ -480,6 +483,7 @@ BEGIN
     IDS_NO                  "No"\r
     IDS_CFG_RE_NEWSERVER    "<New server...>"\r
     IDS_CFG_RE_NEWDMAP      "<New domain mapping...>"\r
+    IDS_KRB5_NC_NAME        "Kerberos 5"\r
 END\r
 \r
 #endif    // English (U.S.) resources\r
index 22f973f9391478f90ebfce7d90ad087e44d1bb22..2b637ac9fb4d618f60a5720059a9dfc472c58dd5 100644 (file)
@@ -145,6 +145,13 @@ Language=English
 Please select an identity to change the password.\r
 .\r
 \r
+MessageId=\r
+SymbolicName=MSG_ERR_S_INTEGRITY\r
+Language=English\r
+This is commonly caused by an incorrect password.  Please verify that the password is correct and note that passwords are case sensitive.\r
+.\r
+\r
+\r
 MessageId=\r
 SymbolicName=MSG_\r
 Language=English\r
index 52adc34e3f6e72cbf0b014cd79b52120262a20d1..6f76cc56bb28069289a898b02ff77a6b31f25ba0 100644 (file)
 #define IDS_NO                          196\r
 #define IDS_CFG_RE_NEWSERVER            197\r
 #define IDS_CFG_RE_NEWDMAP              198\r
+#define IDS_KRB5_NC_NAME                199\r
 #define IDC_NCK5_RENEWABLE              1002\r
 #define IDC_NCK5_FORWARDABLE            1004\r
 #define IDC_NCK5_REALM                  1005\r
 #define IDC_CFG_INCAPI                  1066\r
 #define IDC_CFG_INCMSLSA                1067\r
 #define IDC_PPK5_FLAGS                  1072\r
+#define IDC_CHECK1                      1073\r
+#define IDC_CFG_INCREALMS               1073\r
 \r
 // Next default values for new objects\r
 // \r
 #ifndef APSTUDIO_READONLY_SYMBOLS\r
 #define _APS_NEXT_RESOURCE_VALUE        117\r
 #define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1073\r
+#define _APS_NEXT_CONTROL_VALUE         1074\r
 #define _APS_NEXT_SYMED_VALUE           101\r
 #endif\r
 #endif\r
index 585ec090a7552c6136a47ec4b960d7acf651a45a..9baa9b9e2929b9993e17513b6097851697713373 100644 (file)
@@ -73,7 +73,7 @@ void khm_exit_gui(void);
 void khm_parse_commandline();\r
 void khm_register_window_classes(void);\r
 \r
-HWND khm_html_help(HWND hwnd, UINT command, DWORD_PTR data);\r
+HWND khm_html_help(HWND hwnd, wchar_t * suffix, UINT command, DWORD_PTR data);\r
 \r
 #define MAX_RES_STRING 1024\r
 \r
index d38b338d2308ff69cea3ac322b0e4cf5f77ff494..0ec3dcbbba279b94ef995b94eba9a6ababf06aae 100644 (file)
@@ -299,6 +299,12 @@ typedef struct tag_ident_data {
     HWND hwnd;\r
 } ident_data;\r
 \r
+typedef struct tag_global_props {\r
+    BOOL monitor;\r
+    BOOL auto_renew;\r
+    BOOL sticky;\r
+} global_props;\r
+\r
 typedef struct tag_idents_data {\r
     BOOL         valid;\r
 \r
@@ -306,6 +312,11 @@ typedef struct tag_idents_data {
     khm_size     n_idents;\r
     khm_size     nc_idents;\r
 \r
+    /* global options */\r
+    global_props saved;\r
+    global_props work;\r
+    BOOL         applied;\r
+\r
     int          refcount;\r
 \r
     HIMAGELIST   hi_status;\r
@@ -319,7 +330,12 @@ typedef struct tag_idents_data {
     khui_config_init_data cfg;\r
 } idents_data;\r
 \r
-static idents_data cfg_idents = {FALSE, NULL, 0, 0, 0, NULL };\r
+static idents_data cfg_idents = {FALSE, NULL, 0, 0,\r
+                                 {0, 0, 0},\r
+                                 {0, 0, 0},\r
+                                 FALSE,\r
+\r
+                                 0, NULL };\r
 \r
 static void\r
 read_params_ident(ident_data * d) {\r
@@ -406,16 +422,24 @@ write_params_ident(ident_data * d) {
         return;\r
     }\r
 \r
-    if (d->saved.monitor != d->work.monitor)\r
-        khc_write_int32(csp_ident, L"Monitor", !!d->work.monitor);\r
+    if (d->removed) {\r
 \r
-    if (d->saved.auto_renew != d->work.auto_renew)\r
-        khc_write_int32(csp_ident, L"AllowAutoRenew", !!d->work.auto_renew);\r
+        khc_remove_space(csp_ident);\r
 \r
-    if (d->saved.sticky != d->work.sticky) {\r
-        kcdb_identity_set_flags(d->ident,\r
-                                (d->work.sticky)?KCDB_IDENT_FLAG_STICKY:0,\r
-                                KCDB_IDENT_FLAG_STICKY);\r
+    } else {\r
+\r
+        if (d->saved.monitor != d->work.monitor)\r
+            khc_write_int32(csp_ident, L"Monitor", !!d->work.monitor);\r
+\r
+        if (d->saved.auto_renew != d->work.auto_renew)\r
+            khc_write_int32(csp_ident, L"AllowAutoRenew",\r
+                            !!d->work.auto_renew);\r
+\r
+        if (d->saved.sticky != d->work.sticky) {\r
+            kcdb_identity_set_flags(d->ident,\r
+                                    (d->work.sticky)?KCDB_IDENT_FLAG_STICKY:0,\r
+                                    KCDB_IDENT_FLAG_STICKY);\r
+        }\r
     }\r
 \r
     khc_close_space(csp_ident);\r
@@ -432,6 +456,30 @@ write_params_ident(ident_data * d) {
 static void\r
 write_params_idents(void) {\r
     int i;\r
+    khm_handle csp_cw;\r
+\r
+    if (KHM_SUCCEEDED(khc_open_space(NULL, L"CredWindow",\r
+                                     KHM_FLAG_CREATE, &csp_cw))) {\r
+        if (cfg_idents.work.monitor != cfg_idents.saved.monitor) {\r
+            khc_write_int32(csp_cw, L"DefaultMonitor",\r
+                            !!cfg_idents.work.monitor);\r
+            cfg_idents.work.monitor = cfg_idents.saved.monitor;\r
+            cfg_idents.applied = TRUE;\r
+        }\r
+        if (cfg_idents.work.auto_renew != cfg_idents.saved.auto_renew) {\r
+            khc_write_int32(csp_cw, L"DefaultAllowAutoRenew",\r
+                            !!cfg_idents.work.auto_renew);\r
+            cfg_idents.work.auto_renew = cfg_idents.saved.auto_renew;\r
+            cfg_idents.applied = TRUE;\r
+        }\r
+        if (cfg_idents.work.sticky != cfg_idents.saved.sticky) {\r
+            khc_write_int32(csp_cw, L"DefaultMonitor",\r
+                            !!cfg_idents.work.sticky);\r
+            cfg_idents.work.sticky = cfg_idents.saved.sticky;\r
+            cfg_idents.applied = TRUE;\r
+        }\r
+        khc_close_space(csp_cw);\r
+    }\r
 \r
     for (i=0; i < (int)cfg_idents.n_idents; i++) {\r
         write_params_ident(&cfg_idents.idents[i]);\r
@@ -450,6 +498,7 @@ init_idents_data(void) {
     khm_size cb;\r
     int n_tries = 0;\r
     int i;\r
+    khm_handle csp_cw;\r
 \r
     if (cfg_idents.valid)\r
         return;\r
@@ -460,6 +509,35 @@ init_idents_data(void) {
     assert(cfg_idents.nc_idents == 0);\r
 #endif\r
 \r
+    if (KHM_SUCCEEDED(khc_open_space(NULL, L"CredWindow", 0, &csp_cw))) {\r
+        khm_int32 t;\r
+\r
+        if (KHM_SUCCEEDED(khc_read_int32(csp_cw, L"DefaultMonitor", &t)))\r
+            cfg_idents.saved.monitor = !!t;\r
+        else\r
+            cfg_idents.saved.monitor = TRUE;\r
+\r
+        if (KHM_SUCCEEDED(khc_read_int32(csp_cw, L"DefaultAllowAutoRenew", &t)))\r
+            cfg_idents.saved.auto_renew = !!t;\r
+        else\r
+            cfg_idents.saved.auto_renew = TRUE;\r
+\r
+        if (KHM_SUCCEEDED(khc_read_int32(csp_cw, L"DefaultSticky", &t)))\r
+            cfg_idents.saved.sticky = !!t;\r
+        else\r
+            cfg_idents.saved.sticky = FALSE;\r
+\r
+    } else {\r
+\r
+        cfg_idents.saved.monitor = TRUE;\r
+        cfg_idents.saved.auto_renew = TRUE;\r
+        cfg_idents.saved.sticky = FALSE;\r
+\r
+    }\r
+\r
+    cfg_idents.work = cfg_idents.saved;\r
+    cfg_idents.applied = FALSE;\r
+\r
     do {\r
         rv = kcdb_identity_enum(KCDB_IDENT_FLAG_CONFIG,\r
                                 KCDB_IDENT_FLAG_CONFIG,\r
@@ -584,251 +662,35 @@ release_idents_data(void) {
         free_idents_data();\r
 }\r
 \r
-#define BS_TRUE 1\r
-#define BS_FALSE 2\r
-\r
-static void\r
-refresh_view_idents_sel(HWND hwnd) {\r
-    HWND hw;\r
-    int sel_count;\r
-    int i;\r
-    int idx;\r
-    ident_data * d;\r
-    LVITEM lvi;\r
-\r
-    int monitor = 0;\r
-    int auto_renew = 0;\r
-    int sticky = 0;\r
-\r
-    hw = GetDlgItem(hwnd, IDC_CFG_IDENTS);\r
-\r
-    sel_count = ListView_GetSelectedCount(hw);\r
-\r
-    idx = -1;\r
-    for (i=0; i < sel_count; i++) {\r
-        idx = ListView_GetNextItem(hw, idx, LVNI_SELECTED);\r
-#ifdef DEBUG\r
-        assert(idx != -1);\r
-#endif\r
-        ZeroMemory(&lvi, sizeof(lvi));\r
-\r
-        lvi.iItem = idx;\r
-        lvi.iSubItem = 0;\r
-        lvi.mask = LVIF_PARAM;\r
-\r
-        ListView_GetItem(hw, &lvi);\r
-\r
-        d = (ident_data *) lvi.lParam;\r
-#ifdef DEBUG\r
-        assert(d != NULL);\r
-#endif\r
-\r
-        if (d->work.monitor)\r
-            monitor |= BS_TRUE;\r
-        else\r
-            monitor |= BS_FALSE;\r
-\r
-        if (d->work.auto_renew)\r
-            auto_renew |= BS_TRUE;\r
-        else\r
-            auto_renew |= BS_FALSE;\r
-\r
-        if (d->work.sticky)\r
-            sticky |= BS_TRUE;\r
-        else\r
-            sticky |= BS_FALSE;\r
-    }\r
-\r
-    CheckDlgButton(hwnd, IDC_CFG_MONITOR,\r
-                   (monitor == BS_TRUE)? BST_CHECKED:\r
-                   ((monitor == BS_FALSE)? BST_UNCHECKED:\r
-                    BST_INDETERMINATE));\r
-\r
-    CheckDlgButton(hwnd, IDC_CFG_RENEW,\r
-                   (auto_renew == BS_TRUE)? BST_CHECKED:\r
-                   ((auto_renew == BS_FALSE)? BST_UNCHECKED:\r
-                    BST_INDETERMINATE));\r
-\r
-    CheckDlgButton(hwnd, IDC_CFG_STICKY,\r
-                   (sticky == BS_TRUE)? BST_CHECKED:\r
-                   ((sticky == BS_FALSE)? BST_UNCHECKED:\r
-                    BST_INDETERMINATE));\r
-\r
-    if (sel_count > 0) {\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_MONITOR), TRUE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_RENEW), TRUE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_STICKY), TRUE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_REMOVE), TRUE);\r
-    } else {\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_MONITOR), FALSE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_RENEW), FALSE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_STICKY), FALSE);\r
-        EnableWindow(GetDlgItem(hwnd, IDC_CFG_REMOVE), FALSE);\r
-    }\r
-}\r
-\r
-#undef BS_TRUE\r
-#undef BS_FALSE\r
 \r
 static void\r
 refresh_data_idents(HWND hwnd) {\r
-    HWND hw;\r
-    int sel_count;\r
-    int i;\r
-    int idx;\r
-    ident_data * d;\r
-    LVITEM lvi;\r
-\r
-    UINT monitor = IsDlgButtonChecked(hwnd, IDC_CFG_MONITOR);\r
-    UINT auto_renew = IsDlgButtonChecked(hwnd, IDC_CFG_RENEW);\r
-    UINT sticky = IsDlgButtonChecked(hwnd, IDC_CFG_STICKY);\r
-\r
-    hw = GetDlgItem(hwnd, IDC_CFG_IDENTS);\r
-\r
-    sel_count = ListView_GetSelectedCount(hw);\r
-\r
-    idx = -1;\r
-    for (i=0; i < sel_count; i++) {\r
-        idx = ListView_GetNextItem(hw, idx, LVNI_SELECTED);\r
-#ifdef DEBUG\r
-        assert(idx != -1);\r
-#endif\r
-        ZeroMemory(&lvi, sizeof(lvi));\r
-\r
-        lvi.iItem = idx;\r
-        lvi.iSubItem = 0;\r
-        lvi.mask = LVIF_PARAM;\r
-\r
-        ListView_GetItem(hw, &lvi);\r
-\r
-        d = (ident_data *) lvi.lParam;\r
-#ifdef DEBUG\r
-        assert(d != NULL);\r
-#endif\r
-\r
-        if (monitor == BST_CHECKED)\r
-            d->work.monitor = TRUE;\r
-        else if (monitor == BST_UNCHECKED)\r
-            d->work.monitor = FALSE;\r
-\r
-        if (auto_renew == BST_CHECKED)\r
-            d->work.auto_renew = TRUE;\r
-        else if (auto_renew == BST_UNCHECKED)\r
-            d->work.auto_renew = FALSE;\r
-\r
-        if (sticky == BST_CHECKED)\r
-            d->work.sticky = TRUE;\r
-        else if (sticky == BST_UNCHECKED)\r
-            d->work.sticky = FALSE;\r
-\r
-        if (d->hwnd)\r
-            PostMessage(d->hwnd, KHUI_WM_CFG_NOTIFY,\r
-                        MAKEWPARAM(0, WMCFG_UPDATE_STATE), 0);\r
-    }\r
+    cfg_idents.work.monitor =\r
+        (IsDlgButtonChecked(hwnd, IDC_CFG_MONITOR) == BST_CHECKED);\r
+    cfg_idents.work.auto_renew =\r
+        (IsDlgButtonChecked(hwnd, IDC_CFG_RENEW) == BST_CHECKED);\r
+    cfg_idents.work.sticky =\r
+        (IsDlgButtonChecked(hwnd, IDC_CFG_STICKY) == BST_CHECKED);\r
 }\r
 \r
 static void\r
 refresh_view_idents_state(HWND hwnd) {\r
-    HWND hw;\r
-    int i;\r
-    LVITEM lvi;\r
-    ident_data * d;\r
-\r
-    BOOL modified = FALSE;\r
-    BOOL applied = FALSE;\r
-\r
-    hw = GetDlgItem(hwnd, IDC_CFG_IDENTS);\r
-\r
-    for (i = -1;;) {\r
-\r
-        i = ListView_GetNextItem(hw, i, LVNI_ALL);\r
-        if (i == -1)\r
-            break;\r
-\r
-        ZeroMemory(&lvi, sizeof(lvi));\r
-        lvi.iItem = i;\r
-        lvi.iSubItem = 0;\r
-        lvi.mask = LVIF_PARAM;\r
-\r
-        ListView_GetItem(hw, &lvi);\r
-\r
-        d = (ident_data *) lvi.lParam;\r
-#ifdef DEBUG\r
-        assert(d != NULL);\r
-#endif\r
-\r
-        ZeroMemory(&lvi, sizeof(lvi));\r
-\r
-        lvi.mask = LVIF_STATE;\r
-        lvi.stateMask = LVIS_STATEIMAGEMASK;\r
-        lvi.iItem = i;\r
-        lvi.iSubItem = 0;\r
-\r
-        if (d->removed) {\r
-            lvi.state = INDEXTOSTATEIMAGEMASK(cfg_idents.idx_deleted);\r
-            modified = TRUE;\r
-        } else if (d->saved.monitor != d->work.monitor ||\r
-                   d->saved.auto_renew != d->work.auto_renew ||\r
-                   d->saved.sticky != d->work.sticky) {\r
-            lvi.state = INDEXTOSTATEIMAGEMASK(cfg_idents.idx_modified);\r
-            modified = TRUE;\r
-        } else if (d->applied) {\r
-            lvi.state = INDEXTOSTATEIMAGEMASK(cfg_idents.idx_applied);\r
-            applied = TRUE;\r
-        } else {\r
-            lvi.state = INDEXTOSTATEIMAGEMASK(cfg_idents.idx_default);\r
-        }\r
-\r
-        ListView_SetItem(hw, &lvi);\r
-    }\r
-\r
-    {\r
-        khm_int32 flags = 0;\r
-\r
-        if (modified)\r
-            flags |= KHUI_CNFLAG_MODIFIED;\r
-        if (applied)\r
-            flags |= KHUI_CNFLAG_APPLIED;\r
-\r
-        khui_cfg_set_flags_inst(&cfg_idents.cfg, flags,\r
-                                KHUI_CNFLAG_APPLIED | KHUI_CNFLAG_MODIFIED);\r
-    }\r
-}\r
-\r
-static void\r
-remove_idents(HWND hwnd) {\r
-    HWND hw;\r
-    int sel_count;\r
-    int i;\r
-    int idx;\r
-    ident_data * d;\r
-    LVITEM lvi;\r
-\r
-    hw = GetDlgItem(hwnd, IDC_CFG_IDENTS);\r
-\r
-    sel_count = ListView_GetSelectedCount(hw);\r
-\r
-    idx = -1;\r
-    for (i=0; i < sel_count; i++) {\r
-        idx = ListView_GetNextItem(hw, idx, LVNI_SELECTED);\r
-#ifdef DEBUG\r
-        assert(idx != -1);\r
-#endif\r
-        ZeroMemory(&lvi, sizeof(lvi));\r
-\r
-        lvi.iItem = idx;\r
-        lvi.iSubItem = 0;\r
-        lvi.mask = LVIF_PARAM;\r
+    BOOL modified;\r
+    BOOL applied;\r
+    khm_int32 flags = 0;\r
 \r
-        ListView_GetItem(hw, &lvi);\r
+    applied = cfg_idents.applied;\r
+    modified = (cfg_idents.work.monitor != cfg_idents.saved.monitor ||\r
+                cfg_idents.work.auto_renew != cfg_idents.saved.auto_renew ||\r
+                cfg_idents.work.sticky != cfg_idents.saved.sticky);\r
 \r
-        d = (ident_data *) lvi.lParam;\r
-#ifdef DEBUG\r
-        assert(d != NULL);\r
-#endif\r
+    if (modified)\r
+        flags |= KHUI_CNFLAG_MODIFIED;\r
+    if (applied)\r
+        flags |= KHUI_CNFLAG_APPLIED;\r
 \r
-        d->removed = TRUE;\r
-    }\r
+    khui_cfg_set_flags_inst(&cfg_idents.cfg, flags,\r
+                            KHUI_CNFLAG_APPLIED | KHUI_CNFLAG_MODIFIED);\r
 }\r
 \r
 INT_PTR CALLBACK\r
@@ -840,37 +702,14 @@ khm_cfg_ids_tab_proc(HWND hwnd,
     switch(umsg) {\r
     case WM_INITDIALOG:\r
         {\r
-            HWND hw;\r
             HICON hicon;\r
-            LVCOLUMN lvcol;\r
-            LVITEM lvi;\r
-            wchar_t coltext[256];\r
-            RECT r;\r
-            int i;\r
 \r
             hold_idents_data();\r
 \r
             cfg_idents.hwnd = hwnd;\r
             cfg_idents.cfg = *((khui_config_init_data *) lParam);\r
 \r
-            /* first add the column */\r
-            hw = GetDlgItem(hwnd, IDC_CFG_IDENTS);\r
-\r
-            ZeroMemory(&lvcol, sizeof(lvcol));\r
-            lvcol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_FMT;\r
-\r
-            lvcol.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;\r
-\r
-            GetWindowRect(hw, &r);\r
-            lvcol.cx = ((r.right - r.left) * 95) / 100;\r
-\r
-            LoadString(khm_hInstance, IDS_CFG_IDS_IDENTITY,\r
-                       coltext, ARRAYLENGTH(coltext));\r
-            lvcol.pszText = coltext;\r
-\r
-            ListView_InsertColumn(hw, 0, &lvcol);\r
-\r
-            /* and the status icons */\r
+            /* add the status icons */\r
             if (cfg_idents.hi_status)\r
                 goto _done_with_icons;\r
 \r
@@ -927,56 +766,29 @@ khm_cfg_ids_tab_proc(HWND hwnd,
 \r
             DestroyIcon(hicon);\r
 \r
-            ListView_SetImageList(hw, cfg_idents.hi_status, LVSIL_SMALL);\r
-            ListView_SetImageList(hw, cfg_idents.hi_status, LVSIL_STATE);\r
-\r
         _done_with_icons:\r
 \r
-            /* now add each identity */\r
-            for(i=0; i < (int)cfg_idents.n_idents; i++) {\r
-                ZeroMemory(&lvi, sizeof(lvi));\r
-\r
-                lvi.mask = LVIF_PARAM | LVIF_TEXT | LVIF_STATE | LVIF_IMAGE;\r
-                lvi.iImage = cfg_idents.idx_id;\r
-                lvi.lParam = (LPARAM) &cfg_idents.idents[i];\r
-                lvi.pszText = cfg_idents.idents[i].idname;\r
-                lvi.state = INDEXTOSTATEIMAGEMASK(cfg_idents.idx_default);\r
-                lvi.stateMask = LVIS_STATEIMAGEMASK;\r
-\r
-                cfg_idents.idents[i].lv_idx = ListView_InsertItem(hw, &lvi);\r
-            }\r
+            CheckDlgButton(hwnd, IDC_CFG_MONITOR,\r
+                           (cfg_idents.work.monitor)?BST_CHECKED:BST_UNCHECKED);\r
+            CheckDlgButton(hwnd, IDC_CFG_RENEW,\r
+                           (cfg_idents.work.auto_renew)?BST_CHECKED:BST_UNCHECKED);\r
+            CheckDlgButton(hwnd, IDC_CFG_STICKY,\r
+                           (cfg_idents.work.sticky)?BST_CHECKED:BST_UNCHECKED);\r
 \r
         }\r
         return FALSE;\r
 \r
-    case WM_NOTIFY:\r
-        {\r
-            LPNMHDR lpnm = (LPNMHDR) lParam;\r
-\r
-            if (lpnm->code == LVN_ITEMCHANGED) {\r
-                refresh_view_idents_sel(hwnd);\r
-            }\r
-        }\r
-        return TRUE;\r
-\r
     case WM_COMMAND:\r
 \r
         if (HIWORD(wParam) == BN_CLICKED) {\r
             UINT ctrl = LOWORD(wParam);\r
+\r
             switch(ctrl) {\r
             case IDC_CFG_MONITOR:\r
             case IDC_CFG_RENEW:\r
             case IDC_CFG_STICKY:\r
-                if (IsDlgButtonChecked(hwnd, ctrl) == BST_CHECKED)\r
-                    CheckDlgButton(hwnd, ctrl, BST_UNCHECKED);\r
-                else\r
-                    CheckDlgButton(hwnd, ctrl, BST_CHECKED);\r
                 refresh_data_idents(hwnd);\r
                 break;\r
-\r
-            case IDC_CFG_REMOVE:\r
-                remove_idents(hwnd);\r
-                break;\r
             }\r
 \r
             refresh_view_idents_state(hwnd);\r
@@ -994,7 +806,6 @@ khm_cfg_ids_tab_proc(HWND hwnd,
 \r
             case WMCFG_UPDATE_STATE:\r
                 refresh_view_idents_state(hwnd);\r
-                refresh_view_idents_sel(hwnd);\r
                 break;\r
             }\r
         }\r
@@ -1086,6 +897,26 @@ refresh_view_ident(HWND hwnd, khui_config_node node) {
                    (d->work.sticky? BST_CHECKED: BST_UNCHECKED));\r
 }\r
 \r
+static void\r
+mark_remove_ident(HWND hwnd, khui_config_init_data * idata) {\r
+    ident_data * d;\r
+\r
+    d = find_ident_by_node(idata->ctx_node);\r
+#ifdef DEBUG\r
+    assert(d);\r
+#endif\r
+\r
+    if (d->removed)\r
+        return;\r
+\r
+    d->removed = TRUE;\r
+\r
+    khui_cfg_set_flags_inst(idata, KHUI_CNFLAG_MODIFIED,\r
+                            KHUI_CNFLAG_MODIFIED);\r
+\r
+    EnableWindow(GetDlgItem(hwnd, IDC_CFG_REMOVE), FALSE);\r
+}\r
+\r
 static void\r
 refresh_data_ident(HWND hwnd, khui_config_init_data * idata) {\r
     ident_data * d;\r
@@ -1168,8 +999,16 @@ khm_cfg_id_tab_proc(HWND hwnd,
                     PostMessage(cfg_idents.hwnd, KHUI_WM_CFG_NOTIFY,\r
                                 MAKEWPARAM(1, WMCFG_UPDATE_STATE), 0);\r
                 break;\r
+\r
+            case IDC_CFG_REMOVE:\r
+                mark_remove_ident(hwnd, idata);\r
+                if (cfg_idents.hwnd)\r
+                    PostMessage(cfg_idents.hwnd, KHUI_WM_CFG_NOTIFY,\r
+                                MAKEWPARAM(1, WMCFG_UPDATE_STATE), 0);\r
+                break;\r
             }\r
         }\r
+\r
         khm_set_dialog_result(hwnd, 0);\r
         return TRUE;\r
 \r
index bca18012c71040a8a168a643cad7c5791ae8c3ba..220865113b3b9062ef3d18c4c46b20bae561643b 100644 (file)
@@ -168,6 +168,8 @@ write_params(notif_data * d) {
     khui_cfg_set_flags(d->node,\r
                        KHUI_CNFLAG_APPLIED,\r
                        KHUI_CNFLAG_APPLIED | KHUI_CNFLAG_MODIFIED);\r
+\r
+    khm_timer_refresh(hwnd_notifier);\r
 }\r
 \r
 static void\r
index 970599e853496d307b1a302732975e606ac24756..7441b54f885f7c366a25a822a41abfdd40a4b1b2 100644 (file)
@@ -535,6 +535,8 @@ cfgui_dlgproc(HWND hwnd,
 \r
         khui_cfg_clear_params();\r
 \r
+        khui_cfg_set_configui_handle(hwnd);\r
+\r
         d = PMALLOC(sizeof(*d));\r
         ZeroMemory(d, sizeof(*d));\r
 \r
@@ -565,8 +567,6 @@ cfgui_dlgproc(HWND hwnd,
         khm_add_dialog(hwnd);\r
         khm_enter_modal(hwnd);\r
 \r
-        khui_cfg_set_configui_handle(hwnd);\r
-\r
         return TRUE;\r
 \r
     case WM_DESTROY:\r
index b88f3d14e95c1880762c0640be691a6bfed099de..7e0756fb45cdc5eafb74b09ff9fbca116d58b1fe 100644 (file)
@@ -32,6 +32,7 @@ static CRITICAL_SECTION cs_dialog;
 static HANDLE in_dialog_evt = NULL;\r
 static LONG init_dialog = 0;\r
 static khm_int32 dialog_result = 0;\r
+static wchar_t dialog_identity[KCDB_IDENT_MAXCCH_NAME];\r
 \r
 static void\r
 dialog_sync_init(void) {\r
@@ -76,7 +77,7 @@ khm_cred_begin_dialog(void) {
 }\r
 \r
 void \r
-khm_cred_end_dialog(khm_int32 result) {\r
+khm_cred_end_dialog(khui_new_creds * nc) {\r
     dialog_sync_init();\r
 \r
     EnterCriticalSection(&cs_dialog);\r
@@ -84,7 +85,20 @@ khm_cred_end_dialog(khm_int32 result) {
         in_dialog = FALSE;\r
         SetEvent(in_dialog_evt);\r
     }\r
-    dialog_result = result;\r
+    dialog_result = nc->result;\r
+    if (nc->subtype == KMSG_CRED_NEW_CREDS &&\r
+        nc->n_identities > 0 &&\r
+        nc->identities[0]) {\r
+        khm_size cb;\r
+\r
+        cb = sizeof(dialog_identity);\r
+        if (KHM_FAILED(kcdb_identity_get_name(nc->identities[0],\r
+                                              dialog_identity,\r
+                                              &cb)))\r
+            dialog_identity[0] = 0;\r
+    } else {\r
+        dialog_identity[0] = 0;\r
+    }\r
     LeaveCriticalSection(&cs_dialog);\r
 }\r
 \r
@@ -102,7 +116,8 @@ khm_cred_is_in_dialog(void) {
 }\r
 \r
 khm_int32\r
-khm_cred_wait_for_dialog(DWORD timeout, khm_int32 * result) {\r
+khm_cred_wait_for_dialog(DWORD timeout, khm_int32 * result,\r
+                         wchar_t * ident, khm_size cb_ident) {\r
     khm_int32 rv;\r
 \r
     dialog_sync_init();\r
@@ -122,8 +137,12 @@ khm_cred_wait_for_dialog(DWORD timeout, khm_int32 * result) {
 \r
             if (!in_dialog) {\r
                 rv = KHM_ERROR_SUCCESS;\r
-                if (result)\r
+                if (result) {\r
                     *result = dialog_result;\r
+                }\r
+                if (ident) {\r
+                    StringCbCopy(ident, cb_ident, dialog_identity);\r
+                }\r
                 break;\r
             } else if(dw == WAIT_TIMEOUT) {\r
                 rv = KHM_ERROR_TIMEOUT;\r
@@ -289,14 +308,14 @@ kmsg_cred_completion(kmq_message *m)
                     khui_context_reset();\r
                 */\r
 \r
-                khm_cred_end_dialog(nc->result);\r
+                khm_cred_end_dialog(nc);\r
             }\r
 \r
             khui_cw_destroy_cred_blob(nc);\r
 \r
             kmq_post_message(KMSG_CRED, KMSG_CRED_REFRESH, 0, 0);\r
 \r
-            khm_cred_process_commandline();\r
+            kmq_post_message(KMSG_ACT, KMSG_ACT_CONTINUE_CMDLINE, 0, 0);\r
         }\r
         break;\r
 \r
@@ -323,11 +342,11 @@ kmsg_cred_completion(kmq_message *m)
 \r
         kmq_post_message(KMSG_CRED, KMSG_CRED_REFRESH, 0, 0);\r
 \r
-        khm_cred_process_commandline();\r
+        kmq_post_message(KMSG_ACT, KMSG_ACT_CONTINUE_CMDLINE, 0, 0);\r
         break;\r
 \r
     case KMSG_CRED_IMPORT:\r
-        khm_cred_process_commandline();\r
+        kmq_post_message(KMSG_ACT, KMSG_ACT_CONTINUE_CMDLINE, 0, 0);\r
         break;\r
 \r
     case KMSG_CRED_REFRESH:\r
@@ -573,8 +592,9 @@ void khm_cred_obtain_new_creds(wchar_t * title)
         khui_alert_release(a);\r
 \r
         khui_context_release(&nc->ctx);\r
+        nc->result = KHUI_NC_RESULT_CANCEL;\r
+        khm_cred_end_dialog(nc);\r
         khui_cw_destroy_cred_blob(nc);\r
-        khm_cred_end_dialog(KHUI_NC_RESULT_CANCEL);\r
         return;\r
     }\r
 \r
@@ -617,8 +637,9 @@ void khm_cred_obtain_new_creds(wchar_t * title)
         _end_task();\r
     } else {\r
         khui_context_release(&nc->ctx);\r
+        nc->result = KHUI_NC_RESULT_CANCEL;\r
+        khm_cred_end_dialog(nc);\r
         khui_cw_destroy_cred_blob(nc);\r
-        khm_cred_end_dialog(KHUI_NC_RESULT_CANCEL);\r
     }\r
 }\r
 \r
@@ -784,7 +805,8 @@ khm_cred_process_commandline(void) {
 \r
     if (khm_startup.init ||\r
         khm_startup.renew ||\r
-        khm_startup.destroy) {\r
+        khm_startup.destroy ||\r
+        khm_startup.autoinit) {\r
         kcdb_identity_get_default(&defident);\r
     }\r
 \r
@@ -846,6 +868,15 @@ khm_cred_process_commandline(void) {
             kcdb_credset_get_size(NULL, &count);\r
 \r
             if (count == 0) {\r
+                if (defident)\r
+                    khui_context_set(KHUI_SCOPE_IDENT,\r
+                                     defident,\r
+                                     KCDB_CREDTYPE_INVALID,\r
+                                     NULL, NULL, 0,\r
+                                     NULL);\r
+                else\r
+                    khui_context_reset();\r
+\r
                 khm_cred_obtain_new_creds(NULL);\r
             }\r
             khm_startup.autoinit = FALSE;\r
@@ -869,9 +900,27 @@ khm_cred_process_commandline(void) {
 \r
 void\r
 khm_cred_begin_commandline(void) {\r
+    khm_handle csp_cw;\r
+\r
     if (khm_startup.seen)\r
         return;\r
 \r
+    if (KHM_SUCCEEDED(khc_open_space(NULL, L"CredWindow", 0, &csp_cw))) {\r
+        khm_int32 t = 0;\r
+\r
+        khc_read_int32(csp_cw, L"Autoinit", &t);\r
+        if (t)\r
+            khm_startup.autoinit = TRUE;\r
+\r
+        t = 0;\r
+        khc_read_int32(csp_cw, L"AutoImport", &t);\r
+        if (t)\r
+            khm_startup.import = TRUE;\r
+\r
+        khc_close_space(csp_cw);\r
+\r
+    }\r
+\r
     khm_startup.seen = TRUE;\r
     khm_startup.processing = TRUE;\r
 \r
@@ -893,9 +942,9 @@ khm_cred_addr_change(void) {
     khm_size cb;\r
     khm_size n_idents;\r
 \r
-    __int64 ft_now;\r
-    __int64 ft_exp;\r
-    __int64 ft_issue;\r
+    FILETIME ft_now;\r
+    FILETIME ft_exp;\r
+    FILETIME ft_issue;\r
 \r
     if (KHM_SUCCEEDED(khc_open_space(NULL, L"CredWindow",\r
                                      0, &csp_cw))) {\r
@@ -937,7 +986,7 @@ khm_cred_addr_change(void) {
     if (!ids)\r
         return;\r
 \r
-    GetSystemTimeAsFileTime((LPFILETIME) &ft_now);\r
+    GetSystemTimeAsFileTime(&ft_now);\r
 \r
     for (t=ids; t && *t; t = multi_string_next(t)) {\r
         khm_handle ident;\r
@@ -958,11 +1007,21 @@ khm_cred_addr_change(void) {
             (kcdb_identity_get_attr(ident, KCDB_ATTR_EXPIRE, NULL,\r
                                     &ft_exp, &cb)) &&\r
 \r
-            ft_now > (ft_issue + ft_exp)/2 &&\r
-            ft_now < ft_exp) {\r
+            CompareFileTime(&ft_now, &ft_exp) < 0) {\r
 \r
-            khm_cred_renew_identity(ident);\r
+            khm_int64 i_issue;\r
+            khm_int64 i_exp;\r
+            khm_int64 i_now;\r
 \r
+            i_issue = FtToInt(&ft_issue);\r
+            i_exp = FtToInt(&ft_exp);\r
+            i_now = FtToInt(&ft_now);\r
+\r
+            if (i_now > (i_issue + i_exp) / 2) {\r
+\r
+                khm_cred_renew_identity(ident);\r
+\r
+            }\r
         }\r
 \r
         kcdb_identity_release(ident);\r
index 6337830982128835fe600088b3b579c129b61bcb..b9be3d4875b0e0554097aa8032a85c50aa9501c1 100644 (file)
@@ -61,7 +61,8 @@ BOOL
 khm_cred_is_in_dialog(void);\r
 \r
 khm_int32\r
-khm_cred_wait_for_dialog(DWORD timeout, khm_int32 * result);\r
+khm_cred_wait_for_dialog(DWORD timeout, khm_int32 * result,\r
+                         wchar_t * ident, khm_size cb_ident);\r
 \r
 void\r
 khm_cred_begin_commandline(void);\r
@@ -75,4 +76,7 @@ khm_cred_refresh(void);
 void\r
 khm_cred_addr_change(void);\r
 \r
+void\r
+khm_cred_import(void);\r
+\r
 #endif\r
index be7610497a2e679bb9d1e679e7dfc97071838b33..5211d50b164ae688ce90b31ae92734f1f27420ee 100644 (file)
@@ -268,6 +268,7 @@ _skip_col:
         ADD_BITMAP(IDB_FLAG_WARN);\r
         ADD_BITMAP(IDB_FLAG_EXPIRED);\r
         ADD_BITMAP(IDB_FLAG_CRITICAL);\r
+        ADD_BITMAP(IDB_FLAG_RENEW);\r
         ADD_BITMAP(IDB_WDG_STUCK);\r
         ADD_BITMAP(IDB_WDG_STUCK_HI);\r
         ADD_BITMAP(IDB_WDG_STICK);\r
@@ -458,7 +459,7 @@ cw_get_cred_exp_flags(khui_credwnd_tbl * tbl, khm_handle cred)
     if(KHM_FAILED(kcdb_cred_get_attr(cred, KCDB_ATTR_TIMELEFT, NULL, &ft, &cbsize)))\r
         return 0;\r
 \r
-    s = FtIntervalToMilliseconds(&ft) / 1000;\r
+    s = FtIntervalToSeconds(&ft);\r
 \r
     flags = 0;\r
     if(s < 0)\r
@@ -622,6 +623,7 @@ cw_update_outline(khui_credwnd_tbl * tbl)
     khm_size cbbuf;\r
     khm_int32 flags;\r
     int selected;\r
+    khm_int32 expstate = 0;\r
 \r
     /*  this is called after calling cw_update_creds, so we assume\r
         that the credentials are all loaded and sorted according to\r
@@ -883,6 +885,7 @@ cw_update_outline(khui_credwnd_tbl * tbl)
         visible = visible && (ol->flags & KHUI_CW_O_EXPAND);\r
 \r
         flags = cw_get_cred_exp_flags(tbl, thiscred);\r
+        expstate |= flags;\r
 \r
         if(visible) {\r
             khm_int32 c_flags;\r
@@ -1040,6 +1043,16 @@ cw_update_outline(khui_credwnd_tbl * tbl)
 _exit:\r
     if(grouping)\r
         PFREE(grouping);\r
+\r
+    if (tbl->n_rows == 0)\r
+        khm_notify_icon_expstate(KHM_NOTIF_EMPTY);\r
+    else if (expstate & CW_EXPSTATE_EXPIRED)\r
+        khm_notify_icon_expstate(KHM_NOTIF_EXP);\r
+    else if ((expstate & CW_EXPSTATE_WARN) ||\r
+             (expstate & CW_EXPSTATE_CRITICAL))\r
+        khm_notify_icon_expstate(KHM_NOTIF_WARN);\r
+    else\r
+        khm_notify_icon_expstate(KHM_NOTIF_OK);\r
 }\r
 \r
 void \r
@@ -1125,10 +1138,12 @@ cw_hditem_from_tbl_col(khui_credwnd_col * col, HDITEM *phi)
     }\r
     phi->lParam = col->attr_id;\r
 #if (_WIN32_WINNT >= 0x501)\r
-    if(col->flags & KHUI_CW_COL_SORT_INC) {\r
-        phi->fmt |= HDF_SORTUP;\r
-    } else if(col->flags & KHUI_CW_COL_SORT_DEC) {\r
-        phi->fmt |= HDF_SORTDOWN;\r
+    if (IS_COMMCTL6()) {\r
+        if(col->flags & KHUI_CW_COL_SORT_INC) {\r
+            phi->fmt |= HDF_SORTUP;\r
+        } else if(col->flags & KHUI_CW_COL_SORT_DEC) {\r
+            phi->fmt |= HDF_SORTDOWN;\r
+        }\r
     }\r
 #endif\r
     if(col->width < 0) {\r
@@ -1365,7 +1380,7 @@ cw_draw_header(HDC hdc,
     int selected = 0;\r
     khm_int32 idf = 0;\r
 \r
-    /* each header consists of a 'expose' widget and some text */\r
+    /* each header consists of a couple of widgets and some text */\r
     /* we need to figure out the background color first */\r
     \r
     cr = &(tbl->rows[row]);\r
@@ -1455,7 +1470,7 @@ cw_draw_header(HDC hdc,
                            hdc, \r
                            r->left, r->bottom - KHUI_SMICON_CY, \r
                            0);\r
-        r->left += KHUI_SMICON_CX ;\r
+        r->left += KHUI_SMICON_CX * 3 / 2 ;\r
     }\r
 \r
     /* ok, now o->header contains the string representation of the\r
@@ -1576,7 +1591,7 @@ cw_wm_create(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
         WS_CHILD | HDS_BUTTONS |\r
         HDS_FULLDRAG | HDS_HORZ | HDS_HOTTRACK\r
 #if (_WIN32_WINNT >= 0x501)\r
-        | HDS_FLAT\r
+        | ((IS_COMMCTL6())?HDS_FLAT:0)\r
 #endif\r
         ,\r
         0,0,0,0,hwnd, (HMENU) 0, khm_hInstance, NULL);\r
@@ -1760,14 +1775,17 @@ cw_wm_paint(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 \r
                         if(j > tbl->rows[i].col) {\r
                             cbbuf = sizeof(buf);\r
-                            if(KHM_FAILED(kcdb_cred_get_attr_string((khm_handle) tbl->rows[i].data, tbl->cols[j].attr_id, buf, &cbbuf, KCDB_TS_SHORT)))\r
+                            if(KHM_FAILED(kcdb_cred_get_attr_string((khm_handle) tbl->rows[i].data,\r
+                                                                    tbl->cols[j].attr_id, buf,\r
+                                                                    &cbbuf, KCDB_TS_SHORT)))\r
                                 continue;\r
 \r
                             rh.left += tbl->hpad;\r
                             rh.right -= tbl->hpad;\r
 \r
                             SetTextAlign(hdc, 0);\r
-                            DrawText(hdc, buf, (int)((cbbuf / sizeof(wchar_t)) - 1), &rh, DT_LEFT | DT_VCENTER | DT_NOCLIP | DT_SINGLELINE | DT_END_ELLIPSIS);\r
+                            DrawText(hdc, buf, (int)((cbbuf / sizeof(wchar_t)) - 1), &rh,\r
+                                     DT_LEFT | DT_VCENTER | DT_NOCLIP | DT_SINGLELINE | DT_END_ELLIPSIS);\r
                             //TextOut(hdc, x, y + tbl->vpad, buf, (cbbuf / sizeof(wchar_t)) - 1);\r
                         }\r
                     }\r
@@ -1784,9 +1802,9 @@ cw_wm_paint(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                                 flag = o->flags;\r
                             else\r
                                 flag = 0;\r
-                        }\r
-                        else\r
+                        } else {\r
                             flag = tbl->rows[i].flags;\r
+                        }\r
 \r
                         flag &= CW_EXPSTATE_MASK;\r
 \r
@@ -1802,7 +1820,7 @@ cw_wm_paint(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                             if (KHM_SUCCEEDED(kcdb_cred_get_flags((khm_handle) tbl->rows[i].data, &flags)) &&\r
                                 (flags & KCDB_CRED_FLAG_RENEWABLE)) {\r
                                 khui_ilist_draw_id(tbl->ilist,\r
-                                                   IDB_TK_REFRESH_SM,\r
+                                                   IDB_FLAG_RENEW,\r
                                                    hdc,\r
                                                    x, y, 0);\r
                             }\r
@@ -2415,6 +2433,12 @@ cw_wm_mouse(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                        x >= KHUI_SMICON_CX * 3 / 2 &&\r
                        x < KHUI_SMICON_CX * 5 / 2){\r
                 nm_state |= CW_MOUSE_WSTICKY | CW_MOUSE_WIDGET;\r
+            } else if (tbl->cols[tbl->rows[row].col].attr_id ==\r
+                       KCDB_ATTR_ID_NAME &&\r
+                       col == tbl->rows[row].col &&\r
+                       x >= KHUI_SMICON_CX * 3 &&\r
+                       x < KHUI_SMICON_CX * 4) {\r
+                nm_state |= CW_MOUSE_WICON | CW_MOUSE_WIDGET;\r
             }\r
         }\r
     }\r
@@ -2422,7 +2446,7 @@ cw_wm_mouse(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     /* did the user drag the cursor off the current row? */\r
     if((tbl->mouse_state & CW_MOUSE_LDOWN) &&\r
        (nm_row != tbl->mouse_row)) {\r
-        nm_state &= ~(CW_MOUSE_WIDGET | CW_MOUSE_WOUTLINE | CW_MOUSE_WSTICKY);\r
+        nm_state &= ~CW_MOUSE_WMASK;\r
     }\r
     \r
     if(!(nm_state & CW_MOUSE_LDOWN) && \r
@@ -2458,6 +2482,11 @@ cw_wm_mouse(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
             tbl->mouse_state = CW_MOUSE_WIDGET | CW_MOUSE_WSTICKY;\r
 \r
             return 0;\r
+        } else if ((nm_state & CW_MOUSE_WICON) &&\r
+                   (tbl->mouse_state & CW_MOUSE_WICON)) {\r
+            /* click on an row icon */\r
+            cw_select_row(tbl, nm_row, wParam);\r
+            cw_properties(hwnd);\r
         } else {\r
             /* click on a row */\r
             cw_select_row(tbl, nm_row, wParam);\r
@@ -2644,61 +2673,17 @@ cw_wm_hscroll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     return DefWindowProc(hwnd, uMsg, wParam, lParam);\r
 }\r
 \r
-LRESULT \r
-cw_wm_vscroll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
-{\r
-    khui_credwnd_tbl * tbl;\r
-    SCROLLINFO si;\r
+static void\r
+cw_vscroll_to_pos(HWND hwnd, khui_credwnd_tbl * tbl, int newpos) {\r
     RECT cr;\r
     RECT sr;\r
     RECT lr;\r
     int dy;\r
-    int newpos;\r
 \r
-    tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
     GetClientRect(hwnd, &cr);\r
     cr.top += tbl->header_height;\r
     dy = tbl->scr_top;\r
 \r
-    switch(LOWORD(wParam)) {\r
-        case SB_LEFT:\r
-            newpos = 0;\r
-            break;\r
-\r
-        case SB_BOTTOM:\r
-            newpos = tbl->ext_height;\r
-            break;\r
-\r
-        case SB_LINEUP:\r
-            newpos = tbl->scr_top - (tbl->ext_height / 12);\r
-            break;\r
-\r
-        case SB_LINEDOWN:\r
-            newpos = tbl->scr_top + (tbl->ext_height / 12);\r
-            break;\r
-\r
-        case SB_PAGEUP:\r
-            newpos = tbl->scr_top - (cr.bottom - cr.top);\r
-            break;\r
-\r
-        case SB_PAGEDOWN:\r
-            newpos = tbl->scr_top + (cr.bottom - cr.top);\r
-            break;\r
-\r
-        case SB_THUMBTRACK:\r
-        case SB_THUMBPOSITION:\r
-            ZeroMemory(&si, sizeof(si));\r
-            si.cbSize = sizeof(si);\r
-            si.fMask = SIF_TRACKPOS;\r
-            GetScrollInfo(hwnd, SB_VERT, &si);\r
-\r
-            newpos = si.nTrackPos;\r
-            break;\r
-\r
-        default:\r
-            return DefWindowProc(hwnd, uMsg, wParam, lParam);\r
-    }\r
-\r
     tbl->scr_top = newpos;\r
     cw_update_extents(tbl, TRUE);\r
 \r
@@ -2745,10 +2730,89 @@ cw_wm_vscroll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     if(lr.top < lr.bottom && lr.left < lr.right) {\r
         InvalidateRect(hwnd, &lr, FALSE);\r
     }\r
+}\r
+\r
+LRESULT \r
+cw_wm_vscroll(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+    khui_credwnd_tbl * tbl;\r
+    SCROLLINFO si;\r
+    int newpos;\r
+    RECT cr;\r
+\r
+    tbl = (khui_credwnd_tbl *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+\r
+    GetClientRect(hwnd, &cr);\r
+    cr.top += tbl->header_height;\r
+\r
+    switch(LOWORD(wParam)) {\r
+        case SB_LEFT:\r
+            newpos = 0;\r
+            break;\r
+\r
+        case SB_BOTTOM:\r
+            newpos = tbl->ext_height;\r
+            break;\r
+\r
+        case SB_LINEUP:\r
+            newpos = tbl->scr_top - (tbl->ext_height / 12);\r
+            break;\r
+\r
+        case SB_LINEDOWN:\r
+            newpos = tbl->scr_top + (tbl->ext_height / 12);\r
+            break;\r
+\r
+        case SB_PAGEUP:\r
+            newpos = tbl->scr_top - (cr.bottom - cr.top);\r
+            break;\r
+\r
+        case SB_PAGEDOWN:\r
+            newpos = tbl->scr_top + (cr.bottom - cr.top);\r
+            break;\r
+\r
+        case SB_THUMBTRACK:\r
+        case SB_THUMBPOSITION:\r
+            ZeroMemory(&si, sizeof(si));\r
+            si.cbSize = sizeof(si);\r
+            si.fMask = SIF_TRACKPOS;\r
+            GetScrollInfo(hwnd, SB_VERT, &si);\r
+\r
+            newpos = si.nTrackPos;\r
+            break;\r
+\r
+        default:\r
+            return DefWindowProc(hwnd, uMsg, wParam, lParam);\r
+    }\r
+\r
+    cw_vscroll_to_pos(hwnd, tbl, newpos);\r
 \r
     return DefWindowProc(hwnd, uMsg, wParam, lParam);\r
 }\r
 \r
+static void\r
+cw_ensure_row_visible(HWND hwnd, khui_credwnd_tbl * tbl, int row) {\r
+    RECT r;\r
+    int newpos;\r
+\r
+    if (row < 0)\r
+        row = 0;\r
+    else if (row >= (int) tbl->n_rows)\r
+        row = (int) tbl->n_rows - 1;\r
+\r
+    GetClientRect(hwnd, &r);\r
+    r.top += tbl->header_height;\r
+\r
+    if (row * tbl->cell_height < tbl->scr_top) {\r
+        newpos = row * tbl->cell_height;\r
+    } else if ((row + 1) * tbl->cell_height\r
+             > tbl->scr_top + (r.bottom - r.top)) {\r
+        newpos = ((row + 1) * tbl->cell_height) - (r.bottom - r.top);\r
+    } else\r
+        return;\r
+\r
+    cw_vscroll_to_pos(hwnd, tbl, newpos);\r
+}\r
+\r
 static INT_PTR CALLBACK \r
 cw_pp_ident_proc(HWND hwnd,\r
                  UINT uMsg,\r
@@ -2819,7 +2883,10 @@ cw_pp_ident_proc(HWND hwnd,
 \r
         case MAKEWPARAM(IDC_PP_CONFIG, BN_CLICKED):\r
             {\r
+                khui_config_node cfg_id = NULL;\r
                 khui_config_node cfg_ids = NULL;\r
+                wchar_t idname[KCDB_IDENT_MAXCCH_NAME];\r
+                khm_size cb;\r
                 khm_int32 rv;\r
 \r
                 khm_refresh_config();\r
@@ -2831,10 +2898,24 @@ cw_pp_ident_proc(HWND hwnd,
                 if (KHM_FAILED(rv))\r
                     return TRUE;\r
 \r
-                khm_show_config_pane(cfg_ids);\r
+                cb = sizeof(idname);\r
+                if (KHM_SUCCEEDED(kcdb_identity_get_name(s->identity,\r
+                                                         idname,\r
+                                                         &cb))) {\r
+                    rv = khui_cfg_open(cfg_ids,\r
+                                       idname,\r
+                                       &cfg_id);\r
+                }\r
+\r
+                if (cfg_id)\r
+                    khm_show_config_pane(cfg_id);\r
+                else\r
+                    khm_show_config_pane(cfg_ids);\r
 \r
                 if (cfg_ids)\r
                     khui_cfg_release(cfg_ids);\r
+                if (cfg_id)\r
+                    khui_cfg_release(cfg_id);\r
             }\r
             return TRUE;\r
         }\r
@@ -3201,6 +3282,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
             InvalidateRect(tbl->hwnd, NULL, TRUE);\r
 \r
             khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT), KHUI_ACTION_LAYOUT_ID);\r
+            kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
         }\r
         break;\r
 \r
@@ -3219,6 +3301,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 \r
             khui_check_radio_action(khui_find_menu(KHUI_MENU_LAYOUT), \r
                               KHUI_ACTION_LAYOUT_LOC);\r
+            kmq_post_message(KMSG_ACT, KMSG_ACT_REFRESH, 0, 0);\r
         }\r
         break;\r
 \r
@@ -3236,7 +3319,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
             if(new_row < 0)\r
                 new_row = 0;\r
             if(new_row >= (int) tbl->n_rows)\r
-                new_row = (int) tbl->n_rows;\r
+                new_row = (int) tbl->n_rows - 1;\r
 \r
             if (LOWORD(wParam) == KHUI_PACTION_UP)\r
                 wp = 0;\r
@@ -3250,6 +3333,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 #endif\r
 \r
             cw_select_row(tbl, new_row, wp);\r
+            cw_ensure_row_visible(hwnd, tbl, new_row);\r
         }\r
         break;\r
 \r
@@ -3267,7 +3351,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
             if(new_row < 0)\r
                 new_row = 0;\r
             if(new_row >= (int) tbl->n_rows)\r
-                new_row = (int) tbl->n_rows;\r
+                new_row = (int) tbl->n_rows - 1;\r
 \r
             if (LOWORD(wParam) == KHUI_PACTION_DOWN)\r
                 wp = 0;\r
@@ -3280,6 +3364,7 @@ cw_wm_command(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
                 assert(FALSE);\r
 #endif\r
             cw_select_row(tbl, new_row, wp);\r
+            cw_ensure_row_visible(hwnd, tbl, new_row);\r
         }\r
         break;\r
 \r
index 5d1137f8460d6904925564298f5227f55d26cefd..33e00bacb057fe8810e37a3f66312577fbe913d8 100644 (file)
@@ -216,6 +216,11 @@ typedef struct khui_credwnd_tbl_t {
                                           outline widget */\r
 #define CW_MOUSE_WSTICKY    0x00000010 /* mouse is highlighting a\r
                                           sticky widget */\r
+#define CW_MOUSE_WICON      0x00000020 /* an icon widget.  represents\r
+                                          the icon next to identities\r
+                                          and next to credentials. */\r
+\r
+#define CW_MOUSE_WMASK      0x00000039 /* all widget bits */\r
 \r
 void khm_unregister_credwnd_class(void);\r
 \r
index b17c045c70ec2d53cf79dca4ff93c3119c988e9e..9fb30c53e792d60a03a03f64d3a94c33968e1bba 100644 (file)
Binary files a/src/windows/identity/ui/images/app_notify_error.ico and b/src/windows/identity/ui/images/app_notify_error.ico differ
diff --git a/src/windows/identity/ui/images/app_state_exp.ico b/src/windows/identity/ui/images/app_state_exp.ico
new file mode 100644 (file)
index 0000000..b365b6b
Binary files /dev/null and b/src/windows/identity/ui/images/app_state_exp.ico differ
diff --git a/src/windows/identity/ui/images/app_state_ok.ico b/src/windows/identity/ui/images/app_state_ok.ico
new file mode 100644 (file)
index 0000000..8363fb2
Binary files /dev/null and b/src/windows/identity/ui/images/app_state_ok.ico differ
diff --git a/src/windows/identity/ui/images/app_state_warn.ico b/src/windows/identity/ui/images/app_state_warn.ico
new file mode 100644 (file)
index 0000000..3510e5a
Binary files /dev/null and b/src/windows/identity/ui/images/app_state_warn.ico differ
index 0b4c920e61781e20f29e05e309c7078237d71b35..d643fb31799d8d6ceac0eae8315e7bef993a5745 100644 (file)
Binary files a/src/windows/identity/ui/images/flag-critical.bmp and b/src/windows/identity/ui/images/flag-critical.bmp differ
index f5be298a83810ae8585244cbaaa50d2507c48daf..edb3fc3c88595f8685a3188ff115b9131611ca2c 100644 (file)
Binary files a/src/windows/identity/ui/images/flag-warning.bmp and b/src/windows/identity/ui/images/flag-warning.bmp differ
index 2815fb448637366a99c8fdc38605d18802169178..a3a40feecff222d6782d44a2e13ab4b51114b589 100644 (file)
Binary files a/src/windows/identity/ui/images/flag_expired.bmp and b/src/windows/identity/ui/images/flag_expired.bmp differ
diff --git a/src/windows/identity/ui/images/flag_renewable.bmp b/src/windows/identity/ui/images/flag_renewable.bmp
new file mode 100644 (file)
index 0000000..3a9dc38
Binary files /dev/null and b/src/windows/identity/ui/images/flag_renewable.bmp differ
index eb2d4a9bb30083f51bbbaf48e3933ab3ecf41add..b139effdb400449375ef036346eae5859d706e89 100644 (file)
@@ -65,6 +65,9 @@ IDI_CFG_MODIFIED        ICON                    "..\\..\\images\\cfg_mod.ico"
 IDI_CFG_APPLIED         ICON                    "..\\..\\images\\cfg_applied.ico"\r
 IDI_CFG_DELETED         ICON                    "..\\..\\images\\cfg_deleted.ico"\r
 IDI_ID                  ICON                    "..\\..\\images\\id.ico"\r
+IDI_APPICON_WARN        ICON                    "..\\..\\images\\app_state_warn.ico"\r
+IDI_APPICON_EXP         ICON                    "..\\..\\images\\app_state_exp.ico"\r
+IDI_APPICON_OK          ICON                    "..\\..\\images\\app_state_ok.ico"\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
@@ -132,6 +135,7 @@ IDB_WDG_STUCK_HI        BITMAP                  "..\\..\\images\\wdg_stuck_hi.bm
 IDB_WDG_STICK           BITMAP                  "..\\..\\images\\wdg_stick.bmp"\r
 IDB_WDG_STICK_HI        BITMAP                  "..\\..\\images\\wdg_stick_hi.bmp"\r
 IDB_WDG_STUCK           BITMAP                  "..\\..\\images\\wdg_stuck.bmp"\r
+IDB_FLAG_RENEW          BITMAP                  "..\\..\\images\\flag_renewable.bmp"\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 //\r
@@ -264,21 +268,21 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
 FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
 BEGIN\r
     GROUPBOX        "Startup",IDC_CFG_STARTUP_GROUP,7,7,241,50\r
-    CONTROL         "&Prompt for new credentials if there aren't any at startup",\r
+    CONTROL         "&Obtain new credentials at startup (if none are present)",\r
                     IDC_CFG_AUTOINIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,\r
                     16,22,196,10\r
-    CONTROL         "&Start NetIDMgr when Windows starts",IDC_CFG_AUTOSTART,\r
+    CONTROL         "&Start NetIDMgr during Windows logon",IDC_CFG_AUTOSTART,\r
                     "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,16,\r
                     38,135,10\r
-    GROUPBOX        "Other",IDC_CFG_OTHER,7,63,241,70\r
-    CONTROL         "&Keep NetIDMgr running after closing window",\r
+    GROUPBOX        "Other",IDC_CFG_OTHER,7,63,241,54\r
+    CONTROL         "&Run NetIDMgr in system tray after window close",\r
                     IDC_CFG_KEEPRUNNING,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,16,78,158,10\r
-    CONTROL         "Detect network connectivity",IDC_CFG_NETDETECT,"Button",\r
+                    WS_TABSTOP,16,78,170,10\r
+    CONTROL         "Monitor network connectivity",IDC_CFG_NETDETECT,"Button",\r
                     BS_AUTOCHECKBOX | WS_TABSTOP,16,96,106,10\r
-    CONTROL         "A&utomatically import credentials from Windows",\r
-                    IDC_CFG_AUTOIMPORT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,\r
-                    16,113,165,10\r
+    CONTROL         "A&utomatically import Windows logon identity",\r
+                    IDC_CFG_AUTOIMPORT,"Button",BS_AUTOCHECKBOX | NOT \r
+                    WS_VISIBLE | WS_TABSTOP,16,147,165,10\r
 END\r
 \r
 IDD_CFG_IDENTITIES DIALOGEX 0, 0, 255, 182\r
@@ -296,17 +300,18 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT\r
 FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
 BEGIN\r
-    CONTROL         "&Monitor credentials expiration",IDC_NOTIF_MONITOR,\r
-                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,139,10\r
-    CONTROL         "&Renew automatically",IDC_NOTIF_RENEW,"Button",\r
-                    BS_AUTOCHECKBOX | WS_TABSTOP,22,32,82,10\r
-    EDITTEXT        IDC_NOTIF_RENEW_THR,122,30,126,14,ES_AUTOHSCROLL\r
-    CONTROL         "Warn",IDC_NOTIF_WARN1,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,22,57,33,10\r
-    EDITTEXT        IDC_NOTIF_WARN1_THR,122,55,126,14,ES_AUTOHSCROLL\r
-    CONTROL         "Warn again",IDC_NOTIF_WARN2,"Button",BS_AUTOCHECKBOX | \r
-                    WS_TABSTOP,22,82,67,10\r
-    EDITTEXT        IDC_NOTIF_WARN2_THR,122,80,126,14,ES_AUTOHSCROLL\r
+    CONTROL         "&Monitor credential expiration",IDC_NOTIF_MONITOR,\r
+                    "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,7,\r
+                    111,139,10\r
+    CONTROL         "&Renew automatically at",IDC_NOTIF_RENEW,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,9,100,10\r
+    EDITTEXT        IDC_NOTIF_RENEW_THR,122,7,126,14,ES_AUTOHSCROLL\r
+    CONTROL         "Initial warning at",IDC_NOTIF_WARN1,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,31,100,10\r
+    EDITTEXT        IDC_NOTIF_WARN1_THR,122,29,126,14,ES_AUTOHSCROLL\r
+    CONTROL         "Final warning at",IDC_NOTIF_WARN2,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,53,100,10\r
+    EDITTEXT        IDC_NOTIF_WARN2_THR,122,51,126,14,ES_AUTOHSCROLL\r
 END\r
 \r
 IDD_CFG_PLUGINS DIALOGEX 0, 0, 255, 182\r
@@ -351,31 +356,29 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT\r
 FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
 BEGIN\r
-    CONTROL         "",IDC_CFG_IDENTS,"SysListView32",LVS_REPORT | \r
-                    LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER | \r
-                    WS_TABSTOP,7,7,221,72\r
-    GROUPBOX        "Selected identity",IDC_CFG_IDENTITY,7,81,221,63\r
     CONTROL         "Monitor credential expiration",IDC_CFG_MONITOR,"Button",\r
-                    BS_3STATE | WS_DISABLED | WS_TABSTOP,13,92,107,10\r
-    CONTROL         "Automatically renew",IDC_CFG_RENEW,"Button",BS_3STATE | \r
-                    WS_DISABLED | WS_TABSTOP,13,106,81,10\r
-    CONTROL         "Always show in the credentials list (Sticky)",\r
-                    IDC_CFG_STICKY,"Button",BS_3STATE | WS_DISABLED | \r
-                    WS_TABSTOP,13,120,151,10\r
-    PUSHBUTTON      "&Remove",IDC_CFG_REMOVE,174,126,50,14,WS_DISABLED\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,7,107,10\r
+    CONTROL         "Automatically renew",IDC_CFG_RENEW,"Button",\r
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,20,81,10\r
+    CONTROL         "Always show in the credentials list (Pinned)",\r
+                    IDC_CFG_STICKY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,\r
+                    34,151,10\r
 END\r
 \r
 IDD_CFG_ID_TAB DIALOGEX 0, 0, 235, 151\r
 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU\r
+EXSTYLE WS_EX_CONTROLPARENT\r
 FONT 8, "MS Shell Dlg", 400, 0, 0x1\r
 BEGIN\r
-    CONTROL         "Always show in the credentials list (Sticky)",\r
+    CONTROL         "Always show in the credentials list (Pinned)",\r
                     IDC_CFG_STICKY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,\r
                     34,151,10\r
     CONTROL         "Monitor credential expiration",IDC_CFG_MONITOR,"Button",\r
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,7,107,10\r
     CONTROL         "Automatically renew",IDC_CFG_RENEW,"Button",\r
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,20,81,10\r
+    PUSHBUTTON      "Remove identity ...",IDC_CFG_REMOVE,139,122,78,14,NOT \r
+                    WS_VISIBLE\r
 END\r
 \r
 IDD_ABOUT DIALOGEX 0, 0, 268, 170\r
@@ -544,10 +547,10 @@ BEGIN
     IDS_MENU_HELP           "&Help"\r
     IDS_ACTION_PROPERTIES   "&Properties ..."\r
     IDS_ACTION_EXIT         "E&xit"\r
-    IDS_CFG_ROOT_NAME       "NetIDMgr"\r
+    IDS_CFG_ROOT_NAME       "Network Identity Manager"\r
     IDS_ACTION_SET_DEF_ID   "Set as &default"\r
     IDS_ACTION_SET_SRCH_ID  "Allow applications to &search"\r
-    IDS_CFG_ROOT_TITLE      "NetIDMgr Configuration"\r
+    IDS_CFG_ROOT_TITLE      "Network Identity Manager Configuration"\r
     IDS_CFG_GENERAL_SHORT   "General"\r
     IDS_ACTION_NEW_CRED     "&New credentials ..."\r
     IDS_ACTION_PASSWD_ID    "Change &password ..."\r
@@ -571,7 +574,7 @@ BEGIN
     IDS_ACTION_HELP_CONTENTS "Contents ..."\r
     IDS_ACTION_HELP_INDEX   "Index ..."\r
     IDS_ACTION_HELP_ABOUT   "About NetIDMgr ..."\r
-    IDS_CFG_GENERAL_LONG    "General options for NetIDMgr"\r
+    IDS_CFG_GENERAL_LONG    "General options"\r
     IDS_SAMPLE_STRING       "Wxy"\r
     IDS_NO_CREDS            "<large><center>You currently have no credentials.Click <a id=""NewCreds"">here</a> to obtain new credentials.</center></large>"\r
     IDS_WT_INIT_CREDS       "Obtain initial credentials"\r
@@ -625,7 +628,7 @@ BEGIN
     IDS_ACTION_CLOSE_APP    "Close NetIDMgr window"\r
     IDS_NC_FAILED_TITLE     "Failed to acquire credentials"\r
     IDS_CFG_IDENTITIES_SHORT "Identities"\r
-    IDS_CFG_IDENTITIES_LONG "Options for all identities"\r
+    IDS_CFG_IDENTITIES_LONG "Global Identity settings"\r
     IDS_CFG_NOTIF_SHORT     "Notifications"\r
     IDS_CFG_NOTIF_LONG      "Notifications"\r
     IDS_CFG_PLUGINS_SHORT   "Plugins"\r
@@ -685,6 +688,11 @@ BEGIN
                             "This is quite possibly caused by the identity provider module failing to load properly."\r
     IDS_NC_REN_FAILED_TITLE "Failed to renew credentials"\r
     IDS_CW_DEFAULT          "(Default)"\r
+    IDS_ACTION_OPT_PLUGINS  "Plugins ..."\r
+    IDS_NC_SETDEF           "&Set as default identity"\r
+    IDS_NC_ID_DEF           "<p>This identity is the default</p>"\r
+    IDS_NC_ID_WDEF          "<p>Will be the default. (<a id=""NotDef"">Don't make default</a>)</p>"\r
+    IDS_NC_ID_NDEF          "<p>Not default identity.  (<a id=""MakeDef"">make default</a>)</p>"\r
 END\r
 \r
 #endif    // English (U.S.) resources\r
index 93055d97f29b886b6a01baad5a544ac438e251b3..6f7f9bd47cb5bd38c695d42d92f91637530686a5 100644 (file)
@@ -376,7 +376,11 @@ khm_module_load_ctx_handler(enum kherr_ctx_event evt,
 \r
 static wchar_t helpfile[MAX_PATH] = L"";\r
 \r
-HWND khm_html_help(HWND hwnd, UINT command, DWORD_PTR data) {\r
+HWND khm_html_help(HWND hwnd, wchar_t * suffix,\r
+                   UINT command, DWORD_PTR data) {\r
+\r
+    wchar_t gpath[MAX_PATH + MAX_PATH];\r
+\r
     if (!*helpfile) {\r
         DWORD dw;\r
         wchar_t ppath[MAX_PATH];\r
@@ -392,7 +396,12 @@ HWND khm_html_help(HWND hwnd, UINT command, DWORD_PTR data) {
         }\r
     }\r
 \r
-    return HtmlHelp(hwnd, helpfile, command, data);\r
+    StringCbCopy(gpath, sizeof(gpath), helpfile);\r
+\r
+    if (suffix)\r
+        StringCbCat(gpath, sizeof(gpath), suffix);\r
+\r
+    return HtmlHelp(hwnd, gpath, command, data);\r
 }\r
 \r
 void khm_load_default_modules(void) {\r
index c7bf94da1c1d578de3176032fcaa2c7a3e945140..10270f2a09f1e15b0918c7785740e8082d6558f6 100644 (file)
@@ -129,7 +129,7 @@ void add_action_to_menu(HMENU hm, khui_action * act,
         def = khui_find_menu(act->cmd);\r
         if(def) {\r
             mii.fMask |= MIIM_SUBMENU;\r
-            mii.hSubMenu = mm_create_menu_from_def(def);\r
+            mii.hSubMenu = mm_create_menu_from_def(def, FALSE);\r
         }\r
 \r
         if(flags & KHUI_ACTIONREF_DEFAULT)\r
@@ -139,12 +139,76 @@ void add_action_to_menu(HMENU hm, khui_action * act,
     InsertMenuItem(hm,idx,TRUE,&mii);\r
 }\r
 \r
-static HMENU mm_create_menu_from_def(khui_menu_def * def) {\r
+static void refresh_menu(HMENU hm, khui_menu_def * def);\r
+\r
+static void refresh_menu_item(HMENU hm, khui_action * act, \r
+                              int idx, int flags) {\r
+    MENUITEMINFO mii;\r
+\r
+    mii.cbSize = sizeof(mii);\r
+    mii.fMask = 0;\r
+\r
+    if (act == NULL)\r
+        return;\r
+    else {\r
+        khui_menu_def * def;\r
+\r
+        if(act->state & KHUI_ACTIONSTATE_DISABLED) {\r
+            mii.fMask |= MIIM_STATE;\r
+            mii.fState = MFS_DISABLED;\r
+        } else {\r
+            mii.fMask |= MIIM_STATE;\r
+            mii.fState = MFS_ENABLED;\r
+        }\r
+\r
+        if(act->type & KHUI_ACTIONTYPE_TOGGLE) {\r
+            mii.fMask |= MIIM_STATE;\r
+            if (act->state & KHUI_ACTIONSTATE_CHECKED) {\r
+                mii.fState |= MFS_CHECKED;\r
+            } else {\r
+                mii.fState |= MFS_UNCHECKED;\r
+            }\r
+        }\r
+\r
+        SetMenuItemInfo(hm, act->cmd, FALSE, &mii);\r
+\r
+        def = khui_find_menu(act->cmd);\r
+        if(def) {\r
+            MENUITEMINFO mii2;\r
+\r
+            mii2.cbSize = sizeof(mii2);\r
+            mii2.fMask = MIIM_SUBMENU;\r
+\r
+            if (GetMenuItemInfo(hm, act->cmd, FALSE, &mii2)) {\r
+                refresh_menu(mii2.hSubMenu, def);\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+static void refresh_menu(HMENU hm, khui_menu_def * def) {\r
+    khui_action_ref * act;\r
+    int i;\r
+\r
+    act = def->items;\r
+    i = 0;\r
+    while ((def->n_items == -1 && act->action != KHUI_MENU_END) ||\r
+           (def->n_items >= 0 && i < (int) def->n_items)) {\r
+        refresh_menu_item(hm, khui_find_action(act->action), i, act->flags);\r
+        act++; i++;\r
+    }\r
+}\r
+\r
+static HMENU mm_create_menu_from_def(khui_menu_def * def, BOOL main) {\r
     HMENU hm;\r
     khui_action_ref * act;\r
     int i;\r
 \r
-    hm = CreatePopupMenu();\r
+    if (main)\r
+        hm = CreateMenu();\r
+    else\r
+        hm = CreatePopupMenu();\r
+\r
     act = def->items;\r
     i = 0;\r
     while((def->n_items == -1 && act->action != KHUI_MENU_END) ||\r
@@ -163,7 +227,7 @@ static void mm_show_panel_def(khui_menu_def * def, LONG x, LONG y)
 {\r
     HMENU hm;\r
 \r
-    hm = mm_create_menu_from_def(def);\r
+    hm = mm_create_menu_from_def(def, FALSE);\r
 \r
     mm_hot_track = (mm_last_hot_item >= 0);\r
 \r
@@ -218,12 +282,11 @@ LRESULT khm_menu_activate(int menu_id) {
     } else if(menu_id == MENU_ACTIVATE_NONE) {\r
         menu_id = -1;\r
     }\r
-\r
     \r
     SendMessage(khui_main_menu_toolbar,\r
-        TB_SETHOTITEM,\r
-        menu_id,\r
-        0);\r
+                TB_SETHOTITEM,\r
+                menu_id,\r
+                0);\r
 \r
     khm_menu_track_current();\r
 \r
@@ -472,7 +535,36 @@ LRESULT khm_menu_notify_main(LPNMHDR notice) {
     return ret;\r
 }\r
 \r
-void khm_menu_create_main(HWND rebar) {\r
+HMENU khui_hmenu_main = NULL;\r
+\r
+void khm_menu_refresh_items(void) {\r
+    khui_menu_def * def;\r
+\r
+    if (!khui_hmenu_main)\r
+        return;\r
+\r
+    def = khui_find_menu(KHUI_MENU_MAIN);\r
+\r
+    refresh_menu(khui_hmenu_main, def);\r
+\r
+    DrawMenuBar(khm_hwnd_main);\r
+}\r
+\r
+void khm_menu_create_main(HWND parent) {\r
+    HMENU hmenu;\r
+    khui_menu_def * def;\r
+\r
+    def = khui_find_menu(KHUI_MENU_MAIN);\r
+\r
+    hmenu = mm_create_menu_from_def(def, TRUE);\r
+\r
+    SetMenu(parent, hmenu);\r
+\r
+    khui_hmenu_main = hmenu;\r
+\r
+    return;\r
+\r
+#ifdef USE_EXPLORER_STYLE_MENU_BAR\r
     HWND hwtb;\r
     REBARBANDINFO rbi;\r
     SIZE sz;\r
@@ -566,4 +658,5 @@ void khm_menu_create_main(HWND rebar) {
                 RB_INSERTBAND,\r
                 0,\r
                 (LPARAM) &rbi);\r
+#endif\r
 }\r
index 59638cdd4e2377e88bba8bcb3894b862ae59a929..7f718c26c47a952e1202b69211df946f82360a37 100644 (file)
@@ -45,8 +45,9 @@ void khm_menu_show_panel(int id, LONG x, LONG y);
 void khm_menu_track_current(void);\r
 LRESULT khm_menu_measure_item(WPARAM wParam, LPARAM lparam);\r
 LRESULT khm_menu_draw_item(WPARAM wParam, LPARAM lparam);\r
+void khm_menu_refresh_items(void);\r
 \r
-static HMENU mm_create_menu_from_def(khui_menu_def * def);\r
+static HMENU mm_create_menu_from_def(khui_menu_def * def, BOOL main);\r
 static void mm_show_panel_def(khui_menu_def * def, LONG x, LONG y);\r
 \r
 void khui_init_menu(void);\r
index 8f55005b32f265d74d092ec353b5ce0b2b72235e..1e00c6d2a1766b482f7b79824f0e874f4609e357 100644 (file)
@@ -112,7 +112,7 @@ LRESULT CALLBACK khm_main_wnd_proc(
         break;\r
 \r
     case WM_HELP:\r
-        MessageBox(khm_hwnd_main, L"WM_HELP", L"Notice", MB_OK);\r
+        khm_html_help(khm_hwnd_main, NULL, HH_HELP_CONTEXT, IDH_WELCOME);\r
         break;\r
 \r
     case WM_COMMAND:\r
@@ -175,16 +175,24 @@ LRESULT CALLBACK khm_main_wnd_proc(
         }\r
             break;\r
 \r
+        case KHUI_ACTION_OPT_PLUGINS: {\r
+            khui_config_node node;\r
+\r
+            khui_cfg_open(NULL, L"KhmPlugins", &node);\r
+            khm_show_config_pane(node);\r
+        }\r
+            break;\r
+\r
         case KHUI_ACTION_HELP_CTX:\r
-            khm_html_help(khm_hwnd_main, HH_HELP_CONTEXT, IDH_WELCOME);\r
+            khm_html_help(khm_hwnd_main, NULL, HH_HELP_CONTEXT, IDH_WELCOME);\r
             break;\r
 \r
         case KHUI_ACTION_HELP_CONTENTS:\r
-            khm_html_help(khm_hwnd_main, HH_DISPLAY_TOC, 0);\r
+            khm_html_help(khm_hwnd_main, NULL, HH_DISPLAY_TOC, 0);\r
             break;\r
 \r
         case KHUI_ACTION_HELP_INDEX:\r
-            khm_html_help(khm_hwnd_main, HH_DISPLAY_INDEX, (DWORD_PTR) L"");\r
+            khm_html_help(khm_hwnd_main, NULL, HH_DISPLAY_INDEX, (DWORD_PTR) L"");\r
             break;\r
 \r
         case KHUI_ACTION_HELP_ABOUT:\r
@@ -400,10 +408,14 @@ LRESULT CALLBACK khm_main_wnd_proc(
             kmq_wm_begin(lParam, &m);\r
             if (m->type == KMSG_ACT &&\r
                 m->subtype == KMSG_ACT_REFRESH) {\r
+                khm_menu_refresh_items();\r
                 khm_update_standard_toolbar();\r
             } else if (m->type == KMSG_ACT &&\r
                        m->subtype == KMSG_ACT_BEGIN_CMDLINE) {\r
                 khm_cred_begin_commandline();\r
+            } else if (m->type == KMSG_ACT &&\r
+                       m->subtype == KMSG_ACT_CONTINUE_CMDLINE) {\r
+                khm_cred_process_commandline();\r
             } else if (m->type == KMSG_CRED &&\r
                   m->subtype == KMSG_CRED_REFRESH) {\r
                 mw_restart_refresh_timer(hwnd);\r
@@ -500,6 +512,8 @@ void khm_create_main_window_controls(HWND hwnd_main) {
     REBARINFO rbi;\r
     HWND hwRebar;\r
 \r
+    khm_menu_create_main(hwnd_main);\r
+\r
     hwRebar = \r
         CreateWindowEx(WS_EX_TOOLWINDOW,\r
                        REBARCLASSNAME,\r
@@ -531,7 +545,6 @@ void khm_create_main_window_controls(HWND hwnd_main) {
         return;\r
 \r
     /* self attach */\r
-    khm_menu_create_main(hwRebar);\r
     khm_create_standard_toolbar(hwRebar);\r
     khm_create_statusbar(hwnd_main);\r
 \r
index 6852846fb410679f518ba74c64fa8a4842c6dca4..619b79687ac2c5ae8c8ab5a072b3d9415fe49870 100644 (file)
@@ -43,12 +43,20 @@ nc_common_dlg_proc(HWND hwnd,
 {\r
     switch(uMsg) {\r
     case WM_INITDIALOG:\r
+        {\r
+            khui_nc_wnd_data * d;\r
+\r
+            d = (khui_nc_wnd_data *) lParam;\r
 \r
 #pragma warning(push)\r
 #pragma warning(disable: 4244)\r
-        SetWindowLongPtr(hwnd, DWLP_USER, lParam);\r
+            SetWindowLongPtr(hwnd, DWLP_USER, lParam);\r
 #pragma warning(pop)\r
-\r
+            if (d->nc->subtype == KMSG_CRED_PASSWORD) {\r
+                ShowWindow(GetDlgItem(hwnd, IDC_NC_OPTIONS),\r
+                           SW_HIDE);\r
+            }\r
+        }\r
         return TRUE;\r
 \r
     case WM_COMMAND:\r
@@ -271,6 +279,7 @@ nc_update_credtext(khui_nc_wnd_data * d)
         kcdb_identity_get_name(d->nc->identities[0], id_name, &cbbuf);\r
 \r
         kcdb_identity_get_flags(d->nc->identities[0], &flags);\r
+\r
         if (flags & KCDB_IDENT_FLAG_INVALID) {\r
             LoadString(khm_hInstance, IDS_NC_CREDTEXT_ID_INVALID, \r
                        id_fmt, (int) ARRAYLENGTH(id_fmt));\r
@@ -290,6 +299,21 @@ nc_update_credtext(khui_nc_wnd_data * d)
         StringCbPrintf(buf, NC_MAXCB_CREDTEXT - cch*sizeof(wchar_t), \r
                        main_fmt, id_string);\r
 \r
+        if (flags & KCDB_IDENT_FLAG_VALID) {\r
+            if (flags & KCDB_IDENT_FLAG_DEFAULT)\r
+                LoadString(khm_hInstance, IDS_NC_ID_DEF,\r
+                           id_string, ARRAYLENGTH(id_string));\r
+            else if (d->nc->set_default)\r
+                LoadString(khm_hInstance, IDS_NC_ID_WDEF,\r
+                           id_string, ARRAYLENGTH(id_string));\r
+            else\r
+                LoadString(khm_hInstance, IDS_NC_ID_NDEF,\r
+                           id_string, ARRAYLENGTH(id_string));\r
+\r
+            StringCbCat(buf, NC_MAXCB_CREDTEXT - cch * sizeof(wchar_t),\r
+                        id_string);\r
+        }\r
+\r
     } else if(d->nc->n_identities > 1) {\r
         wchar_t *ids_string;\r
         khm_size cb_ids_string;\r
@@ -456,6 +480,12 @@ nc_update_credtext(khui_nc_wnd_data * d)
 \r
 #define CW_PARAM DWLP_USER\r
 \r
+static void\r
+nc_add_control_row(khui_nc_wnd_data * d, \r
+                   HWND label,\r
+                   HWND input,\r
+                   khui_control_size size);\r
+\r
 static LRESULT \r
 nc_handle_wm_create(HWND hwnd,\r
                     UINT uMsg,\r
@@ -691,6 +721,7 @@ nc_handle_wm_create(HWND hwnd,
         ShowWindow(ncd->dlg_ts, SW_HIDE);\r
 \r
         nc_position_credtext(ncd);\r
+\r
     } else {\r
         /* hide and show stuff */\r
         ShowWindow(ncd->dlg_main, SW_SHOW);\r
@@ -705,6 +736,28 @@ nc_handle_wm_create(HWND hwnd,
        selector controls */\r
     c->ident_cb(c, WMNC_IDENT_INIT, NULL, 0, 0, (LPARAM) ncd->dlg_main);\r
 \r
+#if 0\r
+    {\r
+        HWND hw;\r
+        wchar_t wcaption[64];\r
+\r
+        LoadString(khm_hInstance, IDS_NC_SETDEF, wcaption,\r
+                   ARRAYLENGTH(wcaption));\r
+\r
+        /* Now create the set as default button */\r
+        hw = CreateWindow\r
+            (L"BUTTON",\r
+             wcaption,\r
+             WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX,\r
+             0, 0, 100, 100,\r
+             ncd->dlg_main,\r
+             (HMENU) NC_BN_SET_DEF_ID,\r
+             khm_hInstance,\r
+             NULL);\r
+\r
+        nc_add_control_row(ncd, NULL, hw, KHUI_CTRLSIZE_HALF);\r
+    }\r
+#endif\r
     /* we defer the creation of the tab buttons for later */\r
 \r
     /* add this to the dialog chain */\r
@@ -757,23 +810,27 @@ nc_add_control_row(khui_nc_wnd_data * d,
 #endif\r
     }\r
 \r
-    SetWindowPos(label,\r
-                 ((d->hwnd_last_idspec != NULL)?\r
-                  d->hwnd_last_idspec:\r
-                  HWND_TOP),\r
-                 r_label.left, r_label.top,\r
-                 r_label.right - r_label.left,\r
-                 r_label.bottom - r_label.top,\r
-                 SWP_DEFERERASE | SWP_NOACTIVATE |\r
-                 SWP_NOOWNERZORDER);\r
-\r
-    SetWindowPos(input,\r
-                 label,\r
-                 r_input.left, r_input.top,\r
-                 r_input.right - r_input.left,\r
-                 r_input.bottom - r_input.top,\r
-                 SWP_DEFERERASE | SWP_NOACTIVATE |\r
-                 SWP_NOOWNERZORDER);\r
+    if (label)\r
+        SetWindowPos(label,\r
+                     ((d->hwnd_last_idspec != NULL)?\r
+                      d->hwnd_last_idspec:\r
+                      HWND_TOP),\r
+                     r_label.left, r_label.top,\r
+                     r_label.right - r_label.left,\r
+                     r_label.bottom - r_label.top,\r
+                     SWP_DEFERERASE | SWP_NOACTIVATE |\r
+                     SWP_NOOWNERZORDER);\r
+\r
+    if (input)\r
+        SetWindowPos(input,\r
+                     (label ? label : ((d->hwnd_last_idspec != NULL)?\r
+                                       d->hwnd_last_idspec:\r
+                                       HWND_TOP)),\r
+                     r_input.left, r_input.top,\r
+                     r_input.right - r_input.left,\r
+                     r_input.bottom - r_input.top,\r
+                     SWP_DEFERERASE | SWP_NOACTIVATE |\r
+                     SWP_NOOWNERZORDER);\r
 \r
     d->hwnd_last_idspec = input;\r
 \r
@@ -877,6 +934,10 @@ nc_handle_wm_command(HWND hwnd,
             }\r
             return FALSE;\r
 \r
+        case IDC_NC_HELP:\r
+            khm_html_help(hwnd, NULL, HH_HELP_CONTEXT, IDH_ACTION_NEW_ID);\r
+            return FALSE;\r
+\r
         case IDC_NC_OPTIONS: \r
             /* the Options button in the main window was clicked.  we\r
                respond by expanding the dialog. */\r
@@ -958,10 +1019,26 @@ nc_handle_wm_command(HWND hwnd,
                                                    WMNC_DIALOG_SWITCH_PANEL),\r
                                         0);\r
                     }\r
+                } else if (!wcsicmp(sid, L"NotDef")) {\r
+                    d->nc->set_default = FALSE;\r
+                    nc_update_credtext(d);\r
+                } else if (!wcsicmp(sid, L"MakeDef")) {\r
+                    d->nc->set_default = TRUE;\r
+                    nc_update_credtext(d);\r
                 }\r
             }\r
             return FALSE;\r
 \r
+#if 0\r
+        case NC_BN_SET_DEF_ID:\r
+            {\r
+                d->nc->set_default =\r
+                    (IsDlgButtonChecked(d->dlg_main, NC_BN_SET_DEF_ID)\r
+                     == BST_CHECKED);\r
+            }\r
+            return FALSE;\r
+#endif\r
+\r
         default:\r
             /* if one of the tab strip buttons were pressed, then\r
                we should switch to that panel */\r
@@ -1271,7 +1348,21 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
 \r
             nc_notify_types(d->nc, KHUI_WM_NC_NOTIFY,\r
                             MAKEWPARAM(0, WMNC_IDENTITY_CHANGE), 0);\r
+\r
+            if (d->nc->subtype == KMSG_CRED_NEW_CREDS &&\r
+                d->nc->n_identities > 0 &&\r
+                d->nc->identities[0]) {\r
+                khm_int32 f = 0;\r
+\r
+                kcdb_identity_get_flags(d->nc->identities[0], &f);\r
+\r
+                if (!(f & KCDB_IDENT_FLAG_DEFAULT)) {\r
+                    d->nc->set_default = FALSE;\r
+                }\r
+            }\r
+\r
             nc_update_credtext(d);\r
+\r
         }\r
         break;\r
 \r
@@ -1517,7 +1608,11 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
                              SWP_NOACTIVATE | SWP_NOMOVE | \r
                              SWP_NOOWNERZORDER | SWP_NOSIZE | \r
                              SWP_SHOWWINDOW);\r
-                                \r
+\r
+                SendMessage(hw, EM_SETLIMITTEXT,\r
+                            KHUI_MAXCCH_PROMPT_VALUE -1,\r
+                            0);\r
+\r
                 d->nc->prompts[i]->hwnd_edit = hw;\r
 \r
                 hw_prev = hw;\r
@@ -1542,12 +1637,12 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
 \r
             nc = d->nc;\r
 \r
-            /* reset state */\r
-            nc->result = KHUI_NC_RESULT_CANCEL;\r
-\r
             if(nc->response & KHUI_NC_RESPONSE_NOEXIT) {\r
                 HWND hw;\r
 \r
+                /* reset state */\r
+                nc->result = KHUI_NC_RESULT_CANCEL;\r
+\r
                 hw = GetDlgItem(d->dlg_main, IDOK);\r
                 EnableWindow(hw, TRUE);\r
                 hw = GetDlgItem(d->dlg_main, IDCANCEL);\r
@@ -1586,6 +1681,72 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
     return TRUE;\r
 }\r
 \r
+static LRESULT nc_handle_wm_help(HWND hwnd,\r
+                                 UINT uMsg,\r
+                                 WPARAM wParam,\r
+                                 LPARAM lParam) {\r
+    static DWORD ctxids[] = {\r
+        NC_TS_CTRL_ID_MIN, IDH_NC_TABMAIN,\r
+        NC_TS_CTRL_ID_MIN + 1, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 2, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 3, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 4, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 5, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 6, IDH_NC_TABBUTTON,\r
+        NC_TS_CTRL_ID_MIN + 7, IDH_NC_TABBUTTON,\r
+        IDOK, IDH_NC_OK,\r
+        IDCANCEL, IDH_NC_CANCEL,\r
+        IDC_NC_HELP, IDH_NC_HELP,\r
+        IDC_NC_OPTIONS, IDH_NC_OPTIONS,\r
+        IDC_NC_CREDTEXT, IDH_NC_CREDWND,\r
+        0\r
+    };\r
+\r
+    HELPINFO * hlp;\r
+    HWND hw = NULL;\r
+    HWND hw_ctrl;\r
+    khui_nc_wnd_data * d;\r
+\r
+    d = (khui_nc_wnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, CW_PARAM);\r
+\r
+    hlp = (HELPINFO *) lParam;\r
+\r
+    if (d->nc->subtype != KMSG_CRED_NEW_CREDS &&\r
+        d->nc->subtype != KMSG_CRED_PASSWORD)\r
+        return TRUE;\r
+\r
+    if (hlp->iContextType != HELPINFO_WINDOW)\r
+        return TRUE;\r
+\r
+    if (hlp->hItemHandle != NULL &&\r
+        hlp->hItemHandle != hwnd) {\r
+        DWORD id;\r
+        int i;\r
+\r
+        hw_ctrl =hlp->hItemHandle;\r
+\r
+        id = GetWindowLong(hw_ctrl, GWL_ID);\r
+        for (i=0; ctxids[i] != 0; i += 2)\r
+            if (ctxids[i] == id)\r
+                break;\r
+\r
+        if (ctxids[i] != 0)\r
+            hw = khm_html_help(hw_ctrl,\r
+                               ((d->nc->subtype == KMSG_CRED_NEW_CREDS)?\r
+                                L"::popups_newcreds.txt":\r
+                                L"::popups_password.txt"),\r
+                               HH_TP_HELP_WM_HELP,\r
+                               (DWORD_PTR) ctxids);\r
+    }\r
+\r
+    if (hw == NULL) {\r
+        khm_html_help(hwnd, NULL, HH_HELP_CONTEXT,\r
+                      ((d->nc->subtype == KMSG_CRED_NEW_CREDS)?\r
+                       IDH_ACTION_NEW_ID: IDH_ACTION_PASSWD_ID));\r
+    }\r
+\r
+    return TRUE;\r
+}\r
 \r
 static LRESULT CALLBACK nc_window_proc(HWND hwnd,\r
                                        UINT uMsg,\r
@@ -1606,6 +1767,9 @@ static LRESULT CALLBACK nc_window_proc(HWND hwnd,
     case WM_MOVING:\r
         return nc_handle_wm_moving(hwnd, uMsg, wParam, lParam);\r
 \r
+    case WM_HELP:\r
+        return nc_handle_wm_help(hwnd, uMsg, wParam, lParam);\r
+\r
     case KHUI_WM_NC_NOTIFY:\r
         return nc_handle_wm_nc_notify(hwnd, uMsg, wParam, lParam);\r
     }\r
index 22505bc746263a4f443ff0f04aed90082e04757b..7813e1c19ac40fbd93e72695de21a9b9327f3127 100644 (file)
@@ -88,6 +88,8 @@ void khm_show_newcredwnd(HWND hwnd);
 /* Maximum control ID */\r
 #define NC_TS_CTRL_ID_MAX (NC_TS_CTRL_ID_MIN + NC_TS_MAX_CTRLS - 1)\r
 \r
+#define NC_BN_SET_DEF_ID 8012\r
+\r
 /* the first control ID that may be used by an identity provider */\r
 #define NC_IS_CTRL_ID_MIN 8016\r
 \r
index 5d62be5fc472e06127d85d2fb8ba9cd17167910b..b7ac4626299073adde34c5879fd22ba9f926ce98 100644 (file)
@@ -57,6 +57,8 @@ khui_alert * alert_queue[KHUI_ALERT_QUEUE_MAX];
 khm_int32    alert_queue_head = 0;\r
 khm_int32    alert_queue_tail = 0;\r
 \r
+int  iid_normal = IDI_NOTIFY_NONE;\r
+\r
 #define is_alert_queue_empty() (alert_queue_head == alert_queue_tail)\r
 #define is_alert_queue_full()  (((alert_queue_tail + 1) % KHUI_ALERT_QUEUE_MAX) == alert_queue_head)\r
 \r
@@ -227,8 +229,8 @@ notifier_wnd_proc(HWND hwnd,
 \r
         case WM_LBUTTONUP:\r
             /* fall through */\r
-\r
         case NIN_SELECT:\r
+            /* fall through */\r
         case NIN_KEYSELECT:\r
             khm_show_main_window();\r
             break;\r
@@ -1025,7 +1027,7 @@ void khm_notify_icon_add(void) {
     ni.hWnd = hwnd_notifier;\r
     ni.uID = KHUI_NOTIFY_ICON_ID;\r
     ni.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;\r
-    ni.hIcon = LoadIcon(khm_hInstance, MAKEINTRESOURCE(IDI_NOTIFY_NONE));\r
+    ni.hIcon = LoadIcon(khm_hInstance, MAKEINTRESOURCE(iid_normal));\r
     ni.uCallbackMessage = KHUI_WM_NOTIFIER;\r
     LoadString(khm_hInstance, IDS_NOTIFY_PREFIX, buf, ARRAYLENGTH(buf));\r
     StringCbCopy(ni.szTip, sizeof(ni.szTip), buf);\r
@@ -1066,7 +1068,7 @@ khm_notify_icon_balloon(khm_int32 severity,
         iid = IDI_NOTIFY_ERROR;\r
     } else {\r
         ni.dwInfoFlags = NIIF_NONE;\r
-        iid = IDI_NOTIFY_NONE;\r
+        iid = iid_normal;\r
     }\r
 \r
     ni.hWnd = hwnd_notifier;\r
@@ -1098,6 +1100,27 @@ khm_notify_icon_balloon(khm_int32 severity,
     DestroyIcon(ni.hIcon);\r
 }\r
 \r
+void khm_notify_icon_expstate(enum khm_notif_expstate expseverity) {\r
+    int new_iid;\r
+\r
+    if (expseverity == KHM_NOTIF_OK)\r
+        new_iid = IDI_APPICON_OK;\r
+    else if (expseverity == KHM_NOTIF_WARN)\r
+        new_iid = IDI_APPICON_WARN;\r
+    else if (expseverity == KHM_NOTIF_EXP)\r
+        new_iid = IDI_APPICON_EXP;\r
+    else\r
+        new_iid = IDI_NOTIFY_NONE;\r
+\r
+    if (iid_normal == new_iid)\r
+        return;\r
+\r
+    iid_normal = new_iid;\r
+\r
+    if (current_alert == NULL)\r
+        khm_notify_icon_change(KHERR_NONE);\r
+}\r
+\r
 void khm_notify_icon_change(khm_int32 severity) {\r
     NOTIFYICONDATA ni;\r
     wchar_t buf[256];\r
@@ -1110,7 +1133,7 @@ void khm_notify_icon_change(khm_int32 severity) {
     else if (severity == KHERR_ERROR)\r
         iid = IDI_NOTIFY_ERROR;\r
     else\r
-        iid = IDI_NOTIFY_NONE;\r
+        iid = iid_normal;\r
 \r
     ZeroMemory(&ni, sizeof(ni));\r
 \r
index de9fb60fa9fdbad64c82881df0f0c802130bf7e4..140d02c449b58009a1e389bba665c053aaedfec0 100644 (file)
 #ifndef __KHIMAIRA_NOTIFIER_H\r
 #define __KHIMAIRA_NOTIFIER_H\r
 \r
+extern HWND hwnd_notifier;\r
+\r
+enum khm_notif_expstate {\r
+    KHM_NOTIF_EMPTY,\r
+    KHM_NOTIF_OK,\r
+    KHM_NOTIF_WARN,\r
+    KHM_NOTIF_EXP\r
+};\r
+\r
 void \r
 khm_init_notifier(void);\r
 \r
@@ -42,4 +51,7 @@ khm_notify_icon_balloon(khm_int32 severity,
                          wchar_t * msg,\r
                          khm_int32 timeout);\r
 \r
+void\r
+khm_notify_icon_expstate(enum khm_notif_expstate expseverity);\r
+\r
 #endif\r
index 9c48eed431bc7abd239a4c99f3070143a43b5efb..04056566d138a93ddcfcca4a3aef3f6577627d3e 100644 (file)
@@ -101,12 +101,13 @@ reqdaemonwnd_proc(HWND hwnd,
                 kcdb_identity_create(widname,\r
                                      KCDB_IDENT_FLAG_CREATE,\r
                                      &identity);\r
-\r
             }\r
 \r
+            widname[0] = 0;\r
+\r
             do {\r
                 if (khm_cred_is_in_dialog()) {\r
-                    khm_cred_wait_for_dialog(INFINITE, NULL);\r
+                    khm_cred_wait_for_dialog(INFINITE, NULL, NULL, 0);\r
                 }\r
 \r
                 if (identity)\r
@@ -122,7 +123,6 @@ reqdaemonwnd_proc(HWND hwnd,
                 else\r
                     khui_context_reset();\r
 \r
-\r
                 if (pdlginfo->dlgtype == NETID_DLGTYPE_TGT)\r
                     SendMessage(khm_hwnd_main, WM_COMMAND,\r
                                 MAKEWPARAM(KHUI_ACTION_NEW_CRED, 0), 0);\r
@@ -132,7 +132,9 @@ reqdaemonwnd_proc(HWND hwnd,
                 else\r
                     break;\r
 \r
-                if (KHM_FAILED(khm_cred_wait_for_dialog(INFINITE, &result)))\r
+                if (KHM_FAILED(khm_cred_wait_for_dialog(INFINITE, &result,\r
+                                                        widname,\r
+                                                        sizeof(widname))))\r
                     continue;\r
                 else {\r
                     lr = (result != KHUI_NC_RESULT_GET_CREDS);\r
@@ -140,15 +142,66 @@ reqdaemonwnd_proc(HWND hwnd,
                 }\r
             } while(TRUE);\r
 \r
+#ifdef DEBUG\r
+            assert(lr || pdlginfo->dlgtype != NETID_DLGTYPE_TGT ||\r
+                   widname[0]);\r
+#endif\r
+\r
+            if (!lr && pdlginfo->dlgtype == NETID_DLGTYPE_TGT &&\r
+                widname[0]) {\r
+                khm_handle out_ident;\r
+                wchar_t * atsign;\r
+\r
+                atsign = wcsrchr(widname, L'@');\r
+\r
+                if (atsign == NULL)\r
+                    goto _exit;\r
+\r
+                if (KHM_SUCCEEDED(kcdb_identity_create(widname,\r
+                                                       0,\r
+                                                       &out_ident))) {\r
+                    khm_size cb;\r
+\r
+                    pdlginfo->out.ccache[0] = 0;\r
+\r
+                    cb = sizeof(pdlginfo->out.ccache);\r
+                    kcdb_identity_get_attrib(out_ident,\r
+                                             L"Krb5CCName",\r
+                                             NULL,\r
+                                             pdlginfo->out.ccache,\r
+                                             &cb);\r
+                    kcdb_identity_release(out_ident);\r
+                }\r
+#ifdef DEBUG\r
+                else {\r
+                    assert(FALSE);\r
+                }\r
+#endif\r
+\r
+                *atsign++ = 0;\r
+\r
+                StringCbCopy(pdlginfo->out.username,\r
+                             sizeof(pdlginfo->out.username),\r
+                             widname);\r
+\r
+                StringCbCopy(pdlginfo->out.realm,\r
+                             sizeof(pdlginfo->out.realm),\r
+                             atsign);\r
+            }\r
+\r
+        _exit:\r
+\r
             if (pdlginfo)\r
                 UnmapViewOfFile(pdlginfo);\r
             if (hmap)\r
                 CloseHandle(hmap);\r
+            if (identity)\r
+                kcdb_identity_release(identity);\r
 \r
             return lr;\r
         }\r
 \r
-#if 0\r
+#ifdef DEPRECATED_REMOTE_CALL\r
         /* deprecated */\r
     case ID_OBTAIN_TGT_WITH_LPARAM:\r
         {\r
@@ -296,6 +349,7 @@ khm_reqdaemon_thread_proc(LPVOID vparam) {
 #ifdef DEBUG\r
     DWORD dw;\r
 #endif\r
+\r
     khm_register_reqdaemonwnd_class();\r
 \r
 #ifdef DEBUG\r
index 4bee5f206a179b16eb808578a24c501ae63495ea..b8060c6a0171933ad9408dc03f6f3e8f880757a0 100644 (file)
 #define IDB_WDG_STUCK                   201\r
 #define IDS_ACTION_IMPORT               202\r
 #define IDS_CTX_IMPORT                  203\r
+#define IDB_FLAG_RENEW                  203\r
 #define IDS_CFG_PI_COL_PLUGINS          204\r
+#define IDI_APPICON_WARN                204\r
 #define IDS_PISTATE_FAILUNK             205\r
+#define IDI_APPICON_EXP                 205\r
 #define IDS_PISTATE_FAILMAX             206\r
+#define IDI_ICON4                       206\r
+#define IDI_APPICON_OK                  206\r
 #define IDS_PISTATE_FAILREG             207\r
 #define IDS_PISTATE_FAILDIS             208\r
 #define IDS_PISTATE_FAILLOD             209\r
 #define IDS_ERR_SUGG_NO_IDENTPRO        225\r
 #define IDS_NC_REN_FAILED_TITLE         226\r
 #define IDS_CW_DEFAULT                  227\r
+#define IDS_ACTION_OPT_PLUGINS          228\r
+#define IDS_NC_SETDEF                   229\r
+#define IDS_NC_ID_DEF                   230\r
+#define IDS_NC_ID_WDEF                  231\r
+#define IDS_NC_ID_NDEF                  232\r
 #define IDC_NC_USERNAME                 1007\r
 #define IDC_NC_PASSWORD                 1008\r
 #define IDC_NC_CREDTEXT_LABEL           1009\r
 // \r
 #ifdef APSTUDIO_INVOKED\r
 #ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        202\r
+#define _APS_NEXT_RESOURCE_VALUE        207\r
 #define _APS_NEXT_COMMAND_VALUE         40010\r
-#define _APS_NEXT_CONTROL_VALUE         1105\r
+#define _APS_NEXT_CONTROL_VALUE         1107\r
 #define _APS_NEXT_SYMED_VALUE           101\r
 #endif\r
 #endif\r
index 98957858c5d636ed45ac01267f97f800abbfc5fb..5d28e6a582e3fc936bdaa8861e566c3b99a53bb7 100644 (file)
@@ -86,19 +86,22 @@ khm_timer_exit(void) {
 static void\r
 tmr_fire_timer(void) {\r
     int i;\r
-    __int64 curtime;\r
-    __int64 err;\r
-    __int64 next_event;\r
+    unsigned __int64 curtime;\r
+    unsigned __int64 err;\r
+    unsigned __int64 next_event;\r
     int     tmr_count[KHUI_N_TTYPES];\r
-    __int64 tmr_offset[KHUI_N_TTYPES];\r
+    unsigned __int64 tmr_offset[KHUI_N_TTYPES];\r
     int t;\r
     khm_handle eff_ident = NULL;\r
     khui_timer_type eff_type = 0; /* meaningless */\r
     int fire_count = 0;\r
+    FILETIME ft;\r
+\r
+    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR_SMALL, &ft);\r
+    err = FtToInt(&ft);\r
+    GetSystemTimeAsFileTime(&ft);\r
+    curtime = FtToInt(&ft);\r
 \r
-    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR_SMALL, \r
-                            (LPFILETIME) &err);\r
-    GetSystemTimeAsFileTime((LPFILETIME) &curtime);\r
     next_event = 0;\r
 \r
     ZeroMemory(tmr_count, sizeof(tmr_count));\r
@@ -175,7 +178,7 @@ tmr_fire_timer(void) {
         wchar_t wtime[128];\r
         wchar_t wmsg[256];\r
         wchar_t wtitle[64];\r
-        __int64 ft_second;\r
+        unsigned __int64 second;\r
         khui_alert * alert = NULL;\r
 \r
         khm_size cb;\r
@@ -187,12 +190,13 @@ tmr_fire_timer(void) {
            seconds' instead of '5 mins' and so on when converting to a\r
            string.  So we add half a second to make the message\r
            neater. */\r
-        TimetToFileTimeInterval(1, (LPFILETIME) &ft_second);\r
-        next_event += ft_second / 2;\r
+        TimetToFileTimeInterval(1, &ft);\r
+        second = FtToInt(&ft);\r
+        next_event += second / 2;\r
 \r
         cb = sizeof(wtime);\r
-\r
-        FtIntervalToString((LPFILETIME) &next_event,\r
+        ft = IntToFt(next_event);\r
+        FtIntervalToString(&ft,\r
                            wtime,\r
                            &cb);\r
 \r
@@ -207,7 +211,7 @@ tmr_fire_timer(void) {
             cb = sizeof(idname);\r
             kcdb_identity_get_name(eff_ident, idname, &cb);\r
 \r
-            if (next_event < ft_second) {\r
+            if (next_event < second) {\r
                 LoadString(khm_hInstance, IDS_WARN_EXPIRED_ID,\r
                            fmt, ARRAYLENGTH(fmt));\r
 \r
@@ -219,7 +223,7 @@ tmr_fire_timer(void) {
                 StringCbPrintf(wmsg, sizeof(wmsg), fmt, idname, wtime);\r
             }\r
         } else {\r
-            if (next_event < ft_second) {\r
+            if (next_event < second) {\r
                 LoadString(khm_hInstance, IDS_WARN_EXPIRED,\r
                            wmsg, ARRAYLENGTH(wmsg));\r
             } else {\r
@@ -325,12 +329,13 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
     khm_handle ident = NULL;\r
     int mark_idx;\r
     int idx;\r
-    __int64 ft_expiry;\r
-    __int64 ft_current;\r
-    __int64 ft_cred_expiry;\r
-    __int64 ft;\r
-    __int64 fte;\r
-    __int64 ft_reinst;\r
+    FILETIME ft_expiry;\r
+    FILETIME ft_current;\r
+    FILETIME ft_creinst;\r
+    FILETIME ft_cred_expiry;\r
+    FILETIME ft;\r
+    FILETIME fte;\r
+    FILETIME ft_reinst;\r
     khm_size cb;\r
 \r
     kcdb_cred_get_identity(cred, &ident);\r
@@ -352,9 +357,11 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
         }\r
 \r
     /* and the current time */\r
-    GetSystemTimeAsFileTime((LPFILETIME) &ft_current);\r
+    GetSystemTimeAsFileTime(&ft_current);\r
+\r
+    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR, &ft_reinst);\r
 \r
-    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR, (LPFILETIME) &ft_reinst);\r
+    ft_creinst = FtAdd(&ft_current, &ft_reinst);\r
 \r
     mark_idx = tmr_find(ident, KHUI_TTYPE_ID_MARK, 0, 0);\r
 \r
@@ -382,7 +389,7 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
         khm_int32 to_crit = KHUI_DEF_TIMEOUT_CRIT;\r
         khm_int32 to_renew = KHUI_DEF_TIMEOUT_RENEW;\r
 \r
-        if (ft_expiry < ft_current)\r
+        if (CompareFileTime(&ft_expiry, &ft_current) < 0)\r
             /* already expired */\r
             goto _done_with_ident;\r
 \r
@@ -433,8 +440,8 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
         if (monitor && do_renew) {\r
             int prev;\r
 \r
-            TimetToFileTimeInterval(to_renew, (LPFILETIME) &ft);\r
-            fte = ft_expiry - ft;\r
+            TimetToFileTimeInterval(to_renew, &ft);\r
+            fte = FtSub(&ft_expiry, &ft);\r
 \r
             prev =\r
                 tmr_find(ident, KHUI_TTYPE_ID_RENEW, 0, 0);\r
@@ -444,15 +451,16 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
                This maybe because that NetIDMgr was started at the\r
                last minute, or because for some reason the renew timer\r
                could not be triggered earlier. */\r
-            if (fte > ft_current ||\r
+            if (CompareFileTime(&fte, &ft_current) > 0 ||\r
                 prev == -1 ||\r
                 !(khui_timers[prev].flags & KHUI_TE_FLAG_EXPIRED)) {\r
 \r
-                if (fte <= ft_current)\r
+                if (CompareFileTime(&fte, &ft_current) < 0)\r
                     fte = ft_current;\r
 \r
                 tmr_update(ident, KHUI_TTYPE_ID_RENEW, \r
-                           fte, ft, 0, fte > ft_current + ft_reinst);\r
+                           FtToInt(&fte), FtToInt(&ft), 0,\r
+                           CompareFileTime(&fte,&ft_creinst) > 0);\r
                 renew_done = TRUE;\r
             } else {\r
                 /* special case.  If the renew timer was in the past\r
@@ -461,32 +469,36 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
                    failed we don't want to automatically retry\r
                    everytime we check the timers. */\r
                 tmr_update(ident, KHUI_TTYPE_ID_RENEW,\r
-                           fte, ft, 0, FALSE);\r
+                           FtToInt(&fte), FtToInt(&ft), 0, FALSE);\r
             }\r
         }\r
 \r
         if (monitor && do_warn && !renew_done) {\r
-            TimetToFileTimeInterval(to_warn, (LPFILETIME) &ft);\r
-            fte = ft_expiry - ft;\r
 \r
-            if (fte > ft_current)\r
+            TimetToFileTimeInterval(to_warn, &ft);\r
+            fte = FtSub(&ft_expiry, &ft);\r
+\r
+            if (CompareFileTime(&fte, &ft_current) > 0)\r
                 tmr_update(ident, KHUI_TTYPE_ID_WARN,\r
-                           fte, ft, 0, fte > ft_current + ft_reinst);\r
+                           FtToInt(&fte), FtToInt(&ft), 0,\r
+                           CompareFileTime(&fte, &ft_creinst) > 0);\r
         }\r
 \r
         if (monitor && do_crit && !renew_done) {\r
-            TimetToFileTimeInterval(to_crit, (LPFILETIME) &ft);\r
-            fte = ft_expiry - ft;\r
+            TimetToFileTimeInterval(to_crit, &ft);\r
+            fte = FtSub(&ft_expiry, &ft);\r
 \r
-            if (fte > ft_current)\r
+            if (CompareFileTime(&fte, &ft_current) > 0)\r
                 tmr_update(ident, KHUI_TTYPE_ID_CRIT,\r
-                           fte, ft, 0, fte > ft_current + ft_reinst);\r
+                           FtToInt(&fte), FtToInt(&ft), 0,\r
+                           CompareFileTime(&fte, &ft_creinst) > 0);\r
         }\r
 \r
         if (monitor && !renew_done) {\r
-            if (ft_expiry > ft_current)\r
+            if (CompareFileTime(&ft_expiry, &ft_current) > 0)\r
                 tmr_update(ident, KHUI_TTYPE_ID_EXP, \r
-                           ft_expiry, 0, 0, fte > ft_current + ft_reinst);\r
+                           FtToInt(&ft_expiry), 0, 0,\r
+                           CompareFileTime(&fte, &ft_creinst) > 0);\r
         }\r
 \r
     _done_with_ident:\r
@@ -500,20 +512,27 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
                                       &cb)))\r
         goto _cleanup;\r
 \r
-    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR, (LPFILETIME) &ft);\r
+    TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR, &ft);\r
 \r
-    if (ft_cred_expiry >= ft_expiry ||\r
-        (ft_expiry - ft_cred_expiry) < ft)\r
-        goto _cleanup;\r
+    {\r
+        FILETIME ft_delta;\r
+\r
+        ft_delta = FtSub(&ft_expiry, &ft_cred_expiry);\r
+\r
+        if (CompareFileTime(&ft_cred_expiry, &ft_expiry) >= 0 ||\r
+            CompareFileTime(&ft_delta, &ft) < 0)\r
+            goto _cleanup;\r
+    }\r
 \r
     if ((idx = tmr_find(ident, KHUI_TTYPE_ID_WARN, 0, 0)) >= 0 &&\r
         !(khui_timers[idx].flags & KHUI_TE_FLAG_STALE)) {\r
 \r
-        fte = ft_cred_expiry - khui_timers[idx].offset;\r
-        if (fte > ft_current) {\r
-            tmr_update(cred, KHUI_TTYPE_CRED_WARN, fte, \r
+        fte = IntToFt(FtToInt(&ft_cred_expiry) - khui_timers[idx].offset);\r
+        if (CompareFileTime(&fte, &ft_current) > 0) {\r
+            tmr_update(cred, KHUI_TTYPE_CRED_WARN,\r
+                       FtToInt(&fte), \r
                        khui_timers[idx].offset, 0,\r
-                       fte > ft_current + ft_reinst);\r
+                       CompareFileTime(&fte, &ft_creinst) > 0);\r
             kcdb_cred_hold(cred);\r
         }\r
     }\r
@@ -521,11 +540,12 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
     if ((idx = tmr_find(ident, KHUI_TTYPE_ID_CRIT, 0, 0)) >= 0 &&\r
         !(khui_timers[idx].flags & KHUI_TE_FLAG_STALE)) {\r
 \r
-        fte = ft_cred_expiry - khui_timers[idx].offset;\r
-        if (fte > ft_current) {\r
-            tmr_update(cred, KHUI_TTYPE_CRED_CRIT, fte,\r
+        fte = IntToFt(FtToInt(&ft_cred_expiry) - khui_timers[idx].offset);\r
+        if (CompareFileTime(&fte, &ft_current) > 0) {\r
+            tmr_update(cred, KHUI_TTYPE_CRED_CRIT,\r
+                       FtToInt(&fte),\r
                        khui_timers[idx].offset, 0,\r
-                       fte > ft_current + ft_reinst);\r
+                       CompareFileTime(&fte, &ft_creinst) > 0);\r
             kcdb_cred_hold(cred);\r
         }\r
     }\r
@@ -533,11 +553,12 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
     if ((idx = tmr_find(ident, KHUI_TTYPE_ID_RENEW, 0, 0)) >= 0 &&\r
         !(khui_timers[idx].flags & KHUI_TE_FLAG_STALE)) {\r
 \r
-        fte = ft_cred_expiry - khui_timers[idx].offset;\r
-        if (fte > ft_current) {\r
-            tmr_update(cred, KHUI_TTYPE_CRED_RENEW, fte,\r
+        fte = IntToFt(FtToInt(&ft_cred_expiry) - khui_timers[idx].offset);\r
+        if (CompareFileTime(&fte, &ft_current) > 0) {\r
+            tmr_update(cred, KHUI_TTYPE_CRED_RENEW,\r
+                       FtToInt(&fte),\r
                        khui_timers[idx].offset, 0,\r
-                       fte > ft_current + ft_reinst);\r
+                       CompareFileTime(&fte, &ft_creinst) > 0);\r
             kcdb_cred_hold(cred);\r
         }\r
     }\r
@@ -545,10 +566,11 @@ tmr_cred_apply_proc(khm_handle cred, void * rock) {
     if ((idx = tmr_find(ident, KHUI_TTYPE_ID_EXP, 0, 0)) >= 0 &&\r
         !(khui_timers[idx].flags & KHUI_TE_FLAG_STALE)) {\r
 \r
-        if (ft_cred_expiry > ft_current) {\r
-            tmr_update(cred, KHUI_TTYPE_CRED_EXP, ft_cred_expiry,\r
+        if (CompareFileTime(&ft_cred_expiry, &ft_current) > 0) {\r
+            tmr_update(cred, KHUI_TTYPE_CRED_EXP,\r
+                       FtToInt(&ft_cred_expiry),\r
                        0, 0,\r
-                       ft_cred_expiry > ft_current + ft_reinst);\r
+                       CompareFileTime(&ft_cred_expiry, &ft_creinst) > 0);\r
         }\r
     }\r
 \r
@@ -618,9 +640,9 @@ tmr_purge(void) {
 void \r
 khm_timer_refresh(HWND hwnd) {\r
     int i;\r
-    __int64 next_event = 0;\r
-    __int64 curtime;\r
-    __int64 diff;\r
+    unsigned __int64 next_event = 0;\r
+    unsigned __int64 curtime;\r
+    unsigned __int64 diff;\r
 \r
     EnterCriticalSection(&cs_timers);\r
 \r
@@ -655,19 +677,23 @@ khm_timer_refresh(HWND hwnd) {
     }\r
 \r
     if (next_event != 0) {\r
-        GetSystemTimeAsFileTime((LPFILETIME) &curtime);\r
+        FILETIME ft;\r
+\r
+        GetSystemTimeAsFileTime(&ft);\r
+        curtime = FtToInt(&ft);\r
 \r
-        TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR_SMALL,\r
-                                (LPFILETIME) &diff);\r
+        TimetToFileTimeInterval(KHUI_TIMEEQ_ERROR_SMALL, &ft);\r
+        diff = FtToInt(&ft);\r
 \r
         if (curtime + diff > next_event) {\r
             tmr_fire_timer();\r
             goto _check_next_event;\r
         } else {\r
             diff = next_event - curtime;\r
+            ft = IntToFt(diff);\r
             SetTimer(hwnd,\r
                      KHUI_TRIGGER_TIMER_ID,\r
-                     FtIntervalToMilliseconds((LPFILETIME) &diff),\r
+                     FtIntervalToMilliseconds(&ft),\r
                      NULL);\r
         }\r
     }\r
index 3a57917214d01d3876e63cf089ae2fb111f912e9..081d27852da9565033f266557f6e65338176911c 100644 (file)
@@ -58,8 +58,8 @@ typedef struct tag_khui_timer_event {
     khm_handle       key;\r
     khui_timer_type  type;\r
 \r
-    __int64          expire;    /* time at which the timer expires */\r
-    __int64          offset;    /* time offset at which the event that\r
+    unsigned __int64 expire;    /* time at which the timer expires */\r
+    unsigned __int64 offset;    /* time offset at which the event that\r
                                    the timer warns of happens */\r
     void *           data;\r
     khm_int32        flags;\r
index fcc0d9ebd79389ffc5fb024a864eaaaf06a1c162..801d6cc52caf246278cde58f31f6cf5333a7d263 100644 (file)
@@ -368,6 +368,6 @@ void khm_create_standard_toolbar(HWND rebar) {
 \r
     SendMessage(rebar,\r
         RB_INSERTBAND,\r
-        1,\r
+        0,\r
         (LPARAM) &rbi);\r
 }\r
index eeb44bbd38c659a981750279f24b00a09b519dd2..14057ddedb7a61b29dc804eeeda331e0e248424f 100644 (file)
@@ -2,7 +2,7 @@ Name,Type,Value,Description
 CredWindow,KC_SPACE,0,Options for the credentials window\r
   AutoInit,KC_INT32,0,Prompt for creds if there arent any\r
   AutoStart,KC_INT32,0,Start Khimaira when Windows starts\r
-  AutoImport,KC_INT32,0,Import Windows creds when Khimaira starts\r
+  AutoImport,KC_INT32,1,Import Windows creds when Khimaira starts\r
   AutoDetectNet,KC_INT32,1,Automatically detect network connectivity changes\r
   KeepRunning,KC_INT32,1,Keep running after closing Khimaira\r
   DefaultView,KC_STRING,ByIdentity,\r
@@ -11,6 +11,7 @@ CredWindow,KC_SPACE,0,Options for the credentials window
   PaddingVertical,KC_INT32,2,\r
   PaddingHeader,KC_INT32,16,\r
   Monitor,KC_INT32,1,Monitor credentials\r
+  DefaultMonitor,KC_INT32,1,Default Monitor value for new identities\r
   RefreshTimeout,KC_INT32,60,In seconds\r
   WarnThreshold,KC_INT32,900,In seconds\r
   AllowWarn,KC_INT32,1,Boolean. Enables warning.\r
@@ -18,6 +19,8 @@ CredWindow,KC_SPACE,0,Options for the credentials window
   AllowCritical,KC_INT32,1,Boolean. Enables critical.\r
   AutoRenewThreshold,KC_INT32,600,In seconds\r
   AllowAutoRenew,KC_INT32,1,Boolean.\r
+  DefaultAllowAutoRenew,KC_INT32,1,Default AllowAutoRenew value for new identities\r
+  DefaultSticky,KC_INT32,0,Default Sticky value for new identities\r
   MaxThreshold,KC_INT32,86400,Max value for a threshold (1 day)\r
   MinThreshold,KC_INT32,10,Min value for a threshold (0)\r
   Windows,KC_SPACE,0,Window parameters\r
@@ -35,16 +38,16 @@ CredWindow,KC_SPACE,0,Options for the credentials window
    Custom_0,KC_ENDSPACE,0,\r
    ByIdentity,KC_SPACE,0,The default view\r
     Description,KC_STRING,View grouped by identity and credential type,\r
-    ColumnList,KC_STRING,"_CWFlags,_CWTypeIcon,IdentityName,TypeName,Name,TimeLeft",\r
+    ColumnList,KC_STRING,"_CWFlags,IdentityName,TypeName,Name,TimeLeft",\r
     Columns,KC_SPACE,0,Columns\r
       _CWFlags,KC_SPACE,0,\r
         Width,KC_INT32,20,\r
        Flags,KC_INT32,112,\r
       _CWFlags,KC_ENDSPACE,0,\r
-      _CWTypeIcon,KC_SPACE,0,\r
-        Width,KC_INT32,20,\r
-       Flags,KC_INT32,112,\r
-      _CWTypeIcon,KC_ENDSPACE,0,\r
+#      _CWTypeIcon,KC_SPACE,0,\r
+#        Width,KC_INT32,20,\r
+#      Flags,KC_INT32,112,\r
+#      _CWTypeIcon,KC_ENDSPACE,0,\r
       IdentityName,KC_SPACE,0,\r
         Width,KC_INT32,100,\r
         SortIndex,KC_INT32,0,\r
@@ -68,16 +71,16 @@ CredWindow,KC_SPACE,0,Options for the credentials window
    ByIdentity,KC_ENDSPACE,0\r
    ByLocation,KC_SPACE,0,View by location\r
     Description,KC_STRING,View grouped by location,\r
-    ColumnList,KC_STRING,"_CWFlags,_CWTypeIcon,Location,IdentityName,TypeName,Name,TimeLeft",\r
+    ColumnList,KC_STRING,"_CWFlags,Location,IdentityName,TypeName,Name,TimeLeft",\r
     Columns,KC_SPACE,0,Columns\r
       _CWFlags,KC_SPACE,0,\r
         Width,KC_INT32,20,\r
        Flags,KC_INT32,112,\r
       _CWFlags,KC_ENDSPACE,0,\r
-      _CWTypeIcon,KC_SPACE,0,\r
-        Width,KC_INT32,20,\r
-       Flags,KC_INT32,112,\r
-      _CWTypeIcon,KC_ENDSPACE,0,\r
+#      _CWTypeIcon,KC_SPACE,0,\r
+#        Width,KC_INT32,20,\r
+#      Flags,KC_INT32,112,\r
+#      _CWTypeIcon,KC_ENDSPACE,0,\r
       Location,KC_SPACE,0,\r
         Width,KC_INT32,100,\r
         SortIndex,KC_INT32,0,\r
index 05b9455149aa68ab5a76ed1689ce35a57f28c856..a97b37ba46044d7a4c9526a12ad8563f736469f8 100644 (file)
@@ -15,4 +15,7 @@ KHUI_ACTION_DESTROY_CRED,FVIRTKEY,VK_DELETE,KHUI_ACCEL_SCOPE_GLOBAL
 KHUI_ACTION_EXIT,FCONTROL|FVIRTKEY,\'X\',KHUI_ACCEL_SCOPE_GLOBAL\r
 KHUI_ACTION_VIEW_REFRESH,FVIRTKEY,VK_F5,KHUI_ACCEL_SCOPE_GLOBAL\r
 KHUI_ACTION_NEW_CRED,FCONTROL|FVIRTKEY,\'N\',KHUI_ACCEL_SCOPE_GLOBAL\r
+KHUI_ACTION_RENEW_CRED,FCONTROL|FVIRTKEY,\'R\',KHUI_ACCEL_SCOPE_GLOBAL\r
+KHUI_ACTION_IMPORT,FCONTROL|FVIRTKEY,\'I\',KHUI_ACCEL_SCOPE_GLOBAL\r
+KHUI_ACTION_DESTROY_CRED,FCONTROL|FVIRTKEY,\'D\',KHUI_ACCEL_SCOPE_GLOBAL\r
 KHUI_PACTION_SELALL,FCONTROL|FVIRTKEY,\'A\',KHUI_ACCEL_SCOPE_GLOBAL\r
index 0ebb9ae0c0ff040b71c695507b195406092b5c39..b337eb8944e2269fb6cdbb6e767013e5af8869c1 100644 (file)
@@ -49,14 +49,13 @@ khui_action_ref khui_menu_cred[] = {
     MENU_ACTION(KHUI_ACTION_NEW_CRED),\r
     MENU_SEP(),\r
     MENU_ACTION(KHUI_ACTION_RENEW_CRED),\r
+    MENU_ACTION(KHUI_ACTION_IMPORT),\r
     MENU_ACTION(KHUI_ACTION_DESTROY_CRED),\r
     MENU_SEP(),\r
     MENU_ACTION(KHUI_ACTION_SET_DEF_ID),\r
     MENU_ACTION(KHUI_ACTION_SET_SRCH_ID),\r
     MENU_SEP(),\r
     MENU_ACTION(KHUI_ACTION_PASSWD_ID),\r
-    MENU_SEP(),\r
-    MENU_ACTION(KHUI_ACTION_IMPORT),\r
     MENU_END()\r
 };\r
 \r
@@ -87,6 +86,7 @@ khui_action_ref khui_menu_options[] = {
     MENU_ACTION(KHUI_ACTION_OPT_KHIM),\r
     MENU_ACTION(KHUI_ACTION_OPT_IDENTS),\r
     MENU_ACTION(KHUI_ACTION_OPT_NOTIF),\r
+    MENU_ACTION(KHUI_ACTION_OPT_PLUGINS),\r
     MENU_END()\r
 };\r
 \r
index 371fb8798ebd1cfcc441a97e546e73f723d19128..dd4949849585a44eaaf0a1a386a69f49e52a6487 100644 (file)
@@ -17,13 +17,14 @@ KHUI_ACTION_DESTROY_CRED,KHUI_ACTIONTYPE_TRIGGER,,IDB_TK_DELETE,0,IDB_TK_DELETE_
 KHUI_ACTION_LAYOUT_ID,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_LAYOUT_ID,0,0,KHUI_ACTIONSTATE_CHECKED\r
 KHUI_ACTION_LAYOUT_TYPE,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_LAYOUT_TYPE,0,0,KHUI_ACTIONSTATE_DISABLED\r
 KHUI_ACTION_LAYOUT_LOC,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_LAYOUT_LOC,0,0,0\r
-KHUI_ACTION_TB_STANDARD,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_TB_STANDARD,0,0,KHUI_ACTIONSTATE_CHECKED\r
+KHUI_ACTION_TB_STANDARD,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_TB_STANDARD,0,0,KHUI_ACTIONSTATE_CHECKED|KHUI_ACTIONSTATE_DISABLED\r
 KHUI_ACTION_CHOOSE_COLS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_CHOOSE_COLS,0,IDH_ACTION_CHOOSE_COLS,KHUI_ACTIONSTATE_DISABLED\r
 KHUI_ACTION_DEBUG_WINDOW,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_DEBUG_WINDOW,0,IDH_ACTION_DEBUG_WINDOW,KHUI_ACTIONSTATE_DISABLED\r
 KHUI_ACTION_VIEW_REFRESH,KHUI_ACTIONTYPE_TRIGGER,,IDB_VW_REFRESH,0,0,IDB_VW_REFRESH_SM,0,IDS_ACTION_VIEW_REFRESH,0,IDH_ACTION_VIEW_REFRESH,0\r
 KHUI_ACTION_OPT_IDENTS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_IDENTS,0,IDH_ACTION_OPT_INIT,0\r
 KHUI_ACTION_OPT_KHIM,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_KHIM,0,IDH_ACTION_OPT_KHIM,0\r
 KHUI_ACTION_OPT_NOTIF,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_NOTIF,0,IDH_ACTION_OPT_NOTIF,0\r
+KHUI_ACTION_OPT_PLUGINS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPT_PLUGINS,0,IDH_ACTION_OPT_KHIM,0\r
 KHUI_ACTION_HELP_CTX,KHUI_ACTIONTYPE_TRIGGER,,IDB_HELP,0,0,IDB_HELP_SM,0,IDS_ACTION_HELP_CTX,0,0,0\r
 KHUI_ACTION_HELP_CONTENTS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_HELP_CONTENTS,0,0,0\r
 KHUI_ACTION_HELP_INDEX,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_HELP_INDEX,0,0,0\r
index 2cb4e92f991d71c0a712fdbe86f7b68bd1de700c..dae98ff680cd8666f05a9fbdd14a78f4fda42b9f 100644 (file)
@@ -342,7 +342,7 @@ cw_create_prompt(khm_size idx,
         StringCbCopy(p->prompt, cb_prompt, prompt);\r
     }\r
 \r
-    if(def) {\r
+    if(def && cb_def > 0) {\r
         cb_def += sizeof(wchar_t);\r
         p->def = PMALLOC(cb_def);\r
         StringCbCopy(p->def, cb_def, def);\r
index b880721b63ca2f9eb31ddd6783038a96b2f5b9c1..3f1c4307380bb62879fd485913ad3bfb1cff3c66 100644 (file)
@@ -62,6 +62,7 @@
 #define KHUI_ACTION_MENU_ACTIVATE   (KHUI_ACTION_BASE + 26)\r
 #define KHUI_ACTION_CLOSE_APP   (KHUI_ACTION_BASE + 27)\r
 #define KHUI_ACTION_IMPORT      (KHUI_ACTION_BASE + 28)\r
+#define KHUI_ACTION_OPT_PLUGINS (KHUI_ACTION_BASE + 29)\r
 /*@}*/\r
 \r
 /*! \name Pseudo actions \r
index ff693b3b157a5aae317fd60cb0b7340e80502c3b..257434454388ad0a2cd85b33db0b1db6c90fba9f 100644 (file)
@@ -229,6 +229,10 @@ typedef struct tag_khui_new_creds {
 \r
     CRITICAL_SECTION cs;\r
 \r
+    khm_boolean set_default;    /*!< After a successfull credentials\r
+                                  acquisition, set the primary\r
+                                  identity as the default. */\r
+\r
     khm_handle  *identities;    /*!< The list of identities associated\r
                                   with this request.  The first\r
                                   identity in this list (\a\r
index accff416bd3afd65c291b4a08f0fd8c431feda75..5de877da611c1659c3d4e7b85188e39edc8654fc 100644 (file)
@@ -33,7 +33,7 @@
   @{*/\r
 \r
 /* Leash compatibility */\r
-#define ID_OBTAIN_TGT_WITH_LPARAM       32809\r
+#define ID_OBTAIN_TGT_WITH_LPARAM       32810\r
 \r
 #define KHUI_REQDAEMONWND_CLASS L"IDMgrRequestDaemonCls"\r
 #define KHUI_REQDAEMONWND_NAME  L"IDMgrRequestDaemon"\r
@@ -43,7 +43,7 @@
 #define NETID_USERNAME_SZ       128\r
 #define NETID_REALM_SZ          192\r
 #define NETID_TITLE_SZ          256\r
-#define NETID_CCACHE_NAME_SZ  264\r
+#define NETID_CCACHE_NAME_SZ    264\r
   \r
 #define NETID_DLGTYPE_TGT      0\r
 #define NETID_DLGTYPE_CHPASSWD 1\r
index d1b02e64ffd6b903635b6b731a7e824e39c31a58..1a4233d518a48246c5fc63c785dec8e2b12d089d 100644 (file)
@@ -44,7 +44,7 @@ KHMEXP hashtable * KHMAPI hash_new_hashtable(khm_int32 n,
     h->delr = delr;\r
     h->hash = hash;\r
 \r
-    h->bins = calloc(sizeof(hash_bin *), n);\r
+    h->bins = PCALLOC(sizeof(hash_bin *), n);\r
 \r
     return h;\r
 }\r
index 2ddcedb2c6fa734a1f4d3b4a87c960e77b73e5c9..814920dce67b76703a7d034ae1a531228434df8b 100644 (file)
@@ -125,6 +125,22 @@ perf_strdup(char * file, int line, const char * str) {
     return dest;\r
 }\r
 \r
+KHMEXP void *\r
+perf_calloc(char * file, int line, size_t num, size_t size) {\r
+    void * ptr;\r
+    size_t tsize;\r
+\r
+    tsize = num * size;\r
+\r
+    ptr = perf_malloc(file,line,tsize);\r
+\r
+    if (ptr) {\r
+        ZeroMemory(ptr, tsize);\r
+    }\r
+\r
+    return ptr;\r
+}\r
+\r
 KHMEXP void * \r
 perf_malloc(char * file, int line, size_t s) {\r
     allocation * a;\r
index ad620fd575f4b1d0497cd05735b312552b37ebc1..d8d5951b3671bf49252c1f01f3abaff0eab3d2a6 100644 (file)
@@ -31,6 +31,7 @@
 \r
 #ifdef DEBUG\r
 #define PMALLOC(s) perf_malloc(__FILE__,__LINE__,s)\r
+#define PCALLOC(n,s) perf_calloc(__FILE__,__LINE__,n,s)\r
 #define PREALLOC(d,s) perf_realloc(__FILE__,__LINE__,d,s)\r
 #define PFREE(p)   perf_free(p)\r
 #define PDUMP(f)   perf_dump(f)\r
@@ -38,6 +39,7 @@
 #define PSTRDUP(s) perf_strdup(__FILE__,__LINE__,s)\r
 #else\r
 #define PMALLOC(s) malloc(s)\r
+#define PCALLOC(n,s) calloc(n,s)\r
 #define PREALLOC(d,s) realloc(d,s)\r
 #define PFREE(p)   free(p)\r
 #define PDUMP(f)   ((void) 0)\r
@@ -63,4 +65,7 @@ perf_wcsdup(char * file, int line, const wchar_t * str);
 KHMEXP char *\r
 perf_strdup(char * file, int line, const char * str);\r
 \r
+KHMEXP void *\r
+perf_calloc(char * file, int line, size_t num, size_t size);\r
+\r
 #endif\r