home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / rasshost.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  5KB  |  150 lines

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