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.

71 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000
  6. //
  7. // File: auservinternals.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "pch.h"
  11. #pragma hdrstop
  12. /*****
  13. Looks for reminder timestamp in users registry. If not found, returns
  14. failure. If found, passes the remaining timeout in seconds remaining
  15. before we should remind the user
  16. *****/
  17. HRESULT getReminderTimeout(DWORD *pdwTimeDiff, UINT * /*pIndex*/)
  18. {
  19. return getAddedTimeout(pdwTimeDiff, TIMEOUTVALUE);
  20. }
  21. HRESULT getReminderState(DWORD *pdwState)
  22. {
  23. HKEY hAUKey;
  24. LONG lRet;
  25. DWORD dwType = REG_DWORD, dwSize = sizeof(DWORD);
  26. return GetRegDWordValue(TIMEOUTSTATE,pdwState);
  27. }
  28. HRESULT removeTimeOutKeys(BOOL fLastWaitReminderKeys)
  29. {
  30. if (fLastWaitReminderKeys)
  31. {
  32. return DeleteRegValue(LASTWAITTIMEOUT);
  33. }
  34. else
  35. {
  36. HRESULT hr1 = DeleteRegValue(TIMEOUTVALUE);
  37. HRESULT hr2 = DeleteRegValue( TIMEOUTSTATE);
  38. if (FAILED(hr1) || FAILED(hr2))
  39. {
  40. return FAILED(hr1)? hr1 : hr2;
  41. }
  42. else
  43. {
  44. return S_OK;
  45. }
  46. }
  47. }
  48. HRESULT removeReminderKeys()
  49. {
  50. return removeTimeOutKeys(FALSE);
  51. }
  52. HRESULT setLastWaitTimeout(DWORD pdwLastWaitTimeout)
  53. {
  54. return setAddedTimeout(pdwLastWaitTimeout, LASTWAITTIMEOUT);
  55. }
  56. HRESULT getLastWaitTimeout(DWORD * pdwLastWaitTimeout)
  57. {
  58. return getAddedTimeout(pdwLastWaitTimeout, LASTWAITTIMEOUT);
  59. }
  60. HRESULT removeLastWaitKey(void)
  61. {
  62. return removeTimeOutKeys(TRUE);
  63. }