Leaked source code of windows server 2003
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.

117 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. util.hxx
  5. Abstract:
  6. Contains the class definition of UTILITY classes.
  7. Author:
  8. Madan Appiah (madana) 16-Nov-1994
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. Ahsan Kabir (akabir) 25-Sept-97 made minor alterations to the API.
  13. --*/
  14. #ifndef _UTIL_
  15. #define _UTIL_
  16. #ifndef CACHE_REG
  17. #include <reg.hxx>
  18. #endif
  19. /*++
  20. Class Description:
  21. This class implements the MEMORY allocation object.
  22. Public Member functions:
  23. Alloc : allocates a block memory.
  24. Free : Frees a memory block that was allocated by the above alloc()
  25. member function.
  26. --*/
  27. struct MEMORY {
  28. PVOID Alloc(DWORD Size)
  29. {
  30. return ALLOCATE_MEMORY (LPTR, Size);
  31. }
  32. VOID MEMORY::Free (PVOID MemoryPtr)
  33. {
  34. FREE_MEMORY( MemoryPtr );
  35. }
  36. };
  37. BOOL
  38. DeleteOneCachedFile(
  39. LPSTR lpszFileName,
  40. DWORD dostEntry
  41. );
  42. DWORD
  43. DeleteCachedFilesInDir(
  44. LPSTR lpszPath,
  45. DWORD dwLevel = 0
  46. );
  47. DWORD
  48. MoveCachedFiles(
  49. LPSTR pszOldPath,
  50. LPSTR pszNewPath
  51. );
  52. BOOL hConstructSubDirs(PTSTR pszBase);
  53. BOOL AppendSlashIfNecessary(LPSTR lpszPath, DWORD* cb);
  54. BOOL AnyFindsInProgress(DWORD ContainerID);
  55. BOOL EnableCacheVu(LPSTR, DWORD = 0);
  56. BOOL DisableCacheVu(LPSTR lpszCacheRoot);
  57. BOOL IsValidCacheSubDir(LPSTR szPath);
  58. VOID StripTrailingWhiteSpace(LPSTR szString, LPDWORD pcb);
  59. IsCorrectUser(IN LPSTR lpszHeaderInfo, IN DWORD dwHeaderSize);
  60. BOOL GetDiskInfoA(PSTR pszPath, PDWORD pdwClusterSize, PDWORDLONG pdlAvailable, PDWORDLONG pdlTotal);
  61. #define GetDiskInfo GetDiskInfoA
  62. typedef VOID (WINAPI *PFN)();
  63. BOOL EstablishFunction(PTSTR pszModule, PTSTR pszFunction, PFN* pfn);
  64. BOOL ScanToLastSeparator(PTSTR pszPath, PTSTR* ppszCurrent);
  65. BOOL GenerateStringWithOrdinal(PCTSTR psz, DWORD dwOrdinal, PTSTR pszBuffer, DWORD dwMax);
  66. REGISTRY_OBJ* CreateExtensiRegObj(HKEY hKey);
  67. BOOL IsPerUserEntry(LPURL_FILEMAP_ENTRY pfe);
  68. class MUTEX_HOLDER
  69. {
  70. private:
  71. HANDLE _hHandle;
  72. DWORD _dwState;
  73. public:
  74. MUTEX_HOLDER();
  75. ~MUTEX_HOLDER();
  76. VOID Grab(HANDLE hHandle, DWORD dwTime);
  77. VOID Release();
  78. };
  79. #endif // _UTIL_