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.5 KiB

  1. // adm_execresetkeyimmediate.h : Declaration of the ADM_execResetKeyImmediate class
  2. #ifndef __ADM_EXECRESETKEYIMMEDIATE_H_
  3. #define __ADM_EXECRESETKEYIMMEDIATE_H_
  4. class ADM_execResetKeyImmediateAccessor
  5. {
  6. public:
  7. LONG m_RETURNVALUE;
  8. TCHAR m_keyLastResetDate[4001];
  9. CComBSTR m_connectionString;
  10. BEGIN_PARAM_MAP(ADM_execResetKeyImmediateAccessor)
  11. SET_PARAM_TYPE(DBPARAMIO_OUTPUT)
  12. COLUMN_ENTRY(1, m_RETURNVALUE)
  13. SET_PARAM_TYPE(DBPARAMIO_INPUT | DBPARAMIO_OUTPUT)
  14. COLUMN_ENTRY(2, m_keyLastResetDate)
  15. END_PARAM_MAP()
  16. DEFINE_COMMAND(ADM_execResetKeyImmediateAccessor, _T("{ ? = CALL dbo.ADM_execResetKeyImmediate;1 (?) }"))
  17. // You may wish to call this function if you are inserting a record and wish to
  18. // initialize all the fields, if you are not going to explicitly set all of them.
  19. void ClearRecord()
  20. {
  21. memset(this, 0, sizeof(*this));
  22. }
  23. };
  24. class ADM_execResetKeyImmediate : public CCommand<CAccessor<ADM_execResetKeyImmediateAccessor> >
  25. {
  26. public:
  27. HRESULT Open()
  28. {
  29. HRESULT hr;
  30. hr = OpenDataSource();
  31. if( FAILED(hr) )
  32. return hr;
  33. return OpenRowset();
  34. }
  35. HRESULT OpenDataSource()
  36. {
  37. HRESULT hr;
  38. CDataSource db;
  39. m_keyLastResetDate[ 0 ] = NULL;
  40. hr = db.OpenFromInitializationString( m_connectionString );
  41. if( FAILED(hr) )
  42. return hr;
  43. return m_session.Open(db);
  44. }
  45. HRESULT OpenRowset()
  46. {
  47. return CCommand<CAccessor<ADM_execResetKeyImmediateAccessor> >::Open(m_session);
  48. }
  49. CSession m_session;
  50. };
  51. #endif // __ADM_EXECRESETKEYIMMEDIATE_H_