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.

158 lines
3.4 KiB

  1. #include <tchar.h>
  2. #ifndef _THREAD_TEST
  3. #define _THREAD_TEST
  4. #include <windows.h>
  5. #define SECURITY_WIN32
  6. #include <sspi.h>
  7. #include <issperr.h>
  8. typedef struct _UI_CONTROL {
  9. LPTSTR szUserName;
  10. LPTSTR szPassword;
  11. BOOL fPersist;
  12. DWORD dwCount;
  13. HWND hOK;
  14. HWND hUserName;
  15. HWND hPassword;
  16. HWND hPasswordSave;
  17. } UI_CONTROL, * LPUI_CONTROL;
  18. ///////////////////////// DIALOG OPERATION MODES ////////////////////////////
  19. #define MODE_IE_ONLY 0x00000001
  20. #define MODE_ALL 0x0000ffff
  21. ///////////////////////// DEBUG PRINTING STUFF ////////////////////////////
  22. #define INFO 10
  23. #define ENTRY_EXIT 20
  24. #define STATISTICS 40
  25. #define API 50
  26. #define ERROR 60
  27. #define FATAL 70
  28. ///////////////////////// DEBUG PRINTING STUFF ////////////////////////////
  29. #define DEBUG_PRINT
  30. ////////////////////// function prototypes ////////////////////////////////
  31. int
  32. __cdecl dprintf( DWORD dwCategory, char * format, ... );
  33. VOID InitializeSecurityInterface(BOOL fDirect);
  34. SECURITY_STATUS
  35. DoAuthenticate(PCredHandle phCred,
  36. PCtxtHandle phCtxt,
  37. PCtxtHandle phNewCtxt,
  38. DWORD fContextAttr,
  39. LPSTR szHeader,
  40. LPSTR szRealm,
  41. LPSTR szHost,
  42. LPSTR szUrl,
  43. LPSTR szMethod,
  44. LPSTR szUser,
  45. LPSTR szPass,
  46. LPSTR szNonce,
  47. HWND hWnd,
  48. LPSTR szResponse,
  49. DWORD cbResponse);
  50. BOOL HaveDigest();
  51. SECURITY_STATUS
  52. LogoffOfDigestPkg(
  53. PCredHandle phCred);
  54. SECURITY_STATUS
  55. LogonToDigestPkg(
  56. LPSTR szAppCtx,
  57. LPSTR szUserCtx,
  58. PCredHandle phCred);
  59. VOID
  60. PrimeCredCache(
  61. CredHandle CredHandle,
  62. LPSTR szRealm,
  63. LPSTR szUser,
  64. LPSTR szPass);
  65. extern PSecurityFunctionTable g_pFuncTbl;
  66. extern HINSTANCE hSecLib;
  67. #define SEC_SUCCESS(Status) ((Status) >= 0)
  68. LPSTR
  69. issperr2str( SECURITY_STATUS error );
  70. SECURITY_STATUS
  71. _InitializeSecurityContext(
  72. PCredHandle phCred,
  73. PCtxtHandle phCtxt,
  74. PCtxtHandle phNewCtxt,
  75. DWORD fContextAttr,
  76. LPSTR szHeader,
  77. LPSTR szRealm,
  78. LPSTR szHost,
  79. LPSTR szUrl,
  80. LPSTR szMethod,
  81. LPSTR szUser,
  82. LPSTR szPass,
  83. LPSTR szNonce,
  84. HWND hWnd,
  85. LPSTR szResponse,
  86. DWORD cbResponse);
  87. typedef struct _ISC_PARAMS {
  88. // Return value
  89. SECURITY_STATUS ss;
  90. PCredHandle phCred;
  91. PCtxtHandle phCtxt;
  92. PCtxtHandle phNewCtxt;
  93. DWORD fContextReq;
  94. LPSTR szHeader;
  95. LPSTR szRealm;
  96. LPSTR szHost;
  97. LPSTR szUrl;
  98. LPSTR szMethod;
  99. LPSTR szUser;
  100. LPSTR szPass;
  101. LPSTR szNonce;
  102. HWND hWnd;
  103. // response stored here
  104. LPSTR szResponse;
  105. DWORD cbResponse;
  106. } ISC_PARAMS, *LPISC_PARAMS;
  107. //
  108. // the thread which calls UI
  109. //
  110. void __cdecl fnUiThread( LPVOID lpData );
  111. BOOL
  112. SetUIUserNameAndPassword(
  113. LPSTR szUsername,
  114. LPSTR szPassword,
  115. BOOL fPersist);
  116. BOOL CALLBACK EnumerateWindowCallback(HWND hwnd, LPARAM lParam);
  117. BOOL
  118. GenerateServerChallenge(
  119. LPSTR szChallenge,
  120. DWORD cbChallenge);
  121. class CSessionAttributeList;
  122. class CSessionList;
  123. extern CSessionAttributeList * g_pSessionAttributeList;
  124. extern CSessionList * g_pSessionList;
  125. #endif