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.

94 lines
3.2 KiB

  1. #ifndef __AWSECX_H__
  2. #define __AWSECX_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define MINKEYBUFSIZE 1024 // dictated by comments in awsec.h
  7. #define SECTYPE_NONE 0
  8. #define SECTYPE_KEY 1
  9. #define SECTYPE_PASSWORD 2
  10. #define CB_QUERYREPLACE 0
  11. #define CB_INFORMDUPLICATE 1
  12. typedef BOOL (CALLBACK QUERYREPLACEKEYCB)(HWND hWndParent, LPTSTR pKeyOwner,
  13. UINT context) ;
  14. typedef WORD (CALLBACK *RESOLVEGETKEYCB)(LPMAPISESSION pSession,
  15. LPARAM lParamfpx, WORD context, LPBYTE pKey,
  16. LPWORD pcbKey);
  17. typedef struct {
  18. LPBYTE pKey ;
  19. WORD cbKey;
  20. LPTSTR pName;
  21. LPENTRYID pEntryID;
  22. LONG cbEntryID;
  23. } SECKEYREC, *LPSECKEYREC ;
  24. BOOL GetPABStrings(LPMAPISESSION pSession, LPTSTR *ppFName, LPTSTR *ppEAddress);
  25. BOOL GetLoginName(LPMAPISESSION pSession, LPTSTR *ppLoginName);
  26. BOOL GetLoginNameXP (LPTSTR lpszFriendly, LPTSTR lpszEmail, LPTSTR *ppLoginName);
  27. WORD GetCurrentUserAddress(LPMAPISESSION pSession, LPTSTR *ppAddress,
  28. LPWORD pNChars);
  29. BOOL SetNoneSecurityProps(LPMAPIPROP pMsg, LPTSTR pPwdEncrypt, BOOL bDigSig,
  30. DWORD dwhSecurity);
  31. BOOL SetKeySecurityProps(LPMAPIPROP pMsg, LPTSTR pPwdEncrypt, BOOL bDigSig,
  32. DWORD dwhSecurity);
  33. BOOL SetPwdSecurityProps(LPMAPIPROP pMsg, LPTSTR pPwdEncrypt, LPTSTR pPassword,
  34. BOOL bDigSig, DWORD dwhSecurity);
  35. BOOL GetSecurityProps(LPMAPIPROP pMsg, LPTSTR pPwdDecrypt, LPWORD pSecType,
  36. LPBOOL pDigSig, LPTSTR *ppSecPwd, LPTSTR *ppSimplePwd);
  37. BOOL SetResolveGetKeyCB(DWORD hSec, RESOLVEGETKEYCB fpxResolve, LPARAM lParamfpx);
  38. BOOL SetMapiSession(DWORD hSec, LPMAPISESSION pSession);
  39. BOOL SetAddressBook(DWORD hSec, LPADRBOOK lpAB);
  40. WORD ImportPrivateKeysEx(LPSTR userid, LPSOSSESSION lpSess,
  41. ReadCB FAR *readCB, DWORD readHand, LPSTR password);
  42. WORD AddPublicKeysEx(LPSOSSESSION lpSess, LPSECKEYREC pKeys, int iNumKeys,
  43. LPMAPISESSION pSession, QUERYREPLACEKEYCB fpxCB, HWND hWndParent);
  44. WORD DelPublicKeysEx(LPSOSSESSION lpSess, LPSECKEYREC pKeys, int iNumKeys,
  45. LPMAPISESSION pSession);
  46. WORD GetPublicKeyEx(LPSOSSESSION lpSess, LPTSTR pOwner, BYTE FAR *key,
  47. LPWORD pcbKey);
  48. WORD GetUsersPublicKeyEx(LPSOSSESSION lpSess, BYTE FAR *key, LPWORD pcbKey);
  49. // Convenient utilities.
  50. BOOL GetFaxABEntryID(LPADRBOOK pAB, LPENTRYID *ppEntryID, LPULONG pcbEntryID);
  51. BOOL MakeTargetName(LPTSTR pFName, LPTSTR pEAddress, LPTSTR *ppTargetName);
  52. BOOL AddKeyEntryToPAB(LPADRBOOK pAB, LPABCONT pPAB,
  53. LPTSTR pFName, LPTSTR pEAddress, LPBYTE pKey, WORD cbKey,
  54. LPSPropValue *ppRetEntryID);
  55. // Additional return codes.
  56. #define SEC_INVSECHANDLE 20 // security handle has become invalid.
  57. #define SEC_LOSTKEYS 21 // this operation has caused loss of keys.
  58. #define SEC_REGFAILURE 22 // registry failure keeps operation from succeeding.
  59. #define SEC_BUFTOOSMALL 23 // supplied buffer was to small to hold return.
  60. #define SEC_NOMATCHINGOWNER 24 // Could not find key owner matching the target.
  61. #define SEC_DUPLICATEOWNERS 25 // More could not resolve key ownership.
  62. #define SEC_MAPIERROR 26 // Unexpected mapi error returned.
  63. // Programmer error:
  64. #define SEC_NOMAPISESSION 50 // Mapi Session not set, opperation requires one
  65. #define SEC_FAILURE 100
  66. #ifdef __cplusplus
  67. } /* extern "C" */
  68. #endif
  69. #endif /* __AWSECX_H__ */