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.

75 lines
2.6 KiB

  1. //=================================================================
  2. //
  3. // SecurityApi.h
  4. //
  5. // Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef _SECUR_H_
  9. #define _SECUR_H_
  10. /******************************************************************************
  11. * #includes to Register this class with the CResourceManager.
  12. *****************************************************************************/
  13. extern const GUID g_guidSecurApi;
  14. extern const TCHAR g_tstrSecur[];
  15. /******************************************************************************
  16. * Function pointer typedefs. Add new functions here as required.
  17. *****************************************************************************/
  18. #define SECURITY_WIN32
  19. #include <sspi.h>
  20. #include <schnlsp.h> //for UNISP_NAME_A
  21. /******************************************************************************
  22. * Wrapper class for Ws2_32 load/unload, for registration with CResourceManager.
  23. ******************************************************************************/
  24. class CSecurityApi : public CDllWrapperBase
  25. {
  26. private:
  27. // Member variables (function pointers) pointing to CSecur functions.
  28. // Add new functions here as required.
  29. PSecurityFunctionTableW (WINAPI *m_pfnInitSecurityInterface)();
  30. PSecurityFunctionTableW m_pSecFuncTable;
  31. public:
  32. // Constructor and destructor:
  33. CSecurityApi( LPCTSTR a_tstrWrappedDllName ) ;
  34. ~CSecurityApi();
  35. // Inherrited initialization function.
  36. virtual bool Init();
  37. // suppoorted APIs
  38. SECURITY_STATUS AcquireCredentialsHandleW
  39. (
  40. SEC_WCHAR SEC_FAR * pszPrincipal, // Name of principal
  41. SEC_WCHAR SEC_FAR * pszPackage, // Name of package
  42. unsigned long fCredentialUse, // Flags indicating use
  43. void SEC_FAR * pvLogonId, // Pointer to logon ID
  44. void SEC_FAR * pAuthData, // Package specific data
  45. SEC_GET_KEY_FN pGetKeyFn, // Pointer to GetKey() func
  46. void SEC_FAR * pvGetKeyArgument, // Value to pass to GetKey()
  47. PCredHandle phCredential, // (out) Cred Handle
  48. PTimeStamp ptsExpiry // (out) Lifetime (optional)
  49. );
  50. SECURITY_STATUS QueryCredentialsAttributesW(
  51. PCredHandle phCredential, // Credential to query
  52. unsigned long ulAttribute, // Attribute to query
  53. void SEC_FAR * pBuffer // Buffer for attributes
  54. );
  55. SECURITY_STATUS FreeCredentialsHandle(
  56. PCredHandle phCredential // Handle to free
  57. );
  58. };
  59. #endif