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.

134 lines
3.4 KiB

  1. // *********************************************************************************
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // Module Name:
  6. //
  7. // pch.h
  8. //
  9. // Abstract:
  10. //
  11. // This module is a precompiled header file for the common functionality
  12. //
  13. // Author:
  14. //
  15. // Sunil G.V.N. Murali ([email protected]) 1-Sep-2000
  16. //
  17. // Revision History:
  18. //
  19. // Sunil G.V.N. Murali ([email protected]) 1-Sep-2000 : Created It.
  20. //
  21. // *********************************************************************************
  22. #ifndef __PCH_H
  23. #define __PCH_H
  24. #if _MSC_VER > 1000
  25. #pragma once
  26. #endif // _MSC_VER > 1000
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #if !defined( SECURITY_WIN32 ) && !defined( SECURITY_KERNEL ) && !defined( SECURITY_MAC )
  31. #define SECURITY_WIN32
  32. #endif
  33. //
  34. // Private nt headers.
  35. //
  36. #include <nt.h>
  37. #include <ntrtl.h>
  38. #include <nturtl.h>
  39. #include <ntexapi.h>
  40. #include <Security.h>
  41. #include <SecExt.h>
  42. #include <shlwapi.h>
  43. //
  44. // public Windows header files
  45. //
  46. #include <tchar.h>
  47. #include <windows.h>
  48. #include <winsock2.h>
  49. #include <lm.h>
  50. #include <io.h>
  51. #include <limits.h>
  52. #include <strsafe.h>
  53. //
  54. // public C header files
  55. //
  56. #include <stdio.h>
  57. #include <stdlib.h>
  58. #include <string.h>
  59. #include <malloc.h>
  60. #include <errno.h>
  61. //
  62. // private headers
  63. //
  64. #include "cmdlineres.h"
  65. #include "cmdline.h"
  66. //
  67. // externs
  68. //
  69. extern BOOL g_bInitialized;
  70. //
  71. // custom purpose macros
  72. //
  73. #define CLEAR_LAST_ERROR() \
  74. SetLastError( NO_ERROR ); \
  75. 1
  76. #define OUT_OF_MEMORY() \
  77. if ( GetLastError() == NO_ERROR ) \
  78. { \
  79. SetLastError( ERROR_NOT_ENOUGH_MEMORY ); \
  80. } \
  81. 1
  82. #define INVALID_PARAMETER() \
  83. if ( GetLastError() == NO_ERROR ) \
  84. { \
  85. SetLastError( ERROR_INVALID_PARAMETER ); \
  86. } \
  87. 1
  88. #define UNEXPECTED_ERROR() \
  89. if ( GetLastError() == NO_ERROR ) \
  90. { \
  91. SetLastError( ERROR_PROCESS_ABORTED ); \
  92. } \
  93. 1
  94. #define INVALID_SYNTAX() \
  95. SetLastError( (DWORD) MK_E_SYNTAX ); \
  96. 1
  97. //
  98. // internal functions
  99. //
  100. LPWSTR GetInternalTemporaryBufferRef( IN DWORD dwIndexNumber );
  101. LPWSTR GetInternalTemporaryBuffer( DWORD dwIndexNumber,
  102. LPCWSTR pwszText,
  103. DWORD dwLength, BOOL bNullify );
  104. //
  105. // temporary buffer index start positions -- file wise
  106. #define INDEX_TEMP_CMDLINE_C 0
  107. #define TEMP_CMDLINE_C_COUNT 7
  108. #define INDEX_TEMP_CMDLINEPARSER_C (INDEX_TEMP_CMDLINE_C + TEMP_CMDLINE_C_COUNT)
  109. #define TEMP_CMDLINEPARSER_C_COUNT 6
  110. #define INDEX_TEMP_RMTCONNECTIVITY_C (INDEX_TEMP_CMDLINEPARSER_C + TEMP_CMDLINEPARSER_C_COUNT)
  111. #define TEMP_RMTCONNECTIVITY_C_COUNT 6
  112. #define INDEX_TEMP_SHOWRESULTS_C (INDEX_TEMP_RMTCONNECTIVITY_C + TEMP_RMTCONNECTIVITY_C_COUNT)
  113. #define TEMP_SHOWRESULTS_C_COUNT 4
  114. #endif // __PCH_H