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.

66 lines
1.8 KiB

  1. // header for the W3Service object
  2. #define KEYSET_LIST L"W3_KEY_LIST"
  3. #define KEYSET_PUB_KEY L"W3_PUBLIC_KEY_%s"
  4. #define KEYSET_PRIV_KEY L"W3_PRIVATE_KEY_%s"
  5. #define KEYSET_PASSWORD L"W3_KEY_PASSWORD_%s"
  6. #define KEYSET_DEFAULT L"Default"
  7. #define KEY_NAME_BASE "W3_KEYMAN_KEY_"
  8. #define KEY_LINKS_SECRET_W L"W3_KEYMAN_LINKS"
  9. #define KEYMAN_LINK_DEFAULT "DEFAULT"
  10. void DisposeLSAData( PVOID pData );
  11. //--------------------------------------------------------
  12. class CW3KeyService : public CService
  13. {
  14. public:
  15. CW3KeyService();
  16. ~CW3KeyService();
  17. void LoadKeys( CMachine* pMachine );
  18. BOOL FCommitChangesNow();
  19. // create a new key.
  20. CKey* PNewKey() {return (CKey*)new CW3Key;}
  21. // get the key on this machine that is set to be the default key
  22. CW3Key* PGetDefaultKey( void );
  23. // cached wide machine name
  24. WCHAR* m_pszwMachineName;
  25. protected:
  26. // initialize basic stuff from machine - must be called from sub-class
  27. BOOL FInitMachine( void );
  28. // restore all the keys that are stored on the target machine
  29. BOOL FRestoreNormalKeys( HANDLE hPolicy );
  30. // restore a key that was generated by keyset
  31. BOOL FLoadKeySetKeys( HANDLE hPolicy );
  32. // store out all the keys to the target machine
  33. BOOL FWriteOutKeys( HANDLE hPolicy );
  34. // delete existing keys that the W3 server references (keyset style keys)
  35. BOOL DeleteAllW3Keys( HANDLE hPolicy );
  36. // a smarter secret write error box
  37. void WriteSecretMessageBox( void );
  38. // helpful utilities for scanning the
  39. // keys contained by a service object
  40. CW3Key* GetFirstW3Key()
  41. { return (CW3Key*)GetFirstChild(); }
  42. CW3Key* GetNextW3Key( CW3Key* pKey )
  43. { return (CW3Key*)GetNextChild(pKey); }
  44. private:
  45. // number of keys READ from the normal secrets
  46. long m_nNumKeysRead;
  47. BOOL FExpandoHandle( HANDLE* ph, PVOID pData, DWORD cbData );
  48. };