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.

64 lines
1.7 KiB

  1. enum
  2. {
  3. KEY_EXPIRE_STATUS_INVALIDKEY = 0,
  4. KEY_EXPIRE_STATUS_OK,
  5. KEY_EXPIRE_STATUS_EXIRES_SOON,
  6. KEY_EXPIRE_STATUS_EXPIRED
  7. };
  8. // forward declare the service class
  9. class CW3KeyService;
  10. //-------------------------------------------------------------
  11. // This is the key object
  12. class CW3Key : public CCmnKey
  13. {
  14. public:
  15. CW3Key();
  16. ~CW3Key();
  17. void UpdateCaption( void );
  18. // init from keyset key
  19. BOOL FInitKey( HANDLE hPolicy, PWCHAR pwszName );
  20. // init from stored keyset key
  21. BOOL FInitKey( PVOID pData, DWORD cbSrc );
  22. // copy the members from a key into this key
  23. virtual void CopyDataFrom( CKey* pKey );
  24. // make a copy of the key
  25. virtual CKey* PClone( void );
  26. BOOL FIsDefault( void )
  27. { return m_fDefault; }
  28. void SetDefault();
  29. void OnProperties();
  30. // generate a handle containing data that gets stored and then is used to restore
  31. // the key object at a later date. Restore this key by passing this dereferenced
  32. // handle back into the FInitKey routine above.
  33. HANDLE HGenerateDataHandle( BOOL fIncludePassword );
  34. BOOL InitializeFromPointer( PUCHAR pSrc, DWORD cbSrc );
  35. // install a cert
  36. BOOL FInstallCertificate( PVOID pCert, DWORD cbCert, CString &szPass );
  37. // The key dirty routine actually just calls the host machine's dirty routine
  38. // BOOL FSetDirty( void );
  39. // save this key out as a set of secrets
  40. BOOL WriteKey( HANDLE hPolicy, WORD iKey, PWCHAR pwcharName );
  41. BOOL WriteW3Keys( HANDLE hPolicy, WCHAR* pWName );
  42. BOOL ImportW3Key( HANDLE hPolicy, WCHAR* pWName );
  43. // data used to maintain links to servers
  44. BOOL m_fDefault;
  45. CString m_szIPAddress;
  46. protected:
  47. // DO declare all this DYNCREATE
  48. DECLARE_DYNCREATE(CW3Key);
  49. private:
  50. };