log_debug_w32 (hr, "%s:%s: OpenProperty failed", __FILE__, __func__);
log_debug ("%s:%s: OpenProperty failed: hr=%#lx", __FILE__, __func__, hr);
GpgMsgImpl::loadBody (void){  HRESULT hr;  LPSPropValue lpspvFEID = NULL;  LPSTREAM stream;  SPropValue prop;  STATSTG statInfo;  ULONG nread;  if (body || !message)    return;  #if 1  hr = message->OpenProperty (PR_BODY, &IID_IStream,                              0, 0, (LPUNKNOWN*)&stream);  if ( hr != S_OK )    {      log_debug_w32 (hr, "%s:%s: OpenProperty failed", __FILE__, __func__);      return;    }  hr = stream->Stat (&statInfo, STATFLAG_NONAME);  if ( hr != S_OK )    {      log_debug_w32 (hr, "%s:%s: Stat failed", __FILE__, __func__);      stream->Release ();      return;    }    /* FIXME: We might want to read only the first 1k to decide whetehr     this is actually an OpenPGP message and only then continue     reading.  This requires some changes in this module. */  body = (char*)xmalloc ((size_t)statInfo.cbSize.QuadPart + 2);  hr = stream->Read (body, (size_t)statInfo.cbSize.QuadPart, &nread);  if ( hr != S_OK )    {      log_debug_w32 (hr, "%s:%s: Read failed", __FILE__, __func__);      xfree (body);      body = NULL;      stream->Release ();      return;    }  body[nread] = 0;  body[nread+1] = 0;  if (nread != statInfo.cbSize.QuadPart)    {      log_debug ("%s:%s: not enough bytes returned\n", __FILE__, __func__);      xfree (body);      body = NULL;      stream->Release ();      return;    }  stream->Release ();  /* Fixme: We need to optimize this. */  {    char *tmp;    tmp = wchar_to_utf8 ((wchar_t*)body);    if (!tmp)      log_debug ("%s: error converting to utf8\n", __func__);    else      {        xfree (body);        body = tmp;      }  }#else /* Old method. */  hr = HrGetOneProp ((LPMAPIPROP)message, PR_BODY, &lpspvFEID);  if (FAILED (hr))    {      log_debug ("%s: HrGetOneProp failed\n", __func__);      return;    }      switch ( PROP_TYPE (lpspvFEID->ulPropTag) )    {    case PT_UNICODE:      body = wchar_to_utf8 (lpspvFEID->Value.lpszW);      if (!body)        log_debug ("%s: error converting to utf8\n", __func__);      break;          case PT_STRING8:      body = xstrdup (lpspvFEID->Value.lpszA);      break;          default:      log_debug ("%s: proptag=0x%08lx not supported\n",                 __func__, lpspvFEID->ulPropTag);      break;    }  MAPIFreeBuffer (lpspvFEID);#endif    if (body)    log_debug ("%s:%s: loaded body `%s' at %p\n",               __FILE__, __func__, body, body);  //   prop.ulPropTag = PR_ACCESS;//   prop.Value.l = MAPI_ACCESS_MODIFY;//   hr = HrSetOneProp (message, &prop);//   if (FAILED (hr))//     log_debug_w32 (-1,"%s:%s: updating access to 0x%08lx failed",//                    __FILE__, __func__, prop.Value.l);}