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.

57 lines
1.4 KiB

  1. /************************************************************************************************
  2. Copyright (c) 2001 Microsoft Corporation
  3. File Name: NTAuth.h
  4. Abstract: Defines the class to do NTLM authentication
  5. Notes:
  6. History: 10/10/2001 Created by Hao Yu (haoyu)
  7. ************************************************************************************************/
  8. #ifndef _POP3_NTAUTH_
  9. #define _POP3_NTAUTH_
  10. #define SECURITY_WIN32
  11. #include <security.h>
  12. #define SEC_SUCCESS(Status) ((Status) >= 0)
  13. #include <p3admin.h>
  14. #define AUTH_BUF_SIZE 4096
  15. #define NT_SEC_DLL_NAME _T("\\System32\\Secur32.dll")
  16. #define NTLM_PACKAGE _T("NTLM")
  17. class CAuthServer
  18. {
  19. public:
  20. CAuthServer();
  21. ~CAuthServer();
  22. HRESULT InitCredential();
  23. HRESULT HandShake(LPBYTE pInBuf,
  24. DWORD cbInBufSize,
  25. LPBYTE pOutBuf,
  26. PDWORD pcbOutBufSize);
  27. HRESULT GetUserName(WCHAR *wszUserName);
  28. void Cleanup();
  29. static HRESULT GlobalInit();
  30. static void GlobalUninit();
  31. private:
  32. static long m_glInit;
  33. static PSecurityFunctionTable m_gpFuncs;
  34. static HINSTANCE m_ghLib;
  35. static IP3Config *m_gpIConfig;
  36. bool m_bInit;
  37. bool m_bFirstCall;
  38. bool m_bHaveSecContext;
  39. CredHandle m_hCredHandle;
  40. CtxtHandle m_hSecContext;
  41. };
  42. #endif //_POP3_NTAUTH_