Source code of Windows XP (NT5)
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.

168 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. bitssrvcfg.h
  5. Abstract:
  6. Header to define server configuration information.
  7. --*/
  8. #define BITS_COMMAND_VERBW L"BITS_POST"
  9. #define BITS_COMMAND_VERBA "BITS_POST"
  10. const DWORD MD_BITS_UPLOAD_ENABLED = 0;
  11. const DWORD MD_BITS_CONNECTION_DIR = 1;
  12. const DWORD MD_BITS_MAX_FILESIZE = 2;
  13. const DWORD MD_BITS_NO_PROGRESS_TIMEOUT = 3;
  14. const DWORD MD_BITS_NOTIFICATION_URL_TYPE = 4;
  15. const DWORD MD_BITS_NOTIFICATION_URL = 5;
  16. const DWORD MD_BITS_CLEANUP_WORKITEM_KEY = 6;
  17. const DWORD MD_BITS_HOSTID = 7;
  18. const DWORD MD_BITS_HOSTID_FALLBACK_TIMEOUT = 8;
  19. enum BITS_SERVER_NOTIFICATION_TYPE
  20. {
  21. BITS_NOTIFICATION_TYPE_NONE = 0,
  22. BITS_NOTIFICATION_TYPE_POST_BYREF = 1,
  23. BITS_NOTIFICATION_TYPE_POST_BYVAL = 2,
  24. BITS_NOTIFICATION_TYPE_MAX = 2
  25. };
  26. const WCHAR * const MD_BITS_UNLIMITED_MAX_FILESIZE = L"18446744073709551615";
  27. const CHAR * const MD_BITS_UNLIMITED_MAX_FILESIZEA = "18446744073709551615";
  28. const UINT64 MD_BITS_UNLIMITED_MAX_FILESIZE_AS_INT64 = 18446744073709551615;
  29. const DWORD MD_BITS_NO_TIMEOUT = 0xFFFFFFFF;
  30. const WCHAR * const MD_DEFAULT_BITS_CONNECTION_DIR = L"BITS-Sessions";
  31. const CHAR * const MD_DEFAULT_BITS_CONNECTION_DIRA = "BITS-Sessions";
  32. const WCHAR * const MD_DEFAULT_BITS_MAX_FILESIZE = MD_BITS_UNLIMITED_MAX_FILESIZE;
  33. const CHAR * const MD_DEFAULT_BITS_MAX_FILESIZEA = MD_BITS_UNLIMITED_MAX_FILESIZEA;
  34. const UINT64 MD_DEFAULT_BITS_MAX_FILESIZE_AS_INT64 = MD_BITS_UNLIMITED_MAX_FILESIZE_AS_INT64;
  35. const DWORD MD_DEFAULT_NO_PROGESS_TIMEOUT = 60 /*seconds*/ * 60 /* minutes */ * 24 /* hours */ * 14 /* days */;
  36. const BITS_SERVER_NOTIFICATION_TYPE MD_DEFAULT_BITS_NOTIFICATION_URL_TYPE = BITS_NOTIFICATION_TYPE_NONE;
  37. const WCHAR * const MD_DEFAULT_BITS_NOTIFICATION_URL = L"";
  38. const CHAR * const MD_DEFAULT_BITS_NOTIFICATION_URLA = "";
  39. const WCHAR * const MD_DEFAULT_BITS_HOSTID = L"";
  40. const CHAR * const MD_DEFAULT_BITS_HOSTIDA = "";
  41. const DWORD MD_DEFAULT_HOSTID_FALLBACK_TIMEOUT = 60 /*seconds*/ * 60 /* minutes */ * 24 /* hours */; /* 1 day */
  42. struct PROPERTY_ITEM
  43. {
  44. WCHAR * PropertyName;
  45. WCHAR * ClassName;
  46. WCHAR * Syntax;
  47. DWORD UserType;
  48. DWORD PropertyNumber;
  49. };
  50. const PROPERTY_ITEM g_Properties[] =
  51. {
  52. {
  53. L"BITSUploadEnabled",
  54. L"IIsWebVirtualDir",
  55. L"Boolean",
  56. IIS_MD_UT_FILE,
  57. 0
  58. },
  59. {
  60. L"BITSSessionDirectory",
  61. L"IIsWebVirtualDir",
  62. L"String",
  63. IIS_MD_UT_FILE,
  64. 1
  65. },
  66. {
  67. L"BITSMaximumUploadSize",
  68. L"IIsWebVirtualDir",
  69. L"String",
  70. IIS_MD_UT_FILE,
  71. 2
  72. },
  73. {
  74. L"BITSSessionTimeout",
  75. L"IIsWebVirtualDir",
  76. L"Integer",
  77. IIS_MD_UT_FILE,
  78. 3
  79. },
  80. {
  81. L"BITSServerNotificationType",
  82. L"IIsWebVirtualDir",
  83. L"Integer",
  84. IIS_MD_UT_FILE,
  85. 4
  86. },
  87. {
  88. L"BITSServerNotificationURL",
  89. L"IIsWebVirtualDir",
  90. L"String",
  91. IIS_MD_UT_FILE,
  92. 5
  93. },
  94. {
  95. L"BITSCleanupWorkItemKey",
  96. L"IIsWebVirtualDir",
  97. L"String",
  98. IIS_MD_UT_FILE,
  99. 6
  100. },
  101. {
  102. L"BITSHostId",
  103. L"IIsWebVirtualDir",
  104. L"String",
  105. IIS_MD_UT_FILE,
  106. 7
  107. },
  108. {
  109. L"BITSHostIdFallbackTimeout",
  110. L"IIsWebVirtualDir",
  111. L"Integer",
  112. IIS_MD_UT_FILE,
  113. 8
  114. }
  115. };
  116. const SIZE_T g_NumberOfProperties = sizeof(g_Properties)/sizeof(*g_Properties);
  117. class PropertyIDManager
  118. {
  119. DWORD m_PropertyIDs[ g_NumberOfProperties ];
  120. DWORD m_PropertyUserTypes[ g_NumberOfProperties ];
  121. public:
  122. PropertyIDManager()
  123. {
  124. memset( &m_PropertyIDs, 0, sizeof( m_PropertyIDs ) );
  125. memset( &m_PropertyUserTypes, 0, sizeof( m_PropertyUserTypes ) );
  126. }
  127. HRESULT LoadPropertyInfo( const WCHAR *MachineName = L"LocalHost" );
  128. DWORD GetPropertyMetabaseID( DWORD PropID )
  129. {
  130. return m_PropertyIDs[PropID];
  131. }
  132. DWORD GetPropertyUserType( DWORD PropID )
  133. {
  134. return m_PropertyUserTypes[PropID];
  135. }
  136. };