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.

116 lines
2.9 KiB

  1. /*++
  2. Module Name:
  3. wrapmaps.cpp
  4. Abstract:
  5. wrapper classes for the mapper classes provided by phillich. See the headers in iismap.hxx
  6. These wrappers simplify the code interfaces for accessing the data.
  7. Author:
  8. Boyd Multerer boydm
  9. Boyd Multerer boydm 4/16/97
  10. --*/
  11. //C:\nt\public\sdk\lib\i386
  12. #include "stdafx.h"
  13. #include "WrapMaps.h"
  14. //#define IISMDB_INDEX_CERT11_CERT 0
  15. //#define IISMDB_INDEX_CERT11_NT_ACCT 1
  16. //#define IISMDB_INDEX_CERT11_NAME 2
  17. //#define IISMDB_INDEX_CERT11_ENABLED 3
  18. //#define IISMDB_INDEX_CERT11_NB 4
  19. //----------------------------------------------------------------
  20. BOOL C11Mapping::GetCertificate( PUCHAR* ppCert, DWORD* pcbCert )
  21. {
  22. *ppCert = (PUCHAR)m_pCert;
  23. *pcbCert = m_cbCert;
  24. return TRUE;
  25. }
  26. //----------------------------------------------------------------
  27. BOOL C11Mapping::SetCertificate( PUCHAR pCert, DWORD cbCert )
  28. {
  29. // we want to store a copy of the certificate - first free any existing cert
  30. if ( m_pCert )
  31. {
  32. GlobalFree( m_pCert );
  33. cbCert = 0;
  34. m_pCert = NULL;
  35. }
  36. // copy in the new one
  37. m_pCert = (PVOID)GlobalAlloc( GPTR, cbCert );
  38. if ( !m_pCert ) return FALSE;
  39. CopyMemory( m_pCert, pCert, cbCert );
  40. m_cbCert = cbCert;
  41. return TRUE;
  42. }
  43. //----------------------------------------------------------------
  44. BOOL C11Mapping::GetNTAccount( CString &szAccount )
  45. {
  46. szAccount = m_szAccount;
  47. return TRUE;
  48. }
  49. //----------------------------------------------------------------
  50. BOOL C11Mapping::SetNTAccount( CString szAccount )
  51. {
  52. m_szAccount = szAccount;
  53. return TRUE;
  54. }
  55. //----------------------------------------------------------------
  56. BOOL C11Mapping::GetNTPassword( CString &szPassword )
  57. {
  58. szPassword = m_szPassword;
  59. return TRUE;
  60. }
  61. //----------------------------------------------------------------
  62. BOOL C11Mapping::SetNTPassword( CString szPassword )
  63. {
  64. m_szPassword = szPassword;
  65. return TRUE;
  66. }
  67. //----------------------------------------------------------------
  68. BOOL C11Mapping::GetMapName( CString &szName )
  69. {
  70. szName = m_szName;
  71. return TRUE;
  72. }
  73. //----------------------------------------------------------------
  74. BOOL C11Mapping::SetMapName( CString szName )
  75. {
  76. m_szName = szName;
  77. return TRUE;
  78. }
  79. //----------------------------------------------------------------
  80. // the enabled flag is considered try if the SIZE of data is greater
  81. // than zero. Apparently the content doesn't matter.
  82. BOOL C11Mapping::GetMapEnabled( BOOL* pfEnabled )
  83. {
  84. *pfEnabled = m_fEnabled;
  85. return TRUE;
  86. }
  87. //----------------------------------------------------------------
  88. // the enabled flag is considered try if the SIZE of data is greater
  89. // than zero. Apparently the content doesn't matter.
  90. BOOL C11Mapping::SetMapEnabled( BOOL fEnabled )
  91. {
  92. m_fEnabled = fEnabled;
  93. return TRUE;
  94. }