Commit 36bfd19a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

inetcomm: Use nameless unions.

parent 497de3cc
MODULE = inetcomm.dll
IMPORTLIB = inetcomm
IMPORTS = uuid urlmon propsys oleaut32 ole32 ws2_32 user32 advapi32
EXTRADEFS = -DWINE_NO_NAMELESS_EXTENSION
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
......
......@@ -410,11 +410,11 @@ static HRESULT WINAPI MimeInternat_ConvertString(IMimeInternational *iface, CODE
{
case VT_LPSTR:
if(cpiSource == CP_UNICODE) cpiSource = GetACP();
src_len = strlen(pIn->u.pszVal);
src_len = strlen(pIn->pszVal);
break;
case VT_LPWSTR:
cpiSource = CP_UNICODE;
src_len = lstrlenW(pIn->u.pwszVal) * sizeof(WCHAR);
src_len = lstrlenW(pIn->pwszVal) * sizeof(WCHAR);
break;
default:
return E_INVALIDARG;
......@@ -426,37 +426,37 @@ static HRESULT WINAPI MimeInternat_ConvertString(IMimeInternational *iface, CODE
DWORD mode = 0;
UINT in_size = src_len, out_size;
hr = IMultiLanguage_ConvertString(ml, &mode, cpiSource, cpiDest, (BYTE*)pIn->u.pszVal, &in_size,
hr = IMultiLanguage_ConvertString(ml, &mode, cpiSource, cpiDest, (BYTE*)pIn->pszVal, &in_size,
NULL, &out_size);
if(hr == S_OK) /* S_FALSE means the conversion could not be performed */
{
out_size += (cpiDest == CP_UNICODE) ? sizeof(WCHAR) : sizeof(char);
pOut->u.pszVal = CoTaskMemAlloc(out_size);
if(!pOut->u.pszVal)
pOut->pszVal = CoTaskMemAlloc(out_size);
if(!pOut->pszVal)
hr = E_OUTOFMEMORY;
else
{
mode = 0;
in_size = src_len;
hr = IMultiLanguage_ConvertString(ml, &mode, cpiSource, cpiDest, (BYTE*)pIn->u.pszVal, &in_size,
(BYTE*)pOut->u.pszVal, &out_size);
hr = IMultiLanguage_ConvertString(ml, &mode, cpiSource, cpiDest, (BYTE*)pIn->pszVal, &in_size,
(BYTE*)pOut->pszVal, &out_size);
if(hr == S_OK)
{
if(cpiDest == CP_UNICODE)
{
pOut->u.pwszVal[out_size / sizeof(WCHAR)] = 0;
pOut->pwszVal[out_size / sizeof(WCHAR)] = 0;
pOut->vt = VT_LPWSTR;
}
else
{
pOut->u.pszVal[out_size] = '\0';
pOut->pszVal[out_size] = '\0';
pOut->vt = VT_LPSTR;
}
}
else
CoTaskMemFree(pOut->u.pszVal);
CoTaskMemFree(pOut->pszVal);
}
}
IMultiLanguage_Release(ml);
......
......@@ -738,7 +738,7 @@ static void read_value(header_t *header, char **cur)
}
header->value.vt = VT_LPSTR;
header->value.u.pszVal = value;
header->value.pszVal = value;
*cur = end;
}
......@@ -748,22 +748,22 @@ static void init_content_type(MimeBody *body, header_t *header)
char *slash;
DWORD len;
slash = strchr(header->value.u.pszVal, '/');
slash = strchr(header->value.pszVal, '/');
if(!slash)
{
WARN("malformed context type value\n");
return;
}
len = slash - header->value.u.pszVal;
len = slash - header->value.pszVal;
body->content_pri_type = HeapAlloc(GetProcessHeap(), 0, len + 1);
memcpy(body->content_pri_type, header->value.u.pszVal, len);
memcpy(body->content_pri_type, header->value.pszVal, len);
body->content_pri_type[len] = '\0';
body->content_sub_type = strdupA(slash + 1);
}
static void init_content_encoding(MimeBody *body, header_t *header)
{
const char *encoding = header->value.u.pszVal;
const char *encoding = header->value.pszVal;
if(!stricmp(encoding, "base64"))
body->encoding = IET_BASE64;
......@@ -1099,7 +1099,7 @@ static HRESULT WINAPI MimeBody_GetProp(
{
PropVariantClear(pValue);
pValue->vt = VT_LPSTR;
pValue->u.pszVal = strdupA(This->content_pri_type);
pValue->pszVal = strdupA(This->content_pri_type);
return S_OK;
}
......@@ -1416,11 +1416,11 @@ static HRESULT WINAPI MimeBody_SetOption(
switch(oid)
{
case OID_SECURITY_HWND_OWNER:
FIXME("OID_SECURITY_HWND_OWNER (value %08x): ignoring\n", pValue->u.ulVal);
FIXME("OID_SECURITY_HWND_OWNER (value %08x): ignoring\n", pValue->ulVal);
hr = S_OK;
break;
case OID_TRANSMIT_BODY_ENCODING:
FIXME("OID_TRANSMIT_BODY_ENCODING (value %08x): ignoring\n", pValue->u.ulVal);
FIXME("OID_TRANSMIT_BODY_ENCODING (value %08x): ignoring\n", pValue->ulVal);
hr = S_OK;
break;
default:
......@@ -2745,16 +2745,16 @@ static HRESULT WINAPI MimeMessage_SetOption(
switch(oid)
{
case OID_HIDE_TNEF_ATTACHMENTS:
FIXME("OID_HIDE_TNEF_ATTACHMENTS (value %d): ignoring\n", pValue->u.boolVal);
FIXME("OID_HIDE_TNEF_ATTACHMENTS (value %d): ignoring\n", pValue->boolVal);
break;
case OID_SHOW_MACBINARY:
FIXME("OID_SHOW_MACBINARY (value %d): ignoring\n", pValue->u.boolVal);
FIXME("OID_SHOW_MACBINARY (value %d): ignoring\n", pValue->boolVal);
break;
case OID_SAVEBODY_KEEPBOUNDARY:
FIXME("OID_SAVEBODY_KEEPBOUNDARY (value %d): ignoring\n", pValue->u.boolVal);
FIXME("OID_SAVEBODY_KEEPBOUNDARY (value %d): ignoring\n", pValue->boolVal);
break;
case OID_CLEANUP_TREE_ON_SAVE:
FIXME("OID_CLEANUP_TREE_ON_SAVE (value %d): ignoring\n", pValue->u.boolVal);
FIXME("OID_CLEANUP_TREE_ON_SAVE (value %d): ignoring\n", pValue->boolVal);
break;
default:
FIXME("Unhandled oid %08x\n", oid);
......
......@@ -331,12 +331,12 @@ static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszRespons
{
switch (This->command)
{
case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->u.rUidlInfo); break;
case POP3_STAT: hr = parse_stat_response(This, &pResponse->u.rStatInfo); break;
case POP3_LIST: hr = parse_list_response(This, &pResponse->u.rListInfo); break;
case POP3_DELE: hr = parse_dele_response(This, &pResponse->u.dwPopId); break;
case POP3_RETR: hr = parse_retr_response(This, &pResponse->u.rRetrInfo); break;
case POP3_TOP: hr = parse_top_response(This, &pResponse->u.rTopInfo); break;
case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->rUidlInfo); break;
case POP3_STAT: hr = parse_stat_response(This, &pResponse->rStatInfo); break;
case POP3_LIST: hr = parse_list_response(This, &pResponse->rListInfo); break;
case POP3_DELE: hr = parse_dele_response(This, &pResponse->dwPopId); break;
case POP3_RETR: hr = parse_retr_response(This, &pResponse->rRetrInfo); break;
case POP3_TOP: hr = parse_top_response(This, &pResponse->rTopInfo); break;
default:
This->state = STATE_DONE;
break;
......
......@@ -141,7 +141,7 @@ static HRESULT on_mime_message_available(MimeHtmlProtocol *protocol, IMimeMessag
if(FAILED(hres))
return report_result(protocol, hres);
found = !lstrcmpW(protocol->location, value.u.pwszVal);
found = !lstrcmpW(protocol->location, value.pwszVal);
PropVariantClear(&value);
}while(!found);
}else {
......@@ -159,7 +159,7 @@ static HRESULT on_mime_message_available(MimeHtmlProtocol *protocol, IMimeMessag
value.vt = VT_LPWSTR;
hres = IMimeBody_GetProp(mime_body, "content-type", 0, &value);
if(SUCCEEDED(hres)) {
hres = IInternetProtocolSink_ReportProgress(protocol->sink, BINDSTATUS_MIMETYPEAVAILABLE, value.u.pwszVal);
hres = IInternetProtocolSink_ReportProgress(protocol->sink, BINDSTATUS_MIMETYPEAVAILABLE, value.pwszVal);
PropVariantClear(&value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment