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.

175 lines
4.1 KiB

  1. //============================================================================
  2. // Copyright (c) 1996, Microsoft Corporation
  3. //
  4. // File: nthdr1.h
  5. //
  6. // History:
  7. // Abolade-Gbadegesin 04-02-96 Created.
  8. //
  9. // This file contains macros to hide differences in implementation
  10. // of the scripting between Win9x and Windows NT
  11. //============================================================================
  12. #ifndef _NTHDR1_H_
  13. #define _NTHDR1_H_
  14. //
  15. // declare data-type for return codes
  16. //
  17. #ifndef _HRESULT_DEFINED
  18. #define _HRESULT_DEFINED
  19. typedef LONG HRESULT;
  20. #endif //!_HRESULT_DEFINED
  21. //
  22. // undefine registry-string redefined by rnap.h
  23. //
  24. #ifdef REGSTR_VAL_MODE
  25. #undef REGSTR_VAL_MODE
  26. #endif
  27. //
  28. // define critical-section initialization function needed by common.c
  29. //
  30. #define ReinitializeCriticalSection InitializeCriticalSection
  31. //
  32. // provide dummy definiton of ContextHelp for terminal.c
  33. //
  34. #define ContextHelp(a,b,c,d)
  35. //
  36. // macros used for CRT-style Unicode<->ANSI conversion
  37. //
  38. #define WCSTOMBS(a,b) \
  39. WideCharToMultiByte( \
  40. CP_ACP, 0, (b), -1, (a), lstrlenW(b) + 1, NULL, NULL \
  41. )
  42. #define MBSTOWCS(a, b) \
  43. MultiByteToWideChar( \
  44. CP_ACP, 0, (b), -1, (a), (lstrlenW(b) + 1) * sizeof(WCHAR) \
  45. )
  46. //
  47. // constants used for RASMAN I/O
  48. //
  49. #define SIZE_RecvBuffer 1024
  50. #define SIZE_ReceiveBuf SIZE_RecvBuffer
  51. #define SIZE_SendBuffer 1
  52. #define SIZE_SendBuf SIZE_SendBuffer
  53. #define SECS_RecvTimeout 1
  54. //----------------------------------------------------------------------------
  55. // Function: RxLogErrors
  56. //
  57. // Logs script-syntax-errors to a file.
  58. //----------------------------------------------------------------------------
  59. DWORD
  60. RxLogErrors(
  61. IN HANDLE hscript,
  62. IN VOID* hsaStxerr
  63. );
  64. //----------------------------------------------------------------------------
  65. // Function: RxReadFile
  66. //
  67. // Transfers data out of a RASMAN buffer into the circular buffer
  68. // used by the Win9x scripting code
  69. //----------------------------------------------------------------------------
  70. BOOL
  71. RxReadFile(
  72. IN HANDLE hscript,
  73. IN BYTE* pBuffer,
  74. IN DWORD dwBufferSize,
  75. OUT DWORD* pdwBytesRead
  76. );
  77. //----------------------------------------------------------------------------
  78. // Function: RxSetIPAddress
  79. //
  80. // Sets the IP address for the script's RAS entry
  81. //----------------------------------------------------------------------------
  82. DWORD
  83. RxSetIPAddress(
  84. IN HANDLE hscript,
  85. IN LPCSTR lpszAddress
  86. );
  87. //----------------------------------------------------------------------------
  88. // Function: RxSetKeyboard
  89. //
  90. // Signals the script-owner to enable or disable keyboard input.
  91. //----------------------------------------------------------------------------
  92. DWORD
  93. RxSetKeyboard(
  94. IN HANDLE hscript,
  95. IN BOOL bEnable
  96. );
  97. //----------------------------------------------------------------------------
  98. // Function: RxSendCreds
  99. //
  100. // Sends users password over the wire.
  101. //----------------------------------------------------------------------------
  102. DWORD
  103. RxSendCreds(
  104. IN HANDLE hscript,
  105. IN CHAR controlchar
  106. );
  107. //----------------------------------------------------------------------------
  108. // Function: RxSetPortData
  109. //
  110. // Changes settings for the COM port.
  111. //----------------------------------------------------------------------------
  112. DWORD
  113. RxSetPortData(
  114. IN HANDLE hscript,
  115. IN VOID* pStatement
  116. );
  117. //----------------------------------------------------------------------------
  118. // Function: RxWriteFile
  119. //
  120. // Transmits the given buffer thru RASMAN on a port
  121. //----------------------------------------------------------------------------
  122. VOID
  123. RxWriteFile(
  124. IN HANDLE hscript,
  125. IN BYTE* pBuffer,
  126. IN DWORD dwBufferSize,
  127. OUT DWORD* pdwBytesWritten
  128. );
  129. #endif // _NTHDR1_H_