You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.0 KiB
99 lines
2.0 KiB
//+---------------------------------------------------------------------------
|
|
//
|
|
// Microsoft Windows
|
|
// Copyright (C) Microsoft Corporation, 1995 - 1995.
|
|
//
|
|
// File: cache.hxx
|
|
//
|
|
// Contents: Functions to manage a cache of shares
|
|
//
|
|
// History: 11-Apr-95 BruceFo Created
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#ifndef __CACHE_HXX__
|
|
#define __CACHE_HXX__
|
|
|
|
// The CShareCache class encapsulates a cache of network shares. The cache
|
|
// is thread-safe; all access is protected by a critical section.
|
|
|
|
class CStrHashTable;
|
|
class CShareInfo;
|
|
|
|
class CShareCache
|
|
{
|
|
public:
|
|
|
|
CShareCache(
|
|
VOID
|
|
);
|
|
|
|
~CShareCache();
|
|
|
|
BOOL
|
|
IsPathShared(
|
|
LPCTSTR lpPath,
|
|
BOOL fRefresh
|
|
);
|
|
|
|
BOOL
|
|
IsShareNameUsed(
|
|
IN PWSTR pszShareName
|
|
);
|
|
|
|
BOOL
|
|
IsExistingShare(
|
|
IN PCWSTR pszShareName,
|
|
IN PCWSTR pszPath,
|
|
OUT PWSTR pszOldPath,
|
|
IN INT cchOldPathBuf // 585682-2002/04/12-JonN
|
|
);
|
|
|
|
VOID
|
|
Refresh(
|
|
VOID
|
|
);
|
|
|
|
HRESULT
|
|
ConstructList(
|
|
IN PCWSTR pszPath,
|
|
IN OUT CShareInfo* pShareList,
|
|
OUT ULONG* pcShares
|
|
);
|
|
|
|
HRESULT
|
|
ConstructParentWarnList(
|
|
IN PCWSTR pszPath,
|
|
OUT CShareInfo** ppShareList
|
|
);
|
|
|
|
private:
|
|
|
|
VOID
|
|
Delete(
|
|
VOID
|
|
);
|
|
|
|
VOID
|
|
RefreshNoCritSec(
|
|
VOID
|
|
);
|
|
|
|
BOOL
|
|
CacheOK(
|
|
VOID
|
|
);
|
|
|
|
UINT m_cShares;
|
|
LPBYTE m_pBufShares;
|
|
CStrHashTable* m_pHash;
|
|
CRITICAL_SECTION m_csBuf; // last for debugging ease
|
|
};
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern CShareCache g_ShareCache; // the main share cache
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
#endif // __CACHE_HXX__
|