home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / rasshost.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.6 KB  |  156 lines

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