Source code of Windows XP (NT5)
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.

161 lines
3.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: msgina.c
  7. //
  8. // Contents: Microsoft Logon GUI DLL
  9. //
  10. // History: 7-14-94 RichardW Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #include <windows.h>
  14. #include <npapi.h>
  15. #include <ntsecapi.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. BOOL
  19. WINAPI
  20. DllMain(
  21. HINSTANCE hInstance,
  22. DWORD dwReason,
  23. LPVOID lpReserved)
  24. {
  25. switch (dwReason)
  26. {
  27. case DLL_PROCESS_ATTACH:
  28. DisableThreadLibraryCalls ( hInstance );
  29. case DLL_PROCESS_DETACH:
  30. default:
  31. return(TRUE);
  32. }
  33. }
  34. VOID
  35. DebugOut(
  36. PSTR Format,
  37. ...
  38. )
  39. {
  40. va_list ArgList;
  41. CHAR Buffer[ 256 ];
  42. va_start( ArgList, Format );
  43. _vsnprintf( Buffer, 256, Format, ArgList );
  44. OutputDebugString( Buffer );
  45. }
  46. DWORD
  47. WINAPI
  48. NPGetCaps(
  49. DWORD nIndex
  50. )
  51. {
  52. DWORD dwRes;
  53. switch (nIndex)
  54. {
  55. case WNNC_NET_TYPE:
  56. dwRes = 0xffff0000; // credential manager
  57. break;
  58. case WNNC_SPEC_VERSION:
  59. dwRes = WNNC_SPEC_VERSION51; // We are using version 5.1 of the spec.
  60. break;
  61. case WNNC_DRIVER_VERSION:
  62. dwRes = 1; // This driver is version 1.
  63. break;
  64. case WNNC_START:
  65. dwRes = 1; // We are already "started"
  66. break;
  67. default:
  68. dwRes = 0; // We don't support anything else
  69. break;
  70. }
  71. return dwRes;
  72. }
  73. /****************************************************************************
  74. FUNCTION: NPLogonNotify
  75. PURPOSE: This entry point is called when a user logs on. If the user
  76. authentication fails here, the user will still be logged on
  77. to the local machine.
  78. *******************************************************************************/
  79. DWORD
  80. WINAPI
  81. NPLogonNotify (
  82. PLUID lpLogonId,
  83. LPCWSTR lpAuthentInfoType,
  84. LPVOID lpAuthentInfo,
  85. LPCWSTR lpPreviousAuthentInfoType,
  86. LPVOID lpPreviousAuthentInfo,
  87. LPWSTR lpStationName,
  88. LPVOID StationHandle,
  89. LPWSTR *lpLogonScript
  90. )
  91. {
  92. PMSV1_0_INTERACTIVE_LOGON pAuthInfo;
  93. //
  94. // Write out some information about the logon attempt
  95. //
  96. DebugOut( "NPLogonNotify\n" );
  97. DebugOut( "lpAuthentInfoType=%ws lpStationName=%ws\r\n",
  98. lpAuthentInfoType, lpStationName);
  99. // Do something with the authentication information
  100. //
  101. pAuthInfo = (PMSV1_0_INTERACTIVE_LOGON) lpAuthentInfo;
  102. DebugOut( "LogonDomain=%ws User=%ws\r\n",
  103. pAuthInfo->LogonDomainName.Buffer,
  104. pAuthInfo->UserName.Buffer);
  105. return NO_ERROR;
  106. }
  107. /****************************************************************************
  108. FUNCTION: NPPasswordChangeNotify
  109. PURPOSE: This function is used to notify a credential manager provider
  110. of a password change (or, more accurately, an authentication
  111. information change) for an account.
  112. *******************************************************************************/
  113. DWORD
  114. WINAPI
  115. NPPasswordChangeNotify (
  116. LPCWSTR lpAuthentInfoType,
  117. LPVOID lpAuthentInfo,
  118. LPCWSTR lpPreviousAuthentInfoType,
  119. LPVOID lpPreviousAuthentInfo,
  120. LPWSTR lpStationName,
  121. LPVOID StationHandle,
  122. DWORD dwChangeInfo
  123. )
  124. {
  125. DebugOut( "NPPasswordChangeNotify\n" );
  126. return NO_ERROR;
  127. }