home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / ras / winnt / rashost / sechost.h < prev   
C/C++ Source or Header  |  1996-03-18  |  5KB  |  152 lines

  1. /********************************************************************/
  2. /**               Copyright(c) 1989 Microsoft Corporation.       **/
  3. /********************************************************************/
  4.  
  5. //***
  6. //
  7. // Filename:    sechost.h
  8. //
  9. // Description: This header defines the interface between third party security
  10. //              DLLs and the supervisor. 
  11. //
  12. // History:
  13. //    Nov 11,1994.    NarenG        Created original version.
  14. //
  15.  
  16. #ifndef _SECHOST_
  17. #define _SECHOST_
  18.  
  19. #include <lmcons.h>                 // Defines for DNLEN and UNLEN
  20.  
  21. #define DEVICE_NAME_LEN             32
  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[DEVICE_NAME_LEN+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. // Called to send data to remote host
  115. // Will return errors from winerror.h or raserror.h
  116. //
  117.  
  118. DWORD WINAPI
  119. RasSecurityDialogSend(
  120.     IN HPORT    hPort,          // RAS handle to port.
  121.     IN PBYTE    pBuffer,        // Pointer to buffer containing data to send
  122.     IN WORD     BufferLength    // Length of above buffer.
  123. );
  124.  
  125. //
  126. // Called to receive data from remote host
  127. // Will return errors from winerror.h or raserror.h
  128. //
  129.  
  130. DWORD WINAPI
  131. RasSecurityDialogReceive(
  132.     IN HPORT    hPort,          // RAS handle to port.
  133.     IN PBYTE    pBuffer,        // Pointer to buffer to receive data
  134.     IN PWORD    pBufferLength,  // length of data received in bytes.
  135.     IN DWORD    Timeout,        // in seconds
  136.     IN HANDLE   hEvent          // Event to set when receive completes or 
  137.                                 // timeouts
  138. );
  139.  
  140. //
  141. // Called to get Information about port.
  142. // Will return errors from winerror.h or raserror.h
  143. //
  144.  
  145. DWORD WINAPI
  146. RasSecurityDialogGetInfo(
  147.     IN HPORT                hPort,      // RAS handle to port.
  148.     IN RAS_SECURITY_INFO*   pBuffer     // Pointer to get info structure.
  149. );
  150.  
  151. #endif
  152.