pull up r19077 from trunk
authorTom Yu <tlyu@mit.edu>
Fri, 30 Mar 2007 00:34:24 +0000 (00:34 +0000)
committerTom Yu <tlyu@mit.edu>
Fri, 30 Mar 2007 00:34:24 +0000 (00:34 +0000)
 r19077@cathode-dark-space:  jaltman | 2007-01-20 00:42:30 -0500
 ticket: new
 subject: NIM - Context sensitive system tray menu and more
 component: windows

   Adds context sensitive menus for renew and destroy
  to the system tray menu.  Select either all identities
     or one of the identities with credentials.

  Increases the API to 1.1.9 and adds a new interactive
  callback mechanism.

ticket: 5408
version_fixed: 1.6.1

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19319 dc483132-0cff-0310-8789-dd5450dbe970

24 files changed:
src/windows/identity/apiversion.txt
src/windows/identity/config/Makefile.w2k
src/windows/identity/config/Makefile.w32
src/windows/identity/doc/footer.html
src/windows/identity/doc/main_page.h
src/windows/identity/kcreddb/identity.c
src/windows/identity/plugins/common/dynimport.c
src/windows/identity/ui/credfuncs.c
src/windows/identity/ui/credfuncs.h
src/windows/identity/ui/intaction.h [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/reqdaemon.c
src/windows/identity/ui/resource.h
src/windows/identity/ui/toolbar.c
src/windows/identity/ui/uibind.c [new file with mode: 0644]
src/windows/identity/uilib/action.c
src/windows/identity/uilib/actions.csv
src/windows/identity/uilib/khactiondef.h
src/windows/identity/uilib/khuidefs.h

index 4399861e8e89a62bb51063b0d2195165e5859cea..9681ccc1c84c884f1c4ee19d754d42d19cb15b38 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright (c) 2004 Massachusetts Institute of Technology\r
+# Copyright (c) 2007 Secure Endpoints Inc.\r
 #\r
 # Permission is hereby granted, free of charge, to any person\r
 # obtaining a copy of this software and associated documentation files\r
@@ -214,3 +215,13 @@ Date=(TBD)
 \r
 +KCDB_OP_DELCONFIG\r
 # notification that the configuration information for an identity is to be removed.\r
+\r
+\r
+#----------------------------------------------------------------\r
+Version=7\r
+AppVersion=1.1.9.0\r
+Date=(TBD)\r
+# Released with KFW 3.2.0\r
+\r
++KHUI_ACTION_UICB\r
+# Internal action to dispatch a UI callback
\ No newline at end of file
index b9902bd903d7e967e63299ef53e9f2c0b6e85ac1..f2977786c52772af1930bb2722867b9b92bdde0d 100644 (file)
@@ -4,7 +4,7 @@
 #             in the build tree.\r
 #\r
 # Copyright (c) 2004,2005,2006 Massachusetts Institute of Technology\r
-# Copyright (c) 2006 Secure Endpoints Inc.\r
+# Copyright (c) 2006,2007 Secure Endpoints Inc.\r
 #\r
 # Permission is hereby granted, free of charge, to any person\r
 # obtaining a copy of this software and associated documentation files\r
@@ -47,7 +47,7 @@ KHIMAIRA_WIN32_CONFIG=1
 # Version info\r
 NETIDMGR_VERSION_MAJOR=1\r
 NETIDMGR_VERSION_MINOR=1\r
-NETIDMGR_VERSION_PATCH=8\r
+NETIDMGR_VERSION_PATCH=9\r
 NETIDMGR_VERSION_AUX=0\r
 NETIDMGR_RELEASEDESC=\r
 \r
@@ -58,7 +58,7 @@ NETIDMGR_RELEASEDESC=
 #\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=6\r
+NETIDMGR_VERSION_API=7\r
 \r
 # Minimum backwards compatible version.  API versions from\r
 # NETIDMGR_VERSION_API_MINCOMPAT through NETIDMGR_VERSION_API\r
index 8ede1dbae09b615e34280765adcfe566044f807a..e327a707555e5c1aa368000ef5d40ba4ce9166e5 100644 (file)
@@ -4,7 +4,7 @@
 #             in the build tree.\r
 #\r
 # Copyright (c) 2004,2005,2006 Massachusetts Institute of Technology\r
-# Copyright (c) 2006 Secure Endpoints Inc.\r
+# Copyright (c) 2006,2007 Secure Endpoints Inc.\r
 #\r
 # Permission is hereby granted, free of charge, to any person\r
 # obtaining a copy of this software and associated documentation files\r
@@ -47,7 +47,7 @@ KHIMAIRA_WIN32_CONFIG=1
 # Version info\r
 NETIDMGR_VERSION_MAJOR=1\r
 NETIDMGR_VERSION_MINOR=1\r
-NETIDMGR_VERSION_PATCH=8\r
+NETIDMGR_VERSION_PATCH=9\r
 NETIDMGR_VERSION_AUX=0\r
 NETIDMGR_RELEASEDESC=\r
 \r
@@ -58,7 +58,7 @@ NETIDMGR_RELEASEDESC=
 #\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=6\r
+NETIDMGR_VERSION_API=7\r
 \r
 # Minimum backwards compatible version.  API versions from\r
 # NETIDMGR_VERSION_API_MINCOMPAT through NETIDMGR_VERSION_API\r
index 13314c2b04e912a78a5201808eea4d3d57e22a0b..fb3b621ce9e663cbad1553809f85c45ce8aaee56 100644 (file)
@@ -5,7 +5,7 @@
     <td>\r
       <address style="align:right;">\r
         <small>Generated on $datetime for $projectname $projectnumber by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a> $doxygenversion<br>\r
-       &copy; 2004 Massachusetts Institute of Technology. Contact <a href="mailto:khimaira@mit.edu">khimaira@mit.edu</a><br>\r
+       &copy; 2004-2007 Massachusetts Institute of Technology. Contact <a href="mailto:khimaira@mit.edu">khimaira@mit.edu</a><br>\r
        </small>\r
       </address>\r
     </td>\r
index 415a8e3f3a9bb871c6d68b2f9dc2f9c274aa45ab..34b3d1d72cd99ae317dd9abb53a6e40260a33157 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -39,7 +40,7 @@
     - \subpage bugs\r
     - \subpage releases\r
 \r
-    &copy; 2004 Massachusetts Institute of Technology\r
+    &copy; 2004-2007 Massachusetts Institute of Technology\r
 */\r
 \r
 /*!\r
@@ -49,7 +50,7 @@
 \r
     \section license_l MIT License\r
 \r
-    Copyright &copy; 2004 Massachusetts Institute of Technology\r
+    Copyright &copy; 2004,2005,2006,2007 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\r
index 6057b6f2c238a5cee70da9ae4f7f76731c0d0b90..3f6020682ac8124e4f131d10ba82bdfa6e1a8554 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -998,9 +999,8 @@ kcdb_identity_get_attr(khm_handle vid,
         /* we should never hit this case */\r
 #ifdef DEBUG\r
         assert(FALSE);\r
-#else\r
-        code = KHM_ERROR_INVALID_OPERATION;\r
 #endif\r
+        code = KHM_ERROR_INVALID_OPERATION;\r
     } else {\r
 #endif\r
         code = type->dup(\r
@@ -1091,9 +1091,8 @@ kcdb_identity_get_attr_string(khm_handle vid,
     if(attrib->flags & KCDB_ATTR_FLAG_COMPUTED) {\r
 #ifdef DEBUG\r
         assert(FALSE);\r
-#else\r
-        code = KHM_ERROR_INVALID_OPERATION;\r
 #endif\r
+        code = KHM_ERROR_INVALID_OPERATION;\r
     } else {\r
 #endif\r
         if(kcdb_buf_exist(&id->buf, slot)) {\r
index 311e4cf9336870e813bbcc84a185b07445aaa45c..b3d764476052dfc770074dd21c8d390a7cd787d9 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
 * Copyright (c) 2005 Massachusetts Institute of Technology\r
+* Copyright (c) 2007 Secure Endpoints Inc.\r
 *\r
 * Permission is hereby granted, free of charge, to any person\r
 * obtaining a copy of this software and associated documentation\r
@@ -25,8 +26,7 @@
 /* $Id$ */\r
 \r
 #include<windows.h>\r
-#include<khdefs.h>\r
-#include<kherror.h>\r
+#include<netidmgr.h>\r
 #include<dynimport.h>\r
 \r
 HINSTANCE hKrb4 = 0;\r
@@ -364,30 +364,36 @@ khm_int32 init_imports(void) {
     OSVERSIONINFO osvi;\r
     int imp_rv = 1;\r
 \r
-#define CKRV if(!imp_rv) goto _err_ret\r
+#define CKRV(m)           \\r
+  do {                    \\r
+    if(!imp_rv) {         \\r
+      _reportf(L"Can't locate all required exports from module [%S]", (m)); \\r
+      goto _err_ret;      \\r
+    }                     \\r
+ } while (FALSE)\r
 \r
 #ifndef _WIN64\r
     imp_rv = LoadFuncs(KRB4_DLL, k4_fi, &hKrb4, 0, 1, 0, 0);\r
-    CKRV;\r
+    CKRV(KRB4_DLL);\r
 #endif\r
 \r
     imp_rv = LoadFuncs(KRB5_DLL, k5_fi, &hKrb5, 0, 1, 0, 0);\r
-    CKRV;\r
+    CKRV(KRB5_DLL);\r
 \r
     imp_rv = LoadFuncs(COMERR_DLL, ce_fi, &hComErr, 0, 0, 1, 0);\r
-    CKRV;\r
+    CKRV(COMERR_DLL);\r
 \r
     imp_rv = LoadFuncs(SERVICE_DLL, service_fi, &hService, 0, 1, 0, 0);\r
-    CKRV;\r
+    CKRV(SERVICE_DLL);\r
 \r
     imp_rv = LoadFuncs(SECUR32_DLL, lsa_fi, &hSecur32, 0, 1, 1, 1);\r
-    CKRV;\r
+    CKRV(SECUR32_DLL);\r
 \r
     imp_rv = LoadFuncs(KRB524_DLL, k524_fi, &hKrb524, 0, 1, 1, 1);\r
-    CKRV;\r
+    CKRV(KRB524_DLL);\r
 \r
     imp_rv = LoadFuncs(PROFILE_DLL, profile_fi, &hProfile, 0, 1, 0, 0);\r
-    CKRV;\r
+    CKRV(PROFILE_DLL);\r
 \r
     imp_rv = LoadFuncs(CCAPI_DLL, ccapi_fi, &hCCAPI, 0, 1, 0, 0);\r
     /* CCAPI_DLL is optional.  No error check. */\r
@@ -405,7 +411,7 @@ khm_int32 init_imports(void) {
     {\r
         // Windows 9x\r
         imp_rv = LoadFuncs(TOOLHELPDLL, toolhelp_fi, &hToolHelp32, 0, 1, 0, 0);\r
-        CKRV;\r
+        CKRV(TOOLHELPDLL);\r
 \r
         hPsapi = 0;\r
     }             \r
@@ -413,7 +419,7 @@ khm_int32 init_imports(void) {
     {\r
         // Windows NT\r
         imp_rv = LoadFuncs(PSAPIDLL, psapi_fi, &hPsapi, 0, 1, 0, 0);\r
-        CKRV;\r
+        CKRV(PSAPIDLL);\r
 \r
         hToolHelp32 = 0;\r
     }\r
index 530ef08521f54feaffc40f565aba0cf8d9d81f1c..dcb70480ed69b92586c49c49a46555b82ff3fde3 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -504,6 +505,41 @@ void khm_cred_destroy_creds(khm_boolean sync, khm_boolean quiet)
     _end_task();\r
 }\r
 \r
+void khm_cred_destroy_identity(khm_handle identity)\r
+{\r
+    khui_action_context * pctx;\r
+    wchar_t idname[KCDB_IDENT_MAXCCH_NAME];\r
+    khm_size cb;\r
+\r
+    if (identity == NULL)\r
+        return;\r
+\r
+    pctx = PMALLOC(sizeof(*pctx));\r
+#ifdef DEBUG\r
+    assert(pctx);\r
+#endif\r
+\r
+    khui_context_create(pctx,\r
+                        KHUI_SCOPE_IDENT,\r
+                        identity,\r
+                        KCDB_CREDTYPE_INVALID,\r
+                        NULL);\r
+\r
+    cb = sizeof(idname);\r
+    kcdb_identity_get_name(identity, idname, &cb);\r
+\r
+    _begin_task(KHERR_CF_TRANSITIVE);\r
+    _report_sr1(KHERR_NONE, IDS_CTX_DESTROY_ID, _dupstr(idname));\r
+    _describe();\r
+\r
+    kmq_post_message(KMSG_CRED,\r
+                     KMSG_CRED_DESTROY_CREDS,\r
+                     0,\r
+                     (void *) pctx);\r
+\r
+    _end_task();\r
+}\r
+\r
 void khm_cred_renew_identity(khm_handle identity)\r
 {\r
     khui_new_creds * c;\r
index 677d27945d4139e2df9adf2bd302a903b49ea958..379573ff523a38b7425f66a57d1d9ccf16a613ab 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -34,6 +35,9 @@ void
 khm_cred_destroy_creds(khm_boolean sync,\r
                        khm_boolean quiet);\r
 \r
+void\r
+khm_cred_destroy_identity(khm_handle identity);\r
+\r
 void \r
 khm_cred_renew_identity(khm_handle identity);\r
 \r
diff --git a/src/windows/identity/ui/intaction.h b/src/windows/identity/ui/intaction.h
new file mode 100644 (file)
index 0000000..2b4a66a
--- /dev/null
@@ -0,0 +1,44 @@
+/*\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person\r
+ * obtaining a copy of this software and associated documentation\r
+ * files (the "Software"), to deal in the Software without\r
+ * restriction, including without limitation the rights to use, copy,\r
+ * modify, merge, publish, distribute, sublicense, and/or sell copies\r
+ * of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be\r
+ * included in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+/* $Id$ */\r
+\r
+#ifndef __NETIDMGR_ACTION_H_INTERNAL\r
+#define __NETIDMGR_ACTION_H_INTERNAL\r
+\r
+/* Internal declarations for exports and data structured used in\r
+   nidmgr32.dll and netidmgr.exe */\r
+\r
+extern HWND khui_hwnd_main;\r
+\r
+typedef struct tag_khui_ui_callback_data {\r
+    khm_int32       magic;\r
+    khm_ui_callback cb;\r
+    void *          rock;\r
+    khm_int32       rv;\r
+} khui_ui_callback_data;\r
+\r
+#define KHUI_UICBDATA_MAGIC 0x8a08572a\r
+\r
+#endif\r
index 96e8de6a5205807ef018ab33d537fbfdedcefed1..862872daea89abacbd6c295e7f3beb6b6fc9ad04 100644 (file)
@@ -782,6 +782,13 @@ STRINGTABLE
 BEGIN\r
     IDS_NC_REN_FAILED_TITLE_I "Failed to renew creds for %s"\r
     IDS_CFG_IDNAME_NON      "No identity selected.  Please select an identity and try again."\r
+    IDS_MENU_DESTROY_CRED   "Destroy ..."\r
+    IDS_MENU_RENEW_CRED     "Renew ..."\r
+    IDS_ACTION_DESTROY_ALL  "All identities"\r
+    IDS_ACTION_RENEW_ALL    "All identities"\r
+    IDS_IDACTION_RENEW      "Renew credentials for %s"\r
+    IDS_IDACTION_DESTROY    "Destroy credentials for %s"\r
+    IDS_CTX_DESTROY_ID      "Destroying identity %1!s!"\r
 END\r
 \r
 #endif    // English (U.S.) resources\r
index e2210782f4520f57896d9213228891b0d306ad7a..c05fa6b7fa4393b5eeef767a80f224108604b775 100644 (file)
@@ -352,10 +352,11 @@ int _n_ui_propsheets = 0;
 void khm_add_property_sheet(khui_property_sheet * s) {\r
     if(_n_ui_propsheets < MAX_UI_PROPSHEETS)\r
         _ui_propsheets[_n_ui_propsheets++] = s;\r
+    else {\r
 #ifdef DEBUG\r
-    else\r
         assert(FALSE);\r
 #endif\r
+    }\r
 }\r
 \r
 void khm_del_property_sheet(khui_property_sheet * s) {\r
index fc3a64b0c97cbda9644d729e16f79b02e8d0a715..c99cafafd26df22776ce8dc8dbcf0353dddfe517 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -561,6 +562,289 @@ LRESULT khm_menu_notify_main(LPNMHDR notice) {
     return ret;\r
 }\r
 \r
+struct identity_action_map {\r
+    khm_handle identity;\r
+    khm_int32  renew_cmd;\r
+    khm_int32  destroy_cmd;\r
+    int        refreshcycle;\r
+};\r
+\r
+#define IDMAP_ALLOC_INCR 8\r
+\r
+struct identity_action_map * id_action_map = NULL;\r
+khm_size n_id_action_map  = 0;\r
+khm_size nc_id_action_map = 0;\r
+\r
+int idcmd_refreshcycle = 0;\r
+\r
+static struct identity_action_map *\r
+create_identity_cmd_map(khm_handle ident) {\r
+\r
+    struct identity_action_map * actmap;\r
+    wchar_t idname[KCDB_IDENT_MAXCCH_NAME];\r
+    wchar_t fmt[128];\r
+    wchar_t tooltip[KHUI_MAXCCH_SHORT_DESC];\r
+    khm_size cb;\r
+\r
+    if (n_id_action_map + 1 > nc_id_action_map) {\r
+        nc_id_action_map = UBOUNDSS(n_id_action_map + 1,\r
+                                    IDMAP_ALLOC_INCR,\r
+                                    IDMAP_ALLOC_INCR);\r
+#ifdef DEBUG\r
+        assert(nc_id_action_map > n_id_action_map + 1);\r
+#endif\r
+        id_action_map = PREALLOC(id_action_map,\r
+                                 nc_id_action_map * sizeof(id_action_map[0]));\r
+#ifdef DEBUG\r
+        assert(id_action_map);\r
+#endif\r
+        ZeroMemory(&id_action_map[n_id_action_map],\r
+                   sizeof(id_action_map[0]) * (nc_id_action_map - n_id_action_map));\r
+    }\r
+\r
+    actmap = &id_action_map[n_id_action_map];\r
+    n_id_action_map++;\r
+\r
+    cb = sizeof(idname);\r
+    kcdb_identity_get_name(ident, idname, &cb);\r
+\r
+    actmap->identity = ident;\r
+    kcdb_identity_hold(ident);\r
+\r
+    fmt[0] = L'\0';\r
+    LoadString(khm_hInstance, IDS_IDACTION_RENEW,\r
+               fmt, ARRAYLENGTH(fmt));\r
+    StringCbPrintf(tooltip, sizeof(tooltip), fmt, idname);\r
+\r
+    actmap->renew_cmd =\r
+        khui_action_create(NULL, idname, tooltip, NULL,\r
+                           KHUI_ACTIONTYPE_TRIGGER, NULL);\r
+\r
+    fmt[0] = L'\0';\r
+    LoadString(khm_hInstance, IDS_IDACTION_DESTROY,\r
+               fmt, ARRAYLENGTH(fmt));\r
+    StringCbPrintf(tooltip, sizeof(tooltip), fmt, idname);\r
+\r
+    actmap->destroy_cmd =\r
+        khui_action_create(NULL, idname, tooltip, NULL,\r
+                           KHUI_ACTIONTYPE_TRIGGER, NULL);\r
+\r
+    actmap->refreshcycle = idcmd_refreshcycle;\r
+\r
+    return actmap;\r
+}\r
+\r
+static void\r
+purge_identity_cmd_map(void) {\r
+    khm_size i;\r
+\r
+    for (i=0; i < n_id_action_map; i++) {\r
+        khm_handle ident;\r
+\r
+        if (id_action_map[i].refreshcycle != idcmd_refreshcycle) {\r
+            ident = id_action_map[i].identity;\r
+            id_action_map[i].identity = NULL;\r
+            kcdb_identity_release(ident);\r
+\r
+            khui_action_delete(id_action_map[i].renew_cmd);\r
+            khui_action_delete(id_action_map[i].destroy_cmd);\r
+\r
+            id_action_map[i].renew_cmd = 0;\r
+            id_action_map[i].destroy_cmd = 0;\r
+        }\r
+    }\r
+}\r
+\r
+static struct identity_action_map *\r
+get_identity_cmd_map(khm_handle ident) {\r
+    khm_size i;\r
+\r
+    for (i=0; i < n_id_action_map; i++) {\r
+        if (kcdb_identity_is_equal(id_action_map[i].identity,\r
+                                   ident))\r
+            break;\r
+    }\r
+\r
+    if (i < n_id_action_map) {\r
+        id_action_map[i].refreshcycle = idcmd_refreshcycle;\r
+        return &id_action_map[i];\r
+    } else {\r
+        return create_identity_cmd_map(ident);\r
+    }\r
+}\r
+\r
+static khm_int32\r
+get_identity_renew_command(khm_handle ident) {\r
+    struct identity_action_map * map;\r
+\r
+    map = get_identity_cmd_map(ident);\r
+\r
+    if (map)\r
+        return map->renew_cmd;\r
+    else\r
+        return 0;\r
+}\r
+\r
+static khm_int32\r
+get_identity_destroy_command(khm_handle ident) {\r
+    struct identity_action_map * map;\r
+\r
+    map = get_identity_cmd_map(ident);\r
+\r
+    if (map)\r
+        return map->destroy_cmd;\r
+    else\r
+        return 0;\r
+}\r
+\r
+void\r
+khm_refresh_identity_menus(void) {\r
+    khui_menu_def * renew_def = NULL;\r
+    khui_menu_def * dest_def = NULL;\r
+    wchar_t * idlist = NULL;\r
+    wchar_t * idname = NULL;\r
+    khm_size cb = 0;\r
+    khm_size n_idents = 0;\r
+    khm_size t;\r
+    khm_int32 rv = KHM_ERROR_SUCCESS;\r
+\r
+    idcmd_refreshcycle++;\r
+\r
+    do {\r
+        if (idlist)\r
+            PFREE(idlist);\r
+        idlist = NULL;\r
+        cb = 0;\r
+\r
+        rv = kcdb_identity_enum(KCDB_IDENT_FLAG_ACTIVE | KCDB_IDENT_FLAG_EMPTY,\r
+                                KCDB_IDENT_FLAG_ACTIVE,\r
+                                NULL,\r
+                                &cb,\r
+                                &n_idents);\r
+        if (rv != KHM_ERROR_TOO_LONG || cb == 0 || cb == sizeof(wchar_t) * 2)\r
+            break;\r
+\r
+        idlist = PMALLOC(cb);\r
+#ifdef DEBUG\r
+        assert(idlist);\r
+#endif\r
+\r
+        rv = kcdb_identity_enum(KCDB_IDENT_FLAG_ACTIVE | KCDB_IDENT_FLAG_EMPTY,\r
+                                KCDB_IDENT_FLAG_ACTIVE,\r
+                                idlist,\r
+                                &cb,\r
+                                &n_idents);\r
+        if (rv == KHM_ERROR_TOO_LONG)\r
+            continue;\r
+\r
+        if (KHM_FAILED(rv)) {\r
+            /* something else went wrong. hmm. */\r
+            if (idlist)\r
+                PFREE(idlist);\r
+            idlist = NULL;\r
+        }\r
+        break;\r
+\r
+    } while(TRUE);\r
+\r
+    renew_def = khui_find_menu(KHUI_MENU_RENEW_CRED);\r
+    dest_def = khui_find_menu(KHUI_MENU_DESTROY_CRED);\r
+#ifdef DEBUG\r
+    assert(renew_def);\r
+    assert(dest_def);\r
+#endif\r
+\r
+    t = khui_menu_get_size(renew_def);\r
+    while(t) {\r
+        khui_menu_remove_action(renew_def, 0);\r
+        t--;\r
+    }\r
+    khui_menu_insert_action(renew_def, 0, KHUI_ACTION_RENEW_ALL, 0);\r
+\r
+    t = khui_menu_get_size(dest_def);\r
+    while(t) {\r
+        khui_menu_remove_action(dest_def, 0);\r
+        t--;\r
+    }\r
+    khui_menu_insert_action(dest_def, 0, KHUI_ACTION_DESTROY_ALL, 0);\r
+\r
+    if (idlist != NULL && n_idents > 0) {\r
+        khui_menu_insert_action(renew_def, 1, KHUI_MENU_SEP, 0);\r
+        khui_menu_insert_action(dest_def,  1, KHUI_MENU_SEP, 0);\r
+    }\r
+\r
+    for (idname = idlist; idname && idname[0];\r
+         idname = multi_string_next(idname)) {\r
+        khm_handle identity = NULL;\r
+\r
+        if (KHM_FAILED(kcdb_identity_create(idname, 0, &identity))) {\r
+#ifdef DEBUG\r
+            assert(FALSE);\r
+#endif\r
+            continue;\r
+        }\r
+\r
+        khui_menu_insert_action(renew_def, 1000,\r
+                                get_identity_renew_command(identity),\r
+                                0);\r
+\r
+        khui_menu_insert_action(dest_def, 1000,\r
+                                get_identity_destroy_command(identity),\r
+                                0);\r
+    }\r
+\r
+    if (idlist)\r
+        PFREE(idlist);\r
+\r
+    purge_identity_cmd_map();\r
+}\r
+\r
+khm_boolean\r
+khm_check_identity_menu_action(khm_int32 act_id) {\r
+\r
+    if (act_id == KHUI_ACTION_DESTROY_ALL) {\r
+        khm_size i;\r
+\r
+        for (i=0; i < n_id_action_map; i++) {\r
+            if (id_action_map[i].identity != NULL) {\r
+                khm_cred_destroy_identity(id_action_map[i].identity);\r
+            }\r
+        }\r
+\r
+        return TRUE;\r
+    } else if (act_id == KHUI_ACTION_RENEW_ALL) {\r
+        khm_size i;\r
+\r
+        for (i=0; i < n_id_action_map; i++) {\r
+            if (id_action_map[i].identity != NULL) {\r
+                khm_cred_renew_identity(id_action_map[i].identity);\r
+            }\r
+        }\r
+\r
+        return TRUE;\r
+    } else {\r
+        khm_size i;\r
+\r
+        for (i=0; i < n_id_action_map; i++) {\r
+            if (id_action_map[i].identity == NULL)\r
+                continue;\r
+\r
+            if (id_action_map[i].renew_cmd == act_id) {\r
+                khm_cred_renew_identity(id_action_map[i].identity);\r
+                return TRUE;\r
+            }\r
+\r
+            if (id_action_map[i].destroy_cmd == act_id) {\r
+                khm_cred_destroy_identity(id_action_map[i].identity);\r
+                return TRUE;\r
+            }\r
+        }\r
+    }\r
+\r
+    return FALSE;\r
+}\r
+\r
+\r
 HMENU khui_hmenu_main = NULL;\r
 \r
 void khm_menu_refresh_items(void) {\r
@@ -625,9 +909,8 @@ void khm_menu_create_main(HWND parent) {
     if(!hwtb) {\r
 #ifdef DEBUG\r
         assert(FALSE);\r
-#else\r
-        return;\r
 #endif\r
+        return;\r
     }\r
 \r
     khui_main_menu_toolbar = hwtb;\r
index 7f718c26c47a952e1202b69211df946f82360a37..a0f64a0a6ea92a30622b8ad45ebf570847779769 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -46,6 +47,8 @@ void khm_menu_track_current(void);
 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
+khm_boolean khm_check_identity_menu_action(khm_int32 act_id);\r
+void khm_refresh_identity_menus(void);\r
 \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
index eba23e40ed57afccd5762239b3c6f4ddb6a24f75..71e09dfacc410a0b5b727cfd1ee81039321e61b5 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -25,6 +26,7 @@
 /* $Id$ */\r
 \r
 #include<khmapp.h>\r
+#include<intaction.h>\r
 #include<assert.h>\r
 \r
 ATOM khm_main_window_class;\r
@@ -62,8 +64,9 @@ mw_restart_refresh_timer(HWND hwnd) {
                                       &timeout)))\r
             timeout = MW_REFRESH_TIMEOUT;\r
         khc_close_space(csp_cw);\r
-    } else\r
+    } else {\r
         timeout = MW_REFRESH_TIMEOUT;\r
+    }\r
 \r
     timeout *= 1000;            /* convert to milliseconds */\r
 \r
@@ -172,6 +175,27 @@ khm_process_query_app_ver(khm_query_app_version * papp_ver) {
     papp_ver->code = KHM_ERROR_SUCCESS;\r
 }\r
 \r
+static void\r
+khm_ui_cb(LPARAM lParam) {\r
+    khui_ui_callback_data * pcbdata;\r
+\r
+    pcbdata = (khui_ui_callback_data *) lParam;\r
+\r
+    if (pcbdata == NULL || pcbdata->magic != KHUI_UICBDATA_MAGIC) {\r
+#ifdef DEBUG\r
+        assert(FALSE);\r
+#endif\r
+        return;\r
+    }\r
+\r
+#ifdef DEBUG\r
+    assert(pcbdata->cb);\r
+#endif\r
+\r
+    /* make the call */\r
+    pcbdata->rv = (*pcbdata->cb)(khm_hwnd_main, pcbdata->rock);\r
+}\r
+\r
 LRESULT CALLBACK \r
 khm_main_wnd_proc(HWND hwnd,\r
                   UINT uMsg,\r
@@ -339,6 +363,10 @@ khm_main_wnd_proc(HWND hwnd,
             return SendMessage(khm_hwnd_main_cred, uMsg, \r
                                wParam, lParam);\r
 \r
+        case KHUI_ACTION_UICB:\r
+            khm_ui_cb(lParam);\r
+            break;\r
+\r
             /* menu commands */\r
         case KHUI_PACTION_MENU:\r
             if(HIWORD(lParam) == 1)\r
@@ -408,6 +436,12 @@ khm_main_wnd_proc(HWND hwnd,
             {\r
                 khui_action * act;\r
 \r
+                /* check if this is an identity menu action.  (custom\r
+                   actions that were created for renewing or\r
+                   destroying specific identities). */\r
+                if (khm_check_identity_menu_action(LOWORD(wParam)))\r
+                    break;\r
+\r
                 act = khui_find_action(LOWORD(wParam));\r
                 if (act && act->listener) {\r
                     kmq_post_sub_msg(act->listener, KMSG_ACT, KMSG_ACT_ACTIVATE, act->cmd, NULL);\r
@@ -568,6 +602,9 @@ khm_main_wnd_proc(HWND hwnd,
             } else if (m->type == KMSG_CRED &&\r
                        m->subtype == KMSG_CRED_ADDR_CHANGE) {\r
                 khm_cred_addr_change();\r
+            } else if (m->type == KMSG_CRED &&\r
+                       m->subtype == KMSG_CRED_ROOTDELTA) {\r
+                khm_refresh_identity_menus();\r
             } else if (m->type == KMSG_KMM &&\r
                        m->subtype == KMSG_KMM_I_DONE) {\r
                 kmq_post_message(KMSG_ACT, KMSG_ACT_BEGIN_CMDLINE, 0, 0);\r
index b876b029790d0fceb9b473ebf26725ff0b1d86d2..75ebef4d823f90740f63b3dec93d0a46532db861 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -1372,9 +1373,8 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd,
                         } else {\r
 #ifdef DEBUG\r
                             assert(FALSE);\r
-#else\r
-                            continue;\r
 #endif\r
+                            continue;\r
                         }\r
                     }\r
 \r
index 684f6c74a6d60492f8636bb6f0ab027ea08c7341..b95f02daf788793d84fcef6fc46bdd3f15eb5233 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -171,12 +172,11 @@ reqdaemonwnd_proc(HWND hwnd,
                                              pdlginfo->out.ccache,\r
                                              &cb);\r
                     kcdb_identity_release(out_ident);\r
-                }\r
+                } else {\r
 #ifdef DEBUG\r
-                else {\r
                     assert(FALSE);\r
-                }\r
 #endif\r
+                }\r
 \r
                 *atsign++ = 0;\r
 \r
index b8dc0ec048a20321f42e1b920a776a81c60db101..f430fe0b08e59152ed672982edcd4bbde5e525b9 100644 (file)
 #define IDS_NC_PWD_FAILED_TITLE_I       287\r
 #define IDS_NC_REN_FAILED_TITLE_I       288\r
 #define IDS_CFG_IDNAME_NON              289\r
+#define IDS_MENU_DESTROY_CRED           290\r
+#define IDS_MENU_RENEW_CRED             291\r
+#define IDS_ACTION_DESTROY_ALL          292\r
+#define IDS_ACTION_RENEW_ALL            293\r
+#define IDS_IDACTION_RENEW              294\r
+#define IDS_IDACTION_DESTROY            295\r
+#define IDS_CTX_DESTROY_ID              296\r
 #define IDC_NC_USERNAME                 1007\r
 #define IDC_NC_PASSWORD                 1008\r
 #define IDC_NC_CREDTEXT_LABEL           1009\r
index 7157563e4aeb1f4fec15d2c447a7459a23d88004..f3781b93016026edfae9ba07195d1194b20950ec 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -312,9 +313,8 @@ void khm_create_standard_toolbar(HWND rebar) {
     if (!def) {\r
 #ifdef DEBUG\r
         assert(FALSE);\r
-#else\r
-        return;\r
 #endif\r
+        return;\r
     }\r
 \r
     hwtb = CreateWindowEx(0\r
@@ -340,9 +340,8 @@ void khm_create_standard_toolbar(HWND rebar) {
     if(!hwtb) {\r
 #ifdef DEBUG\r
         assert(FALSE);\r
-#else\r
-        return;\r
 #endif\r
+        return;\r
     }\r
 \r
     hiList = ImageList_Create(\r
diff --git a/src/windows/identity/ui/uibind.c b/src/windows/identity/ui/uibind.c
new file mode 100644 (file)
index 0000000..ac5e136
--- /dev/null
@@ -0,0 +1,58 @@
+/*\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person\r
+ * obtaining a copy of this software and associated documentation\r
+ * files (the "Software"), to deal in the Software without\r
+ * restriction, including without limitation the rights to use, copy,\r
+ * modify, merge, publish, distribute, sublicense, and/or sell copies\r
+ * of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be\r
+ * included in all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+ * SOFTWARE.\r
+ */\r
+\r
+/* $Id$ */\r
+\r
+#include<khuidefs.h>\r
+#include<intaction.h>\r
+\r
+#ifdef DEBUG\r
+#include <assert.h>\r
+#endif\r
+\r
+KHMEXP khm_int32 KHMAPI\r
+khui_request_UI_callback(khm_ui_callback cb, void * rock) {\r
+\r
+    khui_ui_callback_data cbdata;\r
+\r
+#ifdef DEBUG\r
+    assert(khui_hwnd_main);\r
+#endif\r
+\r
+    if (khui_hwnd_main == NULL)\r
+        return KHM_ERROR_NOT_READY;\r
+\r
+    ZeroMemory(&cbdata, sizeof(cbdata));\r
+    cbdata.magic = KHUI_UICBDATA_MAGIC;\r
+    cbdata.cb = cb;\r
+    cbdata.rock = rock;\r
+    cbdata.rv = KHM_ERROR_NOT_IMPLEMENTED;\r
+\r
+    SendMessage(khui_hwnd_main, WM_COMMAND,\r
+                MAKEWPARAM(KHUI_ACTION_UICB, 0),\r
+                (LPARAM) &cbdata);\r
+\r
+    return KHM_ERROR_SUCCESS;\r
+}\r
+\r
index 78fd3a821af4aecf5546e04c4dbd5624ee0ad58c..a7ab184fade53c22cecb5a54f64cd2aff7c906f4 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -26,6 +27,7 @@
 \r
 #define NOEXPORT\r
 #include<khuidefs.h>\r
+#include<intaction.h>\r
 #include<utils.h>\r
 #include<assert.h>\r
 \r
@@ -164,8 +166,8 @@ khui_action_ref khui_menu_ico_ctx_normal[] = {
     MENU_DEFACTION(KHUI_ACTION_CLOSE_APP),\r
     MENU_SEP(),\r
     MENU_ACTION(KHUI_ACTION_NEW_CRED),\r
-    MENU_ACTION(KHUI_ACTION_RENEW_CRED),\r
-    MENU_ACTION(KHUI_ACTION_DESTROY_CRED),\r
+    MENU_SUBMENU(KHUI_MENU_RENEW_CRED),\r
+    MENU_SUBMENU(KHUI_MENU_DESTROY_CRED),\r
     MENU_SEP(),\r
     MENU_ACTION(KHUI_ACTION_EXIT),\r
     MENU_END()\r
@@ -181,6 +183,16 @@ khui_action_ref khui_menu_columns[] = {
     MENU_END()\r
 };\r
 \r
+khui_action_ref khui_menu_destroy_cred[] = {\r
+    MENU_DEFACTION(KHUI_ACTION_DESTROY_ALL),\r
+    MENU_END()\r
+};\r
+\r
+khui_action_ref khui_menu_renew_cred[] = {\r
+    MENU_DEFACTION(KHUI_ACTION_RENEW_ALL),\r
+    MENU_END()\r
+};\r
+\r
 khui_action_ref khui_pmenu_tok_sel[] = {\r
     MENU_ACTION(KHUI_ACTION_RENEW_CRED),\r
     MENU_ACTION(KHUI_ACTION_DESTROY_CRED),\r
@@ -204,6 +216,8 @@ khui_menu_def khui_all_menus[] = {
     CONSTMENU(KHUI_MENU_OPTIONS, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_menu_options),\r
     CONSTMENU(KHUI_MENU_HELP, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_menu_help),\r
     CONSTMENU(KHUI_MENU_COLUMNS, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_menu_columns),\r
+    CONSTMENU(KHUI_MENU_RENEW_CRED, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_menu_renew_cred),\r
+    CONSTMENU(KHUI_MENU_DESTROY_CRED, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_menu_destroy_cred),\r
 \r
     /* toolbars */\r
     CONSTMENU(KHUI_TOOLBAR_STANDARD, KHUI_MENUSTATE_CONSTANT | KHUI_MENUSTATE_SYSTEM, khui_toolbar_standard),\r
index 50c19d4f5db8be8bf78d7bd810535a613a670d00..88ac4405236b29f6444b3fcfd5728c73aa5596c6 100644 (file)
@@ -7,6 +7,8 @@ KHUI_MENU_HELP,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_MENU_HELP,0,IDH_MENU_HELP,
 KHUI_MENU_LAYOUT,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_MENU_LAYOUT,0,0,0\r
 KHUI_MENU_TOOLBARS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_MENU_TOOLBARS,0,0,0\r
 KHUI_MENU_COLUMNS,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_CHOOSE_COLS,0,IDH_ACTION_CHOOSE_COLS,0\r
+KHUI_MENU_DESTROY_CRED,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_MENU_DESTROY_CRED,0,0,0\r
+KHUI_MENU_RENEW_CRED,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_MENU_RENEW_CRED,0,0,0\r
 KHUI_ACTION_PROPERTIES,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_PROPERTIES,IDS_ACTIONT_PROPERTIES,IDH_ACTION_PROPERTIES,0\r
 KHUI_ACTION_EXIT,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_EXIT,IDS_ACTIONT_EXIT,IDH_ACTION_EXIT,0\r
 KHUI_ACTION_SET_DEF_ID,KHUI_ACTIONTYPE_TRIGGER | KHUI_ACTIONTYPE_TOGGLE,,0,0,0,0,0,IDS_ACTION_SET_DEF_ID,IDS_ACTIONT_SET_DEF_ID,IDH_ACTION_SET_DEF_ID,0\r
@@ -34,6 +36,8 @@ KHUI_ACTION_HELP_ABOUT,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_HELP_ABOUT,
 KHUI_ACTION_OPEN_APP,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_OPEN_APP,0,0,0\r
 KHUI_ACTION_CLOSE_APP,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_CLOSE_APP,0,0,0\r
 KHUI_ACTION_IMPORT,KHUI_ACTIONTYPE_TRIGGER,,IDB_IMPORT,0,IDB_IMPORT_DIS,IDB_IMPORT_SM,IDB_IMPORT_SM_DIS,IDS_ACTION_IMPORT,IDS_ACTIONT_IMPORT,0,0\r
+KHUI_ACTION_DESTROY_ALL,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_DESTROY_ALL,0,0,0\r
+KHUI_ACTION_RENEW_ALL,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_ACTION_RENEW_ALL,0,0,0\r
 KHUI_PACTION_OK,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_PACTION_OK,0,0,0\r
 KHUI_PACTION_CANCEL,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_PACTION_CANCEL,0,0,0\r
 KHUI_PACTION_CLOSE,KHUI_ACTIONTYPE_TRIGGER,,0,0,0,0,0,IDS_PACTION_CLOSE,0,0,0\r
index 68bbf913797378a11b4f03169da51bcd7129ef86..31866ba2751b5bc00111927dc0505749286b19f0 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -65,6 +66,9 @@
 #define KHUI_ACTION_LAYOUT_CUST (KHUI_ACTION_BASE + 30)\r
 #define KHUI_ACTION_OPT_APPEAR  (KHUI_ACTION_BASE + 31)\r
 #define KHUI_ACTION_LAYOUT_RELOAD (KHUI_ACTION_BASE + 32)\r
+#define KHUI_ACTION_RENEW_ALL   (KHUI_ACTION_BASE + 33)\r
+#define KHUI_ACTION_DESTROY_ALL (KHUI_ACTION_BASE + 34)\r
+#define KHUI_ACTION_UICB        (KHUI_ACTION_BASE + 35)\r
 /*@}*/\r
 \r
 /*! \name Pseudo actions \r
@@ -105,6 +109,7 @@ context.
 #define KHUI_PACTION_PGUP   (KHUI_PACTION_BASE + 26)\r
 #define KHUI_PACTION_PGUP_EXTEND (KHUI_PACTION_BASE + 27)\r
 #define KHUI_PACTION_PGDN_EXTEND (KHUI_PACTION_BASE + 28)\r
+\r
 /*@}*/\r
 \r
 /*! \name Menus\r
@@ -135,7 +140,9 @@ Stock menus.
 #define KHUI_PMENU_TOK_SEL  (KHUI_MENU_BASE + 10)\r
 #define KHUI_PMENU_ID_SEL   (KHUI_MENU_BASE + 11)\r
 \r
-/* Next menu: 14 */\r
+#define KHUI_MENU_DESTROY_CRED (KHUI_MENU_BASE + 16)\r
+#define KHUI_MENU_RENEW_CRED (KHUI_MENU_BASE + 17)\r
+\r
 /*@}*/\r
 \r
 /*! \name Toolbars\r
index de28979257383a354650bd6dd9678378e9e4c1fd..7df605cc74a07d33511253f049d404323f999794 100644 (file)
@@ -1,5 +1,6 @@
 /*\r
  * Copyright (c) 2005 Massachusetts Institute of Technology\r
+ * Copyright (c) 2007 Secure Endpoints Inc.\r
  *\r
  * Permission is hereby granted, free of charge, to any person\r
  * obtaining a copy of this software and associated documentation\r
@@ -87,6 +88,12 @@ khm_get_lib_version(khm_version * libver, khm_ui_4 * apiver);
 KHMEXP khm_ui_4 KHMAPI\r
 khm_get_commctl_version(khm_version * pdvi);\r
 \r
+typedef khm_int32\r
+(KHMAPI *khm_ui_callback)(HWND hwnd_main_wnd, void * rock);\r
+\r
+KHMEXP khm_int32 KHMAPI\r
+khui_request_UI_callback(khm_ui_callback cb, void * rock);\r
+\r
 /*!@}*/\r
 \r
 #endif\r