win32-name-event-objects-20040228
[openafs.git] / src / WINNT / afsadmsvr / TaAfsAdmSvrClientCell.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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  */
9
10 extern "C" {
11 #include <afs/param.h>
12 #include <afs/stds.h>
13 }
14
15 #include "TaAfsAdmSvrClientInternal.h"
16
17
18 /*
19  * ROUTINES ___________________________________________________________________
20  *
21  */
22
23 BOOL ADMINAPI asc_CellChange (DWORD idClient, ASID idCell, LPAFSADMSVR_CHANGECELL_PARAMS pChange, ULONG *pStatus)
24 {
25    BOOL rc = TRUE;
26    ULONG status = 0;
27
28    RpcTryExcept
29       {
30       if ((rc = AfsAdmSvr_ChangeCell (idClient, idCell, pChange, &status)) != FALSE)
31          {
32          // If we succeeded in changing this cell's properties, get the
33          // newest values for our cache.
34          //
35          ASOBJPROP Properties;
36          rc = asc_ObjectPropertiesGet (idClient, GET_ALL_DATA, idCell, idCell, &Properties, &status);
37          }
38       }
39    RpcExcept(1)
40       {
41       rc = FALSE;
42       status = RPC_S_CALL_FAILED_DNE;
43       }
44    RpcEndExcept
45
46    if (!rc && pStatus)
47       *pStatus = status;
48    return rc;
49 }
50
51
52 BOOL ADMINAPI asc_CellRefreshRateSet (DWORD idClient, ASID idCell, ULONG cminRefreshRate, ULONG *pStatus)
53 {
54    BOOL rc = TRUE;
55    ULONG status = 0;
56
57    RpcTryExcept
58       {
59       rc = AfsAdmSvr_SetRefreshRate (idClient, idCell, cminRefreshRate, &status);
60       }
61    RpcExcept(1)
62       {
63       rc = FALSE;
64       status = RPC_S_CALL_FAILED_DNE;
65       }
66    RpcEndExcept
67
68    if (!rc && pStatus)
69       *pStatus = status;
70    return rc;
71 }
72