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.

62 lines
1.2 KiB

  1. // MsiDatabase.cpp: implementation of the CMsiDatabase class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include <stdlib.h>
  6. #include "MsiDatabase.h"
  7. //////////////////////////////////////////////////////////////////////
  8. // Construction/Destruction
  9. //////////////////////////////////////////////////////////////////////
  10. /*
  11. CMsiDatabase::CMsiDatabase()
  12. {
  13. // MSIHANDLE hInstall // installer handle
  14. }
  15. */
  16. CMsiDatabase::CMsiDatabase(MSIHANDLE hInstall)
  17. {
  18. UNREFERENCED_PARAMETER( hInstall );
  19. // m_hInstall = hInstall;
  20. // m_hDatabase = MsiGetActiveDatabase(hInstall);
  21. // *m_pszBuf = new TCHAR(sizeof(BUFFERSIZE));
  22. }
  23. CMsiDatabase::~CMsiDatabase()
  24. {
  25. delete *m_pszBuf;
  26. }
  27. int CMsiDatabase::GetProperty(TCHAR* name, TCHAR** pszBuf)
  28. {
  29. DWORD cbSize = BUFFERSIZE;
  30. ZeroMemory( *m_pszBuf, BUFFERSIZE );
  31. *pszBuf = *m_pszBuf;
  32. int rt = MsiGetProperty( m_hInstall, name, *pszBuf, &cbSize );
  33. if(rt == ERROR_SUCCESS)
  34. {
  35. return TRUE;
  36. }
  37. return FALSE;
  38. }
  39. BOOL CMsiDatabase::SetProperty(TCHAR* ptName, TCHAR* ptValue)
  40. {
  41. int rt = MsiSetProperty( m_hInstall, ptName, ptValue );
  42. if(rt == ERROR_SUCCESS)
  43. {
  44. return TRUE;
  45. }
  46. return FALSE;
  47. }