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.

121 lines
3.1 KiB

  1. /*****************************************************************************\
  2. * MODULE: basicsec.c
  3. *
  4. * Security routines.
  5. *
  6. *
  7. * Copyright (C) 1996-1997 Microsoft Corporation
  8. * Copyright (C) 1996-1997 Hewlett Packard
  9. *
  10. * History:
  11. * 07-Oct-1996 HWP-Guys Initiated port from win95 to winNT
  12. *
  13. \*****************************************************************************/
  14. #ifdef NOT_IMPLEMENTED
  15. #include "precomp.h"
  16. #include "priv.h"
  17. // NOTE: Currently, this module is not implemented. In the future this
  18. // could be functional, but it's not necessary for this particular
  19. // implementation.
  20. //
  21. // 30-Oct-1996 : ChrisWil (HWP)
  22. //
  23. /*****************************************************************************\
  24. * AuthenticateUser
  25. *
  26. *
  27. \*****************************************************************************/
  28. DWORD AuthenticateUser(
  29. LPVOID *lppvContext,
  30. LPTSTR lpszServerName,
  31. LPTSTR lpszScheme,
  32. DWORD dwFlags,
  33. LPSTR lpszInBuffer,
  34. DWORD dwInBufferLength,
  35. LPTSTR lpszUserName,
  36. LPTSTR lpszPassword)
  37. {
  38. DBG_MSG(DBG_LEV_WARN, (TEXT("Call: AuthenticateUser: Not Implemented")));
  39. return ERROR_SUCCESS;
  40. }
  41. /*****************************************************************************\
  42. * UnloadAuthenticateUser
  43. *
  44. *
  45. \*****************************************************************************/
  46. VOID UnloadAuthenticateUser(
  47. LPVOID *lppvContext,
  48. LPTSTR lpszServer,
  49. LPTSTR lpszScheme)
  50. {
  51. DBG_MSG(DBG_LEV_WARN, (TEXT("Call: AuthenticateUser: Not Implemented")));
  52. return ERROR_SUCCESS;
  53. }
  54. /*****************************************************************************\
  55. * PreAuthenticateUser
  56. *
  57. *
  58. \*****************************************************************************/
  59. DWORD PreAuthenticateUser(
  60. LPVOID *lppvContext,
  61. LPTSTR lpszServerName,
  62. LPTSTR lpszScheme,
  63. DWORD dwFlags,
  64. LPSTR lpszInBuffer,
  65. DWORD dwInBufferLength,
  66. LPSTR lpszOutBuffer,
  67. LPDWORD lpdwOutBufferLength,
  68. LPTSTR lpszUserName,
  69. LPTSTR lpszPassword)
  70. {
  71. DBG_MSG(DBG_LEV_WARN, (TEXT("Call: AuthenticateUser: Not Implemented")));
  72. return ERROR_SUCCESS;
  73. }
  74. /*****************************************************************************\
  75. * GetTokenHandle
  76. *
  77. * Stolen from windows\base\username.c. Must close the handle that is
  78. * returned.
  79. *
  80. \*****************************************************************************/
  81. #define GETTOK_FLGS (TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY)
  82. BOOL GetTokenHandle(
  83. PHANDLE phToken)
  84. {
  85. if (!OpenThreadToken(GetCurrentThread(), GETTOK_FLGS, TRUE, phToken)) {
  86. if (GetLastError() == ERROR_NO_TOKEN) {
  87. // This means we are not impersonating anybody.
  88. // Instead, lets get the token out of the process.
  89. //
  90. if (!OpenProcessToken(GetCurrentProcess(), GETTOK_FLGS, phToken)) {
  91. return FALSE;
  92. }
  93. } else {
  94. return FALSE;
  95. }
  96. }
  97. return TRUE;
  98. }
  99. #endif