1
0

browserInternal.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "main.h"
  2. #include "./browserInternal.h"
  3. #include "./resource.h"
  4. #include <exdisp.h>
  5. #include <strsafe.h>
  6. #if (_MSC_VER < 1500)
  7. // {D81F90A3-8156-44F7-AD28-5ABB87003274}
  8. EXTERN_C const IID IID_IProtectFocus =
  9. { 0xd81f90a3, 0x8156, 0x44f7, { 0xad, 0x28, 0x5a, 0xbb, 0x87, 0x00, 0x32, 0x74 } };
  10. #endif
  11. HRESULT FormatEncryptionString(UINT encryptionId, LPWSTR pszBuffer, INT cchBufferMax)
  12. {
  13. HRESULT hr = S_OK;
  14. if (secureLockIconUnsecure == encryptionId)
  15. {
  16. Plugin_LoadString(IDS_CONNECTION_UNSECURE, pszBuffer, cchBufferMax);
  17. return S_OK;
  18. }
  19. Plugin_LoadString(IDS_CONNECTION_ENCRYPTED, pszBuffer, cchBufferMax);
  20. INT resId = 0;
  21. switch(encryptionId)
  22. {
  23. case secureLockIconMixed: resId = IDS_ENCRYPTION_MIXED; break;
  24. case secureLockIconSecure40Bit: resId = IDS_ENCRYPTION_40BIT; break;
  25. case secureLockIconSecure56Bit: resId = IDS_ENCRYPTION_56BIT; break;
  26. case secureLockIconSecureFortezza: resId = IDS_ENCRYPTION_FORTEZZA; break;
  27. case secureLockIconSecure128Bit: resId = IDS_ENCRYPTION_128BIT; break;
  28. }
  29. if (0 != resId)
  30. {
  31. WCHAR szEncryption[96] = {0};
  32. Plugin_LoadString(resId, szEncryption, ARRAYSIZE(szEncryption));
  33. if (L'\0' != szEncryption[0])
  34. {
  35. INT cchLen = lstrlen(pszBuffer);
  36. hr = StringCchPrintf(pszBuffer + cchLen, cchBufferMax - cchLen, L": %s", szEncryption);
  37. }
  38. }
  39. return hr;
  40. }