should be sufficient.  The problem witgh this is that we have
should be sufficient.  The problem with this is that we did
GpgMsgImpl::decrypt (HWND hwnd){  log_debug ("%s:%s: enter\n", __FILE__, __func__);  openpgp_t mtype;  char *plaintext = NULL;  attach_info_t table = NULL;  int err;  unsigned int pos;  unsigned int n_attach = 0;  unsigned int n_encrypted = 0;  unsigned int n_signed = 0;  HRESULT hr;  int pgpmime_succeeded = 0;  mtype = getMessageType ();  /* Check whether this possibly encrypted message has encrypted     attachments.  We check right now because we need to get into the     decryption code even if the body is not encrypted but attachments     are available. */  table = gatherAttachmentInfo ();  if (table)    {      for (pos=0; !table[pos].end_of_table; pos++)        if (table[pos].is_encrypted)          n_encrypted++;        else if (table[pos].is_signed)          n_signed++;      n_attach = pos;    }  log_debug ("%s:%s: message has %u attachments with "             "%u signed and %d encrypted\n",             __FILE__, __func__, n_attach, n_signed, n_encrypted);  if (mtype == OPENPGP_NONE && !n_encrypted && !n_signed)     {      /* Because we usually work around the OL object model, it can't         notice that we changed the windows's text behind its back (by         means of update_display and the SetWindowText API).  Thus it         happens sometimes that the ciphertext is still displayed         although the MAPI calls in loadBody returned the plaintext         (because we once used set_message_body).  The effect is that         when clicking the decrypt button, we won't have any         ciphertext to decrypt and thus get to here.  We try solving         this by updating the window if we also have a cached entry.         Another solution would be to always update the windows's text         using a cached plaintext (in OnRead). I have some fear that         this might lead to unexpected behaviour in certain cases, so         we better only do it on demand and only if the old reply hack         has been enabled. */      void *refhandle;      const char *s;      if (!opt.compat.old_reply_hack          && (s = msgcache_get_from_mapi (message, &refhandle)))        {          xfree (body_plain);          body_plain = xstrdup (s);          update_display (hwnd, this, exchange_cb);          msgcache_unref (refhandle);          log_debug ("%s:%s: leave (already decrypted)\n", __FILE__, __func__);        }      else        {          MessageBox (hwnd, "No valid OpenPGP data found.",                      "GPG Decryption", MB_ICONWARNING|MB_OK);          log_debug ("%s:%s: leave (no OpenPGP data)\n", __FILE__, __func__);        }            release_attach_info (table);      return 0;    }  /* We always want an attestation.  Note that we ignore any error     because that would anyway be a out of core situation and thus we     can't do much about it. */  if (has_attestation)    {      if (attestation)        gpgme_data_release (attestation);      log_debug ("%s:%s: we already have an attestation\n",                 __FILE__, __func__);    }  else if (!attestation && !opt.compat.no_attestation)    gpgme_data_new (&attestation);    /* Process according to type of message. */  if (is_pgpmime)    {      LPATTACH att;      int method;      LPSTREAM from;            hr = message->OpenAttach (1, NULL, MAPI_BEST_ACCESS, &att);	      if (FAILED (hr))        {          log_error ("%s:%s: can't open PGP/MIME attachment 2: hr=%#lx",                     __FILE__, __func__, hr);          MessageBox (hwnd, "Problem decrypting PGP/MIME message",                      "GPG Decryption", MB_ICONERROR|MB_OK);          log_debug ("%s:%s: leave (PGP/MIME problem)\n", __FILE__, __func__);          release_attach_info (table);          return gpg_error (GPG_ERR_GENERAL);        }      method = get_attach_method (att);      if (method != ATTACH_BY_VALUE)        {          log_error ("%s:%s: unsupported method %d for PGP/MIME attachment 2",                     __FILE__, __func__, method);          MessageBox (hwnd, "Problem decrypting PGP/MIME message",                      "GPG Decryption", MB_ICONERROR|MB_OK);          log_debug ("%s:%s: leave (bad PGP/MIME method)\n",__FILE__,__func__);          att->Release ();          release_attach_info (table);          return gpg_error (GPG_ERR_GENERAL);        }      hr = att->OpenProperty (PR_ATTACH_DATA_BIN, &IID_IStream,                               0, 0, (LPUNKNOWN*) &from);      if (FAILED (hr))        {          log_error ("%s:%s: can't open data of attachment 2: hr=%#lx",                     __FILE__, __func__, hr);          MessageBox (hwnd, "Problem decrypting PGP/MIME message",                      "GPG Decryption", MB_ICONERROR|MB_OK);          log_debug ("%s:%s: leave (OpenProperty failed)\n",__FILE__,__func__);          att->Release ();          release_attach_info (table);          return gpg_error (GPG_ERR_GENERAL);        }      err = pgpmime_decrypt (from, opt.passwd_ttl, &plaintext, attestation,                             hwnd);            from->Release ();      att->Release ();      if (!err)        pgpmime_succeeded = 1;    }  else if (mtype == OPENPGP_CLEARSIG)    err = op_verify (getOrigText (), NULL, NULL, attestation);  else if (*getOrigText())    err = op_decrypt (getOrigText (), &plaintext, opt.passwd_ttl,                      NULL, attestation);  else    err = gpg_error (GPG_ERR_NO_DATA);  if (err)    {      if (!is_pgpmime && n_attach && gpg_err_code (err) == GPG_ERR_NO_DATA)        ;      else if (mtype == OPENPGP_CLEARSIG)        MessageBox (hwnd, op_strerror (err),                    "GPG verification failed", MB_ICONERROR|MB_OK);      else        MessageBox (hwnd, op_strerror (err),                    "GPG decryption failed", MB_ICONERROR|MB_OK);    }  else if (plaintext && *plaintext)    {	      int is_html = is_html_body (plaintext);      log_debug ("decrypt isHtml=%d\n", is_html);      /* Do we really need to set the body?  update_display below         should be sufficient.  The problem witgh this is that we have         changes in the MAPI and OL will later ask whether to save         them.  The original reason for this kludge was to get the         plaintext into the reply (by setting the property without         calling SaveChanges) - with OL2003 it didn't worked reliable         and thus we implemented the trick with the msgcache. For now         we will disable it but add a compatibility flag to re-enable         it. */      if (opt.compat.old_reply_hack)        set_message_body (message, plaintext);      xfree (body_plain);      body_plain = plaintext;      plaintext = NULL;      msgcache_put (body_plain, 0, message);      if (opt.save_decrypted_attach)        {          /* User wants us to replace the encrypted message with the             plaintext version. */          hr = message->SaveChanges (KEEP_OPEN_READWRITE|FORCE_SAVE);          if (FAILED (hr))            log_debug ("%s:%s: SaveChanges failed: hr=%#lx",                       __FILE__, __func__, hr);          update_display (hwnd, this, exchange_cb);                  }      else if (!silent && update_display (hwnd, this, exchange_cb))         {          const char s[] =             "The message text cannot be displayed.\n"            "You have to save the decrypted message to view it.\n"            "Then you need to re-open the message.\n\n"            "Do you want to save the decrypted message?";          int what;                    what = MessageBox (hwnd, s, "GPG Decryption",                             MB_YESNO|MB_ICONWARNING);          if (what == IDYES)             {              log_debug ("decrypt: saving plaintext message.\n");              hr = message->SaveChanges (KEEP_OPEN_READWRITE|FORCE_SAVE);              if (FAILED (hr))                log_debug ("%s:%s: SaveChanges failed: hr=%#lx",                           __FILE__, __func__, hr);            }	}    }  /* If we have signed attachments.  Ask whether the signatures should     be verified; we do this is case of large attachments where     verification might take long. */  if (!silent && n_signed && !pgpmime_succeeded)    {      const char s[] =         "Signed attachments found.\n\n"        "@LIST@\n"        "Do you want to verify the signatures?";      int what;      char *text;      text = text_from_attach_info (table, s, 2);            what = MessageBox (hwnd, text, "Attachment Verification",                         MB_YESNO|MB_ICONINFORMATION);      xfree (text);      if (what == IDYES)         {          for (pos=0; !table[pos].end_of_table; pos++)            if (table[pos].is_signed)              {                assert (table[pos].sig_pos < n_attach);                verifyAttachment (hwnd, table, pos, table[pos].sig_pos);              }        }    }  if (!silent && n_encrypted && !pgpmime_succeeded)    {      const char s[] =         "Encrypted attachments found.\n\n"        "@LIST@\n"        "Do you want to decrypt and save them?";      int what;      char *text;      text = text_from_attach_info (table, s, 4);      what = MessageBox (hwnd, text, "Attachment Decryption",                         MB_YESNO|MB_ICONINFORMATION);      xfree (text);      if (what == IDYES)         {          for (pos=0; !table[pos].end_of_table; pos++)            if (table[pos].is_encrypted)              decryptAttachment (hwnd, pos, true, opt.passwd_ttl,                                 table[pos].filename);        }    }  writeAttestation ();  release_attach_info (table);  log_debug ("%s:%s: leave (rc=%d)\n", __FILE__, __func__, err);  return err;}