Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/urlmon/axinstall.c | 37 ++++++----------
dlls/urlmon/bindctx.c | 2 +-
dlls/urlmon/binding.c | 13 +++---
dlls/urlmon/bindprot.c | 8 +---
dlls/urlmon/file.c | 3 +-
dlls/urlmon/format.c | 2 +-
dlls/urlmon/http.c | 9 +---
dlls/urlmon/internet.c | 12 ++---
dlls/urlmon/mimefilter.c | 9 ++--
dlls/urlmon/sec_mgr.c | 93 ++++++++++++---------------------------
dlls/urlmon/session.c | 57 ++++++------------------
dlls/urlmon/umon.c | 8 +---
dlls/urlmon/uri.c | 40 ++++++-----------
dlls/urlmon/urlmon_main.c | 4 +-
14 files changed, 89 insertions(+), 208 deletions(-)
diff --git a/dlls/urlmon/axinstall.c b/dlls/urlmon/axinstall.c
index 3f10902ddd2..2a8c2c45760 100644
--- a/dlls/urlmon/axinstall.c
+++ b/dlls/urlmon/axinstall.c
@@ -30,12 +30,6 @@
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 {
INSTALL_UNKNOWN,
INSTALL_DLL,
@@ -97,19 +91,19 @@ static HRESULT extract_cab_file(install_ctx_t *ctx)
/* NOTE: Assume that file_name contains ".cab" extension */
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)) {
ctx->install_type = INSTALL_INF;
return S_OK;
}
- memcpy(ptr, dllW, sizeof(dllW));
+ memcpy(ptr, L"dll", sizeof(L"dll"));
if(file_exists(ctx->install_file)) {
ctx->install_type = INSTALL_DLL;
return S_OK;
}
- memcpy(ptr, ocxW, sizeof(ocxW));
+ memcpy(ptr, L"ocx", sizeof(L"ocx"));
if(file_exists(ctx->install_file)) {
ctx->install_type = INSTALL_DLL;
return S_OK;
@@ -183,18 +177,16 @@ static HRESULT process_hook_section(install_ctx_t *ctx, const WCHAR *sect_name)
DWORD len;
HRESULT hres;
- static const WCHAR runW[] = {'r','u','n',0};
-
len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(!len)
return S_OK;
for(key = buf; *key; key += lstrlenW(key)+1) {
- if(!wcsicmp(key, runW)) {
+ if(!wcsicmp(key, L"run")) {
WCHAR *cmd;
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));
@@ -226,17 +218,14 @@ static HRESULT install_inf_file(install_ctx_t *ctx)
DWORD len;
HRESULT hres;
- static const WCHAR setup_hooksW[] = {'S','e','t','u','p',' ','H','o','o','k','s',0};
- 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);
+ len = GetPrivateProfileStringW(L"Setup Hooks", NULL, NULL, buf, ARRAY_SIZE(buf), ctx->install_file);
if(len) {
default_install = FALSE;
for(key = buf; *key; key += lstrlenW(key)+1) {
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);
if(!len) {
WARN("Could not get key value\n");
@@ -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) {
default_install = FALSE;
for(key = buf; *key; key += lstrlenW(key)+1) {
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);
if(!len) {
WARN("Could not get key value\n");
@@ -354,7 +343,7 @@ static BOOL init_warning_dialog(HWND hwnd, install_ctx_t *ctx)
BSTR display_uri;
HRESULT hres;
- if(!SetPropW(hwnd, ctxW, ctx))
+ if(!SetPropW(hwnd, L"ctx", ctx))
return FALSE;
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
case WM_COMMAND:
switch(wparam) {
case ID_AXINSTALL_INSTALL_BTN: {
- install_ctx_t *ctx = GetPropW(hwnd, ctxW);
+ install_ctx_t *ctx = GetPropW(hwnd, L"ctx");
if(ctx)
ctx->cancel = FALSE;
EndDialog(hwnd, 0);
@@ -395,7 +384,7 @@ static INT_PTR WINAPI warning_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
return FALSE;
}
case WM_TIMER:
- update_counter(GetPropW(hwnd, ctxW), hwnd);
+ update_counter(GetPropW(hwnd, L"ctx"), hwnd);
return TRUE;
}
@@ -460,7 +449,7 @@ static HRESULT install_file(install_ctx_t *ctx, const WCHAR *cache_file)
if(!ext)
ext = ptr;
- if(!wcsicmp(ext, cab_extW)) {
+ if(!wcsicmp(ext, L".cab")) {
hres = install_cab_file(ctx);
}else {
FIXME("Unsupported extension %s\n", debugstr_w(ext));
diff --git a/dlls/urlmon/bindctx.c b/dlls/urlmon/bindctx.c
index 61917518c09..406232467c3 100644
--- a/dlls/urlmon/bindctx.c
+++ b/dlls/urlmon/bindctx.c
@@ -23,7 +23,7 @@
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;
diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c
index e90d4daf346..d35052dfdf6 100644
--- a/dlls/urlmon/binding.c
+++ b/dlls/urlmon/binding.c
@@ -26,8 +26,8 @@
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 bscb_holderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
+static WCHAR cbinding_contextW[] = L"CBinding Context";
+static WCHAR bscb_holderW[] = L"_BSCB_Holder_";
typedef struct {
IUnknown IUnknown_iface;
@@ -197,7 +197,6 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid)
static const WCHAR mime_keyW[] =
{'M','I','M','E','\\','D','a','t','a','b','a','s','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;
key_name = heap_alloc(sizeof(mime_keyW) + len*sizeof(WCHAR));
@@ -213,7 +212,7 @@ static LPWSTR get_mime_clsid(LPCWSTR mime, CLSID *clsid)
size = 50*sizeof(WCHAR);
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);
if(res != ERROR_SUCCESS) {
WARN("Could not get CLSID: %08x\n", res);
@@ -1239,13 +1238,11 @@ static HRESULT WINAPI InternetBindInfo_GetBindString(IInternetBindInfo *iface,
switch(ulStringType) {
case BINDSTRING_ACCEPT_MIMES: {
- static const WCHAR wszMimes[] = {'*','/','*',0};
-
if(!ppwzStr || !pcElFetched)
return E_INVALIDARG;
- ppwzStr[0] = CoTaskMemAlloc(sizeof(wszMimes));
- memcpy(ppwzStr[0], wszMimes, sizeof(wszMimes));
+ ppwzStr[0] = CoTaskMemAlloc(sizeof(L"*/*"));
+ memcpy(ppwzStr[0], L"*/*", sizeof(L"*/*"));
*pcElFetched = 1;
return S_OK;
}
diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c
index e9c97e8a9db..2e58884b199 100644
--- a/dlls/urlmon/bindprot.c
+++ b/dlls/urlmon/bindprot.c
@@ -83,10 +83,6 @@ static LRESULT WINAPI notif_wnd_proc(HWND hwnd, UINT msg, WPARAM 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 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 *
static WNDCLASSEXW wndclass = {
sizeof(wndclass), 0, notif_wnd_proc, 0, 0,
NULL, NULL, NULL, NULL, NULL,
- wszURLMonikerNotificationWindow, NULL
+ L"URL Moniker Notification Window", NULL
};
wndclass.hInstance = hProxyDll;
@@ -128,7 +124,7 @@ HWND get_notif_hwnd(void)
return NULL;
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);
if(tls_data->notif_hwnd)
tls_data->notif_hwnd_cnt++;
diff --git a/dlls/urlmon/file.c b/dlls/urlmon/file.c
index d634085b766..f2a8d983251 100644
--- a/dlls/urlmon/file.c
+++ b/dlls/urlmon/file.c
@@ -264,7 +264,6 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
DWORD grfBINDF = 0;
DWORD scheme, size;
LPWSTR mime = NULL;
- WCHAR null_char = 0;
BSTR ext;
HRESULT hres;
@@ -301,7 +300,7 @@ static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUr
return S_OK;
}
- IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char);
+ IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, L"");
size = 0;
hres = CoInternetParseIUri(pUri, PARSE_PATH_FROM_URL, 0, path, ARRAY_SIZE(path), &size, 0);
diff --git a/dlls/urlmon/format.c b/dlls/urlmon/format.c
index 6967c3b4f39..c9e528ce35a 100644
--- a/dlls/urlmon/format.c
+++ b/dlls/urlmon/format.c
@@ -21,7 +21,7 @@
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 {
IEnumFORMATETC IEnumFORMATETC_iface;
diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index cf7a0b78231..bee226bd474 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -65,8 +65,7 @@ static inline HttpProtocol *impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
return CONTAINING_RECORD(iface, HttpProtocol, IWinInetHttpInfo_iface);
}
-static const WCHAR default_headersW[] = {
- '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 const WCHAR default_headersW[] = L"Accept-Encoding: gzip, deflate";
static LPWSTR query_http_info(HttpProtocol *This, DWORD option)
{
@@ -512,9 +511,6 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot)
BOOL res;
HRESULT hres;
- static const WCHAR wszDefaultContentType[] =
- {'t','e','x','t','/','h','t','m','l',0};
-
if(!This->http_negotiate) {
WARN("Expected IHttpNegotiate pointer to be non-NULL\n");
return S_OK;
@@ -572,8 +568,7 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot)
WARN("HttpQueryInfo failed: %d\n", GetLastError());
IInternetProtocolSink_ReportProgress(This->base.protocol_sink,
(This->base.bindf & BINDF_FROMURLMON)
- ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE,
- wszDefaultContentType);
+ ? BINDSTATUS_MIMETYPEAVAILABLE : BINDSTATUS_RAWMIMETYPE, L"text/html");
}
content_length = query_http_info(This, HTTP_QUERY_CONTENT_LENGTH);
diff --git a/dlls/urlmon/internet.c b/dlls/urlmon/internet.c
index ed95c069e22..20a11be306e 100644
--- a/dlls/urlmon/internet.c
+++ b/dlls/urlmon/internet.c
@@ -26,11 +26,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
static const WCHAR feature_control_keyW[] =
- {'S','o','f','t','w','a','r','e','\\',
- '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};
+ L"Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl";
static CRITICAL_SECTION process_features_cs;
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
HKEY feature;
DWORD res;
- static const WCHAR wildcardW[] = {'*',0};
-
res = RegOpenKeyW(feature_control, feature_name, &feature);
if(res != ERROR_SUCCESS)
return FALSE;
@@ -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);
if(res != ERROR_SUCCESS || type != REG_DWORD) {
size = sizeof(DWORD);
- res = RegQueryValueExW(feature, wildcardW, NULL, &type, (BYTE*)&value, &size);
+ res = RegQueryValueExW(feature, L"*", NULL, &type, (BYTE*)&value, &size);
}
RegCloseKey(feature);
@@ -507,7 +501,7 @@ static BOOL get_feature_from_reg(HKEY feature_control, LPCWSTR feature_name, LPC
return FALSE;
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;
}
diff --git a/dlls/urlmon/mimefilter.c b/dlls/urlmon/mimefilter.c
index 44b9e92994a..6ee0da5b119 100644
--- a/dlls/urlmon/mimefilter.c
+++ b/dlls/urlmon/mimefilter.c
@@ -428,14 +428,12 @@ HRESULT find_mime_from_ext(const WCHAR *ext, WCHAR **ret)
WCHAR mime[64];
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);
if(res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res);
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);
if(res != ERROR_SUCCESS)
return HRESULT_FROM_WIN32(res);
@@ -482,9 +480,8 @@ static HRESULT find_mime_from_url(const WCHAR *url, WCHAR **ret)
return hres;
}
-static const WCHAR text_plainW[] = {'t','e','x','t','/','p','l','a','i','n','\0'};
-static const WCHAR app_octetstreamW[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
- 'o','c','t','e','t','-','s','t','r','e','a','m','\0'};
+static const WCHAR text_plainW[] = L"text/plain";
+static const WCHAR app_octetstreamW[] = L"application/octet-stream";
static const struct {
const WCHAR *mime;
diff --git a/dlls/urlmon/sec_mgr.c b/dlls/urlmon/sec_mgr.c
index af6cf212bd4..60672930ebc 100644
--- a/dlls/urlmon/sec_mgr.c
+++ b/dlls/urlmon/sec_mgr.c
@@ -33,35 +33,12 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
-
-static const WCHAR currentlevelW[] = {'C','u','r','r','e','n','t','L','e','v','e','l',0};
-static const WCHAR descriptionW[] = {'D','e','s','c','r','i','p','t','i','o','n',0};
-static const WCHAR displaynameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
-static const WCHAR fileW[] = {'f','i','l','e',0};
-static const WCHAR flagsW[] = {'F','l','a','g','s',0};
-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 const WCHAR wszZonesKey[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\";
+static const WCHAR zone_map_keyW[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap";
+static const WCHAR wszZoneMapDomainsKey[] =
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains";
static inline BOOL is_drive_path(const WCHAR *path)
{
@@ -135,13 +112,7 @@ static HRESULT get_zone_from_reg(LPCWSTR schema, DWORD *zone)
HKEY hkey;
static const WCHAR wszZoneMapProtocolKey[] =
- {'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','\\',
- 'P','r','o','t','o','c','o','l','D','e','f','a','u','l','t','s',0};
+ L"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\ProtocolDefaults";
res = RegOpenKeyW(HKEY_CURRENT_USER, wszZoneMapProtocolKey, &hkey);
if(res != ERROR_SUCCESS) {
@@ -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 const WCHAR wildcardW[] = {'*',0};
-
DWORD res;
DWORD size = sizeof(DWORD);
DWORD type;
@@ -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. */
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)
return FALSE;
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;
}
@@ -528,7 +497,7 @@ static HRESULT map_security_uri_to_zone(IUri *uri, DWORD *zone)
if(FAILED(hres))
return hres;
- if(!wcsicmp(scheme, fileW)) {
+ if(!wcsicmp(scheme, L"file")) {
BSTR path;
WCHAR *ptr, *path_start, root[20];
@@ -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 const WCHAR wszFormat[] = {'%','s','%','u',0};
-
WCHAR key_name[ARRAY_SIZE(wszZonesKey) + 12];
DWORD res;
- wsprintfW(key_name, wszFormat, wszZonesKey, zone);
+ wsprintfW(key_name, L"%s%u", wszZonesKey, zone);
res = RegOpenKeyW(parent_key, key_name, hkey);
@@ -688,9 +655,7 @@ static HRESULT get_action_policy(DWORD zone, DWORD action, BYTE *policy, DWORD s
WCHAR action_str[16];
DWORD len = size;
- static const WCHAR formatW[] = {'%','X',0};
-
- wsprintfW(action_str, formatW, action);
+ wsprintfW(action_str, L"%X", action);
res = RegQueryValueExW(hkey, action_str, NULL, NULL, policy, &len);
if(res == ERROR_MORE_DATA) {
@@ -1425,13 +1390,13 @@ static HRESULT WINAPI ZoneMgrImpl_GetZoneAttributes(IInternetZoneManagerEx2* ifa
if (FAILED(hr))
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, descriptionW, pZoneAttributes->szDescription, MAX_ZONE_DESCRIPTION);
- get_string_from_reg(hcu, hklm, iconW, pZoneAttributes->szIconPath, MAX_ZONE_PATH);
- get_dword_from_reg(hcu, hklm, minlevelW, &pZoneAttributes->dwTemplateMinLevel);
- get_dword_from_reg(hcu, hklm, currentlevelW, &pZoneAttributes->dwTemplateCurrentLevel);
- get_dword_from_reg(hcu, hklm, recommendedlevelW, &pZoneAttributes->dwTemplateRecommended);
- get_dword_from_reg(hcu, hklm, flagsW, &pZoneAttributes->dwFlags);
+ get_string_from_reg(hcu, hklm, L"DisplayName", pZoneAttributes->szDisplayName, MAX_ZONE_PATH);
+ get_string_from_reg(hcu, hklm, L"Description", pZoneAttributes->szDescription, MAX_ZONE_DESCRIPTION);
+ get_string_from_reg(hcu, hklm, L"Icon", pZoneAttributes->szIconPath, MAX_ZONE_PATH);
+ get_dword_from_reg(hcu, hklm, L"MinLevel", &pZoneAttributes->dwTemplateMinLevel);
+ get_dword_from_reg(hcu, hklm, L"CurrentLevel", &pZoneAttributes->dwTemplateCurrentLevel);
+ get_dword_from_reg(hcu, hklm, L"RecommendedLevel", &pZoneAttributes->dwTemplateRecommended);
+ get_dword_from_reg(hcu, hklm, L"Flags", &pZoneAttributes->dwFlags);
RegCloseKey(hklm);
RegCloseKey(hcu);
@@ -1459,25 +1424,25 @@ static HRESULT WINAPI ZoneMgrImpl_SetZoneAttributes(IInternetZoneManagerEx2* ifa
return S_OK; /* IE6 returned E_FAIL here */
/* 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));
- 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));
- 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));
- RegSetValueExW(hcu, minlevelW, 0, REG_DWORD,
+ RegSetValueExW(hcu, L"MinLevel", 0, REG_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));
- RegSetValueExW(hcu, recommendedlevelW, 0, REG_DWORD,
+ RegSetValueExW(hcu, L"RecommendedLevel", 0, REG_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);
return S_OK;
@@ -2048,7 +2013,7 @@ HRESULT WINAPI CoInternetGetSecurityUrlEx(IUri *pUri, IUri **ppSecUri, PSUACTION
const WCHAR *tmp = ret_url;
/* Check and see if a "//" is after the scheme name. */
- tmp += ARRAY_SIZE(fileW);
+ tmp += ARRAY_SIZE(L"file");
if(*tmp != '/' || *(tmp+1) != '/')
hres = E_INVALIDARG;
}
@@ -2083,11 +2048,9 @@ BOOL WINAPI IsInternetESCEnabledLocal(void)
DWORD type, size, val;
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) {
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;
RegCloseKey(zone_map);
}
diff --git a/dlls/urlmon/session.c b/dlls/urlmon/session.c
index 523511d2db7..5154bdb61f8 100644
--- a/dlls/urlmon/session.c
+++ b/dlls/urlmon/session.c
@@ -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 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)
{
name_space *iter;
@@ -82,7 +75,6 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
static const WCHAR wszProtocolsKey[] =
{'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));
memcpy(wszKey, wszProtocolsKey, sizeof(wszProtocolsKey));
@@ -96,7 +88,7 @@ static HRESULT get_protocol_cf(LPCWSTR schema, DWORD schema_len, CLSID *pclsid,
}
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);
if(res != ERROR_SUCCESS || type != REG_SZ) {
WARN("Could not get protocol CLSID res=%d\n", res);
@@ -249,10 +241,6 @@ HRESULT get_protocol_handler(IUri *uri, CLSID *clsid, IClassFactory **ret)
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;
IInternetProtocol *ret;
mime_filter *iter;
@@ -283,7 +271,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime)
return ret;
}
- res = RegOpenKeyW(HKEY_CLASSES_ROOT, filtersW, &hlist);
+ res = RegOpenKeyW(HKEY_CLASSES_ROOT, L"Protocols\\Filter", &hlist);
if(res != ERROR_SUCCESS) {
TRACE("Could not open MIME filters key\n");
return NULL;
@@ -295,7 +283,7 @@ IInternetProtocol *get_mime_filter(LPCWSTR mime)
return NULL;
size = sizeof(clsidw);
- res = RegQueryValueExW(hfilter, CLSIDW, NULL, &type, (LPBYTE)clsidw, &size);
+ res = RegQueryValueExW(hfilter, L"CLSID", NULL, &type, (BYTE*)clsidw, &size);
CloseHandle(hfilter);
if(res!=ERROR_SUCCESS || type!=REG_SZ) {
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)
DWORD size = sizeof(DWORD), res, type;
HKEY hkey;
- static const WCHAR wszUrlEncoding[] = {'U','r','l','E','n','c','o','d','i','n','g',0};
-
- res = RegOpenKeyW(root, internet_settings_keyW, &hkey);
+ res = RegOpenKeyW(root, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", &hkey);
if(res != ERROR_SUCCESS)
return FALSE;
- res = RegQueryValueExW(hkey, wszUrlEncoding, NULL, &type, (LPBYTE)encoding, &size);
+ res = RegQueryValueExW(hkey, L"UrlEncoding", NULL, &type, (BYTE*)encoding, &size);
RegCloseKey(hkey);
return res == ERROR_SUCCESS;
@@ -529,39 +515,21 @@ static void ensure_useragent(void)
BOOL is_wow;
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)
return;
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)
- os_type = win64W;
+ os_type = L"Win64; x64; ";
else if(IsWow64Process(GetCurrentProcess(), &is_wow) && is_wow)
- os_type = wow64W;
+ os_type = L"WOW64; ";
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);
size = len+40;
@@ -571,7 +539,8 @@ static void ensure_useragent(void)
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) {
DWORD value_len;
diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c
index 14273efee99..e51b2f07d26 100644
--- a/dlls/urlmon/umon.c
+++ b/dlls/urlmon/umon.c
@@ -858,10 +858,7 @@ HRESULT WINAPI URLDownloadToCacheFileW(LPUNKNOWN lpUnkCaller, LPCWSTR szURL, LPW
HRESULT hr;
LPWSTR ext;
- static WCHAR header[] = {
- 'H','T','T','P','/','1','.','0',' ','2','0','0',' ',
- 'O','K','\\','r','\\','n','\\','r','\\','n',0
- };
+ static WCHAR header[] = L"HTTP/1.0 200 OK\\r\\n\\r\\n";
TRACE("(%p, %s, %p, %d, %d, %p)\n", lpUnkCaller, debugstr_w(szURL),
szFileName, dwBufLength, dwReserved, pBSC);
@@ -932,11 +929,10 @@ HRESULT WINAPI HlinkSimpleNavigateToString( LPCWSTR szTarget,
if (grfHLNF == HLNF_OPENINNEWWINDOW)
{
SHELLEXECUTEINFOW sei;
- static const WCHAR openW[] = { 'o', 'p', 'e', 'n', 0 };
memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei);
- sei.lpVerb = openW;
+ sei.lpVerb = L"open";
sei.nShow = SW_SHOWNORMAL;
sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NO_CONSOLE;
sei.lpFile = szTarget;
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index cf901dfd8b7..91247b689b8 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -699,8 +699,6 @@ static BSTR pre_process_uri(LPCWSTR uri) {
* address.
*/
static DWORD ui2ipv4(WCHAR *dest, UINT address) {
- static const WCHAR formatW[] =
- {'%','u','.','%','u','.','%','u','.','%','u',0};
DWORD ret = 0;
UCHAR digits[4];
@@ -711,22 +709,21 @@ static DWORD ui2ipv4(WCHAR *dest, UINT address) {
if(!dest) {
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
- 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;
}
static DWORD ui2str(WCHAR *dest, UINT value) {
- static const WCHAR formatW[] = {'%','u',0};
DWORD ret = 0;
if(!dest) {
WCHAR tmp[11];
- ret = swprintf(tmp, ARRAY_SIZE(tmp), formatW, value);
+ ret = swprintf(tmp, ARRAY_SIZE(tmp), L"%u", value);
} else
- ret = swprintf(dest, 11, formatW, value);
+ ret = swprintf(dest, 11, L"%u", value);
return ret;
}
@@ -970,14 +967,11 @@ static BOOL parse_scheme_type(parse_data *data) {
* 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 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. */
if(is_implicit_file_path(*ptr)) {
if(flags & Uri_CREATE_ALLOW_IMPLICIT_FILE_SCHEME) {
- data->scheme = fileW;
- data->scheme_len = lstrlenW(fileW);
+ data->scheme = L"file";
+ data->scheme_len = lstrlenW(L"file");
data->has_implicit_scheme = TRUE;
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
* c) an invalid URI.
*/
if(flags & Uri_CREATE_ALLOW_IMPLICIT_WILDCARD_SCHEME) {
- data->scheme = wildcardW;
- data->scheme_len = lstrlenW(wildcardW);
+ data->scheme = L"*";
+ data->scheme_len = lstrlenW(L"*");
data->has_implicit_scheme = TRUE;
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) {
/* Attempts to parse the path information of a hierarchical URI. */
static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags) {
const WCHAR *start = *ptr;
- static const WCHAR slash[] = {'/',0};
const BOOL is_file = data->scheme_type == URL_SCHEME_FILE;
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
data->path_len = 0;
} else if(!(flags & Uri_CREATE_NO_CANONICALIZE)) {
/* If the path component is empty, then a '/' is added. */
- data->path = slash;
+ data->path = L"/";
data->path_len = 1;
}
} else {
@@ -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,
DWORD flags, BOOL computeOnly) {
- static const WCHAR localhostW[] =
- {'l','o','c','a','l','h','o','s','t',0};
const WCHAR *ptr;
const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN;
if(data->scheme_type == URL_SCHEME_FILE &&
- data->host_len == lstrlenW(localhostW)) {
- if(!StrCmpNIW(data->host, localhostW, data->host_len)) {
+ data->host_len == lstrlenW(L"localhost")) {
+ if(!StrCmpNIW(data->host, L"localhost", data->host_len)) {
uri->host_start = -1;
uri->host_len = 0;
uri->host_type = Uri_HOST_UNKNOWN;
@@ -3147,8 +3138,7 @@ static HRESULT validate_scheme_name(const UriBuilder *builder, parse_data *data,
ptr = builder->uri->canon_uri+builder->uri->scheme_start;
expected_len = builder->uri->scheme_len;
} else {
- static const WCHAR nullW[] = {0};
- ptr = nullW;
+ ptr = L"";
expected_len = 0;
}
@@ -3317,8 +3307,7 @@ static HRESULT validate_path(const UriBuilder *builder, parse_data *data, DWORD
ptr = builder->uri->canon_uri+builder->uri->path_start;
expected_len = builder->uri->path_len;
} else {
- static const WCHAR nullW[] = {0};
- ptr = nullW;
+ ptr = L"";
check_len = FALSE;
expected_len = -1;
}
@@ -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
* one and if it's a hierarchical URI.
*/
- static const WCHAR slashW[] = {'/',0};
- data.path = slashW;
+ data.path = L"/";
data.path_len = 1;
}
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c
index 5d598830fdf..1af4d38ac81 100644
--- a/dlls/urlmon/urlmon_main.c
+++ b/dlls/urlmon/urlmon_main.c
@@ -453,9 +453,7 @@ static HRESULT register_inf(BOOL doregister)
HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
HMODULE hAdvpack;
- static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
-
- hAdvpack = LoadLibraryW(wszAdvpack);
+ hAdvpack = LoadLibraryW(L"advpack.dll");
pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall");
return pRegInstall(hProxyDll, doregister ? "RegisterDll" : "UnregisterDll", NULL);
--
2.26.2