RassHost.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:4k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4.     rasshost.h
  5. Abstract:
  6.     This header defines the interface between third party security
  7.     DLLs and the RAS server.
  8.     
  9. --*/
  10. #ifndef _RASSHOST_
  11. #define _RASSHOST_
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #include <mprapi.h>
  16. typedef DWORD  HPORT;
  17. typedef struct _SECURITY_MESSAGE
  18. {
  19.     DWORD dwMsgId;
  20.     HPORT hPort;
  21.     DWORD dwError;                  // Should be non-zero only if error
  22.                                     // occurred during the security dialog.
  23.                                     // Should contain errors from winerror.h
  24.                                     // or raserror.h
  25.     CHAR  UserName[UNLEN+1];        // Should always contain username if
  26.                                     // dwMsgId is SUCCESS/FAILURE
  27.     CHAR  Domain[DNLEN+1];          // Should always contain domain if
  28.                                     // dwMsgId is SUCCESS/FAILURE
  29. } SECURITY_MESSAGE, *PSECURITY_MESSAGE;
  30. // Values for dwMsgId in SECURITY_MESSAGE structure
  31. #define SECURITYMSG_SUCCESS     1
  32. #define SECURITYMSG_FAILURE     2
  33. #define SECURITYMSG_ERROR       3
  34. // Used by RasSecurityGetInfo call
  35. typedef struct _RAS_SECURITY_INFO
  36. {
  37.     DWORD LastError;                    // SUCCESS = receive completed
  38.                                         // PENDING = receive pending
  39.                                         // else completed with error
  40.     DWORD BytesReceived;                // only valid if LastError == SUCCESS
  41.     CHAR  DeviceName[MAX_DEVICE_NAME+1];
  42. }RAS_SECURITY_INFO,*PRAS_SECURITY_INFO;
  43. typedef DWORD (WINAPI *RASSECURITYPROC)();
  44. //
  45. // Called by third party DLL to notify the supervisor of termination of
  46. // the security dialog
  47. //
  48. VOID WINAPI
  49. RasSecurityDialogComplete(
  50.     IN SECURITY_MESSAGE * pSecMsg       // Pointer to the above info. structure
  51. );
  52. //
  53. // Called by supervisor into the security DLL to notify it to begin the
  54. // security dialog for a client.
  55. //
  56. // Should return errors from winerror.h or raserror.h
  57. //
  58. DWORD WINAPI
  59. RasSecurityDialogBegin(
  60.     IN HPORT  hPort,        // RAS handle to port
  61.     IN PBYTE  pSendBuf,     // Pointer to the buffer used in
  62.                             // RasSecurityDialogSend
  63.     IN DWORD  SendBufSize,  // Size of above bufer in bytes
  64.     IN PBYTE  pRecvBuf,     // Pointer to the buffer used in
  65.                             // RasSecurityDialogReceive
  66.     IN DWORD  RecvBufSize,  // Size of above buffer
  67.     IN VOID  (WINAPI *RasSecurityDialogComplete)( SECURITY_MESSAGE* )
  68.                             // Pointer to function RasSecurityDialogComplete.
  69.                             // Guaranteed to be the same on every call.
  70. );
  71. //
  72. // Called by supervisor into the security DLL to notify it to stop the
  73. // security dialog for a client. If this call returns an error, then it is not
  74. // neccesary for the dll to call RasSecurityDialogComplete. Otherwise the DLL
  75. // must call RasSecurityDialogComplete.
  76. //
  77. // Should return errors from winerror.h or raserror.h
  78. //
  79. DWORD WINAPI
  80. RasSecurityDialogEnd(
  81.     IN HPORT    hPort           // RAS handle to port.
  82. );
  83. //
  84. // The following entrypoints should be loaded by calling GetProcAddress from
  85. // RasMan.lib
  86. //
  87. // Called to send data to remote host
  88. // Will return errors from winerror.h or raserror.h
  89. //
  90. DWORD WINAPI
  91. RasSecurityDialogSend(
  92.     IN HPORT    hPort,          // RAS handle to port.
  93.     IN PBYTE    pBuffer,        // Pointer to buffer containing data to send
  94.     IN WORD     BufferLength    // Length of above buffer.
  95. );
  96. //
  97. // Called to receive data from remote host
  98. // Will return errors from winerror.h or raserror.h
  99. //
  100. DWORD WINAPI
  101. RasSecurityDialogReceive(
  102.     IN HPORT    hPort,          // RAS handle to port.
  103.     IN PBYTE    pBuffer,        // Pointer to buffer to receive data
  104.     IN PWORD    pBufferLength,  // length of data received in bytes.
  105.     IN DWORD    Timeout,        // in seconds
  106.     IN HANDLE   hEvent          // Event to set when receive completes or
  107.                                 // timeouts
  108. );
  109. //
  110. // Called to get Information about port.
  111. // Will return errors from winerror.h or raserror.h
  112. //
  113. DWORD WINAPI
  114. RasSecurityDialogGetInfo(
  115.     IN HPORT                hPort,      // RAS handle to port.
  116.     IN RAS_SECURITY_INFO*   pBuffer     // Pointer to get info structure.
  117. );
  118. #endif