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.

110 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. lsaspmlpcapi.cxx
  6. Abstract:
  7. This file provides useful accssors and mutators.
  8. Author:
  9. Larry Zhu (LZhu) May 1, 2001 Created
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #include "precomp.hxx"
  15. #pragma hdrstop
  16. #include "lsaspmlpcapi.hxx"
  17. TSPMLPCAPI::TSPMLPCAPI(void) : m_hr(E_FAIL)
  18. {
  19. }
  20. TSPMLPCAPI::TSPMLPCAPI(IN ULONG64 baseOffset)
  21. : m_baseOffset(baseOffset), m_hr(E_FAIL)
  22. {
  23. m_hr = Initialize();
  24. }
  25. TSPMLPCAPI::~TSPMLPCAPI(void)
  26. {
  27. }
  28. HRESULT TSPMLPCAPI::IsValid(void) const
  29. {
  30. return m_hr;
  31. }
  32. USHORT TSPMLPCAPI::GetfAPI() const
  33. {
  34. USHORT fAPI = 0;
  35. ReadStructField(m_baseOffset, kstrSpmLpcApi, "fAPI", sizeof(fAPI), &fAPI);
  36. return fAPI;
  37. }
  38. ULONG64 TSPMLPCAPI::GetContextPointer(void) const
  39. {
  40. return ReadStructPtrField(m_baseOffset, kstrSpmLpcApi, "ContextPointer");
  41. }
  42. /******************************************************************************
  43. Private Methods
  44. ******************************************************************************/
  45. /*++
  46. Routine Name:
  47. Initialize
  48. Routine Description:
  49. Do necessary initialization.
  50. Arguments:
  51. None
  52. Return Value:
  53. An HRESULT
  54. --*/
  55. HRESULT TSPMLPCAPI::Initialize(void)
  56. {
  57. HRESULT hRetval = E_FAIL;
  58. ULONG fieldOffset = 0;
  59. hRetval = NO_ERROR == GetFieldOffset(kstrSpmLpcApi, "API", &fieldOffset) ? S_OK : E_FAIL;
  60. if (SUCCEEDED(hRetval)) {
  61. hRetval = TSPM_API::Initialize(m_baseOffset + fieldOffset);
  62. }
  63. return hRetval;
  64. }
  65. HRESULT TSPMLPCAPI::Initialize(IN ULONG64 baseOffset)
  66. {
  67. m_baseOffset = baseOffset;
  68. m_hr = Initialize();
  69. return m_hr;
  70. }