Commit 79181a1d authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

urlmon: Use wide-char string literals.

parent c7345a51
...@@ -30,12 +30,6 @@ ...@@ -30,12 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static const WCHAR ctxW[] = {'c','t','x',0};
static const WCHAR cab_extW[] = {'.','c','a','b',0};
static const WCHAR infW[] = {'i','n','f',0};
static const WCHAR dllW[] = {'d','l','l',0};
static const WCHAR ocxW[] = {'o','c','x',0};
enum install_type { enum install_type {
INSTALL_UNKNOWN, INSTALL_UNKNOWN,
INSTALL_DLL, INSTALL_DLL,
...@@ -97,19 +91,19 @@ static HRESULT extract_cab_file(install_ctx_t *ctx) ...@@ -97,19 +91,19 @@ static HRESULT extract_cab_file(install_ctx_t *ctx)
/* NOTE: Assume that file_name contains ".cab" extension */ /* NOTE: Assume that file_name contains ".cab" extension */
ptr = ctx->install_file+path_len+1+file_len-3; ptr = ctx->install_file+path_len+1+file_len-3;
memcpy(ptr, infW, sizeof(infW)); memcpy(ptr, L"inf", sizeof(L"inf"));
if(file_exists(ctx->install_file)) { if(file_exists(ctx->install_file)) {
ctx->install_type = INSTALL_INF; ctx->install_type = INSTALL_INF;
return S_OK; return S_OK;
} }
memcpy(ptr, dllW, sizeof(dllW)); memcpy(ptr, L"dll", sizeof(L"dll"));
if(file_exists(ctx->install_file)) { if(file_exists(ctx->install_file)) {
ctx->install_type = INSTALL_DLL; ctx->install_type = INSTALL_DLL;
return S_OK; return S_OK;
} }
memcpy(ptr, ocxW, sizeof(ocxW)); memcpy(ptr, L"ocx", sizeof(L"ocx"));
if(file_exists(ctx->install_file)) { if(file_exists(ctx->install_file)) {
ctx->install_type = INSTALL_DLL; ctx->install_type = INSTALL_DLL;
return S_OK; return S_OK;
...@@ -183,18 +177,16 @@ static HRESULT process_hook_section(install_ctx_t *ctx, const WCHAR *sect_name) ...@@ -183,18 +177,16 @@ static HRESULT process_hook_section(install_ctx_t *ctx, const WCHAR *sect_name)
DWORD len; DWORD len;
HRESULT hres; HRESULT hres;
static const WCHAR runW[] = {'r','u','n',0};
len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file); len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(!len) if(!len)
return S_OK; return S_OK;
for(key = buf; *key; key += lstrlenW(key)+1) { for(key = buf; *key; key += lstrlenW(key)+1) {
if(!wcsicmp(key, runW)) { if(!wcsicmp(key, L"run")) {
WCHAR *cmd; WCHAR *cmd;
size_t size; size_t size;
len = GetPrivateProfileStringW(sect_name, runW, NULL, val, ARRAY_SIZE(val), ctx->install_file); len = GetPrivateProfileStringW(sect_name, L"run", NULL, val, ARRAY_SIZE(val), ctx->install_file);
TRACE("Run %s\n", debugstr_w(val)); TRACE("Run %s\n", debugstr_w(val));
...@@ -226,17 +218,14 @@ static HRESULT install_inf_file(install_ctx_t *ctx) ...@@ -226,17 +218,14 @@ static HRESULT install_inf_file(install_ctx_t *ctx)
DWORD len; DWORD len;
HRESULT hres; HRESULT hres;
static const WCHAR setup_hooksW[] = {'S','e','t','u','p',' ','H','o','o','k','s',0}; len = GetPrivateProfileStringW(L"Setup Hooks", NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
static const WCHAR add_codeW[] = {'A','d','d','.','C','o','d','e',0};
len = GetPrivateProfileStringW(setup_hooksW, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(len) { if(len) {
default_install = FALSE; default_install = FALSE;
for(key = buf; *key; key += lstrlenW(key)+1) { for(key = buf; *key; key += lstrlenW(key)+1) {
TRACE("[Setup Hooks] key: %s\n", debugstr_w(key)); TRACE("[Setup Hooks] key: %s\n", debugstr_w(key));
len = GetPrivateProfileStringW(setup_hooksW, key, NULL, sect_name, ARRAY_SIZE(sect_name), len = GetPrivateProfileStringW(L"Setup Hooks", key, NULL, sect_name, ARRAY_SIZE(sect_name),
ctx->install_file); ctx->install_file);
if(!len) { if(!len) {
WARN("Could not get key value\n"); WARN("Could not get key value\n");
...@@ -249,14 +238,14 @@ static HRESULT install_inf_file(install_ctx_t *ctx) ...@@ -249,14 +238,14 @@ static HRESULT install_inf_file(install_ctx_t *ctx)
} }
} }
len = GetPrivateProfileStringW(add_codeW, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file); len = GetPrivateProfileStringW(L"Add.Code", NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(len) { if(len) {
default_install = FALSE; default_install = FALSE;
for(key = buf; *key; key += lstrlenW(key)+1) { for(key = buf; *key; key += lstrlenW(key)+1) {
TRACE("[Add.Code] key: %s\n", debugstr_w(key)); TRACE("[Add.Code] key: %s\n", debugstr_w(key));
len = GetPrivateProfileStringW(add_codeW, key, NULL, sect_name, ARRAY_SIZE(sect_name), len = GetPrivateProfileStringW(L"Add.Code", key, NULL, sect_name, ARRAY_SIZE(sect_name),
ctx->install_file); ctx->install_file);
if(!len) { if(!len) {
WARN("Could not get key value\n"); WARN("Could not get key value\n");
...@@ -354,7 +343,7 @@ static BOOL init_warning_dialog(HWND hwnd, install_ctx_t *ctx) ...@@ -354,7 +343,7 @@ static BOOL init_warning_dialog(HWND hwnd, install_ctx_t *ctx)
BSTR display_uri; BSTR display_uri;
HRESULT hres; HRESULT hres;
if(!SetPropW(hwnd, ctxW, ctx)) if(!SetPropW(hwnd, L"ctx", ctx))
return FALSE; return FALSE;
hres = IUri_GetDisplayUri(ctx->uri, &display_uri); hres = IUri_GetDisplayUri(ctx->uri, &display_uri);
...@@ -384,7 +373,7 @@ static INT_PTR WINAPI warning_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp ...@@ -384,7 +373,7 @@ static INT_PTR WINAPI warning_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
case WM_COMMAND: case WM_COMMAND:
switch(wparam) { switch(wparam) {
case ID_AXINSTALL_INSTALL_BTN: { case ID_AXINSTALL_INSTALL_BTN: {
install_ctx_t *ctx = GetPropW(hwnd, ctxW); install_ctx_t *ctx = GetPropW(hwnd, L"ctx");
if(ctx) if(ctx)
ctx->cancel = FALSE; ctx->cancel = FALSE;
EndDialog(hwnd, 0); EndDialog(hwnd, 0);
...@@ -395,7 +384,7 @@ static INT_PTR WINAPI warning_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp ...@@ -395,7 +384,7 @@ static INT_PTR WINAPI warning_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
return FALSE; return FALSE;
} }
case WM_TIMER: case WM_TIMER:
update_counter(GetPropW(hwnd, ctxW), hwnd); update_counter(GetPropW(hwnd, L"ctx"), hwnd);
return TRUE; return TRUE;
} }
...@@ -460,7 +449,7 @@ static HRESULT install_file(install_ctx_t *ctx, const WCHAR *cache_file) ...@@ -460,7 +449,7 @@ static HRESULT install_file(install_ctx_t *ctx, const WCHAR *cache_file)
if(!ext) if(!ext)
ext = ptr; ext = ptr;
if(!wcsicmp(ext, cab_extW)) { if(!wcsicmp(ext, L".cab")) {
hres = install_cab_file(ctx); hres = install_cab_file(ctx);
}else { }else {
FIXME("Unsupported extension %s\n", debugstr_w(ext)); FIXME("Unsupported extension %s\n", debugstr_w(ext));
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static WCHAR bscb_holderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; static WCHAR bscb_holderW[] = L"_BSCB_Holder_";
extern IID IID_IBindStatusCallbackHolder; extern IID IID_IBindStatusCallbackHolder;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static WCHAR cbinding_contextW[] = {'C','B','i','n','d','i','n','g',' ','C','o','n','t','e','x','t',0}; static WCHAR cbinding_contextW[] = L"CBinding Context";
static WCHAR bscb_holderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 }; static WCHAR bscb_holderW[] = L"_BSCB_Holder_";
typedef struct { typedef struct {
IUnknown IUnknown_iface; IUnknown IUnknown_iface;
...@@ -197,7 +197,6 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid) ...@@ -197,7 +197,6 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid)
static const WCHAR mime_keyW[] = static const WCHAR mime_keyW[] =
{'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\', {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\',
'C','o','n','t','e','n','t',' ','T','y','p','e','\\'}; 'C','o','n','t','e','n','t',' ','T','y','p','e','\\'};
static const WCHAR clsidW[] = {'C','L','S','I','D',0};
len = lstrlenW(mime)+1; len = lstrlenW(mime)+1;
key_name = heap_alloc(sizeof(mime_keyW) + len*sizeof(WCHAR)); key_name = heap_alloc(sizeof(mime_keyW) + len*sizeof(WCHAR));
...@@ -213,7 +212,7 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid) ...@@ -213,7 +212,7 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid)
size = 50*sizeof(WCHAR); size = 50*sizeof(WCHAR);
ret = heap_alloc(size); ret = heap_alloc(size);
res = RegQueryValueExW(hkey, clsidW, NULL, &type, (LPBYTE)ret, &size); res = RegQueryValueExW(hkey, L"CLSID", NULL, &type, (BYTE*)ret, &size);
RegCloseKey(hkey); RegCloseKey(hkey);
if(res != ERROR_SUCCESS) { if(res != ERROR_SUCCESS) {
WARN("Could not get CLSID: %08x\n", res); WARN("Could not get CLSID: %08x\n", res);
...@@ -1239,13 +1238,11 @@ static HRESULT WINAPI InternetBindInfo_GetBindString(IInternetBindInfo *iface, ...@@ -1239,13 +1238,11 @@ static HRESULT WINAPI InternetBindInfo_GetBindString(IInternetBindInfo *iface,
switch(ulStringType) { switch(ulStringType) {
case BINDSTRING_ACCEPT_MIMES: { case BINDSTRING_ACCEPT_MIMES: {
static const WCHAR wszMimes[] = {'*','/','*',0};
if(!ppwzStr || !pcElFetched) if(!ppwzStr || !pcElFetched)
return E_INVALIDARG; return E_INVALIDARG;
ppwzStr[0] = CoTaskMemAlloc(sizeof(wszMimes)); ppwzStr[0] = CoTaskMemAlloc(sizeof(L"*/*"));
memcpy(ppwzStr[0], wszMimes, sizeof(wszMimes)); memcpy(ppwzStr[0], L"*/*", sizeof(L"*/*"));
*pcElFetched = 1; *pcElFetched = 1;
return S_OK; return S_OK;
} }
......
...@@ -83,10 +83,6 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM ...@@ -83,10 +83,6 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
return DefWindowProcW(hwnd, msg, wParam, lParam); return DefWindowProcW(hwnd, msg, wParam, lParam);
} }
static const WCHAR wszURLMonikerNotificationWindow[] =
{'U','R','L',' ','M','o','n','i','k','e','r',' ',
'N','o','t','i','f','i','c','a','t','i','o','n',' ','W','i','n','d','o','w',0};
static ATOM notif_wnd_class; static ATOM notif_wnd_class;
static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void **context) static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void **context)
...@@ -94,7 +90,7 @@ static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void * ...@@ -94,7 +90,7 @@ static BOOL WINAPI register_notif_wnd_class(INIT_ONCE *once, void *param, void *
static WNDCLASSEXW wndclass = { static WNDCLASSEXW wndclass = {
sizeof(wndclass), 0, notif_wnd_proc, 0, 0, sizeof(wndclass), 0, notif_wnd_proc, 0, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
wszURLMonikerNotificationWindow, NULL L"URL Moniker Notification Window", NULL
}; };
wndclass.hInstance = hProxyDll; wndclass.hInstance = hProxyDll;
...@@ -128,7 +124,7 @@ HWND get_notif_hwnd(void) ...@@ -128,7 +124,7 @@ HWND get_notif_hwnd(void)
return NULL; return NULL;
tls_data->notif_hwnd = CreateWindowExW(0, MAKEINTRESOURCEW(notif_wnd_class), tls_data->notif_hwnd = CreateWindowExW(0, MAKEINTRESOURCEW(notif_wnd_class),
wszURLMonikerNotificationWindow, 0, 0, 0, 0, 0, HWND_MESSAGE, L"URL Moniker Notification Window", 0, 0, 0, 0, 0, HWND_MESSAGE,
NULL, hProxyDll, NULL); NULL, hProxyDll, NULL);
if(tls_data->notif_hwnd) if(tls_data->notif_hwnd)
tls_data->notif_hwnd_cnt++; tls_data->notif_hwnd_cnt++;
......
...@@ -264,7 +264,6 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -264,7 +264,6 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
DWORD grfBINDF = 0; DWORD grfBINDF = 0;
DWORD scheme, size; DWORD scheme, size;
LPWSTR mime = NULL; LPWSTR mime = NULL;
WCHAR null_char = 0;
BSTR ext; BSTR ext;
HRESULT hres; HRESULT hres;
...@@ -301,7 +300,7 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr ...@@ -301,7 +300,7 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
return S_OK; return S_OK;
} }
IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char); IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, L"");
size = 0; size = 0;
hres = CoInternetParseIUri(pUri, PARSE_PATH_FROM_URL, 0, path, ARRAY_SIZE(path), &size, 0); hres = CoInternetParseIUri(pUri, PARSE_PATH_FROM_URL, 0, path, ARRAY_SIZE(path), &size, 0);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static WCHAR wszEnumFORMATETC[] = {'_','E','n','u','m','F','O','R','M','A','T','E','T','C','_',0}; static WCHAR wszEnumFORMATETC[] = L"_EnumFORMATETC_";
typedef struct { typedef struct {
IEnumFORMATETC IEnumFORMATETC_iface; IEnumFORMATETC IEnumFORMATETC_iface;
......
...@@ -65,8 +65,7 @@ static inline HttpProtocol *impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface) ...@@ -65,8 +65,7 @@ static inline HttpProtocol *impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
return CONTAINING_RECORD(iface, HttpProtocol, IWinInetHttpInfo_iface); return CONTAINING_RECORD(iface, HttpProtocol, IWinInetHttpInfo_iface);
} }
static const WCHAR default_headersW[] = { static const WCHAR default_headersW[] = L"Accept-Encoding: gzip, deflate";
'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0};
static LPWSTR query_http_info(HttpProtocol *This, DWORD option) static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
{ {
...@@ -512,9 +511,6 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot) ...@@ -512,9 +511,6 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot)
BOOL res; BOOL res;
HRESULT hres; HRESULT hres;
static const WCHAR wszDefaultContentType[] =
{'t','e','x','t','/','h','t','m','l',0};
if(!This->http_negotiate) { if(!This->http_negotiate) {
WARN("Expected IHttpNegotiate pointer to be non-NULL\n"); WARN("Expected IHttpNegotiate pointer to be non-NULL\n");
return S_OK; return S_OK;
...@@ -572,8 +568,7 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot) ...@@ -572,8 +568,7 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot)
WARN("HttpQueryInfo failed: %d\n", GetLastError()); WARN("HttpQueryInfo failed: %d\n", GetLastError());
IInternetProtocolSink_ReportProgress(This->base.protocol_sink, IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
(This->base.bindf & BINDF_FROMURLMON) (This->base.bindf & BINDF_FROMURLMON)
? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE, ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE, L"text/html");
wszDefaultContentType);
} }
content_length = query_http_info(This, HTTP_QUERY_CONTENT_LENGTH); content_length = query_http_info(This, HTTP_QUERY_CONTENT_LENGTH);
......
...@@ -26,11 +26,7 @@ ...@@ -26,11 +26,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static const WCHAR feature_control_keyW[] = static const WCHAR feature_control_keyW[] =
{'S','o','f','t','w','a','r','e','\\', L"Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl";
'M','i','c','r','o','s','o','f','t','\\',
'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','\\',
'M','a','i','n','\\',
'F','e','a','t','u','r','e','C','o','n','t','r','o','l',0};
static CRITICAL_SECTION process_features_cs; static CRITICAL_SECTION process_features_cs;
static CRITICAL_SECTION_DEBUG process_features_cs_dbg = static CRITICAL_SECTION_DEBUG process_features_cs_dbg =
...@@ -489,8 +485,6 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC ...@@ -489,8 +485,6 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC
HKEY feature; HKEY feature;
DWORD res; DWORD res;
static const WCHAR wildcardW[] = {'*',0};
res = RegOpenKeyW(feature_control, feature_name, &feature); res = RegOpenKeyW(feature_control, feature_name, &feature);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return FALSE; return FALSE;
...@@ -499,7 +493,7 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC ...@@ -499,7 +493,7 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC
res = RegQueryValueExW(feature, process_name, NULL, &type, (BYTE*)&value, &size); res = RegQueryValueExW(feature, process_name, NULL, &type, (BYTE*)&value, &size);
if(res != ERROR_SUCCESS || type != REG_DWORD) { if(res != ERROR_SUCCESS || type != REG_DWORD) {
size = sizeof(DWORD); size = sizeof(DWORD);
res = RegQueryValueExW(feature, wildcardW, NULL, &type, (BYTE*)&value, &size); res = RegQueryValueExW(feature, L"*", NULL, &type, (BYTE*)&value, &size);
} }
RegCloseKey(feature); RegCloseKey(feature);
...@@ -507,7 +501,7 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC ...@@ -507,7 +501,7 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC
return FALSE; return FALSE;
if(type != REG_DWORD) { if(type != REG_DWORD) {
WARN("Unexpected registry value type %d (expected REG_DWORD) for %s\n", type, debugstr_w(wildcardW)); WARN("Unexpected registry value type %d (expected REG_DWORD) for %s\n", type, debugstr_w(L"*"));
return FALSE; return FALSE;
} }
......
...@@ -428,14 +428,12 @@ HRESULT find_mime_from_ext(const WCHAR *ext, WCHAR **ret) ...@@ -428,14 +428,12 @@ HRESULT find_mime_from_ext(const WCHAR *ext, WCHAR **ret)
WCHAR mime[64]; WCHAR mime[64];
HKEY hkey; HKEY hkey;
static const WCHAR content_typeW[] = {'C','o','n','t','e','n','t',' ','T','y','p','e','\0'};
res = RegOpenKeyW(HKEY_CLASSES_ROOT, ext, &hkey); res = RegOpenKeyW(HKEY_CLASSES_ROOT, ext, &hkey);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res); return HRESULT_FROM_WIN32(res);
size = sizeof(mime); size = sizeof(mime);
res = RegQueryValueExW(hkey, content_typeW, NULL, NULL, (LPBYTE)mime, &size); res = RegQueryValueExW(hkey, L"Content Type", NULL, NULL, (BYTE*)mime, &size);
RegCloseKey(hkey); RegCloseKey(hkey);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res); return HRESULT_FROM_WIN32(res);
...@@ -482,9 +480,8 @@ static HRESULT find_mime_from_url(const WCHAR *url, WCHAR **ret) ...@@ -482,9 +480,8 @@ static HRESULT find_mime_from_url(const WCHAR *url, WCHAR **ret)
return hres; return hres;
} }
static const WCHAR text_plainW[] = {'t','e','x','t','/','p','l','a','i','n','\0'}; static const WCHAR text_plainW[] = L"text/plain";
static const WCHAR app_octetstreamW[] = {'a','p','p','l','i','c','a','t','i','o','n','/', static const WCHAR app_octetstreamW[] = L"application/octet-stream";
'o','c','t','e','t','-','s','t','r','e','a','m','\0'};
static const struct { static const struct {
const WCHAR *mime; const WCHAR *mime;
......
...@@ -33,35 +33,12 @@ ...@@ -33,35 +33,12 @@
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(urlmon); WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static const WCHAR wszZonesKey[] =
static const WCHAR currentlevelW[] = {'C','u','r','r','e','n','t','L','e','v','e','l',0}; L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\";
static const WCHAR descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR zone_map_keyW[] =
static const WCHAR displaynameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap";
static const WCHAR fileW[] = {'f','i','l','e',0}; static const WCHAR wszZoneMapDomainsKey[] =
static const WCHAR flagsW[] = {'F','l','a','g','s',0}; L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains";
static const WCHAR iconW[] = {'I','c','o','n',0};
static const WCHAR minlevelW[] = {'M','i','n','L','e','v','e','l',0};
static const WCHAR recommendedlevelW[] = {'R','e','c','o','m','m','e','n','d','e','d',
'L','e','v','e','l',0};
static const WCHAR wszZonesKey[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
'Z','o','n','e','s','\\',0};
static const WCHAR zone_map_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
'Z','o','n','e','M','a','p',0};
static const WCHAR wszZoneMapDomainsKey[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
'Z','o','n','e','M','a','p','\\',
'D','o','m','a','i','n','s',0};
static inline BOOL is_drive_path(const WCHAR *path) static inline BOOL is_drive_path(const WCHAR *path)
{ {
...@@ -135,13 +112,7 @@ static HRESULT get_zone_from_reg(LPCWSTR schema, DWORD *zone) ...@@ -135,13 +112,7 @@ static HRESULT get_zone_from_reg(LPCWSTR schema, DWORD *zone)
HKEY hkey; HKEY hkey;
static const WCHAR wszZoneMapProtocolKey[] = static const WCHAR wszZoneMapProtocolKey[] =
{'S','o','f','t','w','a','r','e','\\', L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\ProtocolDefaults";
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s','\\',
'Z','o','n','e','M','a','p','\\',
'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey); res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey);
if(res != ERROR_SUCCESS) { if(res != ERROR_SUCCESS) {
...@@ -262,8 +233,6 @@ static BOOL matches_domain_pattern(LPCWSTR pattern, LPCWSTR str, BOOL implicit_w ...@@ -262,8 +233,6 @@ static BOOL matches_domain_pattern(LPCWSTR pattern, LPCWSTR str, BOOL implicit_w
static BOOL get_zone_for_scheme(HKEY key, LPCWSTR schema, DWORD *zone) static BOOL get_zone_for_scheme(HKEY key, LPCWSTR schema, DWORD *zone)
{ {
static const WCHAR wildcardW[] = {'*',0};
DWORD res; DWORD res;
DWORD size = sizeof(DWORD); DWORD size = sizeof(DWORD);
DWORD type; DWORD type;
...@@ -278,12 +247,12 @@ static BOOL get_zone_for_scheme(HKEY key, LPCWSTR schema, DWORD *zone) ...@@ -278,12 +247,12 @@ static BOOL get_zone_for_scheme(HKEY key, LPCWSTR schema, DWORD *zone)
/* Try to get the zone for the wildcard scheme. */ /* Try to get the zone for the wildcard scheme. */
size = sizeof(DWORD); size = sizeof(DWORD);
res = RegQueryValueExW(key, wildcardW, NULL, &type, (BYTE*)zone, &size); res = RegQueryValueExW(key, L"*", NULL, &type, (BYTE*)zone, &size);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return FALSE; return FALSE;
if(type != REG_DWORD) { if(type != REG_DWORD) {
WARN("Unexpected value type %d for value %s, expected REG_DWORD\n", type, debugstr_w(wildcardW)); WARN("Unexpected value type %d for value %s, expected REG_DWORD\n", type, debugstr_w(L"*"));
return FALSE; return FALSE;
} }
...@@ -528,7 +497,7 @@ static HRESULT map_security_uri_to_zone(IUri *uri, DWORD *zone) ...@@ -528,7 +497,7 @@ static HRESULT map_security_uri_to_zone(IUri *uri, DWORD *zone)
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
if(!wcsicmp(scheme, fileW)) { if(!wcsicmp(scheme, L"file")) {
BSTR path; BSTR path;
WCHAR *ptr, *path_start, root[20]; WCHAR *ptr, *path_start, root[20];
...@@ -639,12 +608,10 @@ static HRESULT map_uri_to_zone(IUri *uri, DWORD *zone, IUri **ret_uri) ...@@ -639,12 +608,10 @@ static HRESULT map_uri_to_zone(IUri *uri, DWORD *zone, IUri **ret_uri)
static HRESULT open_zone_key(HKEY parent_key, DWORD zone, HKEY *hkey) static HRESULT open_zone_key(HKEY parent_key, DWORD zone, HKEY *hkey)
{ {
static const WCHAR wszFormat[] = {'%','s','%','u',0};
WCHAR key_name[ARRAY_SIZE(wszZonesKey) + 12]; WCHAR key_name[ARRAY_SIZE(wszZonesKey) + 12];
DWORD res; DWORD res;
wsprintfW(key_name, wszFormat, wszZonesKey, zone); wsprintfW(key_name, L"%s%u", wszZonesKey, zone);
res = RegOpenKeyW(parent_key, key_name, hkey); res = RegOpenKeyW(parent_key, key_name, hkey);
...@@ -688,9 +655,7 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s ...@@ -688,9 +655,7 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s
WCHAR action_str[16]; WCHAR action_str[16];
DWORD len = size; DWORD len = size;
static const WCHAR formatW[] = {'%','X',0}; wsprintfW(action_str, L"%X", action);
wsprintfW(action_str, formatW, action);
res = RegQueryValueExW(hkey, action_str, NULL, NULL, policy, &len); res = RegQueryValueExW(hkey, action_str, NULL, NULL, policy, &len);
if(res == ERROR_MORE_DATA) { if(res == ERROR_MORE_DATA) {
...@@ -1425,13 +1390,13 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManagerEx2* ifa ...@@ -1425,13 +1390,13 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManagerEx2* ifa
if (FAILED(hr)) if (FAILED(hr))
TRACE("Zone %d not in HKLM\n", dwZone); TRACE("Zone %d not in HKLM\n", dwZone);
get_string_from_reg(hcu, hklm, displaynameW, pZoneAttributes->szDisplayName, MAX_ZONE_PATH); get_string_from_reg(hcu, hklm, L"DisplayName", pZoneAttributes->szDisplayName, MAX_ZONE_PATH);
get_string_from_reg(hcu, hklm, descriptionW, pZoneAttributes->szDescription, MAX_ZONE_DESCRIPTION); get_string_from_reg(hcu, hklm, L"Description", pZoneAttributes->szDescription, MAX_ZONE_DESCRIPTION);
get_string_from_reg(hcu, hklm, iconW, pZoneAttributes->szIconPath, MAX_ZONE_PATH); get_string_from_reg(hcu, hklm, L"Icon", pZoneAttributes->szIconPath, MAX_ZONE_PATH);
get_dword_from_reg(hcu, hklm, minlevelW, &pZoneAttributes->dwTemplateMinLevel); get_dword_from_reg(hcu, hklm, L"MinLevel", &pZoneAttributes->dwTemplateMinLevel);
get_dword_from_reg(hcu, hklm, currentlevelW, &pZoneAttributes->dwTemplateCurrentLevel); get_dword_from_reg(hcu, hklm, L"CurrentLevel", &pZoneAttributes->dwTemplateCurrentLevel);
get_dword_from_reg(hcu, hklm, recommendedlevelW, &pZoneAttributes->dwTemplateRecommended); get_dword_from_reg(hcu, hklm, L"RecommendedLevel", &pZoneAttributes->dwTemplateRecommended);
get_dword_from_reg(hcu, hklm, flagsW, &pZoneAttributes->dwFlags); get_dword_from_reg(hcu, hklm, L"Flags", &pZoneAttributes->dwFlags);
RegCloseKey(hklm); RegCloseKey(hklm);
RegCloseKey(hcu); RegCloseKey(hcu);
...@@ -1459,25 +1424,25 @@ static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManagerEx2* ifa ...@@ -1459,25 +1424,25 @@ static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManagerEx2* ifa
return S_OK; /* IE6 returned E_FAIL here */ return S_OK; /* IE6 returned E_FAIL here */
/* cbSize is ignored */ /* cbSize is ignored */
RegSetValueExW(hcu, displaynameW, 0, REG_SZ, (LPBYTE) pZoneAttributes->szDisplayName, RegSetValueExW(hcu, L"DisplayName", 0, REG_SZ, (BYTE*)pZoneAttributes->szDisplayName,
(lstrlenW(pZoneAttributes->szDisplayName)+1)* sizeof(WCHAR)); (lstrlenW(pZoneAttributes->szDisplayName)+1)* sizeof(WCHAR));
RegSetValueExW(hcu, descriptionW, 0, REG_SZ, (LPBYTE) pZoneAttributes->szDescription, RegSetValueExW(hcu, L"Description", 0, REG_SZ, (BYTE*)pZoneAttributes->szDescription,
(lstrlenW(pZoneAttributes->szDescription)+1)* sizeof(WCHAR)); (lstrlenW(pZoneAttributes->szDescription)+1)* sizeof(WCHAR));
RegSetValueExW(hcu, iconW, 0, REG_SZ, (LPBYTE) pZoneAttributes->szIconPath, RegSetValueExW(hcu, L"Icon", 0, REG_SZ, (BYTE*)pZoneAttributes->szIconPath,
(lstrlenW(pZoneAttributes->szIconPath)+1)* sizeof(WCHAR)); (lstrlenW(pZoneAttributes->szIconPath)+1)* sizeof(WCHAR));
RegSetValueExW(hcu, minlevelW, 0, REG_DWORD, RegSetValueExW(hcu, L"MinLevel", 0, REG_DWORD,
(const BYTE*) &pZoneAttributes->dwTemplateMinLevel, sizeof(DWORD)); (const BYTE*) &pZoneAttributes->dwTemplateMinLevel, sizeof(DWORD));
RegSetValueExW(hcu, currentlevelW, 0, REG_DWORD, RegSetValueExW(hcu, L"CurrentLevel", 0, REG_DWORD,
(const BYTE*) &pZoneAttributes->dwTemplateCurrentLevel, sizeof(DWORD)); (const BYTE*) &pZoneAttributes->dwTemplateCurrentLevel, sizeof(DWORD));
RegSetValueExW(hcu, recommendedlevelW, 0, REG_DWORD, RegSetValueExW(hcu, L"RecommendedLevel", 0, REG_DWORD,
(const BYTE*) &pZoneAttributes->dwTemplateRecommended, sizeof(DWORD)); (const BYTE*) &pZoneAttributes->dwTemplateRecommended, sizeof(DWORD));
RegSetValueExW(hcu, flagsW, 0, REG_DWORD, (const BYTE*) &pZoneAttributes->dwFlags, sizeof(DWORD)); RegSetValueExW(hcu, L"Flags", 0, REG_DWORD, (const BYTE*) &pZoneAttributes->dwFlags, sizeof(DWORD));
RegCloseKey(hcu); RegCloseKey(hcu);
return S_OK; return S_OK;
...@@ -2048,7 +2013,7 @@ HRESULT WINAPI CoInternetGetSecurityUrlEx(IUri *pUri, IUri **ppSecUri, PSUACTION ...@@ -2048,7 +2013,7 @@ HRESULT WINAPI CoInternetGetSecurityUrlEx(IUri *pUri, IUri **ppSecUri, PSUACTION
const WCHAR *tmp = ret_url; const WCHAR *tmp = ret_url;
/* Check and see if a "//" is after the scheme name. */ /* Check and see if a "//" is after the scheme name. */
tmp += ARRAY_SIZE(fileW); tmp += ARRAY_SIZE(L"file");
if(*tmp != '/' || *(tmp+1) != '/') if(*tmp != '/' || *(tmp+1) != '/')
hres = E_INVALIDARG; hres = E_INVALIDARG;
} }
...@@ -2083,11 +2048,9 @@ BOOL WINAPI IsInternetESCEnabledLocal(void) ...@@ -2083,11 +2048,9 @@ BOOL WINAPI IsInternetESCEnabledLocal(void)
DWORD type, size, val; DWORD type, size, val;
HKEY zone_map; HKEY zone_map;
static const WCHAR iehardenW[] = {'I','E','H','a','r','d','e','n',0};
if(RegOpenKeyExW(HKEY_CURRENT_USER, zone_map_keyW, 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) { if(RegOpenKeyExW(HKEY_CURRENT_USER, zone_map_keyW, 0, KEY_QUERY_VALUE, &zone_map) == ERROR_SUCCESS) {
size = sizeof(DWORD); size = sizeof(DWORD);
if(RegQueryValueExW(zone_map, iehardenW, NULL, &type, (BYTE*)&val, &size) == ERROR_SUCCESS) if(RegQueryValueExW(zone_map, L"IEHarden", NULL, &type, (BYTE*)&val, &size) == ERROR_SUCCESS)
esc_enabled = type == REG_DWORD && val != 0; esc_enabled = type == REG_DWORD && val != 0;
RegCloseKey(zone_map); RegCloseKey(zone_map);
} }
......
...@@ -52,13 +52,6 @@ static CRITICAL_SECTION_DEBUG session_cs_dbg = ...@@ -52,13 +52,6 @@ static CRITICAL_SECTION_DEBUG session_cs_dbg =
}; };
static CRITICAL_SECTION session_cs = { &session_cs_dbg, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION session_cs = { &session_cs_dbg, -1, 0, 0, 0, 0 };
static const WCHAR internet_settings_keyW[] =
{'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t',
'\\','W','i','n','d','o','w','s',
'\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n',
'\\','I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s',0};
static name_space *find_name_space(LPCWSTR protocol) static name_space *find_name_space(LPCWSTR protocol)
{ {
name_space *iter; name_space *iter;
...@@ -82,7 +75,6 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, ...@@ -82,7 +75,6 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
static const WCHAR wszProtocolsKey[] = static const WCHAR wszProtocolsKey[] =
{'P','R','O','T','O','C','O','L','S','\\','H','a','n','d','l','e','r','\\'}; {'P','R','O','T','O','C','O','L','S','\\','H','a','n','d','l','e','r','\\'};
static const WCHAR wszCLSID[] = {'C','L','S','I','D',0};
wszKey = heap_alloc(sizeof(wszProtocolsKey)+(schema_len+1)*sizeof(WCHAR)); wszKey = heap_alloc(sizeof(wszProtocolsKey)+(schema_len+1)*sizeof(WCHAR));
memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey)); memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey));
...@@ -96,7 +88,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid, ...@@ -96,7 +88,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
} }
size = sizeof(str_clsid); size = sizeof(str_clsid);
res = RegQueryValueExW(hkey, wszCLSID, NULL, &type, (LPBYTE)str_clsid, &size); res = RegQueryValueExW(hkey, L"CLSID", NULL, &type, (BYTE*)str_clsid, &size);
RegCloseKey(hkey); RegCloseKey(hkey);
if(res != ERROR_SUCCESS || type != REG_SZ) { if(res != ERROR_SUCCESS || type != REG_SZ) {
WARN("Could not get protocol CLSID res=%d\n", res); WARN("Could not get protocol CLSID res=%d\n", res);
...@@ -249,10 +241,6 @@ HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret) ...@@ -249,10 +241,6 @@ HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret)
IInternetProtocol *get_mime_filter(LPCWSTR mime) IInternetProtocol *get_mime_filter(LPCWSTR mime)
{ {
static const WCHAR filtersW[] = {'P','r','o','t','o','c','o','l','s',
'\\','F','i','l','t','e','r',0 };
static const WCHAR CLSIDW[] = {'C','L','S','I','D',0};
IClassFactory *cf = NULL; IClassFactory *cf = NULL;
IInternetProtocol *ret; IInternetProtocol *ret;
mime_filter *iter; mime_filter *iter;
...@@ -283,7 +271,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime) ...@@ -283,7 +271,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime)
return ret; return ret;
} }
res = RegOpenKeyW(HKEY_CLASSES_ROOT, filtersW, &hlist); res = RegOpenKeyW(HKEY_CLASSES_ROOT, L"Protocols\\Filter", &hlist);
if(res != ERROR_SUCCESS) { if(res != ERROR_SUCCESS) {
TRACE("Could not open MIME filters key\n"); TRACE("Could not open MIME filters key\n");
return NULL; return NULL;
...@@ -295,7 +283,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime) ...@@ -295,7 +283,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime)
return NULL; return NULL;
size = sizeof(clsidw); size = sizeof(clsidw);
res = RegQueryValueExW(hfilter, CLSIDW, NULL, &type, (LPBYTE)clsidw, &size); res = RegQueryValueExW(hfilter, L"CLSID", NULL, &type, (BYTE*)clsidw, &size);
CloseHandle(hfilter); CloseHandle(hfilter);
if(res!=ERROR_SUCCESS || type!=REG_SZ) { if(res!=ERROR_SUCCESS || type!=REG_SZ) {
WARN("Could not get filter CLSID for %s\n", debugstr_w(mime)); WARN("Could not get filter CLSID for %s\n", debugstr_w(mime));
...@@ -505,13 +493,11 @@ static BOOL get_url_encoding(HKEY root, DWORD *encoding) ...@@ -505,13 +493,11 @@ static BOOL get_url_encoding(HKEY root, DWORD *encoding)
DWORD size = sizeof(DWORD), res, type; DWORD size = sizeof(DWORD), res, type;
HKEY hkey; HKEY hkey;
static const WCHAR wszUrlEncoding[] = {'U','r','l','E','n','c','o','d','i','n','g',0}; res = RegOpenKeyW(root, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", &hkey);
res = RegOpenKeyW(root, internet_settings_keyW, &hkey);
if(res != ERROR_SUCCESS) if(res != ERROR_SUCCESS)
return FALSE; return FALSE;
res = RegQueryValueExW(hkey, wszUrlEncoding, NULL, &type, (LPBYTE)encoding, &size); res = RegQueryValueExW(hkey, L"UrlEncoding", NULL, &type, (BYTE*)encoding, &size);
RegCloseKey(hkey); RegCloseKey(hkey);
return res == ERROR_SUCCESS; return res == ERROR_SUCCESS;
...@@ -529,39 +515,21 @@ static void ensure_useragent(void) ...@@ -529,39 +515,21 @@ static void ensure_useragent(void)
BOOL is_wow; BOOL is_wow;
HKEY key; HKEY key;
static const WCHAR formatW[] =
{'M','o','z','i','l','l','a','/','4','.','0',
' ','(','c','o','m','p','a','t','i','b','l','e',';',
' ','M','S','I','E',' ','8','.','0',';',
' ','W','i','n','d','o','w','s',' ','%','s','%','d','.','%','d',';',
' ','%','s','T','r','i','d','e','n','t','/','5','.','0',0};
static const WCHAR post_platform_keyW[] =
{'S','O','F','T','W','A','R','E',
'\\','M','i','c','r','o','s','o','f','t',
'\\','W','i','n','d','o','w','s',
'\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n',
'\\','I','n','t','e','r','n','e','t',' ','S','e','t','t','i','n','g','s',
'\\','5','.','0','\\','U','s','e','r',' ','A','g','e','n','t',
'\\','P','o','s','t',' ','P','l','a','t','f','o','r','m',0};
static const WCHAR ntW[] = {'N','T',' ',0};
static const WCHAR win64W[] = {'W','i','n','6','4',';',' ','x','6','4',';',' ',0};
static const WCHAR wow64W[] = {'W','O','W','6','4',';',' ',0};
static const WCHAR emptyW[] = {0};
if(user_agent) if(user_agent)
return; return;
GetVersionExW(&info); GetVersionExW(&info);
is_nt = info.dwPlatformId == VER_PLATFORM_WIN32_NT ? ntW : emptyW; is_nt = info.dwPlatformId == VER_PLATFORM_WIN32_NT ? L"NT " : L"";
if(sizeof(void*) == 8) if(sizeof(void*) == 8)
os_type = win64W; os_type = L"Win64; x64; ";
else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow) else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow)
os_type = wow64W; os_type = L"WOW64; ";
else else
os_type = emptyW; os_type = L"";
swprintf(buf, ARRAY_SIZE(buf), formatW, is_nt, info.dwMajorVersion, info.dwMinorVersion, os_type); swprintf(buf, ARRAY_SIZE(buf), L"Mozilla/4.0 (compatible; MSIE 8.0; Windows %s%d.%d; %sTrident/5.0",
is_nt, info.dwMajorVersion, info.dwMinorVersion, os_type);
len = lstrlenW(buf); len = lstrlenW(buf);
size = len+40; size = len+40;
...@@ -571,7 +539,8 @@ static void ensure_useragent(void) ...@@ -571,7 +539,8 @@ static void ensure_useragent(void)
memcpy(ret, buf, len*sizeof(WCHAR)); memcpy(ret, buf, len*sizeof(WCHAR));
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, post_platform_keyW, &key); res = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
"Internet Settings\\5.0\\User Agent\\Post Platform", &key);
if(res == ERROR_SUCCESS) { if(res == ERROR_SUCCESS) {
DWORD value_len; DWORD value_len;
......
...@@ -858,10 +858,7 @@ HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPW ...@@ -858,10 +858,7 @@ HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPW
HRESULT hr; HRESULT hr;
LPWSTR ext; LPWSTR ext;
static WCHAR header[] = { static WCHAR header[] = L"HTTP/1.0 200 OK\\r\\n\\r\\n";
'H','T','T','P','/','1','.','0',' ','2','0','0',' ',
'O','K','\\','r','\\','n','\\','r','\\','n',0
};
TRACE("(%p, %s, %p, %d, %d, %p)\n", lpUnkCaller, debugstr_w(szURL), TRACE("(%p, %s, %p, %d, %d, %p)\n", lpUnkCaller, debugstr_w(szURL),
szFileName, dwBufLength, dwReserved, pBSC); szFileName, dwBufLength, dwReserved, pBSC);
...@@ -932,11 +929,10 @@ HRESULT WINAPI HlinkSimpleNavigateToString( LPCWSTR szTarget, ...@@ -932,11 +929,10 @@ HRESULT WINAPI HlinkSimpleNavigateToString( LPCWSTR szTarget,
if (grfHLNF == HLNF_OPENINNEWWINDOW) if (grfHLNF == HLNF_OPENINNEWWINDOW)
{ {
SHELLEXECUTEINFOW sei; SHELLEXECUTEINFOW sei;
static const WCHAR openW[] = { 'o', 'p', 'e', 'n', 0 };
memset(&sei, 0, sizeof(sei)); memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei); sei.cbSize = sizeof(sei);
sei.lpVerb = openW; sei.lpVerb = L"open";
sei.nShow = SW_SHOWNORMAL; sei.nShow = SW_SHOWNORMAL;
sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NO_CONSOLE; sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NO_CONSOLE;
sei.lpFile = szTarget; sei.lpFile = szTarget;
......
...@@ -699,8 +699,6 @@ static BSTR pre_process_uri(LPCWSTR uri) { ...@@ -699,8 +699,6 @@ static BSTR pre_process_uri(LPCWSTR uri) {
* address. * address.
*/ */
static DWORD ui2ipv4(WCHAR *dest, UINT address) { static DWORD ui2ipv4(WCHAR *dest, UINT address) {
static const WCHAR formatW[] =
{'%','u','.','%','u','.','%','u','.','%','u',0};
DWORD ret = 0; DWORD ret = 0;
UCHAR digits[4]; UCHAR digits[4];
...@@ -711,22 +709,21 @@ static DWORD ui2ipv4(WCHAR *dest, UINT address) { ...@@ -711,22 +709,21 @@ static DWORD ui2ipv4(WCHAR *dest, UINT address) {
if(!dest) { if(!dest) {
WCHAR tmp[16]; WCHAR tmp[16];
ret = swprintf(tmp, ARRAY_SIZE(tmp), formatW, digits[0], digits[1], digits[2], digits[3]); ret = swprintf(tmp, ARRAY_SIZE(tmp), L"%u.%u.%u.%u", digits[0], digits[1], digits[2], digits[3]);
} else } else
ret = swprintf(dest, 16, formatW, digits[0], digits[1], digits[2], digits[3]); ret = swprintf(dest, 16, L"%u.%u.%u.%u", digits[0], digits[1], digits[2], digits[3]);
return ret; return ret;
} }
static DWORD ui2str(WCHAR *dest, UINT value) { static DWORD ui2str(WCHAR *dest, UINT value) {
static const WCHAR formatW[] = {'%','u',0};
DWORD ret = 0; DWORD ret = 0;
if(!dest) { if(!dest) {
WCHAR tmp[11]; WCHAR tmp[11];
ret = swprintf(tmp, ARRAY_SIZE(tmp), formatW, value); ret = swprintf(tmp, ARRAY_SIZE(tmp), L"%u", value);
} else } else
ret = swprintf(dest, 11, formatW, value); ret = swprintf(dest, 11, L"%u", value);
return ret; return ret;
} }
...@@ -970,14 +967,11 @@ static BOOL parse_scheme_type(parse_data *data) { ...@@ -970,14 +967,11 @@ static BOOL parse_scheme_type(parse_data *data) {
* Returns TRUE if it was able to successfully parse the information. * Returns TRUE if it was able to successfully parse the information.
*/ */
static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD extras) { static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD extras) {
static const WCHAR fileW[] = {'f','i','l','e',0};
static const WCHAR wildcardW[] = {'*',0};
/* First check to see if the uri could implicitly be a file path. */ /* First check to see if the uri could implicitly be a file path. */
if(is_implicit_file_path(*ptr)) { if(is_implicit_file_path(*ptr)) {
if(flags & Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME) { if(flags & Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME) {
data->scheme = fileW; data->scheme = L"file";
data->scheme_len = lstrlenW(fileW); data->scheme_len = lstrlenW(L"file");
data->has_implicit_scheme = TRUE; data->has_implicit_scheme = TRUE;
TRACE("(%p %p %x): URI is an implicit file path.\n", ptr, data, flags); TRACE("(%p %p %x): URI is an implicit file path.\n", ptr, data, flags);
...@@ -996,8 +990,8 @@ static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD ...@@ -996,8 +990,8 @@ static BOOL parse_scheme(const WCHAR **ptr, parse_data *data, DWORD flags, DWORD
* c) an invalid URI. * c) an invalid URI.
*/ */
if(flags & Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME) { if(flags & Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME) {
data->scheme = wildcardW; data->scheme = L"*";
data->scheme_len = lstrlenW(wildcardW); data->scheme_len = lstrlenW(L"*");
data->has_implicit_scheme = TRUE; data->has_implicit_scheme = TRUE;
TRACE("(%p %p %x): URI is an implicit wildcard scheme.\n", ptr, data, flags); TRACE("(%p %p %x): URI is an implicit wildcard scheme.\n", ptr, data, flags);
...@@ -1510,7 +1504,6 @@ static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) { ...@@ -1510,7 +1504,6 @@ static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) {
/* Attempts to parse the path information of a hierarchical URI. */ /* Attempts to parse the path information of a hierarchical URI. */
static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags) { static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags) {
const WCHAR *start = *ptr; const WCHAR *start = *ptr;
static const WCHAR slash[] = {'/',0};
const BOOL is_file = data->scheme_type == URL_SCHEME_FILE; const BOOL is_file = data->scheme_type == URL_SCHEME_FILE;
if(is_path_delim(data->scheme_type, **ptr)) { if(is_path_delim(data->scheme_type, **ptr)) {
...@@ -1519,7 +1512,7 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f ...@@ -1519,7 +1512,7 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f
data->path_len = 0; data->path_len = 0;
} else if(!(flags & Uri_CREATE_NO_CANONICALIZE)) { } else if(!(flags & Uri_CREATE_NO_CANONICALIZE)) {
/* If the path component is empty, then a '/' is added. */ /* If the path component is empty, then a '/' is added. */
data->path = slash; data->path = L"/";
data->path_len = 1; data->path_len = 1;
} }
} else { } else {
...@@ -1972,14 +1965,12 @@ static BOOL canonicalize_userinfo(const parse_data *data, Uri *uri, DWORD flags, ...@@ -1972,14 +1965,12 @@ static BOOL canonicalize_userinfo(const parse_data *data, Uri *uri, DWORD flags,
*/ */
static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri, static BOOL canonicalize_reg_name(const parse_data *data, Uri *uri,
DWORD flags, BOOL computeOnly) { DWORD flags, BOOL computeOnly) {
static const WCHAR localhostW[] =
{'l','o','c','a','l','h','o','s','t',0};
const WCHAR *ptr; const WCHAR *ptr;
const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN; const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN;
if(data->scheme_type == URL_SCHEME_FILE && if(data->scheme_type == URL_SCHEME_FILE &&
data->host_len == lstrlenW(localhostW)) { data->host_len == lstrlenW(L"localhost")) {
if(!StrCmpNIW(data->host, localhostW, data->host_len)) { if(!StrCmpNIW(data->host, L"localhost", data->host_len)) {
uri->host_start = -1; uri->host_start = -1;
uri->host_len = 0; uri->host_len = 0;
uri->host_type = Uri_HOST_UNKNOWN; uri->host_type = Uri_HOST_UNKNOWN;
...@@ -3147,8 +3138,7 @@ static HRESULT validate_scheme_name(const UriBuilder *builder, parse_data *data, ...@@ -3147,8 +3138,7 @@ static HRESULT validate_scheme_name(const UriBuilder *builder, parse_data *data,
ptr = builder->uri->canon_uri+builder->uri->scheme_start; ptr = builder->uri->canon_uri+builder->uri->scheme_start;
expected_len = builder->uri->scheme_len; expected_len = builder->uri->scheme_len;
} else { } else {
static const WCHAR nullW[] = {0}; ptr = L"";
ptr = nullW;
expected_len = 0; expected_len = 0;
} }
...@@ -3317,8 +3307,7 @@ static HRESULT validate_path(const UriBuilder *builder, parse_data *data, DWORD ...@@ -3317,8 +3307,7 @@ static HRESULT validate_path(const UriBuilder *builder, parse_data *data, DWORD
ptr = builder->uri->canon_uri+builder->uri->path_start; ptr = builder->uri->canon_uri+builder->uri->path_start;
expected_len = builder->uri->path_len; expected_len = builder->uri->path_len;
} else { } else {
static const WCHAR nullW[] = {0}; ptr = L"";
ptr = nullW;
check_len = FALSE; check_len = FALSE;
expected_len = -1; expected_len = -1;
} }
...@@ -6131,8 +6120,7 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result, ...@@ -6131,8 +6120,7 @@ static HRESULT combine_uri(Uri *base, Uri *relative, DWORD flags, IUri **result,
/* Just set the path as a '/' if the base didn't have /* Just set the path as a '/' if the base didn't have
* one and if it's a hierarchical URI. * one and if it's a hierarchical URI.
*/ */
static const WCHAR slashW[] = {'/',0}; data.path = L"/";
data.path = slashW;
data.path_len = 1; data.path_len = 1;
} }
......
...@@ -453,9 +453,7 @@ static HRESULT register_inf(BOOL doregister) ...@@ -453,9 +453,7 @@ static HRESULT register_inf(BOOL doregister)
HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
HMODULE hAdvpack; HMODULE hAdvpack;
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; hAdvpack = LoadLibraryW(L"advpack.dll");
hAdvpack = LoadLibraryW(wszAdvpack);
pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall");
return pRegInstall(hProxyDll, doregister ? "RegisterDll" : "UnregisterDll", NULL); return pRegInstall(hProxyDll, doregister ? "RegisterDll" : "UnregisterDll", NULL);
......
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