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.

128 lines
1.7 KiB

  1. #ifndef __MAIN_HXX
  2. #define __MAIN_HXX
  3. //
  4. // System Includes
  5. //
  6. #define UNICODE
  7. #define _UNICODE
  8. #define INC_OLE2
  9. #include <windows.h>
  10. //
  11. // CRunTime Includes
  12. //
  13. #include <stdlib.h>
  14. #include <limits.h>
  15. #include <io.h>
  16. #include <stdio.h>
  17. #include <stddef.h>
  18. //
  19. // Public ADs includes
  20. //
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #include "activeds.h"
  25. #include "oledb.h"
  26. #include "oledberr.h"
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #define NULL_TERMINATED 0
  31. //
  32. // ********* Useful macros
  33. //
  34. #define BAIL_ON_NULL(p) \
  35. if (!(p)) { \
  36. goto error; \
  37. }
  38. #define BAIL_ON_FAILURE(hr) \
  39. if (FAILED(hr)) { \
  40. goto error; \
  41. }
  42. #define FREE_INTERFACE(pInterface) \
  43. if (pInterface) { \
  44. pInterface->Release(); \
  45. pInterface=NULL; \
  46. }
  47. #define ADS_FREE(pMem) \
  48. if (pMem) { \
  49. FreeADsMem(pMem); \
  50. pMem = NULL; \
  51. }
  52. #define FREE_UNICODE_STRING(pMem) \
  53. if (pMem) { \
  54. FreeUnicodeString(pMem); \
  55. pMem = NULL; \
  56. }
  57. void
  58. PrintAttrDefinition(
  59. PADS_ATTR_DEF pAttrDefiniton,
  60. DWORD dwNumAttributes
  61. );
  62. int
  63. AnsiToUnicodeString(
  64. LPSTR pAnsi,
  65. LPWSTR pUnicode,
  66. DWORD StringLength
  67. );
  68. int
  69. UnicodeToAnsiString(
  70. LPWSTR pUnicode,
  71. LPSTR pAnsi,
  72. DWORD StringLength
  73. );
  74. LPWSTR
  75. AllocateUnicodeString(
  76. LPSTR pAnsiString
  77. );
  78. void
  79. FreeUnicodeString(
  80. LPWSTR pUnicodeString
  81. );
  82. void
  83. PrintUsage(
  84. void
  85. );
  86. HRESULT
  87. ProcessArgs(
  88. int argc,
  89. char * argv[]
  90. );
  91. LPWSTR
  92. RemoveWhiteSpaces(
  93. LPWSTR pszText
  94. );
  95. #endif // __MAIN_HXX