本文整理汇总了C++中LPIDENT::OpenCell方法的典型用法代码示例。如果您正苦于以下问题:C++ LPIDENT::OpenCell方法的具体用法?C++ LPIDENT::OpenCell怎么用?C++ LPIDENT::OpenCell使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPIDENT
的用法示例。
在下文中一共展示了LPIDENT::OpenCell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AfsAdmSvr_AutoOpen_ThreadProc
DWORD WINAPI AfsAdmSvr_AutoOpen_ThreadProc (PVOID lp)
{
DWORD dwScope = PtrToUlong(lp);
ULONG status;
if (!l.fOperational)
return 0;
// First we'll have to find out which cell to open
//
TCHAR szCell[ cchNAME ];
if (!CELL::GetDefaultCell (szCell, &status))
{
Print (dlERROR, TEXT("CELL::GetDefaultCell failed; error 0x%08lX"), status);
}
else
{
// Then try to actually open the cell
//
Print (dlSTANDARD, TEXT("Auto-opening cell %s; scope=%s"), szCell, (dwScope == (AFSADMSVR_SCOPE_VOLUMES | AFSADMSVR_SCOPE_USERS)) ? TEXT("full") : (dwScope == AFSADMSVR_SCOPE_VOLUMES) ? TEXT("volumes") : TEXT("users"));
LPIDENT lpiCell;
if ((lpiCell = CELL::OpenCell ((LPTSTR)szCell, &status)) == NULL)
{
Print (dlERROR, TEXT("Auto-open of cell %s failed; error 0x%08lX"), szCell, status);
}
else
{
LPCELL lpCell;
if ((lpCell = lpiCell->OpenCell (&status)) == NULL)
{
Print (dlERROR, TEXT("Auto-open: OpenCell failed; error 0x%08lX"), status);
}
else
{
AfsAdmSvr_AddToMinScope (dwScope);
if (!lpCell->RefreshAll (&status))
Print (dlERROR, TEXT("Auto-open: RefreshCell failed; error 0x%08lX"), status);
else
Print (dlSTANDARD, TEXT("Auto-open of cell %s successful"), szCell);
lpCell->Close();
// We intentionally do not call CELL::CloseCell() here--as would
// ordinarily be necessary to balance our CELL::OpenCell() call
// above--because we never want to close our cache for this cell.
// The point of calling AutoOpen() up front is to keep an admin
// server alive and ready for use on a particular cell--calling
// CELL::CloseCell() here negates that purpose.
}
}
}
return 0;
}