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

inetcomm: Use nameless unions.

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