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.

178 lines
4.7 KiB

  1. /*
  2. Copyright (c) 1997-1999 Microsoft Corporation
  3. Module Name:
  4. sdpdef.h
  5. Abstract:
  6. Author:
  7. */
  8. #ifndef __SDP_DEFINITIONS__
  9. #define __SDP_DEFINITIONS__
  10. // error codes
  11. #include "sdperr.h"
  12. // sets the first bit to indicate error
  13. // sets the win32 facility code
  14. // this is used instead of the HRESULT_FROM_WIN32 macro because that clears the customer flag
  15. inline long
  16. HRESULT_FROM_ERROR_CODE(
  17. IN long ErrorCode
  18. )
  19. {
  20. return ( 0x80070000 | (0xa000ffff & ErrorCode) );
  21. }
  22. #define BAIL_ON_FAILURE(HResultExpr) { {HRESULT MacroHResult = HResultExpr; if ( FAILED(MacroHResult) || (S_FALSE==MacroHResult) ){ return MacroHResult; }} }
  23. #define BAIL_IF_NULL(Ptr, HResult) { if ( NULL == Ptr ) return HResult; }
  24. const CHAR CHAR_BLANK = ' ';
  25. const CHAR CHAR_TAB = '\t';
  26. const CHAR CHAR_RETURN = '\r';
  27. const CHAR CHAR_NEWLINE = '\n';
  28. const CHAR CHAR_COLON = ':';
  29. const CHAR CHAR_EQUAL = '=';
  30. const CHAR CHAR_BACK_SLASH = '/';
  31. const CHAR CHAR_LEFT_ANGLE = '<';
  32. const CHAR CHAR_RIGHT_ANGLE = '>';
  33. const CHAR CHAR_LEFT_PAREN = '(';
  34. const CHAR CHAR_RIGHT_PAREN = ')';
  35. const CHAR CHAR_VERSION = 'v';
  36. const CHAR CHAR_ORIGIN = 'o';
  37. const CHAR CHAR_SESSION_NAME = 's';
  38. const CHAR CHAR_TITLE = 'i';
  39. const CHAR CHAR_URI = 'u';
  40. const CHAR CHAR_EMAIL = 'e';
  41. const CHAR CHAR_PHONE = 'p';
  42. const CHAR CHAR_CONNECTION = 'c';
  43. const CHAR CHAR_BANDWIDTH = 'b';
  44. const CHAR CHAR_TIME = 't';
  45. const CHAR CHAR_REPEAT = 'r';
  46. const CHAR CHAR_ADJUSTMENT = 'z';
  47. const CHAR CHAR_KEY = 'k';
  48. const CHAR CHAR_ATTRIBUTE = 'a';
  49. const CHAR CHAR_MEDIA = 'm';
  50. const CHAR CHAR_MEDIA_TITLE = 'i';
  51. const CHAR CHAR_MEDIA_CONNECTION = 'c';
  52. const CHAR CHAR_MEDIA_BANDWIDTH = 'b';
  53. const CHAR CHAR_MEDIA_KEY = 'k';
  54. const CHAR CHAR_MEDIA_ATTRIBUTE = 'a';
  55. const CHAR CHAR_DOT = '.';
  56. const CHAR EOS = '\0';
  57. // string constants
  58. // type prefix strings
  59. const CHAR VERSION_STRING[] = {CHAR_VERSION, CHAR_EQUAL, EOS};
  60. const CHAR ORIGIN_STRING[] = {CHAR_ORIGIN, CHAR_EQUAL, EOS};
  61. const CHAR SESSION_NAME_STRING[] = {CHAR_SESSION_NAME, CHAR_EQUAL, EOS};
  62. const CHAR TITLE_STRING[] = {CHAR_TITLE, CHAR_EQUAL, EOS};
  63. const CHAR URI_STRING[] = {CHAR_URI, CHAR_EQUAL, EOS};
  64. const CHAR EMAIL_STRING[] = {CHAR_EMAIL, CHAR_EQUAL, EOS};
  65. const CHAR PHONE_STRING[] = {CHAR_PHONE, CHAR_EQUAL, EOS};
  66. const CHAR CONNECTION_STRING[] = {CHAR_CONNECTION, CHAR_EQUAL, EOS};
  67. const CHAR BANDWIDTH_STRING[] = {CHAR_BANDWIDTH, CHAR_EQUAL, EOS};
  68. const CHAR TIME_STRING[] = {CHAR_TIME, CHAR_EQUAL, EOS};
  69. const CHAR REPEAT_STRING[] = {CHAR_REPEAT, CHAR_EQUAL, EOS};
  70. const CHAR ADJUSTMENT_STRING[] = {CHAR_ADJUSTMENT, CHAR_EQUAL, EOS};
  71. const CHAR KEY_STRING[] = {CHAR_KEY, CHAR_EQUAL, EOS};
  72. const CHAR ATTRIBUTE_STRING[] = {CHAR_ATTRIBUTE, CHAR_EQUAL, EOS};
  73. const CHAR MEDIA_STRING[] = {CHAR_MEDIA, CHAR_EQUAL, EOS};
  74. const CHAR MEDIA_TITLE_STRING[] = {CHAR_MEDIA_TITLE, CHAR_EQUAL, EOS};
  75. const CHAR MEDIA_CONNECTION_STRING[] = {CHAR_MEDIA_CONNECTION, CHAR_EQUAL, EOS};
  76. const CHAR MEDIA_BANDWIDTH_STRING[] = {CHAR_MEDIA_BANDWIDTH, CHAR_EQUAL, EOS};
  77. const CHAR MEDIA_KEY_STRING[] = {CHAR_MEDIA_KEY, CHAR_EQUAL, EOS};
  78. const CHAR MEDIA_ATTRIBUTE_STRING[] = {CHAR_MEDIA_ATTRIBUTE, CHAR_EQUAL, EOS};
  79. // other string constants
  80. const CHAR MEDIA_SEARCH_STRING[] = {CHAR_NEWLINE, CHAR_MEDIA, CHAR_EQUAL, EOS};
  81. const CHAR NEWLINE_STRING[] = "\n";
  82. const CHAR INTERNET_STRING[] = "IN";
  83. const CHAR IP4_STRING[] = "IP4";
  84. // const integral values
  85. const DWORD TYPE_STRING_LEN = strlen(VERSION_STRING);
  86. // limited character strings
  87. extern const CHAR *LIMITED_NETWORK_TYPES[];
  88. extern const BYTE NUM_NETWORK_TYPES;
  89. extern const CHAR *LIMITED_ADDRESS_TYPES[];
  90. extern const BYTE NUM_ADDRESS_TYPES;
  91. #endif // __SDP_DEFINITIONS__