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.

138 lines
4.3 KiB

  1. #ifndef __GENERAL__
  2. #define __GENERAL__
  3. #include "resource.h"
  4. #include "init.h"
  5. #include <cleanoc.h>
  6. #include <wininet.h>
  7. #define VERSION_MAXSIZE 50
  8. #define TIMESTAMP_MAXSIZE 64
  9. #define MESSAGE_MAXSIZE 200
  10. #define CONTROLNAME_MAXSIZE 200
  11. #define MAX_KILOBYTE_ABBREV_LEN 16
  12. // Needed for FindFirstControl/FindNextControl
  13. #define MAX_CTRL_NAME_SIZE 2048
  14. #define MAX_DIST_UNIT_NAME_LEN MAX_PATH
  15. #define MAX_CLIENT_LEN 1024
  16. #define MAX_REGENTRY_SIZE 1024
  17. #define MAX_CLSID_LEN 40
  18. // conlumn identifiers
  19. #define NUM_COLUMNS 6
  20. enum {
  21. SI_CONTROL = 0, // column
  22. SI_STATUS, // column
  23. SI_TOTALSIZE, // column
  24. SI_CREATION, // column
  25. SI_LASTACCESS, // column
  26. SI_VERSION, // column
  27. SI_LOCATION,
  28. SI_CLSID,
  29. SI_TYPELIBID,
  30. SI_CODEBASE
  31. };
  32. // control status flags moved to cleanoc.h ( in iedev\inc )
  33. // struct containing info about a control
  34. struct tagDEPENDENTFILEINFO
  35. {
  36. TCHAR szFile[MAX_PATH];
  37. DWORD dwSize;
  38. };
  39. typedef tagDEPENDENTFILEINFO DEPENDENTFILEINFO;
  40. typedef DEPENDENTFILEINFO* LPDEPENDENTFILEINFO;
  41. struct tagCACHECTRLINFO
  42. {
  43. TCHAR szName[CONTROLNAME_MAXSIZE];
  44. TCHAR szFile[MAX_PATH];
  45. TCHAR szCLSID[MAX_CLSID_LEN];
  46. TCHAR szTypeLibID[MAX_CLSID_LEN];
  47. TCHAR szVersion[VERSION_MAXSIZE];
  48. TCHAR szLastAccess[TIMESTAMP_MAXSIZE];
  49. TCHAR szCreation[TIMESTAMP_MAXSIZE];
  50. TCHAR szLastChecked[TIMESTAMP_MAXSIZE];
  51. TCHAR szCodeBase[INTERNET_MAX_URL_LENGTH];
  52. DWORD dwIsDistUnit;
  53. DWORD dwHasActiveX;
  54. DWORD dwHasJava;
  55. DWORD dwTotalFileSize;
  56. DWORD dwTotalSizeSaved;
  57. UINT cTotalFiles;
  58. DWORD dwStatus;
  59. FILETIME timeCreation;
  60. FILETIME timeLastAccessed;
  61. DEPENDENTFILEINFO dependentFile;
  62. };
  63. typedef tagCACHECTRLINFO CACHECTRLINFO;
  64. typedef CACHECTRLINFO* LPCACHECTRLINFO;
  65. // PIDL format for this folder...
  66. struct tagCONTROLPIDL
  67. {
  68. USHORT cb;
  69. CACHECTRLINFO ci;
  70. };
  71. typedef tagCONTROLPIDL CONTROLPIDL;
  72. typedef UNALIGNED CONTROLPIDL* LPCONTROLPIDL;
  73. // common expiration
  74. #define DEFAULT_DAYS_BEFORE_EXPIRE 60
  75. #define DEFAULT_DAYS_BEFORE_AUTOEXPIRE 15
  76. // misc macros
  77. #define IS_VALID_CONTROLPIDL(pidl) (TRUE)
  78. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  79. // helper functions
  80. LPCTSTR GetStringInfo(LPCONTROLPIDL lpcpidl, int nFlag);
  81. BOOL GetTimeInfo(LPCONTROLPIDL lpcpidl, int nFlag, FILETIME* lpTime);
  82. UINT GetTotalNumOfFiles(LPCONTROLPIDL lpcpidl);
  83. DWORD GetSizeSaved(LPCONTROLPIDL lpcpidl);
  84. BOOL GetSizeSaved(LPCONTROLPIDL pcpidl, LPTSTR lpszBuf);
  85. UINT GetStatus(LPCONTROLPIDL pcpidl);
  86. BOOL GetStatus(LPCONTROLPIDL pcpidl, LPTSTR lpszBuf, int nBufSize);
  87. BOOL GetDependentFile(
  88. LPCONTROLPIDL lpcpidl,
  89. UINT iFile,
  90. LPTSTR lpszFile,
  91. DWORD *pdwSize);
  92. HICON GetDefaultOCIcon(LPCONTROLPIDL lpcpidl);
  93. void GetContentBools(LPCONTROLPIDL pcpidl, BOOL *pbHasActiveX, BOOL *pbHasJava );
  94. HRESULT GetLastAccessTime(HANDLE hControl, FILETIME *pLastAccess);
  95. HRESULT CreatePropDialog(
  96. HWND hwnd,
  97. LPCONTROLPIDL pcpidl);
  98. void GenerateEvent(
  99. LONG lEventId,
  100. LPITEMIDLIST pidlFolder,
  101. LPITEMIDLIST pidlIn,
  102. LPITEMIDLIST pidlNewIn);
  103. HCURSOR StartWaitCur();
  104. void EndWaitCur(HCURSOR hCurOld);
  105. void GetDaysBeforeExpireGeneral(ULONG *pnDays);
  106. void GetDaysBeforeExpireAuto(ULONG *pnDays);
  107. HRESULT WINAPI RemoveControlByName2(
  108. LPCTSTR lpszFile,
  109. LPCTSTR lpszCLSID,
  110. LPCTSTR lpszTypeLibID,
  111. BOOL bForceRemove, /* = FALSE */
  112. DWORD dwIsDistUnit, /* = FALSE */
  113. BOOL bSilent);
  114. HRESULT WINAPI RemoveControlByHandle2(
  115. HANDLE hControlHandle,
  116. BOOL bForceRemove, /* = FALSE */
  117. BOOL bSilent);
  118. #endif