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.

162 lines
4.0 KiB

  1. //#----------------------------------------------------------------------------
  2. //
  3. // File: sspspm.h
  4. //
  5. // Synopsis: Definitions specific to SSPI SPM DLL.
  6. //
  7. // Copyright (C) 1995 Microsoft Corporation. All Rights Reserved.
  8. //
  9. // Authors: LucyC Created 25 Sept 1995
  10. //
  11. //-----------------------------------------------------------------------------
  12. #ifndef _SSPSPM_H_
  13. #define _SSPSPM_H_
  14. #include <platform.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //
  19. // Names of secruity DLL
  20. //
  21. #define SSP_SPM_NT_DLL "security.dll"
  22. #define SSP_SPM_WIN95_DLL "secur32.dll"
  23. #define SSP_SPM_DLL_NAME_SIZE 16 // max. length of security DLL names
  24. #define MAX_SSPI_PKG 32 // Max. no. of SSPI supported
  25. #define SSPPKG_ERROR ((UCHAR) 0xff)
  26. #define SSPPKG_NO_PKG SSPPKG_ERROR
  27. #define MAX_AUTH_MSG_SIZE 10000
  28. #define TCP_PRINT fprintf
  29. #define DBG_CONTEXT stderr
  30. #define MAX_BLOB_SIZE 13000
  31. //
  32. // Server host list definition.
  33. // The following defines an entry in the server host list.
  34. //
  35. typedef struct _ssp_host_list
  36. {
  37. struct _ssp_host_list *pNext;
  38. unsigned char *pHostname; // name of server host
  39. unsigned char pkgID; // the package being used for this host
  40. } SspHosts, *PSspHosts;
  41. //
  42. // List of SSPI packages installed on this machine.
  43. // The following defines an entry of the SSPI package list.
  44. //
  45. typedef struct _ssp_auth_pkg
  46. {
  47. LPTSTR pName; // package name
  48. DWORD Capabilities ; // Interesting capabilities bit
  49. ULONG cbMaxToken; // max size of security token
  50. } SSPAuthPkg, *PSSPAuthPkg;
  51. #define SSPAUTHPKG_SUPPORT_NTLM_CREDS 0x00000001
  52. //
  53. // The following defines the global data structure which the SPM DLL keeps
  54. // in the HTSPM structure.
  55. //
  56. typedef struct _ssp_htspm
  57. {
  58. PSecurityFunctionTable pFuncTbl;
  59. SSPAuthPkg **PkgList; // array of pointers to auth packages
  60. UCHAR PkgCnt;
  61. BOOLEAN bKeepList; // whether to keep a list of servers
  62. PSspHosts pHostlist;
  63. } SspData, *PSspData;
  64. #define SPM_STATUS_OK 0
  65. #define SPM_ERROR 1
  66. #define SPM_STATUS_WOULD_BLOCK 2
  67. #define SPM_STATUS_INSUFFICIENT_BUFFER 3
  68. /////////////////////////////////////////////////////////////////////////////
  69. //
  70. // Function headers from sspcalls.c
  71. //
  72. /////////////////////////////////////////////////////////////////////////////
  73. DWORD
  74. GetSecAuthMsg (
  75. PSspData pData,
  76. PCredHandle pCredential,
  77. DWORD pkgID, // the package index into package list
  78. PCtxtHandle pInContext,
  79. PCtxtHandle pOutContext,
  80. ULONG fContextReq, // Request Flags
  81. VOID *pBuffIn,
  82. DWORD cbBuffIn,
  83. char *pFinalBuff,
  84. DWORD *pcbBuffOut,
  85. SEC_CHAR *pszTarget, // Server Host Name
  86. BOOL fTargetTrusted,
  87. UINT bNonBlock,
  88. LPSTR pszScheme,
  89. SECURITY_STATUS *pssResult
  90. );
  91. INT
  92. GetPkgId(LPTSTR lpszPkgName);
  93. DWORD
  94. GetPkgCapabilities(
  95. INT Package
  96. );
  97. ULONG
  98. GetPkgMaxToken(
  99. INT Package
  100. );
  101. /////////////////////////////////////////////////////////////////////////////
  102. //
  103. // Function headers from buffspm.c
  104. //
  105. /////////////////////////////////////////////////////////////////////////////
  106. PSspHosts
  107. SspSpmNewHost (
  108. PSspData pData,
  109. UCHAR *pHost, // name of server host to be added
  110. UCHAR Package
  111. );
  112. VOID
  113. SspSpmDeleteHost(
  114. SspData *pData,
  115. PSspHosts pDelHost
  116. );
  117. VOID
  118. SspSpmTrashHostList(
  119. SspData *pData
  120. );
  121. PSspHosts
  122. SspSpmGetHost(
  123. PSspData pData,
  124. UCHAR *pHost
  125. );
  126. #ifdef __cplusplus
  127. } // end extern "C" {
  128. #endif
  129. #endif /* _SSPSPM_H_ */