X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2FWINNT%2Fclient_config%2Ftab_general.cpp;h=4994c2b456b54e23626aafcb1e27792d22fdc4e8;hp=450ad7d7069d12a089fe76b07aa1fbfe837c450b;hb=4affa40db8c6c2c9908a77101ee001c3762f9593;hpb=06634de3494db97c182b3452e1f7a9b70e608606 diff --git a/src/WINNT/client_config/tab_general.cpp b/src/WINNT/client_config/tab_general.cpp index 450ad7d..4994c2b 100644 --- a/src/WINNT/client_config/tab_general.cpp +++ b/src/WINNT/client_config/tab_general.cpp @@ -7,9 +7,15 @@ * directory or online at http://www.openafs.org/dl/license10.html */ +#include +#include + extern "C" { +#include #include +#include #include +#include #include #include } @@ -101,9 +107,9 @@ BOOL CALLBACK GeneralTab_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { case IDAPPLY: if (!GeneralTab_OnApply (hDlg, FALSE, TRUE)) - SetWindowLong (hDlg, DWL_MSGRESULT, TRUE); + SetWindowLongPtr (hDlg, DWLP_MSGRESULT, TRUE); else if (g.fIsWinNT && !GeneralTab_AskIfStopped (hDlg)) - SetWindowLong (hDlg, DWL_MSGRESULT, TRUE); + SetWindowLongPtr (hDlg, DWLP_MSGRESULT, TRUE); break; case IDC_REFRESH: @@ -228,7 +234,7 @@ BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid) if (!fForce) { // Don't try to do anything if we've already failed the apply - if (GetWindowLong (hDlg, DWL_MSGRESULT)) + if (GetWindowLongPtr (hDlg, DWLP_MSGRESULT)) return FALSE; } @@ -262,11 +268,12 @@ BOOL GeneralTab_OnApply (HWND hDlg, BOOL fForce, BOOL fComplainIfInvalid) BOOL fLogonAuthent = IsDlgButtonChecked (hDlg, IDC_LOGON); if (fLogonAuthent != g.Configuration.fLogonAuthent) { - SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED); + SetBitLogonOption(fLogonAuthent,LOGON_OPTION_INTEGRATED); g.Configuration.fLogonAuthent = fLogonAuthent; } - Config_SetTrayIconFlag (IsDlgButtonChecked (hDlg, IDC_TRAYICON)); + if (GetDlgItem(hDlg, IDC_TRAYICON) != NULL) + Config_SetTrayIconFlag (IsDlgButtonChecked(hDlg, IDC_TRAYICON)); if (g.fIsWinNT) { @@ -659,26 +666,30 @@ BOOL fIsCellInCellServDB (LPCTSTR pszCell) { BOOL fFound = FALSE; CELLSERVDB CellServDB; - - if (CSDB_ReadFile (&CellServDB, NULL)) + char cellname[256], i; + + /* we pray for all ascii cellnames */ + for ( i=0 ; pszCell[i] && i < (sizeof(cellname)-1) ; i++ ) + cellname[i] = pszCell[i]; + cellname[i] = '\0'; + + ULONG code = cm_SearchCellRegistry(1, cellname, NULL, NULL, NULL, NULL); + if (code == 0) + fFound = TRUE; + if (!fFound && + (code != CM_ERROR_FORCE_DNS_LOOKUP) && + CSDB_ReadFile (&CellServDB, NULL)) { if (CSDB_FindCell (&CellServDB, pszCell)) fFound = TRUE; CSDB_FreeFile (&CellServDB); } -#ifdef AFS_AFSDB_ENV - if ( fFound == FALSE ) { - int ttl; - char cellname[128], i; - - /* we pray for all ascii cellnames */ - for ( i=0 ; pszCell[i] && i < (sizeof(cellname)-1) ; i++ ) - cellname[i] = pszCell[i]; - cellname[i] = '\0'; - - fFound = !cm_SearchCellByDNS(cellname, NULL, &ttl, NULL, NULL); - } -#endif + if ( fFound == FALSE ) { + int ttl; + fFound = !cm_SearchCellByDNS(cellname, NULL, &ttl, NULL, NULL); + } + done: + return fFound; }