Update NEWS for 1.6.22
[pkg-k5-afs_openafs.git] / src / WINNT / afssvrmgr / set_general.cpp
blobc928c77e3bc22a36f292cd9c0b8d356a9a9938cb
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
10 #include <winsock2.h>
11 #include <ws2tcpip.h>
13 extern "C" {
14 #include <afs/param.h>
15 #include <afs/stds.h>
18 #include "svrmgr.h"
19 #include "set_general.h"
23 * FILESET PREFERENCES ________________________________________________________
27 PVOID Filesets_LoadPreferences (LPIDENT lpiFileset)
29 LPFILESET_PREF pfp = New (FILESET_PREF);
31 if (!RestorePreferences (lpiFileset, pfp, sizeof(FILESET_PREF)))
33 pfp->perWarnSetFull = -1; // use the server's default value
35 Alert_SetDefaults (&pfp->oa);
38 Alert_Initialize (&pfp->oa);
39 return pfp;
43 BOOL Filesets_SavePreferences (LPIDENT lpiFileset)
45 BOOL rc = FALSE;
47 PVOID pfp = lpiFileset->GetUserParam();
48 if (pfp != NULL)
50 rc = StorePreferences (lpiFileset, pfp, sizeof(FILESET_PREF));
53 return rc;
58 * ROUTINES ___________________________________________________________________
62 LPIDENT Filesets_GetSelected (HWND hDlg)
64 return (LPIDENT)FL_GetSelectedData (GetDlgItem (hDlg, IDC_SET_LIST));
68 LPIDENT Filesets_GetFocused (HWND hDlg, POINT *pptHitTest)
70 HWND hList = GetDlgItem (hDlg, IDC_SET_LIST);
72 if (pptHitTest == NULL)
74 return (LPIDENT)FL_GetFocusedData (hList);
77 HLISTITEM hItem;
78 if ((hItem = FastList_ItemFromPoint (hList, pptHitTest, TRUE)) != NULL)
80 return (LPIDENT)FL_GetData (hList, hItem);
83 return NULL;
87 BOOL Filesets_fIsLocked (LPFILESETSTATUS pfs)
89 return (pfs->State & fsLOCKED) ? TRUE : FALSE;