From 6b0e4039c65262e68481ff43bc0cce531c5b39eb Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Mon, 19 Oct 2009 17:12:32 -0400 Subject: [PATCH] Windows: Add a token status icon to the NIM plug-in The Network Identity Manager plug-in for OpenAFS replaces afscreds.exe for token management. However, unlike afscreds.exe, the plug-in did not indicate the status of AFS tokens using an icon in the notification area. This patch adds a token status icon to the plug-in so that while the plug-in is used, a familiar padlock icon in the notification area will indicate the status of tokens as well as the OpenAFS service. There are four possible states indicated by the icons: - No tokens: indicated by a padlock with a bright red 'X' beside it. - At least one valid token: indicated by a normal padlock. - Service is not running: indicated by a grayed out padlock with a black square beside it. - Service error: indicated by a padlock broken in half. The 'Service error' state means that the OpenAFS client service is technically running (as reported by Windows), but is not responding to requests. In addition to the icon, hovering the mouse cursor over the icon will show details about the current state (such as the list of cells for which valid tokens exist) and the version of OpenAFS running on the machine. Reviewed-on: http://gerrit.openafs.org/683 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/netidmgr_plugin/NTMakefile | 6 + src/WINNT/netidmgr_plugin/afscred.h | 56 ++++ src/WINNT/netidmgr_plugin/afsfuncs.c | 14 +- src/WINNT/netidmgr_plugin/afsicon.c | 239 ++++++++++++++++++ src/WINNT/netidmgr_plugin/afsplugin.c | 76 +++--- .../netidmgr_plugin/images/creds_broke.ico | Bin 0 -> 318 bytes .../netidmgr_plugin/images/creds_none.ico | Bin 0 -> 318 bytes src/WINNT/netidmgr_plugin/images/creds_ok.ico | Bin 0 -> 318 bytes .../netidmgr_plugin/images/creds_stopped.ico | Bin 0 -> 318 bytes .../netidmgr_plugin/lang/en_us/langres.rc | 32 ++- src/WINNT/netidmgr_plugin/langres.h | 12 +- 11 files changed, 387 insertions(+), 48 deletions(-) create mode 100644 src/WINNT/netidmgr_plugin/afsicon.c create mode 100644 src/WINNT/netidmgr_plugin/images/creds_broke.ico create mode 100644 src/WINNT/netidmgr_plugin/images/creds_none.ico create mode 100644 src/WINNT/netidmgr_plugin/images/creds_ok.ico create mode 100644 src/WINNT/netidmgr_plugin/images/creds_stopped.ico diff --git a/src/WINNT/netidmgr_plugin/NTMakefile b/src/WINNT/netidmgr_plugin/NTMakefile index bce08bc5e..be9dda644 100644 --- a/src/WINNT/netidmgr_plugin/NTMakefile +++ b/src/WINNT/netidmgr_plugin/NTMakefile @@ -77,11 +77,13 @@ DLLFILE=$(EXEDIR)\afscred.dll LIBFILE=$(LIBFILEDIR)\afscred.lib INCFILES= \ + AFS_component_version_number.h \ afsp_version.h \ $(INCFILEDIR)\afspext.h \ $(INCFILEDIR)\afsp_version.h OBJFILES= \ + $(OUT)\AFS_component_version_number.obj \ $(OUT)\afsfuncs.obj \ $(OUT)\afsplugin.obj \ $(OUT)\main.obj \ @@ -90,6 +92,7 @@ OBJFILES= \ $(OUT)\afsnewcreds.obj \ $(OUT)\afsext.obj \ $(OUT)\afshelp.obj \ + $(OUT)\afsicon.obj \ $(OUT)\dynimport.obj \ $(OUT)\krb5common.obj @@ -138,6 +141,9 @@ $(OUT)\afsext.obj: afsext.c $(OUT)\afshelp.obj: afshelp.c $(PC2OBJ) +$(OUT)\afsicon.obj: afsicon.c + $(PC2OBJ) + $(OUT)\dynimport.obj: dynimport.c $(PC2OBJ) diff --git a/src/WINNT/netidmgr_plugin/afscred.h b/src/WINNT/netidmgr_plugin/afscred.h index 693b3adf8..cc2119f80 100644 --- a/src/WINNT/netidmgr_plugin/afscred.h +++ b/src/WINNT/netidmgr_plugin/afscred.h @@ -209,4 +209,60 @@ afs_ext_klog(afs_tk_method method, BOOL afs_cfg_get_afscreds_shortcut(wchar_t * wpath); +/* Notificaiton icon functions */ + +enum notification_icon_state { + AFSICON_REPORT_TOKENS, + AFSICON_SERVICE_STOPPED, + AFSICON_SERVICE_ERROR +}; + +void +afs_icon_set_state(enum notification_icon_state state, + khm_handle credset_with_tokens); + +void +afs_remove_icon(void); + + +/* Compatibility */ +#if KH_VERSION_API < 7 + +#ifdef _WIN64 +#define NIMDLLNAME L"nidmgr64.dll" +#define API_khui_action_lock "khui_action_lock" +#define API_khui_action_unlock "khui_action_unlock" +#define API_khui_refresh_actions "khui_refresh_actions" +#define API_khui_request_UI_callback "khui_request_UI_callback" +#else +#define NIMDLLNAME L"nidmgr32.dll" +#define API_khui_action_lock "_khui_action_lock@0" +#define API_khui_action_unlock "_khui_action_unlock@0" +#define API_khui_refresh_actions "_khui_refresh_actions@0" +#define API_khui_request_UI_callback "_khui_request_UI_callback@8" +#endif + +extern void +(KHMAPI * pkhui_action_lock)(void); + +extern void +(KHMAPI * pkhui_action_unlock)(void); + +extern void +(KHMAPI * pkhui_refresh_actions)(void); + +typedef khm_int32 +(KHMAPI * khm_ui_callback)(HWND hwnd_main_wnd, void * rock); + +extern khm_int32 +(KHMAPI * pkhui_request_UI_callback)(khm_ui_callback cb, + void * rock); + +#define khui_action_lock (*pkhui_action_lock) +#define khui_action_unlock (*pkhui_action_unlock) +#define khui_refresh_actions (*pkhui_refresh_actions) +#define khui_request_UI_callback (*pkhui_request_UI_callback) + +#endif + #endif diff --git a/src/WINNT/netidmgr_plugin/afsfuncs.c b/src/WINNT/netidmgr_plugin/afsfuncs.c index d8215478b..a6bf66dda 100644 --- a/src/WINNT/netidmgr_plugin/afsfuncs.c +++ b/src/WINNT/netidmgr_plugin/afsfuncs.c @@ -144,6 +144,14 @@ afs_list_tokens(void) r = afs_list_tokens_internal(); kcdb_credset_collect(NULL, afs_credset, NULL, afs_credtype_id, NULL); + if (r == 0) { + afs_icon_set_state(AFSICON_REPORT_TOKENS, afs_credset); + } else if (r == -1) { + afs_icon_set_state(AFSICON_SERVICE_STOPPED, NULL); + } else { + afs_icon_set_state(AFSICON_SERVICE_ERROR, NULL); + } + return r; } @@ -332,7 +340,7 @@ afs_list_tokens_internal(void) FILETIME ft; if (!afs_is_running()) - return 0; + return -1; kcdb_credset_flush(afs_credset); @@ -346,7 +354,7 @@ afs_list_tokens_internal(void) if (rc = ktc_ListTokens(cellNum, &cellNum, &aserver)) { if (rc != KTC_NOENT) - return(0); + return(-2); if (BreakAtEnd == 1) break; @@ -356,7 +364,7 @@ afs_list_tokens_internal(void) if (rc = ktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient)) { if (rc == KTC_ERROR) - return(0); + return(-3); continue; } diff --git a/src/WINNT/netidmgr_plugin/afsicon.c b/src/WINNT/netidmgr_plugin/afsicon.c new file mode 100644 index 000000000..b6f93e831 --- /dev/null +++ b/src/WINNT/netidmgr_plugin/afsicon.c @@ -0,0 +1,239 @@ + +#define NOSTRSAFE +#include "afscred.h" +#include "AFS_component_version_number.h" +#include +#include +#include +#include + +static ATOM message_window_class = 0; +static HWND notifier_window = NULL; +static volatile BOOL notification_icon_added = FALSE; + +#define TOKEN_ICON_ID 1 +#define TOKEN_MESSAGE_ID WM_USER + +static LRESULT CALLBACK +notifier_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + if (uMsg == TOKEN_MESSAGE_ID) { + switch (lParam) { + case NIN_SELECT: + case NIN_KEYSELECT: + + { + NOTIFYICONDATA idata; + khm_int32 cmd = KHUI_ACTION_OPEN_APP; + + khc_read_int32(NULL, L"CredWindow\\NotificationAction", &cmd); + + khui_action_trigger(cmd, NULL); + + ZeroMemory(&idata, sizeof(idata)); + + Shell_NotifyIcon(NIM_SETFOCUS, &idata); + } + return 0; + + default: + return 0; + } + } + return DefWindowProc(hwnd, uMsg, wParam, lParam); +} + +static void +initialize_if_necessary(void) +{ + if (message_window_class == 0) { + WNDCLASSEX c = { + sizeof(WNDCLASSEX), /* cbSize */ + 0, /* style */ + notifier_wnd_proc, /* lpfnWndProc */ + 0, /* cbClsExtra */ + 0, /* cbWndExtra */ + hInstance, /* hinstance */ + NULL, /* hIcon */ + NULL, /* hCursor */ + NULL, /* hbrBackground */ + NULL, /* lpszMenuName */ + L"OpenAFSTokenStateIconNotifier", /* lpszClassName */ + NULL, /* hIconSm */ + }; + + message_window_class = RegisterClassEx(&c); + } + + if (notifier_window == NULL && message_window_class != 0) { + notifier_window = CreateWindow(MAKEINTATOM(message_window_class), + L"OpenAFSTokenStateIconNotifierWindow", + 0, 0, 0, 0, 0, + HWND_MESSAGE, + NULL, + hInstance, + NULL); + } + + assert(notifier_window != NULL); + + if (!notification_icon_added && notifier_window != NULL) { + NOTIFYICONDATA idata; + + ZeroMemory(&idata, sizeof(idata)); + + idata.cbSize = sizeof(idata); + idata.hWnd = notifier_window; + idata.uID = TOKEN_ICON_ID; + idata.uFlags = NIF_ICON | NIF_MESSAGE; + idata.uCallbackMessage = TOKEN_MESSAGE_ID; + idata.hIcon = (HICON) LoadImage(hResModule, MAKEINTRESOURCE(IDI_CRED_NONE), + IMAGE_ICON, 0, 0, + LR_DEFAULTSIZE | LR_DEFAULTCOLOR | LR_SHARED); + notification_icon_added = Shell_NotifyIcon(NIM_ADD, &idata); + + idata.cbSize = sizeof(idata); + idata.uVersion = NOTIFYICON_VERSION; + + Shell_NotifyIcon(NIM_SETVERSION, &idata); + + assert(notification_icon_added); + } +} + +void +afs_remove_icon(void) +{ + NOTIFYICONDATA idata; + wchar_t buf[ARRAYLENGTH(idata.szTip)]; + + ZeroMemory(&idata, sizeof(idata)); + + idata.cbSize = sizeof(idata); + idata.hWnd = notifier_window; + idata.uID = TOKEN_ICON_ID; + Shell_NotifyIcon(NIM_DELETE, &idata); + notification_icon_added = FALSE; +} + +static void +set_tooltip_and_icon(UINT tooltip_text, const wchar_t * postfix, UINT icon_id) +{ + NOTIFYICONDATA idata; + wchar_t buf[ARRAYLENGTH(idata.szTip)]; + + ZeroMemory(&idata, sizeof(idata)); + + idata.cbSize = sizeof(idata); + idata.hWnd = notifier_window; + idata.uID = TOKEN_ICON_ID; + idata.uFlags = NIF_ICON | NIF_TIP; + idata.hIcon = (HICON) LoadImage(hResModule, MAKEINTRESOURCE(icon_id), + IMAGE_ICON, 0, 0, + LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED); + if (tooltip_text != 0) { + LoadString(hResModule, tooltip_text, buf, ARRAYLENGTH(buf)); + } + StringCbPrintf(idata.szTip, sizeof(idata.szTip), + L"%s%s%s%s", + (tooltip_text != 0)? buf : L"", + (postfix != NULL)? postfix : L"", + (tooltip_text != 0 || postfix != NULL)? L"\n": L"", + _T(AFS_VERINFO_BUILD)); + + Shell_NotifyIcon(NIM_MODIFY, &idata); +} + +struct state_data { + enum notification_icon_state state; + khm_handle credset; +}; + +#define COLLECT_STR_LEN 256 + +static khm_int32 KHMAPI +collect_cell_names(khm_handle cred, void * rock) +{ + wchar_t *str = (wchar_t *) rock; + wchar_t cell[KCDB_MAXCCH_NAME] = L""; + FILETIME ft_now; + FILETIME ft_expire; + khm_size cb; + + cb = sizeof(ft_expire); + if (KHM_FAILED(kcdb_cred_get_attr(cred, KCDB_ATTR_EXPIRE, NULL, &ft_expire, &cb))) + return KHM_ERROR_SUCCESS; + + GetSystemTimeAsFileTime(&ft_now); + if (CompareFileTime(&ft_now, &ft_expire) >= 0) + return KHM_ERROR_SUCCESS; + + cb = sizeof(cell); + + if (KHM_SUCCEEDED(kcdb_cred_get_attr(cred, afs_attr_cell, NULL, cell, &cb)) && + cell[0]) { + StringCchCat(str, COLLECT_STR_LEN, cell); + StringCchCat(str, COLLECT_STR_LEN, L"\n"); + } + + return KHM_ERROR_SUCCESS; +} + +static khm_int32 KHMAPI +set_state_from_ui_thread(HWND hwnd_main, void * stuff) +{ + struct state_data * d = (struct state_data *) stuff; + + initialize_if_necessary(); + + switch (d->state) { + case AFSICON_REPORT_TOKENS: + { + wchar_t cells[COLLECT_STR_LEN] = L""; + + kcdb_credset_apply(d->credset, collect_cell_names, cells); + + if (cells[0] == L'\0') { + set_tooltip_and_icon(IDS_CRED_TT_NONE, NULL, IDI_CRED_NONE); + break; + } + + set_tooltip_and_icon(0, cells, IDI_CRED_OK); + } + break; + + case AFSICON_SERVICE_STOPPED: + set_tooltip_and_icon(IDS_CRED_TT_NOS, NULL, IDI_CRED_SVCSTOP); + break; + + case AFSICON_SERVICE_ERROR: + set_tooltip_and_icon(IDS_CRED_TT_SERR, NULL, IDI_CRED_BROKEN); + break; + + default: + assert(FALSE); + } + + return KHM_ERROR_SUCCESS; +} + +void +afs_icon_set_state(enum notification_icon_state state, + khm_handle credset_with_tokens) +{ + struct state_data d; + +#if KH_VERSION_API < 7 + if (pkhui_request_UI_callback == NULL) + return; +#endif + + d.state = state; + d.credset = credset_with_tokens; + + if (notification_icon_added) { + set_state_from_ui_thread(NULL, &d); + } else { + khui_request_UI_callback(set_state_from_ui_thread, &d); + } +} diff --git a/src/WINNT/netidmgr_plugin/afsplugin.c b/src/WINNT/netidmgr_plugin/afsplugin.c index 9db999a5c..89cb2b4f5 100644 --- a/src/WINNT/netidmgr_plugin/afsplugin.c +++ b/src/WINNT/netidmgr_plugin/afsplugin.c @@ -79,27 +79,22 @@ afs_msg_ext(khm_int32 msg_subtype, khm_ui_4 uparam, void * vparam); HMODULE hm_netidmgr; /* declarations from version 7 of the API */ -KHMEXP void +void (KHMAPI * pkhui_action_lock)(void); -KHMEXP void +void (KHMAPI * pkhui_action_unlock)(void); -KHMEXP void +void (KHMAPI * pkhui_refresh_actions)(void); typedef khm_int32 (KHMAPI * khm_ui_callback)(HWND hwnd_main_wnd, void * rock); -KHMEXP khm_int32 +khm_int32 (KHMAPI * pkhui_request_UI_callback)(khm_ui_callback cb, void * rock); -#define khui_action_lock (*pkhui_action_lock) -#define khui_action_unlock (*pkhui_action_unlock) -#define khui_refresh_actions (*pkhui_refresh_actions) -#define khui_request_UI_callback (*pkhui_request_UI_callback) - #endif /* AFS plugin callback */ @@ -250,6 +245,42 @@ afs_msg_system(khm_int32 msg_subtype, switch(msg_subtype) { case KMSG_SYSTEM_INIT: + + /* If we are building against an older SDK, we should try to + load newer APIs if it's available at run-time. */ +#if KH_VERSION_API < 7 + do { + khm_version libver; + khm_ui_4 apiver; + + khm_get_lib_version(&libver, &apiver); + + if (apiver < 7) + break; + + hm_netidmgr = LoadLibrary(NIMDLLNAME); + + if (hm_netidmgr == NULL) + break; + + pkhui_action_lock = (void (KHMAPI *)(void)) + GetProcAddress(hm_netidmgr, API_khui_action_lock); + pkhui_action_unlock = (void (KHMAPI *)(void)) + GetProcAddress(hm_netidmgr, API_khui_action_unlock); + pkhui_refresh_actions = (void (KHMAPI *)(void)) + GetProcAddress(hm_netidmgr, API_khui_refresh_actions); + pkhui_request_UI_callback = (khm_int32 (KHMAPI *)(khm_ui_callback, void *)) + GetProcAddress(hm_netidmgr, API_khui_request_UI_callback); + + } while (FALSE); +#endif + + /* Add the icon now. On NIM v2.x, doing so after tokens were + reported may result in a deadlock as we try to switch to + the UI thread and the UI thread is blocked on a resource + request to this plug-in. */ + afs_icon_set_state(AFSICON_SERVICE_STOPPED, NULL); + /* Perform critical registrations and data structure initalization */ { @@ -546,37 +577,14 @@ afs_msg_system(khm_int32 msg_subtype, wchar_t long_desc[KHUI_MAXCCH_LONG_DESC]; #if KH_VERSION_API < 7 - - khm_version libver; - khm_ui_4 apiver; - - khm_get_lib_version(&libver, &apiver); - - if (apiver < 7) - goto no_custom_help; - - hm_netidmgr = LoadLibrary(L"nidmgr32.dll"); - - if (hm_netidmgr == NULL) - goto no_custom_help; - - pkhui_action_lock = (void (KHMAPI *)(void)) - GetProcAddress(hm_netidmgr, "_khui_action_lock@0"); - pkhui_action_unlock = (void (KHMAPI *)(void)) - GetProcAddress(hm_netidmgr, "_khui_action_unlock@0"); - pkhui_refresh_actions = (void (KHMAPI *)(void)) - GetProcAddress(hm_netidmgr, "_khui_refresh_actions@0"); - pkhui_request_UI_callback = (khm_int32 (KHMAPI *)(khm_ui_callback, void *)) - GetProcAddress(hm_netidmgr, "_khui_request_UI_callback@8"); - if (pkhui_action_lock == NULL || pkhui_action_unlock == NULL || pkhui_refresh_actions == NULL || pkhui_request_UI_callback == NULL) goto no_custom_help; - #endif + kmq_create_subscription(afs_plugin_cb, &h_sub); LoadString(hResModule, IDS_ACTION_AFS_HELP, @@ -658,6 +666,8 @@ afs_msg_system(khm_int32 msg_subtype, case KMSG_SYSTEM_EXIT: + afs_remove_icon(); + /* Try to remove the AFS plug-in action from Help menu if it was successfully registered. Also, delete the action. */ if (action_id_afs_help != 0) { diff --git a/src/WINNT/netidmgr_plugin/images/creds_broke.ico b/src/WINNT/netidmgr_plugin/images/creds_broke.ico new file mode 100644 index 0000000000000000000000000000000000000000..eda6d1edd300012820ce5977e440596b354e3a12 GIT binary patch literal 318 zcmZvXF$%&!5Jg{5*ae$_V5?iQ#MwKPqGb54sk6m9D}LFp|| zU6?GLYI1g4q|me2Oj>4+O(89;Gn)6MkpY7o>pqwFL5{0c&|G^Tzq1E*6 ggS-BHuAn;U1#@8myCEFLa1m~^4p;S$H9T8*1G;KDN&o-= literal 0 HcmV?d00001 diff --git a/src/WINNT/netidmgr_plugin/images/creds_none.ico b/src/WINNT/netidmgr_plugin/images/creds_none.ico new file mode 100644 index 0000000000000000000000000000000000000000..3899cb7df26a1ab3a2db0bb3873a1ab3fbe52ac9 GIT binary patch literal 318 zcmZusF%E+;3_R3IVS}kKR_ekSiGgoXWuOvEMz)Fx{O$(DVtgtjRj%BL(7q8-&1&{vb%aqH(zye h9O=y`4DzT0VEK2?))Eo}@ghF-zn4F7Hz?u``~d1>LV^GQ literal 0 HcmV?d00001 diff --git a/src/WINNT/netidmgr_plugin/images/creds_ok.ico b/src/WINNT/netidmgr_plugin/images/creds_ok.ico new file mode 100644 index 0000000000000000000000000000000000000000..d2f64f08dd2f997bceeaa563d7e130d564771d64 GIT binary patch literal 318 zcmZurF%E+;47`X+=>}8Rc4Vx?z}PP#Wk@BK{GiWa=s=#*Com!vHN6Wpj+U6>C zg_926w$gWpJf{hR=JMJ16ri(VSMSHww?41`NiWPLFj?SLY$1Ps{D8O18Tj1vKkx=WbZe%rF!mRGDO)<4soi)|@)VxXkpU6T4nnlT_MI;mCotoM1&XB3bm>tm}-%_Wzhi*F$U(8OwB$;75g4x veqCGd(`P<=LvXSbbsIt_ZBx? literal 0 HcmV?d00001 diff --git a/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc b/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc index ad25c7221..d09dcb34a 100644 --- a/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc +++ b/src/WINNT/netidmgr_plugin/lang/en_us/langres.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "..\\..\\langres.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -126,7 +126,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_NC_AFS, DIALOG BEGIN @@ -178,13 +178,17 @@ IDI_AFSPLUGIN ICON "..\\..\\images\\OpenAFS.ico" IDI_NC_NEW ICON "..\\..\\images\\nc_new.ico" IDI_NC_EXIST ICON "..\\..\\images\\nc_exist.ico" IDI_NC_NOTOWNED ICON "..\\..\\images\\nc_notowned.ico" +IDI_CRED_BROKEN ICON "..\\..\\images\\creds_broke.ico" +IDI_CRED_NONE ICON "..\\..\\images\\creds_none.ico" +IDI_CRED_OK ICON "..\\..\\images\\creds_ok.ico" +IDI_CRED_SVCSTOP ICON "..\\..\\images\\creds_stopped.ico" ///////////////////////////////////////////////////////////////////////////// // // String Table // -STRINGTABLE +STRINGTABLE BEGIN IDS_AFS_SHORT_DESC "AFS credentials" IDS_AFS_LONG_DESC "AFS credentials" @@ -199,15 +203,15 @@ BEGIN IDS_NC_REALM_AUTO "(Automatic)" END -STRINGTABLE +STRINGTABLE BEGIN IDS_NC_TT_NO_CELL "You have not specified an AFS cell to authenticate to." IDS_NC_TT_CANT_ADD "Can't add a new token" - IDS_NC_TT_MALFORMED_CELL + IDS_NC_TT_MALFORMED_CELL "The cell name you specified contains invalid characters." IDS_NC_TT_NO_REALM "You have not specified a Kerberos realm to use to obtain tokesn for the cell." IDS_NC_AUTO "(Auto)" - IDS_NC_TT_MALFORMED_REALM + IDS_NC_TT_MALFORMED_REALM "The realm name you entered contains invalid characters." IDS_NC_TT_CANT_UPDATE "Can't update token" IDS_AFS_CREDTEXT_DIS "

AFS: AFS is disabled. (click here to enable)

" @@ -221,7 +225,7 @@ BEGIN IDS_ATTR_CLIENT_PRINC_SHORT_DESC "Client Principal" END -STRINGTABLE +STRINGTABLE BEGIN IDS_ATTR_SERVER_PRINC_SHORT_DESC "Server Principal" IDS_DEF_LOCATION "AFS Cache Manager" @@ -241,7 +245,7 @@ BEGIN IDS_NC_TT_CONFLICTM "Credentials for cell %s are already listed for identity %s.\nDo you want to keep the credentials for other identities as well as this one?" END -STRINGTABLE +STRINGTABLE BEGIN IDS_NC_TT_DETAILS "Details about credential" IDS_NC_TT_CONFLICTD "This credential already exists under a different identity." @@ -256,6 +260,14 @@ BEGIN IDS_ERR_GENERAL "Credentials could not be obtained for cell %1!S!." IDS_ACTION_AFS_HELP "AFS" IDS_ACTION_AFS_HELP_TT "Display documentation for the OpenAFS plug-in" + IDS_CRED_TT_NONE "No AFS tokens" + IDS_CRED_TT_TOK "Tokens for " + IDS_CRED_TT_NOS "OpenAFS service has not been started." +END + +STRINGTABLE +BEGIN + IDS_CRED_TT_SERR "OpenAFS service cannot be reached." END #endif // English (U.S.) resources diff --git a/src/WINNT/netidmgr_plugin/langres.h b/src/WINNT/netidmgr_plugin/langres.h index c472b1453..b77b61ce7 100644 --- a/src/WINNT/netidmgr_plugin/langres.h +++ b/src/WINNT/netidmgr_plugin/langres.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by C:\work\openafs.1.5\src\Winnt\netidmgr_plugin\lang\en_us\langres.rc +// Used by C:\work\openafs-git\src\Winnt\netidmgr_plugin\lang\en_us\langres.rc // #define IDS_AFS_SHORT_DESC 101 #define IDS_AFS_LONG_DESC 102 @@ -24,9 +24,13 @@ #define IDS_NC_REALM_AUTO 111 #define IDI_NC_NOTOWNED 111 #define IDS_NC_TT_NO_CELL 112 +#define IDI_CRED_BROKEN 112 #define IDS_NC_TT_CANT_ADD 113 +#define IDI_CRED_NONE 113 #define IDS_NC_TT_MALFORMED_CELL 114 +#define IDI_CRED_OK 114 #define IDS_NC_TT_NO_REALM 115 +#define IDI_CRED_SVCSTOP 115 #define IDS_NC_AUTO 116 #define IDS_NC_TT_MALFORMED_REALM 117 #define IDS_NC_TT_CANT_UPDATE 118 @@ -68,6 +72,10 @@ #define IDS_ERR_GENERAL 154 #define IDS_ACTION_AFS_HELP 155 #define IDS_ACTION_AFS_HELP_TT 156 +#define IDS_CRED_TT_NONE 157 +#define IDS_CRED_TT_TOK 158 +#define IDS_CRED_TT_NOS 159 +#define IDS_CRED_TT_SERR 160 #define IDC_NCAFS_OBTAIN 1001 #define IDC_NCAFS_TOKENLIST 1002 #define IDC_NCAFS_CELL 1004 @@ -95,7 +103,7 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 112 +#define _APS_NEXT_RESOURCE_VALUE 116 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1024 #define _APS_NEXT_SYMED_VALUE 101 -- 2.39.5